Previous 15994 Revisions Next

r1772 Thursday 28th February, 2008 at 14:10:25 UTC by Nathan Woods
Updated to MAME 0.123u3 code (plus some recent mc6845 updates)
[ROOT]makefile
[docs]messnew.txt
[src/build]build.mak verinfo.c
[src/emu]attotime.h audit.c clifront.c cpuexec.c cpuexec.h cpuintrf.c drawgfx.c driver.h info.c inptport.c inptport.h mame.c mconfig.c mconfig.h sound.c sound.h timer.h tokenize.h* ui.c validity.c video.c
[src/emu/cpu]cpu.mak
[src/emu/cpu/upd7810]7810dasm.c 7810ops.c 7810tbl.c upd7810.c upd7810.h
[src/emu/drivers]xtal.h
[src/emu/machine]6850acia.c z80pio.c
[src/emu/video]generic.c generic.h mc6845.c mc6845.h s2636.c s2636.h
[src/mame]mame.mak mamedriv.c
[src/mame/audio]n8080.c redalert.c
[src/mame/drivers]1945kiii.c 20pacgal.c 4enraya.c 88games.c ace.c acefruit.c acommand.c actfancr.c aeroboto.c aerofgt.c airbustr.c ajax.c aliens.c alpha68k.c ambush.c ampoker2.c amspdwy.c angelkds.c appoooh.c ashnojoe.c asterix.c asteroid.c astinvad.c astrocde.c asuka.c atarifb.c aztarac.c backfire.c bionicc.c bwidow.c bzone.c calomega.c* calorie.c cave.c cchasm.c cclimber.c cinemat.c citycon.c cps2.c dacholer.c dblewing.c deco156.c dkong.c dlair.c dominob.c dunhuang.c enigma2.c expro02.c fantland.c frogger.c funworld.c gaelco3d.c gaiden.c galpanic.c gameplan.c gpworld.c hanaroku.c hyperspt.c jedi.c laserbat.c lockon.c looping.c madalien.c mcatadv.c megasys1.c mhavoc.c mirage.c missb2.c mpu4drvr.c mw8080bw.c namcos2.c namcos21.c naomi.c neodrvr.c neogeo.c nss.c nyny.c ohmygod.c olibochu.c omegrace.c pacland.c pgm.c psychic5.c pturn.c quantum.c r2dtank.c sandscrp.c sbowling.c segag80v.c spiders.c sprint4.c ssingles.c stactics.c starwars.c suprnova.c taito_l.c tempest.c tmnt.c ultratnk.c vertigo.c vicdual.c warpwarp.c wilytowr.c xtheball.c xxmissio.c zaxxon.c
[src/mame/includes]20pacgal.h cclimber.h dkong.h namcos2.h qix.h stactics.h* taitoipt.h
[src/mame/layout]stactics.lay*
[src/mame/machine]ajax.c cps2crpt.c irem_cpu.c namcos2.c pcshare.c qix.c
[src/mame/video]1942.c 1943.c 20pacgal.c aeroboto.c ambush.c amspdwy.c appoooh.c arkanoid.c armedf.c bagman.c bankp.c baraduke.c battlane.c battlex.c bionicc.c bking.c blktiger.c blueprnt.c bogeyman.c bombjack.c boogwing.c bosco.c btime.c bublbobl.c buggychl.c cabal.c calomega.c* cave.c cbasebal.c cbuster.c cclimber.c champbas.c changela.c cheekyms.c chqflag.c circus.c circusc.c cischeat.c citycon.c cloak.c clshroad.c cninja.c combatsc.c commando.c cop01.c copsnrob.c cosmic.c cps1.c crbaloon.c crshrace.c cvs.c dassault.c dcon.c ddragon.c ddragon3.c deadang.c dec0.c dec8.c deco16ic.c deco32.c decocass.c deniam.c destroyr.c dietgo.c digdug.c dkong.c docastle.c dogfgt.c dooyong.c dynax.c dynduke.c esd16.c exctsccr.c exedexes.c exidy440.c exprraid.c exzisus.c fantland.c fastfred.c firetrap.c flower.c flyball.c freekick.c funkybee.c funkyjet.c funworld.c fuukifg2.c fuukifg3.c gaelco.c gaelco2.c gaiden.c galaga.c galaxian.c galivan.c galpani2.c galpanic.c gaplus.c gberet.c gcpinbal.c ginganin.c gladiatr.c gng.c goindol.c gottlieb.c gotya.c groundfx.c gunsmoke.c hanaawas.c hexa.c higemaru.c holeland.c hyperspt.c hyprduel.c ironhors.c jack.c jackal.c jailbrek.c kan_panb.c kan_pand.c kaneko16.c kchamp.c kingobox.c ksayakyu.c ladybug.c lasso.c lastduel.c liberate.c lkage.c lordgun.c lsasquad.c lwings.c m10.c m107.c m52.c m58.c m72.c m90.c m92.c madalien.c magmax.c malzak.c mappy.c markham.c megasys1.c mermaid.c metlclsh.c metro.c mexico86.c mikie.c mitchell.c mjkjidai.c mjsister.c momoko.c mouser.c mrdo.c mrjong.c ms32.c mustache.c mystston.c n8080.c namcona1.c namcos1.c namcos86.c nbmj8688.c nbmj8891.c nbmj8991.c nbmj9195.c nemesis.c ninjakd2.c nitedrvr.c niyanpai.c nmk16.c nova2001.c othldrby.c othunder.c pacland.c pacman.c paradise.c parodius.c pastelg.c pbaction.c pcktgal.c pitnrun.c pktgaldx.c playmark.c pokechmp.c poolshrk.c popeye.c powerins.c ppu2c0x.c prehisle.c psikyo.c psikyo4.c psx.c psychic5.c qix.c quasar.c rallyx.c realbrk.c redclash.c renegade.c retofinv.c rockola.c rocnrope.c rohga.c rollerg.c rollrace.c sauro.c sbasketb.c scotrsht.c segas24.c senjyo.c seta2.c sf.c shangha3.c shaolins.c shootout.c simpl156.c simpsons.c skyfox.c skykid.c skyraid.c slapshot.c snes.c snk68.c solomon.c sonson.c spacefb.c spcforce.c spdodgeb.c speedbal.c splash.c sprint8.c spy.c srmp2.c srumbler.c sshangha.c ssozumo.c ssv.c st0016.c stactics.c starcrus.c starshp1.c stfight.c strnskil.c suna16.c suna8.c supbtime.c superqix.c suprloco.c surpratk.c system1.c system16.c tagteam.c tail2nos.c taito_b.c taito_f2.c taito_h.c taito_z.c taitoair.c taitoic.c taitosj.c taxidrvr.c tecmo.c tehkanwc.c terracre.c thedeep.c thief.c thoop2.c thunderx.c tigeroad.c tmnt.c tnzs.c toaplan1.c toaplan2.c toki.c topspeed.c trackfld.c travrusa.c truco.c tryout.c tsamurai.c tubep.c tumblep.c tunhunt.c twincobr.c undrfire.c unico.c vaportra.c vastar.c vball.c vdc.c victory.c volfied.c vulgus.c wgp.c wiz.c wrally.c wwfsstar.c wwfwfest.c xain.c xevious.c xmen.c xxmissio.c ygv608.c yiear.c yunsun16.c yunsung8.c zaccaria.c zaxxon.c zodiack.c
[src/mess]inputx.h messdrv.h mslegacy.c mslegacy.h
[src/mess/drivers]astrocde.c einstein.c mpf1.c nascom1.c
[src/mess/includes]cbmb.h pet.h
[src/mess/machine]svi318.c
[src/mess/tools/messtest]testmess.c
[src/mess/video]cbmb.c cgenie.c intv.c jupiter.c kim1.c mbee.c mekd2.c p2000m.c pc_video.c pet.c
[src/osd]osdepend.h
[src/osd/windows]sound.c vconv.c video.c windows.mak
[src/osd/winui]layout.c mui_opts.c mui_util.c properties.c treeview.c winui.c winui.mak
[src/osd/winui/help/docs]whatsnew.txt

src/build/build.mak
r1771r1772
99#
1010###########################################################################
1111
12
13BUILDSRC = $(SRC)/build
14BUILDOBJ = $(OBJ)/build
15BUILDOUT = $(BUILDOBJ)
16
1712OBJDIRS += \
1813   $(BUILDOBJ) \
1914
r1771r1772
2318# set of build targets
2419#-------------------------------------------------
2520
26FILE2STR = $(BUILDOUT)/file2str$(EXE)
27PNG2BDC = $(BUILDOUT)/png2bdc$(EXE)
21FILE2STR = $(BUILDOUT)/file2str$(BUILD_EXE)
22PNG2BDC = $(BUILDOUT)/png2bdc$(BUILD_EXE)
23VERINFO = $(BUILDOUT)/verinfo$(BUILD_EXE)
24
2825VERINFO = $(BUILDOUT)/verinfo$(EXE)
2926
3027ifneq ($(CROSS_BUILD),1)
src/build/verinfo.c
r1771r1772
1313#include <string.h>
1414#include <stdlib.h>
1515
16#define ARRAY_LENGTH(x)            (sizeof(x) / sizeof(x[0]))
16#define ARRAY_LENGTH(x)      (sizeof(x) / sizeof(x[0]))
17#define BUILD_WINDOWS      (0)
18#define BUILD_WINUI         (1)
19#define BUILD_MESS         (2)
1720
1821//============================================================
1922//  TYPE DEFINITIONS
r1771r1772
4043
4144
4245//============================================================
46// STATIC
47//============================================================
48
49static int build;
50
51
52//============================================================
4353//  emit_version_info
4454//============================================================
4555
r1771r1772
160170//============================================================
161171//  main
162172//============================================================
173static int usage(char *me)
174{
175   fprintf(stderr, "Usage: %s [-b windows|winui|mess] <filename>\n", me);
176   return 1;
177}
163178
179
180//============================================================
181//  main
182//============================================================
183
164184int main(int argc, char *argv[])
165185{
166186   version_info v;
167187   char legal_copyright[512];
168188   char *buffer;
169189   size_t size;
190   int opt;
170191   FILE *f;
171192
172193   memset(&v, 0, sizeof(v));
194   build = BUILD_WINDOWS;
173195
174196   // validate parameters
175   if (argc < 2)
197   opt = 1;
198   while (opt < argc && *argv[opt] == '-')
176199   {
177      printf("Usage: %s <filename>\n", argv[0]);
178      return 0;
200      if (!strcmp(argv[opt], "-b"))
201      {
202         char *p = argv[++opt];
203         if (!strcmp(p,"windows"))
204            build = BUILD_WINDOWS;
205         else if (!strcmp(p,"winui"))
206            build = BUILD_WINUI;
207         else if (!strcmp(p,"mess"))
208            build = BUILD_MESS;
209         else
210            return usage(argv[0]);
211      }
212      else
213         return usage(argv[0]);
214      opt++;
179215   }
180216
217   if (opt != argc-1 )
218   {
219      return usage(argv[0]);
220   }
221
181222   // open the file
182   f = fopen(argv[1], "rb");
223   f = fopen(argv[argc-1], "rb");
183224   if (f == NULL)
184225   {
185      fprintf(stderr, "Error opening file %s\n", argv[1]);
226      fprintf(stderr, "Error opening file %s\n", argv[argc-1]);
186227      return 1;
187228   }
188229
r1771r1772
209250   if (parse_version(buffer, &v.version_major, &v.version_minor, &v.version_build, &v.version_string))
210251      return 1;
211252
212#ifdef MESS
213   // MESS
214   v.author = "MESS Team";
215   v.comments = "Multi Emulation Super System";
216   v.company_name = "MESS Team";
217   v.file_description = "Multi Emulation Super System";
218   v.internal_name = "MESS";
219   v.original_filename = "MESS";
220   v.product_name = "MESS";
221#elif defined(WINUI)
222   // MAMEUI
223   v.author = "Christopher Kirmse and the MAMEUI team";
224   v.comments = "Multiple Arcade Machine Emulator with GUI";
225   v.company_name = "MAME Team";
226   v.file_description = "Multiple Arcade Machine Emulator with GUI";
227   v.internal_name = "MAMEUI";
228   v.original_filename = "MAMEUI";
229   v.product_name = "MAMEUI";
230#else
231   // MAME
232   v.author = "Nicola Salmoria and the MAME Team";
233   v.comments = "Multiple Arcade Machine Emulator";
234   v.company_name = "MAME Team";
235   v.file_description = "Multiple Arcade Machine Emulator";
236   v.internal_name = "MAME";
237   v.original_filename = "MAME";
238   v.product_name = "MAME";
239#endif
253   if (build == BUILD_MESS)
254   {
255      // MESS
256      v.author = "MESS Team";
257      v.comments = "Multi Emulation Super System";
258      v.company_name = "MESS Team";
259      v.file_description = "Multi Emulation Super System";
260      v.internal_name = "MESS";
261      v.original_filename = "MESS";
262      v.product_name = "MESS";
263   }
264   else if (build == BUILD_WINUI)
265   {
266      // MAMEUI
267      v.author = "Christopher Kirmse and the MAMEUI team";
268      v.comments = "Multiple Arcade Machine Emulator with GUI";
269      v.company_name = "MAME Team";
270      v.file_description = "Multiple Arcade Machine Emulator with GUI";
271      v.internal_name = "MAMEUI";
272      v.original_filename = "MAMEUI";
273      v.product_name = "MAMEUI";
274   }
275   else
276   {
277      // MAME
278      v.author = "Nicola Salmoria and the MAME Team";
279      v.comments = "Multiple Arcade Machine Emulator";
280      v.company_name = "MAME Team";
281      v.file_description = "Multiple Arcade Machine Emulator";
282      v.internal_name = "MAME";
283      v.original_filename = "MAME";
284      v.product_name = "MAME";
285   }
240286
241287   // build legal_copyright string
242288   v.legal_copyright = legal_copyright;
src/mame/audio/n8080.c
r1771r1772
323323
324324   if (n8080_hardware == 1)
325325   {
326      flip_screen = data & 0x20;
326      flip_screen_set_no_update(data & 0x20);
327327   }
328328   if (n8080_hardware == 3)
329329   {
src/mame/audio/redalert.c
r1771r1772
2121#define REDALERT_AUDIO_PCB_CLOCK   (XTAL_12_5MHz)
2222#define REDALERT_AUDIO_CPU_CLOCK   (REDALERT_AUDIO_PCB_CLOCK / 12)
2323#define REDALERT_AY8910_CLOCK      (REDALERT_AUDIO_PCB_CLOCK / 6)
24#define REDALERT_AUDIO_CPU_IRQ_FREQ   (1.0 / attotime_to_double(PERIOD_OF_555_ASTABLE(RES_K(120), RES_K(2.7), CAP_U(0.01))))
24#define REDALERT_AUDIO_CPU_IRQ_FREQ   (1000000000 / PERIOD_OF_555_ASTABLE_NSEC(RES_K(120), RES_K(2.7), CAP_U(0.01)))
2525
2626#define REDALERT_VOICE_PCB_CLOCK   (XTAL_6MHz)
2727#define REDALERT_VOICE_CPU_CLOCK   (REDALERT_VOICE_PCB_CLOCK)
src/mame/machine/irem_cpu.c
r1771r1772
302302
303303const UINT8 gussun_decryption_table[256] = {
304304    0x63,xxxx,xxxx,0x36,xxxx,0x52,0xb1,0x5b, 0x68,0xcd,xxxx,xxxx,xxxx,0xa8,xxxx,xxxx, /* 00 */
305//    0x63                          gggg            gggg                gggg
305//  gggg                          gggg            gggg                gggg
306306    xxxx,xxxx,0x75,0x24,0x08,0x83,0x32,0xe9, xxxx,0x79,xxxx,0x8f,0x22,xxxx,0xac,xxxx, /* 10 */
307//                        ????                      pppp      gggg
307//                      ????                      pppp      gggg
308308    0x5d,0xa5,0x11,0x51,0x0a,0x29,xxxx,xxxx ,0xf8,0x98,0x91,0x40,0x28,0x00,0x03,0x5f, /* 20 */
309//              gggg           gggg            gggg gggg      gggg gggg pppp
309//            gggg           gggg            gggg gggg      gggg gggg pppp
310310    0x26,xxxx,xxxx,0x8b,0x2f,0x02,xxxx,xxxx, 0x8e,0xab,xxxx,xxxx,0xbc,0x90,0xb3,xxxx, /* 30 */
311//                        gggg
311//                      gggg
312312    0x09,xxxx,0xc6,xxxx,xxxx,0x3a,xxxx,xxxx, xxxx,0x74,0x61,xxxx,0x33,xxxx,xxxx,xxxx, /* 40 */
313//    gggg
313//  gggg
314314    xxxx,0x53,0xa0,0xc0,0xc3,0x41,0xfc,0xe7, xxxx,0x2c,0x7c,0x2b,xxxx,0x4f,0xba,0x2a, /* 50 */
315//              gggg           gggg                 gggg pppp gggg      gggg
315//            gggg           gggg                 gggg pppp gggg      gggg
316316    0xb0,xxxx,0x21,0x7d,xxxx,xxxx,0xb5,0x07, 0xb9,xxxx,0x27,0x46,0xf9,xxxx,xxxx,xxxx, /* 60 */
317//              pppp pppp           gggg                 gggg
317//            pppp pppp           gggg                 gggg
318318    xxxx,0xea,0x72,0x73,0xad,0xd1,0x3b,0x5e, 0xe5,0x57,xxxx,0x0d,0xfd,xxxx,0x92,0x3c, /* 70 */
319//                   gggg                                     pppp gggg      gggg
320    xxxx,0x86,0x78,0x7f,0x18,0x25,0x2d,xxxx, 0x9a,0xeb,0x04,0x0b,0xa2,0xb8,0xf6,xxxx, /* 80 */
321//              pppp pppp ????      pppp       gggg
319//                 gggg                                     pppp gggg      gggg
320    xxxx,0x86,0x78,0x7f,0x30,0x25,0x2d,xxxx, 0x9a,0xeb,0x04,0x0b,0xa2,0xb8,0xf6,xxxx, /* 80 */
321//            pppp gggg gggg      pppp       gggg
322322    xxxx,xxxx,0x9d,xxxx,0xbb,xxxx,xxxx,0xcb, 0xa9,0xcf,xxxx,0x60,0x43,0x56,xxxx,xxxx, /* 90 */
323//              gggg                     gggg
323//            gggg                     gggg
324324    xxxx,0xa3,xxxx,xxxx,0x12,xxxx,0xfa,0xb4, xxxx,0x81,0xe6,0x48,0x80,0x8c,0xd4,xxxx, /* a0 */
325//                        ????           gggg                 ????      gggg gggg
325//                      gggg           gggg                 ????      gggg gggg
326326    0x42,xxxx,0x84,0xb6,0x77,0x3d,0x3e,xxxx, xxxx,0xb7,0x4b,xxxx,0xa4,xxxx,xxxx,xxxx, /* b0 */
327//    gggg      gggg ???? gggg      gggg            ???? pppp      gggg
327//  gggg      gggg ???? gggg      gggg            ???? pppp      gggg
328328    xxxx,0xff,0x47,xxxx,0x55,0x1e,xxxx,0x59, 0x93,xxxx,xxxx,xxxx,0x88,0xc1,0x01,0xb2, /* c0 */
329//              gggg                                                         pppp
329//            gggg                                                         pppp
330330    0x85,0x2e,0x06,0xc7,0x05,xxxx,0x8a,0x5a, 0x58,0xbe,xxxx,0x4e,xxxx,0x1f,0x23,xxxx, /* d0 */
331//    gggg                                                    gggg
331//  gggg                                                    gggg
332332    0xe8,xxxx,0x89,0xa1,0xd0,xxxx,xxxx,0xe2, 0x38,0xfe,0x50,0x9c,xxxx,xxxx,xxxx,0x49, /* e0 */
333//                                                            gggg                gggg
333//                                                          gggg                gggg
334334    0xfb,0x20,0xf3,xxxx,xxxx,0x0f,xxxx,xxxx, xxxx,0x76,0xf7,0xbd,0x39,0x7e,0xbf,xxxx, /* f0 */
335//         pppp                                     gggg      gggg      gggg
335//       pppp                                     gggg      gggg      gggg
336336};
337337
338338
r1771r1772
345345"????" -> missing
346346"0xHH" -> right code (not supported)
347347
34814 -> 08 (2097b 20980 - routine from 2097a) (08 30) probably 08 - after the start and before the menu
349          - to handle the player number
350.40 -> ??
351j5a -> 78 (195eb - (222fc - routine from 222ed to ) (7x j...) no 70,79,7a,7b,7d,7f ok 78,7c,7e
352.62 -> ?? (1cf86 1cfa3 - routine from 1cf61 to 1cff4)  (water in level 1) (01 11 19 29)
3537e ->  (1e073 -
354j82 -> 78 (78,7c,7e) ->
355.84 -> 18 (1d8f1 - routine from 1d8c7 to 1d8fc) - three bytes (00,08,18,28,30) (sprite animation)
356ab -> 4f?
357.b3 -> 19 (216b6 - 216cf
358b9 -> b7 (21210 - ) 2 bytes -
34814 -> 08 (2097b 20980 - routine from 2097a) (08 30) to handle the player number -> probably 08
349ab -> 4f?(19570 - routine from 194e1 to 19619) (when the water go up)
350b3 -> 19 (216b6 - 216cf - 16663 (when you rotate a piece) - 175f1 - 17d2a - 17d36
351b9 -> b7 (21210 - routine from 2117e to ) 2 bytes -
359352
360
361353rz probably:
36235419 -> 79 (1df45 routine from 1df27 / 2282f - routine from 2281f to 22871) no 70,78,7a,7b,7c,7e,7f(ok) ok 79,7d
3632d -> 00 (1df1d - routine from 1dee8 to 1df26) -> 00 - to handle sprite animation
3555a -> 7c (195eb - (222fc - routine from 222ed to ) (7x j...) no 70,71,79,7a,7b ok (78,7c) -> 7c
36435663 -> 7d (1df7f, 1df8c, 1df95, 21f08 - routine from 1df27 to ) no 70,78,7a,7b,7c,7e,7f(ok) ok 79,7d
3653577b -> 0d
36683 -> 7f (194cd - routine from) no 70,78,79,7a,7b,7c,7d,7e ok 77(no) ok 7f
35882 -> 78 (78,7c) -> 78
36735986 -> 2d
368360ba -> 4b (1094d, 10b28 - routine from 10948 to 10b73) one byte -> probably 4b
369361ce -> 01 (10236 - routine from 1017e to 10254) (01, 09, 19, 21, 29, 31) -> probably 01
370362f1 -> 20 to handle the player number
371fd -> 7e (1d659 - routine from 1d63c to 1d65e) no 70,76,77,78,79,7a,7b, 7c,7d,7e,7f  ok 7e
372363
373364rz guess:
37436506 -> b1 (22872 - routine from 22872 to 2289d)
r1771r1772
38137229 -> 98 (1df22 - routine from 1dee8 to 1df26) -> 98 - to handle sprite animation
3823732b -> 40 (1d4d2 1db81 1dba9 - routine from 1d4b2 to 1d4de) -> 40
3833742c -> 28 (20333 - routine from 2032a to 20366) (18,28)
3752d -> 00 (1df1d - routine from 1dee8 to 1df26) -> 00 - to handle sprite animation
38437634 -> 2f (20381 - routine from 2037b to 20391) - used to handle number of lives and game over
37740 -> 09
38537852 -> a0
38637955 -> 41
38738059 -> 2c (220cf - 2037f - routine from 2202f to ) 2bytes (2c,
3883815b -> 2b (used in "Service Mode" / "CHARACTER menu")
3825d -> 4f
38362 -> 21 (1cf86 1cfa3 - routine from 1cf61 to 1cff4)  (water in level 1) (01 11 19 29)
38938466 -> b5 (1daaf - routine from 1da61 to 1daca) - two bytes (colors effect)
3903856a -> 27 (20368 - routine from 20368 to 2037a) - used to limit the max lives number
39138673 -> 73 (1d4f7 - routine from 1d4df to 1d539) -> (no 70,71,72,74,75,76,77,78,79,7a,7b,7c,7d,7e,7f) - ok 73
3877c -> fd
3887e -> 92 (1e095 - routine from 1e073 to 1e0cf)
38983 -> 7f (194cd - routine from) no 70,78,79,7a,7b,7c,7d,7e ok 77(no) ok 7f
39084 -> 08 (1d8f1 - routine from 1d8c7 to 1d8fc) - three bytes (ok 30) (sprite animation) -> 30
39239188 -> 9a
39339292 -> 9d
39439397 -> cb
394a4 -> 12 (02,12) - routine from 1d392 -> 12
395395a7 -> b4 (2029a - routine from 20290 to
396396ad -> 8c (1d559, 1d8d4 - routine from 1d547 - ; routine from 1d8b8 to 1d8fc) ..............................
397397ae -> d4 (20215 - ) used when you insert a coin to handle the "coin number" in decimal
398b0 -> 42 (routine from 128db)
398399b2 -> 84 (20a8b - 20acc) 20,21,84,85 (scroll down the object)  - to handle the player number
399400b4 -> 77 (1d03a, 1d57a - routine from 1d4df ) no 70,71,76,78,79,7a,7b,7c,7d,7e,7f ok 77
400401b6 -> 3e
402bc -> a4
401403c2 -> 47 (22881, 220ff - routine from 22872 to 22885)
404d0 -> 85 (routine from 16a3e) (when you rotate a piece)
402405db -> 4e (18b1a)
403406eb -> 9c
404407ef -> 49 (dec CW) (used in "Service Mode" / "CHARACTER menu")
405408f9 -> 76 (16d02(f 16cfa)-16598-165a1-18de7(f 18dc4) no 71(no),77(no),(icons? 70,76,78,7a,7c,7e),79,7d,7f(no) maybe 76
406409fb -> bd
410fd -> 7e (1d659 - routine from 1d63c to 1d65e) no 70,76,77,78,79,7a,7b, 7c,7d,7e,7f  ok 7e
407411
408
409
410412missing V35+ core:
41100    -> 63    not supported (229e2 - routine from 229da to 229ec) (for now we use cd instruction + hack)
4120f 92 -> of 92 not supported (1011d before of STI instruction) (for now no effects)
4130f 92 -> of 92 not supported (1011d before STI instruction) (for now no effects)
413414
414415-------------------------------------------------------------------------------------------------------------
415416
r1771r1772
449450add iy,sp [e7]
450451clc
451452ret
452
453Unused: [2] 00  add %Eb,%Gb
454Unused: [2] 01  add %Ev,%Gv
455Unused: [2] 08  or %Eb,%Gb
456Unused: [2] 09  or %Ev,%Gv
457Unused: [2] 0a  or %Gb,%Eb
458Unused: [2] 0c  or al,%Ib
459Unused: [1] 0e  push cs
460Unused: [2] 10  adc %Eb,%Gb
461Unused: [2] 11  adc %Ev,%Gv
462Unused: [2] 12  adc %Gb,%Eb
463Unused: [2] 13  adc %Gv,%Ev
464Unused: [2] 14  adc al,%Ib
465Unused: [3] 15  adc aw,%Iv
466Unused: [1] 16  push ss
467Unused: [1] 17  pop ss
468Unused: [2] 18  sbb %Eb,%Gb
469Unused: [2] 19  sbb %Ev,%Gv
470Unused: [2] 1a  sbb %Gb,%Eb
471Unused: [2] 1b  sbb %Gv,%Ev
472Unused: [2] 1c  sbb al,%Ib
473Unused: [3] 1d  sbb aw,%Iv
474Unused: [2] 20  and %Eb,%Gb
475Unused: [2] 22  and %Gb,%Eb
476Unused: [2] 24  and al,%Ib
477Unused: [1] 27  adj4a
478Unused: [2] 28  sub %Eb,%Gb
479Unused: [2] 29  sub %Ev,%Gv
480Unused: [2] 2a  sub %Gb,%Eb
481Unused: [2] 2b  sub %Gv,%Ev
482Unused: [2] 2c  sub al,%Ib
483Unused: [1] 2f  adj4s
484Unused: [2] 30  xor %Eb,%Gb
485Unused: [2] 31  xor %Ev,%Gv
486Unused: [2] 34  xor al,%Ib
487Unused: [3] 35  xor aw,%Iv
488Unused: [1] 37  adjba
489Unused: [1] 3f  adjbs
490Unused: [1] 40  inc aw
491Unused: [1] 42  inc dw
492Unused: [1] 44  inc sp
493Unused: [1] 45  inc bp
494Unused: [1] 47  inc iy
495Unused: [1] 48  dec aw
496Unused: [1] 49  dec cw
497Unused: [1] 4a  dec dw
498Unused: [1] 4b  dec bw
499Unused: [1] 4c  dec sp
500Unused: [1] 4d  dec bp
501Unused: [1] 4e  dec ix
502Unused: [1] 54  push sp
503Unused: [1] 5c  pop sp
504Unused: [1] 60  pusha
505Unused: [1] 61  popa
506Unused: [0] 62  chkind %Gv,%Ma
507Unused: [0] 63  (null)
508Unused: [0] 64  repnc %p
509Unused: [0] 65  repc %p
510Unused: [0] 66  (null)
511Unused: [0] 67  (null)
512Unused: [0] 69  imul %Gw,%Ew,%Iw
513Unused: [0] 6a  push %Ix
514Unused: [0] 6b  imul %Gw,%Ew,%Ib
515Unused: [0] 6c  insb
516Unused: [0] 6d  insw
517Unused: [0] 6e  outsb
518Unused: [0] 6f  outsw
519Unused: [1] 71  jno %Jb
520Unused: [1] 76  jbe %Jb
521Unused: [1] 77  ja %Jb
522Unused: [1] 78  js %Jb
523Unused: [1] 79  jns %Jb
524Unused: [1] 7a  jpe %Jb
525Unused: [1] 7b  jpo %Jb
526Unused: [1] 7c  jl %Jb
527Unused: [1] 7e  jle %Jb
528Unused: [1] 7f  jg %Jb
529DUPLICATE: 81   %g0 %Ew,%Iw
530Unused: [2] 84  test %Eb,%Gb
531Unused: [2] 85  test %Ew,%Gw
532Unused: [2] 87  xch %Ew,%Gw
533Unused: [0] 8c  mov %Ew,%Sw
534Unused: [0] 8d  ldea %Gw,%M
535Unused: [0] 8f  pop %Ev
536Unused: [1] 92  xch dw,aw
537Unused: [1] 94  xch sp,aw
538Unused: [1] 95  xch bp,aw
539Unused: [1] 96  xch ix,aw
540Unused: [1] 97  xch iy,aw
541Unused: [0] 98  cvtbw
542Unused: [0] 99  cvtwl
543Unused: [0] 9b  fwait
544Unused: [0] 9e  sahf
545Unused: [0] 9f  lahf
546Unused: [0] a0  mov al,%Oc
547Unused: [0] a2  mov %Oc,al
548Unused: [0] a5  %P movsw
549Unused: [0] a6  %P cmpsb
550Unused: [0] a7  %P cmpsw
551Unused: [0] a9  test aw,%Iv
552Unused: [0] aa  %P stosb
553Unused: [0] ae  %P scasb
554Unused: [0] af  %P scasw
555Unused: [2] b4  mov ah,%Ib
556Unused: [2] b5  mov ch,%Ib
557Unused: [2] b6  mov dh,%Ib
558Unused: [2] b7  mov bh,%Ib
559Unused: [3] bd  mov bp,%Iv
560Unused: [0] c2  ret %Iw
561Unused: [0] c4  les %Gv,%Mp
562Unused: [0] c5  lds %Gv,%Mp
563Unused: [0] c8  enter %Iw,%Ib
564Unused: [0] c9  leave
565Unused: [0] ca  retf %Iw
566Unused: [0] cc  int 03
567Unused: [0] cd  int %Ib
568Unused: [0] ce  into
569Unused: [0] d2  %g1 %Eb,cl
570Unused: [0] d3  %g1 %Ev,cl
571Unused: [0] d4  aam ; %Ib
572Unused: [0] d5  aad ; %Ib
573Unused: [0] d6  (null)
574Unused: [0] d7  trans
575Unused: [0] d8  %f0
576Unused: [0] d9  %f1
577Unused: [0] da  %f2
578Unused: [0] db  %f3
579Unused: [0] dc  %f4
580Unused: [0] dd  %f5
581Unused: [0] de  %f6
582Unused: [0] df  %f7
583Unused: [0] e0  loopne %Jb
584Unused: [0] e1  loope %Jb
585Unused: [0] e3  j%j cxz %Jb
586Unused: [0] e4  in al,%Ib
587Unused: [0] ec  in al,dw
588Unused: [0] ed  in aw,dw
589Unused: [0] ee  out dw,al
590Unused: [0] ef  out dx,aw
591Unused: [0] f0  lock %p
592DUPLICATE: f1   (null)
593Unused: [0] f2  repne %p
594Unused: [0] f4  hlt
595Unused: [0] f5  not1 CY(cmc)
596Unused: [0] f6  %g2
597Unused: [1] fb  ei
598Unused: [1] fd  std
599453*/
600454
601455const UINT8 leagueman_decryption_table[256] = {
src/mame/machine/qix.c
r1771r1772
605605{
606606   qix_state *state = Machine->driver_data;
607607
608   return readinputport(state->flip_screen ? 6 : 4);
608   return readinputport(state->flip ? 6 : 4);
609609}
610610
611611
r1771r1772
613613{
614614   qix_state *state = Machine->driver_data;
615615
616   return readinputport(state->flip_screen ? 5 : 3);
616   return readinputport(state->flip ? 5 : 3);
617617}
src/mame/machine/pcshare.c
r1771r1772
525525
526526void pc_keyb_set_clock(int on)
527527{
528   attotime keyb_delay = STATIC_ATTOTIME_IN_MSEC(5);
529
530528   on = on ? 1 : 0;
531529
532530   if (pc_keyb.on != on)
533531   {
534532      if (on)
535         timer_adjust_oneshot(pc_keyboard_timer, keyb_delay, 0);
533         timer_adjust_oneshot(pc_keyboard_timer, ATTOTIME_IN_MSEC(5), 0);
536534      else
537535         timer_reset(pc_keyboard_timer, attotime_never);
538536
src/mame/machine/namcos2.c
r1771r1772
9494   }
9595}
9696
97MACHINE_START( namcos2 )
98{
99   namcos2_eeprom = auto_malloc(namcos2_eeprom_size);
100}
101
97102MACHINE_RESET( namcos2 )
98103{
99104   int loop;
100105   mFinalLapProtCount = 0;
101106
102   namcos2_eeprom = auto_malloc(namcos2_eeprom_size);
103
104107   /* Initialise the bank select in the sound CPU */
105108   namcos2_sound_bankselect_w(0,0); /* Page in bank 0 */
106109
src/mame/machine/cps2crpt.c
r1771r1772
766766   { "ddtodur1", { 0xeca19c3d,0x24736bf0 }, 0x180000 },   // 0C78 1019 4000  cmpi.w  #$1019,$4000
767767   { "ddtodj",   { 0x4510e79c,0xf36b8a2d }, 0x180000 },   // 0C78 1019 4000  cmpi.w  #$1019,$4000
768768   { "ddtodjr1", { 0x4510e79c,0xf36b8a2d }, 0x180000 },   // 0C78 1019 4000  cmpi.w  #$1019,$4000
769   { "ddtodjr2", { 0x4510e79c,0xf36b8a2d }, 0x180000 },   // 0C78 1019 4000  cmpi.w  #$1019,$4000
769770   { "ddtoda",   { 0xdecac105,0x19710411 }, 0x180000 },   // 0C78 1019 4000  cmpi.w  #$1019,$4000
770771   { "ddtodh",   { 0x19691019,0xe825dde0 }, 0x180000 },   // 0C78 1019 4000  cmpi.w  #$1019,$4000
771772   { "ecofghtr", { 0x931031dc,0xba987654 }, 0x200000 },   // 0838 0003 7345  btst    #3,$7345
src/mame/machine/ajax.c
r1771r1772
1414#include "cpu/konami/konami.h"
1515#include "video/konamiic.h"
1616
17UINT8 *ajax_sharedram;
1817extern UINT8 ajax_priority;
1918static int firq_enable;
2019
r1771r1772
165164   }
166165}
167166
168/* Shared RAM between the 052001 and the 6809 (6264SL at I8) */
169READ8_HANDLER( ajax_sharedram_r )
170{
171   return ajax_sharedram[offset];
172}
173
174WRITE8_HANDLER( ajax_sharedram_w )
175{
176   ajax_sharedram[offset] = data;
177}
178
179167/*  ajax_bankswitch_w_2:
180168    Handled by the LS273 Octal +ve edge trigger D-type Flip-flop with Reset at K14:
181169
src/mame/mamedriv.c
r1771r1772
24952495   DRIVER( ddtodr1 )   /* 13/01/1994 (c) 1993 (Euro) */
24962496   DRIVER( ddtodu )   /* 25/01/1994 (c) 1993 (US) */
24972497   DRIVER( ddtodur1 )   /* 13/01/1994 (c) 1993 (US) */
2498   DRIVER( ddtodj )   /* 25/01/1994 (c) 1993 (Japan) */
2499   DRIVER( ddtodjr1 )   /* 13/01/1994 (c) 1993 (Japan) */
2498   DRIVER( ddtodj )   /* 12/04/1994 (c) 1993 (Japan) */
2499   DRIVER( ddtodjr1 )   /* 25/01/1994 (c) 1993 (Japan) */
2500   DRIVER( ddtodjr2 )   /* 13/01/1994 (c) 1993 (Japan) */
25002501   DRIVER( ddtoda )   /* 13/01/1994 (c) 1993 (Asia) */
25012502   DRIVER( ddtodh )   /* 25/01/1994 (c) 1993 (Hispanic) */
25022503   DRIVER( ssf2t )      /* 23/02/1994 (c) 1994 (World) */
r1771r1772
39803981   /* Sega Naomi-based (Dreamcast) systems */
39813982   DRIVER( naomi )
39823983   DRIVER( csmash )
3984   DRIVER( csmasho )
39833985   DRIVER( vs2_2k )
3984   DRIVER( vs2_2ka )
39853986   DRIVER( smarinef )
39863987   DRIVER( cspike )
39873988   DRIVER( capsnk )
r1771r1772
55555556   DRIVER( neobombe )   /* 0093 (c) 1997 Hudson */
55565557   DRIVER( gowcaizr )   /* 0094 (c) 1995 Technos */
55575558   DRIVER( rbff1 )      /* 0095 (c) 1995 SNK */
5559   DRIVER( rbff1a )   /* 0095 (c) 1995 SNK */
55585560   DRIVER( aof3 )      /* 0096 (c) 1996 SNK */
55595561   DRIVER( aof3k )      /* Censored Korean release of aof3 */
55605562   DRIVER( sonicwi3 )   /* 0097 (c) 1995 Video System Co. */
r1771r1772
56685670   DRIVER( pnyaa )      /* 0267 (c) 2003 Aiky / Taito */
56695671   DRIVER( ms5pcb )   /* 0268 (c) 2003 Playmore */
56705672   DRIVER( mslug5 )   /* 0268 (c) 2003 Playmore */
5673   DRIVER( mslug5h )   /* 0268 (c) 2003 Playmore */
56715674   DRIVER( ms5plus )   /* bootleg */
56725675   DRIVER( svcpcb )   /* 0269 (c) 2003 Playmore / Capcom - JAMMA PCB */
56735676   DRIVER( svcpcba )   /* 0269 (c) 2003 Playmore / Capcom - JAMMA PCB */
r1771r1772
77907793   DRIVER( dreamwld )   /* (c) 2000 SemiCom */
77917794   DRIVER( cybertnk )   /* (c) 1990 Coreland */
77927795   DRIVER( pkscram )   /* (c) 1993 Cosmo Electronics Corporation */
7796
7797   /* Funworld */
77937798   DRIVER( jollycrd )   /* (c) 1985 TAB-Austria */
77947799   DRIVER( jolycdae )   /* (c) 1985 TAB-Austria */
77957800   DRIVER( jolyc3x3 )   /* (c) 1985 TAB-Austria */
77967801   DRIVER( jolyc980 )   /* (c) 2000 Spale-Soft */
7797   DRIVER( jolycdcr )   /* (c) 1993 Soft Design */
7802   DRIVER( jolycdev )   /* (c) 1998 TAB/Evona */
7803   DRIVER( jolyccra )   /* (c) 1985 TAB-Austria */
7804   DRIVER( jolyccrb )   /* (c) 1993 Soft Design */
77987805   DRIVER( jolycdit )   /* 199? bootleg */
7806   DRIVER( sjcd2kx3 )   /* (c) 1985 M.P.*/
77997807   DRIVER( jolycdab )   /* (c) 1986 Inter Games */
78007808   DRIVER( bigdeal )   /* (c) 1986 Funworld */
78017809   DRIVER( bigdealb )   /* (c) 1986 Funworld */
r1771r1772
78167824   DRIVER( magiccdb )   /* (c) 1996 Impera */
78177825   DRIVER( vegasslw )   /* (c) 1993 Funworld */
78187826   DRIVER( vegasfst )   /* (c) 1993 Soft Design */
7827   DRIVER( vegasfte )   /* (c) 1993 Soft Design */
7828   DRIVER( jolyjokr )   /* (c) 198? Impera */
7829   DRIVER( jolyjkra )   /* (c) 198? Impera */
78197830   DRIVER( jokercrd )   /* (c) 1993 Vesely Svet */
78207831   DRIVER( mongolnw )   /* 199? bootleg */
78217832   DRIVER( soccernw )   /* 199? bootleg */
78227833   DRIVER( snookr10 )   /* (c) 1998 Sandiy */
78237834   DRIVER( saloon )   /* 199? unknown */
7835
78247836   DRIVER( vroulet )   /* (c) 1989 World Game */
78257837   DRIVER( rcasino )   /* (c) 1984 Dyna Electronics */
78267838   DRIVER( cmv801 )   /* (c) 198? Corsica */
r1771r1772
78897901   DRIVER( jokerpkr )   /* Bootleg in Coinmaster hardware */
78907902   DRIVER( pottnpkr )   /* Bootleg */
78917903   DRIVER( pottnpkb )   /* Bootleg */
7892   DRIVER( gdrawpkr )   /* (c) 1981 Cal Omega / Casino Electronics Inc. */
7904
7905   /* Cal Omega */
7906   DRIVER( comg076 )   /* (c) 1981 Cal Omega Inc. */
7907   DRIVER( comg079 )   /* (c) 1981 Cal Omega Inc. */
7908   DRIVER( comg094 )   /* (c) 1981 Cal Omega Inc. */
7909   DRIVER( comg107 )   /* (c) 1982 Cal Omega Inc. */
7910   DRIVER( comg125 )   /* (c) 1982 Cal Omega Inc. */
7911   DRIVER( comg127 )   /* (c) 1982 Cal Omega Inc. */
7912   DRIVER( comg128 )   /* (c) 1982 Cal Omega Inc. */
7913   DRIVER( comg134 )   /* (c) 1982 Cal Omega Inc. */
7914   DRIVER( comg145 )   /* (c) 1982 Cal Omega Inc. */
7915   DRIVER( comg157 )   /* (c) 1983 Cal Omega Inc. */
7916   DRIVER( comg159 )   /* (c) 1983 Cal Omega Inc. */
7917   DRIVER( comg164 )   /* (c) 1983 Cal Omega Inc. */
7918   DRIVER( comg168 )   /* (c) 1983 Cal Omega Inc. */
7919   DRIVER( comg172 )   /* (c) 1983 Cal Omega Inc. */
7920   DRIVER( comg175 )   /* (c) 1984 Cal Omega / Casino Electronics Inc. */
7921   DRIVER( comg176 )   /* (c) 1982 Cal Omega Inc. */
7922   DRIVER( comg181 )   /* (c) 1983 Cal Omega Inc. */
7923   DRIVER( comg183 )   /* (c) 1983 Cal Omega Inc. */
7924   DRIVER( comg185 )   /* (c) 1983 Cal Omega Inc. */
7925   DRIVER( comg186 )   /* (c) 1983 Cal Omega Inc. */
7926   DRIVER( comg204 )   /* (c) 1984 Cal Omega Inc. */
7927   DRIVER( comg208 )   /* (c) 1984 Cal Omega Inc. */
7928   DRIVER( comg227 )   /* (c) 1984 Cal Omega Inc. */
7929   DRIVER( comg236 )   /* (c) 1984 Cal Omega Inc. */
7930   DRIVER( comg239 )   /* (c) 1985 Cal Omega / Casino Electronics Inc. */
7931   DRIVER( comg246 )   /* (c) 1985 Cal Omega Inc. */
7932   DRIVER( comg272a )   /* (c) 1985 Cal Omega Inc. */
7933   DRIVER( comg272b )   /* (c) 1985 Cal Omega Inc. */
7934   DRIVER( comg903d )   /* (c) 198? Cal Omega Inc. */
7935   DRIVER( comg905d )   /* (c) 198? Cal Omega Inc. */
78937936   DRIVER( elgrande )   /* (c) 1982 Tuni Electro Service / E.T. Marketing */
7937   DRIVER( jjpoker )   /* (c) 1983 Enter-Tech */
7938   DRIVER( jjpokerb )   /* (c) 1983 Enter-Tech */
7939   DRIVER( ssipkr24 )   /* (c) 1988 SSI */
7940   DRIVER( ssipkr30 )   /* (c) 1988 SSI */
7941   DRIVER( ssipkr40 )   /* (c) 1990 SSI */
7942
78947943   DRIVER( altair )   /* (c) 1981 Cidelsa */
78957944   DRIVER( destryer )   /* (c) 1981 Cidelsa */
78967945   DRIVER( destryea )   /* (c) 1981 Cidelsa */
src/mame/includes/taitoipt.h
r1771r1772
11/*******************************************************************************
22
3    Input port macros used by many games in mutiple Taito drivers
3    Input port macros used by many games in multiple Taito drivers
44
55*******************************************************************************/
66
77
8/**************************** Machine Dip Swicthes ****************************/
8/**************************** Machine Dip Switches ****************************/
99
1010/* with location */
1111#define TAITO_DSWA_BITS_2_TO_3_LOC(DIPBANK) \
r1771r1772
205205   TAITO_COINAGE_US_COIN_CONT
206206
207207
208/************************** Difficulty Dip Swicthes ***************************/
208/************************** Difficulty Dip Switches ***************************/
209209
210210/* with location */
211211#define TAITO_DIFFICULTY_LOC(DIPBANK) \
src/mame/includes/stactics.h
r0r1772
1/****************************************************************************
2
3    Sega "Space Tactics" Driver
4
5    Frank Palazzolo (palazzol@home.com)
6
7****************************************************************************/
8
9
10typedef struct _stactics_state stactics_state;
11struct _stactics_state
12{
13   /* machine state */
14   int    vert_pos;
15   int    horiz_pos;
16   UINT8 *motor_on;
17
18   /* video state */
19   UINT8 *videoram_b;
20   UINT8 *videoram_d;
21   UINT8 *videoram_e;
22   UINT8 *videoram_f;
23   UINT8 *palette;
24   UINT8 *display_buffer;
25   UINT8 *lamps;
26
27   UINT8  y_scroll_d;
28   UINT8  y_scroll_e;
29   UINT8  y_scroll_f;
30   UINT8  vblank_count;
31   UINT8  shot_standby;
32   UINT8  shot_arrive;
33   UINT16 beam_state;
34   UINT16 old_beam_state;
35   UINT16 beam_states_per_frame;
36};
37
38
39/*----------- defined in video/stactics.c -----------*/
40
41MACHINE_DRIVER_EXTERN( stactics_video );
42
43WRITE8_HANDLER( stactics_palette_w );
44WRITE8_HANDLER( stactics_scroll_ram_w );
45WRITE8_HANDLER( stactics_speed_latch_w );
46WRITE8_HANDLER( stactics_shot_trigger_w );
47WRITE8_HANDLER( stactics_shot_flag_clear_w );
48CUSTOM_INPUT( stactics_get_vblank_count_d3 );
49CUSTOM_INPUT( stactics_get_shot_standby );
50CUSTOM_INPUT( stactics_get_not_shot_arrive );
51
src/mame/includes/qix.h
r1771r1772
3131   UINT8 *videoram_address;
3232   UINT8 *videoram_mask;
3333   UINT8 *paletteram;
34   UINT8  flip_screen;
34   UINT8  flip;
3535   UINT8  palette_bank;
3636   UINT8  leds;
3737   UINT8 *scanline_latch;
src/mame/includes/namcos2.h
r1771r1772
137137
138138extern int namcos2_gametype;
139139
140MACHINE_START( namcos2 );
140141MACHINE_RESET( namcos2 );
141142
142143READ16_HANDLER( namcos2_flap_prot_r );
src/mame/includes/cclimber.h
r1771r1772
99
1010/*----------- defined in video/cclimber.c -----------*/
1111
12extern UINT8 *cclimber_bsvideoram;
13extern size_t cclimber_bsvideoram_size;
14extern UINT8 *cclimber_bigspriteram;
12extern UINT8 *cclimber_videoram;
13extern UINT8 *cclimber_colorram;
14extern UINT8 *cclimber_spriteram;
15extern UINT8 *cclimber_bigsprite_videoram;
16extern UINT8 *cclimber_bigsprite_control;
17
1518extern UINT8 *cclimber_column_scroll;
19extern UINT8 *cclimber_flip_screen;
1620
17extern UINT8 *swimmer_bgcolor;
18extern UINT8 *swimmer_sidepanel_enabled;
21extern UINT8 *swimmer_background_color;
22extern UINT8 *swimmer_side_background_enabled;
1923extern UINT8 *swimmer_palettebank;
2024
21extern UINT8 *toprollr_videoram2;
22extern UINT8 *toprollr_videoram3;
23extern UINT8 *toprollr_videoram4;
25extern UINT8 *toprollr_bg_videoram;
26extern UINT8 *toprollr_bg_coloram;
2427
2528WRITE8_HANDLER( cclimber_colorram_w );
29WRITE8_HANDLER( cannonb_flip_screen_w );
30
2631PALETTE_INIT( cclimber );
32VIDEO_START( cclimber );
2733VIDEO_UPDATE( cclimber );
2834
29VIDEO_UPDATE( cannonb );
35PALETTE_INIT( swimmer );
36VIDEO_START( swimmer );
37VIDEO_UPDATE( swimmer );
3038
39PALETTE_INIT( yamato );
3140VIDEO_UPDATE( yamato );
41
42PALETTE_INIT( toprollr );
3243VIDEO_START( toprollr );
3344VIDEO_UPDATE( toprollr );
3445
35PALETTE_INIT( swimmer );
36VIDEO_UPDATE( swimmer );
3746
38
3947/*----------- defined in audio/cclimber.c -----------*/
4048
4149extern const struct AY8910interface cclimber_ay8910_interface;
src/mame/includes/dkong.h
r1771r1772
7171   const UINT8 *   color_codes;
7272   emu_timer *      scanline_timer;
7373   INT8          vidhw;         /* Selected video hardware RS Conversion / TKG04 */
74   UINT8 *         video_ram;
75   UINT8 *         sprite_ram;
76   size_t          sprite_ram_size;
7477
7578   /* radar scope */
7679   UINT8   sig30Hz;
r1771r1772
9396   UINT16   grid_col;
9497   UINT8   sprite_bank;
9598   UINT8   dma_latch;
99   UINT8    flip;
96100
97101   /* reverse address lookup map - hunchbkd */
98102   INT16 rev_map[0x200];
src/mame/includes/20pacgal.h
r1771r1772
1616   UINT8 *video_ram;
1717   UINT8 *sprite_ram;
1818   UINT8 *sprite_color_lookup;
19   UINT8 *flip_screen;
19   UINT8 *flip;
2020
2121   /* machine state */
2222   UINT8 game_selected;   /* 0 = Ms. Pac-Man, 1 = Galaga */
src/mame/mame.mak
r1771r1772
10281028   $(DRIVERS)/terracre.o $(VIDEO)/terracre.o \
10291029   $(DRIVERS)/tubep.o $(VIDEO)/tubep.o \
10301030   $(DRIVERS)/wiping.o $(AUDIO)/wiping.o $(VIDEO)/wiping.o \
1031   $(DRIVERS)/yamato.o \
10321031   $(MACHINE)/nb1413m3.o \
10331032
10341033$(MAMEOBJ)/nintendo.a: \
r1771r1772
11701169   $(DRIVERS)/segaybd.o $(VIDEO)/segaybd.o \
11711170   $(DRIVERS)/ssf2md.o \
11721171   $(DRIVERS)/sg1000a.o \
1173   $(DRIVERS)/stactics.o $(MACHINE)/stactics.o $(VIDEO)/stactics.o \
1172   $(DRIVERS)/stactics.o $(VIDEO)/stactics.o \
11741173   $(DRIVERS)/stv.o $(DRIVERS)/stvinit.o $(MACHINE)/stvprot.o $(MACHINE)/stvcd.o \
11751174   $(DRIVERS)/suprloco.o $(VIDEO)/suprloco.o \
11761175   $(DRIVERS)/system1.o $(VIDEO)/system1.o \
r1771r1772
15081507   $(DRIVERS)/aztarac.o $(AUDIO)/aztarac.o $(VIDEO)/aztarac.o \
15091508   $(DRIVERS)/beaminv.o \
15101509   $(DRIVERS)/bmcbowl.o \
1510   $(DRIVERS)/calomega.o $(VIDEO)/calomega.o \
15111511   $(DRIVERS)/carrera.o \
15121512   $(DRIVERS)/cave.o $(VIDEO)/cave.o \
15131513   $(DRIVERS)/cherrym.o \
r1771r1772
15391539   $(DRIVERS)/freekick.o $(VIDEO)/freekick.o \
15401540   $(DRIVERS)/funworld.o $(VIDEO)/funworld.o \
15411541   $(DRIVERS)/gamecstl.o \
1542   $(DRIVERS)/gdrawpkr.o $(VIDEO)/gdrawpkr.o \
15431542   $(DRIVERS)/gtipoker.o \
15441543   $(DRIVERS)/go2000.o \
15451544   $(DRIVERS)/good.o \
r1771r1772
17161715
17171716$(DRIVERS)/sspeedr.o:   $(LAYOUT)/sspeedr.lh
17181717
1718$(DRIVERS)/stactics.o:   $(LAYOUT)/stactics.lh
1719
17191720$(DRIVERS)/tceptor.o:   $(LAYOUT)/tceptor2.lh
17201721
17211722$(DRIVERS)/tetrisp2.o:   $(LAYOUT)/rocknms.lh
src/mame/video/mitchell.c
r1771r1772
281281
282282VIDEO_UPDATE( pang )
283283{
284   fillbitmap(bitmap,machine->pens[0],cliprect);
284   fillbitmap(bitmap,0,cliprect);
285285   tilemap_draw(bitmap,cliprect,bg_tilemap,0,0);
286286   draw_sprites(machine, bitmap,cliprect);
287287   return 0;
src/mame/video/xevious.c
r1771r1772
194194   UINT8 color = ((attr & 0x03) << 4) | ((attr & 0x3c) >> 2);
195195   SET_TILE_INFO(
196196         0,
197         xevious_fg_videoram[tile_index] | (flip_screen ? 0x100 : 0),
197         xevious_fg_videoram[tile_index] | (flip_screen_get() ? 0x100 : 0),
198198         color,
199         TILE_FLIPYX((attr & 0xc0) >> 6) ^ (flip_screen ? TILE_FLIPX : 0));
199         TILE_FLIPYX((attr & 0xc0) >> 6) ^ (flip_screen_get() ? TILE_FLIPX : 0));
200200}
201201
202202static TILE_GET_INFO( get_bg_tile_info )
r1771r1772
450450         color = spriteram[offs + 1] & 0x7f;
451451         flipx = spriteram_3[offs] & 4;
452452         flipy = spriteram_3[offs] & 8;
453         if (flip_screen)
453         if (flip_screen_get())
454454         {
455455            flipx = !flipx;
456456            flipy = !flipy;
src/mame/video/blktiger.c
r1771r1772
209209      int color = attr & 0x07;
210210      int flipx = attr & 0x08;
211211
212      if (flip_screen)
212      if (flip_screen_get())
213213      {
214214         sx = 240 - sx;
215215         sy = 240 - sy;
r1771r1772
219219      drawgfx(bitmap,machine->gfx[2],
220220            code,
221221            color,
222            flipx,flip_screen,
222            flipx,flip_screen_get(),
223223            sx,sy,
224224            cliprect,TRANSPARENCY_PEN,15);
225225   }
src/mame/video/dynduke.c
r1771r1772
155155      sprite = buffered_spriteram16[offs+1];
156156      sprite &= 0x3fff;
157157
158      if (flip_screen) {
158      if (flip_screen_get()) {
159159         x=240-x;
160160         y=240-y;
161161         if (fx) fx=0; else fx=1;
src/mame/video/tunhunt.c
r1771r1772
196196   }
197197}
198198
199static void draw_motion_object(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
199static void draw_motion_object(mame_bitmap *bitmap, const rectangle *cliprect)
200200{
201201/*
202202 *      VSTRLO  0x1202
r1771r1772
229229         color = ((span_data>>6)&0x3)^0x3;
230230         count = (span_data&0x1f)+1;
231231         while( count-- && x < 256 )
232            *BITMAP_ADDR16(tmpbitmap, line, x++) = machine->pens[color];
232            *BITMAP_ADDR16(tmpbitmap, line, x++) = color;
233233      }
234234      while( x<256 )
235         *BITMAP_ADDR16(tmpbitmap, line, x++) = machine->pens[0];
235         *BITMAP_ADDR16(tmpbitmap, line, x++) = 0;
236236   } /* next line */
237237
238238   switch( tunhunt_ram[VSTRLO] )
r1771r1772
260260      scaley,/* incyy */
261261      0, /* no wraparound */
262262      cliprect,
263      TRANSPARENCY_PEN,machine->pens[0],
263      TRANSPARENCY_PEN,0,
264264      0 /* priority */
265265   );
266266}
267267
268static void draw_box(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
268static void draw_box(mame_bitmap *bitmap, const rectangle *cliprect)
269269{
270270/*
271271    This is unnecessarily slow, but the box priorities aren't completely understood,
r1771r1772
311311               }
312312            }
313313            if (x >= cliprect->min_x && x <= cliprect->max_x)
314               *BITMAP_ADDR16(bitmap, 0xff-y, x) = machine->pens[color];
314               *BITMAP_ADDR16(bitmap, 0xff-y, x) = color;
315315         }
316316   }
317317}
r1771r1772
373373{
374374   set_pens(machine->colortable);
375375
376   draw_box(machine, bitmap, cliprect);
376   draw_box(bitmap, cliprect);
377377
378   draw_motion_object(machine, bitmap, cliprect);
378   draw_motion_object(bitmap, cliprect);
379379
380380   draw_shell(machine, bitmap, cliprect,
381381      tunhunt_ram[SHL0PC],   /* picture code */
src/mame/video/tryout.c
r1771r1772
200200      fy = 0;
201201      inc = 16;
202202
203      if (flip_screen)
203      if (flip_screen_get())
204204      {
205205         x = 240 - x;
206206         fx = !fx;
r1771r1772
240240
241241   int scrollx;
242242
243   if (!flip_screen)
243   if (!flip_screen_get())
244244      tilemap_set_scrollx(fg_tilemap, 0, 16); /* Assumed hard-wired */
245245   else
246246      tilemap_set_scrollx(fg_tilemap, 0, -8); /* Assumed hard-wired */
src/mame/video/bublbobl.c
r1771r1772
7575            x = sx + xc * 8;
7676            y = (sy + yc * 8) & 0xff;
7777
78            if (flip_screen)
78            if (flip_screen_get())
7979            {
8080               x = 248 - x;
8181               y = 248 - y;
src/mame/video/skyfox.c
r1771r1772
243243
244244***************************************************************************/
245245
246static void draw_background(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
246static void draw_background(mame_bitmap *bitmap, const rectangle *cliprect)
247247{
248248   UINT8 *RAM   =   memory_region(REGION_GFX2);
249249   int x,y,i;
r1771r1772
271271      for (j = 0 ; j <= ((pen&0x80)?0:3); j++)
272272         *BITMAP_ADDR16(bitmap,
273273                     ( ((j/2)&1) + y ) % 256,
274                     ( (j&1)     + x ) % 512) = machine->pens[256+(pen&0x7f)];
274                     ( (j&1)     + x ) % 512) = 256+(pen&0x7f);
275275   }
276276}
277277
r1771r1772
287287
288288VIDEO_UPDATE( skyfox )
289289{
290   fillbitmap(bitmap,machine->pens[255],cliprect);   // the bg is black
291   draw_background(machine, bitmap, cliprect);
290   fillbitmap(bitmap,255,cliprect);   // the bg is black
291   draw_background(bitmap, cliprect);
292292   draw_sprites(machine, bitmap, cliprect);
293293   return 0;
294294}
src/mame/video/rocnrope.c
r1771r1772
9696
9797WRITE8_HANDLER( rocnrope_flipscreen_w )
9898{
99   if (flip_screen != (~data & 0x01))
99   if (flip_screen_get() != (~data & 0x01))
100100   {
101101      flip_screen_set(~data & 0x01);
102102      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
src/mame/video/docastle.c
r1771r1772
188188         flipy = spriteram[offs + 2] & 0x80;
189189      }
190190
191      if (flip_screen)
191      if (flip_screen_get())
192192      {
193193         sx = 240 - sx;
194194         sy = 240 - sy;
src/mame/video/mystston.c
r1771r1772
149149         int sx = 240 - spriteram[offs + 3];
150150         int sy = (240 - spriteram[offs + 2]) & 0xff;
151151
152         if (flip_screen)
152         if (flip_screen_get())
153153         {
154154            sx = 240 - sx;
155155            sy = 240 - sy;
src/mame/video/ygv608.c
r1771r1772
809809      tilemap_set_scroll_cols( tilemap_B, ygv608.page_x );
810810
811811      // now clear the screen in case we change to 1-plane mode
812      fillbitmap( work_bitmap, machine->pens[0], cliprect );
812      fillbitmap( work_bitmap, 0, cliprect );
813813
814814      // reset resize flag
815815      ygv608.tilemap_resize = 0;
r1771r1772
862862   if ((ygv608.regs.s.r7 & r7_md) & MD_1PLANE)
863863   {
864864      // If the background tilemap is disabled, we need to clear the bitmap to black
865      fillbitmap (work_bitmap,machine->pens[0],cliprect);
865      fillbitmap (work_bitmap,0,cliprect);
866866//      fillbitmap (work_bitmap,1,&machine->screen[0].visarea);
867867   }
868868   else
r1771r1772
900900  // for some reason we can't use an opaque tilemap_A
901901  // so use a transparent but clear the work bitmap first
902902  // - look at why this is the case?!?
903  fillbitmap( work_bitmap,
904              machine->pens[0],
905              &machine->screen[0].visarea );
903  fillbitmap( work_bitmap,0,&machine->screen[0].visarea );
906904
907905   if ((ygv608.regs.s.r11 & r11_prm) == PRM_ASBDEX ||
908906      (ygv608.regs.s.r11 & r11_prm) == PRM_ASEBDX )
r1771r1772
917915                   ygv608.ay, // + ( machine->screen[0].visarea.min_y << 16 ),
918916                   ygv608.dx, ygv608.dxy, ygv608.dyx, ygv608.dy, 0,
919917                   cliprect,
920                   TRANSPARENCY_PEN, machine->pens[0], 0 );
918                   TRANSPARENCY_PEN, 0, 0 );
921919  else
922920#endif
923    copybitmap_trans( bitmap, work_bitmap, 0, 0, 0, 0, cliprect, machine->pens[0] );
921    copybitmap_trans( bitmap, work_bitmap, 0, 0, 0, 0, cliprect, 0 );
924922
925923   if ((ygv608.regs.s.r11 & r11_prm) == PRM_SABDEX ||
926924      (ygv608.regs.s.r11 & r11_prm) == PRM_SEABDX)
src/mame/video/senjyo.c
r1771r1772
191191
192192
193193   if (senjyo_bgstripes == 0xff)   /* off */
194   {
195      fillbitmap(bitmap,machine->pens[0],cliprect);
196   }
194      fillbitmap(bitmap,0,cliprect);
197195   else
198196   {
199197      pen = 0;
200198      count = 0;
201199      strwid = senjyo_bgstripes;
202200      if (strwid == 0) strwid = 0x100;
203      if (flip_screen) strwid ^= 0xff;
201      if (flip_screen_get()) strwid ^= 0xff;
204202
205203      for (x = 0;x < 256;x++)
206204      {
207         if (flip_screen)
208         {
205         if (flip_screen_get())
209206            for (y = 0;y < 256;y++)
210               *BITMAP_ADDR16(bitmap, y, 255 - x) = machine->pens[384 + pen];
211         }
207               *BITMAP_ADDR16(bitmap, y, 255 - x) = 384 + pen;
212208         else
213         {
214209            for (y = 0;y < 256;y++)
215               *BITMAP_ADDR16(bitmap, y, x) = machine->pens[384 + pen];
216         }
210               *BITMAP_ADDR16(bitmap, y, x) = 384 + pen;
217211
218212         count += 0x10;
219213         if (count >= strwid)
r1771r1772
225219   }
226220}
227221
228static void draw_radar(running_machine *machine, mame_bitmap *bitmap,const rectangle *cliprect)
222static void draw_radar(mame_bitmap *bitmap,const rectangle *cliprect)
229223{
230224   int offs,x;
231225
232226   for (offs = 0;offs < 0x400;offs++)
233   {
234      if (senjyo_radarram[offs])
235      {
236         for (x = 0;x < 8;x++)
227      for (x = 0;x < 8;x++)
228         if (senjyo_radarram[offs] & (1 << x))
237229         {
238            if (senjyo_radarram[offs] & (1 << x))
239            {
240               int sx, sy;
230            int sx, sy;
241231
242               sx = (8 * (offs % 8) + x) + 256-64;
243               sy = ((offs & 0x1ff) / 8) + 96;
232            sx = (8 * (offs % 8) + x) + 256-64;
233            sy = ((offs & 0x1ff) / 8) + 96;
244234
245               if (flip_screen)
246               {
247                  sx = 255 - sx;
248                  sy = 255 - sy;
249               }
250
251               if (sy >= cliprect->min_y && sy <= cliprect->max_y &&
252                  sx >= cliprect->min_x && sx <= cliprect->max_x)
253                  *BITMAP_ADDR16(bitmap, sy, sx) = machine->pens[offs < 0x200 ? 512 : 513];
235            if (flip_screen_get())
236            {
237               sx = 255 - sx;
238               sy = 255 - sy;
254239            }
240
241            if (sy >= cliprect->min_y && sy <= cliprect->max_y &&
242               sx >= cliprect->min_x && sx <= cliprect->max_x)
243               *BITMAP_ADDR16(bitmap, sy, sx) = offs < 0x200 ? 512 : 513;
255244         }
256      }
257   }
258245}
259246
260247static void draw_sprites(running_machine *machine, mame_bitmap *bitmap,const rectangle *cliprect,int priority)
r1771r1772
280267         flipx = spriteram[offs+1] & 0x40;
281268         flipy = spriteram[offs+1] & 0x80;
282269
283         if (flip_screen)
270         if (flip_screen_get())
284271         {
285272            flipx = !flipx;
286273            flipy = !flipy;
r1771r1772
325312
326313      scrollx = senjyo_scrollx1[0];
327314      scrolly = senjyo_scrolly1[0] + 256 * senjyo_scrolly1[1];
328      if (flip_screen)
315      if (flip_screen_get())
329316         scrollx = -scrollx;
330317      tilemap_set_scrollx(bg1_tilemap,0,scrollx);
331318      tilemap_set_scrolly(bg1_tilemap,0,scrolly);
r1771r1772
337324         scrollx = senjyo_scrollx1[0];
338325         scrolly = senjyo_scrolly1[0] + 256 * senjyo_scrolly1[1];
339326      }
340      if (flip_screen)
327      if (flip_screen_get())
341328         scrollx = -scrollx;
342329      tilemap_set_scrollx(bg2_tilemap,0,scrollx);
343330      tilemap_set_scrolly(bg2_tilemap,0,scrolly);
344331
345332      scrollx = senjyo_scrollx3[0];
346333      scrolly = senjyo_scrolly3[0] + 256 * senjyo_scrolly3[1];
347      if (flip_screen)
334      if (flip_screen_get())
348335         scrollx = -scrollx;
349336      tilemap_set_scrollx(bg3_tilemap,0,scrollx);
350337      tilemap_set_scrolly(bg3_tilemap,0,scrolly);
r1771r1772
359346   tilemap_draw(bitmap,cliprect,bg1_tilemap,0,0);
360347   draw_sprites(machine, bitmap,cliprect,3);
361348   tilemap_draw(bitmap,cliprect,fg_tilemap,0,0);
362   draw_radar(machine, bitmap,cliprect);
349   draw_radar(bitmap,cliprect);
363350
364351#if 0
365352{
src/mame/video/yiear.c
r1771r1772
7171{
7272   /* bit 0 flips screen */
7373
74   if (flip_screen != (data & 0x01))
74   if (flip_screen_get() != (data & 0x01))
7575   {
7676      flip_screen_set(data & 0x01);
7777      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
r1771r1772
122122      int sy = 240 - spriteram[offs + 1];
123123      int sx = spriteram_2[offs];
124124
125      if (flip_screen)
125      if (flip_screen_get())
126126      {
127127         sy = 240 - sy;
128128         flipy = !flipy;
src/mame/video/nbmj9195.c
r1771r1772
504504      // nbmj9195 1layer
505505      copyscrollbitmap(bitmap, nbmj9195_tmpbitmap[0], SCANLINE_MAX, nbmj9195_scrollx_raster[0], 1, &scrolly[0], cliprect);
506506   else
507      fillbitmap(bitmap, machine->pens[0x0ff], 0);
507      fillbitmap(bitmap, 0x0ff, 0);
508508
509509   if (nbmj9195_dispflag[1])
510510   {
511511      if (gfxdraw_mode == 1)
512512         // nbmj9195 2layer
513         copyscrollbitmap_trans(bitmap, nbmj9195_tmpbitmap[1], SCANLINE_MAX, nbmj9195_scrollx_raster[1], 1, &scrolly[1], cliprect, machine->pens[0x0ff]);
513         copyscrollbitmap_trans(bitmap, nbmj9195_tmpbitmap[1], SCANLINE_MAX, nbmj9195_scrollx_raster[1], 1, &scrolly[1], cliprect, 0x0ff);
514514
515515      if (gfxdraw_mode == 2)
516516         // nbmj9195 nb22090 2layer
517         copyscrollbitmap_trans(bitmap, nbmj9195_tmpbitmap[1], SCANLINE_MAX, nbmj9195_scrollx_raster[1], 1, &scrolly[1], cliprect, machine->pens[0x1ff]);
517         copyscrollbitmap_trans(bitmap, nbmj9195_tmpbitmap[1], SCANLINE_MAX, nbmj9195_scrollx_raster[1], 1, &scrolly[1], cliprect, 0x1ff);
518518   }
519519   return 0;
520520}
src/mame/video/sonson.c
r1771r1772
109109
110110WRITE8_HANDLER( sonson_flipscreen_w )
111111{
112   if (flip_screen != (~data & 0x01))
112   if (flip_screen_get() != (~data & 0x01))
113113   {
114114      flip_screen_set(~data & 0x01);
115115      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
r1771r1772
145145      int sx = spriteram[offs + 3];
146146      int sy = spriteram[offs + 0];
147147
148      if (flip_screen)
148      if (flip_screen_get())
149149      {
150150         sx = 240 - sx;
151151         sy = 240 - sy;
src/mame/video/simpl156.c
r1771r1772
4040{
4141   int offs;
4242
43   flip_screen = 1;
43   //FIXME: flip_screen_x should not be written!
44   flip_screen_set_no_update(1);
4445
4546   for (offs = (0x1400/4)-4;offs >= 0;offs -= 4) // 0x1400 for charlien
4647   {
r1771r1772
8687         inc = 1;
8788      }
8889
89      if (flip_screen)
90      if (flip_screen_get())
9091      {
9192         y=240-y;
9293         x=304-x;
r1771r1772
117118
118119   deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll);
119120
120   fillbitmap(bitmap,machine->pens[256],cliprect);
121   fillbitmap(bitmap,256,cliprect);
121122
122123   deco16_tilemap_2_draw(bitmap,cliprect,0,2);
123124   deco16_tilemap_1_draw(bitmap,cliprect,0,4);
src/mame/video/deadang.c
r1771r1772
108108      color = (spriteram16[offs+1]>>12)&0xf;
109109      sprite = spriteram16[offs+1]&0xfff;
110110
111      if (flip_screen) {
111      if (flip_screen_get()) {
112112         x=240-x;
113113         y=240-y;
114114         if (fx) fx=0; else fx=1;
src/mame/video/copsnrob.c
r1771r1772
3838
3939    /* Draw the cars. Positioning was based on a screen shot */
4040    if (copsnrob_cary[0])
41    {
4241        drawgfx(bitmap,machine->gfx[1],
4342                copsnrob_carimage[0],0,
4443                1,0,
4544                0xe4,256-copsnrob_cary[0],
4645                cliprect,TRANSPARENCY_PEN,0);
47    }
4846
4947    if (copsnrob_cary[1])
50    {
5148        drawgfx(bitmap,machine->gfx[1],
5249                copsnrob_carimage[1],0,
5350                1,0,
5451                0xc4,256-copsnrob_cary[1],
5552                cliprect,TRANSPARENCY_PEN,0);
56    }
5753
5854    if (copsnrob_cary[2])
59    {
6055        drawgfx(bitmap,machine->gfx[1],
6156                copsnrob_carimage[2],0,
6257                0,0,
6358                0x24,256-copsnrob_cary[2],
6459                cliprect,TRANSPARENCY_PEN,0);
65    }
6660
6761    if (copsnrob_cary[3])
68    {
6962        drawgfx(bitmap,machine->gfx[1],
7063                copsnrob_carimage[3],0,
7164                0,0,
7265                0x04,256-copsnrob_cary[3],
7366                cliprect,TRANSPARENCY_PEN,0);
74    }
7567
7668
7769    /* Draw the beer truck. Positioning was based on a screen shot.
r1771r1772
143135            if (val & mask1)
144136            {
145137                for (y = 0; y <= machine->screen[0].visarea.max_y; y++)
146                {
147138                    if (copsnrob_bulletsram[y] & mask2)
148                    {
149                  *BITMAP_ADDR16(bitmap, y, 256-x) = machine->pens[1];
150                    }
151                }
139                  *BITMAP_ADDR16(bitmap, y, 256-x) = 1;
152140            }
153141
154142            mask1 <<= 1;
src/mame/video/twincobr.c
r1771r1772
500500
501501   if (wardner_sprite_hack) wardner_sprite_priority_hack();
502502
503   fillbitmap(bitmap,machine->pens[0],cliprect);
503   fillbitmap(bitmap,0,cliprect);
504504
505505   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_OPAQUE,0);
506506   draw_sprites(machine, bitmap,cliprect,0x0400);
src/mame/video/bking.c
r1771r1772
149149
150150   coin_lockout_global_w(~data & 0x01);
151151
152   flip_screen = data & 0x04;
152   flip_screen_set_no_update(data & 0x04);
153153
154   tilemap_set_flip(ALL_TILEMAPS, flip_screen ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
154   tilemap_set_flip(ALL_TILEMAPS, flip_screen_get() ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
155155
156156   controller = data & 0x02;
157157
r1771r1772
323323      latch = 0x0400;
324324   }
325325
326   tilemap_set_scrollx(bg_tilemap, 0, flip_screen ? -xld : xld);
327   tilemap_set_scrolly(bg_tilemap, 0, flip_screen ? -yld : yld);
326   tilemap_set_scrollx(bg_tilemap, 0, flip_screen_get() ? -xld : xld);
327   tilemap_set_scrolly(bg_tilemap, 0, flip_screen_get() ? -yld : yld);
328328
329329   tilemap_draw(helper0, &rect, bg_tilemap, 0, 0);
330330
r1771r1772
350350               int col = (xld + x) / 8 + 1;
351351               int row = (yld + y) / 8 + 0;
352352
353               latch |= (flip_screen ? 31 - col : col) << 0;
354               latch |= (flip_screen ? 31 - row : row) << 5;
353               latch |= (flip_screen_get() ? 31 - col : col) << 0;
354               latch |= (flip_screen_get() ? 31 - row : row) << 5;
355355
356356               pc3259_output[0] = (latch >> 0x0) & 0xf;
357357               pc3259_output[1] = (latch >> 0x4) & 0xf;
src/mame/video/galpani2.c
r1771r1772
164164   if (msk != 0) layers_ctrl &= msk;   }
165165#endif
166166
167   fillbitmap(bitmap,machine->pens[0],cliprect);
167   fillbitmap(bitmap,0,cliprect);
168168   fillbitmap(priority_bitmap,0,cliprect);
169169
170170   if (layers_ctrl & 0x1)
r1771r1772
173173      int y = 0;
174174      copyscrollbitmap_trans(bitmap, galpani2_bg15_bitmap,
175175                        1, &x, 1, &y,
176                        cliprect,machine->pens[0x4200 + 0]);
176                        cliprect,0x4200 + 0);
177177   }
178178
179179/*  test mode:
r1771r1772
188188      int y = - ( *galpani2_bg8_0_scrolly + 0x200 - 0x1be );
189189      copyscrollbitmap_trans(bitmap, galpani2_bg8_bitmap_0,
190190                        1, &x, 1, &y,
191                        cliprect,machine->pens[0x4000 + 0]);
191                        cliprect,0x4000 + 0);
192192   }
193193
194194   if (layers_ctrl & 0x4)
r1771r1772
197197      int y = - ( *galpani2_bg8_1_scrolly + 0x200 - 0x1be );
198198      copyscrollbitmap_trans(bitmap, galpani2_bg8_bitmap_1,
199199                        1, &x, 1, &y,
200                        cliprect,machine->pens[0x4000 + 0]);
200                        cliprect,0x4000 + 0);
201201   }
202202
203203   if (layers_ctrl & 0x8)   kaneko16_draw_sprites(machine, bitmap, cliprect);
src/mame/video/thief.c
r1771r1772
113113VIDEO_UPDATE( thief ){
114114   UINT32 offs;
115115   int flipscreen = thief_video_control&1;
116   const pen_t *pal_data = machine->pens;
117116   const UINT8 *source = videoram;
118117
119118   if( thief_video_control&4 ) /* visible page */
r1771r1772
130129      if( flipscreen ){
131130         for( bit=0; bit<8; bit++ ){
132131            *BITMAP_ADDR16(bitmap, 0xff - ypos, 0xff - (xpos+bit)) =
133               pal_data[
134132                  (((plane0<<bit)&0x80)>>7) |
135133                  (((plane1<<bit)&0x80)>>6) |
136134                  (((plane2<<bit)&0x80)>>5) |
137                  (((plane3<<bit)&0x80)>>4)];
135                  (((plane3<<bit)&0x80)>>4);
138136         }
139137      }
140138      else {
141139         for( bit=0; bit<8; bit++ ){
142140            *BITMAP_ADDR16(bitmap, ypos, xpos+bit) =
143               pal_data[
144141                  (((plane0<<bit)&0x80)>>7) |
145142                  (((plane1<<bit)&0x80)>>6) |
146143                  (((plane2<<bit)&0x80)>>5) |
147                  (((plane3<<bit)&0x80)>>4)];
144                  (((plane3<<bit)&0x80)>>4);
148145         }
149146      }
150147   }
src/mame/video/ddragon3.c
r1771r1772
4545      case 1: return ddragon3_fg_scrolly;
4646      case 2: return ddragon3_bg_scrollx;
4747      case 3: return ddragon3_bg_scrolly;
48      case 5: return flip_screen;
48      case 5: return flip_screen_get();
4949      case 6: return ddragon3_bg_tilebase;
5050   }
5151
r1771r1772
153153         if (attr & 0x02) sy = 239 + (0x100 - sy); else sy = 240 - sy;
154154         if (sx > 0x17f) sx = 0 - (0x200 - sx);
155155
156         if (flip_screen)
156         if (flip_screen_get())
157157         {
158158            sx = 304 - sx;
159159            sy = 224 - sy;
r1771r1772
164164         for (i = 0; i <= height; i++)
165165         {
166166            drawgfx(bitmap, machine->gfx[1], code + i, color, flipx, flipy,
167               sx, sy + (flip_screen ? (i * 16) : (-i * 16)), cliprect,
167               sx, sy + (flip_screen_get() ? (i * 16) : (-i * 16)), cliprect,
168168               TRANSPARENCY_PEN, 0);
169169         }
170170      }
src/mame/video/ambush.c
r1771r1772
7373
7474      code = videoram[offs] | ((col & 0x60) << 3);
7575
76      if (flip_screen)
76      if (flip_screen_get())
7777      {
7878         sx = 31 - sx;
7979         sy = 31 - sy;
r1771r1772
8383      drawgfx(bitmap,machine->gfx[0],
8484            code,
8585            (col & 0x0f) | ((*ambush_colorbank & 0x03) << 4),
86            flip_screen,flip_screen,
86            flip_screen_get(),flip_screen_get(),
8787            8*sx, (8*sy + scroll) & 0xff,
8888            cliprect,transparency,0);
8989   }
r1771r1772
124124         /* 16x16 sprites */
125125         gfx = 1;
126126
127         if (!flip_screen)
127         if (!flip_screen_get())
128128         {
129129            sy = 240 - sy;
130130         }
r1771r1772
139139         gfx = 0;
140140         code <<= 2;
141141
142         if (!flip_screen)
142         if (!flip_screen_get())
143143         {
144144            sy = 248 - sy;
145145         }
r1771r1772
153153      flipx = spriteram[offs + 1] & 0x40;
154154      flipy = spriteram[offs + 1] & 0x80;
155155
156      if (flip_screen)
156      if (flip_screen_get())
157157      {
158158         flipx = !flipx;
159159         flipy = !flipy;
src/mame/video/sauro.c
r1771r1772
7878
7979WRITE8_HANDLER( sauro_scroll_fg_w )
8080{
81   const int *map = (flip_screen ? scroll2_map_flip : scroll2_map);
81   const int *map = (flip_screen_get() ? scroll2_map_flip : scroll2_map);
8282   int scroll = (data & 0xf8) | map[data & 7];
8383
8484   tilemap_set_scrollx(fg_tilemap, 0, scroll);
r1771r1772
126126
127127      flipx = spriteram[offs+3] & 0x04;
128128
129      if (flip_screen)
129      if (flip_screen_get())
130130      {
131131         flipx = !flipx;
132132         sx = (235 - sx) & 0xff;  // The &0xff is not 100% percent correct
r1771r1772
136136      drawgfx(bitmap, machine->gfx[2],
137137            code,
138138            color,
139            flipx,flip_screen,
139            flipx,flip_screen_get(),
140140            sx,sy,
141141            cliprect,TRANSPARENCY_PEN,0);
142142   }
r1771r1772
201201
202202      flipx = spriteram[offs+3] & 0x04;
203203
204      if (flip_screen)
204      if (flip_screen_get())
205205      {
206206         flipx = !flipx;
207207         sx = (235 - sx) & 0xff;  /* The &0xff is not 100% percent correct */
r1771r1772
211211      drawgfx(bitmap, machine->gfx[1],
212212            code,
213213            color,
214            flipx,flip_screen,
214            flipx,flip_screen_get(),
215215            sx,sy,
216216            cliprect,TRANSPARENCY_PEN,0);
217217   }
src/mame/video/gaplus.c
r1771r1772
172172            if ( color && total_stars < MAX_STARS ) {
173173               stars[total_stars].x = x;
174174               stars[total_stars].y = y;
175               stars[total_stars].col = machine->pens[color];
175               stars[total_stars].col = color;
176176               stars[total_stars].set = set++;
177177
178178               if ( set == 3 )
r1771r1772
291291         int duplicate = spriteram_3[offs] & 0x80;
292292         int x,y;
293293
294         if (flip_screen)
294         if (flip_screen_get())
295295         {
296296            flipx ^= 1;
297297            flipy ^= 1;
r1771r1772
322322   /* flip screen control is embedded in RAM */
323323   flip_screen_set(gaplus_spriteram[0x1f7f-0x800] & 1);
324324
325   fillbitmap(bitmap, machine->pens[0], cliprect);
325   fillbitmap(bitmap, 0, cliprect);
326326
327327   starfield_render(machine, bitmap);
328328
src/mame/video/system1.c
r1771r1772
288288      x_flipped = x;
289289      y = y_flipped = sy+row;
290290
291      if (flip_screen)
291      if (flip_screen_get())
292292      {
293293         y_flipped = 258 - sy - height + row;
294294         x_flipped = (252*2) - x;
r1771r1772
322322         if (color1)
323323            draw_pixel(bitmap,x,y,x_flipped,y_flipped,spr_number,sprite_palette_base+color1);
324324         x++;
325         x_flipped += flip_screen ? -1 : 1;
325         x_flipped += flip_screen_get() ? -1 : 1;
326326
327327         if (color2 == 15) break;
328328         if (color2)
329329            draw_pixel(bitmap,x,y,x_flipped,y_flipped,spr_number,sprite_palette_base+color2);
330330         x++;
331         x_flipped += flip_screen ? -1 : 1;
331         x_flipped += flip_screen_get() ? -1 : 1;
332332      }
333333   }
334334}
r1771r1772
382382         sx = (offs/2) % 32;
383383         sy = (offs/2) / 32;
384384
385         if (flip_screen)
385         if (flip_screen_get())
386386         {
387387            sx = 31 - sx;
388388            sy = 31 - sy;
r1771r1772
396396            drawgfx(bitmap,machine->gfx[0],
397397                  code,
398398                  color,
399                  flip_screen,flip_screen,
399                  flip_screen_get(),flip_screen_get(),
400400                  8*sx + blockgal_kludgeoffset,8*sy,
401401                  cliprect,TRANSPARENCY_PEN,0);
402402         }
r1771r1772
441441            sx = (offs/2) % 32;
442442            sy = (offs/2) / 32;
443443
444            if (flip_screen)
444            if (flip_screen_get())
445445            {
446446               sx = 31 - sx;
447447               sy = 31 - sy;
r1771r1772
450450            drawgfx(tmp_bitmap,machine->gfx[0],
451451                  code,
452452                  color,
453                  flip_screen,flip_screen,
453                  flip_screen_get(),flip_screen_get(),
454454                  8*sx,8*sy,
455455                  0,TRANSPARENCY_NONE,0);
456456         }
457457      }
458458
459459      /* copy the temporary bitmap to the screen */
460      if (flip_screen)
460      if (flip_screen_get())
461461         copyscrollbitmap(bitmap,tmp_bitmap,1,&background_scrollx_flip,1,&background_scrolly_flip,cliprect);
462462      else
463463         copyscrollbitmap(bitmap,tmp_bitmap,1,&background_scrollx,1,&background_scrolly,cliprect);
r1771r1772
479479            sx = (offs/2) % 32;
480480            sy = (offs/2) / 32;
481481
482            if (flip_screen)
482            if (flip_screen_get())
483483            {
484484               sx = 8*(31-sx) + background_scrollx_flip;
485485               sy = 8*(31-sy) + background_scrolly_flip;
r1771r1772
494494            drawgfx(bitmap,machine->gfx[0],
495495                  code,
496496                  color,
497                  flip_screen,flip_screen,
497                  flip_screen_get(),flip_screen_get(),
498498                  sx,sy,
499499                  cliprect,TRANSPARENCY_PEN,0);
500500            drawgfx(bitmap,machine->gfx[0],
501501                  code,
502502                  color,
503                  flip_screen,flip_screen,
503                  flip_screen_get(),flip_screen_get(),
504504                  sx-256,sy,
505505                  cliprect,TRANSPARENCY_PEN,0);
506506            drawgfx(bitmap,machine->gfx[0],
507507                  code,
508508                  color,
509                  flip_screen,flip_screen,
509                  flip_screen_get(),flip_screen_get(),
510510                  sx,sy-256,
511511                  cliprect,TRANSPARENCY_PEN,0);
512512            drawgfx(bitmap,machine->gfx[0],
513513                  code,
514514                  color,
515                  flip_screen,flip_screen,
515                  flip_screen_get(),flip_screen_get(),
516516                  sx-256,sy-256,
517517                  cliprect,TRANSPARENCY_PEN,0);
518518         }
r1771r1772
535535
536536   /* even if screen is off, sprites must still be drawn to update the collision table */
537537   if (system1_video_mode & 0x10)  /* screen off */
538      fillbitmap(bitmap,machine->pens[0],cliprect);
538      fillbitmap(bitmap,0,cliprect);
539539   return 0;
540540}
541541
r1771r1772
583583            sx = (offs/2) % 32;
584584            sy = (offs/2) / 32;
585585
586            if (flip_screen)
586            if (flip_screen_get())
587587            {
588588               sx = 31 - sx;
589589               sy = 31 - sy;
r1771r1772
592592            drawgfx(tmp_bitmap,machine->gfx[0],
593593                  code,
594594                  color,
595                  flip_screen,flip_screen,
595                  flip_screen_get(),flip_screen_get(),
596596                  8*sx,8*sy,
597597                  0,TRANSPARENCY_NONE,0);
598598         }
r1771r1772
601601      /* copy the temporary bitmap to the screen */
602602      if (choplifter_scroll_x_on)
603603      {
604         if (flip_screen)
604         if (flip_screen_get())
605605         {
606606            int scrollx_row_flip[32],i;
607607
r1771r1772
633633            sx = (offs/2) % 32;
634634            sy = (offs/2) / 32;
635635
636            if (flip_screen)
636            if (flip_screen_get())
637637            {
638638               sx = 8*(31-sx);
639639
r1771r1772
653653            drawgfx(bitmap,machine->gfx[0],
654654                  code,
655655                  color,
656                  flip_screen,flip_screen,
656                  flip_screen_get(),flip_screen_get(),
657657                  sx,8*sy,
658658                  cliprect,TRANSPARENCY_PEN,0);
659659         }
r1771r1772
676676
677677   /* even if screen is off, sprites must still be drawn to update the collision table */
678678   if (system1_video_mode & 0x10)  /* screen off */
679      fillbitmap(bitmap,machine->pens[0],cliprect);
679      fillbitmap(bitmap,0,cliprect);
680680
681681
682682#ifdef MAME_DEBUG
r1771r1772
736736            if (x > 256) x -= 512;
737737            if (y > 224) y -= 512;
738738
739            if (flip_screen)
739            if (flip_screen_get())
740740            {
741741               x = 248 - x;
742742               y = 248 - y;
r1771r1772
750750               drawgfx(bitmap,machine->gfx[0],
751751                     code,
752752                     ((code >> 5) & 0x3f) + 64,
753                     flip_screen,flip_screen,
753                     flip_screen_get(),flip_screen_get(),
754754                     x,y,
755755                     cliprect, TRANSPARENCY_NONE, 0);
756756            else if (priority)
757757               drawgfx(bitmap,machine->gfx[0],
758758                     code,
759759                     ((code >> 5) & 0x3f) + 64,
760                     flip_screen,flip_screen,
760                     flip_screen_get(),flip_screen_get(),
761761                     x,y,
762762                     cliprect, TRANSPARENCY_PEN, 0);
763763
r1771r1772
782782      code = wbml_paged_videoram[offs] | (wbml_paged_videoram[offs+1] << 8);
783783      code = ((code >> 4) & 0x800) | (code & 0x7ff);
784784
785      if (flip_screen)
785      if (flip_screen_get())
786786      {
787787         sx = 31 - sx;
788788         sy = 31 - sy;
r1771r1772
791791      drawgfx(bitmap,machine->gfx[0],
792792            code,
793793            (code >> 5) & 0x3f,
794            flip_screen,flip_screen,
794            flip_screen_get(),flip_screen_get(),
795795            8*sx,8*sy,
796796            cliprect,TRANSPARENCY_PEN,0);
797797   }
r1771r1772
807807
808808   /* even if screen is off, sprites must still be drawn to update the collision table */
809809   if (system1_video_mode & 0x10)  /* screen off */
810      fillbitmap(bitmap,machine->pens[0],cliprect);
810      fillbitmap(bitmap,0,cliprect);
811811   return 0;
812812}
813813
r1771r1772
837837            if (x > 256) x -= 512;
838838            if (y > 224) y -= 512;
839839
840            if (flip_screen)
840            if (flip_screen_get())
841841            {
842842               x = 248 - x;
843843               y = 248 - y;
r1771r1772
851851               drawgfx(bitmap,machine->gfx[0],
852852                     code,
853853                     ((code >> 5) & 0x3f) + 64,
854                     flip_screen,flip_screen,
854                     flip_screen_get(),flip_screen_get(),
855855                     x,y,
856856                     cliprect, TRANSPARENCY_NONE, 0);
857857            else if (priority)
858858               drawgfx(bitmap,machine->gfx[0],
859859                     code,
860860                     ((code >> 5) & 0x3f) + 64,
861                     flip_screen,flip_screen,
861                     flip_screen_get(),flip_screen_get(),
862862                     x,y,
863863                     cliprect, TRANSPARENCY_PEN, 0);
864864
r1771r1772
877877
878878   /* even if screen is off, sprites must still be drawn to update the collision table */
879879   if (system1_video_mode & 0x10)  /* screen off */
880      fillbitmap(bitmap,machine->pens[0],cliprect);
880      fillbitmap(bitmap,0,cliprect);
881881   return 0;
882882}
883883
r1771r1772
898898
899899   /* even if screen is off, sprites must still be drawn to update the collision table */
900900   if (system1_video_mode & 0x10)  /* screen off */
901      fillbitmap(bitmap,machine->pens[0],cliprect);
901      fillbitmap(bitmap,0,cliprect);
902902
903903   blockgal_kludgeoffset = 0;
904904   return 0;
src/mame/video/powerins.c
r1771r1772
299299
300300      /* Handle flip_screen. Apply a global offset of 32 pixels along x too */
301301
302      if (flip_screen)
302      if (flip_screen_get())
303303      {   sx = screen_w - sx - dimx*16 - 32;   flipx = !flipx;
304304         sy = screen_h - sy - dimy*16;      flipy = !flipy;
305305         code += dimx*dimy-1;         inc = -1;   }
r1771r1772
367367#endif
368368
369369   if (layers_ctrl&1)      tilemap_draw(bitmap,cliprect, tilemap_0, 0, 0);
370   else               fillbitmap(bitmap,machine->pens[0],cliprect);
370   else               fillbitmap(bitmap,0,cliprect);
371371   if (layers_ctrl&8)      draw_sprites(machine,bitmap,cliprect);
372372   if (layers_ctrl&2)      tilemap_draw(bitmap,cliprect, tilemap_1, 0, 0);
373373   return 0;
src/mame/video/niyanpai.c
r1771r1772
436436   if (niyanpai_dispflag[0])
437437      copyscrollbitmap(bitmap, niyanpai_tmpbitmap[0], 1, &scrollx[0], 1, &scrolly[0], cliprect);
438438   else
439      fillbitmap(bitmap, machine->pens[0x00ff], 0);
439      fillbitmap(bitmap, 0x00ff, 0);
440440
441441   if (niyanpai_dispflag[1])
442      copyscrollbitmap_trans(bitmap, niyanpai_tmpbitmap[1], 1, &scrollx[1], 1, &scrolly[1], cliprect, machine->pens[0x01ff]);
442      copyscrollbitmap_trans(bitmap, niyanpai_tmpbitmap[1], 1, &scrollx[1], 1, &scrolly[1], cliprect, 0x01ff);
443443
444444   if (niyanpai_dispflag[2])
445      copyscrollbitmap_trans(bitmap, niyanpai_tmpbitmap[2], 1, &scrollx[2], 1, &scrolly[2], cliprect, machine->pens[0x02ff]);
445      copyscrollbitmap_trans(bitmap, niyanpai_tmpbitmap[2], 1, &scrollx[2], 1, &scrolly[2], cliprect, 0x02ff);
446446
447447   return 0;
448448}
src/mame/video/exedexes.c
r1771r1772
222222      tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
223223   }
224224   else
225   {
226      fillbitmap(bitmap, machine->pens[0], cliprect);
227   }
225      fillbitmap(bitmap, 0, cliprect);
228226
229227   draw_sprites(machine, bitmap, cliprect, 1);
230228
src/mame/video/seta2.c
r1771r1772
374374
375375VIDEO_UPDATE( seta2 )
376376{
377   /* Black or pens[0]? */
378   fillbitmap(bitmap,machine->pens[0],cliprect);
377   /* Black or pen 0? */
378   fillbitmap(bitmap,0,cliprect);
379379
380380   if (seta2_vregs[0x30/2] & 1)   return 0;      // BLANK SCREEN
381381
src/mame/video/dynax.c
r1771r1772
10721072    I,O        -  Change palette (-,+)
10731073    J,K & N,M  -  Change "tile"  (-,+, slow & fast)
10741074    R          -  move "tile" to the next 1/8th of the gfx  */
1075static int debug_viewer(running_machine *machine, mame_bitmap *bitmap,const rectangle *cliprect)
1075static int debug_viewer(mame_bitmap *bitmap,const rectangle *cliprect)
10761076{
10771077#ifdef MAME_DEBUG
10781078   static int toggle;
r1771r1772
10931093      dynax_blit_palettes = (c & 0xf) * 0x111;
10941094      dynax_blit_palbank  = (c >>  4) & 1;
10951095
1096      fillbitmap(bitmap,machine->pens[0],cliprect);
1096      fillbitmap(bitmap,0,cliprect);
10971097      memset(dynax_pixmap[0][0],0,sizeof(UINT8)*0x100*0x100);
10981098      if (layer_layout != LAYOUT_MJDIALQ2)
10991099         memset(dynax_pixmap[0][1],0,sizeof(UINT8)*0x100*0x100);
r1771r1772
11161116   int layers_ctrl = ~dynax_layer_enable;
11171117   int lay[4];
11181118
1119   if (debug_viewer(machine,bitmap,cliprect))   return 0;
1119   if (debug_viewer(bitmap,cliprect))   return 0;
11201120   layers_ctrl &= debug_mask();
11211121
11221122   fillbitmap(
11231123      bitmap,
1124      machine->pens[(dynax_blit_backpen & 0xff) + (dynax_blit_palbank & 1) * 256],
1124      (dynax_blit_backpen & 0xff) + (dynax_blit_palbank & 1) * 256,
11251125      cliprect);
11261126
11271127   /* bit 4 = display enable? */
r1771r1772
11521152   int lay[4];
11531153   int pri;
11541154
1155   if (debug_viewer(machine,bitmap,cliprect))   return 0;
1155   if (debug_viewer(bitmap,cliprect))   return 0;
11561156   layers_ctrl &= debug_mask();
11571157
11581158   fillbitmap(
11591159      bitmap,
1160      machine->pens[(dynax_blit_backpen & 0xff) + (dynax_blit_palbank & 0x0f) * 256],
1160      (dynax_blit_backpen & 0xff) + (dynax_blit_palbank & 0x0f) * 256,
11611161      cliprect);
11621162
11631163   pri = hanamai_priority >> 4;
r1771r1772
11871187{
11881188   int layers_ctrl = ~dynax_layer_enable;
11891189
1190   if (debug_viewer(machine,bitmap,cliprect))   return 0;
1190   if (debug_viewer(bitmap,cliprect))   return 0;
11911191   layers_ctrl &= debug_mask();
11921192
11931193   fillbitmap(
11941194      bitmap,
1195      machine->pens[(dynax_blit_backpen & 0xff) + (dynax_blit_palbank & 1) * 256],
1195      (dynax_blit_backpen & 0xff) + (dynax_blit_palbank & 1) * 256,
11961196      cliprect);
11971197
11981198   if (layers_ctrl & 1)   hanamai_copylayer( bitmap, cliprect, 0 );
r1771r1772
12061206
12071207   int layers_ctrl = dynax_layer_enable;
12081208
1209   if (debug_viewer(machine,bitmap,cliprect))   return 0;
1209   if (debug_viewer(bitmap,cliprect))   return 0;
12101210   layers_ctrl &= debug_mask();
12111211
12121212   fillbitmap(
12131213      bitmap,
1214      machine->pens[(dynax_blit_backpen & 0xff) + (dynax_blit_palbank & 1) * 256],
1214      (dynax_blit_backpen & 0xff) + (dynax_blit_palbank & 1) * 256,
12151215      cliprect);
12161216
12171217   if (screen==0)
r1771r1772
12371237{
12381238   int layers_ctrl = ~dynax_layer_enable;
12391239
1240   if (debug_viewer(machine,bitmap,cliprect))   return 0;
1240   if (debug_viewer(bitmap,cliprect))   return 0;
12411241   layers_ctrl &= debug_mask();
12421242
12431243   fillbitmap(
12441244      bitmap,
1245      machine->pens[(dynax_blit_backpen & 0xff) + (dynax_blit_palbank & 1) * 256],
1245      (dynax_blit_backpen & 0xff) + (dynax_blit_palbank & 1) * 256,
12461246      cliprect);
12471247
12481248   if (layers_ctrl & 1)   mjdialq2_copylayer( bitmap, cliprect, 0 );
src/mame/video/shootout.c
r1771r1772
106106            int flipx = (attributes & 0x04);
107107            int flipy = 0;
108108
109            if (flip_screen) {
109            if (flip_screen_get()) {
110110               flipx = !flipx;
111111               flipy = !flipy;
112112            }
r1771r1772
117117
118118               vx = sx;
119119               vy = sy;
120               if (flip_screen) {
120               if (flip_screen_get()) {
121121                  vx = 240 - vx;
122122                  vy = 240 - vy;
123123               }
r1771r1772
136136
137137            vx = sx;
138138            vy = sy;
139            if (flip_screen) {
139            if (flip_screen_get()) {
140140               vx = 240 - vx;
141141               vy = 240 - vy;
142142            }
src/mame/video/paradise.c
r1771r1772
198198      int flipx   =   0;   // ?
199199      int flipy   =   0;
200200
201      if (flip_screen)   {   x = 0xf0 - x;   flipx = !flipx;
201      if (flip_screen_get())   {   x = 0xf0 - x;   flipx = !flipx;
202202                        y = 0xf0 - y;   flipy = !flipy;   }
203203
204204      drawgfx(bitmap,machine->gfx[0],
r1771r1772
259259
260260   if (layers_ctrl&1)   tilemap_draw(bitmap,cliprect, tilemap_0, 0,0);
261261   if (layers_ctrl&2)   tilemap_draw(bitmap,cliprect, tilemap_1, 0,0);
262   if (layers_ctrl&4)   copybitmap_trans(bitmap,tmpbitmap,flip_screen,flip_screen,0,0,cliprect, 0x80f);
262   if (layers_ctrl&4)   copybitmap_trans(bitmap,tmpbitmap,flip_screen_get(),flip_screen_get(),0,0,cliprect, 0x80f);
263263
264264   if (paradise_priority & 2)
265265   {
src/mame/video/volfied.c
r1771r1772
9797   UINT16* p = video_ram;
9898
9999   if (video_ctrl & 1)
100   {
101100      p += 0x20000;
102   }
103101
104102   for (y = 0; y < machine->screen[0].height; y++)
105103   {
r1771r1772
112110            color |= 0x800 | ((p[x] >> 9) & 0xf);
113111
114112            if (p[x] & 0x2000)
115            {
116113               color &= ~0xf;     /* hack */
117            }
118114         }
119115         else
120         {
121116            color |= p[x] & 0xf;
122         }
123117
124         *BITMAP_ADDR16(bitmap, y, x - 1) = machine->pens[color];
118         *BITMAP_ADDR16(bitmap, y, x - 1) = color;
125119      }
126120
127121      p += 512;
src/mame/video/mexico86.c
r1771r1772
3232   /* the background character columns is stored inthe area dd00-dd3f */
3333
3434   /* This clears & redraws the entire screen each pass */
35   fillbitmap(bitmap,machine->pens[255],&machine->screen[0].visarea);
35   fillbitmap(bitmap,255,&machine->screen[0].visarea);
3636
3737   sx = 0;
3838/* the score display seems to be outside of the main objectram. */
r1771r1772
113113   /* the background character columns is stored inthe area dd00-dd3f */
114114
115115   /* This clears & redraws the entire screen each pass */
116   fillbitmap(bitmap,machine->pens[255],&machine->screen[0].visarea);
116   fillbitmap(bitmap,255,&machine->screen[0].visarea);
117117
118118   sx = 0;
119119/* the score display seems to be outside of the main objectram. */
src/mame/video/terracre.c
r1771r1772
7878         color += 16 * (spritepalettebank[(tile>>1)&0xff] & 0x0f);
7979      }
8080
81      if (flip_screen)
81      if (flip_screen_get())
8282      {
8383            sx=240-sx;
8484            sy=240-sy;
src/mame/video/mouser.c
r1771r1772
6868      sx = offs % 32;
6969      sy = offs / 32;
7070
71      if (flip_screen_x)
71      if (flip_screen_x_get())
7272      {
7373         sx = 31 - sx;
7474      }
7575
76      if (flip_screen_y)
76      if (flip_screen_y_get())
7777      {
7878         sy = 31 - sy;
7979      }
r1771r1772
9090      drawgfx(bitmap,machine->gfx[0],
9191            videoram[offs] | (colorram[color_offs]>>5)*256 | ((colorram[color_offs]>>4)&1)*512,
9292            colorram[color_offs]%16,
93            flip_screen_x,flip_screen_y,
93            flip_screen_x_get(),flip_screen_y_get(),
9494            8*sx,scrolled_y_position,
9595            cliprect,TRANSPARENCY_NONE,0);
9696   }
r1771r1772
106106      flipx = (spriteram[offs]&0x40)>>6;
107107      flipy = (spriteram[offs]&0x80)>>7;
108108
109      if (flip_screen_x)
109      if (flip_screen_x_get())
110110      {
111111         flipx = !flipx;
112112         sx = 240 - sx;
113113      }
114114
115      if (flip_screen_y)
115      if (flip_screen_y_get())
116116      {
117117         flipy = !flipy;
118118         sy = 238 - sy;
r1771r1772
136136      flipx = (spriteram[offs]&0x40)>>6;
137137      flipy = (spriteram[offs]&0x80)>>7;
138138
139      if (flip_screen_x)
139      if (flip_screen_x_get())
140140      {
141141         flipx = !flipx;
142142         sx = 240 - sx;
143143      }
144144
145      if (flip_screen_y)
145      if (flip_screen_y_get())
146146      {
147147         flipy = !flipy;
148148         sy = 238 - sy;
src/mame/video/undrfire.c
r1771r1772
290290   pivlayer[2] = 2;
291291
292292   fillbitmap(priority_bitmap,0,cliprect);
293   fillbitmap(bitmap,machine->pens[0],cliprect);   /* wrong color? */
293   fillbitmap(bitmap,0,cliprect);   /* wrong color? */
294294
295295
296296/* The "PIV" chip seems to be a renamed TC0100SCN. It has a
src/mame/video/malzak.c
r1771r1772
4040
4141UINT8* saa5050_vidram;  /* Video RAM for SAA 5050 */
4242
43static mame_bitmap* collision_bitmap;
4443static s2636_t *s2636_0, *s2636_1;
4544UINT8 *malzak_s2636_0_ram;
4645UINT8 *malzak_s2636_1_ram;
r1771r1772
5756
5857VIDEO_START( malzak )
5958{
60   collision_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,BITMAP_FORMAT_INDEXED8);
61
6259   saa5050_vidram = auto_malloc(0x800);
6360
6461   /* configure the S2636 chips */
r1771r1772
233230
234231         for (x = cliprect->min_x; x <= cliprect->max_x; x++)
235232         {
236            int pixel0 = *BITMAP_ADDR8(s2636_0_bitmap, y, x);
237            int pixel1 = *BITMAP_ADDR8(s2636_1_bitmap, y, x);
233            int pixel0 = *BITMAP_ADDR16(s2636_0_bitmap, y, x);
234            int pixel1 = *BITMAP_ADDR16(s2636_1_bitmap, y, x);
238235
239236            if (S2636_IS_PIXEL_DRAWN(pixel0))
240               *BITMAP_ADDR16(bitmap, y, x) = machine->pens[S2636_PIXEL_COLOR(pixel0)];
237               *BITMAP_ADDR16(bitmap, y, x) = S2636_PIXEL_COLOR(pixel0);
241238
242239            if (S2636_IS_PIXEL_DRAWN(pixel1))
243               *BITMAP_ADDR16(bitmap, y, x) = machine->pens[S2636_PIXEL_COLOR(pixel1)];
240               *BITMAP_ADDR16(bitmap, y, x) = S2636_PIXEL_COLOR(pixel1);
244241         }
245242      }
246243   }
src/mame/video/deco32.c
r1771r1772
241241      fx = !(spritedata[offs+0]&0x4000);
242242      fy = !(spritedata[offs+0]&0x8000);
243243
244      if (!flip_screen) {
244      if (!flip_screen_get()) {
245245         sx = sx & 0x01ff;
246246         sy = sy & 0x01ff;
247247         if (sx>0x180) sx=-(0x200 - sx);
r1771r1772
12131213   static int last_pf3_bank;
12141214
12151215   flip_screen_set(deco32_pf12_control[0]&0x80);
1216   tilemap_set_flip(ALL_TILEMAPS,flip_screen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
1216   tilemap_set_flip(ALL_TILEMAPS,flip_screen_get() ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
12171217
12181218   deco32_setup_scroll(pf1_tilemap, 256,(deco32_pf12_control[5]>>0)&0xff,(deco32_pf12_control[6]>>0)&0xff,deco32_pf12_control[2],deco32_pf12_control[1],deco32_pf1_rowscroll,deco32_pf1_rowscroll+0x200);
12191219   deco32_setup_scroll(pf1a_tilemap,512,(deco32_pf12_control[5]>>0)&0xff,(deco32_pf12_control[6]>>0)&0xff,deco32_pf12_control[2],deco32_pf12_control[1],deco32_pf1_rowscroll,deco32_pf1_rowscroll+0x200);
src/mame/video/lkage.c
r1771r1772
127127         priority_mask = (0xf0);
128128      }
129129
130      if (flip_screen_x)
130      if (flip_screen_x_get())
131131      {
132132         sx = 239 - sx - 24;
133133         flipx = !flipx;
134134      }
135      if( flip_screen_y )
135      if( flip_screen_y_get() )
136136      {
137137         sy = 254 - 16*height - sy;
138138         flipy = !flipy;
src/mame/video/gaiden.c
r1771r1772
213213***************************************************************************/
214214
215215/* mix & blend the paletted 16-bit tile and sprite bitmaps into an RGB 32-bit bitmap */
216
217/* the source data is 3 16-bit indexed bitmaps, we use them to determine which 2 colours
218   to blend into the final 32-bit rgb bitmaps, this is currently broken (due to zsolt's core
219   changes?) it appears that the sprite drawing is no longer putting the correct raw data
220   in the bitmaps? */
216221static void blendbitmaps(running_machine *machine,
217222      mame_bitmap *dest,mame_bitmap *src1,mame_bitmap *src2,mame_bitmap *src3,
218      int sx,int sy,const rectangle *clip)
223      int sx,int sy,const rectangle *cliprect)
219224{
220   int ox;
221   int oy;
222   int ex;
223   int ey;
225   int y,x;
226   const pen_t *paldata = machine->pens;
224227
225   /* check bounds */
226   ox = sx;
227   oy = sy;
228
229   ex = sx + src1->width - 1;
230   if (sx < 0) sx = 0;
231   if (sx < clip->min_x) sx = clip->min_x;
232   if (ex >= dest->width) ex = dest->width - 1;
233   if (ex > clip->max_x) ex = clip->max_x;
234   if (sx > ex) return;
235
236   ey = sy + src1->height - 1;
237   if (sy < 0) sy = 0;
238   if (sy < clip->min_y) sy = clip->min_y;
239   if (ey >= dest->height) ey = dest->height - 1;
240   if (ey > clip->max_y) ey = clip->max_y;
241   if (sy > ey) return;
242
228   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
243229   {
244      const pen_t *paldata = machine->pens;
245      UINT32 *end;
230      UINT32 *dd  = BITMAP_ADDR32(dest, y, 0);
231      UINT16 *sd1 = BITMAP_ADDR16(src1, y, 0);
232      UINT16 *sd2 = BITMAP_ADDR16(src2, y, 0);
233      UINT16 *sd3 = BITMAP_ADDR16(src3, y, 0);
246234
247      UINT16 *sd1 = src1->base;                                    /* source data   */
248      UINT16 *sd2 = src2->base;
249      UINT16 *sd3 = src3->base;
250
251      int sw = ex-sx+1;                                          /* source width  */
252      int sh = ey-sy+1;                                          /* source height */
253      int sm = src1->rowpixels;                                    /* source modulo */
254
255      UINT32 *dd = BITMAP_ADDR32(dest, sy, sx);                        /* dest data     */
256      int dm = dest->rowpixels;                                 /* dest modulo   */
257
258      sd1 += (sx-ox);
259      sd1 += sm * (sy-oy);
260      sd2 += (sx-ox);
261      sd2 += sm * (sy-oy);
262      sd3 += (sx-ox);
263      sd3 += sm * (sy-oy);
264
265      sm -= sw;
266      dm -= sw;
267
268      while (sh)
235      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
269236      {
270
271#define BLENDPIXEL(x)   if (sd3[x]) {                                          \
272                     if (sd2[x]) {                                       \
273                        dd[x] = paldata[sd2[x] | 0x0400] + paldata[sd3[x]];         \
274                     } else {                                          \
275                        dd[x] = paldata[sd1[x] | 0x0400] + paldata[sd3[x]];         \
276                     }                                                \
277                  } else {                                             \
278                     if (sd2[x]) {                                       \
279                        if (sd2[x] & 0x0800) {                              \
280                           dd[x] = paldata[sd1[x] | 0x0400] + paldata[sd2[x]];      \
281                        } else {                                       \
282                           dd[x] = paldata[sd2[x]];                        \
283                        }                                             \
284                     } else {                                          \
285                        dd[x] = paldata[sd1[x]];                           \
286                     }                                                \
287                  }
288
289         end = dd + sw;
290         while (dd <= end - 8)
237         if (sd3[x])
291238         {
292            BLENDPIXEL(0);
293            BLENDPIXEL(1);
294            BLENDPIXEL(2);
295            BLENDPIXEL(3);
296            BLENDPIXEL(4);
297            BLENDPIXEL(5);
298            BLENDPIXEL(6);
299            BLENDPIXEL(7);
300            dd += 8;
301            sd1 += 8;
302            sd2 += 8;
303            sd3 += 8;
239            if (sd2[x])
240               dd[x] = paldata[sd2[x] | 0x0400] | paldata[sd3[x]];
241            else
242               dd[x] = paldata[sd1[x] | 0x0400] | paldata[sd3[x]];
304243         }
305         while (dd < end)
244         else
306245         {
307            BLENDPIXEL(0);
308            dd++;
309            sd1++;
310            sd2++;
311            sd3++;
246            if (sd2[x])
247            {
248               if (sd2[x] & 0x800)
249                  dd[x] = paldata[sd1[x] | 0x0400] | paldata[sd2[x]];
250               else
251                  dd[x] = paldata[sd2[x]];
252            }
253            else
254               dd[x] = paldata[sd1[x]];
312255         }
313         dd += dm;
314         sd1 += sm;
315         sd2 += sm;
316         sd3 += sm;
317         sh--;
318
319#undef BLENDPIXEL
320
321256      }
322257   }
323258}
r1771r1772
341276
342277#define NUM_SPRITES 256
343278
344static void gaiden_draw_sprites(running_machine *machine, mame_bitmap *bitmap_bg, mame_bitmap *bitmap_fg, mame_bitmap *bitmap_sp, const rectangle *cliprect)
279static void gaiden_draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
345280{
346281   static const UINT8 layout[8][8] =
347282   {
r1771r1772
356291   };
357292
358293   const gfx_element *gfx = machine->gfx[3];
359   mame_bitmap *bitmap = bitmap_bg;
360294   const UINT16 *source = (NUM_SPRITES - 1) * 8 + spriteram16;
361   const UINT8 blend_support = (bitmap_fg && bitmap_sp);
362295   int count = NUM_SPRITES;
363296
364297   /* draw all sprites from front to back */
r1771r1772
384317         int ypos = source[3] & 0x01ff;
385318         int xpos = source[4] & 0x01ff;
386319
387         if (!blend_support && (attributes & 0x20) && (cpu_getcurrentframe() & 1))
320         if ((attributes & 0x20) && (cpu_getcurrentframe() & 1))
388321            goto skip_sprite;
389322
390323         color = (color >> 4) & 0x0f;
r1771r1772
395328         if (ypos >= 256)
396329            ypos -= 512;
397330
398         if (flip_screen)
331         if (flip_screen_get())
399332         {
400333            flipx = !flipx;
401334            flipy = !flipy;
r1771r1772
419352            case 0x3: priority_mask = 0xf0 | 0xcc | 0xaa;   break;   /* obscured by bg and fg  */
420353         }
421354
355         for (row = 0; row < sizey; row++)
356         {
357            for (col = 0; col < sizex; col++)
358            {
359               int sx = xpos + 8 * (flipx ? (sizex - 1 - col) : col);
360               int sy = ypos + 8 * (flipy ? (sizey - 1 - row) : row);
361
362               pdrawgfx(bitmap, gfx,
363                  number + layout[row][col],
364                  color,
365                  flipx, flipy,
366                  sx, sy,
367                  cliprect, TRANSPARENCY_PEN, 0,
368                  priority_mask);
369            }
370         }
371      }
372skip_sprite:
373      source -= 8;
374   }
375}
376
377
378static void raiga_draw_sprites(running_machine *machine, mame_bitmap *bitmap_bg, mame_bitmap *bitmap_fg, mame_bitmap *bitmap_sp, const rectangle *cliprect)
379{
380   static const UINT8 layout[8][8] =
381   {
382      { 0, 1, 4, 5,16,17,20,21},
383      { 2, 3, 6, 7,18,19,22,23},
384      { 8, 9,12,13,24,25,28,29},
385      {10,11,14,15,26,27,30,31},
386      {32,33,36,37,48,49,52,53},
387      {34,35,38,39,50,51,54,55},
388      {40,41,44,45,56,57,60,61},
389      {42,43,46,47,58,59,62,63}
390   };
391
392   const gfx_element *gfx = machine->gfx[3];
393   const UINT16 *source = (NUM_SPRITES - 1) * 8 + spriteram16;
394   int count = NUM_SPRITES;
395
396   /* draw all sprites from front to back */
397   while (count--)
398   {
399      UINT32 attributes = source[0];
400      UINT32 priority_mask;
401      int col,row;
402
403      if (attributes & 0x04)
404      {
405         UINT32 priority = (attributes >> 6) & 3;
406         UINT32 flipx = (attributes & 1);
407         UINT32 flipy = (attributes & 2);
408
409         UINT32 color = source[2];
410         UINT32 sizex = 1 << ((color >> 0) & 3);                  /* 1,2,4,8 */
411         UINT32 sizey = 1 << ((color >> gaiden_sprite_sizey) & 3);   /* 1,2,4,8 */
412
413         /* raiga needs something like this */
414         UINT32 number = (source[1] & (sizex > 2 ? 0x7ff8 : 0x7ffc));
415
416         int ypos = source[3] & 0x01ff;
417         int xpos = source[4] & 0x01ff;
418
419         color = (color >> 4) & 0x0f;
420
421         /* wraparound */
422         if (xpos >= 256)
423            xpos -= 512;
424         if (ypos >= 256)
425            ypos -= 512;
426
427         if (flip_screen_get())
428         {
429            flipx = !flipx;
430            flipy = !flipy;
431
432            xpos = 256 - (8 * sizex) - xpos;
433            ypos = 256 - (8 * sizey) - ypos;
434
435            if (xpos <= -256)
436               xpos += 512;
437            if (ypos <= -256)
438               ypos += 512;
439         }
440
441         /* bg: 1; fg:2; text: 4 */
442         switch( priority )
443         {
444            default:
445            case 0x0: priority_mask = 0;               break;
446            case 0x1: priority_mask = 0xf0;               break;   /* obscured by text layer */
447            case 0x2: priority_mask = 0xf0 | 0xcc;         break;   /* obscured by foreground */
448            case 0x3: priority_mask = 0xf0 | 0xcc | 0xaa;   break;   /* obscured by bg and fg  */
449         }
450
422451         /* blending */
423         if (blend_support && (attributes & 0x20))
452         if (attributes & 0x20)
424453         {
425454            color |= 0x80;
426455
r1771r1772
433462
434463                  pdrawgfx(bitmap_sp, gfx,
435464                     number + layout[row][col],
436                     color,
465                     color * 16,
437466                     flipx, flipy,
438467                     sx, sy,
439                     cliprect, TRANSPARENCY_PEN, 0,
468                     cliprect, TRANSPARENCY_PEN_RAW, 0,
440469                     priority_mask);
441470               }
442471            }
443472         }
444473         else
445474         {
446            if (blend_support)
447               bitmap = (priority >= 2) ? bitmap_bg : bitmap_fg;
475            mame_bitmap *bitmap = (priority >= 2) ? bitmap_bg : bitmap_fg;
448476
449477            for (row = 0; row < sizey; row++)
450478            {
r1771r1772
455483
456484                  pdrawgfx(bitmap, gfx,
457485                     number + layout[row][col],
458                     color,
486                     color * 16,
459487                     flipx, flipy,
460488                     sx, sy,
461                     cliprect, TRANSPARENCY_PEN, 0,
489                     cliprect, TRANSPARENCY_PEN_RAW, 0,
462490                     priority_mask);
463491               }
464492            }
465493         }
466494      }
467skip_sprite:
495
468496      source -= 8;
469497   }
470498}
r1771r1772
531559
532560VIDEO_UPDATE( gaiden )
533561{
534   fillbitmap(priority_bitmap,                    0, cliprect);
535   fillbitmap(bitmap,          machine->pens[0x200], cliprect);
562   fillbitmap(priority_bitmap, 0, cliprect);
563   fillbitmap(bitmap, 0x200, cliprect);
536564
537565   tilemap_draw(bitmap, cliprect, background, 0, 1);
538566   tilemap_draw(bitmap, cliprect, foreground, 0, 2);
539567   tilemap_draw(bitmap, cliprect, text_layer, 0, 4);
540568
541   gaiden_draw_sprites(machine, bitmap, NULL, NULL, cliprect);
569   gaiden_draw_sprites(machine, bitmap, cliprect);
542570   return 0;
543571}
544572
r1771r1772
559587   tilemap_draw(tile_bitmap_fg, cliprect,text_layer, 0, 4);
560588
561589   /* draw sprites into a 16-bit bitmap */
562   gaiden_draw_sprites(machine, tile_bitmap_bg, tile_bitmap_fg, sprite_bitmap, cliprect);
590   raiga_draw_sprites(machine, tile_bitmap_bg, tile_bitmap_fg, sprite_bitmap, cliprect);
563591
564592   /* mix & blend the tilemaps and sprites into a 32-bit bitmap */
565593   blendbitmaps(machine, bitmap, tile_bitmap_bg, tile_bitmap_fg, sprite_bitmap, 0, 0, cliprect);
src/mame/video/zaxxon.c
r1771r1772
189189WRITE8_HANDLER( zaxxon_flipscreen_w )
190190{
191191   /* low bit controls flip; background and sprite flip are handled at render time */
192   flip_screen = ~data & 1;
193   tilemap_set_flip(fg_tilemap, flip_screen ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
192   flip_screen_set_no_update(~data & 1);
193   tilemap_set_flip(fg_tilemap, flip_screen_get() ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
194194}
195195
196196
r1771r1772
313313      int colorbase = bg_color + (congo_color_bank << 8);
314314      int xmask = pixmap->width - 1;
315315      int ymask = pixmap->height - 1;
316      int flipmask = flip_screen ? 0xff : 0x00;
317      int flipoffs = flip_screen ? 0x38 : 0x40;
316      int flipmask = flip_screen_get() ? 0xff : 0x00;
317      int flipoffs = flip_screen_get() ? 0x38 : 0x40;
318318      int x, y;
319319
320320      /* the starting X value is offset by 1 pixel (normal) or 7 pixels */
321321      /* (flipped) due to a delay in the loading */
322      if (!flip_screen)
322      if (!flip_screen_get())
323323         flipoffs -= 1;
324324      else
325325         flipoffs += 7;
r1771r1772
377377
378378INLINE int find_minimum_y(UINT8 value)
379379{
380   int flipmask = flip_screen ? 0xff : 0x00;
381   int flipconst = flip_screen ? 0xef : 0xf1;
380   int flipmask = flip_screen_get() ? 0xff : 0x00;
381   int flipconst = flip_screen_get() ? 0xef : 0xf1;
382382   int y;
383383
384384   /* the sum of the Y position plus a constant based on the flip state */
r1771r1772
408408
409409INLINE int find_minimum_x(UINT8 value)
410410{
411   int flipmask = flip_screen ? 0xff : 0x00;
411   int flipmask = flip_screen_get() ? 0xff : 0x00;
412412   int x;
413413
414414   /* the sum of the X position plus a constant specifies the address within */
r1771r1772
422422
423423static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, UINT16 flipxmask, UINT16 flipymask)
424424{
425   int flipmask = flip_screen ? 0xff : 0x00;
425   int flipmask = flip_screen_get() ? 0xff : 0x00;
426426   int offs;
427427
428428   /* only the lower half of sprite RAM is read during rendering */
src/mame/video/trackfld.c
r1771r1772
107107
108108WRITE8_HANDLER( trackfld_flipscreen_w )
109109{
110   if (flip_screen != data)
110   if (flip_screen_get() != data)
111111   {
112112      flip_screen_set(data);
113113      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
r1771r1772
202202      int sx = spriteram[offs] - 1;
203203      int sy = 240 - spriteram_2[offs + 1];
204204
205      if (flip_screen)
205      if (flip_screen_get())
206206      {
207207         sy = 240 - sy;
208208         flipy = !flipy;
r1771r1772
238238   for (row = 0; row < 32; row++)
239239   {
240240      scrollx = trackfld_scroll[row] + 256 * (trackfld_scroll2[row] & 0x01);
241      if (flip_screen) scrollx = -scrollx;
241      if (flip_screen_get()) scrollx = -scrollx;
242242      tilemap_set_scrollx(bg_tilemap, row, scrollx);
243243   }
244244
src/mame/video/fastfred.c
r1771r1772
223223
224224WRITE8_HANDLER( fastfred_flip_screen_x_w )
225225{
226   if (flip_screen_x != (data & 0x01))
226   if (flip_screen_x_get() != (data & 0x01))
227227   {
228      flip_screen_x = data & 0x01;
228      flip_screen_x_set(data & 0x01);
229229
230      tilemap_set_flip(bg_tilemap, (flip_screen_x ? TILEMAP_FLIPX : 0) | (flip_screen_y ? TILEMAP_FLIPY : 0));
230      tilemap_set_flip(bg_tilemap, (flip_screen_x_get() ? TILEMAP_FLIPX : 0) | (flip_screen_y_get() ? TILEMAP_FLIPY : 0));
231231   }
232232}
233233
234234WRITE8_HANDLER( fastfred_flip_screen_y_w )
235235{
236   if (flip_screen_y != (data & 0x01))
236   if (flip_screen_y_get() != (data & 0x01))
237237   {
238      flip_screen_y = data & 0x01;
238      flip_screen_y_set(data & 0x01);
239239
240      tilemap_set_flip(bg_tilemap, (flip_screen_x ? TILEMAP_FLIPX : 0) | (flip_screen_y ? TILEMAP_FLIPY : 0));
240      tilemap_set_flip(bg_tilemap, (flip_screen_x_get() ? TILEMAP_FLIPX : 0) | (flip_screen_y_get() ? TILEMAP_FLIPY : 0));
241241   }
242242}
243243
r1771r1772
303303      }
304304
305305
306      if (flip_screen_x)
306      if (flip_screen_x_get())
307307      {
308308         sx = 240 - sx;
309309         flipx = !flipx;
310310      }
311      if (flip_screen_y)
311      if (flip_screen_y_get())
312312      {
313313         sy = 240 - sy;
314314         flipy = !flipy;
r1771r1772
319319            colorbank | (fastfred_spriteram[offs + 2] & 0x07),
320320            flipx,flipy,
321321            sx,sy,
322            flip_screen_x ? &spritevisibleareaflipx : &spritevisiblearea,TRANSPARENCY_PEN,0);
322            flip_screen_x_get() ? &spritevisibleareaflipx : &spritevisiblearea,TRANSPARENCY_PEN,0);
323323   }
324324}
325325
src/mame/video/lwings.c
r1771r1772
203203         flipx = buffered_spriteram[offs + 1] & 0x02;
204204         flipy = buffered_spriteram[offs + 1] & 0x04;
205205
206         if (flip_screen)
206         if (flip_screen_get())
207207         {
208208            sx = 240 - sx;
209209            sy = 240 - sy;
r1771r1772
252252            flipy = 1;
253253         }
254254
255         if (flip_screen)
255         if (flip_screen_get())
256256         {
257257            sx = 240 - sx;
258258            sy = 240 - sy;
src/mame/video/tecmo.c
r1771r1772
201201         flipx = bank & 1;
202202         flipy = bank & 2;
203203
204         if (flip_screen)
204         if (flip_screen_get())
205205         {
206206            xpos = 256 - (8 * size) - xpos;
207207            ypos = 256 - (8 * size) - ypos;
r1771r1772
242242VIDEO_UPDATE( tecmo )
243243{
244244   fillbitmap(priority_bitmap,0,cliprect);
245   fillbitmap(bitmap,machine->pens[0x100],cliprect);
245   fillbitmap(bitmap,0x100,cliprect);
246246   tilemap_draw(bitmap,cliprect,bg_tilemap,0,1);
247247   tilemap_draw(bitmap,cliprect,fg_tilemap,0,2);
248248   tilemap_draw(bitmap,cliprect,tx_tilemap,0,4);
src/mame/video/galpanic.c
r1771r1772
8686   }
8787}
8888
89static void draw_fgbitmap(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
89static void draw_fgbitmap(mame_bitmap *bitmap, const rectangle *cliprect)
9090{
9191   int offs;
9292
r1771r1772
9898      sy = offs / 256;
9999      color = galpanic_fgvideoram[offs];
100100      if (color)
101         *BITMAP_ADDR16(bitmap, sy, sx) = machine->pens[color];
101         *BITMAP_ADDR16(bitmap, sy, sx) = color;
102102   }
103103}
104104
r1771r1772
107107   /* copy the temporary bitmap to the screen */
108108   copybitmap(bitmap,tmpbitmap,0,0,0,0,cliprect);
109109
110   draw_fgbitmap(machine, bitmap, cliprect);
110   draw_fgbitmap(bitmap, cliprect);
111111
112112   pandora_update(machine,bitmap,cliprect);
113113
r1771r1772
119119   /* copy the temporary bitmap to the screen */
120120   copybitmap(bitmap,tmpbitmap,0,0,0,0,cliprect);
121121
122   draw_fgbitmap(machine,bitmap,cliprect);
122   draw_fgbitmap(bitmap,cliprect);
123123
124124
125125//  if(galpanic_clear_sprites)
src/mame/video/cclimber.c
r1771r1772
1111#include "includes/cclimber.h"
1212
1313
14UINT8 *cclimber_bsvideoram;
15size_t cclimber_bsvideoram_size;
16UINT8 *cclimber_bigspriteram;
14#define CCLIMBER_FLIP_X      (cclimber_flip_screen[0] & 0x01)
15#define CCLIMBER_FLIP_Y      (cclimber_flip_screen[1] & 0x01)
16#define CCLIMBER_BG_PEN      (0)
17#define SWIMMER_SIDE_BG_PEN   (0x120)
18#define SWIMMER_BG_SPLIT   (0x18 * 8)
19#define YAMATO_SKY_PEN_BASE   (0x60)
20
21static tilemap *pf_tilemap;
22static tilemap *bs_tilemap;
23
24UINT8 *cclimber_videoram;
25UINT8 *cclimber_colorram;
26UINT8 *cclimber_spriteram;
27
28UINT8 *cclimber_bigsprite_videoram;
29UINT8 *cclimber_bigsprite_control;
1730UINT8 *cclimber_column_scroll;
18UINT8 *swimmer_bgcolor;
19UINT8 *swimmer_sidepanel_enabled;
31UINT8 *cclimber_flip_screen;
32
33UINT8 *swimmer_background_color;
34UINT8 *swimmer_side_background_enabled;
2035UINT8 *swimmer_palettebank;
2136
37UINT8 *toprollr_bg_videoram;
38UINT8 *toprollr_bg_coloram;
39static tilemap *toproller_bg_tilemap;
2240
41
2342/***************************************************************************
2443
2544  Convert the color PROMs into a more useable format.
r1771r1772
4160{
4261   static const int resistances_rg[3] = { 1000, 470, 220 };
4362   static const int resistances_b [2] = { 470, 220 };
44   double rweights[3], gweights[3], bweights[2];
63   double weights_rg[3], weights_b[2];
4564   int i;
4665
4766   /* compute the color output resistor weights */
4867   compute_resistor_weights(0,   255, -1.0,
49         3, &resistances_rg[0], rweights, 0, 0,
50         3, &resistances_rg[0], gweights, 0, 0,
51         2, &resistances_b[0],  bweights, 0, 0);
68         3, resistances_rg, weights_rg, 0, 0,
69         2, resistances_b,  weights_b,  0, 0,
70         0, 0, 0, 0, 0);
5271
5372   for (i = 0;i < machine->config->total_colors; i++)
5473   {
55      UINT8 data;
5674      int bit0, bit1, bit2;
5775      int r, g, b;
5876
59      if (i & 0x07)
60         data = color_prom[i];
61      else
62         /* River Patrol shows that background is pen 0 */
63         data = color_prom[0];
64
6577      /* red component */
66      bit0 = (data >> 0) & 0x01;
67      bit1 = (data >> 1) & 0x01;
68      bit2 = (data >> 2) & 0x01;
69      r = combine_3_weights(rweights, bit0, bit1, bit2);
78      bit0 = (color_prom[i] >> 0) & 0x01;
79      bit1 = (color_prom[i] >> 1) & 0x01;
80      bit2 = (color_prom[i] >> 2) & 0x01;
81      r = combine_3_weights(weights_rg, bit0, bit1, bit2);
7082
7183      /* green component */
72      bit0 = (data >> 3) & 0x01;
73      bit1 = (data >> 4) & 0x01;
74      bit2 = (data >> 5) & 0x01;
75      g = combine_3_weights(gweights, bit0, bit1, bit2);
84      bit0 = (color_prom[i] >> 3) & 0x01;
85      bit1 = (color_prom[i] >> 4) & 0x01;
86      bit2 = (color_prom[i] >> 5) & 0x01;
87      g = combine_3_weights(weights_rg, bit0, bit1, bit2);
7688
7789      /* blue component */
78      bit0 = (data >> 6) & 0x01;
79      bit1 = (data >> 7) & 0x01;
80      b = combine_2_weights(bweights, bit0, bit1);
90      bit0 = (color_prom[i] >> 6) & 0x01;
91      bit1 = (color_prom[i] >> 7) & 0x01;
92      b = combine_2_weights(weights_b, bit0, bit1);
8193
8294      palette_set_color(machine, i, MAKE_RGB(r, g, b));
8395   }
r1771r1772
124136{
125137   int i;
126138
127   for (i = 0; i < 0x200; i++)
139   for (i = 0; i < 0x100; i++)
128140   {
129      rgb_t color;
141      int bit0, bit1, bit2;
142      int r, g, b;
130143
131      /* non-backgrond pens */
132      if (i & 0x07)
133      {
134         int bit0, bit1, bit2;
135         int r, g, b;
144      /* red component */
145      bit0 = (color_prom[i + 0x000] >> 0) & 0x01;
146      bit1 = (color_prom[i + 0x000] >> 1) & 0x01;
147      bit2 = (color_prom[i + 0x000] >> 2) & 0x01;
148      r = 0x20 * bit0 + 0x40 * bit1 + 0x80 * bit2;
136149
137         /* red component */
138         bit0 = (color_prom[(i & 0xff) + 0x000] >> 0) & 0x01;
139         bit1 = (color_prom[(i & 0xff) + 0x000] >> 1) & 0x01;
140         bit2 = (color_prom[(i & 0xff) + 0x000] >> 2) & 0x01;
141         r = 0x20 * bit0 + 0x40 * bit1 + 0x80 * bit2;
150      /* green component */
151      bit0 = (color_prom[i + 0x000] >> 3) & 0x01;
152      bit1 = (color_prom[i + 0x100] >> 0) & 0x01;
153      bit2 = (color_prom[i + 0x100] >> 1) & 0x01;
154      g = 0x20 * bit0 + 0x40 * bit1 + 0x80 * bit2;
142155
143         /* green component */
144         bit0 = (color_prom[(i & 0xff) + 0x000] >> 3) & 0x01;
145         bit1 = (color_prom[(i & 0xff) + 0x100] >> 0) & 0x01;
146         bit2 = (color_prom[(i & 0xff) + 0x100] >> 1) & 0x01;
147         g = 0x20 * bit0 + 0x40 * bit1 + 0x80 * bit2;
156      /* blue component */
157      bit0 = 0;
158      bit1 = (color_prom[i + 0x100] >> 2) & 0x01;
159      bit2 = (color_prom[i + 0x100] >> 3) & 0x01;
160      b = 0x20 * bit0 + 0x40 * bit1 + 0x80 * bit2;
148161
149         /* blue component */
150         bit0 = 0;
151         bit1 = (color_prom[(i & 0xff) + 0x100] >> 2) & 0x01;
152         bit2 = (color_prom[(i & 0xff) + 0x100] >> 3) & 0x01;
153         b = 0x20 * bit0 + 0x40 * bit1 + 0x80 * bit2;
154
155         color = MAKE_RGB(r,g,b);
156      }
157
158      /* backgrond pen */
159      else
160      {
161         if (i & 0x100)
162            /* side panel */
163#if 0
164            // values calculated from the resistors don't seem to match the real board
165            color = MAKE_RGB(0x24, 0x5d, 0x4e);
166#endif
167            color = MAKE_RGB(0x20, 0x98, 0x79);
168         else
169            /* 'water' background -- will be modified dynamically later */
170            color = RGB_BLACK;
171      }
172
173      palette_set_color(machine, i, color);
162      palette_set_color(machine, i, MAKE_RGB(r, g, b));
174163   }
175164
176165   color_prom += 0x200;
r1771r1772
199188      bit2 = (color_prom[i] >> 7) & 0x01;
200189      b = 0x20 * bit0 + 0x40 * bit1 + 0x80 * bit2;
201190
202      palette_set_color(machine, i + 0x200, MAKE_RGB(r, g, b));
191      palette_set_color(machine, i + 0x100, MAKE_RGB(r, g, b));
203192   }
193
194   /* side panel backgrond pen */
195#if 0
196   // values calculated from the resistors don't seem to match the real board
197   palette_set_color(machine, SWIMMER_SIDE_BG_PEN, MAKE_RGB(0x24, 0x5d, 0x4e));
198#endif
199   palette_set_color(machine, SWIMMER_SIDE_BG_PEN, MAKE_RGB(0x20, 0x98, 0x79));
204200}
205201
206202
203PALETTE_INIT( yamato )
204{
205   int i;
207206
207   /* chars - 12 bits RGB */
208   for (i = 0; i < 0x40; i++)
209   {
210      int bit0, bit1, bit2, bit3;
211      int r, g, b;
212
213      /* red component */
214      bit0 = (color_prom[i + 0x00] >> 0) & 0x01;
215      bit1 = (color_prom[i + 0x00] >> 1) & 0x01;
216      bit2 = (color_prom[i + 0x00] >> 2) & 0x01;
217      bit3 = (color_prom[i + 0x00] >> 3) & 0x01;
218      r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
219
220      /* green component */
221      bit0 = (color_prom[i + 0x00] >> 4) & 0x01;
222      bit1 = (color_prom[i + 0x00] >> 5) & 0x01;
223      bit2 = (color_prom[i + 0x00] >> 6) & 0x01;
224      bit3 = (color_prom[i + 0x00] >> 7) & 0x01;
225      g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
226
227      /* blue component */
228      bit0 = (color_prom[i + 0x40] >> 0) & 0x01;
229      bit1 = (color_prom[i + 0x40] >> 1) & 0x01;
230      bit2 = (color_prom[i + 0x40] >> 2) & 0x01;
231      bit3 = (color_prom[i + 0x40] >> 3) & 0x01;
232      b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
233
234      palette_set_color(machine, i, MAKE_RGB(r, g, b));
235   }
236
237   /* big sprite - 8 bits RGB */
238   for (i = 0; i < 0x20; i++)
239   {
240      int bit0, bit1, bit2;
241      int r, g, b;
242
243      /* red component */
244      bit0 = (color_prom[i + 0x80] >> 0) & 0x01;
245      bit1 = (color_prom[i + 0x80] >> 1) & 0x01;
246      bit2 = (color_prom[i + 0x80] >> 2) & 0x01;
247      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
248
249      /* green component */
250      bit0 = (color_prom[i + 0x80] >> 3) & 0x01;
251      bit1 = (color_prom[i + 0x80] >> 4) & 0x01;
252      bit2 = (color_prom[i + 0x80] >> 5) & 0x01;
253      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
254
255      /* blue component */
256      bit0 = 0;
257      bit1 = (color_prom[i + 0x80] >> 6) & 0x01;
258      bit2 = (color_prom[i + 0x80] >> 7) & 0x01;
259      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
260
261      palette_set_color(machine, i + 0x40, MAKE_RGB(r, g, b));
262   }
263
264   /* fake colors for bg gradient */
265   for (i = 0; i < 0x100; i++)
266      palette_set_color(machine, YAMATO_SKY_PEN_BASE + i, MAKE_RGB(0, 0, i));
267}
268
269
270PALETTE_INIT( toprollr )
271{
272   int i;
273
274   for (i = 0; i < 0xa0; i++)
275   {
276      int bit0, bit1, bit2;
277      int r, g, b;
278
279      /* red component */
280      bit0 = (color_prom[i] >> 0) & 0x01;
281      bit1 = (color_prom[i] >> 1) & 0x01;
282      bit2 = (color_prom[i] >> 2) & 0x01;
283      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
284
285      /* green component */
286      bit0 = (color_prom[i] >> 3) & 0x01;
287      bit1 = (color_prom[i] >> 4) & 0x01;
288      bit2 = (color_prom[i] >> 5) & 0x01;
289      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
290
291      /* blue component */
292      bit0 = 0;
293      bit1 = (color_prom[i] >> 6) & 0x01;
294      bit2 = (color_prom[i] >> 7) & 0x01;
295      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
296
297      palette_set_color(machine, i, MAKE_RGB(r, g, b));
298   }
299}
300
301
208302/***************************************************************************
209303
210304  Swimmer can directly set the background color.
r1771r1772
224318
225319static void swimmer_set_background_pen(running_machine *machine)
226320{
227   int i;
228   pen_t color;
229321   int bit0, bit1, bit2;
230322   int r, g, b;
231323
232324   /* red component */
233325   bit0 = 0;
234   bit1 = (*swimmer_bgcolor >> 6) & 0x01;
235   bit2 = (*swimmer_bgcolor >> 7) & 0x01;
326   bit1 = (*swimmer_background_color >> 6) & 0x01;
327   bit2 = (*swimmer_background_color >> 7) & 0x01;
236328   r = 0x20 * bit0 + 0x40 * bit1 + 0x80 * bit2;
237329
238330   /* green component */
239   bit0 = (*swimmer_bgcolor >> 3) & 0x01;
240   bit1 = (*swimmer_bgcolor >> 4) & 0x01;
241   bit2 = (*swimmer_bgcolor >> 5) & 0x01;
331   bit0 = (*swimmer_background_color >> 3) & 0x01;
332   bit1 = (*swimmer_background_color >> 4) & 0x01;
333   bit2 = (*swimmer_background_color >> 5) & 0x01;
242334   g = 0x20 * bit0 + 0x40 * bit1 + 0x80 * bit2;
243335
244336   /* blue component */
245   bit0 = (*swimmer_bgcolor >> 0) & 0x01;
246   bit1 = (*swimmer_bgcolor >> 1) & 0x01;
247   bit2 = (*swimmer_bgcolor >> 2) & 0x01;
337   bit0 = (*swimmer_background_color >> 0) & 0x01;
338   bit1 = (*swimmer_background_color >> 1) & 0x01;
339   bit2 = (*swimmer_background_color >> 2) & 0x01;
248340   b = 0x20 * bit0 + 0x40 * bit1 + 0x80 * bit2;
249341
250   color = MAKE_RGB(r, g, b);
251
252   /* set pen 0 if each color code */
253   for (i = 0; i < 0x100; i += 8)
254      palette_set_color(machine, i, color);
342   palette_set_color(machine, CCLIMBER_BG_PEN, MAKE_RGB(r, g, b));
255343}
256344
257345
258346
259347WRITE8_HANDLER( cclimber_colorram_w )
260348{
261   /* bit 5 of the address is not used for color memory. There is just */
262   /* 512 bytes of memory; every two consecutive rows share the same memory */
263   /* region. */
264   colorram[offset] = data;
265   colorram[offset ^ 0x20] = data;
349   /* A5 is not connected, there is only 0x200 bytes of RAM */
350   cclimber_colorram[offset & ~0x20] = data;
351   cclimber_colorram[offset |  0x20] = data;
266352}
267353
268354
355WRITE8_HANDLER( cannonb_flip_screen_w )
356{
357   cclimber_flip_screen[0] = data;
358   cclimber_flip_screen[1] = data;
359}
269360
270static void cclimber_draw_big_sprite(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
361
362static TILE_GET_INFO( cclimber_get_pf_tile_info )
271363{
272   int offs;
273   int ox,oy,sx,sy,flipx,flipy;
274   int color;
364   int code, color;
275365
366   int flags = TILE_FLIPYX(cclimber_colorram[tile_index] >> 6);
276367
277   ox = 136 - cclimber_bigspriteram[3];
278   oy = 128 - cclimber_bigspriteram[2];
279   flipx = cclimber_bigspriteram[1] & 0x10;
280   flipy = cclimber_bigspriteram[1] & 0x20;
281   if (flip_screen_y)      /* only the Y direction has to be flipped */
282   {
283      oy = 128 - oy;
284      flipy = !flipy;
285   }
286   color = cclimber_bigspriteram[1] & 0x07;   /* cclimber */
287//  color = cclimber_bigspriteram[1] & 0x03;    /* swimmer */
368   /* vertical flipping flips two adjacent characters */
369   if (flags & 0x02)
370      tile_index = tile_index ^ 0x20;
288371
289   for (offs = cclimber_bsvideoram_size - 1;offs >= 0;offs--)
290   {
291      sx = offs % 16;
292      sy = offs / 16;
293      if (flipx) sx = 15 - sx;
294      if (flipy) sy = 15 - sy;
372   code = ((cclimber_colorram[tile_index] & 0x10) << 5) |
373         ((cclimber_colorram[tile_index] & 0x20) << 3) |
374          cclimber_videoram[tile_index];
295375
296      drawgfx(bitmap,machine->gfx[2],
297//              cclimber_bsvideoram[offs],  /* cclimber */
298            cclimber_bsvideoram[offs] + ((cclimber_bigspriteram[1] & 0x08) << 5),   /* swimmer */
299            color,
300            flipx,flipy,
301            (ox+8*sx) & 0xff,(oy+8*sy) & 0xff,
302            cliprect,TRANSPARENCY_PEN,0);
376   color = cclimber_colorram[tile_index] & 0x0f;
303377
304      /* wraparound */
305      drawgfx(bitmap,machine->gfx[2],
306//              cclimber_bsvideoram[offs],  /* cclimber */
307            cclimber_bsvideoram[offs] + ((cclimber_bigspriteram[1] & 0x08) << 5),   /* swimmer */
308            color,
309            flipx,flipy,
310            ((ox+8*sx) & 0xff) - 256,(oy+8*sy) & 0xff,
311            cliprect,TRANSPARENCY_PEN,0);
312   }
378   SET_TILE_INFO(0, code, color, flags);
313379}
314380
315381
316VIDEO_UPDATE( cclimber )
382static TILE_GET_INFO( swimmer_get_pf_tile_info )
317383{
318   int offs;
384   int code, color;
319385
320   for (offs = videoram_size - 1;offs >= 0;offs--)
321   {
322      int sx,sy,flipx,flipy;
386   int flags = TILE_FLIPYX(cclimber_colorram[tile_index] >> 6);
323387
324      sx = offs % 32;
325      sy = offs / 32;
326      flipx = colorram[offs] & 0x40;
327      flipy = colorram[offs] & 0x80;
328      /* vertical flipping flips two adjacent characters */
329      if (flipy) sy ^= 1;
388   /* vertical flipping flips two adjacent characters */
389   if (flags & 0x02)
390      tile_index = tile_index ^ 0x20;
330391
331      if (flip_screen_x)
332      {
333         sx = 31 - sx;
334         flipx = !flipx;
335      }
336      if (flip_screen_y)
337      {
338         sy = 31 - sy;
339         flipy = !flipy;
340      }
392   code = ((cclimber_colorram[tile_index] & 0x10) << 4) | cclimber_videoram[tile_index];
393   color = ((*swimmer_palettebank & 0x01) << 4) | (cclimber_colorram[tile_index] & 0x0f);
341394
342      drawgfx(tmpbitmap,machine->gfx[(colorram[offs] & 0x10) ? 1 : 0],
343            videoram[offs] + 8 * (colorram[offs] & 0x20),
344            colorram[offs] & 0x0f,
345            flipx,flipy,
346            8*sx,8*sy,
347            0,TRANSPARENCY_NONE,0);
348   }
395   SET_TILE_INFO(0, code, color, flags);
396}
349397
350398
351   /* copy the temporary bitmap to the screen */
352   {
353      int scroll[32];
399static TILE_GET_INFO( toprollr_get_pf_tile_info )
400{
401   int code, attr, color;
354402
403   attr = tile_index & 0x10 ? cclimber_colorram[tile_index & ~0x20] : cclimber_colorram[tile_index];
404   code = ((attr & 0x30) << 4) | cclimber_videoram[tile_index];
405   color = attr & 0x0f;
355406
356      if (flip_screen_x)
357      {
358         for (offs = 0;offs < 32;offs++)
359         {
360            scroll[offs] = -cclimber_column_scroll[31 - offs];
361            if (flip_screen_y) scroll[offs] = -scroll[offs];
362         }
363      }
364      else
365      {
366         for (offs = 0;offs < 32;offs++)
367         {
368            scroll[offs] = -cclimber_column_scroll[offs];
369            if (flip_screen_y) scroll[offs] = -scroll[offs];
370         }
371      }
407   SET_TILE_INFO(0, code, color, 0);
408}
372409
373      copyscrollbitmap(bitmap,tmpbitmap,0,0,32,scroll,cliprect);
374   }
375410
411static TILE_GET_INFO( cclimber_get_bs_tile_info )
412{
413   int code, color;
376414
377   if (cclimber_bigspriteram[0] & 1)
378      /* draw the "big sprite" below sprites */
379      cclimber_draw_big_sprite(machine, bitmap, cliprect);
415   /* only the lower right is visible */
416   tileinfo->group = ((tile_index & 0x210) == 0x210) ? 0 : 1;
380417
418   /* the address doesn't use A4 of the coordinates, giving a 16x16 map */
419   tile_index = ((tile_index & 0x1e0) >> 1) | (tile_index & 0x0f);
381420
382   /* Draw the sprites. Note that it is important to draw them exactly in this */
383   /* order, to have the correct priorities. */
384   for (offs = spriteram_size - 4;offs >= 0;offs -= 4)
385   {
386      int sx,sy,flipx,flipy;
421   code = ((cclimber_bigsprite_control[1] & 0x08) << 5) | cclimber_bigsprite_videoram[tile_index];
422   color = cclimber_bigsprite_control[1] & 0x07;
387423
424   SET_TILE_INFO(2, code, color, 0);
425}
388426
389      sx = spriteram[offs + 3];
390      sy = 240 - spriteram[offs + 2];
391      flipx = spriteram[offs] & 0x40;
392      flipy = spriteram[offs] & 0x80;
393      if (flip_screen_x)
394      {
395         sx = 240 - sx;
396         flipx = !flipx;
397      }
398      if (flip_screen_y)
399      {
400         sy = 240 - sy;
401         flipy = !flipy;
402      }
403427
404      drawgfx(bitmap,machine->gfx[spriteram[offs + 1] & 0x10 ? 4 : 3],
405            (spriteram[offs] & 0x3f) + 2 * (spriteram[offs + 1] & 0x20),
406            spriteram[offs + 1] & 0x0f,
407            flipx,flipy,
408            sx,sy,
409            cliprect,TRANSPARENCY_PEN,0);
410   }
428static TILE_GET_INFO( toprollr_get_bs_tile_info )
429{
430   int code, color;
411431
432   /* only the lower right is visible */
433   tileinfo->group = ((tile_index & 0x210) == 0x210) ? 0 : 1;
412434
413   if ((cclimber_bigspriteram[0] & 1) == 0)
414      /* draw the "big sprite" over sprites */
415      cclimber_draw_big_sprite(machine, bitmap, cliprect);
416   return 0;
435   /* the address doesn't use A4 of the coordinates, giving a 16x16 map */
436   tile_index = ((tile_index & 0x1e0) >> 1) | (tile_index & 0x0f);
437
438   code = ((cclimber_bigsprite_control[1] & 0x18) << 5) | cclimber_bigsprite_videoram[tile_index];
439   color = cclimber_bigsprite_control[1] & 0x07;
440
441   SET_TILE_INFO(2, code, color, 0);
417442}
418443
419444
420VIDEO_UPDATE( cannonb )
445static TILE_GET_INFO( toproller_get_bg_tile_info )
421446{
422   int offs;
447   int code = ((toprollr_bg_coloram[tile_index] & 0x40) << 2) | toprollr_bg_videoram[tile_index];
448   int color = toprollr_bg_coloram[tile_index] & 0x0f;
423449
424   for (offs = videoram_size - 1;offs >= 0;offs--)
425   {
426      int attr,code,color,sx,sy,flipx,flipy;
450   SET_TILE_INFO(3, code, color, TILE_FLIPX);
451}
427452
428      code = videoram[offs];
429      attr = colorram[offs] & 0x20;
430      color = colorram[offs] & 0x0f;
431      sx = offs % 32;
432      sy = offs / 32;
433      flipx = colorram[offs] & 0x40;
434      flipy = colorram[offs] & 0x80;
435      /* vertical flipping flips two adjacent characters */
436      if (flipy) sy ^= 1;
437453
438      if (flip_screen_x)
439      {
440         sx = 31 - sx;
441         flipx = !flipx;
442      }
443      if (flip_screen_y)
444      {
445         sy = 31 - sy;
446         flipy = !flipy;
447      }
454VIDEO_START( cclimber )
455{
456   pf_tilemap = tilemap_create(cclimber_get_pf_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
457   tilemap_set_transparent_pen(pf_tilemap, 0);
458   tilemap_set_scroll_cols(pf_tilemap, 32);
448459
449      drawgfx(tmpbitmap,machine->gfx[0],
450            code + 8 * attr,
451            color,
452            flipx,flipy,
453            8*sx,8*sy,
454            0,TRANSPARENCY_NONE,0);
455   }
460   bs_tilemap = tilemap_create(cclimber_get_bs_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
461   tilemap_set_scroll_cols(bs_tilemap, 1);
462   tilemap_set_scroll_rows(bs_tilemap, 1);
463   tilemap_set_transmask(bs_tilemap, 0, 0x01, 0);   /* pen 0 is transaprent */
464   tilemap_set_transmask(bs_tilemap, 1, 0x0f, 0);  /* all 4 pens are transparent */
465}
456466
457467
458   /* copy the temporary bitmap to the screen */
459   {
460      int scroll[32];
468VIDEO_START( swimmer )
469{
470   pf_tilemap = tilemap_create(swimmer_get_pf_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
471   tilemap_set_transparent_pen(pf_tilemap, 0);
472   tilemap_set_scroll_cols(pf_tilemap, 32);
461473
474   bs_tilemap = tilemap_create(cclimber_get_bs_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
475   tilemap_set_scroll_cols(bs_tilemap, 1);
476   tilemap_set_scroll_rows(bs_tilemap, 1);
477   tilemap_set_transmask(bs_tilemap, 0, 0x01, 0);   /* pen 0 is transaprent */
478   tilemap_set_transmask(bs_tilemap, 1, 0xff, 0);  /* all 8 pens are transparent */
479}
462480
463      if (flip_screen_x)
464      {
465         for (offs = 0;offs < 32;offs++)
466         {
467            scroll[offs] = -cclimber_column_scroll[31 - offs];
468            if (flip_screen_y) scroll[offs] = -scroll[offs];
469         }
470      }
471      else
472      {
473         for (offs = 0;offs < 32;offs++)
474         {
475            scroll[offs] = -cclimber_column_scroll[offs];
476            if (flip_screen_y) scroll[offs] = -scroll[offs];
477         }
478      }
479481
480      copyscrollbitmap(bitmap,tmpbitmap,0,0,32,scroll,cliprect);
481   }
482VIDEO_START( toprollr )
483{
484   pf_tilemap = tilemap_create(toprollr_get_pf_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
485   tilemap_set_transparent_pen(pf_tilemap, 0);
482486
487   toproller_bg_tilemap = tilemap_create(toproller_get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
488   tilemap_set_scroll_rows(toproller_bg_tilemap, 1);
483489
484   if (cclimber_bigspriteram[0] & 1)
485      /* draw the "big sprite" below sprites */
486      cclimber_draw_big_sprite(machine, bitmap, cliprect);
490   bs_tilemap = tilemap_create(toprollr_get_bs_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
491   tilemap_set_scroll_cols(bs_tilemap, 1);
492   tilemap_set_scroll_rows(bs_tilemap, 1);
493   tilemap_set_transmask(bs_tilemap, 0, 0x01, 0);   /* pen 0 is transaprent */
494   tilemap_set_transmask(bs_tilemap, 1, 0x0f, 0);  /* all 4 pens are transparent */
495}
487496
488497
489   /* Draw the sprites. Note that it is important to draw them exactly in this */
490   /* order, to have the correct priorities. */
491   for (offs = spriteram_size - 4;offs >= 0;offs -= 4)
492   {
493      int code,color,sx,sy,flipx,flipy;
498static void draw_playfield(mame_bitmap *bitmap, const rectangle *cliprect)
499{
500   int i;
494501
495      code = spriteram[offs] & 0x3f;
496      color = spriteram[offs + 1] & 0x0f;
497      sx = spriteram[offs + 3];
498      sy = 240 - spriteram[offs + 2];
499      flipx = spriteram[offs] & 0x40;
500      flipy = spriteram[offs] & 0x80;
501      if (flip_screen_x)
502      {
503         sx = 240 - sx;
504         flipx = !flipx;
505      }
506      if (flip_screen_y)
507      {
508         sy = 240 - sy;
509         flipy = !flipy;
510      }
502   tilemap_mark_all_tiles_dirty(pf_tilemap);
503   tilemap_set_flip(pf_tilemap, (CCLIMBER_FLIP_X ? TILEMAP_FLIPX : 0) |
504                         (CCLIMBER_FLIP_Y ? TILEMAP_FLIPY : 0));
505   for (i = 0; i < 32; i++)
506      tilemap_set_scrolly(pf_tilemap, i, cclimber_column_scroll[i]);
511507
512      drawgfx(bitmap,machine->gfx[3],
513            code + 0x40,
514            color,
515            flipx,flipy,
516            sx,sy,
517            cliprect,TRANSPARENCY_PEN,0);
518   }
519
520   if ((cclimber_bigspriteram[0] & 1) == 0)
521      /* draw the "big sprite" over sprites */
522      cclimber_draw_big_sprite(machine, bitmap, cliprect);
523   return 0;
508   tilemap_draw(bitmap, cliprect, pf_tilemap, 0, 0);
524509}
525510
526511
527VIDEO_UPDATE( swimmer )
512static void cclimber_draw_bigsprite(mame_bitmap *bitmap, const rectangle *cliprect)
528513{
529   int offs;
514   UINT8 x = cclimber_bigsprite_control[3] - 8;
515   UINT8 y = cclimber_bigsprite_control[2];
516   int bigsprite_flip_x = (cclimber_bigsprite_control[1] & 0x10) >> 4;
517   int bigsprite_flip_y = (cclimber_bigsprite_control[1] & 0x20) >> 5;
530518
531   swimmer_set_background_pen(machine);
519   if (bigsprite_flip_x)
520      x = 0x7f - x;
532521
533   for (offs = videoram_size - 1;offs >= 0;offs--)
534   {
535      int sx,sy,flipx,flipy,color;
522   if (bigsprite_flip_y)
523      y = 0x7f - y;
536524
537      sx = offs % 32;
538      sy = offs / 32;
539      flipx = colorram[offs] & 0x40;
540      flipy = colorram[offs] & 0x80;
541      /* vertical flipping flips two adjacent characters */
542      if (flipy) sy ^= 1;
525   tilemap_mark_all_tiles_dirty(bs_tilemap);
543526
544      color = (colorram[offs] & 0x0f) + 0x10 * (*swimmer_palettebank & 0x01);
545      if (sx >= 24 && (*swimmer_sidepanel_enabled & 0x01))
546      {
547         color += 32;
548      }
527   tilemap_set_flip(bs_tilemap, (bigsprite_flip_x ? TILEMAP_FLIPX : 0) |
528                         (CCLIMBER_FLIP_Y ^ bigsprite_flip_y ? TILEMAP_FLIPY : 0));
549529
550      if (flip_screen_x)
551      {
552         sx = 31 - sx;
553         flipx = !flipx;
554      }
555      if (flip_screen_y)
556      {
557         sy = 31 - sy;
558         flipy = !flipy;
559      }
530   tilemap_set_scrollx(bs_tilemap, 0, x);
531   tilemap_set_scrolly(bs_tilemap, 0, y);
560532
561      drawgfx(tmpbitmap,machine->gfx[0],
562            videoram[offs] + ((colorram[offs] & 0x10) << 4),
563            color,
564            flipx,flipy,
565            8*sx,8*sy,
566            0,TRANSPARENCY_NONE,0);
567   }
533   tilemap_draw(bitmap, cliprect, bs_tilemap, 0, 0);
534}
568535
569536
570   /* copy the temporary bitmap to the screen */
571   {
572      int scroll[32];
537static void toprollr_draw_bigsprite(mame_bitmap *bitmap, const rectangle *cliprect)
538{
539   UINT8 x = cclimber_bigsprite_control[3] - 8;
540   UINT8 y = cclimber_bigsprite_control[2];
573541
542   tilemap_mark_all_tiles_dirty(bs_tilemap);
574543
575      if (flip_screen_y)
576      {
577         for (offs = 0;offs < 32;offs++)
578            scroll[offs] = cclimber_column_scroll[31 - offs];
579      }
580      else
581      {
582         for (offs = 0;offs < 32;offs++)
583            scroll[offs] = -cclimber_column_scroll[offs];
584      }
544   tilemap_set_flip(bs_tilemap, CCLIMBER_FLIP_Y ? TILEMAP_FLIPY : 0);
585545
586      copyscrollbitmap(bitmap,tmpbitmap,0,0,32,scroll,cliprect);
587   }
546   tilemap_set_scrollx(bs_tilemap, 0, x);
547   tilemap_set_scrolly(bs_tilemap, 0, y);
588548
549   tilemap_draw(bitmap, cliprect, bs_tilemap, 0, 0);
550}
589551
590   if (cclimber_bigspriteram[0] & 1)
591      /* draw the "big sprite" below sprites */
592      cclimber_draw_big_sprite(machine, bitmap, cliprect);
593552
553static void cclimber_draw_sprites(mame_bitmap *bitmap, gfx_element **gfx, const rectangle *cliprect)
554{
555   int offs;
594556
595   /* Draw the sprites. Note that it is important to draw them exactly in this */
596   /* order, to have the correct priorities. */
597   for (offs = spriteram_size - 4;offs >= 0;offs -= 4)
557   /* draw the sprites -- note that it is important to draw them exactly in this
558       order, to have the correct priorities. */
559   for (offs = 0x1c; offs >= 0; offs -= 4)
598560   {
599      int sx,sy,flipx,flipy;
561      int x = cclimber_spriteram[offs + 3];
562      int y = 240 - cclimber_spriteram[offs + 2];
600563
564      int code = ((cclimber_spriteram[offs + 1] & 0x10) << 3) |
565               ((cclimber_spriteram[offs + 1] & 0x20) << 1) |
566               ( cclimber_spriteram[offs + 0] & 0x3f);
601567
602      sx = spriteram[offs + 3];
603      sy = 240 - spriteram[offs + 2];
604      flipx = spriteram[offs] & 0x40;
605      flipy = spriteram[offs] & 0x80;
606      if (flip_screen_x)
568      int color = cclimber_spriteram[offs + 1] & 0x0f;
569
570      int flipx = cclimber_spriteram[offs + 0] & 0x40;
571      int flipy = cclimber_spriteram[offs + 0] & 0x80;
572
573      if (CCLIMBER_FLIP_X)
607574      {
608         sx = 240 - sx;
575         x = 240 - x;
609576         flipx = !flipx;
610577      }
611      if (flip_screen_y)
578
579      if (CCLIMBER_FLIP_Y)
612580      {
613         sy = 240 - sy;
581         y = 240 - y;
614582         flipy = !flipy;
615583      }
616584
617      drawgfx(bitmap,machine->gfx[1],
618            (spriteram[offs] & 0x3f) | (spriteram[offs + 1] & 0x10) << 2,
619            (spriteram[offs + 1] & 0x0f) + 0x10 * (*swimmer_palettebank & 0x01),
620            flipx,flipy,
621            sx,sy,
622            cliprect,TRANSPARENCY_PEN,0);
585      drawgfx(bitmap, gfx[1], code, color, flipx, flipy, x, y, cliprect, TRANSPARENCY_PEN, 0);
623586   }
624
625
626   if ((cclimber_bigspriteram[0] & 1) == 0)
627      /* draw the "big sprite" over sprites */
628      cclimber_draw_big_sprite(machine, bitmap, cliprect);
629   return 0;
630587}
631588
632VIDEO_UPDATE( yamato )
589
590static void swimmer_draw_sprites(mame_bitmap *bitmap, gfx_element **gfx, const rectangle *cliprect)
633591{
634592   int offs;
635   int i,j;
636593
637   /* bg gradient */
638   fillbitmap(bitmap, 0, cliprect);
639
640   for(i=8;i<256;i++)
594   /* draw the sprites -- note that it is important to draw them exactly in this
595       order, to have the correct priorities. */
596   for (offs = 0x1c; offs >= 0; offs -= 4)
641597   {
642      pen_t pen = 16*4+8*4 + memory_region(REGION_USER1)[(flip_screen_x?0x1280:0x1200)+(i>>1)];
598      int x = cclimber_spriteram[offs + 3];
599      int y = 240 - cclimber_spriteram[offs + 2];
643600
644      for(j=0;j<256;j++)
645      {
646         *BITMAP_ADDR16(bitmap, j, i-8) = pen;
647      }
648   }
601      int code = ((cclimber_spriteram[offs + 1] & 0x10) << 2) |
602               (cclimber_spriteram[offs + 0] & 0x3f);
649603
604      int color = ((*swimmer_palettebank & 0x01) << 4) |
605               (cclimber_spriteram[offs + 1] & 0x0f);
650606
651   fillbitmap(tmpbitmap, 0, NULL);
607      int flipx = cclimber_spriteram[offs + 0] & 0x40;
608      int flipy = cclimber_spriteram[offs + 0] & 0x80;
652609
653   for (offs = videoram_size - 1;offs >= 0;offs--)
654   {
655      int sx,sy,flipx,flipy;
656
657      sx = offs % 32;
658      sy = offs / 32;
659      flipx = colorram[offs] & 0x40;
660      flipy = colorram[offs] & 0x80;
661      /* vertical flipping flips two adjacent characters */
662      if (flipy) sy ^= 1;
663
664      if (flip_screen_x)
610      if (CCLIMBER_FLIP_X)
665611      {
666         sx = 31 - sx;
612         x = 240 - x;
667613         flipx = !flipx;
668614      }
669      if (flip_screen_y)
615
616      if (CCLIMBER_FLIP_Y)
670617      {
671         sy = 31 - sy;
618         y = 240 - y;
672619         flipy = !flipy;
673620      }
674621
675      drawgfx(tmpbitmap,machine->gfx[(colorram[offs] & 0x10) ? 1 : 0],
676            videoram[offs] + 8 * (colorram[offs] & 0x20),
677            colorram[offs] & 0x0f,
678            flipx,flipy,
679            8*sx,8*sy,
680            NULL,TRANSPARENCY_PEN,0);
622      drawgfx(bitmap, gfx[1], code, color, flipx, flipy, x, y, cliprect, TRANSPARENCY_PEN, 0);
681623   }
624}
682625
683626
684   /* copy the temporary bitmap to the screen */
685   {
686      int scroll[32];
627VIDEO_UPDATE( cclimber )
628{
629   fillbitmap(bitmap, CCLIMBER_BG_PEN, cliprect);
630   draw_playfield(bitmap, cliprect);
687631
688
689      if (flip_screen_x)
690      {
691         for (offs = 0;offs < 32;offs++)
692         {
693            scroll[offs] = -cclimber_column_scroll[31 - offs];
694            if (flip_screen_y) scroll[offs] = -scroll[offs];
695         }
696      }
697      else
698      {
699         for (offs = 0;offs < 32;offs++)
700         {
701            scroll[offs] = -cclimber_column_scroll[offs];
702            if (flip_screen_y) scroll[offs] = -scroll[offs];
703         }
704      }
705
706      copyscrollbitmap_trans(bitmap,tmpbitmap,0,0,32,scroll,cliprect,0);
632   /* draw the "big sprite" under the regular sprites */
633   if ((cclimber_bigsprite_control[0] & 0x01))
634   {
635      cclimber_draw_bigsprite(bitmap, cliprect);
636      cclimber_draw_sprites(bitmap, machine->gfx, cliprect);
707637   }
708638
709
710   if (cclimber_bigspriteram[0] & 1)
711      /* draw the "big sprite" below sprites */
712      cclimber_draw_big_sprite(machine, bitmap, cliprect);
713
714
715   /* Draw the sprites. Note that it is important to draw them exactly in this */
716   /* order, to have the correct priorities. */
717   for (offs = spriteram_size - 4;offs >= 0;offs -= 4)
639   /* draw the "big sprite" over the regular sprites */
640   else
718641   {
719      int sx,sy,flipx,flipy;
720
721
722      sx = spriteram[offs + 3];
723      sy = 240 - spriteram[offs + 2];
724      flipx = spriteram[offs] & 0x40;
725      flipy = spriteram[offs] & 0x80;
726      if (flip_screen_x)
727      {
728         sx = 240 - sx;
729         flipx = !flipx;
730      }
731      if (flip_screen_y)
732      {
733         sy = 240 - sy;
734         flipy = !flipy;
735      }
736
737      drawgfx(bitmap,machine->gfx[spriteram[offs + 1] & 0x10 ? 4 : 3],
738            (spriteram[offs] & 0x3f) + 2 * (spriteram[offs + 1] & 0x20),
739            spriteram[offs + 1] & 0x0f,
740            flipx,flipy,
741            sx,sy,
742            cliprect,TRANSPARENCY_PEN,0);
642      cclimber_draw_sprites(bitmap, machine->gfx, cliprect);
643      cclimber_draw_bigsprite(bitmap, cliprect);
743644   }
744645
745
746   if ((cclimber_bigspriteram[0] & 1) == 0)
747      /* draw the "big sprite" over sprites */
748      cclimber_draw_big_sprite(machine, bitmap, cliprect);
749646   return 0;
750647}
751648
752649
753/* Top Roller */
754
755#define PRIORITY_OVER     0x20
756#define PRIORITY_UNDER    0x00
757#define PRIORITY_MASK    0x20
758
759static tilemap *bg_tilemap;
760
761UINT8 *toprollr_videoram2;
762UINT8 *toprollr_videoram3;
763UINT8 *toprollr_videoram4;
764
765
766static TILE_GET_INFO( get_tile_info_bg )
650VIDEO_UPDATE( yamato )
767651{
768   int code = toprollr_videoram3[tile_index];
769   int attr = toprollr_videoram4[tile_index];
770   int flipx,flipy,bank,palette;
652   int i;
653   UINT8 *sky_rom = memory_region(REGION_USER1) + 0x1200;
771654
772   bank=(attr&0x40)<<2;
655   for (i = 0; i < 0x100; i++)
656   {
657      int j;
658      pen_t pen = YAMATO_SKY_PEN_BASE + sky_rom[(CCLIMBER_FLIP_X ? 0x80 : 0) + (i >> 1)];
773659
660      for (j = 0; j < 0x100; j++)
661         *BITMAP_ADDR16(bitmap, j, (i - 8) & 0xff) = pen;
662   }
774663
664   draw_playfield(bitmap, cliprect);
775665
666   /* draw the "big sprite" under the regular sprites */
667   if ((cclimber_bigsprite_control[0] & 0x01))
668   {
669      cclimber_draw_bigsprite(bitmap, cliprect);
670      cclimber_draw_sprites(bitmap, machine->gfx, cliprect);
671   }
776672
673   /* draw the "big sprite" over the regular sprites */
674   else
675   {
676      cclimber_draw_sprites(bitmap, machine->gfx, cliprect);
677      cclimber_draw_bigsprite(bitmap, cliprect);
678   }
777679
778   flipx=1;
779   flipy=0;
780
781   code+=bank;
782
783   palette=(attr&0xf)+0x18 ;
784
785   SET_TILE_INFO(1, code, palette, (flipx?TILE_FLIPX:0)|(flipy?TILE_FLIPY:0));
680   return 0;
786681}
787682
788VIDEO_START( toprollr )
789{
790   bg_tilemap = tilemap_create(get_tile_info_bg,tilemap_scan_rows,8,8,32,32);
791}
792683
793static void toprollr_draw_big_sprite(running_machine *machine, mame_bitmap *bitmap,const rectangle *cliprect,int priority)
684VIDEO_UPDATE( swimmer )
794685{
795   if((cclimber_bigspriteram[1]&PRIORITY_MASK)==priority)
686   swimmer_set_background_pen(machine);
687
688   if (*swimmer_side_background_enabled & 0x01)
796689   {
797      int code,xs,ys,palette,bank,x,y;
798      int flipx=0;
799      int flipy=0;
690      if (CCLIMBER_FLIP_X)
691      {
692         rectangle split_rect_left =  { 0, 0xff - SWIMMER_BG_SPLIT, 0, 0xff };
693         rectangle split_rect_right = { 0x100 - SWIMMER_BG_SPLIT, 0xff, 0, 0xff };
800694
801      xs=136-cclimber_bigspriteram[3];
802      ys=128-cclimber_bigspriteram[2];
695         sect_rect(&split_rect_left, cliprect);
696         fillbitmap(bitmap, SWIMMER_SIDE_BG_PEN, &split_rect_left);
803697
804
805      if(xs==0)
806      {
807         return;
698         sect_rect(&split_rect_right, cliprect);
699         fillbitmap(bitmap, CCLIMBER_BG_PEN, &split_rect_right);
808700      }
809
810      if (flip_screen_x)
701      else
811702      {
812         flipx^=1;
813      }
703         rectangle split_rect_left =  { 0, SWIMMER_BG_SPLIT - 1, 0, 0xff };
704         rectangle split_rect_right = { SWIMMER_BG_SPLIT, 0xff, 0, 0xff };
814705
815      palette=cclimber_bigspriteram[1]&0x7;
706         sect_rect(&split_rect_left, cliprect);
707         fillbitmap(bitmap, CCLIMBER_BG_PEN, &split_rect_left);
816708
817      bank=(cclimber_bigspriteram[1]>>3)&3;
709         sect_rect(&split_rect_right, cliprect);
710         fillbitmap(bitmap, SWIMMER_SIDE_BG_PEN, &split_rect_right);
711      }
712   }
713   else
714      fillbitmap(bitmap, CCLIMBER_BG_PEN, cliprect);
818715
716   draw_playfield(bitmap, cliprect);
819717
820      for(y=0;y<16;y++)
821         for(x=0;x<16;x++)
822         {
823            int sx=x;
824            int sy=y;
825            if (flipx) sx = 15 - x;
826            if (flipy) sy = 15 - y;
718   /* draw the "big sprite" under the regular sprites */
719   if ((cclimber_bigsprite_control[0] & 0x01))
720   {
721      cclimber_draw_bigsprite(bitmap, cliprect);
722      swimmer_draw_sprites(bitmap, machine->gfx, cliprect);
723   }
827724
828            code=cclimber_bsvideoram[y*16+x]+bank*256;
829
830            drawgfx(bitmap, machine->gfx[3], code, palette, flipx, flipy,(sx*8+xs)&0xff,(sy*8+ys)&0xff, cliprect, TRANSPARENCY_PEN, 0);
831            drawgfx(bitmap, machine->gfx[3], code, palette, flipx, flipy,((sx*8+xs)&0xff)-256,((sy*8+ys)&0xff)-256, cliprect, TRANSPARENCY_PEN, 0);
832         }
725   /* draw the "big sprite" over the regular sprites */
726   else
727   {
728      swimmer_draw_sprites(bitmap, machine->gfx, cliprect);
729      cclimber_draw_bigsprite(bitmap, cliprect);
833730   }
731
732   return 0;
834733}
835734
735
836736VIDEO_UPDATE( toprollr )
837737{
738   rectangle scroll_area_clip = *cliprect;
739   scroll_area_clip.min_x = 4*8;
740   scroll_area_clip.max_x = 29*8-1;
838741
839   UINT32 x,y;
840   int offs;
841   rectangle myclip=*cliprect;
842   myclip.min_x=4*8;
843   myclip.max_x=29*8-1;
742   fillbitmap(bitmap, CCLIMBER_BG_PEN, cliprect);
844743
845   fillbitmap(bitmap, 0, cliprect);
744   tilemap_set_scrollx(toproller_bg_tilemap, 0, toprollr_bg_videoram[0]);
745   tilemap_set_flip(toproller_bg_tilemap, (CCLIMBER_FLIP_X ? TILEMAP_FLIPX : 0) |
746                                  (CCLIMBER_FLIP_Y ? TILEMAP_FLIPY : 0));
747   tilemap_mark_all_tiles_dirty(toproller_bg_tilemap);
748   tilemap_draw(bitmap, &scroll_area_clip, toproller_bg_tilemap, 0, 0);
846749
847   tilemap_set_scrollx(bg_tilemap,0,toprollr_videoram3[0]+8);
848   tilemap_mark_all_tiles_dirty(bg_tilemap);
849   tilemap_draw(bitmap, &myclip,bg_tilemap,0,0);
850
851   toprollr_draw_big_sprite(machine, bitmap, &myclip, PRIORITY_UNDER);
852
853   for (offs = spriteram_size - 4;offs >= 0;offs -= 4)
750   /* draw the "big sprite" over the regular sprites */
751   if ((cclimber_bigsprite_control[1] & 0x20))
854752   {
855      int sx,sy,flipx,flipy,palette;
753      cclimber_draw_sprites(bitmap, machine->gfx, &scroll_area_clip);
754      toprollr_draw_bigsprite(bitmap, &scroll_area_clip);
755   }
856756
857      sx = spriteram[offs + 3]-8;
858      sy = 240 - spriteram[offs + 2];
859      flipx = spriteram[offs] & 0x40;
860      flipy = spriteram[offs] & 0x80;
861      if (flip_screen_x)
862      {
863         sx = 240 - sx;
864         flipx = !flipx;
865      }
866      if (flip_screen_y)
867      {
868         sy = 240 - sy;
869         flipy = !flipy;
870      }
871
872      palette=0x08+(spriteram[offs + 1] & 0x0f);
873
874      drawgfx(bitmap,machine->gfx[2],
875         (spriteram[offs] & 0x3f) + 2 * (spriteram[offs + 1] & 0x20)+8*(spriteram[offs + 1] & 0x10),
876            palette,
877            flipx,flipy,
878            sx,sy,
879            &myclip,TRANSPARENCY_PEN,0);
757   /* draw the "big sprite" under the regular sprites */
758   else
759   {
760      toprollr_draw_bigsprite(bitmap, &scroll_area_clip);
761      cclimber_draw_sprites(bitmap, machine->gfx, &scroll_area_clip);
880762   }
881763
882   toprollr_draw_big_sprite(machine, bitmap, &myclip, PRIORITY_OVER);
764   tilemap_mark_all_tiles_dirty(pf_tilemap);
765   tilemap_set_flip(pf_tilemap, (CCLIMBER_FLIP_X ? TILEMAP_FLIPX : 0) |
766                         (CCLIMBER_FLIP_Y ? TILEMAP_FLIPY : 0));
767   tilemap_draw(bitmap, cliprect, pf_tilemap, 0, 0);
883768
884   for(y=0;y<32;y++)
885      for(x=0;x<32;x++)
886      {
887         int sx=x*8;
888         int sy=y*8;
889         int flipx=0;
890         int flipy=0;
891
892         int code=videoram[y*32+x];
893         int attr=(x>16)?(toprollr_videoram2[(y&0xfe)*32+x]):(toprollr_videoram2[y*32+x]);
894         int palette;
895
896         if (flip_screen_x)
897         {
898            sx = 240 - sx;
899            flipx^=1;
900         }
901         if (flip_screen_y)
902         {
903            sy = 240 - sy;
904            flipy^=1;
905         }
906
907         palette=8+(attr&0xf);
908         drawgfx(bitmap, machine->gfx[0], code+((attr&0xf0)<<4),palette, flipx, flipy, sx, sy, cliprect, TRANSPARENCY_PEN, 0);
909
910      }
911769   return 0;
912770}
913
914
915
src/mame/video/hexa.c
r1771r1772
2323   int bankaddress;
2424
2525   /* bit 0 = flipx (or y?) */
26   if (flip_screen_x != (data & 0x01))
26   if (flip_screen_x_get() != (data & 0x01))
2727   {
2828      flip_screen_x_set(data & 0x01);
2929      tilemap_mark_all_tiles_dirty(bg_tilemap);
3030   }
3131
3232   /* bit 1 = flipy (or x?) */
33   if (flip_screen_y != (data & 0x02))
33   if (flip_screen_y_get() != (data & 0x02))
3434   {
3535      flip_screen_y_set(data & 0x02);
3636      tilemap_mark_all_tiles_dirty(bg_tilemap);
src/mame/video/cloak.c
r1771r1772
55***************************************************************************/
66
77#include "driver.h"
8#include "deprecat.h"
8#include "video/resnet.h"
99#include "cloak.h"
1010
11static mame_bitmap *tmpbitmap2;
12static UINT8 x,y,bmap;
13static UINT8 *tmpvideoram,*tmpvideoram2;
1411
12#define NUM_PENS   (0x40)
13
14static UINT8 bitmap_videoram_selected;
15static UINT8 bitmap_videoram_address_x;
16static UINT8 bitmap_videoram_address_y;
17static UINT8 *bitmap_videoram1;
18static UINT8 *bitmap_videoram2;
19static UINT8 *current_bitmap_videoram_accessed;
20static UINT8 *current_bitmap_videoram_displayed;
21static UINT16 *palette_ram;
22
1523static tilemap *bg_tilemap;
1624
1725/***************************************************************************
r1771r1772
1927  CLOAK & DAGGER uses RAM to dynamically
2028  create the palette. The resolution is 9 bit (3 bits per gun). The palette
2129  contains 64 entries, but it is accessed through a memory windows 128 bytes
22  long: writing to the first 64 bytes sets the msb of the red component to 0,
30  long: writing to the first 64 bytes sets the MSB of the red component to 0,
2331  while writing to the last 64 bytes sets it to 1.
2432
2533  Colors 0-15  Character mapped graphics
26  Colors 16-31 Bitmapped graphics (maybe 8 colors per bitmap?)
34  Colors 16-31 Bitmapped graphics (2 palettes selected by 128H)
2735  Colors 32-47 Sprites
2836  Colors 48-63 not used
2937
r1771r1772
4048  bit 0 -- diode |< -- pullup 1 kohm -- 10  kohm resistor -- pulldown 100 pf -- BLUE
4149
4250***************************************************************************/
51
4352WRITE8_HANDLER( cloak_paletteram_w )
4453{
45   int r,g,b;
46   int bit0,bit1,bit2;
54   palette_ram[offset & 0x3f] = ((offset & 0x40) << 2) | data;
55}
4756
48   /* a write to offset 64-127 means to set the msb of the red component */
49   int color = data | ((offset & 0x40) << 2);
5057
51   r = (~color & 0x1c0) >> 6;
52   g = (~color & 0x038) >> 3;
53   b = (~color & 0x007);
58static void set_pens(running_machine *machine)
59{
60   static const int resistances[3] = { 10000, 4700, 2200 };
61   double weights[3];
62   int i;
5463
55   // the following is WRONG! fix it
64   /* compute the color output resistor weights */
65   compute_resistor_weights(0,   255, -1.0,
66                      3, resistances, weights, 0, 1000,
67                      0, 0, 0, 0, 0,
68                      0, 0, 0, 0, 0);
5669
57   bit0 = (r >> 0) & 0x01;
58   bit1 = (r >> 1) & 0x01;
59   bit2 = (r >> 2) & 0x01;
60   r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
61   bit0 = (g >> 0) & 0x01;
62   bit1 = (g >> 1) & 0x01;
63   bit2 = (g >> 2) & 0x01;
64   g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
65   bit0 = (b >> 0) & 0x01;
66   bit1 = (b >> 1) & 0x01;
67   bit2 = (b >> 2) & 0x01;
68   b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
70   for (i = 0; i < NUM_PENS; i++)
71   {
72      int r, g, b;
73      int bit0, bit1, bit2;
6974
70   palette_set_color(Machine,offset & 0x3f,MAKE_RGB(r,g,b));
75      /* red component */
76      bit0 = (~palette_ram[i] >> 6) & 0x01;
77      bit1 = (~palette_ram[i] >> 7) & 0x01;
78      bit2 = (~palette_ram[i] >> 8) & 0x01;
79      r = combine_3_weights(weights, bit0, bit1, bit2);
80
81      /* green component */
82      bit0 = (~palette_ram[i] >> 3) & 0x01;
83      bit1 = (~palette_ram[i] >> 4) & 0x01;
84      bit2 = (~palette_ram[i] >> 5) & 0x01;
85      g = combine_3_weights(weights, bit0, bit1, bit2);
86
87      /* blue component */
88      bit0 = (~palette_ram[i] >> 0) & 0x01;
89      bit1 = (~palette_ram[i] >> 1) & 0x01;
90      bit2 = (~palette_ram[i] >> 2) & 0x01;
91      b = combine_3_weights(weights, bit0, bit1, bit2);
92
93      palette_set_color(machine, i, MAKE_RGB(r, g, b));
94   }
7195}
7296
97
98static void set_current_bitmap_videoram_pointer(void)
99{
100   current_bitmap_videoram_accessed  = bitmap_videoram_selected ? bitmap_videoram1 : bitmap_videoram2;
101   current_bitmap_videoram_displayed = bitmap_videoram_selected ? bitmap_videoram2 : bitmap_videoram1;
102}
103
73104WRITE8_HANDLER( cloak_clearbmp_w )
74105{
75   bmap = data & 0x01;
106   video_screen_update_now(0);
107   bitmap_videoram_selected = data & 0x01;
108   set_current_bitmap_videoram_pointer();
76109
77110   if (data & 0x02)   /* clear */
78   {
79      if (bmap)
80      {
81         fillbitmap(tmpbitmap, 16, &Machine->screen[0].visarea);
82         memset(tmpvideoram, 0, 256*256);
83      }
84      else
85      {
86         fillbitmap(tmpbitmap2, 16, &Machine->screen[0].visarea);
87         memset(tmpvideoram2, 0, 256*256);
88      }
89   }
111      memset(current_bitmap_videoram_accessed, 0, 256*256);
90112}
91113
92114static void adjust_xy(int offset)
93115{
94   switch(offset)
116   switch (offset)
95117   {
96      case 0x00:  x--; y++; break;
97      case 0x01:       y--; break;
98      case 0x02:  x--;      break;
99      case 0x04:  x++; y++; break;
100      case 0x05:      y++; break;
101      case 0x06:  x++;      break;
118      case 0x00:  bitmap_videoram_address_x--; bitmap_videoram_address_y++; break;
119      case 0x01:                         bitmap_videoram_address_y--; break;
120      case 0x02:  bitmap_videoram_address_x--;                       break;
121      case 0x04:  bitmap_videoram_address_x++; bitmap_videoram_address_y++; break;
122      case 0x05:                         bitmap_videoram_address_y++; break;
123      case 0x06:  bitmap_videoram_address_x++;                       break;
102124   }
103125}
104126
105127READ8_HANDLER( graph_processor_r )
106128{
107   int ret;
129   UINT8 ret = current_bitmap_videoram_accessed[(bitmap_videoram_address_y << 8) | bitmap_videoram_address_x];
108130
109   if (bmap)
110   {
111      ret = tmpvideoram2[y * 256 + x];
112   }
113    else
114   {
115      ret = tmpvideoram[y * 256 + x];
116   }
117
118131   adjust_xy(offset);
119132
120133   return ret;
r1771r1772
122135
123136WRITE8_HANDLER( graph_processor_w )
124137{
125   int color;
126
127138   switch (offset)
128139   {
129      case 0x03: x = data; break;
130      case 0x07: y = data; break;
140      case 0x03: bitmap_videoram_address_x = data; break;
141      case 0x07: bitmap_videoram_address_y = data; break;
131142      default:
132         color = data & 0x07;
143         current_bitmap_videoram_accessed[(bitmap_videoram_address_y << 8) | bitmap_videoram_address_x] = data & 0x07;
133144
134         if (bmap)
135         {
136            *BITMAP_ADDR16(tmpbitmap, y, (x-6)&0xff) = 16 + color;
137            tmpvideoram[y*256+x] = color;
138         }
139         else
140         {
141            *BITMAP_ADDR16(tmpbitmap2, y, (x-6)&0xff) = 16 + color;
142            tmpvideoram2[y*256+x] = color;
143         }
144
145145         adjust_xy(offset);
146146         break;
147147      }
r1771r1772
165165   SET_TILE_INFO(0, code, 0, 0);
166166}
167167
168static void refresh_bitmaps(void)
168VIDEO_START( cloak )
169169{
170   int lx,ly;
170   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
171171
172   for (ly = 0; ly < 256; ly++)
173   {
174      for (lx = 0; lx < 256; lx++)
175      {
176         *BITMAP_ADDR16(tmpbitmap,  ly, (lx-6)&0xff) = 16 + tmpvideoram[ly*256+lx];
177         *BITMAP_ADDR16(tmpbitmap2, ly, (lx-6)&0xff) = 16 + tmpvideoram2[ly*256+lx];
178      }
179   }
172   bitmap_videoram1 = auto_malloc(256*256);
173   bitmap_videoram2 = auto_malloc(256*256);
174   palette_ram = auto_malloc(NUM_PENS * sizeof(palette_ram[0]));
175
176   set_current_bitmap_videoram_pointer();
177
178   state_save_register_global(bitmap_videoram_address_x);
179   state_save_register_global(bitmap_videoram_address_y);
180   state_save_register_global(bitmap_videoram_selected);
181   state_save_register_global_pointer(bitmap_videoram1, 256*256);
182   state_save_register_global_pointer(bitmap_videoram2, 256*256);
183   state_save_register_global_pointer(palette_ram, NUM_PENS);
184   state_save_register_func_postload(set_current_bitmap_videoram_pointer);
180185}
181186
182VIDEO_START( cloak )
187static void draw_bitmap(mame_bitmap *bitmap, const rectangle *cliprect)
183188{
184   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
185       8, 8, 32, 32);
189   int x, y;
186190
187   tmpbitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
188   tmpbitmap2 = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
191   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
192      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
193      {
194         pen_t pen = current_bitmap_videoram_displayed[(y << 8) | x];
189195
190   tmpvideoram = auto_malloc(256*256);
191   tmpvideoram2 = auto_malloc(256*256);
192
193   state_save_register_global(x);
194   state_save_register_global(y);
195   state_save_register_global(bmap);
196   state_save_register_global_pointer(tmpvideoram, 256*256);
197   state_save_register_global_pointer(tmpvideoram2, 256*256);
198   state_save_register_func_postload(refresh_bitmaps);
196         if (pen)
197            *BITMAP_ADDR16(bitmap, y, (x - 6) & 0xff) = 0x10 | ((x & 0x80) >> 4) | pen;
198      }
199199}
200200
201201static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
r1771r1772
210210      int sx = spriteram[offs + 192];
211211      int sy = 240 - spriteram[offs];
212212
213      if (flip_screen)
213      if (flip_screen_get())
214214      {
215215         sx -= 9;
216216         sy = 240 - sy;
r1771r1772
218218         flipy = !flipy;
219219      }
220220
221      drawgfx(bitmap, machine->gfx[1], code, 0, flipx, flipy,
222         sx, sy,   cliprect, TRANSPARENCY_PEN, 0);
221      drawgfx(bitmap, machine->gfx[1], code, 0, flipx, flipy,   sx, sy,   cliprect, TRANSPARENCY_PEN, 0);
223222   }
224223}
225224
226225VIDEO_UPDATE( cloak )
227226{
227   set_pens(machine);
228228   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
229   copybitmap_trans(bitmap, (bmap ? tmpbitmap2 : tmpbitmap),flip_screen,flip_screen,0,0,cliprect,machine->pens[16]);
229   draw_bitmap(bitmap, cliprect);
230230   draw_sprites(machine, bitmap, cliprect);
231231   return 0;
232232}
src/mame/video/namcona1.c
r1771r1772
259259      int bShadow )
260260{
261261   const gfx_element *gfx,*mask;
262   const pen_t *paldata;
262   pen_t pen_base;
263263   UINT8 *gfx_addr;
264264   int gfx_pitch;
265265   UINT8 *mask_addr;
r1771r1772
278278      mask = machine->gfx[1];
279279      code %= gfx->total_elements;
280280      color %= gfx->total_colors;
281      paldata = &machine->pens[gfx->color_base + gfx->color_granularity * color];
281      pen_base = gfx->color_base + gfx->color_granularity * color;
282282      gfx_addr = gfx->gfxdata + code * gfx->char_modulo;
283283      gfx_pitch = gfx->line_modulo;
284284      mask_addr = mask->gfxdata + code * mask->char_modulo;
r1771r1772
355355                        { /* sprite pixel is opaque */
356356                           if( priority>=pri[-x] )
357357                           {
358                              dest[-x] = paldata[gfx_addr[x]];
358                              dest[-x] = pen_base + gfx_addr[x];
359359                           }
360360                           pri[-x] = 0xff;
361361                        }
r1771r1772
372372                        { /* sprite pixel is opaque */
373373                           if( priority>=pri[x] )
374374                           {
375                              dest[x] = paldata[gfx_addr[x]];
375                              dest[x] = pen_base + gfx_addr[x];
376376                           }
377377                           pri[x] = 0xff;
378378                        }
r1771r1772
397397      int bShadow )
398398{
399399   const gfx_element *gfx;
400   const pen_t *paldata;
400   pen_t pen_base;
401401   UINT8 *gfx_addr;
402402   int gfx_pitch;
403403   int x,y;
r1771r1772
413413      gfx = machine->gfx[0];
414414      code %= gfx->total_elements;
415415      color %= gfx->total_colors;
416      paldata = &machine->pens[gfx->color_base + gfx->color_granularity * color];
416      pen_base = gfx->color_base + gfx->color_granularity * color;
417417      gfx_addr = gfx->gfxdata + code * gfx->char_modulo;
418418      gfx_pitch = gfx->line_modulo;
419419
r1771r1772
433433                  {
434434                     if( priority>=pri[-x] )
435435                     {
436                        dest[-x] = paldata[gfx_addr[x]];
436                        dest[-x] = pen_base + gfx_addr[x];
437437                     }
438438                     pri[-x] = 0xff;
439439                  }
r1771r1772
447447                  {
448448                     if( priority>=pri[x] )
449449                     {
450                        dest[x] = paldata[gfx_addr[x]];
450                        dest[x] = pen_base + gfx_addr[x];
451451                     }
452452                     pri[x] = 0xff;
453453                  } /* next x */
r1771r1772
548548   int x;
549549   UINT16 data;
550550
551   memset( pPri, 0xff, 38*8 );
552551   for( x=0; x<38*8; x+=2 )
553552   {
553      pPri[x / 2] = 0xff;
554554      data = *pSource++;
555555      pDest[x] = paldata[data>>8];
556556      pDest[x+1] = paldata[data&0xff];
src/mame/video/armedf.c
r1771r1772
241241      int sx = buffered_spriteram16[offs+3];
242242      int sy = sprite_offy+240-(buffered_spriteram16[offs+0]&0x1ff);
243243
244      if (flip_screen) {
244      if (flip_screen_get()) {
245245         sx = 320 - sx + 176;   /* don't ask where 176 comes from, just tried it out */
246246         sy = 240 - sy + 1;      /* don't ask where 1 comes from, just tried it out */
247247         flipx = !flipx;         /* the values seem to result in pixel-correct placement */
src/mame/video/dkong.c
r1771r1772
448448static TILE_GET_INFO( dkong_bg_tile_info )
449449{
450450   dkong_state *state = machine->driver_data;
451   int code = videoram[tile_index] + 256 * state->gfx_bank;
451   int code = state->video_ram[tile_index] + 256 * state->gfx_bank;
452452   int color = (state->color_codes[tile_index % 32 + 32 * (tile_index / 32 / 4)] & 0x0f) + 0x10 * state->palette_bank;
453453
454454   SET_TILE_INFO(0, code, color, 0);
r1771r1772
457457static TILE_GET_INFO( radarsc1_bg_tile_info )
458458{
459459   dkong_state *state = machine->driver_data;
460   int code = videoram[tile_index] + 256 * state->gfx_bank;
460   int code = state->video_ram[tile_index] + 256 * state->gfx_bank;
461461   int color = (state->color_codes[tile_index % 32] & 0x0f);
462462   color = color | (state->palette_bank<<4);
463463
r1771r1772
474474{
475475   dkong_state *state = Machine->driver_data;
476476
477   if (videoram[offset] != data)
477   if (state->video_ram[offset] != data)
478478   {
479      videoram[offset] = data;
479      state->video_ram[offset] = data;
480480      tilemap_mark_tile_dirty(state->bg_tilemap, offset);
481481   }
482482}
r1771r1772
553553
554554WRITE8_HANDLER( dkong_flipscreen_w )
555555{
556   flip_screen_set(~data & 0x01);
556   dkong_state *state = Machine->driver_data;
557
558   state->flip = ~data & 0x01;
557559}
558560
559561WRITE8_HANDLER( dkong_spritebank_w )
r1771r1772
575577   int offs;
576578
577579   /* Draw the sprites. */
578   for (offs = state->sprite_bank<<9;offs < (state->sprite_bank<<9) + 0x200 /* spriteram_size */; offs += 4)
580   for (offs = state->sprite_bank<<9;offs < (state->sprite_bank<<9) + 0x200 /* sprite_ram_size */; offs += 4)
579581   {
580      if (spriteram[offs])
582      if (state->sprite_ram[offs])
581583      {
582         /* spriteram[offs + 2] & 0x40 is used by Donkey Kong 3 only */
583         /* spriteram[offs + 2] & 0x30 don't seem to be used (they are */
584         /* sprite_ram[offs + 2] & 0x40 is used by Donkey Kong 3 only */
585         /* sprite_ram[offs + 2] & 0x30 don't seem to be used (they are */
584586         /* probably not part of the color code, since Mario Bros, which */
585587         /* has similar hardware, uses a memory mapped port to change */
586588         /* palette bank, so it's limited to 16 color codes) */
587589
588590         int x,y;
589591
590         x = spriteram[offs + 3] - 8;
591         y = 240 - spriteram[offs] + 7;
592         x = state->sprite_ram[offs + 3] - 8;
593         y = 240 - state->sprite_ram[offs] + 7;
592594
593         if (flip_screen)
595         if (state->flip)
594596         {
595597            x = 240 - x;
596            y = VTOTAL - VBEND - y;
598            y = VTOTAL - VBEND - y - 8;
597599
598600            drawgfx(bitmap,machine->gfx[1],
599                  (spriteram[offs + 1] & 0x7f) + ((spriteram[offs + 2] & mask_bank) << shift_bits),
600                  (spriteram[offs + 2] & 0x0f) + 16 * state->palette_bank,
601                  !(spriteram[offs + 2] & 0x80),!(spriteram[offs + 1] & 0x80),
601                  (state->sprite_ram[offs + 1] & 0x7f) + ((state->sprite_ram[offs + 2] & mask_bank) << shift_bits),
602                  (state->sprite_ram[offs + 2] & 0x0f) + 16 * state->palette_bank,
603                  !(state->sprite_ram[offs + 2] & 0x80),!(state->sprite_ram[offs + 1] & 0x80),
602604                  x,y,
603605                  cliprect,TRANSPARENCY_PEN,0);
604606
605607            /* draw with wrap around - this fixes the 'beheading' bug */
606608            drawgfx(bitmap,machine->gfx[1],
607                  (spriteram[offs + 1] & 0x7f) + ((spriteram[offs + 2] & mask_bank) << shift_bits),
608                  (spriteram[offs + 2] & 0x0f) + 16 * state->palette_bank,
609                  (spriteram[offs + 2] & 0x80),(spriteram[offs + 1] & 0x80),
609                  (state->sprite_ram[offs + 1] & 0x7f) + ((state->sprite_ram[offs + 2] & mask_bank) << shift_bits),
610                  (state->sprite_ram[offs + 2] & 0x0f) + 16 * state->palette_bank,
611                  (state->sprite_ram[offs + 2] & 0x80),(state->sprite_ram[offs + 1] & 0x80),
610612                  x-256,y,
611613                  cliprect,TRANSPARENCY_PEN,0);
612614         }
613615         else
614616         {
615617            drawgfx(bitmap,machine->gfx[1],
616                  (spriteram[offs + 1] & 0x7f) + ((spriteram[offs + 2] & mask_bank) << shift_bits),
617                  (spriteram[offs + 2] & 0x0f) + 16 * state->palette_bank,
618                  (spriteram[offs + 2] & 0x80),(spriteram[offs + 1] & 0x80),
618                  (state->sprite_ram[offs + 1] & 0x7f) + ((state->sprite_ram[offs + 2] & mask_bank) << shift_bits),
619                  (state->sprite_ram[offs + 2] & 0x0f) + 16 * state->palette_bank,
620                  (state->sprite_ram[offs + 2] & 0x80),(state->sprite_ram[offs + 1] & 0x80),
619621                  x,y,
620622                  cliprect,TRANSPARENCY_PEN,0);
621623
622624            /* draw with wrap around - this fixes the 'beheading' bug */
623625            drawgfx(bitmap,machine->gfx[1],
624                  (spriteram[offs + 1] & 0x7f) + ((spriteram[offs + 2] & mask_bank) << shift_bits),
625                  (spriteram[offs + 2] & 0x0f) + 16 * state->palette_bank,
626                  (spriteram[offs + 2] & 0x80),(spriteram[offs + 1] & 0x80),
626                  (state->sprite_ram[offs + 1] & 0x7f) + ((state->sprite_ram[offs + 2] & mask_bank) << shift_bits),
627                  (state->sprite_ram[offs + 2] & 0x0f) + 16 * state->palette_bank,
628                  (state->sprite_ram[offs + 2] & 0x80),(state->sprite_ram[offs + 1] & 0x80),
627629                  x+256,y,
628630                  cliprect,TRANSPARENCY_PEN,0);
629631         }
r1771r1772
804806   radarscp_step(machine, y);
805807   if (y <= machine->screen[0].visarea.min_y || y > machine->screen[0].visarea.max_y)
806808      counter = 0;
807   offset = ((-flip_screen) ^ state->rflip_sig) ? 0x000 : 0x400;
809   offset = (state->flip ^ state->rflip_sig) ? 0x000 : 0x400;
808810   x = 0;
809811   while (x < machine->screen[0].width)
810812   {
r1771r1772
812814      if ((counter < table_len) && (x == 4 * (table[counter|offset] & 0x7f)))
813815      {
814816         if ( state->star_ff && (table[counter|offset] & 0x80) )   /* star */
815            *pixel = machine->pens[RADARSCP_STAR_COL];
817            *pixel = RADARSCP_STAR_COL;
816818         else if (state->grid_sig && !(table[counter|offset] & 0x80))         /* radar */
817            *pixel = machine->pens[RADARSCP_GRID_COL_OFFSET+state->grid_col];
819            *pixel = RADARSCP_GRID_COL_OFFSET+state->grid_col;
818820         else
819            *pixel = machine->pens[RADARSCP_BCK_COL_OFFSET + state->blue_level];
821            *pixel = RADARSCP_BCK_COL_OFFSET + state->blue_level;
820822         counter++;
821823      }
822824      else
823         *pixel = machine->pens[RADARSCP_BCK_COL_OFFSET + state->blue_level];
825         *pixel = RADARSCP_BCK_COL_OFFSET + state->blue_level;
824826      x++;
825827   }
826828   while ((counter < table_len) && ( x < 4 * (table[counter|offset] & 0x7f)))
r1771r1772
877879   state_save_register_global(state->snd02_enable);
878880   state_save_register_global(state->sig_ansn);
879881   state_save_register_global(state->grid_col);
882   state_save_register_global(state->flip);
880883
881884   /* this must be registered here - hmmm */
882   state_save_register_global(flip_screen);
885   //state_save_register_global(flip_screen_get());
883886
884887}
885888
r1771r1772
919922{
920923   dkong_state *state = machine->driver_data;
921924
925   tilemap_set_flip(ALL_TILEMAPS, state->flip ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
926   tilemap_set_scrollx(state->bg_tilemap, 0, state->flip ?  0 : 0);
927   tilemap_set_scrolly(state->bg_tilemap, 0, state->flip ? -8 : 0);
928
922929   switch (state->hardware_type)
923930   {
924931      case HARDWARE_TKG02:
r1771r1772
947954   tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
948955
949956   /* Draw the sprites. */
950   for (offs = 0;offs < spriteram_size;offs += 4)
957   for (offs = 0;offs < state->sprite_ram_size;offs += 4)
951958   {
952      if (spriteram[offs])
959      if (state->sprite_ram[offs])
953960      {
954961         drawgfx(bitmap,machine->gfx[1],
955               spriteram[offs + 2],
956               (spriteram[offs + 1] & 0x0f) + 16 * state->palette_bank,
957               spriteram[offs + 1] & 0x80,spriteram[offs + 1] & 0x40,
958               spriteram[offs + 3] - 8,240 - spriteram[offs] + 8,
962               state->sprite_ram[offs + 2],
963               (state->sprite_ram[offs + 1] & 0x0f) + 16 * state->palette_bank,
964               state->sprite_ram[offs + 1] & 0x80,state->sprite_ram[offs + 1] & 0x40,
965               state->sprite_ram[offs + 3] - 8,240 - state->sprite_ram[offs] + 8,
959966               cliprect,TRANSPARENCY_PEN,0);
960967      }
961968   }
r1771r1772
968975
969976   tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
970977
971   /* it uses spriteram[offs + 2] & 0x10 for sprite bank */
978   /* it uses sprite_ram[offs + 2] & 0x10 for sprite bank */
972979   draw_sprites(machine, bitmap, cliprect, 0x10, 3);
973980   return 0;
974981}
src/mame/video/appoooh.c
r1771r1772
220220
221221      if(sx>=248) sx -= 256;
222222
223      if (flip_screen)
223      if (flip_screen_get())
224224      {
225225         sx = 239 - sx;
226226         sy = 239 - sy;
r1771r1772
229229      drawgfx( dest_bmp, gfx,
230230            code,
231231            color,
232            flipx,flip_screen,
232            flipx,flip_screen_get(),
233233            sx, sy,
234234            cliprect,
235235            TRANSPARENCY_PEN , 0);
r1771r1772
253253
254254      if(sx>=248) sx -= 256;
255255
256      if (flip_screen)
256      if (flip_screen_get())
257257      {
258258         sx = 239 - sx;
259259         sy = 239 - sy;
r1771r1772
262262      drawgfx( dest_bmp, gfx,
263263            code,
264264            color,
265            flipx,flip_screen,
265            flipx,flip_screen_get(),
266266            sx, sy,
267267            cliprect,
268268            TRANSPARENCY_PEN , 0);
src/mame/video/skyraid.c
r1771r1772
3535      y = 136 + 16 * (i ^ 1);
3636
3737      for (x = 0; x < bitmap->width; x += 16)
38      {
39         drawgfx(bitmap, machine->gfx[0], *p++, 0, 0, 0,
40            x, y, cliprect, TRANSPARENCY_PEN, 0);
41      }
38         drawgfx(bitmap, machine->gfx[0], *p++, 0, 0, 0,    x, y, cliprect, TRANSPARENCY_PEN, 0);
4239   }
4340}
4441
4542
46static void draw_terrain(running_machine *machine, mame_bitmap* bitmap, const rectangle *cliprect)
43static void draw_terrain(mame_bitmap* bitmap, const rectangle *cliprect)
4744{
4845   const UINT8* p = memory_region(REGION_USER1);
4946
r1771r1772
7067         r.max_y = y + 1;
7168         r.max_x = x + 31 - count;
7269
73         fillbitmap(bitmap, machine->pens[color], &r);
70         fillbitmap(bitmap, color, &r);
7471
7572         x += 32 - count;
7673      }
r1771r1772
9289      vert -= 31;
9390
9491      if (flag & 1)
95      {
9692         drawgfx(bitmap, machine->gfx[1],
9793            code ^ 15, code >> 3, 0, 0,
9894            horz / 2, vert, cliprect, TRANSPARENCY_PEN, 2);
99      }
10095   }
10196}
10297
r1771r1772
139134      int x2 = 0x100 + p[(y & ~1) + 1];
140135
141136      for (x = x1; x < x2; x++)
142      {
143137         pDst[x] = pSrc[128 * (x - x1) / (x2 - x1)];
144      }
145138   }
146139}
147140
148141
149142VIDEO_UPDATE( skyraid )
150143{
151   fillbitmap(bitmap, machine->pens[0], cliprect);
144   fillbitmap(bitmap, 0, cliprect);
152145
153   draw_terrain(machine, helper, cliprect);
146   draw_terrain(helper, cliprect);
154147   draw_sprites(machine, helper, cliprect);
155148   draw_missiles(machine, helper, cliprect);
156149   draw_trapezoid(bitmap, helper);
src/mame/video/travrusa.c
r1771r1772
304304      8*8, 32*8-1
305305   };
306306   rectangle clip = *cliprect;
307   if (flip_screen)
307   if (flip_screen_get())
308308      sect_rect(&clip, &spritevisibleareaflip);
309309   else
310310      sect_rect(&clip, &spritevisiblearea);
r1771r1772
319319      int flipx = attr & 0x40;
320320      int flipy = attr & 0x80;
321321
322      if (flip_screen)
322      if (flip_screen_get())
323323      {
324324         sx = 240 - sx;
325325         sy = 240 - sy;
src/mame/video/psx.c
r1771r1772
932932         n_line = n_lines;
933933         while( n_line > 0 )
934934         {
935            draw_scanline16( bitmap, n_x + n_left, n_y + n_top, n_columns, m_p_p_vram[ n_y + m_n_displaystarty ] + n_x + n_displaystartx, machine->pens, -1 );
935            draw_scanline16( bitmap, n_x + n_left, n_y + n_top, n_columns, m_p_p_vram[ n_y + m_n_displaystarty ] + n_x + n_displaystartx, NULL, -1 );
936936            n_y++;
937937            n_line--;
938938         }
src/mame/video/metlclsh.c
r1771r1772
194194      if (sx < -7) sx += 256;
195195      sy   =   240 - spriteram[offs+2];
196196
197      if (flip_screen)
197      if (flip_screen_get())
198198      {
199199         sx = 240 - sx;   flipx = !flipx;
200200         sy = 240 - sy;   flipy = !flipy;      if (sizey)   sy+=16;
r1771r1772
237237
238238VIDEO_UPDATE( metlclsh )
239239{
240   fillbitmap(bitmap,machine->pens[0x10],cliprect);
240   fillbitmap(bitmap,0x10,cliprect);
241241
242242   tilemap_draw(bitmap,cliprect,fg_tilemap,1,0);   // low priority tiles of foreground
243243   if (metlclsh_scrollx[0] & 0x08)               // background (if enabled)
244244   {
245245      /* The background seems to be always flipped along x */
246      tilemap_set_flip(bg_tilemap, (flip_screen ? (TILEMAP_FLIPX|TILEMAP_FLIPY) : 0) ^ TILEMAP_FLIPX);
246      tilemap_set_flip(bg_tilemap, (flip_screen_get() ? (TILEMAP_FLIPX|TILEMAP_FLIPY) : 0) ^ TILEMAP_FLIPX);
247247      tilemap_set_scrollx(bg_tilemap, 0,metlclsh_scrollx[1] + ((metlclsh_scrollx[0]&0x02)<<7) );
248248      tilemap_draw(bitmap,cliprect,bg_tilemap,0,0);
249249   }
src/mame/video/vdc.c
r1771r1772
7373
7474static void vdc_advance_line(running_machine *machine, int which);
7575static void draw_black_line(running_machine *machine, int line);
76static void draw_overscan_line(const pen_t *pens, int line);
77static void draw_sgx_overscan_line(const pen_t *pens, int line);
78static void pce_refresh_line(int which, int line, int external_input, UINT8 *drawn, UINT16 *line_buffer, const pen_t *pens);
79static void pce_refresh_sprites(running_machine *machine, int which, int line, UINT8 *drawn, UINT16 *line_buffer, const pen_t *pens);
76static void draw_overscan_line(int line);
77static void draw_sgx_overscan_line(int line);
78static void pce_refresh_line(int which, int line, int external_input, UINT8 *drawn, UINT16 *line_buffer);
79static void pce_refresh_sprites(running_machine *machine, int which, int line, UINT8 *drawn, UINT16 *line_buffer);
8080static void vdc_do_dma(int which);
8181static void vpc_init( void );
8282
r1771r1772
8686   if ( vce.current_bitmap_line >= 14 && vce.current_bitmap_line < 14 + 242 ) {
8787      /* We are in the active display area */
8888      /* First fill the line with the overscan color */
89      draw_overscan_line(machine->pens, vce.current_bitmap_line );
89      draw_overscan_line(vce.current_bitmap_line );
9090
9191      /* Check if we need to draw more just the overscan color */
9292      if ( vdc[0].current_segment == STATE_VDW ) {
r1771r1772
103103         vdc[0].y_scroll = ( vdc[0].current_segment_line == 0 ) ? vdc[0].vdc_data[BYR].w : ( vdc[0].y_scroll + 1 );
104104
105105         /* Draw VDC #0 background layer */
106         pce_refresh_line( 0, vdc[0].current_segment_line, 0, drawn, line_buffer, machine->pens);
106         pce_refresh_line( 0, vdc[0].current_segment_line, 0, drawn, line_buffer);
107107
108108         /* Draw VDC #0 sprite layer */
109109         if(vdc[0].vdc_data[CR].w & CR_SB) {
110            pce_refresh_sprites(machine, 0, vdc[0].current_segment_line, drawn, line_buffer, machine->pens);
110            pce_refresh_sprites(machine, 0, vdc[0].current_segment_line, drawn, line_buffer);
111111         }
112112      }
113113   } else {
r1771r1772
126126   if ( vce.current_bitmap_line >= 14 && vce.current_bitmap_line < 14 + 242 ) {
127127      /* We are in the active display area */
128128      /* First fill the line with the overscan color */
129      draw_sgx_overscan_line(machine->pens, vce.current_bitmap_line );
129      draw_sgx_overscan_line(vce.current_bitmap_line );
130130
131131      /* Check if we need to draw more just the overscan color */
132132      if ( vdc[0].current_segment == STATE_VDW ) {
r1771r1772
145145         vdc[1].y_scroll = ( vdc[1].current_segment_line == 0 ) ? vdc[1].vdc_data[BYR].w : ( vdc[1].y_scroll + 1 );
146146
147147         /* Draw VDC #0 background layer */
148         pce_refresh_line( 0, vdc[0].current_segment_line, 0, drawn[0], temp_buffer[0], machine->pens);
148         pce_refresh_line( 0, vdc[0].current_segment_line, 0, drawn[0], temp_buffer[0]);
149149
150150         /* Draw VDC #0 sprite layer */
151151         if(vdc[0].vdc_data[CR].w & CR_SB) {
152            pce_refresh_sprites(machine, 0, vdc[0].current_segment_line, drawn[0], temp_buffer[0], machine->pens);
152            pce_refresh_sprites(machine, 0, vdc[0].current_segment_line, drawn[0], temp_buffer[0]);
153153         }
154154
155155         /* Draw VDC #1 background layer */
156         pce_refresh_line( 1, vdc[1].current_segment_line, 1, drawn[1], temp_buffer[1], machine->pens);
156         pce_refresh_line( 1, vdc[1].current_segment_line, 1, drawn[1], temp_buffer[1]);
157157
158158         /* Draw VDC #1 sprite layer */
159159         if ( vdc[1].vdc_data[CR].w & CR_SB ) {
160            pce_refresh_sprites(machine, 1, vdc[1].current_segment_line, drawn[1], temp_buffer[1], machine->pens);
160            pce_refresh_sprites(machine, 1, vdc[1].current_segment_line, drawn[1], temp_buffer[1]);
161161         }
162162
163163         line_buffer = BITMAP_ADDR16( vce.bmp, vce.current_bitmap_line, 86 );
r1771r1772
388388      line_buffer[i] = get_black_pen( machine );
389389}
390390
391static void draw_overscan_line(const pen_t *pens, int line)
391static void draw_overscan_line(int line)
392392{
393393   int i;
394394
r1771r1772
399399   UINT16 *line_buffer = BITMAP_ADDR16( vce.bmp, line, 0 );
400400
401401   for ( i = 0; i < VDC_WPF; i++ )
402      line_buffer[i] = pens[color_base + vce.vce_data[0x100].w];
402      line_buffer[i] = color_base + vce.vce_data[0x100].w;
403403}
404404
405static void draw_sgx_overscan_line(const pen_t *pens, int line) {
405static void draw_sgx_overscan_line(int line) {
406406   int i;
407407
408408   /* Are we in greyscale mode or in color mode? */
r1771r1772
412412   UINT16 *line_buffer = BITMAP_ADDR16( vce.bmp, line, 0 );
413413
414414   for ( i = 0; i < VDC_WPF; i++ )
415      line_buffer[i] = pens[color_base + vce.vce_data[0].w];
415      line_buffer[i] = color_base + vce.vce_data[0].w;
416416}
417417
418418static void vram_write(int which, offs_t offset, UINT8 data)
r1771r1772
627627}
628628
629629
630static void pce_refresh_line(int which, int line, int external_input, UINT8 *drawn, UINT16 *line_buffer, const pen_t *pens)
630static void pce_refresh_line(int which, int line, int external_input, UINT8 *drawn, UINT16 *line_buffer)
631631{
632632    static const int width_table[4] = {5, 6, 7, 7};
633633
r1771r1772
705705            if ( phys_x >= 0 && phys_x < vdc[which].physical_width ) {
706706               drawn[ pixel ] = c ? 1 : 0;
707707               if ( c || ! external_input )
708                  line_buffer[ pixel ] = pens[color_base + vce.vce_data[c].w];
708                  line_buffer[ pixel ] = color_base + vce.vce_data[c].w;
709709               pixel++;
710710               if ( vdc[which].physical_width != 512 ) {
711711                  while ( pixel < ( ( ( phys_x + 1 ) * 512 ) / vdc[which].physical_width ) ) {
712712                     drawn[ pixel ] = c ? 1 : 0;
713713                     if ( c || ! external_input )
714                        line_buffer[ pixel ] = pens[color_base + vce.vce_data[c].w];
714                        line_buffer[ pixel ] = color_base + vce.vce_data[c].w;
715715                     pixel++;
716716                  }
717717               }
r1771r1772
755755   }
756756}
757757
758static void pce_refresh_sprites(running_machine *machine, int which, int line, UINT8 *drawn, UINT16 *line_buffer, const pen_t *pens)
758static void pce_refresh_sprites(running_machine *machine, int which, int line, UINT8 *drawn, UINT16 *line_buffer)
759759{
760760    int i;
761761   UINT8 sprites_drawn=0;
r1771r1772
828828                  if ( buf[x] ) {
829829                     if( drawn[pixel_x] < 2 ) {
830830                        if( priority || drawn[pixel_x] == 0 ) {
831                           line_buffer[pixel_x] = machine->pens[color_base + vce.vce_data[0x100 + (palette << 4) + buf[x]].w];
831                           line_buffer[pixel_x] = color_base + vce.vce_data[0x100 + (palette << 4) + buf[x]].w;
832832                           if ( vdc[which].physical_width != 512 ) {
833833                              int dp = 1;
834834                              while ( pixel_x + dp < ( ( ( obj_x + x + 1 ) * 512 ) / vdc[which].physical_width ) ) {
835835                                 drawn[pixel_x + dp] = i + 2;
836                                 line_buffer[pixel_x + dp] = pens[color_base + vce.vce_data[0x100 + (palette << 4) + buf[x]].w];
836                                 line_buffer[pixel_x + dp] = color_base + vce.vce_data[0x100 + (palette << 4) + buf[x]].w;
837837                                 dp++;
838838                              }
839839                           }
r1771r1772
870870                  if ( buf[x] ) {
871871                     if( drawn[pixel_x] < 2 ) {
872872                        if ( priority || drawn[pixel_x] == 0 ) {
873                           line_buffer[pixel_x] = pens[color_base + vce.vce_data[0x100 + (palette << 4) + buf[x]].w];
873                           line_buffer[pixel_x] = color_base + vce.vce_data[0x100 + (palette << 4) + buf[x]].w;
874874                           if ( vdc[which].physical_width != 512 ) {
875875                              int dp = 1;
876876                              while ( pixel_x + dp < ( ( ( obj_x + x + 1 ) * 512 ) / vdc[which].physical_width ) ) {
877877                                 drawn[pixel_x + dp] = i + 2;
878                                 line_buffer[pixel_x + dp] = pens[color_base + vce.vce_data[0x100 + (palette << 4) + buf[x]].w];
878                                 line_buffer[pixel_x + dp] = color_base + vce.vce_data[0x100 + (palette << 4) + buf[x]].w;
879879                                 dp++;
880880                              }
881881                           }
r1771r1772
914914                     if ( buf[x] ) {
915915                        if( drawn[pixel_x] < 2 ) {
916916                           if( priority || drawn[pixel_x] == 0 ) {
917                              line_buffer[pixel_x] = pens[color_base + vce.vce_data[0x100 + (palette << 4) + buf[x]].w];
917                              line_buffer[pixel_x] = color_base + vce.vce_data[0x100 + (palette << 4) + buf[x]].w;
918918                              if ( vdc[which].physical_width != 512 ) {
919919                                 int dp = 1;
920920                                 while ( pixel_x + dp < ( ( ( obj_x + x + 17 ) * 512 ) / vdc[which].physical_width ) ) {
921921                                    drawn[pixel_x + dp] = i + 2;
922                                    line_buffer[pixel_x + dp] = pens[color_base + vce.vce_data[0x100 + (palette << 4) + buf[x]].w];
922                                    line_buffer[pixel_x + dp] = color_base + vce.vce_data[0x100 + (palette << 4) + buf[x]].w;
923923                                    dp++;
924924                                 }
925925                              }
src/mame/video/kaneko16.c
r1771r1772
278278         if ((r & 0x10) && (b & 0x10))
279279            g = (g - 1) & 0x1f;      /* decrease with wraparound */
280280
281         *BITMAP_ADDR16(kaneko16_bg15_bitmap, y, sx * 256 + x) = machine->pens[2048 + ((g << 10) | (r << 5) | b)];
281         *BITMAP_ADDR16(kaneko16_bg15_bitmap, y, sx * 256 + x) = 2048 + ((g << 10) | (r << 5) | b);
282282     }
283283
284284   VIDEO_START_CALL(kaneko16_1xVIEW2);
r1771r1772
395395      UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy,
396396      const rectangle *clip,int priority)
397397{
398   const pen_t *pal = &machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
398   pen_t pen_base = gfx->color_base + gfx->color_granularity * (color % gfx->total_colors);
399399   UINT8 *source_base = gfx->gfxdata + (code % gfx->total_elements) * gfx->char_modulo;
400400
401401   int sprite_screen_height = ((1<<16)*gfx->height+0x8000)>>16;
r1771r1772
477477               if( c != 0 )
478478               {
479479                  if (pri[x] < priority)
480                     dest[x] = pal[c];
480                     dest[x] = pen_base + c;
481481                  pri[x] = 0xff; // mark it "already drawn"
482482               }
483483               x_index += dx;
r1771r1772
909909   }
910910   else
911911   {
912      fillbitmap(sprites_bitmap,machine->pens[0],cliprect);
912      fillbitmap(sprites_bitmap,0,cliprect);
913913      kaneko16_draw_sprites(machine,bitmap,cliprect);
914914   }
915915}
r1771r1772
937937static void kaneko16_fill_bitmap(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
938938{
939939   if(kaneko16_sprite_type == 1)
940      fillbitmap(bitmap,machine->pens[0x7f00],cliprect);
940      fillbitmap(bitmap,0x7f00,cliprect);
941941   else
942942      /* Fill the bitmap with pen 0. This is wrong, but will work most of
943943           the times. To do it right, each pixel should be drawn with pen 0
944944           of the bottomost tile that covers it (which is pretty tricky to do) */
945      fillbitmap(bitmap,machine->pens[0],cliprect);
945      fillbitmap(bitmap,0,cliprect);
946946}
947947
948948static VIDEO_UPDATE( common )
r1771r1772
10061006      {
10071007         UINT16 dat = (galsnew_fg_pixram[count] & 0xfffe)>>1;
10081008         dat+=2048;
1009         dest[x] = machine->pens[dat];
1009         dest[x] = dat;
10101010         count++;
10111011      }
10121012   }
r1771r1772
10211021         UINT16 dat = (galsnew_bg_pixram[count]);
10221022         //dat &=0x3ff;
10231023         if (dat)
1024         {
1025            dest[x] = machine->pens[dat];
1026         }
1024            dest[x] = dat;
1025
10271026         count++;
10281027      }
10291028   }
src/mame/video/ms32.c
r1771r1772
488488
489489   /* TODO: 0 is correct for gametngk, but break f1superb scrolling grid (text at
490490       top and bottom of the screen becomes black on black) */
491   fillbitmap(bitmap,machine->pens[0],cliprect);   /* bg color */
491   fillbitmap(bitmap,0,cliprect);   /* bg color */
492492
493493
494494   /* priority hack, we really need to figure out what priority ram is I think */
src/mame/video/20pacgal.c
r1771r1772
173173      sy = (sy & 0xff) - 32;   /* fix wraparound */
174174
175175      /* only Galaga appears to be effected by the global flip state */
176      if (state->game_selected && (state->flip_screen[0] & 0x01))
176      if (state->game_selected && (state->flip[0] & 0x01))
177177      {
178178         flip_x = !flip_x;
179179         flip_y = !flip_y;
r1771r1772
201201{
202202   offs_t offs;
203203
204   int flip = state->flip_screen[0] & 0x01;
204   int flip = state->flip[0] & 0x01;
205205
206206   /* for each byte in the video RAM */
207207   for (offs = 0; offs < 0x400; offs++)
src/mame/video/system16.c
r1771r1772
201201   mame_bitmap *bitmap,
202202   const rectangle *cliprect,
203203   const UINT8 *addr, int pitch,
204   const pen_t *paldata,
204   pen_t pen_base,
205205   int x0, int y0, int screen_width, int screen_height,
206206   int width, int height,
207207   int flipx, int flipy,
r1771r1772
209209   int shadow,
210210   int shadow_pen, int eos )
211211{
212   const pen_t *shadow_base = machine->pens + machine->gfx[0]->color_base + (machine->config->total_colors/2);
212   pen_t shadow_pen_base = machine->gfx[0]->color_base + (machine->config->total_colors/2);
213213   const UINT8 *source;
214214   int full_shadow=shadow&SYS16_SPR_SHADOW;
215215   int partial_shadow=shadow&SYS16_SPR_PARTIAL_SHADOW;
r1771r1772
260260                     if( pen && pen!=0xf && sx>=cliprect->min_x && sx<=cliprect->max_x ){
261261                        if(!(pri[sx]&priority)){
262262                           if (full_shadow)
263                              dest[sx] = shadow_base[dest[sx]&shadow_mask];
263                              dest[sx] = shadow_pen_base + (dest[sx]&shadow_mask);
264264                           else if (partial_shadow && pen==shadow_pen)
265                              dest[sx] = shadow_base[dest[sx]&shadow_mask];
265                              dest[sx] = shadow_pen_base + (dest[sx]&shadow_mask);
266266                           else
267                              dest[sx] = paldata[pen];
267                              dest[sx] = pen_base + pen;
268268                        }
269269                     }
270270                     xcount -= width;
r1771r1772
277277                     if( pen && pen!=0xf && sx>=cliprect->min_x && sx<=cliprect->max_x ){
278278                        if(!(pri[sx]&priority)){
279279                           if (full_shadow)
280                              dest[sx] = shadow_base[dest[sx]&shadow_mask];
280                              dest[sx] = shadow_pen_base + (dest[sx]&shadow_mask);
281281                           else if (partial_shadow && pen==shadow_pen)
282                              dest[sx] = shadow_base[dest[sx]&shadow_mask];
282                              dest[sx] = shadow_pen_base + (dest[sx]&shadow_mask);
283283                           else
284                              dest[sx] = paldata[pen];
284                              dest[sx] = pen_base + pen;
285285                        }
286286                     }
287287                     xcount -= width;
r1771r1772
315315                  while( xcount>=width )
316316                  {
317317                     if( pen && pen!=0xf && sx>=cliprect->min_x && sx<=cliprect->max_x )
318                        if(!(pri[sx]&priority)) dest[sx] = paldata[pen];
318                        if(!(pri[sx]&priority)) dest[sx] = pen_base + pen;
319319                     xcount -= width;
320320                     sx+=dx;
321321                  }
r1771r1772
324324                  while( xcount>=width )
325325                  {
326326                     if( pen && pen!=0xf && sx>=cliprect->min_x && sx<=cliprect->max_x )
327                        if(!(pri[sx]&priority)) dest[sx] = paldata[pen];
327                        if(!(pri[sx]&priority)) dest[sx] = pen_base + pen;
328328                     xcount -= width;
329329                     sx+=dx;
330330                  }
r1771r1772
340340
341341static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, int b3d ) //*
342342{
343   const pen_t *base_pal = machine->pens + machine->gfx[0]->color_base;
343   pen_t pen_base = machine->gfx[0]->color_base;
344344   const UINT8 *base_gfx = memory_region(REGION_GFX2);
345345   const int gfx_rom_size = memory_region_length(REGION_GFX2);
346346   const UINT16 *source = sys16_spriteram;
r1771r1772
423423         draw_sprite(machine,
424424            bitmap,cliprect,
425425            base_gfx + gfx, pitch,
426            base_pal + (sprite.color<<4),
426            pen_base + (sprite.color<<4),
427427            xpos, ypos, screen_width, sprite.screen_height,
428428            width, logical_height,
429429            flipx, flipy,
r1771r1772
11121112   if(sys18_bg2_active)
11131113      tilemap_draw( bitmap,cliprect, background2, 0, 0 );
11141114   else
1115      fillbitmap(bitmap,machine->pens[0],cliprect);
1115      fillbitmap(bitmap,0,cliprect);
11161116
11171117   tilemap_draw( bitmap,cliprect, background, TILEMAP_DRAW_OPAQUE, 0 );
11181118   tilemap_draw( bitmap,cliprect, background, TILEMAP_DRAW_OPAQUE | 1, 0 );   //??
src/mame/video/deniam.c
r1771r1772
202202 *   c  | ---------------- | zoomy like in System 16?
203203 *   e  | ---------------- |
204204 */
205static void draw_sprites(running_machine* machine, mame_bitmap *bitmap, const rectangle *cliprect)
205static void draw_sprites(mame_bitmap *bitmap, const rectangle *cliprect)
206206{
207207   int offs;
208208
r1771r1772
260260                        y >= cliprect->min_y && y <= cliprect->max_y)
261261                     {
262262                        if ((*BITMAP_ADDR8(priority_bitmap, y, sx+x) & primask) == 0)
263                           *BITMAP_ADDR16(bitmap, y, sx+x) = machine->pens[color*16+(rom[i]&0x0f)];
263                           *BITMAP_ADDR16(bitmap, y, sx+x) = color*16+(rom[i]&0x0f);
264264                        *BITMAP_ADDR8(priority_bitmap, y, sx+x) = 8;
265265                     }
266266                  }
r1771r1772
280280                        y >= cliprect->min_y && y <= cliprect->max_y)
281281                     {
282282                        if ((*BITMAP_ADDR8(priority_bitmap, y, sx+x) & primask) == 0)
283                           *BITMAP_ADDR16(bitmap, y, sx+x) = machine->pens[color*16+(rom[i]>>4)];
283                           *BITMAP_ADDR16(bitmap, y, sx+x) = color*16+(rom[i]>>4);
284284                        *BITMAP_ADDR8(priority_bitmap, y, sx+x) = 8;
285285                     }
286286                  }
r1771r1772
304304                        y >= cliprect->min_y && y <= cliprect->max_y)
305305                     {
306306                        if ((*BITMAP_ADDR8(priority_bitmap, y, sx+x) & primask) == 0)
307                           *BITMAP_ADDR16(bitmap, y, sx+x) = machine->pens[color*16+(rom[i]>>4)];
307                           *BITMAP_ADDR16(bitmap, y, sx+x) = color*16+(rom[i]>>4);
308308                        *BITMAP_ADDR8(priority_bitmap, y, sx+x) = 8;
309309                     }
310310                  }
r1771r1772
324324                        y >= cliprect->min_y && y <= cliprect->max_y)
325325                     {
326326                        if ((*BITMAP_ADDR8(priority_bitmap, y, sx+x) & primask) == 0)
327                           *BITMAP_ADDR16(bitmap, y, sx+x) = machine->pens[color*16+(rom[i]&0x0f)];
327                           *BITMAP_ADDR16(bitmap, y, sx+x) = color*16+(rom[i]&0x0f);
328328                        *BITMAP_ADDR8(priority_bitmap, y, sx+x) = 8;
329329                     }
330330                  }
r1771r1772
397397   tilemap_draw(bitmap,cliprect,fg_tilemap,0,2);
398398   tilemap_draw(bitmap,cliprect,tx_tilemap,0,4);
399399
400   draw_sprites(machine,bitmap,cliprect);
400   draw_sprites(bitmap,cliprect);
401401   return 0;
402402}
src/mame/video/prehisle.c
r1771r1772
127127
128128      if (sx & 0x200) sx = -(0xff - (sx & 0xff));   // wraparound
129129
130      if (flip_screen)
130      if (flip_screen_get())
131131      {
132132         sx = 240 - sx;
133133         sy = 240 - sy;
src/mame/video/simpsons.c
r1771r1772
162162   sortlayers(layer,layerpri);
163163
164164   fillbitmap(priority_bitmap,0,cliprect);
165   fillbitmap(bitmap,machine->pens[16 * bg_colorbase],cliprect);
165   fillbitmap(bitmap,16 * bg_colorbase,cliprect);
166166   tilemap_draw(bitmap,cliprect,K052109_tilemap[layer[0]],0,1);
167167   tilemap_draw(bitmap,cliprect,K052109_tilemap[layer[1]],0,2);
168168   tilemap_draw(bitmap,cliprect,K052109_tilemap[layer[2]],0,4);
src/mame/video/wwfsstar.c
r1771r1772
154154
155155         number &= ~(chain - 1);
156156
157         if (flip_screen)
157         if (flip_screen_get())
158158         {
159159            flipy = !flipy;
160160            flipx = !flipx;
r1771r1772
164164
165165         for (count=0;count<chain;count++)
166166         {
167            if (flip_screen)
167            if (flip_screen_get())
168168            {
169169               if (!flipy)
170170               {
src/mame/video/taito_b.c
r1771r1772
491491}
492492
493493
494static void draw_framebuffer(running_machine *machine, mame_bitmap *bitmap,const rectangle *cliprect,int priority)
494static void draw_framebuffer(mame_bitmap *bitmap,const rectangle *cliprect,int priority)
495495{
496496  rectangle myclip = *cliprect;
497497  int x,y;
r1771r1772
520520               UINT16 c = *src++;
521521
522522               if (c != 0)
523                  *dst = machine->pens[b_sp_color_base + c];
523                  *dst = b_sp_color_base + c;
524524
525525               dst--;
526526            }
r1771r1772
538538               UINT16 c = *src++;
539539
540540               if (c != 0)
541                  *dst = machine->pens[b_sp_color_base + c];
541                  *dst = b_sp_color_base + c;
542542
543543               dst++;
544544            }
r1771r1772
562562               UINT16 c = *src++;
563563
564564               if (c != 0 && (c & 0x10) == priority)
565                  *dst = machine->pens[b_sp_color_base + c];
565                  *dst = b_sp_color_base + c;
566566
567567               dst--;
568568            }
r1771r1772
580580               UINT16 c = *src++;
581581
582582               if (c != 0 && (c & 0x10) == priority)
583                  *dst = machine->pens[b_sp_color_base + c];
583                  *dst = b_sp_color_base + c;
584584
585585               dst++;
586586            }
r1771r1772
594594{
595595  if ((video_control & 0x20) == 0)
596596  {
597    fillbitmap(bitmap,machine->pens[0],cliprect);
597    fillbitmap(bitmap,0,cliprect);
598598    return 0;
599599  }
600600
601601  /* Draw playfields */
602602  TC0180VCU_tilemap_draw(bitmap,cliprect,bg_tilemap,1);
603603
604  draw_framebuffer(machine, bitmap,cliprect,1);
604  draw_framebuffer(bitmap,cliprect,1);
605605
606606  TC0180VCU_tilemap_draw(bitmap,cliprect,fg_tilemap,0);
607607
r1771r1772
611611    int scrolly = -pixel_scroll[1]; //+240;
612612    /* bit 15 of pixel_scroll[0] is probably flip screen */
613613
614    copyscrollbitmap_trans(bitmap,pixel_bitmap,1,&scrollx,1,&scrolly,cliprect,machine->pens[b_fg_color_base * 16]);
614    copyscrollbitmap_trans(bitmap,pixel_bitmap,1,&scrollx,1,&scrolly,cliprect,b_fg_color_base * 16);
615615  }
616616
617  draw_framebuffer(machine, bitmap,cliprect,0);
617  draw_framebuffer(bitmap,cliprect,0);
618618
619619  tilemap_draw(bitmap,cliprect,tx_tilemap,0,0);
620620   return 0;
src/mame/video/jackal.c
r1771r1772
142142      if (attr & 0x01) sx = sx - 256;
143143      if (sy > 0xf0)   sy = sy - 256;
144144
145      if (flip_screen)
145      if (flip_screen_get())
146146      {
147147         sx = 240 - sx;
148148         sy = 240 - sy;
r1771r1772
155155         int spritenum = sn1*4 + ((sn2 & (8+4)) >> 2) + ((sn2 & (2+1)) << 10);
156156         int mod = -8;
157157
158         if (flip_screen)
158         if (flip_screen_get())
159159         {
160160            sx += 8;
161161            sy -= 8;
r1771r1772
164164
165165         if ((attr & 0x0C) == 0x0C)
166166         {
167            if (flip_screen) sy += 16;
167            if (flip_screen_get()) sy += 16;
168168            DRAW_SPRITE(bank + 1, spritenum, sx, sy)
169169         }
170170
r1771r1772
187187
188188         if (attr & 0x10)
189189         {
190            if (flip_screen)
190            if (flip_screen_get())
191191            {
192192               sx -= 16;
193193               sy -= 16;
src/mame/video/taitoic.c
r1771r1772
26872687   }
26882688}
26892689
2690static void TC0100SCN_tilemap_draw_fg(running_machine *machine, mame_bitmap *bitmap,const rectangle *cliprect, int chip, tilemap* tmap ,int flags, UINT32 priority)
2690static void TC0100SCN_tilemap_draw_fg(mame_bitmap *bitmap,const rectangle *cliprect, int chip, tilemap* tmap ,int flags, UINT32 priority)
26912691{
26922692   const mame_bitmap *src_bitmap = tilemap_get_pixmap(tmap);
26932693   int width_mask, height_mask, x, y, p;
r1771r1772
27172717
27182718         if ((p&0xf)!=0 || (flags & TILEMAP_DRAW_OPAQUE))
27192719         {
2720            *BITMAP_ADDR16(bitmap, y, x + cliprect->min_x) = machine->pens[p];
2720            *BITMAP_ADDR16(bitmap, y, x + cliprect->min_x) = p;
27212721            if (priority_bitmap)
27222722            {
27232723               UINT8 *pri = BITMAP_ADDR8(priority_bitmap, y, 0);
r1771r1772
27492749         break;
27502750      case 1:
27512751         if (disable & 0x02) return 1;
2752         TC0100SCN_tilemap_draw_fg(machine,bitmap,&clip,chip,TC0100SCN_tilemap[chip][1][TC0100SCN_dblwidth[chip]],flags,priority);
2752         TC0100SCN_tilemap_draw_fg(bitmap,&clip,chip,TC0100SCN_tilemap[chip][1][TC0100SCN_dblwidth[chip]],flags,priority);
27532753         break;
27542754      case 2:
27552755         if (disable & 0x04) return 1;
r1771r1772
37493749                  (TC0480SCP_tilemap[layer][TC0480SCP_dblwidth]);
37503750
37513751   UINT16 *dst16,*src16;
3752   UINT8 *tsrc;
3752   UINT16 *tsrc;
37533753   int i,y,y_index,src_y_index,row_index,row_zoom;
37543754   int sx,x_index,x_step;
37553755   UINT32 zoomx,zoomy;
r1771r1772
38313831      }
38323832
38333833      src16 = BITMAP_ADDR16(srcbitmap, src_y_index, 0);
3834      tsrc  = BITMAP_ADDR8(flagsbitmap, src_y_index, 0);
3834      tsrc  = BITMAP_ADDR16(flagsbitmap, src_y_index, 0);
38353835      dst16 = scanline;
38363836
38373837      if (flags & TILEMAP_DRAW_OPAQUE)
src/mame/video/namcos86.c
r1771r1772
300300      sx += sprite_xoffs;
301301      sy -= sprite_yoffs;
302302
303      if (flip_screen)
303      if (flip_screen_get())
304304      {
305305         sx = -sx - sizex;
306306         sy = -sy - sizey;
r1771r1772
335335
336336   scrollx = xscroll[layer] - xdisp[layer];
337337   scrolly = yscroll[layer] + 9;
338   if (flip_screen)
338   if (flip_screen_get())
339339   {
340340      scrollx = -scrollx;
341341      scrolly = -scrolly;
r1771r1772
351351
352352   /* flip screen is embedded in the sprite control registers */
353353   /* can't use flip_screen_set() because the visible area is asymmetrical */
354   flip_screen = spriteram[0x07f6] & 1;
355   tilemap_set_flip(ALL_TILEMAPS,flip_screen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
354   flip_screen_set_no_update(spriteram[0x07f6] & 1);
355   tilemap_set_flip(ALL_TILEMAPS,flip_screen_get() ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
356356   set_scroll(0);
357357   set_scroll(1);
358358   set_scroll(2);
r1771r1772
360360
361361   fillbitmap(priority_bitmap, 0, cliprect);
362362
363   fillbitmap(bitmap,machine->pens[machine->gfx[0]->color_base + 8*backcolor+7],cliprect);
363   fillbitmap(bitmap,machine->gfx[0]->color_base + 8*backcolor+7,cliprect);
364364
365365   for (layer = 0;layer < 8;layer++)
366366   {
src/mame/video/suna8.c
r1771r1772
318318            if (flipx)   tile_flipx = !tile_flipx;
319319            if (flipy)   tile_flipy = !tile_flipy;
320320
321            if (flip_screen)
321            if (flip_screen_get())
322322            {   sx = max_x - sx;   tile_flipx = !tile_flipx;
323323               sy = max_y - sy;   tile_flipy = !tile_flipy;   }
324324
r1771r1772
383383            int sx      =    x + tx * 8;
384384            int sy      =   (y + real_ty * 8) & 0xff;
385385
386            if (flip_screen)
386            if (flip_screen_get())
387387            {   sx = max_x - sx;   flipx = !flipx;
388388               sy = max_y - sy;   flipy = !flipy;   }
389389
r1771r1772
410410VIDEO_UPDATE( suna8 )
411411{
412412   /* see hardhead, hardhea2 test mode (press button 2 for both players) */
413   fillbitmap(bitmap,machine->pens[0xff],cliprect);
413   fillbitmap(bitmap,0xff,cliprect);
414414
415415#ifdef MAME_DEBUG
416416#if TILEMAPS
src/mame/video/vaportra.c
r1771r1772
122122         inc = 1;
123123      }
124124
125      if (flip_screen)
125      if (flip_screen_get())
126126      {
127127         y=240-y;
128128         x=240-x;
src/mame/video/btime.c
r1771r1772
334334        /* check priority */
335335        if ((priority != -1) && (priority != ((code >> 7) & 0x01)))  continue;
336336
337        if (flip_screen)
337        if (flip_screen_get())
338338        {
339339            x = 31 - x;
340340            y = 31 - y;
r1771r1772
343343        drawgfx(bitmap,machine->gfx[0],
344344                code,
345345                color,
346                flip_screen,flip_screen,
346                flip_screen_get(),flip_screen_get(),
347347                8*x,8*y,
348348                cliprect,transparency,0);
349349    }
r1771r1772
370370        flipx = sprite_ram[offs + 0] & 0x04;
371371        flipy = sprite_ram[offs + 0] & 0x02;
372372
373        if (flip_screen)
373        if (flip_screen_get())
374374        {
375375            x = 240 - x;
376376            y = 240 - y + sprite_y_adjust_flip_screen;
r1771r1772
388388                x, y,
389389                cliprect,TRANSPARENCY_PEN,0);
390390
391        y = y + (flip_screen ? -256 : 256);
391        y = y + (flip_screen_get() ? -256 : 256);
392392
393393        // Wrap around
394394        drawgfx(bitmap,machine->gfx[1],
r1771r1772
422422            int x = 240 - (16 * (offs / 16) + scroll);
423423            int y = 16 * (offs % 16);
424424
425            if (flip_screen)
425            if (flip_screen_get())
426426            {
427427                x = 240 - x;
428428                y = 240 - y;
r1771r1772
431431            drawgfx(bitmap, machine->gfx[2],
432432                    memory_region(REGION_GFX3)[tileoffset + offs],
433433                    color,
434                    flip_screen,flip_screen,
434                    flip_screen_get(),flip_screen_get(),
435435                    x,y,
436436                    cliprect,TRANSPARENCY_NONE,0);
437437        }
r1771r1772
485485        // Generate tile map
486486        static UINT8 btime_tilemap[4];
487487
488        if (flip_screen)
488        if (flip_screen_get())
489489            start = 0;
490490        else
491491            start = 1;
r1771r1772
566566            sy = 16 * (((offs % 0x100) < 0x80) ? offs % 8 : (offs % 8) + 8);
567567            sx = 496 - sx;
568568
569            if (flip_screen)
569            if (flip_screen_get())
570570            {
571571                sx = 496 - sx;
572572                sy = 240 - sy;
r1771r1772
575575            drawgfx(background_bitmap, machine->gfx[2],
576576                    (bnj_backgroundram[offs] >> 4) + ((offs & 0x80) >> 3) + 32,
577577                    0,
578                    flip_screen, flip_screen,
578                    flip_screen_get(), flip_screen_get(),
579579                    sx, sy,
580580                    0, TRANSPARENCY_NONE, 0);
581581        }
582582
583583        /* copy the background bitmap to the screen */
584584        scroll = (bnj_scroll1 & 0x02) * 128 + 511 - bnj_scroll2;
585        if (!flip_screen)
585        if (!flip_screen_get())
586586            scroll = 767-scroll;
587587        copyscrollbitmap (bitmap, background_bitmap, 1, &scroll, 0, 0, cliprect);
588588
r1771r1772
613613        sx = 31 - (offs / 32);
614614        sy = offs % 32;
615615
616        if (flip_screen)
616        if (flip_screen_get())
617617        {
618618            sx = 31 - sx;
619619            sy = 31 - sy;
r1771r1772
622622        drawgfx(bitmap, machine->gfx[2],
623623                bnj_backgroundram[offs],
624624                0,
625                flip_screen, flip_screen,
625                flip_screen_get(), flip_screen_get(),
626626                8*sx,8*sy,
627627                cliprect, TRANSPARENCY_NONE, 0);
628628    }
src/mame/video/nova2001.c
r1771r1772
277277         continue;
278278      }
279279
280      if (flip_screen)
280      if (flip_screen_get())
281281      {
282282         sx = 240 - sx;
283283         sy = 240 - sy;
r1771r1772
314314         continue;
315315      }
316316
317      if (flip_screen)
317      if (flip_screen_get())
318318      {
319319         sx = 240 - sx;
320320         sy = 240 - sy;
src/mame/video/cps1.c
r1771r1772
13061306{
13071307#define DRAWSPRITE(CODE,COLOR,FLIPX,FLIPY,SX,SY)               \
13081308{                                                   \
1309   if (flip_screen)                                    \
1309   if (flip_screen_get())                                    \
13101310      pdrawgfx(bitmap,machine->gfx[2],                     \
13111311            CODE,                                    \
13121312            COLOR,                                    \
r1771r1772
15491549{
15501550#define DRAWSPRITE(CODE,COLOR,FLIPX,FLIPY,SX,SY)                           \
15511551{                                                               \
1552   if (flip_screen)                                                \
1552   if (flip_screen_get())                                                \
15531553      pdrawgfx(bitmap,machine->gfx[2],                                 \
15541554            CODE,                                                \
15551555            COLOR,                                                \
r1771r1772
16921692
16931693
16941694
1695static void cps1_render_stars(running_machine *machine,mame_bitmap *bitmap,const rectangle *cliprect)
1695static void cps1_render_stars(mame_bitmap *bitmap,const rectangle *cliprect)
16961696{
16971697   int offs;
16981698   UINT8 *stars_rom = memory_region(REGION_GFX2);
r1771r1772
17161716            int sy = (offs % 256);
17171717            sx = (sx - stars2x + (col & 0x1f)) & 0x1ff;
17181718            sy = (sy - stars2y) & 0xff;
1719            if (flip_screen)
1719            if (flip_screen_get())
17201720            {
17211721               sx = 511 - sx;
17221722               sy = 255 - sy;
r1771r1772
17261726
17271727            if (sx >= cliprect->min_x && sx <= cliprect->max_x &&
17281728               sy >= cliprect->min_y && sy <= cliprect->max_y)
1729               *BITMAP_ADDR16(bitmap, sy, sx) = machine->pens[0xa00+col];
1729               *BITMAP_ADDR16(bitmap, sy, sx) = 0xa00 + col;
17301730         }
17311731      }
17321732   }
r1771r1772
17421742            int sy = (offs % 256);
17431743            sx = (sx - stars1x + (col & 0x1f)) & 0x1ff;
17441744            sy = (sy - stars1y) & 0xff;
1745            if (flip_screen)
1745            if (flip_screen_get())
17461746            {
17471747               sx = 511 - sx;
17481748               sy = 255 - sy;
r1771r1772
17521752
17531753            if (sx >= cliprect->min_x && sx <= cliprect->max_x &&
17541754               sy >= cliprect->min_y && sy <= cliprect->max_y)
1755               *BITMAP_ADDR16(bitmap, sy, sx) = machine->pens[0x800+col];
1755               *BITMAP_ADDR16(bitmap, sy, sx) = 0x800 + col;
17561756         }
17571757      }
17581758   }
r1771r1772
18461846
18471847
18481848   /* Blank screen */
1849   fillbitmap(bitmap,machine->pens[4095],cliprect);
1849   fillbitmap(bitmap,4095,cliprect);
18501850
1851   cps1_render_stars(machine,bitmap,cliprect);
1851   cps1_render_stars(bitmap,cliprect);
18521852
18531853   /* Draw layers (0 = sprites, 1-3 = tilemaps) */
18541854   l0 = (layercontrol >> 0x06) & 03;
src/mame/video/starcrus.c
r1771r1772
197197    clip.min_y=0;
198198    clip.max_y=15;
199199
200    fillbitmap(ship1_vid,machine->pens[0],&clip);
201    fillbitmap(ship2_vid,machine->pens[0],&clip);
200    fillbitmap(ship1_vid,0,&clip);
201    fillbitmap(ship2_vid,0,&clip);
202202
203203   /* origin is with respect to ship1 */
204204
r1771r1772
229229
230230    /* Now check for collisions */
231231    for (sy=0;sy<16;sy++)
232    {
233232        for (sx=0;sx<16;sx++)
234        {
235           if (*BITMAP_ADDR16(ship1_vid, sy, sx)==machine->pens[1])
236              {
237              /* Condition 1 - ship 1 = ship 2 */
238            if (*BITMAP_ADDR16(ship2_vid, sy, sx)==machine->pens[1])
239                   return 1;
240         }
241        }
242    }
233             /* Condition 1 - ship 1 = ship 2 */
234           if ((*BITMAP_ADDR16(ship1_vid, sy, sx)==1) && (*BITMAP_ADDR16(ship2_vid, sy, sx)==1))
235                return 1;
243236
244237    return 0;
245238}
r1771r1772
262255    clip.min_y=0;
263256    clip.max_y=15;
264257
265    fillbitmap(proj1_vid,machine->pens[0],&clip);
266    fillbitmap(proj2_vid,machine->pens[0],&clip);
258    fillbitmap(proj1_vid,0,&clip);
259    fillbitmap(proj2_vid,0,&clip);
267260
268261   /* origin is with respect to proj1 */
269262
r1771r1772
300293
301294    /* Now check for collisions */
302295    for (sy=0;sy<16;sy++)
303    {
304296        for (sx=0;sx<16;sx++)
305        {
306           if (*BITMAP_ADDR16(proj1_vid, sy, sx)==machine->pens[1])
307              {
308              /* Condition 1 - proj 1 = proj 2 */
309            if (*BITMAP_ADDR16(proj2_vid, sy, sx)==machine->pens[1])
310                   return 1;
311         }
312        }
313    }
297             /* Condition 1 - proj 1 = proj 2 */
298           if ((*BITMAP_ADDR16(proj1_vid, sy, sx)==1) && (*BITMAP_ADDR16(proj2_vid, sy, sx)==1))
299                return 1;
314300
315301    return 0;
316302}
r1771r1772
333319    clip.min_y=0;
334320    clip.max_y=15;
335321
336    fillbitmap(ship1_vid,machine->pens[0],&clip);
337    fillbitmap(proj1_vid,machine->pens[0],&clip);
338    fillbitmap(proj2_vid,machine->pens[0],&clip);
322    fillbitmap(ship1_vid,0,&clip);
323    fillbitmap(proj1_vid,0,&clip);
324    fillbitmap(proj2_vid,0,&clip);
339325
340326   /* origin is with respect to ship1 */
341327
r1771r1772
383369
384370    /* Now check for collisions */
385371    for (sy=0;sy<16;sy++)
386    {
387372        for (sx=0;sx<16;sx++)
388        {
389           if (*BITMAP_ADDR16(ship1_vid, sy, sx)==machine->pens[1])
373           if (*BITMAP_ADDR16(ship1_vid, sy, sx)==1)
390374              {
391375              /* Condition 1 - ship 1 = proj 1 */
392            if (*BITMAP_ADDR16(proj1_vid, sy, sx)==machine->pens[1])
376            if (*BITMAP_ADDR16(proj1_vid, sy, sx)==1)
393377                   return 1;
394378              /* Condition 2 - ship 1 = proj 2 */
395              if (*BITMAP_ADDR16(proj2_vid, sy, sx)==machine->pens[1])
379              if (*BITMAP_ADDR16(proj2_vid, sy, sx)==1)
396380                   return 1;
397381            }
398        }
399    }
400382
401383    return 0;
402384}
r1771r1772
419401    clip.min_y=0;
420402    clip.max_y=15;
421403
422    fillbitmap(ship2_vid,machine->pens[0],&clip);
423    fillbitmap(proj1_vid,machine->pens[0],&clip);
424    fillbitmap(proj2_vid,machine->pens[0],&clip);
404    fillbitmap(ship2_vid,0,&clip);
405    fillbitmap(proj1_vid,0,&clip);
406    fillbitmap(proj2_vid,0,&clip);
425407
426408   /* origin is with respect to ship2 */
427409
r1771r1772
469451
470452    /* Now check for collisions */
471453    for (sy=0;sy<16;sy++)
472    {
473454        for (sx=0;sx<16;sx++)
474        {
475           if (*BITMAP_ADDR16(ship2_vid, sy, sx)==machine->pens[1])
455           if (*BITMAP_ADDR16(ship2_vid, sy, sx)==1)
476456              {
477457              /* Condition 1 - ship 2 = proj 1 */
478            if (*BITMAP_ADDR16(proj1_vid, sy, sx)==machine->pens[1])
458            if (*BITMAP_ADDR16(proj1_vid, sy, sx)==1)
479459                   return 1;
480460              /* Condition 2 - ship 2 = proj 2 */
481              if (*BITMAP_ADDR16(proj2_vid, sy, sx)==machine->pens[1])
461              if (*BITMAP_ADDR16(proj2_vid, sy, sx)==1)
482462                   return 1;
483463            }
484        }
485    }
486464
487465    return 0;
488466}
489467
490468VIDEO_UPDATE( starcrus )
491469{
492    fillbitmap(bitmap,machine->pens[0],cliprect);
470    fillbitmap(bitmap,0,cliprect);
493471
494472   /* Draw ship 1 */
495473    drawgfx(bitmap,
src/mame/video/yunsun16.c
r1771r1772
175175      x   +=   sprites_scrolldx;
176176      y   +=   sprites_scrolldy;
177177
178      if (flip_screen)   // not used?
178      if (flip_screen_get())   // not used?
179179      {
180180         flipx = !flipx;      x = max_x - x - 16;
181181         flipy = !flipy;      y = max_y - y - 16;
src/mame/video/wiz.c
r1771r1772
226226
227227VIDEO_UPDATE( kungfut )
228228{
229   fillbitmap(bitmap,machine->pens[bgpen],cliprect);
229   fillbitmap(bitmap,bgpen,cliprect);
230230   draw_background(machine, bitmap, cliprect, 2 + char_bank[0] , 0);
231231   draw_foreground(machine, bitmap, cliprect, 0);
232232   draw_sprites(machine, bitmap, cliprect, spriteram_2, 4);
r1771r1772
239239   int bank;
240240   const rectangle* visible_area;
241241
242   fillbitmap(bitmap,machine->pens[bgpen],cliprect);
242   fillbitmap(bitmap,bgpen,cliprect);
243243   draw_background(machine, bitmap, cliprect, 2 + ((char_bank[0] << 1) | char_bank[1]), 0);
244244   draw_foreground(machine, bitmap, cliprect, 0);
245245
r1771r1772
255255
256256VIDEO_UPDATE( stinger )
257257{
258   fillbitmap(bitmap,machine->pens[bgpen],cliprect);
258   fillbitmap(bitmap,bgpen,cliprect);
259259   draw_background(machine, bitmap, cliprect, 2 + char_bank[0], 1);
260260   draw_foreground(machine, bitmap, cliprect, 1);
261261   draw_sprites(machine, bitmap, cliprect, spriteram_2, 4);
src/mame/video/stactics.c
r1771r1772
1/***************************************************************************
1/****************************************************************************
22
3  video.c
3    Sega "Space Tactics" Driver
44
5  Functions to emulate the video hardware of the machine.
5    Frank Palazzolo (palazzol@home.com)
66
7---
87
98The Video system used in Space Tactics is unusual.
109Here are my notes on how the video system works:
r1771r1772
4847***************************************************************************/
4948
5049#include "driver.h"
50#include "deprecat.h"
51#include "stactics.h"
5152
52/* These are defined in machine/stactics.c */
53extern int stactics_vert_pos;
54extern int stactics_horiz_pos;
55extern UINT8 *stactics_motor_on;
5653
57/* These are needed by machine/stactics.c  */
58int stactics_vblank_count;
59int stactics_shot_standby;
60int stactics_shot_arrive;
6154
62/* These are needed by driver/stactics.c   */
63UINT8 *stactics_videoram_b;
64UINT8 *stactics_videoram_d;
65UINT8 *stactics_videoram_e;
66UINT8 *stactics_videoram_f;
67UINT8 *stactics_palette;
68UINT8 *stactics_display_buffer;
69UINT8 *stactics_lamps;
55/*************************************
56 *
57 *  Palette
58 *
59 *************************************/
7060
71static UINT8 y_scroll_d;
72static UINT8 y_scroll_e;
73static UINT8 y_scroll_f;
74
75static UINT16 beam_state;
76static UINT16 old_beam_state;
77static UINT16 beam_states_per_frame;
78
79
80
81PALETTE_INIT( stactics )
61static PALETTE_INIT( stactics )
8262{
8363   int i;
8464
r1771r1772
10282   }
10383}
10484
105/***************************************************************************
10685
107  Start the video hardware emulation.
10886
109***************************************************************************/
87/*************************************
88 *
89 *  Scrolling
90 *
91 *************************************/
11092
111VIDEO_START( stactics )
93WRITE8_HANDLER( stactics_scroll_ram_w )
11294{
113   y_scroll_d = 0;
114   y_scroll_e = 0;
115   y_scroll_f = 0;
95   stactics_state *state = Machine->driver_data;
11696
117   stactics_vblank_count = 0;
118   stactics_shot_standby = 1;
119   stactics_shot_arrive = 0;
120   beam_state = 0;
121   old_beam_state = 0;
122
123   stactics_vblank_count = 0;
124   stactics_vert_pos = 0;
125   stactics_horiz_pos = 0;
126   *stactics_motor_on = 0;
127}
128
129
130WRITE8_HANDLER( stactics_scroll_ram_w )
131{
132   switch ((offset & 0x700) >> 8)
97   switch (offset >> 8)
13398   {
13499      case 4:  // Page D
135         if (data&0x01)
136            y_scroll_d = offset&0xff;
100         if (data & 0x01)
101            state->y_scroll_d = offset & 0xff;
137102         break;
138103
139104      case 5:  // Page E
140         if (data&0x01)
141            y_scroll_e = offset&0xff;
105         if (data & 0x01)
106            state->y_scroll_e = offset & 0xff;
142107         break;
143108
144109      case 6:  // Page F
145         if (data&0x01)
146            y_scroll_f = offset&0xff;
110         if (data & 0x01)
111            state->y_scroll_f = offset & 0xff;
147112         break;
148113    }
149114}
150115
116
117
118/*************************************
119 *
120 *  VBLANK counter
121 *
122 *************************************/
123
124CUSTOM_INPUT( stactics_get_vblank_count_d3 )
125{
126   stactics_state *state = Machine->driver_data;
127
128   return (state->vblank_count >> 3) & 0x01;
129}
130
131
132
133/*************************************
134 *
135 *  Beam handling
136 *
137 *************************************/
138
151139WRITE8_HANDLER( stactics_speed_latch_w )
152140{
141   stactics_state *state = Machine->driver_data;
142
153143   /* This writes to a shift register which is clocked by   */
154144   /* a 555 oscillator.  This value determines the speed of */
155145   /* the LED fire beams as follows:                        */
r1771r1772
169159         num_rising_edges++;
170160   }
171161
172   beam_states_per_frame = num_rising_edges*19/8;
162   state->beam_states_per_frame = num_rising_edges*19/8;
173163}
174164
165
175166WRITE8_HANDLER( stactics_shot_trigger_w )
176167{
177   stactics_shot_standby = 0;
168   stactics_state *state = Machine->driver_data;
169
170   state->shot_standby = 0;
178171}
179172
173
180174WRITE8_HANDLER( stactics_shot_flag_clear_w )
181175{
182   stactics_shot_arrive = 0;
176   stactics_state *state = Machine->driver_data;
177
178   state->shot_arrive = 0;
183179}
184180
185181
182CUSTOM_INPUT( stactics_get_shot_standby )
183{
184   stactics_state *state = Machine->driver_data;
186185
187static void update_beam(void)
186   return state->shot_standby;
187}
188
189
190CUSTOM_INPUT( stactics_get_not_shot_arrive )
188191{
189   /* An LED fire beam! */
190   /* (There were 120 green LEDS mounted in the cabinet in the game, */
191   /*  and one red one, for the sight)                               */
192   stactics_state *state = Machine->driver_data;
192193
193   /* First, update the firebeam state */
194   return !state->shot_arrive;
195}
194196
195   old_beam_state = beam_state;
196   if (stactics_shot_standby == 0)
197      beam_state = beam_state + beam_states_per_frame;
198197
198static void update_beam(stactics_state *state)
199{
200   /* first, update the firebeam state */
201   state->old_beam_state = state->beam_state;
202   if (state->shot_standby == 0)
203      state->beam_state = state->beam_state + state->beam_states_per_frame;
204
199205   /* These are thresholds for the two shots from the LED fire ROM */
200206   /* (Note: There are two more for sound triggers, */
201207   /*        whenever that gets implemented)        */
202   if ((old_beam_state < 0x8b) & (beam_state >= 0x8b))
203      stactics_shot_arrive = 1;
208   if ((state->old_beam_state < 0x8b) & (state->beam_state >= 0x8b))
209      state->shot_arrive = 1;
204210
205   if ((old_beam_state < 0xca) & (beam_state >= 0xca))
206      stactics_shot_arrive = 1;
211   if ((state->old_beam_state < 0xca) & (state->beam_state >= 0xca))
212      state->shot_arrive = 1;
207213
208   if (beam_state >= 0x100)
214   if (state->beam_state >= 0x100)
209215   {
210      beam_state = 0;
211      stactics_shot_standby = 1;
216      state->beam_state = 0;
217      state->shot_standby = 1;
212218   }
213219}
214220
215221
216222
223/*************************************
224 *
225 *  Video drawing
226 *
227 *************************************/
228
217229INLINE int get_pixel_on_plane(UINT8 *videoram, UINT8 y, UINT8 x, UINT8 y_scroll)
218230{
219231   UINT8 code;
r1771r1772
233245}
234246
235247
236static void draw_background(mame_bitmap *bitmap, const rectangle *cliprect, const pen_t *pens)
248static void draw_background(stactics_state *state, mame_bitmap *bitmap, const rectangle *cliprect)
237249{
238250   int y;
239251
240   fillbitmap(bitmap, pens[0], cliprect);
252   fillbitmap(bitmap, 0, cliprect);
241253
242254   /* for every row */
243255   for (y = 0; y < 0x100; y++)
r1771r1772
248260      for (x = 0; x < 0x100; x++)
249261      {
250262         /* get the pixels for the four planes */
251         int pixel_b = get_pixel_on_plane(stactics_videoram_b, y, x, 0);
252         int pixel_d = get_pixel_on_plane(stactics_videoram_d, y, x, y_scroll_d);
253         int pixel_e = get_pixel_on_plane(stactics_videoram_e, y, x, y_scroll_e);
254         int pixel_f = get_pixel_on_plane(stactics_videoram_f, y, x, y_scroll_f);
263         int pixel_b = get_pixel_on_plane(state->videoram_b, y, x, 0);
264         int pixel_d = get_pixel_on_plane(state->videoram_d, y, x, state->y_scroll_d);
265         int pixel_e = get_pixel_on_plane(state->videoram_e, y, x, state->y_scroll_e);
266         int pixel_f = get_pixel_on_plane(state->videoram_f, y, x, state->y_scroll_f);
255267
256268         /* get the color for this pixel */
257         UINT8 color = stactics_videoram_b[((y >> 3) << 5) | (x >> 3)] >> 4;
269         UINT8 color = state->videoram_b[((y >> 3) << 5) | (x >> 3)] >> 4;
258270
259271         /* assemble the pen index */
260272         int pen = color |
r1771r1772
262274                 (pixel_f << 5) |
263275                 (pixel_e << 6) |
264276                 (pixel_d << 7) |
265                 ((stactics_palette[0] & 0x01) << 8) |
266                 ((stactics_palette[1] & 0x01) << 9);
277                 ((state->palette[0] & 0x01) << 8) |
278                 ((state->palette[1] & 0x01) << 9);
267279
268280         /* compute the effective pixel coordinate after adjusting for the
269281               mirror movement - this is mechanical on the real machine */
270         int sy = y + stactics_vert_pos;
271         int sx = x - stactics_horiz_pos;
282         int sy = y + state->vert_pos;
283         int sx = x - state->horiz_pos;
272284
273285         /* plot if visible */
274286         if ((sy >= 0) && (sy < 0x100) && (sx >= 0) && (sx < 0x100))
275            *BITMAP_ADDR16(bitmap, sy, sx) = pens[pen];
287            *BITMAP_ADDR16(bitmap, sy, sx) = pen;
276288      }
277289   }
278290}
279291
280292
293
294/*************************************
295 *
296 *  Non-video artwork
297 *
298 *************************************/
299
300/* from 7448 datasheet */
301static const int to_7seg[0x10] =
302{
303   0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07,
304   0x7f, 0x67, 0x58, 0x4c, 0x62, 0x69, 0x78, 0x00
305};
306
307
281308static void set_indicator_leds(int data, const char *output_name, int base_index)
282309{
283   /* from 7448 datasheet */
284   static const int to_7seg[0x10] =
285   {
286      0x7e, 0x30, 0x6d, 0x79, 0x33, 0x5b, 0x1f, 0x70,
287      0x7f, 0x73, 0x0d, 0x19, 0x23, 0x4b, 0x0f, 0x00
288   };
289
290310   /* decode the data */
291   data = to_7seg[(data ^ 0x0f) & 0x0f];
311   data = to_7seg[~data & 0x0f];
292312
293313   /* set the 4 LEDs */
294   output_set_indexed_value(output_name, base_index + 0, (data >> 4) & 0x01);
295   output_set_indexed_value(output_name, base_index + 1, (data >> 0) & 0x01);
296   output_set_indexed_value(output_name, base_index + 2, (data >> 1) & 0x01);
297   output_set_indexed_value(output_name, base_index + 3, (data >> 2) & 0x01);
314   output_set_indexed_value(output_name, base_index + 0, (data >> 2) & 0x01);
315   output_set_indexed_value(output_name, base_index + 1, (data >> 6) & 0x01);
316   output_set_indexed_value(output_name, base_index + 2, (data >> 5) & 0x01);
317   output_set_indexed_value(output_name, base_index + 3, (data >> 4) & 0x01);
298318}
299319
300320
301static void update_artwork(void)
321static void update_artwork(stactics_state *state)
302322{
303323   int i;
304324   UINT8 *beam_region = memory_region(REGION_USER1);
305325
306326   /* set the lamps first */
307   output_set_indexed_value("base_lamp", 4, stactics_lamps[0] & 0x01);
308   output_set_indexed_value("base_lamp", 3, stactics_lamps[1] & 0x01);
309   output_set_indexed_value("base_lamp", 2, stactics_lamps[2] & 0x01);
310   output_set_indexed_value("base_lamp", 1, stactics_lamps[3] & 0x01);
311   output_set_indexed_value("base_lamp", 0, stactics_lamps[4] & 0x01);
312   output_set_value("start_lamp",   stactics_lamps[5] & 0x01);
313   output_set_value("barrier_lamp", stactics_lamps[6] & 0x01);  /* this needs to flash on/off, not implemented */
327   output_set_indexed_value("base_lamp", 4, state->lamps[0] & 0x01);
328   output_set_indexed_value("base_lamp", 3, state->lamps[1] & 0x01);
329   output_set_indexed_value("base_lamp", 2, state->lamps[2] & 0x01);
330   output_set_indexed_value("base_lamp", 1, state->lamps[3] & 0x01);
331   output_set_indexed_value("base_lamp", 0, state->lamps[4] & 0x01);
332   output_set_value("start_lamp",   state->lamps[5] & 0x01);
333   output_set_value("barrier_lamp", state->lamps[6] & 0x01);  /* this needs to flash on/off, not implemented */
314334
315335   /* laser beam - loop for each LED */
316336   for (i = 0; i < 0x40; i++)
317337   {
318      offs_t beam_data_offs;
319      UINT8 beam_data;
320      int on;
338      offs_t beam_data_offs = ((i & 0x08) << 7) | ((i & 0x30) << 4) | state->beam_state;
339      UINT8 beam_data = beam_region[beam_data_offs];
340      int on = (beam_data >> (i & 0x07)) & 0x01;
321341
322      beam_data_offs = ((i & 0x08) << 7) | ((i & 0x30) << 4) | beam_state;
323      beam_data = beam_region[beam_data_offs];
324      on = (beam_data >> (i & 0x07)) & 0x01;
325
326342      output_set_indexed_value("beam_led_left", i, on);
327343      output_set_indexed_value("beam_led_right", i, on);
328344   }
329345
330346   /* sight LED */
331   output_set_value("sight_led", *stactics_motor_on & 0x01);
347   output_set_value("sight_led", *state->motor_on & 0x01);
332348
333349   /* score display */
334350   for (i = 0x01; i < 0x07; i++)
335      output_set_indexed_value("score_7seg", i - 1, ~stactics_display_buffer[i] & 0x0f);
351      output_set_digit_value(i - 1, to_7seg[~state->display_buffer[i] & 0x0f]);
336352
337353   /* credits indicator */
338   set_indicator_leds(stactics_display_buffer[0x07], "credit_led", 0x00);
339   set_indicator_leds(stactics_display_buffer[0x08], "credit_led", 0x04);
354   set_indicator_leds(state->display_buffer[0x07], "credit_led", 0x00);
355   set_indicator_leds(state->display_buffer[0x08], "credit_led", 0x04);
340356
341357   /* barriers indicator */
342   set_indicator_leds(stactics_display_buffer[0x09], "barrier_led", 0x00);
343   set_indicator_leds(stactics_display_buffer[0x0a], "barrier_led", 0x04);
344   set_indicator_leds(stactics_display_buffer[0x0b], "barrier_led", 0x08);
358   set_indicator_leds(state->display_buffer[0x09], "barrier_led", 0x00);
359   set_indicator_leds(state->display_buffer[0x0a], "barrier_led", 0x04);
360   set_indicator_leds(state->display_buffer[0x0b], "barrier_led", 0x08);
345361
346362   /* rounds indicator */
347   set_indicator_leds(stactics_display_buffer[0x0c], "round_led", 0x00);
348   set_indicator_leds(stactics_display_buffer[0x0d], "round_led", 0x04);
349   set_indicator_leds(stactics_display_buffer[0x0e], "round_led", 0x08);
350   set_indicator_leds(stactics_display_buffer[0x0f], "round_led", 0x0c);
363   set_indicator_leds(state->display_buffer[0x0c], "round_led", 0x00);
364   set_indicator_leds(state->display_buffer[0x0d], "round_led", 0x04);
365   set_indicator_leds(state->display_buffer[0x0e], "round_led", 0x08);
366   set_indicator_leds(state->display_buffer[0x0f], "round_led", 0x0c);
351367}
352368
353369
354VIDEO_UPDATE( stactics )
370
371/*************************************
372 *
373 *  Start
374 *
375 *************************************/
376
377static VIDEO_START( stactics )
355378{
356   update_beam();
379   stactics_state *state = machine->driver_data;
357380
358   /* update vblank counter */
359   stactics_vblank_count++;
381   state->y_scroll_d = 0;
382   state->y_scroll_e = 0;
383   state->y_scroll_f = 0;
360384
361   draw_background(bitmap, cliprect, machine->pens);
362   update_artwork();
385   state->shot_standby = 1;
386   state->shot_arrive = 0;
387   state->beam_state = 0;
388   state->old_beam_state = 0;
389   state->vblank_count = 0;
390}
363391
392
393
394/*************************************
395 *
396 *  Update
397 *
398 *************************************/
399
400static VIDEO_UPDATE( stactics )
401{
402   stactics_state *state = machine->driver_data;
403
404   update_beam(state);
405   draw_background(state, bitmap, cliprect);
406   update_artwork(state);
407
408   state->vblank_count = (state->vblank_count + 1) & 0x0f;
409
364410   return 0;
365411}
412
413
414
415/*************************************
416 *
417 *  Machine driver
418 *
419 *************************************/
420
421MACHINE_DRIVER_START( stactics_video )
422
423   MDRV_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE)
424
425   MDRV_SCREEN_ADD("main", RASTER)
426   MDRV_SCREEN_REFRESH_RATE(60)
427   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
428   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
429   MDRV_SCREEN_SIZE(32*8, 32*8)
430   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1)
431
432   MDRV_PALETTE_LENGTH(0x400)
433
434   MDRV_PALETTE_INIT(stactics)
435   MDRV_VIDEO_START(stactics)
436   MDRV_VIDEO_UPDATE(stactics)
437MACHINE_DRIVER_END
src/mame/video/mermaid.c
r1771r1772
167167      code |= rougien_gfxbank1 * 0x2800;
168168      code |= rougien_gfxbank2 * 0x2400;
169169
170      if (flip_screen_x)
170      if (flip_screen_x_get())
171171      {
172172         flipx = !flipx;
173173         sx = 240 - sx;
174174      }
175175
176      if (flip_screen_y)
176      if (flip_screen_y_get())
177177      {
178178         flipy = !flipy;
179179         sy = 240 - sy;
180180      }
181181
182182      drawgfx(bitmap, machine->gfx[1], code, color, flipx, flipy, sx, sy,
183         (flip_screen_x ? &flip_spritevisiblearea : &spritevisiblearea),
183         (flip_screen_x_get() ? &flip_spritevisiblearea : &spritevisiblearea),
184184         TRANSPARENCY_PEN, 0);
185185   }
186186}
src/mame/video/dcon.c
r1771r1772
282282   if ((dcon_enable&1)!=1)
283283      tilemap_draw(bitmap,cliprect,background_layer,0,0);
284284   else
285      fillbitmap(bitmap,machine->pens[15],cliprect); /* Should always be black, not pen 15 */
285      fillbitmap(bitmap,15,cliprect); /* Should always be black, not pen 15 */
286286
287287   tilemap_draw(bitmap,cliprect,midground_layer,0,1);
288288   tilemap_draw(bitmap,cliprect,foreground_layer,0,2);
r1771r1772
318318   if ((dcon_enable&1)!=1)
319319      tilemap_draw(bitmap,cliprect,background_layer,0,0);
320320   else
321      fillbitmap(bitmap,machine->pens[15],cliprect); /* Should always be black, not pen 15 */
321      fillbitmap(bitmap,15,cliprect); /* Should always be black, not pen 15 */
322322
323323   tilemap_draw(bitmap,cliprect,midground_layer,0,1);
324324   tilemap_draw(bitmap,cliprect,foreground_layer,0,2);
src/mame/video/galaxian.c
r1771r1772
14211421         /* yellow missile, white shells (this is the terminology on the schematics) */
14221422         color = ((offs == 7*4) ? BULLETS_COLOR_BASE : BULLETS_COLOR_BASE + 1);
14231423
1424         *BITMAP_ADDR16(bitmap, y, x) = machine->pens[color];
1424         *BITMAP_ADDR16(bitmap, y, x) = color;
14251425      }
14261426   }
14271427}
r1771r1772
14411441      x <= machine->screen[0].visarea.max_x)
14421442   {
14431443      /* yellow bullets */
1444      *BITMAP_ADDR16(bitmap, y, x) = machine->pens[BULLETS_COLOR_BASE];
1444      *BITMAP_ADDR16(bitmap, y, x) = BULLETS_COLOR_BASE;
14451445   }
14461446}
14471447
r1771r1772
14541454   if (x >= machine->screen[0].visarea.min_x &&
14551455      x <= machine->screen[0].visarea.max_x)
14561456   {
1457      *BITMAP_ADDR16(bitmap, y, x) = machine->pens[32 + darkplnt_bullet_color];
1457      *BITMAP_ADDR16(bitmap, y, x) = 32 + darkplnt_bullet_color;
14581458   }
14591459}
14601460
r1771r1772
14711471      if (x >= machine->screen[0].visarea.min_x &&
14721472         x <= machine->screen[0].visarea.max_x)
14731473      {
1474         *BITMAP_ADDR16(bitmap, y, x) = machine->pens[BULLETS_COLOR_BASE];
1474         *BITMAP_ADDR16(bitmap, y, x) = BULLETS_COLOR_BASE;
14751475      }
14761476   }
14771477}
r1771r1772
14801480{
14811481   int i, color;
14821482
1483   if (flip_screen_x)  x++;
1483   if (flip_screen_x_get())  x++;
14841484
14851485   x = x - 6;
14861486
r1771r1772
15001500      if (x >= machine->screen[0].visarea.min_x &&
15011501         x <= machine->screen[0].visarea.max_x)
15021502      {
1503         *BITMAP_ADDR16(bitmap, y, x) = machine->pens[color];
1503         *BITMAP_ADDR16(bitmap, y, x) = color;
15041504      }
15051505   }
15061506}
r1771r1772
15121512static void galaxian_draw_background(running_machine *machine, mame_bitmap *bitmap)
15131513{
15141514   /* plain black background */
1515   fillbitmap(bitmap,machine->pens[0],&machine->screen[0].visarea);
1515   fillbitmap(bitmap,0,&machine->screen[0].visarea);
15161516}
15171517
15181518static void scramble_draw_background(running_machine *machine, mame_bitmap *bitmap)
15191519{
15201520   if (background_enable)
1521   {
1522      fillbitmap(bitmap,machine->pens[BACKGROUND_COLOR_BASE],&machine->screen[0].visarea);
1523   }
1521      fillbitmap(bitmap,BACKGROUND_COLOR_BASE,&machine->screen[0].visarea);
15241522   else
1525   {
1526      fillbitmap(bitmap,machine->pens[0],&machine->screen[0].visarea);
1527   }
1523      fillbitmap(bitmap,0,&machine->screen[0].visarea);
15281524}
15291525
15301526static void turtles_draw_background(running_machine *machine, mame_bitmap *bitmap)
15311527{
15321528   int color = (background_blue << 2) | (background_green << 1) | background_red;
15331529
1534   fillbitmap(bitmap,machine->pens[BACKGROUND_COLOR_BASE + color],&machine->screen[0].visarea);
1530   fillbitmap(bitmap,BACKGROUND_COLOR_BASE + color,&machine->screen[0].visarea);
15351531}
15361532
15371533static void frogger_draw_background(running_machine *machine, mame_bitmap *bitmap)
r1771r1772
15391535   /* color split point verified on real machine */
15401536   if (flipscreen_x)
15411537   {
1542      plot_box(bitmap,   0, 0, 128, 256, machine->pens[0]);
1543      plot_box(bitmap, 128, 0, 128, 256, machine->pens[BACKGROUND_COLOR_BASE]);
1538      plot_box(bitmap,   0, 0, 128, 256, 0);
1539      plot_box(bitmap, 128, 0, 128, 256, BACKGROUND_COLOR_BASE);
15441540   }
15451541   else
15461542   {
1547      plot_box(bitmap,   0, 0, 128, 256, machine->pens[BACKGROUND_COLOR_BASE]);
1548      plot_box(bitmap, 128, 0, 128, 256, machine->pens[0]);
1543      plot_box(bitmap,   0, 0, 128, 256, BACKGROUND_COLOR_BASE);
1544      plot_box(bitmap, 128, 0, 128, 256, 0);
15491545   }
15501546}
15511547
r1771r1772
15761572      if ((~prom[x] & 0x01) && background_blue)  color |= 0x04;
15771573
15781574      if (flipscreen_x)
1579      {
15801575         sx = 8 * (31 - x);
1581      }
15821576      else
1583      {
15841577         sx = 8 * x;
1585      }
15861578
1587      plot_box(bitmap, sx, 0, 8, 256, machine->pens[BACKGROUND_COLOR_BASE + color]);
1579      plot_box(bitmap, sx, 0, 8, 256, BACKGROUND_COLOR_BASE + color);
15881580   }
15891581}
15901582
r1771r1772
15961588
15971589
15981590      for (x = 0; x < 128; x++)
1599      {
1600         plot_box(bitmap, x,       0, 1, 256, machine->pens[BACKGROUND_COLOR_BASE + x]);
1601      }
1591         plot_box(bitmap, x,       0, 1, 256, BACKGROUND_COLOR_BASE + x);
16021592
16031593      for (x = 0; x < 120; x++)
1604      {
1605         plot_box(bitmap, x + 128, 0, 1, 256, machine->pens[BACKGROUND_COLOR_BASE + x + 128]);
1606      }
1594         plot_box(bitmap, x + 128, 0, 1, 256, BACKGROUND_COLOR_BASE + x + 128);
16071595
1608      plot_box(bitmap, 248, 0, 16, 256, machine->pens[BACKGROUND_COLOR_BASE]);
1596      plot_box(bitmap, 248, 0, 16, 256, BACKGROUND_COLOR_BASE);
16091597   }
16101598   else
1611   {
1612      fillbitmap(bitmap,machine->pens[0],&machine->screen[0].visarea);
1613   }
1599      fillbitmap(bitmap,0,&machine->screen[0].visarea);
16141600}
16151601
16161602static void rescue_draw_background(running_machine *machine, mame_bitmap *bitmap)
r1771r1772
16191605   {
16201606      int x;
16211607
1622
16231608      for (x = 0; x < 128; x++)
1624      {
1625         plot_box(bitmap, x,       0, 1, 256, machine->pens[BACKGROUND_COLOR_BASE + x]);
1626      }
1609         plot_box(bitmap, x,       0, 1, 256, BACKGROUND_COLOR_BASE + x);
16271610
16281611      for (x = 0; x < 120; x++)
1629      {
1630         plot_box(bitmap, x + 128, 0, 1, 256, machine->pens[BACKGROUND_COLOR_BASE + x + 8]);
1631      }
1612         plot_box(bitmap, x + 128, 0, 1, 256, BACKGROUND_COLOR_BASE + x + 8);
16321613
1633      plot_box(bitmap, 248, 0, 16, 256, machine->pens[BACKGROUND_COLOR_BASE]);
1614      plot_box(bitmap, 248, 0, 16, 256, BACKGROUND_COLOR_BASE);
16341615   }
16351616   else
1636   {
1637      fillbitmap(bitmap,machine->pens[0],&machine->screen[0].visarea);
1638   }
1617      fillbitmap(bitmap,0,&machine->screen[0].visarea);
16391618}
16401619
16411620static void mariner_draw_background(running_machine *machine, mame_bitmap *bitmap)
r1771r1772
16561635      {
16571636         int color;
16581637
1659
16601638         if (x == 0)
16611639            color = 0;
16621640         else
16631641            color = prom[0x20 + x - 1];
16641642
1665         plot_box(bitmap, 8 * (31 - x), 0, 8, 256, machine->pens[BACKGROUND_COLOR_BASE + color]);
1643         plot_box(bitmap, 8 * (31 - x), 0, 8, 256, BACKGROUND_COLOR_BASE + color);
16661644      }
16671645   }
16681646   else
r1771r1772
16711649      {
16721650         int color;
16731651
1674
16751652         if (x == 31)
16761653            color = 0;
16771654         else
16781655            color = prom[x + 1];
16791656
1680         plot_box(bitmap, 8 * x, 0, 8, 256, machine->pens[BACKGROUND_COLOR_BASE + color]);
1657         plot_box(bitmap, 8 * x, 0, 8, 256, BACKGROUND_COLOR_BASE + color);
16811658      }
16821659   }
16831660}
r1771r1772
16871664   int col1 = BACKGROUND_COLOR_BASE + dambustr_bg_color_1;
16881665   int col2 = BACKGROUND_COLOR_BASE + dambustr_bg_color_2;
16891666
1690   if (flip_screen_x)
1667   if (flip_screen_x_get())
16911668   {
1692      plot_box(bitmap,   0, 0, 256-dambustr_bg_split_line, 256, machine->pens[col2]);
1693      plot_box(bitmap, 256-dambustr_bg_split_line, 0, dambustr_bg_split_line, 256, machine->pens[col1]);
1669      plot_box(bitmap,   0, 0, 256-dambustr_bg_split_line, 256, col2);
1670      plot_box(bitmap, 256-dambustr_bg_split_line, 0, dambustr_bg_split_line, 256, col1);
16941671   }
16951672   else
16961673   {
1697      plot_box(bitmap,   0, 0, 256-dambustr_bg_split_line, 256, machine->pens[col1]);
1698      plot_box(bitmap, 256-dambustr_bg_split_line, 0, dambustr_bg_split_line, 256, machine->pens[col2]);
1674      plot_box(bitmap,   0, 0, 256-dambustr_bg_split_line, 256, col1);
1675      plot_box(bitmap, 256-dambustr_bg_split_line, 0, dambustr_bg_split_line, 256, col2);
16991676   }
17001677
17011678}
r1771r1772
17041681{
17051682   static rectangle clip = { 0, 0, 0, 0 };
17061683
1707   if (flip_screen_x)
1684   if (flip_screen_x_get())
17081685   {
17091686      clip.min_x = 254 - dambustr_bg_split_line;
17101687      clip.max_x = dambustr_bg_split_line;
r1771r1772
18071784
18081785
18091786   if (flipscreen_x)
1810   {
18111787      x = 255 - x;
1812   }
1788
18131789   if (flipscreen_y)
1814   {
18151790      y = 255 - y;
1816   }
18171791
1818   *BITMAP_ADDR16(bitmap, y, x) = machine->pens[stars_colors_start + color];
1792   *BITMAP_ADDR16(bitmap, y, x) = stars_colors_start + color;
18191793}
18201794
18211795static void noop_draw_stars(running_machine *machine, mame_bitmap *bitmap)
src/mame/video/othldrby.c
r1771r1772
153153      sizex = (buf_spriteram[offs+2] & 0x000f) + 1;
154154      sizey = (buf_spriteram[offs+3] & 0x000f) + 1;
155155
156      if (flip_screen)
156      if (flip_screen_get())
157157      {
158158         flipx = !flipx;
159159         flipy = !flipy;
r1771r1772
185185
186186   for (layer = 0;layer < 3;layer++)
187187   {
188      if (flip_screen)
188      if (flip_screen_get())
189189      {
190190         tilemap_set_scrollx(bg_tilemap[layer],0,vreg[2*layer]+59);
191191         tilemap_set_scrolly(bg_tilemap[layer],0,vreg[2*layer+1]+248);
r1771r1772
199199
200200   fillbitmap(priority_bitmap,0,cliprect);
201201
202   fillbitmap(bitmap,machine->pens[0],cliprect);
202   fillbitmap(bitmap,0,cliprect);
203203
204204   for (layer = 0;layer < 3;layer++)
205205      tilemap_draw(bitmap,cliprect,bg_tilemap[layer],0,0);
src/mame/video/hyprduel.c
r1771r1772
459459
460460         gfxdata      =   base_gfx + (8*8*4/8) * (((attr & 0x000f) << 16) + code);
461461
462         if (flip_screen)
462         if (flip_screen_get())
463463         {
464464            flipx = !flipx;      x = max_x - x - width;
465465            flipy = !flipy;      y = max_y - y - height;
r1771r1772
635635
636636   /* The background color is selected by a register */
637637   fillbitmap(priority_bitmap,0,cliprect);
638   fillbitmap(bitmap,machine->pens[((hyprduel_videoregs[0x12/2] & 0x0fff) ^ 0x0ff) + 0x1000],cliprect);
638   fillbitmap(bitmap,((hyprduel_videoregs[0x12/2] & 0x0fff) ^ 0x0ff) + 0x1000,cliprect);
639639
640640   /*  Screen Control Register:
641641
src/mame/video/calomega.c
r0r1772
1/***********************************************
2
3    +-------------------------------------+
4    |                                     |
5    | CAL OMEGA - SYSTEMS 903/904/905/906 |
6    |                                     |
7    |      Driver by Roberto Fresca.      |
8    |                                     |
9    +-------------------------------------+
10
11             * Video Hardware *
12
13************************************************/
14
15
16#include "driver.h"
17#include "video/mc6845.h"
18
19static mc6845_t *mc6845;
20static tilemap *bg_tilemap;
21
22WRITE8_HANDLER( calomega_videoram_w )
23{
24   videoram[offset] = data;
25   tilemap_mark_tile_dirty(bg_tilemap, offset);
26}
27
28WRITE8_HANDLER( calomega_colorram_w )
29{
30   colorram[offset] = data;
31   tilemap_mark_tile_dirty(bg_tilemap, offset);
32}
33
34static TILE_GET_INFO( get_bg_tile_info )
35{
36/*  - bits -
37    7654 3210
38    --xx xx--   tiles color.
39    ---- --x-   tiles bank.
40    xx-- ---x   seems unused. */
41
42   int attr = colorram[tile_index];
43   int code = videoram[tile_index];
44   int bank = (attr & 0x02) >> 1;   /* bit 1 switch the gfx banks */
45   int color = (attr & 0x3c);   /* bits 2-3-4-5 for color */
46
47   if (attr == 0x3a)   /* Is the palette wrong? */
48      color = 0x3b;   /* 0x3b is the best match */
49
50   SET_TILE_INFO(bank, code, color, 0);
51}
52
53WRITE8_HANDLER( calomega_mc6845_address_w )
54{
55   mc6845_address_w(mc6845, data);
56}
57
58READ8_HANDLER( calomega_mc6845_register_r )
59{
60   return mc6845_register_r(mc6845);
61}
62
63WRITE8_HANDLER( calomega_mc6845_register_w )
64{
65   mc6845_register_w(mc6845, data);
66}
67
68VIDEO_START( calomega )
69{
70   mc6845 = devtag_get_token(machine, MC6845, "crtc");
71   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 31);
72}
73
74VIDEO_UPDATE( calomega )
75{
76   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
77   return 0;
78}
79
80PALETTE_INIT( calomega )
81{
82/*  prom bits
83    7654 3210
84    ---- ---x   red component.
85    ---- --x-   green component.
86    ---- -x--   blue component.
87    ---- x---   unknown, aparently unused.
88    xxxx ----   unused.
89*/
90   int i;
91
92   /* 00000BGR */
93   if (color_prom == 0) return;
94
95   for (i = 0;i < machine->config->total_colors;i++)
96   {
97      int bit0, bit1, bit2, r, g, b;
98
99      /* red component */
100      bit0 = (color_prom[i] >> 0) & 0x01;
101      r = bit0 * 0xff;
102
103      /* green component */
104      bit1 = (color_prom[i] >> 1) & 0x01;
105      g = bit1 * 0xff;
106
107      /* blue component */
108      bit2 = (color_prom[i] >> 2) & 0x01;
109      b = bit2 * 0xff;
110
111
112      palette_set_color(machine, i, MAKE_RGB(r, g, b));
113   }
114}
src/mame/video/strnskil.c
r1771r1772
5656{
5757   strnskil_scrl_ctrl = data >> 5;
5858
59   if (flip_screen != (data & 0x08))
59   if (flip_screen_get() != (data & 0x08))
6060   {
6161      flip_screen_set(data & 0x08);
6262      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
r1771r1772
8888   {
8989      int code = spriteram[offs + 1];
9090      int color = spriteram[offs + 2] & 0x3f;
91      int flipx = flip_screen_x;
92      int flipy = flip_screen_y;
91      int flipx = flip_screen_x_get();
92      int flipy = flip_screen_y_get();
9393
9494      int sx = spriteram[offs + 3];
9595      int sy = spriteram[offs];
9696      int px, py;
9797
98      if (flip_screen)
98      if (flip_screen_get())
9999      {
100100         px = 240 - sx + 0; /* +2 or +0 ? */
101101         py = sy;
src/mame/video/cosmic.c
r1771r1772
249249}
250250
251251
252static void draw_bitmap(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
252static void draw_bitmap(mame_bitmap *bitmap, const rectangle *cliprect)
253253{
254254   offs_t offs;
255255
r1771r1772
261261      UINT8 x = offs << 3;
262262      UINT8 y = offs >> 5;
263263
264      pen_t pen = machine->pens[map_color(x, y)];
264      pen_t pen = map_color(x, y);
265265
266266      for (i = 0; i < 8; i++)
267267      {
268268         if (data & 0x80)
269269         {
270            if (flip_screen)
270            if (flip_screen_get())
271271               *BITMAP_ADDR16(bitmap, 255-y, 255-x) = pen;
272272            else
273273               *BITMAP_ADDR16(bitmap, y, x) = pen;
r1771r1772
315315}
316316
317317
318static void cosmica_draw_starfield(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
318static void cosmica_draw_starfield(mame_bitmap *bitmap, const rectangle *cliprect)
319319{
320320   UINT8 y = 0;
321321   UINT8 map = 0;
r1771r1772
333333         UINT8 x1;
334334         int hc, hb_;
335335
336         if (flip_screen)
336         if (flip_screen_get())
337337            x1 = x - cpu_getcurrentframe();
338338         else
339339            x1 = x + cpu_getcurrentframe();
r1771r1772
351351            /* RGB order is reversed -- bit 7=R, 6=G, 5=B */
352352            int col = (map >> 7) | ((map >> 5) & 0x02) | ((map >> 3) & 0x04);
353353
354            *BITMAP_ADDR16(bitmap, y, x) = machine->pens[col];
354            *BITMAP_ADDR16(bitmap, y, x) = col;
355355         }
356356
357357         x++;
r1771r1772
364364}
365365
366366
367static void devzone_draw_grid(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
367static void devzone_draw_grid(mame_bitmap *bitmap, const rectangle *cliprect)
368368{
369369   UINT8 y;
370370   UINT8 *horz_PROM = memory_region(REGION_USER2);
r1771r1772
403403         {
404404            if (!(vert_data & horz_data & 0x80))   /* NAND gate */
405405            {
406               pen_t pen = machine->pens[4];   /* blue */
407
408               if (flip_screen)
409                  *BITMAP_ADDR16(bitmap, 255-y, 255-x) = pen;
406               /* blue */
407               if (flip_screen_get())
408                  *BITMAP_ADDR16(bitmap, 255-y, 255-x) = 4;
410409               else
411                  *BITMAP_ADDR16(bitmap, y, x) = pen;
410                  *BITMAP_ADDR16(bitmap, y, x) = 4;
412411            }
413412
414413            horz_data = (horz_data << 1) | 0x01;
r1771r1772
423422}
424423
425424
426static void nomnlnd_draw_background(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
425static void nomnlnd_draw_background(mame_bitmap *bitmap, const rectangle *cliprect)
427426{
428427   UINT8 y = 0;
429428   UINT8 water = cpu_getcurrentframe();
r1771r1772
490489            if (!hd_ & hc_ & !hb_)
491490            {
492491               offs_t offs = ((x >> 3) & 0x03) | ((y & 0x1f) << 2) |
493                             (flip_screen ? 0x80 : 0);
492                             (flip_screen_get() ? 0x80 : 0);
494493
495494               UINT8 plane1 = PROM[offs         ] << (x & 0x07);
496495               UINT8 plane2 = PROM[offs | 0x0400] << (x & 0x07);
r1771r1772
524523
525524         if (color != 0)
526525         {
527            pen_t pen = machine->pens[color];
528
529            if (flip_screen)
530               *BITMAP_ADDR16(bitmap, 255-y, 255-x) = pen;
526            if (flip_screen_get())
527               *BITMAP_ADDR16(bitmap, 255-y, 255-x) = color;
531528            else
532               *BITMAP_ADDR16(bitmap, y, x) = pen;
529               *BITMAP_ADDR16(bitmap, y, x) = color;
533530         }
534531
535532         x++;
r1771r1772
549546
550547VIDEO_UPDATE( cosmicg )
551548{
552   fillbitmap(bitmap, machine->pens[0], cliprect);
553
554   draw_bitmap(machine, bitmap, cliprect);
549   fillbitmap(bitmap, 0, cliprect);
550   draw_bitmap(bitmap, cliprect);
555551   return 0;
556552}
557553
558554
559555VIDEO_UPDATE( panic )
560556{
561   fillbitmap(bitmap, machine->pens[0], cliprect);
562
563   draw_bitmap(machine, bitmap, cliprect);
564
557   fillbitmap(bitmap, 0, cliprect);
558   draw_bitmap(bitmap, cliprect);
565559   draw_sprites(machine, bitmap, cliprect, 0x07, 1);
566560   return 0;
567561}
r1771r1772
569563
570564VIDEO_UPDATE( cosmica )
571565{
572   fillbitmap(bitmap, machine->pens[0], cliprect);
573
574   cosmica_draw_starfield(machine, bitmap, cliprect);
575
576   draw_bitmap(machine, bitmap, cliprect);
577
566   fillbitmap(bitmap, 0, cliprect);
567   cosmica_draw_starfield(bitmap, cliprect);
568   draw_bitmap(bitmap, cliprect);
578569   draw_sprites(machine, bitmap, cliprect, 0x0f, 0);
579570   return 0;
580571}
r1771r1772
582573
583574VIDEO_UPDATE( magspot )
584575{
585   fillbitmap(bitmap, machine->pens[0], cliprect);
586
587   draw_bitmap(machine, bitmap, cliprect);
588
576   fillbitmap(bitmap, 0, cliprect);
577   draw_bitmap(bitmap, cliprect);
589578   draw_sprites(machine, bitmap, cliprect, 0x07, 0);
590579   return 0;
591580}
r1771r1772
593582
594583VIDEO_UPDATE( devzone )
595584{
596   fillbitmap(bitmap, machine->pens[0], cliprect);
585   fillbitmap(bitmap, 0, cliprect);
597586
598587    if (background_enable)
599       devzone_draw_grid(machine, bitmap, cliprect);
588       devzone_draw_grid(bitmap, cliprect);
600589
601   draw_bitmap(machine, bitmap, cliprect);
602
590   draw_bitmap(bitmap, cliprect);
603591   draw_sprites(machine, bitmap, cliprect, 0x07, 0);
604592   return 0;
605593}
r1771r1772
610598   /* according to the video summation logic on pg4, the trees and river
611599       have the highest priority */
612600
613   fillbitmap(bitmap, machine->pens[0], cliprect);
614
615   draw_bitmap(machine, bitmap, cliprect);
616
601   fillbitmap(bitmap, 0, cliprect);
602   draw_bitmap(bitmap, cliprect);
617603   draw_sprites(machine, bitmap, cliprect, 0x07, 0);
618604
619605   if (background_enable)
620      nomnlnd_draw_background(machine, bitmap, cliprect);
606      nomnlnd_draw_background(bitmap, cliprect);
621607
622608   return 0;
623609}
src/mame/video/shaolins.c
r1771r1772
124124{
125125   shaolins_nmi_enable = data;
126126
127   if (flip_screen != (data & 0x01))
127   if (flip_screen_get() != (data & 0x01))
128128   {
129129      flip_screen_set(data & 0x01);
130130      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
r1771r1772
164164         int sx = 240 - spriteram[offs + 6];
165165         int sy = 248 - spriteram[offs + 4];
166166
167         if (flip_screen)
167         if (flip_screen_get())
168168         {
169169            sx = 240 - sx;
170170            sy = 248 - sy;
src/mame/video/sshangha.c
r1771r1772
3030   palette_set_color(Machine,offset/2,MAKE_RGB(r,g,b));
3131}
3232
33static void sshangha_tilemap_draw(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
33static void sshangha_tilemap_draw(mame_bitmap *bitmap, const rectangle *cliprect)
3434{
3535   const mame_bitmap *bitmap0 = tilemap_get_pixmap(pf1_16x16_tilemap);
3636   const mame_bitmap *bitmap1 = tilemap_get_pixmap(pf2_tilemap);
r1771r1772
4141         p=*BITMAP_ADDR16(bitmap0, y, x)&0xf;
4242         p|=(*BITMAP_ADDR16(bitmap1, y, x)&0xf)<<4;
4343
44         *BITMAP_ADDR16(bitmap, y, x) = machine->pens[p|0x300];
44         *BITMAP_ADDR16(bitmap, y, x) = p|0x300;
4545      }
4646   }
4747}
r1771r1772
8787
8888      sprite &= ~multi;
8989
90      if (flip_screen)
90      if (flip_screen_get())
9191      {
9292         y=240-y;
9393         x=304-x;
r1771r1772
188188   static int last_pf1_bank,last_pf2_bank;
189189   int offs;
190190
191   flip_screen=sshangha_control_0[0]&0x80;
192   tilemap_set_flip(ALL_TILEMAPS,flip_screen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
191   flip_screen_set_no_update(sshangha_control_0[0]&0x80);
192   tilemap_set_flip(ALL_TILEMAPS,flip_screen_x_get() ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
193193
194194   tilemap_set_enable( pf2_tilemap, sshangha_control_0[5]&0x8000);
195195   tilemap_set_enable( pf1_8x8_tilemap, sshangha_control_0[5]&0x0080);
r1771r1772
240240    produce a 6bpp tilemap.  We can't precompute this as any tiles can be
241241    used in any tilemap, so we plot it on the fly */
242242   if ((sshangha_video_control&4)==0) {
243      sshangha_tilemap_draw(machine, bitmap, cliprect);
243      sshangha_tilemap_draw(bitmap, cliprect);
244244      draw_sprites(machine, bitmap, cliprect, spriteram16,0x4000,0x4000);
245245   }
246246   else {
src/mame/video/popeye.c
r1771r1772
196196      sx = 8 * (offset % 128);
197197      sy = 8 * (offset / 128);
198198
199      if (flip_screen)
199      if (flip_screen_get())
200200         sy = 512-8 - sy;
201201
202202      colour = data & 0x0f;
r1771r1772
213213      sx = 8 * (offset % 64);
214214      sy = 4 * (offset / 64);
215215
216      if (flip_screen)
216      if (flip_screen_get())
217217         sy = 512-4 - sy;
218218
219219      colour = data & 0x0f;
r1771r1772
277277   int offs;
278278   static int lastflip = 0;
279279
280   if (lastflip != flip_screen)
280   if (lastflip != flip_screen_get())
281281   {
282282      for (offs = 0;offs < popeye_bitmapram_size;offs++)
283283         popeye_bitmap_w(offs,popeye_bitmapram[offs]);
284284
285      lastflip = flip_screen;
285      lastflip = flip_screen_get();
286286   }
287287
288288   set_background_palette(machine, (*popeye_palettebank & 0x08) >> 3);
289289
290290   if (popeye_background_pos[1] == 0)   /* no background */
291      fillbitmap(bitmap,machine->pens[0],cliprect);
291      fillbitmap(bitmap,0,cliprect);
292292   else
293293   {
294294      /* copy the background graphics */
r1771r1772
298298      if (bitmap_type == TYPE_SKYSKIPR)
299299         scrollx = 2*scrollx - 512;
300300
301      if (flip_screen)
301      if (flip_screen_get())
302302      {
303303         if (bitmap_type == TYPE_POPEYE)
304304            scrollx = -scrollx;
r1771r1772
344344      sx = 2*(spriteram[offs])-8;
345345      sy = 2*(256-spriteram[offs + 1]);
346346
347      if (flip_screen)
347      if (flip_screen_get())
348348      {
349349         flipx = !flipx;
350350         flipy = !flipy;
src/mame/video/taxidrvr.c
r1771r1772
2424
2525   if (taxidrvr_bghide)
2626   {
27      fillbitmap(bitmap,machine->pens[0],cliprect);
27      fillbitmap(bitmap,0,cliprect);
2828
2929
3030      /* kludge to fix scroll after death */
src/mame/video/lordgun.c
r1771r1772
294294   tilemap_set_scrollx( tilemap_3, 0, *lordgun_scroll_x_3 );
295295   tilemap_set_scrolly( tilemap_3, 0, *lordgun_scroll_y_3 );
296296
297   fillbitmap( bitmap, machine->pens[0], cliprect );
297   fillbitmap( bitmap, 0, cliprect );
298298
299299   if (layers_ctrl & 4)   tilemap_draw(bitmap, cliprect, tilemap_2, 0, 0);
300300   if (layers_ctrl & 1)   tilemap_draw(bitmap, cliprect, tilemap_0, 0, 0);
src/mame/video/hyperspt.c
r1771r1772
105105
106106WRITE8_HANDLER( hyperspt_flipscreen_w )
107107{
108   if (flip_screen != (data & 0x01))
108   if (flip_screen_get() != (data & 0x01))
109109   {
110110      flip_screen_set(data & 0x01);
111111      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
r1771r1772
141141      int flipx = ~spriteram[offs] & 0x40;
142142      int flipy = spriteram[offs] & 0x80;
143143
144      if (flip_screen)
144      if (flip_screen_get())
145145      {
146146         sy = 240 - sy;
147147         flipy = !flipy;
148148      }
149149
150      /* Note that this adjustment must be done AFTER handling flip_screen, thus */
150      /* Note that this adjustment must be done AFTER handling flip_screen_get(), thus */
151151      /* proving that this is a hardware related "feature" */
152152
153153      sy += 1;
r1771r1772
179179   for (row = 0; row < 32; row++)
180180   {
181181      int scrollx = hyperspt_scroll[row * 2] + (hyperspt_scroll[(row * 2) + 1] & 0x01) * 256;
182      if (flip_screen) scrollx = -scrollx;
182      if (flip_screen_get()) scrollx = -scrollx;
183183      tilemap_set_scrollx(bg_tilemap, row, scrollx);
184184   }
185185
src/mame/video/toaplan1.c
r1771r1772
11511151   toaplan1_log_vram();
11521152#endif
11531153
1154   fillbitmap(bitmap,machine->pens[0],cliprect);
1154   fillbitmap(bitmap,0,cliprect);
11551155
11561156   tilemap_draw(bitmap,cliprect,pf1_tilemap,TILEMAP_DRAW_OPAQUE | 0,0);
11571157   tilemap_draw(bitmap,cliprect,pf1_tilemap,TILEMAP_DRAW_OPAQUE | 1,0);
r1771r1772
11761176#endif
11771177
11781178   fillbitmap(priority_bitmap,0,cliprect);
1179   fillbitmap(bitmap,machine->pens[0x120],cliprect);
1179   fillbitmap(bitmap,0x120,cliprect);
11801180
11811181   tilemap_draw(bitmap,cliprect,pf4_tilemap,TILEMAP_DRAW_OPAQUE,0);
11821182   for (priority = 8; priority < 16; priority++)
r1771r1772
12031203#endif
12041204
12051205   fillbitmap(priority_bitmap,0,cliprect);
1206   fillbitmap(bitmap,machine->pens[0x120],cliprect);
1206   fillbitmap(bitmap,0x120,cliprect);
12071207
12081208   tilemap_draw(bitmap,cliprect,pf1_tilemap,TILEMAP_DRAW_OPAQUE | 0,0);
12091209   tilemap_draw(bitmap,cliprect,pf1_tilemap,TILEMAP_DRAW_OPAQUE | 1,0);
src/mame/video/tmnt.c
r1771r1772
653653   sortlayers(sorted_layer,layerpri);
654654
655655   fillbitmap(priority_bitmap,0,cliprect);
656   fillbitmap(bitmap,machine->pens[16 * bg_colorbase],cliprect);
656   fillbitmap(bitmap,16 * bg_colorbase,cliprect);
657657   tilemap_draw(bitmap,cliprect,K052109_tilemap[sorted_layer[0]],0,1);
658658   tilemap_draw(bitmap,cliprect,K052109_tilemap[sorted_layer[1]],0,2);
659659   tilemap_draw(bitmap,cliprect,K052109_tilemap[sorted_layer[2]],0,4);
r1771r1772
698698   /* not sure about the 053936 priority, but it seems to work */
699699
700700   fillbitmap(priority_bitmap,0,cliprect);
701   fillbitmap(bitmap,machine->pens[16 * bg_colorbase],cliprect);
701   fillbitmap(bitmap,16 * bg_colorbase,cliprect);
702702   tilemap_draw(bitmap,cliprect,K052109_tilemap[sorted_layer[0]],0,1);
703703   if (layerpri[0] >= 0x30 && layerpri[1] < 0x30)
704704   {
r1771r1772
793793   sortlayers(sorted_layer,layerpri);
794794
795795   fillbitmap(priority_bitmap,0,cliprect);
796   fillbitmap(bitmap,machine->pens[16 * bg_colorbase],cliprect);
796   fillbitmap(bitmap,16 * bg_colorbase,cliprect);
797797   tilemap_draw(bitmap,cliprect,K052109_tilemap[sorted_layer[0]],0,1);
798798   tilemap_draw(bitmap,cliprect,K052109_tilemap[sorted_layer[1]],0,2);
799799   tilemap_draw(bitmap,cliprect,K052109_tilemap[sorted_layer[2]],0,4);
src/mame/video/zodiack.c
r1771r1772
4646
4747WRITE8_HANDLER( zodiack_flipscreen_w )
4848{
49   if (flip_screen != (~data & 0x01))
49   if (flip_screen_get() != (~data & 0x01))
5050   {
5151      flip_screen_set(~data & 0x01);
5252      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
r1771r1772
130130   tilemap_set_transparent_pen(fg_tilemap, 0);
131131   tilemap_set_scroll_cols(fg_tilemap, 32);
132132
133   flip_screen = 0;
133   /* FIXME: flip_screen_x should not be written. */
134   flip_screen_set_no_update(0);
134135}
135136
136137static void draw_bullets(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
r1771r1772
144145      x = zodiack_bulletsram[offs + 3] + 7;
145146      y = 255 - zodiack_bulletsram[offs + 1];
146147
147      if (flip_screen && percuss_hardware)
148      if (flip_screen_get() && percuss_hardware)
148149      {
149150         y = 255 - y;
150151      }
r1771r1772
174175      flipy = spriteram[offs + 1] & 0x80;
175176      spritecode = spriteram[offs + 1] & 0x3f;
176177
177      if (flip_screen && percuss_hardware)
178      if (flip_screen_get() && percuss_hardware)
178179      {
179180         sy = 240 - sy;
180181         flipy = !flipy;
src/mame/video/pitnrun.c
r1771r1772
201201      flipy = (spriteram[offs+1]&0x80)>>7;
202202      flipx = (spriteram[offs+1]&0x40)>>6;
203203
204      if (flip_screen_x)
204      if (flip_screen_x_get())
205205      {
206206         sx = 256 - sx;
207207         flipx = !flipx;
208208      }
209      if (flip_screen_y)
209      if (flip_screen_y_get())
210210      {
211211         sy = 240 - sy;
212212         flipy = !flipy;
r1771r1772
256256      dx=128-pitnrun_h_heed+((pitnrun_ha&8)<<5)+3;
257257      dy=128-pitnrun_v_heed+((pitnrun_ha&0x10)<<4);
258258
259      if (flip_screen_x)
259      if (flip_screen_x_get())
260260         dx=128-dx+16;
261261
262      if (flip_screen_y)
262      if (flip_screen_y_get())
263263         dy=128-dy;
264264
265265      myclip.min_x=dx;
r1771r1772
280280   draw_sprites(machine,bitmap,&myclip);
281281
282282   if(pitnrun_ha&4)
283      copybitmap_trans(bitmap,tmp_bitmap[pitnrun_ha&3],flip_screen_x,flip_screen_y,dx,dy,&myclip, 1);
283      copybitmap_trans(bitmap,tmp_bitmap[pitnrun_ha&3],flip_screen_x_get(),flip_screen_y_get(),dx,dy,&myclip, 1);
284284   tilemap_draw(bitmap,cliprect,fg, 0,0);
285285   return 0;
286286}
src/mame/video/tehkanwc.c
r1771r1772
169169      int sx = spriteram[offs + 2] + ((attr & 0x20) << 3) - 128;
170170      int sy = spriteram[offs + 3];
171171
172      if (flip_screen_x)
172      if (flip_screen_x_get())
173173      {
174174         sx = 240 - sx;
175175         flipx = !flipx;
176176      }
177177
178      if (flip_screen_y)
178      if (flip_screen_y_get())
179179      {
180180         sy = 240 - sy;
181181         flipy = !flipy;
src/mame/video/bionicc.c
r1771r1772
199199         int sx = (INT16)buffered_spriteram16[offs+3];   /* signed */
200200         int sy = (INT16)buffered_spriteram16[offs+2];   /* signed */
201201         if(sy>512-16) sy-=512;
202         if (flip_screen)
202         if (flip_screen_get())
203203         {
204204            sx = 240 - sx;
205205            sy = 240 - sy;
src/mame/video/citycon.c
r1771r1772
120120      sx = spriteram[offs + 3];
121121      sy = 239 - spriteram[offs];
122122      flipx = ~spriteram[offs + 2] & 0x10;
123      if (flip_screen)
123      if (flip_screen_get())
124124      {
125125         sx = 240 - sx;
126126         sy = 238 - sy;
r1771r1772
130130      drawgfx(bitmap,machine->gfx[spriteram[offs + 1] & 0x80 ? 2 : 1],
131131            spriteram[offs + 1] & 0x7f,
132132            spriteram[offs + 2] & 0x0f,
133            flipx,flip_screen,
133            flipx,flip_screen_get(),
134134            sx,sy,
135135            cliprect,TRANSPARENCY_PEN,0);
136136   }
src/mame/video/spy.c
r1771r1772
7171   fillbitmap(priority_bitmap, 0, cliprect);
7272
7373   if (!spy_video_enable)
74      fillbitmap(bitmap,16 * layer_colorbase[0],cliprect);
75   else
7476   {
75      fillbitmap(bitmap,machine->pens[16 * layer_colorbase[0]],cliprect);
76      return 0;
77      tilemap_draw(bitmap,cliprect,K052109_tilemap[1],TILEMAP_DRAW_OPAQUE,1);
78      tilemap_draw(bitmap,cliprect,K052109_tilemap[2],0,2);
79      K051960_sprites_draw(bitmap,cliprect,-1,-1);
80      tilemap_draw(bitmap,cliprect,K052109_tilemap[0],0,0);
7781   }
7882
79   tilemap_draw(bitmap,cliprect,K052109_tilemap[1],TILEMAP_DRAW_OPAQUE,1);
80   tilemap_draw(bitmap,cliprect,K052109_tilemap[2],0,2);
81   K051960_sprites_draw(bitmap,cliprect,-1,-1);
82   tilemap_draw(bitmap,cliprect,K052109_tilemap[0],0,0);
8383   return 0;
8484}
src/mame/video/psikyo.c
r1771r1772
359359      zoomy = 32 - zoomy;
360360
361361
362      if (flip_screen)
362      if (flip_screen_get())
363363      {
364364         x = width  - x - (nx * zoomx)/2;
365365         y = height - y - (ny * zoomy)/2;
src/mame/video/playmark.c
r1771r1772
369369   }
370370}
371371
372static void draw_bitmap(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
372static void draw_bitmap(mame_bitmap *bitmap, const rectangle *cliprect)
373373{
374374   int x,y,count;
375375   int color;
r1771r1772
386386         {
387387            if(bg_full_size)
388388            {
389               *BITMAP_ADDR16(bitmap, (y + bgscrolly) & 0x1ff, (x + bgscrollx) & 0x1ff) = machine->pens[0x100 + color];
389               *BITMAP_ADDR16(bitmap, (y + bgscrolly) & 0x1ff, (x + bgscrollx) & 0x1ff) = 0x100 + color;
390390
391391               pri = BITMAP_ADDR8(priority_bitmap, (y + bgscrolly) & 0x1ff, 0);
392392               pri[(x + bgscrollx) & 0x1ff] |= 2;
r1771r1772
396396               /* 50% size */
397397               if(!(x % 2) && !(y % 2))
398398               {
399                  *BITMAP_ADDR16(bitmap, (y / 2 + bgscrolly) & 0x1ff, (x / 2 + bgscrollx) & 0x1ff) = machine->pens[0x100 + color];
399                  *BITMAP_ADDR16(bitmap, (y / 2 + bgscrolly) & 0x1ff, (x / 2 + bgscrollx) & 0x1ff) = 0x100 + color;
400400
401401                  pri = BITMAP_ADDR8(priority_bitmap, (y / 2 + bgscrolly) & 0x1ff, 0);
402402                  pri[(x / 2 + bgscrollx) & 0x1ff] |= 2;
r1771r1772
415415
416416   tilemap_draw(bitmap,cliprect,fg_tilemap,0,0);
417417   if (bg_enable)
418      draw_bitmap(machine, bitmap, cliprect);
418      draw_bitmap(bitmap, cliprect);
419419   draw_sprites(machine, bitmap,cliprect,4);
420420   tilemap_draw(bitmap,cliprect,tx_tilemap,0,0);
421421   return 0;
r1771r1772
427427
428428   tilemap_draw(bitmap,cliprect,fg_tilemap,0,1);
429429   if (bg_enable)
430      draw_bitmap(machine, bitmap, cliprect);
430      draw_bitmap(bitmap, cliprect);
431431   tilemap_draw(bitmap,cliprect,tx_tilemap,0,4);
432432   draw_sprites(machine,bitmap,cliprect,2);
433433   return 0;
src/mame/video/esd16.c
r1771r1772
215215      sy    =   0x100 - ((sy & 0xff)  - (sy & 0x100));
216216      sy   -=   dimy*16;
217217
218      if (flip_screen)
218      if (flip_screen_get())
219219      {   flipx = !flipx;      sx = max_x - sx -    1 * 16 + 2;   // small offset
220220         flipy = !flipy;      sy = max_y - sy - dimy * 16;   }
221221
r1771r1772
274274
275275      sy = 0x1ff-sy;
276276
277      if (flip_screen)
277      if (flip_screen_get())
278278      {   flipx = !flipx;      sx = max_x - sx -    1 * 16 + 2;   // small offset
279279         flipy = !flipy;      sy = max_y - sy - dimy * 16;   }
280280
r1771r1772
325325#endif
326326
327327   if (layers_ctrl & 1)   tilemap_draw(bitmap,cliprect,esdtilemap_0,0,0);
328   else               fillbitmap(bitmap,machine->pens[0],cliprect);
328   else               fillbitmap(bitmap,0,cliprect);
329329
330330   if (layers_ctrl & 2)   tilemap_draw(bitmap,cliprect,esdtilemap_1,0,1);
331331
r1771r1772
353353#endif
354354
355355   if (layers_ctrl & 1)   tilemap_draw(bitmap,cliprect,esdtilemap_0,0,0);
356   else               fillbitmap(bitmap,machine->pens[0],cliprect);
356   else               fillbitmap(bitmap,0,cliprect);
357357
358358   if (layers_ctrl & 2)
359359   {
src/mame/video/cbasebal.c
r1771r1772
176176   if (bg_on)
177177      tilemap_draw(bitmap,cliprect,bg_tilemap,0,0);
178178   else
179      fillbitmap(bitmap,machine->pens[768],cliprect);
179      fillbitmap(bitmap,768,cliprect);
180180
181181   if (obj_on)
182182      draw_sprites(machine, bitmap,cliprect);
src/mame/video/st0016.c
r1771r1772
635635      //super eagle shot
636636      int x,y,dy;
637637
638      fillbitmap(speglsht_bitmap,machine->pens[0],&machine->screen[0].visarea);
638      fillbitmap(speglsht_bitmap,0,&machine->screen[0].visarea);
639639      dy=(speglsht_videoreg&0x20)?(256*512):0; //visible frame
640640
641641      for(y=0;y<256;y++)
r1771r1772
676676         }
677677      }
678678
679      fillbitmap(bitmap,machine->pens[UNUSED_PEN],&machine->screen[0].visarea);
679      fillbitmap(bitmap,UNUSED_PEN,&machine->screen[0].visarea);
680680      draw_bgmap(machine, bitmap,cliprect,0);
681681       draw_sprites(machine, bitmap,cliprect);
682682      draw_bgmap(machine, bitmap,cliprect,1);
src/mame/video/sbasketb.c
r1771r1772
112112
113113WRITE8_HANDLER( sbasketb_flipscreen_w )
114114{
115   if (flip_screen != data)
115   if (flip_screen_get() != data)
116116   {
117117      flip_screen_set(data);
118118      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
r1771r1772
152152         int flipx =  spriteram[offs + 1] & 0x40;
153153         int flipy =  spriteram[offs + 1] & 0x80;
154154
155         if (flip_screen)
155         if (flip_screen_get())
156156         {
157157            sx = 240 - sx;
158158            sy = 240 - sy;
src/mame/video/funkyjet.c
r1771r1772
5454         inc = 1;
5555      }
5656
57      if (flip_screen)
57      if (flip_screen_get())
5858      {
5959         y=240-y;
6060         x=304-x;
r1771r1772
8383   flip_screen_set( deco16_pf12_control[0]&0x80 );
8484   deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll);
8585
86   fillbitmap(bitmap,machine->pens[768],cliprect);
86   fillbitmap(bitmap,768,cliprect);
8787   deco16_tilemap_2_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0);
8888   deco16_tilemap_1_draw(bitmap,cliprect,0,0);
8989   draw_sprites(machine,bitmap,cliprect);
src/mame/video/qix.c
r1771r1772
3131                     UINT8 ra,
3232                     UINT16 y,
3333                     UINT8 x_count,
34                     INT8 cursor_x,
3435                     void *param);
3536
3637
r1771r1772
5354
5455   /* set up save states */
5556   state_save_register_global_pointer(state->videoram, 256 * 256);
56   state_save_register_global(state->flip_screen);
57   state_save_register_global(state->flip);
5758   state_save_register_global(state->palette_bank);
5859   state_save_register_global(state->leds);
5960}
r1771r1772
9394{
9495   qix_state *state = Machine->driver_data;
9596
96   state->flip_screen = data;
97   state->flip = data;
9798}
9899
99100
r1771r1772
353354
354355
355356static void qix_update_row(running_machine *machine, mc6845_t *mc6845, mame_bitmap *bitmap, const rectangle *cliprect,
356                     UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, void *param)
357                     UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param)
357358{
358359   qix_state *state = machine->driver_data;
359360   UINT16 x;
r1771r1772
363364
364365   /* the memory is hooked up to the MA, RA lines this way */
365366   offs_t offs = ((ma << 6) & 0xf800) | ((ra << 8) & 0x0700);
366   offs_t offs_xor = state->flip_screen ? 0xffff : 0;
367   offs_t offs_xor = state->flip ? 0xffff : 0;
367368
368369   for (x = 0; x < x_count * 8; x++)
369370      scanline[x] = state->videoram[(offs + x) ^ offs_xor];
src/mame/video/ksayakyu.c
r1771r1772
107107
108108VIDEO_UPDATE(ksayakyu)
109109{
110   fillbitmap(bitmap,machine->pens[0],cliprect);
110   fillbitmap(bitmap,0,cliprect);
111111   if(video_ctrl&1)
112112      tilemap_draw(bitmap,cliprect,ksayakyu_tilemap,0,0);
113113   draw_sprites(machine,bitmap,cliprect);
src/mame/video/ironhors.c
r1771r1772
124124
125125WRITE8_HANDLER( ironhors_flipscreen_w )
126126{
127   if (flip_screen != (~data & 0x08))
127   if (flip_screen_get() != (~data & 0x08))
128128   {
129129      flip_screen_set(~data & 0x08);
130130      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
r1771r1772
170170      int flipy = sr[offs+4] & 0x40;
171171      int code = (sr[offs] << 2) + ((sr[offs+1] & 0x03) << 10) + ((sr[offs+1] & 0x0c) >> 2);
172172      int color = ((sr[offs+1] & 0xf0)>>4) + 16 * palettebank;
173   //  int mod = flip_screen ? -8 : 8;
173   //  int mod = flip_screen_get() ? -8 : 8;
174174
175      if (flip_screen)
175      if (flip_screen_get())
176176      {
177177         sx = 240 - sx;
178178         sy = 240 - sy;
r1771r1772
193193
194194         case 0x04:   /* 16x8 */
195195            {
196               if (flip_screen) sy += 8; // this fixes the train wheels' position
196               if (flip_screen_get()) sy += 8; // this fixes the train wheels' position
197197
198198               drawgfx(bitmap,machine->gfx[2],
199199                     code & ~1,
src/mame/video/battlex.c
r1771r1772
6161
6262   /* bit 7 is flip screen */
6363
64   if (flip_screen != (data & 0x80))
64   if (flip_screen_get() != (data & 0x80))
6565   {
6666      flip_screen_set(data & 0x80);
6767      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
r1771r1772
9797      int flipy = source[1] & 0x80;
9898      int flipx = source[1] & 0x40;
9999
100      if (flip_screen)
100      if (flip_screen_get())
101101      {
102102         sx = 240 - sx;
103103         sy = 240 - sy;
src/mame/video/snes.c
r1771r1772
14431443             * Stop drawing if exceeded 32 objects and
14441444             * enforcing that limit is enabled */
14451445         range_over++;
1446         if( range_over == 32 && (readinputport( 16 ) & 0x10) )
1446         if( range_over == 32 ) //&& (readinputport( 16 ) & 0x10) )
14471447         {
14481448            /* Set the flag in STAT77 register */
14491449            snes_ram[STAT77] |= 0x40;
src/mame/video/toaplan2.c
r1771r1772
14311431   mark_sprite_priority(0);
14321432   mark_tile_priority(0);
14331433
1434   fillbitmap(bitmap,machine->pens[0],cliprect);
1434   fillbitmap(bitmap,0,cliprect);
14351435
14361436   for (priority = 0; priority < 16; priority++)
14371437   {
r1771r1772
14581458   mark_tile_priority(0);
14591459   mark_tile_priority(1);
14601460
1461   fillbitmap(bitmap,machine->pens[0],cliprect);
1461   fillbitmap(bitmap,0,cliprect);
14621462
14631463   for (priority = 0; priority < 16; priority++)
14641464   {
r1771r1772
14931493   mark_tile_priority(0);
14941494   mark_tile_priority(1);
14951495
1496   fillbitmap(bitmap,machine->pens[0],cliprect);
1496   fillbitmap(bitmap,0,cliprect);
14971497
14981498   for (priority = 0; priority < 16; priority++)
14991499   {
r1771r1772
15461546      objectbank_dirty = 0;
15471547   }
15481548
1549   fillbitmap(bitmap,machine->pens[0],cliprect);
1549   fillbitmap(bitmap,0,cliprect);
15501550
15511551   for (priority = 0; priority < 16; priority++)
15521552   {
r1771r1772
15851585   mark_sprite_priority(0);
15861586   mark_tile_priority(0);
15871587
1588   fillbitmap(bitmap,machine->pens[0],cliprect);
1588   fillbitmap(bitmap,0,cliprect);
15891589
15901590   if (bg_tile_priority[0][0]) tilemap_draw(bitmap,cliprect,bg_tilemap[0],0,0);
15911591   if (fg_tile_priority[0][0]) tilemap_draw(bitmap,cliprect,fg_tilemap[0],0,0);
src/mame/video/mjkjidai.c
r1771r1772
104104
105105      sx += (spriteram_2[offs] & 0x20) >> 5;   // not sure about this
106106
107      if (flip_screen)
107      if (flip_screen_get())
108108      {
109109         sx = 496 - sx;
110110         sy = 240 - sy;
src/mame/video/jailbrek.c
r1771r1772
8080      int sx = spriteram[i + 2] - ((attr & 0x80) << 1);
8181      int sy = spriteram[i + 3];
8282
83      if (flip_screen)
83      if (flip_screen_get())
8484      {
8585         sx = 240 - sx;
8686         sy = 240 - sy;
src/mame/video/gaelco.c
r1771r1772
196196   tilemap_set_scrollx(pant[1], 0, gaelco_vregs[3]);
197197
198198   fillbitmap(priority_bitmap,0,cliprect);
199   fillbitmap( bitmap, machine->pens[0], cliprect );
199   fillbitmap( bitmap, 0, cliprect );
200200
201201   tilemap_draw(bitmap,cliprect,pant[1],3,0);
202202   tilemap_draw(bitmap,cliprect,pant[0],3,0);
r1771r1772
223223   tilemap_set_scrollx(pant[1], 0, gaelco_vregs[3]);
224224
225225   fillbitmap(priority_bitmap,0,cliprect);
226   fillbitmap( bitmap, machine->pens[0], cliprect );
226   fillbitmap( bitmap, 0, cliprect );
227227
228228   tilemap_draw(bitmap,cliprect,pant[1],TILEMAP_DRAW_LAYER1 | 3,0);
229229   tilemap_draw(bitmap,cliprect,pant[0],TILEMAP_DRAW_LAYER1 | 3,0);
src/mame/video/bankp.c
r1771r1772
166166
167167VIDEO_UPDATE( bankp )
168168{
169   if (flip_screen)
169   if (flip_screen_get())
170170   {
171171      tilemap_set_scrollx(fg_tilemap, 0, -scroll_x);
172172      tilemap_set_scrollx(bg_tilemap, 0, 0);
src/mame/video/pastelg.c
r1771r1772
1818static int pastelg_dispflag;
1919static int pastelg_flipscreen;
2020static int blitter_direction_x, blitter_direction_y;
21static int pastelg_screen_refresh;
2221static int pastelg_palbank;
2322
24static mame_bitmap *pastelg_tmpbitmap;
2523static UINT8 *pastelg_videoram;
2624static UINT8 *pastelg_clut;
2725
r1771r1772
137135   }
138136
139137   pastelg_flipscreen_old = pastelg_flipscreen;
140   pastelg_screen_refresh = 1;
141138}
142139
143static void update_pixel(int x,int y)
144{
145   int color = pastelg_videoram[(y * Machine->screen[0].width) + x];
146   *BITMAP_ADDR16(pastelg_tmpbitmap, y, x) = color;
147}
148
149140static TIMER_CALLBACK( blitter_timer_callback )
150141{
151142   nb1413m3_busyflag = 1;
r1771r1772
239230            {
240231               color = ((pastelg_palbank * 0x10) + color);
241232               pastelg_videoram[(dy * Machine->screen[0].width) + dx] = color;
242               update_pixel(dx, dy);
243233            }
244234         }
245235         else
246236         {
247237            color = ((pastelg_palbank * 0x10) + pastelg_clut[color]);
248238            pastelg_videoram[(dy * Machine->screen[0].width) + dx] = color;
249            update_pixel(dx, dy);
250239         }
251240
252241         nb1413m3_busyctr++;
r1771r1772
263252******************************************************************************/
264253VIDEO_START( pastelg )
265254{
266   pastelg_tmpbitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height,machine->screen[0].format);
267255   pastelg_videoram = auto_malloc(machine->screen[0].width * machine->screen[0].height * sizeof(UINT8));
268256   pastelg_clut = auto_malloc(0x10 * sizeof(UINT8));
269257   memset(pastelg_videoram, 0x00, (machine->screen[0].width * machine->screen[0].height * sizeof(UINT8)));
r1771r1772
275263******************************************************************************/
276264VIDEO_UPDATE( pastelg )
277265{
278   int x, y;
279   UINT8 color;
280
281   if (pastelg_screen_refresh)
266   if (pastelg_dispflag)
282267   {
283      pastelg_screen_refresh = 0;
268      int x, y;
284269
285270      for (y = 0; y < machine->screen[0].height; y++)
286      {
287271         for (x = 0; x < machine->screen[0].width; x++)
288         {
289            color = pastelg_videoram[(y * machine->screen[0].width) + x];
290            *BITMAP_ADDR16(pastelg_tmpbitmap, y, x) = machine->pens[color];
291         }
292      }
272            *BITMAP_ADDR16(bitmap, y, x) = pastelg_videoram[(y * machine->screen[0].width) + x];
293273   }
294
295   if (pastelg_dispflag)
296      copybitmap(bitmap, pastelg_tmpbitmap, 0, 0, 0, 0, cliprect);
297274   else
298      fillbitmap(bitmap, machine->pens[0x00], 0);
275      fillbitmap(bitmap, 0, cliprect);
299276
300277   return 0;
301278}
src/mame/video/crbaloon.c
r1771r1772
108108   UINT8 *gfx = memory_region(REGION_GFX2) + (code << 7);
109109
110110
111   if (flip_screen)
111   if (flip_screen_get())
112112      sy += 32;
113113
114114   /* assume no collision */
src/mame/video/bosco.c
r1771r1772
222222      int flipx = spriteram[offs] & 1;
223223      int flipy = spriteram[offs] & 2;
224224      int color = spriteram_2[offs + 1] & 0x3f;
225      if (flip_screen) sx += 32-2;
225      if (flip_screen_get()) sx += 32-2;
226226
227227      drawgfx(bitmap,machine->gfx[1],
228228            (spriteram[offs] & 0xfc) >> 2,
r1771r1772
245245
246246      x = bosco_radarx[offs] + ((~bosco_radarattr[offs] & 0x01) << 8);
247247      y = 253 - bosco_radary[offs];
248      if (flip_screen) x -= 3;
248      if (flip_screen_get()) x -= 3;
249249
250250      drawgfx(bitmap,machine->gfx[2],
251251            ((bosco_radarattr[offs] & 0x0e) >> 1) ^ 0x07,
r1771r1772
280280            /* dont draw the stars that are off the screen */
281281            if ( x < 224 && y < 224 )
282282            {
283               if (flip_screen) x += 64;
283               if (flip_screen_get()) x += 64;
284284
285285               if (y >= machine->screen[0].visarea.min_y && y <= machine->screen[0].visarea.max_y)
286286                  *BITMAP_ADDR16(bitmap, y, x) = STARS_COLOR_BASE + star_seed_tab[star_cntr].col;
r1771r1772
297297       the screen, and clip it to only the position where it is supposed to be shown */
298298   rectangle fg_clip = *cliprect;
299299   rectangle bg_clip = *cliprect;
300   if (flip_screen)
300   if (flip_screen_get())
301301   {
302302      bg_clip.min_x = 8*8;
303303      fg_clip.max_x = 8*8-1;
src/mame/video/funkybee.c
r1771r1772
6565
6666WRITE8_HANDLER( funkybee_scroll_w )
6767{
68   tilemap_set_scrollx(bg_tilemap, 0, flip_screen ? -data : data);
68   tilemap_set_scrollx(bg_tilemap, 0, flip_screen_get() ? -data : data);
6969}
7070
7171WRITE8_HANDLER( funkybee_flipscreen_w )
r1771r1772
108108      int sx = videoram[offs2 + 0x10];
109109      int sy = 224 - colorram[offs2];
110110
111      if (flip_screen)
111      if (flip_screen_get())
112112      {
113113         sy += 32;
114114         flipx = !flipx;
r1771r1772
133133      int sx = videoram[0x1f10];
134134      int sy = offs * 8;
135135
136      if (flip_screen)
136      if (flip_screen_get())
137137      {
138138         sx = 248 - sx;
139139         sy = 248 - sy;
r1771r1772
141141
142142      drawgfx(bitmap,machine->gfx[gfx_bank],
143143            code, color,
144            flip_screen, flip_screen,
144            flip_screen_get(), flip_screen_get(),
145145            sx, sy,
146146            cliprect,TRANSPARENCY_PEN,0);
147147
r1771r1772
150150      sx = videoram[0x1f11];
151151      sy = offs * 8;
152152
153      if (flip_screen)
153      if (flip_screen_get())
154154      {
155155         sx = 248 - sx;
156156         sy = 248 - sy;
r1771r1772
158158
159159      drawgfx(bitmap,machine->gfx[gfx_bank],
160160            code, color,
161            flip_screen, flip_screen,
161            flip_screen_get(), flip_screen_get(),
162162            sx, sy,
163163            cliprect,TRANSPARENCY_PEN,0);
164164   }
src/mame/video/lastduel.c
r1771r1772
214214      flipy = attr & sprite_flipy_mask;   /* 0x40 for lastduel, 0x80 for madgear */
215215      color = attr & 0x0f;
216216
217      if (flip_screen)
217      if (flip_screen_get())
218218      {
219219         sx = 496 - sx;
220220         sy = 240 - sy;
src/mame/video/cischeat.c
r1771r1772
11731173   cischeat_tmap_SET_SCROLL(1)
11741174   cischeat_tmap_SET_SCROLL(2)
11751175
1176   fillbitmap(bitmap,machine->pens[0],cliprect);
1176   fillbitmap(bitmap,0,cliprect);
11771177
11781178   for (i = 7; i >= 4; i--)
11791179   {                                 /* bitmap, road, min_priority, max_priority, transparency */
r1771r1772
12261226   cischeat_tmap_SET_SCROLL(1)
12271227   cischeat_tmap_SET_SCROLL(2)
12281228
1229   fillbitmap(bitmap,machine->pens[0],cliprect);
1229   fillbitmap(bitmap,0,cliprect);
12301230
12311231                              /* bitmap, road, priority, transparency */
12321232   if (megasys1_active_layers & 0x10)   cischeat_draw_road(machine,bitmap,cliprect,0,7,5,TRANSPARENCY_NONE);
r1771r1772
12341234
12351235   flag = 0;
12361236   cischeat_tmap_DRAW(0)
1237//  else fillbitmap(bitmap,machine->pens[0],cliprect);
1237//  else fillbitmap(bitmap,0,cliprect);
12381238   cischeat_tmap_DRAW(1)
12391239
12401240   if (megasys1_active_layers & 0x08)   cischeat_draw_sprites(machine,bitmap,cliprect,15,3);
r1771r1772
12821282   cischeat_tmap_SET_SCROLL(1)
12831283   cischeat_tmap_SET_SCROLL(2)
12841284
1285   fillbitmap(bitmap,machine->pens[0],cliprect);
1285   fillbitmap(bitmap,0,cliprect);
12861286
12871287/*  1: clouds 5, grad 7, road 0     2: clouds 5, grad 7, road 0, tunnel roof 0 */
12881288
r1771r1772
12921292
12931293   flag = 0;
12941294   cischeat_tmap_DRAW(0)
1295//  else fillbitmap(bitmap,machine->pens[0],cliprect);
1295//  else fillbitmap(bitmap,0,cliprect);
12961296   cischeat_tmap_DRAW(1)
12971297
12981298   /* road 1!! 0!! */               /* bitmap, road, min_priority, max_priority, transparency */
r1771r1772
13611361//  cischeat_tmap_SET_SCROLL(1)
13621362   cischeat_tmap_SET_SCROLL(2)
13631363
1364   fillbitmap(bitmap,machine->pens[0],cliprect);
1364   fillbitmap(bitmap,0,cliprect);
13651365
13661366   flag = 0;
13671367   cischeat_tmap_DRAW(0)
1368//  else fillbitmap(bitmap,machine->pens[0],cliprect);
1368//  else fillbitmap(bitmap,0,cliprect);
13691369//  cischeat_tmap_DRAW(1)
13701370   if (megasys1_active_layers & 0x08)   cischeat_draw_sprites(machine,bitmap,cliprect,0,15);
13711371   cischeat_tmap_DRAW(2)
src/mame/video/freekick.c
r1771r1772
4444      int flipy = 0;
4545      int color = spriteram[offs + 1] & 0x1f;
4646
47      if (flip_screen_x)
47      if (flip_screen_x_get())
4848      {
4949         xpos = 240 - xpos;
5050         flipx = !flipx;
5151      }
52      if (flip_screen_y)
52      if (flip_screen_y_get())
5353      {
5454         ypos = 256 - ypos;
5555         flipy = !flipy;
r1771r1772
7979      int flipy = 0;//spriteram[offs + 0] & 0x40;
8080      int color = spriteram[offs + 1] & 0x0f;
8181
82      if (flip_screen_x)
82      if (flip_screen_x_get())
8383      {
8484         xpos = 240 - xpos;
8585         flipx = !flipx;
8686      }
87      if (flip_screen_y)
87      if (flip_screen_y_get())
8888      {
8989         ypos = 256 - ypos;
9090         flipy = !flipy;
r1771r1772
115115      int flipy = spriteram[offs + 2] & 0x40;
116116      int color = spriteram[offs + 2] & 0x1f;
117117
118      if (flip_screen_x)
118      if (flip_screen_x_get())
119119      {
120120         xpos = 240 - xpos;
121121         flipx = !flipx;
122122      }
123      if (flip_screen_y)
123      if (flip_screen_y_get())
124124      {
125125         ypos = 256 - ypos;
126126         flipy = !flipy;
src/mame/video/redclash.c
r1771r1772
260260   }
261261}
262262
263static void draw_bullets(const pen_t *pens, mame_bitmap *bitmap, const rectangle *cliprect )
263static void draw_bullets(mame_bitmap *bitmap, const rectangle *cliprect )
264264{
265265   int offs;
266266
r1771r1772
270270      int sx = 8 * offs + (videoram[offs] & 0x07);   /* ?? */
271271      int sy = 0xff - videoram[offs + 0x20];
272272
273      if (flip_screen)
273      if (flip_screen_get())
274274      {
275275         sx = 240 - sx;
276276      }
277277
278278      if (sx >= cliprect->min_x && sx <= cliprect->max_x &&
279279         sy >= cliprect->min_y && sy <= cliprect->max_y)
280         *BITMAP_ADDR16(bitmap, sy, sx) = pens[0x19];
280         *BITMAP_ADDR16(bitmap, sy, sx) = 0x19;
281281   }
282282}
283283
r1771r1772
357357/* Space Raider doesn't use the Va bit, and it is also set up to */
358358/* window the stars to a certain x range */
359359
360void redclash_draw_stars(const pen_t *pens, mame_bitmap *bitmap, const rectangle *cliprect, UINT8 palette_offset, UINT8 sraider, UINT8 firstx, UINT8 lastx)
360void redclash_draw_stars(mame_bitmap *bitmap, const rectangle *cliprect, UINT8 palette_offset, UINT8 sraider, UINT8 firstx, UINT8 lastx)
361361{
362362   int i;
363363   UINT8 tempbit, feedback, star_color, xloc, yloc;
r1771r1772
403403               if ((xloc>=firstx) && (xloc<=lastx))
404404               {
405405                  star_color = (state >> 9) & 0x1f;
406                  *BITMAP_ADDR16(bitmap, yloc, xloc) = pens[palette_offset+star_color];
406                  *BITMAP_ADDR16(bitmap, yloc, xloc) = palette_offset+star_color;
407407               }
408408            }
409409         }
r1771r1772
422422VIDEO_UPDATE( redclash )
423423{
424424   fillbitmap(bitmap, get_black_pen(machine), cliprect);
425   redclash_draw_stars(machine->pens, bitmap, cliprect, 0x60, 0, 0x00, 0xff);
425   redclash_draw_stars(bitmap, cliprect, 0x60, 0, 0x00, 0xff);
426426   draw_sprites(machine, bitmap, cliprect);
427   draw_bullets(machine->pens, bitmap, cliprect);
427   draw_bullets(bitmap, cliprect);
428428   tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
429429   return 0;
430430}
src/mame/video/flyball.c
r1771r1772
7979   /* draw ball */
8080
8181   for (y = bally; y < bally + 2; y++)
82   {
8382      for (x = ballx; x < ballx + 2; x++)
84      {
8583         if (x >= machine->screen[0].visarea.min_x &&
8684             x <= machine->screen[0].visarea.max_x &&
8785             y >= machine->screen[0].visarea.min_y &&
8886             y <= machine->screen[0].visarea.max_y)
89         {
90            *BITMAP_ADDR16(bitmap, y, x) = machine->pens[1];
91         }
92      }
93   }
87            *BITMAP_ADDR16(bitmap, y, x) = 1;
9488   return 0;
9589}
src/mame/video/rockola.c
r1771r1772
155155
156156   /* bit 7 flips screen */
157157
158   if (flip_screen != (data & 0x80))
158   if (flip_screen_get() != (data & 0x80))
159159   {
160160      flip_screen_set(data & 0x80);
161161      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
r1771r1772
265265{
266266   /* bit 0 flips screen */
267267
268   if (flip_screen != (data & 0x01))
268   if (flip_screen_get() != (data & 0x01))
269269   {
270270      flip_screen_set(data & 0x01);
271271      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
src/mame/video/wgp.c
r1771r1772
701701
702702   TC0100SCN_tilemap_update(machine);
703703
704   fillbitmap(bitmap, machine->pens[0], cliprect);
704   fillbitmap(bitmap, 0, cliprect);
705705
706706   layer[0] = 0;
707707   layer[1] = 1;
src/mame/video/sprint8.c
r1771r1772
182182
183183   tilemap_draw(helper2, &machine->screen[0].visarea, tilemap2, 0, 0);
184184
185   fillbitmap(helper1, machine->pens[0x20], &machine->screen[0].visarea);
185   fillbitmap(helper1, 0x20, &machine->screen[0].visarea);
186186
187187   draw_sprites(machine, helper1, &machine->screen[0].visarea);
188188
src/mame/video/dec0.c
r1771r1772
191191         inc = 1;
192192      }
193193
194      if (flip_screen) {
194      if (flip_screen_get()) {
195195         y=240-y;
196196         x=240-x;
197197         if (fx) fx=0; else fx=1;
r1771r1772
216216
217217/******************************************************************************/
218218
219static void custom_tilemap_draw(running_machine* machine,
220                        mame_bitmap *bitmap,
219static void custom_tilemap_draw(mame_bitmap *bitmap,
221220                        const rectangle *cliprect,
222221                        tilemap *tilemap_ptr,
223222                        const UINT16 *rowscroll_ptr,
r1771r1772
257256    doesn't affect any games.
258257    */
259258
260   if (flip_screen)
259   if (flip_screen_get())
261260      src_y = (src_bitmap->height - 256) - scrolly;
262261   else
263262      src_y = scrolly;
r1771r1772
268267      else
269268         src_x=scrollx;
270269
271      if (flip_screen)
270      if (flip_screen_get())
272271         src_x=(src_bitmap->width - 256) - src_x;
273272
274273      for (x=0; x<=cliprect->max_x; x++) {
r1771r1772
284283            {
285284               /* Top 8 pens of top 8 palettes only */
286285               if ((p&0x88)==0x88)
287                  *BITMAP_ADDR16(bitmap, y, x) = machine->pens[p];
286                  *BITMAP_ADDR16(bitmap, y, x) = p;
288287            }
289288            else
290            {
291               *BITMAP_ADDR16(bitmap, y, x) = machine->pens[p];
292            }
289               *BITMAP_ADDR16(bitmap, y, x) = p;
293290         }
294291      }
295292      src_y++;
r1771r1772
298295
299296/******************************************************************************/
300297
301static void dec0_pf1_draw(running_machine* machine,mame_bitmap *bitmap,const rectangle *cliprect,int flags)
298static void dec0_pf1_draw(mame_bitmap *bitmap,const rectangle *cliprect,int flags)
302299{
303300   switch (dec0_pf1_control_0[3]&0x3) {
304301      case 0:   /* 4x1 */
305         custom_tilemap_draw(machine,bitmap,cliprect,pf1_tilemap_0,dec0_pf1_rowscroll,dec0_pf1_colscroll,dec0_pf1_control_0,dec0_pf1_control_1,flags);
302         custom_tilemap_draw(bitmap,cliprect,pf1_tilemap_0,dec0_pf1_rowscroll,dec0_pf1_colscroll,dec0_pf1_control_0,dec0_pf1_control_1,flags);
306303         break;
307304      case 1:   /* 2x2 */
308305      default:
309         custom_tilemap_draw(machine,bitmap,cliprect,pf1_tilemap_1,dec0_pf1_rowscroll,dec0_pf1_colscroll,dec0_pf1_control_0,dec0_pf1_control_1,flags);
306         custom_tilemap_draw(bitmap,cliprect,pf1_tilemap_1,dec0_pf1_rowscroll,dec0_pf1_colscroll,dec0_pf1_control_0,dec0_pf1_control_1,flags);
310307         break;
311308      case 2:   /* 1x4 */
312         custom_tilemap_draw(machine,bitmap,cliprect,pf1_tilemap_2,dec0_pf1_rowscroll,dec0_pf1_colscroll,dec0_pf1_control_0,dec0_pf1_control_1,flags);
309         custom_tilemap_draw(bitmap,cliprect,pf1_tilemap_2,dec0_pf1_rowscroll,dec0_pf1_colscroll,dec0_pf1_control_0,dec0_pf1_control_1,flags);
313310         break;
314311   };
315312}
316313
317static void dec0_pf2_draw(running_machine* machine,mame_bitmap *bitmap,const rectangle *cliprect,int flags)
314static void dec0_pf2_draw(mame_bitmap *bitmap,const rectangle *cliprect,int flags)
318315{
319316   switch (dec0_pf2_control_0[3]&0x3) {
320317      case 0:   /* 4x1 */
321         custom_tilemap_draw(machine,bitmap,cliprect,pf2_tilemap_0,dec0_pf2_rowscroll,dec0_pf2_colscroll,dec0_pf2_control_0,dec0_pf2_control_1,flags);
318         custom_tilemap_draw(bitmap,cliprect,pf2_tilemap_0,dec0_pf2_rowscroll,dec0_pf2_colscroll,dec0_pf2_control_0,dec0_pf2_control_1,flags);
322319         break;
323320      case 1:   /* 2x2 */
324321      default:
325         custom_tilemap_draw(machine,bitmap,cliprect,pf2_tilemap_1,dec0_pf2_rowscroll,dec0_pf2_colscroll,dec0_pf2_control_0,dec0_pf2_control_1,flags);
322         custom_tilemap_draw(bitmap,cliprect,pf2_tilemap_1,dec0_pf2_rowscroll,dec0_pf2_colscroll,dec0_pf2_control_0,dec0_pf2_control_1,flags);
326323         break;
327324      case 2:   /* 1x4 */
328         custom_tilemap_draw(machine,bitmap,cliprect,pf2_tilemap_2,dec0_pf2_rowscroll,dec0_pf2_colscroll,dec0_pf2_control_0,dec0_pf2_control_1,flags);
325         custom_tilemap_draw(bitmap,cliprect,pf2_tilemap_2,dec0_pf2_rowscroll,dec0_pf2_colscroll,dec0_pf2_control_0,dec0_pf2_control_1,flags);
329326         break;
330327   };
331328}
332329
333static void dec0_pf3_draw(running_machine* machine,mame_bitmap *bitmap,const rectangle *cliprect,int flags)
330static void dec0_pf3_draw(mame_bitmap *bitmap,const rectangle *cliprect,int flags)
334331{
335332   switch (dec0_pf3_control_0[3]&0x3) {
336333      case 0:   /* 4x1 */
337         custom_tilemap_draw(machine,bitmap,cliprect,pf3_tilemap_0,dec0_pf3_rowscroll,dec0_pf3_colscroll,dec0_pf3_control_0,dec0_pf3_control_1,flags);
334         custom_tilemap_draw(bitmap,cliprect,pf3_tilemap_0,dec0_pf3_rowscroll,dec0_pf3_colscroll,dec0_pf3_control_0,dec0_pf3_control_1,flags);
338335         break;
339336      case 1:   /* 2x2 */
340337      default:
341         custom_tilemap_draw(machine,bitmap,cliprect,pf3_tilemap_1,dec0_pf3_rowscroll,dec0_pf3_colscroll,dec0_pf3_control_0,dec0_pf3_control_1,flags);
338         custom_tilemap_draw(bitmap,cliprect,pf3_tilemap_1,dec0_pf3_rowscroll,dec0_pf3_colscroll,dec0_pf3_control_0,dec0_pf3_control_1,flags);
342339         break;
343340      case 2:   /* 1x4 */
344         custom_tilemap_draw(machine,bitmap,cliprect,pf3_tilemap_2,dec0_pf3_rowscroll,dec0_pf3_colscroll,dec0_pf3_control_0,dec0_pf3_control_1,flags);
341         custom_tilemap_draw(bitmap,cliprect,pf3_tilemap_2,dec0_pf3_rowscroll,dec0_pf3_colscroll,dec0_pf3_control_0,dec0_pf3_control_1,flags);
345342         break;
346343   };
347344}
r1771r1772
352349{
353350   flip_screen_set(dec0_pf1_control_0[0]&0x80);
354351
355   dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
352   dec0_pf3_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
356353   draw_sprites(machine,bitmap,cliprect,0x08,0x08);
357   dec0_pf2_draw(machine,bitmap,cliprect,0);
354   dec0_pf2_draw(bitmap,cliprect,0);
358355
359356   /* HB always keeps pf2 on top of pf3, no need explicitly support priority register */
360357
361358   draw_sprites(machine,bitmap,cliprect,0x08,0x00);
362   dec0_pf1_draw(machine,bitmap,cliprect,0);
359   dec0_pf1_draw(bitmap,cliprect,0);
363360   return 0;
364361}
365362
r1771r1772
372369   /* WARNING: inverted wrt Midnight Resistance */
373370   if ((dec0_pri & 0x01) == 0)
374371   {
375      dec0_pf2_draw(machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
376      dec0_pf3_draw(machine,bitmap,cliprect,0);
372      dec0_pf2_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
373      dec0_pf3_draw(bitmap,cliprect,0);
377374
378375      if (dec0_pri & 2)
379         dec0_pf2_draw(machine,bitmap,cliprect,TILEMAP_DRAW_LAYER0); /* Foreground pens only */
376         dec0_pf2_draw(bitmap,cliprect,TILEMAP_DRAW_LAYER0); /* Foreground pens only */
380377
381378      draw_sprites(machine,bitmap,cliprect,0x00,0x00);
382379
383380      if (dec0_pri & 4)
384         dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_DRAW_LAYER0); /* Foreground pens only */
381         dec0_pf3_draw(bitmap,cliprect,TILEMAP_DRAW_LAYER0); /* Foreground pens only */
385382   }
386383   else
387384   {
388      dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
389      dec0_pf2_draw(machine,bitmap,cliprect,0);
385      dec0_pf3_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
386      dec0_pf2_draw(bitmap,cliprect,0);
390387
391388      if (dec0_pri & 2)
392         dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_DRAW_LAYER0); /* Foreground pens only */
389         dec0_pf3_draw(bitmap,cliprect,TILEMAP_DRAW_LAYER0); /* Foreground pens only */
393390
394391      draw_sprites(machine,bitmap,cliprect,0x00,0x00);
395392
396393      if (dec0_pri & 4)
397         dec0_pf2_draw(machine,bitmap,cliprect,TILEMAP_DRAW_LAYER0); /* Foreground pens only */
394         dec0_pf2_draw(bitmap,cliprect,TILEMAP_DRAW_LAYER0); /* Foreground pens only */
398395   }
399396
400   dec0_pf1_draw(machine,bitmap,cliprect,0);
397   dec0_pf1_draw(bitmap,cliprect,0);
401398   return 0;
402399}
403400
r1771r1772
420417      /* Robocop uses it only for the title screen, so this might be just */
421418      /* completely wrong. The top 8 bits of the register might mean */
422419      /* something (they are 0x80 in midres, 0x00 here) */
423      dec0_pf2_draw(machine,bitmap,cliprect,TILEMAP_DRAW_LAYER1|TILEMAP_DRAW_OPAQUE);
420      dec0_pf2_draw(bitmap,cliprect,TILEMAP_DRAW_LAYER1|TILEMAP_DRAW_OPAQUE);
424421
425422      if (dec0_pri & 0x02)
426423         draw_sprites(machine,bitmap,cliprect,0x08,trans);
427424
428      dec0_pf3_draw(machine,bitmap,cliprect,0);
425      dec0_pf3_draw(bitmap,cliprect,0);
429426   }
430427   else
431428   {
432      dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
429      dec0_pf3_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
433430
434431      if (dec0_pri & 0x02)
435432         draw_sprites(machine,bitmap,cliprect,0x08,trans);
436433
437      dec0_pf2_draw(machine,bitmap,cliprect,0);
434      dec0_pf2_draw(bitmap,cliprect,0);
438435   }
439436
440437   if (dec0_pri & 0x02)
r1771r1772
442439   else
443440      draw_sprites(machine,bitmap,cliprect,0x00,0x00);
444441
445   dec0_pf1_draw(machine,bitmap,cliprect,0);
442   dec0_pf1_draw(bitmap,cliprect,0);
446443   return 0;
447444}
448445
r1771r1772
455452   /* This game doesn't have the extra playfield chip on the game board, but
456453    the palette does show through. */
457454   fillbitmap(bitmap,machine->pens[768],cliprect);
458   dec0_pf2_draw(machine,bitmap,cliprect,0);
455   dec0_pf2_draw(bitmap,cliprect,0);
459456   draw_sprites(machine,bitmap,cliprect,0x00,0x00);
460   dec0_pf1_draw(machine,bitmap,cliprect,0);
457   dec0_pf1_draw(bitmap,cliprect,0);
461458   return 0;
462459}
463460
r1771r1772
469466
470467   if (dec0_pri & 0x01)
471468   {
472      dec0_pf2_draw(machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
473      dec0_pf3_draw(machine,bitmap,cliprect,0);
469      dec0_pf2_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
470      dec0_pf3_draw(bitmap,cliprect,0);
474471   }
475472   else
476473   {
477      dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
478      dec0_pf2_draw(machine,bitmap,cliprect,0);
474      dec0_pf3_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
475      dec0_pf2_draw(bitmap,cliprect,0);
479476   }
480477
481478   draw_sprites(machine,bitmap,cliprect,0x00,0x00);
482   dec0_pf1_draw(machine,bitmap,cliprect,0);
479   dec0_pf1_draw(bitmap,cliprect,0);
483480   return 0;
484481}
485482
r1771r1772
489486{
490487   flip_screen_set(dec0_pf1_control_0[0]&0x80);
491488
492   dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
493   dec0_pf2_draw(machine,bitmap,cliprect,0);
489   dec0_pf3_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
490   dec0_pf2_draw(bitmap,cliprect,0);
494491
495492   draw_sprites(machine,bitmap,cliprect,0x00,0x00);
496493
497494   /* Redraw top 8 pens of top 8 palettes over sprites */
498495   if (dec0_pri&0x80)
499      dec0_pf2_draw(machine,bitmap,cliprect,TILEMAP_DRAW_LAYER0);
496      dec0_pf2_draw(bitmap,cliprect,TILEMAP_DRAW_LAYER0);
500497
501   dec0_pf1_draw(machine,bitmap,cliprect,0);
498   dec0_pf1_draw(bitmap,cliprect,0);
502499   return 0;
503500}
504501
r1771r1772
516513
517514   if (dec0_pri & 0x01)
518515   {
519      dec0_pf2_draw(machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
516      dec0_pf2_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
520517
521518      if (dec0_pri & 0x02)
522519         draw_sprites(machine,bitmap,cliprect,0x08,trans);
523520
524      dec0_pf3_draw(machine,bitmap,cliprect,0);
521      dec0_pf3_draw(bitmap,cliprect,0);
525522   }
526523   else
527524   {
528      dec0_pf3_draw(machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
525      dec0_pf3_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE);
529526
530527      if (dec0_pri & 0x02)
531528         draw_sprites(machine,bitmap,cliprect,0x08,trans);
532529
533      dec0_pf2_draw(machine,bitmap,cliprect,0);
530      dec0_pf2_draw(bitmap,cliprect,0);
534531   }
535532
536533   if (dec0_pri & 0x02)
r1771r1772
538535   else
539536      draw_sprites(machine,bitmap,cliprect,0x00,0x00);
540537
541   dec0_pf1_draw(machine,bitmap,cliprect,0);
538   dec0_pf1_draw(bitmap,cliprect,0);
542539   return 0;
543540}
544541
src/mame/video/ssv.c
r1771r1772
11591159   }
11601160
11611161   /* The background color is the first one in the palette */
1162   fillbitmap(bitmap,machine->pens[0], cliprect);
1162   fillbitmap(bitmap,0, cliprect);
11631163
11641164   if (!enable_video)   return 0;
11651165
src/mame/video/taitoair.c
r1771r1772
366366{
367367   TC0080VCO_tilemap_update(machine);
368368
369   fillbitmap(bitmap, machine->pens[0x41], cliprect);
369   fillbitmap(bitmap, 0x41, cliprect);
370370
371371#ifdef MAME_DEBUG
372372   if ( !input_code_pressed(KEYCODE_A) )
src/mame/video/cop01.c
r1771r1772
185185      sx = (spriteram[offs+3] - 0x80) + 256 * (attr & 0x01);
186186      sy = 240 - spriteram[offs];
187187
188      if (flip_screen)
188      if (flip_screen_get())
189189      {
190190         sx = 240 - sx;
191191         sy = 240 - sy;
src/mame/video/hanaawas.c
r1771r1772
7575
7676   /* dirty both current and next offsets */
7777   tilemap_mark_tile_dirty(bg_tilemap, offset);
78   tilemap_mark_tile_dirty(bg_tilemap, (offset + (flip_screen ? -1 : 1)) & 0x03ff);
78   tilemap_mark_tile_dirty(bg_tilemap, (offset + (flip_screen_get() ? -1 : 1)) & 0x03ff);
7979}
8080
8181WRITE8_HANDLER( hanaawas_portB_w )
8282{
8383   /* bit 7 is flip screen */
84   if (flip_screen != (~data & 0x80))
84   if (flip_screen_get() != (~data & 0x80))
8585   {
8686      flip_screen_set(~data & 0x80);
8787      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
r1771r1772
9191static TILE_GET_INFO( get_bg_tile_info )
9292{
9393   /* the color is determined by the current color byte, but the bank is via the previous one!!! */
94   int offset = (tile_index + (flip_screen ? 1 : -1)) & 0x3ff;
94   int offset = (tile_index + (flip_screen_get() ? 1 : -1)) & 0x3ff;
9595   int attr = colorram[offset];
9696   int gfxbank = (attr & 0x40) >> 6;
9797   int code = videoram[tile_index] + ((attr & 0x20) << 3);
src/mame/video/metro.c
r1771r1772
640640
641641         gfxdata      =   base_gfx + (8*8*4/8) * (((attr & 0x000f) << 16) + code);
642642
643         if (flip_screen)
643         if (flip_screen_get())
644644         {
645645            flipx = !flipx;      x = max_x - x - width;
646646            flipy = !flipy;      y = max_y - y - height;
r1771r1772
873873
874874   /* The background color is selected by a register */
875875   fillbitmap(priority_bitmap,0,cliprect);
876   fillbitmap(bitmap,machine->pens[((metro_videoregs[0x12/2] & 0x0fff) ^ 0x0ff) + 0x1000],cliprect);
876   fillbitmap(bitmap,((metro_videoregs[0x12/2] & 0x0fff) ^ 0x0ff) + 0x1000,cliprect);
877877
878878   /*  Screen Control Register:
879879
src/mame/video/circusc.c
r1771r1772
185185      int flipx = sr[offs + 1] & 0x40;
186186      int flipy = sr[offs + 1] & 0x80;
187187
188      if (flip_screen)
188      if (flip_screen_get())
189189      {
190190         sx = 240 - sx;
191191         sy = 240 - sy;
r1771r1772
212212   for (i = 10;i < 32;i++)
213213      tilemap_set_scrolly(bg_tilemap,i,*circusc_scroll);
214214
215   fillbitmap(bitmap, machine->pens[0], cliprect);
215   fillbitmap(bitmap, 0, cliprect);
216216   tilemap_draw(bitmap,cliprect,bg_tilemap,1,0);
217217   draw_sprites(machine,bitmap,cliprect);
218218   tilemap_draw(bitmap,cliprect,bg_tilemap,0,0);
src/mame/video/mikie.c
r1771r1772
113113
114114WRITE8_HANDLER( mikie_flipscreen_w )
115115{
116   if (flip_screen != (data & 0x01))
116   if (flip_screen_get() != (data & 0x01))
117117   {
118118      flip_screen_set(data & 0x01);
119119      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
r1771r1772
149149      int flipx = ~spriteram[offs] & 0x10;
150150      int flipy = spriteram[offs] & 0x20;
151151
152      if (flip_screen)
152      if (flip_screen_get())
153153      {
154154         sy = 242 - sy;
155155         flipy = !flipy;
src/mame/video/surpratk.c
r1771r1772
8989   sortlayers(layer,layerpri);
9090
9191   fillbitmap(priority_bitmap,0,cliprect);
92   fillbitmap(bitmap,machine->pens[16 * bg_colorbase],cliprect);
92   fillbitmap(bitmap,16 * bg_colorbase,cliprect);
9393   tilemap_draw(bitmap,cliprect,K052109_tilemap[layer[0]],0,1);
9494   tilemap_draw(bitmap,cliprect,K052109_tilemap[layer[1]],0,2);
9595   tilemap_draw(bitmap,cliprect,K052109_tilemap[layer[2]],0,4);
src/mame/video/suna16.c
r1771r1772
183183
184184            if (flipx)   tile_flipx = !tile_flipx;
185185
186            if (flip_screen)
186            if (flip_screen_get())
187187            {
188188               sx = max_x - sx;
189189               sy = max_y - sy;
r1771r1772
220220VIDEO_UPDATE( suna16 )
221221{
222222   /* Suna Quiz indicates the background is the last pen */
223   fillbitmap(bitmap,machine->pens[0xff],cliprect);
223   fillbitmap(bitmap,0xff,cliprect);
224224   draw_sprites(machine, bitmap, cliprect, spriteram16, 0);
225225   return 0;
226226}
r1771r1772
239239#endif
240240
241241   /* Suna Quiz indicates the background is the last pen */
242   fillbitmap(bitmap,machine->pens[0xff],cliprect);
242   fillbitmap(bitmap,0xff,cliprect);
243243   if (layers_ctrl & 1)   draw_sprites(machine, bitmap, cliprect, spriteram16,   0);
244244   if (layers_ctrl & 2)   draw_sprites(machine, bitmap, cliprect, spriteram16_2, 1);
245245   return 0;
src/mame/video/zaccaria.c
r1771r1772
209209   int offs;
210210   rectangle clip = *cliprect;
211211
212   if (flip_screen_x)
212   if (flip_screen_x_get())
213213      sect_rect(&clip, &spritevisiblearea_flipx);
214214   else
215215      sect_rect(&clip, &spritevisiblearea);
r1771r1772
235235      int flipx = spriteram_2[offs + 2] & 0x40;
236236      int flipy = spriteram_2[offs + 2] & 0x80;
237237
238      if (flip_screen_x)
238      if (flip_screen_x_get())
239239      {
240240         sx = 240 - sx;
241241         flipx = !flipx;
242242      }
243      if (flip_screen_y)
243      if (flip_screen_y_get())
244244      {
245245         sy = 240 - sy;
246246         flipy = !flipy;
r1771r1772
261261      int flipx = spriteram[offs + 1] & 0x40;
262262      int flipy = spriteram[offs + 1] & 0x80;
263263
264      if (flip_screen_x)
264      if (flip_screen_x_get())
265265      {
266266         sx = 240 - sx;
267267         flipx = !flipx;
268268      }
269      if (flip_screen_y)
269      if (flip_screen_y_get())
270270      {
271271         sy = 240 - sy;
272272         flipy = !flipy;
src/mame/video/speedbal.c
r1771r1772
102102
103103      flipx = flipy = 0;
104104
105      if(flip_screen)
105      if(flip_screen_get())
106106      {
107107         x = 246 - x;
108108         y = 238 - y;
src/mame/video/tagteam.c
r1771r1772
112112
113113WRITE8_HANDLER( tagteam_flipscreen_w )
114114{
115   if (flip_screen != (data &0x01))
115   if (flip_screen_get() != (data &0x01))
116116   {
117117      flip_screen_set(data & 0x01);
118118      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
r1771r1772
149149
150150      if (!(videoram[offs] & 0x01)) continue;
151151
152      if (flip_screen)
152      if (flip_screen_get())
153153      {
154154         sx = 240 - sx;
155155         sy = 240 - sy;
r1771r1772
168168
169169      code = videoram[offs + 0x20] + 256 * spritebank;
170170      color = palettebank;
171      sy += (flip_screen ? -256 : 256);
171      sy += (flip_screen_get() ? -256 : 256);
172172
173173      drawgfx(bitmap, machine->gfx[1],
174174         code, color,
src/mame/video/bagman.c
r1771r1772
8585
8686WRITE8_HANDLER( bagman_flipscreen_w )
8787{
88   if (flip_screen != (data & 0x01))
88   if (flip_screen_get() != (data & 0x01))
8989   {
9090      flip_screen_set(data & 0x01);
9191      tilemap_mark_all_tiles_dirty(bg_tilemap);
r1771r1772
120120      sy = 240 - spriteram[offs + 2];
121121      flipx = spriteram[offs] & 0x40;
122122      flipy = spriteram[offs] & 0x80;
123      if (flip_screen_x)
123      if (flip_screen_x_get())
124124      {
125125         sx = 240 - sx +1;   /* compensate misplacement */
126126         flipx = !flipx;
127127      }
128      if (flip_screen_y)
128      if (flip_screen_y_get())
129129      {
130130         sy = 240 - sy;
131131         flipy = !flipy;
src/mame/video/commando.c
r1771r1772
113113      int sx = buffered_spriteram[offs + 3] - ((attr & 0x01) << 8);
114114      int sy = buffered_spriteram[offs + 2];
115115
116      if (flip_screen)
116      if (flip_screen_get())
117117      {
118118         sx = 240 - sx;
119119         sy = 240 - sy;
src/mame/video/ninjakd2.c
r1771r1772
367367         int const big = (sprptr[2] & 0x04) >> 2;
368368         int x,y;
369369
370         if (flip_screen)
370         if (flip_screen_get())
371371         {
372372            sx = 240 - 16*big - sx;
373373            sy = 240 - 16*big - sy;
r1771r1772
464464
465465VIDEO_UPDATE( ninjakd2 )
466466{
467   fillbitmap(bitmap, machine->pens[0], cliprect);
467   fillbitmap(bitmap, 0, cliprect);
468468
469469   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
470470
r1771r1772
477477
478478VIDEO_UPDATE( robokid )
479479{
480   fillbitmap(bitmap, machine->pens[0], cliprect);
480   fillbitmap(bitmap, 0, cliprect);
481481
482482   tilemap_draw(bitmap, cliprect, bg0_tilemap, 0, 0);
483483
r1771r1772
494494
495495VIDEO_UPDATE( omegaf )
496496{
497   fillbitmap(bitmap, machine->pens[0], cliprect);
497   fillbitmap(bitmap, 0, cliprect);
498498
499499   tilemap_draw(bitmap, cliprect, bg0_tilemap, 0, 0);
500500
src/mame/video/mjsister.c
r1771r1772
9797   if (mjsister_video_enable)
9898   {
9999      for (i=0; i<256; i++)
100      {
101100         for (j=0; j<4; j++)
102            *BITMAP_ADDR16(bitmap, i, 256+j) = machine->pens[mjsister_colorbank * 0x20];
103      }
101            *BITMAP_ADDR16(bitmap, i, 256+j) = mjsister_colorbank * 0x20;
104102
105103      copybitmap      (bitmap,mjsister_tmpbitmap0,f,f,0,0,cliprect);
106104      copybitmap_trans(bitmap,mjsister_tmpbitmap1,f,f,2,0,cliprect,0);
src/mame/video/yunsung8.c
r1771r1772
200200#endif
201201
202202   if (layers_ctrl&1)   tilemap_draw(bitmap,cliprect, tilemap_0, 0,0);
203   else            fillbitmap(bitmap,machine->pens[0],cliprect);
203   else            fillbitmap(bitmap,0,cliprect);
204204
205205   if (layers_ctrl&2)   tilemap_draw(bitmap,cliprect, tilemap_1, 0,0);
206206   return 0;
src/mame/video/m52.c
r1771r1772
302302{
303303   rectangle rect;
304304
305   if (flip_screen)
305   if (flip_screen_get())
306306   {
307307      xpos = 255 - xpos;
308308      ypos = 255 - ypos - BGHEIGHT;
r1771r1772
315315
316316   drawgfx(bitmap, machine->gfx[image],
317317      0, 0,
318      flip_screen,
319      flip_screen,
318      flip_screen_get(),
319      flip_screen_get(),
320320      xpos,
321321      ypos,
322322      cliprect,
r1771r1772
324324
325325   drawgfx(bitmap, machine->gfx[image],
326326      0, 0,
327      flip_screen,
328      flip_screen,
327      flip_screen_get(),
328      flip_screen_get(),
329329      xpos - 256,
330330      ypos,
331331      cliprect,
r1771r1772
334334   rect.min_x = machine->screen[0].visarea.min_x;
335335   rect.max_x = machine->screen[0].visarea.max_x;
336336
337   if (flip_screen)
337   if (flip_screen_get())
338338   {
339339      rect.min_y = ypos - BGHEIGHT;
340340      rect.max_y = ypos - 1;
r1771r1772
345345      rect.max_y = ypos + 2 * BGHEIGHT - 1;
346346   }
347347
348   fillbitmap(bitmap, machine->pens[machine->gfx[image]->color_base + 3], &rect);
348   fillbitmap(bitmap, machine->gfx[image]->color_base + 3, &rect);
349349}
350350
351351
r1771r1772
374374         draw_background(machine, bitmap, cliprect, bg1xpos, bg1ypos, 4); /* cityscape */
375375   }
376376
377   tilemap_set_flip(bg_tilemap, flip_screen ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
377   tilemap_set_flip(bg_tilemap, flip_screen_get() ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
378378
379379   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
380380
r1771r1772
398398         clip.min_y = 128, clip.max_y = 255;
399399
400400      /* adjust for flipping */
401      if (flip_screen)
401      if (flip_screen_get())
402402      {
403403         int temp = clip.min_y;
404404         clip.min_y = 255 - clip.max_y;
src/mame/video/spacefb.c
r1771r1772
1313size_t spacefb_videoram_size;
1414
1515
16/* bitmap that marks whether a given pixel has a sprite/bullet there */
17static bitmap_t *object_present_map;
18
16static UINT8 *object_present_map;
1917static UINT8 flipscreen;
2018static UINT8 gfx_bank;
2119static UINT8 palette_bank;
r1771r1772
2725static UINT8 color_contrast_b;
2826static UINT32 star_shift_reg;
2927
30static double color_weights_r[3], color_weights_g[3], color_weights_b[3];
28static double color_weights_rg[3], color_weights_b[2];
3129
3230
3331
r1771r1772
4139{
4240   flipscreen = data;
4341
44   video_screen_update_partial(0, video_screen_get_vpos(0) - 1);
42   video_screen_update_now(0);
4543}
4644
4745
r1771r1772
4947{
5048   gfx_bank = data;
5149
52   video_screen_update_partial(0, video_screen_get_vpos(0) - 1);
50   video_screen_update_now(0);
5351}
5452
5553
r1771r1772
5755{
5856   palette_bank = data;
5957
60   video_screen_update_partial(0, video_screen_get_vpos(0) - 1);
58   video_screen_update_now(0);
6159}
6260
6361
r1771r1772
6563{
6664   background_red = data;
6765
68   video_screen_update_partial(0, video_screen_get_vpos(0) - 1);
66   video_screen_update_now(0);
6967}
7068
7169
r1771r1772
7371{
7472   background_blue = data;
7573
76   video_screen_update_partial(0, video_screen_get_vpos(0) - 1);
74   video_screen_update_now(0);
7775}
7876
7977
r1771r1772
8179{
8280   disable_star_field = data;
8381
84   video_screen_update_partial(0, video_screen_get_vpos(0) - 1);
82   video_screen_update_now(0);
8583}
8684
8785
r1771r1772
8987{
9088   color_contrast_r = data;
9189
92   video_screen_update_partial(0, video_screen_get_vpos(0) - 1);
90   video_screen_update_now(0);
9391}
9492
9593
r1771r1772
9795{
9896   color_contrast_g = data;
9997
100   video_screen_update_partial(0, video_screen_get_vpos(0) - 1);
98   video_screen_update_now(0);
10199}
102100
103101
r1771r1772
105103{
106104   color_contrast_b = data;
107105
108   video_screen_update_partial(0, video_screen_get_vpos(0) - 1);
106   video_screen_update_now(0);
109107}
110108
111109
r1771r1772
152150   static const int resistances_b [] = {       470, 220 };
153151
154152   compute_resistor_weights(0, 0xff, -1.0,
155                      3, resistances_rg, color_weights_r, 470, 0,
156                      3, resistances_rg, color_weights_g, 470, 0,
157                      2, resistances_b,  color_weights_b, 470, 0);
153                      3, resistances_rg, color_weights_rg, 470, 0,
154                      2, resistances_b,  color_weights_b,  470, 0,
155                      0, 0, 0, 0, 0);
158156
159   object_present_map = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED8);
157   object_present_map = auto_malloc(machine->screen[0].width * machine->screen[0].height);
160158
161159   /* this start value positions the stars to match the flyer screen shot,
162160       but most likely, the actual star position is random as the hardware
r1771r1772
195193      UINT8 ra = (((i >> 4) & 0x01) | background_red) & !disable_star_field;
196194      UINT8 rb =  ((i >> 5) & 0x01) & color_contrast_r & !disable_star_field;
197195
198      UINT8 r = combine_3_weights(color_weights_r, 0, rb, ra);
199      UINT8 g = combine_3_weights(color_weights_g, 0, gb, ga);
200      UINT8 b = combine_2_weights(color_weights_b,    bb, ba);
196      UINT8 r = combine_3_weights(color_weights_rg, 0, rb, ra);
197      UINT8 g = combine_3_weights(color_weights_rg, 0, gb, ga);
198      UINT8 b = combine_2_weights(color_weights_b,     bb, ba);
201199
202200      pens[i] = MAKE_RGB(r, g, b);
203201   }
r1771r1772
234232
235233      for (x = SPACEFB_HBEND; x < SPACEFB_HBSTART; x++)
236234      {
237         if (!*BITMAP_ADDR8(object_present_map, y, x))
235         if (object_present_map[(y * bitmap->width) + x] == 0)
238236         {
239237            /* draw the star - the 4 possible values come from the effect of the two XOR gates */
240238            if (((star_shift_reg & 0x1c0ff) == 0x0c0b7) ||
r1771r1772
297295      UINT8 b1 = (data >> 6) & 0x01;
298296      UINT8 b2 = (data >> 7) & 0x01;
299297
300      UINT8 r = combine_3_weights(color_weights_r, r0, r1, r2);
301      UINT8 g = combine_3_weights(color_weights_g, g0, g1, g2);
302      UINT8 b = combine_2_weights(color_weights_b,     b1, b2);
298      UINT8 r = combine_3_weights(color_weights_rg, r0, r1, r2);
299      UINT8 g = combine_3_weights(color_weights_rg, g0, g1, g2);
300      UINT8 b = combine_2_weights(color_weights_b,      b1, b2);
303301
304302      if (i >> 4)
305303      {
r1771r1772
353351               *BITMAP_ADDR32(bitmap, dy, dx + 0) = pen;
354352               *BITMAP_ADDR32(bitmap, dy, dx + 1) = pen;
355353
356               *BITMAP_ADDR8(object_present_map, dy, dx + 0) = 1;
357               *BITMAP_ADDR8(object_present_map, dy, dx + 1) = 1;
354               object_present_map[(dy * bitmap->width) + dx + 0] = 1;
355               object_present_map[(dy * bitmap->width) + dx + 1] = 1;
358356            }
359357
360358            x = x + 1;
r1771r1772
367365}
368366
369367
370static void draw_sprite(offs_t offs, pen_t* pens, mame_bitmap *bitmap, const rectangle *cliprect)
368static void draw_sprite(offs_t offs, pen_t *pens, mame_bitmap *bitmap, const rectangle *cliprect)
371369{
372370   UINT8 sy;
373371
r1771r1772
410408            *BITMAP_ADDR32(bitmap, dy, dx + 0) = pen;
411409            *BITMAP_ADDR32(bitmap, dy, dx + 1) = pen;
412410
413            *BITMAP_ADDR8(object_present_map, dy, dx + 0) = (data != 0);
414            *BITMAP_ADDR8(object_present_map, dy, dx + 1) = (data != 0);
411            object_present_map[(dy * bitmap->width) + dx + 0] = (data != 0);
412            object_present_map[(dy * bitmap->width) + dx + 1] = (data != 0);
415413
416414            x = x + 1;
417415            data1 = data1 >> 1;
r1771r1772
436434
437435   get_sprite_pens(sprite_pens);
438436
437   memset(object_present_map, 0, bitmap->width * bitmap->height);
438
439439   while (1)
440440   {
441441      if (spacefb_videoram[offs + 0x0300] & 0x20)
r1771r1772
461461
462462VIDEO_UPDATE( spacefb )
463463{
464   fillbitmap(object_present_map, 0, cliprect);
465
466464   draw_objects(bitmap, cliprect);
467
468465   draw_starfield(machine, screen, bitmap, cliprect);
469466
470467   return 0;
src/mame/video/cbuster.c
r1771r1772
111111         inc = 1;
112112      }
113113
114      if (flip_screen) {
114      if (flip_screen_get()) {
115115         y=240-y;
116116         x=240-x;
117117         if (fx) fx=0; else fx=1;
src/mame/video/gng.c
r1771r1772
128128      int flipx = attributes & 0x04;
129129      int flipy = attributes & 0x08;
130130
131      if (flip_screen)
131      if (flip_screen_get())
132132      {
133133         sx = 240 - sx;
134134         sy = 240 - sy;
src/mame/video/n8080.c
r1771r1772
2929   sheriff_color_mode = (data >> 3) & 3;
3030   sheriff_color_data = (data >> 0) & 7;
3131
32   flip_screen = data & 0x20;
32   flip_screen_set_no_update(data & 0x20);
3333}
3434
3535
r1771r1772
8787   }
8888   else
8989   {
90      if (flip_screen)
90      if (flip_screen_get())
9191      {
9292         helifire_mv %= 255;
9393      }
r1771r1772
108108{
109109   cannon_timer = timer_alloc(spacefev_stop_red_cannon, NULL);
110110
111   flip_screen = 0;
111   flip_screen_set_no_update(0);
112112
113113   spacefev_red_screen = 0;
114114   spacefev_red_cannon = 0;
r1771r1772
117117
118118VIDEO_START( sheriff )
119119{
120   flip_screen = 0;
120   flip_screen_set_no_update(0);
121121
122122   sheriff_color_mode = 0;
123123   sheriff_color_data = 0;
r1771r1772
144144      helifire_LSFR[i] = data;
145145   }
146146
147   flip_screen = 0;
147   flip_screen_set_no_update(0);
148148
149149   helifire_flash = 0;
150150}
r1771r1772
152152
153153VIDEO_UPDATE( spacefev )
154154{
155   UINT8 mask = flip_screen ? 0xff : 0x00;
155   UINT8 mask = flip_screen_get() ? 0xff : 0x00;
156156
157157   int x;
158158   int y;
r1771r1772
222222
223223VIDEO_UPDATE( sheriff )
224224{
225   UINT8 mask = flip_screen ? 0xff : 0x00;
225   UINT8 mask = flip_screen_get() ? 0xff : 0x00;
226226
227227   const UINT8* pPROM = memory_region(REGION_PROMS);
228228
r1771r1772
339339
340340         for (n = 0; n < 8; n++)
341341         {
342            if (flip_screen)
342            if (flip_screen_get())
343343            {
344344               if ((videoram[offset ^ 0x1fff] << n) & 0x80)
345345               {
src/mame/video/nbmj8891.c
r1771r1772
555555      if (gfxdraw_mode)
556556      {
557557         copyscrollbitmap      (bitmap, nbmj8891_tmpbitmap0, 0, 0, 0, 0, cliprect);
558         copyscrollbitmap_trans(bitmap, nbmj8891_tmpbitmap1, 0, 0, 1, &scrolly, cliprect, machine->pens[0xff]);
558         copyscrollbitmap_trans(bitmap, nbmj8891_tmpbitmap1, 0, 0, 1, &scrolly, cliprect, 0xff);
559559      }
560560      else
561561         copyscrollbitmap(bitmap, nbmj8891_tmpbitmap0, 0, 0, 1, &scrolly, cliprect);
562562   }
563563   else
564      fillbitmap(bitmap, machine->pens[0xff], 0);
564      fillbitmap(bitmap, 0xff, 0);
565565
566566   return 0;
567567}
src/mame/video/holeland.c
r1771r1772
120120      flipx = spriteram[offs+3] & 0x04;
121121      flipy = spriteram[offs+3] & 0x08;
122122
123      if (flip_screen_x)
123      if (flip_screen_x_get())
124124      {
125125         flipx = !flipx;
126126         sx = 240 - sx;
127127      }
128128
129      if (flip_screen_y)
129      if (flip_screen_y_get())
130130      {
131131         flipy = !flipy;
132132         sy = 240 - sy;
r1771r1772
158158      flipx = spriteram[offs+3] & 0x04;
159159      flipy = spriteram[offs+3] & 0x08;
160160
161      if (flip_screen_x)
161      if (flip_screen_x_get())
162162      {
163163         flipx = !flipx;
164164         sx = 240 - sx;
165165      }
166166
167      if (flip_screen_y)
167      if (flip_screen_y_get())
168168      {
169169         flipy = !flipy;
170170         sy = 240 - sy;
src/mame/video/liberate.c
r1771r1772
215215
216216      if (multi && fy==0) sy-=16;
217217
218      if (flip_screen) {
218      if (flip_screen_get()) {
219219         sy=240-sy;
220220         sx=240-sx;
221221         if (fy)
r1771r1772
276276//      if (multi) sy-=16;
277277      if (fy && multi) { code2=code; code++; }
278278
279      if (flip_screen) {
279      if (flip_screen_get()) {
280280         sy=240-sy;
281281         sx=240-sx;
282282         if (fx) fx=0; else fx=1;
r1771r1772
332332//      if (multi) sy-=16;
333333      if (fy && multi) { code2=code; code++; }
334334
335      if (flip_screen) {
335      if (flip_screen_get()) {
336336         sy=240-sy;
337337         sx=240-sx;
338338         if (fx) fx=0; else fx=1;
r1771r1772
367367   tilemap_set_scrollx(background_tilemap,0,-deco16_io_ram[0]);
368368
369369   if (background_disable)
370      fillbitmap(bitmap,machine->pens[32],cliprect);
370      fillbitmap(bitmap,32,cliprect);
371371   else
372372      tilemap_draw(bitmap,cliprect,background_tilemap,0,0);
373373   boomrang_draw_sprites(machine,bitmap,cliprect,0);
r1771r1772
379379{
380380   int mx,my,tile,color,offs;
381381
382   fillbitmap(bitmap,machine->pens[0],cliprect);
382   fillbitmap(bitmap,0,cliprect);
383383
384384   prosport_draw_sprites(machine,bitmap,cliprect);
385385
r1771r1772
407407   tilemap_set_scrollx(background_tilemap,0,-deco16_io_ram[0]);
408408
409409   if (background_disable)
410      fillbitmap(bitmap,machine->pens[32],cliprect);
410      fillbitmap(bitmap,32,cliprect);
411411   else
412412      tilemap_draw(bitmap,cliprect,background_tilemap,TILEMAP_DRAW_LAYER1,0);
413413
r1771r1772
425425   tilemap_set_scrollx(background_tilemap,0,-deco16_io_ram[0]);
426426
427427   if (background_disable)
428      fillbitmap(bitmap,machine->pens[32],cliprect);
428      fillbitmap(bitmap,32,cliprect);
429429   else
430430      tilemap_draw(bitmap,cliprect,background_tilemap,0,0);
431431
src/mame/video/spdodgeb.c
r1771r1772
179179      int dy = -16;
180180      int cy;
181181
182      if (flip_screen)
182      if (flip_screen_get())
183183      {
184184         sx = 240 - sx;
185185         sy = 240 - sy;
r1771r1772
198198         break;
199199
200200         case 1: /* double y */
201         if (flip_screen) { if (sy > 240) sy -= 256; } else { if (sy < 0) sy += 256; }
201         if (flip_screen_get()) { if (sy > 240) sy -= 256; } else { if (sy < 0) sy += 256; }
202202         cy = sy + dy;
203203         which &= ~1;
204204         DRAW_SPRITE(0,sx,cy);
src/mame/video/gunsmoke.c
r1771r1772
167167      if (bank == 3) bank += sprite3bank;
168168      code += 256 * bank;
169169
170      if (flip_screen)
170      if (flip_screen_get())
171171      {
172172         sx = 240 - sx;
173173         sy = 240 - sy;
src/mame/video/cvs.c
r1771r1772
295295               int bx=255-7-cvs_bullet_ram[offs]-ct;
296296
297297               /* Bullet/Object Collision */
298            if ((*BITMAP_ADDR8(s2636_0_bitmap, offs, bx) != 0) ||
299               (*BITMAP_ADDR8(s2636_1_bitmap, offs, bx) != 0) ||
300               (*BITMAP_ADDR8(s2636_2_bitmap, offs, bx) != 0))
298            if ((*BITMAP_ADDR16(s2636_0_bitmap, offs, bx) != 0) ||
299               (*BITMAP_ADDR16(s2636_1_bitmap, offs, bx) != 0) ||
300               (*BITMAP_ADDR16(s2636_2_bitmap, offs, bx) != 0))
301301               cvs_collision_register |= 0x08;
302302
303303               /* Bullet/Background Collision */
304304            if (colortable_entry_get_value(machine->colortable, *BITMAP_ADDR16(scrolled_collision_background, offs, bx)))
305305                      cvs_collision_register |= 0x80;
306306
307            *BITMAP_ADDR16(bitmap, offs, bx) = machine->pens[BULLET_STAR_PEN];
307            *BITMAP_ADDR16(bitmap, offs, bx) = BULLET_STAR_PEN;
308308            }
309309        }
310310    }
r1771r1772
320320
321321         for (x = cliprect->min_x; x <= cliprect->max_x; x++)
322322         {
323            int pixel0 = *BITMAP_ADDR8(s2636_0_bitmap, y, x);
324            int pixel1 = *BITMAP_ADDR8(s2636_1_bitmap, y, x);
325            int pixel2 = *BITMAP_ADDR8(s2636_2_bitmap, y, x);
323            int pixel0 = *BITMAP_ADDR16(s2636_0_bitmap, y, x);
324            int pixel1 = *BITMAP_ADDR16(s2636_1_bitmap, y, x);
325            int pixel2 = *BITMAP_ADDR16(s2636_2_bitmap, y, x);
326326
327327            int pixel = pixel0 | pixel1 | pixel2;
328328
329329            if (S2636_IS_PIXEL_DRAWN(pixel))
330330            {
331               *BITMAP_ADDR16(bitmap, y, x) = machine->pens[SPRITE_PEN_BASE + S2636_PIXEL_COLOR(pixel)];
331               *BITMAP_ADDR16(bitmap, y, x) = SPRITE_PEN_BASE + S2636_PIXEL_COLOR(pixel);
332332
333333               /* S2636 vs. S2636 collision detection */
334334               if (S2636_IS_PIXEL_DRAWN(pixel0) && S2636_IS_PIXEL_DRAWN(pixel1)) cvs_collision_register |= 0x01;
r1771r1772
362362         {
363363            if ((y & 1) ^ ((x >> 4) & 1))
364364            {
365               if (flip_screen_x)
365               if (flip_screen_x_get())
366366                  x = ~x;
367367
368               if (flip_screen_y)
368               if (flip_screen_y_get())
369369                  y = ~y;
370370
371371               if (colortable_entry_get_value(machine->colortable, *BITMAP_ADDR16(bitmap, y, x)) == 0)
372                  *BITMAP_ADDR16(bitmap, y, x) = machine->pens[BULLET_STAR_PEN];
372                  *BITMAP_ADDR16(bitmap, y, x) = BULLET_STAR_PEN;
373373            }
374374         }
375375      }
src/mame/video/truco.c
r1771r1772
3535   UINT8      *vid = videoram;
3636   int x, y;
3737
38   for( y = 0; y < 192; y++ ) {
39      for( x = 0; x < 256; x++ ) {
38   for( y = 0; y < 192; y++ )
39   {
40      for( x = 0; x < 256; x++ )
41      {
4042         int      pixel;
4143
42         if ( x & 1 ) {
44         if ( x & 1 )
4345            pixel = vid[x>>1] & 0x0f;
44         } else {
46         else
4547            pixel = ( vid[x>>1] >> 4 ) & 0x0f;
46         }
4748
48         *BITMAP_ADDR16(bitmap, y, x) = machine->pens[pixel];
49         *BITMAP_ADDR16(bitmap, y, x) = pixel;
4950      }
5051
5152      vid += 0x80;
src/mame/video/tnzs.c
r1771r1772
197197
198198
199199   /* Fill the background */
200   fillbitmap(bitmap, machine->pens[0x1f0], cliprect);
200   fillbitmap(bitmap, 0x1f0, cliprect);
201201
202202   /* Redraw the background tiles (c400-c5ff) */
203203   draw_background(machine, bitmap, cliprect, tnzs_objram + 0x400);
src/mame/video/rohga.c
r1771r1772
124124         inc = 1;
125125      }
126126
127      if (flip_screen) {
127      if (flip_screen_get()) {
128128         x=304-x;
129129         y=240-y;
130130         if (fx) fx=0; else fx=1;
r1771r1772
217217         inc = 1;
218218      }
219219
220      if (flip_screen) {
220      if (flip_screen_get()) {
221221         x=304-x;
222222         y=240-y;
223223         if (fx) fx=0; else fx=1;
r1771r1772
395395      fx = (spriteptr[offs+0]&0x4000);
396396      fy = (spriteptr[offs+0]&0x8000);
397397
398      if (!flip_screen) { /* Inverted from Mutant Fighter! */
398      if (!flip_screen_get()) { /* Inverted from Mutant Fighter! */
399399         if (fx) fx=0; else fx=1;
400400         if (fy) fy=0; else fy=1;
401401
src/mame/video/vball.c
r1771r1772
135135      int flipy = 0;
136136      int dy = -16;
137137
138      if (flip_screen)
138      if (flip_screen_get())
139139      {
140140         sx = 240 - sx;
141141         sy = 240 - sy;
src/mame/video/higemaru.c
r1771r1772
8080   coin_counter_w(1,data & 1);
8181
8282   /* bit 7 flips screen */
83   if (flip_screen != (data & 0x80))
83   if (flip_screen_get() != (data & 0x80))
8484   {
8585      flip_screen_set(data & 0x80);
8686      tilemap_mark_all_tiles_dirty(bg_tilemap);
r1771r1772
114114      sy = spriteram[offs + 8];
115115      flipx = spriteram[offs + 4] & 0x10;
116116      flipy = spriteram[offs + 4] & 0x20;
117      if (flip_screen)
117      if (flip_screen_get())
118118      {
119119         sx = 240 - sx;
120120         sy = 240 - sy;
src/mame/video/nemesis.c
r1771r1772
388388   update_gfx(machine);
389389
390390   fillbitmap(priority_bitmap,0,cliprect);
391   fillbitmap(bitmap,machine->pens[0],cliprect);
391   fillbitmap(bitmap,0,cliprect);
392392
393393   tilemap_set_scrolly( background, 0, (nemesis_yscroll[0x180] & 0xff) );
394394
r1771r1772
417417   update_gfx(machine);
418418
419419   fillbitmap(priority_bitmap,0,cliprect);
420   fillbitmap(bitmap,machine->pens[0],cliprect);
420   fillbitmap(bitmap,0,cliprect);
421421
422422   clip.min_x = 0;
423423   clip.max_x = 255;
src/mame/video/cheekyms.c
r1771r1772
8686   int offs;
8787
8888
89   fillbitmap(bitmap,machine->pens[0],cliprect);
89   fillbitmap(bitmap,0,cliprect);
9090
9191   /* Draw the sprites first, because they're supposed to appear below
9292       the characters */
r1771r1772
105105
106106      if (v1 & 0x80)
107107      {
108         if (!flip_screen)
109         {
108         if (!flip_screen_get())
110109            code++;
111         }
112110
113111         drawgfx(bitmap,machine->gfx[1],
114112               code,
r1771r1772
162160            color = 0xc + char_palette;
163161      }
164162
165      if (flip_screen)
163      if (flip_screen_get())
166164      {
167165         sx = 31 - sx;
168166         sy = 31 - sy;
r1771r1772
171169      drawgfx(bitmap,machine->gfx[0],
172170            videoram[offs],
173171            color,
174            flip_screen,flip_screen,
172            flip_screen_get(),flip_screen_get(),
175173            8*sx, 8*sy - (man_area ? man_scroll : 0),
176174            cliprect,TRANSPARENCY_PEN,0);
177175   }
src/mame/video/magmax.c
r1771r1772
9898
9999   /* copy the background graphics */
100100   if (*magmax_vreg & 0x40)      /* background disable */
101      fillbitmap(bitmap, machine->pens[0], cliprect);
101      fillbitmap(bitmap, 0, cliprect);
102102   else
103103   {
104104      int v;
src/mame/video/deco16ic.c
r1771r1772
598598void deco_allocate_sprite_bitmap(void)
599599{
600600   /* Allow sprite bitmap to be used by Deco32 games as well */
601   sprite_priority_bitmap = auto_bitmap_alloc( Machine->screen[0].width, Machine->screen[0].height, BITMAP_FORMAT_INDEXED8 );
601   sprite_priority_bitmap = auto_bitmap_alloc( Machine->screen[0].width, Machine->screen[0].height, BITMAP_FORMAT_INDEXED16 );
602602}
603603
604604/*****************************************************************************************/
src/mame/video/1942.c
r1771r1772
214214      sx = spriteram[offs + 3] - 0x10 * (spriteram[offs + 1] & 0x10);
215215      sy = spriteram[offs + 2];
216216      dir = 1;
217      if (flip_screen)
217      if (flip_screen_get())
218218      {
219219         sx = 240 - sx;
220220         sy = 240 - sy;
r1771r1772
229229      {
230230         drawgfx(bitmap,machine->gfx[2],
231231               code + i,col,
232               flip_screen,flip_screen,
232               flip_screen_get(),flip_screen_get(),
233233               sx,sy + 16 * i * dir,
234234               cliprect,TRANSPARENCY_PEN,15);
235235
src/mame/video/poolshrk.c
r1771r1772
3535
3636   tilemap_mark_all_tiles_dirty(bg_tilemap);
3737
38   fillbitmap(bitmap, machine->pens[0], cliprect);
38   fillbitmap(bitmap, 0, cliprect);
3939
4040   /* draw sprites */
4141
src/mame/video/bombjack.c
r1771r1772
3535
3636WRITE8_HANDLER( bombjack_flipscreen_w )
3737{
38   if (flip_screen != (data & 0x01))
38   if (flip_screen_get() != (data & 0x01))
3939   {
4040      flip_screen_set(data & 0x01);
4141      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
r1771r1772
106106         sy = 241-spriteram[offs+2];
107107      flipx = spriteram[offs+1] & 0x40;
108108      flipy =   spriteram[offs+1] & 0x80;
109      if (flip_screen)
109      if (flip_screen_get())
110110      {
111111         if (spriteram[offs+1] & 0x20)
112112         {
src/mame/video/rallyx.c
r1771r1772
490490      x > cliprect->max_x)
491491      return;
492492
493   if (flip_screen_x)
493   if (flip_screen_x_get())
494494      x = 255 - x;
495495
496   if (flip_screen_y)
496   if (flip_screen_y_get())
497497      y = 255 - y;
498498
499499   if (colortable_entry_get_value(machine->colortable, *BITMAP_ADDR16(bitmap, y, x) % 0x144) == 0)
500      *BITMAP_ADDR16(bitmap, y, x) = machine->pens[STARS_COLOR_BASE + color];
500      *BITMAP_ADDR16(bitmap, y, x) = STARS_COLOR_BASE + color;
501501}
502502
503503static void draw_stars(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect )
r1771r1772
526526      int color = spriteram_2[offs + 1] & 0x3f;
527527      int flipx = spriteram[offs] & 1;
528528      int flipy = spriteram[offs] & 2;
529      if (flip_screen) sx -= 2*displacement;
529      if (flip_screen_get()) sx -= 2*displacement;
530530
531531      pdrawgfx(bitmap,machine->gfx[1],
532532            (spriteram[offs] & 0xfc) >> 2,
r1771r1772
551551      int flip = spriteram[offs] & 2;
552552
553553      /* handle reduced visible area in some games */
554      if (flip_screen && machine->screen[0].visarea.max_x == 32*8-1) sx += 32;
554      if (flip_screen_get() && machine->screen[0].visarea.max_x == 32*8-1) sx += 32;
555555
556556      pdrawgfx(bitmap,machine->gfx[1],
557557            ((spriteram[offs] & 0x7c) >> 2) + 0x20*(spriteram[offs] & 0x01) + ((spriteram[offs] & 0x80) >> 1),
r1771r1772
574574
575575      x = rallyx_radarx[offs] + ((~rallyx_radarattr[offs & 0x0f] & 0x01) << 8);
576576      y = 253 - rallyx_radary[offs];
577      if (flip_screen) x -= 3;
577      if (flip_screen_get()) x -= 3;
578578
579579      drawgfx(bitmap,machine->gfx[2],
580580            ((rallyx_radarattr[offs & 0x0f] & 0x0e) >> 1) ^ 0x07,
r1771r1772
625625      y = 252 - rallyx_radary[offs];
626626
627627      /* handle reduced visible area in some games */
628      if (flip_screen && machine->screen[0].visarea.max_x == 32*8-1) x += 32;
628      if (flip_screen_get() && machine->screen[0].visarea.max_x == 32*8-1) x += 32;
629629
630630      drawgfx(bitmap,machine->gfx[2],
631631            (rallyx_radarattr[offs & 0x0f] & 0x07) ^ 0x07,
r1771r1772
643643       the screen, and clip it to only the position where it is supposed to be shown */
644644   rectangle fg_clip = *cliprect;
645645   rectangle bg_clip = *cliprect;
646   if (flip_screen)
646   if (flip_screen_get())
647647   {
648648      bg_clip.min_x = 8*8;
649649      fg_clip.max_x = 8*8-1;
r1771r1772
675675       the screen, and clip it to only the position where it is supposed to be shown */
676676   rectangle fg_clip = *cliprect;
677677   rectangle bg_clip = *cliprect;
678   if (flip_screen)
678   if (flip_screen_get())
679679   {
680680      bg_clip.min_x = 8*8;
681681      fg_clip.max_x = 8*8-1;
r1771r1772
711711       the screen, and clip it to only the position where it is supposed to be shown */
712712   rectangle fg_clip = *cliprect;
713713   rectangle bg_clip = *cliprect;
714   if (flip_screen)
714   if (flip_screen_get())
715715   {
716716      bg_clip.min_x = 8*8;
717717      fg_clip.max_x = 8*8-1;
src/mame/video/unico.c
r1771r1772
359359#endif
360360
361361   /* The background color is the first of the last palette */
362   fillbitmap(bitmap,machine->pens[0x1f00],cliprect);
362   fillbitmap(bitmap,0x1f00,cliprect);
363363   fillbitmap(priority_bitmap,0,cliprect);
364364
365365   if (layers_ctrl & 1)   tilemap_draw(bitmap,cliprect,tilemap_0,0,1);
r1771r1772
398398#endif
399399
400400   /* The background color is the first of the last palette */
401   fillbitmap(bitmap,machine->pens[0x1f00],cliprect);
401   fillbitmap(bitmap,0x1f00,cliprect);
402402   fillbitmap(priority_bitmap,0,cliprect);
403403
404404   if (layers_ctrl & 1)   tilemap_draw(bitmap,cliprect,tilemap_0,0,1);
src/mame/video/gcpinbal.c
r1771r1772
318318   }
319319
320320   fillbitmap(priority_bitmap,0,cliprect);
321   fillbitmap(bitmap, machine->pens[0], cliprect);
321   fillbitmap(bitmap, 0, cliprect);
322322
323323   layer[0] = 0;
324324   layer[1] = 1;
src/mame/video/realbrk.c
r1771r1772
278278      xdim   =      ((zoom & 0x00ff) >> 0) << (16-6+4);
279279      ydim   =      ((zoom & 0xff00) >> 8) << (16-6+4);
280280
281      if (flip_screen_x)   {   flipx = !flipx;      sx = (max_x << 16) - sx - xnum * xdim;   }
282      if (flip_screen_y)   {   flipy = !flipy;      sy = (max_y << 16) - sy - ynum * ydim;   }
281      if (flip_screen_x_get())   {   flipx = !flipx;      sx = (max_x << 16) - sx - xnum * xdim;   }
282      if (flip_screen_y_get())   {   flipy = !flipy;      sy = (max_y << 16) - sy - ynum * ydim;   }
283283
284284      if (flipx)   { xstart = xnum-1;  xend = -1;    xinc = -1; }
285285      else      { xstart = 0;       xend = xnum;  xinc = +1; }
r1771r1772
313313            // buffer the tile and rotate it into bitmap
314314            if( rot )
315315            {
316               fillbitmap( tmpbitmap0, machine->pens[0], &spritetile_clip );
317               fillbitmap( tmpbitmap1, machine->pens[0], &spritetile_clip );
316               fillbitmap( tmpbitmap0, 0, &spritetile_clip );
317               fillbitmap( tmpbitmap1, 0, &spritetile_clip );
318318               drawgfxzoom(   tmpbitmap0,machine->gfx[gfx],
319319                           code++,
320320                           color,
r1771r1772
440440      xdim   =      ((zoom & 0x00ff) >> 0) << (16-6+4);
441441      ydim   =      ((zoom & 0xff00) >> 8) << (16-6+4);
442442
443      if (flip_screen_x)   {   flipx = !flipx;      sx = (max_x << 16) - sx - xnum * xdim;   }
444      if (flip_screen_y)   {   flipy = !flipy;      sy = (max_y << 16) - sy - ynum * ydim;   }
443      if (flip_screen_x_get())   {   flipx = !flipx;      sx = (max_x << 16) - sx - xnum * xdim;   }
444      if (flip_screen_y_get())   {   flipy = !flipy;      sy = (max_y << 16) - sy - ynum * ydim;   }
445445
446446      if (flipx)   { xstart = xnum-1;  xend = -1;    xinc = -1; }
447447      else      { xstart = 0;       xend = xnum;  xinc = +1; }
r1771r1772
536536      return 0;
537537   }
538538   else
539      fillbitmap(bitmap,machine->pens[realbrk_vregs[0xc/2] & 0x7fff],cliprect);
539      fillbitmap(bitmap,realbrk_vregs[0xc/2] & 0x7fff,cliprect);
540540
541541   if (layers_ctrl & 2)   tilemap_draw(bitmap,cliprect,tilemap_1,0,0);
542542   if (layers_ctrl & 1)   tilemap_draw(bitmap,cliprect,tilemap_0,0,0);
r1771r1772
604604      return 0;
605605   }
606606   else
607      fillbitmap(bitmap,machine->pens[realbrk_vregs[0xc/2] & 0x7fff],cliprect);
607      fillbitmap(bitmap,realbrk_vregs[0xc/2] & 0x7fff,cliprect);
608608
609609
610610
src/mame/video/flower.c
r1771r1772
7979      code |= ((source[2] & 0x01) << 6);
8080      code |= ((source[2] & 0x08) << 4);
8181
82      if(flip_screen)
82      if(flip_screen_get())
8383      {
8484         flipx = !flipx;
8585         flipy = !flipy;
r1771r1772
173173
174174   draw_sprites(machine,bitmap,cliprect);
175175
176   if(flip_screen)
176   if(flip_screen_get())
177177   {
178178      myclip.min_x = cliprect->min_x;
179179      myclip.max_x = cliprect->min_x + 15;
src/mame/video/xain.c
r1771r1772
184184      sy = 240 - spriteram[offs];
185185      if (sy <= -7) sy += 256;
186186      flipx = attr & 0x40;
187      if (flip_screen)
187      if (flip_screen_get())
188188      {
189189         sx = 239 - sx;
190190         sy = 240 - sy;
r1771r1772
196196         drawgfx(bitmap,machine->gfx[3],
197197               numtile,
198198               color,
199               flipx,flip_screen,
200               sx-1,flip_screen?sy+16:sy-16,
199               flipx,flip_screen_get(),
200               sx-1,flip_screen_get() ? sy+16:sy-16,
201201               cliprect,TRANSPARENCY_PEN,0);
202202         drawgfx(bitmap,machine->gfx[3],
203203               numtile+1,
204204               color,
205               flipx,flip_screen,
205               flipx,flip_screen_get(),
206206               sx-1,sy,
207207               cliprect,TRANSPARENCY_PEN,0);
208208      }
r1771r1772
211211         drawgfx(bitmap,machine->gfx[3],
212212               numtile,
213213               color,
214               flipx,flip_screen,
214               flipx,flip_screen_get(),
215215               sx,sy,
216216               cliprect,TRANSPARENCY_PEN,0);
217217      }
src/mame/video/namcos1.c
r1771r1772
138138
139139   /* all palette entries are not affected by shadow sprites... */
140140   for (i = 0;i < 0x2000;i++)
141      machine->shadow_table[machine->pens[i]] = machine->pens[i];
141      machine->shadow_table[i] = i;
142142   /* ... except for tilemap colors */
143143   for (i = 0x0800;i < 0x1000;i++)
144      machine->shadow_table[machine->pens[i]] = machine->pens[i + 0x0800];
144      machine->shadow_table[i] = i + 0x0800;
145145
146146   spriteram = &namcos1_spriteram[0x800];
147147
r1771r1772
309309      sx += sprite_xoffs;
310310      sy -= sprite_yoffs;
311311
312      if (flip_screen)
312      if (flip_screen_get())
313313      {
314314         sx = -sx - sizex;
315315         sy = -sy - sizey;
r1771r1772
345345
346346   /* flip screen is embedded in the sprite control registers */
347347   /* can't use flip_screen_set() because the visible area is asymmetrical */
348   flip_screen = spriteram[0x07f6] & 1;
349   tilemap_set_flip(ALL_TILEMAPS,flip_screen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
348   flip_screen_set_no_update(spriteram[0x07f6] & 1);
349   tilemap_set_flip(ALL_TILEMAPS,flip_screen_get() ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
350350
351351
352352   /* background color */
r1771r1772
378378      scrollx = ( namcos1_playfield_control[j+1] + (namcos1_playfield_control[j+0]<<8) ) - disp_x[i];
379379      scrolly = ( namcos1_playfield_control[j+3] + (namcos1_playfield_control[j+2]<<8) ) + 8;
380380
381      if (flip_screen)
381      if (flip_screen_get())
382382      {
383383         scrollx = -scrollx;
384384         scrolly = -scrolly;
src/mame/video/mrdo.c
r1771r1772
245245
246246VIDEO_UPDATE( mrdo )
247247{
248   fillbitmap(bitmap,machine->pens[0],cliprect);
248   fillbitmap(bitmap,0,cliprect);
249249   tilemap_draw(bitmap,cliprect,bg_tilemap,0,0);
250250   tilemap_draw(bitmap,cliprect,fg_tilemap,0,0);
251251   draw_sprites(machine,bitmap,cliprect);
src/mame/video/toki.c
r1771r1772
202202         flipy   = 0;
203203         tile    = (sprite_word[1] & 0xfff) + ((sprite_word[2] & 0x8000) >> 3);
204204
205         if (flip_screen) {
205         if (flip_screen_get()) {
206206            x=240-x;
207207            y=240-y;
208208            if (flipx) flipx=0; else flipx=1;
src/mame/video/renegade.c
r1771r1772
101101         if (sx > 248)
102102            sx -= 256;
103103
104         if (flip_screen)
104         if (flip_screen_get())
105105         {
106106            sx = 240 - sx;
107107            sy = 240 - sy;
r1771r1772
114114            drawgfx(bitmap, machine->gfx[sprite_bank],
115115               sprite_number + 1,
116116               color,
117               xflip, flip_screen,
118               sx, sy + (flip_screen ? -16 : 16),
117               xflip, flip_screen_get(),
118               sx, sy + (flip_screen_get() ? -16 : 16),
119119               cliprect, TRANSPARENCY_PEN, 0);
120120         }
121121         else
122122         {
123            sy += (flip_screen ? -16 : 16);
123            sy += (flip_screen_get() ? -16 : 16);
124124         }
125125         drawgfx(bitmap, machine->gfx[sprite_bank],
126126            sprite_number,
127127            color,
128            xflip, flip_screen,
128            xflip, flip_screen_get(),
129129            sx, sy,
130130            cliprect, TRANSPARENCY_PEN, 0);
131131      }
src/mame/video/galaga.c
r1771r1772
424424    int color = galaga_videoram[tile_index + 0x400] & 0x3f;
425425   SET_TILE_INFO(
426426         0,
427         (galaga_videoram[tile_index] & 0x7f) | (flip_screen ? 0x80 : 0) | (galaga_gfxbank << 8),
427         (galaga_videoram[tile_index] & 0x7f) | (flip_screen_get() ? 0x80 : 0) | (galaga_gfxbank << 8),
428428         color,
429         flip_screen ? TILE_FLIPX : 0);
429         flip_screen_get() ? TILE_FLIPX : 0);
430430   tileinfo->group = color;
431431}
432432
r1771r1772
516516      int sizey = (spriteram_3[offs] & 0x08) >> 3;
517517      int x,y;
518518
519      if (flip_screen)
519      if (flip_screen_get())
520520      {
521521         flipx ^= 1;
522522         flipy ^= 1;
src/mame/video/lasso.c
r1771r1772
231231static WRITE8_HANDLER( lasso_flip_screen_w )
232232{
233233   /* don't know which is which, but they are always set together */
234   flip_screen_x = data & 0x01;
235   flip_screen_y = data & 0x02;
234   flip_screen_x_set(data & 0x01);
235   flip_screen_y_set( data & 0x02);
236236
237   tilemap_set_flip(ALL_TILEMAPS, (flip_screen_x ? TILEMAP_FLIPX : 0) |
238                           (flip_screen_y ? TILEMAP_FLIPY : 0));
237   tilemap_set_flip(ALL_TILEMAPS, (flip_screen_x_get() ? TILEMAP_FLIPX : 0) |
238                           (flip_screen_y_get() ? TILEMAP_FLIPY : 0));
239239}
240240
241241
r1771r1772
309309      flipx = source[1] & 0x40;
310310      flipy = source[1] & 0x80;
311311
312      if (flip_screen_x)
312      if (flip_screen_x_get())
313313      {
314314         sx = 240 - sx;
315315         flipx = !flipx;
316316      }
317317
318      if (flip_screen_y)
318      if (flip_screen_y_get())
319319      {
320320         flipy = !flipy;
321321      }
r1771r1772
340340}
341341
342342
343static void draw_lasso(const pen_t *pens, mame_bitmap *bitmap, const rectangle *cliprect)
343static void draw_lasso(mame_bitmap *bitmap, const rectangle *cliprect)
344344{
345345   offs_t offs;
346   pen_t pen = pens[0x3f];
346   pen_t pen = 0x3f;
347347
348348   for (offs = 0; offs < 0x2000; offs++)
349349   {
r1771r1772
352352      UINT8 x;
353353      UINT8 y = offs >> 5;
354354
355      if (flip_screen_y)
355      if (flip_screen_y_get())
356356         y = ~y;
357357
358358      if ((y < cliprect->min_y) || (y > cliprect->max_y))
r1771r1772
361361      x = (offs & 0x1f) << 3;
362362      data = lasso_bitmap_ram[offs];
363363
364      if (flip_screen_x)
364      if (flip_screen_x_get())
365365         x = ~x;
366366
367367      for (bit = 0; bit < 8; bit++)
r1771r1772
369369         if ((data & 0x80) && (x >= cliprect->min_x) && (x <= cliprect->max_x))
370370            *BITMAP_ADDR16(bitmap, y, x) = pen;
371371
372         if (flip_screen_x)
372         if (flip_screen_x_get())
373373            x = x - 1;
374374         else
375375            x = x + 1;
r1771r1772
383383VIDEO_UPDATE( lasso )
384384{
385385   palette_set_color(machine, 0, get_color(*lasso_back_color));
386   fillbitmap(bitmap, machine->pens[0], cliprect);
386   fillbitmap(bitmap, 0, cliprect);
387387
388388   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
389   draw_lasso(machine->pens, bitmap, cliprect);
389   draw_lasso(bitmap, cliprect);
390390   draw_sprites(machine, bitmap, cliprect, 0);
391391
392392   return 0;
r1771r1772
395395VIDEO_UPDATE( chameleo )
396396{
397397   palette_set_color(machine, 0, get_color(*lasso_back_color));
398   fillbitmap(bitmap, machine->pens[0], cliprect);
398   fillbitmap(bitmap, 0, cliprect);
399399
400400   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
401401   draw_sprites(machine, bitmap, cliprect, 0);
src/mame/video/nbmj8688.c
r1771r1772
701701      copybitmap(bitmap, mjsikaku_tmpbitmap, 0, 0, 0, scrolly - 256, cliprect);
702702   }
703703   else
704   {
705      fillbitmap(bitmap, machine->pens[0], 0);
706   }
704      fillbitmap(bitmap, 0, 0);
705
707706   return 0;
708707}
709708
src/mame/video/psychic5.c
r1771r1772
318318      if (attr & 0x01) sx -= 256;
319319      if (attr & 0x04) sy -= 256;
320320
321      if (flip_screen)
321      if (flip_screen_get())
322322      {
323323         sx = 224 - sx;
324324         sy = 224 - sy;
r1771r1772
354354      }
355355      else
356356      {
357         if (flip_screen)
357         if (flip_screen_get())
358358            DRAW_SPRITE(code, sx + 16, sy + 16)
359359         else
360360            DRAW_SPRITE(code, sx, sy)
src/mame/video/taito_h.c
r1771r1772
427427   taitoh_log_vram();
428428#endif
429429
430   fillbitmap(bitmap, machine->pens[0], cliprect);
430   fillbitmap(bitmap, 0, cliprect);
431431
432432   TC0080VCO_tilemap_draw(machine,bitmap,cliprect,0,TILEMAP_DRAW_OPAQUE,0);
433433   TC0080VCO_tilemap_draw(machine,bitmap,cliprect,1,0,0);
r1771r1772
445445   taitoh_log_vram();
446446#endif
447447
448   fillbitmap(bitmap, machine->pens[0], cliprect);
448   fillbitmap(bitmap, 0, cliprect);
449449
450450#ifdef MAME_DEBUG
451451   if ( !input_code_pressed(KEYCODE_A) )
r1771r1772
476476   taitoh_log_vram();
477477#endif
478478
479   fillbitmap(bitmap, machine->pens[0], cliprect);
479   fillbitmap(bitmap, 0, cliprect);
480480
481481#ifdef MAME_DEBUG
482482   if ( !input_code_pressed(KEYCODE_A) )
src/mame/video/othunder.c
r1771r1772
232232   fillbitmap(priority_bitmap,0,cliprect);
233233
234234   /* Ensure screen blanked even when bottom layer not drawn due to disable bit */
235   fillbitmap(bitmap, machine->pens[0], cliprect);
235   fillbitmap(bitmap, 0, cliprect);
236236
237237   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],TILEMAP_DRAW_OPAQUE,1);
238238   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[1],0,2);
src/mame/video/ginganin.c
r1771r1772
280280
281281
282282   if (layers_ctrl1 & 1)   tilemap_draw(bitmap,cliprect, bg_tilemap,  0,0);
283   else               fillbitmap(bitmap,machine->pens[0],cliprect);
283   else               fillbitmap(bitmap,0,cliprect);
284284
285285   if (layers_ctrl1 & 2)   tilemap_draw(bitmap,cliprect, fg_tilemap,  0,0);
286286   if (layers_ctrl1 & 8)   draw_sprites(machine, bitmap,cliprect);
src/mame/video/tail2nos.c
r1771r1772
190190      tilemap_draw(bitmap,cliprect,bg_tilemap,0,0);
191191   }
192192   else
193      fillbitmap(bitmap,machine->pens[0],cliprect);
193      fillbitmap(bitmap,0,cliprect);
194194   return 0;
195195}
src/mame/video/quasar.c
r1771r1772
173173               int bx=255-9-cvs_bullet_ram[offs]-ct;
174174
175175               /* bullet/object Collision */
176            if (*BITMAP_ADDR8(s2636_0_bitmap, offs, bx) != 0) cvs_collision_register |= 0x04;
177            if (*BITMAP_ADDR8(s2636_2_bitmap, offs, bx) != 0) cvs_collision_register |= 0x08;
176            if (*BITMAP_ADDR16(s2636_0_bitmap, offs, bx) != 0) cvs_collision_register |= 0x04;
177            if (*BITMAP_ADDR16(s2636_2_bitmap, offs, bx) != 0) cvs_collision_register |= 0x08;
178178
179            *BITMAP_ADDR16(bitmap, offs, bx) = machine->pens[7];
179            *BITMAP_ADDR16(bitmap, offs, bx) = 7;
180180            }
181181        }
182182    }
r1771r1772
192192
193193         for (x = cliprect->min_x; x <= cliprect->max_x; x++)
194194         {
195            int pixel0 = *BITMAP_ADDR8(s2636_0_bitmap, y, x);
196            int pixel1 = *BITMAP_ADDR8(s2636_1_bitmap, y, x);
197            int pixel2 = *BITMAP_ADDR8(s2636_2_bitmap, y, x);
195            int pixel0 = *BITMAP_ADDR16(s2636_0_bitmap, y, x);
196            int pixel1 = *BITMAP_ADDR16(s2636_1_bitmap, y, x);
197            int pixel2 = *BITMAP_ADDR16(s2636_2_bitmap, y, x);
198198
199199            int pixel = pixel0 | pixel1 | pixel2;
200200
201201            if (S2636_IS_PIXEL_DRAWN(pixel))
202202            {
203               *BITMAP_ADDR16(bitmap, y, x) = machine->pens[S2636_PIXEL_COLOR(pixel)];
203               *BITMAP_ADDR16(bitmap, y, x) = S2636_PIXEL_COLOR(pixel);
204204
205205               /* S2636 vs. background collision detection */
206206               if (colortable_entry_get_value(machine->colortable, *BITMAP_ADDR16(cvs_collision_background, y, x)))
src/mame/video/mrjong.c
r1771r1772
8080
8181WRITE8_HANDLER( mrjong_flipscreen_w )
8282{
83   if (flip_screen != (data & 0x01))
83   if (flip_screen_get() != (data & 0x01))
8484   {
8585      flip_screen_set(data & 0x01);
8686      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
r1771r1772
119119
120120      sx = 224 - spriteram[offs + 2];
121121      sy = spriteram[offs + 0];
122      if (flip_screen)
122      if (flip_screen_get())
123123      {
124124         sx = 208 - sx;
125125         sy = 240 - sy;
src/mame/video/slapshot.c
r1771r1772
581581   spritepri[3] = TC0360PRI_regs[7] >> 4;
582582
583583   fillbitmap(priority_bitmap,0,cliprect);
584   fillbitmap(bitmap,machine->pens[0],cliprect);
584   fillbitmap(bitmap,0,cliprect);
585585
586586#ifdef MAME_DEBUG
587587   if (dislayer[layer[0]]==0)
src/mame/video/victory.c
r1771r1772
11301130      }
11311131
11321132      /* draw the scanline */
1133      draw_scanline8(bitmap, 0, y, 256, scanline, machine->pens, -1);
1133      draw_scanline8(bitmap, 0, y, 256, scanline, NULL, -1);
11341134   }
11351135
11361136   return 0;
src/mame/video/1943.c
r1771r1772
205205      int sx = spriteram[offs + 3] - ((attr & 0x10) << 4);
206206      int sy = spriteram[offs + 2];
207207
208      if (flip_screen)
208      if (flip_screen_get())
209209      {
210210         sx = 240 - sx;
211211         sy = 240 - sy;
r1771r1772
216216      {
217217         if (color != 0x0a && color != 0x0b)
218218         {
219            drawgfx(bitmap, machine->gfx[3], code, color, flip_screen, flip_screen,
219            drawgfx(bitmap, machine->gfx[3], code, color, flip_screen_get(), flip_screen_get(),
220220               sx, sy, cliprect, TRANSPARENCY_PEN, 0);
221221         }
222222      }
r1771r1772
224224      {
225225         if (color == 0x0a || color == 0x0b)
226226         {
227            drawgfx(bitmap, machine->gfx[3], code, color, flip_screen, flip_screen,
227            drawgfx(bitmap, machine->gfx[3], code, color, flip_screen_get(), flip_screen_get(),
228228               sx, sy, cliprect, TRANSPARENCY_PEN, 0);
229229         }
230230      }
src/mame/video/psikyo4.c
r1771r1772
127127{
128128   if (screen==0)
129129   {
130      fillbitmap(bitmap, machine->pens[0x1000], cliprect);
130      fillbitmap(bitmap, 0x1000, cliprect);
131131      draw_sprites(machine, bitmap, cliprect, 0x0000);
132132   }
133133   else if (screen==1)
134134   {
135      fillbitmap(bitmap, machine->pens[0x1001], cliprect);
135      fillbitmap(bitmap, 0x1001, cliprect);
136136      draw_sprites(machine, bitmap, cliprect, 0x2000);
137137   }
138138   return 0;
src/mame/video/pacland.c
r1771r1772
310310      sprite &= ~sizex;
311311      sprite &= ~(sizey << 1);
312312
313      if (flip_screen)
313      if (flip_screen_get())
314314      {
315315         flipx ^= 1;
316316         flipy ^= 1;
r1771r1772
380380   int row;
381381
382382   for (row = 5; row < 29; row++)
383      tilemap_set_scrollx(fg_tilemap, row, flip_screen ? scroll0-7 : scroll0);
384   tilemap_set_scrollx(bg_tilemap, 0, flip_screen ? scroll1-4 : scroll1-3);
383      tilemap_set_scrollx(fg_tilemap, row, flip_screen_get() ? scroll0-7 : scroll0);
384   tilemap_set_scrollx(bg_tilemap, 0, flip_screen_get() ? scroll1-4 : scroll1-3);
385385
386386   /* draw high priority sprite pixels, setting priority bitmap to non-zero
387387       wherever there is a high-priority pixel; note that we draw to the bitmap
src/mame/video/cninja.c
r1771r1772
197197         inc = 1;
198198      }
199199
200      if (flip_screen) {
200      if (flip_screen_get()) {
201201         y=240-y;
202202         x=240-x;
203203         if (fx) fx=0; else fx=1;
r1771r1772
265265         inc = 1;
266266      }
267267
268      if (flip_screen) {
268      if (flip_screen_get()) {
269269         y=240-y;
270270         x=304-x;
271271         if (fx) fx=0; else fx=1;
r1771r1772
355355      fx = (spriteptr[offs+0]&0x4000);
356356      fy = (spriteptr[offs+0]&0x8000);
357357
358      if (flip_screen) {
358      if (flip_screen_get()) {
359359         if (fx) fx=0; else fx=1;
360360         if (fy) fy=0; else fy=1;
361361
r1771r1772
404404
405405   /* Draw playfields */
406406   fillbitmap(priority_bitmap,0,cliprect);
407   fillbitmap(bitmap,machine->pens[512],cliprect);
407   fillbitmap(bitmap,512,cliprect);
408408   deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE,1);
409409   deco16_tilemap_3_draw(bitmap,cliprect,0,2);
410410   deco16_tilemap_2_draw(bitmap,cliprect,TILEMAP_DRAW_LAYER1,2);
r1771r1772
421421   deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll);
422422
423423   fillbitmap(priority_bitmap,0,cliprect);
424   fillbitmap(bitmap,machine->pens[0],cliprect);
424   fillbitmap(bitmap,0,cliprect);
425425   deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE,1);
426426   if (deco16_raster_display_position)
427427      raster_pf3_draw(bitmap,cliprect,0,2);
r1771r1772
453453
454454   /* Draw playfields */
455455   fillbitmap(priority_bitmap,0,cliprect);
456   fillbitmap(bitmap,machine->pens[0x200],cliprect);
456   fillbitmap(bitmap,0x200,cliprect);
457457   if ((deco16_priority&4)==0)
458458      deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE,1);
459459
r1771r1772
488488   deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll);
489489
490490   /* Draw playfields */
491   fillbitmap(bitmap,machine->pens[0x400],cliprect); /* Confirmed */
491   fillbitmap(bitmap,0x400,cliprect); /* Confirmed */
492492
493493   /* There is no priority prom on this board, but there is a
494494    priority control word, the only values used in game appear
src/mame/video/rollrace.c
r1771r1772
6666   int col;
6767
6868   /* fill in background colour*/
69   fillbitmap(bitmap,machine->pens[ra_bkgpen],&machine->screen[0].visarea);
69   fillbitmap(bitmap,ra_bkgpen,&machine->screen[0].visarea);
7070
7171   /* draw road */
7272   for (offs = videoram_size - 1;offs >= 0;offs--)
src/mame/video/jack.c
r1771r1772
7373      flipx = (spriteram[offs + 3] & 0x80);
7474      flipy = (spriteram[offs + 3] & 0x40);
7575
76      if (flip_screen)
76      if (flip_screen_get())
7777      {
7878         sx = 248 - sx;
7979         sy = 248 - sy;
r1771r1772
154154      flipx = (spriteram[offs + 3] & 0x80);
155155      flipy = (spriteram[offs + 3] & 0x40);
156156
157      if (flip_screen)
157      if (flip_screen_get())
158158      {
159159         sx = 248 - sx;
160160         sy = 248 - sy;
src/mame/video/tumblep.c
r1771r1772
5757         inc = 1;
5858      }
5959
60      if (flip_screen)
60      if (flip_screen_get())
6161      {
6262         y=240-y;
6363         x=304-x;
r1771r1772
9191   flip_screen_set( deco16_pf12_control[0]&0x80 );
9292   deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll);
9393
94   fillbitmap(bitmap,machine->pens[256],cliprect); /* not verified */
94   fillbitmap(bitmap,256,cliprect); /* not verified */
9595
9696   deco16_tilemap_2_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0);
9797   deco16_tilemap_1_draw(bitmap,cliprect,0,0);
src/mame/video/dogfgt.c
r1771r1772
128128
129129      for (i = 0;i < 3;i++)
130130         color |= ((bitmapram[offset + BITMAPRAM_SIZE/3 * i] >> subx) & 1) << i;
131      if (flip_screen)
131      if (flip_screen_get())
132132         *BITMAP_ADDR16(pixbitmap, y^0xff, (x+subx)^0xff) = PIXMAP_COLOR_BASE + 8*pixcolor + color;
133133      else
134134         *BITMAP_ADDR16(pixbitmap, y, x+subx) = PIXMAP_COLOR_BASE + 8*pixcolor + color;
r1771r1772
199199         sy = (240 - spriteram[offs+2]) & 0xff;
200200         flipx = spriteram[offs] & 0x04;
201201         flipy = spriteram[offs] & 0x02;
202         if (flip_screen)
202         if (flip_screen_get())
203203         {
204204            sx = 240 - sx;
205205            sy = 240 - sy;
r1771r1772
224224   int offs;
225225
226226
227   if (lastflip != flip_screen || lastpixcolor != pixcolor)
227   if (lastflip != flip_screen_get() || lastpixcolor != pixcolor)
228228   {
229      lastflip = flip_screen;
229      lastflip = flip_screen_get();
230230      lastpixcolor = pixcolor;
231231
232232      for (offs = 0;offs < BITMAPRAM_SIZE;offs++)
r1771r1772
238238
239239   draw_sprites(machine, bitmap, cliprect);
240240
241   copybitmap_trans(bitmap,pixbitmap,0,0,0,0,cliprect,machine->pens[PIXMAP_COLOR_BASE + 8*pixcolor]);
241   copybitmap_trans(bitmap,pixbitmap,0,0,0,0,cliprect,PIXMAP_COLOR_BASE + 8*pixcolor);
242242   return 0;
243243}
src/mame/video/dietgo.c
r1771r1772
4242         inc = 1;
4343      }
4444
45      if (flip_screen)
45      if (flip_screen_get())
4646      {
4747         y=240-y;
4848         x=304-x;
r1771r1772
8484   flip_screen_set( deco16_pf12_control[0]&0x80 );
8585   deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll);
8686
87   fillbitmap(bitmap,machine->pens[256],cliprect); /* not verified */
87   fillbitmap(bitmap,256,cliprect); /* not verified */
8888
8989   deco16_tilemap_2_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0);
9090   deco16_tilemap_1_draw(bitmap,cliprect,0,0);
src/mame/video/taitosj.c
r1771r1772
771771   int i = 0;
772772
773773   /* fill the screen with the background color */
774   fillbitmap(bitmap, machine->pens[8 * (taitosj_colorbank[1] & 0x07)], cliprect);
774   fillbitmap(bitmap, 8 * (taitosj_colorbank[1] & 0x07), cliprect);
775775
776776   for (i = 0; i < 4; i++)
777777   {
src/mame/video/kingobox.c
r1771r1772
174174      tilemap_mark_all_tiles_dirty(bg_tilemap);
175175   }
176176
177   if (flip_screen != (data & 0x80))
177   if (flip_screen_get() != (data & 0x80))
178178   {
179179      flip_screen_set(data & 0x80);
180180      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
r1771r1772
229229      sx = spriteram[roffs+1];
230230      sy = spriteram[roffs];
231231
232      if (flip_screen)
232      if (flip_screen_get())
233233      {
234234         sx = 240 - sx;
235235         sy = 240 - sy;
r1771r1772
289289      int sx = spriteram[offs+2];
290290      int sy = spriteram[offs];
291291
292      if (flip_screen)
292      if (flip_screen_get())
293293      {
294294         sx = 240 - sx;
295295         sy = 240 - sy;
src/mame/video/nbmj8991.c
r1771r1772
338338      copyscrollbitmap(bitmap, nbmj8991_tmpbitmap, 1, &scrollx, 1, &scrolly, cliprect);
339339   }
340340   else
341      fillbitmap(bitmap, machine->pens[0x00], 0);
341      fillbitmap(bitmap, 0, 0);
342342
343343   return 0;
344344}
r1771r1772
378378      copyscrollbitmap(bitmap, nbmj8991_tmpbitmap, 1, &scrollx, 1, &scrolly, cliprect);
379379   }
380380   else
381      fillbitmap(bitmap, machine->pens[0x00], 0);
381      fillbitmap(bitmap, 0, 0);
382382
383383   return 0;
384384}
src/mame/video/galivan.c
r1771r1772
392392   tilemap_set_scrolly(bg_tilemap,0,scrolly[0] + 256 * (scrolly[1] & 0x07));
393393
394394   if (layers & 0x40)
395      fillbitmap(bitmap,machine->pens[0],cliprect);
395      fillbitmap(bitmap,0,cliprect);
396396   else
397397      tilemap_draw(bitmap,cliprect,bg_tilemap,0,0);
398398
r1771r1772
416416   tilemap_set_scrolly(bg_tilemap,0,scrolly[0] + 256 * (scrolly[1] & 0xff));
417417
418418   if (ninjemak_dispdisable)
419      fillbitmap(bitmap,machine->pens[0],cliprect);
419      fillbitmap(bitmap,0,cliprect);
420420   else
421421      tilemap_draw(bitmap,cliprect,bg_tilemap,0,0);
422422
src/mame/video/tsamurai.c
r1771r1772
173173      /* So I'm using this specific check. -kal 11 jul 2002 */
174174//      if(sprite_type == 1) sy=sy+2;
175175
176      if( flip_screen )
176      if( flip_screen_get() )
177177      {
178178         drawgfx( bitmap,gfx,
179179            sprite_number&0x7f,
r1771r1772
216216        Note that the background color register isn't well understood
217217        (screenshots would be helpful)
218218    */
219   fillbitmap(bitmap,machine->pens[bgcolor],cliprect);
219   fillbitmap(bitmap,bgcolor,cliprect);
220220   tilemap_draw(bitmap,cliprect,background,0,0);
221221   draw_sprites(machine, bitmap,cliprect);
222222   tilemap_draw(bitmap,cliprect,foreground,0,0);
src/mame/video/splash.c
r1771r1772
8989   tilemap_mark_tile_dirty(bg_tilemap[offset >> 11],((offset << 1) & 0x0fff) >> 1);
9090}
9191
92static void draw_bitmap(running_machine *machine, mame_bitmap *bitmap,const rectangle *cliprect)
92static void draw_bitmap(mame_bitmap *bitmap,const rectangle *cliprect)
9393{
9494   int sx,sy,color,count,colxor,bitswap;
9595   colxor = 0; /* splash and some bitmap modes in roldfrog */
r1771r1772
165165         }
166166
167167         if (sy >= cliprect->min_y && sy <= cliprect->max_y && sx-9 >= cliprect->min_x && sx-9 <= cliprect->max_x)
168            *BITMAP_ADDR16(bitmap, sy, sx-9) = machine->pens[0x300+(color^colxor)];
168            *BITMAP_ADDR16(bitmap, sy, sx-9) = 0x300+(color^colxor);
169169      }
170170   }
171171
r1771r1772
268268   tilemap_set_scrolly(bg_tilemap[0], 0, splash_vregs[0]);
269269   tilemap_set_scrolly(bg_tilemap[1], 0, splash_vregs[1]);
270270
271   draw_bitmap(machine, bitmap,cliprect);
271   draw_bitmap(bitmap,cliprect);
272272
273273   tilemap_draw(bitmap,cliprect,bg_tilemap[1],0,0);
274274   splash_draw_sprites(machine, bitmap,cliprect);
r1771r1772
282282   tilemap_set_scrolly(bg_tilemap[0], 0, splash_vregs[0]);
283283   tilemap_set_scrolly(bg_tilemap[1], 0, splash_vregs[1]);
284284
285   draw_bitmap(machine, bitmap,cliprect);
285   draw_bitmap(bitmap,cliprect);
286286
287287   tilemap_draw(bitmap,cliprect,bg_tilemap[1],0,0);
288288   /*Sprite chip is similar but not the same*/
src/mame/video/kan_panb.c
r1771r1772
3030      x = dx;
3131      y = dy;
3232
33      if (flip_screen)
33      if (flip_screen_get())
3434      {
3535         sx = 240 - x;
3636         sy = 240 - y;
r1771r1772
6262      x = dx;
6363      y = dy;
6464
65      if (flip_screen)
65      if (flip_screen_get())
6666      {
6767         sx = 240 - x;
6868         sy = 240 - y;
r1771r1772
117117      x = dx;
118118      y = dy;
119119
120      if (flip_screen)
120      if (flip_screen_get())
121121      {
122122         sx = 240 - x;
123123         sy = 240 - y;
r1771r1772
165165
166166      if (wrapr == 8) xpos -= 256;
167167
168      if (flip_screen)
168      if (flip_screen_get())
169169      {
170170         xpos = 240 - xpos;
171171         ypos = 240 - ypos;
r1771r1772
245245      if (x > 511) x &= 0x1ff;
246246      if (y > 511) y &= 0x1ff;
247247
248      if (flip_screen)
248      if (flip_screen_get())
249249      {
250250         sx = 240 - x;
251251         sy = 240 - y;
src/mame/video/exidy440.c
r1771r1772
286286 *
287287 *************************************/
288288
289static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, int scroll_offset)
289static void draw_sprites(mame_bitmap *bitmap, const rectangle *cliprect, int scroll_offset)
290290{
291291   int i;
292292
r1771r1772
351351               {
352352                  /* combine with the background */
353353                  pen = left | old[0];
354                  *BITMAP_ADDR16(bitmap, yoffs, currx) = machine->pens[pen];
354                  *BITMAP_ADDR16(bitmap, yoffs, currx) = pen;
355355
356356                  /* check the collisions bit */
357357                  if ((palette[2 * pen] & 0x80) && count++ < 128)
r1771r1772
364364               {
365365                  /* combine with the background */
366366                  pen = right | old[1];
367                  *BITMAP_ADDR16(bitmap, yoffs, currx) = machine->pens[pen];
367                  *BITMAP_ADDR16(bitmap, yoffs, currx) = pen;
368368
369369                  /* check the collisions bit */
370370                  if ((palette[2 * pen] & 0x80) && count++ < 128)
r1771r1772
404404   }
405405
406406   /* draw the sprites */
407   draw_sprites(machine, bitmap, cliprect, scroll_offset);
407   draw_sprites(bitmap, cliprect, scroll_offset);
408408}
409409
410410
src/mame/video/exzisus.c
r1771r1772
8383   int gfx_num, gfx_attr, gfx_offs;
8484
8585   /* Is this correct ? */
86   fillbitmap(bitmap, machine->pens[1023], cliprect);
86   fillbitmap(bitmap, 1023, cliprect);
8787
8888   /* ---------- 1st TC0010VCU ---------- */
8989   sx = 0;
r1771r1772
138138            x = (sx + (xc << 3)) & 0xff;
139139            y = (sy + (yc << 3)) & 0xff;
140140
141            if (flip_screen)
141            if (flip_screen_get())
142142            {
143143               x = 248 - x;
144144               y = 248 - y;
r1771r1772
147147            drawgfx(bitmap, machine->gfx[0],
148148                  code & 0x3fff,
149149                  color,
150                  flip_screen, flip_screen,
150                  flip_screen_get(), flip_screen_get(),
151151                  x, y,
152152                  cliprect, TRANSPARENCY_PEN, 15);
153153            goffs += 2;
r1771r1772
208208            x = (sx + (xc << 3)) & 0xff;
209209            y = (sy + (yc << 3)) & 0xff;
210210
211            if (flip_screen)
211            if (flip_screen_get())
212212            {
213213               x = 248 - x;
214214               y = 248 - y;
r1771r1772
217217            drawgfx(bitmap, machine->gfx[1],
218218                  code & 0x3fff,
219219                  color,
220                  flip_screen, flip_screen,
220                  flip_screen_get(), flip_screen_get(),
221221                  x, y,
222222                  cliprect, TRANSPARENCY_PEN, 15);
223223            goffs += 2;
src/mame/video/dassault.c
r1771r1772
7272            inc = 1;
7373         }
7474
75         if (flip_screen) {
75         if (flip_screen_get()) {
7676            y=240-y;
7777            x=304-x;
7878            if (fx) fx=0; else fx=1;
src/mame/video/gotya.c
r1771r1772
8585
8686   scroll_bit_8 = data & 0x01;
8787
88   if (flip_screen != (data & 0x02))
88   if (flip_screen_get() != (data & 0x02))
8989   {
9090      flip_screen_set(data & 0x02);
9191      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
r1771r1772
118118{
119119   int row;
120120
121   if (flip_screen)
121   if (flip_screen_get())
122122   {
123123      sx = 35 - sx;
124124   }
r1771r1772
127127   {
128128      int sy;
129129
130      if (flip_screen)
130      if (flip_screen_get())
131131      {
132132         sy = row;
133133      }
r1771r1772
139139      drawgfx(bitmap,machine->gfx[0],
140140         gotya_videoram2[row * 32 + col],
141141         gotya_videoram2[row * 32 + col + 0x10] & 0x0f,
142         flip_screen_x, flip_screen_y,
142         flip_screen_x_get(), flip_screen_y_get(),
143143         8 * sx, 8 * sy,
144144         cliprect,
145145         TRANSPARENCY_NONE, 0);
r1771r1772
157157      int sx = 256 - spriteram[offs + 0x10] + (spriteram[offs + 0x01] & 0x01) * 256;
158158      int sy = spriteram[offs + 0x00];
159159
160      if (flip_screen)
160      if (flip_screen_get())
161161      {
162162         sy = 240 - sy;
163163      }
164164
165165      drawgfx(bitmap,machine->gfx[1],
166166         code, color,
167         flip_screen_x, flip_screen_y,
167         flip_screen_x_get(), flip_screen_y_get(),
168168         sx, sy,
169169         cliprect,
170170         TRANSPARENCY_PEN, 0);
src/mame/video/supbtime.c
r1771r1772
5858         inc = 1;
5959      }
6060
61      if (flip_screen)
61      if (flip_screen_get())
6262      {
6363         y=240-y;
6464         x=304-x;
r1771r1772
9494   flip_screen_set( deco16_pf12_control[0]&0x80 );
9595   deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll);
9696
97   fillbitmap(bitmap,machine->pens[768],cliprect);
97   fillbitmap(bitmap,768,cliprect);
9898
9999   deco16_tilemap_2_draw(bitmap,cliprect,0,0);
100100   draw_sprites(machine, bitmap,cliprect);
src/mame/video/retofinv.c
r1771r1772
205205      sprite &= ~sizex;
206206      sprite &= ~(sizey << 1);
207207
208      if (flip_screen)
208      if (flip_screen_get())
209209      {
210210         flipx ^= 1;
211211         flipy ^= 1;
src/mame/video/bogeyman.c
r1771r1772
118118
119119         if (multi) sy -= 16;
120120
121         if (flip_screen)
121         if (flip_screen_get())
122122         {
123123            sx = 240 - sx;
124124            sy = 240 - sy;
r1771r1772
138138            drawgfx(bitmap,machine->gfx[2],
139139               code + 1, color,
140140               flipx, flipy,
141               sx, sy + (flip_screen ? -16 : 16),
141               sx, sy + (flip_screen_get() ? -16 : 16),
142142               cliprect,
143143               TRANSPARENCY_PEN, 0);
144144         }
src/mame/video/srmp2.c
r1771r1772
434434
435435VIDEO_UPDATE( srmp2 )
436436{
437   fillbitmap(bitmap, machine->pens[0x1f0], cliprect);
437   fillbitmap(bitmap, 0x1f0, cliprect);
438438   srmp2_draw_sprites(machine, bitmap, cliprect);
439439   return 0;
440440}
r1771r1772
442442
443443VIDEO_UPDATE( srmp3 )
444444{
445   fillbitmap(bitmap, machine->pens[0x1f0], cliprect);
445   fillbitmap(bitmap, 0x1f0, cliprect);
446446   srmp3_draw_sprites(machine, bitmap, cliprect);
447447   return 0;
448448}
r1771r1772
450450
451451VIDEO_UPDATE( mjyuugi )
452452{
453   fillbitmap(bitmap, machine->pens[0x1f0], cliprect);
453   fillbitmap(bitmap, 0x1f0, cliprect);
454454   mjyuugi_draw_sprites(machine, bitmap, cliprect);
455455   return 0;
456456}
src/mame/video/m72.c
r1771r1772
422422      h = 1 << ((m72_spriteram[offs+2] & 0x3000) >> 12);
423423      sy -= 16 * h;
424424
425      if (flip_screen)
425      if (flip_screen_get())
426426      {
427427         sx = 512 - 16*w - sx;
428428         sy = 284 - 16*h - sy;
r1771r1772
474474      h = 1 << ((spriteram16_2[offs+2] & 0x3000) >> 12);
475475      sy -= 16 * h;
476476
477      if (flip_screen)
477      if (flip_screen_get())
478478      {
479479         sx = 512 - 16*w - sx;
480480         sy = 256 - 16*h - sy;
src/mame/video/pokechmp.c
r1771r1772
1212
1313WRITE8_HANDLER( pokechmp_flipscreen_w )
1414{
15   if (flip_screen != (data & 0x80))
15   if (flip_screen_get() != (data & 0x80))
1616   {
1717      flip_screen_set(data & 0x80);
1818      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
r1771r1772
4949
5050         flipx = spriteram[offs+1] & 0x04;
5151         flipy = spriteram[offs+1] & 0x02;
52         if (flip_screen) {
52         if (flip_screen_get()) {
5353            sx=240-sx;
5454            sy=240-sy;
5555            if (flipx) flipx=0; else flipx=1;
src/mame/video/snk68.c
r1771r1772
160160      my=0x200 - my;
161161      my-=0x200;
162162
163      if (flip_screen) {
163      if (flip_screen_get()) {
164164         mx=240-mx;
165165         my=240-my;
166166      }
r1771r1772
174174            fx=tile&0x4000;
175175            tile&=0x3fff;
176176
177            if (flip_screen) {
177            if (flip_screen_get()) {
178178               if (fx) fx=0; else fx=1;
179179               if (fy) fy=0; else fy=1;
180180            }
r1771r1772
187187               cliprect,TRANSPARENCY_PEN,0);
188188         }
189189
190         if (flip_screen) {
190         if (flip_screen_get()) {
191191            my-=16;
192192            if (my < -0x100) my+=0x200;
193193         }
r1771r1772
202202
203203VIDEO_UPDATE( pow )
204204{
205   fillbitmap(bitmap,machine->pens[2047],cliprect);
205   fillbitmap(bitmap,2047,cliprect);
206206
207207   /* This appears to be correct priority */
208208   draw_sprites(machine, bitmap,cliprect,1,0x000);
r1771r1772
237237      my=0x200 - my;
238238      my-=0x200;
239239
240      if (flip_screen) {
240      if (flip_screen_get()) {
241241         mx=240-mx;
242242         my=240-my;
243243      }
r1771r1772
254254               fx=tile&0x8000;
255255            }
256256
257            if (flip_screen) {
257            if (flip_screen_get()) {
258258               if (fx) fx=0; else fx=1;
259259               if (fy) fy=0; else fy=1;
260260            }
r1771r1772
269269               mx,my,
270270               cliprect,TRANSPARENCY_PEN,0);
271271         }
272         if (flip_screen) {
272         if (flip_screen_get()) {
273273            my-=16;
274274            if (my < -0x100) my+=0x200;
275275         }
r1771r1772
284284
285285VIDEO_UPDATE( searchar )
286286{
287   fillbitmap(bitmap,machine->pens[2047],cliprect);
287   fillbitmap(bitmap,2047,cliprect);
288288
289289   /* This appears to be correct priority */
290290   draw_sprites2(machine, bitmap,cliprect,8,0x2000,0x000);
src/mame/video/madalien.c
r1771r1772
185185}
186186
187187
188static void draw_edges(mame_bitmap *bitmap, const rectangle *cliprect, int flip_screen, int scroll_mode)
188static void draw_edges(mame_bitmap *bitmap, const rectangle *cliprect, int flip, int scroll_mode)
189189{
190190   rectangle clip_edge1;
191191   rectangle clip_edge2;
r1771r1772
193193   clip_edge1 = *cliprect;
194194   clip_edge2 = *cliprect;
195195
196   if (flip_screen)
196   if (flip)
197197   {
198198      clip_edge1.min_y = *madalien_edge1_pos | 0x80;
199199      clip_edge2.max_y = (*madalien_edge2_pos & 0x7f) ^ 0x7f;
r1771r1772
210210   tilemap_mark_all_tiles_dirty(tilemap_edge1[scroll_mode]);
211211   tilemap_mark_all_tiles_dirty(tilemap_edge2[scroll_mode]);
212212
213   tilemap_set_flip(tilemap_edge1[scroll_mode], flip_screen ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
213   tilemap_set_flip(tilemap_edge1[scroll_mode], flip ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
214214   tilemap_set_scrollx(tilemap_edge1[scroll_mode], 0, -(*madalien_scroll & 0xfc));
215215   tilemap_set_scrolly(tilemap_edge1[scroll_mode], 0, *madalien_edge1_pos & 0x7f);
216216
217   tilemap_set_flip(tilemap_edge2[scroll_mode], flip_screen ? TILEMAP_FLIPX : TILEMAP_FLIPY);
217   tilemap_set_flip(tilemap_edge2[scroll_mode], flip ? TILEMAP_FLIPX : TILEMAP_FLIPY);
218218   tilemap_set_scrollx(tilemap_edge2[scroll_mode], 0, -(*madalien_scroll & 0xfc));
219219   tilemap_set_scrolly(tilemap_edge2[scroll_mode], 0, *madalien_edge2_pos & 0x7f);
220220
r1771r1772
223223}
224224
225225
226static void draw_headlight(mame_bitmap *bitmap, const rectangle *cliprect, int flip_screen)
226static void draw_headlight(mame_bitmap *bitmap, const rectangle *cliprect, int flip)
227227{
228228   if (BIT(*madalien_video_flags, 0))
229229   {
r1771r1772
234234         UINT8 x;
235235         UINT8 hy = y - *madalien_headlight_pos;
236236
237         if (flip_screen)
237         if (flip)
238238            hy = ~hy;
239239
240240         if ((hy < cliprect->min_y) || (hy > cliprect->max_y))
r1771r1772
244244         {
245245            UINT8 hx = x;
246246
247            if (flip_screen)
247            if (flip)
248248               hx = ~hx;
249249
250250            if ((hx < cliprect->min_x) || (hx > cliprect->max_x))
r1771r1772
258258}
259259
260260
261static void draw_foreground(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, int flip_screen)
261static void draw_foreground(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, int flip)
262262{
263263   int i;
264264
r1771r1772
266266      decodechar(machine->gfx[0], i, madalien_charram);
267267
268268   tilemap_mark_all_tiles_dirty(tilemap_fg);
269   tilemap_set_flip(tilemap_fg, flip_screen ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
269   tilemap_set_flip(tilemap_fg, flip ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
270270   tilemap_draw(bitmap, cliprect, tilemap_fg, 0, 0);
271271}
272272
273273
274274static VIDEO_UPDATE( madalien )
275275{
276   int flip_screen = BIT(readinputportbytag("DIP"), 6) && BIT(*madalien_video_control, 0);
276   int flip = BIT(readinputportbytag("DIP"), 6) && BIT(*madalien_video_control, 0);
277277
278278   // bits #0 and #1 define scrolling mode
279279   //
r1771r1772
284284   // mode 3 - transition from A to B
285285   int scroll_mode = *madalien_scroll & 3;
286286
287   fillbitmap(bitmap, machine->pens[0], cliprect);
288   draw_edges(bitmap, cliprect, flip_screen, scroll_mode);
289   draw_foreground(machine, bitmap, cliprect, flip_screen);
287   fillbitmap(bitmap, 0, cliprect);
288   draw_edges(bitmap, cliprect, flip, scroll_mode);
289   draw_foreground(machine, bitmap, cliprect, flip);
290290
291291   /* highlight section A (outside of tunnels) */
292292
r1771r1772
304304      if (scroll_mode == 3)
305305         max_x = (*madalien_scroll & 0xfc) - 1;
306306
307      if (flip_screen)
307      if (flip)
308308      {
309309         int max_x_save = max_x;
310310         max_x = 0xff - min_x;
r1771r1772
317317               *BITMAP_ADDR16(bitmap, y, x) |= 8;
318318   }
319319
320   draw_headlight(bitmap, cliprect, flip_screen);
320   draw_headlight(bitmap, cliprect, flip);
321321
322322   return 0;
323323}
src/mame/video/aeroboto.c
r1771r1772
7575
7676READ8_HANDLER( aeroboto_in0_r )
7777{
78   return readinputport(flip_screen ? 1 : 0);
78   return readinputport(flip_screen_get() ? 1 : 0);
7979}
8080
8181WRITE8_HANDLER( aeroboto_3000_w )
r1771r1772
126126      int x = spriteram[offs+3];
127127      int y = 240 - spriteram[offs];
128128
129      if (flip_screen)
129      if (flip_screen_get())
130130      {
131131         x = 248 - x;
132132         y = 240 - y;
r1771r1772
135135      drawgfx(bitmap, machine->gfx[1],
136136            spriteram[offs+1],
137137            spriteram[offs+2] & 0x07,
138            flip_screen, flip_screen,
138            flip_screen_get(), flip_screen_get(),
139139            ((x + 8) & 0xff) - 8, y,
140140            cliprect, TRANSPARENCY_PEN, 0);
141141   }
src/mame/video/firetrap.c
r1771r1772
227227      color = ((spriteram[offs + 1] & 0x08) >> 2) | (spriteram[offs + 1] & 0x01);
228228      flipx = spriteram[offs + 1] & 0x04;
229229      flipy = spriteram[offs + 1] & 0x02;
230      if (flip_screen)
230      if (flip_screen_get())
231231      {
232232         sx = 240 - sx;
233233         sy = 240 - sy;
r1771r1772
237237
238238      if (spriteram[offs + 1] & 0x10)   /* double width */
239239      {
240         if (flip_screen) sy -= 16;
240         if (flip_screen_get()) sy -= 16;
241241
242242         drawgfx(bitmap,machine->gfx[3],
243243               code & ~1,
src/mame/video/thedeep.c
r1771r1772
176176      if (color & 1)   sx -= 256;
177177      if (attr  & 1)   sy -= 256;
178178
179      if (flip_screen)
179      if (flip_screen_get())
180180      {
181181         flipx = !flipx;
182182         flipy = !flipy;
src/mame/video/topspeed.c
r1771r1772
166166   layer[3] = 0;
167167
168168   fillbitmap(priority_bitmap,0,cliprect);
169   fillbitmap(bitmap, machine->pens[0], cliprect);
169   fillbitmap(bitmap, 0, cliprect);
170170
171171#ifdef MAME_DEBUG
172172   if (dislayer[3]==0)
src/mame/video/amspdwy.c
r1771r1772
117117      int flipx   =   attr & 0x80;
118118      int flipy   =   attr & 0x40;
119119
120      if (flip_screen)
120      if (flip_screen_get())
121121      {
122122         x = max_x - x - 8;   y = max_y - y - 8;
123123         flipx = !flipx;   flipy = !flipy;
src/mame/video/fantland.c
r1771r1772
137137
138138VIDEO_UPDATE( fantland )
139139{
140   fillbitmap(bitmap,machine->pens[0],cliprect);
140   fillbitmap(bitmap,0,cliprect);
141141   draw_sprites(machine,bitmap,cliprect);
142142
143143   return 0;
src/mame/video/srumbler.c
r1771r1772
142142      sx = buffered_spriteram[offs + 3] + 0x100 * ( attr & 0x01);
143143      flipy = attr & 0x02;
144144
145      if (flip_screen)
145      if (flip_screen_get())
146146      {
147147         sx = 496 - sx;
148148         sy = 240 - sy;
r1771r1772
152152      drawgfx(bitmap,machine->gfx[2],
153153            code,
154154            colour,
155            flip_screen,flipy,
155            flip_screen_get(),flipy,
156156            sx, sy,
157157            cliprect,TRANSPARENCY_PEN,15);
158158   }
src/mame/video/pbaction.c
r1771r1772
4141WRITE8_HANDLER( pbaction_scroll_w )
4242{
4343   scroll = data - 3;
44   if (flip_screen) scroll = -scroll;
44   if (flip_screen_get()) scroll = -scroll;
4545   tilemap_set_scrollx(bg_tilemap, 0, scroll);
4646   tilemap_set_scrollx(fg_tilemap, 0, scroll);
4747}
r1771r1772
100100         sy = 241-spriteram[offs+2];
101101      flipx = spriteram[offs+1] & 0x40;
102102      flipy =   spriteram[offs+1] & 0x80;
103      if (flip_screen)
103      if (flip_screen_get())
104104      {
105105         if (spriteram[offs] & 0x80)
106106         {
r1771r1772
120120            spriteram[offs],
121121            spriteram[offs + 1] & 0x0f,
122122            flipx,flipy,
123            sx + (flip_screen ? scroll : -scroll), sy,
123            sx + (flip_screen_get() ? scroll : -scroll), sy,
124124            cliprect,TRANSPARENCY_PEN,0);
125125   }
126126}
src/mame/video/funworld.c
r1771r1772
1414    * Jolly Card (austrian, encrypted),                 TAB-Austria,        1985.
1515    * Jolly Card (3x3 deal),                            TAB-Austria,        1985.
1616    * Jolly Card Professional 2.0,                      Spale-Soft,         2000.
17    * Jolly Card (croatian),                            Soft Design,        1993.
17    * Jolly Card (Evona Electronic),                    Evona Electronic    1998.
18    * Jolly Card (croatian, set 1),                     TAB-Austria,        1985.
19    * Jolly Card (croatian, set 2),                     Soft Design,        1993.
1820    * Jolly Card (italian, blue TAB board, encrypted),  bootleg,            199?.
21    * Super Joly 2000 - 3x,                             M.P.                1985.
1922    * Jolly Card (austrian, Funworld, bootleg),         Inter Games,        1986.
2023    * Big Deal (hungarian, set 1),                      Funworld,           1986.
2124    * Big Deal (hungarian, set 2),                      Funworld,           1986.
r1771r1772
3639    * Magic Card II (blue TAB board, encrypted),        Impera,             1996.
3740    * Royal Vegas Joker Card (slow deal),               Funworld,           1993.
3841    * Royal Vegas Joker Card (fast deal),               Soft Design,        1993.
42    * Royal Vegas Joker Card (fast deal, english gfx),  Soft Design,        1993.
43    * Jolly Joker,                                      Impera,             198?.
44    * Jolly Joker (50bet),                              Impera,             198?.
3945    * Joker Card (Ver.A267BC, encrypted),               Vesely Svet,        1993.
4046    * Mongolfier New (italian),                         bootleg,            199?.
4147    * Soccer New (italian),                             bootleg,            199?.
r1771r1772
4854
4955#include "driver.h"
5056#include "video/mc6845.h"
57#include "video/resnet.h"
5158
5259static mc6845_t *mc6845;
5360static tilemap *bg_tilemap;
5461
5562
63/***** RESISTORS *****
64
65            74LS373
66           +-------+
67  bit 0 -->|03   02|--> 1  KOhms resistor --> \
68  bit 1 -->|04   05|--> 470 Ohms resistor -->  | 100 Ohms pulldown resistor --> RED
69  bit 2 -->|07   06|--> 220 Ohms resistor --> /
70  bit 3 -->|08   09|--> 1  KOhms resistor --> \
71  bit 4 -->|13   12|--> 470 Ohms resistor -->  | 100 Ohms pulldown resistor --> BLUE
72  bit 5 -->|14   15|--> 220 Ohms resistor --> /
73  bit 6 -->|17   16|--> 470 Ohms resistor --> \  100 Ohms pulldown resistor --> GREEN
74  bit 7 -->|18   19|--> 220 Ohms resistor --> /
75           +-------+
76  (G pulldown is silk labeled 220 Ohms, but a 100 Ohms resistor is there)
77
78*/
79
5680PALETTE_INIT(funworld)
5781{
5882   int i;
83   static const int resistances_rb[3] = { 1000, 470, 220 };
84   static const int resistances_g [2] = { 470, 220 };
85   double weights_r[3], weights_b[3], weights_g[2];
5986
60   /* RRRBBBGG */
61   if (color_prom == 0) return;
87   compute_resistor_weights(0,   255,   -1.0,
88         3,   resistances_rb,   weights_r,   100,   0,
89         3,   resistances_rb,   weights_b,   100,   0,
90         2,   resistances_g,   weights_g,   100,   0);
6291
63   for (i = 0;i < machine->config->total_colors;i++)
92
93   for (i = 0; i < machine->config->total_colors; i++)
6494   {
65      int bit0,bit1,bit2,r,g,b;
95      int bit0, bit1, bit2, r, g, b;
6696
6797      /* red component */
6898      bit0 = (color_prom[i] >> 0) & 0x01;
6999      bit1 = (color_prom[i] >> 1) & 0x01;
70100      bit2 = (color_prom[i] >> 2) & 0x01;
71      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
101      r = combine_3_weights(weights_r, bit0, bit1, bit2);
72102      /* blue component */
73103      bit0 = (color_prom[i] >> 3) & 0x01;
74104      bit1 = (color_prom[i] >> 4) & 0x01;
75105      bit2 = (color_prom[i] >> 5) & 0x01;
76      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
106      b = combine_3_weights(weights_b, bit0, bit1, bit2);
77107      /* green component */
78      bit0 = 0;
79      bit1 = (color_prom[i] >> 6) & 0x01;
80      bit2 = (color_prom[i] >> 7) & 0x01;
81      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
108      bit0 = (color_prom[i] >> 6) & 0x01;
109      bit1 = (color_prom[i] >> 7) & 0x01;
110      g = combine_2_weights(weights_g, bit0, bit1);
82111
83112      palette_set_color(machine,i,MAKE_RGB(r,g,b));
84113   }
src/mame/video/thunderx.c
r1771r1772
7373   fillbitmap(priority_bitmap,0,cliprect);
7474
7575   /* The background color is always from layer 1 - but it's always black anyway */
76//  fillbitmap(bitmap,machine->pens[16 * layer_colorbase[1]],cliprect);
76//  fillbitmap(bitmap,16 * layer_colorbase[1],cliprect);
7777   if (scontra_priority)
7878   {
7979      tilemap_draw(bitmap,cliprect,K052109_tilemap[2],TILEMAP_DRAW_OPAQUE,1);
src/mame/video/spcforce.c
r1771r1772
2525
2626   /* draw the characters as sprites because they could be overlapping */
2727
28   fillbitmap(bitmap,machine->pens[0],&machine->screen[0].visarea);
28   fillbitmap(bitmap,0,&machine->screen[0].visarea);
2929
3030
3131   for (offs = 0; offs < videoram_size; offs++)
r1771r1772
3939      code = videoram[offs] + ((colorram[offs] & 0x01) << 8);
4040      col  = (~colorram[offs] >> 4) & 0x07;
4141
42      if (flip_screen)
42      if (flip_screen_get())
4343      {
4444         sx = 248 - sx;
4545         sy = 248 - sy;
r1771r1772
4747
4848      drawgfx(bitmap,machine->gfx[0],
4949            code, col,
50            flip_screen, flip_screen,
50            flip_screen_get(), flip_screen_get(),
5151            sx, sy,
5252            &machine->screen[0].visarea,TRANSPARENCY_PEN,0);
5353   }
src/mame/video/xmen.c
r1771r1772
118118
119119   fillbitmap(priority_bitmap,0,cliprect);
120120   /* note the '+1' in the background color!!! */
121   fillbitmap(bitmap,machine->pens[16 * bg_colorbase+1],cliprect);
121   fillbitmap(bitmap,16 * bg_colorbase+1,cliprect);
122122   tilemap_draw(bitmap,cliprect,K052109_tilemap[layer[0]],0,1);
123123   tilemap_draw(bitmap,cliprect,K052109_tilemap[layer[1]],0,2);
124124   tilemap_draw(bitmap,cliprect,K052109_tilemap[layer[2]],0,4);
r1771r1772
246246
247247   fillbitmap(priority_bitmap,0,&cliprect);
248248   /* note the '+1' in the background color!!! */
249   fillbitmap(renderbitmap,machine->pens[16 * bg_colorbase+1],&cliprect);
249   fillbitmap(renderbitmap,16 * bg_colorbase+1,&cliprect);
250250   tilemap_draw(renderbitmap,&cliprect,K052109_tilemap[layer[0]],0,1);
251251   tilemap_draw(renderbitmap,&cliprect,K052109_tilemap[layer[1]],0,2);
252252   tilemap_draw(renderbitmap,&cliprect,K052109_tilemap[layer[2]],0,4);
src/mame/video/exprraid.c
r1771r1772
1818
1919WRITE8_HANDLER( exprraid_flipscreen_w )
2020{
21   if (flip_screen != (data & 0x01))
21   if (flip_screen_get() != (data & 0x01))
2222   {
2323      flip_screen_set(data & 0x01);
2424      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
r1771r1772
106106      int sx = ((248 - spriteram[offs + 2]) & 0xff) - 8;
107107      int sy = spriteram[offs];
108108
109      if (flip_screen)
109      if (flip_screen_get())
110110      {
111111         sx = 240 - sx;
112112         sy = 240 - sy;
r1771r1772
127127         drawgfx(bitmap,machine->gfx[1],
128128            code + 1, color,
129129            flipx, flipy,
130            sx, sy + (flip_screen ? -16 : 16),
130            sx, sy + (flip_screen_get() ? -16 : 16),
131131            cliprect, TRANSPARENCY_PEN, 0);
132132      }
133133   }
src/mame/video/momoko.c
r1771r1772
6969}
7070/****************************************************************************/
7171
72static void momoko_draw_bg_pri(running_machine *machine, mame_bitmap *bitmap, int chr, int col, int flipx, int flipy, int x,int y, int pri)
72static void momoko_draw_bg_pri(mame_bitmap *bitmap, int chr, int col, int flipx, int flipy, int x,int y, int pri)
7373{
7474   int xx,sx,sy,px,py,dot;
7575   UINT32 gfxadr;
r1771r1772
9191               else  py=7-sy + y;
9292
9393            if (dot>=pri)
94               *BITMAP_ADDR16(bitmap, py, px) = machine->pens[col*16+dot+256];
94               *BITMAP_ADDR16(bitmap, py, px) = col*16+dot+256;
9595            d0 = d0 << 1;
9696            d1 = d1 << 1;
9797         }
r1771r1772
152152      }
153153   }
154154   else
155   fillbitmap(bitmap, machine->pens[256], 0);
155   fillbitmap(bitmap, 256, 0);
156156
157157
158158/* draw sprites (momoko) */
r1771r1772
213213            {
214214               col = col & 0x0f;
215215               chr = chr + momoko_bg_select * 512;
216               momoko_draw_bg_pri(machine, bitmap,chr,col,flip,flip,px,py,pri);
216               momoko_draw_bg_pri(bitmap,chr,col,flip,flip,px,py,pri);
217217            }
218218         }
219219      }
src/mame/video/kchamp.c
r1771r1772
8080        int sx = spriteram[offs + 3] - 8;
8181        int sy = 247 - spriteram[offs];
8282
83      if (flip_screen)
83      if (flip_screen_get())
8484      {
8585         sx = 240 - sx;
8686         sy = 240 - sy;
r1771r1772
108108        int sx = spriteram[offs + 3];
109109        int sy = 240 - spriteram[offs];
110110
111      if (flip_screen)
111      if (flip_screen_get())
112112      {
113113         sx = 240 - sx;
114114         sy = 240 - sy;
src/mame/video/digdug.c
r1771r1772
134134       characters when screen is flipped, we have to flip them back. */
135135   SET_TILE_INFO(
136136         0,
137         (code & 0x7f) | (flip_screen ? 0x80 : 0),
137         (code & 0x7f) | (flip_screen_get() ? 0x80 : 0),
138138         color,
139         flip_screen ? TILE_FLIPX : 0);
139         flip_screen_get() ? TILE_FLIPX : 0);
140140}
141141
142142
r1771r1772
277277      if (size)
278278         sprite = (sprite & 0xc0) | ((sprite & ~0xc0) << 2);
279279
280      if (flip_screen)
280      if (flip_screen_get())
281281      {
282282         flipx ^= 1;
283283         flipy ^= 1;
src/mame/video/m90.c
r1771r1772
228228   fillbitmap(priority_bitmap,0,cliprect);
229229
230230   if (!pf2_enable)
231      fillbitmap(bitmap,machine->pens[0],cliprect);
231      fillbitmap(bitmap,0,cliprect);
232232
233233   if (pf2_enable)
234234   {
src/mame/video/scotrsht.c
r1771r1772
108108      int sx = spriteram[i + 2] - ((attr & 0x80) << 1);
109109      int sy = spriteram[i + 3];
110110
111      if (flip_screen)
111      if (flip_screen_get())
112112      {
113113         sx = 240 - sx;
114114         sy = 240 - sy;
src/mame/video/taito_z.c
r1771r1772
857857
858858   fillbitmap(priority_bitmap,0,cliprect);
859859
860   fillbitmap(bitmap, machine->pens[0], cliprect);
860   fillbitmap(bitmap, 0, cliprect);
861861
862862   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],0,0);
863863   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[1],0,1);
r1771r1772
884884   fillbitmap(priority_bitmap,0,cliprect);
885885
886886   /* Ensure screen blanked even when bottom layer not drawn due to disable bit */
887   fillbitmap(bitmap, machine->pens[0], cliprect);
887   fillbitmap(bitmap, 0, cliprect);
888888
889889   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],TILEMAP_DRAW_OPAQUE,0);
890890   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[1],0,1);
r1771r1772
909909   fillbitmap(priority_bitmap,0,cliprect);
910910
911911   /* Ensure screen blanked even when bottom layer not drawn due to disable bit */
912   fillbitmap(bitmap, machine->pens[0],cliprect);
912   fillbitmap(bitmap, 0,cliprect);
913913
914914   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],TILEMAP_DRAW_OPAQUE,0);
915915   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[1],0,1);
r1771r1772
934934   fillbitmap(priority_bitmap,0,cliprect);
935935
936936   /* Ensure screen blanked even when bottom layer not drawn due to disable bit */
937   fillbitmap(bitmap, machine->pens[0], cliprect);
937   fillbitmap(bitmap, 0, cliprect);
938938
939939   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],TILEMAP_DRAW_OPAQUE,0);
940940   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[1],0,1);
r1771r1772
959959   fillbitmap(priority_bitmap,0,cliprect);
960960
961961   /* Ensure screen blanked even when bottom layer not drawn due to disable bit */
962   fillbitmap(bitmap, machine->pens[0], cliprect);
962   fillbitmap(bitmap, 0, cliprect);
963963
964964   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],TILEMAP_DRAW_OPAQUE,0);
965965   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[1],0,1);
r1771r1772
984984   fillbitmap(priority_bitmap,0,cliprect);
985985
986986   /* Ensure screen blanked even when bottom layer not drawn due to disable bit */
987   fillbitmap(bitmap, machine->pens[0], cliprect);
987   fillbitmap(bitmap, 0, cliprect);
988988
989989   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],TILEMAP_DRAW_OPAQUE,1);
990990   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[1],0,2);
r1771r1772
10141014   fillbitmap(priority_bitmap,0,cliprect);
10151015
10161016   /* Ensure screen blanked - this shouldn't be necessary! */
1017   fillbitmap(bitmap, machine->pens[0], cliprect);
1017   fillbitmap(bitmap, 0, cliprect);
10181018
10191019   TC0480SCP_tilemap_draw(bitmap,cliprect,layer[0],TILEMAP_DRAW_OPAQUE,0);
10201020   TC0480SCP_tilemap_draw(bitmap,cliprect,layer[1],0,0);
src/mame/video/markham.c
r1771r1772
5151
5252WRITE8_HANDLER( markham_flipscreen_w )
5353{
54   if (flip_screen != (data & 0x01))
54   if (flip_screen_get() != (data & 0x01))
5555   {
5656      flip_screen_set(data & 0x01);
5757      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
r1771r1772
8484      int chr = spriteram[offs+1];
8585      int col = spriteram[offs+2];
8686
87      int fx = flip_screen;
88      int fy = flip_screen;
87      int fx = flip_screen_get();
88      int fy = flip_screen_get();
8989
9090      int x = spriteram[offs+3];
9191      int y = spriteram[offs+0];
9292      int px,py;
9393      col &= 0x3f ;
9494
95      if (flip_screen==0)
95      if (flip_screen_get()==0)
9696      {
9797         px = x-2;
9898         py = 240-y;
src/mame/video/superqix.c
r1771r1772
177177      int sx = spriteram[offs + 1] + 256 * (spriteram[offs] & 0x01);
178178      int sy = spriteram[offs + 2];
179179
180      if (flip_screen)
180      if (flip_screen_get())
181181      {
182182         sx = 240 - sx;
183183         sy = 240 - sy;
r1771r1772
186186      drawgfx(bitmap,machine->gfx[1],
187187            code,
188188            color,
189            flip_screen, flip_screen,
189            flip_screen_get(), flip_screen_get(),
190190            sx, sy,
191191            cliprect, TRANSPARENCY_PEN, 0);
192192   }
r1771r1772
206206      int sx = spriteram[offs + 1];
207207      int sy = spriteram[offs + 2];
208208
209      if (flip_screen)
209      if (flip_screen_get())
210210      {
211211         sx = 240 - sx;
212212         sy = 240 - sy;
r1771r1772
253253VIDEO_UPDATE( superqix )
254254{
255255   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_LAYER1, 0);
256   copybitmap_trans(bitmap,fg_bitmap[show_bitmap],flip_screen,flip_screen,0,0,cliprect,0);
256   copybitmap_trans(bitmap,fg_bitmap[show_bitmap],flip_screen_get(),flip_screen_get(),0,0,cliprect,0);
257257   superqix_draw_sprites(machine, bitmap,cliprect);
258258   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_LAYER0, 0);
259259   return 0;
src/mame/video/mappy.c
r1771r1772
427427         sprite &= ~sizex;
428428         sprite &= ~(sizey << 1);
429429
430         if (flip_screen)
430         if (flip_screen_get())
431431         {
432432            flipx ^= 1;
433433            flipy ^= 1;
r1771r1772
502502         int sizey = size[(spriteram_3[offs] & 0x30) >> 4];
503503         int x,y;
504504
505         if (flip_screen)
505         if (flip_screen_get())
506506         {
507507            flipx ^= 1;
508508            flipy ^= 1;
src/mame/video/tigeroad.c
r1771r1772
1919
2020      /* bit 1 flips screen */
2121
22      if (flip_screen != (data & 0x02))
22      if (flip_screen_get() != (data & 0x02))
2323      {
2424         flip_screen_set(data & 0x02);
2525         tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
r1771r1772
8888         if (sx > 0x100) sx -= 0x200;
8989         if (sy > 0x100) sy -= 0x200;
9090
91         if (flip_screen)
91         if (flip_screen_get())
9292         {
9393            sx = 240 - sx;
9494            sy = 240 - sy;
src/mame/video/kan_pand.c
r1771r1772
120120         y = dy;
121121      }
122122
123      if (flip_screen)
123      if (flip_screen_get())
124124      {
125125         sx = 240 - x;
126126         sy = 240 - y;
src/mame/video/boogwing.c
r1771r1772
55static void draw_sprites(running_machine *machine, mame_bitmap *bitmap,const rectangle *cliprect, UINT16* spriteram_base, int gfx_region)
66{
77   int offs;
8   int flipscreen=!flip_screen;
8   int flipscreen=!flip_screen_get();
99
1010   for (offs = 0x400-4;offs >= 0;offs -= 4)
1111   {
src/mame/video/decocass.c
r1771r1772
171171   drawgfx(bitmap, machine->gfx[3], 1, color, 0, 1, sx, sy - 64, cliprect, TRANSPARENCY_PEN, 0);
172172}
173173
174static void draw_center(running_machine* machine, mame_bitmap *bitmap, const rectangle *cliprect)
174static void draw_center(mame_bitmap *bitmap, const rectangle *cliprect)
175175{
176176   int sx, sy, x, y, color;
177177
r1771r1772
194194         if (((sy + y) & color_center_bot & 3) == (sy & color_center_bot & 3))
195195            for (x = 0; x < 256; x++)
196196               if (0 != (x & 16) || 0 != (center_h_shift_space & 1))
197                  *BITMAP_ADDR16(bitmap, sy + y, (sx + x) & 255) = machine->pens[color];
197                  *BITMAP_ADDR16(bitmap, sy + y, (sx + x) & 255) = color;
198198      }
199199}
200200
r1771r1772
428428      flipx = sprite_ram[offs + 0] & 0x04;
429429      flipy = sprite_ram[offs + 0] & 0x02;
430430
431      if (flip_screen)
431      if (flip_screen_get())
432432      {
433433         sx = 240 - sx;
434434         sy = 240 - sy + sprite_y_adjust_flip_screen;
r1771r1772
446446            sx,sy,
447447            cliprect, TRANSPARENCY_PEN, 0);
448448
449      sy += (flip_screen ? -256 : 256);
449      sy += (flip_screen_get() ? -256 : 256);
450450
451451      // Wrap around
452452      drawgfx(bitmap,machine->gfx[1],
r1771r1772
459459}
460460
461461
462static void draw_missiles(running_machine* machine, mame_bitmap *bitmap, const rectangle *cliprect,
462static void draw_missiles(mame_bitmap *bitmap, const rectangle *cliprect,
463463                  int missile_y_adjust, int missile_y_adjust_flip_screen,
464464                  UINT8 *missile_ram, int interleave)
465465{
r1771r1772
473473
474474      sy = 255 - missile_ram[offs + 0*interleave];
475475      sx = 255 - missile_ram[offs + 2*interleave];
476      if (flip_screen)
476      if (flip_screen_get())
477477      {
478478         sx = 240 - sx;
479479         sy = 240 - sy + missile_y_adjust_flip_screen;
r1771r1772
483483         for (x = 0; x < 4; x++)
484484         {
485485            if (sx >= cliprect->min_x && sx <= cliprect->max_x)
486               *BITMAP_ADDR16(bitmap, sy, sx) = machine->pens[(color_missiles >> 4) & 7];
486               *BITMAP_ADDR16(bitmap, sy, sx) = (color_missiles >> 4) & 7;
487487            sx++;
488488         }
489489
490490      sy = 255 - missile_ram[offs + 1*interleave];
491491      sx = 255 - missile_ram[offs + 3*interleave];
492      if (flip_screen)
492      if (flip_screen_get())
493493      {
494494         sx = 240 - sx;
495495         sy = 240 - sy + missile_y_adjust_flip_screen;
r1771r1772
499499         for (x = 0; x < 4; x++)
500500         {
501501            if (sx >= cliprect->min_x && sx <= cliprect->max_x)
502               *BITMAP_ADDR16(bitmap, sy, sx) = machine->pens[color_missiles & 7];
502               *BITMAP_ADDR16(bitmap, sy, sx) = color_missiles & 7;
503503            sx++;
504504         }
505505   }
r1771r1772
690690   if (mode_set & 0x20)
691691   {
692692      draw_object(machine,bitmap,cliprect);
693      draw_center(machine,bitmap,cliprect);
693      draw_center(bitmap,cliprect);
694694   }
695695   else
696696   {
697697      draw_object(machine,bitmap,cliprect);
698      draw_center(machine,bitmap,cliprect);
698      draw_center(bitmap,cliprect);
699699      if (mode_set & 0x08)   /* bkg_ena on ? */
700700      {
701701         clip = bg_tilemap_l_clip;
r1771r1772
709709   }
710710   tilemap_draw(bitmap,cliprect, fg_tilemap, 0, 0);
711711   draw_sprites(machine,bitmap,cliprect, (color_center_bot >> 1) & 1, 0, 0, decocass_fgvideoram, 0x20);
712   draw_missiles(machine,bitmap,cliprect, 1, 0, decocass_colorram, 0x20);
712   draw_missiles(bitmap,cliprect, 1, 0, decocass_colorram, 0x20);
713713   return 0;
714714}
715715
src/mame/video/skykid.c
r1771r1772
8383       characters when screen is flipped, we have to flip them back. */
8484   SET_TILE_INFO(
8585         0,
86         skykid_textram[tile_index] | (flip_screen ? 0x100 : 0),
86         skykid_textram[tile_index] | (flip_screen_get() ? 0x100 : 0),
8787         skykid_textram[tile_index + 0x400] & 0x3f,
88         flip_screen ? (TILE_FLIPY | TILE_FLIPX) : 0);
88         flip_screen_get() ? (TILE_FLIPY | TILE_FLIPX) : 0);
8989}
9090
9191
r1771r1772
123123   state_save_register_global(priority);
124124   state_save_register_global(scroll_x);
125125   state_save_register_global(scroll_y);
126   state_save_register_global(flip_screen);
126   //FIXME: flip_screen
127   //state_save_register_global(flip_screen_x_get());
127128}
128129
129130
r1771r1772
205206      sprite &= ~sizex;
206207      sprite &= ~(sizey << 1);
207208
208      if (flip_screen)
209      if (flip_screen_get())
209210      {
210211         flipx ^= 1;
211212         flipy ^= 1;
r1771r1772
233234
234235VIDEO_UPDATE( skykid )
235236{
236   if (flip_screen)
237   if (flip_screen_get())
237238   {
238239      tilemap_set_scrollx(bg_tilemap, 0, 189 - (scroll_x ^ 1));
239240      tilemap_set_scrolly(bg_tilemap, 0, 7 - scroll_y);
src/mame/video/segas24.c
r1771r1772
3434   sys24_tile_update(machine);
3535
3636   fillbitmap(priority_bitmap, 0, 0);
37   fillbitmap(bitmap, machine->pens[0], &machine->screen[0].visarea);
37   fillbitmap(bitmap, 0, &machine->screen[0].visarea);
3838
3939   for(i=0; i<12; i++)
4040      order[i] = i;
src/mame/video/mustache.c
r1771r1772
5252
5353WRITE8_HANDLER (mustache_video_control_w)
5454{
55   if (flip_screen != (data & 0x01))
55   if (flip_screen_get() != (data & 0x01))
5656   {
5757      flip_screen_set(data & 0x01);
5858      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
r1771r1772
115115      if ((control_byte & 0xa))
116116         clip.max_y = machine->screen[0].visarea.max_y;
117117      else
118         if (flip_screen)
118         if (flip_screen_get())
119119            clip.min_y = machine->screen[0].visarea.min_y + 56;
120120         else
121121            clip.max_y = machine->screen[0].visarea.max_y - 56;
122122
123      if (flip_screen)
123      if (flip_screen_get())
124124      {
125125         sx = 240 - sx;
126126         sy = 240 - sy;
r1771r1772
129129      drawgfx(bitmap,gfx,
130130            code,
131131            color,
132            flip_screen,flip_screen,
132            flip_screen_get(),flip_screen_get(),
133133            sx,sy,
134134            &clip,TRANSPARENCY_PEN,0);
135135   }
src/mame/video/parodius.c
r1771r1772
8888   sortlayers(layer,layerpri);
8989
9090   fillbitmap(priority_bitmap,0,cliprect);
91   fillbitmap(bitmap,machine->pens[16 * bg_colorbase],cliprect);
91   fillbitmap(bitmap,16 * bg_colorbase,cliprect);
9292   tilemap_draw(bitmap,cliprect,K052109_tilemap[layer[0]],0,1);
9393   tilemap_draw(bitmap,cliprect,K052109_tilemap[layer[1]],0,2);
9494   tilemap_draw(bitmap,cliprect,K052109_tilemap[layer[2]],0,4);
src/mame/video/ladybug.c
r1771r1772
1717void redclash_set_stars_enable( UINT8 on );
1818void redclash_update_stars_state(void);
1919void redclash_set_stars_speed( UINT8 speed );
20void redclash_draw_stars(const pen_t *pens, mame_bitmap *bitmap, const rectangle *cliprect, UINT8 palette_offset, UINT8 sraider, UINT8 firstx, UINT8 lastx);
20void redclash_draw_stars(mame_bitmap *bitmap, const rectangle *cliprect, UINT8 palette_offset, UINT8 sraider, UINT8 firstx, UINT8 lastx);
2121
2222static tilemap *bg_tilemap;
2323static tilemap *grid_tilemap;
r1771r1772
161161
162162WRITE8_HANDLER( ladybug_flipscreen_w )
163163{
164   if (flip_screen != (data & 0x01))
164   if (flip_screen_get() != (data & 0x01))
165165   {
166166      flip_screen_set(data & 0x01);
167167      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
r1771r1772
250250   // bit3 = enable stars
251251   // bit210 = stars speed/dir
252252
253   if (flip_screen != (data & 0x80))
253   if (flip_screen_get() != (data & 0x80))
254254   {
255255      flip_screen_set(data & 0x80);
256256      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
r1771r1772
363363   int offs;
364364
365365   // clear the bg bitmap
366   fillbitmap(bitmap,machine->pens[0],cliprect);
366   fillbitmap(bitmap,0,cliprect);
367367
368368   for (offs = 0; offs < 32; offs++)
369369   {
370370      int sx = offs % 4;
371371      int sy = offs / 4;
372372
373      if (flip_screen)
373      if (flip_screen_get())
374374         tilemap_set_scrollx(bg_tilemap, offs, -videoram[32 * sx + sy]);
375375      else
376376         tilemap_set_scrollx(bg_tilemap, offs, videoram[32 * sx + sy]);
r1771r1772
399399      int sx = offs % 4;
400400      int sy = offs / 4;
401401
402      if (flip_screen)
402      if (flip_screen_get())
403403         tilemap_set_scrollx(bg_tilemap, offs, -videoram[32 * sx + sy]);
404404      else
405405         tilemap_set_scrollx(bg_tilemap, offs, videoram[32 * sx + sy]);
406406   }
407407
408408   // clear the bg bitmap
409   fillbitmap(bitmap,machine->pens[0],cliprect);
409   fillbitmap(bitmap,0,cliprect);
410410
411411   // draw the stars
412   if (flip_screen)
413      redclash_draw_stars(machine->pens,bitmap,cliprect,0x60,1,0x27,0xff);
412   if (flip_screen_get())
413      redclash_draw_stars(bitmap,cliprect,0x60,1,0x27,0xff);
414414   else
415      redclash_draw_stars(machine->pens,bitmap,cliprect,0x60,1,0x00,0xd8);
415      redclash_draw_stars(bitmap,cliprect,0x60,1,0x00,0xd8);
416416
417417   // draw the gridlines
418418   colortable_palette_set_color(machine->colortable, 0x40, MAKE_RGB(sraider_grid_color & 0x40 ? 0xff : 0,
419419                                                           sraider_grid_color & 0x20 ? 0xff : 0,
420420                                                           sraider_grid_color & 0x10 ? 0xff : 0));
421   tilemap_draw(bitmap, cliprect, grid_tilemap, 0, flip_screen);
421   tilemap_draw(bitmap, cliprect, grid_tilemap, 0, flip_screen_get());
422422
423423   for (i = 0; i < 0x100; i++)
424424   {
r1771r1772
428428
429429         int height = cliprect->max_y - cliprect->min_y + 1;
430430
431         if (flip_screen)
431         if (flip_screen_get())
432432            x = ~x;
433433
434         plot_box(bitmap, x, cliprect->min_y, 1, height, machine->pens[0x81]);
434         plot_box(bitmap, x, cliprect->min_y, 1, height, 0x81);
435435      }
436436   }
437437
438438   // now the chars
439   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, flip_screen);
439   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, flip_screen_get());
440440
441441   // now the sprites
442442   draw_sprites(machine, bitmap, cliprect);
src/mame/video/combatsc.c
r1771r1772
563563
564564      clip = *cliprect;
565565      clip.max_x = clip.min_x + 7;
566      fillbitmap(bitmap,machine->pens[0],&clip);
566      fillbitmap(bitmap,0,&clip);
567567
568568      clip = *cliprect;
569569      clip.min_x = clip.max_x - 7;
570      fillbitmap(bitmap,machine->pens[0],&clip);
570      fillbitmap(bitmap,0,&clip);
571571   }
572572   return 0;
573573}
src/mame/video/blueprnt.c
r1771r1772
9797      int flipx = spriteram[offs + 2] & 0x40;
9898      int flipy = spriteram[offs + 2 - 4] & 0x80;   // -4? Awkward, isn't it?
9999
100      if (flip_screen)
100      if (flip_screen_get())
101101      {
102102         sx = 248 - sx;
103103         sy = 240 - sy;
r1771r1772
115115{
116116   int i;
117117
118   if (flip_screen)
118   if (flip_screen_get())
119119      for (i = 0; i < 32; i++)
120120         tilemap_set_scrolly(bg_tilemap, i, blueprnt_scrollram[32 - i]);
121121   else
src/mame/video/ppu2c0x.c
r1771r1772
423423   }
424424
425425   /* cache the background pen */
426   back_pen = chips[num].machine->pens[(chips[num].back_color & color_mask)+intf->color_base[num]];
426   back_pen = (chips[num].back_color & color_mask)+intf->color_base[num];
427427
428428   /* determine where in the nametable to start drawing from */
429429   /* based on the current scanline and scroll regs */
r1771r1772
739739         color_mask = 0xff;
740740
741741      /* cache the background pen */
742      back_pen = chips[num].machine->pens[(chips[num].back_color & color_mask)+intf->color_base[num]];
742      back_pen = (chips[num].back_color & color_mask)+intf->color_base[num];
743743
744744      // Fill this scanline with the background pen.
745745      for (i = 0; i < bitmap->width; i ++)
r1771r1772
803803            else
804804               penNum = this_ppu->videoram[this_ppu->videoram_addr & 0x3f00] & 0x3f;
805805
806            back_pen = chips[num].machine->pens[penNum + intf->color_base[num]];
806            back_pen = penNum + intf->color_base[num];
807807         }
808808         else
809            back_pen = chips[num].machine->pens[(this_ppu->back_color & color_mask)+intf->color_base[num]];
809            back_pen = (this_ppu->back_color & color_mask)+intf->color_base[num];
810810
811811         // Fill this scanline with the background pen.
812812         for (i = 0; i < bitmap->width; i ++)
r1771r1772
986986      for( i = 0; i < ARRAY_LENGTH( default_colortable_mono ); i++ )
987987      {
988988         /* monochromatic table */
989         chips[num].colortable_mono[i] = chips[num].machine->pens[default_colortable_mono[i] + color_base];
989         chips[num].colortable_mono[i] = default_colortable_mono[i] + color_base;
990990
991991         /* color table */
992         chips[num].colortable[i] = chips[num].machine->pens[default_colortable[i] + color_base];
992         chips[num].colortable[i] = default_colortable[i] + color_base;
993993      }
994994   }
995995
r1771r1772
11321132            {
11331133               UINT8 oldColor = this_ppu->videoram[i+0x3f00];
11341134
1135               this_ppu->colortable[i] = chips[num].machine->pens[color_base + oldColor + (data & PPU_CONTROL1_COLOR_EMPHASIS)*2];
1135               this_ppu->colortable[i] = color_base + oldColor + (data & PPU_CONTROL1_COLOR_EMPHASIS)*2;
11361136            }
11371137         }
11381138
r1771r1772
12481248
12491249               if ( tempAddr & 0x03 )
12501250               {
1251                  this_ppu->colortable[ tempAddr & 0x1f ] = chips[num].machine->pens[color_base + data + colorEmphasis];
1252                  this_ppu->colortable_mono[tempAddr & 0x1f] = chips[num].machine->pens[color_base + (data & 0xf0) + colorEmphasis];
1251                  this_ppu->colortable[ tempAddr & 0x1f ] = color_base + data + colorEmphasis;
1252                  this_ppu->colortable_mono[tempAddr & 0x1f] = color_base + (data & 0xf0) + colorEmphasis;
12531253               }
12541254
12551255               /* The only valid background colors are writes to 0x3f00 and 0x3f10 */
r1771r1772
12611261                  this_ppu->back_color = data;
12621262                  for( i = 0; i < 32; i += 4 )
12631263                  {
1264                     this_ppu->colortable[ i ] = chips[num].machine->pens[color_base + data + colorEmphasis];
1265                     this_ppu->colortable_mono[i] = chips[num].machine->pens[color_base + (data & 0xf0) + colorEmphasis];
1264                     this_ppu->colortable[ i ] = color_base + data + colorEmphasis;
1265                     this_ppu->colortable_mono[i] = color_base + (data & 0xf0) + colorEmphasis;
12661266                  }
12671267               }
12681268            }
src/mame/video/buggychl.c
r1771r1772
111111      int sx = offs % 32;
112112      int sy = offs / 32;
113113
114      if (flip_screen_x) sx = 31 - sx;
115      if (flip_screen_y) sy = 31 - sy;
114      if (flip_screen_x_get()) sx = 31 - sx;
115      if (flip_screen_y_get()) sy = 31 - sy;
116116
117117      drawgfx(tmpbitmap1,machine->gfx[0],
118118            code,
119119            2,
120            flip_screen_x,flip_screen_y,
120            flip_screen_x_get(),flip_screen_y_get(),
121121            8*sx,8*sy,
122122            NULL,TRANSPARENCY_NONE,0);
123123   }
r1771r1772
150150
151151      int code = videoram[offs];
152152
153      if (flip_screen_x) sx = 31 - sx;
154      if (flip_screen_y) sy = 31 - sy;
153      if (flip_screen_x_get()) sx = 31 - sx;
154      if (flip_screen_y_get()) sy = 31 - sy;
155155
156156      drawgfx(bitmap,machine->gfx[0],
157157            code,
158158            0,
159            flip_screen_x,flip_screen_y,
159            flip_screen_x_get(),flip_screen_y_get(),
160160            8*sx,8*sy,
161161            cliprect,transp,0);
162162   }
r1771r1772
187187
188188      for (y = 0;y < 64;y++)
189189      {
190         int dy = flip_screen_y ? (255 - sy - y) : (sy + y);
190         int dy = flip_screen_y_get() ? (255 - sy - y) : (sy + y);
191191
192192         if ((dy & ~0xff) == 0)
193193         {
r1771r1772
216216                  col = pendata[x];
217217                  if (col)
218218                  {
219                     int dx = flip_screen_x ? (255 - sx - px) : (sx + px);
219                     int dx = flip_screen_x_get() ? (255 - sx - px) : (sx + px);
220220                     if ((dx & ~0xff) == 0)
221221                        *BITMAP_ADDR16(bitmap, dy, dx) = sprite_color_base + col;
222222                  }
src/mame/video/starshp1.c
r1771r1772
379379{
380380   set_pens(machine->colortable);
381381
382   fillbitmap(bitmap, machine->pens[0], cliprect);
382   fillbitmap(bitmap, 0, cliprect);
383383
384384   if (starshp1_starfield_kill == 0)
385385      draw_starfield(bitmap);
r1771r1772
422422   if (rect.max_y > helper->height - 1)
423423      rect.max_y = helper->height - 1;
424424
425   fillbitmap(helper, machine->pens[0], &machine->screen[0].visarea);
425   fillbitmap(helper, 0, &machine->screen[0].visarea);
426426
427427   if (starshp1_attract == 0)
428428      draw_spaceship(machine, helper, &machine->screen[0].visarea);
src/mame/video/taito_f2.c
r1771r1772
10511051   /* SSI only uses sprites, the tilemap registers are not even initialized.
10521052       (they are in Majestic 12, but the tilemaps are not used anyway) */
10531053   fillbitmap(priority_bitmap,0,cliprect);
1054   fillbitmap(bitmap,machine->pens[0],cliprect);
1054   fillbitmap(bitmap,0,cliprect);
10551055   draw_sprites(machine, bitmap,cliprect,NULL, 0);
10561056   return 0;
10571057}
r1771r1772
10641064   TC0100SCN_tilemap_update(machine);
10651065
10661066   fillbitmap(priority_bitmap,0,cliprect);
1067   fillbitmap(bitmap,machine->pens[0],cliprect);   /* wrong color? */
1067   fillbitmap(bitmap,0,cliprect);   /* wrong color? */
10681068   draw_sprites(machine, bitmap,cliprect,NULL, 0);
10691069   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,TC0100SCN_bottomlayer(0),0,0);
10701070   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,TC0100SCN_bottomlayer(0)^1,0,0);
r1771r1772
10801080   TC0100SCN_tilemap_update(machine);
10811081
10821082   fillbitmap(priority_bitmap,0,cliprect);
1083   fillbitmap(bitmap,machine->pens[0],cliprect);   /* wrong color? */
1083   fillbitmap(bitmap,0,cliprect);   /* wrong color? */
10841084   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,TC0100SCN_bottomlayer(0),0,0);
10851085   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,TC0100SCN_bottomlayer(0)^1,0,0);
10861086   draw_sprites(machine, bitmap,cliprect,NULL, 0);
r1771r1772
11121112   f2_spriteblendmode = TC0360PRI_regs[0]&0xc0;
11131113
11141114   fillbitmap(priority_bitmap,0,cliprect);
1115   fillbitmap(bitmap,machine->pens[0],cliprect);   /* wrong color? */
1115   fillbitmap(bitmap,0,cliprect);   /* wrong color? */
11161116
11171117   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[0],0,1);
11181118   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,layer[1],0,2);
r1771r1772
11711171   f2_spriteblendmode = TC0360PRI_regs[0]&0xc0;
11721172
11731173   fillbitmap(priority_bitmap,0,cliprect);
1174   fillbitmap(bitmap,machine->pens[0],cliprect);   /* wrong color? */
1174   fillbitmap(bitmap,0,cliprect);   /* wrong color? */
11751175
11761176   drawn=0;
11771177   for (i=0; i<16; i++)
r1771r1772
12341234
12351235
12361236   fillbitmap(priority_bitmap,0,cliprect);
1237   fillbitmap(bitmap,machine->pens[0],cliprect);   /* wrong color? */
1237   fillbitmap(bitmap,0,cliprect);   /* wrong color? */
12381238
12391239
12401240   /*
r1771r1772
13671367   f2_spriteblendmode = TC0360PRI_regs[0]&0xc0;
13681368
13691369   fillbitmap(priority_bitmap,0,cliprect);
1370   fillbitmap(bitmap,machine->pens[0],cliprect);
1370   fillbitmap(bitmap,0,cliprect);
13711371
13721372   TC0480SCP_tilemap_draw(bitmap,cliprect,layer[0],0,1);
13731373   TC0480SCP_tilemap_draw(bitmap,cliprect,layer[1],0,2);
r1771r1772
14141414   spritepri[3] = TC0360PRI_regs[7] >> 4;
14151415
14161416   fillbitmap(priority_bitmap,0,cliprect);
1417   fillbitmap(bitmap,machine->pens[0],cliprect);
1417   fillbitmap(bitmap,0,cliprect);
14181418
14191419   TC0480SCP_tilemap_draw(bitmap,cliprect,layer[0],0,1);
14201420   TC0480SCP_tilemap_draw(bitmap,cliprect,layer[1],0,2);
src/mame/video/gberet.c
r1771r1772
153153         int flipx = attr & 0x10;
154154         int flipy = attr & 0x20;
155155
156         if (flip_screen)
156         if (flip_screen_get())
157157         {
158158            sx = 240 - sx;
159159            sy = 240 - sy;
r1771r1772
206206         int flipx = attr & 0x10;
207207         int flipy = attr & 0x20;
208208
209         if (flip_screen)
209         if (flip_screen_get())
210210         {
211211            sx = 240 - sx;
212212            sy = 240 - sy;
src/mame/video/stfight.c
r1771r1772
271271                sx -= 0x100;
272272         }
273273
274         if (flip_screen)
274         if (flip_screen_get())
275275         {
276276            sx = 240 - sx;
277277            sy = 240 - sy;
r1771r1772
283283         pdrawgfx(bitmap,machine->gfx[4],
284284                 code,
285285                color,
286                flipx,flip_screen,
286                flipx,flip_screen_get(),
287287                sx,sy,
288288                 cliprect,TRANSPARENCY_PEN,0x0f,
289289                pri ? 0x02 : 0);
r1771r1772
298298
299299   fillbitmap(priority_bitmap,0,cliprect);
300300
301   fillbitmap(bitmap,machine->pens[0],cliprect);   /* in case bg_tilemap is disabled */
301   fillbitmap(bitmap,0,cliprect);   /* in case bg_tilemap is disabled */
302302    tilemap_draw(bitmap,cliprect,bg_tilemap,0,0);
303303   tilemap_draw(bitmap,cliprect,fg_tilemap,0,1);
304304
src/mame/video/gottlieb.c
r1771r1772
9595
9696   background_priority = data & 0x01;
9797
98   if (flip_screen_x != (data & 0x02))
98   if (flip_screen_x_get() != (data & 0x02))
9999   {
100100      flip_screen_x_set(data & 0x02);
101101      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
102102   }
103103
104   if (flip_screen_y != (data & 0x04))
104   if (flip_screen_y_get() != (data & 0x04))
105105   {
106106      flip_screen_y_set(data & 0x04);
107107      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
r1771r1772
187187      int sy = (spriteram[offs]) - 13;
188188      int code = (255 ^ spriteram[offs + 2]) + 256 * spritebank;
189189
190      if (flip_screen_x) sx = 233 - sx;
191      if (flip_screen_y) sy = 244 - sy;
190      if (flip_screen_x_get()) sx = 233 - sx;
191      if (flip_screen_y_get()) sy = 244 - sy;
192192
193193      if (spriteram[offs] || spriteram[offs + 1])   /* needed to avoid garbage on screen */
194194         drawgfx(bitmap, machine->gfx[1],
195195            code, 0,
196            flip_screen_x, flip_screen_y,
196            flip_screen_x_get(), flip_screen_y_get(),
197197            sx,sy,
198198            cliprect,
199199            TRANSPARENCY_PEN, 0);
r1771r1772
203203VIDEO_UPDATE( gottlieb )
204204{
205205   if (!background_priority)
206   {
207206      tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_OPAQUE, 0);
208   }
209207   else
210   {
211      fillbitmap(bitmap, machine->pens[0], cliprect);
212   }
208      fillbitmap(bitmap, 0, cliprect);
213209
214210   draw_sprites(machine, bitmap, cliprect);
215211
216212   if (background_priority)
217   {
218213      tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
219   }
214
220215   return 0;
221216}
src/mame/video/ddragon.c
r1771r1772
203203            which = src[i+3] + ( ( src[i+2] & 0x0f ) << 8 );
204204         }
205205
206         if (flip_screen)
206         if (flip_screen_get())
207207         {
208208            sx = 240 - sx;
209209            sy = 256 - sy;
src/mame/video/tubep.c
r1771r1772
582582{
583583   int DISP_ = DISP^1;
584584
585   const pen_t *pens = &machine->pens[ 32 ]; //change it later
585   pen_t pen_base = 32; //change it later
586586
587587   UINT32 v;
588588   UINT8 *text_gfx_base = memory_region(REGION_GFX1);
r1771r1772
609609         text_gfx_data = text_gfx_base[(text_code << 3) | (v & 0x07)];
610610
611611         if (text_gfx_data & (0x80 >> (h & 0x07)))
612            *BITMAP_ADDR16(bitmap, v, h) = machine->pens[(tubep_textram[text_offs + 1] & 0x0f) | color_A4];
612            *BITMAP_ADDR16(bitmap, v, h) = (tubep_textram[text_offs + 1] & 0x0f) | color_A4;
613613         else
614614         {
615615            UINT32 bg_data;
r1771r1772
650650            if (sp_data != 0x0f)
651651               bg_data = prom2[sp_data | color_A4];
652652
653            *BITMAP_ADDR16(bitmap, v, h) = pens[ bg_data*64 + romB_data_h ];
653            *BITMAP_ADDR16(bitmap, v, h) = pen_base + bg_data*64 + romB_data_h;
654654         }
655655      }
656656   }
r1771r1772
737737{
738738   int DISP_ = DISP^1;
739739
740   const pen_t *pens = &machine->pens[ 0x00 ];
741
742740   UINT32 v;
743741   UINT8 *text_gfx_base = memory_region(REGION_GFX1);
744742   UINT8 *rom13D  = memory_region(REGION_USER1);
r1771r1772
779777         text_gfx_data = text_gfx_base[(text_code << 3) | (v & 0x07)];
780778
781779         if (text_gfx_data & (0x80 >> (h & 0x07)))
782            *BITMAP_ADDR16(bitmap, v, h) = machine->pens[0x10 | (tubep_textram[text_offs + 1] & 0x0f)];
780            *BITMAP_ADDR16(bitmap, v, h) = 0x10 | (tubep_textram[text_offs + 1] & 0x0f);
783781         else
784782         {
785783            UINT32 sp_data;
r1771r1772
790788               sp_data = sp_data1;
791789
792790            if (sp_data != 0x0f)
793               *BITMAP_ADDR16(bitmap, v, h) = pens[0x00+ sp_data ];
791               *BITMAP_ADDR16(bitmap, v, h) = 0x00 + sp_data;
794792            else
795793            {
796794               UINT32 bg_data;
r1771r1772
843841               color_bank =  (pal14h4_pin13 & ((bg_data&0x08)>>3) & ((bg_data&0x04)>>2) & (((bg_data&0x02)>>1)^1) &  (bg_data&0x01)    )
844842                        | (pal14h4_pin18 & ((bg_data&0x08)>>3) & ((bg_data&0x04)>>2) &  ((bg_data&0x02)>>1)    & ((bg_data&0x01)^1) )
845843                        | (pal14h4_pin19);
846               *BITMAP_ADDR16(bitmap, v, h) = pens[0x20+ color_bank*0x10 + bg_data ];
844               *BITMAP_ADDR16(bitmap, v, h) = 0x20 + color_bank*0x10 + bg_data;
847845            }
848846         }
849847      }
src/mame/video/xxmissio.c
r1771r1772
1010
1111#include "driver.h"
1212
13UINT8 *xxmissio_bgram;
1314UINT8 *xxmissio_fgram;
15UINT8 *xxmissio_spriteram;
1416
15static UINT8 xxmissio_xscroll,xxmissio_yscroll;
17static tilemap *bg_tilemap;
18static tilemap *fg_tilemap;
19static UINT8 xscroll;
20static UINT8 yscroll;
1621static UINT8 flipscreen;
1722
1823
1924WRITE8_HANDLER( xxmissio_scroll_x_w )
2025{
21   xxmissio_xscroll = data;
26   xscroll = data;
2227}
2328WRITE8_HANDLER( xxmissio_scroll_y_w )
2429{
25   xxmissio_yscroll = data;
30   yscroll = data;
2631}
2732
2833WRITE8_HANDLER( xxmissio_flipscreen_w )
r1771r1772
3035   flipscreen = data & 0x01;
3136}
3237
33WRITE8_HANDLER( xxmissio_videoram_w )
38WRITE8_HANDLER( xxmissio_bgram_w )
3439{
35   int offs = offset & 0x7e0;
36   int x = (offset + (xxmissio_xscroll >> 3) ) & 0x1f;
37   offs |= x;
40   int x = (offset + (xscroll >> 3)) & 0x1f;
41   offset = (offset & 0x7e0) | x;
3842
39   videoram[offs] = data;
43   xxmissio_bgram[offset] = data;
4044}
41READ8_HANDLER( xxmissio_videoram_r )
45READ8_HANDLER( xxmissio_bgram_r )
4246{
43   int offs = offset & 0x7e0;
44   int x = (offset + (xxmissio_xscroll >> 3) ) & 0x1f;
45   offs |= x;
47   int x = (offset + (xscroll >> 3)) & 0x1f;
48   offset = (offset & 0x7e0) | x;
4649
47   return videoram[offs];
50   return xxmissio_bgram[offset];
4851}
4952
5053WRITE8_HANDLER( xxmissio_paletteram_w )
r1771r1772
5457
5558/****************************************************************************/
5659
57VIDEO_UPDATE( xxmissio )
60static TILE_GET_INFO( get_bg_tile_info )
5861{
59   int offs;
60   int chr,col;
61   int x,y,px,py,fx,fy,sx,sy;
62   int code = ((xxmissio_bgram[0x400 | tile_index] & 0xc0) << 2) | xxmissio_bgram[0x000 | tile_index];
63   int color =  xxmissio_bgram[0x400 | tile_index] & 0x0f;
6264
63   int size = videoram_size/2;
65   SET_TILE_INFO(2, code, color, 0);
66}
6467
65/* draw BG layer */
68static TILE_GET_INFO( get_fg_tile_info )
69{
70   int code = xxmissio_fgram[0x000 | tile_index];
71   int color = xxmissio_fgram[0x400 | tile_index] & 0x07;
6672
67   for (y=0; y<32; y++)
68   {
69      for (x=0; x<32; x++)
70      {
71         offs = y*0x20 + x;
73   SET_TILE_INFO(0, code, color, 0);
74}
7275
73         if (flipscreen!=0)
74            offs = (size-1)-offs;
76VIDEO_START( xxmissio )
77{
78   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 16, 8, 32, 32);
79   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, 16, 8, 32, 32);
7580
76         px = x*16;
77         py = y*8;
81   tilemap_set_scroll_cols(bg_tilemap, 1);
82   tilemap_set_scroll_rows(bg_tilemap, 1);
83   tilemap_set_scrolldx(bg_tilemap, 2, 12);
7884
79         chr = videoram[ offs ] ;
80         col = videoram[ offs + size];
81         chr = chr + ((col & 0xc0) << 2 );
82         col = col & 0x0f;
85   tilemap_set_transparent_pen(fg_tilemap, 0);
86}
8387
84         drawgfx(tmpbitmap,machine->gfx[2],
85            chr,
86            col,
87            flipscreen,flipscreen,
88            px,py,
89            &machine->screen[0].visarea,TRANSPARENCY_NONE,0);
90      }
91   }
9288
93   if (flipscreen == 0)
94   {
95      sx = -xxmissio_xscroll*2+12;
96      sy = -xxmissio_yscroll;
97   }
98   else
99   {
100      sx = xxmissio_xscroll*2+2;
101      sy = xxmissio_yscroll;
102   }
89static void draw_sprites(mame_bitmap *bitmap, gfx_element **gfx, const rectangle *cliprect)
90{
91   int offs;
92   int chr,col;
93   int x,y,px,py,fx,fy;
10394
104   copyscrollbitmap(bitmap,tmpbitmap,1,&sx,1,&sy,cliprect);
105
106/* draw sprites */
107
108   for (offs=0; offs<spriteram_size; offs +=32)
95   for (offs=0; offs<0x800; offs +=0x20)
10996   {
110      chr = spriteram[offs];
111      col = spriteram[offs+3];
97      chr = xxmissio_spriteram[offs];
98      col = xxmissio_spriteram[offs+3];
11299
113100      fx = ((col & 0x10) >> 4) ^ flipscreen;
114101      fy = ((col & 0x20) >> 5) ^ flipscreen;
115102
116      x = spriteram[offs+1]*2;
117      y = spriteram[offs+2];
103      x = xxmissio_spriteram[offs+1]*2;
104      y = xxmissio_spriteram[offs+2];
118105
119106      chr = chr + ((col & 0x40) << 2);
120107      col = col & 0x07;
r1771r1772
126113      }
127114      else
128115      {
129         px = 480-x-8;
116         px = 480-x-6;
130117         py = 240-y;
131118      }
132119
133120      px &= 0x1ff;
134121
135      drawgfx(bitmap,machine->gfx[1],
122      drawgfx(bitmap,gfx[1],
136123         chr,
137124         col,
138125         fx,fy,
139126         px,py,
140127         cliprect,TRANSPARENCY_PEN,0);
128
141129      if (px>0x1e0)
142         drawgfx(bitmap,machine->gfx[1],
130         drawgfx(bitmap,gfx[1],
143131            chr,
144132            col,
145133            fx,fy,
r1771r1772
147135            cliprect,TRANSPARENCY_PEN,0);
148136
149137   }
138}
150139
151140
152/* draw FG layer */
141VIDEO_UPDATE( xxmissio )
142{
143   tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
144   tilemap_set_flip(ALL_TILEMAPS, flipscreen ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
153145
154   for (y=4; y<28; y++)
155   {
156      for (x=0; x<32; x++)
157      {
158         offs = y*32+x;
159         chr = xxmissio_fgram[offs];
160         col = xxmissio_fgram[offs + 0x400] & 0x07;
146   tilemap_set_scrollx(bg_tilemap, 0, xscroll * 2);
147   tilemap_set_scrolly(bg_tilemap, 0, yscroll);
161148
162         if (flipscreen==0)
163         {
164            px = 16*x;
165            py = 8*y;
166         }
167         else
168         {
169            px = 496-16*x;
170            py = 248-8*y;
171         }
149   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
150   draw_sprites(bitmap, machine->gfx, cliprect);
151   tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
172152
173         drawgfx(bitmap,machine->gfx[0],
174            chr,
175            col,
176            flipscreen,flipscreen,
177            px,py,
178            cliprect,TRANSPARENCY_PEN,0);
179      }
180   }
181
182153   return 0;
183154}
src/mame/video/pcktgal.c
r1771r1772
3838
3939WRITE8_HANDLER( pcktgal_flipscreen_w )
4040{
41   if (flip_screen != (data & 0x80))
41   if (flip_screen_get() != (data & 0x80))
4242   {
4343      flip_screen_set(data & 0x80);
4444      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
r1771r1772
7575
7676         flipx = spriteram[offs+1] & 0x04;
7777         flipy = spriteram[offs+1] & 0x02;
78         if (flip_screen) {
78         if (flip_screen_get()) {
7979            sx=240-sx;
8080            sy=240-sy;
8181            if (flipx) flipx=0; else flipx=1;
src/mame/video/solomon.c
r1771r1772
3131
3232WRITE8_HANDLER( solomon_flipscreen_w )
3333{
34   if (flip_screen != (data & 0x01))
34   if (flip_screen_get() != (data & 0x01))
3535   {
3636      flip_screen_set(data & 0x01);
3737      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
r1771r1772
8181      int sx = spriteram[offs + 3];
8282      int sy = 241 - spriteram[offs + 2];
8383
84      if (flip_screen)
84      if (flip_screen_get())
8585      {
8686         sx = 240 - sx;
8787         sy = 242 - sy;
src/mame/video/gladiatr.c
r1771r1772
222222      int color = src[1] & 0x1f;
223223      int x,y;
224224
225      if (flip_screen)
225      if (flip_screen_get())
226226      {
227227         xflip = !xflip;
228228         yflip = !yflip;
r1771r1772
292292      int scroll;
293293
294294      scroll = bg_scrollx + ((video_attributes & 0x04) << 6);
295      tilemap_set_scrollx(bg_tilemap, 0, scroll ^ (flip_screen ? 0x0f : 0));
295      tilemap_set_scrollx(bg_tilemap, 0, scroll ^ (flip_screen_get() ? 0x0f : 0));
296296      scroll = fg_scrollx + ((video_attributes & 0x08) << 5);
297      tilemap_set_scrollx(fg_tilemap, 0, scroll ^ (flip_screen ? 0x0f : 0));
297      tilemap_set_scrollx(fg_tilemap, 0, scroll ^ (flip_screen_get() ? 0x0f : 0));
298298
299299      // always 0 anyway
300300      tilemap_set_scrolly(bg_tilemap, 0, bg_scrolly);
src/mame/video/goindol.c
r1771r1772
100100      sx = sprite_ram[offs];
101101      sy = 240-sprite_ram[offs+1];
102102
103      if (flip_screen)
103      if (flip_screen_get())
104104      {
105105         sx = 248 - sx;
106106         sy = 248 - sy;
r1771r1772
115115         drawgfx(bitmap,machine->gfx[gfxbank],
116116                  tile,
117117                  palette,
118                  flip_screen,flip_screen,
118                  flip_screen_get(),flip_screen_get(),
119119                  sx,sy,
120120                  cliprect,
121121                  TRANSPARENCY_PEN, 0);
122122         drawgfx(bitmap,machine->gfx[gfxbank],
123123                  tile+1,
124124                  palette,
125                  flip_screen,flip_screen,
126                  sx,sy + (flip_screen ? -8 : 8),
125                  flip_screen_get(),flip_screen_get(),
126                  sx,sy + (flip_screen_get() ? -8 : 8),
127127                  cliprect,
128128                  TRANSPARENCY_PEN, 0);
129129      }
src/mame/video/groundfx.c
r1771r1772
240240   pivlayer[2] = 2;
241241
242242   fillbitmap(priority_bitmap,0,cliprect);
243   fillbitmap(bitmap,machine->pens[0],cliprect);   /* wrong color? */
243   fillbitmap(bitmap,0,cliprect);   /* wrong color? */
244244
245245   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,pivlayer[0],0,0);
246246   TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,pivlayer[1],0,0);
src/mame/video/cabal.c
r1771r1772
119119
120120         if ( sx>256 )   sx -= 512;
121121
122         if (flip_screen)
122         if (flip_screen_get())
123123         {
124124            sx = 240 - sx;
125125            sy = 240 - sy;
src/mame/video/suprloco.c
r1771r1772
119119
120120WRITE8_HANDLER( suprloco_scrollram_w )
121121{
122   int adj = flip_screen ? -8 : 8;
122   int adj = flip_screen_get() ? -8 : 8;
123123
124124   suprloco_scrollram[offset] = data;
125125   tilemap_set_scrollx(bg_tilemap,offset, data - adj);
r1771r1772
160160
161161INLINE void draw_pixel(mame_bitmap *bitmap,const rectangle *cliprect,int x,int y,int color)
162162{
163   if (flip_screen)
163   if (flip_screen_get())
164164   {
165165      x = bitmap->width - x - 1;
166166      y = bitmap->height - y - 1;
r1771r1772
176176}
177177
178178
179static void draw_sprite(running_machine *machine, mame_bitmap *bitmap,const rectangle *cliprect,int spr_number)
179static void draw_sprite(mame_bitmap *bitmap,const rectangle *cliprect,int spr_number)
180180{
181181   int sx,sy,col,row,height,src,adjy,dy;
182182   UINT8 *spr_reg;
183   const pen_t *spr_palette;
183   pen_t pen_base;
184184   short skip;   /* bytes to skip before drawing each row (can be negative) */
185185
186186
r1771r1772
190190   skip = spr_reg[SPR_SKIP_LO] + (spr_reg[SPR_SKIP_HI] << 8);
191191
192192   height      = spr_reg[SPR_Y_BOTTOM] - spr_reg[SPR_Y_TOP];
193   spr_palette   = machine->pens + 0x100 + 0x10 * (spr_reg[SPR_COL]&0x03) + ((control & 0x20)?0x100:0);
193   pen_base = 0x100 + 0x10 * (spr_reg[SPR_COL]&0x03) + ((control & 0x20)?0x100:0);
194194   sx = spr_reg[SPR_X];
195195   sy = spr_reg[SPR_Y_TOP] + 1;
196196
197   if (!flip_screen)
197   if (!flip_screen_get())
198198   {
199199      adjy = sy;
200200      dy = 1;
r1771r1772
236236
237237         if (color1 == 15) break;
238238         if (color1)
239            draw_pixel(bitmap,cliprect,sx+col,  adjy,spr_palette[color1]);
239            draw_pixel(bitmap,cliprect,sx+col,  adjy,pen_base + color1);
240240
241241         if (color2 == 15) break;
242242         if (color2)
243            draw_pixel(bitmap,cliprect,sx+col+1,adjy,spr_palette[color2]);
243            draw_pixel(bitmap,cliprect,sx+col+1,adjy,pen_base + color2);
244244
245245         col += 2;
246246      }
247247   }
248248}
249249
250static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
250static void draw_sprites(mame_bitmap *bitmap, const rectangle *cliprect)
251251{
252252   int spr_number;
253253   UINT8 *spr_reg;
r1771r1772
257257   {
258258      spr_reg = spriteram + 0x10 * spr_number;
259259      if (spr_reg[SPR_X] != 0xff)
260         draw_sprite(machine, bitmap, cliprect, spr_number);
260         draw_sprite(bitmap, cliprect, spr_number);
261261   }
262262}
263263
264264VIDEO_UPDATE( suprloco )
265265{
266266   tilemap_draw(bitmap,cliprect,bg_tilemap,0,0);
267   draw_sprites(machine, bitmap,cliprect);
267   draw_sprites(bitmap,cliprect);
268268   tilemap_draw(bitmap,cliprect,bg_tilemap,1,0);
269269   return 0;
270270}
src/mame/video/m92.c
r1771r1772
340340            x &= 0x1ff;
341341            for (i=0; i<y_multi; i++)
342342            {
343               if (flip_screen) {
343               if (flip_screen_get()) {
344344                  pdrawgfx(bitmap,machine->gfx[1],
345345                        sprite + s_ptr,
346346                        colour,
r1771r1772
441441      tilemap_draw(bitmap, cliprect, pf_layer[2].tmap,      TILEMAP_DRAW_LAYER0, 1);
442442   }
443443   else
444      fillbitmap(bitmap, machine->pens[0], cliprect);
444      fillbitmap(bitmap, 0, cliprect);
445445
446446   tilemap_draw(bitmap, cliprect, pf_layer[1].wide_tmap, TILEMAP_DRAW_LAYER1, 0);
447447   tilemap_draw(bitmap, cliprect, pf_layer[1].tmap,      TILEMAP_DRAW_LAYER1, 0);
src/mame/video/m58.c
r1771r1772
241241         code2 = code1 + 0x40;
242242      }
243243
244      if (flip_screen)
244      if (flip_screen_get())
245245      {
246246         sx = 240 - sx;
247247         sy2 = 192 - sy1;
r1771r1772
281281         0*8, 6*8-1,
282282         1*8, 31*8-1
283283      };
284      rectangle clip = flip_screen ? clippanelflip : clippanel;
285      int sx = flip_screen ? cliprect->min_x - 8 : cliprect->max_x + 1 - SCROLL_PANEL_WIDTH;
286      int yoffs = flip_screen ? -40 : -16;
284      rectangle clip = flip_screen_get() ? clippanelflip : clippanel;
285      int sx = flip_screen_get() ? cliprect->min_x - 8 : cliprect->max_x + 1 - SCROLL_PANEL_WIDTH;
286      int yoffs = flip_screen_get() ? -40 : -16;
287287
288288      clip.min_y += machine->screen[0].visarea.min_y + yoffs;
289289      clip.max_y += machine->screen[0].visarea.max_y + yoffs;
290290
291      copybitmap(bitmap, scroll_panel_bitmap, flip_screen, flip_screen,
291      copybitmap(bitmap, scroll_panel_bitmap, flip_screen_get(), flip_screen_get(),
292292               sx, machine->screen[0].visarea.min_y + yoffs, &clip);
293293   }
294294}
src/mame/video/destroyr.c
r1771r1772
1919   int i;
2020   int j;
2121
22   fillbitmap(bitmap, machine->pens[0], cliprect);
22   fillbitmap(bitmap, 0, cliprect);
2323
2424   /* draw major objects */
2525
r1771r1772
8484   for (i = 0; i < 256; i++)
8585   {
8686      if (i & 4)
87         *BITMAP_ADDR16(bitmap, destroyr_cursor ^ 0xff, i) = machine->pens[7];
87         *BITMAP_ADDR16(bitmap, destroyr_cursor ^ 0xff, i) = 7;
8888   }
8989   return 0;
9090}
src/mame/video/thoop2.c
r1771r1772
211211
212212   thoop2_sort_sprites();
213213
214   fillbitmap( bitmap, machine->pens[0], cliprect );
214   fillbitmap( bitmap, 0, cliprect );
215215
216216   tilemap_draw(bitmap,cliprect,pant[1],TILEMAP_DRAW_LAYER1 | 3,0);
217217   tilemap_draw(bitmap,cliprect,pant[0],TILEMAP_DRAW_LAYER1 | 3,0);
src/mame/video/wwfwfest.c
r1771r1772
189189         number = (source[2] & 0x00ff) | (source[3] & 0x00ff) << 8;
190190         colourbank = (source[4] & 0x000f);
191191
192         if (flip_screen) {
192         if (flip_screen_get()) {
193193            if (flipy) flipy=0; else flipy=1;
194194            if (flipx) flipx=0; else flipx=1;
195195            ypos=240-ypos-sprite_xoff;
r1771r1772
197197         }
198198
199199         for (count=0;count<chain;count++) {
200            if (flip_screen) {
200            if (flip_screen_get()) {
201201               if (!flipy) {
202202                  drawgfx(bitmap,gfx,number+count,colourbank,flipx,flipy,xpos,ypos+(16*(chain-1))-(16*count),cliprect,TRANSPARENCY_PEN,0);
203203               } else {
src/mame/video/pktgaldx.c
r1771r1772
99static void draw_sprites(running_machine *machine, mame_bitmap *bitmap,const rectangle *cliprect)
1010{
1111   int offs;
12   int flipscreen=!flip_screen;
12   int flipscreen=!flip_screen_get();
1313
1414   for (offs = 0;offs < 0x400;offs += 4)
1515   {
r1771r1772
8989   flip_screen_set( deco16_pf12_control[0]&0x80 );
9090   deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll);
9191
92   fillbitmap(bitmap,machine->pens[0x0],cliprect); /* not Confirmed */
92   fillbitmap(bitmap,0,cliprect); /* not Confirmed */
9393   fillbitmap(priority_bitmap,0,NULL);
9494
9595   deco16_tilemap_2_draw(bitmap,cliprect,0,0);
src/mame/video/fuukifg2.c
r1771r1772
186186      sx = (sx & 0x1ff) - (sx & 0x200);
187187      sy = (sy & 0x1ff) - (sy & 0x200);
188188
189      if (flip_screen)
189      if (flip_screen_get())
190190      {   flipx = !flipx;      sx = max_x - sx - xnum * 16;
191191         flipy = !flipy;      sy = max_y - sy - ynum * 16;   }
192192
r1771r1772
313313
314314   /* Layers scrolling */
315315
316   scrolly_offs = fuuki16_vregs[0xc/2] - (flip_screen ? 0x103 : 0x1f3);
317   scrollx_offs = fuuki16_vregs[0xe/2] - (flip_screen ? 0x2a7 : 0x3f6);
316   scrolly_offs = fuuki16_vregs[0xc/2] - (flip_screen_get() ? 0x103 : 0x1f3);
317   scrollx_offs = fuuki16_vregs[0xe/2] - (flip_screen_get() ? 0x2a7 : 0x3f6);
318318
319319   layer0_scrolly = fuuki16_vregs[0x0/2] + scrolly_offs;
320320   layer0_scrollx = fuuki16_vregs[0x2/2] + scrollx_offs;
src/mame/video/vulgus.c
r1771r1772
185185      sx = spriteram[offs + 3];
186186      sy = spriteram[offs + 2];
187187      dir = 1;
188      if (flip_screen)
188      if (flip_screen_get())
189189      {
190190         sx = 240 - sx;
191191         sy = 240 - sy;
r1771r1772
200200         drawgfx(bitmap,machine->gfx[2],
201201               code + i,
202202               col,
203               flip_screen,flip_screen,
203               flip_screen_get(),flip_screen_get(),
204204               sx, sy + 16 * i * dir,
205205               cliprect,TRANSPARENCY_PEN,15);
206206
r1771r1772
208208         drawgfx(bitmap,machine->gfx[2],
209209               code + i,
210210               col,
211               flip_screen,flip_screen,
211               flip_screen_get(),flip_screen_get(),
212212               sx, sy + 16 * i * dir -  dir * 256,
213213               cliprect,TRANSPARENCY_PEN,15);
214214         i--;
src/mame/video/circus.c
r1771r1772
5151       8, 8, 32, 32);
5252}
5353
54static void draw_line(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, int x1, int y1, int x2, int y2, int dotted)
54static void draw_line(mame_bitmap *bitmap, const rectangle *cliprect, int x1, int y1, int x2, int y2, int dotted)
5555{
5656   /* Draws horizontal and Vertical lines only! */
5757
r1771r1772
6666
6767   if (x1 == x2)
6868      for (count = y2; count >= y1; count -= skip)
69         *BITMAP_ADDR16(bitmap, count, x1) = machine->pens[1];
69         *BITMAP_ADDR16(bitmap, count, x1) = 1;
7070   else
7171      for (count = x2; count >= x1; count -= skip)
72         *BITMAP_ADDR16(bitmap, y1, count) = machine->pens[1];
72         *BITMAP_ADDR16(bitmap, y1, count) = 1;
7373}
7474
75static void draw_robot_box (running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, int x, int y)
75static void draw_robot_box(mame_bitmap *bitmap, const rectangle *cliprect, int x, int y)
7676{
7777   /* Box */
7878
7979   int ex = x + 24;
8080   int ey = y + 26;
8181
82   draw_line(machine,bitmap,cliprect,x,y,ex,y,0);       /* Top */
83   draw_line(machine,bitmap,cliprect,x,ey,ex,ey,0);     /* Bottom */
84   draw_line(machine,bitmap,cliprect,x,y,x,ey,0);       /* Left */
85   draw_line(machine,bitmap,cliprect,ex,y,ex,ey,0);     /* Right */
82   draw_line(bitmap,cliprect,x,y,ex,y,0);       /* Top */
83   draw_line(bitmap,cliprect,x,ey,ex,ey,0);     /* Bottom */
84   draw_line(bitmap,cliprect,x,y,x,ey,0);       /* Left */
85   draw_line(bitmap,cliprect,ex,y,ex,ey,0);     /* Right */
8686
8787   /* Score Grid */
8888
8989   ey = y + 10;
90   draw_line(machine,bitmap,cliprect,x+8,ey,ex,ey,0);   /* Horizontal Divide Line */
91   draw_line(machine,bitmap,cliprect,x+8,y,x+8,ey,0);
92   draw_line(machine,bitmap,cliprect,x+16,y,x+16,ey,0);
90   draw_line(bitmap,cliprect,x+8,ey,ex,ey,0);   /* Horizontal Divide Line */
91   draw_line(bitmap,cliprect,x+8,y,x+8,ey,0);
92   draw_line(bitmap,cliprect,x+16,y,x+16,ey,0);
9393}
9494
9595static void circus_draw_fg(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
r1771r1772
9797   /* The sync generator hardware is used to   */
9898   /* draw the border and diving boards        */
9999
100   draw_line (machine,bitmap,cliprect,0,18,255,18,0);
101   draw_line (machine,bitmap,cliprect,0,249,255,249,1);
102   draw_line (machine,bitmap,cliprect,0,18,0,248,0);
103   draw_line (machine,bitmap,cliprect,247,18,247,248,0);
100   draw_line (bitmap,cliprect,0,18,255,18,0);
101   draw_line (bitmap,cliprect,0,249,255,249,1);
102   draw_line (bitmap,cliprect,0,18,0,248,0);
103   draw_line (bitmap,cliprect,247,18,247,248,0);
104104
105   draw_line (machine,bitmap,cliprect,0,137,17,137,0);
106   draw_line (machine,bitmap,cliprect,231,137,248,137,0);
107   draw_line (machine,bitmap,cliprect,0,193,17,193,0);
108   draw_line (machine,bitmap,cliprect,231,193,248,193,0);
105   draw_line (bitmap,cliprect,0,137,17,137,0);
106   draw_line (bitmap,cliprect,231,137,248,137,0);
107   draw_line (bitmap,cliprect,0,193,17,193,0);
108   draw_line (bitmap,cliprect,231,193,248,193,0);
109109
110110   drawgfx(bitmap,machine->gfx[1],
111111         clown_z,
r1771r1772
122122   return 0;
123123}
124124
125static void robotbwl_draw_scoreboard(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
125static void robotbwl_draw_scoreboard(mame_bitmap *bitmap, const rectangle *cliprect)
126126{
127127   int offs;
128128
r1771r1772
131131
132132   for(offs=15;offs<=63;offs+=24)
133133   {
134      draw_robot_box(machine, bitmap, cliprect, offs, 31);
135      draw_robot_box(machine, bitmap, cliprect, offs, 63);
136      draw_robot_box(machine, bitmap, cliprect, offs, 95);
134      draw_robot_box(bitmap, cliprect, offs, 31);
135      draw_robot_box(bitmap, cliprect, offs, 63);
136      draw_robot_box(bitmap, cliprect, offs, 95);
137137
138      draw_robot_box(machine, bitmap, cliprect, offs+152, 31);
139      draw_robot_box(machine, bitmap, cliprect, offs+152, 63);
140      draw_robot_box(machine, bitmap, cliprect, offs+152, 95);
138      draw_robot_box(bitmap, cliprect, offs+152, 31);
139      draw_robot_box(bitmap, cliprect, offs+152, 63);
140      draw_robot_box(bitmap, cliprect, offs+152, 95);
141141   }
142142
143   draw_robot_box(machine, bitmap, cliprect, 39, 127);                  /* 10th Frame */
144   draw_line(machine,bitmap, cliprect, 39,137,47,137,0);          /* Extra digit box */
143   draw_robot_box(bitmap, cliprect, 39, 127);                  /* 10th Frame */
144   draw_line(bitmap, cliprect, 39,137,47,137,0);          /* Extra digit box */
145145
146   draw_robot_box(machine, bitmap, cliprect, 39+152, 127);
147   draw_line(machine,bitmap, cliprect, 39+152,137,47+152,137,0);
146   draw_robot_box(bitmap, cliprect, 39+152, 127);
147   draw_line(bitmap, cliprect, 39+152,137,47+152,137,0);
148148}
149149
150static void robotbwl_draw_bowling_alley(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
150static void robotbwl_draw_bowling_alley(mame_bitmap *bitmap, const rectangle *cliprect)
151151{
152   draw_line(machine,bitmap, cliprect, 103,17,103,205,0);
153   draw_line(machine,bitmap, cliprect, 111,17,111,203,1);
154   draw_line(machine,bitmap, cliprect, 152,17,152,205,0);
155   draw_line(machine,bitmap, cliprect, 144,17,144,203,1);
152   draw_line(bitmap, cliprect, 103,17,103,205,0);
153   draw_line(bitmap, cliprect, 111,17,111,203,1);
154   draw_line(bitmap, cliprect, 152,17,152,205,0);
155   draw_line(bitmap, cliprect, 144,17,144,203,1);
156156}
157157
158158static void robotbwl_draw_ball(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
r1771r1772
168168VIDEO_UPDATE( robotbwl )
169169{
170170   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
171   robotbwl_draw_scoreboard(machine, bitmap, cliprect);
172   robotbwl_draw_bowling_alley(machine, bitmap, cliprect);
171   robotbwl_draw_scoreboard(bitmap, cliprect);
172   robotbwl_draw_bowling_alley(bitmap, cliprect);
173173   robotbwl_draw_ball(machine, bitmap, cliprect);
174174   return 0;
175175}
src/mame/video/shangha3.c
r1771r1772
8282      int i;
8383
8484      /* Prepare the shadow table */
85      /* We draw in a raw bitmap so we don't have to remap pens through machine->pens */
8685      for (i = 0;i < 14;i++)
8786         gfx_drawmode_table[i] = DRAWMODE_SOURCE;
8887      gfx_drawmode_table[14] = DRAWMODE_SHADOW;
8988      for (i = 0;i < 128;i++)
90         machine->shadow_table[machine->pens[i]] = machine->pens[i+128];
89         machine->shadow_table[i] = i+128;
9190   }
9291}
9392
r1771r1772
135134      zoomx = shangha3_ram[offs+10];
136135      zoomy = shangha3_ram[offs+13];
137136
138      if (flip_screen)
137      if (flip_screen_get())
139138      {
140139         sx = 383 - sx - sizex;
141140         sy = 255 - sy - sizey;
src/mame/video/vastar.c
r1771r1772
146146      flipx = spriteram_3[offs] & 0x02;
147147      flipy = spriteram_3[offs] & 0x01;
148148
149      if (flip_screen)
149      if (flip_screen_get())
150150      {
151151         flipx = !flipx;
152152         flipy = !flipy;
r1771r1772
154154
155155      if (spriteram_2[offs] & 0x08)   /* double width */
156156      {
157         if (!flip_screen)
157         if (!flip_screen_get())
158158            sy = 224 - sy;
159159
160160         drawgfx(bitmap,machine->gfx[2],
r1771r1772
173173      }
174174      else
175175      {
176         if (!flip_screen)
176         if (!flip_screen_get())
177177            sy = 240 - sy;
178178
179179         drawgfx(bitmap,machine->gfx[1],
src/mame/video/gaelco2.c
r1771r1772
456456   }
457457
458458   /* draw screen */
459   fillbitmap(bitmap, machine->pens[0], cliprect);
459   fillbitmap(bitmap, 0, cliprect);
460460
461461   tilemap_draw(bitmap, cliprect, pant[1], 0, 0);
462462   tilemap_draw(bitmap, cliprect, pant[0], 0, 0);
r1771r1772
485485   }
486486
487487   /* draw screen */
488   fillbitmap(bitmap, machine->pens[0], cliprect);
488   fillbitmap(bitmap, 0, cliprect);
489489
490490   if (screen==1)
491491   {
src/mame/video/champbas.c
r1771r1772
117117
118118WRITE8_HANDLER( champbas_flipscreen_w )
119119{
120   if (flip_screen != data)
120   if (flip_screen_get() != data)
121121   {
122122      flip_screen_set(data);
123123      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
src/mame/video/baraduke.c
r1771r1772
261261
262262         sy -= 16 * sizey;
263263
264         if (flip_screen)
264         if (flip_screen_get())
265265         {
266266            sx = 496+3 - 16 * sizex - sx;
267267            sy = 240 - 16 * sizey - sy;
r1771r1772
296296
297297   scrollx = xscroll[layer] + xdisp[layer];
298298   scrolly = yscroll[layer] + 9;
299   if (flip_screen)
299   if (flip_screen_get())
300300   {
301301      scrollx = -scrollx + 3;
302302      scrolly = -scrolly;
r1771r1772
313313
314314   /* flip screen is embedded in the sprite control registers */
315315   /* can't use flip_screen_set() because the visible area is asymmetrical */
316   flip_screen = spriteram[0x07f6] & 0x01;
317   tilemap_set_flip(ALL_TILEMAPS,flip_screen ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
316   flip_screen_set_no_update(spriteram[0x07f6] & 0x01);
317   tilemap_set_flip(ALL_TILEMAPS,flip_screen_get() ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
318318   set_scroll(0);
319319   set_scroll(1);
320320
src/mame/video/ssozumo.c
r1771r1772
155155         int sx = 239 - spriteram[offs + 3];
156156         int sy = (240 - spriteram[offs + 2]) & 0xff;
157157
158         if (flip_screen)
158         if (flip_screen_get())
159159         {
160160            sx = 240 - sx;
161161            sy = 240 - sy;
src/mame/video/m107.c
r1771r1772
281281      tilemap_draw(bitmap, cliprect, pf_layer[3].tmap, 1, 0);
282282   }
283283   else
284      fillbitmap(bitmap, machine->pens[0], cliprect);
284      fillbitmap(bitmap, 0, cliprect);
285285
286286   tilemap_draw(bitmap, cliprect, pf_layer[2].tmap, 0, 0);
287287   tilemap_draw(bitmap, cliprect, pf_layer[2].tmap, 1, 0);
src/mame/video/arkanoid.c
r1771r1772
2626   int bank;
2727
2828   /* bits 0 and 1 flip X and Y, I don't know which is which */
29   if (flip_screen_x != (data & 0x01)) {
29   if (flip_screen_x_get() != (data & 0x01)) {
3030      flip_screen_x_set(data & 0x01);
3131      tilemap_mark_all_tiles_dirty(bg_tilemap);
3232   }
3333
34   if (flip_screen_y != (data & 0x02)) {
34   if (flip_screen_y_get() != (data & 0x02)) {
3535      flip_screen_y_set(data & 0x02);
3636      tilemap_mark_all_tiles_dirty(bg_tilemap);
3737   }
r1771r1772
9999
100100      sx = spriteram[offs];
101101      sy = 248 - spriteram[offs + 1];
102      if (flip_screen_x) sx = 248 - sx;
103      if (flip_screen_y) sy = 248 - sy;
102      if (flip_screen_x_get()) sx = 248 - sx;
103      if (flip_screen_y_get()) sy = 248 - sy;
104104
105105      code = spriteram[offs + 3] + ((spriteram[offs + 2] & 0x03) << 8) + 1024 * gfxbank;
106106
107107      drawgfx(bitmap,machine->gfx[0],
108108            2 * code,
109109            ((spriteram[offs + 2] & 0xf8) >> 3) + 32 * palettebank,
110            flip_screen_x,flip_screen_y,
111            sx,sy + (flip_screen_y ? 8 : -8),
110            flip_screen_x_get(),flip_screen_y_get(),
111            sx,sy + (flip_screen_y_get() ? 8 : -8),
112112            cliprect,TRANSPARENCY_PEN,0);
113113      drawgfx(bitmap,machine->gfx[0],
114114            2 * code + 1,
115115            ((spriteram[offs + 2] & 0xf8) >> 3) + 32 * palettebank,
116            flip_screen_x,flip_screen_y,
116            flip_screen_x_get(),flip_screen_y_get(),
117117            sx,sy,
118118            cliprect,TRANSPARENCY_PEN,0);
119119   }
src/mame/video/megasys1.c
r1771r1772
10011001            if (flag != 0)
10021002            {
10031003               flag = 0;
1004               fillbitmap(bitmap,machine->pens[0],cliprect);
1004               fillbitmap(bitmap,0,cliprect);
10051005            }
10061006
10071007            if (megasys1_sprite_flag & 0x100)   /* sprites are split */
src/mame/video/crshrace.c
r1771r1772
191191      return 0;
192192   }
193193
194   fillbitmap(bitmap,machine->pens[0x1ff],cliprect);
194   fillbitmap(bitmap,0x1ff,cliprect);
195195
196196   switch (gfxctrl & 0xfb)
197197   {
src/mame/video/pacman.c
r1771r1772
219219VIDEO_UPDATE( pacman )
220220{
221221   if (bgpriority != 0)
222      fillbitmap(bitmap,machine->pens[0],cliprect);
222      fillbitmap(bitmap,0,cliprect);
223223   else
224224      tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_OPAQUE,0);
225225
src/mame/video/clshroad.c
r1771r1772
305305      int flipy   =   0;
306306
307307      x -= 0x4a/2;
308      if (flip_screen)
308      if (flip_screen_get())
309309      {
310310         y = 240 - y;
311311         flipx = !flipx;
src/mame/video/chqflag.c
r1771r1772
7676
7777VIDEO_UPDATE( chqflag )
7878{
79   fillbitmap(bitmap,machine->pens[0],cliprect);
79   fillbitmap(bitmap,0,cliprect);
8080
8181   K051316_zoom_draw_1(bitmap,cliprect,TILEMAP_DRAW_LAYER1,0);
8282   K051960_sprites_draw(bitmap,cliprect,0,0);
src/mame/video/sf.c
r1771r1772
148148      {
149149         int c1,c2,c3,c4,t;
150150
151         if (flip_screen)
151         if (flip_screen_get())
152152         {
153153            sx = 480 - sx;
154154            sy = 224 - sy;
r1771r1772
203203      }
204204      else
205205      {
206         if (flip_screen)
206         if (flip_screen_get())
207207         {
208208            sx = 496 - sx;
209209            sy = 240 - sy;
r1771r1772
228228   if (sf_active & 0x20)
229229      tilemap_draw(bitmap,cliprect,bg_tilemap,0,0);
230230   else
231      fillbitmap(bitmap,machine->pens[0],cliprect);
231      fillbitmap(bitmap,0,cliprect);
232232
233233   tilemap_draw(bitmap,cliprect,fg_tilemap,0,0);
234234
src/mame/video/lsasquad.c
r1771r1772
1818
1919      base = 64 * scrollram[offs+1];
2020      sx = 8*(offs/4) + scrollx;
21      if (flip_screen) sx = 248 - sx;
21      if (flip_screen_get()) sx = 248 - sx;
2222      sx &= 0xff;
2323
2424      for (y = 0;y < 32;y++)
r1771r1772
2626         int attr;
2727
2828         sy = 8*y + scrolly;
29         if (flip_screen) sy = 248 - sy;
29         if (flip_screen_get()) sy = 248 - sy;
3030         sy &= 0xff;
3131
3232         attr = videoram[base + 2*y + 1];
r1771r1772
3636         drawgfx(bitmap,machine->gfx[0],
3737               code,
3838               color,
39               flip_screen,flip_screen,
39               flip_screen_get(),flip_screen_get(),
4040               sx,sy,
4141               cliprect,TRANSPARENCY_PEN,15);
4242         if (sx > 248)   /* wraparound */
4343            drawgfx(bitmap,machine->gfx[0],
4444                  code,
4545                  color,
46                  flip_screen,flip_screen,
46                  flip_screen_get(),flip_screen_get(),
4747                  sx-256,sy,
4848                  cliprect,TRANSPARENCY_PEN,15);
4949      }
r1771r1772
103103      base = 64 * lsasquad_scrollram[offs+1];
104104      sx = scrollx+stepx;
105105
106      if (flip_screen) sx = 248 - sx;
106      if (flip_screen_get()) sx = 248 - sx;
107107      sx &= 0xff;
108108
109109      for (y = 0;y < 32;y++)
r1771r1772
111111         int attr;
112112
113113         sy = 8*y + scrolly;
114         if (flip_screen) sy = 248 - sy;
114         if (flip_screen_get()) sy = 248 - sy;
115115         sy &= 0xff;
116116
117117         attr = videoram[base + 2*y + 1];
r1771r1772
124124         drawgfx(bitmap,machine->gfx[0],
125125               code,
126126               color,
127               flip_screen,flip_screen,
127               flip_screen_get(),flip_screen_get(),
128128               sx,sy,
129129               cliprect,TRANSPARENCY_PEN,15);
130130         if (sx > 248)   /* wraparound */
131131            drawgfx(bitmap,machine->gfx[0],
132132                  code,
133133                  color,
134                  flip_screen,flip_screen,
134                  flip_screen_get(),flip_screen_get(),
135135                  sx-256,sy,
136136                  cliprect,TRANSPARENCY_PEN,15);
137137               }
r1771r1772
175175      flipx = attr & 0x40;
176176      flipy = attr & 0x80;
177177
178      if (flip_screen)
178      if (flip_screen_get())
179179      {
180180         sx = 240 - sx;
181181         sy = 240 - sy;
r1771r1772
201201
202202VIDEO_UPDATE( lsasquad )
203203{
204   fillbitmap(bitmap,machine->pens[511],cliprect);
204   fillbitmap(bitmap,511,cliprect);
205205
206206   draw_layer(machine,bitmap,cliprect,lsasquad_scrollram + 0x000);
207207   draw_layer(machine,bitmap,cliprect,lsasquad_scrollram + 0x080);
r1771r1772
213213
214214VIDEO_UPDATE( daikaiju )
215215{
216   fillbitmap(bitmap,machine->pens[511],cliprect);
216   fillbitmap(bitmap,511,cliprect);
217217   drawbg(machine,bitmap,cliprect,0); // bottom
218218   draw_sprites(machine,bitmap,cliprect);
219219   drawbg(machine,bitmap,cliprect,1);   // top = pallete $d ?
src/mame/video/cave.c
r1771r1772
15251525
15261526   cave_sprite_check(machine, cliprect);
15271527
1528   fillbitmap(bitmap,machine->pens[background_color],cliprect);
1528   fillbitmap(bitmap,background_color,cliprect);
15291529
15301530   /*
15311531        Tiles and sprites are ordered by priority (0 back, 3 front) with
src/mame/video/dooyong.c
r1771r1772
413413         }
414414      }
415415
416      if (flip_screen)
416      if (flip_screen_get())
417417      {
418418         sx = 498 - sx;
419419         sy = 240 - (16 * height) - sy;
r1771r1772
475475         width = buffered_spriteram16[offs+1] & 0x000f;
476476         height = (buffered_spriteram16[offs+1] & 0x00f0) >> 4;
477477
478         if (flip_screen)
478         if (flip_screen_get())
479479         {
480480            sx = 498 - (16 * width) - sx;
481481            sy = 240 - (16 * height) - sy;
src/mame/video/dec8.c
r1771r1772
276276      y=(y+16)%0x200;
277277      x=256 - x;
278278      y=256 - y;
279      if (flip_screen) {
279      if (flip_screen_get()) {
280280         y=240-y;
281281         x=240-x;
282282         if (fx) fx=0; else fx=1;
r1771r1772
348348         inc = 1;
349349      }
350350
351      if (flip_screen) {
351      if (flip_screen_get()) {
352352         y=240-y;
353353         x=240-x;
354354         if (fx) fx=0; else fx=1;
r1771r1772
394394      fx = buffered_spriteram[offs+1] & 0x04;
395395      multi = buffered_spriteram[offs+1] & 0x10;
396396
397      if (flip_screen) {
397      if (flip_screen_get()) {
398398         sy=240-sy;
399399         sx=240-sx;
400400         if (fx) fx=0; else fx=1;
r1771r1772
405405       drawgfx(bitmap,machine->gfx[1],
406406              code,
407407            color,
408            fx,flip_screen,
408            fx,flip_screen_get(),
409409            sx,sy,
410410            cliprect,TRANSPARENCY_PEN,0);
411411        if (multi)
412412          drawgfx(bitmap,machine->gfx[1],
413413            code+1,
414414            color,
415            fx,flip_screen,
415            fx,flip_screen_get(),
416416            sx,sy2,
417417            cliprect,TRANSPARENCY_PEN,0);
418418   }
src/mame/video/fuukifg3.c
r1771r1772
210210      sx = (sx & 0x1ff) - (sx & 0x200);
211211      sy = (sy & 0x1ff) - (sy & 0x200);
212212
213      if (flip_screen)
213      if (flip_screen_get())
214214      {   flipx = !flipx;      sx = max_x - sx - xnum * 16;
215215         flipy = !flipy;      sy = max_y - sy - ynum * 16;   }
216216
r1771r1772
344344
345345   /* Layers scrolling */
346346
347   scrolly_offs = ((fuuki32_vregs[0xc/4]&0xffff0000)>>16) - (flip_screen ? 0x103 : 0x1f3);
348   scrollx_offs =  (fuuki32_vregs[0xc/4]&0x0000ffff) - (flip_screen ? 0x2c7 : 0x3f6);
347   scrolly_offs = ((fuuki32_vregs[0xc/4]&0xffff0000)>>16) - (flip_screen_get() ? 0x103 : 0x1f3);
348   scrollx_offs =  (fuuki32_vregs[0xc/4]&0x0000ffff) - (flip_screen_get() ? 0x2c7 : 0x3f6);
349349
350350   layer0_scrolly = ((fuuki32_vregs[0x0/4]&0xffff0000)>>16) + scrolly_offs;
351351   layer0_scrollx = ((fuuki32_vregs[0x0/4]&0x0000ffff)) + scrollx_offs;
src/mame/video/battlane.c
r1771r1772
183183         flipx = attr & 0x04;
184184         flipy = attr & 0x02;
185185
186         if (!flip_screen)
186         if (!flip_screen_get())
187187            {
188188            sx = 240 - sx;
189189            sy = 240 - sy;
r1771r1772
227227
228228         if (data)
229229         {
230            if (flip_screen)
230            if (flip_screen_get())
231231               *BITMAP_ADDR16(bitmap, 255 - y, 255 - x) = data;
232232            else
233233               *BITMAP_ADDR16(bitmap, y, x) = data;
src/mame/video/changela.c
r1771r1772
125125    Obj 1 - Text Layer
126126
127127***************************************************************************/
128static void draw_obj1(running_machine *machine, mame_bitmap *bitmap)
128static void draw_obj1(mame_bitmap *bitmap)
129129{
130130   int sx, sy;
131131
r1771r1772
178178
179179         col = c0 | (c1 << 1) | ((attrib & 0xc0) >> 4);
180180         if((col & 0x07) != 0x07)
181            *BITMAP_ADDR16(bitmap, sy, sx) = machine->pens[col | 0x20];
181            *BITMAP_ADDR16(bitmap, sy, sx) = col | 0x20;
182182      }
183183   }
184184}
r1771r1772
687687   {
688688      int riv_col, prev_col;
689689
690      if((*BITMAP_ADDR16(river_bitmap, sy, sx) == machine->pens[0x08])
691      || (*BITMAP_ADDR16(river_bitmap, sy, sx) == machine->pens[0x09])
692      || (*BITMAP_ADDR16(river_bitmap, sy, sx) == machine->pens[0x0a]))
690      if((*BITMAP_ADDR16(river_bitmap, sy, sx) == 0x08)
691      || (*BITMAP_ADDR16(river_bitmap, sy, sx) == 0x09)
692      || (*BITMAP_ADDR16(river_bitmap, sy, sx) == 0x0a))
693693         riv_col = 1;
694694      else
695695         riv_col = 0;
696696
697      if((*BITMAP_ADDR16(river_bitmap, sy, sx-1) == machine->pens[0x08])
698      || (*BITMAP_ADDR16(river_bitmap, sy, sx-1) == machine->pens[0x09])
699      || (*BITMAP_ADDR16(river_bitmap, sy, sx-1) == machine->pens[0x0a]))
697      if((*BITMAP_ADDR16(river_bitmap, sy, sx-1) == 0x08)
698      || (*BITMAP_ADDR16(river_bitmap, sy, sx-1) == 0x09)
699      || (*BITMAP_ADDR16(river_bitmap, sy, sx-1) == 0x0a))
700700         prev_col = 1;
701701      else
702702         prev_col = 0;
703703
704      if(*BITMAP_ADDR16(obj0_bitmap, sy, sx) == machine->pens[0x14]) /* Car Outline Color */
704      if(*BITMAP_ADDR16(obj0_bitmap, sy, sx) == 0x14) /* Car Outline Color */
705705      {
706706         /* Tree 0 Collision */
707707         if(*BITMAP_ADDR16(tree0_bitmap, sy, sx) != 0)
r1771r1772
747747   copybitmap_trans(bitmap, obj0_bitmap,  0, 0, 0, 0, cliprect, 0);
748748   copybitmap_trans(bitmap, tree0_bitmap, 0, 0, 0, 0, cliprect, 0);
749749   copybitmap_trans(bitmap, tree1_bitmap, 0, 0, 0, 0, cliprect, 0);
750   draw_obj1(machine, bitmap);
750   draw_obj1(bitmap);
751751
752752   return 0;
753753}
src/mame/video/rollerg.c
r1771r1772
6969VIDEO_UPDATE( rollerg )
7070{
7171   fillbitmap(priority_bitmap,0,cliprect);
72   fillbitmap(bitmap,machine->pens[16 * bg_colorbase],cliprect);
72   fillbitmap(bitmap,16 * bg_colorbase,cliprect);
7373   K051316_zoom_draw_0(bitmap,cliprect,0,1);
7474   K053245_sprites_draw(0,bitmap,cliprect);
7575   return 0;
src/mame/video/wrally.c
r1771r1772
163163   tilemap_set_scrolly(pant[1], 0, wrally_vregs[2]);
164164   tilemap_set_scrollx(pant[1], 0, wrally_vregs[3]);
165165
166   fillbitmap( bitmap, machine->pens[0], cliprect );
166   fillbitmap( bitmap, 0, cliprect );
167167
168168   tilemap_draw(bitmap,cliprect,pant[1],0,0);
169169   tilemap_draw(bitmap,cliprect,pant[0],0,0);
src/mame/video/exctsccr.c
r1771r1772
122122
123123WRITE8_HANDLER( exctsccr_flipscreen_w )
124124{
125   if (flip_screen != data)
125   if (flip_screen_get() != data)
126126   {
127127      flip_screen_set(data);
128128      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
src/mame/video/nmk16.c
r1771r1772
444444         if(pri != priority)
445445            continue;
446446
447         if (flip_screen)
447         if (flip_screen_get())
448448         {
449449            sx = 368 - sx;
450450            sy = 240 - sy;
r1771r1772
461461               drawgfx(bitmap,machine->gfx[2],
462462                     code,
463463                     color,
464                     flip_screen, flip_screen,
464                     flip_screen_get(), flip_screen_get(),
465465                     ((x + 16) & 0x1ff) - 16,sy & 0x1ff,
466466                     cliprect,TRANSPARENCY_PEN,15);
467467               code++;
r1771r1772
498498         if(pri != priority)
499499            continue;
500500
501         flipx ^= flip_screen;
502         flipy ^= flip_screen;
501         flipx ^= flip_screen_get();
502         flipy ^= flip_screen_get();
503503
504         if (flip_screen)
504         if (flip_screen_get())
505505         {
506506            sx = 368 - sx;
507507            sy = 240 - sy;
src/mame/video/nitedrvr.c
r1771r1772
3636
3737VIDEO_START( nitedrvr )
3838{
39   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
40       8, 8, 32, 32);
39   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
4140}
4241
43static void draw_box(running_machine *machine, mame_bitmap *bitmap, int bx, int by, int ex, int ey )
42static void draw_box(mame_bitmap *bitmap, int bx, int by, int ex, int ey )
4443{
4544   int x, y;
4645
4746   for (y = by; y < ey; y++)
4847   {
4948      for (x = bx; x < ex; x++)
50      {
5149         if ((y < 256) && (x < 256))
52            *BITMAP_ADDR16(bitmap, y, x) = machine->pens[1];
53      }
50            *BITMAP_ADDR16(bitmap, y, x) = 1;
5451   }
5552
5653   return;
5754}
5855
59static void draw_roadway(running_machine *machine, mame_bitmap *bitmap)
56static void draw_roadway(mame_bitmap *bitmap)
6057{
6158   int roadway;
6259
r1771r1772
6966      ex = bx + ((nitedrvr_hvc[roadway + 32] & 0xf0) >> 4);
7067      ey = by + (16 - (nitedrvr_hvc[roadway + 32] & 0x0f));
7168
72      draw_box(machine, bitmap, bx, by, ex, ey);
69      draw_box(bitmap, bx, by, ex, ey);
7370   }
7471}
7572
7673VIDEO_UPDATE( nitedrvr )
7774{
7875   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
79   draw_roadway(machine, bitmap);
76   draw_roadway(bitmap);
8077   return 0;
8178}
src/mame/video/m10.c
r1771r1772
138138   static const int xpos[4] = { 4*8, 26*8, 7*8, 6*8};
139139   int i;
140140
141   fillbitmap(bitmap,machine->pens[0],cliprect);
141   fillbitmap(bitmap,0,cliprect);
142142
143143   decodegfx(back_gfx, state->chargen,0,4);
144144   for (i=0;i<4;i++)
src/mame/layout/stactics.lay
r0r1772
1<mamelayout version="2">
2   <element name="divider">
3      <rect>
4         <color red="0.5" green="0.5" blue="0.5" />
5      </rect>
6   </element>
7   <element name="red_disc" defstate="0">
8      <disk state="1">
9         <color red="1.0" green="0.125" blue="0.125" />
10      </disk>
11   </element>
12   <element name="red_disc_b">
13      <disk>
14         <color red="1.0" green="0.125" blue="0.125" />
15      </disk>
16   </element>
17   <element name="basetext">
18      <text string="BASE MISSILE BUTTON">
19         <color red="1.0" green="1.0" blue="1.0" />
20      </text>   
21   </element>
22   <element name="scoretext">
23      <text string="SCORE">
24         <color red="1.0" green="1.0" blue="1.0" />
25      </text>   
26   </element>
27   <element name="digit" defstate="10">
28      <led7seg>
29         <color red="1.0" green="0.3" blue="0.0" />
30      </led7seg>
31   </element>
32   <element name="c_text">
33      <text string="C">
34         <color red="1.0" green="1.0" blue="1.0" />
35      </text>   
36   </element>
37   <element name="r_text">
38      <text string="R">
39         <color red="1.0" green="1.0" blue="1.0" />
40      </text>   
41   </element>
42   <element name="e_text">
43      <text string="E">
44         <color red="1.0" green="1.0" blue="1.0" />
45      </text>   
46   </element>
47   <element name="d_text">
48      <text string="D">
49         <color red="1.0" green="1.0" blue="1.0" />
50      </text>   
51   </element>
52   <element name="i_text">
53      <text string="I">
54         <color red="1.0" green="1.0" blue="1.0" />
55      </text>   
56   </element>
57   <element name="t_text">
58      <text string="T">
59         <color red="1.0" green="1.0" blue="1.0" />
60      </text>   
61   </element>
62   <element name="yellow_disc" defstate="0">
63      <disk state="1">
64         <color red="0.92" green="1.0" blue="0.4" />
65      </disk>
66   </element>
67   <element name="yellow_disc_b">
68      <disk>
69         <color red="0.92" green="1.0" blue="0.4" />
70      </disk>
71   </element>
72   <element name="white_r">
73      <rect>
74         <color red="1.0" green="1.0" blue="1.0" />
75      </rect>
76   </element>
77   <element name="yellow_r">
78      <rect>
79         <color red="1.0" green="1.0" blue="0" />
80      </rect>
81   </element>
82   <element name="energy_text">
83      <text string="ENERGY BARRIER">
84         <color red="1.0" green="1.0" blue="1.0" />
85      </text>   
86   </element>
87   <element name="energy_b_text">
88      <text string="ENERGY BARRIER BUTTON">
89         <color red="0" green="0" blue="0" />
90      </text>   
91   </element>
92   <element name="round_text">
93      <text string="ROUND">
94         <color red="1.0" green="1.0" blue="1.0" />
95      </text>   
96   </element>
97   <element name="1_text">
98      <text string="1">
99         <color red="1.0" green="1.0" blue="1.0" />
100      </text>   
101   </element>
102   <element name="2_text">
103      <text string="2">
104         <color red="1.0" green="1.0" blue="1.0" />
105      </text>   
106   </element>
107   <element name="3_text">
108      <text string="3">
109         <color red="1.0" green="1.0" blue="1.0" />
110      </text>   
111   </element>
112   <element name="4_text">
113      <text string="4">
114         <color red="1.0" green="1.0" blue="1.0" />
115      </text>   
116   </element>
117   <element name="5_text">
118      <text string="5">
119         <color red="1.0" green="1.0" blue="1.0" />
120      </text>   
121   </element>
122   <element name="6_text">
123      <text string="6">
124         <color red="1.0" green="1.0" blue="1.0" />
125      </text>   
126   </element>
127   <element name="7_text">
128      <text string="7">
129         <color red="1.0" green="1.0" blue="1.0" />
130      </text>   
131   </element>
132   <element name="8_text">
133      <text string="8">
134         <color red="1.0" green="1.0" blue="1.0" />
135      </text>   
136   </element>
137   <element name="9_text">
138      <text string="9">
139         <color red="1.0" green="1.0" blue="1.0" />
140      </text>   
141   </element>
142   <element name="0_text">
143      <text string="0">
144         <color red="1.0" green="1.0" blue="1.0" />
145      </text>   
146   </element>
147   <element name="green_disc" defstate="0">
148      <disk state="1">
149         <color red="0" green="0.87" blue="0.14" />
150      </disk>
151   </element>
152   <element name="green_disc_b">
153      <disk>
154         <color red="0" green="0.87" blue="0.14" />
155      </disk>
156   </element>
157
158   <view name="Control Panel / Laser LEDs">
159      <screen index="0">
160         <bounds x="0" y="0" width="640" height="480" />
161      </screen>
162      <bezel element="divider">
163                  <bounds x="-60" y="480" width="760" height="4" />
164      </bezel>
165
166<!--Laser Sight -->
167
168      <bezel name="sight_led" element="red_disc">
169                  <bounds x="317" y="225" width="2" height="2" />
170         <color alpha="0.7" />
171      </bezel>
172      <bezel name="sight_led" element="red_disc">
173                  <bounds x="319" y="225" width="2" height="2" />
174         <color alpha="0.7" />
175      </bezel>
176      <bezel name="sight_led" element="red_disc">
177                  <bounds x="317" y="227" width="2" height="2" />
178         <color alpha="0.7" />
179      </bezel>
180      <bezel name="sight_led" element="red_disc">
181                  <bounds x="319" y="227" width="2" height="2" />
182         <color alpha="0.7" />
183      </bezel>
184
185<!--Base Missile Lamps-->
186
187      <bezel element="basetext">
188                  <bounds x="250" y="500" width="140" height="15" />
189      </bezel>
190      <bezel element="red_disc_b">
191                  <bounds x="250" y="525" width="20" height="20" />
192         <color alpha="0.1" />
193      </bezel>
194      <bezel element="red_disc_b">
195                  <bounds x="280" y="525" width="20" height="20" />
196         <color alpha="0.1" />
197      </bezel>
198      <bezel element="red_disc_b">
199                  <bounds x="310" y="525" width="20" height="20" />
200         <color alpha="0.1" />
201      </bezel>
202      <bezel element="red_disc_b">
203                  <bounds x="340" y="525" width="20" height="20" />
204         <color alpha="0.1" />
205      </bezel>
206      <bezel element="red_disc_b">
207                  <bounds x="370" y="525" width="20" height="20" />
208         <color alpha="0.1" />
209      </bezel>
210      <bezel name="base_lamp0" element="red_disc">
211                  <bounds x="250" y="525" width="20" height="20" />
212      </bezel>
213      <bezel name="base_lamp1" element="red_disc">
214                  <bounds x="280" y="525" width="20" height="20" />
215      </bezel>
216      <bezel name="base_lamp2" element="red_disc">
217                  <bounds x="310" y="525" width="20" height="20" />
218      </bezel>
219      <bezel name="base_lamp3" element="red_disc">
220                  <bounds x="340" y="525" width="20" height="20" />
221      </bezel>
222      <bezel name="base_lamp4" element="red_disc">
223                  <bounds x="370" y="525" width="20" height="20" />
224      </bezel>
225
226<!--Score LEDs-->
227
228      <bezel element="scoretext">
229                  <bounds x="230" y="590" width="50" height="30" />
230      </bezel>
231      <bezel name="digit0" element="digit">
232         <bounds x="280" y="590" width="17" height="30" />
233      </bezel>
234      <bezel name="digit1" element="digit">
235         <bounds x="300" y="590" width="17" height="30" />
236      </bezel>
237      <bezel name="digit2" element="digit">
238         <bounds x="320" y="590" width="17" height="30" />
239      </bezel>
240      <bezel name="digit3" element="digit">
241         <bounds x="340" y="590" width="17" height="30" />
242      </bezel>
243      <bezel name="digit4" element="digit">
244         <bounds x="360" y="590" width="17" height="30" />
245      </bezel>
246      <bezel name="digit5" element="digit">
247         <bounds x="380" y="590" width="17" height="30" />
248      </bezel>
249
250<!--Credit LEDs-->
251
252      <bezel element="c_text">
253                  <bounds x="420" y="580" width="10" height="10" />
254      </bezel>
255      <bezel element="r_text">
256                  <bounds x="420" y="591" width="10" height="10" />
257      </bezel>
258      <bezel element="e_text">
259                  <bounds x="420" y="602" width="10" height="10" />
260      </bezel>
261      <bezel element="d_text">
262                  <bounds x="420" y="613" width="10" height="10" />
263      </bezel>
264      <bezel element="i_text">
265                  <bounds x="420" y="624" width="10" height="10" />
266      </bezel>
267      <bezel element="t_text">
268                  <bounds x="420" y="635" width="10" height="10" />
269      </bezel>
270      <bezel element="red_disc_b">
271                  <bounds x="442" y="580" width="11" height="11" />
272         <color alpha="0.1" />
273      </bezel>
274      <bezel element="red_disc_b">
275                  <bounds x="442" y="593" width="11" height="11" />
276         <color alpha="0.1" />
277      </bezel>
278      <bezel element="red_disc_b">
279                  <bounds x="442" y="606" width="11" height="11" />
280         <color alpha="0.1" />
281      </bezel>
282      <bezel element="red_disc_b">
283                  <bounds x="442" y="619" width="11" height="11" />
284         <color alpha="0.1" />
285      </bezel>
286      <bezel element="red_disc_b">
287                  <bounds x="442" y="632" width="11" height="11" />
288         <color alpha="0.1" />
289      </bezel>
290      <bezel name="credit_led0" element="red_disc">
291                  <bounds x="442" y="580" width="11" height="11" />
292      </bezel>
293      <bezel name="credit_led1" element="red_disc">
294                  <bounds x="442" y="593" width="11" height="11" />
295      </bezel>
296      <bezel name="credit_led2" element="red_disc">
297                  <bounds x="442" y="606" width="11" height="11" />
298      </bezel>
299      <bezel name="credit_led3" element="red_disc">
300                  <bounds x="442" y="619" width="11" height="11" />
301      </bezel>
302      <bezel name="credit_led4" element="red_disc">
303                  <bounds x="442" y="632" width="11" height="11" />
304      </bezel>
305
306<!--Start Lamp-->
307
308      <bezel name="start_lamp" element="green_disc">
309                  <bounds x="460" y="650" width="20" height="20" />
310      </bezel>
311      <bezel element="green_disc_b">
312                  <bounds x="460" y="650" width="20" height="20" />
313         <color alpha="0.1" />
314      </bezel>
315
316<!--Energy Barrier LEDs-->
317
318      <bezel element="energy_text">
319                  <bounds x="-25" y="545" width="140" height="20" />
320      </bezel>
321      <bezel element="white_r">
322                  <bounds x="-60" y="555" width="30" height="4" />
323      </bezel>
324      <bezel element="white_r">
325                  <bounds x="110" y="555" width="30" height="4" />
326      </bezel>
327      <bezel element="white_r">
328                  <bounds x="-60" y="555" width="4" height="45" />
329      </bezel>
330      <bezel element="white_r">
331                  <bounds x="136" y="555" width="4" height="45" />
332      </bezel>
333      <bezel element="white_r">
334                  <bounds x="-60" y="596" width="200" height="4" />
335      </bezel>
336      <bezel name="barrier_led0" element="red_disc">
337                  <bounds x="-47" y="586" width="5" height="5" />
338      </bezel>
339      <bezel name="barrier_led1" element="red_disc">
340                  <bounds x="-35" y="586" width="5" height="5" />
341      </bezel>
342      <bezel name="barrier_led2" element="red_disc">
343                  <bounds x="-23" y="586" width="5" height="5" />
344      </bezel>
345      <bezel name="barrier_led3" element="red_disc">
346                  <bounds x="-11" y="586" width="5" height="5" />
347      </bezel>
348      <bezel name="barrier_led4" element="red_disc">
349                  <bounds x="1" y="586" width="5" height="5" />
350      </bezel>
351      <bezel name="barrier_led5" element="red_disc">
352                  <bounds x="13" y="586" width="5" height="5" />
353      </bezel>
354      <bezel name="barrier_led6" element="red_disc">
355                  <bounds x="25" y="586" width="5" height="5" />
356      </bezel>
357      <bezel name="barrier_led7" element="red_disc">
358                  <bounds x="37" y="586" width="5" height="5" />
359      </bezel>
360      <bezel name="barrier_led8" element="red_disc">
361                  <bounds x="49" y="586" width="5" height="5" />
362      </bezel>
363      <bezel name="barrier_led9" element="red_disc">
364                  <bounds x="61" y="586" width="5" height="5" />
365      </bezel>
366      <bezel name="barrier_led10" element="red_disc">
367                  <bounds x="73" y="586" width="5" height="5" />
368      </bezel>
369      <bezel name="barrier_led11" element="red_disc">
370                  <bounds x="85" y="586" width="5" height="5" />
371      </bezel>
372      <bezel element="red_disc_b">
373                  <bounds x="-47" y="586" width="5" height="5" />
374         <color alpha="0.1" />
375      </bezel>
376      <bezel element="red_disc_b">
377                  <bounds x="-35" y="586" width="5" height="5" />
378         <color alpha="0.1" />
379      </bezel>
380      <bezel element="red_disc_b">
381                  <bounds x="-23" y="586" width="5" height="5" />
382         <color alpha="0.1" />
383      </bezel>
384      <bezel element="red_disc_b">
385                  <bounds x="-11" y="586" width="5" height="5" />
386         <color alpha="0.1" />
387      </bezel>
388      <bezel element="red_disc_b">
389                  <bounds x="1" y="586" width="5" height="5" />
390         <color alpha="0.1" />
391      </bezel>
392      <bezel element="red_disc_b">
393                  <bounds x="13" y="586" width="5" height="5" />
394         <color alpha="0.1" />
395      </bezel>
396      <bezel element="red_disc_b">
397                  <bounds x="25" y="586" width="5" height="5" />
398         <color alpha="0.1" />
399      </bezel>
400      <bezel element="red_disc_b">
401                  <bounds x="37" y="586" width="5" height="5" />
402         <color alpha="0.1" />
403      </bezel>
404      <bezel element="red_disc_b">
405                  <bounds x="49" y="586" width="5" height="5" />
406         <color alpha="0.1" />
407      </bezel>
408      <bezel element="red_disc_b">
409                  <bounds x="61" y="586" width="5" height="5" />
410         <color alpha="0.1" />
411      </bezel>
412      <bezel element="red_disc_b">
413                  <bounds x="73" y="586" width="5" height="5" />
414         <color alpha="0.1" />
415      </bezel>
416      <bezel element="red_disc_b">
417                  <bounds x="85" y="586" width="5" height="5" />
418         <color alpha="0.1" />
419      </bezel>
420      <bezel element="1_text">
421                  <bounds x="-48" y="573" width="7" height="7" />
422      </bezel>
423      <bezel element="2_text">
424                  <bounds x="-36" y="573" width="7" height="7" />
425      </bezel>
426      <bezel element="3_text">
427                  <bounds x="-24" y="573" width="7" height="7" />
428      </bezel>
429      <bezel element="4_text">
430                  <bounds x="-12" y="573" width="7" height="7" />
431      </bezel>
432      <bezel element="5_text">
433                  <bounds x="0" y="573" width="7" height="7" />
434      </bezel>
435      <bezel element="6_text">
436                  <bounds x="12" y="573" width="7" height="7" />
437      </bezel>
438      <bezel element="7_text">
439                  <bounds x="24" y="573" width="7" height="7" />
440      </bezel>
441      <bezel element="8_text">
442                  <bounds x="36" y="573" width="7" height="7" />
443      </bezel>
444      <bezel element="9_text">
445                  <bounds x="48" y="573" width="7" height="7" />
446      </bezel>
447      <bezel element="1_text">
448                  <bounds x="59" y="573" width="7" height="7" />
449      </bezel>
450      <bezel element="0_text">
451                 <bounds x="63" y="573" width="7" height="7" />
452      </bezel>
453      <bezel element="1_text">
454                  <bounds x="71" y="573" width="7" height="7" />
455      </bezel>
456      <bezel element="1_text">
457                 <bounds x="75" y="573" width="7" height="7" />
458      </bezel>
459      <bezel element="1_text">
460                  <bounds x="83" y="573" width="7" height="7" />
461      </bezel>
462      <bezel element="2_text">
463                 <bounds x="87" y="573" width="7" height="7" />
464      </bezel>
465
466<!--Energy Barrier Lamp-->
467
468      <bezel element="yellow_r">
469                  <bounds x="-60" y="604" width="200" height="24" />
470      </bezel>
471      <bezel element="energy_b_text">
472                  <bounds x="-60" y="608" width="216" height="15" />
473      </bezel>
474
475      <bezel name="barrier_lamp" element="yellow_disc">
476                  <bounds x="160" y="570" width="40" height="40" />
477      </bezel>
478      <bezel element="yellow_disc_b">
479                  <bounds x="160" y="570" width="40" height="40" />
480         <color alpha="0.1" />
481      </bezel>
482
483<!--Round LEDs-->
484
485      <bezel element="round_text">
486                  <bounds x="-30" y="645" width="140" height="20" />
487      </bezel>
488      <bezel element="white_r">
489                  <bounds x="-60" y="655" width="60" height="4" />
490      </bezel>
491      <bezel element="white_r">
492                  <bounds x="80" y="655" width="60" height="4" />
493      </bezel>
494      <bezel element="white_r">
495                  <bounds x="-60" y="655" width="4" height="45" />
496      </bezel>
497      <bezel element="white_r">
498                  <bounds x="136" y="655" width="4" height="45" />
499      </bezel>
500      <bezel element="white_r">
501                  <bounds x="-60" y="696" width="200" height="4" />
502      </bezel>
503      <bezel name="round_led0" element="red_disc">
504                  <bounds x="-47" y="686" width="5" height="5" />
505      </bezel>
506      <bezel name="round_led1" element="red_disc">
507                  <bounds x="-35" y="686" width="5" height="5" />
508      </bezel>
509      <bezel name="round_led2" element="red_disc">
510                  <bounds x="-23" y="686" width="5" height="5" />
511      </bezel>
512      <bezel name="round_led3" element="red_disc">
513                  <bounds x="-11" y="686" width="5" height="5" />
514      </bezel>
515      <bezel name="round_led4" element="red_disc">
516                  <bounds x="1" y="686" width="5" height="5" />
517      </bezel>
518      <bezel name="round_led5" element="red_disc">
519                  <bounds x="13" y="686" width="5" height="5" />
520      </bezel>
521      <bezel name="round_led6" element="red_disc">
522                  <bounds x="25" y="686" width="5" height="5" />
523      </bezel>
524      <bezel name="round_led7" element="red_disc">
525                  <bounds x="37" y="686" width="5" height="5" />
526      </bezel>
527      <bezel name="round_led8" element="red_disc">
528                  <bounds x="49" y="686" width="5" height="5" />
529      </bezel>
530      <bezel name="round_led9" element="red_disc">
531                  <bounds x="61" y="686" width="5" height="5" />
532      </bezel>
533      <bezel name="round_led10" element="red_disc">
534                  <bounds x="73" y="686" width="5" height="5" />
535      </bezel>
536      <bezel name="round_led11" element="red_disc">
537                  <bounds x="85" y="686" width="5" height="5" />
538      </bezel>
539      <bezel name="round_led12" element="red_disc">
540                  <bounds x="97" y="686" width="5" height="5" />
541      </bezel>
542      <bezel name="round_led13" element="red_disc">
543                  <bounds x="109" y="686" width="5" height="5" />
544      </bezel>
545      <bezel name="round_led14" element="red_disc">
546                  <bounds x="121" y="686" width="5" height="5" />
547      </bezel>
548      <bezel element="red_disc_b">
549                  <bounds x="-47" y="686" width="5" height="5" />
550         <color alpha="0.1" />
551      </bezel>
552      <bezel element="red_disc_b">
553                  <bounds x="-35" y="686" width="5" height="5" />
554         <color alpha="0.1" />
555      </bezel>
556      <bezel element="red_disc_b">
557                  <bounds x="-23" y="686" width="5" height="5" />
558         <color alpha="0.1" />
559      </bezel>
560      <bezel element="red_disc_b">
561                  <bounds x="-11" y="686" width="5" height="5" />
562         <color alpha="0.1" />
563      </bezel>
564      <bezel element="red_disc_b">
565                  <bounds x="1" y="686" width="5" height="5" />
566         <color alpha="0.1" />
567      </bezel>
568      <bezel element="red_disc_b">
569                  <bounds x="13" y="686" width="5" height="5" />
570         <color alpha="0.1" />
571      </bezel>
572      <bezel element="red_disc_b">
573                  <bounds x="25" y="686" width="5" height="5" />
574         <color alpha="0.1" />
575      </bezel>
576      <bezel element="red_disc_b">
577                  <bounds x="37" y="686" width="5" height="5" />
578         <color alpha="0.1" />
579      </bezel>
580      <bezel element="red_disc_b">
581                  <bounds x="49" y="686" width="5" height="5" />
582         <color alpha="0.1" />
583      </bezel>
584      <bezel element="red_disc_b">
585                  <bounds x="61" y="686" width="5" height="5" />
586         <color alpha="0.1" />
587      </bezel>
588      <bezel element="red_disc_b">
589                  <bounds x="73" y="686" width="5" height="5" />
590         <color alpha="0.1" />
591      </bezel>
592      <bezel element="red_disc_b">
593                  <bounds x="85" y="686" width="5" height="5" />
594         <color alpha="0.1" />
595      </bezel>
596      <bezel element="red_disc_b">
597                  <bounds x="97" y="686" width="5" height="5" />
598         <color alpha="0.1" />
599      </bezel>
600      <bezel element="red_disc_b">
601                  <bounds x="109" y="686" width="5" height="5" />
602         <color alpha="0.1" />
603      </bezel>
604      <bezel element="red_disc_b">
605                  <bounds x="121" y="686" width="5" height="5" />
606         <color alpha="0.1" />
607      </bezel>
608      <bezel element="1_text">
609                  <bounds x="-48" y="673" width="7" height="7" />
610      </bezel>
611      <bezel element="2_text">
612                  <bounds x="-36" y="673" width="7" height="7" />
613      </bezel>
614      <bezel element="3_text">
615                  <bounds x="-24" y="673" width="7" height="7" />
616      </bezel>
617      <bezel element="4_text">
618                  <bounds x="-12" y="673" width="7" height="7" />
619      </bezel>
620      <bezel element="5_text">
621                  <bounds x="0" y="673" width="7" height="7" />
622      </bezel>
623      <bezel element="6_text">
624                  <bounds x="12" y="673" width="7" height="7" />
625      </bezel>
626      <bezel element="7_text">
627                  <bounds x="24" y="673" width="7" height="7" />
628      </bezel>
629      <bezel element="8_text">
630                  <bounds x="36" y="673" width="7" height="7" />
631      </bezel>
632      <bezel element="9_text">
633                  <bounds x="48" y="673" width="7" height="7" />
634      </bezel>
635      <bezel element="1_text">
636                  <bounds x="59" y="673" width="7" height="7" />
637      </bezel>
638      <bezel element="0_text">
639                 <bounds x="63" y="673" width="7" height="7" />
640      </bezel>
641      <bezel element="1_text">
642                  <bounds x="71" y="673" width="7" height="7" />
643      </bezel>
644      <bezel element="1_text">
645                 <bounds x="75" y="673" width="7" height="7" />
646      </bezel>
647      <bezel element="1_text">
648                  <bounds x="83" y="673" width="7" height="7" />
649      </bezel>
650      <bezel element="2_text">
651                 <bounds x="87" y="673" width="7" height="7" />
652      </bezel>
653      <bezel element="1_text">
654                  <bounds x="95" y="673" width="7" height="7" />
655      </bezel>
656      <bezel element="3_text">
657                 <bounds x="99" y="673" width="7" height="7" />
658      </bezel>
659      <bezel element="1_text">
660                  <bounds x="107" y="673" width="7" height="7" />
661      </bezel>
662      <bezel element="4_text">
663                 <bounds x="111" y="673" width="7" height="7" />
664      </bezel>
665      <bezel element="1_text">
666                  <bounds x="119" y="673" width="7" height="7" />
667      </bezel>
668      <bezel element="5_text">
669                 <bounds x="123" y="673" width="7" height="7" />
670      </bezel>
671
672<!--Laser Beam Left-->
673
674      <bezel name="beam_led_left0" element="green_disc">
675                  <bounds x="-43" y="463" width="8" height="6" />
676         <color alpha="0.7" />
677      </bezel>
678      <bezel name="beam_led_left1" element="green_disc">
679                  <bounds x="-35" y="457" width="8" height="6" />
680         <color alpha="0.7" />
681      </bezel>
682      <bezel name="beam_led_left2" element="green_disc">
683                  <bounds x="-27" y="451" width="8" height="6" />
684         <color alpha="0.7" />
685      </bezel>
686      <bezel name="beam_led_left3" element="green_disc">
687                  <bounds x="-19" y="445" width="8" height="6" />
688         <color alpha="0.7" />
689      </bezel>
690      <bezel name="beam_led_left4" element="green_disc">
691                  <bounds x="-11" y="439" width="8" height="6" />
692         <color alpha="0.7" />
693      </bezel>
694      <bezel name="beam_led_left5" element="green_disc">
695                  <bounds x="-3" y="433" width="8" height="6" />
696         <color alpha="0.7" />
697      </bezel>
698      <bezel name="beam_led_left6" element="green_disc">
699                  <bounds x="5" y="427" width="8" height="6" />
700         <color alpha="0.7" />
701      </bezel>
702      <bezel name="beam_led_left7" element="green_disc">
703                  <bounds x="13" y="421" width="8" height="6" />
704         <color alpha="0.7" />
705      </bezel>
706      <bezel name="beam_led_left8" element="green_disc">
707                  <bounds x="21" y="415" width="8" height="6" />
708         <color alpha="0.7" />
709      </bezel>
710      <bezel name="beam_led_left9" element="green_disc">
711                  <bounds x="29" y="409" width="8" height="6" />
712         <color alpha="0.7" />
713      </bezel>
714      <bezel name="beam_led_left10" element="green_disc">
715                  <bounds x="37" y="403" width="8" height="6" />
716         <color alpha="0.7" />
717      </bezel>
718      <bezel name="beam_led_left11" element="green_disc">
719                  <bounds x="45" y="397" width="8" height="6" />
720         <color alpha="0.7" />
721      </bezel>
722      <bezel name="beam_led_left12" element="green_disc">
723                  <bounds x="53" y="391" width="8" height="6" />
724         <color alpha="0.7" />
725      </bezel>
726      <bezel name="beam_led_left13" element="green_disc">
727                  <bounds x="61" y="385" width="8" height="6" />
728         <color alpha="0.7" />
729      </bezel>
730      <bezel name="beam_led_left14" element="green_disc">
731                  <bounds x="69" y="379" width="8" height="6" />
732         <color alpha="0.7" />
733      </bezel>
734      <bezel name="beam_led_left16" element="green_disc">
735                  <bounds x="77" y="373" width="8" height="6" />
736         <color alpha="0.7" />
737      </bezel>
738      <bezel name="beam_led_left17" element="green_disc">
739                  <bounds x="85" y="367" width="8" height="6" />
740         <color alpha="0.7" />
741      </bezel>
742      <bezel name="beam_led_left18" element="green_disc">
743                  <bounds x="93" y="361" width="8" height="6" />
744         <color alpha="0.7" />
745      </bezel>
746      <bezel name="beam_led_left19" element="green_disc">
747                  <bounds x="101" y="355" width="8" height="6" />
748         <color alpha="0.7" />
749      </bezel>
750      <bezel name="beam_led_left20" element="green_disc">
751                  <bounds x="109" y="349" width="8" height="6" />
752         <color alpha="0.7" />
753      </bezel>
754      <bezel name="beam_led_left21" element="green_disc">
755                  <bounds x="117" y="345" width="6" height="4" />
756         <color alpha="0.7" />
757      </bezel>
758      <bezel name="beam_led_left22" element="green_disc">
759                  <bounds x="123" y="341" width="6" height="4" />
760         <color alpha="0.7" />
761      </bezel>
762      <bezel name="beam_led_left23" element="green_disc">
763                  <bounds x="129" y="337" width="6" height="4" />
764         <color alpha="0.7" />
765      </bezel>
766      <bezel name="beam_led_left24" element="green_disc">
767                  <bounds x="135" y="333" width="6" height="4" />
768         <color alpha="0.7" />
769      </bezel>
770      <bezel name="beam_led_left25" element="green_disc">
771                  <bounds x="141" y="329" width="6" height="4" />
772         <color alpha="0.7" />
773      </bezel>
774      <bezel name="beam_led_left26" element="green_disc">
775                  <bounds x="147" y="325" width="6" height="4" />
776         <color alpha="0.7" />
777      </bezel>
778      <bezel name="beam_led_left27" element="green_disc">
779                  <bounds x="153" y="321" width="6" height="4" />
780         <color alpha="0.7" />
781      </bezel>
782      <bezel name="beam_led_left28" element="green_disc">
783                  <bounds x="159" y="317" width="6" height="4" />
784         <color alpha="0.7" />
785      </bezel>
786      <bezel name="beam_led_left29" element="green_disc">
787                  <bounds x="165" y="313" width="6" height="4" />
788         <color alpha="0.7" />
789      </bezel>
790      <bezel name="beam_led_left30" element="green_disc">
791                  <bounds x="171" y="309" width="6" height="4" />
792         <color alpha="0.7" />
793      </bezel>
794      <bezel name="beam_led_left32" element="green_disc">
795                  <bounds x="177" y="305" width="6" height="4" />
796         <color alpha="0.7" />
797      </bezel>
798      <bezel name="beam_led_left33" element="green_disc">
799                  <bounds x="183" y="301" width="6" height="4" />
800         <color alpha="0.7" />
801      </bezel>
802      <bezel name="beam_led_left34" element="green_disc">
803                  <bounds x="189" y="297" width="6" height="4" />
804         <color alpha="0.7" />
805      </bezel>
806      <bezel name="beam_led_left35" element="green_disc">
807                  <bounds x="195" y="293" width="6" height="4" />
808         <color alpha="0.7" />
809      </bezel>
810      <bezel name="beam_led_left36" element="green_disc">
811                  <bounds x="201" y="289" width="6" height="4" />
812         <color alpha="0.7" />
813      </bezel>
814      <bezel name="beam_led_left37" element="green_disc">
815                  <bounds x="207" y="285" width="6" height="4" />
816         <color alpha="0.7" />
817      </bezel>
818      <bezel name="beam_led_left38" element="green_disc">
819                  <bounds x="213" y="281" width="6" height="4" />
820         <color alpha="0.7" />
821      </bezel>
822      <bezel name="beam_led_left39" element="green_disc">
823                  <bounds x="219" y="277" width="6" height="4" />
824         <color alpha="0.7" />
825      </bezel>
826      <bezel name="beam_led_left40" element="green_disc">
827                  <bounds x="225" y="273" width="6" height="4" />
828         <color alpha="0.7" />
829      </bezel>
830      <bezel name="beam_led_left41" element="green_disc">
831                  <bounds x="231" y="269" width="6" height="4" />
832         <color alpha="0.7" />
833      </bezel>
834      <bezel name="beam_led_left42" element="green_disc">
835                  <bounds x="237" y="267" width="4" height="2" />
836         <color alpha="0.7" />
837      </bezel>
838      <bezel name="beam_led_left43" element="green_disc">
839                  <bounds x="241" y="265" width="4" height="2" />
840         <color alpha="0.7" />
841      </bezel>
842      <bezel name="beam_led_left44" element="green_disc">
843                  <bounds x="245" y="263" width="4" height="2" />
844         <color alpha="0.7" />
845      </bezel>
846      <bezel name="beam_led_left45" element="green_disc">
847                  <bounds x="249" y="261" width="4" height="2" />
848         <color alpha="0.7" />
849      </bezel>
850      <bezel name="beam_led_left46" element="green_disc">
851                  <bounds x="253" y="259" width="4" height="2" />
852         <color alpha="0.7" />
853      </bezel>
854      <bezel name="beam_led_left48" element="green_disc">
855                  <bounds x="257" y="257" width="4" height="2" />
856         <color alpha="0.7" />
857      </bezel>
858      <bezel name="beam_led_left49" element="green_disc">
859                  <bounds x="261" y="255" width="4" height="2" />
860         <color alpha="0.7" />
861      </bezel>
862      <bezel name="beam_led_left50" element="green_disc">
863                  <bounds x="265" y="253" width="4" height="2" />
864         <color alpha="0.7" />
865      </bezel>
866      <bezel name="beam_led_left51" element="green_disc">
867                  <bounds x="269" y="251" width="4" height="2" />
868         <color alpha="0.7" />
869      </bezel>
870      <bezel name="beam_led_left52" element="green_disc">
871                  <bounds x="273" y="249" width="4" height="2" />
872         <color alpha="0.7" />
873      </bezel>
874      <bezel name="beam_led_left53" element="green_disc">
875                  <bounds x="277" y="247" width="4" height="2" />
876         <color alpha="0.7" />
877      </bezel>
878      <bezel name="beam_led_left54" element="green_disc">
879                  <bounds x="281" y="245" width="4" height="2" />
880         <color alpha="0.7" />
881      </bezel>
882      <bezel name="beam_led_left55" element="green_disc">
883                  <bounds x="285" y="243" width="4" height="2" />
884         <color alpha="0.7" />
885      </bezel>
886      <bezel name="beam_led_left56" element="green_disc">
887                  <bounds x="289" y="241" width="4" height="2" />
888         <color alpha="0.7" />
889      </bezel>
890      <bezel name="beam_led_left57" element="green_disc">
891                  <bounds x="293" y="239" width="4" height="2" />
892         <color alpha="0.7" />
893      </bezel>
894      <bezel name="beam_led_left58" element="green_disc">
895                  <bounds x="297" y="237" width="4" height="2" />
896         <color alpha="0.7" />
897      </bezel>
898      <bezel name="beam_led_left59" element="green_disc">
899                  <bounds x="301" y="235" width="4" height="2" />
900         <color alpha="0.7" />
901      </bezel>
902      <bezel name="beam_led_left60" element="green_disc">
903                  <bounds x="305" y="233" width="4" height="2" />
904         <color alpha="0.7" />
905      </bezel>
906      <bezel name="beam_led_left61" element="green_disc">
907                  <bounds x="309" y="231" width="4" height="2" />
908         <color alpha="0.7" />
909      </bezel>
910      <bezel name="beam_led_left62" element="green_disc">
911                  <bounds x="313" y="229" width="4" height="2" />
912         <color alpha="0.7" />
913      </bezel>
914
915<!--Laser Beam Right-->
916
917      <bezel name="beam_led_right0" element="green_disc">
918                  <bounds x="673" y="463" width="8" height="6" />
919         <color alpha="0.7" />
920      </bezel>
921      <bezel name="beam_led_right1" element="green_disc">
922                  <bounds x="665" y="457" width="8" height="6" />
923         <color alpha="0.7" />
924      </bezel>
925      <bezel name="beam_led_right2" element="green_disc">
926                  <bounds x="657" y="451" width="8" height="6" />
927         <color alpha="0.7" />
928      </bezel>
929      <bezel name="beam_led_right3" element="green_disc">
930                  <bounds x="649" y="445" width="8" height="6" />
931         <color alpha="0.7" />
932      </bezel>
933      <bezel name="beam_led_right4" element="green_disc">
934                  <bounds x="641" y="439" width="8" height="6" />
935         <color alpha="0.7" />
936      </bezel>
937      <bezel name="beam_led_right5" element="green_disc">
938                  <bounds x="633" y="433" width="8" height="6" />
939         <color alpha="0.7" />
940      </bezel>
941      <bezel name="beam_led_right6" element="green_disc">
942                  <bounds x="625" y="427" width="8" height="6" />
943         <color alpha="0.7" />
944      </bezel>
945      <bezel name="beam_led_right7" element="green_disc">
946                  <bounds x="617" y="421" width="8" height="6" />
947         <color alpha="0.7" />
948      </bezel>
949      <bezel name="beam_led_right8" element="green_disc">
950                  <bounds x="609" y="415" width="8" height="6" />
951         <color alpha="0.7" />
952      </bezel>
953      <bezel name="beam_led_right9" element="green_disc">
954                  <bounds x="601" y="409" width="8" height="6" />
955         <color alpha="0.7" />
956      </bezel>
957      <bezel name="beam_led_right10" element="green_disc">
958                  <bounds x="593" y="403" width="8" height="6" />
959         <color alpha="0.7" />
960      </bezel>
961      <bezel name="beam_led_right11" element="green_disc">
962                  <bounds x="585" y="397" width="8" height="6" />
963         <color alpha="0.7" />
964      </bezel>
965      <bezel name="beam_led_right12" element="green_disc">
966                  <bounds x="577" y="391" width="8" height="6" />
967         <color alpha="0.7" />
968      </bezel>
969      <bezel name="beam_led_right13" element="green_disc">
970                  <bounds x="569" y="385" width="8" height="6" />
971         <color alpha="0.7" />
972      </bezel>
973      <bezel name="beam_led_right14" element="green_disc">
974                  <bounds x="561" y="379" width="8" height="6" />
975         <color alpha="0.7" />
976      </bezel>
977      <bezel name="beam_led_right16" element="green_disc">
978                  <bounds x="553" y="373" width="8" height="6" />
979         <color alpha="0.7" />
980      </bezel>
981      <bezel name="beam_led_right17" element="green_disc">
982                  <bounds x="545" y="367" width="8" height="6" />
983         <color alpha="0.7" />
984      </bezel>
985      <bezel name="beam_led_right18" element="green_disc">
986                  <bounds x="537" y="361" width="8" height="6" />
987         <color alpha="0.7" />
988      </bezel>
989      <bezel name="beam_led_right19" element="green_disc">
990                  <bounds x="529" y="355" width="8" height="6" />
991         <color alpha="0.7" />
992      </bezel>
993      <bezel name="beam_led_right20" element="green_disc">
994                  <bounds x="521" y="349" width="8" height="6" />
995         <color alpha="0.7" />
996      </bezel>
997      <bezel name="beam_led_right21" element="green_disc">
998                  <bounds x="515" y="345" width="6" height="4" />
999         <color alpha="0.7" />
1000      </bezel>
1001      <bezel name="beam_led_right22" element="green_disc">
1002                  <bounds x="509" y="341" width="6" height="4" />
1003         <color alpha="0.7" />
1004      </bezel>
1005      <bezel name="beam_led_right23" element="green_disc">
1006                  <bounds x="503" y="337" width="6" height="4" />
1007         <color alpha="0.7" />
1008      </bezel>
1009      <bezel name="beam_led_right24" element="green_disc">
1010                  <bounds x="497" y="333" width="6" height="4" />
1011         <color alpha="0.7" />
1012      </bezel>
1013      <bezel name="beam_led_right25" element="green_disc">
1014                  <bounds x="491" y="329" width="6" height="4" />
1015         <color alpha="0.7" />
1016      </bezel>
1017      <bezel name="beam_led_right26" element="green_disc">
1018                  <bounds x="485" y="325" width="6" height="4" />
1019         <color alpha="0.7" />
1020      </bezel>
1021      <bezel name="beam_led_right27" element="green_disc">
1022                  <bounds x="479" y="321" width="6" height="4" />
1023         <color alpha="0.7" />
1024      </bezel>
1025      <bezel name="beam_led_right28" element="green_disc">
1026                  <bounds x="473" y="317" width="6" height="4" />
1027         <color alpha="0.7" />
1028      </bezel>
1029      <bezel name="beam_led_right29" element="green_disc">
1030                  <bounds x="467" y="313" width="6" height="4" />
1031         <color alpha="0.7" />
1032      </bezel>
1033      <bezel name="beam_led_right30" element="green_disc">
1034                  <bounds x="461" y="309" width="6" height="4" />
1035         <color alpha="0.7" />
1036      </bezel>
1037      <bezel name="beam_led_right32" element="green_disc">
1038                  <bounds x="455" y="305" width="6" height="4" />
1039         <color alpha="0.7" />
1040      </bezel>
1041      <bezel name="beam_led_right33" element="green_disc">
1042                  <bounds x="449" y="301" width="6" height="4" />
1043         <color alpha="0.7" />
1044      </bezel>
1045      <bezel name="beam_led_right34" element="green_disc">
1046                  <bounds x="443" y="297" width="6" height="4" />
1047         <color alpha="0.7" />
1048      </bezel>
1049      <bezel name="beam_led_right35" element="green_disc">
1050                  <bounds x="437" y="293" width="6" height="4" />
1051         <color alpha="0.7" />
1052      </bezel>
1053      <bezel name="beam_led_right36" element="green_disc">
1054                  <bounds x="431" y="289" width="6" height="4" />
1055         <color alpha="0.7" />
1056      </bezel>
1057      <bezel name="beam_led_right37" element="green_disc">
1058                  <bounds x="425" y="285" width="6" height="4" />
1059         <color alpha="0.7" />
1060      </bezel>
1061      <bezel name="beam_led_right38" element="green_disc">
1062                  <bounds x="419" y="281" width="6" height="4" />
1063         <color alpha="0.7" />
1064      </bezel>
1065      <bezel name="beam_led_right39" element="green_disc">
1066                  <bounds x="413" y="277" width="6" height="4" />
1067         <color alpha="0.7" />
1068      </bezel>
1069      <bezel name="beam_led_right40" element="green_disc">
1070                  <bounds x="407" y="273" width="6" height="4" />
1071         <color alpha="0.7" />
1072      </bezel>
1073      <bezel name="beam_led_right41" element="green_disc">
1074                  <bounds x="401" y="269" width="6" height="4" />
1075         <color alpha="0.7" />
1076      </bezel>
1077      <bezel name="beam_led_right42" element="green_disc">
1078                  <bounds x="397" y="267" width="4" height="2" />
1079         <color alpha="0.7" />
1080      </bezel>
1081      <bezel name="beam_led_right43" element="green_disc">
1082                  <bounds x="393" y="265" width="4" height="2" />
1083         <color alpha="0.7" />
1084      </bezel>
1085      <bezel name="beam_led_right44" element="green_disc">
1086                  <bounds x="389" y="263" width="4" height="2" />
1087         <color alpha="0.7" />
1088      </bezel>
1089      <bezel name="beam_led_right45" element="green_disc">
1090                  <bounds x="385" y="261" width="4" height="2" />
1091         <color alpha="0.7" />
1092      </bezel>
1093      <bezel name="beam_led_right46" element="green_disc">
1094                  <bounds x="381" y="259" width="4" height="2" />
1095         <color alpha="0.7" />
1096      </bezel>
1097      <bezel name="beam_led_right48" element="green_disc">
1098                  <bounds x="377" y="257" width="4" height="2" />
1099         <color alpha="0.7" />
1100      </bezel>
1101      <bezel name="beam_led_right49" element="green_disc">
1102                  <bounds x="373" y="255" width="4" height="2" />
1103         <color alpha="0.7" />
1104      </bezel>
1105      <bezel name="beam_led_right50" element="green_disc">
1106                  <bounds x="369" y="253" width="4" height="2" />
1107         <color alpha="0.7" />
1108      </bezel>
1109      <bezel name="beam_led_right51" element="green_disc">
1110                  <bounds x="365" y="251" width="4" height="2" />
1111         <color alpha="0.7" />
1112      </bezel>
1113      <bezel name="beam_led_right52" element="green_disc">
1114                  <bounds x="361" y="249" width="4" height="2" />
1115         <color alpha="0.7" />
1116      </bezel>
1117      <bezel name="beam_led_right53" element="green_disc">
1118                  <bounds x="357" y="247" width="4" height="2" />
1119         <color alpha="0.7" />
1120      </bezel>
1121      <bezel name="beam_led_right54" element="green_disc">
1122                  <bounds x="353" y="245" width="4" height="2" />
1123         <color alpha="0.7" />
1124      </bezel>
1125      <bezel name="beam_led_right55" element="green_disc">
1126                  <bounds x="349" y="243" width="4" height="2" />
1127         <color alpha="0.7" />
1128      </bezel>
1129      <bezel name="beam_led_right56" element="green_disc">
1130                  <bounds x="345" y="241" width="4" height="2" />
1131         <color alpha="0.7" />
1132      </bezel>
1133      <bezel name="beam_led_right57" element="green_disc">
1134                  <bounds x="341" y="239" width="4" height="2" />
1135         <color alpha="0.7" />
1136      </bezel>
1137      <bezel name="beam_led_right58" element="green_disc">
1138                  <bounds x="337" y="237" width="4" height="2" />
1139         <color alpha="0.7" />
1140      </bezel>
1141      <bezel name="beam_led_right59" element="green_disc">
1142                  <bounds x="333" y="235" width="4" height="2" />
1143         <color alpha="0.7" />
1144      </bezel>
1145      <bezel name="beam_led_right60" element="green_disc">
1146                  <bounds x="329" y="233" width="4" height="2" />
1147         <color alpha="0.7" />
1148      </bezel>
1149      <bezel name="beam_led_right61" element="green_disc">
1150                  <bounds x="325" y="231" width="4" height="2" />
1151         <color alpha="0.7" />
1152      </bezel>
1153      <bezel name="beam_led_right62" element="green_disc">
1154                  <bounds x="321" y="229" width="4" height="2" />
1155         <color alpha="0.7" />
1156      </bezel>
1157   </view>
1158</mamelayout>
src/mame/drivers/tempest.c
r1771r1772
585585   MDRV_CPU_ADD(M6502, MASTER_CLOCK / 8)
586586   MDRV_CPU_PROGRAM_MAP(main_map, 0)
587587   MDRV_CPU_PERIODIC_INT(irq0_line_assert, (double)MASTER_CLOCK / 4096 / 12)
588   MDRV_WATCHDOG_TIME_INIT(ATTOTIME_IN_HZ(CLOCK_3KHZ / 256))
588   MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_HZ(CLOCK_3KHZ / 256))
589589   MDRV_NVRAM_HANDLER(atari_vg)
590590
591591   /* video hardware */
r1771r1772
594594   MDRV_SCREEN_SIZE(400, 300)
595595   MDRV_SCREEN_VISIBLE_AREA(0, 580, 0, 570)
596596
597   MDRV_PALETTE_LENGTH(256)
598
599597   MDRV_VIDEO_START(avg_tempest)
600598   MDRV_VIDEO_UPDATE(vector)
601599
src/mame/drivers/aerofgt.c
r1771r1772
161161}
162162
163163
164static ADDRESS_MAP_START( pspikes_readmem, ADDRESS_SPACE_PROGRAM, 16 )
165   AM_RANGE(0x000000, 0x03ffff) AM_READ(MRA16_ROM)
166   AM_RANGE(0x100000, 0x10ffff) AM_READ(MRA16_RAM)
167   AM_RANGE(0x200000, 0x203fff) AM_READ(MRA16_RAM)
168   AM_RANGE(0xff8000, 0xff8fff) AM_READ(MRA16_RAM)
169   AM_RANGE(0xffd000, 0xffdfff) AM_READ(MRA16_RAM)
170   AM_RANGE(0xffe000, 0xffefff) AM_READ(MRA16_RAM)
171   AM_RANGE(0xfff000, 0xfff001) AM_READ(input_port_0_word_r)
172   AM_RANGE(0xfff002, 0xfff003) AM_READ(input_port_1_word_r)
173   AM_RANGE(0xfff004, 0xfff005) AM_READ(input_port_2_word_r)
174   AM_RANGE(0xfff006, 0xfff007) AM_READ(pending_command_r)
164static ADDRESS_MAP_START( pspikes_map, ADDRESS_SPACE_PROGRAM, 16 )
165   AM_RANGE(0x000000, 0x03ffff) AM_ROM
166   AM_RANGE(0x100000, 0x10ffff) AM_RAM   /* work RAM */
167   AM_RANGE(0x200000, 0x203fff) AM_RAM AM_BASE(&aerofgt_spriteram1) AM_SIZE(&aerofgt_spriteram1_size)
168   AM_RANGE(0xff8000, 0xff8fff) AM_READWRITE(MRA16_RAM, aerofgt_bg1videoram_w) AM_BASE(&aerofgt_bg1videoram)
169   AM_RANGE(0xffc000, 0xffc3ff) AM_WRITEONLY AM_BASE(&aerofgt_spriteram3) AM_SIZE(&aerofgt_spriteram3_size)
170   AM_RANGE(0xffd000, 0xffdfff) AM_RAM AM_BASE(&aerofgt_rasterram)   /* bg1 scroll registers */
171   AM_RANGE(0xffe000, 0xffefff) AM_READWRITE(MRA16_RAM, paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
172   AM_RANGE(0xfff000, 0xfff001) AM_READWRITE(input_port_0_word_r, pspikes_palette_bank_w)
173   AM_RANGE(0xfff002, 0xfff003) AM_READWRITE(input_port_1_word_r, pspikes_gfxbank_w)
174   AM_RANGE(0xfff004, 0xfff005) AM_READWRITE(input_port_2_word_r, aerofgt_bg1scrolly_w)
175   AM_RANGE(0xfff006, 0xfff007) AM_READWRITE(pending_command_r, sound_command_w)
175176ADDRESS_MAP_END
176177
177static ADDRESS_MAP_START( pspikes_writemem, ADDRESS_SPACE_PROGRAM, 16 )
178   AM_RANGE(0x000000, 0x03ffff) AM_WRITE(MWA16_ROM)
179   AM_RANGE(0x100000, 0x10ffff) AM_WRITE(MWA16_RAM)   /* work RAM */
180   AM_RANGE(0x200000, 0x203fff) AM_WRITE(MWA16_RAM) AM_BASE(&aerofgt_spriteram1) AM_SIZE(&aerofgt_spriteram1_size)
181   AM_RANGE(0xff8000, 0xff8fff) AM_WRITE(aerofgt_bg1videoram_w) AM_BASE(&aerofgt_bg1videoram)
182   AM_RANGE(0xffc000, 0xffc3ff) AM_WRITE(MWA16_RAM) AM_BASE(&aerofgt_spriteram3) AM_SIZE(&aerofgt_spriteram3_size)
183   AM_RANGE(0xffd000, 0xffdfff) AM_WRITE(MWA16_RAM) AM_BASE(&aerofgt_rasterram)   /* bg1 scroll registers */
184   AM_RANGE(0xffe000, 0xffefff) AM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
185   AM_RANGE(0xfff000, 0xfff001) AM_WRITE(pspikes_palette_bank_w)
186   AM_RANGE(0xfff002, 0xfff003) AM_WRITE(pspikes_gfxbank_w)
187   AM_RANGE(0xfff004, 0xfff005) AM_WRITE(aerofgt_bg1scrolly_w)
188   AM_RANGE(0xfff006, 0xfff007) AM_WRITE(sound_command_w)
189ADDRESS_MAP_END
190
191178static ADDRESS_MAP_START( pspikesb_map, ADDRESS_SPACE_PROGRAM, 16 )
192179   AM_RANGE(0x000000, 0x03ffff) AM_ROM
193180   AM_RANGE(0x100000, 0x10ffff) AM_RAM   /* work RAM */
194181   AM_RANGE(0x200000, 0x203fff) AM_RAM AM_BASE(&aerofgt_spriteram1) AM_SIZE(&aerofgt_spriteram1_size)
195   AM_RANGE(0xff8000, 0xff8fff) AM_RAM AM_WRITE(aerofgt_bg1videoram_w) AM_BASE(&aerofgt_bg1videoram)
182   AM_RANGE(0xc04000, 0xc04001) AM_WRITENOP
183   AM_RANGE(0xff8000, 0xff8fff) AM_READWRITE(MRA16_RAM, aerofgt_bg1videoram_w) AM_BASE(&aerofgt_bg1videoram)
196184   AM_RANGE(0xffc000, 0xffcbff) AM_RAM AM_BASE(&aerofgt_spriteram3) AM_SIZE(&aerofgt_spriteram3_size)
197185   AM_RANGE(0xffd200, 0xffd201) AM_WRITE(pspikesb_gfxbank_w)
198186   AM_RANGE(0xffd000, 0xffdfff) AM_RAM AM_BASE(&aerofgt_rasterram)   /* bg1 scroll registers */
199   AM_RANGE(0xffe000, 0xffefff) AM_RAM AM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
187   AM_RANGE(0xffe000, 0xffefff) AM_READWRITE(MRA16_RAM, paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
200188   AM_RANGE(0xfff000, 0xfff001) AM_READ(input_port_0_word_r)
201189   AM_RANGE(0xfff002, 0xfff003) AM_READ(input_port_1_word_r)
202   AM_RANGE(0xfff004, 0xfff005) AM_READ(input_port_2_word_r)
203   AM_RANGE(0xfff004, 0xfff005) AM_WRITE(aerofgt_bg1scrolly_w)
204   AM_RANGE(0xfff008, 0xfff009) AM_WRITE(pspikesb_oki_banking_w)
205   AM_RANGE(0xc04000, 0xc04001) AM_WRITENOP
190   AM_RANGE(0xfff004, 0xfff005) AM_READWRITE(input_port_2_word_r, aerofgt_bg1scrolly_w)
206191   AM_RANGE(0xfff006, 0xfff007) AM_READWRITE(OKIM6295_status_0_lsb_r, OKIM6295_data_0_lsb_w)
192   AM_RANGE(0xfff008, 0xfff009) AM_WRITE(pspikesb_oki_banking_w)
207193ADDRESS_MAP_END
208194
209195static ADDRESS_MAP_START( pallavol_map, ADDRESS_SPACE_PROGRAM, 16 )
210196   AM_RANGE(0x000000, 0x03ffff) AM_ROM
211197   AM_RANGE(0x100000, 0x10ffff) AM_RAM   /* work RAM */
212198   AM_RANGE(0x200000, 0x203fff) AM_RAM AM_BASE(&aerofgt_spriteram1) AM_SIZE(&aerofgt_spriteram1_size)
199   AM_RANGE(0xc04000, 0xc04001) AM_WRITENOP
213200   AM_RANGE(0xff8000, 0xff8fff) AM_RAM AM_WRITE(aerofgt_bg1videoram_w) AM_BASE(&aerofgt_bg1videoram)
214201   AM_RANGE(0xffc000, 0xffcbff) AM_RAM AM_BASE(&aerofgt_spriteram3) AM_SIZE(&aerofgt_spriteram3_size)
215202   //AM_RANGE(0xffd200, 0xffd201) AM_WRITE(pspikesb_gfxbank_w)
r1771r1772
217204   AM_RANGE(0xffe000, 0xffefff) AM_RAM AM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
218205   AM_RANGE(0xfff000, 0xfff001) AM_READ(input_port_0_word_r)
219206   AM_RANGE(0xfff002, 0xfff003) AM_READ(input_port_1_word_r) AM_WRITE(pspikes_gfxbank_w)
220   AM_RANGE(0xfff004, 0xfff005) AM_READ(input_port_2_word_r)
221   AM_RANGE(0xfff004, 0xfff005) AM_WRITE(aerofgt_bg1scrolly_w)
222   AM_RANGE(0xfff008, 0xfff009) AM_NOP
223   AM_RANGE(0xc04000, 0xc04001) AM_WRITENOP
207   AM_RANGE(0xfff004, 0xfff005) AM_READWRITE(input_port_2_word_r, aerofgt_bg1scrolly_w)
224208   AM_RANGE(0xfff006, 0xfff007) AM_NOP
209   AM_RANGE(0xfff008, 0xfff009) AM_NOP
225210ADDRESS_MAP_END
226211
227212static ADDRESS_MAP_START( pspikesc_map, ADDRESS_SPACE_PROGRAM, 16 )
228213   AM_RANGE(0x000000, 0x03ffff) AM_ROM
229214   AM_RANGE(0x100000, 0x10ffff) AM_RAM   /* work RAM */
230215   AM_RANGE(0x200000, 0x203fff) AM_RAM AM_BASE(&aerofgt_spriteram1) AM_SIZE(&aerofgt_spriteram1_size)
231   AM_RANGE(0xff8000, 0xff8fff) AM_RAM AM_WRITE(aerofgt_bg1videoram_w) AM_BASE(&aerofgt_bg1videoram)
216   AM_RANGE(0xff8000, 0xff8fff) AM_READWRITE(MRA16_RAM, aerofgt_bg1videoram_w) AM_BASE(&aerofgt_bg1videoram)
232217   AM_RANGE(0xffc000, 0xffcbff) AM_RAM AM_BASE(&aerofgt_spriteram3) AM_SIZE(&aerofgt_spriteram3_size)
233218   AM_RANGE(0xffd000, 0xffdfff) AM_RAM AM_BASE(&aerofgt_rasterram)   /* bg1 scroll registers */
234   AM_RANGE(0xffe000, 0xffefff) AM_RAM AM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
219   AM_RANGE(0xffe000, 0xffefff) AM_READWRITE(MRA16_RAM, paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
235220   AM_RANGE(0xfff000, 0xfff001) AM_READWRITE(input_port_0_word_r, pspikes_palette_bank_w)
236221   AM_RANGE(0xfff002, 0xfff003) AM_READWRITE(input_port_1_word_r, pspikes_gfxbank_w)
237222   AM_RANGE(0xfff004, 0xfff005) AM_READ(input_port_2_word_r)
r1771r1772
239224   AM_RANGE(0xfff006, 0xfff007) AM_READWRITE(OKIM6295_status_0_lsb_r, OKIM6295_data_0_lsb_w)
240225ADDRESS_MAP_END
241226
242static ADDRESS_MAP_START( karatblz_readmem, ADDRESS_SPACE_PROGRAM, 16 )
227static ADDRESS_MAP_START( karatblz_map, ADDRESS_SPACE_PROGRAM, 16 )
243228   ADDRESS_MAP_FLAGS( AMEF_ABITS(20) )
244   AM_RANGE(0x000000, 0x07ffff) AM_READ(MRA16_ROM)
245   AM_RANGE(0x080000, 0x081fff) AM_READ(MRA16_RAM)
246   AM_RANGE(0x082000, 0x083fff) AM_READ(MRA16_RAM)
247   AM_RANGE(0x0a0000, 0x0affff) AM_READ(MRA16_RAM)
248   AM_RANGE(0x0b0000, 0x0bffff) AM_READ(MRA16_RAM)
249   AM_RANGE(0x0c0000, 0x0cffff) AM_READ(MRA16_RAM)   /* work RAM */
250   AM_RANGE(0x0f8000, 0x0fbfff) AM_READ(MRA16_RAM)   /* work RAM */
251   AM_RANGE(0x0fc000, 0x0fc7ff) AM_READ(MRA16_RAM)
252   AM_RANGE(0x0fe000, 0x0fe7ff) AM_READ(MRA16_RAM)
229   AM_RANGE(0x000000, 0x07ffff) AM_ROM
230   AM_RANGE(0x080000, 0x081fff) AM_READWRITE(MRA16_RAM, aerofgt_bg1videoram_w) AM_BASE(&aerofgt_bg1videoram)
231   AM_RANGE(0x082000, 0x083fff) AM_READWRITE(MRA16_RAM, aerofgt_bg2videoram_w) AM_BASE(&aerofgt_bg2videoram)
232   AM_RANGE(0x0a0000, 0x0affff) AM_RAM AM_BASE(&aerofgt_spriteram1) AM_SIZE(&aerofgt_spriteram1_size)
233   AM_RANGE(0x0b0000, 0x0bffff) AM_RAM AM_BASE(&aerofgt_spriteram2) AM_SIZE(&aerofgt_spriteram2_size)
234   AM_RANGE(0x0c0000, 0x0cffff) AM_RAM   /* work RAM */
235   AM_RANGE(0x0f8000, 0x0fbfff) AM_RAM   /* work RAM */
236   AM_RANGE(0x0fc000, 0x0fc7ff) AM_RAM AM_BASE(&aerofgt_spriteram3) AM_SIZE(&aerofgt_spriteram3_size)
237   AM_RANGE(0x0fe000, 0x0fe7ff) AM_READWRITE(MRA16_RAM, paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
253238   AM_RANGE(0x0ff000, 0x0ff001) AM_READ(input_port_0_word_r)
254   AM_RANGE(0x0ff002, 0x0ff003) AM_READ(input_port_1_word_r)
239   AM_RANGE(0x0ff002, 0x0ff003) AM_READWRITE(input_port_1_word_r, karatblz_gfxbank_w)
255240   AM_RANGE(0x0ff004, 0x0ff005) AM_READ(input_port_2_word_r)
256   AM_RANGE(0x0ff006, 0x0ff007) AM_READ(input_port_3_word_r)
257   AM_RANGE(0x0ff008, 0x0ff009) AM_READ(input_port_4_word_r)
258   AM_RANGE(0x0ff00a, 0x0ff00b) AM_READ(pending_command_r)
259ADDRESS_MAP_END
260
261static ADDRESS_MAP_START( karatblz_writemem, ADDRESS_SPACE_PROGRAM, 16 )
262   ADDRESS_MAP_FLAGS( AMEF_ABITS(20) )
263   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(MWA16_ROM)
264   AM_RANGE(0x080000, 0x081fff) AM_WRITE(aerofgt_bg1videoram_w) AM_BASE(&aerofgt_bg1videoram)
265   AM_RANGE(0x082000, 0x083fff) AM_WRITE(aerofgt_bg2videoram_w) AM_BASE(&aerofgt_bg2videoram)
266   AM_RANGE(0x0a0000, 0x0affff) AM_WRITE(MWA16_RAM) AM_BASE(&aerofgt_spriteram1) AM_SIZE(&aerofgt_spriteram1_size)
267   AM_RANGE(0x0b0000, 0x0bffff) AM_WRITE(MWA16_RAM) AM_BASE(&aerofgt_spriteram2) AM_SIZE(&aerofgt_spriteram2_size)
268   AM_RANGE(0x0c0000, 0x0cffff) AM_WRITE(MWA16_RAM)   /* work RAM */
269   AM_RANGE(0x0f8000, 0x0fbfff) AM_WRITE(MWA16_RAM)   /* work RAM */
270   AM_RANGE(0x0fc000, 0x0fc7ff) AM_WRITE(MWA16_RAM) AM_BASE(&aerofgt_spriteram3) AM_SIZE(&aerofgt_spriteram3_size)
271   AM_RANGE(0x0fe000, 0x0fe7ff) AM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
272   AM_RANGE(0x0ff002, 0x0ff003) AM_WRITE(karatblz_gfxbank_w)
273   AM_RANGE(0x0ff006, 0x0ff007) AM_WRITE(sound_command_w)
274   AM_RANGE(0x0ff008, 0x0ff009) AM_WRITE(aerofgt_bg1scrollx_w)
275   AM_RANGE(0x0ff00a, 0x0ff00b) AM_WRITE(aerofgt_bg1scrolly_w)
241   AM_RANGE(0x0ff006, 0x0ff007) AM_READWRITE(input_port_3_word_r, sound_command_w)
242   AM_RANGE(0x0ff008, 0x0ff009) AM_READWRITE(input_port_4_word_r, aerofgt_bg1scrollx_w)
243   AM_RANGE(0x0ff00a, 0x0ff00b) AM_READWRITE(pending_command_r, aerofgt_bg1scrolly_w)
276244   AM_RANGE(0x0ff00c, 0x0ff00d) AM_WRITE(aerofgt_bg2scrollx_w)
277245   AM_RANGE(0x0ff00e, 0x0ff00f) AM_WRITE(aerofgt_bg2scrolly_w)
278246ADDRESS_MAP_END
279247
280static ADDRESS_MAP_START( spinlbrk_readmem, ADDRESS_SPACE_PROGRAM, 16 )
281   AM_RANGE(0x000000, 0x03ffff) AM_READ(MRA16_ROM)
282   AM_RANGE(0x080000, 0x080fff) AM_READ(MRA16_RAM)
283   AM_RANGE(0x082000, 0x082fff) AM_READ(MRA16_RAM)
284   AM_RANGE(0xff8000, 0xffbfff) AM_READ(MRA16_RAM)
285   AM_RANGE(0xffc000, 0xffc7ff) AM_READ(MRA16_RAM)
286   AM_RANGE(0xffd000, 0xffd1ff) AM_READ(MRA16_RAM)
287   AM_RANGE(0xffe000, 0xffe7ff) AM_READ(MRA16_RAM)
288   AM_RANGE(0xfff000, 0xfff001) AM_READ(input_port_0_word_r)
289   AM_RANGE(0xfff002, 0xfff003) AM_READ(input_port_1_word_r)
248static ADDRESS_MAP_START( spinlbrk_map, ADDRESS_SPACE_PROGRAM, 16 )
249   AM_RANGE(0x000000, 0x03ffff) AM_ROM
250   AM_RANGE(0x080000, 0x080fff) AM_READWRITE(MRA16_RAM, aerofgt_bg1videoram_w) AM_BASE(&aerofgt_bg1videoram)
251   AM_RANGE(0x082000, 0x082fff) AM_READWRITE(MRA16_RAM, aerofgt_bg2videoram_w) AM_BASE(&aerofgt_bg2videoram)
252   AM_RANGE(0xff8000, 0xffbfff) AM_RAM   /* work RAM */
253   AM_RANGE(0xffc000, 0xffc7ff) AM_RAM AM_BASE(&aerofgt_spriteram3) AM_SIZE(&aerofgt_spriteram3_size)
254   AM_RANGE(0xffd000, 0xffd1ff) AM_RAM AM_BASE(&aerofgt_rasterram)   /* bg1 scroll registers */
255   AM_RANGE(0xffe000, 0xffe7ff) AM_READWRITE(MRA16_RAM, paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
256   AM_RANGE(0xfff000, 0xfff001) AM_READWRITE(input_port_0_word_r, spinlbrk_gfxbank_w)
257   AM_RANGE(0xfff002, 0xfff003) AM_READWRITE(input_port_1_word_r, aerofgt_bg2scrollx_w)
290258   AM_RANGE(0xfff004, 0xfff005) AM_READ(input_port_2_word_r)
291ADDRESS_MAP_END
292
293static ADDRESS_MAP_START( spinlbrk_writemem, ADDRESS_SPACE_PROGRAM, 16 )
294   AM_RANGE(0x000000, 0x03ffff) AM_WRITE(MWA16_ROM)
295   AM_RANGE(0x080000, 0x080fff) AM_WRITE(aerofgt_bg1videoram_w) AM_BASE(&aerofgt_bg1videoram)
296   AM_RANGE(0x082000, 0x082fff) AM_WRITE(aerofgt_bg2videoram_w) AM_BASE(&aerofgt_bg2videoram)
297   AM_RANGE(0xff8000, 0xffbfff) AM_WRITE(MWA16_RAM)   /* work RAM */
298   AM_RANGE(0xffc000, 0xffc7ff) AM_WRITE(MWA16_RAM) AM_BASE(&aerofgt_spriteram3) AM_SIZE(&aerofgt_spriteram3_size)
299   AM_RANGE(0xffd000, 0xffd1ff) AM_WRITE(MWA16_RAM) AM_BASE(&aerofgt_rasterram)   /* bg1 scroll registers */
300   AM_RANGE(0xffe000, 0xffe7ff) AM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
301   AM_RANGE(0xfff000, 0xfff001) AM_WRITE(spinlbrk_gfxbank_w)
302   AM_RANGE(0xfff002, 0xfff003) AM_WRITE(aerofgt_bg2scrollx_w)
303259   AM_RANGE(0xfff006, 0xfff007) AM_WRITE(sound_command_w)
304260ADDRESS_MAP_END
305261
306static ADDRESS_MAP_START( turbofrc_readmem, ADDRESS_SPACE_PROGRAM, 16 )
262static ADDRESS_MAP_START( turbofrc_map, ADDRESS_SPACE_PROGRAM, 16 )
307263   ADDRESS_MAP_FLAGS( AMEF_ABITS(20) )
308   AM_RANGE(0x000000, 0x0bffff) AM_READ(MRA16_ROM)
309   AM_RANGE(0x0c0000, 0x0cffff) AM_READ(MRA16_RAM)   /* work RAM */
310   AM_RANGE(0x0d0000, 0x0d1fff) AM_READ(MRA16_RAM)
311   AM_RANGE(0x0d2000, 0x0d3fff) AM_READ(MRA16_RAM)
312   AM_RANGE(0x0e0000, 0x0e3fff) AM_READ(MRA16_RAM)
313   AM_RANGE(0x0e4000, 0x0e7fff) AM_READ(MRA16_RAM)
314   AM_RANGE(0x0f8000, 0x0fbfff) AM_READ(MRA16_RAM)   /* work RAM */
315   AM_RANGE(0x0fc000, 0x0fc7ff) AM_READ(MRA16_RAM)
316   AM_RANGE(0x0fd000, 0x0fdfff) AM_READ(MRA16_RAM)
317   AM_RANGE(0x0fe000, 0x0fe7ff) AM_READ(MRA16_RAM)
264   AM_RANGE(0x000000, 0x0bffff) AM_ROM
265   AM_RANGE(0x0c0000, 0x0cffff) AM_RAM   /* work RAM */
266   AM_RANGE(0x0d0000, 0x0d1fff) AM_READWRITE(MRA16_RAM, aerofgt_bg1videoram_w) AM_BASE(&aerofgt_bg1videoram)
267   AM_RANGE(0x0d2000, 0x0d3fff) AM_READWRITE(MRA16_RAM, aerofgt_bg2videoram_w) AM_BASE(&aerofgt_bg2videoram)
268   AM_RANGE(0x0e0000, 0x0e3fff) AM_RAM AM_BASE(&aerofgt_spriteram1) AM_SIZE(&aerofgt_spriteram1_size)
269   AM_RANGE(0x0e4000, 0x0e7fff) AM_RAM AM_BASE(&aerofgt_spriteram2) AM_SIZE(&aerofgt_spriteram2_size)
270   AM_RANGE(0x0f8000, 0x0fbfff) AM_RAM   /* work RAM */
271   AM_RANGE(0x0fc000, 0x0fc7ff) AM_RAM AM_BASE(&aerofgt_spriteram3) AM_SIZE(&aerofgt_spriteram3_size)
272   AM_RANGE(0x0fd000, 0x0fdfff) AM_RAM AM_BASE(&aerofgt_rasterram)   /* bg1 scroll registers */
273   AM_RANGE(0x0fe000, 0x0fe7ff) AM_READWRITE(MRA16_RAM, paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
318274   AM_RANGE(0x0ff000, 0x0ff001) AM_READ(input_port_0_word_r)
319   AM_RANGE(0x0ff002, 0x0ff003) AM_READ(input_port_1_word_r)
320   AM_RANGE(0x0ff004, 0x0ff005) AM_READ(input_port_2_word_r)
321   AM_RANGE(0x0ff006, 0x0ff007) AM_READ(pending_command_r)
275   AM_RANGE(0x0ff002, 0x0ff003) AM_READWRITE(input_port_1_word_r, aerofgt_bg1scrolly_w)
276   AM_RANGE(0x0ff004, 0x0ff005) AM_READWRITE(input_port_2_word_r, aerofgt_bg2scrollx_w)
277   AM_RANGE(0x0ff006, 0x0ff007) AM_READWRITE(pending_command_r, aerofgt_bg2scrolly_w)
322278   AM_RANGE(0x0ff008, 0x0ff009) AM_READ(input_port_3_word_r)
323ADDRESS_MAP_END
324
325static ADDRESS_MAP_START( turbofrc_writemem, ADDRESS_SPACE_PROGRAM, 16 )
326   ADDRESS_MAP_FLAGS( AMEF_ABITS(20) )
327   AM_RANGE(0x000000, 0x0bffff) AM_WRITE(MWA16_ROM)
328   AM_RANGE(0x0c0000, 0x0cffff) AM_WRITE(MWA16_RAM)   /* work RAM */
329   AM_RANGE(0x0d0000, 0x0d1fff) AM_WRITE(aerofgt_bg1videoram_w) AM_BASE(&aerofgt_bg1videoram)
330   AM_RANGE(0x0d2000, 0x0d3fff) AM_WRITE(aerofgt_bg2videoram_w) AM_BASE(&aerofgt_bg2videoram)
331   AM_RANGE(0x0e0000, 0x0e3fff) AM_WRITE(MWA16_RAM) AM_BASE(&aerofgt_spriteram1) AM_SIZE(&aerofgt_spriteram1_size)
332   AM_RANGE(0x0e4000, 0x0e7fff) AM_WRITE(MWA16_RAM) AM_BASE(&aerofgt_spriteram2) AM_SIZE(&aerofgt_spriteram2_size)
333   AM_RANGE(0x0f8000, 0x0fbfff) AM_WRITE(MWA16_RAM)   /* work RAM */
334   AM_RANGE(0x0fc000, 0x0fc7ff) AM_WRITE(MWA16_RAM) AM_BASE(&aerofgt_spriteram3) AM_SIZE(&aerofgt_spriteram3_size)
335   AM_RANGE(0x0fd000, 0x0fdfff) AM_WRITE(MWA16_RAM) AM_BASE(&aerofgt_rasterram)   /* bg1 scroll registers */
336   AM_RANGE(0x0fe000, 0x0fe7ff) AM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
337   AM_RANGE(0x0ff002, 0x0ff003) AM_WRITE(aerofgt_bg1scrolly_w)
338   AM_RANGE(0x0ff004, 0x0ff005) AM_WRITE(aerofgt_bg2scrollx_w)
339   AM_RANGE(0x0ff006, 0x0ff007) AM_WRITE(aerofgt_bg2scrolly_w)
340279   AM_RANGE(0x0ff008, 0x0ff00b) AM_WRITE(turbofrc_gfxbank_w)
341280   AM_RANGE(0x0ff00c, 0x0ff00d) AM_WRITE(MWA16_NOP)   /* related to bg2 (written together with the scroll registers) */
342281   AM_RANGE(0x0ff00e, 0x0ff00f) AM_WRITE(turbofrc_sound_command_w)
343282ADDRESS_MAP_END
344283
345static ADDRESS_MAP_START( aerofgtb_readmem, ADDRESS_SPACE_PROGRAM, 16 )
346   AM_RANGE(0x000000, 0x07ffff) AM_READ(MRA16_ROM)
347   AM_RANGE(0x0c0000, 0x0cffff) AM_READ(MRA16_RAM)   /* work RAM */
348   AM_RANGE(0x0d0000, 0x0d1fff) AM_READ(MRA16_RAM)
349   AM_RANGE(0x0d2000, 0x0d3fff) AM_READ(MRA16_RAM)
350   AM_RANGE(0x0e0000, 0x0e3fff) AM_READ(MRA16_RAM)
351   AM_RANGE(0x0e4000, 0x0e7fff) AM_READ(MRA16_RAM)
352   AM_RANGE(0x0f8000, 0x0fbfff) AM_READ(MRA16_RAM)   /* work RAM */
353   AM_RANGE(0x0fc000, 0x0fc7ff) AM_READ(MRA16_RAM)
354   AM_RANGE(0x0fd000, 0x0fd7ff) AM_READ(MRA16_RAM)
284static ADDRESS_MAP_START( aerofgtb_map, ADDRESS_SPACE_PROGRAM, 16 )
285   AM_RANGE(0x000000, 0x07ffff) AM_ROM
286   AM_RANGE(0x0c0000, 0x0cffff) AM_RAM   /* work RAM */
287   AM_RANGE(0x0d0000, 0x0d1fff) AM_READWRITE(MRA16_RAM, aerofgt_bg1videoram_w) AM_BASE(&aerofgt_bg1videoram)
288   AM_RANGE(0x0d2000, 0x0d3fff) AM_READWRITE(MRA16_RAM, aerofgt_bg2videoram_w) AM_BASE(&aerofgt_bg2videoram)
289   AM_RANGE(0x0e0000, 0x0e3fff) AM_RAM AM_BASE(&aerofgt_spriteram1) AM_SIZE(&aerofgt_spriteram1_size)
290   AM_RANGE(0x0e4000, 0x0e7fff) AM_RAM AM_BASE(&aerofgt_spriteram2) AM_SIZE(&aerofgt_spriteram2_size)
291   AM_RANGE(0x0f8000, 0x0fbfff) AM_RAM   /* work RAM */
292   AM_RANGE(0x0fc000, 0x0fc7ff) AM_RAM AM_BASE(&aerofgt_spriteram3) AM_SIZE(&aerofgt_spriteram3_size)
293   AM_RANGE(0x0fd000, 0x0fd7ff) AM_READWRITE(MRA16_RAM, paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
355294   AM_RANGE(0x0fe000, 0x0fe001) AM_READ(input_port_0_word_r)
356   AM_RANGE(0x0fe002, 0x0fe003) AM_READ(input_port_1_word_r)
357   AM_RANGE(0x0fe004, 0x0fe005) AM_READ(input_port_2_word_r)
358   AM_RANGE(0x0fe006, 0x0fe007) AM_READ(pending_command_r)
295   AM_RANGE(0x0fe002, 0x0fe003) AM_READWRITE(input_port_1_word_r, aerofgt_bg1scrolly_w)
296   AM_RANGE(0x0fe004, 0x0fe005) AM_READWRITE(input_port_2_word_r, aerofgt_bg2scrollx_w)
297   AM_RANGE(0x0fe006, 0x0fe007) AM_READWRITE(pending_command_r, aerofgt_bg2scrolly_w)
359298   AM_RANGE(0x0fe008, 0x0fe009) AM_READ(input_port_3_word_r)
360   AM_RANGE(0x0ff000, 0x0fffff) AM_READ(MRA16_RAM)
361ADDRESS_MAP_END
362
363static ADDRESS_MAP_START( aerofgtb_writemem, ADDRESS_SPACE_PROGRAM, 16 )
364   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(MWA16_ROM)
365   AM_RANGE(0x0c0000, 0x0cffff) AM_WRITE(MWA16_RAM)   /* work RAM */
366   AM_RANGE(0x0d0000, 0x0d1fff) AM_WRITE(aerofgt_bg1videoram_w) AM_BASE(&aerofgt_bg1videoram)
367   AM_RANGE(0x0d2000, 0x0d3fff) AM_WRITE(aerofgt_bg2videoram_w) AM_BASE(&aerofgt_bg2videoram)
368   AM_RANGE(0x0e0000, 0x0e3fff) AM_WRITE(MWA16_RAM) AM_BASE(&aerofgt_spriteram1) AM_SIZE(&aerofgt_spriteram1_size)
369   AM_RANGE(0x0e4000, 0x0e7fff) AM_WRITE(MWA16_RAM) AM_BASE(&aerofgt_spriteram2) AM_SIZE(&aerofgt_spriteram2_size)
370   AM_RANGE(0x0f8000, 0x0fbfff) AM_WRITE(MWA16_RAM)   /* work RAM */
371   AM_RANGE(0x0fc000, 0x0fc7ff) AM_WRITE(MWA16_RAM) AM_BASE(&aerofgt_spriteram3) AM_SIZE(&aerofgt_spriteram3_size)
372   AM_RANGE(0x0fd000, 0x0fd7ff) AM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
373   AM_RANGE(0x0fe002, 0x0fe003) AM_WRITE(aerofgt_bg1scrolly_w)
374   AM_RANGE(0x0fe004, 0x0fe005) AM_WRITE(aerofgt_bg2scrollx_w)
375   AM_RANGE(0x0fe006, 0x0fe007) AM_WRITE(aerofgt_bg2scrolly_w)
376299   AM_RANGE(0x0fe008, 0x0fe00b) AM_WRITE(turbofrc_gfxbank_w)
377300   AM_RANGE(0x0fe00e, 0x0fe00f) AM_WRITE(turbofrc_sound_command_w)
378   AM_RANGE(0x0ff000, 0x0fffff) AM_WRITE(MWA16_RAM) AM_BASE(&aerofgt_rasterram)   /* used only for the scroll registers */
301   AM_RANGE(0x0ff000, 0x0fffff) AM_RAM AM_BASE(&aerofgt_rasterram)   /* used only for the scroll registers */
379302ADDRESS_MAP_END
380303
381static ADDRESS_MAP_START( aerofgt_readmem, ADDRESS_SPACE_PROGRAM, 16 )
382   AM_RANGE(0x000000, 0x07ffff) AM_READ(MRA16_ROM)
383   AM_RANGE(0x1a0000, 0x1a07ff) AM_READ(MRA16_RAM)
384   AM_RANGE(0x1b0000, 0x1b07ff) AM_READ(MRA16_RAM)
385   AM_RANGE(0x1b0800, 0x1b0801) AM_READ(MRA16_NOP)   /* ??? */
386   AM_RANGE(0x1b0ff0, 0x1b0fff) AM_READ(MRA16_RAM)   /* stack area during boot */
387   AM_RANGE(0x1b2000, 0x1b3fff) AM_READ(MRA16_RAM)
388   AM_RANGE(0x1b4000, 0x1b5fff) AM_READ(MRA16_RAM)
389   AM_RANGE(0x1c0000, 0x1c3fff) AM_READ(MRA16_RAM)
390   AM_RANGE(0x1c4000, 0x1c7fff) AM_READ(MRA16_RAM)
391   AM_RANGE(0x1d0000, 0x1d1fff) AM_READ(MRA16_RAM)
392   AM_RANGE(0xfef000, 0xffefff) AM_READ(MRA16_RAM)   /* work RAM */
304static ADDRESS_MAP_START( aerofgt_map, ADDRESS_SPACE_PROGRAM, 16 )
305   AM_RANGE(0x000000, 0x07ffff) AM_ROM
306   AM_RANGE(0x1a0000, 0x1a07ff) AM_READWRITE(MRA16_RAM, paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
307   AM_RANGE(0x1b0000, 0x1b07ff) AM_RAM AM_BASE(&aerofgt_rasterram)   /* used only for the scroll registers */
308   AM_RANGE(0x1b0800, 0x1b0801) AM_NOP   /* ??? */
309   AM_RANGE(0x1b0ff0, 0x1b0fff) AM_RAM   /* stack area during boot */
310   AM_RANGE(0x1b2000, 0x1b3fff) AM_READWRITE(MRA16_RAM, aerofgt_bg1videoram_w) AM_BASE(&aerofgt_bg1videoram)
311   AM_RANGE(0x1b4000, 0x1b5fff) AM_READWRITE(MRA16_RAM, aerofgt_bg2videoram_w) AM_BASE(&aerofgt_bg2videoram)
312   AM_RANGE(0x1c0000, 0x1c3fff) AM_RAM AM_BASE(&aerofgt_spriteram1) AM_SIZE(&aerofgt_spriteram1_size)
313   AM_RANGE(0x1c4000, 0x1c7fff) AM_RAM AM_BASE(&aerofgt_spriteram2) AM_SIZE(&aerofgt_spriteram2_size)
314   AM_RANGE(0x1d0000, 0x1d1fff) AM_RAM AM_BASE(&aerofgt_spriteram3) AM_SIZE(&aerofgt_spriteram3_size)
315   AM_RANGE(0xfef000, 0xffefff) AM_RAM   /* work RAM */
316   AM_RANGE(0xffff80, 0xffff87) AM_WRITE(aerofgt_gfxbank_w)
317   AM_RANGE(0xffff88, 0xffff89) AM_WRITE(aerofgt_bg1scrolly_w)   /* + something else in the top byte */
318   AM_RANGE(0xffff90, 0xffff91) AM_WRITE(aerofgt_bg2scrolly_w)   /* + something else in the top byte */
393319   AM_RANGE(0xffffa0, 0xffffa1) AM_READ(input_port_0_word_r)
394320   AM_RANGE(0xffffa2, 0xffffa3) AM_READ(input_port_1_word_r)
395321   AM_RANGE(0xffffa4, 0xffffa5) AM_READ(input_port_2_word_r)
396322   AM_RANGE(0xffffa6, 0xffffa7) AM_READ(input_port_3_word_r)
397323   AM_RANGE(0xffffa8, 0xffffa9) AM_READ(input_port_4_word_r)
398   AM_RANGE(0xffffac, 0xffffad) AM_READ(pending_command_r)
324   AM_RANGE(0xffffac, 0xffffad) AM_READWRITE(pending_command_r, MWA16_NOP)   /* ??? */
399325   AM_RANGE(0xffffae, 0xffffaf) AM_READ(input_port_5_word_r)
400ADDRESS_MAP_END
401
402static ADDRESS_MAP_START( aerofgt_writemem, ADDRESS_SPACE_PROGRAM, 16 )
403   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(MWA16_ROM)
404   AM_RANGE(0x1a0000, 0x1a07ff) AM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
405   AM_RANGE(0x1b0000, 0x1b07ff) AM_WRITE(MWA16_RAM) AM_BASE(&aerofgt_rasterram)   /* used only for the scroll registers */
406   AM_RANGE(0x1b0800, 0x1b0801) AM_WRITE(MWA16_NOP)   /* ??? */
407   AM_RANGE(0x1b0ff0, 0x1b0fff) AM_WRITE(MWA16_RAM)   /* stack area during boot */
408   AM_RANGE(0x1b2000, 0x1b3fff) AM_WRITE(aerofgt_bg1videoram_w) AM_BASE(&aerofgt_bg1videoram)
409   AM_RANGE(0x1b4000, 0x1b5fff) AM_WRITE(aerofgt_bg2videoram_w) AM_BASE(&aerofgt_bg2videoram)
410   AM_RANGE(0x1c0000, 0x1c3fff) AM_WRITE(MWA16_RAM) AM_BASE(&aerofgt_spriteram1) AM_SIZE(&aerofgt_spriteram1_size)
411   AM_RANGE(0x1c4000, 0x1c7fff) AM_WRITE(MWA16_RAM) AM_BASE(&aerofgt_spriteram2) AM_SIZE(&aerofgt_spriteram2_size)
412   AM_RANGE(0x1d0000, 0x1d1fff) AM_WRITE(MWA16_RAM) AM_BASE(&aerofgt_spriteram3) AM_SIZE(&aerofgt_spriteram3_size)
413   AM_RANGE(0xfef000, 0xffefff) AM_WRITE(MWA16_RAM)   /* work RAM */
414   AM_RANGE(0xffff80, 0xffff87) AM_WRITE(aerofgt_gfxbank_w)
415   AM_RANGE(0xffff88, 0xffff89) AM_WRITE(aerofgt_bg1scrolly_w)   /* + something else in the top byte */
416   AM_RANGE(0xffff90, 0xffff91) AM_WRITE(aerofgt_bg2scrolly_w)   /* + something else in the top byte */
417   AM_RANGE(0xffffac, 0xffffad) AM_WRITE(MWA16_NOP)   /* ??? */
418326   AM_RANGE(0xffffc0, 0xffffc1) AM_WRITE(sound_command_w)
419327ADDRESS_MAP_END
420328
r1771r1772
444352   AM_RANGE(0x10b800, 0x10bfff) AM_RAM AM_BASE(&aerofgt_spriteram3) AM_SIZE(&aerofgt_spriteram3_size)
445353ADDRESS_MAP_END
446354
447static ADDRESS_MAP_START( wbbc97_readmem, ADDRESS_SPACE_PROGRAM, 16 )
448   AM_RANGE(0x000000, 0x3fffff) AM_READ(MRA16_ROM)
449   AM_RANGE(0x500000, 0x50ffff) AM_READ(MRA16_RAM)
450   AM_RANGE(0x600000, 0x605fff) AM_READ(MRA16_RAM)
451   AM_RANGE(0xa00000, 0xa3ffff) AM_READ(MRA16_RAM)
452   AM_RANGE(0xff8000, 0xff8fff) AM_READ(MRA16_RAM)
453   AM_RANGE(0xffd000, 0xffdfff) AM_READ(MRA16_RAM)
454   AM_RANGE(0xffe000, 0xffefff) AM_READ(MRA16_RAM)
455   AM_RANGE(0xfff000, 0xfff001) AM_READ(input_port_0_word_r)
456   AM_RANGE(0xfff002, 0xfff003) AM_READ(input_port_1_word_r)
457   AM_RANGE(0xfff004, 0xfff005) AM_READ(input_port_2_word_r)
458   AM_RANGE(0xfff006, 0xfff007) AM_READNOP
459ADDRESS_MAP_END
460
461static ADDRESS_MAP_START( wbbc97_writemem, ADDRESS_SPACE_PROGRAM, 16 )
462   AM_RANGE(0x000000, 0x3fffff) AM_WRITE(MWA16_ROM)
463   AM_RANGE(0x500000, 0x50ffff) AM_WRITE(MWA16_RAM)   /* work RAM */
464   AM_RANGE(0x600000, 0x605fff) AM_WRITE(MWA16_RAM) AM_BASE(&aerofgt_spriteram1) AM_SIZE(&aerofgt_spriteram1_size)
465   AM_RANGE(0xa00000, 0xa3ffff) AM_WRITE(MWA16_RAM) AM_BASE(&wbbc97_bitmapram)
466   AM_RANGE(0xff8000, 0xff8fff) AM_WRITE(aerofgt_bg1videoram_w) AM_BASE(&aerofgt_bg1videoram)
467   AM_RANGE(0xffc000, 0xffc3ff) AM_WRITE(MWA16_RAM) AM_BASE(&aerofgt_spriteram3) AM_SIZE(&aerofgt_spriteram3_size)
468   AM_RANGE(0xffd000, 0xffdfff) AM_WRITE(MWA16_RAM) AM_BASE(&aerofgt_rasterram)   /* bg1 scroll registers */
469   AM_RANGE(0xffe000, 0xffefff) AM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
470   AM_RANGE(0xfff000, 0xfff001) AM_WRITE(pspikes_palette_bank_w)
471   AM_RANGE(0xfff002, 0xfff003) AM_WRITE(pspikes_gfxbank_w)
472   AM_RANGE(0xfff004, 0xfff005) AM_WRITE(aerofgt_bg1scrolly_w)
473   AM_RANGE(0xfff006, 0xfff007) AM_WRITE(sound_command_w)
355static ADDRESS_MAP_START( wbbc97_map, ADDRESS_SPACE_PROGRAM, 16 )
356   AM_RANGE(0x000000, 0x3fffff) AM_ROM
357   AM_RANGE(0x500000, 0x50ffff) AM_RAM   /* work RAM */
358   AM_RANGE(0x600000, 0x605fff) AM_RAM AM_BASE(&aerofgt_spriteram1) AM_SIZE(&aerofgt_spriteram1_size)
359   AM_RANGE(0xa00000, 0xa3ffff) AM_RAM AM_BASE(&wbbc97_bitmapram)
360   AM_RANGE(0xff8000, 0xff8fff) AM_READWRITE(MRA16_RAM, aerofgt_bg1videoram_w) AM_BASE(&aerofgt_bg1videoram)
361   AM_RANGE(0xffc000, 0xffc3ff) AM_WRITEONLY AM_BASE(&aerofgt_spriteram3) AM_SIZE(&aerofgt_spriteram3_size)
362   AM_RANGE(0xffd000, 0xffdfff) AM_RAM AM_BASE(&aerofgt_rasterram)   /* bg1 scroll registers */
363   AM_RANGE(0xffe000, 0xffefff) AM_READWRITE(MRA16_RAM, paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
364   AM_RANGE(0xfff000, 0xfff001) AM_READWRITE(input_port_0_word_r, pspikes_palette_bank_w)
365   AM_RANGE(0xfff002, 0xfff003) AM_READWRITE(input_port_1_word_r, pspikes_gfxbank_w)
366   AM_RANGE(0xfff004, 0xfff005) AM_READWRITE(input_port_2_word_r, aerofgt_bg1scrolly_w)
367   AM_RANGE(0xfff006, 0xfff007) AM_READWRITE(MRA16_NOP, sound_command_w)
474368   AM_RANGE(0xfff00e, 0xfff00f) AM_WRITE(wbbc97_bitmap_enable_w)
475369ADDRESS_MAP_END
476370
477static ADDRESS_MAP_START( sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
478   AM_RANGE(0x0000, 0x77ff) AM_READ(MRA8_ROM)
479   AM_RANGE(0x7800, 0x7fff) AM_READ(MRA8_RAM)
480   AM_RANGE(0x8000, 0xffff) AM_READ(MRA8_BANK1)
371static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
372   AM_RANGE(0x0000, 0x77ff) AM_ROM
373   AM_RANGE(0x7800, 0x7fff) AM_RAM
374   AM_RANGE(0x8000, 0xffff) AM_ROMBANK(1)
481375ADDRESS_MAP_END
482376
483static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
484   AM_RANGE(0x0000, 0x77ff) AM_WRITE(MWA8_ROM)
485   AM_RANGE(0x7800, 0x7fff) AM_WRITE(MWA8_RAM)
486   AM_RANGE(0x8000, 0xffff) AM_WRITE(MWA8_ROM)
487ADDRESS_MAP_END
488
489static ADDRESS_MAP_START( turbofrc_sound_readport, ADDRESS_SPACE_IO, 8 )
377static ADDRESS_MAP_START( turbofrc_sound_portmap, ADDRESS_SPACE_IO, 8 )
490378   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
491   AM_RANGE(0x14, 0x14) AM_READ(soundlatch_r)
492   AM_RANGE(0x18, 0x18) AM_READ(YM2610_status_port_0_A_r)
493   AM_RANGE(0x1a, 0x1a) AM_READ(YM2610_status_port_0_B_r)
494ADDRESS_MAP_END
495
496static ADDRESS_MAP_START( turbofrc_sound_writeport, ADDRESS_SPACE_IO, 8 )
497   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
498379   AM_RANGE(0x00, 0x00) AM_WRITE(aerofgt_sh_bankswitch_w)
499   AM_RANGE(0x14, 0x14) AM_WRITE(pending_command_clear_w)
500   AM_RANGE(0x18, 0x18) AM_WRITE(YM2610_control_port_0_A_w)
380   AM_RANGE(0x14, 0x14) AM_READWRITE(soundlatch_r, pending_command_clear_w)
381   AM_RANGE(0x18, 0x18) AM_READWRITE(YM2610_status_port_0_A_r, YM2610_control_port_0_A_w)
501382   AM_RANGE(0x19, 0x19) AM_WRITE(YM2610_data_port_0_A_w)
502   AM_RANGE(0x1a, 0x1a) AM_WRITE(YM2610_control_port_0_B_w)
383   AM_RANGE(0x1a, 0x1a) AM_READWRITE(YM2610_status_port_0_B_r, YM2610_control_port_0_B_w)
503384   AM_RANGE(0x1b, 0x1b) AM_WRITE(YM2610_data_port_0_B_w)
504385ADDRESS_MAP_END
505386
506static ADDRESS_MAP_START( aerofgt_sound_readport, ADDRESS_SPACE_IO, 8 )
387static ADDRESS_MAP_START( aerofgt_sound_portmap, ADDRESS_SPACE_IO, 8 )
507388   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
508   AM_RANGE(0x00, 0x00) AM_READ(YM2610_status_port_0_A_r)
509   AM_RANGE(0x02, 0x02) AM_READ(YM2610_status_port_0_B_r)
510   AM_RANGE(0x0c, 0x0c) AM_READ(soundlatch_r)
511ADDRESS_MAP_END
512
513static ADDRESS_MAP_START( aerofgt_sound_writeport, ADDRESS_SPACE_IO, 8 )
514   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
515   AM_RANGE(0x00, 0x00) AM_WRITE(YM2610_control_port_0_A_w)
389   AM_RANGE(0x00, 0x00) AM_READWRITE(YM2610_status_port_0_A_r, YM2610_control_port_0_A_w)
516390   AM_RANGE(0x01, 0x01) AM_WRITE(YM2610_data_port_0_A_w)
517   AM_RANGE(0x02, 0x02) AM_WRITE(YM2610_control_port_0_B_w)
391   AM_RANGE(0x02, 0x02) AM_READWRITE(YM2610_status_port_0_B_r, YM2610_control_port_0_B_w)
518392   AM_RANGE(0x03, 0x03) AM_WRITE(YM2610_data_port_0_B_w)
519393   AM_RANGE(0x04, 0x04) AM_WRITE(aerofgt_sh_bankswitch_w)
520394   AM_RANGE(0x08, 0x08) AM_WRITE(pending_command_clear_w)
395   AM_RANGE(0x0c, 0x0c) AM_READ(soundlatch_r)
521396ADDRESS_MAP_END
522397
523static ADDRESS_MAP_START( aerfboot_snd_map, ADDRESS_SPACE_PROGRAM, 8 )
398static ADDRESS_MAP_START( aerfboot_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
524399   AM_RANGE(0x0000, 0x7fff) AM_ROM
525400   AM_RANGE(0x8000, 0x87ff) AM_RAM
526401   AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r)
r1771r1772
13881263
13891264   /* basic machine hardware */
13901265   MDRV_CPU_ADD(M68000,20000000/2)   /* 10 MHz (?) */
1391   MDRV_CPU_PROGRAM_MAP(pspikes_readmem,pspikes_writemem)
1266   MDRV_CPU_PROGRAM_MAP(pspikes_map,0)
13921267   MDRV_CPU_VBLANK_INT(irq1_line_hold,1)/* all irq vectors are the same */
13931268
1394   MDRV_CPU_ADD(Z80,8000000/2)
1395   /* audio CPU */   /* 4 MHz ??? */
1396   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
1397   MDRV_CPU_IO_MAP(turbofrc_sound_readport,turbofrc_sound_writeport)
1269   MDRV_CPU_ADD(Z80,8000000/2) /* 4 MHz ??? */
1270   MDRV_CPU_PROGRAM_MAP(sound_map,0)
1271   MDRV_CPU_IO_MAP(turbofrc_sound_portmap,0)
13981272                        /* IRQs are triggered by the YM2610 */
13991273
14001274   MDRV_MACHINE_RESET(aerofgt)
r1771r1772
15151389
15161390   /* basic machine hardware */
15171391   MDRV_CPU_ADD(M68000,20000000/2)   /* 10 MHz (?) */
1518   MDRV_CPU_PROGRAM_MAP(karatblz_readmem,karatblz_writemem)
1392   MDRV_CPU_PROGRAM_MAP(karatblz_map,0)
15191393   MDRV_CPU_VBLANK_INT(irq1_line_hold,1)
15201394
1521   MDRV_CPU_ADD(Z80,8000000/2)
1522   /* audio CPU */   /* 4 MHz ??? */
1523   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
1524   MDRV_CPU_IO_MAP(turbofrc_sound_readport,turbofrc_sound_writeport)
1395   MDRV_CPU_ADD(Z80,8000000/2) /* 4 MHz ??? */
1396   MDRV_CPU_PROGRAM_MAP(sound_map,0)
1397   MDRV_CPU_IO_MAP(turbofrc_sound_portmap,0)
15251398                        /* IRQs are triggered by the YM2610 */
15261399
15271400   MDRV_MACHINE_RESET(aerofgt)
r1771r1772
15541427
15551428   /* basic machine hardware */
15561429   MDRV_CPU_ADD(M68000,20000000/2)   /* 10 MHz (?) */
1557   MDRV_CPU_PROGRAM_MAP(spinlbrk_readmem,spinlbrk_writemem)
1430   MDRV_CPU_PROGRAM_MAP(spinlbrk_map,0)
15581431   MDRV_CPU_VBLANK_INT(irq1_line_hold,1)/* there are vectors for 3 and 4 too */
15591432
1560   MDRV_CPU_ADD(Z80,8000000/2)
1561   /* audio CPU */   /* 4 MHz ??? */
1562   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
1563   MDRV_CPU_IO_MAP(turbofrc_sound_readport,turbofrc_sound_writeport)
1433   MDRV_CPU_ADD(Z80,8000000/2) /* 4 MHz ??? */
1434   MDRV_CPU_PROGRAM_MAP(sound_map,0)
1435   MDRV_CPU_IO_MAP(turbofrc_sound_portmap,0)
15641436                        /* IRQs are triggered by the YM2610 */
15651437
15661438   MDRV_MACHINE_RESET(aerofgt)
r1771r1772
15931465
15941466   /* basic machine hardware */
15951467   MDRV_CPU_ADD(M68000,20000000/2)   /* 10 MHz (verified on pcb) */
1596   MDRV_CPU_PROGRAM_MAP(turbofrc_readmem,turbofrc_writemem)
1468   MDRV_CPU_PROGRAM_MAP(turbofrc_map,0)
15971469   MDRV_CPU_VBLANK_INT(irq1_line_hold,1)/* all irq vectors are the same */
15981470
1599   MDRV_CPU_ADD(Z80,5000000)
1600   /* audio CPU */   /* 5 MHz (verified on pcb) */
1601   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
1602   MDRV_CPU_IO_MAP(turbofrc_sound_readport,turbofrc_sound_writeport)
1471   MDRV_CPU_ADD(Z80,5000000) /* 5 MHz (verified on pcb) */
1472   MDRV_CPU_PROGRAM_MAP(sound_map,0)
1473   MDRV_CPU_IO_MAP(turbofrc_sound_portmap,0)
16031474                        /* IRQs are triggered by the YM2610 */
16041475
16051476   MDRV_MACHINE_RESET(aerofgt)
r1771r1772
16321503
16331504   /* basic machine hardware */
16341505   MDRV_CPU_ADD(M68000,20000000/2)   /* 10 MHz (?) */
1635   MDRV_CPU_PROGRAM_MAP(aerofgtb_readmem,aerofgtb_writemem)
1506   MDRV_CPU_PROGRAM_MAP(aerofgtb_map,0)
16361507   MDRV_CPU_VBLANK_INT(irq1_line_hold,1)/* all irq vectors are the same */
16371508
1638   MDRV_CPU_ADD(Z80,8000000/2)
1639   /* audio CPU */   /* 4 MHz ??? */
1640   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
1641   MDRV_CPU_IO_MAP(aerofgt_sound_readport,aerofgt_sound_writeport)
1509   MDRV_CPU_ADD(Z80,8000000/2) /* 4 MHz ??? */
1510   MDRV_CPU_PROGRAM_MAP(sound_map,0)
1511   MDRV_CPU_IO_MAP(aerofgt_sound_portmap,0)
16421512                        /* IRQs are triggered by the YM2610 */
16431513
16441514   MDRV_MACHINE_RESET(aerofgt)
r1771r1772
16721542
16731543   /* basic machine hardware */
16741544   MDRV_CPU_ADD(M68000,20000000/2)   /* 10 MHz (verified on pcb) */
1675   MDRV_CPU_PROGRAM_MAP(aerofgt_readmem,aerofgt_writemem)
1545   MDRV_CPU_PROGRAM_MAP(aerofgt_map,0)
16761546   MDRV_CPU_VBLANK_INT(irq1_line_hold,1)/* all irq vectors are the same */
16771547
1678   MDRV_CPU_ADD(Z80,5000000)
1679   /* audio CPU */   /* 5 MHz (verified on pcb) */
1680   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
1681   MDRV_CPU_IO_MAP(aerofgt_sound_readport,aerofgt_sound_writeport)
1548   MDRV_CPU_ADD(Z80,5000000) /* 5 MHz (verified on pcb) */
1549   MDRV_CPU_PROGRAM_MAP(sound_map,0)
1550   MDRV_CPU_IO_MAP(aerofgt_sound_portmap,0)
16821551                        /* IRQs are triggered by the YM2610 */
16831552
16841553   MDRV_MACHINE_RESET(aerofgt)
r1771r1772
17161585   MDRV_CPU_VBLANK_INT(irq1_line_hold,1)
17171586
17181587   MDRV_CPU_ADD(Z80,8000000/2) /* 4 MHz ??? */
1719   MDRV_CPU_PROGRAM_MAP(aerfboot_snd_map,0)
1588   MDRV_CPU_PROGRAM_MAP(aerfboot_sound_map,0)
17201589
17211590   /* video hardware */
17221591   MDRV_SCREEN_ADD("main", RASTER)
r1771r1772
17441613
17451614   /* basic machine hardware */
17461615   MDRV_CPU_ADD(M68000,20000000/2)   /* 10 MHz (?) */
1747   MDRV_CPU_PROGRAM_MAP(wbbc97_readmem,wbbc97_writemem)
1616   MDRV_CPU_PROGRAM_MAP(wbbc97_map,0)
17481617   MDRV_CPU_VBLANK_INT(irq1_line_hold,1)/* all irq vectors are the same */
17491618
17501619   MDRV_CPU_ADD(Z80,8000000/2) /* 4 MHz ??? */
src/mame/drivers/expro02.c
r1771r1772
338338   MDRV_PALETTE_INIT(berlwall)
339339
340340   /* arm watchdog */
341   MDRV_WATCHDOG_TIME_INIT(ATTOTIME_IN_SEC(3))   /* a guess, and certainly wrong */
341   MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_SEC(3))   /* a guess, and certainly wrong */
342342
343343   /* sound hardware */
344344   MDRV_SPEAKER_STANDARD_MONO("mono")
src/mame/drivers/mhavoc.c
r1771r1772
533533   MDRV_SCREEN_SIZE(400, 300)
534534   MDRV_SCREEN_VISIBLE_AREA(0, 300, 0, 260)
535535
536   MDRV_PALETTE_LENGTH(32768)
537
538536   MDRV_VIDEO_START(avg_mhavoc)
539537   MDRV_VIDEO_UPDATE(vector)
540538
src/mame/drivers/bzone.c
r1771r1772
587587   MDRV_SCREEN_SIZE(400, 300)
588588   MDRV_SCREEN_VISIBLE_AREA(0, 580, 0, 400)
589589
590   MDRV_PALETTE_LENGTH(32768)
591
592590   MDRV_VIDEO_START(avg_bzone)
593591   MDRV_VIDEO_UPDATE(vector)
594592
src/mame/drivers/dblewing.c
r1771r1772
9999         inc = 1;
100100      }
101101
102      if (flip_screen)
102      if (flip_screen_get())
103103      {
104104         y=240-y;
105105         x=304-x;
src/mame/drivers/ambush.c
r1771r1772
5656}
5757
5858
59static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
60   AM_RANGE(0x0000, 0x7fff) AM_READ(MRA8_ROM)
61   AM_RANGE(0x8000, 0x87ff) AM_READ(MRA8_RAM)
59static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
60   AM_RANGE(0x0000, 0x7fff) AM_ROM
61   AM_RANGE(0x8000, 0x87ff) AM_RAM
6262   AM_RANGE(0xa000, 0xa000) AM_READ(watchdog_reset_r)
63   AM_RANGE(0xc000, 0xc7ff) AM_READ(MRA8_RAM)
63   AM_RANGE(0xc000, 0xc7ff) AM_RAM
64   AM_RANGE(0xc080, 0xc09f) AM_BASE(&ambush_scrollram)
65   AM_RANGE(0xc100, 0xc1ff) AM_BASE(&colorram)
66   AM_RANGE(0xc200, 0xc3ff) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
67   AM_RANGE(0xc400, 0xc7ff) AM_BASE(&videoram) AM_SIZE(&videoram_size)
6468   AM_RANGE(0xc800, 0xc800) AM_READ(input_port_2_r)
65ADDRESS_MAP_END
66
67static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
68   AM_RANGE(0x8000, 0x87ff) AM_WRITE(MWA8_RAM)
69   AM_RANGE(0xc080, 0xc09f) AM_WRITE(MWA8_RAM) AM_BASE(&ambush_scrollram)
70   AM_RANGE(0xc100, 0xc1ff) AM_WRITE(MWA8_RAM) AM_BASE(&colorram)
71   AM_RANGE(0xc200, 0xc3ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
72   AM_RANGE(0xc400, 0xc7ff) AM_WRITE(MWA8_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size)
7369   AM_RANGE(0xcc00, 0xcc03) AM_WRITE(MWA8_NOP)
7470   AM_RANGE(0xcc04, 0xcc04) AM_WRITE(flip_screen_w)
7571   AM_RANGE(0xcc05, 0xcc05) AM_WRITE(MWA8_RAM) AM_BASE(&ambush_colorbank)
7672   AM_RANGE(0xcc07, 0xcc07) AM_WRITE(ambush_coin_counter_w)
7773ADDRESS_MAP_END
7874
79static ADDRESS_MAP_START( readport, ADDRESS_SPACE_IO, 8 )
75static ADDRESS_MAP_START( main_portmap, ADDRESS_SPACE_IO, 8 )
8076   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
81   AM_RANGE(0x00, 0x00) AM_READ(AY8910_read_port_0_r)
82   AM_RANGE(0x80, 0x80) AM_READ(AY8910_read_port_1_r)
83ADDRESS_MAP_END
84
85static ADDRESS_MAP_START( writeport, ADDRESS_SPACE_IO, 8 )
86   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
87   AM_RANGE(0x00, 0x00) AM_WRITE(AY8910_control_port_0_w)
77   AM_RANGE(0x00, 0x00) AM_READWRITE(AY8910_read_port_0_r, AY8910_control_port_0_w)
8878   AM_RANGE(0x01, 0x01) AM_WRITE(AY8910_write_port_0_w)
89   AM_RANGE(0x80, 0x80) AM_WRITE(AY8910_control_port_1_w)
79   AM_RANGE(0x80, 0x80) AM_READWRITE(AY8910_read_port_1_r, AY8910_control_port_1_w)
9080   AM_RANGE(0x81, 0x81) AM_WRITE(AY8910_write_port_1_w)
9181ADDRESS_MAP_END
9282
r1771r1772
184174
185175   /* basic machine hardware */
186176   MDRV_CPU_ADD(Z80, 4000000)        /* 4.00 MHz??? */
187   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
188   MDRV_CPU_IO_MAP(readport,writeport)
177   MDRV_CPU_PROGRAM_MAP(main_map,0)
178   MDRV_CPU_IO_MAP(main_portmap,0)
189179   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
190180
191181   /* video hardware */
src/mame/drivers/jedi.c
r1771r1772
270270
271271static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
272272   AM_RANGE(0x0000, 0x07ff) AM_RAM
273   AM_RANGE(0x0800, 0x08ff) AM_MIRROR(0x0380) AM_READWRITE(MRA8_RAM, nvram_data_w) AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
273   AM_RANGE(0x0800, 0x08ff) AM_MIRROR(0x0300) AM_READWRITE(MRA8_RAM, nvram_data_w) AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
274274   AM_RANGE(0x0c00, 0x0c00) AM_MIRROR(0x03fe) AM_READWRITE(input_port_0_r, MWA8_NOP)
275275   AM_RANGE(0x0c01, 0x0c01) AM_MIRROR(0x03fe) AM_READWRITE(input_port_1_r, MWA8_NOP)
276276   AM_RANGE(0x1000, 0x13ff) AM_NOP
src/mame/drivers/suprnova.c
r1771r1772
44    taken to pieces and attempted reconstruction by David Haywood
55
66Mainboard + Cart combo
7  Regions are not cross compatible and have thier own BIOS
7  Regions are not cross compatible and have their own BIOS
88   Regions by color coded cart:
99
1010    White      = Japan
11    Light Blue = USA
12    Dark Blue  = Europe
11    Light Blue = Europe
12    Dark Blue  = USA
1313    Green      = Asia
1414    Red        = Korean
1515
src/mame/drivers/frogger.c
r1771r1772
273273   MDRV_CPU_PROGRAM_MAP(froggrmc_readmem,froggrmc_writemem)
274274
275275   MDRV_VIDEO_START(froggers)
276   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33)
277276MACHINE_DRIVER_END
278277
279278
src/mame/drivers/ashnojoe.c
r1771r1772
115115   }
116116}
117117
118static ADDRESS_MAP_START( ashnojoe_readmem, ADDRESS_SPACE_PROGRAM, 16 )
119   AM_RANGE(0x000000, 0x01ffff) AM_READ(MRA16_ROM)
120   AM_RANGE(0x040000, 0x043fff) AM_READ(MRA16_RAM)
121   AM_RANGE(0x044000, 0x048fff) AM_READ(MRA16_RAM)
122   AM_RANGE(0x049000, 0x049fff) AM_READ(MRA16_RAM)
118static ADDRESS_MAP_START( ashnojoe_map, ADDRESS_SPACE_PROGRAM, 16 )
119   AM_RANGE(0x000000, 0x01ffff) AM_ROM
120   AM_RANGE(0x040000, 0x041fff) AM_READWRITE(MRA16_RAM, ashnojoe_tileram3_w) AM_BASE(&ashnojoetileram16_3)
121   AM_RANGE(0x042000, 0x043fff) AM_READWRITE(MRA16_RAM, ashnojoe_tileram4_w) AM_BASE(&ashnojoetileram16_4)
122   AM_RANGE(0x044000, 0x044fff) AM_READWRITE(MRA16_RAM, ashnojoe_tileram5_w) AM_BASE(&ashnojoetileram16_5)
123   AM_RANGE(0x045000, 0x045fff) AM_READWRITE(MRA16_RAM, ashnojoe_tileram2_w) AM_BASE(&ashnojoetileram16_2)
124   AM_RANGE(0x046000, 0x046fff) AM_READWRITE(MRA16_RAM, ashnojoe_tileram6_w) AM_BASE(&ashnojoetileram16_6)
125   AM_RANGE(0x047000, 0x047fff) AM_READWRITE(MRA16_RAM, ashnojoe_tileram7_w) AM_BASE(&ashnojoetileram16_7)
126   AM_RANGE(0x048000, 0x048fff) AM_READWRITE(MRA16_RAM, ashnojoe_tileram_w) AM_BASE(&ashnojoetileram16)
127   AM_RANGE(0x049000, 0x049fff) AM_READWRITE(MRA16_RAM, paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
123128   AM_RANGE(0x04a000, 0x04a001) AM_READ(input_port_0_word_r) // p1 inputs, coins
124129   AM_RANGE(0x04a002, 0x04a003) AM_READ(input_port_1_word_r) // p2 inputs
125130   AM_RANGE(0x04a004, 0x04a005) AM_READ(input_port_2_word_r) // dipswitches
126   AM_RANGE(0x04a00a, 0x04a00b) AM_READ(fake_4a00a_r) // ??
127   AM_RANGE(0x04c000, 0x04ffff) AM_READ(MRA16_RAM)
128   AM_RANGE(0x080000, 0x0bffff) AM_READ(MRA16_ROM)
129ADDRESS_MAP_END
130
131static ADDRESS_MAP_START( ashnojoe_writemem, ADDRESS_SPACE_PROGRAM, 16 )
132   AM_RANGE(0x000000, 0x01ffff) AM_WRITE(MWA16_ROM)
133   AM_RANGE(0x040000, 0x041fff) AM_WRITE(ashnojoe_tileram3_w) AM_BASE(&ashnojoetileram16_3)
134   AM_RANGE(0x042000, 0x043fff) AM_WRITE(ashnojoe_tileram4_w) AM_BASE(&ashnojoetileram16_4)
135   AM_RANGE(0x044000, 0x044fff) AM_WRITE(ashnojoe_tileram5_w) AM_BASE(&ashnojoetileram16_5)
136   AM_RANGE(0x045000, 0x045fff) AM_WRITE(ashnojoe_tileram2_w) AM_BASE(&ashnojoetileram16_2)
137   AM_RANGE(0x046000, 0x046fff) AM_WRITE(ashnojoe_tileram6_w) AM_BASE(&ashnojoetileram16_6)
138   AM_RANGE(0x047000, 0x047fff) AM_WRITE(ashnojoe_tileram7_w) AM_BASE(&ashnojoetileram16_7)
139   AM_RANGE(0x048000, 0x048fff) AM_WRITE(ashnojoe_tileram_w) AM_BASE(&ashnojoetileram16)
140   AM_RANGE(0x049000, 0x049fff) AM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
141131   AM_RANGE(0x04a006, 0x04a007) AM_WRITE(MWA16_RAM) AM_BASE(&ashnojoe_tilemap_reg)
142132   AM_RANGE(0x04a008, 0x04a009) AM_WRITE(ashnojoe_soundlatch_w)
133   AM_RANGE(0x04a00a, 0x04a00b) AM_READ(fake_4a00a_r) // ??
143134   AM_RANGE(0x04a010, 0x04a019) AM_WRITE(joe_tilemaps_xscroll_w)
144135   AM_RANGE(0x04a020, 0x04a029) AM_WRITE(joe_tilemaps_yscroll_w)
145   AM_RANGE(0x04c000, 0x04ffff) AM_WRITE(MWA16_RAM)
146   AM_RANGE(0x080000, 0x0bffff) AM_WRITE(MWA16_ROM)
136   AM_RANGE(0x04c000, 0x04ffff) AM_RAM
137   AM_RANGE(0x080000, 0x0bffff) AM_ROM
147138ADDRESS_MAP_END
148139
149140static READ8_HANDLER(fake_6_r)
r1771r1772
163154   MSM5205_data_w(0, data>>4);
164155}
165156
166static ADDRESS_MAP_START( sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
167   AM_RANGE(0x0000, 0x5fff) AM_READ(MRA8_ROM)
168   AM_RANGE(0x6000, 0x7fff) AM_READ(MRA8_RAM)
169   AM_RANGE(0x8000, 0xffff) AM_READ(MRA8_BANK4)
157static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
158   AM_RANGE(0x0000, 0x5fff) AM_ROM
159   AM_RANGE(0x6000, 0x7fff) AM_RAM
160   AM_RANGE(0x8000, 0xffff) AM_ROMBANK(4)
170161ADDRESS_MAP_END
171162
172static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
173   AM_RANGE(0x0000, 0x5fff) AM_WRITE(MWA8_ROM)
174   AM_RANGE(0x6000, 0x7fff) AM_WRITE(MWA8_RAM)
175   AM_RANGE(0x8000, 0xffff) AM_WRITE(MWA8_ROM)
176ADDRESS_MAP_END
177
178static ADDRESS_MAP_START( sound_readport, ADDRESS_SPACE_IO, 8 )
163static ADDRESS_MAP_START( sound_portmap, ADDRESS_SPACE_IO, 8 )
179164   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
180   AM_RANGE(0x00, 0x00) AM_READ(YM2203_status_port_0_r)
181   AM_RANGE(0x01, 0x01) AM_READ(YM2203_read_port_0_r)
165   AM_RANGE(0x00, 0x00) AM_READWRITE(YM2203_status_port_0_r, YM2203_control_port_0_w)
166   AM_RANGE(0x01, 0x01) AM_READWRITE(YM2203_read_port_0_r, YM2203_write_port_0_w)
167   AM_RANGE(0x02, 0x02) AM_WRITE(adpcm_data_w)
182168   AM_RANGE(0x04, 0x04) AM_READ(soundlatch_r) //PC: 15D -> cp $7f
183169   AM_RANGE(0x06, 0x06) AM_READ(fake_6_r/*soundlatch_r */) //PC: 14A -> and $1
184170ADDRESS_MAP_END
185171
186static ADDRESS_MAP_START( sound_writeport, ADDRESS_SPACE_IO, 8 )
187   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
188   AM_RANGE(0x00, 0x00) AM_WRITE(YM2203_control_port_0_w)
189   AM_RANGE(0x01, 0x01) AM_WRITE(YM2203_write_port_0_w)
190   AM_RANGE(0x02, 0x02) AM_WRITE(adpcm_data_w)
191ADDRESS_MAP_END
192
193172static INPUT_PORTS_START( ashnojoe )
194173   PORT_START_TAG("IN0")   /* player 1 16-bit */
195174   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(1)
r1771r1772
355334
356335   /* basic machine hardware */
357336   MDRV_CPU_ADD(M68000, 8000000) /* 8 MHz (verified on pcb) */
358   MDRV_CPU_PROGRAM_MAP(ashnojoe_readmem,ashnojoe_writemem)
337   MDRV_CPU_PROGRAM_MAP(ashnojoe_map,0)
359338   MDRV_CPU_VBLANK_INT(irq1_line_hold,1)
360339
361340   MDRV_CPU_ADD(Z80, 4000000) /* 4 MHz (verified on pcb) */
362   /* audio CPU */
363   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
364   MDRV_CPU_IO_MAP(sound_readport,sound_writeport)
341   MDRV_CPU_PROGRAM_MAP(sound_map,0)
342   MDRV_CPU_IO_MAP(sound_portmap,0)
365343
366344   /* video hardware */
367345   MDRV_SCREEN_ADD("main", RASTER)
src/mame/drivers/vertigo.c
r1771r1772
122122   MDRV_SCREEN_SIZE(400, 300)
123123   MDRV_SCREEN_VISIBLE_AREA(0, 510, 0, 400)
124124
125   MDRV_PALETTE_LENGTH(32768)
126
127125   MDRV_VIDEO_START(vector)
128126   MDRV_VIDEO_UPDATE(vector)
129127MACHINE_DRIVER_END
src/mame/drivers/gaiden.c
r1771r1772
914914};
915915
916916static GFXDECODE_START( gaiden )
917   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout,        256, 4096 - 256 )   /* tiles 8x8  */
918   GFXDECODE_ENTRY( REGION_GFX2, 0, tile2layout,       768, 4096 - 768 )   /* tiles 16x16 */
919   GFXDECODE_ENTRY( REGION_GFX3, 0, tile2layout,       512, 4096 - 512 )   /* tiles 16x16 */
920   GFXDECODE_ENTRY( REGION_GFX4, 0, spritelayout,        0, 4096 -   0 )   /* sprites 8x8 */
917   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout,        0x100, 16 )   /* tiles 8x8  */
918   GFXDECODE_ENTRY( REGION_GFX2, 0, tile2layout,       0x300, 16 )   /* tiles 16x16 */
919   GFXDECODE_ENTRY( REGION_GFX3, 0, tile2layout,       0x200, 16 )   /* tiles 16x16 */
920   GFXDECODE_ENTRY( REGION_GFX4, 0, spritelayout,      0x000, 16 )   /* sprites 8x8 */
921921GFXDECODE_END
922922
923static GFXDECODE_START( raiga )
924   GFXDECODE_ENTRY( REGION_GFX1, 0, tilelayout,        0x100, 16 )   /* tiles 8x8  */
925   GFXDECODE_ENTRY( REGION_GFX2, 0, tile2layout,       0x300, 16 )   /* tiles 16x16 */
926   GFXDECODE_ENTRY( REGION_GFX3, 0, tile2layout,       0x200, 16 + 128 ) /* tiles 16x16 (only colors 0x00-x0f and 0x80-0x8f are used) */
927   GFXDECODE_ENTRY( REGION_GFX4, 0, spritelayout,      0x000, 16 + 128 ) /* sprites 8x8 (only colors 0x00-x0f and 0x80-0x8f are used) */
928GFXDECODE_END
929
923930static const gfx_layout drgnbowl_tile2layout =
924931{
925932   16,16,
r1771r1772
10171024
10181025   MDRV_VIDEO_START(raiga)
10191026   MDRV_VIDEO_UPDATE(raiga)
1027   MDRV_GFXDECODE(raiga)
10201028MACHINE_DRIVER_END
10211029
10221030static MACHINE_DRIVER_START( drgnbowl )
src/mame/drivers/zaxxon.c
r1771r1772
718718
719719static INPUT_PORTS_START( razmataz )
720720   PORT_START_TAG("SW00")
721   PORT_BIT( 0xff, 0x00, IPT_SPECIAL) PORT_CUSTOM(razmataz_dial_r, 0)
721   PORT_BIT( 0xff, 0x00, IPT_SPECIAL) PORT_CUSTOM(razmataz_dial_r, (void *)0)
722722
723723   PORT_START_TAG("DIAL0")
724724   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(30) PORT_KEYDELTA(15) PORT_RESET PORT_PLAYER(1)
r1771r1772
733733   PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED )
734734
735735   PORT_START_TAG("SW08")
736   PORT_BIT( 0xff, 0x00, IPT_SPECIAL) PORT_CUSTOM(razmataz_dial_r, 1)
736   PORT_BIT( 0xff, 0x00, IPT_SPECIAL) PORT_CUSTOM(razmataz_dial_r, (void *)1)
737737
738738   PORT_START_TAG("DIAL1")
739739   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(30) PORT_KEYDELTA(15) PORT_RESET PORT_PLAYER(2)
src/mame/drivers/xtheball.c
r1771r1772
359359   MDRV_CPU_ADD(TMS34010, 40000000)
360360   MDRV_CPU_CONFIG(tms_config)
361361   MDRV_CPU_PROGRAM_MAP(main_map,0)
362   MDRV_CPU_PERIODIC_INT(irq1_line_pulse,15000)
362   MDRV_CPU_PERIODIC_INT(irq1_line_hold,15000)
363363
364364   MDRV_MACHINE_RESET(xtheball)
365365   MDRV_NVRAM_HANDLER(generic_1fill)
src/mame/drivers/galpanic.c
r1771r1772
965965   MDRV_IMPORT_FROM(galpanic)
966966
967967   /* arm watchdog */
968   MDRV_WATCHDOG_TIME_INIT(ATTOTIME_IN_SEC(3))   /* a guess, and certainly wrong */
968   MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_SEC(3))   /* a guess, and certainly wrong */
969969MACHINE_DRIVER_END
970970
971971static MACHINE_DRIVER_START( comad )
src/mame/drivers/cclimber.c
r1771r1772
123123TODO:
124124        * Verify timings of sound/music on Swimmer.
125125
126
127-------------------------------------------------------------------
128
129    T.S. 17.12.2005:
130
131    Yamato:
132    -------
133     Added temporary bg gradient (bad colors/offset).
134
135     Gradient table are stored in two(?) ROMs.
136     Each table is 256 bytes long: 128 for normal
137     and 128 bytes for flipped screen.
138     Color format is unknown - probably direct RGB
139     mapping of 8 or 16 (both roms) bits. Also table
140     selection source is unknown.
141
142     TODO:
143      - bg gradient color decode & table selection
144
145
146 Top Roller:
147 ----------
148     It's made by the same developers as Yamato and use
149     probably the same encrypted SEGA cpu as Yamato.
150
151     lives - $6155
152
153     TODO:
154
155       - COINB DSW is missing
156       - few issues in cocktail mode
157       - wrong colors (fg text layer) - game sometimes ("round" text , lives) updates only even columns of cell attribs...
158
159-------------------------------------------------------------------
160
161
162 Top Roller
163 Jaleco
164
165 Hardware : Original Jaleco board no 8307-B/8307-A(redump)
166
167 Main CPU : Encrypted Z80 (probably 315-5018)
168 Sound : AY-3-8910
169
170 ROMS CRC32 + positions :
171
172 [9894374d]  d5
173 [ef789f00]  f5
174 [d45494ba]  h5
175 [1cb48ea0]  k5
176 [84139f46]  l5
177 [e30c1dd8]  m5
178 [904fffb6]  d3
179 [94371cfb]  f3
180 [8a8032a7]  h3
181 [1e8914a6]  k3
182 [b20a9fa2]  l3
183 [7f989dc9]  p3
184 [89327329]  a4 bottom board 89327329
185 [7a945733]  c4 bottom board
186 [5f2c2a78]  h4 bottom board  bad dump / [1d9e3325] (8307-A)
187 [ce3afe26]  j4 bottom board
188
126189***************************************************************************/
127190
128191#include "driver.h"
129192#include "deprecat.h"
193#include "machine/segacrpt.h"
130194#include "sound/ay8910.h"
131195#include "sound/samples.h"
132196#include "includes/cclimber.h"
r1771r1772
134198
135199#define MASTER_CLOCK         XTAL_18_432MHz
136200
201static UINT8 yamato_p0;
202static UINT8 yamato_p1;
203static UINT8 toprollr_rombank;
137204
138205
139static WRITE8_HANDLER( cannonb_flip_screen_w )
206static WRITE8_HANDLER( swimmer_sh_soundlatch_w )
140207{
141   flip_screen_set(data);
208   soundlatch_w(offset,data);
209   cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff);
142210}
143211
144212
145static WRITE8_HANDLER( flip_screen_x_w )
213static WRITE8_HANDLER( yamato_p0_w )
146214{
147   flip_screen_x_set(data);
215   yamato_p0 = data;
148216}
149217
150static WRITE8_HANDLER( flip_screen_y_w )
218static WRITE8_HANDLER( yamato_p1_w )
151219{
152   flip_screen_y_set(data);
220   yamato_p1 = data;
153221}
154222
223static READ8_HANDLER( yamato_p0_r )
224{
225   return yamato_p0;
226}
155227
156static WRITE8_HANDLER( swimmer_sh_soundlatch_w )
228static READ8_HANDLER( yamato_p1_r )
157229{
158   soundlatch_w(offset,data);
159   cpunum_set_input_line_and_vector(Machine, 1,0,HOLD_LINE,0xff);
230   return yamato_p1;
160231}
161232
162233
234static WRITE8_HANDLER(toprollr_rombank_w)
235{
236   toprollr_rombank &= ~(1 << offset);
237   toprollr_rombank |= (data & 1) << offset;
238
239   if (toprollr_rombank < 3)
240      memory_set_bank(1, toprollr_rombank);
241}
242
243
163244static TIMER_CALLBACK( disable_interrupts )
164245{
165246   cpu_interrupt_enable(0,0);
r1771r1772
173254   /* we must do this on a timer in order to have it take effect */
174255   /* otherwise, the reset process will override our changes */
175256   timer_call_after_resynch(NULL, 0, disable_interrupts);
257
258   toprollr_rombank = 0;
176259}
177260
178261
r1771r1772
184267   AM_RANGE(0x0000, 0x5fff) AM_ROM
185268   AM_RANGE(0x6000, 0x6bff) AM_RAM            /* Crazy Kong only */
186269   AM_RANGE(0x8000, 0x83ff) AM_RAM
187   AM_RANGE(0x8800, 0x88ff) AM_RAM AM_BASE(&cclimber_bsvideoram) AM_SIZE(&cclimber_bsvideoram_size)
270   AM_RANGE(0x8800, 0x88ff) AM_RAM AM_BASE(&cclimber_bigsprite_videoram)
188271   AM_RANGE(0x8900, 0x8bff) AM_RAM            /* not used, but initialized */
189   AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x0400) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size)
272   AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x0400) AM_RAM AM_BASE(&cclimber_videoram)
190273   /* 9800-9bff and 9c00-9fff share the same RAM, interleaved */
191274   /* (9800-981f for scroll, 9c20-9c3f for color RAM, and so on) */
192275   AM_RANGE(0x9800, 0x981f) AM_RAM AM_BASE(&cclimber_column_scroll)
193   AM_RANGE(0x9880, 0x989f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
194   AM_RANGE(0x98dc, 0x98df) AM_RAM AM_BASE(&cclimber_bigspriteram)
276   AM_RANGE(0x9880, 0x989f) AM_RAM AM_BASE(&cclimber_spriteram)
277   AM_RANGE(0x98dc, 0x98df) AM_RAM AM_BASE(&cclimber_bigsprite_control)
195278   AM_RANGE(0x9800, 0x9bff) AM_RAM  /* not used, but initialized */
196   AM_RANGE(0x9c00, 0x9fff) AM_READWRITE(MRA8_RAM, cclimber_colorram_w) AM_BASE(&colorram)
197   AM_RANGE(0xa000, 0xa000) AM_READWRITE(input_port_0_r, interrupt_enable_w)     /* IN0 */
198   AM_RANGE(0xa001, 0xa001) AM_WRITE(flip_screen_x_w)
199   AM_RANGE(0xa002, 0xa002) AM_WRITE(flip_screen_y_w)
279   AM_RANGE(0x9c00, 0x9fff) AM_READWRITE(MRA8_RAM, cclimber_colorram_w) AM_BASE(&cclimber_colorram)
280   AM_RANGE(0xa000, 0xa000) AM_READWRITE(input_port_0_r, interrupt_enable_w)
281   AM_RANGE(0xa001, 0xa002) AM_WRITE(MWA8_RAM) AM_BASE(&cclimber_flip_screen)
200282   AM_RANGE(0xa003, 0xa003) AM_WRITE(interrupt_enable_w) //used by Crazy Kong Bootleg with alt levels and speed up
201283   AM_RANGE(0xa004, 0xa004) AM_WRITE(cclimber_sample_trigger_w)
202   AM_RANGE(0xa800, 0xa800) AM_READWRITE(input_port_1_r, cclimber_sample_rate_w)     /* IN1 */
203   AM_RANGE(0xb000, 0xb000) AM_READWRITE(input_port_2_r, cclimber_sample_volume_w)     /* DSW */
204   AM_RANGE(0xb800, 0xb800) AM_READ(input_port_3_r)     /* IN2 */
284   AM_RANGE(0xa800, 0xa800) AM_READWRITE(input_port_1_r, cclimber_sample_rate_w)
285   AM_RANGE(0xb000, 0xb000) AM_READWRITE(input_port_2_r, cclimber_sample_volume_w)
286   AM_RANGE(0xb800, 0xb800) AM_READ(input_port_3_r)
205287ADDRESS_MAP_END
206288
207
208289static ADDRESS_MAP_START( cannonb_map, ADDRESS_SPACE_PROGRAM, 8 )
209290   AM_RANGE(0x5045, 0x505f) AM_WRITENOP      /* do not errorlog this */
210291   AM_RANGE(0x0000, 0x5fff) AM_ROM
211   AM_RANGE(0x6000, 0x6bff) AM_RAM             /* Crazy Kong only, Cannon Ball also */
292   AM_RANGE(0x6000, 0x6bff) AM_RAM
212293   AM_RANGE(0x8000, 0x83ff) AM_RAM
213   AM_RANGE(0x8800, 0x8800) AM_READNOP          /* must not return what's written (game will reset after coin insert if it returns 0xff)*/
214   AM_RANGE(0x8800, 0x88ff) AM_RAM AM_BASE(&cclimber_bsvideoram) AM_SIZE(&cclimber_bsvideoram_size)
294   AM_RANGE(0x8800, 0x88ff) AM_READWRITE(MRA8_NOP, MWA8_RAM) AM_BASE(&cclimber_bigsprite_videoram) /* must not return what's written (game will reset after coin insert if it returns 0xff)*/
215295//AM_RANGE(0x8900, 0x8bff) AM_WRITE(MWA8_RAM)  /* not used, but initialized */
216   AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x0400) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size)
296   AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x0400) AM_RAM AM_BASE(&cclimber_videoram)
217297   /* 9800-9bff and 9c00-9fff share the same RAM, interleaved */
218298   /* (9800-981f for scroll, 9c20-9c3f for color RAM, and so on) */
219299   AM_RANGE(0x9800, 0x981f) AM_RAM AM_BASE(&cclimber_column_scroll)
220   AM_RANGE(0x9880, 0x989f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
221   AM_RANGE(0x98dc, 0x98df) AM_RAM AM_BASE(&cclimber_bigspriteram)
300   AM_RANGE(0x9880, 0x989f) AM_RAM AM_BASE(&cclimber_spriteram)
301   AM_RANGE(0x98dc, 0x98df) AM_RAM AM_BASE(&cclimber_bigsprite_control)
222302   AM_RANGE(0x9800, 0x9bff) AM_RAM  /* not used, but initialized */
223   AM_RANGE(0x9c00, 0x9fff) AM_READWRITE(MRA8_RAM, cclimber_colorram_w) AM_BASE(&colorram)
303   AM_RANGE(0x9c00, 0x9fff) AM_READWRITE(MRA8_RAM, cclimber_colorram_w) AM_BASE(&cclimber_colorram)
224304   AM_RANGE(0xa000, 0xa000) AM_READWRITE(input_port_0_r, interrupt_enable_w)
225   AM_RANGE(0xa001, 0xa001) AM_WRITE(cannonb_flip_screen_w)
305   AM_RANGE(0xa001, 0xa002) AM_WRITE(cannonb_flip_screen_w) AM_BASE(&cclimber_flip_screen)
226306   AM_RANGE(0xa004, 0xa004) AM_WRITE(cclimber_sample_trigger_w)
227307   AM_RANGE(0xa800, 0xa800) AM_READWRITE(input_port_1_r, cclimber_sample_rate_w)
228308   AM_RANGE(0xb000, 0xb000) AM_READWRITE(input_port_2_r, cclimber_sample_volume_w)
229   AM_RANGE(0xb800, 0xb800) AM_READ(input_port_3_r)     /* IN2 */
309   AM_RANGE(0xb800, 0xb800) AM_READ(input_port_3_r)
230310ADDRESS_MAP_END
231311
232
233312static ADDRESS_MAP_START( swimmer_map, ADDRESS_SPACE_PROGRAM, 8 )
234313   AM_RANGE(0x0000, 0x7fff) AM_ROM
235314   AM_RANGE(0x8000, 0x87ff) AM_RAM
236   AM_RANGE(0x8800, 0x88ff) AM_MIRROR(0x0100) AM_RAM AM_BASE(&cclimber_bsvideoram) AM_SIZE(&cclimber_bsvideoram_size)
237   AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x0400) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size)
315   AM_RANGE(0x8800, 0x88ff) AM_MIRROR(0x0100) AM_RAM AM_BASE(&cclimber_bigsprite_videoram)
316   AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x0400) AM_RAM AM_BASE(&cclimber_videoram)
238317   AM_RANGE(0x9800, 0x981f) AM_WRITE(MWA8_RAM) AM_BASE(&cclimber_column_scroll)
239   AM_RANGE(0x9880, 0x989f) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
240   AM_RANGE(0x98fc, 0x98ff) AM_WRITE(MWA8_RAM) AM_BASE(&cclimber_bigspriteram)
241   AM_RANGE(0x9c00, 0x9fff) AM_READWRITE(MRA8_RAM, cclimber_colorram_w) AM_BASE(&colorram)
318   AM_RANGE(0x9880, 0x989f) AM_WRITE(MWA8_RAM) AM_BASE(&cclimber_spriteram)
319   AM_RANGE(0x98fc, 0x98ff) AM_WRITE(MWA8_RAM) AM_BASE(&cclimber_bigsprite_control)
320   AM_RANGE(0x9c00, 0x9fff) AM_READWRITE(MRA8_RAM, cclimber_colorram_w) AM_BASE(&cclimber_colorram)
242321   AM_RANGE(0xa000, 0xa000) AM_READWRITE(input_port_0_r, interrupt_enable_w)
243   AM_RANGE(0xa001, 0xa001) AM_WRITE(flip_screen_x_w)
244   AM_RANGE(0xa002, 0xa002) AM_WRITE(flip_screen_y_w)
245   AM_RANGE(0xa003, 0xa003) AM_WRITE(MWA8_RAM) AM_BASE(&swimmer_sidepanel_enabled)
322   AM_RANGE(0xa001, 0xa002) AM_WRITE(MWA8_RAM) AM_BASE(&cclimber_flip_screen)
323   AM_RANGE(0xa003, 0xa003) AM_WRITE(MWA8_RAM) AM_BASE(&swimmer_side_background_enabled)
246324   AM_RANGE(0xa004, 0xa004) AM_WRITE(MWA8_RAM) AM_BASE(&swimmer_palettebank)
247325   AM_RANGE(0xa800, 0xa800) AM_READWRITE(input_port_1_r, swimmer_sh_soundlatch_w)
248326   AM_RANGE(0xb000, 0xb000) AM_READ(input_port_2_r)
249   AM_RANGE(0xb800, 0xb800) AM_READWRITE(input_port_3_r, MWA8_RAM) AM_BASE(&swimmer_bgcolor)
327   AM_RANGE(0xb800, 0xb800) AM_READWRITE(input_port_3_r, MWA8_RAM) AM_BASE(&swimmer_background_color)
250328   AM_RANGE(0xb880, 0xb880) AM_READ(input_port_4_r)
251329   AM_RANGE(0xc000, 0xc7ff) AM_RAM               /* ??? used by Guzzler */
252330   AM_RANGE(0xe000, 0xffff) AM_ROM               /* Guzzler only */
253331ADDRESS_MAP_END
254332
333static ADDRESS_MAP_START( yamato_map, ADDRESS_SPACE_PROGRAM, 8 )
334   AM_RANGE(0x0000, 0x5fff) AM_ROM
335   AM_RANGE(0x6000, 0x6fff) AM_RAM
336   AM_RANGE(0x7000, 0x7fff) AM_ROM
337   AM_RANGE(0x8800, 0x88ff) AM_RAM AM_BASE(&cclimber_bigsprite_videoram)
338   AM_RANGE(0x8900, 0x8bff) AM_RAM            /* not used, but initialized */
339   AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x0400) AM_RAM AM_BASE(&cclimber_videoram)
340   /* 9800-9bff and 9c00-9fff share the same RAM, interleaved */
341   /* (9800-981f for scroll, 9c20-9c3f for color RAM, and so on) */
342   AM_RANGE(0x9800, 0x981f) AM_RAM AM_BASE(&cclimber_column_scroll)
343   AM_RANGE(0x9880, 0x989f) AM_RAM AM_BASE(&cclimber_spriteram)
344   AM_RANGE(0x98dc, 0x98df) AM_RAM AM_BASE(&cclimber_bigsprite_control)
345   AM_RANGE(0x9800, 0x9bff) AM_RAM  /* not used, but initialized */
346   AM_RANGE(0x9c00, 0x9fff) AM_READWRITE(MRA8_RAM, cclimber_colorram_w) AM_BASE(&cclimber_colorram)
347   AM_RANGE(0xa000, 0xa000) AM_READWRITE(input_port_0_r, interrupt_enable_w)
348   AM_RANGE(0xa001, 0xa002) AM_WRITE(MWA8_RAM) AM_BASE(&cclimber_flip_screen)
349   AM_RANGE(0xa800, 0xa800) AM_READ(input_port_1_r)
350   AM_RANGE(0xb000, 0xb000) AM_READ(input_port_2_r)
351   AM_RANGE(0xb800, 0xb800) AM_READ(input_port_3_r)
352   AM_RANGE(0xba00, 0xba00) AM_READ(input_port_4_r)     /* IN3 (maybe a mirror of b800) */
353ADDRESS_MAP_END
255354
355static ADDRESS_MAP_START( toprollr_map, ADDRESS_SPACE_PROGRAM, 8 )
356   AM_RANGE(0x0000, 0x5fff) AM_READ(MRA8_BANK1)
357   AM_RANGE(0x6000, 0x6bff) AM_RAM
358   AM_RANGE(0x8800, 0x88ff) AM_RAM AM_BASE(&cclimber_bigsprite_videoram)
359   AM_RANGE(0x8c00, 0x8fff) AM_RAM AM_BASE(&toprollr_bg_videoram)
360   AM_RANGE(0x9000, 0x93ff) AM_RAM AM_BASE(&cclimber_videoram)
361   AM_RANGE(0x9400, 0x97ff) AM_RAM AM_BASE(&toprollr_bg_coloram)
362   AM_RANGE(0x9800, 0x987f) AM_RAM /* unused ? */
363   AM_RANGE(0x9880, 0x995f) AM_RAM AM_BASE(&cclimber_spriteram)
364   AM_RANGE(0x99dc, 0x99df) AM_RAM AM_BASE(&cclimber_bigsprite_control)
365   AM_RANGE(0x9c00, 0x9fff) AM_RAM AM_BASE(&cclimber_colorram)
366   AM_RANGE(0xa000, 0xa000) AM_WRITE(interrupt_enable_w) AM_READ(input_port_0_r)
367   AM_RANGE(0xa001, 0xa002) AM_WRITE(MWA8_RAM) AM_BASE(&cclimber_flip_screen)
368   AM_RANGE(0xa004, 0xa004) AM_WRITE(cclimber_sample_trigger_w)
369   AM_RANGE(0xa005, 0xa006) AM_WRITE(toprollr_rombank_w)
370   AM_RANGE(0xa800, 0xa800) AM_READWRITE(input_port_1_r, cclimber_sample_rate_w)
371   AM_RANGE(0xb000, 0xb000) AM_READWRITE(input_port_2_r, cclimber_sample_volume_w)
372   AM_RANGE(0xb800, 0xb800) AM_READ(input_port_3_r)
373   AM_RANGE(0xc000, 0xffff) AM_ROM
374ADDRESS_MAP_END
375
376
256377static ADDRESS_MAP_START( cclimber_portmap, ADDRESS_SPACE_IO, 8 )
257378   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
258379   AM_RANGE(0x08, 0x08) AM_WRITE(AY8910_control_port_0_w)
r1771r1772
260381   AM_RANGE(0x0c, 0x0c) AM_READ(AY8910_read_port_0_r)
261382ADDRESS_MAP_END
262383
384static ADDRESS_MAP_START( yamato_portmap, ADDRESS_SPACE_IO, 8 )
385   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
386   AM_RANGE(0x00, 0x00) AM_WRITE(yamato_p0_w)   /* ??? */
387   AM_RANGE(0x01, 0x01) AM_WRITE(yamato_p1_w)   /* ??? */
388ADDRESS_MAP_END
263389
264static ADDRESS_MAP_START( swimmer_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
390
391static ADDRESS_MAP_START( swimmer_audio_map, ADDRESS_SPACE_PROGRAM, 8 )
265392   AM_RANGE(0x0000, 0x0fff) AM_ROM
266393   AM_RANGE(0x2000, 0x23ff) AM_RAM
267394   AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_r)
268395   AM_RANGE(0x4000, 0x4001) AM_RAM            /* ??? */
269396ADDRESS_MAP_END
270397
271static ADDRESS_MAP_START( swimmer_sound_portmap, ADDRESS_SPACE_IO, 8 )
398static ADDRESS_MAP_START( yamato_audio_map, ADDRESS_SPACE_PROGRAM, 8 )
399   AM_RANGE(0x0000, 0x07ff) AM_ROM
400   AM_RANGE(0x5000, 0x53ff) AM_RAM
401ADDRESS_MAP_END
402
403
404static ADDRESS_MAP_START( swimmer_audio_portmap, ADDRESS_SPACE_IO, 8 )
272405   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
273406   AM_RANGE(0x00, 0x00) AM_WRITE(AY8910_write_port_0_w)
274407   AM_RANGE(0x01, 0x01) AM_WRITE(AY8910_control_port_0_w)
r1771r1772
276409   AM_RANGE(0x81, 0x81) AM_WRITE(AY8910_control_port_1_w)
277410ADDRESS_MAP_END
278411
412static ADDRESS_MAP_START( yamato_audio_portmap, ADDRESS_SPACE_IO, 8 )
413   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
414   AM_RANGE(0x00, 0x00) AM_WRITE(AY8910_control_port_0_w)
415   AM_RANGE(0x01, 0x01) AM_WRITE(AY8910_write_port_0_w)
416   AM_RANGE(0x02, 0x02) AM_WRITE(AY8910_control_port_1_w)
417   AM_RANGE(0x03, 0x03) AM_WRITE(AY8910_write_port_1_w)
418   AM_RANGE(0x04, 0x04) AM_READ(yamato_p0_r)   /* ??? */
419   AM_RANGE(0x08, 0x08) AM_READ(yamato_p1_r)   /* ??? */
420ADDRESS_MAP_END
279421
280422
423
281424#define CCIN0\
282425   PORT_START_TAG("IN0")\
283426   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_UP ) PORT_8WAY\
r1771r1772
705848   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
706849INPUT_PORTS_END
707850
851static INPUT_PORTS_START( yamato )
852   PORT_START
853   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
854   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
855   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 )
856   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2 )
857   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
858   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
859   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
860   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
708861
862   PORT_START
863   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
864   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
865   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
866   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL
867   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
868   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
869   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
870   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
709871
710static const gfx_layout charlayout =
872   PORT_START
873   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
874   PORT_DIPSETTING(    0x00, "3" )
875   PORT_DIPSETTING(    0x01, "4" )
876   PORT_DIPSETTING(    0x02, "5" )
877   PORT_DIPSETTING(    0x03, "6" )
878   PORT_DIPNAME( 0x1c, 0x00, DEF_STR( Coin_A ) )
879   PORT_DIPSETTING(    0x0c, DEF_STR( 4C_1C ) )
880   PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )
881   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
882   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
883   PORT_DIPSETTING(    0x18, DEF_STR( 2C_3C ) )
884   PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) )
885   PORT_DIPSETTING(    0x14, DEF_STR( 1C_3C ) )
886   PORT_DIPSETTING(    0x1c, DEF_STR( Free_Play ) )
887   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Bonus_Life ) )
888   PORT_DIPSETTING(    0x00, "Every 30000" )
889   PORT_DIPSETTING(    0x20, "Every 50000" )
890   PORT_DIPNAME( 0x40, 0x00, "Speed" )
891   PORT_DIPSETTING(    0x00, "Slow" )
892   PORT_DIPSETTING(    0x40, "Fast" )
893   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) )
894   PORT_DIPSETTING(    0x80, DEF_STR( Upright ) )
895   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
896
897   PORT_START
898   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN2 )   /* set 1 only */
899   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 )
900   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
901   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
902   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN3 )   /* set 1 only */
903   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
904   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
905   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
906
907   PORT_START      /* IN3 */
908   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
909   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
910   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
911   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START2 )
912   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
913   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
914   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
915   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
916INPUT_PORTS_END
917
918static INPUT_PORTS_START( toprollr )
919   PORT_START
920   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 )
921   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
922   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
923   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
924   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
925
926   PORT_START
927   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
928   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
929   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
930   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
931   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
932
933   PORT_START
934   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
935   PORT_DIPSETTING(    0x00, "3" )
936   PORT_DIPSETTING(    0x01, "4" )
937   PORT_DIPSETTING(    0x02, "5" )
938   PORT_DIPSETTING(    0x03, "6" )
939   PORT_DIPNAME( 0x1c, 0x00, DEF_STR( Coin_A ) )
940   PORT_DIPSETTING(    0x0c, DEF_STR( 4C_1C ) )
941   PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )
942   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
943   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
944   PORT_DIPSETTING(    0x18, DEF_STR( 2C_3C ) )
945   PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) )
946   PORT_DIPSETTING(    0x14, DEF_STR( 1C_3C ) )
947   PORT_DIPSETTING(    0x1c, DEF_STR( Free_Play ) )
948   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Bonus_Life ) )
949   PORT_DIPSETTING(    0x00, "Every 30000" )
950   PORT_DIPSETTING(    0x20, "Every 50000" )
951   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Difficulty ) )
952   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
953   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
954   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) )
955   PORT_DIPSETTING(    0x80, DEF_STR( Upright ) )
956   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
957
958   PORT_START
959   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN2 )
960   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 )
961   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
962   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 )
963   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN3 )
964INPUT_PORTS_END
965
966
967
968static const gfx_layout cclimber_charlayout =
711969{
712   8,8,    /* 8*8 characters */
713   512,    /* 512 characters (256 in Crazy Climber) */
714   2,      /* 2 bits per pixel */
715   { 0, 512*8*8 }, /* the two bitplanes are separated */
716   { 0, 1, 2, 3, 4, 5, 6, 7 },     /* pretty straightforward layout */
970   8,8,
971   RGN_FRAC(1,2),
972   2,
973   { 0, RGN_FRAC(1,2) },
974   { 0, 1, 2, 3, 4, 5, 6, 7 },
717975   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
718   8*8     /* every char takes 8 consecutive bytes */
976   8*8
719977};
720static const gfx_layout bscharlayout =
978
979static const gfx_layout cclimber_spritelayout =
721980{
722   8,8,    /* 8*8 characters */
723   256,    /* 256 characters */
724   2,      /* 2 bits per pixel */
725   { 0, 256*8*8 }, /* the bitplanes are separated */
726   { 0, 1, 2, 3, 4, 5, 6, 7 },     /* pretty straightforward layout */
981   16,16,
982   RGN_FRAC(1,2),
983   2,
984   { 0, RGN_FRAC(1,2) },
985   { 0, 1, 2, 3, 4, 5, 6, 7,
986         8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 },
987   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
988         16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 },
989   32*8
990};
991
992static const gfx_layout cannonb_charlayout =
993{
994   8,8,
995   512,
996   2,
997   { 0, 1024*8*8 },
998   { 0, 1, 2, 3, 4, 5, 6, 7 },
727999   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
728   8*8     /* every char takes 8 consecutive bytes */
1000   8*8
7291001};
730static const gfx_layout spritelayout =
1002
1003static const gfx_layout cannonb_spritelayout =
7311004{
732   16,16,  /* 16*16 sprites */
733   128,    /* 128 sprites (64 in Crazy Climber) */
734   2,      /* 2 bits per pixel */
735   { 0, 128*16*16 },       /* the bitplanes are separated */
736   { 0, 1, 2, 3, 4, 5, 6, 7,       /* pretty straightforward layout */
1005   16,16,
1006   64,
1007   2,
1008   { 0, 256*16*16 },
1009   { 0, 1, 2, 3, 4, 5, 6, 7,
7371010         8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 },
7381011   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
7391012         16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 },
740   32*8    /* every sprite takes 32 consecutive bytes */
1013   32*8
7411014};
7421015
7431016static const gfx_layout swimmer_charlayout =
7441017{
745   8,8,    /* 8*8 characters */
746   512,    /* 512 characters */
747   3,      /* 3 bits per pixel */
748   { 0, 512*8*8, 512*2*8*8 },      /* the bitplanes are separated */
1018   8,8,
1019   RGN_FRAC(1,3),
1020   3,
1021   { 0, RGN_FRAC(1,3), RGN_FRAC(2,3) },
7491022   { 0, 1, 2, 3, 4, 5, 6, 7 },        /* characters are upside down */
7501023   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
7511024   8*8     /* every char takes 8 consecutive bytes */
r1771r1772
7531026
7541027static const gfx_layout swimmer_spritelayout =
7551028{
756   16,16,  /* 16*16 sprites */
757   128,    /* 128 sprites */
758   3,         /* 3 bits per pixel */
759   { 0, 128*16*16, 128*2*16*16 },  /* the bitplanes are separated */
760   { 0, 1, 2, 3, 4, 5, 6, 7,       /* pretty straightforward layout */
1029   16,16,
1030   RGN_FRAC(1,3),
1031   3,
1032   { 0, RGN_FRAC(1,3), RGN_FRAC(2,3) },
1033   { 0, 1, 2, 3, 4, 5, 6, 7,
7611034         8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 },
7621035   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
7631036         16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 },
764   32*8    /* every sprite takes 32 consecutive bytes */
1037   32*8
7651038};
7661039
7671040static GFXDECODE_START( cclimber )
768   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,      0, 16 ) /* char set #1 */
769   GFXDECODE_ENTRY( REGION_GFX1, 0x2000, charlayout,      0, 16 ) /* char set #2 */
770   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, bscharlayout, 16*4,  8 ) /* big sprite char set */
771   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, spritelayout,    0, 16 ) /* sprite set #1 */
772   GFXDECODE_ENTRY( REGION_GFX1, 0x2000, spritelayout,    0, 16 ) /* sprite set #2 */
1041   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, cclimber_charlayout,      0, 16 ) /* characters */
1042   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, cclimber_spritelayout,    0, 16 ) /* sprites */
1043   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, cclimber_charlayout,   16*4,  8 ) /* big sprites */
7731044GFXDECODE_END
7741045
1046static GFXDECODE_START( cannonb )
1047   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, cannonb_charlayout,       0, 16 ) /* characters */
1048   GFXDECODE_ENTRY( REGION_GFX1, 0x1000, cannonb_spritelayout,     0, 16 ) /* sprites */
1049   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, cclimber_charlayout,   16*4,  8 ) /* big sprites */
1050GFXDECODE_END
1051
7751052static GFXDECODE_START( swimmer )
776   GFXDECODE_ENTRY( REGION_GFX1, 0, swimmer_charlayout,      0, 64 ) /* characters */
777   GFXDECODE_ENTRY( REGION_GFX1, 0, swimmer_spritelayout,    0, 32 ) /* sprite set #1 */
778   GFXDECODE_ENTRY( REGION_GFX2, 0, swimmer_charlayout,   64*8, 4 )  /* big sprite set */
1053   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, swimmer_charlayout,       0, 32 ) /* characters */
1054   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, swimmer_spritelayout,     0, 32 ) /* sprites */
1055   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, swimmer_charlayout,    32*8,  4 ) /* big sprites */
7791056GFXDECODE_END
7801057
1058static GFXDECODE_START( toprollr )
1059   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, cclimber_charlayout,      0, 16 )
1060   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, cclimber_spritelayout,    0, 16 )
1061   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, cclimber_charlayout,   16*4,  8 ) /* big sprites */
1062   GFXDECODE_ENTRY( REGION_GFX3, 0x0000, cclimber_charlayout,   24*4, 16 )
1063GFXDECODE_END
7811064
7821065
783static MACHINE_DRIVER_START( cclimber )
7841066
1067static MACHINE_DRIVER_START( root )
1068
7851069   /* basic machine hardware */
7861070   MDRV_CPU_ADD_TAG("main", Z80, MASTER_CLOCK/3/2)   /* 3.072 MHz */
7871071   MDRV_CPU_PROGRAM_MAP(cclimber_map,0)
r1771r1772
8021086   MDRV_PALETTE_LENGTH(16*4+8*4)
8031087
8041088   MDRV_PALETTE_INIT(cclimber)
805   MDRV_VIDEO_START(generic)
1089   MDRV_VIDEO_START(cclimber)
8061090   MDRV_VIDEO_UPDATE(cclimber)
1091MACHINE_DRIVER_END
8071092
1093
1094static MACHINE_DRIVER_START( cclimber )
1095
1096   MDRV_IMPORT_FROM(root)
1097
8081098   /* sound hardware */
8091099   MDRV_SPEAKER_STANDARD_MONO("mono")
8101100
r1771r1772
8271117   MDRV_CPU_PROGRAM_MAP(cannonb_map,0)
8281118
8291119   /* video hardware */
830   MDRV_VIDEO_UPDATE(cannonb)
1120   MDRV_GFXDECODE(cannonb)
8311121MACHINE_DRIVER_END
8321122
8331123
1124static MACHINE_DRIVER_START( yamato )
1125
1126   MDRV_IMPORT_FROM(root)
1127
1128   /* basic machine hardware */
1129   MDRV_CPU_MODIFY("main")
1130   MDRV_CPU_PROGRAM_MAP(yamato_map,0)
1131   MDRV_CPU_IO_MAP(yamato_portmap,0)
1132
1133   MDRV_CPU_ADD(Z80, 3072000) /* 3.072 MHz ? */
1134   MDRV_CPU_PROGRAM_MAP(yamato_audio_map,0)
1135   MDRV_CPU_IO_MAP(yamato_audio_portmap,0)
1136
1137   /* video hardware */
1138   MDRV_PALETTE_LENGTH(16*4+8*4+256)
1139   MDRV_PALETTE_INIT(yamato)
1140   MDRV_VIDEO_UPDATE(yamato)
1141
1142   /* audio hardware */
1143   MDRV_SPEAKER_STANDARD_MONO("mono")
1144
1145   MDRV_SOUND_ADD(AY8910, 1536000)
1146   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
1147
1148   MDRV_SOUND_ADD(AY8910, 1536000)
1149   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
1150MACHINE_DRIVER_END
1151
1152
1153static MACHINE_DRIVER_START( toprollr )
1154
1155   MDRV_IMPORT_FROM(cclimber)
1156
1157   /* basic machine hardware */
1158   MDRV_CPU_MODIFY("main")
1159   MDRV_CPU_PROGRAM_MAP(toprollr_map,0)
1160
1161   /* video hardware */
1162   MDRV_GFXDECODE(toprollr)
1163   MDRV_PALETTE_LENGTH(32*5)
1164   MDRV_PALETTE_INIT(toprollr)
1165
1166   MDRV_VIDEO_START(toprollr)
1167   MDRV_VIDEO_UPDATE(toprollr)
1168MACHINE_DRIVER_END
1169
1170
8341171static MACHINE_DRIVER_START( swimmer )
8351172
8361173   /* basic machine hardware */
r1771r1772
8391176   MDRV_CPU_VBLANK_INT(nmi_line_pulse,1)
8401177
8411178   MDRV_CPU_ADD(Z80,4000000/2)
842   MDRV_CPU_PROGRAM_MAP(swimmer_sound_map,0)
843   MDRV_CPU_IO_MAP(swimmer_sound_portmap,0)
1179   MDRV_CPU_PROGRAM_MAP(swimmer_audio_map,0)
1180   MDRV_CPU_IO_MAP(swimmer_audio_portmap,0)
8441181   MDRV_CPU_PERIODIC_INT(nmi_line_pulse, (double)4000000/16384) /* IRQs are triggered by the main CPU */
8451182
8461183   /* video hardware */
r1771r1772
8521189   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
8531190
8541191   MDRV_GFXDECODE(swimmer)
855   MDRV_PALETTE_LENGTH(64*8+4*8)
1192   MDRV_PALETTE_LENGTH(32*8+4*8+1)
8561193
8571194   MDRV_PALETTE_INIT(swimmer)
858   MDRV_VIDEO_START(generic)
1195   MDRV_VIDEO_START(swimmer)
8591196   MDRV_VIDEO_UPDATE(swimmer)
8601197
861   /* sound hardware */
1198   /* audio hardware */
8621199   MDRV_SPEAKER_STANDARD_MONO("mono")
8631200   MDRV_SOUND_ADD(AY8910, 4000000/2)
8641201   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
r1771r1772
8841221
8851222   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
8861223   ROM_LOAD( "cc06",         0x0000, 0x0800, CRC(481b64cc) SHA1(3f35c545fc784ed4f969aba2d7be6e13a5ae32b7) )
887   /* empty hole - Crazy Kong has an additional ROM here */
888   ROM_LOAD( "cc04",         0x1000, 0x0800, CRC(332347cb) SHA1(4115ca32af73f1791635b7d9e093bf77088a8222) )
889   /* empty hole - Crazy Kong has an additional ROM here */
890   ROM_LOAD( "cc05",         0x2000, 0x0800, CRC(2c33b760) SHA1(2edea8fe13376fbd51a5586d97aba3b30d78e94b) )
891   /* empty hole - Crazy Kong has an additional ROM here */
1224   /* 0x0800-0x0fff - empty */
1225   ROM_LOAD( "cc05",         0x1000, 0x0800, CRC(2c33b760) SHA1(2edea8fe13376fbd51a5586d97aba3b30d78e94b) )
1226   /* 0x1800-0xffff - empty */
1227   ROM_LOAD( "cc04",         0x2000, 0x0800, CRC(332347cb) SHA1(4115ca32af73f1791635b7d9e093bf77088a8222) )
1228   /* 0x2800-0x2fff - empty */
8921229   ROM_LOAD( "cc03",         0x3000, 0x0800, CRC(4e4b3658) SHA1(0d39a8cb5cd6cf06008be60707f9b277a8a32a2d) )
893   /* empty hole - Crazy Kong has an additional ROM here */
1230   /* 0x3800-0x3fff - empty */
8941231
8951232   ROM_REGION( 0x1000, REGION_GFX2, ROMREGION_DISPOSE )
8961233   ROM_LOAD( "cc02",         0x0000, 0x0800, CRC(14f3ecc9) SHA1(a1b5121abfbe8f07580eb3fa6384352d239a3d75) )
r1771r1772
9161253
9171254   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
9181255   ROM_LOAD( "cc06",         0x0000, 0x0800, CRC(481b64cc) SHA1(3f35c545fc784ed4f969aba2d7be6e13a5ae32b7) )
919   /* empty hole - Crazy Kong has an additional ROM here */
920   ROM_LOAD( "cc04",         0x1000, 0x0800, CRC(332347cb) SHA1(4115ca32af73f1791635b7d9e093bf77088a8222) )
921   /* empty hole - Crazy Kong has an additional ROM here */
922   ROM_LOAD( "cc05",         0x2000, 0x0800, CRC(2c33b760) SHA1(2edea8fe13376fbd51a5586d97aba3b30d78e94b) )
923   /* empty hole - Crazy Kong has an additional ROM here */
1256   /* 0x0800-0x0fff - empty */
1257   ROM_LOAD( "cc05",         0x1000, 0x0800, CRC(2c33b760) SHA1(2edea8fe13376fbd51a5586d97aba3b30d78e94b) )
1258   /* 0x1800-0xffff - empty */
1259   ROM_LOAD( "cc04",         0x2000, 0x0800, CRC(332347cb) SHA1(4115ca32af73f1791635b7d9e093bf77088a8222) )
1260   /* 0x2800-0x2fff - empty */
9241261   ROM_LOAD( "cc03",         0x3000, 0x0800, CRC(4e4b3658) SHA1(0d39a8cb5cd6cf06008be60707f9b277a8a32a2d) )
925   /* empty hole - Crazy Kong has an additional ROM here */
1262   /* 0x3800-0x3fff - empty */
9261263
9271264   ROM_REGION( 0x1000, REGION_GFX2, ROMREGION_DISPOSE )
9281265   ROM_LOAD( "cc02",         0x0000, 0x0800, CRC(14f3ecc9) SHA1(a1b5121abfbe8f07580eb3fa6384352d239a3d75) )
r1771r1772
9481285
9491286   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
9501287   ROM_LOAD( "cc06",         0x0000, 0x0800, CRC(481b64cc) SHA1(3f35c545fc784ed4f969aba2d7be6e13a5ae32b7) )
951   /* empty hole - Crazy Kong has an additional ROM here */
952   ROM_LOAD( "m04.bin",      0x1000, 0x0800, CRC(6fb80538) SHA1(6ba5add5c0190e79191b3fa749a1b94e766e3950) )
953   /* empty hole - Crazy Kong has an additional ROM here */
954   ROM_LOAD( "m05.bin",      0x2000, 0x0800, CRC(056af36b) SHA1(756a295bbf7ede201b2e4cb106ce67a127e008de) )
955   /* empty hole - Crazy Kong has an additional ROM here */
956   ROM_LOAD( "m03.bin",      0x3000, 0x0800, CRC(67127253) SHA1(e27556ed74e73644a2578ce6645c312d64f484c6) )
957   /* empty hole - Crazy Kong has an additional ROM here */
1288   /* 0x0800-0x0fff - empty */
1289   ROM_LOAD( "m05.bin",      0x1000, 0x0800, CRC(056af36b) SHA1(756a295bbf7ede201b2e4cb106ce67a127e008de) )
1290   /* 0x1800-0xffff - empty */
1291   ROM_LOAD( "m04.bin",      0x2000, 0x0800, CRC(6fb80538) SHA1(6ba5add5c0190e79191b3fa749a1b94e766e3950) )
1292   /* 0x2800-0x2fff - empty */
1293   ROM_LOAD( "m03.bin",      0x3800, 0x0800, CRC(67127253) SHA1(e27556ed74e73644a2578ce6645c312d64f484c6) )
1294   /* 0x3800-0x3fff - empty */
9581295
9591296   ROM_REGION( 0x1000, REGION_GFX2, ROMREGION_DISPOSE )
9601297   ROM_LOAD( "m02.bin",      0x0000, 0x0800, CRC(7f4877de) SHA1(c9aa9ff1b6cf907917fedfbd419b15ac337cf7bb) )
r1771r1772
9811318
9821319   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
9831320   ROM_LOAD( "cc06",         0x0000, 0x0800, CRC(481b64cc) SHA1(3f35c545fc784ed4f969aba2d7be6e13a5ae32b7) )
984   /* empty hole - Crazy Kong has an additional ROM here */
985   ROM_LOAD( "cc04",         0x1000, 0x0800, CRC(332347cb) SHA1(4115ca32af73f1791635b7d9e093bf77088a8222) )
986   /* empty hole - Crazy Kong has an additional ROM here */
987   ROM_LOAD( "cc05",         0x2000, 0x0800, CRC(2c33b760) SHA1(2edea8fe13376fbd51a5586d97aba3b30d78e94b) )
988   /* empty hole - Crazy Kong has an additional ROM here */
1321   /* 0x0800-0x0fff - empty */
1322   ROM_LOAD( "cc05",         0x1000, 0x0800, CRC(2c33b760) SHA1(2edea8fe13376fbd51a5586d97aba3b30d78e94b) )
1323   /* 0x1800-0xffff - empty */
1324   ROM_LOAD( "cc04",         0x2000, 0x0800, CRC(332347cb) SHA1(4115ca32af73f1791635b7d9e093bf77088a8222) )
1325   /* 0x2800-0x2fff - empty */
9891326   ROM_LOAD( "cc03",         0x3000, 0x0800, CRC(4e4b3658) SHA1(0d39a8cb5cd6cf06008be60707f9b277a8a32a2d) )
990   /* empty hole - Crazy Kong has an additional ROM here */
1327   /* 0x3800-0x3fff - empty */
9911328
9921329   ROM_REGION( 0x1000, REGION_GFX2, ROMREGION_DISPOSE )
9931330   ROM_LOAD( "cc02",         0x0000, 0x0800, CRC(14f3ecc9) SHA1(a1b5121abfbe8f07580eb3fa6384352d239a3d75) )
r1771r1772
10151352
10161353   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
10171354   ROM_LOAD( "n11-06.bin",   0x0000, 0x1000, CRC(2dcedd12) SHA1(dfdcfc21bcba7c8e148ee54daae511ca78c58e70) )
1018   ROM_LOAD( "k11-04.bin",   0x1000, 0x1000, CRC(3375b3bd) SHA1(a00b3c31cff123aab6ac0833aabfdd663302971a) )
1019   ROM_LOAD( "l11-05.bin",   0x2000, 0x1000, CRC(fa7cbd91) SHA1(0208d2ebc59f3600005476b6987472685bc99d67) )
1355   ROM_LOAD( "l11-05.bin",   0x1000, 0x1000, CRC(fa7cbd91) SHA1(0208d2ebc59f3600005476b6987472685bc99d67) )
1356   ROM_LOAD( "k11-04.bin",   0x2000, 0x1000, CRC(3375b3bd) SHA1(a00b3c31cff123aab6ac0833aabfdd663302971a) )
10201357   ROM_LOAD( "h11-03.bin",   0x3000, 0x1000, CRC(5655cc11) SHA1(5195e9b2a60c54280b48b32ee8248090904dbc51) )
10211358
10221359   ROM_REGION( 0x1000, REGION_GFX2, ROMREGION_DISPOSE )
r1771r1772
10441381
10451382   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
10461383   ROM_LOAD( "n11-06.bin",   0x0000, 0x1000, CRC(2dcedd12) SHA1(dfdcfc21bcba7c8e148ee54daae511ca78c58e70) )
1047   ROM_LOAD( "k11-04.bin",   0x1000, 0x1000, CRC(3375b3bd) SHA1(a00b3c31cff123aab6ac0833aabfdd663302971a) )
1048   ROM_LOAD( "l11-05.bin",   0x2000, 0x1000, CRC(fa7cbd91) SHA1(0208d2ebc59f3600005476b6987472685bc99d67) )
1384   ROM_LOAD( "l11-05.bin",   0x1000, 0x1000, CRC(fa7cbd91) SHA1(0208d2ebc59f3600005476b6987472685bc99d67) )
1385   ROM_LOAD( "k11-04.bin",   0x2000, 0x1000, CRC(3375b3bd) SHA1(a00b3c31cff123aab6ac0833aabfdd663302971a) )
10491386   ROM_LOAD( "h11-03.bin",   0x3000, 0x1000, CRC(5655cc11) SHA1(5195e9b2a60c54280b48b32ee8248090904dbc51) )
10501387
10511388   ROM_REGION( 0x1000, REGION_GFX2, ROMREGION_DISPOSE )
r1771r1772
10731410
10741411   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
10751412   ROM_LOAD( "n11-06.bin",   0x0000, 0x1000, CRC(2dcedd12) SHA1(dfdcfc21bcba7c8e148ee54daae511ca78c58e70) )
1076   ROM_LOAD( "k11-04.bin",   0x1000, 0x1000, CRC(3375b3bd) SHA1(a00b3c31cff123aab6ac0833aabfdd663302971a) )
1077   ROM_LOAD( "l11-05.bin",   0x2000, 0x1000, CRC(fa7cbd91) SHA1(0208d2ebc59f3600005476b6987472685bc99d67) )
1413   ROM_LOAD( "l11-05.bin",   0x1000, 0x1000, CRC(fa7cbd91) SHA1(0208d2ebc59f3600005476b6987472685bc99d67) )
1414   ROM_LOAD( "k11-04.bin",   0x2000, 0x1000, CRC(3375b3bd) SHA1(a00b3c31cff123aab6ac0833aabfdd663302971a) )
10781415   ROM_LOAD( "h11-03.bin",   0x3000, 0x1000, CRC(5655cc11) SHA1(5195e9b2a60c54280b48b32ee8248090904dbc51) )
10791416
10801417   ROM_REGION( 0x1000, REGION_GFX2, ROMREGION_DISPOSE )
r1771r1772
11031440   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
11041441   /* same as ckong but with halves switched */
11051442   ROM_LOAD( "o50b-1",       0x0000, 0x0800, CRC(cae9e2bf) SHA1(bc62d98840b8b5b296de0f1379baabb1b4d25df0) )
1106   ROM_CONTINUE(             0x2000, 0x0800 )
1443   ROM_CONTINUE(             0x1000, 0x0800 )
11071444   ROM_LOAD( "o50b-2",       0x0800, 0x0800, CRC(fba82114) SHA1(36b7c124edf73b01681f5d63867fafa38a31abbf) )
1108   ROM_CONTINUE(             0x2800, 0x0800 )
1109   ROM_LOAD( "o50b-3",       0x1000, 0x0800, CRC(1714764b) SHA1(b025fcc03d45b1ec29be7e292622745544ba891d) )
1445   ROM_CONTINUE(             0x1800, 0x0800 )
1446   ROM_LOAD( "o50b-3",       0x2000, 0x0800, CRC(1714764b) SHA1(b025fcc03d45b1ec29be7e292622745544ba891d) )
11101447   ROM_CONTINUE(             0x3000, 0x0800 )
1111   ROM_LOAD( "o50b-4",       0x1800, 0x0800, CRC(b7008b57) SHA1(9328ff79947dbebdc3e2dd8bcc362667b8201476) )
1448   ROM_LOAD( "o50b-4",       0x2800, 0x0800, CRC(b7008b57) SHA1(9328ff79947dbebdc3e2dd8bcc362667b8201476) )
11121449   ROM_CONTINUE(             0x3800, 0x0800 )
11131450
11141451   ROM_REGION( 0x1000, REGION_GFX2, ROMREGION_DISPOSE )
r1771r1772
11361473
11371474   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
11381475   ROM_LOAD( "ck6.bin",      0x0000, 0x1000, CRC(a8916dc8) SHA1(472520aae3837e6026f2a7577d3b2aff371a316c) )
1139   ROM_LOAD( "ck4.bin",      0x1000, 0x1000, CRC(b62a0367) SHA1(8c285cbc714d7e6589bd63b3cef7c841ed1c2a4e) )
1140   ROM_LOAD( "ck5.bin",      0x2000, 0x1000, CRC(cd3b5dde) SHA1(2319a2be04d70989b01f4fc703756ba6e1c1f388) )
1476   ROM_LOAD( "ck5.bin",      0x1000, 0x1000, CRC(cd3b5dde) SHA1(2319a2be04d70989b01f4fc703756ba6e1c1f388) )
1477   ROM_LOAD( "ck4.bin",      0x2000, 0x1000, CRC(b62a0367) SHA1(8c285cbc714d7e6589bd63b3cef7c841ed1c2a4e) )
11411478   ROM_LOAD( "ck3.bin",      0x3000, 0x1000, CRC(61122c5e) SHA1(978b6dbec35f3adc651fddf332db17625099a92e) )
11421479
11431480   ROM_REGION( 0x1000, REGION_GFX2, ROMREGION_DISPOSE )
r1771r1772
11651502
11661503   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
11671504   ROM_LOAD( "n11-06.bin",   0x0000, 0x1000, CRC(2dcedd12) SHA1(dfdcfc21bcba7c8e148ee54daae511ca78c58e70) )
1168   ROM_LOAD( "k11-04.bin",   0x1000, 0x1000, CRC(3375b3bd) SHA1(a00b3c31cff123aab6ac0833aabfdd663302971a) )
1169   ROM_LOAD( "l11-05.bin",   0x2000, 0x1000, CRC(fa7cbd91) SHA1(0208d2ebc59f3600005476b6987472685bc99d67) )
1505   ROM_LOAD( "l11-05.bin",   0x1000, 0x1000, CRC(fa7cbd91) SHA1(0208d2ebc59f3600005476b6987472685bc99d67) )
1506   ROM_LOAD( "k11-04.bin",   0x2000, 0x1000, CRC(3375b3bd) SHA1(a00b3c31cff123aab6ac0833aabfdd663302971a) )
11701507   ROM_LOAD( "h11-03.bin",   0x3000, 0x1000, CRC(5655cc11) SHA1(5195e9b2a60c54280b48b32ee8248090904dbc51) )
11711508
11721509   ROM_REGION( 0x1000, REGION_GFX2, ROMREGION_DISPOSE )
r1771r1772
11941531
11951532   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
11961533   ROM_LOAD( "ck6.bin",      0x0000, 0x1000, CRC(a8916dc8) SHA1(472520aae3837e6026f2a7577d3b2aff371a316c) )
1197   ROM_LOAD( "ck4.bin",      0x1000, 0x1000, CRC(b62a0367) SHA1(8c285cbc714d7e6589bd63b3cef7c841ed1c2a4e) )
1198   ROM_LOAD( "ck5.bin",      0x2000, 0x1000, CRC(cd3b5dde) SHA1(2319a2be04d70989b01f4fc703756ba6e1c1f388) )
1534   ROM_LOAD( "ck5.bin",      0x1000, 0x1000, CRC(cd3b5dde) SHA1(2319a2be04d70989b01f4fc703756ba6e1c1f388) )
1535   ROM_LOAD( "ck4.bin",      0x2000, 0x1000, CRC(b62a0367) SHA1(8c285cbc714d7e6589bd63b3cef7c841ed1c2a4e) )
11991536   ROM_LOAD( "ck3.bin",      0x3000, 0x1000, CRC(61122c5e) SHA1(978b6dbec35f3adc651fddf332db17625099a92e) )
12001537
12011538   ROM_REGION( 0x1000, REGION_GFX2, ROMREGION_DISPOSE )
r1771r1772
12231560
12241561   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
12251562   ROM_LOAD( "n11-6.bin",    0x0000, 0x1000, CRC(2dcedd12) SHA1(dfdcfc21bcba7c8e148ee54daae511ca78c58e70) )
1226   ROM_LOAD( "k11-4.bin",    0x1000, 0x1000, CRC(3375b3bd) SHA1(a00b3c31cff123aab6ac0833aabfdd663302971a) )
1227   ROM_LOAD( "l11-5.bin",    0x2000, 0x1000, CRC(fa7cbd91) SHA1(0208d2ebc59f3600005476b6987472685bc99d67) )
1563   ROM_LOAD( "l11-5.bin",    0x1000, 0x1000, CRC(fa7cbd91) SHA1(0208d2ebc59f3600005476b6987472685bc99d67) )
1564   ROM_LOAD( "k11-4.bin",    0x2000, 0x1000, CRC(3375b3bd) SHA1(a00b3c31cff123aab6ac0833aabfdd663302971a) )
12281565   ROM_LOAD( "h11-3.bin",    0x3000, 0x1000, CRC(5655cc11) SHA1(5195e9b2a60c54280b48b32ee8248090904dbc51) )
12291566
12301567   ROM_REGION( 0x1000, REGION_GFX2, ROMREGION_DISPOSE )
r1771r1772
12411578   ROM_LOAD( "r05-13.bin",   0x1000, 0x1000, CRC(9003ffbd) SHA1(fd016056aabc23957643f37230f03842294f795e) )
12421579ROM_END
12431580
1244ROM_START( rpatrolb )
1581/* This set came from a 'Silver Land' board with Silver Land GFX roms, however, the program roms are nearly
1582   the same as River Patrol but appear to have an original ORCA copyright
1583
1584   I think the board was a half-converted board as 'Water Gage' and 'Bon Voyage' don't really fit the theme
1585   of Silver Land so I'm loading the River Patrol GFX instead as they fit better
1586*/
1587ROM_START( rpatrol )
12451588   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1246   ROM_LOAD( "rp1.4l",       0x0000, 0x1000, CRC(bfd7ae7a) SHA1(a06d1cc2674ed40d0bfa67dd6d724964c1e40600) )
1247   ROM_LOAD( "rp2.4j",       0x1000, 0x1000, CRC(03f53340) SHA1(35336945f4b634fc4c7791ac9c9e6643c8cd8006) )
1248   ROM_LOAD( "rp3.4f",       0x2000, 0x1000, CRC(8fa300df) SHA1(5c3ba1ef6c1ce8df437b4fa464293208630b5e8d) )
1249   ROM_LOAD( "rp4.4e",       0x3000, 0x1000, CRC(74a8f1f4) SHA1(6bbc4944e4b31425a6b82f370b6760e5a4b36f56) )
1250   ROM_LOAD( "rp5.4c",       0x4000, 0x1000, CRC(d7ef6c87) SHA1(38e3b44b355907824919acc4f5064dcb98ebb1d0) )
1251   /* no ROM at 5000 */
1589   ROM_LOAD( "sci1.bin",       0x0000, 0x1000, CRC(33b01c90) SHA1(9c8da6dd963bfb0544ef99b8fdedcf86c32cdb6b) )
1590   ROM_LOAD( "sci2.bin",       0x1000, 0x1000, CRC(03f53340) SHA1(35336945f4b634fc4c7791ac9c9e6643c8cd8006) )
1591   ROM_LOAD( "sci3.bin",       0x2000, 0x1000, CRC(8fa300df) SHA1(5c3ba1ef6c1ce8df437b4fa464293208630b5e8d) )
1592   ROM_LOAD( "sci4.bin",       0x3000, 0x1000, CRC(74a8f1f4) SHA1(6bbc4944e4b31425a6b82f370b6760e5a4b36f56) )
1593   ROM_LOAD( "sci5.bin",       0x4000, 0x1000, CRC(d7ef6c87) SHA1(38e3b44b355907824919acc4f5064dcb98ebb1d0) )
12521594
12531595   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
12541596   ROM_LOAD( "rp6.6n",       0x0000, 0x0800, CRC(19f18e9e) SHA1(a5500ac36bcda772f3ba79d9e9d37b1eec7bfd13) )
1255   /* 0800-0fff empty */
1256   ROM_LOAD( "rp8.6k",       0x1000, 0x0800, CRC(008738c7) SHA1(a66d9daf31b0d9cf087b591c74f0aaee3d7607b5) )
1257   /* 1800-1fff empty */
1258   ROM_LOAD( "rp7.6l",       0x2000, 0x0800, CRC(07f2070d) SHA1(39df286fda9e48eba6e770fe23a603b5e10d88b6) )
1259   /* 2800-2fff empty */
1597   /* 0x0800-0x0fff - empty */
1598   ROM_LOAD( "rp7.6l",       0x1000, 0x0800, CRC(07f2070d) SHA1(39df286fda9e48eba6e770fe23a603b5e10d88b6) )
1599   /* 0x1800-0xffff - empty */
1600   ROM_LOAD( "rp8.6k",       0x2000, 0x0800, CRC(008738c7) SHA1(a66d9daf31b0d9cf087b591c74f0aaee3d7607b5) )
1601   /* 0x2800-0x2fff - empty */
12601602   ROM_LOAD( "rp9.6h",       0x3000, 0x0800, CRC(ea5aafca) SHA1(d8f8fe270680ae261d63bd4702107961cd904699) )
1261   /* 3800-3fff empty */
1603   /* 0x3800-0x3fff - empty */
12621604
12631605   ROM_REGION( 0x1000, REGION_GFX2, ROMREGION_DISPOSE )
12641606   ROM_LOAD( "rp10.6a",      0x0000, 0x0800, CRC(59747c31) SHA1(92acf07489f3e17f0c1769a0df15b6ddb117830f) )
r1771r1772
12691611   ROM_LOAD( "bprom2.9p",    0x0020, 0x0020, CRC(1743bd26) SHA1(9bb50f6e24a7ac3c9ddf3923e57c5532603009e5) )
12701612   ROM_LOAD( "bprom3.9c",    0x0040, 0x0020, CRC(ee03bc96) SHA1(45e33e750a536a904f30136d84dd7993d97e8e54) )
12711613
1272   /* no samples */
1273ROM_END
1274
1275ROM_START( silvland )
1276   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1277   ROM_LOAD( "7.2r",         0x0000, 0x1000, CRC(57e6be62) SHA1(c1d47970f8209256c9ccd6512b921dec6c276998) )
1278   ROM_LOAD( "8.1n",         0x1000, 0x1000, CRC(bbb2b287) SHA1(93cd4ebe238c189c80be8b8ab1ec2649256dd6ea) )
1279   ROM_LOAD( "rp3.4f",       0x2000, 0x1000, CRC(8fa300df) SHA1(5c3ba1ef6c1ce8df437b4fa464293208630b5e8d) )
1280   ROM_LOAD( "10.2n",        0x3000, 0x1000, CRC(5536a65d) SHA1(0bf2b9ea76fd6fd8c0475bf6f49a42f1c96d3906) )
1281   ROM_LOAD( "11.1r",        0x4000, 0x1000, CRC(6f23f66f) SHA1(3ca8075c28956ec473ccb0e9f05e9ad8669f743d) )
1282   ROM_LOAD( "12.2k",        0x5000, 0x1000, CRC(26f1537c) SHA1(0468352d49edec3a52e32612856735b78e11079b) )
1283
1614   // these are the GFX Roms found on the board, from Silver Land, but IMO not correct for this program
1615#if 0
12841616   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
1285   ROM_LOAD( "6.6n",         0x0000, 0x0800, CRC(affb804f) SHA1(9fc77804690e91773787e06f3329accef075f9f3) )
1286   /* 0800-0fff empty */
1287   ROM_LOAD( "4.6k",         0x1000, 0x0800, CRC(e487579d) SHA1(aed59f15dbc904d73e19d914ccd0a86fda859085) )
1288   /* 1800-1fff empty */
1289   ROM_LOAD( "5.6l",         0x2000, 0x0800, CRC(ad4642e5) SHA1(f4de2d9ed0e69c002be07f47247e95167a3ffffb) )
1290   /* 2800-2fff empty */
1291   ROM_LOAD( "3.6h",         0x3000, 0x0800, CRC(59125a1a) SHA1(37638fb690d6b4f11585f6a13586271c2f0e3743) )
1292   /* 3800-3fff empty */
1617   ROM_LOAD( "sci46.bin",    0x0000, 0x0800, CRC(affb804f) SHA1(9fc77804690e91773787e06f3329accef075f9f3) )
1618   /* 0x0800-0x0fff - empty */
1619   ROM_LOAD( "sci45.bin",    0x1000, 0x0800, CRC(ad4642e5) SHA1(f4de2d9ed0e69c002be07f47247e95167a3ffffb) )
1620   /* 0x1800-0xffff - empty */
1621   ROM_LOAD( "sci44.bin",    0x2000, 0x0800, CRC(e487579d) SHA1(aed59f15dbc904d73e19d914ccd0a86fda859085) )
1622   /* 0x2800-0x2fff - empty */
1623   ROM_LOAD( "sci43.bin",    0x3000, 0x0800, CRC(59125a1a) SHA1(37638fb690d6b4f11585f6a13586271c2f0e3743) )
1624   /* 0x3800-0x3fff - empty */
12931625
12941626   ROM_REGION( 0x1000, REGION_GFX2, ROMREGION_DISPOSE )
1295   ROM_LOAD( "2.6c",         0x0000, 0x0800, CRC(c8d32b8e) SHA1(7d655d243ed13cf2537f3fdfde5bf34229f7cb84) )
1296   ROM_LOAD( "1.6a",         0x0800, 0x0800, CRC(ee333daf) SHA1(b02998dccec9a4f841838874221caabae8380fcc) )
1627   ROM_LOAD( "sci42.bin",         0x0000, 0x0800, CRC(c8d32b8e) SHA1(7d655d243ed13cf2537f3fdfde5bf34229f7cb84) )
1628   ROM_LOAD( "sci41.bin",         0x0800, 0x0800, CRC(ee333daf) SHA1(b02998dccec9a4f841838874221caabae8380fcc) )
12971629
12981630   ROM_REGION( 0x0060, REGION_PROMS, 0 )
12991631   ROM_LOAD( "mb7051.1v",    0x0000, 0x0020, CRC(1d2343b1) SHA1(294f22178af4532abf767c1ffe2dc831bbe683bf) )
13001632   ROM_LOAD( "mb7051.1u",    0x0020, 0x0020, CRC(c174753c) SHA1(303bfb1f470b525ccaeafa81a38a4bc3a7de5dbb) )
13011633   ROM_LOAD( "mb7051.1t",    0x0040, 0x0020, CRC(04a1be01) SHA1(9c270c04d374d46752ec99bd4e79fed1e2896bc0) )
1302
1634#endif
13031635   /* no samples */
13041636ROM_END
13051637
1306/* This set came from a 'Silver Land' board with Silver Land GFX roms, however, the program roms are nearly
1307   the same as River Patrol but appear to have an original ORCA copyright
1308
1309   I think the board was a half-converted board as 'Water Gage' and 'Bon Voyage' don't really fit the theme
1310   of Silver Land so I'm loading the River Patrol GFX instead as they fit better
1311*/
1312ROM_START( rpatrol )
1638ROM_START( rpatrolb )
13131639   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1314   ROM_LOAD( "sci1.bin",       0x0000, 0x1000, CRC(33b01c90) SHA1(9c8da6dd963bfb0544ef99b8fdedcf86c32cdb6b) )
1315   ROM_LOAD( "sci2.bin",       0x1000, 0x1000, CRC(03f53340) SHA1(35336945f4b634fc4c7791ac9c9e6643c8cd8006) )
1316   ROM_LOAD( "sci3.bin",       0x2000, 0x1000, CRC(8fa300df) SHA1(5c3ba1ef6c1ce8df437b4fa464293208630b5e8d) )
1317   ROM_LOAD( "sci4.bin",       0x3000, 0x1000, CRC(74a8f1f4) SHA1(6bbc4944e4b31425a6b82f370b6760e5a4b36f56) )
1318   ROM_LOAD( "sci5.bin",       0x4000, 0x1000, CRC(d7ef6c87) SHA1(38e3b44b355907824919acc4f5064dcb98ebb1d0) )
1640   ROM_LOAD( "rp1.4l",       0x0000, 0x1000, CRC(bfd7ae7a) SHA1(a06d1cc2674ed40d0bfa67dd6d724964c1e40600) )
1641   ROM_LOAD( "rp2.4j",       0x1000, 0x1000, CRC(03f53340) SHA1(35336945f4b634fc4c7791ac9c9e6643c8cd8006) )
1642   ROM_LOAD( "rp3.4f",       0x2000, 0x1000, CRC(8fa300df) SHA1(5c3ba1ef6c1ce8df437b4fa464293208630b5e8d) )
1643   ROM_LOAD( "rp4.4e",       0x3000, 0x1000, CRC(74a8f1f4) SHA1(6bbc4944e4b31425a6b82f370b6760e5a4b36f56) )
1644   ROM_LOAD( "rp5.4c",       0x4000, 0x1000, CRC(d7ef6c87) SHA1(38e3b44b355907824919acc4f5064dcb98ebb1d0) )
1645   /* no ROM at 5000 */
13191646
13201647   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
13211648   ROM_LOAD( "rp6.6n",       0x0000, 0x0800, CRC(19f18e9e) SHA1(a5500ac36bcda772f3ba79d9e9d37b1eec7bfd13) )
1322   /* 0800-0fff empty */
1323   ROM_LOAD( "rp8.6k",       0x1000, 0x0800, CRC(008738c7) SHA1(a66d9daf31b0d9cf087b591c74f0aaee3d7607b5) )
1324   /* 1800-1fff empty */
1325   ROM_LOAD( "rp7.6l",       0x2000, 0x0800, CRC(07f2070d) SHA1(39df286fda9e48eba6e770fe23a603b5e10d88b6) )
1326   /* 2800-2fff empty */
1649   /* 0x0800-0x0fff - empty */
1650   ROM_LOAD( "rp7.6l",       0x1000, 0x0800, CRC(07f2070d) SHA1(39df286fda9e48eba6e770fe23a603b5e10d88b6) )
1651   /* 0x1800-0xffff - empty */
1652   ROM_LOAD( "rp8.6k",       0x2000, 0x0800, CRC(008738c7) SHA1(a66d9daf31b0d9cf087b591c74f0aaee3d7607b5) )
1653   /* 0x2800-0x2fff - empty */
13271654   ROM_LOAD( "rp9.6h",       0x3000, 0x0800, CRC(ea5aafca) SHA1(d8f8fe270680ae261d63bd4702107961cd904699) )
1328   /* 3800-3fff empty */
1655   /* 0x3800-0x3fff - empty */
13291656
13301657   ROM_REGION( 0x1000, REGION_GFX2, ROMREGION_DISPOSE )
13311658   ROM_LOAD( "rp10.6a",      0x0000, 0x0800, CRC(59747c31) SHA1(92acf07489f3e17f0c1769a0df15b6ddb117830f) )
r1771r1772
13361663   ROM_LOAD( "bprom2.9p",    0x0020, 0x0020, CRC(1743bd26) SHA1(9bb50f6e24a7ac3c9ddf3923e57c5532603009e5) )
13371664   ROM_LOAD( "bprom3.9c",    0x0040, 0x0020, CRC(ee03bc96) SHA1(45e33e750a536a904f30136d84dd7993d97e8e54) )
13381665
1339   // these are the GFX Roms found on the board, from Silver Land, but IMO not correct for this program
1340#if 0
1666   /* no samples */
1667ROM_END
1668
1669ROM_START( silvland )
1670   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1671   ROM_LOAD( "7.2r",         0x0000, 0x1000, CRC(57e6be62) SHA1(c1d47970f8209256c9ccd6512b921dec6c276998) )
1672   ROM_LOAD( "8.1n",         0x1000, 0x1000, CRC(bbb2b287) SHA1(93cd4ebe238c189c80be8b8ab1ec2649256dd6ea) )
1673   ROM_LOAD( "rp3.4f",       0x2000, 0x1000, CRC(8fa300df) SHA1(5c3ba1ef6c1ce8df437b4fa464293208630b5e8d) )
1674   ROM_LOAD( "10.2n",        0x3000, 0x1000, CRC(5536a65d) SHA1(0bf2b9ea76fd6fd8c0475bf6f49a42f1c96d3906) )
1675   ROM_LOAD( "11.1r",        0x4000, 0x1000, CRC(6f23f66f) SHA1(3ca8075c28956ec473ccb0e9f05e9ad8669f743d) )
1676   ROM_LOAD( "12.2k",        0x5000, 0x1000, CRC(26f1537c) SHA1(0468352d49edec3a52e32612856735b78e11079b) )
1677
13411678   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
1342   ROM_LOAD( "sci46.bin",         0x0000, 0x0800, CRC(affb804f) SHA1(9fc77804690e91773787e06f3329accef075f9f3) )
1343   /* 0800-0fff empty */
1344   ROM_LOAD( "sci44.bin",         0x1000, 0x0800, CRC(e487579d) SHA1(aed59f15dbc904d73e19d914ccd0a86fda859085) )
1345   /* 1800-1fff empty */
1346   ROM_LOAD( "sci45.bin",         0x2000, 0x0800, CRC(ad4642e5) SHA1(f4de2d9ed0e69c002be07f47247e95167a3ffffb) )
1347   /* 2800-2fff empty */
1348   ROM_LOAD( "sci43.bin",         0x3000, 0x0800, CRC(59125a1a) SHA1(37638fb690d6b4f11585f6a13586271c2f0e3743) )
1349   /* 3800-3fff empty */
1679   ROM_LOAD( "6.6n",         0x0000, 0x0800, CRC(affb804f) SHA1(9fc77804690e91773787e06f3329accef075f9f3) )
1680   /* 0x0800-0x0fff - empty */
1681   ROM_LOAD( "5.6l",         0x1000, 0x0800, CRC(ad4642e5) SHA1(f4de2d9ed0e69c002be07f47247e95167a3ffffb) )
1682   /* 0x1800-0xffff - empty */
1683   ROM_LOAD( "4.6k",         0x2000, 0x0800, CRC(e487579d) SHA1(aed59f15dbc904d73e19d914ccd0a86fda859085) )
1684   /* 0x2800-0x2fff - empty */
1685   ROM_LOAD( "3.6h",         0x3000, 0x0800, CRC(59125a1a) SHA1(37638fb690d6b4f11585f6a13586271c2f0e3743) )
1686   /* 0x3800-0x3fff - empty */
13501687
13511688   ROM_REGION( 0x1000, REGION_GFX2, ROMREGION_DISPOSE )
1352   ROM_LOAD( "sci42.bin",         0x0000, 0x0800, CRC(c8d32b8e) SHA1(7d655d243ed13cf2537f3fdfde5bf34229f7cb84) )
1353   ROM_LOAD( "sci41.bin",         0x0800, 0x0800, CRC(ee333daf) SHA1(b02998dccec9a4f841838874221caabae8380fcc) )
1689   ROM_LOAD( "2.6c",         0x0000, 0x0800, CRC(c8d32b8e) SHA1(7d655d243ed13cf2537f3fdfde5bf34229f7cb84) )
1690   ROM_LOAD( "1.6a",         0x0800, 0x0800, CRC(ee333daf) SHA1(b02998dccec9a4f841838874221caabae8380fcc) )
13541691
13551692   ROM_REGION( 0x0060, REGION_PROMS, 0 )
13561693   ROM_LOAD( "mb7051.1v",    0x0000, 0x0020, CRC(1d2343b1) SHA1(294f22178af4532abf767c1ffe2dc831bbe683bf) )
13571694   ROM_LOAD( "mb7051.1u",    0x0020, 0x0020, CRC(c174753c) SHA1(303bfb1f470b525ccaeafa81a38a4bc3a7de5dbb) )
13581695   ROM_LOAD( "mb7051.1t",    0x0040, 0x0020, CRC(04a1be01) SHA1(9c270c04d374d46752ec99bd4e79fed1e2896bc0) )
1359#endif
1696
13601697   /* no samples */
13611698ROM_END
13621699
r1771r1772
13741711
13751712   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
13761713   ROM_LOAD( "canballs.11n", 0x0000, 0x1000, CRC(a95b8e03) SHA1(e78125023e1af6de292292b875b45401b2173ca9) )
1377   ROM_LOAD( "canballs.11k", 0x1000, 0x1000, CRC(dbbe8263) SHA1(efe4bba25a03261bc8309e6d83d5600def875b0c) )
1378   ROM_LOAD( "canballs.11l", 0x2000, 0x1000, CRC(060b044c) SHA1(3121f07adb661663a2303085eea1b662968f8f98) )
1714   ROM_LOAD( "canballs.11l", 0x1000, 0x1000, CRC(060b044c) SHA1(3121f07adb661663a2303085eea1b662968f8f98) )
1715   ROM_LOAD( "canballs.11k", 0x2000, 0x1000, CRC(dbbe8263) SHA1(efe4bba25a03261bc8309e6d83d5600def875b0c) )
13791716   ROM_LOAD( "canballs.11h", 0x3000, 0x1000, CRC(8043bc1a) SHA1(bd2f3dfe26cf8d987d9ecaa41eac4bdc4e16a692) )
13801717
13811718   ROM_REGION( 0x1000, REGION_GFX2, ROMREGION_DISPOSE )
r1771r1772
14001737   ROM_LOAD( "cb4.bin",   0x3000, 0x1000, CRC(696ebdb0) SHA1(0bff115e4710199641722ca12af4e16dc5b0ec13) )
14011738
14021739   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
1403   ROM_LOAD( "cb10.bin",   0x0000, 0x1000, CRC(602a6c2d) SHA1(788f83bcb0667d8a42c209f3d51708d496be58df) )
1404   ROM_LOAD( "cb9.bin",   0x1000, 0x1000, CRC(2d036026) SHA1(b6eada3e67edd7db59d9ca823b798cd20f0afca9) )
1740   ROM_LOAD( "cb10.bin",   0x0000, 0x0800, CRC(602a6c2d) SHA1(788f83bcb0667d8a42c209f3d51708d496be58df) )
1741   /* 0x0800-0x0fff - empty */
1742   ROM_CONTINUE(           0x1000, 0x0800 )
1743   /* 0x1800-0x0fff - empty */
1744   ROM_LOAD( "cb9.bin",    0x2000, 0x0800, CRC(2d036026) SHA1(b6eada3e67edd7db59d9ca823b798cd20f0afca9) )
1745   /* 0x2800-0x0fff - empty */
1746   ROM_CONTINUE(           0x3000, 0x0800 )
1747   /* 0x3800-0x0fff - empty */
14051748
14061749   ROM_REGION( 0x1000, REGION_GFX2, ROMREGION_DISPOSE )
14071750   ROM_LOAD( "cb7.bin",   0x0000, 0x0800, CRC(80eb517d) SHA1(fef4111f656c58b28e7eac5aa5b5cc7e07ccb2fd) )
r1771r1772
14281771   ROM_LOAD( "sw7",          0x6000, 0x1000, CRC(37efb64e) SHA1(0ed4d678895c17b37df605990acd096c538e3675) )
14291772   ROM_LOAD( "sw8",          0x7000, 0x1000, CRC(33d6001e) SHA1(749b746d018e74e364fd6974e4522c8a18915774) )
14301773
1431   ROM_REGION( 0x10000, REGION_CPU2, 0 )     /* 64k for sound board */
1774   ROM_REGION( 0x10000, REGION_CPU2, 0 )
14321775   ROM_LOAD( "sw12.4k",      0x0000, 0x1000, CRC(2eee9bcb) SHA1(ceafdf750a8af0c1c9abbbf437c3e9d9ae09f72b) )
14331776
14341777   ROM_REGION( 0x3000, REGION_GFX1, ROMREGION_DISPOSE )
r1771r1772
14611804   ROM_LOAD( "swa7",         0x6000, 0x1000, CRC(7090e5ee) SHA1(d1e0ca38c3d1e4a7b7efa3696e47fb36ad3f8aa0) )
14621805   ROM_LOAD( "swa8",         0x7000, 0x1000, CRC(ab86efa9) SHA1(5b5a80ae285c7e9f4c51e646116edf789d4dba39) )
14631806
1464   ROM_REGION( 0x10000, REGION_CPU2, 0 )     /* 64k for sound board */
1807   ROM_REGION( 0x10000, REGION_CPU2, 0 )
14651808   ROM_LOAD( "sw12.4k",      0x0000, 0x1000, CRC(2eee9bcb) SHA1(ceafdf750a8af0c1c9abbbf437c3e9d9ae09f72b) )
14661809
14671810   ROM_REGION( 0x3000, REGION_GFX1, ROMREGION_DISPOSE )
r1771r1772
14941837   ROM_LOAD( "sw7.9c",       0x6000, 0x1000, CRC(88266f2e) SHA1(4ad15f9ba7b45a6c1c3637f8d0fd8be9c04b495f) )
14951838   ROM_LOAD( "sw8.9a",       0x7000, 0x1000, CRC(191a16e4) SHA1(75d3f49e2f4ea04d3a7cc88662c023768bf48365) )
14961839
1497   ROM_REGION( 0x10000, REGION_CPU2, 0 )     /* 64k for sound board */
1840   ROM_REGION( 0x10000, REGION_CPU2, 0 )
14981841   ROM_LOAD( "sw12.4k",      0x0000, 0x1000, CRC(2eee9bcb) SHA1(ceafdf750a8af0c1c9abbbf437c3e9d9ae09f72b) )
14991842
15001843   ROM_REGION( 0x3000, REGION_GFX1, ROMREGION_DISPOSE )
r1771r1772
15241867   ROM_LOAD( "guzz-04.bin",  0x6000, 0x2000, CRC(45be42f5) SHA1(578943afdb6ceca34ca7c19c2fd1164ca3aa57bd) )
15251868   ROM_LOAD( "guzz-16.bin",  0xe000, 0x2000, CRC(61ee00b7) SHA1(ea8516c8dfb2de32a8034f94c7d0c086e3596740) )
15261869
1527   ROM_REGION( 0x10000, REGION_CPU2, 0 )     /* 64k for sound board */
1870   ROM_REGION( 0x10000, REGION_CPU2, 0 )
15281871   ROM_LOAD( "guzz-12.bin",  0x0000, 0x1000, CRC(f3754d9e) SHA1(bb30832aba4e82ab0ecce40fc1223d9771ff7dd2) )
15291872
15301873   ROM_REGION( 0x3000, REGION_GFX1, ROMREGION_DISPOSE )
r1771r1772
15431886   ROM_LOAD( "guzzler.001",  0x0200, 0x020, CRC(69089495) SHA1(96b067b22be14536bac748f8d61e5587a8a04e92) )
15441887ROM_END
15451888
1889ROM_START( yamato )
1890   ROM_REGION( 2*0x10000, REGION_CPU1, 0 )
1891   ROM_LOAD( "2.5de",        0x0000, 0x2000, CRC(20895096) SHA1(af76786e3c519e710899f143d46c53087e9817c7) )
1892   ROM_LOAD( "3.5f",         0x2000, 0x2000, CRC(57a696f9) SHA1(28ea80fb100ac92295fc3eb318617d7cb014408d) )
1893   ROM_LOAD( "4.5jh",        0x4000, 0x2000, CRC(59a468e8) SHA1(a79cdee6efefd87a356cc8d710f8050bc12e07c3) )
1894   /* hole at 6000-6fff */
1895   ROM_LOAD( "11.5a",        0x7000, 0x1000, CRC(35987485) SHA1(1f0cb545bbd52982cbf801bc1dd2c4087af2f5f7) )
15461896
1897   ROM_REGION( 0x10000, REGION_CPU2, 0 )
1898   ROM_LOAD( "1.5v",         0x0000, 0x0800, CRC(3aad9e3c) SHA1(37b0414b265397881bb45b166ecab85880d1358d) )
15471899
1900   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
1901   ROM_LOAD( "10.11k",       0x0000, 0x2000, CRC(161121f5) SHA1(017c5c6b773b0ae1d0be52e4bac90b699ea196dd) )
1902   ROM_LOAD( "9.11h",        0x2000, 0x2000, CRC(56e84cc4) SHA1(c48e0e5460376d6b34173c42a27907ef12218182) )
1903
1904   ROM_REGION( 0x2000, REGION_GFX2, ROMREGION_DISPOSE )
1905   ROM_LOAD( "8.11c",        0x0000, 0x1000, CRC(28024d9a) SHA1(c871c4d74be72a8bfea99e89d43f91922f4b734b) )
1906   ROM_LOAD( "7.11a",        0x1000, 0x1000, CRC(4a179790) SHA1(7fb6b033de939ff8bd13055c073311dca2c1a6fe) )
1907
1908   ROM_REGION( 0x2000, REGION_USER1, 0 )
1909   ROM_LOAD( "5.5lm",        0x0000, 0x1000, CRC(7761ad24) SHA1(98878b19addd142d35718080eece05eaaee0388d) )   /* ?? */
1910   ROM_LOAD( "6.5n",         0x1000, 0x1000, CRC(da48444c) SHA1(a43e672ce262eb817fb4e5715ef4fb304a6a2815) )
1911
1912   ROM_REGION( 0x00a0, REGION_PROMS, 0 )
1913   ROM_LOAD( "1.bpr",        0x0000, 0x0020, CRC(ef2053ab) SHA1(2006cbf003f90a8e75f39047a88a3bba85d78e80) )
1914   ROM_LOAD( "2.bpr",        0x0020, 0x0020, CRC(2281d39f) SHA1(e9b568bdacf7ab611801cf42ea5c7624f5440ef6) )
1915   ROM_LOAD( "3.bpr",        0x0040, 0x0020, CRC(9e6341e3) SHA1(2e7a4d3c1f40d6089735734b9d9de2ca57fb73c7) )
1916   ROM_LOAD( "4.bpr",        0x0060, 0x0020, CRC(1c97dc0b) SHA1(fe8e0a91172abdd2d14b199da144306a9b944372) )
1917   ROM_LOAD( "5.bpr",        0x0080, 0x0020, CRC(edd6c05f) SHA1(b95db8aaf74fe175d1179f0d85f79242b16f5fb4) )
1918ROM_END
1919
1920ROM_START( yamato2 )
1921   ROM_REGION( 2*0x10000, REGION_CPU1, 0 )
1922   ROM_LOAD( "2-2.5de",      0x0000, 0x2000, CRC(93da1d52) SHA1(21b72856ebbd969e4e075b52719e6acdbd1bc4c5) )
1923   ROM_LOAD( "3-2.5f",       0x2000, 0x2000, CRC(31e73821) SHA1(e582c9fcea1b29d43f65b6aa67e1895c38d2736c) )
1924   ROM_LOAD( "4-2.5jh",      0x4000, 0x2000, CRC(fd7bcfc3) SHA1(5037170cb3a9824794e90d74def92b0b25d45caa) )
1925   /* hole at 6000-6fff */
1926   /* 7000-7fff not present here */
1927
1928   ROM_REGION( 0x10000, REGION_CPU2, 0 )
1929   ROM_LOAD( "1.5v",         0x0000, 0x0800, CRC(3aad9e3c) SHA1(37b0414b265397881bb45b166ecab85880d1358d) )
1930
1931   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
1932   ROM_LOAD( "10.11k",       0x0000, 0x2000, CRC(161121f5) SHA1(017c5c6b773b0ae1d0be52e4bac90b699ea196dd) )
1933   ROM_LOAD( "9.11h",        0x2000, 0x2000, CRC(56e84cc4) SHA1(c48e0e5460376d6b34173c42a27907ef12218182) )
1934
1935   ROM_REGION( 0x2000, REGION_GFX2, ROMREGION_DISPOSE )
1936   ROM_LOAD( "8.11c",        0x0000, 0x1000, CRC(28024d9a) SHA1(c871c4d74be72a8bfea99e89d43f91922f4b734b) )
1937   ROM_LOAD( "7.11a",        0x1000, 0x1000, CRC(4a179790) SHA1(7fb6b033de939ff8bd13055c073311dca2c1a6fe) )
1938
1939   ROM_REGION( 0x2000, REGION_USER1, 0 )
1940   ROM_LOAD( "5.5lm",        0x0000, 0x1000, CRC(7761ad24) SHA1(98878b19addd142d35718080eece05eaaee0388d) )   /* ?? */
1941   ROM_LOAD( "6.5n",         0x1000, 0x1000, CRC(da48444c) SHA1(a43e672ce262eb817fb4e5715ef4fb304a6a2815) )
1942
1943   ROM_REGION( 0x00a0, REGION_PROMS, 0 )
1944   ROM_LOAD( "1.bpr",        0x0000, 0x0020, CRC(ef2053ab) SHA1(2006cbf003f90a8e75f39047a88a3bba85d78e80) )
1945   ROM_LOAD( "2.bpr",        0x0020, 0x0020, CRC(2281d39f) SHA1(e9b568bdacf7ab611801cf42ea5c7624f5440ef6) )
1946   ROM_LOAD( "3.bpr",        0x0040, 0x0020, CRC(9e6341e3) SHA1(2e7a4d3c1f40d6089735734b9d9de2ca57fb73c7) )
1947   ROM_LOAD( "4.bpr",        0x0060, 0x0020, CRC(1c97dc0b) SHA1(fe8e0a91172abdd2d14b199da144306a9b944372) )
1948   ROM_LOAD( "5.bpr",        0x0080, 0x0020, CRC(edd6c05f) SHA1(b95db8aaf74fe175d1179f0d85f79242b16f5fb4) )
1949ROM_END
1950
1951ROM_START( toprollr )
1952   ROM_REGION( 0x10000*2, REGION_CPU1, 0 )
1953   ROM_LOAD( "10.k3", 0xc000, 0x2000, CRC(1e8914a6) SHA1(ec17f185f890d04ce75a5d8edf8b32da60e7a8d8) )
1954   ROM_LOAD( "11.l3", 0xe000, 0x2000, CRC(b20a9fa2) SHA1(accd3296447eca002b0808e7b02832f5e35407e8) )
1955
1956   ROM_REGION( 0x04000, REGION_GFX1, ROMREGION_DISPOSE )
1957   ROM_LOAD( "16.j4", 0x0000, 0x2000, CRC(ce3afe26) SHA1(7de00720f091537c64cc0fec687c061de3a8b1a3) )
1958   ROM_LOAD( "15.h4", 0x2000, 0x2000, CRC(1d9e3325) SHA1(e7f6863aa2ba2aeec40cfcc5cf6c69e947c185b5) )
1959
1960   ROM_REGION( 0x04000, REGION_GFX2, ROMREGION_DISPOSE )
1961   ROM_LOAD( "14.c4", 0x0000, 0x2000, CRC(7a945733) SHA1(14187ba303aecf0a812c425c34d8edda3deaa2b5) )
1962   ROM_LOAD( "13.a4", 0x2000, 0x2000, CRC(89327329) SHA1(555331a3136aa8c5bb35b97dd54bc59da067be57) )
1963
1964   ROM_REGION( 0x2000, REGION_GFX3, ROMREGION_DISPOSE )
1965   ROM_LOAD( "6.m5",  0x0000, 0x1000, CRC(e30c1dd8) SHA1(1777bf98625153c9b191020860e4e1839b46b998) )
1966   ROM_LOAD( "5.l5",  0x1000, 0x1000, CRC(84139f46) SHA1(976f781fb279dd540778708174b942a263f16443) )
1967
1968   ROM_REGION( 0x12000, REGION_USER1, 0 )
1969   ROM_LOAD( "2.f5",   0x00000, 0x02000, CRC(ef789f00) SHA1(424d69584d391ee7b9ad5db7ee6ced97d69897d4) )
1970   ROM_LOAD( "8.f3",   0x02000, 0x02000, CRC(94371cfb) SHA1(cb501c36b213c995a4048b3a96c85848c556cd05) )
1971   ROM_LOAD( "4.k5",   0x04000, 0x02000, CRC(1cb48ea0) SHA1(fdc75075112042ec84a7d1b3e5b5a6db1d1cb871) )
1972   ROM_COPY( REGION_USER1, 0x04000, 0x0a000, 0x02000 )
1973   ROM_COPY( REGION_USER1, 0x04000, 0x10000, 0x02000 )
1974   ROM_LOAD( "3.h5",   0x06000, 0x02000, CRC(d45494ba) SHA1(6e235b34f9457acadad6d4e27799978bc2e3db08) )
1975   ROM_LOAD( "9.h3",   0x08000, 0x02000, CRC(8a8032a7) SHA1(d6642d72645c613c21f65bbbe1560d0437d41f43) )
1976   ROM_LOAD( "1.d5",   0x0c000, 0x02000, CRC(9894374d) SHA1(173de4abbc3fb5d522aa6d6d5caf8e4d54f2a598) )
1977   ROM_LOAD( "7.d3",   0x0e000, 0x02000, CRC(904fffb6) SHA1(5528bc2a4d2fe8672428fd4725644265f0d57ded) )
1978
1979   ROM_REGION( 0x2000, REGION_SOUND1, 0 )
1980   ROM_LOAD( "12.p3",  0x0000, 0x2000, CRC(7f989dc9) SHA1(3b4d18cbb992872b3cf8f5eaf5381ed3a9468cc1) )
1981
1982   ROM_REGION( 0x01a0, REGION_PROMS, 0 )
1983   ROM_LOAD( "prom.p2",  0x0000, 0x0020, CRC(42e828fa) SHA1(81250b1f7c3956b3902324adbbaf3b5989e854ee) ) //08-0f sprites + fg (wrong?)
1984   ROM_LOAD( "prom.r2",  0x0020, 0x0020, CRC(99b87eed) SHA1(06c3164d681fe4aff0338c0dad1a921f7fe7369d) ) //10-17 sprites
1985   ROM_LOAD( "prom.a1",  0x0040, 0x0020, CRC(7d626d6c) SHA1(7c7202d0ec5bf0381e7104eef53afa5fa4596a29) ) //00-07 big sprites
1986   ROM_LOAD( "prom.p9",  0x0060, 0x0020, CRC(eb399c02) SHA1(bf3d6c6dd982cb54446cf8a010b7adb949514bdb) ) //18-1f bg
1987   ROM_LOAD( "prom.n9",  0x0080, 0x0020, CRC(fb03ea99) SHA1(4dcef86106cef713dfcbd965072bfa8fe4b68e15) ) //20-27 bg
1988   ROM_LOAD( "prom.s9",  0x00a0, 0x0100, CRC(abf4c5fb) SHA1(a953f14642d4b72328293b36bc3c65b13491ffff) ) //unknown prom (filled with 2 bit vals)
1989
1990ROM_END
1991
1992
1993static DRIVER_INIT( yamato )
1994{
1995   yamato_decode();
1996}
1997
1998
1999static DRIVER_INIT( toprollr )
2000{
2001   toprollr_decode();
2002}
2003
2004
15482005GAME( 1980, cclimber, 0,        cclimber, cclimber, cclimber, ROT0,   "Nichibutsu", "Crazy Climber (US)", 0 )
15492006GAME( 1980, cclimbrj, cclimber, cclimber, cclimbrj, cclimbrj, ROT0,   "Nichibutsu", "Crazy Climber (Japan)", 0 )
15502007GAME( 1980, ccboot,   cclimber, cclimber, cclimber, cclimbrj, ROT0,   "bootleg", "Crazy Climber (bootleg set 1)", 0 )
r1771r1772
15572014GAME( 198?, bigkong,  ckong,    cclimber, ckong,    0,        ROT270, "bootleg", "Big Kong", 0 )
15582015GAME( 1981, monkeyd,  ckong,    cclimber, ckong,    0,        ROT270, "bootleg", "Monkey Donkey", 0 )
15592016GAME( 198?, ckongb,   ckong,    cclimber, ckongb,   ckongb,   ROT270, "bootleg", "Crazy Kong Part II (alternative levels)", 0 )
1560
15612017GAME( 1981, rpatrol,  0,        cclimber, rpatrol,  0,        ROT0,   "Orca", "River Patrol (Orca)", 0 )
15622018GAME( 1981, rpatrolb, rpatrol,  cclimber, rpatrol,  0,        ROT0,   "bootleg", "River Patrol (bootleg)", 0 )
15632019GAME( 1981, silvland, rpatrol,  cclimber, rpatrol,  0,        ROT0,   "Falcon", "Silver Land", 0 )
1564
15652020GAME( 1985, cannonb,  cannonbp, cannonb,  cannonb,  cannonb,  ROT90,  "Soft", "Cannon Ball (bootleg on Crazy Climber hardware, set 1)" , GAME_IMPERFECT_GRAPHICS )
15662021GAME( 1985, cannonb2, cannonbp, cannonb,  cannonb,  cannonb2, ROT90,  "TV Game Gruenberg", "Cannon Ball (bootleg on Crazy Climber hardware, set 2)", 0 )
1567
15682022GAME( 1982, swimmer,  0,        swimmer,  swimmer,  0,        ROT0,   "Tehkan", "Swimmer (set 1)", 0 )
15692023GAME( 1982, swimmera, swimmer,  swimmer,  swimmer,  0,        ROT0,   "Tehkan", "Swimmer (set 2)", 0 )
15702024GAME( 1982, swimmerb, swimmer,  swimmer,  swimmerb, 0,        ROT0,   "Tehkan", "Swimmer (set 3)", 0 )
15712025GAME( 1983, guzzler,  0,        swimmer,  guzzler,  0,        ROT90,  "Tehkan", "Guzzler", 0 )
2026GAME( 1983, yamato,   0,        yamato,   yamato,   yamato,   ROT90,  "Sega", "Yamato (US)", GAME_IMPERFECT_GRAPHICS )
2027GAME( 1983, yamato2,  yamato,   yamato,   yamato,   yamato,   ROT90,  "Sega", "Yamato (World?)", GAME_IMPERFECT_GRAPHICS )
2028GAME( 1983, toprollr, 0,        toprollr, toprollr, toprollr, ROT90,  "Jaleco", "Top Roller", GAME_IMPERFECT_COLORS )
src/mame/drivers/enigma2.c
r1771r1772
192192         offs_t color_map_address = (y >> 3 << 5) | (x >> 3);
193193         /* the schematics shows it like this, but it doesn't work as this would
194194               produce no stars, due to the contents of the PROM -- maybe there is
195               a star disabled bit somewhere that's connected here instead of flip_screen */
196         /* star_map_address = (y >> 4 << 6) | (engima2_flip_screen << 5) | (x >> 3); */
195               a star disabled bit somewhere that's connected here instead of flip_screen_get() */
196         /* star_map_address = (y >> 4 << 6) | (engima2_flip_screen_get() << 5) | (x >> 3); */
197197         offs_t star_map_address = (y >> 4 << 6) | 0x20 | (x >> 3);
198198
199199         offs_t videoram_address = (y << 5) | (x >> 3);
src/mame/drivers/acefruit.c
r1771r1772
299299   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME( "Cancel/Clear" )
300300   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME( "Refill" ) PORT_TOGGLE
301301   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )              /* "Token in" - also "Refill" when "Refill" mode ON */
302   PORT_BIT( 0x08, 0x00, IPT_SPECIAL) PORT_CUSTOM(sidewndr_payout_r, 0x01)
302   PORT_BIT( 0x08, 0x00, IPT_SPECIAL) PORT_CUSTOM(sidewndr_payout_r, (void *)0x01)
303303   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN )
304304
305305   PORT_START_TAG("IN3")   // 3
306306   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME( "Hold/Nudge 1" )
307307   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME( "Accountancy System" ) PORT_TOGGLE
308308   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN4 )              /* "50P in" */
309   PORT_BIT( 0x08, 0x00, IPT_SPECIAL) PORT_CUSTOM(sidewndr_payout_r, 0x02)
309   PORT_BIT( 0x08, 0x00, IPT_SPECIAL) PORT_CUSTOM(sidewndr_payout_r, (void *)0x02)
310310   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN )
311311
312312   PORT_START_TAG("IN4")   // 4
r1771r1772
413413   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME( "Collect/Cancel" )
414414   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
415415   /* tested at 0xeed7 with IN1 bit 3 - before coins are tested - table at 0xef55 (4 * 3 bytes) */
416   PORT_BIT( 0x08, 0x00, IPT_SPECIAL) PORT_CUSTOM(starspnr_coinage_r, 0x08) /* to be confirmed */
416   PORT_BIT( 0x08, 0x00, IPT_SPECIAL) PORT_CUSTOM(starspnr_coinage_r, (void *)0x08) /* to be confirmed */
417417
418418   PORT_START_TAG("IN2")   // 2
419419   /* tested at 0xe83c */
r1771r1772
423423   /* tested at 0xef82 after IN5 bit 1 and after IN1 bit 3 - after coins are tested - table at 0xefa8 (3 bytes) */
424424   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
425425   /* tested at 0xeeba with IN3 bit 3 - before coins are tested - table at 0xef55 (4 * 3 bytes) */
426   PORT_BIT( 0x08, 0x00, IPT_SPECIAL) PORT_CUSTOM(starspnr_coinage_r, 0x02) /* to be confirmed */
426   PORT_BIT( 0x08, 0x00, IPT_SPECIAL) PORT_CUSTOM(starspnr_coinage_r, (void *)0x02) /* to be confirmed */
427427   /* tested at 0x1b0f */
428428   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
429429
r1771r1772
432432   /* tested at 0xe8ea and 0xecbe */
433433   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
434434   /* tested at 0xeeba with IN2 bit 3 - before coins are tested - table at 0xef55 (4 * 3 bytes) */
435   PORT_BIT( 0x08, 0x00, IPT_SPECIAL) PORT_CUSTOM(starspnr_coinage_r, 0x01) /* to be confirmed */
435   PORT_BIT( 0x08, 0x00, IPT_SPECIAL) PORT_CUSTOM(starspnr_coinage_r, (void *)0x01) /* to be confirmed */
436436   /* tested at 0x0178 */
437437   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
438438
r1771r1772
443443   /* tested at 0xed86 */
444444   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
445445   /* tested at 0xeed7 with IN1 bit 3 - before coins are tested - table at 0xef55 (4 * 3 bytes) */
446   PORT_BIT( 0x08, 0x00, IPT_SPECIAL) PORT_CUSTOM(starspnr_coinage_r, 0x04) /* to be confirmed */
446   PORT_BIT( 0x08, 0x00, IPT_SPECIAL) PORT_CUSTOM(starspnr_coinage_r, (void *)0x04) /* to be confirmed */
447447
448448   PORT_START_TAG("IN5")   // 5
449449   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON9 ) PORT_NAME( "Hold 3" )
r1771r1772
452452   /* tested at 0xec6f */
453453   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
454454   /* tested at 0x1d60 with IN6 bit 3 and IN7 bit 3 - table at 0x1d90 (8 * 3 bytes) */
455   PORT_BIT( 0x08, 0x00, IPT_SPECIAL) PORT_CUSTOM(starspnr_payout_r, 0x01) /* to be confirmed */
455   PORT_BIT( 0x08, 0x00, IPT_SPECIAL) PORT_CUSTOM(starspnr_payout_r, (void *)0x01) /* to be confirmed */
456456   /* tested at 0xe312 and 0xe377 */
457457   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
458458
r1771r1772
461461   /* tested at 0xee42, 0xee5e and 0xeff5 before IN1 bit 0 - invalid code after 0xf000 */
462462   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
463463   /* tested at 0x1d60 with IN5 bit 3 and IN7 bit 3 - table at 0x1d90 (8 * 3 bytes) */
464   PORT_BIT( 0x08, 0x00, IPT_SPECIAL) PORT_CUSTOM(starspnr_payout_r, 0x02) /* to be confirmed */
464   PORT_BIT( 0x08, 0x00, IPT_SPECIAL) PORT_CUSTOM(starspnr_payout_r, (void *)0x02) /* to be confirmed */
465465   /* tested at 0xe8dd and 0xec1c */
466466   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
467467
r1771r1772
473473   /* tested at 0xedcb */
474474   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
475475   /* tested at 0x1d60 with IN5 bit 3 and IN6 bit 3 - table at 0x1d90 (8 * 3 bytes) */
476   PORT_BIT( 0x08, 0x00, IPT_SPECIAL) PORT_CUSTOM(starspnr_payout_r, 0x04) /* to be confirmed */
476   PORT_BIT( 0x08, 0x00, IPT_SPECIAL) PORT_CUSTOM(starspnr_payout_r, (void *)0x04) /* to be confirmed */
477477   /* tested at 0xec2a */
478478   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
479479
src/mame/drivers/dkong.c
r1771r1772
9696  I have added a driver configuration switch to switch between TKG4 and TKG2-01 (radarscope) palettes.
9797  At a later stage, a TKG2-02 will be added as well.
9898
99  Mike Haaland provided the following information on startup sounds:
99100
101  For both of these boards [dkong, dkongjr], only the jump sound
102  is distinguishable. I don't hear the pound of walk sound.
103
100104Donkey Kong and Donkey Kong Jr. memory map (preliminary) (DKong 3 follows)
101105
1021060000-3fff ROM (Donkey Kong Jr.and Donkey Kong 3: 0000-5fff)
r1771r1772
717721static ADDRESS_MAP_START( dkong_map, ADDRESS_SPACE_PROGRAM, 8 )
718722   AM_RANGE(0x0000, 0x3fff) AM_ROM
719723   AM_RANGE(0x6000, 0x6bff) AM_RAM
720   AM_RANGE(0x7000, 0x73ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)  /* sprite set 1 */
721   AM_RANGE(0x7400, 0x77ff) AM_READWRITE(MRA8_RAM, dkong_videoram_w) AM_BASE(&videoram)
724   AM_RANGE(0x7000, 0x73ff) AM_RAM AM_BASE_MEMBER(dkong_state, sprite_ram)
725                           AM_SIZE_MEMBER(dkong_state, sprite_ram_size)  /* sprite set 1 */
726   AM_RANGE(0x7400, 0x77ff) AM_READWRITE(MRA8_RAM, dkong_videoram_w)
727                            AM_BASE_MEMBER(dkong_state, video_ram)
722728   AM_RANGE(0x7800, 0x780f) AM_READWRITE(dma8257_0_r, dma8257_0_w)              /* P8257 control registers */
723729   AM_RANGE(0x7c00, 0x7c00) AM_READ_PORT("IN0") AM_WRITE(dkong_sh_tuneselect_w)  /* IN0, sound CPU intf */
724730   AM_RANGE(0x7c80, 0x7c80) AM_READ_PORT("IN1") AM_WRITE(radarscp_grid_color_w)  /* IN1 */
r1771r1772
737743   AM_RANGE(0x0000, 0x5fff) AM_ROM
738744   AM_RANGE(0x6000, 0x6bff) AM_RAM
739745   AM_RANGE(0x6c00, 0x6fff) AM_RAM                                              /* DK3 bootleg only */
740   AM_RANGE(0x7000, 0x73ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) /* sprite set 1 */
741   AM_RANGE(0x7400, 0x77ff) AM_READWRITE(MRA8_RAM, dkong_videoram_w) AM_BASE(&videoram)
746   AM_RANGE(0x7000, 0x73ff) AM_RAM AM_BASE_MEMBER(dkong_state, sprite_ram)
747                           AM_SIZE_MEMBER(dkong_state, sprite_ram_size) /* sprite set 1 */
748   AM_RANGE(0x7400, 0x77ff) AM_READWRITE(MRA8_RAM, dkong_videoram_w)
749                           AM_BASE_MEMBER(dkong_state, video_ram)
742750   AM_RANGE(0x7800, 0x780f) AM_READWRITE(dma8257_0_r, dma8257_0_w)            /* P8257 control registers */
743751   AM_RANGE(0x7c00, 0x7c00) AM_READ_PORT("IN0") AM_WRITE(dkongjr_sh_tuneselect_w)
744752   AM_RANGE(0x7c80, 0x7c80) AM_READ_PORT("IN1") AM_WRITE(dkongjr_gfxbank_w)
r1771r1772
761769   AM_RANGE(0x0000, 0x5fff) AM_ROM
762770   AM_RANGE(0x6000, 0x67ff) AM_RAM
763771   AM_RANGE(0x6800, 0x6fff) AM_RAM
764   AM_RANGE(0x7000, 0x73ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) /* sprite set 1 */
765   AM_RANGE(0x7400, 0x77ff) AM_READWRITE(MRA8_RAM, dkong_videoram_w) AM_BASE(&videoram)
772   AM_RANGE(0x7000, 0x73ff) AM_RAM AM_BASE_MEMBER(dkong_state, sprite_ram)
773                           AM_SIZE_MEMBER(dkong_state, sprite_ram_size) /* sprite set 1 */
774   AM_RANGE(0x7400, 0x77ff) AM_READWRITE(MRA8_RAM, dkong_videoram_w)
775                           AM_BASE_MEMBER(dkong_state, video_ram)
766776   AM_RANGE(0x7c00, 0x7c00) AM_READ_PORT("IN0")  AM_WRITE(soundlatch_w)
767777   AM_RANGE(0x7c80, 0x7c80) AM_READ_PORT("IN1")  AM_WRITE(soundlatch2_w)
768778   AM_RANGE(0x7d00, 0x7d00) AM_READ_PORT("DSW0") AM_WRITE(soundlatch3_w)
r1771r1772
794804
795805static ADDRESS_MAP_START( hunchbkd_map, ADDRESS_SPACE_PROGRAM, 8 )
796806   AM_RANGE(0x0000, 0x0fff) AM_ROM
797   AM_RANGE(0x1000, 0x13ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)  /* 0x7000 */
807   AM_RANGE(0x1000, 0x13ff) AM_RAM AM_BASE_MEMBER(dkong_state, sprite_ram)
808                           AM_SIZE_MEMBER(dkong_state, sprite_ram_size)  /* 0x7000 */
798809   AM_RANGE(0x1400, 0x1400) AM_READ_PORT("IN0") AM_WRITE(dkong_sh_tuneselect_w)
799810   AM_RANGE(0x1480, 0x1480) AM_READ_PORT("IN1")
800811   AM_RANGE(0x1500, 0x1500) AM_READ(dkong_in2_r)                                 /* IN2 */
r1771r1772
806817   AM_RANGE(0x1585, 0x1585) AM_WRITE(p8257_drq_w)                          /* P8257 ==> /DRQ0 /DRQ1 */
807818   AM_RANGE(0x1586, 0x1587) AM_WRITE(dkong_palettebank_w)
808819   AM_RANGE(0x1600, 0x17ff) AM_RAM                                               /* 0x6400  spriteram location */
809   AM_RANGE(0x1800, 0x1bff) AM_READWRITE(MRA8_RAM, dkong_videoram_w) AM_BASE(&videoram) /* 0x7400 */
820   AM_RANGE(0x1800, 0x1bff) AM_READWRITE(MRA8_RAM, dkong_videoram_w)
821                           AM_BASE_MEMBER(dkong_state, video_ram)        /* 0x7400 */
810822   AM_RANGE(0x1C00, 0x1f7f) AM_RAM                                               /* 0x6000 */
811823   AM_RANGE(0x1f80, 0x1f8f) AM_READWRITE(dma8257_0_r, dma8257_0_w)              /* P8257 control registers */
812824   /* 0x6800 not remapped */
src/mame/drivers/sprint4.c
r1771r1772
279279
280280   PORT_START_TAG("COLLISION")
281281   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Player 1 Gas") PORT_PLAYER(1)
282   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM( get_collision, 0 )
282   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM( get_collision, (void *)0 )
283283   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Player 2 Gas") PORT_PLAYER(2)
284   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM( get_collision, 1 )
284   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM( get_collision, (void *)1 )
285285   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Player 3 Gas") PORT_PLAYER(3)
286   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM( get_collision, 2 )
286   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM( get_collision, (void *)2 )
287287   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Player 4 Gas") PORT_PLAYER(4)
288   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM( get_collision, 3 )
288   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM( get_collision, (void *)3 )
289289
290290   PORT_START_TAG("COIN")
291291   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
r1771r1772
316316   PORT_DIPSETTING(    0xe0, "150 seconds" )
317317
318318   PORT_START_TAG("ANALOG")
319   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM( get_wheel, 0)
320   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM( get_lever, 0)
321   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM( get_wheel, 1)
322   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM( get_lever, 1)
323   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM( get_wheel, 2)
324   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM( get_lever, 2)
325   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM( get_wheel, 3)
326   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM( get_lever, 3)
319   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM( get_wheel, (void *)0)
320   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM( get_lever, (void *)0)
321   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM( get_wheel, (void *)1)
322   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM( get_lever, (void *)1)
323   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM( get_wheel, (void *)2)
324   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM( get_lever, (void *)2)
325   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM( get_wheel, (void *)3)
326   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM( get_lever, (void *)3)
327327
328328   PORT_START_TAG("WHEEL1")
329329   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(16) PORT_PLAYER(1)
src/mame/drivers/appoooh.c
r1771r1772
8686
8787
8888
89static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
90   AM_RANGE(0x0000, 0x7fff) AM_READ(MRA8_ROM)
91   AM_RANGE(0x8000, 0x9fff) AM_READ(MRA8_ROM)
92   AM_RANGE(0xa000, 0xdfff) AM_READ(MRA8_BANK1)
93   AM_RANGE(0xe000, 0xe7ff) AM_READ(MRA8_RAM)
94   AM_RANGE(0xe800, 0xefff) AM_READ(MRA8_RAM) /* RAM ? */
95   AM_RANGE(0xf000, 0xffff) AM_READ(MRA8_RAM)
96ADDRESS_MAP_END
89static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
90   AM_RANGE(0x0000, 0x7fff) AM_ROM
91   AM_RANGE(0x8000, 0x9fff) AM_ROM
92   AM_RANGE(0xa000, 0xdfff) AM_ROMBANK(1)
93   AM_RANGE(0xe000, 0xe7ff) AM_RAM
94   AM_RANGE(0xe800, 0xefff) AM_RAM /* RAM ? */
9795
98static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
99   AM_RANGE(0x0000, 0x7fff) AM_WRITE(MWA8_ROM)
100   AM_RANGE(0x8000, 0xdfff) AM_WRITE(MWA8_ROM)
101   AM_RANGE(0xe000, 0xe7ff) AM_WRITE(MWA8_RAM)
102   AM_RANGE(0xe800, 0xefff) AM_WRITE(MWA8_RAM) /* RAM ? */
103   AM_RANGE(0xf000, 0xf01f) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram)
96   AM_RANGE(0xf000, 0xf01f) AM_BASE(&spriteram)
10497   AM_RANGE(0xf020, 0xf3ff) AM_WRITE(appoooh_fg_videoram_w) AM_BASE(&appoooh_fg_videoram)
10598   AM_RANGE(0xf420, 0xf7ff) AM_WRITE(appoooh_fg_colorram_w) AM_BASE(&appoooh_fg_colorram)
106   AM_RANGE(0xf800, 0xf81f) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram_2)
99   AM_RANGE(0xf800, 0xf81f) AM_BASE(&spriteram_2)
107100   AM_RANGE(0xf820, 0xfbff) AM_WRITE(appoooh_bg_videoram_w) AM_BASE(&appoooh_bg_videoram)
108101   AM_RANGE(0xfc20, 0xffff) AM_WRITE(appoooh_bg_colorram_w) AM_BASE(&appoooh_bg_colorram)
102   AM_RANGE(0xf000, 0xffff) AM_RAM
109103ADDRESS_MAP_END
110104
111static ADDRESS_MAP_START( readport, ADDRESS_SPACE_IO, 8 )
105static ADDRESS_MAP_START( main_portmap, ADDRESS_SPACE_IO, 8 )
112106   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
113   AM_RANGE(0x00, 0x00) AM_READ(input_port_0_r)   /* IN0 */
114   AM_RANGE(0x01, 0x01) AM_READ(input_port_1_r)   /* IN1 */
115   AM_RANGE(0x03, 0x03) AM_READ(input_port_3_r)   /* DSW */
116   AM_RANGE(0x04, 0x04) AM_READ(input_port_2_r)   /* IN2 */
117ADDRESS_MAP_END
118
119static ADDRESS_MAP_START( writeport, ADDRESS_SPACE_IO, 8 )
120   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
121   AM_RANGE(0x00, 0x00) AM_WRITE(SN76496_0_w)
122   AM_RANGE(0x01, 0x01) AM_WRITE(SN76496_1_w)
107   AM_RANGE(0x00, 0x00) AM_READWRITE(input_port_0_r, SN76496_0_w)
108   AM_RANGE(0x01, 0x01) AM_READWRITE(input_port_1_r, SN76496_1_w)
123109   AM_RANGE(0x02, 0x02) AM_WRITE(SN76496_2_w)
124   AM_RANGE(0x03, 0x03) AM_WRITE(appoooh_adpcm_w)
125   AM_RANGE(0x04, 0x04) AM_WRITE(appoooh_out_w)
110   AM_RANGE(0x03, 0x03) AM_READWRITE(input_port_3_r, appoooh_adpcm_w)
111   AM_RANGE(0x04, 0x04) AM_READWRITE(input_port_2_r, appoooh_out_w)
126112   AM_RANGE(0x05, 0x05) AM_WRITE(appoooh_scroll_w) /* unknown */
127113ADDRESS_MAP_END
128114
r1771r1772
228214
229215   /* basic machine hardware */
230216   MDRV_CPU_ADD(Z80,18432000/6)   /* ??? the main xtal is 18.432 MHz */
231   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
232   MDRV_CPU_IO_MAP(readport,writeport)
217   MDRV_CPU_PROGRAM_MAP(main_map,0)
218   MDRV_CPU_IO_MAP(main_portmap,0)
233219   MDRV_CPU_VBLANK_INT(nmi_line_pulse,1)
234220
235221   /* video hardware */
r1771r1772
430416
431417   /* basic machine hardware */
432418   MDRV_CPU_ADD(Z80,18432000/6)   /* ??? the main xtal is 18.432 MHz */
433   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
434   MDRV_CPU_IO_MAP(readport,writeport)
419   MDRV_CPU_PROGRAM_MAP(main_map,0)
420   MDRV_CPU_IO_MAP(main_portmap,0)
435421   MDRV_CPU_VBLANK_INT(nmi_line_pulse,1)
436422
437423   /* video hardware */
src/mame/drivers/hanaroku.c
r1771r1772
5353      int sx = hanaroku_spriteram1[i + 0x200] | ((hanaroku_spriteram2[i + 0x200] & 0x07) << 8);
5454      int sy = 242 - hanaroku_spriteram3[i];
5555
56      if (flip_screen)
56      if (flip_screen_get())
5757      {
5858         sy = 242 - sy;
5959         flipx = !flipx;
src/mame/drivers/aliens.c
r1771r1772
8989}
9090
9191
92static ADDRESS_MAP_START( aliens_readmem, ADDRESS_SPACE_PROGRAM, 8 )
93   AM_RANGE(0x0000, 0x03ff) AM_READ(bankedram_r)         /* palette + work RAM */
94   AM_RANGE(0x0400, 0x1fff) AM_READ(MRA8_RAM)
95   AM_RANGE(0x2000, 0x3fff) AM_READ(MRA8_BANK1)            /* banked ROM */
92static ADDRESS_MAP_START( aliens_map, ADDRESS_SPACE_PROGRAM, 8 )
93   AM_RANGE(0x0000, 0x03ff) AM_READWRITE(bankedram_r, bankedram_w) AM_BASE(&ram)         /* palette + work RAM */
94   AM_RANGE(0x0400, 0x1fff) AM_RAM
95   AM_RANGE(0x2000, 0x3fff) AM_ROMBANK(1)                  /* banked ROM */
9696   AM_RANGE(0x5f80, 0x5f80) AM_READ(input_port_2_r)         /* DIPSW #3 */
9797   AM_RANGE(0x5f81, 0x5f81) AM_READ(input_port_3_r)         /* Player 1 inputs */
9898   AM_RANGE(0x5f82, 0x5f82) AM_READ(input_port_4_r)         /* Player 2 inputs */
9999   AM_RANGE(0x5f83, 0x5f83) AM_READ(input_port_1_r)         /* DIPSW #2 */
100100   AM_RANGE(0x5f84, 0x5f84) AM_READ(input_port_0_r)         /* DIPSW #1 */
101   AM_RANGE(0x5f88, 0x5f88) AM_READ(watchdog_reset_r)
102   AM_RANGE(0x4000, 0x7fff) AM_READ(K052109_051960_r)
103   AM_RANGE(0x8000, 0xffff) AM_READ(MRA8_ROM)            /* ROM e24_j02.bin */
104ADDRESS_MAP_END
105
106static ADDRESS_MAP_START( aliens_writemem, ADDRESS_SPACE_PROGRAM, 8 )
107   AM_RANGE(0x0000, 0x03ff) AM_WRITE(bankedram_w) AM_BASE(&ram)         /* palette + work RAM */
108   AM_RANGE(0x0400, 0x1fff) AM_WRITE(MWA8_RAM)
109   AM_RANGE(0x2000, 0x3fff) AM_WRITE(MWA8_ROM)               /* banked ROM */
110   AM_RANGE(0x5f88, 0x5f88) AM_WRITE(aliens_coin_counter_w)      /* coin counters */
101   AM_RANGE(0x5f88, 0x5f88) AM_READWRITE(watchdog_reset_r, aliens_coin_counter_w)      /* coin counters */
111102   AM_RANGE(0x5f8c, 0x5f8c) AM_WRITE(aliens_sh_irqtrigger_w)      /* cause interrupt on audio CPU */
112   AM_RANGE(0x4000, 0x7fff) AM_WRITE(K052109_051960_w)
113   AM_RANGE(0x8000, 0xffff) AM_WRITE(MWA8_ROM)               /* ROM e24_j02.bin */
103   AM_RANGE(0x4000, 0x7fff) AM_READWRITE(K052109_051960_r, K052109_051960_w)
104   AM_RANGE(0x8000, 0xffff) AM_ROM                        /* ROM e24_j02.bin */
114105ADDRESS_MAP_END
115106
116static ADDRESS_MAP_START( aliens_readmem_sound, ADDRESS_SPACE_PROGRAM, 8 )
117   AM_RANGE(0x0000, 0x7fff) AM_READ(MRA8_ROM)            /* ROM g04_b03.bin */
118   AM_RANGE(0x8000, 0x87ff) AM_READ(MRA8_RAM)            /* RAM */
119   AM_RANGE(0xa001, 0xa001) AM_READ(YM2151_status_port_0_r)
107static ADDRESS_MAP_START( aliens_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
108   AM_RANGE(0x0000, 0x7fff) AM_ROM                        /* ROM g04_b03.bin */
109   AM_RANGE(0x8000, 0x87ff) AM_RAM                        /* RAM */
110   AM_RANGE(0xa000, 0xa000) AM_WRITE(YM2151_register_port_0_w)
111   AM_RANGE(0xa001, 0xa001) AM_READWRITE(YM2151_status_port_0_r, YM2151_data_port_0_w)
120112   AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_r)         /* soundlatch_r */
121   AM_RANGE(0xe000, 0xe00d) AM_READ(K007232_read_port_0_r)
113   AM_RANGE(0xe000, 0xe00d) AM_READWRITE(K007232_read_port_0_r, K007232_write_port_0_w)
122114ADDRESS_MAP_END
123115
124static ADDRESS_MAP_START( aliens_writemem_sound, ADDRESS_SPACE_PROGRAM, 8 )
125   AM_RANGE(0x0000, 0x7fff) AM_WRITE(MWA8_ROM)               /* ROM g04_b03.bin */
126   AM_RANGE(0x8000, 0x87ff) AM_WRITE(MWA8_RAM)               /* RAM */
127   AM_RANGE(0xa000, 0xa000) AM_WRITE(YM2151_register_port_0_w)
128   AM_RANGE(0xa001, 0xa001) AM_WRITE(YM2151_data_port_0_w)
129   AM_RANGE(0xe000, 0xe00d) AM_WRITE(K007232_write_port_0_w)
130ADDRESS_MAP_END
131116
132117/***************************************************************************
133118
r1771r1772
252237
253238   /* basic machine hardware */
254239   MDRV_CPU_ADD(KONAMI, 3000000)      /* ? */
255   MDRV_CPU_PROGRAM_MAP(aliens_readmem,aliens_writemem)
240   MDRV_CPU_PROGRAM_MAP(aliens_map,0)
256241   MDRV_CPU_VBLANK_INT(aliens_interrupt,1)
257242
258243   MDRV_CPU_ADD(Z80, 3579545)
259   /* audio CPU */      /* ? */
260   MDRV_CPU_PROGRAM_MAP(aliens_readmem_sound,aliens_writemem_sound)
244   MDRV_CPU_PROGRAM_MAP(aliens_sound_map,0)
261245
262246   MDRV_MACHINE_RESET(aliens)
263247
src/mame/drivers/88games.c
r1771r1772
120120   upd7759_port_w( speech_chip, data );
121121}
122122
123static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
124   AM_RANGE(0x0000, 0x1fff) AM_READ(MRA8_RAM) AM_BASE(&banked_rom)   /* banked ROM + palette RAM */
125   AM_RANGE(0x2000, 0x37ff) AM_READ(MRA8_RAM)
126   AM_RANGE(0x3800, 0x3fff) AM_READ(bankedram_r)
123static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
124   AM_RANGE(0x0000, 0x0fff) AM_RAM   AM_BASE(&banked_rom) /* banked ROM + palette RAM */
125   AM_RANGE(0x1000, 0x1fff) AM_READWRITE(MRA8_RAM, paletteram_xBBBBBGGGGGRRRRR_be_w) AM_BASE(&paletteram_1000)   /* banked ROM + palette RAM */
126   AM_RANGE(0x2000, 0x2fff) AM_RAM
127   AM_RANGE(0x3000, 0x37ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
128   AM_RANGE(0x3800, 0x3fff) AM_READWRITE(bankedram_r, bankedram_w) AM_BASE(&ram)
129   AM_RANGE(0x5f84, 0x5f84) AM_WRITE(k88games_5f84_w)
130   AM_RANGE(0x5f88, 0x5f88) AM_WRITE(watchdog_reset_w)
131   AM_RANGE(0x5f8c, 0x5f8c) AM_WRITE(soundlatch_w)
132   AM_RANGE(0x5f90, 0x5f90) AM_WRITE(k88games_sh_irqtrigger_w)
127133   AM_RANGE(0x5f94, 0x5f94) AM_READ(input_port_0_r)
128134//  AM_RANGE(0x5f95, 0x5f95) AM_READ(input_port_1_r)
129135//  AM_RANGE(0x5f96, 0x5f96) AM_READ(input_port_2_r)
r1771r1772
131137   AM_RANGE(0x5f96, 0x5f96) AM_READ(cheat2_r)   /* P3 and P4 IO and handle fake button for cheating */
132138   AM_RANGE(0x5f97, 0x5f97) AM_READ(input_port_3_r)
133139   AM_RANGE(0x5f9b, 0x5f9b) AM_READ(input_port_4_r)
134   AM_RANGE(0x4000, 0x7fff) AM_READ(K052109_051960_r)
135   AM_RANGE(0x8000, 0xffff) AM_READ(MRA8_ROM)
136ADDRESS_MAP_END
137
138static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
139   AM_RANGE(0x0000, 0x0fff) AM_WRITE(MWA8_RAM)   /* banked ROM */
140   AM_RANGE(0x1000, 0x1fff) AM_WRITE(paletteram_xBBBBBGGGGGRRRRR_be_w) AM_BASE(&paletteram_1000)   /* banked ROM + palette RAM */
141   AM_RANGE(0x2000, 0x2fff) AM_WRITE(MWA8_RAM)
142   AM_RANGE(0x3000, 0x37ff) AM_WRITE(MWA8_RAM) AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
143   AM_RANGE(0x3800, 0x3fff) AM_WRITE(bankedram_w) AM_BASE(&ram)
144   AM_RANGE(0x5f84, 0x5f84) AM_WRITE(k88games_5f84_w)
145   AM_RANGE(0x5f88, 0x5f88) AM_WRITE(watchdog_reset_w)
146   AM_RANGE(0x5f8c, 0x5f8c) AM_WRITE(soundlatch_w)
147   AM_RANGE(0x5f90, 0x5f90) AM_WRITE(k88games_sh_irqtrigger_w)
148140   AM_RANGE(0x5fc0, 0x5fcf) AM_WRITE(K051316_ctrl_0_w)
149   AM_RANGE(0x4000, 0x7fff) AM_WRITE(K052109_051960_w)
150   AM_RANGE(0x8000, 0xffff) AM_WRITE(MWA8_ROM)
141   AM_RANGE(0x4000, 0x7fff) AM_READWRITE(K052109_051960_r, K052109_051960_w)
142   AM_RANGE(0x8000, 0xffff) AM_ROM
151143ADDRESS_MAP_END
152144
153static ADDRESS_MAP_START( sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
154   AM_RANGE(0x0000, 0x7fff) AM_READ(MRA8_ROM)
155   AM_RANGE(0x8000, 0x87ff) AM_READ(MRA8_RAM)
156   AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r)
157   AM_RANGE(0xc001, 0xc001) AM_READ(YM2151_status_port_0_r)
158ADDRESS_MAP_END
159
160static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
161   AM_RANGE(0x0000, 0x7fff) AM_WRITE(MWA8_ROM)
162   AM_RANGE(0x8000, 0x87ff) AM_WRITE(MWA8_RAM)
145static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
146   AM_RANGE(0x0000, 0x7fff) AM_ROM
147   AM_RANGE(0x8000, 0x87ff) AM_RAM
163148   AM_RANGE(0x9000, 0x9000) AM_WRITE(speech_msg_w)
149   AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r)
164150   AM_RANGE(0xc000, 0xc000) AM_WRITE(YM2151_register_port_0_w)
165   AM_RANGE(0xc001, 0xc001) AM_WRITE(YM2151_data_port_0_w)
151   AM_RANGE(0xc001, 0xc001) AM_READWRITE(YM2151_status_port_0_r, YM2151_data_port_0_w)
166152   AM_RANGE(0xe000, 0xe000) AM_WRITE(speech_control_w)
167153ADDRESS_MAP_END
168154
r1771r1772
292278
293279   /* basic machine hardware */
294280   MDRV_CPU_ADD(KONAMI, 3000000) /* ? */
295   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
281   MDRV_CPU_PROGRAM_MAP(main_map,0)
296282   MDRV_CPU_VBLANK_INT(k88games_interrupt,1)
297283
298284   MDRV_CPU_ADD(Z80, 3579545)
299   /* audio CPU */
300   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
285   MDRV_CPU_PROGRAM_MAP(sound_map,0)
301286
302287   MDRV_MACHINE_RESET(88games)
303288   MDRV_NVRAM_HANDLER(generic_0fill)
src/mame/drivers/20pacgal.c
r1771r1772
231231   AM_RANGE(0x88, 0x88) AM_WRITE(rom_bank_select_w)
232232   AM_RANGE(0x89, 0x89) AM_WRITE(_20pacgal_dac_w)
233233   AM_RANGE(0x8a, 0x8a) AM_WRITE(MWA8_NOP)            /* stars: bits 3-4 = active set; bit 5 = enable */
234   AM_RANGE(0x8b, 0x8b) AM_WRITE(MWA8_RAM) AM_BASE_MEMBER(_20pacgal_state, flip_screen)
234   AM_RANGE(0x8b, 0x8b) AM_WRITE(MWA8_RAM) AM_BASE_MEMBER(_20pacgal_state, flip)
235235   AM_RANGE(0x8f, 0x8f) AM_WRITE(_20pacgal_coin_counter_w)
236236ADDRESS_MAP_END
237237
src/mame/drivers/nyny.c
r1771r1772
304304
305305
306306static void nyny_update_row(running_machine *machine, mc6845_t *mc6845, mame_bitmap *bitmap, const rectangle *cliprect,
307                     UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, void *param)
307                     UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param)
308308{
309309   UINT8 cx;
310310
src/mame/drivers/actfancr.c
r1771r1772
9090
9191/******************************************************************************/
9292
93static ADDRESS_MAP_START( actfan_readmem, ADDRESS_SPACE_PROGRAM, 8 )
94   AM_RANGE(0x000000, 0x02ffff) AM_READ(MRA8_ROM)
95   AM_RANGE(0x062000, 0x063fff) AM_READ(actfancr_pf1_data_r)
96   AM_RANGE(0x072000, 0x0727ff) AM_READ(actfancr_pf2_data_r)
97   AM_RANGE(0x100000, 0x1007ff) AM_READ(MRA8_RAM)
98   AM_RANGE(0x130000, 0x130003) AM_READ(actfan_control_1_r)
99   AM_RANGE(0x140000, 0x140001) AM_READ(actfan_control_0_r)
100   AM_RANGE(0x120000, 0x1205ff) AM_READ(MRA8_RAM)
101   AM_RANGE(0x1f0000, 0x1f3fff) AM_READ(MRA8_RAM)
102ADDRESS_MAP_END
103
104static ADDRESS_MAP_START( actfan_writemem, ADDRESS_SPACE_PROGRAM, 8 )
105   AM_RANGE(0x000000, 0x02ffff) AM_WRITE(MWA8_ROM)
93static ADDRESS_MAP_START( actfan_map, ADDRESS_SPACE_PROGRAM, 8 )
94   AM_RANGE(0x000000, 0x02ffff) AM_ROM
10695   AM_RANGE(0x060000, 0x06001f) AM_WRITE(actfancr_pf1_control_w)
107   AM_RANGE(0x062000, 0x063fff) AM_WRITE(actfancr_pf1_data_w) AM_BASE(&actfancr_pf1_data)
96   AM_RANGE(0x062000, 0x063fff) AM_READWRITE(actfancr_pf1_data_r, actfancr_pf1_data_w) AM_BASE(&actfancr_pf1_data)
10897   AM_RANGE(0x070000, 0x07001f) AM_WRITE(actfancr_pf2_control_w)
109   AM_RANGE(0x072000, 0x0727ff) AM_WRITE(actfancr_pf2_data_w) AM_BASE(&actfancr_pf2_data)
110   AM_RANGE(0x100000, 0x1007ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
98   AM_RANGE(0x072000, 0x0727ff) AM_READWRITE(actfancr_pf2_data_r, actfancr_pf2_data_w) AM_BASE(&actfancr_pf2_data)
99   AM_RANGE(0x100000, 0x1007ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
111100   AM_RANGE(0x110000, 0x110001) AM_WRITE(buffer_spriteram_w)
112   AM_RANGE(0x120000, 0x1205ff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_le_w) AM_BASE(&paletteram)
101   AM_RANGE(0x120000, 0x1205ff) AM_READWRITE(MRA8_RAM, paletteram_xxxxBBBBGGGGRRRR_le_w) AM_BASE(&paletteram)
102   AM_RANGE(0x130000, 0x130003) AM_READ(actfan_control_1_r)
103   AM_RANGE(0x140000, 0x140001) AM_READ(actfan_control_0_r)
113104   AM_RANGE(0x150000, 0x150001) AM_WRITE(actfancr_sound_w)
114   AM_RANGE(0x1f0000, 0x1f3fff) AM_WRITE(MWA8_RAM) AM_BASE(&actfancr_ram) /* Main ram */
105   AM_RANGE(0x1f0000, 0x1f3fff) AM_RAM AM_BASE(&actfancr_ram) /* Main ram */
115106ADDRESS_MAP_END
116107
117static ADDRESS_MAP_START( triothep_readmem, ADDRESS_SPACE_PROGRAM, 8 )
118   AM_RANGE(0x000000, 0x03ffff) AM_READ(MRA8_ROM)
119   AM_RANGE(0x044000, 0x045fff) AM_READ(actfancr_pf2_data_r)
120   AM_RANGE(0x064000, 0x0647ff) AM_READ(actfancr_pf1_data_r)
121   AM_RANGE(0x120000, 0x1207ff) AM_READ(MRA8_RAM)
122   AM_RANGE(0x130000, 0x1305ff) AM_READ(MRA8_RAM)
123   AM_RANGE(0x140000, 0x140001) AM_READ(MRA8_NOP) /* Value doesn't matter */
124   AM_RANGE(0x1f0000, 0x1f3fff) AM_READ(MRA8_RAM)
125   AM_RANGE(0x1ff000, 0x1ff001) AM_READ(triothep_control_r)
126ADDRESS_MAP_END
127
128static ADDRESS_MAP_START( triothep_writemem, ADDRESS_SPACE_PROGRAM, 8 )
129   AM_RANGE(0x000000, 0x03ffff) AM_WRITE(MWA8_ROM)
108static ADDRESS_MAP_START( triothep_map, ADDRESS_SPACE_PROGRAM, 8 )
109   AM_RANGE(0x000000, 0x03ffff) AM_ROM
130110   AM_RANGE(0x040000, 0x04001f) AM_WRITE(actfancr_pf2_control_w)
131   AM_RANGE(0x044000, 0x045fff) AM_WRITE(actfancr_pf2_data_w) AM_BASE(&actfancr_pf2_data)
111   AM_RANGE(0x044000, 0x045fff) AM_READWRITE(actfancr_pf2_data_r, actfancr_pf2_data_w) AM_BASE(&actfancr_pf2_data)
132112   AM_RANGE(0x046400, 0x0467ff) AM_WRITE(MWA8_NOP) /* Pf2 rowscroll - is it used? */
133113   AM_RANGE(0x060000, 0x06001f) AM_WRITE(actfancr_pf1_control_w)
134   AM_RANGE(0x064000, 0x0647ff) AM_WRITE(actfancr_pf1_data_w) AM_BASE(&actfancr_pf1_data)
114   AM_RANGE(0x064000, 0x0647ff) AM_READWRITE(actfancr_pf1_data_r, actfancr_pf1_data_w) AM_BASE(&actfancr_pf1_data)
135115   AM_RANGE(0x066400, 0x0667ff) AM_WRITE(MWA8_RAM) AM_BASE(&actfancr_pf1_rowscroll_data)
136116   AM_RANGE(0x100000, 0x100001) AM_WRITE(actfancr_sound_w)
137117   AM_RANGE(0x110000, 0x110001) AM_WRITE(buffer_spriteram_w)
138   AM_RANGE(0x120000, 0x1207ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
139   AM_RANGE(0x130000, 0x1305ff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_le_w) AM_BASE(&paletteram)
140   AM_RANGE(0x1f0000, 0x1f3fff) AM_WRITE(MWA8_RAM) AM_BASE(&actfancr_ram) /* Main ram */
141   AM_RANGE(0x1ff000, 0x1ff001) AM_WRITE(triothep_control_select_w)
118   AM_RANGE(0x120000, 0x1207ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
119   AM_RANGE(0x130000, 0x1305ff) AM_READWRITE(MRA8_RAM, paletteram_xxxxBBBBGGGGRRRR_le_w) AM_BASE(&paletteram)
120   AM_RANGE(0x140000, 0x140001) AM_READNOP /* Value doesn't matter */
121   AM_RANGE(0x1f0000, 0x1f3fff) AM_RAM AM_BASE(&actfancr_ram) /* Main ram */
122   AM_RANGE(0x1ff000, 0x1ff001) AM_READWRITE(triothep_control_r, triothep_control_select_w)
142123   AM_RANGE(0x1ff400, 0x1ff403) AM_WRITE(H6280_irq_status_w)
143124ADDRESS_MAP_END
144125
145126/******************************************************************************/
146127
147static ADDRESS_MAP_START( dec0_s_readmem, ADDRESS_SPACE_PROGRAM, 8 )
148   AM_RANGE(0x0000, 0x07ff) AM_READ(MRA8_RAM)
149   AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_r)
150   AM_RANGE(0x3800, 0x3800) AM_READ(OKIM6295_status_0_r)
151   AM_RANGE(0x4000, 0xffff) AM_READ(MRA8_ROM)
152ADDRESS_MAP_END
153
154static ADDRESS_MAP_START( dec0_s_writemem, ADDRESS_SPACE_PROGRAM, 8 )
155   AM_RANGE(0x0000, 0x07ff) AM_WRITE(MWA8_RAM)
128static ADDRESS_MAP_START( dec0_s_map, ADDRESS_SPACE_PROGRAM, 8 )
129   AM_RANGE(0x0000, 0x07ff) AM_RAM
156130   AM_RANGE(0x0800, 0x0800) AM_WRITE(YM2203_control_port_0_w)
157131   AM_RANGE(0x0801, 0x0801) AM_WRITE(YM2203_write_port_0_w)
158132   AM_RANGE(0x1000, 0x1000) AM_WRITE(YM3812_control_port_0_w)
159133   AM_RANGE(0x1001, 0x1001) AM_WRITE(YM3812_write_port_0_w)
160   AM_RANGE(0x3800, 0x3800) AM_WRITE(OKIM6295_data_0_w)
161   AM_RANGE(0x4000, 0xffff) AM_WRITE(MWA8_ROM)
134   AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_r)
135   AM_RANGE(0x3800, 0x3800) AM_READWRITE(OKIM6295_status_0_r, OKIM6295_data_0_w)
136   AM_RANGE(0x4000, 0xffff) AM_ROM
162137ADDRESS_MAP_END
163138
164139/******************************************************************************/
r1771r1772
376351
377352   /* basic machine hardware */
378353   MDRV_CPU_ADD(H6280,21477200/3) /* Should be accurate */
379   MDRV_CPU_PROGRAM_MAP(actfan_readmem,actfan_writemem)
354   MDRV_CPU_PROGRAM_MAP(actfan_map,0)
380355   MDRV_CPU_VBLANK_INT(irq0_line_hold,1) /* VBL */
381356
382357   MDRV_CPU_ADD(M6502, 1500000)
383358   /* audio CPU */ /* Should be accurate */
384   MDRV_CPU_PROGRAM_MAP(dec0_s_readmem,dec0_s_writemem)
359   MDRV_CPU_PROGRAM_MAP(dec0_s_map,0)
385360
386361   /* video hardware */
387362   MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM)
r1771r1772
420395
421396   /* basic machine hardware */
422397   MDRV_CPU_ADD(H6280,XTAL_21_4772MHz/3) /* XIN=21.4772Mhz, verified on pcb */
423   MDRV_CPU_PROGRAM_MAP(triothep_readmem,triothep_writemem)
398   MDRV_CPU_PROGRAM_MAP(triothep_map,0)
424399   MDRV_CPU_VBLANK_INT(irq0_line_hold,1) /* VBL */
425400
426401   MDRV_CPU_ADD(M6502, XTAL_12MHz/8) /* verified on pcb */
427402   /* audio CPU */ /* Should be accurate */
428   MDRV_CPU_PROGRAM_MAP(dec0_s_readmem,dec0_s_writemem)
403   MDRV_CPU_PROGRAM_MAP(dec0_s_map,0)
429404
430405   /* video hardware */
431406   MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM)
src/mame/drivers/mw8080bw.c
r1771r1772
834834   MDRV_IMPORT_FROM(mw8080bw_root)
835835   MDRV_CPU_MODIFY("main")
836836   MDRV_CPU_IO_MAP(zzzap_io_map,0)
837   MDRV_WATCHDOG_TIME_INIT( PERIOD_OF_555_MONOSTABLE(RES_M(1), CAP_U(1)) ) /* 1.1s */
837   MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_NSEC(PERIOD_OF_555_MONOSTABLE_NSEC(RES_M(1), CAP_U(1)))) /* 1.1s */
838838
839839   /* audio hardware */
840840   /* MDRV_IMPORT_FROM(zzzap_audio) */
r1771r1772
946946   MDRV_CPU_MODIFY("main")
947947   MDRV_CPU_IO_MAP(maze_io_map,0)
948948   MDRV_MACHINE_START(maze)
949   MDRV_WATCHDOG_TIME_INIT( PERIOD_OF_555_MONOSTABLE(RES_K(270), CAP_U(10)) ) /* 2.97s */
949   MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_NSEC(PERIOD_OF_555_MONOSTABLE_NSEC(RES_K(270), CAP_U(10)))) /* 2.97s */
950950
951951   /* audio hardware */
952952   MDRV_IMPORT_FROM(maze_audio)
r1771r1772
10371037   MDRV_CPU_MODIFY("main")
10381038   MDRV_CPU_IO_MAP(boothill_io_map,0)
10391039   MDRV_MACHINE_START(boothill)
1040   MDRV_WATCHDOG_TIME_INIT( PERIOD_OF_555_MONOSTABLE(RES_K(270), CAP_U(10)) ) /* 2.97s */
1040   MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_NSEC(PERIOD_OF_555_MONOSTABLE_NSEC(RES_K(270), CAP_U(10)))) /* 2.97s */
10411041
10421042   /* audio hardware */
10431043   MDRV_IMPORT_FROM(boothill_audio)
r1771r1772
11391139   MDRV_IMPORT_FROM(mw8080bw_root)
11401140   MDRV_CPU_MODIFY("main")
11411141   MDRV_CPU_IO_MAP(checkmat_io_map,0)
1142   MDRV_WATCHDOG_TIME_INIT( PERIOD_OF_555_MONOSTABLE(RES_K(270), CAP_U(10)) ) /* 2.97s */
1142   MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_NSEC(PERIOD_OF_555_MONOSTABLE_NSEC(RES_K(270), CAP_U(10)))) /* 2.97s */
11431143
11441144   /* audio hardware */
11451145   MDRV_IMPORT_FROM(checkmat_audio)
r1771r1772
12751275   MDRV_CPU_MODIFY("main")
12761276   MDRV_CPU_IO_MAP(desertgu_io_map,0)
12771277   MDRV_MACHINE_START(desertgu)
1278   MDRV_WATCHDOG_TIME_INIT(ATTOTIME_IN_USEC(255000000 / (MW8080BW_PIXEL_CLOCK / MW8080BW_HTOTAL / MW8080BW_VTOTAL)))
1278   MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_USEC(255000000 / (MW8080BW_PIXEL_CLOCK / MW8080BW_HTOTAL / MW8080BW_VTOTAL)))
12791279
12801280   /* audio hardware */
12811281   MDRV_IMPORT_FROM(desertgu_audio)
r1771r1772
14721472   MDRV_IMPORT_FROM(mw8080bw_root)
14731473   MDRV_CPU_MODIFY("main")
14741474   MDRV_CPU_IO_MAP(dplay_io_map,0)
1475   MDRV_WATCHDOG_TIME_INIT(ATTOTIME_IN_USEC(255000000 / (MW8080BW_PIXEL_CLOCK / MW8080BW_HTOTAL / MW8080BW_VTOTAL)))
1475   MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_USEC(255000000 / (MW8080BW_PIXEL_CLOCK / MW8080BW_HTOTAL / MW8080BW_VTOTAL)))
14761476
14771477   /* audio hardware */
14781478   MDRV_IMPORT_FROM(dplay_audio)
r1771r1772
16541654   MDRV_CPU_MODIFY("main")
16551655   MDRV_CPU_IO_MAP(m4_io_map,0)
16561656   MDRV_MACHINE_START(m4)
1657   MDRV_WATCHDOG_TIME_INIT(ATTOTIME_IN_USEC(255000000 / (MW8080BW_PIXEL_CLOCK / MW8080BW_HTOTAL / MW8080BW_VTOTAL)))
1657   MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_USEC(255000000 / (MW8080BW_PIXEL_CLOCK / MW8080BW_HTOTAL / MW8080BW_VTOTAL)))
16581658
16591659   /* audio hardware */
16601660   MDRV_IMPORT_FROM(m4_audio)
r1771r1772
18281828   MDRV_CPU_MODIFY("main")
18291829   MDRV_CPU_IO_MAP(clowns_io_map,0)
18301830   MDRV_MACHINE_START(clowns)
1831   MDRV_WATCHDOG_TIME_INIT(ATTOTIME_IN_USEC(255000000 / (MW8080BW_PIXEL_CLOCK / MW8080BW_HTOTAL / MW8080BW_VTOTAL)))
1831   MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_USEC(255000000 / (MW8080BW_PIXEL_CLOCK / MW8080BW_HTOTAL / MW8080BW_VTOTAL)))
18321832
18331833   /* audio hardware */
18341834   MDRV_IMPORT_FROM(clowns_audio)
r1771r1772
19061906   MDRV_IMPORT_FROM(mw8080bw_root)
19071907   MDRV_CPU_MODIFY("main")
19081908   MDRV_CPU_IO_MAP(shuffle_io_map,0)
1909   MDRV_WATCHDOG_TIME_INIT(ATTOTIME_IN_USEC(255000000 / (MW8080BW_PIXEL_CLOCK / MW8080BW_HTOTAL / MW8080BW_VTOTAL)))
1909   MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_USEC(255000000 / (MW8080BW_PIXEL_CLOCK / MW8080BW_HTOTAL / MW8080BW_VTOTAL)))
19101910
19111911   /* audio hardware */
19121912   /* MDRV_IMPORT_FROM(shuffle_audio) */
r1771r1772
19911991   MDRV_CPU_IO_MAP(dogpatch_io_map,0)
19921992   /* the watch dog time is unknown, but all other */
19931993   /* Midway boards of the era used the same circuit */
1994   MDRV_WATCHDOG_TIME_INIT(ATTOTIME_IN_USEC(255000000 / (MW8080BW_PIXEL_CLOCK / MW8080BW_HTOTAL / MW8080BW_VTOTAL)))
1994   MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_USEC(255000000 / (MW8080BW_PIXEL_CLOCK / MW8080BW_HTOTAL / MW8080BW_VTOTAL)))
19951995
19961996   /* audio hardware */
19971997   MDRV_IMPORT_FROM(dogpatch_audio)
r1771r1772
21992199   MDRV_CPU_MODIFY("main")
22002200   MDRV_CPU_IO_MAP(spcenctr_io_map,0)
22012201   MDRV_MACHINE_START(spcenctr)
2202   MDRV_WATCHDOG_TIME_INIT(ATTOTIME_IN_USEC(255000000 / (MW8080BW_PIXEL_CLOCK / MW8080BW_HTOTAL / MW8080BW_VTOTAL)))
2202   MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_USEC(255000000 / (MW8080BW_PIXEL_CLOCK / MW8080BW_HTOTAL / MW8080BW_VTOTAL)))
22032203
22042204   /* video hardware */
22052205   MDRV_VIDEO_UPDATE(spcenctr)
r1771r1772
22992299   MDRV_CPU_MODIFY("main")
23002300   MDRV_CPU_IO_MAP(phantom2_io_map,0)
23012301   MDRV_MACHINE_START(phantom2)
2302   MDRV_WATCHDOG_TIME_INIT(ATTOTIME_IN_USEC(255000000 / (MW8080BW_PIXEL_CLOCK / MW8080BW_HTOTAL / MW8080BW_VTOTAL)))
2302   MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_USEC(255000000 / (MW8080BW_PIXEL_CLOCK / MW8080BW_HTOTAL / MW8080BW_VTOTAL)))
23032303
23042304   /* video hardware */
23052305   MDRV_VIDEO_UPDATE(phantom2)
r1771r1772
24352435   MDRV_IMPORT_FROM(mw8080bw_root)
24362436   MDRV_CPU_MODIFY("main")
24372437   MDRV_CPU_IO_MAP(bowler_io_map,0)
2438   MDRV_WATCHDOG_TIME_INIT(ATTOTIME_IN_USEC(255000000 / (MW8080BW_PIXEL_CLOCK / MW8080BW_HTOTAL / MW8080BW_VTOTAL)))
2438   MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_USEC(255000000 / (MW8080BW_PIXEL_CLOCK / MW8080BW_HTOTAL / MW8080BW_VTOTAL)))
24392439
24402440   /* audio hardware */
24412441   MDRV_IMPORT_FROM(bowler_audio)
r1771r1772
26572657   MDRV_CPU_MODIFY("main")
26582658   MDRV_CPU_IO_MAP(invaders_io_map,0)
26592659   MDRV_MACHINE_START(invaders)
2660   MDRV_WATCHDOG_TIME_INIT(ATTOTIME_IN_USEC(255000000 / (MW8080BW_PIXEL_CLOCK / MW8080BW_HTOTAL / MW8080BW_VTOTAL)))
2660   MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_USEC(255000000 / (MW8080BW_PIXEL_CLOCK / MW8080BW_HTOTAL / MW8080BW_VTOTAL)))
26612661
26622662   /* video hardware */
26632663   MDRV_VIDEO_UPDATE(invaders)
r1771r1772
27362736   MDRV_IMPORT_FROM(mw8080bw_root)
27372737   MDRV_CPU_MODIFY("main")
27382738   MDRV_CPU_IO_MAP(blueshrk_io_map,0)
2739   MDRV_WATCHDOG_TIME_INIT(ATTOTIME_IN_USEC(255000000 / (MW8080BW_PIXEL_CLOCK / MW8080BW_HTOTAL / MW8080BW_VTOTAL)))
2739   MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_USEC(255000000 / (MW8080BW_PIXEL_CLOCK / MW8080BW_HTOTAL / MW8080BW_VTOTAL)))
27402740
27412741   /* audio hardware */
27422742   MDRV_IMPORT_FROM(blueshrk_audio)
r1771r1772
28342834   MDRV_IMPORT_FROM(mw8080bw_root)
28352835   MDRV_CPU_MODIFY("main")
28362836   MDRV_CPU_IO_MAP(invad2ct_io_map,0)
2837   MDRV_WATCHDOG_TIME_INIT(ATTOTIME_IN_USEC(255000000 / (MW8080BW_PIXEL_CLOCK / MW8080BW_HTOTAL / MW8080BW_VTOTAL)))
2837   MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_USEC(255000000 / (MW8080BW_PIXEL_CLOCK / MW8080BW_HTOTAL / MW8080BW_VTOTAL)))
28382838
28392839   /* audio hardware */
28402840   MDRV_IMPORT_FROM(invad2ct_audio)
src/mame/drivers/stactics.c
r1771r1772
11/****************************************************************************
22
3Sega "Space Tactics" Driver
3    Sega "Space Tactics" Driver
44
5Frank Palazzolo (palazzol@home.com)
5    Frank Palazzolo (palazzol@home.com)
66
77Master processor - Intel 8080A
88
r1771r1772
3535
3636At this time, emulation is missing:
3737
38Lamps (Credit, Barrier, and 5 lamps for firing from the bases)
3938Sound (all discrete and a 76477)
4039Verify Color PROM resistor values (Last 8 colors)
41Verify Bar graph displays
4240
4341****************************************************************************/
4442
4543#include "driver.h"
44#include "deprecat.h"
45#include "stactics.h"
46#include "stactics.lh"
4647
47/* Defined in machine/stactics.c */
48READ8_HANDLER( stactics_port_0_r );
49READ8_HANDLER( stactics_port_2_r );
50READ8_HANDLER( stactics_port_3_r );
51READ8_HANDLER( stactics_vert_pos_r );
52READ8_HANDLER( stactics_horiz_pos_r );
53INTERRUPT_GEN( stactics_interrupt );
54WRITE8_HANDLER( stactics_coin_lockout_w );
55extern UINT8 *stactics_motor_on;
5648
57/* Defined in video/stactics.c */
58VIDEO_START( stactics );
59VIDEO_UPDATE( stactics );
60extern UINT8 *stactics_videoram_b;
61extern UINT8 *stactics_videoram_d;
62extern UINT8 *stactics_videoram_e;
63extern UINT8 *stactics_videoram_f;
64extern UINT8 *stactics_palette;
65extern UINT8 *stactics_display_buffer;
66extern UINT8 *stactics_lamps;
6749
68PALETTE_INIT( stactics );
50/*************************************
51 *
52 *  Mirror motor handling
53 *
54 *************************************/
6955
70WRITE8_HANDLER( stactics_palette_w );
71WRITE8_HANDLER( stactics_scroll_ram_w );
72WRITE8_HANDLER( stactics_speed_latch_w );
73WRITE8_HANDLER( stactics_shot_trigger_w );
74WRITE8_HANDLER( stactics_shot_flag_clear_w );
56static CUSTOM_INPUT( get_motor_not_ready )
57{
58   stactics_state *state = Machine->driver_data;
7559
60   /* if the motor is self-centering, but not centered yet */
61    return ((*state->motor_on & 0x01) == 0) &&
62          ((state->horiz_pos != 0) || (state->vert_pos != 0));
63}
7664
65
66static READ8_HANDLER( vert_pos_r )
67{
68   stactics_state *state = Machine->driver_data;
69
70    return 0x70 - state->vert_pos;
71}
72
73
74static READ8_HANDLER( horiz_pos_r )
75{
76   stactics_state *state = Machine->driver_data;
77
78    return state->horiz_pos + 0x88;
79}
80
81
82static void move_motor(stactics_state *state)
83{
84    /* monitor motor under joystick control */
85    if (*state->motor_on & 0x01)
86    {
87      int ip3 = readinputport(3);
88      int ip4 = readinputport(4);
89
90      /* up */
91      if (((ip4 & 0x01) == 0) && (state->vert_pos > -128))
92         state->vert_pos--;
93
94      /* down */
95      if (((ip4 & 0x02) == 0) && (state->vert_pos < 127))
96         state->vert_pos++;
97
98      /* left */
99      if (((ip3 & 0x20) == 0) && (state->horiz_pos < 127))
100         state->horiz_pos++;
101
102      /* right */
103      if (((ip3 & 0x40) == 0) && (state->horiz_pos > -128))
104         state->horiz_pos--;
105    }
106
107    /* monitor motor under self-centering control */
108    else
109    {
110        if (state->horiz_pos > 0)
111            state->horiz_pos--;
112        else if (state->horiz_pos < 0)
113            state->horiz_pos++;
114
115        if (state->vert_pos > 0)
116            state->vert_pos--;
117        else if (state->vert_pos < 0)
118            state->vert_pos++;
119    }
120}
121
122
123
124/*************************************
125 *
126 *  Random number generator
127 *
128 *************************************/
129
130static CUSTOM_INPUT( get_rng )
131{
132   /* this is a 555 timer, but cannot read one of the resistor values */
133   return mame_rand(Machine) & 0x07;
134}
135
136
137
138/*************************************
139 *
140 *  Coin lockout
141 *
142 *************************************/
143
144static WRITE8_HANDLER( stactics_coin_lockout_w )
145{
146   coin_lockout_w(offset, ~data & 0x01);
147}
148
149
150
151/*************************************
152 *
153 *  Interrupt system
154 *
155 *************************************/
156
157static INTERRUPT_GEN( stactics_interrupt )
158{
159   stactics_state *state = machine->driver_data;
160
161   move_motor(state);
162
163    cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
164}
165
166
167
168/*************************************
169 *
170 *  Data CPU memory handlers
171 *
172 *************************************/
173
77174static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
78175    AM_RANGE(0x0000, 0x2fff) AM_ROM
79176    AM_RANGE(0x4000, 0x47ff) AM_RAM
r1771r1772
81178    AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x0fff) AM_READ(input_port_1_r)
82179    AM_RANGE(0x6000, 0x6001) AM_MIRROR(0x0f08) AM_WRITE(stactics_coin_lockout_w)
83180    AM_RANGE(0x6002, 0x6005) AM_MIRROR(0x0f08) AM_WRITE(MWA8_NOP)
84    AM_RANGE(0x6006, 0x6007) AM_MIRROR(0x0f08) AM_WRITE(MWA8_RAM) AM_BASE(&stactics_palette)
181    AM_RANGE(0x6006, 0x6007) AM_MIRROR(0x0f08) AM_WRITE(MWA8_RAM) AM_BASE_MEMBER(stactics_state, palette)
85182 /* AM_RANGE(0x6010, 0x6017) AM_MIRROR(0x0f08) AM_WRITE(stactics_sound_w) */
86    AM_RANGE(0x6016, 0x6016) AM_MIRROR(0x0f08) AM_WRITE(MWA8_RAM) AM_BASE(&stactics_motor_on)  /* Note: This overlaps rocket sound */
87    AM_RANGE(0x6020, 0x6027) AM_MIRROR(0x0f08) AM_WRITE(MWA8_RAM) AM_BASE(&stactics_lamps)
183    AM_RANGE(0x6016, 0x6016) AM_MIRROR(0x0f08) AM_WRITE(MWA8_RAM) AM_BASE_MEMBER(stactics_state, motor_on)  /* Note: This overlaps rocket sound */
184    AM_RANGE(0x6020, 0x6027) AM_MIRROR(0x0f08) AM_WRITE(MWA8_RAM) AM_BASE_MEMBER(stactics_state, lamps)
88185    AM_RANGE(0x6030, 0x6030) AM_MIRROR(0x0f0f) AM_WRITE(stactics_speed_latch_w)
89186    AM_RANGE(0x6040, 0x6040) AM_MIRROR(0x0f0f) AM_WRITE(stactics_shot_trigger_w)
90187    AM_RANGE(0x6050, 0x6050) AM_MIRROR(0x0f0f) AM_WRITE(stactics_shot_flag_clear_w)
91    AM_RANGE(0x6060, 0x606f) AM_MIRROR(0x0f00) AM_WRITE(MWA8_RAM) AM_BASE(&stactics_display_buffer)
188    AM_RANGE(0x6060, 0x606f) AM_MIRROR(0x0f00) AM_WRITE(MWA8_RAM) AM_BASE_MEMBER(stactics_state, display_buffer)
92189    AM_RANGE(0x6070, 0x609f) AM_MIRROR(0x0f00) AM_WRITE(MWA8_NOP)
93190 /* AM_RANGE(0x60a0, 0x60ef) AM_MIRROR(0x0f00) AM_WRITE(stactics_sound2_w) */
94191    AM_RANGE(0x60f0, 0x60ff) AM_MIRROR(0x0f00) AM_WRITE(MWA8_NOP)
95    AM_RANGE(0x7000, 0x7000) AM_MIRROR(0x0fff) AM_READ(stactics_port_2_r)
96    AM_RANGE(0x8000, 0x8000) AM_MIRROR(0x0fff) AM_READ(stactics_port_3_r)
97    AM_RANGE(0x8000, 0x8fff) AM_WRITE(stactics_scroll_ram_w)
98    AM_RANGE(0x9000, 0x9000) AM_MIRROR(0x0fff) AM_READ(stactics_vert_pos_r)
99    AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x0fff) AM_READ(stactics_horiz_pos_r)
100    AM_RANGE(0xb000, 0xbfff) AM_RAM AM_BASE(&stactics_videoram_b)
192    AM_RANGE(0x7000, 0x7000) AM_MIRROR(0x0fff) AM_READ(input_port_2_r)
193    AM_RANGE(0x8000, 0x8000) AM_MIRROR(0x0fff) AM_READ(input_port_3_r)
194    AM_RANGE(0x8000, 0x87ff) AM_MIRROR(0x0800) AM_WRITE(stactics_scroll_ram_w)
195    AM_RANGE(0x9000, 0x9000) AM_MIRROR(0x0fff) AM_READ(vert_pos_r)
196    AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x0fff) AM_READ(horiz_pos_r)
197    AM_RANGE(0xb000, 0xbfff) AM_RAM AM_BASE_MEMBER(stactics_state, videoram_b)
101198    AM_RANGE(0xc000, 0xcfff) AM_NOP
102    AM_RANGE(0xd000, 0xdfff) AM_RAM AM_BASE(&stactics_videoram_d)
103    AM_RANGE(0xe000, 0xefff) AM_RAM AM_BASE(&stactics_videoram_e)
104    AM_RANGE(0xf000, 0xffff) AM_RAM AM_BASE(&stactics_videoram_f)
199    AM_RANGE(0xd000, 0xdfff) AM_RAM AM_BASE_MEMBER(stactics_state, videoram_d)
200    AM_RANGE(0xe000, 0xefff) AM_RAM AM_BASE_MEMBER(stactics_state, videoram_e)
201    AM_RANGE(0xf000, 0xffff) AM_RAM AM_BASE_MEMBER(stactics_state, videoram_f)
105202ADDRESS_MAP_END
106203
107204
205
206/*************************************
207 *
208 *  Input port definitions
209 *
210 *************************************/
211
108212static INPUT_PORTS_START( stactics )
109213
110214    PORT_START  /*  IN0 */
111    /*PORT_BIT (0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) Motor status. see stactics_port_0_r */
215    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON7 )
216    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON6 )
217    PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON5 )
218    PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 )
219    PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 )
220    PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
112221    PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 )
113    PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
114    PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 )
115    PORT_BIT (0x08, IP_ACTIVE_LOW, IPT_BUTTON4 )
116    PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON5 )
117    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON6 )
118    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON7 )
222    PORT_BIT (0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_motor_not_ready, 0)
119223
120224    PORT_START  /* IN1 */
121225    PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_B ) )
r1771r1772
144248    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
145249
146250    PORT_START  /* IN2 */
147    /* This is accessed by stactics_port_2_r() */
148    /*PORT_BIT (0x0f, IP_ACTIVE_HIGH, IPT_UNUSED ) Random number generator */
251    PORT_BIT (0x07, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_rng, 0)
252    PORT_BIT (0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(stactics_get_vblank_count_d3, 0)
149253    PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
150254    PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
151255    PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) )
r1771r1772
154258   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
155259
156260    PORT_START  /* IN3 */
157    /* This is accessed by stactics_port_3_r() */
158261    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
159    /* PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) */
262    PORT_BIT (0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(stactics_get_shot_standby, 0)
160263    PORT_DIPNAME( 0x04, 0x04, "Number of Barriers" )
161264    PORT_DIPSETTING(    0x04, "4" )
162265    PORT_DIPSETTING(    0x00, "6" )
r1771r1772
168271    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
169272    PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
170273    PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
171    /* PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) */
274    PORT_BIT (0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(stactics_get_not_shot_arrive, 0)
172275
173276   PORT_START   /* FAKE */
174277    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
r1771r1772
176279INPUT_PORTS_END
177280
178281
282
283/*************************************
284 *
285 *  Start
286 *
287 *************************************/
288
289static MACHINE_START( stactics )
290{
291   stactics_state *state = machine->driver_data;
292
293   state->vert_pos = 0;
294   state->horiz_pos = 0;
295   *state->motor_on = 0;
296}
297
298
299
300/*************************************
301 *
302 *  Machine driver
303 *
304 *************************************/
305
179306static MACHINE_DRIVER_START( stactics )
180307
308   MDRV_DRIVER_DATA(stactics_state)
309
181310   /* basic machine hardware */
182311   MDRV_CPU_ADD(8080, 1933560)
183312   MDRV_CPU_PROGRAM_MAP(main_map,0)
184   MDRV_CPU_VBLANK_INT(stactics_interrupt,1)
313   MDRV_CPU_VBLANK_INT(stactics_interrupt, 1)
185314
315   MDRV_MACHINE_START(stactics)
316
186317   /* video hardware */
187   MDRV_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE)
318   MDRV_IMPORT_FROM(stactics_video)
188319
189   MDRV_SCREEN_ADD("main", RASTER)
190   MDRV_SCREEN_REFRESH_RATE(60)
191   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
192   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
193   MDRV_SCREEN_SIZE(32*8, 32*8)
194   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1)
195
196   MDRV_PALETTE_LENGTH(0x400)
197
198   MDRV_PALETTE_INIT(stactics)
199   MDRV_VIDEO_START(stactics)
200   MDRV_VIDEO_UPDATE(stactics)
201
202   /* sound hardware */
320   /* audio hardware */
203321MACHINE_DRIVER_END
204322
205323
206324
207/***************************************************************************
325/*************************************
326 *
327 *  ROM definition
328 *
329 *************************************/
208330
209  Game driver(s)
210
211***************************************************************************/
212
213331ROM_START( stactics )
214332   ROM_REGION( 0x10000, REGION_CPU1, 0 )
215333   ROM_LOAD( "epr-218x",     0x0000, 0x0800, CRC(b1186ad2) SHA1(88929a183ac0499619b3e07241f3b5a0c89bdab1) )
r1771r1772
232350
233351
234352
235GAME( 1981, stactics, 0, stactics, stactics, 0, ORIENTATION_FLIP_X, "Sega", "Space Tactics", GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND )
353/*************************************
354 *
355 *  Game driver
356 *
357 *************************************/
236358
359GAMEL( 1981, stactics, 0, stactics, stactics, 0, ORIENTATION_FLIP_X, "Sega", "Space Tactics", GAME_NO_SOUND, layout_stactics )
src/mame/drivers/calorie.c
r1771r1772
141141      ypos = 0xff - calorie_sprites[x+2];
142142      xpos = calorie_sprites[x+3];
143143
144      if(flip_screen)
144      if(flip_screen_get())
145145      {
146146         if( calorie_sprites[x+1] & 0x10 )
147147            ypos = 0xff - ypos + 32;
src/mame/drivers/gaelco3d.c
r1771r1772
836836   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)   // checked after reading analog from port 1
837837   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)   // checked after reading analog from port 2
838838   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)   // checked after reading analog from port 3
839   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM(analog_bit_r, 0)
840   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM(analog_bit_r, 1)
841   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM(analog_bit_r, 2)
842   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM(analog_bit_r, 3)
839   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM(analog_bit_r, (void *)0)
840   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM(analog_bit_r, (void *)1)
841   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM(analog_bit_r, (void *)2)
842   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM(analog_bit_r, (void *)3)
843843
844844   PORT_START
845845   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN1 )   // verified
r1771r1772
875875   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
876876   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_SERVICE1 )
877877   PORT_SERVICE_NO_TOGGLE( 0x0800, IP_ACTIVE_LOW )
878   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM(analog_bit_r, 0)
879   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM(analog_bit_r, 1)
880   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM(analog_bit_r, 2)
881   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM(analog_bit_r, 3)
878   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM(analog_bit_r, (void *)0)
879   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM(analog_bit_r, (void *)1)
880   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM(analog_bit_r, (void *)2)
881   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM(analog_bit_r, (void *)3)
882882
883883   PORT_START
884884   PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN )
r1771r1772
909909   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
910910   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_SERVICE1 )
911911   PORT_SERVICE_NO_TOGGLE( 0x0800, IP_ACTIVE_LOW )
912   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM(analog_bit_r, 0)
913   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM(analog_bit_r, 1)
914   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM(analog_bit_r, 2)
915   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM(analog_bit_r, 3)
912   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM(analog_bit_r, (void *)0)
913   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM(analog_bit_r, (void *)1)
914   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM(analog_bit_r, (void *)2)
915   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM(analog_bit_r, (void *)3)
916916
917917   PORT_START
918918   PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN )
src/mame/drivers/calomega.c
r0r1772
1/**********************************************************************************
2
3    +-------------------------------------+
4    |                                     |
5    | CAL OMEGA - SYSTEMS 903/904/905/906 |
6    |                                     |
7    |      Driver by Roberto Fresca.      |
8    |                                     |
9    +-------------------------------------+
10
11
12    --- Technical Notes ---
13
14    Name:    System 903, System 904, System 905 & System 906.
15    Company: Cal Omega / Omega Products / Casino Electronics Inc.
16    Year:    1981-1989
17
18
19    Hardware:
20
21    CPU =  1x SY6502 @ 625 kHz.  ; M6502 compatible.
22    SND =  1x AY8912 @ 1.25 MHz. ; AY-3-8910 compatible.
23    I/O =  2x PIAs SY6520/6820   ; M6821 compatible.
24    CRCT = 1x SY6545             ; M6845 compatible mode. It doesn't seems that is using
25                                 ; the first 4 bits of register R03 (HSync width).
26
27    CLK =  1x Xtal @ 10 MHz.     ; CPU clock = 625 kHz.
28                                 ; SND clock = 1250 kHz.
29                                 ; PXL clock = 5000 kHz.
30
31    Systems 903/904 also have a 6850 for serial comunication.
32
33    PRG ROMS at locations u5, u6, u7, u8, u9.
34    GFX ROMS at locations u67(cgo), u68(cga), u69(cgb), u70(cgc).
35
36    For systems 903/904, u5 to u9 are 2516
37    For system 905,      u5 to u9 are 2532
38
39    DSW = 3 banks (903/904)
40    DSW = 1 bank  (905)
41
42    Inputs use 6 lines from 6520 PIA's port, and multiplexed x4 each.
43
44    Some games like Keno and Big Game, also have a key encoder peripheral processor
45    based on a 8035, and 1x ROM 2516/2532.
46
47
48
49***********************************************************************************
50
51
52   ++++ System 903-906 official list of games (not complete) ++++
53
54   -----+--------------------------+--------+---------+----------+---------+----------+---------+---------------+------+------+-------
55    VER |  NAME                    | SYSTEM | PROGRAM | CHAR GEN | CG P/N  | CLR PROM | CP P/N  | GAME TYPE     | DUMP | STAT | ADDED
56   -----+--------------------------+--------+---------+----------+---------+----------+---------+---------------+------+------+-------
57    7.6 | Poker                    |  903   | AUG/81  | PKCG     | 6300010 | POKCLR   | 6600020 | Amusement     | Yes  | OK   | Yes
58 *  7.9 | Arcade Poker             |  903   | AUG/81  | PKCG     | 6300010 | POKCLR   | 6600020 | Amusement     | Yes  | BD   | Yes
59 *  8.0 | Arcade Black Jack        |  903   | SEP/81  | CPKCG?   | 6300010 | POKCLR   | 6600020 | Amusement?    | No   |      | No
60 *  9.4 | Keno                     |  903   | DEC/81  | KCG      | 6300060 | POKCLR   | 6600020 | Amusement     | Yes  | BD   | Yes
61 * 10.7 | Big Game                 |  903   | MAR/82  | LOTCG    | unknown | BCLR     | unknown | Amusement?    | Yes  | OK   | Yes
62 * 11.3 | Black Jack               |  903   |         | CPKCG?   | 6300010 | POKCLR   | 6600020 | Amusement?    | No   |      | No
63 * 12.5 | Bingo                    |  903   | JUN/82  | NBCG     | unknown | BCLR     | unknown | Amusement     | Yes  | OK   | Yes
64 * 12.7 | Keno                     | 903/4? | JUL/82  | KCG      | 6300060 | POKCLR   | 6600020 | Amusement     | Yes  | BD   | Yes
65 * 12.8 | Arcade Game (Draw Poker) |  903   | JUL/82  | PKCG     | 6300010 | POKCLR   | 6600020 | Amusement     | Yes  | OK   | Yes
66   13.4 | Nudge Bingo              |  903   | SEP/82  | NBCG     | 6300040 | BCLR     | 6600040 | Amusement     | Yes  | OK   | Yes
67   14.5 | Pixels                   |  903   | DEC/82  | PIXCG    | 6300070 | PIXCLR   | 6600050 | Amusement     | Yes  | OK   | Yes
68   14.7 | Nudge Bingo              |  903   |         | NBCG     | 6300040 | BCLR     | 6600040 | Amusement     | No   |      | No
69   15.0 | Punchboard               |  903   |         | PBCG     | 6300190 | PBCLR    | 6600130 | Gaming Wash   | No   |      | No
70   15.7 | Double-Draw Poker        |  903   | JAN/83  | CPKCG    | 6300010 | POKCLR   | 6600020 | Amusement     | Yes  | OK   | Yes
71   15.8 | Poker Montana            |   ?    |         | CPKCG    | 6300010 | POKCLR   | 6600020 | Gaming        | No   |      | No
72   15.9 | Wild Double-Up           |  905   | JAN/83  | JKR2CG   | 6300100 | WLDCLR   | 6600010 | Amusement     | Yes  | OK   | Yes
73   16.2 | Gaming Lottery           |   ?    |         | LCG      | 6300050 | LOTCLR   | 6600030 | Gaming        | No   |      | No
74   16.3 | Black Jack               |   ?    |         | CPKCG    | 6300010 | POKCLR   | 6600020 | Amusement     | No   |      | No
75   16.4 | K.I.S.S. Keno            |  904   | MAY/83  | KCG      | 6300060 | PCLR     | 6600020 | Amusement     | Yes  | BD   | Yes
76   16.5 | K.I.S.S. Poker           |   ?    |         | POKER    | 6300010 | POKCLR   | 6600020 | Amusement     | No   |      | No
77   16.6 | Nudge Bingo              |   ?    |         | NBCG     | 6300040 | BCOLOR   | 6600040 | Amusement     | No   |      | No
78   16.7 | Poker                    |   ?    |         | PCG      | 6300010 | POKCLR   | 6600020 | Amusement     | No   |      | No
79   16.8 | Keno                     |  903   | MAR/83  | KCG      | 6300060 | POKCLR   | 6600020 | Amusement     | Yes  | BD   | Yes
80   17.0 | Poker                    |  905   |         | POKERCGs | 6300010 | PKRCLR   | 6600020 | Amusement     | No   |      | No
81   17.1 | Nudge Bingo              |   ?    |         | NBCG     | 6300040 | BCOLOR   | 6600040 | Amusement     | No   |      | No
82   17.2 | Double/Double Poker      |  905   | MAY/83  | JKRPKR   | 6300100 | WILDCLR  | 6600010 | Amusement     | Yes  | OK   | Yes
83   17.3 | Casino Poker             |   ?    |         | PKCG     | 6300010 | POKCLR   | 6600020 | Nevada Gaming | No   |      | No
84   17.4 | Gin Gaming               |   ?    |         | GCG0.2   | 6300080 | GINCLR   | 6600060 | Nevada Gaming | No   |      | No
85   17.5 | Gaming Draw Poker        |  903   | DEC/84  | PKCG     | 6300010 | POKCLR   | 6600020 | Nevada Gaming | Yes  | OK   | Yes
86   17.6 | Nudge                    |  903   | SEP/82  | NBCG     | 6300040 | BCLR     | 6600040 | Amusement     | Yes  | OK   | Yes
87   17.7 | Keno                     |   ?    |         | KCG      | 6300060 | POKCLR   | 6600020 | Gaming        | No   |      | No
88   17.9 | AWP Poker                |   ?    |         | PKCG     | 6300010 | POKCLR   | 6600020 | Gaming        | No   |      | No
89   18.1 | Nudge                    |   ?    | JUL/83  | NBCG     | 6300040 | BCLR     | 6600040 | Amusement     | Yes  | OK   | Yes
90   18.2 | Amusement Poker          |   ?    |         | JKRCG02  | 6300100 | WLDCLR   | 6600010 | Amusement     | No   |      | No
91   18.3 | Pixels                   |  905   | AUG/83  | PXCG     | 6300070 | PIXCLR   | 6600050 | Amusement     | Yes  | OK   | Yes
92   18.4 | Double Draw-Lebanon      |   ?    |         | PKCG     | 6300010 | POKCLR   | 6600020 | Amusement     | No   |      | No
93   18.5 | Pixels                   |  905   | AUG/83  | PXCG     | 6300070 | PIXCLR   | 6600050 | Amusement     | Yes  | OK   | Yes
94   18.6 | Pixels                   |  905   | AUG/83  | PXCG     | 6300070 | PIXCLR   | 6600050 | Amusement     | Yes  | OK   | Yes
95   18.7 | Amusement Poker (skill)  |  905   | AUG/83  | JKRTWO   | 6300100 | MULTCLR  | 6600070 | Amusement     | No   |      | No
96   18.8 | Poker-Lebanon            |   ?    |         | PKCG     | 6300010 | POKCLR   | 6600020 | Amusement     | No   |      | No
97   18.9 | Pixels (french)          |   ?    |         | PIXCG    | 6300070 | PIXCLR   | 6600050 | Amusement     | No   |      | No
98   19.0 | Hi-Score Poker           |   ?    |         | JKRTWO   | 6300100 | WLDCLR   | 6600070 | Amusement     | No   |      | No
99 * 19.1 | Super Blackjack?         |  905   | AUG/83  | JKRTWO?  | 6300100 | MLTCLR   | 6600070 | Amusement?    | No   |      | No
100   19.2 | AWP Poker                |   ?    |         | PKCG     | 6300010 | POKCLR   | 6600020 | Gaming        | No   |      | No
101   19.3 | Gin                      |   ?    |         | GCG2     | 6300110 | MLTCLR   | 6600070 | Amusement     | No   |      | No
102   19.4 | Pixels (french)          |   ?    |         | PIXCG    | 6300070 | PIXCLR   | 6600050 | Amusement     | No   |      | No
103   19.7 | Ind. Wild Double-Up      |   ?    |         | JKRCG    | 6300100 | WLDCLR   | 6600070 | Amusement     | No   |      | No
104   19.9 | Double-Up Nudge          |   ?    |         | NUDGE    | 6300040 | BCOLOR   | 6600040 | Amusement     | No   |      | No
105   20.1 | Poker                    |   ?    |         | GPKCG    | 6300010 | POKCLR   | 6600020 | Amusement     | No   |      | No
106   20.4 | Super Blackjack          |  905   | FEB/84  | JKRTWO   | 6300100 | MLTCLR   | 6600070 | Amusement     | Yes  | OK   | Yes
107 * 20.5 | Blackjack?               |  905   | FEB/84  | JKRTWO?  | 6300100 | MLTCLR   | 6600070 | Amusement?    | No   |      | No
108   20.7 | Double-Up Nudge          |   ?    |         | NUDGECG  | 6300040 | BCOLOR   | 6600040 | Amusement     | No   |      | No
109   20.8 | Winner's Choice          |   ?    | FEB/84  | MLT2CG   | 6300130 | MLTCLR   | 6600070 | Amusement     | Yes  | OK   | Yes
110   20.9 | Gaming Poker-Europe      |   ?    |         | PKCG     | 6300010 | POKCLR   | 6600020 | Gaming        | No   |      | No
111   21.1 | AWP Poker                |   ?    |         | POKCG    | 6300010 | POKCLR   | 6600020 | Gaming        | No   |      | No
112   21.2 | Video Slot               |   ?    |         | SL1CG    | 6300180 | SLC1     | 6600120 | Gaming        | No   |      | No
113   21.4 | Wild Double-Up Poker     |   ?    |         | WLDCG    | 6300100 | WLDCLR   | 6600010 | Amusement     | No   |      | No
114   21.5 | Double/Double Poker      |   ?    |         | JKRTWO   | 6300100 | WLDCLR   | 6600010 | Amusement     | No   |      | No
115 * 21.6 | Wild Double-Up?          |  905   | JUN/84  | WLDCG    | 6300100 | WLDCLR   | 6600010 | Amusement?    | No   |      | No
116 * 21.7 | Poker?                   |  905   | MAY/84  | GPKCG?   | 6300010 | POKCLR   | 6600020 | Amusement?    | No   |      | No
117   21.9 | Amusement Poker          |   ?    |         | JKRCG    | 6300100 | WILDCLR  | 6600010 | Amusement     | No   |      | No
118   22.1 | Poker                    |   ?    |         | PKCG     | 6300010 | POKCLR   | 6600020 | Nevada Gaming | No   |      | No
119   22.7 | Amusement Poker (dbl/dbl)|  905   | JUL/84  | JKRPKR   | 6300100 | WLDCLR   | 6600010 | Amusement     | Yes  | OK   | Yes
120   22.8 | Tennesee Wild Poker      |  905   |         | JKR2CG   | 6300100 | MLTCLR   | 6600070 | Amusement     | No   |      | No
121   22.9 | Double/Double Poker      |  905   |         | JKRTWO   | 6300100 | MLTCLR   | 6600010 | Amusement     | No   |      | No
122   23.0 | FC Bingo (4-card)        |  905   | JUN/84  | FCBCG    | 6300150 | FCBCLR   | 6600100 | Amusement     | No   |      | No
123   23.2 | Pixels                   |   ?    |         | PIXCG    | 6300070 | PIXCLR   | 6600050 | Amusement     | No   |      | No
124 * 23.6 | Hotline                  |  905   | OCT/84  | HLCG     | 6300160 | HLCLR    | 6600110 | Amusement     | Yes  | OK   | Yes
125   23.7 | AWP Blackjack            |   ?    |         | POKER    | 6300010 | POKCLR   | 6600020 | Gaming        | No   |      | No
126   23.9 | G.Draw Poker (discard)   |   ?    | JAN/85  | POKCG    | 6300010 | POKCLR   | 6600020 | Nevada Gaming | Yes  | OK   | Yes
127   24.0 | Poker (hold)             |   ?    |         | POKCG    | 6300010 | POKCLR   | 6600020 | Nevada Gaming | No   |      | No
128   24.2 | Export Poker             |   ?    |         | GPKCG    | 6300010 | POKCLR   | 6600020 | Gaming        | No   |      | No
129   24.3 | Gaming Blackjack         |   ?    |         | GPKCG    | 6300010 | POKCLR   | 6600020 | Nevada Gaming | No   |      | No
130   24.5 | Wild Double-Up           |   ?    |         | JKPKCG   | 6300100 | WLDCLR   | 6600010 | Amusement     | No   |      | No
131   24.6 | Hotline                  |  905   | JAN/85  | HLCG     | 6300160 | HLCLR    | 6600110 | Amusement     | Yes  | OK   | Yes
132   24.8 | Poker (discard)          |   ?    |         | PKCG     | 6300010 | POKCLR   | 6600020 | Nevada Gaming | No   |      | No
133   24.9 | Poker (hold)             |   ?    |         | PKCG     | 6300010 | POKCLR   | 6600020 | Nevada Gaming | No   |      | No
134   25.3 | 4-Card Bingo-Gaming      |   ?    |         | FCB1CG   | 6300150 | FCB1CLR  | 6600100 | Gaming        | No   |      | No
135   25.4 | Indian 4-Card Bingo      |   ?    |         | FCBCG    | 6300150 | FCB1CLR  | 6600100 | Amer-Indian   | No   |      | No
136   25.5 | Wild Double-Up Poker     |   ?    |         | JKRCG    | 6300100 | WILD     | 6600010 | Amusement     | No   |      | No
137   25.6 | Mr. Domino               |   ?    |         | DOMCG    | 6300140 | DOMCLR   | 6600080 | Amusement     | No   |      | No
138   25.7 | Mr. Domino               |   ?    |         | DOMCG    | 6300140 | DOMCLR   | 6600080 | Amusement     | No   |      | No
139   25.8 | Poker                    |   ?    |         | PKCG     | 6300010 | POKCLR   | 6600020 | Gaming        | No   |      | No
140   26.3 | Wild Double-Up Poker     |   ?    |         | JKRCG    | 6300100 | WILD     | 6600010 | Amusement     | No   |      | No
141   26.5 | 4-Reel Slot              |   ?    |         | SLOT4CG  | 6300220 | SL4CLR   | 6600140 | Gaming        | No   |      | No
142   26.6 | Poker                    |   ?    |         | GPKCG    | 6300250 | POKCLR   | 6600020 | Nevada Gaming | No   |      | No
143   26.8 | Wild Double-Up Poker     |   ?    |         | JKRCG    | 6300260 | WILD     | 6600010 | Nevada Gaming | No   |      | No
144   27.1 | Tourney Gaming Poker     |   ?    |         | POKCG    | 6300010 | POKCLR   | 6600020 | Nevada Gaming | No   |      | No
145   27.2 | Arcade Keno              |   ?    | AUG/85  | KJCG     | 6300060 | POKCLR   | 6600020 | Montana       | Yes  | BD   | Yes
146 * 27.2 | Arcade Keno              |   ?    | AUG/85  | KJCG     | 6300060 | POKCLR   | 6600020 | Gaming        | Yes  | BD   | Yes
147   27.3 | Export Poker             |   ?    |         | PKCG     | 6300010 | POKCLR   | 6600020 | Gaming        | No   |      | No
148   27.4 | Keno II                  |   ?    |         | KJCG     | 6300060 | POKCLR   | 6600020 | Montana       | No   |      | No
149   27.5 | Keno (Austria)           |   ?    |         | KENOCG   | 6300060 | POKCLR   | 6600020 | Gaming        | No   |      | No
150   27.6 | Slot 8                   |   ?    |         | SL8CG    | 6300290 | SLOT4CLR | 6600140 | Gaming        | No   |      | No
151   27.9 | 3-Reel Slot, Gaming      |   ?    |         | SL2CG    | 6300280 | SL2CLR   | 6600120 | Nevada Gaming | No   |      | No
152   28.0 | 3-Reel Slot              |   ?    |         | SL2CG    | 6300180 | SL2CLR   | 6600120 | Gaming        | No   |      | No
153   28.2 | Hotline                  |   ?    |         | HLCG     | 6300160 | HLCLR    | 6600110 | Amusement     | No   |      | No
154   28.5 | Hotline                  |   ?    |         | HLCG     | 6300130 | HLCLR    | 6600110 | Amusement     | No   |      | No
155   29.0x| Stand or Draw Poker      |   ?    |         | ST2CG    | 6300270 | ST2CLR   | 6600150 | Nevada Gaming | No   |      | No
156   30.0x| Casino 21                |   ?    |         | GPKCG    | 6300250 | WILD     | 6600010 | Nevada Gaming | No   |      | No
157   31.0x| Poker (discard)          |   ?    |         | POKCG    | 6300010 | POKCLR   | 6600020 | Nevada Gaming | No   |      | No
158   32.0x| Poker (hold)             |   ?    |         | POKCG    | 6300010 | POKCLR   | 6600020 | Nevada Gaming | No   |      | No
159   33.0x| Keno                     |   ?    |         | KJCG     | 6300060 | POKCLR   | 6600020 | Nevada Gaming | No   |      | No
160   34.0x| Keno (Austria)           |   ?    |         | KJCG     | 6300060 | POKCLR   | 6600020 | Gaming        | No   |      | No
161   35.0x| 1-3 Sign Poker (discard) |   ?    |         | POKCG    | 6300010 | POKCLR   | 6600020 | Nevada Gaming | No   |      | No
162   36.0x| 1-3 Sign Poker (hold)    |   ?    |         | POKCG    | 6300010 | POKCLR   | 6600020 | Nevada Gaming | No   |      | No
163   37.0x| Amusement Keno           |   ?    |         | KJCG     | 6300060 | POKCLR   | 6600020 | Montana       | No   |      | No
164   39.0x| 3-Reel Slot              |   ?    |         | SBARCG   | 6300305 | JKRSLOT  | 6600170 | Nevada Gaming | No   |      | No
165   39.0x| 3-Reel Slot              |   ?    |         | PLAIN7CG | 6300309 | JKRSLOT  | 6600170 | Nevada Gaming | No   |      | No
166   39.0x| 3-Reel Slot              |   ?    |         | JWCG     | 6300313 | JKRSLOT  | 6600170 | Nevada Gaming | No   |      | No
167   40.0x| Poker w/Wild Card        |  903   |         | JKRCG    | 6300260 | WLDCLR   | 6600010 | Nevada Gaming | No   |      | No
168   41.0x| Do-it-yourself Bingo     |   ?    |         | KCG      | 6300060 | PKRCLR   | 6600020 | Amer-Indian   | No   |      | No
169   42.0x| Mr. Domino               |   ?    |         | NDMCG    | 6300300 | DOMCLR   | 6600080 | Amusement     | No   |      | No
170   43.0x| Export Poker             |   ?    |         | GPKCG    | 6300170 | POKCLR   | 6600020 | Gaming        | No   |      | No
171   44.0x| Tourney Poker (discard)  |   ?    |         | POKCG    | 6300010 | POKCLR   | 6600020 | Nevada Gaming | No   |      | No
172   45.0x| Tourney Poker (hold)     |   ?    |         | POKCG    | 6300010 | POKCLR   | 6600020 | Nevada Gaming | No   |      | No
173   46.0x| Gaming Poker             |   ?    |         | GPKCG    | 6300010 | POKCLR   | 6600020 | Nevada Gaming | No   |      | No
174   47.0x| 4-Card Indian Bingo      |   ?    |         | FCB7CG   | 6300150 | FCB7CLR  | 6600100 | Amer-Indian   | No   |      | No
175   48.0x| Keno                     |   ?    |         | KJCG     | 6300060 | POKCLR   | 6600020 | Montana       | No   |      | No
176   51.0x| Poker (906-III)          |  906   |         | GP2CG    | unknown | WILD     | unknown | Nevada Gaming | No   |      | No
177        |                          |        |         |          |         |          |         |               |      |      |
178 * 903d | System 903 Diag.PROM     |  903   | unknown | any      | unknown | any      | unknown | Testing H/W   | Yes  | OK   | Yes
179 * 905d | System 905 Diag.PROM     |  905   | unknown | any      | unknown | any      | unknown | Testing H/W   | Yes  | OK   | Yes
180
181
182   (*) Not in the original list.
183
184
185
186   ++++ Unofficial games ++++
187
188   -------------------------------+----------------------+------+-----------+--------+------+------+-------
189    NAME                          | COMPANY              | YEAR | GAME TYPE | SYSTEM | DUMP | STAT | ADDED
190   -------------------------------+----------------------+------+-----------+--------+------+------+-------
191    El Grande - 5 Card Draw (New) | Tuni Electro Service | 1982 | Amusement |  903   | Yes  | BR   | Yes
192    Jackpot Joker Poker (set 1)   | Enter-Tech (ETL)     | 1983 | Amusement |  903   | Yes  | OK   | Yes
193    Jackpot Joker Poker (set 2)   | Enter-Tech (ETL)     | 1983 | Amusement |  903   | Yes  | OK   | Yes
194    SSI Poker (v2.4)              | SSI                  | 1988 | Amusement |  903   | Yes  | IC   | Yes
195    SSI Poker (v3.0)              | SSI                  | 1988 | Amusement |  903   | Yes  | IC   | Yes
196    SSI Poker (v4.0)              | SSI                  | 1990 | Amusement |  903   | Yes  | IC   | Yes
197
198
199    STAT: OK = Good dump.
200          BD = At least 1 ROM is bad dumped.
201          BR = At least 1 ROM is bit-rotten.
202          IC = Incomplete set (at least 1 ROM is missing)
203
204    (for more information see the ROM load)
205
206
207
208***********************************************************************************
209
210
211    --- General Notes ---
212
213
214    Gaming Draw Poker:
215
216    Gaming Draw Poker, formerly known as Jack Potten's poker, is an evolution of the
217    mentioned game. It was created by Cal Omega in 1981 for Casino Electronics Inc.
218    Cal Omega was bought out by CEI (Casino Electronics Inc.), and CEI was bought by UCMC.
219
220    This game was made before the CEI 906iii system.
221
222    The game use the same GFX set that Jack Potten's poker for cards and have similar
223    layout, but the game is different and the old discrete pitched sounds were replaced
224    with a better set of sounds through a AY8910/12 implementation. The empty socket in
225    the pcb is maybe for future upgrades instead of sound ROM, since sounds are hardcoded.
226
227    Inputs are multiplexed and selected through PIA1, portB.
228
229    In game, use "Stand" instead of "Deal/Draw" to conserve all cards without discards.
230    To enter to TEST MODE press F2. Press "Discard 1" + "Discard 2" + "Discard 3" to exit.
231    To enter the STATS MODE press "Show Stats". Press "Deal/Draw" to exit.
232    To pass coin and hopper errors press "Hopper SW". Also keep it pressed to see the status.
233    For payout, press "Manual Collect" an then "Payout" for each credit (manual mode).
234
235
236    El Grande - 5 Card Draw:
237
238    This game was created by Tuni Electro Service and was licenced to E.T. Marketing,Inc.
239    This is the new version. The old one is still undumped, but looks like Golden Poker D-Up.
240
241    Flyer: http://www.arcadeflyers.com/?page=thumbs&db=videodb&id=4542
242
243    The AY8912 is mapped to 0x840/0x841 but the game lacks of credits and bet sounds.
244    The rest of sounds are ok. Maybe the missing ones are generated by discrete circuitry.
245
246    Inputs are multiplexed and selected through PIA1, portB.
247
248    There aren't meter and stats modes. Only for amusement, so... no payout.
249    To clear credits press F2.
250    To enter to TEST MODE press F2 twice. Press "Hold 1" + "Hold 2" + "Hold 3" to exit.
251
252
253
254***********************************************************************************?
255
256
257    *** Memory Maps ***
258
259    -- System 903 --
260
261    $0000 - $07FF   NVRAM           ; All registers and settings.
262    $0840 - $0840   AY-8912         ; Read/Control.
263    $0841 - $0841   AY-8912         ; Write.
264    $0880 - $0880   CRTC6845        ; MC6845 adressing.
265    $0881 - $0881   CRTC6845        ; MC6845 Read/Write.
266    $08C4 - $08C7   PIA0            ; I/O Ports 0, 1, 2, 3.
267    $08C8 - $08CB   PIA1            ; I/O Port  4.
268
269    $1000 - $13FF   VideoRAM
270    $1400 - $17FF   ColorRAM
271
272    $1800 - $FFFF   ROM
273
274
275    -- System 905 --
276
277    $0000 - $07FF   NVRAM           ; All registers and settings.
278    $1080 - $1080   CRTC6845        ; MC6845 adressing.
279    $1081 - $1081   CRTC6845        ; MC6845 Read/Write.
280    $10C4 - $10C7   PIA0            ; I/O Ports 0, 1, 2, 3.
281    $10C8 - $10CB   PIA1            ; I/O Port  4, AY-8912.
282
283    $2000 - $23FF   VideoRAM
284    $2400 - $27FF   ColorRAM
285
286    $2800 - $FFFF   ROM
287
288
289    *** MC6545 Initialization ***
290
291    ----------------------------------------------------------------------------------------------------------------------
292    register:  R00   R01   R02   R03   R04   R05   R06   R07   R08   R09   R10   R11   R12   R13   R14   R15   R16   R17
293    ----------------------------------------------------------------------------------------------------------------------
294    value:     0x27  0x20  0x23  0x03  0x1F  0x04  0x1F  0x1F  0x00  0x07  0x00  0x00  0x00  0x00  0x00  0x00  0x00  0x00.
295
296
297
298    *** MC6545 conditional change for elgrande if 0x8c4 (PIA0) has bit7 activated ***
299
300    ---------------------------------------------------------
301    register:  R00   R01   R02   R03   R04   R05   R06   R07
302    ---------------------------------------------------------
303    value:     0x27  0x20  0x23  0x03  0x26  0x00  0x20  0x22
304
305
306
307***********************************************************************************
308
309
310    Dumper notes (old)
311
312
313    -- Gaming Draw Poker --------------------------------------------------------
314
315    Program roms are roms 23*.*, on the board, there is a number near each roms
316    looks to be the address of the rom :
317
318            23-91   1800
319            23-92   2000
320            23-93   2800
321            23-94   3000
322            23-9    3800
323
324    Graphics are in roms CG*.*, there is no type indication on these rams, i hope
325    i read them correctly.
326
327    There is also 3 sets of switches on the board :
328
329            SW1     1       300     SW2     1       OPT1
330                    2       600             2       OPT2
331                    3       1200            3       OPT3
332                    4       2400            4       OPT4
333                    5       4800            5       OPT5
334                    6       9600            6       DIS
335                    7       -               7       +VPOL
336                    8       -               8       +HPOL
337
338            SW3     no indications on the board
339
340    The sound rom is missing on the board :(
341
342
343    -- El Grande 5 Card Draw ----------------------------------------------------
344
345    ROM text showed poker stuff and "TUNI" "1982"
346
347    .u6    2716
348    .u7    2516
349    .u8    2516
350    .u9    2516
351    .u67   2516
352    .u68   2516
353    .u69   2716
354    .u70   2716
355    .u28   82s129
356
357    6502
358    HD46505
359    AY-3-8912
360    MC6821P x2
361    TC5501  x2
362    10MHz Crystal
363
364    empty socket at u5
365
366
367***********************************************************************************
368
369
370    UPDATES
371    -------
372
373
374    [2008-02-26]
375
376    - Renamed the driver to calomega.c.
377    - Extended the driver to support all the other Cal Omega systems.
378    - Switched to XTAL def.
379    - Fixed CPU & sound clocks based on official diagrams.
380    - Replaced the AY-8910 with AY-8912 to match the real hardware.
381    - Unified some memory maps.
382    - Splitted machine in sys903 and sys905.
383    - Fixed memory map offsets for sys905.
384    - Added support to the following games:
385
386        Game 7.6 (Arcade Poker)
387        Game 7.9 (Arcade Poker)
388        Game 9.4 (Keno)
389        Game 10.7 (Big Game)
390        Game 12.5 (Bingo)
391        Game 12.7 (Keno)
392        Game 12.8 (Arcade Game)
393        Game 13.4 (Nudge Bingo)
394        Game 14.5 (Pixels)
395        Game 15.7 (Double-Draw Poker)
396        Game 15.9 (Wild Double-Up)
397        Game 16.4 (Keno)
398        Game 16.8 (Keno)
399        Game 17.2 (Double Double Poker)
400        Game 17.51 (Gaming Draw Poker)
401        Game 17.6 (Nudge Bingo)
402        Game 18.1 (Nudge Bingo)
403        Game 18.3 (Pixels)
404        Game 18.5 (Pixels)
405        Game 18.6 (Pixels)
406        Game 20.4 (Super Blackjack)
407        Game 20.8 (Winner's Choice)
408        Game 22.7 (Amusement Poker, d/d)
409        Game 23.6 (Hotline)
410        Game 23.9 (Gaming Draw Poker) --> EX gdrawpkr.
411        Game 24.6 (Hotline)
412        Game 27.2 (Keno, amusement)
413        Game 27.2 (Keno, gaming)
414        System 903 Diag.PROM
415        System 905 Diag.PROM
416        Jackpot Joker Poker (set 1)
417        Jackpot Joker Poker (set 2)
418        SSI Poker (v2.4)
419        SSI Poker (v3.0)
420        SSI Poker (v4.0)
421
422    - Added a list of official/unofficial games, and their states.
423    - Fixed a bug introduced when extended the color PROM region to eliminate colortable lenght.
424    - Other changes/fixes.
425    - Updated technical notes.
426
427
428    [2007-09-15]
429
430    - Added sound support to "El Grande - 5 Card Draw".
431    - All crystals documented via #defines.
432    - All CPU and sound clocks derived from #defined crystal values.
433    - Splitted the driver to driver/video.
434    - Some minor input cleanups.
435    - Updated technical notes.
436
437
438    [2007-08-13]
439
440    - Added "El Grande - 5 Card Draw" (new).
441    - Constructed a new memory map for this game.
442    - Reworked a whole set of inputs for this game.
443    - Patched some bad bits in GFX rom d1.u68 till a good dump appear.
444    - Updated technical notes.
445
446
447    [2007-07-23]
448
449    - Cleaned up the inputs.
450    - Changed the hold buttons to "discard" since they are in fact discard buttons.
451    - Updated technical notes.
452
453
454    [2007-03-24 to 2007-04-27]
455
456    - Rearranged GFX in two different banks.
457    - Decoded GFX properly.
458    - Rewrote the memory map based on program ROMs analysis.
459    - Hooked two SY6520/6280 (M6821) PIAs for I/O.
460    - Hooked the SY6545 (6845) CRT controller.
461    - Fixed size for screen total and visible area based on SY6545 CRTC registers.
462    - Added partial inputs through PIAs.
463    - Added proper sound through AY8910 (mapped at $0840-$0841).
464    - Fixed AY8910 volume to avoid clips.
465    - Proper colors through color PROM decode.
466    - Demuxed inputs (thanks to Dox that pointed me in the right direction!)
467    - Added some game-protection workaround.
468    - Added NVRAM support.
469    - Renamed driver, set and description to match the real game.
470    - Added technical notes.
471
472
473    TODO:
474
475    - Parent/clone relationship.
476    - System 905 inputs.
477    - System 905 sound through PIAs.
478    - Fix lamps.
479
480
481***********************************************************************************/
482
483
484#define MASTER_CLOCK   XTAL_10MHz
485
486#include "driver.h"
487#include "video/mc6845.h"
488#include "machine/6821pia.h"
489#include "sound/ay8910.h"
490
491/* from video */
492WRITE8_HANDLER( calomega_videoram_w );
493WRITE8_HANDLER( calomega_colorram_w );
494WRITE8_HANDLER( calomega_mc6845_address_w );
495READ8_HANDLER( calomega_mc6845_register_r );
496WRITE8_HANDLER( calomega_mc6845_register_w );
497PALETTE_INIT( calomega );
498VIDEO_START( calomega );
499VIDEO_UPDATE( calomega );
500
501
502/*************************
503* Memory map information *
504*************************/
505
506static ADDRESS_MAP_START( sys903_map, ADDRESS_SPACE_PROGRAM, 8 )
507   AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
508   AM_RANGE(0x0840, 0x0840) AM_WRITE(AY8910_control_port_0_w)
509   AM_RANGE(0x0841, 0x0841) AM_WRITE(AY8910_write_port_0_w)
510   AM_RANGE(0x0880, 0x0880) AM_WRITE(calomega_mc6845_address_w)
511   AM_RANGE(0x0881, 0x0881) AM_READWRITE(calomega_mc6845_register_r, calomega_mc6845_register_w)
512   AM_RANGE(0x08c4, 0x08c7) AM_READWRITE(pia_0_r, pia_0_w)
513   AM_RANGE(0x08c8, 0x08cb) AM_READWRITE(pia_1_r, pia_1_w)
514   AM_RANGE(0x1000, 0x13ff) AM_RAM AM_WRITE(calomega_videoram_w) AM_BASE(&videoram)
515   AM_RANGE(0x1400, 0x17ff) AM_RAM AM_WRITE(calomega_colorram_w) AM_BASE(&colorram)
516   AM_RANGE(0x1800, 0xffff) AM_ROM
517ADDRESS_MAP_END
518
519static ADDRESS_MAP_START( sys905_map, ADDRESS_SPACE_PROGRAM, 8 )
520   AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
521   AM_RANGE(0x0880, 0x0880) AM_WRITE(AY8910_control_port_0_w)
522   AM_RANGE(0x0881, 0x0881) AM_WRITE(AY8910_write_port_0_w)
523   AM_RANGE(0x1080, 0x1080) AM_WRITE(calomega_mc6845_address_w)
524   AM_RANGE(0x1081, 0x1081) AM_READWRITE(calomega_mc6845_register_r, calomega_mc6845_register_w)
525   AM_RANGE(0x10c4, 0x10c7) AM_READWRITE(pia_0_r, pia_0_w)
526   AM_RANGE(0x10c8, 0x10cb) AM_READWRITE(pia_1_r, pia_1_w)
527   AM_RANGE(0x2000, 0x23ff) AM_RAM AM_WRITE(calomega_videoram_w) AM_BASE(&videoram)
528   AM_RANGE(0x2400, 0x27ff) AM_RAM AM_WRITE(calomega_colorram_w) AM_BASE(&colorram)
529   AM_RANGE(0x2800, 0xffff) AM_ROM
530ADDRESS_MAP_END
531
532
533/*************************
534*      Input ports       *
535*************************/
536
537static INPUT_PORTS_START( gdrawpkr )
538   PORT_START_TAG("IN0-0")
539   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )   /* credits */
540   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Manual Collect") PORT_CODE(KEYCODE_7)
541   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Double Up") PORT_CODE(KEYCODE_3)
542   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Deal/Draw") PORT_CODE(KEYCODE_2)
543   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("Cancel Discards") PORT_CODE(KEYCODE_N)
544   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON13 ) PORT_NAME("Stand") PORT_CODE(KEYCODE_E)
545   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
546   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
547
548   PORT_START_TAG("IN0-1")
549   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Payout") PORT_CODE(KEYCODE_Q)
550   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
551   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Service") PORT_CODE(KEYCODE_8)
552//  PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Bit 3") PORT_CODE(KEYCODE_F)
553//  PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Bit 4") PORT_CODE(KEYCODE_G)
554//  PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Bit 5") PORT_CODE(KEYCODE_H)
555   PORT_BIT( 0x0c, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Test Mode") PORT_CODE(KEYCODE_F2)   /* should be splitted? */
556   PORT_BIT( 0x14, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Hopper SW") PORT_CODE(KEYCODE_9)   /* should be splitted? */
557   PORT_BIT( 0x24, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Show Stats") PORT_CODE(KEYCODE_0)   /* should be splitted? */
558   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
559   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
560
561   PORT_START_TAG("IN0-2")
562   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("Discard 1") PORT_CODE(KEYCODE_Z)
563   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON9 ) PORT_NAME("Discard 2") PORT_CODE(KEYCODE_X)
564   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON10 ) PORT_NAME("Discard 3") PORT_CODE(KEYCODE_C)
565   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON11 ) PORT_NAME("Discard 4") PORT_CODE(KEYCODE_V)
566   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON12 ) PORT_NAME("Discard 5") PORT_CODE(KEYCODE_B)
567   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Small") PORT_CODE(KEYCODE_S)
568   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
569   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
570
571   PORT_START_TAG("IN0-3")
572   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
573   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Bet") PORT_CODE(KEYCODE_1)
574   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Take") PORT_CODE(KEYCODE_4)
575   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Big") PORT_CODE(KEYCODE_A)
576   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
577   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
578   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
579   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
580
581   PORT_START_TAG("SW1")
582   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
583   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
584   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
585   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
586   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
587   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
588   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
589   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
590   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
591   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
592   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
593   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
594   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
595   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
596   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
597   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
598   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
599   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
600   PORT_DIPNAME( 0xC0, 0x40, "Maximum Bet")
601   PORT_DIPSETTING(    0x00, "5" )
602   PORT_DIPSETTING(    0x40, "10" )
603   PORT_DIPSETTING(    0x80, "40" )
604   PORT_DIPSETTING(    0xC0, "80" )
605INPUT_PORTS_END
606
607static INPUT_PORTS_START( comg076 )
608   PORT_START_TAG("IN0-0")
609   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )   /* credits */
610   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Manual Collect") PORT_CODE(KEYCODE_7)
611   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Double Up") PORT_CODE(KEYCODE_3)
612   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Deal/Draw") PORT_CODE(KEYCODE_2)
613   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("Cancel Discards") PORT_CODE(KEYCODE_N)
614   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON13 ) PORT_NAME("Stand") PORT_CODE(KEYCODE_E)
615   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
616   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
617
618   PORT_START_TAG("IN0-1")
619   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN2 )   /* credits */
620   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
621   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Service") PORT_CODE(KEYCODE_8)
622//  PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Bit 3") PORT_CODE(KEYCODE_F)
623//  PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Bit 4") PORT_CODE(KEYCODE_G)
624//  PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Bit 5") PORT_CODE(KEYCODE_H)
625   PORT_BIT( 0x0c, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Unk.")   PORT_CODE(KEYCODE_8)   /* should be splitted? */
626   PORT_BIT( 0x14, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Hopper SW") PORT_CODE(KEYCODE_9)   /* should be splitted? */
627   PORT_BIT( 0x24, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Test Mode") PORT_CODE(KEYCODE_F2)   /* should be splitted? */
628   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
629   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
630
631   PORT_START_TAG("IN0-2")
632   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("Discard 1") PORT_CODE(KEYCODE_Z)
633   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON9 ) PORT_NAME("Discard 2") PORT_CODE(KEYCODE_X)
634   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON10 ) PORT_NAME("Discard 3") PORT_CODE(KEYCODE_C)
635   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON11 ) PORT_NAME("Discard 4") PORT_CODE(KEYCODE_V)
636   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON12 ) PORT_NAME("Discard 5") PORT_CODE(KEYCODE_B)
637   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Small") PORT_CODE(KEYCODE_S)
638   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
639   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
640
641   PORT_START_TAG("IN0-3")
642   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
643   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Bet") PORT_CODE(KEYCODE_1)
644   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Take") PORT_CODE(KEYCODE_4)
645   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Big") PORT_CODE(KEYCODE_A)
646   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
647   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
648   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
649   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
650
651   PORT_START_TAG("SW1")
652   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
653   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
654   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
655   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
656   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
657   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
658   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
659   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
660   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
661   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
662   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
663   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
664   PORT_DIPNAME( 0x30, 0x00, "Minimum Winning Hand")
665   PORT_DIPSETTING(    0x00, "Jacks or Better" )
666   PORT_DIPSETTING(    0x20, "Queens or Better" )
667   PORT_DIPSETTING(    0x30, "Kings or Better" )
668   PORT_DIPSETTING(    0x10, "Pair of Aces" )
669   PORT_DIPNAME( 0xC0, 0x80, "Maximum Bet")
670   PORT_DIPSETTING(    0x00, "1" )
671   PORT_DIPSETTING(    0x80, "10" )
672   PORT_DIPSETTING(    0xC0, "20" )
673   PORT_DIPSETTING(    0x40, "50" )
674INPUT_PORTS_END
675
676static INPUT_PORTS_START( comg128 )
677   PORT_START_TAG("IN0-0")
678   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )   /* credits */
679   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
680   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Double Up") PORT_CODE(KEYCODE_3)
681   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Deal/Draw") PORT_CODE(KEYCODE_2)
682   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("Cancel Discards") PORT_CODE(KEYCODE_N)
683   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
684   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
685   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
686
687   PORT_START_TAG("IN0-1")
688   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Payout") PORT_CODE(KEYCODE_Q)
689   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
690   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Service") PORT_CODE(KEYCODE_8)
691   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
692   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
693   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Test Mode") PORT_CODE(KEYCODE_F2)
694   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
695   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
696
697   PORT_START_TAG("IN0-2")
698   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("Discard 1") PORT_CODE(KEYCODE_Z)
699   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON9 ) PORT_NAME("Discard 2") PORT_CODE(KEYCODE_X)
700   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON10 ) PORT_NAME("Discard 3") PORT_CODE(KEYCODE_C)
701   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON11 ) PORT_NAME("Discard 4") PORT_CODE(KEYCODE_V)
702   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON12 ) PORT_NAME("Discard 5") PORT_CODE(KEYCODE_B)
703   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
704   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
705   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
706
707   PORT_START_TAG("IN0-3")
708   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
709   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Bet") PORT_CODE(KEYCODE_1)
710   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Take") PORT_CODE(KEYCODE_4)
711   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Big") PORT_CODE(KEYCODE_A)
712   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Small") PORT_CODE(KEYCODE_S)
713   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
714   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
715   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
716
717   PORT_START_TAG("SW1")
718   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
719   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
720   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
721   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
722   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
723   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
724   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
725   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
726   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
727   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
728   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
729   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
730   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
731   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
732   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
733   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
734   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
735   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
736   PORT_DIPNAME( 0xC0, 0x40, "Hands per Coin")
737   PORT_DIPSETTING(    0x00, "2" )
738   PORT_DIPSETTING(    0x40, "3" )
739   PORT_DIPSETTING(    0x80, "4" )
740   PORT_DIPSETTING(    0xC0, "5" )
741INPUT_PORTS_END
742
743static INPUT_PORTS_START( elgrande )
744   PORT_START_TAG("IN0-0")
745   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN2 )
746   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
747   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Double Up") PORT_CODE(KEYCODE_3)
748   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Deal/Draw") PORT_CODE(KEYCODE_2)
749   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("Cancel Holds") PORT_CODE(KEYCODE_N)
750   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
751   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
752   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
753
754   PORT_START_TAG("IN0-1")
755   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
756   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
757   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Service") PORT_CODE(KEYCODE_8)
758   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
759   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
760   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
761   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
762   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
763
764   PORT_START_TAG("IN0-2")
765   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("Hold 1") PORT_CODE(KEYCODE_Z)
766   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON9 ) PORT_NAME("Hold 2") PORT_CODE(KEYCODE_X)
767   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON10 ) PORT_NAME("Hold 3") PORT_CODE(KEYCODE_C)
768   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON11 ) PORT_NAME("Hold 4") PORT_CODE(KEYCODE_V)
769   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON12 ) PORT_NAME("Hold 5") PORT_CODE(KEYCODE_B)
770   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
771   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
772   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
773
774   PORT_START_TAG("IN0-3")
775   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Test Mode") PORT_CODE(KEYCODE_F2)
776   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Bet") PORT_CODE(KEYCODE_1)
777   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Take") PORT_CODE(KEYCODE_4)
778   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Odd") PORT_CODE(KEYCODE_A)
779   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Even") PORT_CODE(KEYCODE_S)
780   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
781   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
782   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
783
784   PORT_START_TAG("SW1")
785   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
786   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
787   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
788   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
789   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
790   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
791   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
792   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
793   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
794   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
795   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
796   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
797   PORT_DIPNAME( 0x30, 0x20, "Minimum Winning Hand")
798   PORT_DIPSETTING(    0x20, "Jacks or Better" )
799   PORT_DIPSETTING(    0x30, "Queens or Better" )
800   PORT_DIPSETTING(    0x00, "Kings or Better" )
801   PORT_DIPSETTING(    0x10, "Aces or Better" )
802   PORT_DIPNAME( 0xC0, 0x40, "Maximum Bet")
803   PORT_DIPSETTING(    0x00, "5" )
804   PORT_DIPSETTING(    0x40, "10" )
805   PORT_DIPSETTING(    0x80, "20" )
806   PORT_DIPSETTING(    0xC0, "50" )
807INPUT_PORTS_END
808
809static INPUT_PORTS_START( jjpoker )
810   PORT_START_TAG("IN0-0")
811   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN2 )
812   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
813   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Double Up") PORT_CODE(KEYCODE_3)
814   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Deal/Draw") PORT_CODE(KEYCODE_2)
815   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("Cancel Discards") PORT_CODE(KEYCODE_N)
816   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
817   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
818   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
819
820   PORT_START_TAG("IN0-1")
821   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
822   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
823   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Service") PORT_CODE(KEYCODE_8)
824   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
825   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
826   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
827   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
828   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
829
830   PORT_START_TAG("IN0-2")
831   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("Discard 1") PORT_CODE(KEYCODE_Z)
832   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON9 ) PORT_NAME("Discard 2") PORT_CODE(KEYCODE_X)
833   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON10 ) PORT_NAME("Discard 3") PORT_CODE(KEYCODE_C)
834   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON11 ) PORT_NAME("Discard 4") PORT_CODE(KEYCODE_V)
835   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON12 ) PORT_NAME("Discard 5") PORT_CODE(KEYCODE_B)
836   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
837   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
838   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
839
840   PORT_START_TAG("IN0-3")
841   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Test Mode") PORT_CODE(KEYCODE_F2)
842   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Bet") PORT_CODE(KEYCODE_1)
843   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Take") PORT_CODE(KEYCODE_4)
844   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Odd") PORT_CODE(KEYCODE_A)
845   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Even") PORT_CODE(KEYCODE_S)
846   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
847   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
848   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
849
850   PORT_START_TAG("SW1")
851   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
852   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
853   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
854   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
855   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
856   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
857   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
858   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
859   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
860   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Coinage ) )
861   PORT_DIPSETTING(    0x08, "1 coin 50 credits" )
862   PORT_DIPSETTING(    0x00, "1 coin 25 credits" )
863   PORT_DIPNAME( 0x30, 0x20, "Minimum Winning Hand")
864   PORT_DIPSETTING(    0x20, "Jacks or Better" )
865   PORT_DIPSETTING(    0x30, "Queens or Better" )
866   PORT_DIPSETTING(    0x00, "Kings or Better" )
867   PORT_DIPSETTING(    0x10, "Aces or Better" )
868   PORT_DIPNAME( 0xC0, 0x40, "Maximum Bet")
869   PORT_DIPSETTING(    0x00, "5" )
870   PORT_DIPSETTING(    0x40, "10" )
871   PORT_DIPSETTING(    0x80, "20" )
872   PORT_DIPSETTING(    0xC0, "50" )
873INPUT_PORTS_END
874
875static INPUT_PORTS_START( ssipkr )
876   PORT_START_TAG("IN0-0")
877   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN2 )
878   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
879   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Double Up") PORT_CODE(KEYCODE_3)
880   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Deal/Draw") PORT_CODE(KEYCODE_2)
881   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("Cancel Discards") PORT_CODE(KEYCODE_N)
882   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
883   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
884   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
885
886   PORT_START_TAG("IN0-1")
887   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
888   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
889   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Service") PORT_CODE(KEYCODE_8)
890   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
891   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
892   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
893   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
894   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
895
896   PORT_START_TAG("IN0-2")
897   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("Discard 1") PORT_CODE(KEYCODE_Z)
898   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON9 ) PORT_NAME("Discard 2") PORT_CODE(KEYCODE_X)
899   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON10 ) PORT_NAME("Discard 3") PORT_CODE(KEYCODE_C)
900   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON11 ) PORT_NAME("Discard 4") PORT_CODE(KEYCODE_V)
901   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON12 ) PORT_NAME("Discard 5") PORT_CODE(KEYCODE_B)
902   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
903   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
904   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
905
906   PORT_START_TAG("IN0-3")
907   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Test Mode") PORT_CODE(KEYCODE_F2)
908   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Bet") PORT_CODE(KEYCODE_1)
909   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Take") PORT_CODE(KEYCODE_4)
910   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Odd") PORT_CODE(KEYCODE_A)
911   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Even") PORT_CODE(KEYCODE_S)
912   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
913   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
914   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
915
916   PORT_START_TAG("SW1")
917   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
918   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
919   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
920   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
921   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
922   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
923   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
924   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
925   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
926   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Coinage ) )
927   PORT_DIPSETTING(    0x08, "1 coin 1 credits" )
928   PORT_DIPSETTING(    0x00, "1 coin 10 credits" )
929   PORT_DIPNAME( 0x30, 0x20, "Minimum Winning Hand")
930   PORT_DIPSETTING(    0x20, "Jacks or Better" )
931   PORT_DIPSETTING(    0x30, "Queens or Better" )
932   PORT_DIPSETTING(    0x00, "Kings or Better" )
933   PORT_DIPSETTING(    0x10, "Aces or Better" )
934   PORT_DIPNAME( 0xC0, 0x40, "Maximum Bet")
935   PORT_DIPSETTING(    0x00, "5" )
936   PORT_DIPSETTING(    0x40, "10" )
937   PORT_DIPSETTING(    0x80, "20" )
938   PORT_DIPSETTING(    0xC0, "50" )
939INPUT_PORTS_END
940
941static INPUT_PORTS_START( standard )
942   PORT_START_TAG("IN0-0")
943   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("0-1") PORT_CODE(KEYCODE_1)
944   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("0-2") PORT_CODE(KEYCODE_2)
945   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("0-3") PORT_CODE(KEYCODE_3)
946   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("0-4") PORT_CODE(KEYCODE_4)
947   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("0-5") PORT_CODE(KEYCODE_5)
948   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("0-6") PORT_CODE(KEYCODE_6)
949   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
950   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
951
952   PORT_START_TAG("IN0-1")
953   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("1-1") PORT_CODE(KEYCODE_Q)
954   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("1-2") PORT_CODE(KEYCODE_W)
955   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("1-3") PORT_CODE(KEYCODE_E)
956   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("1-4") PORT_CODE(KEYCODE_R)
957   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("1-5") PORT_CODE(KEYCODE_T)
958   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("1-6") PORT_CODE(KEYCODE_Y)
959   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
960   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
961
962   PORT_START_TAG("IN0-2")
963   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("2-1") PORT_CODE(KEYCODE_A)
964   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("2-2") PORT_CODE(KEYCODE_S)
965   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("2-3") PORT_CODE(KEYCODE_D)
966   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("2-4") PORT_CODE(KEYCODE_F)
967   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("2-5") PORT_CODE(KEYCODE_G)
968   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("2-6") PORT_CODE(KEYCODE_H)
969   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
970   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
971
972   PORT_START_TAG("IN0-3")
973   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("3-1") PORT_CODE(KEYCODE_Z)
974   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("3-2") PORT_CODE(KEYCODE_X)
975   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("3-3") PORT_CODE(KEYCODE_C)
976   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("3-4") PORT_CODE(KEYCODE_V)
977   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("3-5") PORT_CODE(KEYCODE_B)
978   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("3-6") PORT_CODE(KEYCODE_N)
979   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
980   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
981
982   PORT_START_TAG("SW1")
983   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
984   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
985   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
986   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
987   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
988   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
989   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
990   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
991   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
992   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
993   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
994   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
995   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
996   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
997   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
998   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
999   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1000   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1001   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
1002   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1003   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1004   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
1005   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1006   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1007INPUT_PORTS_END
1008
1009/*************************
1010*    Graphics Layouts    *
1011*************************/
1012
1013static const gfx_layout charlayout =
1014{
1015   8, 8,
1016   RGN_FRAC(1,1),
1017   1,
1018   { 0 },
1019   { 0, 1, 2, 3, 4, 5, 6, 7 },
1020   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
1021   8*8
1022};
1023
1024static const gfx_layout tilelayout =
1025{
1026   8, 8,
1027   RGN_FRAC(1,3),
1028   3,
1029   { 0, RGN_FRAC(1,3), RGN_FRAC(2,3) },    /* bitplanes are separated */
1030   { 0, 1, 2, 3, 4, 5, 6, 7 },
1031   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
1032   8*8
1033};
1034
1035
1036/******************************
1037* Graphics Decode Information *
1038******************************/
1039
1040static GFXDECODE_START( calomega )
1041   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 16 )
1042   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout, (8 * 3) + 128, 16 )
1043GFXDECODE_END
1044
1045
1046/***********************
1047*    Write Handlers    *
1048***********************/
1049
1050static int mux_data = 0;
1051
1052static READ8_HANDLER( mux_port_r )
1053{
1054   switch( mux_data&0xf0 )   /* bits 4-7 */
1055   {
1056      case 0x10: return input_port_0_r(0);
1057      case 0x20: return input_port_1_r(0);
1058      case 0x40: return input_port_2_r(0);
1059      case 0x80: return input_port_3_r(0);
1060   }
1061   return 0xff;
1062}
1063
1064static WRITE8_HANDLER( mux_w )
1065{
1066   mux_data = data ^ 0xff;   /* inverted */
1067}
1068
1069
1070/****  Lamps debug  ****
1071
1072    PIA0-B  PIA1-A
1073
1074    0xff    0x7f    = OFF
1075    0xfd    0x7f    = Deal
1076    0xf1    0x7b    = 12345 Holds
1077    0xef    0x7f    = Double Up & Take
1078    0xff    0x7e    = Big & Small
1079
1080    0xfe    0x7f    = Hold 1
1081    0xfd    0x7f    = Hold 2
1082    0xfb    0x7f    = Hold 3
1083    0xf7    0x7f    = Hold 4
1084    0xef    0x7f    = Hold 5
1085    0xff    0x7e    = Cancel
1086    0xff    0x7d    = Bet
1087    0xff    0x7b    = Take
1088
1089*/
1090static WRITE8_HANDLER( lamps_a_w )
1091{
1092   output_set_lamp_value(0, 1-((data) & 1));      // 0
1093   output_set_lamp_value(1, 1-((data >> 1) & 1));   // 1
1094   output_set_lamp_value(2, 1-((data >> 2) & 1));   // 2
1095   output_set_lamp_value(3, 1-((data >> 3) & 1));   // 3
1096   output_set_lamp_value(4, 1-((data >> 4) & 1));   // 4
1097   output_set_lamp_value(5, 1-((data >> 5) & 1));   // 5
1098   output_set_lamp_value(6, 1-((data >> 6) & 1));   // 6
1099   output_set_lamp_value(7, 1-((data >> 7) & 1));   // 7
1100}
1101
1102static WRITE8_HANDLER( lamps_b_w )
1103{
1104   output_set_lamp_value(8, 1-((data) & 1));      // 0
1105   output_set_lamp_value(9, 1-((data >> 1) & 1));   // 1
1106   output_set_lamp_value(10, 1-((data >> 2) & 1));   // 2
1107   output_set_lamp_value(11, 1-((data >> 3) & 1));   // 3
1108   output_set_lamp_value(12, 1-((data >> 4) & 1));   // 4
1109   output_set_lamp_value(13, 1-((data >> 5) & 1));   // 5
1110   output_set_lamp_value(14, 1-((data >> 6) & 1));   // 6
1111   output_set_lamp_value(15, 1-((data >> 7) & 1));   // 7
1112}
1113
1114
1115/***********************
1116*    PIA Interfaces    *
1117***********************/
1118
1119static const pia6821_interface pia0_intf =
1120{
1121   /* PIA inputs: A, B, CA1, CB1, CA2, CB2 */
1122   mux_port_r, 0, 0, 0, 0, 0,
1123
1124   /* PIA outputs: A, B, CA2, CB2 */
1125   0, lamps_a_w, 0, 0,
1126
1127   /* PIA IRQs: A, B */
1128   0, 0
1129};
1130
1131static const pia6821_interface pia1_intf =
1132{
1133   /* PIA inputs: A, B, CA1, CB1, CA2, CB2 */
1134   input_port_4_r, 0, 0, 0, 0, 0,   /* 5 & 6 not tested */
1135
1136   /* PIA outputs: A, B, CA2, CB2 */
1137
1138   lamps_b_w, mux_w, 0, 0,
1139
1140   /* PIA IRQs: A, B */
1141   0, 0
1142};
1143
1144
1145/*************************
1146*    Machine Drivers     *
1147*************************/
1148
1149static MACHINE_DRIVER_START( sys903 )
1150   // basic machine hardware
1151   MDRV_CPU_ADD_TAG("main", M6502, MASTER_CLOCK/16)   /* confirmed */
1152   MDRV_CPU_PROGRAM_MAP(sys903_map, 0)
1153   MDRV_CPU_VBLANK_INT(irq0_line_hold, 1)
1154
1155   MDRV_NVRAM_HANDLER(generic_0fill)
1156
1157   // video hardware
1158   MDRV_SCREEN_ADD("main", RASTER)
1159   MDRV_SCREEN_REFRESH_RATE(60)
1160   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
1161   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1162   MDRV_SCREEN_SIZE((39+1)*8, (31+1)*8)                  /* Taken from MC6845 init, registers 00 & 04. Normally programmed with (value-1) */
1163   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 31*8-1)    /* Taken from MC6845 init, registers 01 & 06 */
1164
1165   MDRV_GFXDECODE(calomega)
1166   MDRV_PALETTE_LENGTH(1024)
1167
1168   MDRV_PALETTE_INIT(calomega)
1169   MDRV_VIDEO_START(calomega)
1170   MDRV_VIDEO_UPDATE(calomega)
1171
1172   MDRV_DEVICE_ADD("crtc", MC6845)
1173
1174   // sound hardware
1175   MDRV_SPEAKER_STANDARD_MONO("mono")
1176   MDRV_SOUND_ADD(AY8912, MASTER_CLOCK/8)      /* confirmed */
1177   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
1178MACHINE_DRIVER_END
1179
1180static MACHINE_DRIVER_START( sys905 )
1181   // basic machine hardware
1182   MDRV_IMPORT_FROM( sys903 )
1183
1184   MDRV_CPU_REPLACE("main", M6502, MASTER_CLOCK/16)   /* confirmed */
1185   MDRV_CPU_PROGRAM_MAP(sys905_map, 0)
1186MACHINE_DRIVER_END
1187
1188
1189/*************************
1190*        ROM Load        *
1191*************************/
1192
1193ROM_START( comg076 )   /* Cal Omega v7.6 (Arcade Poker) */
1194   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1195   ROM_LOAD( "7.62",   0x2000, 0x0800, CRC(99ffa2a4) SHA1(07fd182ff86f9ab09bbf09f51d655811a09ffa03) )
1196   ROM_LOAD( "7.63",   0x2800, 0x0800, CRC(9ed58bc5) SHA1(c545053847ec7585e4ac97c70cf33529ed0f1111) )
1197   ROM_LOAD( "7.64",   0x3000, 0x0800, CRC(95714680) SHA1(26938903600bd0920b1dd1c6900c56c6b749976a) )
1198   ROM_LOAD( "7.65",   0x3800, 0x0800, CRC(02be8b39) SHA1(bb056e6e0ebd5f81c61fa7aa8252330088b3088e) )
1199   ROM_RELOAD(         0xf800, 0x0800 )    /* for vectors/pointers */
1200
1201   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
1202   ROM_LOAD( "pokcgo",    0x0000, 0x0800, CRC(b626ad89) SHA1(551b75f4559d11a4f8f56e38982114a21c77d4e7) )
1203
1204   ROM_REGION( 0x1800, REGION_GFX2, ROMREGION_DISPOSE )
1205   ROM_LOAD( "pokcgc",    0x0000, 0x0800, CRC(f2f94661) SHA1(f37f7c0dff680fd02897dae64e13e297d0fdb3e7) )
1206   ROM_LOAD( "pokcgb",    0x0800, 0x0800, CRC(6bbb1e2d) SHA1(51ee282219bf84218886ad11a24bc6a8e7337527) )
1207   ROM_LOAD( "pokcga",    0x1000, 0x0800, CRC(6e3e9b1d) SHA1(14eb8d14ce16719a6ad7d13db01e47c8f05955f0) )
1208
1209   ROM_REGION( 0x400, REGION_PROMS, 0 )
1210   ROM_LOAD( "pokerclr",   0x0000, 0x0100, CRC(a8191ef7) SHA1(d6f777980179ab091e2713ee815d46bf9c0ac486) )
1211   ROM_RELOAD(            0x0100, 0x0100 )
1212   ROM_RELOAD(            0x0200, 0x0100 )
1213   ROM_RELOAD(            0x0300, 0x0100 )
1214ROM_END
1215
1216ROM_START( comg079 )   /* Cal Omega v7.9 (Arcade Poker) */
1217   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1218   ROM_LOAD( "7.91",   0x1800, 0x0800, CRC(da415c27) SHA1(be42f1d36579ff8fafd6df4e30a64a6141a7a2ae) )
1219   ROM_LOAD( "7.92",   0x2000, 0x0800, CRC(31211ed3) SHA1(799bc4ca77ee01a4d45320263e4cc2d066ec26e5) )
1220 /* code jumps to $2e64 where there's an inexistent mnemonic 0x32! */
1221   ROM_LOAD( "7.93",   0x2800, 0x0800, BAD_DUMP CRC(52c84b9c) SHA1(569d6384b9084a11fe84e291f1c165bc0df3ab49) )
1222   ROM_LOAD( "7.94",   0x3000, 0x0800, CRC(ed0e7d4a) SHA1(72f512ca2da573e4571ca6f164fb055daa26dd3c) )
1223   ROM_LOAD( "7.95",   0x3800, 0x0800, CRC(3acc8f49) SHA1(1a193cc292f79da869caddd11478d6ad55466d7b) )
1224   ROM_RELOAD(         0xf800, 0x0800 )    /* for vectors/pointers */
1225
1226   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
1227   ROM_LOAD( "pokcgo",    0x0000, 0x0800, CRC(b626ad89) SHA1(551b75f4559d11a4f8f56e38982114a21c77d4e7) )
1228
1229   ROM_REGION( 0x1800, REGION_GFX2, ROMREGION_DISPOSE )
1230   ROM_LOAD( "pokcgc",    0x0000, 0x0800, CRC(f2f94661) SHA1(f37f7c0dff680fd02897dae64e13e297d0fdb3e7) )
1231   ROM_LOAD( "pokcgb",    0x0800, 0x0800, CRC(6bbb1e2d) SHA1(51ee282219bf84218886ad11a24bc6a8e7337527) )
1232   ROM_LOAD( "pokcga",    0x1000, 0x0800, CRC(6e3e9b1d) SHA1(14eb8d14ce16719a6ad7d13db01e47c8f05955f0) )
1233
1234   ROM_REGION( 0x400, REGION_PROMS, 0 )
1235   ROM_LOAD( "pokerclr",   0x0000, 0x0100, CRC(a8191ef7) SHA1(d6f777980179ab091e2713ee815d46bf9c0ac486) )
1236   ROM_RELOAD(            0x0100, 0x0100 )
1237   ROM_RELOAD(            0x0200, 0x0100 )
1238   ROM_RELOAD(            0x0300, 0x0100 )
1239ROM_END
1240
1241ROM_START( comg094 )   /* Cal Omega v9.4 (Keno) */
1242   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1243   ROM_LOAD( "keno9_4.02",   0x2000, 0x0800, CRC(1cff1319) SHA1(97b7ed54d398f36dc476028471784fc4e50bc378) )
1244   ROM_LOAD( "keno9_4.03",   0x2800, 0x0800, CRC(e6b123be) SHA1(f89df2dc6deeecff41be83d7a9040cfe5d872bad) )
1245   ROM_LOAD( "keno9_4.04",   0x3000, 0x0800, CRC(13939de9) SHA1(b2f97828808f6001846049cbf9af40e32908a58f) )
1246   ROM_LOAD( "keno9_4.05",   0x3800, 0x0800, CRC(7508de2e) SHA1(62faf65a1b815e11158cfb807090923ab368784d) )
1247   ROM_RELOAD(            0xf800, 0x0800 )    /* for vectors/pointers */
1248
1249   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
1250   ROM_LOAD( "kenocg.cgo",    0x0000, 0x0800, BAD_DUMP CRC(fb721236) SHA1(33ef355913b8acb5017a24ca1c46dec1c391a528) )   // bad dump?
1251
1252   ROM_REGION( 0x1800, REGION_GFX2, ROMREGION_DISPOSE )
1253   ROM_LOAD( "kenocg.cgc",    0x0000, 0x0800, CRC(fb721236) SHA1(33ef355913b8acb5017a24ca1c46dec1c391a528) )
1254   ROM_LOAD( "kenocg.cgb",    0x0800, 0x0800, CRC(2b9205d9) SHA1(48ed4dcef38e9567246f09bd9bea5bf291e7e1b9) )
1255   ROM_LOAD( "kenocg.cga",    0x1000, 0x0800, CRC(c4491e35) SHA1(44acb8bd7af287350b99d159b6f83015fcdbd93c) )
1256
1257   ROM_REGION( 0x400, REGION_PROMS, 0 )
1258   ROM_LOAD( "pokerclr",   0x0000, 0x0100, CRC(a8191ef7) SHA1(d6f777980179ab091e2713ee815d46bf9c0ac486) )
1259   ROM_RELOAD(            0x0100, 0x0100 )
1260   ROM_RELOAD(            0x0200, 0x0100 )
1261   ROM_RELOAD(            0x0300, 0x0100 )
1262ROM_END
1263
1264ROM_START( comg107 )   /* Cal Omega v10.7 (Big Game) */
1265   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1266   ROM_LOAD( "10.72",   0x2000, 0x0800, CRC(dd0fbefb) SHA1(caed286ba1adb4d5c5c874c56339b9d71dd41bc6) )
1267   ROM_LOAD( "10.73",   0x2800, 0x0800, CRC(fcb7774d) SHA1(d3c89e0df0005e4bc4894156622b3d1e4cd09f2a) )
1268   ROM_LOAD( "10.74",   0x3000, 0x0800, CRC(d19ed885) SHA1(c41e59e87ce88a5b229e334b6a563a3b21d12b15) )
1269   ROM_LOAD( "10.75",   0x3800, 0x0800, CRC(1491f3ab) SHA1(cf545f5f5da910b98846699bff1d2e6eb40dc290) )
1270   ROM_RELOAD(         0xf800, 0x0800 )    /* for vectors/pointers */
1271
1272   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
1273   ROM_LOAD( "lotclr.cgo",    0x0000, 0x1000, CRC(6f7cffee) SHA1(ababeb49155c84b22c4bb3568cfb5f05ff1cd797) )
1274
1275   ROM_REGION( 0x3000, REGION_GFX2, ROMREGION_DISPOSE )
1276   ROM_LOAD( "lotclr.cgc",    0x0000, 0x1000, CRC(bfe4df1c) SHA1(f7e055d41e16ead6b18d755e664347645f94865a) )
1277   ROM_LOAD( "lotclr.cgb",    0x1000, 0x1000, CRC(5bda0f42) SHA1(d4b3340e9c8ca49483fa846103f0bd81d57a5ab3) )
1278   ROM_LOAD( "lotclr.cga",    0x2000, 0x1000, CRC(0975e360) SHA1(7b9dbbae50c43ad99ee11798ada0a44e71c611f9) )
1279
1280   ROM_REGION( 0x0800, REGION_USER1, 0 )   /* keyboard interfase ROM */
1281   ROM_LOAD( "lotkbd.sub",    0x0000, 0x0800, CRC(c1636ab5) SHA1(5a3ad24918751ca6a6640807e421e80f6b4cc844) )
1282
1283   ROM_REGION( 0x400, REGION_PROMS, 0 )
1284   ROM_LOAD( "bclr",      0x0000, 0x0100, CRC(0ec45d01) SHA1(da73ae7e1c74913921dc378a97795c6da47dcbfb) )
1285   ROM_RELOAD(            0x0100, 0x0100 )
1286   ROM_RELOAD(            0x0200, 0x0100 )
1287   ROM_RELOAD(            0x0300, 0x0100 )
1288ROM_END
1289
1290ROM_START( comg125 )   /* Cal Omega v12.5 (Bingo) */
1291   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1292   ROM_LOAD( "bngo12_5.02", 0xe000, 0x0800, CRC(ea0a6bd6) SHA1(f138d2f29252d95dea93a1e936725de99c714b35) )
1293   ROM_LOAD( "bngo12_5.03", 0xe800, 0x0800, CRC(c888ee34) SHA1(2796c6ae196b046f12b75b1c095a430fa4be0da2) )
1294   ROM_LOAD( "bngo12_5.04", 0xf000, 0x0800, CRC(4c7d11a6) SHA1(0131f077e204250d594c9baadc0596efeb7639cc) )
1295   ROM_LOAD( "bngo12_5.05", 0xf800, 0x0800, CRC(fabe1de0) SHA1(a39583d410707930fbe32341c30bb1b8a28a8d73) )
1296
1297   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
1298   ROM_LOAD( "bingo.cgo", 0x0000, 0x1000, CRC(ded1c944) SHA1(eafb30b4a2cbb6c10dba959d3839a8f8bf793972) )
1299
1300   ROM_REGION( 0x3000, REGION_GFX2, ROMREGION_DISPOSE )
1301   ROM_LOAD( "bingo.cga", 0x0000, 0x1000, CRC(3fc39df9) SHA1(223d05f8969a1846a986b29395c98f97a3218bf7) )
1302   ROM_LOAD( "bingo.cgb", 0x1000, 0x1000, CRC(a7548075) SHA1(a751289cbc8b726082b60740c0202c08e3981e24) )
1303   ROM_LOAD( "bingo.cgc", 0x2000, 0x1000, CRC(9f101dd8) SHA1(4f6671b8b36f9351f368d8bbc92c20bd2b7b3dab) )
1304
1305   ROM_REGION( 0x400, REGION_PROMS, 0 )
1306   ROM_LOAD( "82s129n.u28", 0x0000, 0x0100, CRC(6db5a344) SHA1(5f1a81ac02a2a74252decd3bb95a5436cc943930) )
1307   ROM_RELOAD(             0x0100, 0x0100 )
1308   ROM_RELOAD(             0x0200, 0x0100 )
1309   ROM_RELOAD(             0x0300, 0x0100 )
1310ROM_END
1311
1312ROM_START( comg127 )   /* Cal Omega v12.7 (Keno) */
1313   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1314   ROM_LOAD( "keno12_7.02",   0xe000, 0x0800, CRC(091a4b32) SHA1(3600854152482bf18d2377aa635a9fd7f3d4b2f7) )
1315   ROM_LOAD( "keno12_7.03",   0xe800, 0x0800, CRC(c1fb5293) SHA1(f20cdddb4c89cb2fc647ddfcff6bd6f5095a0a28) )
1316   ROM_LOAD( "keno12_7.04",   0xf000, 0x0800, CRC(de277137) SHA1(127b95616824dfb1025f3346c1335a8bf4835e68) )
1317   ROM_LOAD( "keno12_7.05",   0xf800, 0x0800, CRC(04485ba3) SHA1(ee22396fc23508635e43ca8b17fc1f23e670fe85) )
1318
1319   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
1320   ROM_LOAD( "kenocg.cgo",    0x0000, 0x0800, BAD_DUMP CRC(fb721236) SHA1(33ef355913b8acb5017a24ca1c46dec1c391a528) )   // bad dump?
1321
1322   ROM_REGION( 0x1800, REGION_GFX2, ROMREGION_DISPOSE )
1323   ROM_LOAD( "kenocg.cgc",    0x0000, 0x0800, CRC(fb721236) SHA1(33ef355913b8acb5017a24ca1c46dec1c391a528) )
1324   ROM_LOAD( "kenocg.cgb",    0x0800, 0x0800, CRC(2b9205d9) SHA1(48ed4dcef38e9567246f09bd9bea5bf291e7e1b9) )
1325   ROM_LOAD( "kenocg.cga",    0x1000, 0x0800, CRC(c4491e35) SHA1(44acb8bd7af287350b99d159b6f83015fcdbd93c) )
1326
1327   ROM_REGION( 0x400, REGION_PROMS, 0 )
1328   ROM_LOAD( "pokerclr",   0x0000, 0x0100, CRC(a8191ef7) SHA1(d6f777980179ab091e2713ee815d46bf9c0ac486) )
1329   ROM_RELOAD(            0x0100, 0x0100 )
1330   ROM_RELOAD(            0x0200, 0x0100 )
1331   ROM_RELOAD(            0x0300, 0x0100 )
1332ROM_END
1333
1334ROM_START( comg128 )   /* Cal Omega v12.8 (Arcade Game) */
1335   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1336   ROM_LOAD( "12.82",   0xe000, 0x0800, CRC(85f0c548) SHA1(f08e26a7acb883a92e73e564fb2b58422d1784c6) )
1337   ROM_LOAD( "12.83",   0xe800, 0x0800, CRC(57212e46) SHA1(d0bac63e0efcdb8ef4a1b6c4d53776447557e4d0) )
1338   ROM_LOAD( "12.84",   0xf000, 0x0800, CRC(00ab3cd8) SHA1(da00457c49d3a101dc31578d07b2e986f0d73919) )
1339   ROM_LOAD( "12.85",   0xf800, 0x0800, CRC(3b00c172) SHA1(039aa2a2b41ea29e8e22a889c3984e30b321e7e3) )
1340
1341   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
1342   ROM_LOAD( "pokcgo",    0x0000, 0x0800, CRC(b626ad89) SHA1(551b75f4559d11a4f8f56e38982114a21c77d4e7) )
1343
1344   ROM_REGION( 0x1800, REGION_GFX2, ROMREGION_DISPOSE )
1345   ROM_LOAD( "pokcgc",    0x0000, 0x0800, CRC(f2f94661) SHA1(f37f7c0dff680fd02897dae64e13e297d0fdb3e7) )
1346   ROM_LOAD( "pokcgb",    0x0800, 0x0800, CRC(6bbb1e2d) SHA1(51ee282219bf84218886ad11a24bc6a8e7337527) )
1347   ROM_LOAD( "pokcga",    0x1000, 0x0800, CRC(6e3e9b1d) SHA1(14eb8d14ce16719a6ad7d13db01e47c8f05955f0) )
1348
1349   ROM_REGION( 0x400, REGION_PROMS, 0 )
1350   ROM_LOAD( "pokerclr",   0x0000, 0x0100, CRC(a8191ef7) SHA1(d6f777980179ab091e2713ee815d46bf9c0ac486) )
1351   ROM_RELOAD(            0x0100, 0x0100 )
1352   ROM_RELOAD(            0x0200, 0x0100 )
1353   ROM_RELOAD(            0x0300, 0x0100 )
1354ROM_END
1355
1356ROM_START( comg134 )   /* Cal Omega 13.4 (Nudge Keno) */
1357   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1358   ROM_LOAD( "13.42",   0xe000, 0x0800, CRC(3ff1e83d) SHA1(0c2d2faed1148909dd7d50e9eda76c6403181435) )
1359   ROM_LOAD( "13.43",   0xe800, 0x0800, CRC(cf2125f4) SHA1(32678f3ac82c76fb8116de77ce332fe098d5e8c0) )
1360   ROM_LOAD( "13.44",   0xf000, 0x0800, CRC(09a8d3c4) SHA1(60937b386a7fa8c30bd509633b5e98e79a1189d4) )
1361   ROM_LOAD( "13.45",   0xf800, 0x0800, CRC(790d3347) SHA1(02bbbfd447bee596557e4c3a61649ca1330a970f) )
1362
1363   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
1364   ROM_LOAD( "nbcg.cgo",   0x0000, 0x0800, CRC(b4b01f22) SHA1(1214d91ae28ac40ef37fce787783cd64331ed224) )
1365
1366   ROM_REGION( 0x3000, REGION_GFX2, ROMREGION_DISPOSE )
1367   ROM_LOAD( "nbcg.cgc",   0x0000, 0x1000, CRC(f7ca234f) SHA1(3b2717051341c423969ed4bfb292a9f88119c2a8) )
1368   ROM_LOAD( "nbcg.cgb",   0x1000, 0x1000, CRC(9d409932) SHA1(d3ffca50a059278777238d206895a0d188f4ff6f) )
1369   ROM_LOAD( "nbcg.cga",   0x2000, 0x1000, CRC(afe1a666) SHA1(c1530700a283d18e7136754d45904930ef424bcf) )
1370
1371   ROM_REGION( 0x400, REGION_PROMS, 0 )
1372   ROM_LOAD( "bclr",      0x0000, 0x0100, CRC(0ec45d01) SHA1(da73ae7e1c74913921dc378a97795c6da47dcbfb) )
1373   ROM_RELOAD(            0x0100, 0x0100 )
1374   ROM_RELOAD(            0x0200, 0x0100 )
1375   ROM_RELOAD(            0x0300, 0x0100 )
1376ROM_END
1377
1378ROM_START( comg145 )   /* Cal Omega v14.5 (Pixels) */
1379   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1380   ROM_LOAD( "14.51", 0xd800, 0x0800, CRC(b173af4b) SHA1(2fd7d391c765e8e5bf148d92223ffc2a2619dcfd) )
1381   ROM_LOAD( "14.52", 0xe000, 0x0800, CRC(f12434c5) SHA1(f957831867cc8c98fb479cd2d859790d19883d26) )
1382   ROM_LOAD( "14.53", 0xe800, 0x0800, CRC(3b22802b) SHA1(8cc563e79fd90873132e358f2ce5942ddbd65144) )
1383   ROM_LOAD( "14.54", 0xf000, 0x0800, CRC(8a230410) SHA1(4ff31869a7389af20f6557d9306f19a5d3ba5766) )
1384   ROM_LOAD( "14.55", 0xf800, 0x0800, CRC(0e6e7413) SHA1(6e2b37f6cbb49ce3e0111777a3b197f5b2012ed0) )
1385
1386   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
1387   ROM_LOAD( "pixcg.cgo", 0x0000, 0x0800, CRC(4b487d88) SHA1(ae8bf1c84c475a70ea98eb8419a920389bac1761) )
1388
1389   ROM_REGION( 0x3000, REGION_GFX2, ROMREGION_DISPOSE )
1390   ROM_LOAD( "pixcg.cga", 0x0000, 0x1000, CRC(d80f064a) SHA1(1b22ca3e446ed3c6fb49a90c463394dec96bc4ec) )
1391   ROM_LOAD( "pixcg.cgb", 0x1000, 0x1000, CRC(a3bed6b1) SHA1(078cface4af9720bee3288f5f0236725c8bfb575) )
1392   ROM_LOAD( "pixcg.cgc", 0x2000, 0x1000, CRC(9750eea2) SHA1(4f8b04a161501840ad2576379f23e8be2d46a488) )
1393
1394   ROM_REGION( 0x400, REGION_PROMS, 0 )
1395   ROM_LOAD( "pixclr",      0x0000, 0x0100, CRC(67d23e76) SHA1(826cf77ca5a4d492d66e45ee96a7780a94fbe634) )
1396   ROM_RELOAD(            0x0100, 0x0100 )
1397   ROM_RELOAD(            0x0200, 0x0100 )
1398   ROM_RELOAD(            0x0300, 0x0100 )
1399ROM_END
1400
1401ROM_START( comg157 )   /* Cal Omega v15.7 (Double-Draw Poker) */
1402   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1403   ROM_LOAD( "15.71",    0xd800, 0x0800, CRC(e0c89569) SHA1(68f32b00dd8ceb08e9677438c2bfec86e1a7fe6a) )
1404   ROM_LOAD( "15.72",    0xe000, 0x0800, CRC(a3ebd1af) SHA1(a31eff7fe205efeb5b6fe1adaed66d2f23f91844) )
1405   ROM_LOAD( "15.73",    0xe800, 0x0800, CRC(68682479) SHA1(5644e7f86a854572f4e54d6cf9552ef9ccbcb195) )
1406   ROM_LOAD( "15.74",    0xf000, 0x0800, CRC(1d020dd0) SHA1(a36ae43587c0dd9abcb893db45715c405bb091fe) )
1407   ROM_LOAD( "15.75",    0xf800, 0x0800, CRC(dba3ad3e) SHA1(4ef16e7b7456e189fcbf3ceba98955960d0953fc) )
1408
1409   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
1410   ROM_LOAD( "gpkcg.cgo",    0x0000, 0x0800, CRC(b626ad89) SHA1(551b75f4559d11a4f8f56e38982114a21c77d4e7) )
1411
1412   ROM_REGION( 0x1800, REGION_GFX2, ROMREGION_DISPOSE )
1413   ROM_LOAD( "gpkcg.cgc",    0x0000, 0x0800, CRC(f2f94661) SHA1(f37f7c0dff680fd02897dae64e13e297d0fdb3e7) )
1414   ROM_LOAD( "gpkcg.cgb",    0x0800, 0x0800, CRC(6bbb1e2d) SHA1(51ee282219bf84218886ad11a24bc6a8e7337527) )
1415   ROM_LOAD( "gpkcg.cga",    0x1000, 0x0800, CRC(6e3e9b1d) SHA1(14eb8d14ce16719a6ad7d13db01e47c8f05955f0) )
1416
1417   ROM_REGION( 0x400, REGION_PROMS, 0 )
1418   ROM_LOAD( "pokerclr",   0x0000, 0x0100, CRC(a8191ef7) SHA1(d6f777980179ab091e2713ee815d46bf9c0ac486) )
1419   ROM_RELOAD(            0x0100, 0x0100 )
1420   ROM_RELOAD(            0x0200, 0x0100 )
1421   ROM_RELOAD(            0x0300, 0x0100 )
1422ROM_END
1423
1424ROM_START( comg159 )   /* Cal Omega v15.9 (Wild Double-Up) */
1425   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1426   ROM_LOAD( "15.93",    0xd000, 0x1000, CRC(a1ca1fc0) SHA1(a751dba148c818a25237c2ac95328b6a5643f4e0) )
1427   ROM_LOAD( "15.94",    0xe000, 0x1000, CRC(849595ea) SHA1(c28629de84b0c0d389c52490677ecb9139fd738d) )
1428   ROM_LOAD( "15.95",    0xf000, 0x1000, CRC(c858ea24) SHA1(c7ecaddd4064b352c061b9164f2f347c310fab39) )
1429
1430   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
1431   ROM_LOAD( "jkr2.cgo",    0x0000, 0x0800, CRC(987b3e4d) SHA1(ae4b5dc0e4d1195bbf18b375c1a4dbf880f5f38c) )
1432
1433   ROM_REGION( 0x1800, REGION_GFX2, ROMREGION_DISPOSE )
1434   ROM_LOAD( "jkr2.cgc",   0x0000, 0x0800, CRC(5b96f5e0) SHA1(4733349798eb059998a4814331f57e7f09e02490) )
1435   ROM_LOAD( "jkr2.cgb",   0x0800, 0x0800, CRC(d77dda31) SHA1(e11b476cf0b609a8a40981b81b4d83b3c86678dc) )
1436   ROM_LOAD( "jkr2.cga",   0x1000, 0x0800, CRC(def60756) SHA1(fe71424fc638761d9ff65391261a030a2889ad5e) )
1437
1438   ROM_REGION( 0x400, REGION_PROMS, 0 )
1439   ROM_LOAD( "wildclr",   0x0000, 0x0100, CRC(a26a8fae) SHA1(d570fe9443a0912bd34b81ac4c3e4c5f8901f523) )
1440   ROM_RELOAD(            0x0100, 0x0100 )
1441   ROM_RELOAD(            0x0200, 0x0100 )
1442   ROM_RELOAD(            0x0300, 0x0100 )
1443ROM_END
1444
1445ROM_START( comg164 )   /* Cal Omega v16.4 (Keno) */
1446   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1447   ROM_LOAD( "keno16_4.02",   0xd800, 0x0800, CRC(fae6b065) SHA1(a123f98e4b4815a06d62d0429697cdce71756b94) )
1448   ROM_LOAD( "keno16_4.03",   0xe000, 0x0800, CRC(15974dbc) SHA1(fe2979861b8021949c127b182b9b50975b77bdd1) )
1449   ROM_LOAD( "keno16_4.04",   0xe800, 0x0800, CRC(64f06a75) SHA1(1cf4d89d2ee60200f84d47a3a637471e0af9239c) )
1450   ROM_LOAD( "keno16_4.05",   0xf000, 0x0800, CRC(3a8bc80e) SHA1(a1fb58b30850b1fe2bf976b8b99c8c540d67534a) )
1451   ROM_RELOAD(               0xf800, 0x0800 )    /* for vectors/pointers */
1452
1453   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
1454   ROM_LOAD( "kenocg.cgo",    0x0000, 0x0800, BAD_DUMP CRC(fb721236) SHA1(33ef355913b8acb5017a24ca1c46dec1c391a528) )   // bad dump?
1455
1456   ROM_REGION( 0x1800, REGION_GFX2, ROMREGION_DISPOSE )
1457   ROM_LOAD( "kenocg.cgc",    0x0000, 0x0800, CRC(fb721236) SHA1(33ef355913b8acb5017a24ca1c46dec1c391a528) )
1458   ROM_LOAD( "kenocg.cgb",    0x0800, 0x0800, CRC(2b9205d9) SHA1(48ed4dcef38e9567246f09bd9bea5bf291e7e1b9) )
1459   ROM_LOAD( "kenocg.cga",    0x1000, 0x0800, CRC(c4491e35) SHA1(44acb8bd7af287350b99d159b6f83015fcdbd93c) )
1460
1461   ROM_REGION( 0x400, REGION_PROMS, 0 )
1462   ROM_LOAD( "pokerclr",   0x0000, 0x0100, CRC(a8191ef7) SHA1(d6f777980179ab091e2713ee815d46bf9c0ac486) )
1463   ROM_RELOAD(            0x0100, 0x0100 )
1464   ROM_RELOAD(            0x0200, 0x0100 )
1465   ROM_RELOAD(            0x0300, 0x0100 )
1466ROM_END
1467
1468ROM_START( comg168 )   /* Cal Omega v16.8 (Keno) */
1469   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1470   ROM_LOAD( "keno16_8.02",   0xe000, 0x0800, CRC(ba044cd6) SHA1(659ec979e61baf4e871af857b722bb6fd789ff75) )
1471   ROM_LOAD( "keno16_8.03",   0xe800, 0x0800, CRC(e3326b68) SHA1(7326f87319c363161ba8571dd983b070ef4f8694) )
1472   ROM_LOAD( "keno16_8.04",   0xf000, 0x0800, CRC(1f72acea) SHA1(26d0e5a36f14ccae22d216a13d0459f0389ea6c0) )
1473   ROM_LOAD( "keno16_8.05",   0xf800, 0x0800, CRC(4f38e3b3) SHA1(4d034959f665f0fdb5a4df85bae67dbd3d38077f) )
1474
1475   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
1476   ROM_LOAD( "kenocg.cgo",    0x0000, 0x0800, BAD_DUMP CRC(fb721236) SHA1(33ef355913b8acb5017a24ca1c46dec1c391a528) )   // bad dump?
1477
1478   ROM_REGION( 0x1800, REGION_GFX2, ROMREGION_DISPOSE )
1479   ROM_LOAD( "kenocg.cgc",    0x0000, 0x0800, CRC(fb721236) SHA1(33ef355913b8acb5017a24ca1c46dec1c391a528) )
1480   ROM_LOAD( "kenocg.cgb",    0x0800, 0x0800, CRC(2b9205d9) SHA1(48ed4dcef38e9567246f09bd9bea5bf291e7e1b9) )
1481   ROM_LOAD( "kenocg.cga",    0x1000, 0x0800, CRC(c4491e35) SHA1(44acb8bd7af287350b99d159b6f83015fcdbd93c) )
1482
1483   ROM_REGION( 0x400, REGION_PROMS, 0 )
1484   ROM_LOAD( "pokerclr",   0x0000, 0x0100, CRC(a8191ef7) SHA1(d6f777980179ab091e2713ee815d46bf9c0ac486) )
1485   ROM_RELOAD(            0x0100, 0x0100 )
1486   ROM_RELOAD(            0x0200, 0x0100 )
1487   ROM_RELOAD(            0x0300, 0x0100 )
1488ROM_END
1489
1490ROM_START( comg172 )   /* Cal Omega v17.2 (Double Double Poker) */
1491   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1492   ROM_LOAD( "17.23",    0xd000, 0x1000, CRC(96efc8d1) SHA1(96836ca7188dc53e3a8af64f1fed9fe1c0c4e056) )
1493   ROM_LOAD( "17.24",    0xe000, 0x1000, CRC(08d31a98) SHA1(85e23ffeb8fa82ec0155f54d2193511517e6ec8c) )
1494   ROM_LOAD( "17.25",    0xf000, 0x1000, CRC(82508c71) SHA1(dd44e949f36e04ceaf1e527615c7003d0a9c0073) )
1495
1496   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
1497   ROM_LOAD( "jkrpkr.cgo",    0x0000, 0x0800, CRC(987b3e4d) SHA1(ae4b5dc0e4d1195bbf18b375c1a4dbf880f5f38c) )
1498
1499   ROM_REGION( 0x1800, REGION_GFX2, ROMREGION_DISPOSE )
1500   ROM_LOAD( "jkrpkr.cgc",    0x0000, 0x0800, CRC(5b96f5e0) SHA1(4733349798eb059998a4814331f57e7f09e02490) )
1501   ROM_LOAD( "jkrpkr.cgb",    0x0800, 0x0800, CRC(d77dda31) SHA1(e11b476cf0b609a8a40981b81b4d83b3c86678dc) )
1502   ROM_LOAD( "jkrpkr.cga",    0x1000, 0x0800, CRC(def60756) SHA1(fe71424fc638761d9ff65391261a030a2889ad5e) )
1503
1504   ROM_REGION( 0x400, REGION_PROMS, 0 )
1505   ROM_LOAD( "wildclr",   0x0000, 0x0100, CRC(a26a8fae) SHA1(d570fe9443a0912bd34b81ac4c3e4c5f8901f523) )
1506   ROM_RELOAD(            0x0100, 0x0100 )
1507   ROM_RELOAD(            0x0200, 0x0100 )
1508   ROM_RELOAD(            0x0300, 0x0100 )
1509ROM_END
1510
1511ROM_START( comg175 )   /* Cal Omega v17.5 (Gaming Draw Poker) */
1512   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1513   ROM_LOAD( "17.51",   0xd800, 0x0800, CRC(5450b90a) SHA1(4e67a17b2353bbe89fb6be4951efd09a948a987e) )
1514   ROM_LOAD( "17.52",   0xe000, 0x0800, CRC(29d787fd) SHA1(3f8c46f928c7fc3e68fe47efe23505f393bdb577) )
1515   ROM_LOAD( "17.53",   0xe800, 0x0800, CRC(080f6a23) SHA1(69866fba7cc348976ed1dfbfe103a5852a60d081) )
1516   ROM_LOAD( "17.54",   0xf000, 0x0800, CRC(7867815d) SHA1(8f3c4375f9b7c4eb5ebe413a8ac8593ff2ceb3e0) )
1517   ROM_LOAD( "17.55",   0xf800, 0x0800, CRC(656aa3e3) SHA1(2ccf1328d134cb26a5c4a0e45841079166de19be) )
1518
1519   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
1520   ROM_LOAD( "pokcgo",    0x0000, 0x0800, CRC(b626ad89) SHA1(551b75f4559d11a4f8f56e38982114a21c77d4e7) )
1521
1522   ROM_REGION( 0x1800, REGION_GFX2, ROMREGION_DISPOSE )
1523   ROM_LOAD( "pokcgc",    0x0000, 0x0800, CRC(f2f94661) SHA1(f37f7c0dff680fd02897dae64e13e297d0fdb3e7) )
1524   ROM_LOAD( "pokcgb",    0x0800, 0x0800, CRC(6bbb1e2d) SHA1(51ee282219bf84218886ad11a24bc6a8e7337527) )
1525   ROM_LOAD( "pokcga",    0x1000, 0x0800, CRC(6e3e9b1d) SHA1(14eb8d14ce16719a6ad7d13db01e47c8f05955f0) )
1526
1527   ROM_REGION( 0x400, REGION_PROMS, 0 )
1528   ROM_LOAD( "pokerclr",   0x0000, 0x0100, CRC(a8191ef7) SHA1(d6f777980179ab091e2713ee815d46bf9c0ac486) )
1529   ROM_RELOAD(            0x0100, 0x0100 )
1530   ROM_RELOAD(            0x0200, 0x0100 )
1531   ROM_RELOAD(            0x0300, 0x0100 )
1532ROM_END
1533
1534ROM_START( comg176 )   /* Cal Omega 17.6 (Nudge Keno) */
1535   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1536   ROM_LOAD( "17.61",   0xd800, 0x0800, CRC(7b201d27) SHA1(142d25c424e6bfd4327bb796f8dc9d0e6cb21797) )
1537   ROM_LOAD( "17.62",   0xe000, 0x0800, CRC(0ce87971) SHA1(ad1fecf4ed34eccd2a5b09e8847cb4a011875b73) )
1538   ROM_LOAD( "17.63",   0xe800, 0x0800, CRC(adce3e97) SHA1(5c12984b241c4884158ecc0743a3805115457277) )
1539   ROM_LOAD( "17.64",   0xf000, 0x0800, CRC(2a48525a) SHA1(9e48ca9fc3cc4c42dac3a24b2a6ac78204f7d2d8) )
1540   ROM_LOAD( "17.65",   0xf800, 0x0800, CRC(d4d929fa) SHA1(9cee198596375b810210856bc4ba5f5a3d706df4) )
1541
1542   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
1543   ROM_LOAD( "nbcg.cgo",   0x0000, 0x0800, CRC(b4b01f22) SHA1(1214d91ae28ac40ef37fce787783cd64331ed224) )
1544
1545   ROM_REGION( 0x3000, REGION_GFX2, ROMREGION_DISPOSE )
1546   ROM_LOAD( "nbcg.cgc",   0x0000, 0x1000, CRC(f7ca234f) SHA1(3b2717051341c423969ed4bfb292a9f88119c2a8) )
1547   ROM_LOAD( "nbcg.cgb",   0x1000, 0x1000, CRC(9d409932) SHA1(d3ffca50a059278777238d206895a0d188f4ff6f) )
1548   ROM_LOAD( "nbcg.cga",   0x2000, 0x1000, CRC(afe1a666) SHA1(c1530700a283d18e7136754d45904930ef424bcf) )
1549
1550   ROM_REGION( 0x400, REGION_PROMS, 0 )
1551   ROM_LOAD( "bclr",      0x0000, 0x0100, CRC(0ec45d01) SHA1(da73ae7e1c74913921dc378a97795c6da47dcbfb) )
1552   ROM_RELOAD(            0x0100, 0x0100 )
1553   ROM_RELOAD(            0x0200, 0x0100 )
1554   ROM_RELOAD(            0x0300, 0x0100 )
1555ROM_END
1556
1557ROM_START( comg181 )   /* Cal Omega 18.1 (Nudge Keno) */
1558   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1559   ROM_LOAD( "18.12",   0xe000, 0x0800, CRC(dd867180) SHA1(caf703f45dea980e84fc29d2ea0d3f4e211aaa3f) )
1560   ROM_LOAD( "18.13",   0xe800, 0x0800, CRC(39ccbddd) SHA1(1c027957ad6a3346dd3bcc0b422d2e854c6f5439) )
1561   ROM_LOAD( "18.14",   0xf000, 0x0800, CRC(ddf23ef1) SHA1(8340a2b0125e42602045fea2a248f1ec9e9915c0) )
1562   ROM_LOAD( "18.15",   0xf800, 0x0800, CRC(549610b5) SHA1(371e4651a400d4c8b7181391c1d9b964d1ccb6fb) )
1563
1564   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
1565   ROM_LOAD( "nbcg.cgo",   0x0000, 0x0800, CRC(b4b01f22) SHA1(1214d91ae28ac40ef37fce787783cd64331ed224) )
1566
1567   ROM_REGION( 0x3000, REGION_GFX2, ROMREGION_DISPOSE )
1568   ROM_LOAD( "nbcg.cgc",   0x0000, 0x1000, CRC(f7ca234f) SHA1(3b2717051341c423969ed4bfb292a9f88119c2a8) )
1569   ROM_LOAD( "nbcg.cgb",   0x1000, 0x1000, CRC(9d409932) SHA1(d3ffca50a059278777238d206895a0d188f4ff6f) )
1570   ROM_LOAD( "nbcg.cga",   0x2000, 0x1000, CRC(afe1a666) SHA1(c1530700a283d18e7136754d45904930ef424bcf) )
1571
1572   ROM_REGION( 0x400, REGION_PROMS, 0 )
1573   ROM_LOAD( "bclr",      0x0000, 0x0100, CRC(0ec45d01) SHA1(da73ae7e1c74913921dc378a97795c6da47dcbfb) )
1574   ROM_RELOAD(            0x0100, 0x0100 )
1575   ROM_RELOAD(            0x0200, 0x0100 )
1576   ROM_RELOAD(            0x0300, 0x0100 )
1577ROM_END
1578
1579ROM_START( comg183 )   /* Cal Omega v18.3 (Pixels) */
1580   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1581   ROM_LOAD( "18.32", 0xC000, 0x1000, CRC(c793ffc1) SHA1(f2ef82f92a9e18128d28973bcf050d0c3e1819f3) )
1582   ROM_LOAD( "18.33", 0xd000, 0x1000, CRC(415a6599) SHA1(648986310a3864652897e5d18b8be06819cce7a8) )
1583   ROM_LOAD( "18.34", 0xe000, 0x1000, CRC(fc5d3b89) SHA1(3601401d00d7a0621eac4254da238e9c8929cac4) )
1584   ROM_LOAD( "18.35", 0xf000, 0x1000, CRC(6552207f) SHA1(bd8a7546b4dad07d151dc7039028916386aee5e9) )
1585
1586   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
1587   ROM_LOAD( "pixcg.cgo", 0x0000, 0x0800, CRC(4b487d88) SHA1(ae8bf1c84c475a70ea98eb8419a920389bac1761) )
1588
1589   ROM_REGION( 0x3000, REGION_GFX2, ROMREGION_DISPOSE )
1590   ROM_LOAD( "pixcg.cga", 0x0000, 0x1000, CRC(d80f064a) SHA1(1b22ca3e446ed3c6fb49a90c463394dec96bc4ec) )
1591   ROM_LOAD( "pixcg.cgb", 0x1000, 0x1000, CRC(a3bed6b1) SHA1(078cface4af9720bee3288f5f0236725c8bfb575) )
1592   ROM_LOAD( "pixcg.cgc", 0x2000, 0x1000, CRC(9750eea2) SHA1(4f8b04a161501840ad2576379f23e8be2d46a488) )
1593
1594   ROM_REGION( 0x400, REGION_PROMS, 0 )
1595   ROM_LOAD( "pixclr",      0x0000, 0x0100, CRC(67d23e76) SHA1(826cf77ca5a4d492d66e45ee96a7780a94fbe634) )
1596   ROM_RELOAD(            0x0100, 0x0100 )
1597   ROM_RELOAD(            0x0200, 0x0100 )
1598   ROM_RELOAD(            0x0300, 0x0100 )
1599ROM_END
1600
1601ROM_START( comg185 )   /* Cal Omega v18.5 (Pixels) */
1602   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1603   ROM_LOAD( "18.52", 0xC000, 0x1000, CRC(19225f7d) SHA1(73d713ee86886f935d9b2c2ca670d8e00d466b7f) )
1604   ROM_LOAD( "18.53", 0xd000, 0x1000, CRC(797e2b70) SHA1(83f974c6c1886eab5c90782766b72900c73045e1) )
1605   ROM_LOAD( "18.54", 0xe000, 0x1000, CRC(6becc802) SHA1(e72783db52bffd3fa2f7d35cd8a004415e37b004) )
1606   ROM_LOAD( "18.55", 0xf000, 0x1000, CRC(313db76a) SHA1(d81228bf0badc8a3cf08c77de27b3d973953175c) )
1607
1608   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
1609   ROM_LOAD( "pixcg.cgo", 0x0000, 0x0800, CRC(4b487d88) SHA1(ae8bf1c84c475a70ea98eb8419a920389bac1761) )
1610
1611   ROM_REGION( 0x3000, REGION_GFX2, ROMREGION_DISPOSE )
1612   ROM_LOAD( "pixcg.cga", 0x0000, 0x1000, CRC(d80f064a) SHA1(1b22ca3e446ed3c6fb49a90c463394dec96bc4ec) )
1613   ROM_LOAD( "pixcg.cgb", 0x1000, 0x1000, CRC(a3bed6b1) SHA1(078cface4af9720bee3288f5f0236725c8bfb575) )
1614   ROM_LOAD( "pixcg.cgc", 0x2000, 0x1000, CRC(9750eea2) SHA1(4f8b04a161501840ad2576379f23e8be2d46a488) )
1615
1616   ROM_REGION( 0x400, REGION_PROMS, 0 )
1617   ROM_LOAD( "pixclr",      0x0000, 0x0100, CRC(67d23e76) SHA1(826cf77ca5a4d492d66e45ee96a7780a94fbe634) )
1618   ROM_RELOAD(            0x0100, 0x0100 )
1619   ROM_RELOAD(            0x0200, 0x0100 )
1620   ROM_RELOAD(            0x0300, 0x0100 )
1621ROM_END
1622
1623ROM_START( comg186 )   /* Cal Omega v18.6 (Pixels) */
1624   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1625   ROM_LOAD( "18.62", 0xC000, 0x1000, CRC(025f4268) SHA1(750a5417fe2b077893d8252dd5eafc42fafd965e) )
1626   ROM_LOAD( "18.63", 0xd000, 0x1000, CRC(948a6ef1) SHA1(6aeb244209f3376042a32d9accb38e3f09cb192a) )
1627   ROM_LOAD( "18.64", 0xe000, 0x1000, CRC(9fb6e82b) SHA1(db38564e8060f1c67183f3f412a24439b2253e13) )
1628   ROM_LOAD( "18.65", 0xf000, 0x1000, CRC(a68be5ef) SHA1(1ab2bc1b070863260fa281970f886d77e2fa7ccd) )
1629
1630   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
1631   ROM_LOAD( "pixcg.cgo", 0x0000, 0x0800, CRC(4b487d88) SHA1(ae8bf1c84c475a70ea98eb8419a920389bac1761) )
1632
1633   ROM_REGION( 0x3000, REGION_GFX2, ROMREGION_DISPOSE )
1634   ROM_LOAD( "pixcg.cga", 0x0000, 0x1000, CRC(d80f064a) SHA1(1b22ca3e446ed3c6fb49a90c463394dec96bc4ec) )
1635   ROM_LOAD( "pixcg.cgb", 0x1000, 0x1000, CRC(a3bed6b1) SHA1(078cface4af9720bee3288f5f0236725c8bfb575) )
1636   ROM_LOAD( "pixcg.cgc", 0x2000, 0x1000, CRC(9750eea2) SHA1(4f8b04a161501840ad2576379f23e8be2d46a488) )
1637
1638   ROM_REGION( 0x400, REGION_PROMS, 0 )
1639   ROM_LOAD( "pixclr",      0x0000, 0x0100, CRC(67d23e76) SHA1(826cf77ca5a4d492d66e45ee96a7780a94fbe634) )
1640   ROM_RELOAD(            0x0100, 0x0100 )
1641   ROM_RELOAD(            0x0200, 0x0100 )
1642   ROM_RELOAD(            0x0300, 0x0100 )
1643ROM_END
1644
1645ROM_START( comg204 )   /* Cal Omega v20.4 (Super Blackjack) */
1646   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1647   ROM_LOAD( "bj20.41",   0xb000, 0x1000, CRC(9c2203f7) SHA1(fd566683e887cf80cd0e6c82a413aebc378397f8) )
1648   ROM_LOAD( "bj20.42",   0xc000, 0x1000, CRC(31b37010) SHA1(c35ef77725c6c6dd9f369d50d9a8e55c2e3644af) )
1649   ROM_LOAD( "bj20.43",   0xd000, 0x1000, CRC(a9edf684) SHA1(7d2d8f3ec00c93914bfd629fae838b7d0f4bf414) )
1650   ROM_LOAD( "bj20.44",   0xe000, 0x1000, CRC(7a46e6cd) SHA1(91be6ddfd33ebab1f65e08f58c1be46fc770c1bf) )
1651   ROM_LOAD( "bj20.45",   0xf000, 0x1000, CRC(1e76202a) SHA1(015bf7ba62a561f5640aad7855e5fdd46787cdbf) )
1652
1653   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
1654   ROM_LOAD( "bj-jkr2.cgo",   0x0000, 0x0800, CRC(987b3e4d) SHA1(ae4b5dc0e4d1195bbf18b375c1a4dbf880f5f38c) )
1655
1656   ROM_REGION( 0x1800, REGION_GFX2, ROMREGION_DISPOSE )
1657   ROM_LOAD( "bj-jkr2.cgc",   0x0000, 0x0800, CRC(5b96f5e0) SHA1(4733349798eb059998a4814331f57e7f09e02490) )
1658   ROM_LOAD( "bj-jkr2.cgb",   0x0800, 0x0800, CRC(d77dda31) SHA1(e11b476cf0b609a8a40981b81b4d83b3c86678dc) )
1659   ROM_LOAD( "bj-jkr2.cga",   0x1000, 0x0800, CRC(def60756) SHA1(fe71424fc638761d9ff65391261a030a2889ad5e) )
1660
1661   ROM_REGION( 0x400, REGION_PROMS, 0 )
1662   ROM_LOAD( "mltclr",      0x0000, 0x0100, CRC(fefb0fa8) SHA1(66d86aa19d9d37ffd2840d6653fcec667bc716d4) )
1663   ROM_RELOAD(            0x0100, 0x0100 )
1664   ROM_RELOAD(            0x0200, 0x0100 )
1665   ROM_RELOAD(            0x0300, 0x0100 )
1666ROM_END
1667
1668ROM_START( comg208 )   /* Cal Omega v20.8 (Winner's Choice) */
1669   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1670   ROM_LOAD( "20.81",   0xb000, 0x1000, CRC(938be03a) SHA1(606252b5160a7af340faa3d4ed6af9dff849c9ac) )
1671   ROM_LOAD( "20.82",   0xc000, 0x1000, CRC(7d42257c) SHA1(f1487bcc2475d1bcdfbc9bf866adcb0d510acef5) )
1672   ROM_LOAD( "20.83",   0xd000, 0x1000, CRC(b3b25958) SHA1(096f010db3164579ba81851a3f1062df0f46fc0f) )
1673   ROM_LOAD( "20.84",   0xe000, 0x1000, CRC(0bfb9f9d) SHA1(4a3c1e88faa90a9f4a483b053beb2c8af688d52d) )
1674   ROM_LOAD( "20.85",   0xf000, 0x1000, CRC(d61ba385) SHA1(0352a5306e942467d142982394d2d72892d1ecd6) )
1675
1676   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
1677   ROM_LOAD( "mlt2cg.cgo",   0x0000, 0x1000, CRC(43a095f0) SHA1(1824dd864bfc385035cc6b3da736ab6de9336440) )
1678
1679   ROM_REGION( 0x3000, REGION_GFX2, ROMREGION_DISPOSE )
1680   ROM_LOAD( "mlt2cg.cgc",   0x0000, 0x1000, CRC(432ae4f9) SHA1(e4229ee743d0245b3efaed0d852bf24712508ce9) )
1681   ROM_LOAD( "mlt2cg.cgb",   0x1000, 0x1000, CRC(d5173679) SHA1(396c9c3eb7a0a5e5d279d079e635c8e4e5581779) )
1682   ROM_LOAD( "mlt2cg.cga",   0x2000, 0x1000, CRC(b7397d3a) SHA1(f35607a4cd60e4467e27474e8063b7a7a4a65d9f) )
1683
1684   ROM_REGION( 0x400, REGION_PROMS, 0 )
1685   ROM_LOAD( "mltclr",      0x0000, 0x0100, CRC(fefb0fa8) SHA1(66d86aa19d9d37ffd2840d6653fcec667bc716d4) )
1686   ROM_RELOAD(            0x0100, 0x0100 )
1687   ROM_RELOAD(            0x0200, 0x0100 )
1688   ROM_RELOAD(            0x0300, 0x0100 )
1689ROM_END
1690
1691ROM_START( comg227 )   /* Cal Omega v22.7 (Amusement Poker (Double Double)) */
1692   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1693   ROM_LOAD( "22.73",    0xd000, 0x1000, CRC(152d1ff9) SHA1(8bbfea1bae9e4fe2a2ac52507dc8dd0e33fbbd06) )
1694   ROM_LOAD( "22.74",    0xe000, 0x1000, CRC(3af0f69d) SHA1(c34a0eab3ad4e4db310727805ba1ddc73533bfa6) )
1695   ROM_LOAD( "22.75",    0xf000, 0x1000, CRC(d1f3fe24) SHA1(8b43b521fb1be8ef4286b4bfee99b654c49cf9de) )
1696
1697   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
1698   ROM_LOAD( "jkrpkr.cgo",    0x0000, 0x0800, CRC(987b3e4d) SHA1(ae4b5dc0e4d1195bbf18b375c1a4dbf880f5f38c) )
1699
1700   ROM_REGION( 0x1800, REGION_GFX2, ROMREGION_DISPOSE )
1701   ROM_LOAD( "jkrpkr.cgc",    0x0000, 0x0800, CRC(5b96f5e0) SHA1(4733349798eb059998a4814331f57e7f09e02490) )
1702   ROM_LOAD( "jkrpkr.cgb",    0x0800, 0x0800, CRC(d77dda31) SHA1(e11b476cf0b609a8a40981b81b4d83b3c86678dc) )
1703   ROM_LOAD( "jkrpkr.cga",    0x1000, 0x0800, CRC(def60756) SHA1(fe71424fc638761d9ff65391261a030a2889ad5e) )
1704
1705   ROM_REGION( 0x400, REGION_PROMS, 0 )
1706   ROM_LOAD( "wildclr",   0x0000, 0x0100, CRC(a26a8fae) SHA1(d570fe9443a0912bd34b81ac4c3e4c5f8901f523) )
1707   ROM_RELOAD(            0x0100, 0x0100 )
1708   ROM_RELOAD(            0x0200, 0x0100 )
1709   ROM_RELOAD(            0x0300, 0x0100 )
1710ROM_END
1711
1712ROM_START( comg236 )   /* Cal Omega v23.6 (Hotline) */
1713   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1714   ROM_LOAD( "23.62",    0xc000, 0x1000, CRC(6f3dd409) SHA1(8112c3114609317fe5543bf26fa426d36d60c5e1) )
1715   ROM_LOAD( "23.63",    0xd000, 0x1000, CRC(76e96865) SHA1(03055751efa143cff0501aaa9b2beb9d533e13e7) )
1716   ROM_LOAD( "23.64",    0xe000, 0x1000, CRC(26a18d82) SHA1(1ca036c014f180fb1720150642be3986c053c1c9) )
1717   ROM_LOAD( "23.65",    0xf000, 0x1000, CRC(4e24d2d3) SHA1(56200760dced8b8bf2b38eee5c26a20ffc5b5442) )
1718
1719   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
1720   ROM_LOAD( "hlcg.cgo",    0x0000, 0x1000, CRC(b2871c94) SHA1(001c376479701efa4542c88f0eca9e13c694667c) )
1721
1722   ROM_REGION( 0x3000, REGION_GFX2, ROMREGION_DISPOSE )
1723   ROM_LOAD( "hlcg.cgc",    0x0000, 0x1000, CRC(6af901d9) SHA1(f9fcfcf2c92d1a3ef9a18b4e3e680c9de4829533) )
1724   ROM_LOAD( "hlcg.cgb",    0x1000, 0x1000, CRC(db2d3eb7) SHA1(45f686edf7093069b44e895547c7ec67f820447d) )
1725   ROM_LOAD( "hlcg.cga",    0x2000, 0x1000, CRC(a7e583fd) SHA1(d3b0aa9e24b6aedf24af55e5b149ab75d6f01a36) )
1726
1727   ROM_REGION( 0x400, REGION_PROMS, 0 )
1728   ROM_LOAD( "hlclr",      0x0000, 0x0100, CRC(1c994cda) SHA1(5c8698b4c5e43146106c9da8a306e3099b26ca2d) )
1729   ROM_RELOAD(            0x0100, 0x0100 )
1730   ROM_RELOAD(            0x0200, 0x0100 )
1731   ROM_RELOAD(            0x0300, 0x0100 )
1732ROM_END
1733
1734ROM_START( comg239 )   /* Cal Omega v23.9 (Gaming Draw Poker) */
1735   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1736   ROM_LOAD( "23-91.u5",    0xd800, 0x0800, CRC(b49035e2) SHA1(b94a0245ca64d15b1496d1b272ffc0ce80f85526) )
1737   ROM_LOAD( "23-92.u6",    0xe000, 0x0800, CRC(d9ffaa73) SHA1(e39d10121e16f89cd8d30a5391a14dc3d4b13a46) )
1738   ROM_LOAD( "23-93.u7",    0xe800, 0x0800, CRC(f4e44280) SHA1(a03e5f03ed86c8ad7900fab0ef6a71c76eba3232) )
1739   ROM_LOAD( "23-94.u8",    0xf000, 0x0800, CRC(8372f4d0) SHA1(de289b65cbe30c92b46fa87b9262ff7f9cfa0431) )
1740   ROM_LOAD( "23-9.u9",    0xf800, 0x0800, CRC(bfcb934d) SHA1(b7cfa049bdd773368cb8326bcdfabbf474d15bb4) )
1741
1742   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
1743   ROM_LOAD( "cg-0.u67",    0x0000, 0x0800, CRC(b626ad89) SHA1(551b75f4559d11a4f8f56e38982114a21c77d4e7) )
1744
1745   ROM_REGION( 0x1800, REGION_GFX2, ROMREGION_DISPOSE )
1746   ROM_LOAD( "cg-2c.u70",    0x0000, 0x0800, CRC(f2f94661) SHA1(f37f7c0dff680fd02897dae64e13e297d0fdb3e7) )
1747   ROM_LOAD( "cg-2b.u69",    0x0800, 0x0800, CRC(6bbb1e2d) SHA1(51ee282219bf84218886ad11a24bc6a8e7337527) )
1748   ROM_LOAD( "cg-2a.u68",    0x1000, 0x0800, CRC(6e3e9b1d) SHA1(14eb8d14ce16719a6ad7d13db01e47c8f05955f0) )
1749
1750   ROM_REGION( 0x400, REGION_PROMS, 0 )
1751   ROM_LOAD( "82s129n.u28",   0x0000, 0x0100, CRC(6db5a344) SHA1(5f1a81ac02a2a74252decd3bb95a5436cc943930) )
1752   ROM_RELOAD(               0x0100, 0x0100 )
1753   ROM_RELOAD(               0x0200, 0x0100 )
1754   ROM_RELOAD(               0x0300, 0x0100 )
1755ROM_END
1756
1757ROM_START( comg246 )   /* Cal Omega v24.6 (Hotline) */
1758   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1759   ROM_LOAD( "24.62",    0xc000, 0x1000, CRC(41f7b882) SHA1(4b532d70d5a7101952085a8fcdc0568c4266a72a) )
1760   ROM_LOAD( "24.63",    0xd000, 0x1000, CRC(226580b7) SHA1(07e6332ace45e0ced57aed6e348ab12c1f07ff34) )
1761   ROM_LOAD( "24.64",    0xe000, 0x1000, CRC(bf402e32) SHA1(436670b8f37caac14bb578a31dddbc0e2b0fd1ae) )
1762   ROM_LOAD( "24.65",    0xf000, 0x1000, CRC(4eb99af3) SHA1(1af1a27f2575290aa0dce88840cd8be516a542ff) )
1763
1764   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
1765   ROM_LOAD( "hlcg.cgo",    0x0000, 0x1000, CRC(b2871c94) SHA1(001c376479701efa4542c88f0eca9e13c694667c) )
1766
1767   ROM_REGION( 0x3000, REGION_GFX2, ROMREGION_DISPOSE )
1768   ROM_LOAD( "hlcg.cgc",    0x0000, 0x1000, CRC(6af901d9) SHA1(f9fcfcf2c92d1a3ef9a18b4e3e680c9de4829533) )
1769   ROM_LOAD( "hlcg.cgb",    0x1000, 0x1000, CRC(db2d3eb7) SHA1(45f686edf7093069b44e895547c7ec67f820447d) )
1770   ROM_LOAD( "hlcg.cga",    0x2000, 0x1000, CRC(a7e583fd) SHA1(d3b0aa9e24b6aedf24af55e5b149ab75d6f01a36) )
1771
1772   ROM_REGION( 0x400, REGION_PROMS, 0 )
1773   ROM_LOAD( "hlclr",      0x0000, 0x0100, CRC(1c994cda) SHA1(5c8698b4c5e43146106c9da8a306e3099b26ca2d) )
1774   ROM_RELOAD(            0x0100, 0x0100 )
1775   ROM_RELOAD(            0x0200, 0x0100 )
1776   ROM_RELOAD(            0x0300, 0x0100 )
1777ROM_END
1778
1779ROM_START( comg272a )   /* Cal Omega v27.2 (Keno (amusement)) */
1780   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1781   ROM_LOAD( "keno27_2.02",   0xe000, 0x0800, CRC(db3e1918) SHA1(4b8f33103f093ddbe750b536abc4545cf262d2e5) )
1782   ROM_LOAD( "keno27_2.03",   0xe800, 0x0800, CRC(c9e9cfd8) SHA1(dd0615ac579331330bda070f9ed68d7972436781) )
1783   ROM_LOAD( "keno27_2.04",   0xf000, 0x0800, CRC(d3fbab7f) SHA1(805510356bd52cf698a838daeaf16096eedcfd37) )
1784   ROM_LOAD( "keno27_2.05",   0xf800, 0x0800, CRC(22dc5b5e) SHA1(4442b7ac0516fdad8c81687fa9683eeace5b6c2d) )
1785
1786   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
1787   ROM_LOAD( "kenocg.cgo",    0x0000, 0x0800, BAD_DUMP CRC(fb721236) SHA1(33ef355913b8acb5017a24ca1c46dec1c391a528) )   // bad dump?
1788
1789   ROM_REGION( 0x1800, REGION_GFX2, ROMREGION_DISPOSE )
1790   ROM_LOAD( "kenocg.cgc",    0x0000, 0x0800, CRC(fb721236) SHA1(33ef355913b8acb5017a24ca1c46dec1c391a528) )
1791   ROM_LOAD( "kenocg.cgb",    0x0800, 0x0800, CRC(2b9205d9) SHA1(48ed4dcef38e9567246f09bd9bea5bf291e7e1b9) )
1792   ROM_LOAD( "kenocg.cga",    0x1000, 0x0800, CRC(c4491e35) SHA1(44acb8bd7af287350b99d159b6f83015fcdbd93c) )
1793
1794   ROM_REGION( 0x400, REGION_PROMS, 0 )
1795   ROM_LOAD( "pokerclr",   0x0000, 0x0100, CRC(a8191ef7) SHA1(d6f777980179ab091e2713ee815d46bf9c0ac486) )
1796   ROM_RELOAD(            0x0100, 0x0100 )
1797   ROM_RELOAD(            0x0200, 0x0100 )
1798   ROM_RELOAD(            0x0300, 0x0100 )
1799ROM_END
1800
1801ROM_START( comg272b )   /* Cal Omega v27.2 (Keno (gaming)) */
1802   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1803   ROM_LOAD( "keno_x1.02m",   0xe000, 0x0800, CRC(6dc6ec9c) SHA1(dd80d0e544ad51d1b950970e735d7ce1e05062e3) )
1804   ROM_LOAD( "keno_x1.03m",   0xe800, 0x0800, CRC(242ce2ed) SHA1(e114cec7eb7554de14561e7c0e6aed01d7e72ca6) )
1805   ROM_LOAD( "keno_x1.04m",   0xf000, 0x0800, CRC(e191b0e1) SHA1(cc476efa194c1b2cd0035e9b4725e81d3a6f381c) )
1806   ROM_LOAD( "keno_x1.05m",   0xf800, 0x0800, CRC(4152b53d) SHA1(6fe577045d03362b8b988c7a9cd0542c9a20d7a7) )
1807
1808   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
1809   ROM_LOAD( "kenocg.cgo",    0x0000, 0x0800, BAD_DUMP CRC(fb721236) SHA1(33ef355913b8acb5017a24ca1c46dec1c391a528) )   // bad dump?
1810
1811   ROM_REGION( 0x1800, REGION_GFX2, ROMREGION_DISPOSE )
1812   ROM_LOAD( "kenocg.cgc",    0x0000, 0x0800, CRC(fb721236) SHA1(33ef355913b8acb5017a24ca1c46dec1c391a528) )
1813   ROM_LOAD( "kenocg.cgb",    0x0800, 0x0800, CRC(2b9205d9) SHA1(48ed4dcef38e9567246f09bd9bea5bf291e7e1b9) )
1814   ROM_LOAD( "kenocg.cga",    0x1000, 0x0800, CRC(c4491e35) SHA1(44acb8bd7af287350b99d159b6f83015fcdbd93c) )
1815
1816   ROM_REGION( 0x400, REGION_PROMS, 0 )
1817   ROM_LOAD( "pokerclr",   0x0000, 0x0100, CRC(a8191ef7) SHA1(d6f777980179ab091e2713ee815d46bf9c0ac486) )
1818   ROM_RELOAD(            0x0100, 0x0100 )
1819   ROM_RELOAD(            0x0200, 0x0100 )
1820   ROM_RELOAD(            0x0300, 0x0100 )
1821ROM_END
1822
1823ROM_START( comg903d )   /* Cal Omega 903d (System 903 diag.PROM) */
1824   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1825   ROM_LOAD( "903diag",   0x3800, 0x0800, CRC(f8092cea) SHA1(0c864419a4e1956c030b185739eca59313f20e8a) )
1826   ROM_RELOAD(            0xf800, 0x0800 )    /* for vectors/pointers */
1827
1828   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
1829   ROM_LOAD( "testcgo",   0x0000, 0x0800, CRC(b626ad89) SHA1(551b75f4559d11a4f8f56e38982114a21c77d4e7) )
1830
1831   ROM_REGION( 0x1800, REGION_GFX2, ROMREGION_DISPOSE )
1832   ROM_FILL(            0x0000, 0x1800, 0xff )   /* removed all roms, requested by the instructions sheet */
1833
1834   ROM_REGION( 0x400, REGION_PROMS, 0 )
1835   ROM_LOAD( "testclr",   0x0000, 0x0100, CRC(a8191ef7) SHA1(d6f777980179ab091e2713ee815d46bf9c0ac486) )
1836   ROM_RELOAD(            0x0100, 0x0100 )
1837   ROM_RELOAD(            0x0200, 0x0100 )
1838   ROM_RELOAD(            0x0300, 0x0100 )
1839ROM_END
1840
1841ROM_START( comg905d )   /* Cal Omega 905d (System 905 diag.PROM) */
1842   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1843   ROM_LOAD( "905diag",   0xf000, 0x1000, CRC(6c20dbc7) SHA1(dbab0d2cf07bade2e3619bd5f29d406f3498a278) )
1844
1845   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
1846   ROM_LOAD( "testcgo",   0x0000, 0x0800, CRC(b626ad89) SHA1(551b75f4559d11a4f8f56e38982114a21c77d4e7) )
1847
1848   ROM_REGION( 0x1800, REGION_GFX2, ROMREGION_DISPOSE )
1849   ROM_FILL(            0x0000, 0x1800, 0xff )   /* removed all roms, requested by the instructions sheet */
1850
1851   ROM_REGION( 0x400, REGION_PROMS, 0 )
1852   ROM_LOAD( "testclr",   0x0000, 0x0100, CRC(a8191ef7) SHA1(d6f777980179ab091e2713ee815d46bf9c0ac486) )
1853   ROM_RELOAD(            0x0100, 0x0100 )
1854   ROM_RELOAD(            0x0200, 0x0100 )
1855   ROM_RELOAD(            0x0300, 0x0100 )
1856ROM_END
1857
1858/* Unofficial/3rd part games */
1859
1860ROM_START( elgrande )
1861   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1862   ROM_LOAD( "d1.u6",   0x2000, 0x0800, CRC(8b6b505c) SHA1(5f89bb1b50b9dfacf23c50e3016b9258b0e15084) )
1863   ROM_LOAD( "d1.u7",   0x2800, 0x0800, CRC(d803a978) SHA1(682b73c968ef57007397d3e5eb0e78a97722da5e) )
1864   ROM_LOAD( "d1.u8",   0x3000, 0x0800, CRC(291fa93b) SHA1(1d57f736b11ddc916effde78e2cd08c313a62901) )
1865   ROM_LOAD( "d1.u9",   0x3800, 0x0800, CRC(ec3309a7) SHA1(b8ab7f3f2edf2658ea633b2b557ea37517615399) )
1866   ROM_RELOAD(         0xf800, 0x0800 )    /* for vectors/pointers */
1867
1868   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
1869   ROM_LOAD( "d1.u67",   0x0000, 0x0800, CRC(a8ac979d) SHA1(f7299d3f7c4aded028a65ae4365c174f0e953824) )
1870
1871   ROM_REGION( 0x1800, REGION_GFX2, ROMREGION_DISPOSE )
1872   ROM_LOAD( "d1.u70",   0x0000, 0x0800, CRC(4f12d424) SHA1(c43f1df757ac7dd76875245e73d47451d1f7f6f2) )
1873   ROM_LOAD( "d1.u69",   0x0800, 0x0800, CRC(ed3c83b7) SHA1(93e2134de3d9f79a6cff0391c1a32fccd3840c3f) )
1874   ROM_LOAD( "d1.u68",   0x1000, 0x0800, BAD_DUMP CRC(3ab70570) SHA1(5ff84015a78d15a5207499f84ce637e49bca136f) ) /* bad bits */
1875
1876   ROM_REGION( 0x400, REGION_PROMS, 0 )
1877   ROM_LOAD( "d1.u28",      0x0000, 0x0200, CRC(a6d43709) SHA1(cbff2cb60137462dc0b7c7719a64574218d96c62) )
1878   ROM_RELOAD(            0x0200, 0x0200 )
1879ROM_END
1880
1881ROM_START( jjpoker )   /* tuni-83 */
1882   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1883   ROM_LOAD( "tuni-83.u5",    0x1800, 0x0800, CRC(46c542ee) SHA1(0b3832d8ab69427298de03d18984a220a9a35c30) )
1884   ROM_LOAD( "tuni-83.u6",    0x2000, 0x0800, CRC(e24b392a) SHA1(3b705b5cc60d2b33375f52958b72e70ce36fa216) )
1885   ROM_LOAD( "tuni-83.u7",    0x2800, 0x0800, CRC(c49e4e37) SHA1(d70321e87e6192bc65950153c13c049a52000148) )
1886   ROM_LOAD( "tuni-83.u8",    0x3000, 0x0800, CRC(7a20d8ff) SHA1(d9c08c5dd5fe8d9f67d4fe031b47c3dbfcc717c1) )
1887   ROM_LOAD( "tuni-83.u9",    0x3800, 0x0800, CRC(8cba33a6) SHA1(6998a47521f8d40425f68444bb9a45df72276c6b) )
1888   ROM_RELOAD(             0xf800, 0x0800 )    /* for vectors/pointers */
1889
1890   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
1891   ROM_LOAD( "tuni-83.u67", 0x0000, 0x0800, CRC(a8ac979d) SHA1(f7299d3f7c4aded028a65ae4365c174f0e953824) )
1892
1893   ROM_REGION( 0x1800, REGION_GFX2, ROMREGION_DISPOSE )
1894   ROM_LOAD( "tuni-83.u70", 0x0000, 0x0800, CRC(c131bf96) SHA1(3fb6717955a7312061395e5770c0f1ca9716d77c) )
1895   ROM_LOAD( "tuni-83.u69", 0x0800, 0x0800, CRC(3483b4fb) SHA1(ac04b68c5fb8f8f142582181ad13bee87636cead) )
1896   ROM_LOAD( "tuni-83.u68", 0x1000, 0x0800, CRC(e055a148) SHA1(d80e4330dce96b98df5bec731876f185476d6058) )
1897
1898   ROM_REGION( 0x400, REGION_PROMS, 0 )
1899   ROM_LOAD( "tunipoker",   0x0000, 0x0100, CRC(5101a33b) SHA1(a36bc421064d0ed96beb27b549f69adce0a553c2) )
1900   ROM_RELOAD(            0x0100, 0x0100 )
1901   ROM_RELOAD(            0x0200, 0x0100 )
1902   ROM_RELOAD(            0x0300, 0x0100 )
1903ROM_END
1904
1905ROM_START( jjpokerb )   /* pokr_j */
1906   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1907   ROM_LOAD( "pokr_j.01",    0x1800, 0x0800, CRC(d0004eda) SHA1(2fd39213e3028066fd4f9b8db206f036b566e2f7) )
1908   ROM_LOAD( "pokr_j.02",    0x2000, 0x0800, CRC(6809ccd9) SHA1(2573194a13ddf0270bccd456bda84b822036c660) )
1909   ROM_LOAD( "pokr_j.03",    0x2800, 0x0800, CRC(20c4519a) SHA1(c58662a6404060c2d1e60953a0bf69fee5657694) )
1910   ROM_LOAD( "pokr_j.04",    0x3000, 0x0800, CRC(d127fcbf) SHA1(ebf8ab47233c2cfe54cb8e36ec2ff7bf5f8631a5) )
1911   ROM_LOAD( "pokr_j.05",    0x3800, 0x0800, CRC(bb376541) SHA1(1b4f91cef36d6decd2b1da9765af4e5ec976b2fc) )
1912   ROM_RELOAD(             0xf800, 0x0800 )    /* for vectors/pointers */
1913
1914   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
1915   ROM_LOAD( "tuni-83.u67", 0x0000, 0x0800, CRC(a8ac979d) SHA1(f7299d3f7c4aded028a65ae4365c174f0e953824) )
1916
1917   ROM_REGION( 0x1800, REGION_GFX2, ROMREGION_DISPOSE )
1918   ROM_LOAD( "tuni-83.u70", 0x0000, 0x0800, CRC(c131bf96) SHA1(3fb6717955a7312061395e5770c0f1ca9716d77c) )
1919   ROM_LOAD( "tuni-83.u69", 0x0800, 0x0800, CRC(3483b4fb) SHA1(ac04b68c5fb8f8f142582181ad13bee87636cead) )
1920   ROM_LOAD( "tuni-83.u68", 0x1000, 0x0800, CRC(e055a148) SHA1(d80e4330dce96b98df5bec731876f185476d6058) )
1921
1922   ROM_REGION( 0x400, REGION_PROMS, 0 )
1923   ROM_LOAD( "tunipoker",   0x0000, 0x0100, CRC(5101a33b) SHA1(a36bc421064d0ed96beb27b549f69adce0a553c2) )
1924   ROM_RELOAD(            0x0100, 0x0100 )
1925   ROM_RELOAD(            0x0200, 0x0100 )
1926   ROM_RELOAD(            0x0300, 0x0100 )
1927ROM_END
1928
1929ROM_START( ssipkr24 )   /* pokr02_4 (gfx and prom from jjpoker) */
1930   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1931   ROM_LOAD( "pokr02_4.01",    0x1800, 0x0800, CRC(8adf1d6d) SHA1(d83677eed9426841767d947919f6da671b5fbed4) )
1932   ROM_LOAD( "pokr02_4.02",    0x2000, 0x0800, CRC(5298a01c) SHA1(a0085498699bc15cc6ada9e4e9541bd84b97eeae) )
1933   ROM_LOAD( "pokr02_4.03",    0x2800, 0x0800, CRC(30b5ead6) SHA1(7650ebb5f17eae17f3a0ddee67432a7f9dbf1c13) )
1934   ROM_LOAD( "pokr02_4.04",    0x3000, 0x0800, CRC(ade57860) SHA1(ee80e97302a4d6371fde5bacb58747075976f617) )
1935   ROM_LOAD( "pokr02_4.05",    0x3800, 0x0800, CRC(ad15250b) SHA1(d006657df1d2e01e33a3efb906e4532a2cd5b85d) )
1936   ROM_RELOAD(             0xf800, 0x0800 )    /* for vectors/pointers */
1937
1938   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
1939   ROM_LOAD( "tuni-83.u67", 0x0000, 0x0800, BAD_DUMP CRC(a8ac979d) SHA1(f7299d3f7c4aded028a65ae4365c174f0e953824) )
1940
1941   ROM_REGION( 0x1800, REGION_GFX2, ROMREGION_DISPOSE )
1942   ROM_LOAD( "tuni-83.u70", 0x0000, 0x0800, BAD_DUMP CRC(c131bf96) SHA1(3fb6717955a7312061395e5770c0f1ca9716d77c) )
1943   ROM_LOAD( "tuni-83.u69", 0x0800, 0x0800, BAD_DUMP CRC(3483b4fb) SHA1(ac04b68c5fb8f8f142582181ad13bee87636cead) )
1944   ROM_LOAD( "tuni-83.u68", 0x1000, 0x0800, BAD_DUMP CRC(e055a148) SHA1(d80e4330dce96b98df5bec731876f185476d6058) )
1945
1946   ROM_REGION( 0x400, REGION_PROMS, 0 )
1947   ROM_LOAD( "tunipoker",   0x0000, 0x0100, BAD_DUMP CRC(5101a33b) SHA1(a36bc421064d0ed96beb27b549f69adce0a553c2) )
1948   ROM_RELOAD(            0x0100, 0x0100 )
1949   ROM_RELOAD(            0x0200, 0x0100 )
1950   ROM_RELOAD(            0x0300, 0x0100 )
1951ROM_END
1952
1953ROM_START( ssipkr30 )   /* pokr03_0 (gfx and prom from jjpoker) */
1954   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1955   ROM_LOAD( "pokr03_0.01",    0x1800, 0x0800, CRC(db9581fe) SHA1(605b254e0ebb96423eb522ce75242083d70f01ca) )
1956   ROM_LOAD( "pokr03_0.02",    0x2000, 0x0800, CRC(861243ad) SHA1(290eba5c820177669e5adeac1e2f172b73789542) )
1957   ROM_LOAD( "pokr03_0.03",    0x2800, 0x0800, CRC(b5154dc0) SHA1(3b517a8d82db62be68427378fe92f0225174ba00) )
1958   ROM_LOAD( "pokr03_0.04",    0x3000, 0x0800, CRC(93bdef84) SHA1(3ea10a4d4d164f63082fbff4ae9b9fd14b5bcb27) )
1959   ROM_LOAD( "pokr03_0.05",    0x3800, 0x0800, CRC(bd2ffd49) SHA1(b60c3866b11acd5053ec6dc5c37c0e322cb29478) )
1960   ROM_RELOAD(             0xf800, 0x0800 )    /* for vectors/pointers */
1961
1962   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
1963   ROM_LOAD( "tuni-83.u67", 0x0000, 0x0800, BAD_DUMP CRC(a8ac979d) SHA1(f7299d3f7c4aded028a65ae4365c174f0e953824) )
1964
1965   ROM_REGION( 0x1800, REGION_GFX2, ROMREGION_DISPOSE )
1966   ROM_LOAD( "tuni-83.u70", 0x0000, 0x0800, BAD_DUMP CRC(c131bf96) SHA1(3fb6717955a7312061395e5770c0f1ca9716d77c) )
1967   ROM_LOAD( "tuni-83.u69", 0x0800, 0x0800, BAD_DUMP CRC(3483b4fb) SHA1(ac04b68c5fb8f8f142582181ad13bee87636cead) )
1968   ROM_LOAD( "tuni-83.u68", 0x1000, 0x0800, BAD_DUMP CRC(e055a148) SHA1(d80e4330dce96b98df5bec731876f185476d6058) )
1969
1970   ROM_REGION( 0x400, REGION_PROMS, 0 )
1971   ROM_LOAD( "tunipoker",   0x0000, 0x0100, BAD_DUMP CRC(5101a33b) SHA1(a36bc421064d0ed96beb27b549f69adce0a553c2) )
1972   ROM_RELOAD(            0x0100, 0x0100 )
1973   ROM_RELOAD(            0x0200, 0x0100 )
1974   ROM_RELOAD(            0x0300, 0x0100 )
1975ROM_END
1976
1977ROM_START( ssipkr40 )   /* (gfx and prom from jjpoker) */
1978   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1979   ROM_LOAD( "40-1.903",    0x1800, 0x0800, CRC(461eb68c) SHA1(54781670930c723c993ca9ad80e06e38ddd2f035) )
1980   ROM_LOAD( "40-2.903",    0x2000, 0x0800, CRC(099094a9) SHA1(c5a6ccb5ec0bebc79ef0b9c98595ef87c65ce361) )
1981   ROM_LOAD( "40-3.903",    0x2800, 0x0800, CRC(1c923554) SHA1(d0050a8833f9a1a5fa0598b06a7bb265f0e814e4) )
1982   ROM_LOAD( "40-4.903",    0x3000, 0x0800, CRC(552bf73d) SHA1(bf9197aab029c8dfaac88abcbda57547845323da) )
1983   ROM_LOAD( "40-5.903",    0x3800, 0x0800, CRC(4d388d13) SHA1(8d46d6c227fe22f0433f02909b172f60cada1dd4) )
1984   ROM_RELOAD(             0xf800, 0x0800 )    /* for vectors/pointers */
1985
1986   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
1987   ROM_LOAD( "tuni-83.u67", 0x0000, 0x0800, BAD_DUMP CRC(a8ac979d) SHA1(f7299d3f7c4aded028a65ae4365c174f0e953824) )
1988
1989   ROM_REGION( 0x1800, REGION_GFX2, ROMREGION_DISPOSE )
1990   ROM_LOAD( "tuni-83.u70", 0x0000, 0x0800, BAD_DUMP CRC(c131bf96) SHA1(3fb6717955a7312061395e5770c0f1ca9716d77c) )
1991   ROM_LOAD( "tuni-83.u69", 0x0800, 0x0800, BAD_DUMP CRC(3483b4fb) SHA1(ac04b68c5fb8f8f142582181ad13bee87636cead) )
1992   ROM_LOAD( "tuni-83.u68", 0x1000, 0x0800, BAD_DUMP CRC(e055a148) SHA1(d80e4330dce96b98df5bec731876f185476d6058) )
1993
1994   ROM_REGION( 0x400, REGION_PROMS, 0 )
1995   ROM_LOAD( "tunipoker",   0x0000, 0x0100, BAD_DUMP CRC(5101a33b) SHA1(a36bc421064d0ed96beb27b549f69adce0a553c2) )
1996   ROM_RELOAD(            0x0100, 0x0100 )
1997   ROM_RELOAD(            0x0200, 0x0100 )
1998   ROM_RELOAD(            0x0300, 0x0100 )
1999ROM_END
2000
2001
2002/*************************
2003*      Driver Init       *
2004*************************/
2005
2006static DRIVER_INIT( calomega )
2007{
2008   /* Palette transformed by PLDs? */
2009   int x;
2010   UINT8 *BPR = memory_region( REGION_PROMS );
2011
2012   for (x=0x0000;x<0x0400;x++)
2013   {
2014      if (BPR[x] == 0x07)
2015         BPR[x] = 0x04;   /* blue background */
2016   }
2017
2018   /* Initializing PIAs... */
2019   pia_config(0, &pia0_intf);
2020   pia_config(1, &pia1_intf);
2021}
2022
2023static DRIVER_INIT( elgrande )
2024{
2025   int x;
2026   UINT8 *BPR = memory_region( REGION_PROMS );
2027   UINT8 *ROM = memory_region( REGION_GFX2 );
2028
2029   /* Palette transformed by PLDs? */
2030   for (x=0x0000;x<0x0400;x++)
2031   {
2032      if (BPR[x] == 0x07)
2033         BPR[x] = 0x00; /* black background */
2034   }
2035
2036   /* Temporary patch to fix some bad bits in ROM d1.u68 till a correct dump appear */
2037   ROM[0x171c] = 0xff;
2038   ROM[0x171d] = 0xff;
2039   ROM[0x171e] = 0xff;
2040   ROM[0x1737] = 0xff;
2041   ROM[0x173d] = 0xff;
2042
2043   /* Initializing PIAs... */
2044   pia_config(0, &pia0_intf);
2045   pia_config(1, &pia1_intf);
2046}
2047
2048static DRIVER_INIT( jjpoker )
2049{
2050   /* Palette transformed by PLDs? */
2051   int x;
2052   UINT8 *BPR = memory_region( REGION_PROMS );
2053
2054   for (x=0x0000;x<0x0400;x++)
2055   {
2056      if (BPR[x] == 0x02)
2057         BPR[x] = 0x00;   /* blue background */
2058   }
2059
2060   /* Initializing PIAs... */
2061   pia_config(0, &pia0_intf);
2062   pia_config(1, &pia1_intf);
2063}
2064
2065static DRIVER_INIT( standard )
2066{
2067   /* Palette transformed by PLDs? */
2068   int x;
2069   UINT8 *BPR = memory_region( REGION_PROMS );
2070
2071   for (x=0x0000;x<0x0400;x++)
2072   {
2073      if (BPR[x] == 0x07)
2074         BPR[x] = 0x04;   /* blue background */
2075   }
2076
2077   /* Initializing PIAs... */
2078   pia_config(0, &pia0_intf);
2079   pia_config(1, &pia1_intf);
2080}
2081
2082
2083/*************************
2084*      Game Drivers      *
2085*************************/
2086
2087/*    YEAR  NAME      PARENT    MACHINE   INPUT     INIT      ROT    COMPANY                                 FULLNAME                                     FLAGS   */
2088GAME( 1981, comg076,  0,        sys903,   comg076,  calomega, ROT0, "Cal Omega Inc.",                        "Cal Omega - Game 7.6 (Arcade Poker)",           0 )
2089GAME( 1981, comg079,  0,        sys903,   comg076,  calomega, ROT0, "Cal Omega Inc.",                        "Cal Omega - Game 7.9 (Arcade Poker)",           0 )
2090GAME( 1981, comg094,  0,        sys903,   standard, calomega, ROT0, "Cal Omega Inc.",                        "Cal Omega - Game 9.4 (Keno)",                   GAME_NOT_WORKING )
2091GAME( 1982, comg107,  0,        sys903,   standard, calomega, ROT0, "Cal Omega Inc.",                        "Cal Omega - Game 10.7 (Big Game)",              GAME_NOT_WORKING )
2092GAME( 1982, comg125,  0,        sys903,   standard, calomega, ROT0, "Cal Omega Inc.",                        "Cal Omega - Game 12.5 (Bingo)",                 GAME_NOT_WORKING )
2093GAME( 1982, comg127,  0,        sys903,   standard, standard, ROT0, "Cal Omega Inc.",                        "Cal Omega - Game 12.7 (Keno)",                  GAME_NOT_WORKING )
2094GAME( 1982, comg128,  0,        sys903,   comg128,  standard, ROT0, "Cal Omega Inc.",                        "Cal Omega - Game 12.8 (Arcade Game)",           0 )
2095GAME( 1982, comg134,  0,        sys903,   standard, standard, ROT0, "Cal Omega Inc.",                        "Cal Omega - Game 13.4 (Nudge Bingo)",           GAME_NOT_WORKING )
2096GAME( 1982, comg145,  0,        sys903,   standard, calomega, ROT0, "Cal Omega Inc.",                        "Cal Omega - Game 14.5 (Pixels)",                GAME_NOT_WORKING )
2097GAME( 1983, comg157,  0,        sys903,   standard, calomega, ROT0, "Cal Omega Inc.",                        "Cal Omega - Game 15.7 (Double-Draw Poker)",     GAME_NOT_WORKING )
2098GAME( 1983, comg159,  0,        sys905,   standard, calomega, ROT0, "Cal Omega Inc.",                        "Cal Omega - Game 15.9 (Wild Double-Up)",        GAME_NOT_WORKING )
2099GAME( 1983, comg164,  0,        sys903,   standard, calomega, ROT0, "Cal Omega Inc.",                        "Cal Omega - Game 16.4 (Keno)",                  GAME_NOT_WORKING )
2100GAME( 1983, comg168,  0,        sys903,   standard, calomega, ROT0, "Cal Omega Inc.",                        "Cal Omega - Game 16.8 (Keno)",                  GAME_NOT_WORKING )
2101GAME( 1983, comg172,  0,        sys905,   standard, calomega, ROT0, "Cal Omega Inc.",                        "Cal Omega - Game 17.2 (Double Double Poker)",   GAME_NOT_WORKING )
2102GAME( 1984, comg175,  0,        sys903,   gdrawpkr, calomega, ROT0, "Cal Omega / Casino Electronics Inc.",   "Cal Omega - Game 17.51 (Gaming Draw Poker)",    0 )
2103GAME( 1982, comg176,  0,        sys903,   standard, standard, ROT0, "Cal Omega Inc.",                        "Cal Omega - Game 17.6 (Nudge Bingo)",           GAME_NOT_WORKING )
2104GAME( 1982, comg181,  0,        sys903,   standard, standard, ROT0, "Cal Omega Inc.",                        "Cal Omega - Game 18.1 (Nudge Bingo)",           GAME_NOT_WORKING )
2105GAME( 1983, comg183,  0,        sys905,   standard, calomega, ROT0, "Cal Omega Inc.",                        "Cal Omega - Game 18.3 (Pixels)",                GAME_NOT_WORKING )
2106GAME( 1983, comg185,  0,        sys905,   standard, calomega, ROT0, "Cal Omega Inc.",                        "Cal Omega - Game 18.5 (Pixels)",                GAME_NOT_WORKING )
2107GAME( 1983, comg186,  0,        sys905,   standard, calomega, ROT0, "Cal Omega Inc.",                        "Cal Omega - Game 18.6 (Pixels)",                GAME_NOT_WORKING )
2108GAME( 1984, comg204,  0,        sys905,   standard, calomega, ROT0, "Cal Omega Inc.",                        "Cal Omega - Game 20.4 (Super Blackjack)",       GAME_NOT_WORKING )
2109GAME( 1984, comg208,  0,        sys905,   standard, calomega, ROT0, "Cal Omega Inc.",                        "Cal Omega - Game 20.8 (Winner's Choice)",       GAME_NOT_WORKING )
2110GAME( 1984, comg227,  0,        sys905,   standard, calomega, ROT0, "Cal Omega Inc.",                        "Cal Omega - Game 22.7 (Amusement Poker, d/d)",  GAME_NOT_WORKING )
2111GAME( 1984, comg236,  0,        sys905,   standard, calomega, ROT0, "Cal Omega Inc.",                        "Cal Omega - Game 23.6 (Hotline)",               GAME_NOT_WORKING )
2112GAME( 1985, comg239,  0,        sys903,   gdrawpkr, calomega, ROT0, "Cal Omega / Casino Electronics Inc.",   "Cal Omega - Game 23.9 (Gaming Draw Poker)",     0 )
2113GAME( 1985, comg246,  0,        sys905,   standard, calomega, ROT0, "Cal Omega Inc.",                        "Cal Omega - Game 24.6 (Hotline)",               GAME_NOT_WORKING )
2114GAME( 1985, comg272a, 0,        sys903,   standard, calomega, ROT0, "Cal Omega Inc.",                        "Cal Omega - Game 27.2 (Keno, amusement)",       GAME_NOT_WORKING )
2115GAME( 1985, comg272b, 0,        sys903,   standard, calomega, ROT0, "Cal Omega Inc.",                        "Cal Omega - Game 27.2 (Keno, gaming)",          GAME_NOT_WORKING )
2116GAME( 198?, comg903d, 0,        sys903,   gdrawpkr, calomega, ROT0, "Cal Omega Inc.",                        "Cal Omega - System 903 Diag.PROM",              GAME_NOT_WORKING )
2117GAME( 198?, comg905d, 0,        sys905,   gdrawpkr, calomega, ROT0, "Cal Omega Inc.",                        "Cal Omega - System 905 Diag.PROM",              GAME_NOT_WORKING )
2118GAME( 1982, elgrande, 0,        sys903,   elgrande, elgrande, ROT0, "Tuni Electro Service / E.T. Marketing", "El Grande - 5 Card Draw (New)",                 0 )
2119GAME( 1983, jjpoker,  0,        sys903,   jjpoker,  jjpoker,  ROT0, "Enter-Tech (ETL)",                      "Jackpot Joker Poker (set 1)",                   0 )
2120GAME( 1983, jjpokerb, jjpoker,  sys903,   jjpoker,  jjpoker,  ROT0, "Enter-Tech (ETL)",                      "Jackpot Joker Poker (set 2)",                   0 )
2121GAME( 1988, ssipkr24, jjpoker,  sys903,   ssipkr,   jjpoker,  ROT0, "SSI",                                   "SSI Poker (v2.4)",                              0 )
2122GAME( 1988, ssipkr30, jjpoker,  sys903,   ssipkr,   jjpoker,  ROT0, "SSI",                                   "SSI Poker (v3.0)",                              0 )
2123GAME( 1990, ssipkr40, jjpoker,  sys903,   ssipkr,   jjpoker,  ROT0, "SSI",                                   "SSI Poker (v4.0)",                              0 )
src/mame/drivers/4enraya.c
r1771r1772
7777   last=data;
7878}
7979
80static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
81   AM_RANGE(0x0000, 0xbfff) AM_READ(MRA8_ROM)
82   AM_RANGE(0xc000, 0xcfff) AM_READ(MRA8_RAM)
83   AM_RANGE(0xd000, 0xffff) AM_READ(MRA8_NOP)
84ADDRESS_MAP_END
85
86static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
87   AM_RANGE(0x0000, 0xbfff) AM_WRITE(MWA8_ROM)
88   AM_RANGE(0xc000, 0xcfff) AM_WRITE(MWA8_RAM)
80static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
81   AM_RANGE(0x0000, 0xbfff) AM_ROM
82   AM_RANGE(0xc000, 0xcfff) AM_RAM
8983   AM_RANGE(0xd000, 0xdfff) AM_WRITE(fenraya_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
9084ADDRESS_MAP_END
9185
92static ADDRESS_MAP_START( readport, ADDRESS_SPACE_IO, 8 )
86static ADDRESS_MAP_START( main_portmap, ADDRESS_SPACE_IO, 8 )
9387   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
9488   AM_RANGE(0x00, 0x00) AM_READ(input_port_0_r)
9589   AM_RANGE(0x01, 0x01) AM_READ(input_port_1_r)
9690   AM_RANGE(0x02, 0x02) AM_READ(input_port_2_r)
97ADDRESS_MAP_END
98
99static ADDRESS_MAP_START( writeport, ADDRESS_SPACE_IO, 8 )
100   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
10191   AM_RANGE(0x23, 0x23) AM_WRITE(sound_data_w)
10292   AM_RANGE(0x33, 0x33) AM_WRITE(sound_control_w)
10393ADDRESS_MAP_END
r1771r1772
169159
170160   /* basic machine hardware */
171161   MDRV_CPU_ADD(Z80,8000000/2)
172   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
173   MDRV_CPU_IO_MAP(readport,writeport)
162   MDRV_CPU_PROGRAM_MAP(main_map,0)
163   MDRV_CPU_IO_MAP(main_portmap,0)
174164   MDRV_CPU_VBLANK_INT(irq0_line_hold,4)
175165
176166   /* video hardware */
src/mame/drivers/cps2.c
r1771r1772
22142214
22152215ROM_START( ddtodj )
22162216   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
2217   ROM_LOAD16_WORD_SWAP( "dadj.03c", 0x000000, 0x80000, CRC(0b1b5798) SHA1(ce2749164a6cf4c99db4bfa7e515a9022006cf92) )
2218   ROM_LOAD16_WORD_SWAP( "dadj.04c", 0x080000, 0x80000, CRC(c6a2fbc8) SHA1(cb7105e9d35c9e64f5535eb5f491e3f2cf6de64e) )
2219   ROM_LOAD16_WORD_SWAP( "dadj.05c", 0x100000, 0x80000, CRC(189b15fe) SHA1(91baef189549a25122fd5ab238a849bad2766862) )
2220   ROM_LOAD16_WORD_SWAP( "dad.06a",  0x180000, 0x80000, CRC(6225495a) SHA1(a9a02abb072e3482ac92d7aed8ce9a5bcf636bc0) )
2221   ROM_LOAD16_WORD_SWAP( "dad.07a",  0x200000, 0x80000, CRC(b3480ec3) SHA1(a66f8dba67101fd71c2af4f3c3d71e55778a9f2c) )
2222
2223   ROM_REGION( 0xc00000, REGION_GFX1, 0 )
2224   ROMX_LOAD( "dad.13m",   0x000000, 0x200000, CRC(da3cb7d6) SHA1(d59bb53d5f32889eb6eb7f8b1c8781948c97283d) , ROM_GROUPWORD | ROM_SKIP(6) )
2225   ROMX_LOAD( "dad.15m",   0x000002, 0x200000, CRC(92b63172) SHA1(9bed7dbbb17729f2ad3d318396f5335c0bd39937) , ROM_GROUPWORD | ROM_SKIP(6) )
2226   ROMX_LOAD( "dad.17m",   0x000004, 0x200000, CRC(b98757f5) SHA1(3eead22e097906bf0e1e151cd0a9c75abc5a32d4) , ROM_GROUPWORD | ROM_SKIP(6) )
2227   ROMX_LOAD( "dad.19m",   0x000006, 0x200000, CRC(8121ce46) SHA1(40c4dc969318d38f0c6d5401c9c64371f51aa12c) , ROM_GROUPWORD | ROM_SKIP(6) )
2228   ROMX_LOAD( "dad.14m",   0x800000, 0x100000, CRC(837e6f3f) SHA1(c060183474fba0e82d765b9f282b84838550dff6) , ROM_GROUPWORD | ROM_SKIP(6) )
2229   ROMX_LOAD( "dad.16m",   0x800002, 0x100000, CRC(f0916bdb) SHA1(9354d258dd26cbbf12c78ecfc277c357cbdb360e) , ROM_GROUPWORD | ROM_SKIP(6) )
2230   ROMX_LOAD( "dad.18m",   0x800004, 0x100000, CRC(cef393ef) SHA1(830b33c86cc24776d17ad65fa89a3b16c40446a1) , ROM_GROUPWORD | ROM_SKIP(6) )
2231   ROMX_LOAD( "dad.20m",   0x800006, 0x100000, CRC(8953fe9e) SHA1(f4795beb006335d13e3934aa9760e775eb0bb950) , ROM_GROUPWORD | ROM_SKIP(6) )
2232
2233   ROM_REGION( QSOUND_SIZE, REGION_CPU2, 0 ) /* 64k for the audio CPU (+banks) */
2234   ROM_LOAD( "dad.01",   0x00000, 0x08000, CRC(3f5e2424) SHA1(4aa744576bc6752c43a90a27a816ebd90076b248) )
2235   ROM_CONTINUE(         0x10000, 0x18000 )
2236
2237   ROM_REGION( 0x400000, REGION_SOUND1, 0 ) /* QSound samples */
2238   ROM_LOAD16_WORD_SWAP( "dad.11m",   0x000000, 0x200000, CRC(0c499b67) SHA1(a8ebd8a1cd6dece8344b7cb0439d85843fb97616) )
2239   ROM_LOAD16_WORD_SWAP( "dad.12m",   0x200000, 0x200000, CRC(2f0b5a4e) SHA1(8d1ebbb811aa469b0f0d29d719d2b9af28fb63a2) )
2240ROM_END
2241
2242ROM_START( ddtodjr2 )
2243   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
22172244   ROM_LOAD16_WORD_SWAP( "dadj.03b", 0x000000, 0x80000, CRC(87606b85) SHA1(1311c9ae321207db4632572f6c838b732974b087) )
22182245   ROM_LOAD16_WORD_SWAP( "dadj.04b", 0x080000, 0x80000, CRC(24d49575) SHA1(419d7d2f970c23c39334a7f2e8c5caa237769c5d) )
22192246   ROM_LOAD16_WORD_SWAP( "dadj.05b", 0x100000, 0x80000, CRC(56ce51f7) SHA1(3a15537c479e3798ec30d5e313a727d7f91955c0) )
r1771r1772
71507177GAME( 1993, ddtodr1,  ddtod,    cps2, cps2_4p4b, cps2,     ROT0,   "Capcom", "Dungeons & Dragons: Tower of Doom (Euro 940113)", 0 )
71517178GAME( 1993, ddtodu,   ddtod,    cps2, cps2_4p4b, cps2,     ROT0,   "Capcom", "Dungeons & Dragons: Tower of Doom (USA 940125)", 0 )
71527179GAME( 1993, ddtodur1, ddtod,    cps2, cps2_4p4b, cps2,     ROT0,   "Capcom", "Dungeons & Dragons: Tower of Doom (USA 940113)", 0 )
7153GAME( 1993, ddtodj,   ddtod,    cps2, cps2_4p4b, cps2,     ROT0,   "Capcom", "Dungeons & Dragons: Tower of Doom (Japan 940125)", 0 )
7154GAME( 1993, ddtodjr1, ddtod,    cps2, cps2_4p4b, cps2,     ROT0,   "Capcom", "Dungeons & Dragons: Tower of Doom (Japan 940113)", 0 )
7180GAME( 1993, ddtodj,   ddtod,    cps2, cps2_4p4b, cps2,     ROT0,   "Capcom", "Dungeons & Dragons: Tower of Doom (Japan 940412)", 0 )
7181GAME( 1993, ddtodjr1, ddtod,    cps2, cps2_4p4b, cps2,     ROT0,   "Capcom", "Dungeons & Dragons: Tower of Doom (Japan 940125)", 0 )
7182GAME( 1993, ddtodjr2, ddtod,    cps2, cps2_4p4b, cps2,     ROT0,   "Capcom", "Dungeons & Dragons: Tower of Doom (Japan 940113)", 0 )
71557183GAME( 1993, ddtoda,   ddtod,    cps2, cps2_4p4b, cps2,     ROT0,   "Capcom", "Dungeons & Dragons: Tower of Doom (Asia 940113)", 0 )
71567184GAME( 1993, ddtodh,   ddtod,    cps2, cps2_4p4b, cps2,     ROT0,   "Capcom", "Dungeons & Dragons: Tower of Doom (Hispanic 940125)", 0 )
71577185GAME( 1993, ecofghtr, 0,        cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Eco Fighters (World 931203)", 0 )
src/mame/drivers/hyperspt.c
r1771r1772
460460static MACHINE_DRIVER_START( hyperspt )
461461
462462   /* basic machine hardware */
463   MDRV_CPU_ADD(M6809, XTAL_18_432MHz/12)   /* verified on pcb */
463   MDRV_CPU_ADD_TAG("main", M6809, XTAL_18_432MHz/12)   /* verified on pcb */
464464   MDRV_CPU_PROGRAM_MAP(hyperspt_readmem,writemem)
465465   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
466466
r1771r1772
502502
503503static MACHINE_DRIVER_START( roadf )
504504   MDRV_IMPORT_FROM(hyperspt)
505   MDRV_CPU_MODIFY("main")
505506   MDRV_CPU_PROGRAM_MAP(roadf_readmem, writemem)
506507   MDRV_GFXDECODE(roadf)
507508   MDRV_VIDEO_START(roadf)
src/mame/drivers/tmnt.c
r1771r1772
24132413   MDRV_CPU_ADD(Z80, XTAL_3_579545MHz)
24142414   MDRV_CPU_PROGRAM_MAP(tmnt_audio_map,0)
24152415
2416   MDRV_MACHINE_RESET(tmnt);
2416   MDRV_MACHINE_RESET(tmnt)
24172417
24182418   /* video hardware */
24192419   MDRV_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS | VIDEO_HAS_HIGHLIGHTS)
src/mame/drivers/missb2.c
r1771r1772
107107            x = sx + xc * 8;
108108            y = (sy + yc * 8) & 0xff;
109109
110            if (flip_screen)
110            if (flip_screen_get())
111111            {
112112               x = 248 - x;
113113               y = 248 - y;
src/mame/drivers/bionicc.c
r1771r1772
5757#include "deprecat.h"
5858#include "sound/2151intf.h"
5959
60#define MASTER_CLOCK      XTAL_24MHz
61#define EXO3_F0_CLK         XTAL_14_31818MHz
6062
6163WRITE16_HANDLER( bionicc_fgvideoram_w );
6264WRITE16_HANDLER( bionicc_bgvideoram_w );
r1771r1772
343345static MACHINE_DRIVER_START( bionicc )
344346
345347   /* basic machine hardware */
346   MDRV_CPU_ADD(M68000, 10000000) /* ?? MHz ? */
348   MDRV_CPU_ADD(M68000, MASTER_CLOCK / 2) /* 12 MHz - verified in schematics */
347349   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
348350   MDRV_CPU_VBLANK_INT(bionicc_interrupt,8)
349351
350   MDRV_CPU_ADD(Z80, 4000000)
351   /* audio CPU */  /* 4 MHz ??? TODO: find real FRQ */
352   /* audio CPU */
353   MDRV_CPU_ADD(Z80, EXO3_F0_CLK / 4)   /* EXO3 C,B=GND, A=5V ==> Divisor 2^2 */
352354   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
353   MDRV_CPU_VBLANK_INT(nmi_line_pulse,4)   /* ??? */
355   /* FIXME: interrupt timing
356     * schematics indicate that nmi_line is set on  M680000 access with AB1=1
357     * and IOCS=0 (active low), see pages A-1/10, A-4/10 in schematics
358     */
359   MDRV_CPU_VBLANK_INT(nmi_line_pulse,4)
354360
355361   /* video hardware */
356362   MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM)
src/mame/drivers/citycon.c
r1771r1772
2121
2222static READ8_HANDLER( citycon_in_r )
2323{
24   return readinputport(flip_screen ? 1 : 0);
24   return readinputport(flip_screen_get() ? 1 : 0);
2525}
2626
2727
src/mame/drivers/ampoker2.c
r1771r1772
860860   MDRV_CPU_PROGRAM_MAP(ampoker2_map, 0)
861861   MDRV_CPU_IO_MAP(ampoker2_io_map, 0)
862862   MDRV_CPU_PERIODIC_INT(nmi_line_pulse, 1536)
863   MDRV_WATCHDOG_TIME_INIT(ATTOTIME_IN_HZ( 5 ))   /* 200 ms, measured */
863   MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_HZ( 5 ))   /* 200 ms, measured */
864864   //MDRV_WATCHDOG_VBLANK_INIT(8)
865865
866866   MDRV_NVRAM_HANDLER(generic_0fill)
src/mame/drivers/dacholer.c
r1771r1772
276276      sx = (spriteram[offs+3] - 128) + 256 * (attr & 0x01);
277277      sy = 248 - spriteram[offs];
278278
279      if (flip_screen)
279      if (flip_screen_get())
280280      {
281281         sx = 240 - sx;
282282         sy = 240 - sy;
src/mame/drivers/namcos21.c
r1771r1772
15451545
15461546   MDRV_INTERLEAVE(200)
15471547
1548   MDRV_MACHINE_START(namcos2)
15481549   MDRV_MACHINE_RESET(namcos2)
15491550   MDRV_NVRAM_HANDLER(namcos2)
15501551
r1771r1772
16181619
16191620   MDRV_INTERLEAVE(100) /* 100 CPU slices per frame */
16201621
1622   MDRV_MACHINE_START(namcos2)
16211623   MDRV_MACHINE_RESET(namcos2)
16221624   MDRV_NVRAM_HANDLER(namcos2)
16231625
r1771r1772
16761678
16771679   MDRV_INTERLEAVE(100) /* 100 CPU slices per frame */
16781680
1681   MDRV_MACHINE_START(namcos2)
16791682   MDRV_MACHINE_RESET(namcos2)
16801683   MDRV_NVRAM_HANDLER(namcos2)
16811684
src/mame/drivers/pgm.c
r1771r1772
546546   }
547547}
548548
549static NVRAM_HANDLER( pgm )
550{
551   if (read_or_write)
552      /* save the SRAM settings */
553      mame_fwrite(file, pgm_mainram, 0x20000);
554   else
555   {
556      /* load the SRAM settings */
557      if (file)
558         mame_fread(file, pgm_mainram, 0x20000);
559      else
560         memset(pgm_mainram, 0, 0x20000);
561   }
562}
563
549564/*** Memory Maps *************************************************************/
550565
551566static ADDRESS_MAP_START( pgm_mem, ADDRESS_SPACE_PROGRAM, 16)
r1771r1772
15671582   MDRV_GFXDECODE(pgm)
15681583   MDRV_PALETTE_LENGTH(0x1200/2)
15691584   MDRV_MACHINE_RESET ( pgm )
1585   MDRV_NVRAM_HANDLER ( pgm )
15701586
15711587   MDRV_VIDEO_START(pgm)
15721588   MDRV_VIDEO_EOF(pgm)
src/mame/drivers/gameplan.c
r1771r1772
11801180   MDRV_MACHINE_RESET(gameplan)
11811181
11821182   /* video hardware */
1183   MDRV_IMPORT_FROM(gameplan_video);
1183   MDRV_IMPORT_FROM(gameplan_video)
11841184
11851185   /* audio hardware */
11861186   MDRV_SPEAKER_STANDARD_MONO("mono")
r1771r1772
12001200   MDRV_CPU_PROGRAM_MAP(leprechn_audio_map,0)
12011201
12021202   /* video hardware */
1203   MDRV_IMPORT_FROM(leprechn_video);
1203   MDRV_IMPORT_FROM(leprechn_video)
12041204MACHINE_DRIVER_END
12051205
12061206
src/mame/drivers/ssingles.c
r1771r1772
4848};
4949
5050static void update_row(running_machine *machine, mc6845_t *mc6845, mame_bitmap *bitmap, const rectangle *cliprect,
51      UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, void *param)
51      UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param)
5252{
5353   int cx,x;
5454   UINT32 tile_address;
src/mame/drivers/cchasm.c
r1771r1772
167167   MDRV_SCREEN_SIZE(400, 300)
168168   MDRV_SCREEN_VISIBLE_AREA(0, 1024-1, 0, 768-1)
169169
170   MDRV_PALETTE_LENGTH(32768)
171
172170   MDRV_VIDEO_START(cchasm)
173171   MDRV_VIDEO_UPDATE(vector)
174172
src/mame/drivers/spiders.c
r1771r1772
450450
451451
452452static void update_row(running_machine *machine, mc6845_t *mc6845, mame_bitmap *bitmap, const rectangle *cliprect,
453                  UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, void *param)
453                  UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param)
454454{
455455   UINT8 cx;
456456
src/mame/drivers/mcatadv.c
r1771r1772
512512   MDRV_GFXDECODE(mcatadv)
513513   MDRV_PALETTE_LENGTH(0x2000/2)
514514
515   MDRV_WATCHDOG_TIME_INIT(ATTOTIME_IN_SEC(3))   /* a guess, and certainly wrong */
515   MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_SEC(3))   /* a guess, and certainly wrong */
516516
517517   MDRV_VIDEO_START(mcatadv)
518518   MDRV_VIDEO_EOF(mcatadv) // Buffer Spriteram
src/mame/drivers/cinemat.c
r1771r1772
999999   MDRV_SCREEN_SIZE(400, 300)
10001000   MDRV_SCREEN_VISIBLE_AREA(0, 1023, 0, 767)
10011001
1002   MDRV_PALETTE_LENGTH(32768)
1003
10041002   MDRV_VIDEO_START(cinemat_bilevel)
10051003   MDRV_VIDEO_EOF(cinemat)
10061004   MDRV_VIDEO_UPDATE(vector)
src/mame/drivers/alpha68k.c
r1771r1772
686686
687687/******************************************************************************/
688688
689static ADDRESS_MAP_START( kyros_readmem, ADDRESS_SPACE_PROGRAM, 16 )
690   AM_RANGE(0x000000, 0x01ffff) AM_READ(MRA16_ROM) // main program
691   AM_RANGE(0x020000, 0x020fff) AM_READ(MRA16_RAM) // work RAM
692   AM_RANGE(0x040000, 0x041fff) AM_READ(MRA16_RAM) // sprite RAM
693   AM_RANGE(0x060000, 0x060001) AM_READ(MRA16_RAM) // MSB: watchdog
694   AM_RANGE(0x080000, 0x0801ff) AM_READ(kyros_alpha_trigger_r)
689static ADDRESS_MAP_START( kyros_map, ADDRESS_SPACE_PROGRAM, 16 )
690   AM_RANGE(0x000000, 0x01ffff) AM_ROM                    // main program
691   AM_RANGE(0x020000, 0x020fff) AM_RAM AM_BASE(&shared_ram)  // work RAM
692   AM_RANGE(0x040000, 0x041fff) AM_RAM AM_BASE(&spriteram16) // sprite RAM
693   AM_RANGE(0x060000, 0x060001) AM_RAM AM_BASE(&videoram16)  // MSB: watchdog, LSB: BGC
694   AM_RANGE(0x080000, 0x0801ff) AM_READWRITE(kyros_alpha_trigger_r, alpha_microcontroller_w)
695695   AM_RANGE(0x0c0000, 0x0c0001) AM_READ(input_port_0_word_r)
696   AM_RANGE(0x0e0000, 0x0e0001) AM_READ(kyros_dip_r)
696   AM_RANGE(0x0e0000, 0x0e0001) AM_READWRITE(kyros_dip_r, kyros_sound_w)
697697ADDRESS_MAP_END
698698
699static ADDRESS_MAP_START( kyros_writemem, ADDRESS_SPACE_PROGRAM, 16 )
700   AM_RANGE(0x000000, 0x01ffff) AM_WRITE(MWA16_ROM)
701   AM_RANGE(0x020000, 0x020fff) AM_WRITE(MWA16_RAM) AM_BASE(&shared_ram)
702   AM_RANGE(0x040000, 0x041fff) AM_WRITE(MWA16_RAM) AM_BASE(&spriteram16)
703   AM_RANGE(0x060000, 0x060001) AM_WRITE(MWA16_RAM) AM_BASE(&videoram16) // LSB: BGC
704   AM_RANGE(0x080000, 0x0801ff) AM_WRITE(alpha_microcontroller_w)
705   AM_RANGE(0x0e0000, 0x0e0001) AM_WRITE(kyros_sound_w)
706ADDRESS_MAP_END
707
708static ADDRESS_MAP_START( alpha68k_I_readmem, ADDRESS_SPACE_PROGRAM, 16 )
709   AM_RANGE(0x000000, 0x03ffff) AM_READ(MRA16_ROM) // main program
710   AM_RANGE(0x080000, 0x083fff) AM_READ(MRA16_RAM) // work RAM
711   AM_RANGE(0x100000, 0x103fff) AM_READ(MRA16_RAM) // video RAM
712   AM_RANGE(0x180000, 0x180001) AM_READ(input_port_3_word_r) // LSB: DSW0
699static ADDRESS_MAP_START( alpha68k_I_map, ADDRESS_SPACE_PROGRAM, 16 )
700   AM_RANGE(0x000000, 0x03ffff) AM_ROM                    // main program
701   AM_RANGE(0x080000, 0x083fff) AM_RAM                    // work RAM
702   AM_RANGE(0x100000, 0x103fff) AM_RAM AM_BASE(&spriteram16) // video RAM
703   AM_RANGE(0x180000, 0x180001) AM_READWRITE(input_port_3_word_r, MWA16_NOP) // LSB: DSW0, MSB: watchdog(?)
713704   AM_RANGE(0x180008, 0x180009) AM_READ(input_port_4_word_r) // LSB: DSW1
714705   AM_RANGE(0x300000, 0x300001) AM_READ(input_port_0_word_r) // joy1, joy2
715706   AM_RANGE(0x340000, 0x340001) AM_READ(input_port_1_word_r) // coin, start, service
716   AM_RANGE(0x380000, 0x380001) AM_READ(input_port_2_word_r) // joy3, joy4
707   AM_RANGE(0x380000, 0x380001) AM_READWRITE(input_port_2_word_r, paddlema_soundlatch_w) // LSB: sound latch write and RST38 trigger, joy3, joy4
717708ADDRESS_MAP_END
718709
719static ADDRESS_MAP_START( alpha68k_I_writemem, ADDRESS_SPACE_PROGRAM, 16 )
720   AM_RANGE(0x000000, 0x03ffff) AM_WRITE(MWA16_NOP)
721   AM_RANGE(0x080000, 0x083fff) AM_WRITE(MWA16_RAM)
722   AM_RANGE(0x100000, 0x103fff) AM_WRITE(MWA16_RAM) AM_BASE(&spriteram16)
723   AM_RANGE(0x180000, 0x180001) AM_WRITE(MWA16_NOP) // MSB: watchdog(?)
724   AM_RANGE(0x380000, 0x380001) AM_WRITE(paddlema_soundlatch_w) // LSB: sound latch write and RST38 trigger
725ADDRESS_MAP_END
726
727710static ADDRESS_MAP_START( alpha68k_II_map, ADDRESS_SPACE_PROGRAM, 16 )
728711   AM_RANGE(0x000000, 0x03ffff) AM_ROM
729712   AM_RANGE(0x040000, 0x040fff) AM_RAM AM_BASE(&shared_ram)
r1771r1772
743726   AM_RANGE(0x800000, 0x83ffff) AM_ROMBANK(8)
744727ADDRESS_MAP_END
745728
746static ADDRESS_MAP_START( alpha68k_V_readmem, ADDRESS_SPACE_PROGRAM, 16 )
747   AM_RANGE(0x000000, 0x03ffff) AM_READ(MRA16_ROM)
748   AM_RANGE(0x040000, 0x043fff) AM_READ(MRA16_RAM)
749   AM_RANGE(0x080000, 0x080001) AM_READ(control_1_r) /* Joysticks */
729static ADDRESS_MAP_START( alpha68k_V_map, ADDRESS_SPACE_PROGRAM, 16 )
730   AM_RANGE(0x000000, 0x03ffff) AM_ROM
731   AM_RANGE(0x040000, 0x043fff) AM_RAM AM_BASE(&shared_ram)
732   AM_RANGE(0x080000, 0x080001) AM_READWRITE(control_1_r, alpha68k_V_sound_w) /* Joysticks */
750733   AM_RANGE(0x0c0000, 0x0c0001) AM_READ(control_2_V_r) /* Dip 2 */
751   AM_RANGE(0x0d8000, 0x0d8001) AM_READ(MRA16_NOP) /* IRQ ack? */
752   AM_RANGE(0x0e0000, 0x0e0001) AM_READ(MRA16_NOP) /* IRQ ack? */
753   AM_RANGE(0x0e8000, 0x0e8001) AM_READ(MRA16_NOP) /* watchdog? */
754   AM_RANGE(0x100000, 0x100fff) AM_READ(MRA16_RAM)
755   AM_RANGE(0x200000, 0x207fff) AM_READ(MRA16_RAM)
756   AM_RANGE(0x300000, 0x303fff) AM_READ(alpha_V_trigger_r)
757   AM_RANGE(0x400000, 0x401fff) AM_READ(MRA16_RAM)
758   AM_RANGE(0x800000, 0x83ffff) AM_READ(MRA16_BANK8)
759ADDRESS_MAP_END
760
761static ADDRESS_MAP_START( alpha68k_V_writemem, ADDRESS_SPACE_PROGRAM, 16 )
762   AM_RANGE(0x000000, 0x03ffff) AM_WRITE(MWA16_NOP)
763   AM_RANGE(0x040000, 0x043fff) AM_WRITE(MWA16_RAM) AM_BASE(&shared_ram)
764   AM_RANGE(0x080000, 0x080001) AM_WRITE(alpha68k_V_sound_w)
765734   AM_RANGE(0x0c0000, 0x0c00ff) AM_WRITE(alpha68k_V_video_control_w)
766   AM_RANGE(0x100000, 0x100fff) AM_WRITE(alpha68k_videoram_w) AM_BASE(&videoram16)
767   AM_RANGE(0x200000, 0x207fff) AM_WRITE(MWA16_RAM) AM_BASE(&spriteram16)
735   AM_RANGE(0x0d8000, 0x0d8001) AM_READNOP /* IRQ ack? */
736   AM_RANGE(0x0e0000, 0x0e0001) AM_READNOP /* IRQ ack? */
737   AM_RANGE(0x0e8000, 0x0e8001) AM_READNOP /* watchdog? */
738   AM_RANGE(0x100000, 0x100fff) AM_READWRITE(MRA16_RAM, alpha68k_videoram_w) AM_BASE(&videoram16)
739   AM_RANGE(0x200000, 0x207fff) AM_RAM AM_BASE(&spriteram16)
740   AM_RANGE(0x300000, 0x303fff) AM_READ(alpha_V_trigger_r)
768741   AM_RANGE(0x300000, 0x3001ff) AM_WRITE(alpha_microcontroller_w)
769742   AM_RANGE(0x303e00, 0x303fff) AM_WRITE(alpha_microcontroller_w) /* Gang Wars mirror */
770   AM_RANGE(0x400000, 0x401fff) AM_WRITE(alpha68k_paletteram_w) AM_BASE(&paletteram16)
743   AM_RANGE(0x400000, 0x401fff) AM_READWRITE(MRA16_RAM, alpha68k_paletteram_w) AM_BASE(&paletteram16)
744   AM_RANGE(0x800000, 0x83ffff) AM_ROMBANK(8)
771745ADDRESS_MAP_END
772746
773747static READ16_HANDLER(sound_cpu_r) { return 1; }
774748
775static ADDRESS_MAP_START( tnexspce_readmem, ADDRESS_SPACE_PROGRAM, 16 )
776   AM_RANGE(0x000000, 0x03ffff) AM_READ(MRA16_ROM)
777   AM_RANGE(0x070000, 0x073fff) AM_READ(MRA16_RAM)
778   AM_RANGE(0x0a0000, 0x0a3fff) AM_READ(MRA16_RAM)
749static ADDRESS_MAP_START( tnexspce_map, ADDRESS_SPACE_PROGRAM, 16 )
750   AM_RANGE(0x000000, 0x03ffff) AM_ROM
751   AM_RANGE(0x070000, 0x073fff) AM_RAM
752   AM_RANGE(0x0a0000, 0x0a3fff) AM_RAM AM_BASE(&spriteram16)
753   AM_RANGE(0x0d0000, 0x0d0001) AM_WRITENOP // unknown write port (0)
779754   AM_RANGE(0x0e0000, 0x0e0001) AM_READ(input_port_0_word_r)
780755   AM_RANGE(0x0e0002, 0x0e0003) AM_READ(input_port_1_word_r)
781756   AM_RANGE(0x0e0004, 0x0e0005) AM_READ(input_port_2_word_r)
757   AM_RANGE(0x0e0006, 0x0e0007) AM_WRITENOP // unknown write port (0)
782758   AM_RANGE(0x0e0008, 0x0e0009) AM_READ(input_port_3_word_r)
783759   AM_RANGE(0x0e000a, 0x0e000b) AM_READ(input_port_4_word_r)
760   AM_RANGE(0x0e000e, 0x0e000f) AM_WRITENOP // unknown write port (0)
784761   AM_RANGE(0x0e0018, 0x0e0019) AM_READ(sound_cpu_r)
785ADDRESS_MAP_END
786
787static ADDRESS_MAP_START( tnexspce_writemem, ADDRESS_SPACE_PROGRAM, 16 )
788   AM_RANGE(0x000000, 0x03ffff) AM_WRITE(MWA16_ROM)
789   AM_RANGE(0x070000, 0x073fff) AM_WRITE(MWA16_RAM)
790   AM_RANGE(0x0a0000, 0x0a3fff) AM_WRITE(MWA16_RAM) AM_BASE(&spriteram16)
791   AM_RANGE(0x0d0000, 0x0d0001) AM_WRITE(MWA16_NOP) // unknown write port (0)
792   AM_RANGE(0x0e0006, 0x0e0007) AM_WRITE(MWA16_NOP) // unknown write port (0)
793   AM_RANGE(0x0e000e, 0x0e000f) AM_WRITE(MWA16_NOP) // unknown write port (0)
794762   AM_RANGE(0x0f0000, 0x0f0001) AM_WRITE(tnexspce_unknown_w)
795763   AM_RANGE(0x0f0002, 0x0f0005) AM_WRITE(tnexspce_coin_counters_w)
796764   AM_RANGE(0x0f0008, 0x0f0009) AM_WRITE(tnexspce_soundlatch_w)
r1771r1772
807775   memory_set_bankptr(7,&RAM[bankaddress]);
808776}
809777
810static ADDRESS_MAP_START( sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
811   AM_RANGE(0x0000, 0x7fff) AM_READ(MRA8_ROM)
812   AM_RANGE(0x8000, 0x87ff) AM_READ(MRA8_RAM)
813   AM_RANGE(0xc000, 0xffff) AM_READ(MRA8_BANK7)
778static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
779   AM_RANGE(0x0000, 0x7fff) AM_ROM
780   AM_RANGE(0x8000, 0x87ff) AM_RAM
781   AM_RANGE(0xc000, 0xffff) AM_ROMBANK(7)
814782ADDRESS_MAP_END
815783
816static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
817   AM_RANGE(0x0000, 0x7fff) AM_WRITE(MWA8_ROM)
818   AM_RANGE(0x8000, 0x87ff) AM_WRITE(MWA8_RAM)
819ADDRESS_MAP_END
820//AT
821static ADDRESS_MAP_START( kyros_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
822   AM_RANGE(0x0000, 0xbfff) AM_READ(MRA8_ROM)
823   AM_RANGE(0xc000, 0xc7ff) AM_READ(MRA8_RAM)
784static ADDRESS_MAP_START( kyros_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
785   AM_RANGE(0x0000, 0xbfff) AM_ROM
786   AM_RANGE(0xc000, 0xc7ff) AM_RAM
824787   AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r)
825ADDRESS_MAP_END
826
827static ADDRESS_MAP_START( kyros_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
828   AM_RANGE(0x0000, 0xbfff) AM_WRITE(MWA8_ROM)
829   AM_RANGE(0xc000, 0xc7ff) AM_WRITE(MWA8_RAM)
830788   AM_RANGE(0xe002, 0xe002) AM_WRITE(soundlatch_clear_w)
831789   AM_RANGE(0xe004, 0xe004) AM_WRITE(DAC_0_signed_data_w)
832790   AM_RANGE(0xe006, 0xe00e) AM_WRITE(MWA8_NOP) // soundboard I/O's, ignored
r1771r1772
839797*/
840798ADDRESS_MAP_END
841799
842static ADDRESS_MAP_START( sstingry_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
843   AM_RANGE(0x0000, 0x7fff) AM_READ(MRA8_ROM)
844   AM_RANGE(0x8000, 0x87ff) AM_READ(MRA8_RAM)
800static ADDRESS_MAP_START( sstingry_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
801   AM_RANGE(0x0000, 0x7fff) AM_ROM
802   AM_RANGE(0x8000, 0x87ff) AM_RAM
845803   AM_RANGE(0xc100, 0xc100) AM_READ(soundlatch_r)
846ADDRESS_MAP_END
847
848static ADDRESS_MAP_START( sstingry_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
849   AM_RANGE(0x0000, 0x7fff) AM_WRITE(MWA8_ROM)
850   AM_RANGE(0x8000, 0x87ff) AM_WRITE(MWA8_RAM)
851804   AM_RANGE(0xc102, 0xc102) AM_WRITE(soundlatch_clear_w)
852805   AM_RANGE(0xc104, 0xc104) AM_WRITE(DAC_0_signed_data_w)
853   AM_RANGE(0xc106, 0xc10e) AM_WRITE(MWA8_NOP) // soundboard I/O's, ignored
806   AM_RANGE(0xc106, 0xc10e) AM_WRITENOP // soundboard I/O's, ignored
854807ADDRESS_MAP_END
855808
856809static ADDRESS_MAP_START( jongbou_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
r1771r1772
858811   AM_RANGE(0x8000, 0x83ff) AM_RAM
859812ADDRESS_MAP_END
860813
861static ADDRESS_MAP_START( alpha68k_I_s_readmem, ADDRESS_SPACE_PROGRAM, 8 )
862   AM_RANGE(0x0000, 0x9fff) AM_READ(MRA8_ROM) // sound program
863   AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r)
864   AM_RANGE(0xe800, 0xe800) AM_READ(YM3812_status_port_0_r)
865   AM_RANGE(0xf000, 0xf7ff) AM_READ(MRA8_RAM) // work RAM
866   AM_RANGE(0xfc00, 0xfc00) AM_READ(MRA8_RAM) // unknown port
867ADDRESS_MAP_END
868
869static ADDRESS_MAP_START( alpha68k_I_s_writemem, ADDRESS_SPACE_PROGRAM, 8 )
870   AM_RANGE(0x0000, 0x9fff) AM_WRITE(MWA8_ROM)
871   AM_RANGE(0xe000, 0xe000) AM_WRITE(soundlatch_clear_w)
872   AM_RANGE(0xe800, 0xe800) AM_WRITE(YM3812_control_port_0_w)
814static ADDRESS_MAP_START( alpha68k_I_s_map, ADDRESS_SPACE_PROGRAM, 8 )
815   AM_RANGE(0x0000, 0x9fff) AM_ROM
816   AM_RANGE(0xe000, 0xe000) AM_READWRITE(soundlatch_r, soundlatch_clear_w)
817   AM_RANGE(0xe800, 0xe800) AM_READWRITE(YM3812_status_port_0_r, YM3812_control_port_0_w)
873818   AM_RANGE(0xec00, 0xec00) AM_WRITE(YM3812_write_port_0_w)
874   AM_RANGE(0xf000, 0xf7ff) AM_WRITE(MWA8_RAM)
875   AM_RANGE(0xfc00, 0xfc00) AM_WRITE(MWA8_RAM) // unknown port
819   AM_RANGE(0xf000, 0xf7ff) AM_RAM
820   AM_RANGE(0xfc00, 0xfc00) AM_RAM // unknown port
876821ADDRESS_MAP_END
877//ZT
878822
879static ADDRESS_MAP_START( tnexspce_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
880   AM_RANGE(0x0000, 0xefff) AM_READ(MRA8_ROM)
881   AM_RANGE(0xf000, 0xf7ff) AM_READ(MRA8_RAM)
882   AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_r) //AT
883ADDRESS_MAP_END
884823
885static ADDRESS_MAP_START( tnexspce_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
886   AM_RANGE(0x0000, 0xefff) AM_WRITE(MWA8_ROM)
887   AM_RANGE(0xf000, 0xf7ff) AM_WRITE(MWA8_RAM)
888   AM_RANGE(0xf800, 0xf800) AM_WRITE(soundlatch_clear_w) //AT
824static ADDRESS_MAP_START( tnexspce_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
825   AM_RANGE(0x0000, 0xefff) AM_ROM
826   AM_RANGE(0xf000, 0xf7ff) AM_RAM
827   AM_RANGE(0xf800, 0xf800) AM_READWRITE(soundlatch_r, soundlatch_clear_w)
889828ADDRESS_MAP_END
890829
891static ADDRESS_MAP_START( sound_readport, ADDRESS_SPACE_IO, 8 )
830static ADDRESS_MAP_START( sound_portmap, ADDRESS_SPACE_IO, 8 )
892831   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
893   AM_RANGE(0x00, 0x00) AM_READ(soundlatch_r)
894ADDRESS_MAP_END
895
896static ADDRESS_MAP_START( sound_writeport, ADDRESS_SPACE_IO, 8 )
897   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
898   AM_RANGE(0x00, 0x00) AM_WRITE(soundlatch_clear_w)
832   AM_RANGE(0x00, 0x00) AM_READWRITE(soundlatch_r, soundlatch_clear_w)
899833   AM_RANGE(0x08, 0x08) AM_WRITE(DAC_0_signed_data_w)
900834   AM_RANGE(0x0a, 0x0a) AM_WRITE(YM2413_register_port_0_w)
901835   AM_RANGE(0x0b, 0x0b) AM_WRITE(YM2413_data_port_0_w)
r1771r1772
904838   AM_RANGE(0x0e, 0x0e) AM_WRITE(sound_bank_w)
905839ADDRESS_MAP_END
906840
907static ADDRESS_MAP_START( kyros_sound_writeport, ADDRESS_SPACE_IO, 8 )
841static ADDRESS_MAP_START( kyros_sound_portmap, ADDRESS_SPACE_IO, 8 )
908842   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
909843   AM_RANGE(0x10, 0x10) AM_WRITE(YM2203_control_port_0_w)
910844   AM_RANGE(0x11, 0x11) AM_WRITE(YM2203_write_port_0_w)
r1771r1772
914848   AM_RANGE(0x91, 0x91) AM_WRITE(YM2203_control_port_2_w)
915849ADDRESS_MAP_END
916850
917static ADDRESS_MAP_START( jongbou_sound_io_map, ADDRESS_SPACE_IO, 8 )
851static ADDRESS_MAP_START( jongbou_sound_portmap, ADDRESS_SPACE_IO, 8 )
918852   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
919853   AM_RANGE(0x00, 0x00) AM_WRITE(AY8910_control_port_0_w)
920854   AM_RANGE(0x01, 0x01) AM_READWRITE(AY8910_read_port_0_r, AY8910_write_port_0_w)
r1771r1772
922856   AM_RANGE(0x06, 0x06) AM_WRITE(MWA8_NOP)
923857ADDRESS_MAP_END
924858
925static ADDRESS_MAP_START( tnexspce_sound_readport, ADDRESS_SPACE_IO, 8 ) //AT
859static ADDRESS_MAP_START( tnexspce_sound_portmap, ADDRESS_SPACE_IO, 8 )
926860   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
927   AM_RANGE(0x00, 0x00) AM_READ(YM3812_status_port_0_r)
928   AM_RANGE(0x3b, 0x3b) AM_READ(MRA8_NOP) // unknown read port
929   AM_RANGE(0x3d, 0x3d) AM_READ(MRA8_NOP) // unknown read port
930   AM_RANGE(0x7b, 0x7b) AM_READ(MRA8_NOP) // unknown read port
931ADDRESS_MAP_END
932
933static ADDRESS_MAP_START( tnexspce_sound_writeport, ADDRESS_SPACE_IO, 8 )
934   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
935   AM_RANGE(0x00, 0x00) AM_WRITE(YM3812_control_port_0_w)
861   AM_RANGE(0x00, 0x00) AM_READWRITE(YM3812_status_port_0_r, YM3812_control_port_0_w)
936862   AM_RANGE(0x20, 0x20) AM_WRITE(YM3812_write_port_0_w)
863   AM_RANGE(0x3b, 0x3b) AM_READNOP // unknown read port
864   AM_RANGE(0x3d, 0x3d) AM_READNOP // unknown read port
865   AM_RANGE(0x7b, 0x7b) AM_READNOP // unknown read port
937866ADDRESS_MAP_END
938867
939868/******************************************************************************/
r1771r1772
20561985
20571986   /* basic machine hardware */
20581987   MDRV_CPU_ADD(M68000, 6000000) /* 24MHz/4? */
2059   MDRV_CPU_PROGRAM_MAP(kyros_readmem,kyros_writemem)
1988   MDRV_CPU_PROGRAM_MAP(kyros_map,0)
20601989   MDRV_CPU_VBLANK_INT(alpha68k_interrupt,2)
20611990
20621991   MDRV_CPU_ADD(Z80, 3579545)
20631992   /* audio CPU */ /* ? */
2064   MDRV_CPU_PROGRAM_MAP(sstingry_sound_readmem,sstingry_sound_writemem)
2065   MDRV_CPU_IO_MAP(0,kyros_sound_writeport)
1993   MDRV_CPU_PROGRAM_MAP(sstingry_sound_map,0)
1994   MDRV_CPU_IO_MAP(kyros_sound_portmap,0)
20661995//AT
20671996   MDRV_CPU_VBLANK_INT(irq0_line_hold, 2)
20681997   MDRV_CPU_PERIODIC_INT(nmi_line_pulse, 4000)
r1771r1772
21062035
21072036   /* basic machine hardware */
21082037   MDRV_CPU_ADD(M68000, 6000000) /* 24MHz/4? */
2109   MDRV_CPU_PROGRAM_MAP(kyros_readmem,kyros_writemem)
2038   MDRV_CPU_PROGRAM_MAP(kyros_map,0)
21102039   MDRV_CPU_VBLANK_INT(alpha68k_interrupt,2)
21112040
21122041   MDRV_CPU_ADD(Z80, 3579545)
21132042   /* audio CPU */ /* ? */
2114   MDRV_CPU_PROGRAM_MAP(kyros_sound_readmem,kyros_sound_writemem)
2115   MDRV_CPU_IO_MAP(0,kyros_sound_writeport)
2043   MDRV_CPU_PROGRAM_MAP(kyros_sound_map,0)
2044   MDRV_CPU_IO_MAP(kyros_sound_portmap,0)
21162045//AT
21172046   MDRV_CPU_VBLANK_INT(irq0_line_hold, 2)
21182047   MDRV_CPU_PERIODIC_INT(nmi_line_pulse, 4000)
r1771r1772
21552084
21562085   /* basic machine hardware */
21572086   MDRV_CPU_ADD(M68000, 8000000)
2158   MDRV_CPU_PROGRAM_MAP(kyros_readmem,kyros_writemem)
2087   MDRV_CPU_PROGRAM_MAP(kyros_map,0)
21592088   MDRV_CPU_VBLANK_INT(alpha68k_interrupt,17) // must be at least 4 for the controls to be smooth
21602089
21612090   MDRV_CPU_ADD(Z80, 4000000)
2162   /* audio CPU */
21632091   MDRV_CPU_PROGRAM_MAP(jongbou_sound_map,0)
2164   MDRV_CPU_IO_MAP(jongbou_sound_io_map,0)
2092   MDRV_CPU_IO_MAP(jongbou_sound_portmap,0)
21652093   MDRV_CPU_VBLANK_INT(irq0_line_hold, 160) // guess, controls sound speed
21662094
21672095   MDRV_MACHINE_RESET(common)
r1771r1772
21912119
21922120   /* basic machine hardware */
21932121   MDRV_CPU_ADD(M68000, 6000000) /* 24MHz/4? */
2194   MDRV_CPU_PROGRAM_MAP(alpha68k_I_readmem,alpha68k_I_writemem)
2122   MDRV_CPU_PROGRAM_MAP(alpha68k_I_map,0)
21952123   MDRV_CPU_VBLANK_INT(irq1_line_hold,1)/* VBL */
21962124
21972125   MDRV_CPU_ADD(Z80, 4000000) // 4Mhz seems to yield the correct tone
2198   /* audio CPU */
2199   MDRV_CPU_PROGRAM_MAP(alpha68k_I_s_readmem, alpha68k_I_s_writemem)
2126   MDRV_CPU_PROGRAM_MAP(alpha68k_I_s_map,0)
22002127
22012128   /* video hardware */
22022129   MDRV_SCREEN_ADD("main", RASTER)
r1771r1772
22292156
22302157   MDRV_CPU_ADD(Z80, /*3579545*/3579545*2) /* Unlikely but needed to stop nested NMI's */
22312158   /* audio CPU */ /* Correct?? */
2232   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
2233   MDRV_CPU_IO_MAP(sound_readport,sound_writeport)
2159   MDRV_CPU_PROGRAM_MAP(sound_map,0)
2160   MDRV_CPU_IO_MAP(sound_portmap,0)
22342161   MDRV_CPU_PERIODIC_INT(nmi_line_pulse, 7500) //AT
22352162
22362163   MDRV_MACHINE_RESET(common)
r1771r1772
22772204   MDRV_CPU_VBLANK_INT(alpha68k_interrupt, 4)
22782205
22792206   MDRV_CPU_ADD(Z80, 4000000*2)
2280   /* audio CPU */
2281   MDRV_CPU_PROGRAM_MAP(sound_readmem, sound_writemem)
2282   MDRV_CPU_IO_MAP(sound_readport, sound_writeport)
2207   MDRV_CPU_PROGRAM_MAP(sound_map,0)
2208   MDRV_CPU_IO_MAP(sound_portmap,0)
22832209   MDRV_CPU_PERIODIC_INT(nmi_line_pulse, 7500)
22842210
22852211   MDRV_MACHINE_RESET(common)
r1771r1772
23162242
23172243   /* basic machine hardware */
23182244   MDRV_CPU_ADD(M68000, 10000000) /* ? */
2319   MDRV_CPU_PROGRAM_MAP(alpha68k_V_readmem,alpha68k_V_writemem)
2245   MDRV_CPU_PROGRAM_MAP(alpha68k_V_map,0)
23202246   MDRV_CPU_VBLANK_INT(irq3_line_hold,1)/* VBL */
23212247
23222248   MDRV_CPU_ADD(Z80, /*3579545*/3579545*2) /* Unlikely but needed to stop nested NMI's */
2323   /* audio CPU */
2324   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
2325   MDRV_CPU_IO_MAP(sound_readport,sound_writeport)
2249   MDRV_CPU_PROGRAM_MAP(sound_map,0)
2250   MDRV_CPU_IO_MAP(sound_portmap,0)
23262251   MDRV_CPU_PERIODIC_INT(nmi_line_pulse, 8500) //AT
23272252
23282253   MDRV_MACHINE_RESET(common)
r1771r1772
23582283
23592284   /* basic machine hardware */
23602285   MDRV_CPU_ADD(M68000, 10000000) /* ? */
2361   MDRV_CPU_PROGRAM_MAP(alpha68k_V_readmem,alpha68k_V_writemem)
2286   MDRV_CPU_PROGRAM_MAP(alpha68k_V_map,0)
23622287   MDRV_CPU_VBLANK_INT(irq3_line_hold,1)/* VBL */
23632288
23642289   MDRV_CPU_ADD(Z80, /*3579545*/3579545*2) /* Unlikely but needed to stop nested NMI's */
2365   /* audio CPU */
2366   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
2367   MDRV_CPU_IO_MAP(sound_readport,sound_writeport)
2290   MDRV_CPU_PROGRAM_MAP(sound_map,0)
2291   MDRV_CPU_IO_MAP(sound_portmap,0)
23682292   MDRV_CPU_PERIODIC_INT(nmi_line_pulse, 8500) //AT
23692293
23702294   MDRV_MACHINE_RESET(common)
r1771r1772
24002324
24012325   /* basic machine hardware */
24022326   MDRV_CPU_ADD(M68000, 9000000) /* Confirmed 18 MHz/2 */
2403   MDRV_CPU_PROGRAM_MAP(tnexspce_readmem,tnexspce_writemem)
2327   MDRV_CPU_PROGRAM_MAP(tnexspce_map,0)
24042328   MDRV_CPU_VBLANK_INT(irq1_line_hold,1)/* VBL */
24052329
24062330   MDRV_CPU_ADD(Z80, 4000000)
2407   /* audio CPU */
2408   MDRV_CPU_PROGRAM_MAP(tnexspce_sound_readmem, tnexspce_sound_writemem)
2409   MDRV_CPU_IO_MAP(tnexspce_sound_readport,tnexspce_sound_writeport)
2331   MDRV_CPU_PROGRAM_MAP(tnexspce_sound_map,0)
2332   MDRV_CPU_IO_MAP(tnexspce_sound_portmap,0)
24102333
24112334   MDRV_MACHINE_RESET(tnexspce)
24122335
src/mame/drivers/vicdual.c
r1771r1772
20962096
20972097   PORT_START_TAG("IN1")
20982098   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
2099   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(samurai_protection_r, 1)
2099   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(samurai_protection_r, (void *)1)
21002100   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) /* unknown, but used */
21012101   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
21022102   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r1771r1772
21072107
21082108   PORT_START_TAG("IN2")
21092109   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
2110   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(samurai_protection_r, 2)
2110   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(samurai_protection_r, (void *)2)
21112111   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) )
21122112   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
21132113   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r1771r1772
21182118
21192119   PORT_START_TAG("IN3")
21202120   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
2121   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(samurai_protection_r, 3)
2121   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(samurai_protection_r, (void *)3)
21222122   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) )
21232123   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
21242124   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
src/mame/drivers/pturn.c
r1771r1772
142142      flipy=spriteram[offs+1]&0x80;
143143
144144
145      if (flip_screen_x)
145      if (flip_screen_x_get())
146146      {
147147         sx = 224 - sx;
148148         flipx ^= 0x40;
149149      }
150150
151      if (flip_screen_y)
151      if (flip_screen_y_get())
152152      {
153153         flipy ^= 0x80;
154154         sy = 224 - sy;
src/mame/drivers/mpu4drvr.c
r1771r1772
306306
307307static const struct acia6850_interface m6809_acia_if =
308308{
309   MPU4_MASTER_CLOCK/44,//This isn't a real division, this is just to work around
310   MPU4_MASTER_CLOCK/44,//the ACIA code's hard coding
309   1,//This isn't a real division, this is just to work around
310   1,//the ACIA code's hard coding
311311   &m68k_m6809_line,
312312   &m6809_m68k_line,
313313   &m6809_acia_cts,
r1771r1772
318318
319319static const struct acia6850_interface m68k_acia_if =
320320{
321   MPU4_MASTER_CLOCK/44,
322   MPU4_MASTER_CLOCK/44,
321   1,
322   1,
323323   &m6809_m68k_line,
324324   &m68k_m6809_line,
325325   &m68k_acia_cts,
r1771r1772
336336
337337static WRITE8_HANDLER( vid_o1_callback )
338338{
339   int clock;
340
339341   ptm6840_set_c2(   1, data); // copy output value to c2
340}
341342
342static WRITE8_HANDLER( vid_o2_callback )
343{
344   int clock  = ptm6840_get_ext_clock(1, 1)/(ptm6840_get_count(1,1)?ptm6840_get_count(1,1):1)
345   *ptm6840_get_ext_clock(1, 0)/(ptm6840_get_count(1,0)?ptm6840_get_count(1,0):1)
346   *ptm6840_get_ext_clock(1, 2)/(ptm6840_get_count(1,2)?ptm6840_get_count(1,2):1);
347
348   ptm6840_set_c3(   1, data); // copy output value to c3
349
350   if (clock)
343   if (data)
351344   {
345      clock = MPU4_MASTER_CLOCK/44;
346      LOGSTUFF(("acia on for %d cycles \n",ptm6840_get_count(1,0)));
347   }
348   else
349   {
350      clock = 1; //as low as we can go, ideally we need to switch the ACIAs off
351   }
352352      acia6850_set_rx_clock(0, clock);
353353      acia6850_set_tx_clock(0, clock);
354354      acia6850_set_rx_clock(1, clock);
355355      acia6850_set_tx_clock(1, clock);
356   }
357356}
358357
358static WRITE8_HANDLER( vid_o2_callback )
359{
360   ptm6840_set_c3(   1, data); // copy output value to c3
361}
362
359363static WRITE8_HANDLER( vid_o3_callback )
360364{
361365   ptm6840_set_c1(   1, data); // copy output value to c1
r1771r1772
365369static const ptm6840_interface ptm_vid_intf =
366370{
367371   VIDEO_MASTER_CLOCK/10,
368   { MPU4_MASTER_CLOCK/4,0,0 },
372   { 0,0,0 },
369373   { vid_o1_callback, vid_o2_callback, vid_o3_callback },
370374   cpu1_ptm_irq
371375};
r1771r1772
685689   if (data==0x00)
686690   {
687691      // master reset
688      LOGSTUFF(("master reset %02x\n",data));
692      LOGSTUFF(("master reset\n"));
693      scn2675_IR_pointer=0;
694      scn2674_irq_register = 0x20;
695      scn2674_status_register = 0x20;
696      scn2674_irq_mask = 0x20;
697      scn2674_gfx_enabled = 0;
698      scn2674_display_enabled = 0;
699      scn2674_cursor_enabled = 0;
700      IR2_scn2674_row_table = 0;
689701   }
690702
691703   if ((data&0xf0)==0x10)
r1771r1772
16621674   MDRV_CPU_ADD_TAG("main", M6809, MPU4_MASTER_CLOCK/4)   // 6809 CPU
16631675   MDRV_CPU_PROGRAM_MAP(dealem_memmap,0)               // setup read and write memorymap
16641676
1665   MDRV_CPU_PERIODIC_INT(gen_50hz, 100)   // generate 50 hz signal
1677   MDRV_CPU_PERIODIC_INT(gen_50hz, 100)               // generate 50 hz signal
16661678
16671679   MDRV_CPU_VBLANK_INT(nmi_line_pulse, 1)
16681680
r1771r1772
16701682   MDRV_SOUND_ADD_TAG("AY8913",AY8913, MPU4_MASTER_CLOCK/4)
16711683   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
16721684
1673   MDRV_NVRAM_HANDLER(generic_0fill)               // load/save nv RAM
1685   MDRV_NVRAM_HANDLER(generic_0fill)                  // load/save nv RAM
16741686   /* video hardware */
16751687   MDRV_SCREEN_ADD("main", RASTER)
1676   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
1688   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)      /* not accurate */)
16771689   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1678   MDRV_SCREEN_SIZE((54+1)*8, (32+1)*8)                  /* Taken from MC6845 init, registers 00 & 04. Normally programmed with (value-1) */
1679   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 31*8-1)    /* Taken from MC6845 init, registers 01 & 06 */
1680   MDRV_SCREEN_REFRESH_RATE(50)
1690   MDRV_SCREEN_SIZE((54+1)*8, (32+1)*8)               /* Taken from MC6845 init, registers 00 & 04. Normally programmed with (value-1) */
1691   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 31*8-1)      /* Taken from MC6845 init, registers 01 & 06 */
1692   MDRV_SCREEN_REFRESH_RATE(56)                     //Measured accurately from the flip-flop
16811693
16821694   MDRV_VIDEO_START( dealem)
16831695   MDRV_GFXDECODE(dealem)
r1771r1772
19691981
19701982GAME( 199?, bctvidbs,0,       mpu4mod2, mpu4,     0,    ROT0,   "Barcrest",       "MPU4 Video Firmware",                                    GAME_IS_BIOS_ROOT )
19711983
1972GAME( 1994?,crmaze,  bctvidbs,mpu4_vid, crmaze,   crmaze,ROT0,   "Barcrest",       "The Crystal Maze: Team Challenge (SWP)",                     GAME_NOT_WORKING|GAME_NO_SOUND )
1984GAME( 1994?,crmaze,  bctvidbs,mpu4_vid, crmaze,   crmaze,ROT0,   "Barcrest",       "The Crystal Maze Team Challenge (SWP)",                     GAME_NOT_WORKING|GAME_NO_SOUND )
19731985GAME( 1992?,crmazea, crmaze,  mpu4_vid, crmaze,   crmaze,ROT0,   "Barcrest",       "The Crystal Maze (AMLD Version)",                           GAME_NOT_WORKING|GAME_NO_SOUND )
1974GAME( 1993?,crmazeb, crmaze,  mpu4_vid, crmaze,   0,     ROT0,   "Barcrest",       "The New Crystal Maze - Now Featuring Ocean Zone! (AMLD Version)",   GAME_NOT_WORKING|GAME_NO_SOUND ) // unprotected?
1986GAME( 1993?,crmazeb, crmaze,  mpu4_vid, crmaze,   0,     ROT0,   "Barcrest",       "The New Crystal Maze Featuring Ocean Zone (AMLD Version)",         GAME_NOT_WORKING|GAME_NO_SOUND ) // unprotected?
19751987GAME( 1990, turnover,bctvidbs,mpu4_vid, mpu4,     0,     ROT0,   "Barcrest",       "Turnover",                                             GAME_NOT_WORKING|GAME_NO_SOUND ) // unprotected?
19761988GAME( 1992, skiltrek,bctvidbs,mpu4_vid, mpu4,     0,     ROT0,   "Barcrest",       "Skill Trek",                                          GAME_NOT_WORKING|GAME_NO_SOUND ) // unprotected?
1977GAME( 1990, timemchn,bctvidbs,mpu4_vid, mpu4,     0,     ROT0,   "Barcrest",       "Time Machine v2.0",                                    GAME_NOT_WORKING|GAME_NO_SOUND ) // unprotected?
1989GAME( 1990, timemchn,bctvidbs,mpu4_vid, mpu4,     0,     ROT0,   "Barcrest",       "Time Machine (v2.0)",                                    GAME_NOT_WORKING|GAME_NO_SOUND ) // unprotected?
19781990GAME( 199?, mating,  bctvidbs,mpu4_vid, mpu4,     mating,ROT0,   "Barcrest",       "The Mating Game (Datapak)",                              GAME_NOT_WORKING|GAME_NO_SOUND )
19791991GAME( 199?, matinga, mating,  mpu4_vid, mpu4,     mating,ROT0,   "Barcrest",       "The Mating Game (Standard)",                              GAME_NOT_WORKING|GAME_NO_SOUND )
19801992GAME( 199?, vgpoker, 0,        vgpoker,   mpu4,     0,    ROT0,   "BwB",            "Vegas Poker (Prototype)",                                 GAME_NOT_WORKING|GAME_NO_SOUND )
19811993
1982GAMEL(1989?,connect4,0,       mpu4mod2, connect4, connect4, ROT0,   "Dolbeck Systems",    "Connect 4",                                          GAME_IMPERFECT_GRAPHICS,layout_connect4 )
1983GAME( 198?, mpu4utst,0,        mpu4mod2, mpu4,          0,   ROT0,   "Barcrest",       "MPU4 Unit Test (Program 4)",                              0 )
1984GAME( 198?, mpu4tst2,0,        mpu4mod2, mpu4,          0,   ROT0,   "Barcrest",       "MPU4 Unit Test (Program 2)",                              0 )
1985GAME( 198?, mpu4met0,0,        mpu4mod2, mpu4,          0, ROT0,   "Barcrest",       "MPU4 Meter Clear ROM",                                    0 )
1994GAMEL(1989?,connect4,0,       mpu4mod2, connect4, connect4, ROT0,   "Dolbeck Systems",    "Connect 4",                                       GAME_IMPERFECT_GRAPHICS,layout_connect4 )
1995GAME( 198?, mpu4utst,0,        mpu4mod2, mpu4,          0,   ROT0,   "Barcrest",       "MPU4 Unit Test (Program 4)",                           0 )
1996GAME( 198?, mpu4tst2,0,        mpu4mod2, mpu4,          0,   ROT0,   "Barcrest",       "MPU4 Unit Test (Program 2)",                           0 )
1997GAME( 198?, mpu4met0,0,        mpu4mod2, mpu4,          0, ROT0,   "Barcrest",       "MPU4 Meter Clear ROM",                                 0 )
src/mame/drivers/angelkds.c
r1771r1772
213213
214214*/
215215
216static ADDRESS_MAP_START( readmem_main, ADDRESS_SPACE_PROGRAM, 8 )
217   AM_RANGE(0x0000, 0x7fff) AM_READ(MRA8_ROM)
218   AM_RANGE(0x8000, 0xbfff) AM_READ(MRA8_BANK1)
219   AM_RANGE(0xc000, 0xdfff) AM_READ(MRA8_RAM)
220   AM_RANGE(0xe000, 0xefff) AM_READ(MRA8_RAM)
221ADDRESS_MAP_END
222
223static ADDRESS_MAP_START( writemem_main, ADDRESS_SPACE_PROGRAM, 8 )
224   AM_RANGE(0x0000, 0x7fff) AM_WRITE(MWA8_ROM)
225   AM_RANGE(0xc000, 0xdfff) AM_WRITE(MWA8_RAM)
226   AM_RANGE(0xe000, 0xe3ff) AM_WRITE(angelkds_bgtopvideoram_w) AM_BASE(&angelkds_bgtopvideoram) /* Top Half of Screen */
227   AM_RANGE(0xe400, 0xe7ff) AM_WRITE(angelkds_bgbotvideoram_w) AM_BASE(&angelkds_bgbotvideoram) /* Bottom Half of Screen */
228   AM_RANGE(0xe800, 0xebff) AM_WRITE(angelkds_txvideoram_w) AM_BASE(&angelkds_txvideoram)
229   AM_RANGE(0xec00, 0xecff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram)
230   AM_RANGE(0xed00, 0xeeff) AM_WRITE(angelkds_paletteram_w) AM_BASE(&paletteram)
216static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
217   AM_RANGE(0x0000, 0x7fff) AM_ROM
218   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK(1)
219   AM_RANGE(0xc000, 0xdfff) AM_RAM
220   AM_RANGE(0xe000, 0xe3ff) AM_READWRITE(MRA8_RAM, angelkds_bgtopvideoram_w) AM_BASE(&angelkds_bgtopvideoram) /* Top Half of Screen */
221   AM_RANGE(0xe400, 0xe7ff) AM_READWRITE(MRA8_RAM, angelkds_bgbotvideoram_w) AM_BASE(&angelkds_bgbotvideoram) /* Bottom Half of Screen */
222   AM_RANGE(0xe800, 0xebff) AM_READWRITE(MRA8_RAM, angelkds_txvideoram_w) AM_BASE(&angelkds_txvideoram)
223   AM_RANGE(0xec00, 0xecff) AM_RAM AM_BASE(&spriteram)
224   AM_RANGE(0xed00, 0xeeff) AM_READWRITE(MRA8_RAM, angelkds_paletteram_w) AM_BASE(&paletteram)
225   AM_RANGE(0xef00, 0xefff) AM_RAM
231226   AM_RANGE(0xf000, 0xf000) AM_WRITE(angelkds_bgtopbank_write)
232227   AM_RANGE(0xf001, 0xf001) AM_WRITE(angelkds_bgtopscroll_write)
233228   AM_RANGE(0xf002, 0xf002) AM_WRITE(angelkds_bgbotbank_write)
r1771r1772
236231   AM_RANGE(0xf005, 0xf005) AM_WRITE(angelkds_layer_ctrl_write)
237232ADDRESS_MAP_END
238233
239static ADDRESS_MAP_START( readport_main, ADDRESS_SPACE_IO, 8 )
234static ADDRESS_MAP_START( main_portmap, ADDRESS_SPACE_IO, 8 )
240235   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
236   AM_RANGE(0x00, 0x00) AM_WRITE(MWA8_NOP) // 00 on start-up, not again
237   AM_RANGE(0x42, 0x42) AM_WRITE(angelkds_cpu_bank_write)
238   AM_RANGE(0x43, 0x43) AM_WRITE(MWA8_NOP) // 9a on start-up, not again
241239   AM_RANGE(0x40, 0x40) AM_READ(input_port_0_r)   /* "Coinage" Dip Switches */
242240   AM_RANGE(0x41, 0x41) AM_READ(input_port_1_r)   /* Other Dip Switches */
243241   AM_RANGE(0x42, 0x42) AM_READ(input_port_2_r)   /* Players inputs (not needed ?) */
244242   AM_RANGE(0x80, 0x80) AM_READ(input_port_3_r)   /* System inputs */
245243   AM_RANGE(0x81, 0x82) AM_READ(angelkds_input_r)   /* Players inputs */
246   AM_RANGE(0xc0, 0xc3) AM_READ(angelkds_main_sound_r)  /* needed by spcpostn */
247ADDRESS_MAP_END
248
249static ADDRESS_MAP_START( writeport_main, ADDRESS_SPACE_IO, 8 )
250   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
251   AM_RANGE(0x00, 0x00) AM_WRITE(MWA8_NOP) // 00 on start-up, not again
252   AM_RANGE(0x42, 0x42) AM_WRITE(angelkds_cpu_bank_write)
253   AM_RANGE(0x43, 0x43) AM_WRITE(MWA8_NOP) // 9a on start-up, not again
254244   AM_RANGE(0x83, 0x83) AM_WRITE(MWA8_NOP) // 9b on start-up, not again
255   AM_RANGE(0xc0, 0xc3) AM_WRITE(angelkds_main_sound_w) // 02 various points
245   AM_RANGE(0xc0, 0xc3) AM_READWRITE(angelkds_main_sound_r, angelkds_main_sound_w) // 02 various points
256246ADDRESS_MAP_END
257247
258248/* sub cpu */
259249
260static ADDRESS_MAP_START( readmem_sub, ADDRESS_SPACE_PROGRAM, 8 )
261   AM_RANGE(0x0000, 0x7fff) AM_READ(MRA8_ROM)
262   AM_RANGE(0x8000, 0x87ff) AM_READ(MRA8_RAM)
263   AM_RANGE(0xaaa9, 0xaaa9) AM_READ(MRA8_NOP)
264   AM_RANGE(0xaaab, 0xaaab) AM_READ(MRA8_NOP)
265   AM_RANGE(0xaaac, 0xaaac) AM_READ(MRA8_NOP)
250static ADDRESS_MAP_START( sub_map, ADDRESS_SPACE_PROGRAM, 8 )
251   AM_RANGE(0x0000, 0x7fff) AM_ROM
252   AM_RANGE(0x8000, 0x87ff) AM_RAM
253   AM_RANGE(0xaaa9, 0xaaa9) AM_READNOP
254   AM_RANGE(0xaaab, 0xaaab) AM_READNOP
255   AM_RANGE(0xaaac, 0xaaac) AM_READNOP
266256ADDRESS_MAP_END
267257
268static ADDRESS_MAP_START( writemem_sub, ADDRESS_SPACE_PROGRAM, 8 )
269   AM_RANGE(0x0000, 0x7fff) AM_WRITE(MWA8_ROM)
270   AM_RANGE(0x8000, 0x87ff) AM_WRITE(MWA8_RAM)
271ADDRESS_MAP_END
272
273static ADDRESS_MAP_START( readport_sub, ADDRESS_SPACE_IO, 8 )
258static ADDRESS_MAP_START( sub_portmap, ADDRESS_SPACE_IO, 8 )
274259   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
275   AM_RANGE(0x00, 0x00) AM_READ(YM2203_status_port_0_r)
276   AM_RANGE(0x40, 0x40) AM_READ(YM2203_status_port_1_r)
277   AM_RANGE(0x80, 0x83) AM_READ(angelkds_sub_sound_r)
278ADDRESS_MAP_END
279
280static ADDRESS_MAP_START( writeport_sub, ADDRESS_SPACE_IO, 8 )
281   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
282   AM_RANGE(0x00, 0x00) AM_WRITE(YM2203_control_port_0_w)
260   AM_RANGE(0x00, 0x00) AM_READWRITE(YM2203_status_port_0_r, YM2203_control_port_0_w)
283261   AM_RANGE(0x01, 0x01) AM_WRITE(YM2203_write_port_0_w)
284   AM_RANGE(0x40, 0x40) AM_WRITE(YM2203_control_port_1_w)
262   AM_RANGE(0x40, 0x40) AM_READWRITE(YM2203_status_port_1_r, YM2203_control_port_1_w)
285263   AM_RANGE(0x41, 0x41) AM_WRITE(YM2203_write_port_1_w)
286   AM_RANGE(0x80, 0x83) AM_WRITE(angelkds_sub_sound_w) // spcpostn
264   AM_RANGE(0x80, 0x83) AM_READWRITE(angelkds_sub_sound_r, angelkds_sub_sound_w) // spcpostn
287265ADDRESS_MAP_END
288266
289267
r1771r1772
616594
617595static MACHINE_DRIVER_START( angelkds )
618596   MDRV_CPU_ADD(Z80, 8000000) /* 8MHz? 6 seems too slow? */
619   MDRV_CPU_PROGRAM_MAP(readmem_main,writemem_main)
620   MDRV_CPU_IO_MAP(readport_main,writeport_main)
597   MDRV_CPU_PROGRAM_MAP(main_map,0)
598   MDRV_CPU_IO_MAP(main_portmap,0)
621599   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
622600
623601   MDRV_CPU_ADD(Z80, 4000000) /* 8 MHz? */
624   /* audio CPU */
625   MDRV_CPU_PROGRAM_MAP(readmem_sub,writemem_sub)
626   MDRV_CPU_IO_MAP(readport_sub,writeport_sub)
602   MDRV_CPU_PROGRAM_MAP(sub_map,0)
603   MDRV_CPU_IO_MAP(sub_portmap,0)
627604
628605   MDRV_INTERLEAVE(100)
629606
src/mame/drivers/warpwarp.c
r1771r1772
150150   res = readinputport(offset);
151151   if (offset == 3)
152152   {
153      res = readinputport(3 + (flip_screen & 1));   // read player 2 input in cocktail mode
153      res = readinputport(3 + (flip_screen_get() & 1));   // read player 2 input in cocktail mode
154154      if (handle_joystick)
155155      {
156156         /* map digital two-way joystick to two fixed VOLIN values */
r1771r1772
232232{
233233   int res;
234234
235   res = readinputport(2 + (flip_screen & 1));
235   res = readinputport(2 + (flip_screen_get() & 1));
236236   if (handle_joystick)
237237   {
238238      if (res & 1) return 0x0f;
src/mame/drivers/dunhuang.c
r1771r1772
678678   MDRV_CPU_IO_MAP(dunhuang_io_map,0)
679679   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
680680
681   MDRV_WATCHDOG_TIME_INIT(ATTOTIME_IN_SEC(5))
681   MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_SEC(5))
682682
683683   /* video hardware */
684684   MDRV_SCREEN_ADD("main", RASTER)
src/mame/drivers/laserbat.c
r1771r1772
8080{
8181   laserbat_input_mux = (data & 0x30) >> 4;
8282
83   flip_screen = data & 0x08;
83   flip_screen_set_no_update(data & 0x08);
8484
8585   coin_counter_w(0,data & 1);
8686
r1771r1772
534534
535535      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
536536      {
537         int pixel0 = *BITMAP_ADDR8(s2636_0_bitmap, y, x);
538         int pixel1 = *BITMAP_ADDR8(s2636_1_bitmap, y, x);
539         int pixel2 = *BITMAP_ADDR8(s2636_2_bitmap, y, x);
537         int pixel0 = *BITMAP_ADDR16(s2636_0_bitmap, y, x);
538         int pixel1 = *BITMAP_ADDR16(s2636_1_bitmap, y, x);
539         int pixel2 = *BITMAP_ADDR16(s2636_2_bitmap, y, x);
540540
541541         if (S2636_IS_PIXEL_DRAWN(pixel0))
542542            *BITMAP_ADDR16(bitmap, y, x) = S2636_PIXEL_COLOR(pixel0);
src/mame/drivers/naomi.c
r1771r1772
10761076   ROM_LOAD("mpr23427.8", 0x4000000, 0x0800000, CRC(5851d525) SHA1(1cb1073542d75a3bcc0d363ed31d49bcaf1fd494) )
10771077ROM_END
10781078
1079ROM_START( csmasho )
1080   ROM_REGION( 0x200000, REGION_CPU1, 0)
1081   NAOMI_BIOS
1082
1083   ROM_REGION( 0x4800000, REGION_USER1, ROMREGION_ERASE00)
1084   ROM_LOAD("epr23428.22", 0x0000000, 0x400000, CRC(f8597496) SHA1(2bb9f25b63b7410934ae4b1e052e1308a5c5a57f) )
1085   ROM_RELOAD( 0x400000, 0x400000)
1086   ROM_LOAD("mpr23420.1", 0x0800000, 0x0800000, CRC(9d5991f2) SHA1(c75871db314b01935d1daaacf1a762e73e5fd411) )
1087   ROM_LOAD("mpr23421.2", 0x1000000, 0x0800000, CRC(6c351db3) SHA1(cdd601321a38fc34152517abdc473b73a4c6f630) )
1088   ROM_LOAD("mpr23422.3", 0x1800000, 0x0800000, CRC(a1d4bd29) SHA1(6c446fd1819f55412351f15cf57b769c0c56c1db) )
1089   ROM_LOAD("mpr23423.4", 0x2000000, 0x0800000, CRC(08cbf373) SHA1(0d9a593f5cc5d632d85d7253c135eef2e8e01598) )
1090   ROM_LOAD("mpr23424.5", 0x2800000, 0x0800000, CRC(f4404000) SHA1(e49d941e47e63bb7f3fddc3c3d2c1653611914ee) )
1091   ROM_LOAD("mpr23425.6", 0x3000000, 0x0800000, CRC(47f51da2) SHA1(af5ecd460114caed3a00157ffd3a2df0fbf348c0) )
1092   ROM_LOAD("mpr23426.7", 0x3800000, 0x0800000, CRC(7f91b13f) SHA1(2d534f77291ebfedc011bf0e803a1b9243fb477f) )
1093   ROM_LOAD("mpr23427.8", 0x4000000, 0x0800000, CRC(5851d525) SHA1(1cb1073542d75a3bcc0d363ed31d49bcaf1fd494) )
1094ROM_END
1095
10791096/*
10801097
10811098SYSTEMID: NAOMI
r1771r1772
18901907
18911908*/
18921909
1893/* according to elsemi this set might be a bad dump, (or protected while the clone isn't?) */
18941910ROM_START( vs2_2k )
18951911   ROM_REGION( 0x200000, REGION_CPU1, 0)
18961912   NAOMI_BIOS
18971913
18981914   ROM_REGION( 0x8000000, REGION_USER1, 0)
1899   ROM_LOAD("epr21929c.22", 0x0000000, 0x0400000,  CRC(b5e609f4) SHA1(92b98bad94268a80f6e4506b812d01c0a7850161) )
1900   ROM_LOAD("mpr21914.u1", 0x0800000, 0x0800000, CRC(f91ef69b) SHA1(4ed23091efad7ddf1878a0bfcdcbba3cf151af84) )
1901   ROM_LOAD("mpr21915.u2", 0x1000000, 0x0800000, CRC(40128a67) SHA1(9d191c4ec33465f29bbc09491dde62f354a9ab15) )
1902   ROM_LOAD("mpr21916.u3", 0x1800000, 0x0800000, CRC(19708b3c) SHA1(7d1ef995ce870ffcb68f420a571efb084f5bfcf2) )
1903   ROM_LOAD("mpr21917.u4", 0x2000000, 0x0800000, CRC(b082379b) SHA1(42f585279da1de7e613e42b76e1b81986c48e6ea) )
1904   ROM_LOAD("mpr21918.u5", 0x2800000, 0x0800000, CRC(a3bc1a47) SHA1(0e5043ab6e118feb59f68c84c095cf5b1dba7d09) )
1905   ROM_LOAD("mpr21919.u6", 0x3000000, 0x0800000, CRC(b1dfada7) SHA1(b4c906bc96b615975f6319a1fdbd5b990e7e4124) )
1906   ROM_LOAD("mpr21920.u7", 0x3800000, 0x0800000, CRC(1c189e28) SHA1(93400de2cb803357fa17ae7e1a5297177f9bcfa1) )
1907   ROM_LOAD("mpr21921.u8", 0x4000000, 0x0800000, CRC(55bcb652) SHA1(4de2e7e584dd4999dc8e405837a18a904dfee0bf) )
1908   ROM_LOAD("mpr21922.u9", 0x4800000, 0x0800000, CRC(2ecda3ff) SHA1(54afc77a01470662d580f5676b4e8dc4d04f63f8) )
1909   ROM_LOAD("mpr21923.u10",0x5000000, 0x0800000, CRC(a5cd42ad) SHA1(59f62e995d45311b1592434d1ffa42c261fa8ba1) )
1910   ROM_LOAD("mpr21924.u11",0x5800000, 0x0800000, CRC(cc1a4ed9) SHA1(0e3aaeaa55f1d145fb4877b6d187a3ee78cf214e) )
1911   ROM_LOAD("mpr21925.u12",0x6000000, 0x0800000, CRC(9452c5fb) SHA1(5a04f96d83cca6248f513de0c6240fc671bcadf9) )
1912   ROM_LOAD("mpr21926.u13",0x6800000, 0x0800000, CRC(d6346491) SHA1(830971cbc14cab022a09ad4c6e11ee49c550e308) )
1913   ROM_LOAD("mpr21927.u14",0x7000000, 0x0800000, CRC(a1901e1e) SHA1(2281f91ac696cc14886bcdf4b0685ce2f5bb8117) )
1914   ROM_LOAD("mpr21928.u15",0x7800000, 0x0400000, CRC(d127d9a5) SHA1(78c95357344ea15469b84fa8b1332e76521892cd) )
1915   ROM_LOAD("epr21929c.22", 0x0000000, 0x0400000, CRC(831af08a) SHA1(af4c74623be823fd061765cede354c6a9722fd10) )
1916   ROM_LOAD("mpr21914.u1",  0x0800000, 0x0800000, CRC(f91ef69b) SHA1(4ed23091efad7ddf1878a0bfcdcbba3cf151af84) )
1917   ROM_LOAD("mpr21915.u2",  0x1000000, 0x0800000, CRC(40128a67) SHA1(9d191c4ec33465f29bbc09491dde62f354a9ab15) )
1918   ROM_LOAD("mpr21916.u3",  0x1800000, 0x0800000, CRC(19708b3c) SHA1(7d1ef995ce870ffcb68f420a571efb084f5bfcf2) )
1919   ROM_LOAD("mpr21917.u4",  0x2000000, 0x0800000, CRC(b082379b) SHA1(42f585279da1de7e613e42b76e1b81986c48e6ea) )
1920   ROM_LOAD("mpr21918.u5",  0x2800000, 0x0800000, CRC(a3bc1a47) SHA1(0e5043ab6e118feb59f68c84c095cf5b1dba7d09) )
1921   ROM_LOAD("mpr21919.u6",  0x3000000, 0x0800000, CRC(b1dfada7) SHA1(b4c906bc96b615975f6319a1fdbd5b990e7e4124) )
1922   ROM_LOAD("mpr21920.u7",  0x3800000, 0x0800000, CRC(1c189e28) SHA1(93400de2cb803357fa17ae7e1a5297177f9bcfa1) )
1923   ROM_LOAD("mpr21921.u8",  0x4000000, 0x0800000, CRC(55bcb652) SHA1(4de2e7e584dd4999dc8e405837a18a904dfee0bf) )
1924   ROM_LOAD("mpr21922.u9",  0x4800000, 0x0800000, CRC(2ecda3ff) SHA1(54afc77a01470662d580f5676b4e8dc4d04f63f8) )
1925   ROM_LOAD("mpr21923.u10", 0x5000000, 0x0800000, CRC(a5cd42ad) SHA1(59f62e995d45311b1592434d1ffa42c261fa8ba1) )
1926   ROM_LOAD("mpr21924.u11", 0x5800000, 0x0800000, CRC(cc1a4ed9) SHA1(0e3aaeaa55f1d145fb4877b6d187a3ee78cf214e) )
1927   ROM_LOAD("mpr21925.u12", 0x6000000, 0x0800000, CRC(9452c5fb) SHA1(5a04f96d83cca6248f513de0c6240fc671bcadf9) )
1928   ROM_LOAD("mpr21926.u13", 0x6800000, 0x0800000, CRC(d6346491) SHA1(830971cbc14cab022a09ad4c6e11ee49c550e308) )
1929   ROM_LOAD("mpr21927.u14", 0x7000000, 0x0800000, CRC(a1901e1e) SHA1(2281f91ac696cc14886bcdf4b0685ce2f5bb8117) )
1930   ROM_LOAD("mpr21928.u15", 0x7800000, 0x0400000, CRC(d127d9a5) SHA1(78c95357344ea15469b84fa8b1332e76521892cd) )
19151931ROM_END
19161932
1917ROM_START( vs2_2ka )
1918   ROM_REGION( 0x200000, REGION_CPU1, 0)
1919   NAOMI_BIOS
1920
1921   ROM_REGION( 0x8000000, REGION_USER1, 0)
1922   ROM_LOAD("u22", 0x0000000, 0x0400000, CRC(831af08a) SHA1(af4c74623be823fd061765cede354c6a9722fd10) )
1923   ROM_LOAD("mpr21914.u1", 0x0800000, 0x0800000, CRC(f91ef69b) SHA1(4ed23091efad7ddf1878a0bfcdcbba3cf151af84) )
1924   ROM_LOAD("mpr21915.u2", 0x1000000, 0x0800000, CRC(40128a67) SHA1(9d191c4ec33465f29bbc09491dde62f354a9ab15) )
1925   ROM_LOAD("mpr21916.u3", 0x1800000, 0x0800000, CRC(19708b3c) SHA1(7d1ef995ce870ffcb68f420a571efb084f5bfcf2) )
1926   ROM_LOAD("mpr21917.u4", 0x2000000, 0x0800000, CRC(b082379b) SHA1(42f585279da1de7e613e42b76e1b81986c48e6ea) )
1927   ROM_LOAD("mpr21918.u5", 0x2800000, 0x0800000, CRC(a3bc1a47) SHA1(0e5043ab6e118feb59f68c84c095cf5b1dba7d09) )
1928   ROM_LOAD("mpr21919.u6", 0x3000000, 0x0800000, CRC(b1dfada7) SHA1(b4c906bc96b615975f6319a1fdbd5b990e7e4124) )
1929   ROM_LOAD("mpr21920.u7", 0x3800000, 0x0800000, CRC(1c189e28) SHA1(93400de2cb803357fa17ae7e1a5297177f9bcfa1) )
1930   ROM_LOAD("mpr21921.u8", 0x4000000, 0x0800000, CRC(55bcb652) SHA1(4de2e7e584dd4999dc8e405837a18a904dfee0bf) )
1931   ROM_LOAD("mpr21922.u9", 0x4800000, 0x0800000, CRC(2ecda3ff) SHA1(54afc77a01470662d580f5676b4e8dc4d04f63f8) )
1932   ROM_LOAD("mpr21923.u10",0x5000000, 0x0800000, CRC(a5cd42ad) SHA1(59f62e995d45311b1592434d1ffa42c261fa8ba1) )
1933   ROM_LOAD("mpr21924.u11",0x5800000, 0x0800000, CRC(cc1a4ed9) SHA1(0e3aaeaa55f1d145fb4877b6d187a3ee78cf214e) )
1934   ROM_LOAD("mpr21925.u12",0x6000000, 0x0800000, CRC(9452c5fb) SHA1(5a04f96d83cca6248f513de0c6240fc671bcadf9) )
1935   ROM_LOAD("mpr21926.u13",0x6800000, 0x0800000, CRC(d6346491) SHA1(830971cbc14cab022a09ad4c6e11ee49c550e308) )
1936   ROM_LOAD("mpr21927.u14",0x7000000, 0x0800000, CRC(a1901e1e) SHA1(2281f91ac696cc14886bcdf4b0685ce2f5bb8117) )
1937   ROM_LOAD("mpr21928.u15",0x7800000, 0x0400000, CRC(d127d9a5) SHA1(78c95357344ea15469b84fa8b1332e76521892cd) )
1938ROM_END
1939
19401933/* Sega Marine Fishing */
19411934
19421935ROM_START( smarinef )
r1771r1772
22792272
22802273/* Naomi & Naomi GD-ROM */
22812274GAME( 1998, naomi,    0,        naomi,    naomi,    0, ROT0, "Sega",            "Naomi Bios", GAME_NO_SOUND|GAME_NOT_WORKING|GAME_IS_BIOS_ROOT )
2282// Complete Dumps
2283GAME( 2001, csmash,   naomi,    naomi,    naomi,    0, ROT0, "Sega",            "Cosmic Smash (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2275
2276/* Complete Dumps */
2277GAME( 2001, csmash,   naomi,    naomi,    naomi,    0, ROT0, "Sega",            "Cosmic Smash (JPN, USA, EXP, KOR, AUS) (rev. A)", GAME_NO_SOUND|GAME_NOT_WORKING )
2278GAME( 2001, csmasho,  csmash,   naomi,    naomi,    0, ROT0, "Sega",            "Cosmic Smash (JPN, USA, EXP, KOR, AUS) (original)", GAME_NO_SOUND|GAME_NOT_WORKING )
22842279GAME( 1999, suchie3,  naomi,    naomi,    naomi,    0, ROT0, "Jaleco",          "Idol Janshi Suchie-Pai 3 (JPN)", GAME_NO_SOUND|GAME_NOT_WORKING )
2285GAME( 1999, vs2_2k,   naomi,    naomi,    naomi,    0, ROT0, "Sega",            "Virtua Striker 2 Ver. 2000 (JPN, USA, EXP, KOR, AUS) (set 1)", GAME_NO_SOUND|GAME_NOT_WORKING )
2286GAME( 1999, vs2_2ka,  vs2_2k,   naomi,    naomi,    0, ROT0, "Sega",            "Virtua Striker 2 Ver. 2000 (JPN, USA, EXP, KOR, AUS) (set 2)", GAME_NO_SOUND|GAME_NOT_WORKING )
2280GAME( 1999, vs2_2k,   naomi,    naomi,    naomi,    0, ROT0, "Sega",            "Virtua Striker 2 Ver. 2000 (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
22872281GAME( 1999, smarinef, naomi,    naomi,    naomi,    0, ROT0, "Sega",            "Sega Marine Fishing", GAME_NO_SOUND|GAME_NOT_WORKING )
22882282GAME( 1999, toyfight, naomi,    naomi,    naomi,    0, ROT0, "Sega",            "Toy Fighter", GAME_NO_SOUND|GAME_NOT_WORKING )
2289// Incomplete Dumps (just IC22)
2283
2284/* Incomplete Dumps (just the program rom IC22) */
22902285GAME( 2000, cspike,   naomi,    naomi,    naomi,    0, ROT0, "Psikyo / Capcom", "Gun Spike (JPN) / Cannon Spike (USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
22912286GAME( 2000, capsnk,   naomi,    naomi,    naomi,    0, ROT0, "Capcom / SNK",    "Capcom Vs. SNK Millennium Fight 2000 (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
22922287GAME( ????, derbyoc,  naomi,    naomi,    naomi,    0, ROT0, "Sega",            "Derby Owners Club (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
r1771r1772
23112306
23122307
23132308
2314// No GD-Rom Sets Supported */
2309/* No GD-Rom Sets Supported */
23152310
23162311/* Naomi 2 & Naomi 2 GD-ROM */
23172312GAME( 2001, naomi2,   0,        naomi,    naomi,    0, ROT0, "Sega",            "Naomi 2 Bios", GAME_NO_SOUND|GAME_NOT_WORKING|GAME_IS_BIOS_ROOT )
2318// No Supported Sets
2313/* No Supported Sets */
23192314
23202315/* Atomiswave */
23212316GAME( 2001, awbios,   0,        naomi,    naomi,    0, ROT0, "Sammy",           "Atomiswave Bios", GAME_NO_SOUND|GAME_NOT_WORKING|GAME_IS_BIOS_ROOT )
2322// No Supported Sets
2317/* No Supported Sets */
src/mame/drivers/asteroid.c
r1771r1772
593593   MDRV_SCREEN_SIZE(400,300)
594594   MDRV_SCREEN_VISIBLE_AREA(522, 1566, 394, 1182)
595595
596   MDRV_PALETTE_LENGTH(32768)
597
598596   MDRV_VIDEO_START(dvg)
599597   MDRV_VIDEO_UPDATE(vector)
600598
src/mame/drivers/segag80v.c
r1771r1772
925925   MDRV_SCREEN_SIZE(400, 300)
926926   MDRV_SCREEN_VISIBLE_AREA(512, 1536, 640-32, 1408+32)
927927
928   MDRV_PALETTE_LENGTH(256)
929
930928   MDRV_VIDEO_START(sega)
931929   MDRV_VIDEO_UPDATE(sega)
932930
src/mame/drivers/ace.c
r1771r1772
143143}
144144
145145
146static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
146/* 5x2101 - SRAM 256x4 */
147/* 3x3106 - SRAM 256x1 */
148/* 1x3622 - ROM 512x4  - doesn't seem to be used ????????????*/
147149
148   AM_RANGE(0x0000, 0x09ff) AM_READ(MRA8_ROM)
150static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
149151
150   AM_RANGE(0x2000, 0x20ff) AM_READ(MRA8_RAM)
151   AM_RANGE(0x8300, 0x83ff) AM_READ(MRA8_RAM)
152   AM_RANGE(0x8000, 0x80ff) AM_READ(ace_characterram_r)
152   AM_RANGE(0x0000, 0x09ff) AM_ROM
153153
154   AM_RANGE(0x2000, 0x20ff) AM_RAM AM_BASE(&ace_scoreram)   /* 2x2101 */
155   AM_RANGE(0x8300, 0x83ff) AM_RAM AM_BASE(&ace_ram2)      /* 2x2101 */
156   AM_RANGE(0x8000, 0x80ff) AM_READWRITE(ace_characterram_r, ace_characterram_w) AM_BASE(&ace_characterram)   /* 3x3101 (3bits: 0, 1, 2) */
157
158   AM_RANGE(0xc000, 0xc005) AM_WRITE(ace_objpos_w)
159
154160   /* players inputs */
155161   AM_RANGE(0xc008, 0xc008) AM_READ(input_port_0_r)
156162   AM_RANGE(0xc009, 0xc009) AM_READ(input_port_1_r)
r1771r1772
188194
189195ADDRESS_MAP_END
190196
191/* 5x2101 - SRAM 256x4 */
192/* 3x3106 - SRAM 256x1 */
193/* 1x3622 - ROM 512x4  - doesn't seem to be used ????????????*/
194197
195static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
196   AM_RANGE(0x0000, 0x09ff) AM_WRITE(MWA8_ROM)
197
198   AM_RANGE(0x2000, 0x20ff) AM_WRITE(MWA8_RAM) AM_BASE(&ace_scoreram)   /* 2x2101 */
199   AM_RANGE(0x8300, 0x83ff) AM_WRITE(MWA8_RAM) AM_BASE(&ace_ram2)      /* 2x2101 */
200   AM_RANGE(0x8000, 0x80ff) AM_WRITE(ace_characterram_w) AM_BASE(&ace_characterram)   /* 3x3101 (3bits: 0, 1, 2) */
201
202   AM_RANGE(0xc000, 0xc005) AM_WRITE(ace_objpos_w)
203ADDRESS_MAP_END
204
205
206198static INPUT_PORTS_START( ace )
207199
208200   PORT_START_TAG("c008")   /* player thrust */
r1771r1772
319311
320312   /* basic machine hardware */
321313   MDRV_CPU_ADD(8080, 18000000 / 9)   /* 2 MHz ? */
322   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
314   MDRV_CPU_PROGRAM_MAP(main_map,0)
323315
324316   /* video hardware */
325317   MDRV_SCREEN_ADD("main", RASTER)
src/mame/drivers/astrocde.c
r1771r1772
9898      2 pressed to get to an input check screen, reset with 1+2 pressed to
9999      get to a convergence test screen.
100100
101****************************************************************************
102
103    DIP locations verified for:
104    - seawolf2 (manual)
105    - wow (manual)
106    - gorf (manual)
107    - robby (manual)
108    - profpac (manual)
109
101110****************************************************************************/
102111
103112#include "driver.h"
r1771r1772
730739static INPUT_PORTS_START( seawolf2 )
731740   PORT_START_TAG("P1HANDLE")
732741   PORT_BIT( 0x3f, 0x1f, IPT_POSITIONAL ) PORT_PLAYER(2) PORT_POSITIONS(64) PORT_REMAP_TABLE(controller_table) PORT_SENSITIVITY(20) PORT_KEYDELTA(4) PORT_CENTERDELTA(0) PORT_CROSSHAIR(X, 2.0, -0.40, 34.0 / 240.0)
733   PORT_DIPNAME( 0x40, 0x00, "Language 1" )
742   PORT_DIPNAME( 0x40, 0x00, "Language 1" )      PORT_DIPLOCATION("S2:!1")
734743   PORT_DIPSETTING(    0x00, "Language 2" )
735744   PORT_DIPSETTING(    0x40, DEF_STR( French ) )
736745   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
r1771r1772
744753   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
745754   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START1 )
746755   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START2 )
747   PORT_DIPNAME( 0x08, 0x00, "Language 2" )
756   PORT_DIPNAME( 0x08, 0x00, "Language 2" )      PORT_DIPLOCATION("S2:!2")
748757   PORT_DIPSETTING(    0x00, DEF_STR( English ) )
749758   PORT_DIPSETTING(    0x08, DEF_STR( German ) )
750759   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
751760
752761   PORT_START_TAG("P4HANDLE")
753   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Coinage ) ) PORT_DIPLOCATION("S1:2")
762   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Coinage ) )   PORT_DIPLOCATION("S1:!2")
754763   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
755764   PORT_DIPSETTING(    0x01, DEF_STR( 1C_1C ) )
756   PORT_DIPNAME( 0x06, 0x00, "Play Time" ) PORT_DIPLOCATION("S1:3,4")
757   PORT_DIPSETTING(    0x06, "40" )
758   PORT_DIPSETTING(    0x04, "50" )
759   PORT_DIPSETTING(    0x02, "60" )
760   PORT_DIPSETTING(    0x00, "70" )
761   PORT_DIPNAME( 0x08, 0x08, "2 Players Game" ) PORT_DIPLOCATION("S1:1")
765   PORT_DIPNAME( 0x06, 0x00, "Play Time" )         PORT_DIPLOCATION("S1:!3,!4")
766   PORT_DIPSETTING(    0x06, "1P 40s/2P 45s" )      /* Extended play: 1P 20s/2P 20s */
767   PORT_DIPSETTING(    0x04, "1P 50s/2P 60s" )      /* Extended play: 1P 25s/2P 30s */
768   PORT_DIPSETTING(    0x02, "1P 60s/2P 75s" )      /* Extended play: 1P 30s/2P 35s */
769   PORT_DIPSETTING(    0x00, "1P 70s/2P 90s" )      /* Extended play: 1P 35s/2P 45s */
770   PORT_DIPNAME( 0x08, 0x08, "2 Players Game" )   PORT_DIPLOCATION("S1:!1")
762771   PORT_DIPSETTING(    0x00, "1 Credit" )
763772   PORT_DIPSETTING(    0x08, "2 Credits" )
764   PORT_DIPNAME( 0x30, 0x00, "Extended Play" ) PORT_DIPLOCATION("S1:5,6")
773   PORT_DIPNAME( 0x30, 0x00, "Extended Play" )      PORT_DIPLOCATION("S1:!5,!6")
765774   PORT_DIPSETTING(    0x10, "5000" )
766775   PORT_DIPSETTING(    0x20, "6000" )
767776   PORT_DIPSETTING(    0x30, "7000" )
768777   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
769   PORT_DIPNAME( 0x40, 0x40, "Monitor" ) PORT_DIPLOCATION("S1:7")
778   PORT_DIPNAME( 0x40, 0x40, "Monitor" )         PORT_DIPLOCATION("S1:!7")
770779   PORT_DIPSETTING(    0x40, "Color" )
771780   PORT_DIPSETTING(    0x00, "B/W" )
772   PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_LOW, "S1:8")
781   PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_LOW, "S1:!8")
773782INPUT_PORTS_END
774783
775784
r1771r1772
787796   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
788797   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT )
789798   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
790   PORT_DIPNAME( 0x10, 0x00, "Monitor" )
799   PORT_DIPNAME( 0x10, 0x00, "Monitor" )         PORT_DIPLOCATION( "JU:1" )
791800   PORT_DIPSETTING(    0x00, "Color" )
792801   PORT_DIPSETTING(    0x10, "B/W" )
793802   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
794   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) )
803   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) )   PORT_DIPLOCATION( "JU:2" )
795804   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
796805   PORT_DIPSETTING(    0x40, DEF_STR( Cocktail ) )
797806   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
r1771r1772
800809   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(ebases_trackball_r, 0)
801810
802811   PORT_START_TAG("P4HANDLE")
803   PORT_DIPNAME( 0x01, 0x00, "2 Players Game" ) PORT_DIPLOCATION( "S1:1" )
812   PORT_DIPNAME( 0x01, 0x00, "2 Players Game" )   PORT_DIPLOCATION( "S1:1" )
804813   PORT_DIPSETTING(    0x00, "1 Credit" )
805814   PORT_DIPSETTING(    0x01, "2 Credits" )
806815   PORT_DIPUNUSED_DIPLOC( 0x02, 0x00, "S1:2" )
r1771r1772
841850   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
842851   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
843852   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
844   PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "S1:7" )
853   PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "JU:1" )
845854   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
846855
847856   PORT_START_TAG("P3HANDLE")
r1771r1772
850859   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
851860   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
852861   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
853   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Cabinet ) )
862   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Cabinet ) )   PORT_DIPLOCATION("JU:2")
854863   PORT_DIPSETTING(    0x20, DEF_STR( Upright ) )
855864   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
856865   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
857866
858867   PORT_START_TAG("P4HANDLE")
859   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Coin_A ) ) PORT_DIPLOCATION( "S1:1" )
868   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Coin_A ) )   PORT_DIPLOCATION( "S1:1" )
860869   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
861870   PORT_DIPSETTING(    0x01, DEF_STR( 1C_1C ) )
862   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Coin_B ) ) PORT_DIPLOCATION( "S1:2,3" )
871   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Coin_B ) )   PORT_DIPLOCATION( "S1:2,3" )
863872   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
864873   PORT_DIPSETTING(    0x06, DEF_STR( 1C_1C ) )
865874   PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) )
r1771r1772
867876   PORT_DIPUNUSED_DIPLOC( 0x08, 0x00, "S1:4" )
868877   PORT_DIPUNUSED_DIPLOC( 0x10, 0x00, "S1:5" )
869878   PORT_DIPUNUSED_DIPLOC( 0x20, 0x00, "S1:6" )
870   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
879   PORT_DIPUNUSED_DIPLOC( 0x40, 0x00, "S1:7" )
880   PORT_DIPUNUSED_DIPLOC( 0x80, 0x00, "S1:8" )
871881INPUT_PORTS_END
872882
873883
r1771r1772
880890   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_TILT )
881891   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
882892   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
883   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) )
893   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) )   PORT_DIPLOCATION("JU:1") /* Undocumented, jumper? */
884894   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
885895   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
886896
r1771r1772
904914   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(wow_speech_status_r, 0)
905915
906916   PORT_START_TAG("P4HANDLE")
907   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("S1:1")
917   /* "If S1:1,2,3 are all ON or all OFF, only coin meter number 1 will count." */
918   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Coin_A ) )      PORT_DIPLOCATION("S1:1")
908919   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
909920   PORT_DIPSETTING(    0x01, DEF_STR( 1C_1C ) )
910   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("S1:2,3")
921   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Coin_B ) )      PORT_DIPLOCATION("S1:2,3")
911922   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
912923   PORT_DIPSETTING(    0x06, DEF_STR( 1C_1C ) )
913924   PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) )
914925   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )
915   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Language ) ) PORT_DIPLOCATION("S1:4")
926   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Language ) )      PORT_DIPLOCATION("S1:4")
916927   PORT_DIPSETTING(    0x08, DEF_STR( English ) )
917   PORT_DIPSETTING(    0x00, "Foreign (NEED ROM)" )
918   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("S1:5")
928   PORT_DIPSETTING(    0x00, "Foreign (NEED ROM)" )   /* "Requires A082-91374-A000" */
929   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Lives ) )      PORT_DIPLOCATION("S1:5")
919930    PORT_DIPSETTING(    0x10, "2 for 1 Credit / 5 for 2 Credits" )
920931    PORT_DIPSETTING(    0x00, "3 for 1 Credit / 7 for 2 Credits" )
921   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("S1:6")
922   PORT_DIPSETTING(    0x20, "3rd Level" )
923   PORT_DIPSETTING(    0x00, "4th Level" )
924   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("S1:7")
932   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("S1:6")
933   PORT_DIPSETTING(    0x20, "After 3rd Level" )
934   PORT_DIPSETTING(    0x00, "After 4th Level" )
935   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) )   PORT_DIPLOCATION("S1:7")
925936   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
926937   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
927   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("S1:8")
928   PORT_DIPSETTING(    0x00, "On only when controls are touched" )
938   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("S1:8")
939   PORT_DIPSETTING(    0x00, "On only when controls are touched" )   /* "Touching controls will enable attract sound for 1 cycle." */
929940   PORT_DIPSETTING(    0x80, "Always On"  )
930941INPUT_PORTS_END
931942
r1771r1772
938949   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_TILT )
939950   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
940951   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
941   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Cabinet ) )
952   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Cabinet ) )      PORT_DIPLOCATION("JU:1")   /* Jumper */
942953   PORT_DIPSETTING(    0x40, DEF_STR( Upright ) )
943954   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
944   PORT_DIPNAME( 0x80, 0x80, "Speech" )
955   PORT_DIPNAME( 0x80, 0x80, "Speech" )            PORT_DIPLOCATION("JU:2")   /* Jumper */
945956   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
946957   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
947958
r1771r1772
963974   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(gorf_speech_status_r, 0)
964975
965976   PORT_START_TAG("P4HANDLE")
966   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("S1:1")
977   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Coin_A ) )      PORT_DIPLOCATION("S1:1")
967978   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
968979   PORT_DIPSETTING(    0x01, DEF_STR( 1C_1C ) )
969   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("S1:2,3")
980   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Coin_B ) )      PORT_DIPLOCATION("S1:2,3")
970981   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
971982   PORT_DIPSETTING(    0x06, DEF_STR( 1C_1C ) )
972983   PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) )
973984   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )
974   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Language ) ) PORT_DIPLOCATION("S1:4")
985   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Language ) )      PORT_DIPLOCATION("S1:4")
975986   PORT_DIPSETTING(    0x08, DEF_STR( English ) )
976   PORT_DIPSETTING(    0x00, "Foreign (NEED ROM)" )
977   PORT_DIPNAME( 0x10, 0x00, "Lives per Credit" ) PORT_DIPLOCATION("S1:5")
987   PORT_DIPSETTING(    0x00, "Foreign (NEED ROM)" )   /* "Requires A082-91374-A000" */
988   PORT_DIPNAME( 0x10, 0x00, "Lives per Credit" )      PORT_DIPLOCATION("S1:5")
978989   PORT_DIPSETTING(    0x10, "2" )
979990   PORT_DIPSETTING(    0x00, "3" )
980   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("S1:6")
991   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("S1:6")
981992   PORT_DIPSETTING(    0x00, "Mission 5" )
982993   PORT_DIPSETTING(    0x20, DEF_STR( None ) )
983   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("S1:7")
994   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) )   PORT_DIPLOCATION("S1:7")
984995   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
985996   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
986   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("S1:8")
997   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("S1:8")
987998   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
988999   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
9891000INPUT_PORTS_END
r1771r1772
10191030   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
10201031
10211032   PORT_START_TAG("P4HANDLE")
1022   PORT_DIPNAME( 0x01, 0x01, "Use NVRAM" ) PORT_DIPLOCATION("S1:1")
1033   PORT_DIPNAME( 0x01, 0x01, "Use NVRAM" )            PORT_DIPLOCATION("S1:1")
10231034   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
10241035   PORT_DIPSETTING(    0x01, DEF_STR( Yes ) )
10251036   PORT_DIPNAME( 0x02, 0x02, "Use Service Mode Settings" ) PORT_DIPLOCATION("S1:2")
10261037   PORT_DIPSETTING(    0x00, "Reset" )
10271038   PORT_DIPSETTING(    0x02, DEF_STR( Yes ) )
1028   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("S1:3")
1039   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Free_Play ) )   PORT_DIPLOCATION("S1:3")
10291040   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
10301041   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1031   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("S1:4")
1042   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Cabinet ) )      PORT_DIPLOCATION("S1:4")   /* Listed as "Unused". */
10321043   PORT_DIPSETTING(    0x08, DEF_STR( Upright ) )
10331044   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
10341045   PORT_DIPUNUSED_DIPLOC( 0x10, 0x00, "S1:5" )
10351046   PORT_DIPUNUSED_DIPLOC( 0x20, 0x00, "S1:6" )
10361047   PORT_DIPUNUSED_DIPLOC( 0x40, 0x00, "S1:7" )
1037   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("S1:8")
1048   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("S1:8")   /* Listed as "Unused". */
10381049   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
10391050   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
10401051INPUT_PORTS_END
r1771r1772
10641075   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
10651076
10661077   PORT_START_TAG("P4HANDLE")
1067   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("S1:1")
1068   PORT_DIPSETTING(    0x01, DEF_STR( Upright ) )
1078   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) )   PORT_DIPLOCATION("S1:1")
1079   PORT_DIPSETTING(    0x01, DEF_STR( Upright ) )   /* Upright or Mini */
10691080   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
1070   PORT_DIPNAME( 0x02, 0x02, "Reset on powerup" ) PORT_DIPLOCATION("S1:2")
1081   PORT_DIPNAME( 0x02, 0x02, "Reset on powerup" )   PORT_DIPLOCATION("S1:2")
10711082   PORT_DIPSETTING(    0x02, DEF_STR( No ) )
10721083   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
1073   PORT_DIPNAME( 0x04, 0x00, "Halt on error" ) PORT_DIPLOCATION("S1:3")
1084   PORT_DIPNAME( 0x04, 0x00, "Halt on error" )      PORT_DIPLOCATION("S1:3")
10741085   PORT_DIPSETTING(    0x04, DEF_STR( No ) )
10751086   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
1076   PORT_DIPNAME( 0x08, 0x00, "Beep" ) PORT_DIPLOCATION("S1:4")
1087   PORT_DIPNAME( 0x08, 0x00, "Beep" )            PORT_DIPLOCATION("S1:4")
10771088   PORT_DIPSETTING(    0x08, DEF_STR( No ) )
10781089   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
1079   PORT_DIPNAME( 0x10, 0x10, "ROM" ) PORT_DIPLOCATION("S1:5")
1080   PORT_DIPSETTING(    0x10, DEF_STR( No ) )
1081   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
1090   PORT_DIPNAME( 0x10, 0x00, "ROM's Used" )      PORT_DIPLOCATION("S1:5")
1091   PORT_DIPSETTING(    0x10, "8K & 16K ROM's" )
1092   PORT_DIPSETTING(    0x00, "32K ROM's" )
10821093   PORT_DIPUNUSED_DIPLOC( 0x20, 0x00, "S1:6" )
10831094   PORT_DIPUNUSED_DIPLOC( 0x40, 0x00, "S1:7" )
10841095   PORT_DIPUNUSED_DIPLOC( 0x80, 0x00, "S1:8" )
r1771r1772
11381149   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
11391150
11401151   PORT_START_TAG("P61")
1141   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("S1:1")
1152   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) )   PORT_DIPLOCATION("S1:1")
11421153   PORT_DIPSETTING(    0x01, DEF_STR( Upright ) )
11431154   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
1144   PORT_DIPNAME( 0x02, 0x02, "Lockup" ) PORT_DIPLOCATION("S1:2")
1155   PORT_DIPNAME( 0x02, 0x02, "Lockup" )         PORT_DIPLOCATION("S1:2")
11451156   PORT_DIPSETTING(    0x02, DEF_STR( No ) )
11461157   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
1147   PORT_DIPNAME( 0x04, 0x00, "Reset" ) PORT_DIPLOCATION("S1:3")
1158   PORT_DIPNAME( 0x04, 0x00, "Reset" )            PORT_DIPLOCATION("S1:3")
11481159   PORT_DIPSETTING(    0x04, DEF_STR( No ) )
11491160   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
1150   PORT_DIPNAME( 0x08, 0x00, "Beep" ) PORT_DIPLOCATION("S1:4")
1161   PORT_DIPNAME( 0x08, 0x00, "Beep" )            PORT_DIPLOCATION("S1:4")
11511162   PORT_DIPSETTING(    0x08, DEF_STR( No ) )
11521163   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
1153   PORT_DIPNAME( 0x10, 0x10, "Regulation" ) PORT_DIPLOCATION("S1:5")
1164   PORT_DIPNAME( 0x10, 0x10, "Regulation" )      PORT_DIPLOCATION("S1:5")
11541165   PORT_DIPSETTING(    0x10, DEF_STR( No ) )
11551166   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
1156   PORT_DIPNAME( 0x20, 0x20, "Ticket Dispenser" ) PORT_DIPLOCATION("S1:6")
1167   PORT_DIPNAME( 0x20, 0x20, "Ticket Dispenser" )   PORT_DIPLOCATION("S1:6")
11571168   PORT_DIPSETTING(    0x20, DEF_STR( No ) )
11581169   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
1159   PORT_DIPNAME( 0x40, 0x40, "Bill Acceptor" ) PORT_DIPLOCATION("S1:7")
1170   PORT_DIPNAME( 0x40, 0x40, "Bill Acceptor" )      PORT_DIPLOCATION("S1:7")
11601171   PORT_DIPSETTING(    0x40, DEF_STR( No ) )
11611172   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
11621173   PORT_DIPUNUSED_DIPLOC( 0x80, 0x00, "S1:8" )
src/mame/drivers/deco156.c
r1771r1772
6464{
6565   int offs;
6666
67   flip_screen = 1;
67   flip_screen_set_no_update(1);
6868
6969   for (offs = (0x1400/4)-4;offs >= 0;offs -= 4) // 0x1400 for charlien
7070   {
r1771r1772
110110         inc = 1;
111111      }
112112
113      if (flip_screen)
113      if (flip_screen_x_get())
114114      {
115115         y=240-y;
116116         x=304-x;
src/mame/drivers/sbowling.c
r1771r1772
6161
6262static void plot_pixel_sbw(int x, int y, int col)
6363{
64   if (flip_screen)
64   if (flip_screen_get())
6565   {
6666      y = 255-y;
6767      x = 247-x;
src/mame/drivers/psychic5.c
r1771r1772
355355   // bit 7 toggles flip screen
356356   if (data & 0x80)
357357   {
358      flip_screen_set(!flip_screen);
358      flip_screen_set(!flip_screen_get());
359359   }
360360}
361361
src/mame/drivers/pacland.c
r1771r1772
201201{
202202   int bit = !BIT(offset,11);
203203   /* can't use flip_screen_set() because the visible area is asymmetrical */
204   flip_screen = bit;
205   tilemap_set_flip(ALL_TILEMAPS,flip_screen ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
204   flip_screen_set_no_update(bit);
205   tilemap_set_flip(ALL_TILEMAPS,flip_screen_get() ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
206206}
207207
208208
src/mame/drivers/nss.c
r1771r1772
387387   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4)
388388   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4)
389389
390   PORT_START   /* IN 8 : Internal switches */
391   PORT_DIPNAME( 0x1, 0x1, "Enforce 32 sprites/line" )
392   PORT_DIPSETTING(   0x0, DEF_STR( No )  )
393   PORT_DIPSETTING(   0x1, DEF_STR( Yes ) )
394
395#ifdef MAME_DEBUG
396   PORT_START   /* IN 9 : debug switches */
397   PORT_DIPNAME( 0x3, 0x0, "Browse tiles" )
398   PORT_DIPSETTING(   0x0, DEF_STR( Off ) )
399   PORT_DIPSETTING(   0x1, "2bpl"  )
400   PORT_DIPSETTING(   0x2, "4bpl"  )
401   PORT_DIPSETTING(   0x3, "8bpl"  )
402   PORT_DIPNAME( 0xc, 0x0, "Browse maps" )
403   PORT_DIPSETTING(   0x0, DEF_STR( Off ) )
404   PORT_DIPSETTING(   0x4, "2bpl"  )
405   PORT_DIPSETTING(   0x8, "4bpl"  )
406   PORT_DIPSETTING(   0xc, "8bpl"  )
407
408   PORT_START   /* IN 10 : debug switches */
409   PORT_BIT( 0x1, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Toggle BG 1") PORT_PLAYER(2)
410   PORT_BIT( 0x2, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_NAME("Toggle BG 2") PORT_PLAYER(2)
411   PORT_BIT( 0x4, IP_ACTIVE_HIGH, IPT_BUTTON9 ) PORT_NAME("Toggle BG 3") PORT_PLAYER(2)
412   PORT_BIT( 0x8, IP_ACTIVE_HIGH, IPT_BUTTON10 ) PORT_NAME("Toggle BG 4") PORT_PLAYER(2)
413   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Toggle Objects") PORT_PLAYER(3)
414   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_NAME("Toggle Main/Sub") PORT_PLAYER(3)
415   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON9 ) PORT_NAME("Toggle Back col") PORT_PLAYER(3)
416   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON10 ) PORT_NAME("Toggle Windows") PORT_PLAYER(3)
417
418   PORT_START   /* IN 11 : debug input */
419   PORT_BIT( 0x1, IP_ACTIVE_HIGH, IPT_BUTTON9 ) PORT_NAME("Pal prev")
420   PORT_BIT( 0x2, IP_ACTIVE_HIGH, IPT_BUTTON10 ) PORT_NAME("Pal next")
421   PORT_BIT( 0x4, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Toggle Transparency") PORT_PLAYER(4)
422#endif
423
424   PORT_START   /* IN 12 : dip-switches */
390   PORT_START   /* IN 8 : dip-switches */
425391   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )
426392   PORT_DIPSETTING(    0x00, DEF_STR( Normal ) )
427393   PORT_DIPSETTING(    0x03, DEF_STR( Hard )  )
src/mame/drivers/mirage.c
r1771r1772
7979         inc = 1;
8080      }
8181
82      if (flip_screen)
82      if (flip_screen_get())
8383      {
8484         y=240-y;
8585         x=304-x;
src/mame/drivers/namcos2.c
r1771r1772
15881588
15891589   MDRV_INTERLEAVE(100) /* CPU slices per frame */
15901590
1591   MDRV_MACHINE_START(namcos2)
15911592   MDRV_MACHINE_RESET(namcos2)
15921593   MDRV_NVRAM_HANDLER(namcos2)
15931594
r1771r1772
16611662
16621663   MDRV_INTERLEAVE(100) /* CPU slices per frame */
16631664
1665   MDRV_MACHINE_START(namcos2)
16641666   MDRV_MACHINE_RESET(namcos2)
16651667   MDRV_NVRAM_HANDLER(namcos2)
16661668
r1771r1772
17101712
17111713   MDRV_INTERLEAVE(100) /* CPU slices per frame */
17121714
1715   MDRV_MACHINE_START(namcos2)
17131716   MDRV_MACHINE_RESET(namcos2)
17141717   MDRV_NVRAM_HANDLER(namcos2)
17151718
r1771r1772
17591762
17601763   MDRV_INTERLEAVE(100) /* CPU slices per frame */
17611764
1765   MDRV_MACHINE_START(namcos2)
17621766   MDRV_MACHINE_RESET(namcos2)
17631767   MDRV_NVRAM_HANDLER(namcos2)
17641768
r1771r1772
18081812
18091813   MDRV_INTERLEAVE(100) /* CPU slices per frame */
18101814
1815   MDRV_MACHINE_START(namcos2)
18111816   MDRV_MACHINE_RESET(namcos2)
18121817   MDRV_NVRAM_HANDLER(namcos2)
18131818
r1771r1772
18571862
18581863   MDRV_INTERLEAVE(100) /* CPU slices per frame */
18591864
1865   MDRV_MACHINE_START(namcos2)
18601866   MDRV_MACHINE_RESET(namcos2)
18611867   MDRV_NVRAM_HANDLER(namcos2)
18621868
src/mame/drivers/aztarac.c
r1771r1772
7272 *
7373 *************************************/
7474
75static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 16 )
76   AM_RANGE(0x000000, 0x00bfff) AM_READ(MRA16_ROM)
77   AM_RANGE(0x022000, 0x022fff) AM_READ(nvram_r)
75static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 )
76   AM_RANGE(0x000000, 0x00bfff) AM_ROM
77   AM_RANGE(0x022000, 0x0220ff) AM_READWRITE(nvram_r, MWA16_RAM) AM_BASE(&generic_nvram16) AM_SIZE(&generic_nvram_size)
7878   AM_RANGE(0x027000, 0x027001) AM_READ(joystick_r)
7979   AM_RANGE(0x027004, 0x027005) AM_READ(input_port_3_word_r)
80   AM_RANGE(0x027008, 0x027009) AM_READ(aztarac_sound_r)
80   AM_RANGE(0x027008, 0x027009) AM_READWRITE(aztarac_sound_r, aztarac_sound_w)
8181   AM_RANGE(0x02700c, 0x02700d) AM_READ(input_port_2_word_r)
8282   AM_RANGE(0x02700e, 0x02700f) AM_READ(watchdog_reset16_r)
83   AM_RANGE(0xff8000, 0xffafff) AM_READ(MRA16_RAM)
84   AM_RANGE(0xffe000, 0xffffff) AM_READ(MRA16_RAM)
85ADDRESS_MAP_END
86
87
88static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 16 )
89   AM_RANGE(0x000000, 0x00bfff) AM_WRITE(MWA16_ROM)
90   AM_RANGE(0x022000, 0x0220ff) AM_WRITE(MWA16_RAM) AM_BASE(&generic_nvram16) AM_SIZE(&generic_nvram_size)
91   AM_RANGE(0x027008, 0x027009) AM_WRITE(aztarac_sound_w)
92   AM_RANGE(0xff8000, 0xffafff) AM_WRITE(MWA16_RAM) AM_BASE(&aztarac_vectorram)
83   AM_RANGE(0xff8000, 0xffafff) AM_RAM AM_BASE(&aztarac_vectorram)
9384   AM_RANGE(0xffb000, 0xffb001) AM_WRITE(aztarac_ubr_w)
94   AM_RANGE(0xffe000, 0xffffff) AM_WRITE(MWA16_RAM)
85   AM_RANGE(0xffe000, 0xffffff) AM_RAM
9586ADDRESS_MAP_END
9687
9788
r1771r1772
10293 *
10394 *************************************/
10495
105static ADDRESS_MAP_START( sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
106   AM_RANGE(0x0000, 0x1fff) AM_READ(MRA8_ROM)
107   AM_RANGE(0x8000, 0x87ff) AM_READ(MRA8_RAM)
96static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
97   AM_RANGE(0x0000, 0x1fff) AM_ROM
98   AM_RANGE(0x8000, 0x87ff) AM_RAM
10899   AM_RANGE(0x8800, 0x8800) AM_READ(aztarac_snd_command_r)
109   AM_RANGE(0x8c00, 0x8c01) AM_READ(AY8910_read_port_0_r)
110   AM_RANGE(0x8c02, 0x8c03) AM_READ(AY8910_read_port_1_r)
111   AM_RANGE(0x8c04, 0x8c05) AM_READ(AY8910_read_port_2_r)
112   AM_RANGE(0x8c06, 0x8c07) AM_READ(AY8910_read_port_3_r)
113   AM_RANGE(0x9000, 0x9000) AM_READ(aztarac_snd_status_r)
100   AM_RANGE(0x8c00, 0x8c00) AM_READWRITE(AY8910_read_port_0_r, AY8910_write_port_0_w)
101   AM_RANGE(0x8c01, 0x8c01) AM_READWRITE(AY8910_read_port_0_r, AY8910_control_port_0_w)
102   AM_RANGE(0x8c02, 0x8c02) AM_READWRITE(AY8910_read_port_1_r, AY8910_write_port_1_w)
103   AM_RANGE(0x8c03, 0x8c03) AM_READWRITE(AY8910_read_port_1_r, AY8910_control_port_1_w)
104   AM_RANGE(0x8c04, 0x8c04) AM_READWRITE(AY8910_read_port_2_r, AY8910_write_port_2_w)
105   AM_RANGE(0x8c05, 0x8c05) AM_READWRITE(AY8910_read_port_2_r, AY8910_control_port_2_w)
106   AM_RANGE(0x8c06, 0x8c06) AM_READWRITE(AY8910_read_port_3_r, AY8910_write_port_3_w)
107   AM_RANGE(0x8c07, 0x8c07) AM_READWRITE(AY8910_read_port_3_r, AY8910_control_port_3_w)
108   AM_RANGE(0x9000, 0x9000) AM_READWRITE(aztarac_snd_status_r, aztarac_snd_status_w)
114109ADDRESS_MAP_END
115110
116111
117static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
118   AM_RANGE(0x0000, 0x1fff) AM_WRITE(MWA8_ROM)
119   AM_RANGE(0x8000, 0x87ff) AM_WRITE(MWA8_RAM)
120   AM_RANGE(0x8c00, 0x8c00) AM_WRITE(AY8910_write_port_0_w)
121   AM_RANGE(0x8c01, 0x8c01) AM_WRITE(AY8910_control_port_0_w)
122   AM_RANGE(0x8c02, 0x8c02) AM_WRITE(AY8910_write_port_1_w)
123   AM_RANGE(0x8c03, 0x8c03) AM_WRITE(AY8910_control_port_1_w)
124   AM_RANGE(0x8c04, 0x8c04) AM_WRITE(AY8910_write_port_2_w)
125   AM_RANGE(0x8c05, 0x8c05) AM_WRITE(AY8910_control_port_2_w)
126   AM_RANGE(0x8c06, 0x8c06) AM_WRITE(AY8910_write_port_3_w)
127   AM_RANGE(0x8c07, 0x8c07) AM_WRITE(AY8910_control_port_3_w)
128   AM_RANGE(0x9000, 0x9000) AM_WRITE(aztarac_snd_status_w)
129ADDRESS_MAP_END
130112
131
132
133113/*************************************
134114 *
135115 *  Port definitions
r1771r1772
169149
170150   /* basic machine hardware */
171151   MDRV_CPU_ADD(M68000, 8000000)
172   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
152   MDRV_CPU_PROGRAM_MAP(main_map,0)
173153   MDRV_CPU_VBLANK_INT(irq4_line_hold,1)
174154
175155   MDRV_CPU_ADD(Z80, 2000000)
176   /* audio CPU */
177   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
156   MDRV_CPU_PROGRAM_MAP(sound_map,0)
178157   MDRV_CPU_PERIODIC_INT(aztarac_snd_timed_irq, 100)
179158
180159   MDRV_MACHINE_RESET(aztarac)
r1771r1772
186165   MDRV_SCREEN_SIZE(400, 300)
187166   MDRV_SCREEN_VISIBLE_AREA(0, 1024-1, 0, 768-1)
188167
189   MDRV_PALETTE_LENGTH(32768)
190
191168   MDRV_VIDEO_START(aztarac)
192169   MDRV_VIDEO_UPDATE(vector)
193170
src/mame/drivers/r2dtank.c
r1771r1772
338338
339339
340340static void update_row(running_machine *machine, mc6845_t *mc6845, mame_bitmap *bitmap, const rectangle *cliprect,
341                  UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, void *param)
341                  UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param)
342342{
343343   UINT8 cx;
344344
src/mame/drivers/ohmygod.c
r1771r1772
335335   MDRV_CPU_VBLANK_INT(irq1_line_hold,1)
336336
337337   MDRV_MACHINE_RESET(ohmygod)
338   MDRV_WATCHDOG_TIME_INIT(ATTOTIME_IN_SEC(3))   /* a guess, and certainly wrong */
338   MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_SEC(3))   /* a guess, and certainly wrong */
339339
340340   /* video hardware */
341341   MDRV_SCREEN_ADD("main", RASTER)
src/mame/drivers/madalien.c
r1771r1772
185185   MDRV_CPU_PERIODIC_INT(nmi_line_pulse, 800)    /* unknown due to incomplete schematics */
186186
187187   /* video hardware */
188   MDRV_IMPORT_FROM(madalien_video);
188   MDRV_IMPORT_FROM(madalien_video)
189189
190190   /* audio hardware */
191191   MDRV_SPEAKER_STANDARD_MONO("mono")
src/mame/drivers/aeroboto.c
r1771r1772
7373   if (data) disable_irq = 1;
7474}
7575
76static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
77   AM_RANGE(0x0000, 0x07ff) AM_READ(MRA8_RAM) // main RAM
78   AM_RANGE(0x0800, 0x08ff) AM_READ(MRA8_RAM) // tile color buffer; copied to 0x2000
79   AM_RANGE(0x1000, 0x17ff) AM_READ(MRA8_RAM) // tile RAM
80   AM_RANGE(0x1800, 0x183f) AM_READ(MRA8_RAM) // horizontal scroll regs
81   AM_RANGE(0x2000, 0x20ff) AM_READ(MRA8_RAM) // tile color RAM
82   AM_RANGE(0x2800, 0x28ff) AM_READ(MRA8_RAM) // sprite RAM
83   AM_RANGE(0x2973, 0x2973) AM_READ(aeroboto_2973_r) // protection read
84   AM_RANGE(0x3000, 0x3000) AM_READ(aeroboto_in0_r)
85   AM_RANGE(0x3001, 0x3001) AM_READ(input_port_2_r)
86   AM_RANGE(0x3002, 0x3002) AM_READ(input_port_3_r)
87   AM_RANGE(0x3004, 0x3004) AM_READ(aeroboto_201_r) // protection read
88   AM_RANGE(0x3800, 0x3800) AM_READ(MRA8_NOP) // watchdog or IRQ ack
89   AM_RANGE(0x4000, 0xffff) AM_READ(MRA8_ROM) // main ROM
90ADDRESS_MAP_END
91
92static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
76static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
9377   AM_RANGE(0x01a2, 0x01a2) AM_WRITE(aeroboto_1a2_w) // affects IRQ line (more protection?)
94   AM_RANGE(0x0000, 0x07ff) AM_WRITE(MWA8_RAM) AM_BASE(&aeroboto_mainram)
95   AM_RANGE(0x0800, 0x08ff) AM_WRITE(MWA8_RAM)
78   AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(&aeroboto_mainram) // main  RAM
79   AM_RANGE(0x0800, 0x08ff) AM_RAM // tile color buffer; copied to 0x2000
9680   AM_RANGE(0x0900, 0x09ff) AM_WRITE(MWA8_RAM) // a backup of default tile colors
97   AM_RANGE(0x1000, 0x17ff) AM_WRITE(aeroboto_videoram_w) AM_BASE(&aeroboto_videoram)
98   AM_RANGE(0x1800, 0x183f) AM_WRITE(MWA8_RAM) AM_BASE(&aeroboto_hscroll)
99   AM_RANGE(0x2000, 0x20ff) AM_WRITE(aeroboto_tilecolor_w) AM_BASE(&aeroboto_tilecolor)
81   AM_RANGE(0x1000, 0x17ff) AM_READWRITE(MRA8_RAM, aeroboto_videoram_w) AM_BASE(&aeroboto_videoram) // tile RAM
82   AM_RANGE(0x1800, 0x183f) AM_RAM AM_BASE(&aeroboto_hscroll) // horizontal scroll regs
83   AM_RANGE(0x2000, 0x20ff) AM_READWRITE(MRA8_RAM, aeroboto_tilecolor_w) AM_BASE(&aeroboto_tilecolor) // tile color RAM
10084   AM_RANGE(0x1840, 0x27ff) AM_WRITE(MWA8_NOP) // cleared during custom LSI test
101   AM_RANGE(0x2800, 0x28ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
85   AM_RANGE(0x2800, 0x28ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) // sprite RAM
10286   AM_RANGE(0x2900, 0x2fff) AM_WRITE(MWA8_NOP) // cleared along with sprite RAM
103   AM_RANGE(0x3000, 0x3000) AM_WRITE(aeroboto_3000_w)
104   AM_RANGE(0x3001, 0x3001) AM_WRITE(soundlatch_w)
105   AM_RANGE(0x3002, 0x3002) AM_WRITE(soundlatch2_w)
106   AM_RANGE(0x3003, 0x3003) AM_WRITE(MWA8_RAM) AM_BASE(&aeroboto_vscroll)
107   AM_RANGE(0x3004, 0x3004) AM_WRITE(MWA8_RAM) AM_BASE(&aeroboto_starx)
108   AM_RANGE(0x3005, 0x3005) AM_WRITE(MWA8_RAM) AM_BASE(&aeroboto_stary) // usable but probably wrong
109   AM_RANGE(0x3006, 0x3006) AM_WRITE(MWA8_RAM) AM_BASE(&aeroboto_bgcolor)
110   AM_RANGE(0x4000, 0xffff) AM_WRITE(MWA8_ROM)
87   AM_RANGE(0x2973, 0x2973) AM_READ(aeroboto_2973_r) // protection read
88   AM_RANGE(0x3000, 0x3000) AM_READWRITE(aeroboto_in0_r, aeroboto_3000_w)
89   AM_RANGE(0x3001, 0x3001) AM_READWRITE(input_port_2_r, soundlatch_w)
90   AM_RANGE(0x3002, 0x3002) AM_READWRITE(input_port_3_r, soundlatch2_w)
91   AM_RANGE(0x3003, 0x3003) AM_WRITEONLY AM_BASE(&aeroboto_vscroll)
92   AM_RANGE(0x3004, 0x3004) AM_READWRITE(aeroboto_201_r, MWA8_RAM) AM_BASE(&aeroboto_starx)
93   AM_RANGE(0x3005, 0x3005) AM_WRITEONLY AM_BASE(&aeroboto_stary) // usable but probably wrong
94   AM_RANGE(0x3006, 0x3006) AM_WRITEONLY AM_BASE(&aeroboto_bgcolor)
95   AM_RANGE(0x3800, 0x3800) AM_READNOP // watchdog or IRQ ack
96   AM_RANGE(0x4000, 0xffff) AM_ROM // main ROM
11197ADDRESS_MAP_END
11298
113static ADDRESS_MAP_START( readmem_sound, ADDRESS_SPACE_PROGRAM, 8 )
114   AM_RANGE(0x0000, 0x0fff) AM_READ(MRA8_RAM)
115   AM_RANGE(0x9002, 0x9002) AM_READ(AY8910_read_port_0_r)
116   AM_RANGE(0xa002, 0xa002) AM_READ(AY8910_read_port_1_r)
117   AM_RANGE(0xf000, 0xffff) AM_READ(MRA8_ROM)
118ADDRESS_MAP_END
119
120static ADDRESS_MAP_START( writemem_sound, ADDRESS_SPACE_PROGRAM, 8 )
121   AM_RANGE(0x0000, 0x0fff) AM_WRITE(MWA8_RAM)
99static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
100   AM_RANGE(0x0000, 0x0fff) AM_RAM
122101   AM_RANGE(0x9000, 0x9000) AM_WRITE(AY8910_control_port_0_w)
123102   AM_RANGE(0x9001, 0x9001) AM_WRITE(AY8910_write_port_0_w)
103   AM_RANGE(0x9002, 0x9002) AM_READ(AY8910_read_port_0_r)
124104   AM_RANGE(0xa000, 0xa000) AM_WRITE(AY8910_control_port_1_w)
125105   AM_RANGE(0xa001, 0xa001) AM_WRITE(AY8910_write_port_1_w)
126   AM_RANGE(0xf000, 0xffff) AM_WRITE(MWA8_ROM)
106   AM_RANGE(0xa002, 0xa002) AM_READ(AY8910_read_port_1_r)
107   AM_RANGE(0xf000, 0xffff) AM_ROM
127108ADDRESS_MAP_END
128109
129110
r1771r1772
247228
248229   /* basic machine hardware */
249230   MDRV_CPU_ADD(M6809, XTAL_10MHz/8) /* verified on pcb */
250   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
231   MDRV_CPU_PROGRAM_MAP(main_map,0)
251232   MDRV_CPU_VBLANK_INT(aeroboto_interrupt,1)
252233
253234   MDRV_CPU_ADD(M6809, XTAL_10MHz/16) /* verified on pcb */
254   /* audio CPU */
255   MDRV_CPU_PROGRAM_MAP(readmem_sound,writemem_sound)
235   MDRV_CPU_PROGRAM_MAP(sound_map,0)
256236   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
257237
258238   /* video hardware */
src/mame/drivers/amspdwy.c
r1771r1772
7272   cpunum_set_input_line(Machine, 1, INPUT_LINE_NMI, PULSE_LINE);
7373}
7474
75static ADDRESS_MAP_START( amspdwy_readmem, ADDRESS_SPACE_PROGRAM, 8 )
76   AM_RANGE(0x0000, 0x7fff) AM_READ(MRA8_ROM            )   // ROM
77//  AM_RANGE(0x8000, 0x801f) AM_READ(MRA8_RAM               )   // Palette
78   AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x0400) AM_READ(MRA8_RAM)   // Layer, mirrored?
79   AM_RANGE(0x9800, 0x9bff) AM_READ(MRA8_RAM         )   // Layer
80   AM_RANGE(0x9c00, 0x9fff) AM_READ(MRA8_RAM            )   // Unused?
81   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r      )   // DSW 1
82   AM_RANGE(0xa400, 0xa400) AM_READ(input_port_1_r      )   // DSW 2
83   AM_RANGE(0xa800, 0xa800) AM_READ(amspdwy_wheel_0_r      )   // Player 1
84   AM_RANGE(0xac00, 0xac00) AM_READ(amspdwy_wheel_1_r      )   // Player 2
85   AM_RANGE(0xb400, 0xb400) AM_READ(amspdwy_sound_r      )   // YM2151 Status + Buttons
86   AM_RANGE(0xc000, 0xc0ff) AM_READ(MRA8_RAM            )   // Sprites
87   AM_RANGE(0xe000, 0xe7ff) AM_READ(MRA8_RAM            )   // Work RAM
75static ADDRESS_MAP_START( amspdwy_map, ADDRESS_SPACE_PROGRAM, 8 )
76   AM_RANGE(0x0000, 0x7fff) AM_ROM                                    // ROM
77   AM_RANGE(0x8000, 0x801f) AM_WRITE(amspdwy_paletteram_w) AM_BASE(&paletteram)// Palette
78   AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x0400) AM_READWRITE(MRA8_RAM, amspdwy_videoram_w) AM_BASE(&videoram)   // Layer, mirrored?
79   AM_RANGE(0x9800, 0x9bff) AM_READWRITE(MRA8_RAM, amspdwy_colorram_w) AM_BASE(&colorram)   // Layer
80   AM_RANGE(0x9c00, 0x9fff) AM_RAM                                    // Unused?
81//  AM_RANGE(0xa000, 0xa000) AM_WRITENOP                                        // ?
82   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)                     // DSW 1
83   AM_RANGE(0xa400, 0xa400) AM_READWRITE(input_port_1_r, amspdwy_flipscreen_w)   // DSW 2 + Toggle Flip Screen?
84   AM_RANGE(0xa800, 0xa800) AM_READ(amspdwy_wheel_0_r)                     // Player 1
85   AM_RANGE(0xac00, 0xac00) AM_READ(amspdwy_wheel_1_r)                     // Player 2
86   AM_RANGE(0xb000, 0xb000) AM_WRITENOP                              // ? Exiting IRQ
87   AM_RANGE(0xb400, 0xb400) AM_READWRITE(amspdwy_sound_r, amspdwy_sound_w)      // YM2151 status, To Sound CPU
88   AM_RANGE(0xc000, 0xc0ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)// Sprites
89   AM_RANGE(0xe000, 0xe7ff) AM_RAM                                    // Work RAM
8890ADDRESS_MAP_END
8991
90static ADDRESS_MAP_START( amspdwy_writemem, ADDRESS_SPACE_PROGRAM, 8 )
91   AM_RANGE(0x0000, 0x7fff) AM_WRITE(MWA8_ROM                     )   // ROM
92   AM_RANGE(0x8000, 0x801f) AM_WRITE(amspdwy_paletteram_w) AM_BASE(&paletteram   )   // Palette
93   AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x0400) AM_WRITE(amspdwy_videoram_w) AM_BASE(&videoram)   // Layer, mirrored?
94   AM_RANGE(0x9800, 0x9bff) AM_WRITE(amspdwy_colorram_w) AM_BASE(&colorram      )   // Layer
95   AM_RANGE(0x9c00, 0x9fff) AM_WRITE(MWA8_RAM                     )   // Unused?
96//  AM_RANGE(0xa000, 0xa000) AM_WRITE(MWA8_NOP                          )   // ?
97   AM_RANGE(0xa400, 0xa400) AM_WRITE(amspdwy_flipscreen_w            )   // Toggle Flip Screen?
98   AM_RANGE(0xb000, 0xb000) AM_WRITE(MWA8_NOP                     )   // ? Exiting IRQ
99   AM_RANGE(0xb400, 0xb400) AM_WRITE(amspdwy_sound_w               )   // To Sound CPU
100   AM_RANGE(0xc000, 0xc0ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size   )   // Sprites
101   AM_RANGE(0xe000, 0xe7ff) AM_WRITE(MWA8_RAM                     )   // Work RAM
102ADDRESS_MAP_END
10392
104
10593static READ8_HANDLER( amspdwy_port_r )
10694{
10795   UINT8 *Tracks = memory_region(REGION_CPU1)+0x10000;
10896   return Tracks[offset];
10997}
11098
111static ADDRESS_MAP_START( amspdwy_readport, ADDRESS_SPACE_IO, 8 )
112   AM_RANGE(0x0000, 0x7fff) AM_READ(amspdwy_port_r   )
99static ADDRESS_MAP_START( amspdwy_portmap, ADDRESS_SPACE_IO, 8 )
100   AM_RANGE(0x0000, 0x7fff) AM_READ(amspdwy_port_r)
113101ADDRESS_MAP_END
114102
115103
r1771r1772
122110
123111***************************************************************************/
124112
125static ADDRESS_MAP_START( amspdwy_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
126   AM_RANGE(0x0000, 0x7fff) AM_READ(MRA8_ROM               )   // ROM
127   AM_RANGE(0x9000, 0x9000) AM_READ(soundlatch_r            )   // From Main CPU
128   AM_RANGE(0xc000, 0xdfff) AM_READ(MRA8_RAM               )   // Work RAM
129   AM_RANGE(0xffff, 0xffff) AM_READ(MRA8_NOP               )   // ??? IY = FFFF at the start ?
113static ADDRESS_MAP_START( amspdwy_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
114   AM_RANGE(0x0000, 0x7fff) AM_ROM                           // ROM
115//  AM_RANGE(0x8000, 0x8000) AM_WRITENOP                            // ? Written with 0 at the start
116   AM_RANGE(0x9000, 0x9000) AM_READ(soundlatch_r)               // From Main CPU
117   AM_RANGE(0xa000, 0xa000) AM_WRITE(YM2151_register_port_0_w)      // YM2151
118   AM_RANGE(0xa001, 0xa001) AM_WRITE(YM2151_data_port_0_w)         //
119   AM_RANGE(0xc000, 0xdfff) AM_RAM                           // Work RAM
120   AM_RANGE(0xffff, 0xffff) AM_READNOP                        // ??? IY = FFFF at the start ?
130121ADDRESS_MAP_END
131122
132static ADDRESS_MAP_START( amspdwy_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
133   AM_RANGE(0x0000, 0x7fff) AM_WRITE(MWA8_ROM               )   // ROM
134//  AM_RANGE(0x8000, 0x8000) AM_WRITE(MWA8_NOP                  )   // ? Written with 0 at the start
135   AM_RANGE(0xa000, 0xa000) AM_WRITE(YM2151_register_port_0_w   )   // YM2151
136   AM_RANGE(0xa001, 0xa001) AM_WRITE(YM2151_data_port_0_w      )   //
137   AM_RANGE(0xc000, 0xdfff) AM_WRITE(MWA8_RAM               )   // Work RAM
138ADDRESS_MAP_END
139123
140124
141125
142
143126/***************************************************************************
144127
145128
r1771r1772
272255
273256   /* basic machine hardware */
274257   MDRV_CPU_ADD(Z80,3000000)
275   MDRV_CPU_PROGRAM_MAP(amspdwy_readmem,amspdwy_writemem)
276   MDRV_CPU_IO_MAP(amspdwy_readport,0)
258   MDRV_CPU_PROGRAM_MAP(amspdwy_map,0)
259   MDRV_CPU_IO_MAP(amspdwy_portmap,0)
277260   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)   /* IRQ: 60Hz, NMI: retn */
278261
279262   MDRV_CPU_ADD(Z80,3000000)   /* Can't be disabled: the YM2151 timers must work */
280   MDRV_CPU_PROGRAM_MAP(amspdwy_sound_readmem,amspdwy_sound_writemem)
263   MDRV_CPU_PROGRAM_MAP(amspdwy_sound_map,0)
281264
282265   /* video hardware */
283266   MDRV_SCREEN_ADD("main", RASTER)
src/mame/drivers/fantland.c
r1771r1772
712712   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_BUTTON1 ) PORT_PLAYER(1)
713713   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_UNKNOWN   )
714714   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_UNKNOWN   )
715   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(wheelrun_wheel_r, 0)
715   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(wheelrun_wheel_r, (void *)0)
716716   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN   )
717717
718718   PORT_START   /* IN1 - 53001 */
r1771r1772
720720   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_BUTTON1 ) PORT_PLAYER(2)
721721   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_UNKNOWN   )
722722   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_UNKNOWN   )
723   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(wheelrun_wheel_r, 1)
723   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(wheelrun_wheel_r, (void *)1)
724724   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN   )
725725
726726   PORT_START   /* IN2 - 53002 */
src/mame/drivers/dominob.c
r1771r1772
5050
5151      sx = spriteram[offs];
5252      sy = 248 - spriteram[offs + 1];
53      if (flip_screen_x) sx = 248 - sx;
54      if (flip_screen_y) sy = 248 - sy;
53      if (flip_screen_x_get()) sx = 248 - sx;
54      if (flip_screen_y_get()) sy = 248 - sy;
5555
5656      code = spriteram[offs + 3] + ((spriteram[offs + 2] & 0x03) << 8)  ;
5757
5858      drawgfx(bitmap,machine->gfx[0],
5959            2 * code,
6060            ((spriteram[offs + 2] & 0xf8) >> 3)  ,
61            flip_screen_x,flip_screen_y,
62            sx,sy + (flip_screen_y ? 8 : -8),
61            flip_screen_x_get(),flip_screen_y_get(),
62            sx,sy + (flip_screen_y_get() ? 8 : -8),
6363            cliprect,TRANSPARENCY_PEN,0);
6464      drawgfx(bitmap,machine->gfx[0],
6565            2 * code + 1,
6666            ((spriteram[offs + 2] & 0xf8) >> 3)  ,
67            flip_screen_x,flip_screen_y,
67            flip_screen_x_get(),flip_screen_y_get(),
6868            sx,sy,
6969            cliprect,TRANSPARENCY_PEN,0);
7070   }
src/mame/drivers/bwidow.c
r1771r1772
696696   MDRV_SCREEN_SIZE(400, 300)
697697   MDRV_SCREEN_VISIBLE_AREA(0, 480, 0, 440)
698698
699   MDRV_PALETTE_LENGTH(32768)
700
701699   MDRV_VIDEO_START(avg)
702700   MDRV_VIDEO_UPDATE(vector)
703701
src/mame/drivers/funworld.c
r1771r1772
1414    * Jolly Card (austrian, encrypted),                 TAB-Austria,        1985.
1515    * Jolly Card (3x3 deal),                            TAB-Austria,        1985.
1616    * Jolly Card Professional 2.0,                      Spale-Soft,         2000.
17    * Jolly Card (croatian),                            Soft Design,        1993.
17    * Jolly Card (Evona Electronic),                    Evona Electronic    1998.
18    * Jolly Card (croatian, set 1),                     TAB-Austria,        1985.
19    * Jolly Card (croatian, set 2),                     Soft Design,        1993.
1820    * Jolly Card (italian, blue TAB board, encrypted),  bootleg,            199?.
21    * Super Joly 2000 - 3x,                             M.P.                1985.
1922    * Jolly Card (austrian, Funworld, bootleg),         Inter Games,        1986.
2023    * Big Deal (hungarian, set 1),                      Funworld,           1986.
2124    * Big Deal (hungarian, set 2),                      Funworld,           1986.
r1771r1772
3639    * Magic Card II (blue TAB board, encrypted),        Impera,             1996.
3740    * Royal Vegas Joker Card (slow deal),               Funworld,           1993.
3841    * Royal Vegas Joker Card (fast deal),               Soft Design,        1993.
42    * Royal Vegas Joker Card (fast deal, english gfx),  Soft Design,        1993.
43    * Jolly Joker,                                      Impera,             198?.
44    * Jolly Joker (50bet),                              Impera,             198?.
3945    * Joker Card (Ver.A267BC, encrypted),               Vesely Svet,        1993.
4046    * Mongolfier New (italian),                         bootleg,            199?.
4147    * Soccer New (italian),                             bootleg,            199?.
r1771r1772
182188
183189    Impera made 2 graphics sets for this game. One of them is encrypted, and meant for the TAB blue board.
184190    This board has two HY18CV85 (electrically-erasable PLD) that handle the encryption.
185    In another hand, the sound has some weir things.
191    In another hand, the sound has some weird things, but is confirmed that happen in the real thing.
186192
187193
194    - Jolly Joker (Impera, 50bet)
195
196    To boot this game for 1st time, DSW should be in the following position:
197    1=ON 2=OFF 3=ON 4=OFF 5=OFF 6=ON 7=ON 8=OFF
198
199    Press RESET (key F3) and then SERVICE1 & SERVICE2 (keys 9 & 0), then RESET (key F3).
200    When numbers start to fill the screen, press RESET (key F3) again to start the game.
201
202
188203    - Mongolfier New
189204    - Soccer New
190205
r1771r1772
782797    - Updated technical notes.
783798    - Cleaned up the driver.
784799
800    2008/02/22
801    - Switched the color decoding routines to use resnet code.
802    - Added complete color connections to/from 74ls373 to the source.
785803
804    2008/02/25
805    - Added new game: Royal Vegas Joker Card (fast deal, english gfx).
806    - Added new game: Jolly Joker.
807    - Added new game: Jolly Joker (50bet).
808    - Added new game: Jolly Card (croatian, set 2).
809    - Added new game: Jolly Card (Evona Electronic)
810    - Added new game: Super Joly 2000 - 3x
811    - Fixed some inputs.
812    - Masked inputs to allow jolyjkra to boot.
813    - Added minor corrections.
814    - Updated technical notes.
815
816
786817    *** TO DO ***
787818
788819    - Figure out the royalcdc, jokercrd and saloon encryption.
r1771r1772
13541385   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
13551386INPUT_PORTS_END
13561387
1388static INPUT_PORTS_START( jolyjkra )
1389   PORT_START_TAG("IN0")
1390   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE )   PORT_NAME("Remote") PORT_CODE(KEYCODE_Q)
1391   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )   PORT_NAME("Halten (Hold) 1") PORT_CODE(KEYCODE_Z)
1392   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON6 )   PORT_NAME("Loeschen (Cancel) / Kassieren (Take)") PORT_CODE(KEYCODE_N)
1393   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )      PORT_NAME("Geben (Start) / Gamble (Play)")
1394   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON5 )   PORT_NAME("Halten (Hold) 5 / Half Gamble") PORT_CODE(KEYCODE_B)
1395   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 )   PORT_NAME("Buchhalt (Service1)")
1396   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE2 )   PORT_NAME("Einstellen (Service2)")
1397   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 )   PORT_NAME("Halten (Hold) 4 / Hoch (High)") PORT_CODE(KEYCODE_V)
1398
1399   PORT_START_TAG("IN1")
1400   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 )   PORT_NAME("Halten (Hold) 2 / Tief (Low)") PORT_CODE(KEYCODE_X)
1401   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 )   PORT_NAME("Halten (Hold) 3") PORT_CODE(KEYCODE_C)
1402   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1403   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1404   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE )   PORT_NAME("Hoppersch") PORT_CODE(KEYCODE_W)
1405   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
1406   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1407   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON7 )   PORT_NAME("Abschreib (Payout)") PORT_CODE(KEYCODE_M)   // Payout? Need to check with hopper filled.
1408
1409   PORT_START_TAG("IN2")
1410   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1411   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
1412   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1413   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1414   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
1415   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
1416   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1417   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1418
1419   PORT_START_TAG("DSW")
1420   PORT_DIPNAME( 0x01, 0x01, "State" )            PORT_DIPLOCATION("SW1:8")
1421   PORT_DIPSETTING(    0x00, "Keyboard Test" )
1422   PORT_DIPSETTING(    0x01, "Play" )
1423   PORT_DIPNAME( 0x02, 0x00, "Remote" )         PORT_DIPLOCATION("SW1:7")
1424   PORT_DIPSETTING(    0x00, "10 Points/Pulse" )
1425   PORT_DIPSETTING(    0x02, "100 Points/Pulse" )
1426   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Coin_B ) )   PORT_DIPLOCATION("SW1:6")
1427   PORT_DIPSETTING(    0x00, "5 Points/Coin" )
1428   PORT_DIPSETTING(    0x04, "10 Points/Coin" )
1429   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Coin_A ) )   PORT_DIPLOCATION("SW1:5")
1430   PORT_DIPSETTING(    0x00, "5 Points/Coin" )
1431   PORT_DIPSETTING(    0x08, "10 Points/Coin" )
1432   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )   PORT_DIPLOCATION("SW1:4")
1433   PORT_DIPSETTING(    0x00, "disabled" )
1434   PORT_DIPSETTING(    0x10, "enabled" )
1435   PORT_DIPNAME( 0x20, 0x00, "Joker" )            PORT_DIPLOCATION("SW1:3")
1436   PORT_DIPSETTING(    0x00, "With Joker" )      // also enable Five of a Kind.
1437   PORT_DIPSETTING(    0x20, "Without Joker" )
1438   PORT_DIPNAME( 0x40, 0x40, "Hold" )            PORT_DIPLOCATION("SW1:2")
1439   PORT_DIPSETTING(    0x00, "Auto Hold" )
1440   PORT_DIPSETTING(    0x40, "No Auto Hold" )
1441
1442   /* after nvram init, set the following one to 'manual'
1443    to allow the remote credits mode to work */
1444
1445   PORT_DIPNAME( 0x80, 0x00, "Payout" )         PORT_DIPLOCATION("SW1:1")
1446   PORT_DIPSETTING(    0x00, "Hopper" )
1447   PORT_DIPSETTING(    0x80, "Manual Payout SW" )
1448INPUT_PORTS_END
1449
13571450static INPUT_PORTS_START( snookr10 )
13581451INPUT_PORTS_END
13591452
r1771r1772
16151708   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )
16161709ROM_END
16171710
1618ROM_START( jolycdcr )
1711ROM_START( jolycdev )   /* Jolly Card (lipa) from Evona */
16191712   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1713   ROM_LOAD( "lipa.bin", 0x8000, 0x8000, CRC(62657c98) SHA1(237466dde26540c119c631c75f51c87ea59d1a91) )
1714
1715   ROM_REGION( 0x10000, REGION_GFX1, ROMREGION_DISPOSE )
1716   ROM_LOAD( "jollyb.bin", 0x0000, 0x8000, CRC(c512b103) SHA1(1f4e78e97855afaf0332fb75e1b5571aafd01c29) )
1717   ROM_LOAD( "jollya.bin", 0x8000, 0x8000, CRC(0f24f39d) SHA1(ac1f6a8a4a2a37cbc0d45c15187b33c25371bffb) )
1718
1719   ROM_REGION( 0x0200, REGION_PROMS, 0 )
1720   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )
1721
1722   ROM_REGION( 0x0200, REGION_PLDS, 0 )
1723   ROM_LOAD( "gal16v8uni.bin", 0x0000, 0x0117, CRC(b81d7e0a) SHA1(7fef0b2bcea931a830d38ae0f1102434cf281d2d) )
1724ROM_END
1725
1726ROM_START( jolyccra )   /* Jolly Card (croatian, set 1) */
1727   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1728   ROM_LOAD( "jollyc.bin", 0x8000, 0x8000, CRC(8926d99d) SHA1(dd5d1ac03d30d823dfcfe1349328ecb7afbc37fa) )
1729
1730   ROM_REGION( 0x10000, REGION_GFX1, ROMREGION_DISPOSE )
1731   ROM_LOAD( "jollyb.bin", 0x0000, 0x8000, CRC(c512b103) SHA1(1f4e78e97855afaf0332fb75e1b5571aafd01c29) )
1732   ROM_LOAD( "jollya.bin", 0x8000, 0x8000, CRC(0f24f39d) SHA1(ac1f6a8a4a2a37cbc0d45c15187b33c25371bffb) )
1733
1734   ROM_REGION( 0x0200, REGION_PROMS, 0 )
1735   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )
1736ROM_END
1737
1738ROM_START( jolyccrb )   /* Jolly Card (croatian, set 2) */
1739   ROM_REGION( 0x10000, REGION_CPU1, 0 )
16201740   ROM_LOAD( "jollypkr.003", 0x8000, 0x8000, CRC(ea7340b4) SHA1(7dd468f28a488a4781521809d06db1d7917048ad) )
16211741
16221742   ROM_REGION( 0x10000, REGION_GFX1, ROMREGION_DISPOSE )
r1771r1772
16421762   ROM_LOAD( "gal16v8b.bin", 0x0000, 0x0117, CRC(3ad712b1) SHA1(54214841fb178e4b59bf6051522718f7667bad28) )
16431763ROM_END
16441764
1765ROM_START( sjcd2kx3 )   /* Super Joly 2000 3x */
1766   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1767   ROM_LOAD( "sj3.bin", 0x8000, 0x8000, CRC(c530b518) SHA1(36934d8e1e2cb2f71eb44a05b86ec970c9f398cd) )
1768
1769   ROM_REGION( 0x10000, REGION_GFX1, ROMREGION_DISPOSE )
1770   ROM_LOAD( "sj2.bin", 0x0000, 0x8000, CRC(d7253325) SHA1(ad40e662519da9b11f77690b7d41c5007f74e280) )
1771   ROM_LOAD( "sj1.bin", 0x8000, 0x8000, CRC(82741749) SHA1(d0bf3073dff9ba1c4913fd754f965951e9cb5b03) )
1772
1773   ROM_REGION( 0x0200, REGION_PROMS, 0 )
1774   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )
1775
1776   ROM_REGION( 0x0200, REGION_PLDS, 0 )
1777   ROM_LOAD( "gal16v8uni.bin", 0x0000, 0x0117, CRC(b81d7e0a) SHA1(7fef0b2bcea931a830d38ae0f1102434cf281d2d) )
1778ROM_END
1779
16451780ROM_START( jolycdab )
16461781   ROM_REGION( 0x10000, REGION_CPU1, 0 )   // program is testing/writting RAM in offset $8800-$BFFF (ROM)...??
16471782   ROM_LOAD( "ig1poker.run", 0x8000, 0x8000, CRC(c96e6542) SHA1(ed6c0cf9fe8597dba9149b2225320d8d9c39219a) )
r1771r1772
19442079   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )
19452080ROM_END
19462081
2082ROM_START( vegasfte )   /* Royal Vegas Joker Card (fast deal, english gfx) */
2083   ROM_REGION( 0x10000, REGION_CPU1, 0 )
2084   ROM_LOAD( "ch3.bin", 0x8000, 0x8000, CRC(87dfb28d) SHA1(9a06e695e59722b6c97e5a9fd2c8b238661e5a4a) )
2085
2086   ROM_REGION( 0x10000, REGION_GFX1, ROMREGION_DISPOSE )
2087   ROM_LOAD( "ch2.bin", 0x0000, 0x8000, CRC(af7ab460) SHA1(01ea400424152c09c10eb83a1bd569019969ccb7) )
2088   ROM_LOAD( "ch1.bin", 0x8000, 0x8000, CRC(0a3679c0) SHA1(ce8a067e1a2eccf9fabb16733ef3a14e0e8129e5) )   /* X & Y in txt layer */
2089
2090   ROM_REGION( 0x0200, REGION_PROMS, 0 )
2091   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )
2092ROM_END
2093
2094ROM_START( jolyjokr )   /* Jolly Joker (Impera, original) */
2095   ROM_REGION( 0x10000, REGION_CPU1, 0 )
2096   ROM_LOAD( "impera3orig.bin", 0x8000, 0x8000, CRC(ceb3a0d5) SHA1(25efae9f225abddfa663e6abcc91801996e5b0ea) )
2097
2098   ROM_REGION( 0x10000, REGION_GFX1, ROMREGION_DISPOSE )
2099   ROM_LOAD( "impera2.bin", 0x0000, 0x8000, BAD_DUMP CRC(57c1ca04) SHA1(9d3e1f50795ebe5997532b67ba467fd6428e81d2) )
2100   ROM_LOAD( "impera1.bin", 0x8000, 0x8000, CRC(8e354c4a) SHA1(95d7edf83bb07b5c58312af6d8a7dff1cf87cba7) )
2101
2102   ROM_REGION( 0x0200, REGION_PROMS, 0 )
2103   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )
2104ROM_END
2105
2106ROM_START( jolyjkra )   /* Jolly Joker (Impera, 50bet) */
2107   ROM_REGION( 0x10000, REGION_CPU1, 0 )
2108   ROM_LOAD( "impera50.bin", 0x8000, 0x8000, CRC(7effc044) SHA1(961438e7fb8222296fb959b510cdf646e4ac3226) )
2109
2110   ROM_REGION( 0x10000, REGION_GFX1, ROMREGION_DISPOSE )
2111   ROM_LOAD( "impera2.bin", 0x0000, 0x8000, BAD_DUMP CRC(57c1ca04) SHA1(9d3e1f50795ebe5997532b67ba467fd6428e81d2) )
2112   ROM_LOAD( "impera1.bin", 0x8000, 0x8000, CRC(8e354c4a) SHA1(95d7edf83bb07b5c58312af6d8a7dff1cf87cba7) )
2113
2114   ROM_REGION( 0x0200, REGION_PROMS, 0 )
2115   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )
2116ROM_END
2117
19472118ROM_START( jokercrd )
19482119/*  (Multi) Joker Card from Vesely Svet (Sprightly World). Czech poker game.
19492120    Program roms seems encrypted. Custom Funworld CPU based on 6502 family.
r1771r1772
20342205ROM_END
20352206
20362207
2208
2209
20372210/**************************
20382211*  Driver Initialization  *
20392212**************************/
r1771r1772
21742347GAME( 1985, jolycdae, jollycrd, funworld, funworld, jolycdae, ROT0, "TAB-Austria",     "Jolly Card (austrian, encrypted)",                0 )
21752348GAME( 1985, jolyc3x3, jollycrd, funworld, funworld, funworld, ROT0, "TAB-Austria",     "Jolly Card (3x3 deal)",                           0 )
21762349GAME( 2000, jolyc980, jollycrd, cuoreuno, funworld, funworld, ROT0, "Spale-Soft",      "Jolly Card Professional 2.0",                     0 )
2177GAME( 1993, jolycdcr, jollycrd, cuoreuno, jolycdcr, funworld, ROT0, "Soft Design",     "Jolly Card (croatian)",                           0 )
2350GAME( 1998, jolycdev, jollycrd, funworld, funworld, funworld, ROT0, "TAB/Evona",       "Jolly Card (Evona Electronic)",                   0 )
2351GAME( 1985, jolyccra, jollycrd, cuoreuno, jolycdcr, funworld, ROT0, "TAB-Austria",     "Jolly Card (croatian, set 1)",                    0 )
2352GAME( 1993, jolyccrb, jollycrd, cuoreuno, jolycdcr, funworld, ROT0, "Soft Design",     "Jolly Card (croatian, set 2)",                    0 )
21782353GAME( 199?, jolycdit, jollycrd, cuoreuno, jolycdit, tabblue,  ROT0, "bootleg",         "Jolly Card (italian, blue TAB board, encrypted)", 0 )
2354GAME( 1985, sjcd2kx3, jollycrd, funworld, funworld, funworld, ROT0, "M.P.",            "Super Joly 2000 - 3x",                            0 )
21792355GAME( 1986, jolycdab, jollycrd, funworld, funworld, funworld, ROT0, "Inter Games",     "Jolly Card (austrian, Funworld, bootleg)",        GAME_NOT_WORKING )
21802356GAME( 1986, bigdeal,  0,        bigdeal,  bigdeal,  funworld, ROT0, "Funworld",        "Big Deal (hungarian, set 1)",                     GAME_IMPERFECT_COLORS )
21812357GAME( 1986, bigdealb, bigdeal,  bigdeal,  bigdeal,  funworld, ROT0, "Funworld",        "Big Deal (hungarian, set 2)",                     GAME_IMPERFECT_COLORS )
r1771r1772
21962372GAME( 1996, magiccdb, magiccrd, magiccrd, magiccrd, tabblue,  ROT0, "Impera",          "Magic Card II (blue TAB board, encrypted)",       GAME_NOT_WORKING )
21972373GAME( 1993, vegasslw, 0,        funworld, funworld, funworld, ROT0, "Funworld",        "Royal Vegas Joker Card (slow deal)",              0 )
21982374GAME( 1993, vegasfst, vegasslw, funworld, funworld, funworld, ROT0, "Soft Design",     "Royal Vegas Joker Card (fast deal)",              0 )
2375GAME( 1993, vegasfte, vegasslw, funworld, funworld, funworld, ROT0, "Soft Design",     "Royal Vegas Joker Card (fast deal, english gfx)", 0 )
2376GAME( 198?, jolyjokr, 0,        funworld, funworld, funworld, ROT0, "Impera",          "Jolly Joker",                                     0 )
2377GAME( 198?, jolyjkra, jolyjokr, funworld, jolyjkra, funworld, ROT0, "Impera",          "Jolly Joker (50bet)",                             0 )
21992378GAME( 1993, jokercrd, 0,        funworld, funworld, funworld, ROT0, "Vesely Svet",     "Joker Card (Ver.A267BC, encrypted)",              GAME_WRONG_COLORS | GAME_NOT_WORKING )
22002379GAME( 199?, mongolnw, 0,        royalmcu, royalcrd, funworld, ROT0, "bootleg",         "Mongolfier New (italian)",                        GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
22012380GAME( 199?, soccernw, 0,        royalcrd, royalcrd, soccernw, ROT0, "bootleg",         "Soccer New (italian)",                            GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
src/mame/drivers/atarifb.c
r1771r1772
248248   PORT_BIT ( 0x80, IP_ACTIVE_LOW,  IPT_COIN1 )
249249
250250   PORT_START_TAG("IN1")
251   PORT_DIPNAME( 0x03, 0x00, "Time per coin" )
251   PORT_DIPNAME( 0x03, 0x00, "Time Per Coin" )      PORT_DIPLOCATION("K10:1,2")
252252   PORT_DIPSETTING(   0x00, "1:30" )
253253   PORT_DIPSETTING(   0x01, "2:00" )
254254   PORT_DIPSETTING(   0x02, "2:30" )
255255   PORT_DIPSETTING(   0x03, "3:00" )
256   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
257   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
258   PORT_DIPSETTING(   0x04, DEF_STR( On ) )
259   PORT_DIPNAME( 0x08, 0x00, "Atari logo" )
256   PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "K10:3" )   /* Listed as "Unused" */
257   PORT_DIPNAME( 0x08, 0x00, "Atari Logo" )      PORT_DIPLOCATION("K10:4") /* Listed as "Unused" */
260258   PORT_DIPSETTING(   0x08, DEF_STR( Off ) )
261259   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
262260   PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
r1771r1772
295293   PORT_BIT ( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
296294
297295   PORT_START_TAG("IN2")
298   PORT_DIPNAME( 0x03, 0x00, "Time per coin" )
296   PORT_DIPNAME( 0x03, 0x00, "Time Per Coin" )      PORT_DIPLOCATION("K10:1,2")
299297   PORT_DIPSETTING(   0x00, "1:30" )
300298   PORT_DIPSETTING(   0x01, "2:00" )
301299   PORT_DIPSETTING(   0x02, "2:30" )
302300   PORT_DIPSETTING(   0x03, "3:00" )
303   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
304   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
305   PORT_DIPSETTING(   0x04, DEF_STR( On ) )
306   PORT_DIPNAME( 0x08, 0x00, "Atari logo" )
301   PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "K10:3" )   /* Listed as "Unused" */
302   PORT_DIPNAME( 0x08, 0x00, "Atari Logo" )      PORT_DIPLOCATION("K10:4") /* Listed as "Unused" */
307303   PORT_DIPSETTING(   0x08, DEF_STR( Off ) )
308304   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
309305   PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_START1 )
r1771r1772
354350   PORT_BIT ( 0x80, IP_ACTIVE_LOW,  IPT_COIN1 )
355351
356352   PORT_START_TAG("IN1")
357   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Difficulty ) )
353   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("K10:1,2")
358354   PORT_DIPSETTING(   0x00, DEF_STR( Hardest ) )
359355   PORT_DIPSETTING(   0x01, DEF_STR( Hard ) )
360   PORT_DIPSETTING(   0x02, "Fair" )
361   PORT_DIPSETTING(   0x03, DEF_STR( Easy ) )
362   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
363   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
364   PORT_DIPSETTING(   0x04, DEF_STR( On ) )
365   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
366   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
367   PORT_DIPSETTING(   0x08, DEF_STR( On ) )
356   PORT_DIPSETTING(   0x02, DEF_STR( Easy ) )
357   PORT_DIPSETTING(   0x03, DEF_STR( Easiest ) )
358   PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "K10:3" )      /* Listed as "Unused" */
359   PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "K10:4" )      /* Listed as "Unused" */
368360   PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
369361   PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
370362   PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
r1771r1772
403395   PORT_BIT ( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
404396
405397   PORT_START_TAG("IN2")
406   PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("2/4 Player Toggle")
407   PORT_DIPNAME( 0x02, 0x00, "Rule Switch" )
398   PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("2/4 Player Toggle") PORT_DIPLOCATION("SW2:4") /* Listed as "Unused" */
399   PORT_DIPNAME( 0x02, 0x00, "Rule Switch" )      PORT_DIPLOCATION("SW2:3") /* Listed as "Unused" */
408400   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
409401   PORT_DIPSETTING(   0x02, DEF_STR( On ) )
410   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Language ) )
402   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Language ) )   PORT_DIPLOCATION("SW2:1,2")
411403   PORT_DIPSETTING(   0x00, DEF_STR( English ) )
412404   PORT_DIPSETTING(   0x04, DEF_STR( German ) )
413405   PORT_DIPSETTING(   0x08, DEF_STR( French ) )
r1771r1772
450442   /* The lower 4 bits are the input */
451443
452444   PORT_START_TAG("IN11")
453   PORT_DIPNAME( 0x07, 0x00, "Time per coin" )
445   PORT_DIPNAME( 0x07, 0x00, "Time per coin" )      PORT_DIPLOCATION("SW1:1,2,3")
454446   PORT_DIPSETTING(   0x00, "1:00" )
455447   PORT_DIPSETTING(   0x01, "1:20" )
456448   PORT_DIPSETTING(   0x02, "1:40" )
r1771r1772
459451   PORT_DIPSETTING(   0x05, "3:00" )
460452   PORT_DIPSETTING(   0x06, "3:30" )
461453   PORT_DIPSETTING(   0x07, "4:00" )
462   PORT_DIPNAME( 0x18, 0x00, DEF_STR( Coin_B ) )
454   PORT_DIPNAME( 0x18, 0x00, DEF_STR( Coin_B ) )   PORT_DIPLOCATION("SW1:4,5")
463455   PORT_DIPSETTING(   0x00, DEF_STR( 1C_1C ) )
464456   PORT_DIPSETTING(   0x08, DEF_STR( 1C_4C ) )
465457   PORT_DIPSETTING(   0x10, DEF_STR( 1C_5C ) )
466458   PORT_DIPSETTING(   0x18, DEF_STR( 1C_6C ) )
467   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Coin_A ) )
459   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Coin_A ) )   PORT_DIPLOCATION("SW1:6")
468460   PORT_DIPSETTING(   0x00, DEF_STR( 1C_1C ) )
469461   PORT_DIPSETTING(   0x20, DEF_STR( 1C_2C ) )
470   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Coinage ) )
462   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Coinage ) )   PORT_DIPLOCATION("SW1:7")
471463   PORT_DIPSETTING(   0x00, "1 Coin Minimum" )
472464   PORT_DIPSETTING(   0x40, "2 Coin Minimum" )
473   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused on schematics */
465   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW1:8" )   /* Listed as "Unused" */
474466INPUT_PORTS_END
475467
476468
r1771r1772
607599
608600   /* basic machine hardware */
609601   MDRV_IMPORT_FROM(atarifb)
602   MDRV_CPU_MODIFY("main")
610603   MDRV_CPU_PROGRAM_MAP(abaseb_map,0)
611604
612605   /* video hardware */
src/mame/drivers/olibochu.c
r1771r1772
6767
6868static WRITE8_HANDLER( olibochu_flipscreen_w )
6969{
70   if (flip_screen != (data & 0x80))
70   if (flip_screen_get() != (data & 0x80))
7171   {
7272      flip_screen_set(data & 0x80);
7373      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
r1771r1772
108108      int sx = spriteram[offs+3];
109109      int sy = ((spriteram[offs+2] + 8) & 0xff) - 8;
110110
111      if (flip_screen)
111      if (flip_screen_get())
112112      {
113113         sx = 240 - sx;
114114         sy = 240 - sy;
r1771r1772
136136      int sx = spriteram_2[offs+3];
137137      int sy = spriteram_2[offs+2];
138138
139      if (flip_screen)
139      if (flip_screen_get())
140140      {
141141         sx = 248 - sx;
142142         sy = 248 - sy;
src/mame/drivers/ultratnk.c
r1771r1772
193193
194194   PORT_START_TAG("COLLISION")
195195   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
196   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM( get_collision, 0 )
196   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM( get_collision, (void *)0 )
197197   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
198   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM( get_collision, 1 )
198   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM( get_collision, (void *)1 )
199199   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) /* VCC */
200   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM( get_collision, 2 )
200   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM( get_collision, (void *)2 )
201201   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_TILT )   /* SLAM */
202   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM( get_collision, 3 )
202   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM( get_collision, (void *)3 )
203203
204204   PORT_START_TAG("COIN")
205205   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
src/mame/drivers/lockon.c
r1771r1772
486486   MDRV_CPU_PROGRAM_MAP(sound_prg, 0)
487487   MDRV_CPU_IO_MAP(sound_io, 0)
488488
489   MDRV_WATCHDOG_TIME_INIT(attotime_mul(PERIOD_OF_555_ASTABLE(10000, 4700, 10000e-12), 4096))
489   MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_NSEC(PERIOD_OF_555_ASTABLE_NSEC(10000, 4700, 10000e-12) * 4096))
490490   MDRV_INTERLEAVE(10)
491491
492492   MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
src/mame/drivers/wilytowr.c
r1771r1772
122122
123123static WRITE8_HANDLER( wilytwr_flipscreen_w )
124124{
125   if (flip_screen != (~data & 0x01))
125   if (flip_screen_get() != (~data & 0x01))
126126   {
127127      flip_screen_set(~data & 0x01);
128128      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
r1771r1772
132132static WRITE8_HANDLER( fghtbskt_flipscreen_w )
133133{
134134   flip_screen_set(data);
135   fg_flag = flip_screen ? TILE_FLIPX : 0;
135   fg_flag = flip_screen_get() ? TILE_FLIPX : 0;
136136}
137137
138138
r1771r1772
179179      int sx = spriteram[offs + 3];
180180      int sy = sy_offset - spriteram[offs];
181181
182      if (flip_screen)
182      if (flip_screen_get())
183183      {
184184         sx = 240 - sx;
185185         sy = sy_offset - sy;
src/mame/drivers/looping.c
r1771r1772
192192{
193193   looping_state *state = Machine->driver_data;
194194   flip_screen_x_set(~data & 0x01);
195   tilemap_set_scrollx(state->bg_tilemap, 0, flip_screen ? 128 : 0);
195   tilemap_set_scrollx(state->bg_tilemap, 0, flip_screen_get() ? 128 : 0);
196196}
197197
198198
r1771r1772
200200{
201201   looping_state *state = Machine->driver_data;
202202   flip_screen_y_set(~data & 0x01);
203   tilemap_set_scrollx(state->bg_tilemap, 0, flip_screen ? 128 : 0);
203   tilemap_set_scrollx(state->bg_tilemap, 0, flip_screen_get() ? 128 : 0);
204204}
205205
206206
r1771r1772
255255      int code  = source[1] & 0x3f;
256256      int color = source[2];
257257
258      if (flip_screen_x)
258      if (flip_screen_x_get())
259259      {
260260         sx = 240 - sx;
261261         flipx = !flipx;
262262      }
263263
264      if (flip_screen_y)
264      if (flip_screen_y_get())
265265      {
266266         sy = 240 - sy;
267267         flipy = !flipy;
src/mame/drivers/1945kiii.c
r1771r1772
129129
130130
131131
132static ADDRESS_MAP_START( k3_readmem, ADDRESS_SPACE_PROGRAM, 16 )
133   AM_RANGE(0x000000, 0x0fffff) AM_READ(MRA16_ROM)
134   AM_RANGE(0x100000, 0x10ffff) AM_READ(MRA16_RAM)
135   AM_RANGE(0x200000, 0x200fff) AM_READ(MRA16_RAM)
136   AM_RANGE(0x240000, 0x240fff) AM_READ(MRA16_RAM)
137   AM_RANGE(0x280000, 0x280fff) AM_READ(MRA16_RAM)
138   AM_RANGE(0x2c0000, 0x2c0fff) AM_READ(MRA16_RAM)
139   AM_RANGE(0x400000, 0x400001) AM_READ(input_port_0_word_r)
140   AM_RANGE(0x440000, 0x440001) AM_READ(input_port_1_word_r)
141   AM_RANGE(0x480000, 0x480001) AM_READ(input_port_2_word_r)
142   AM_RANGE(0x4c0000, 0x4c0001) AM_READ(OKIM6295_status_1_msb_r)
143   AM_RANGE(0x500000, 0x500001) AM_READ(OKIM6295_status_0_msb_r)
144   AM_RANGE(0x8c0000, 0x8cffff) AM_READ(MRA16_RAM)// not used?
145ADDRESS_MAP_END
146
147static ADDRESS_MAP_START( k3_writemem, ADDRESS_SPACE_PROGRAM, 16 )
132static ADDRESS_MAP_START( k3_map, ADDRESS_SPACE_PROGRAM, 16 )
148133   AM_RANGE(0x0009CE, 0x0009CF) AM_WRITE(MWA16_NOP) // bug in code? (clean up log)
149134   AM_RANGE(0x0009D2, 0x0009D3) AM_WRITE(MWA16_NOP) // bug in code? (clean up log)
150135
151   AM_RANGE(0x000000, 0x0fffff) AM_WRITE(MWA16_ROM) // ROM
152   AM_RANGE(0x100000, 0x10ffff) AM_WRITE(MWA16_RAM) // Main Ram
153   AM_RANGE(0x200000, 0x200fff) AM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16) // palette
154   AM_RANGE(0x240000, 0x240fff) AM_WRITE(MWA16_RAM) AM_BASE(&k3_spriteram_1)
155   AM_RANGE(0x280000, 0x280fff) AM_WRITE(MWA16_RAM) AM_BASE(&k3_spriteram_2)
156   AM_RANGE(0x2c0000, 0x2c0fff) AM_WRITE(k3_bgram_w) AM_BASE(&k3_bgram)
136   AM_RANGE(0x000000, 0x0fffff) AM_ROM // ROM
137   AM_RANGE(0x100000, 0x10ffff) AM_RAM // Main Ram
138   AM_RANGE(0x200000, 0x200fff) AM_READWRITE(MRA16_RAM, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16) // palette
139   AM_RANGE(0x240000, 0x240fff) AM_RAM AM_BASE(&k3_spriteram_1)
140   AM_RANGE(0x280000, 0x280fff) AM_RAM AM_BASE(&k3_spriteram_2)
141   AM_RANGE(0x2c0000, 0x2c0fff) AM_READWRITE(MRA16_RAM, k3_bgram_w) AM_BASE(&k3_bgram)
157142   AM_RANGE(0x340000, 0x340001) AM_WRITE(k3_scrollx_w)
158143   AM_RANGE(0x380000, 0x380001) AM_WRITE(k3_scrolly_w)
159144   AM_RANGE(0x3c0000, 0x3c0001) AM_WRITE(k3_soundbanks_w)
160   AM_RANGE(0x4c0000, 0x4c0001) AM_WRITE(OKIM6295_data_1_msb_w)
161   AM_RANGE(0x500000, 0x500001) AM_WRITE(OKIM6295_data_0_msb_w)
162   AM_RANGE(0x8c0000, 0x8cffff) AM_WRITE(MWA16_RAM) // not used?
145   AM_RANGE(0x400000, 0x400001) AM_READ(input_port_0_word_r)
146   AM_RANGE(0x440000, 0x440001) AM_READ(input_port_1_word_r)
147   AM_RANGE(0x480000, 0x480001) AM_READ(input_port_2_word_r)
148   AM_RANGE(0x4c0000, 0x4c0001) AM_READWRITE(OKIM6295_status_1_msb_r, OKIM6295_data_1_msb_w)
149   AM_RANGE(0x500000, 0x500001) AM_READWRITE(OKIM6295_status_0_msb_r, OKIM6295_data_0_msb_w)
150   AM_RANGE(0x8c0000, 0x8cffff) AM_RAM // not used?
163151ADDRESS_MAP_END
164152
165153static INPUT_PORTS_START( k3 )
r1771r1772
257245
258246static MACHINE_DRIVER_START( k3 )
259247   MDRV_CPU_ADD(M68000, 16000000)
260   MDRV_CPU_PROGRAM_MAP(k3_readmem,k3_writemem)
248   MDRV_CPU_PROGRAM_MAP(k3_map,0)
261249   MDRV_CPU_VBLANK_INT(irq4_line_hold,1)
262250
263251   MDRV_GFXDECODE(1945kiii)
src/mame/drivers/astinvad.c
r1771r1772
1111Space Intruder emulation by Lee Taylor (lee@defender.demon.co.uk),
1212    December 1998.
1313
14DIP locations verified for:
15    - astinvad (manual)
16
1417***************************************************************************/
1518
1619#include "driver.h"
r1771r1772
393396   PORT_INCLUDE(kamikaze)
394397
395398   PORT_MODIFY("IN1")
396   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Lives ) )
399   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Lives ) )      PORT_DIPLOCATION("SW:2")
397400   PORT_DIPSETTING(    0x00, "3" )
398401   PORT_DIPSETTING(    0x01, "4" )
399   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Bonus_Life ) )
402   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SW:1")
400403   PORT_DIPSETTING(    0x02, "10000" )
401404   PORT_DIPSETTING(    0x00, "20000" )
402405   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
403   PORT_DIPNAME( 0x88, 0x00, DEF_STR( Coinage ) )
406   PORT_DIPNAME( 0x88, 0x00, DEF_STR( Coinage ) )      PORT_DIPLOCATION("SW:3,4")
404407   PORT_DIPSETTING(    0x88, DEF_STR( 3C_1C ) )
405408   PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
406409   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
src/mame/drivers/neodrvr.c
r1771r1772
29002900   ROM_LOAD16_BYTE( "095-c8.bin", 0x1800001, 0x200000, CRC(4e6beb6c) SHA1(c0ac7cfc832ace6ad52c58f5da3a8101baead749) ) /* Plane 2,3 */
29012901ROM_END
29022902
2903ROM_START( rbff1a ) /* MVS VERSION */
2904   ROM_REGION( 0x300000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
29032905
2906        /* This is a bug fixed revision applied over the original cart. The original P1 and P2 stayed in the cart and this */
2907   /* 512k ROM was added to replace the first 512k of P1. */
2908
2909   ROM_LOAD16_WORD_SWAP( "095-p1.bin",  0x000000, 0x100000, CRC(63b4d8ae) SHA1(03aa9f6bab6aee685d1b57a52823797704eea845) )
2910   ROM_LOAD16_WORD_SWAP( "095-p2.bin",  0x100000, 0x200000, CRC(cc15826e) SHA1(44d6ac6c0ca697a6f367dcfd809b1e1771cb0635) )
2911   ROM_LOAD16_WORD_SWAP( "095-ep1.bin", 0x000000, 0x080000, CRC(be0060a3) SHA1(fa741d34898ad5004a23e280139d1446f1a082c7) )
2912
2913   NEO_SFIX_128K( "095-s1.bin", CRC(b6bf5e08) SHA1(b527355c35ea097f3448676f2ffa65b8e56ae30c) )
2914
2915   NEO_BIOS_AUDIO_128K( "095-m1.bin", CRC(653492a7) SHA1(39e511fb9ed5d2135dc8428a31d0baafb2ab36e0) )
2916
2917   ROM_REGION( 0xc00000, NEOGEO_REGION_AUDIO_DATA_1, 0 )
2918   ROM_LOAD( "069-v1.bin", 0x000000, 0x400000, CRC(2bdbd4db) SHA1(5f4fecf69c2329d699cbd45829c19303b1e2a80e) )
2919   ROM_LOAD( "069-v2.bin", 0x400000, 0x400000, CRC(a698a487) SHA1(11b8bc53bc26a51f4a408e900e3769958625c4ed) )
2920   ROM_LOAD( "095-v3.bin", 0x800000, 0x400000, CRC(189d1c6c) SHA1(f0b8cd1ee40ea3feeb2800f0723b451ec8240203) )
2921
2922   NO_DELTAT_REGION
2923
2924   ROM_REGION( 0x1c00000, NEOGEO_REGION_SPRITES, ROMREGION_DISPOSE )
2925   ROM_LOAD16_BYTE( "069-c1.bin", 0x0000000, 0x400000, CRC(e302f93c) SHA1(d8610b14900b2b8fe691b67ca9b1abb335dbff74) ) /* Plane 0,1 */
2926   ROM_LOAD16_BYTE( "069-c2.bin", 0x0000001, 0x400000, CRC(1053a455) SHA1(69501bfac68739e63d798045b812badd251d57b8) ) /* Plane 2,3 */
2927   ROM_LOAD16_BYTE( "069-c3.bin", 0x0800000, 0x400000, CRC(1c0fde2f) SHA1(cf6c2ef56c03a861de3b0b6dc0d7c9204d947f9d) ) /* Plane 0,1 */
2928   ROM_LOAD16_BYTE( "069-c4.bin", 0x0800001, 0x400000, CRC(a25fc3d0) SHA1(83cb349e2f1032652060b233e741fb893be5af16) ) /* Plane 2,3 */
2929   ROM_LOAD16_BYTE( "095-c5.bin", 0x1000000, 0x400000, CRC(8b9b65df) SHA1(e2a7e20855501f240bcd22f5cc92fcb4a9806abe) ) /* Plane 0,1 */
2930   ROM_LOAD16_BYTE( "095-c6.bin", 0x1000001, 0x400000, CRC(3e164718) SHA1(53217f938c8964c1ca68a6fd5249c4169a5ac8e6) ) /* Plane 2,3 */
2931   ROM_LOAD16_BYTE( "095-c7.bin", 0x1800000, 0x200000, CRC(ca605e12) SHA1(5150b835247fd705bc1dece97d423d9c20a51416) ) /* Plane 0,1 */
2932   ROM_LOAD16_BYTE( "095-c8.bin", 0x1800001, 0x200000, CRC(4e6beb6c) SHA1(c0ac7cfc832ace6ad52c58f5da3a8101baead749) ) /* Plane 2,3 */
2933ROM_END
2934
29042935ROM_START( aof3 )
29052936   ROM_REGION( 0x300000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
29062937   ROM_LOAD16_WORD_SWAP( "096-p1.bin", 0x000000, 0x100000, CRC(9edb420d) SHA1(150d80707325ece351c72c21c6186cfb5996adba) )
r1771r1772
29552986   ROM_LOAD16_BYTE( "096-c8.bin", 0x1800001, 0x200000, CRC(9a34f99c) SHA1(fca72d95ec42790a7f1e771a1e25dbc5bec5fc19) ) /* Plane 2,3 */
29562987ROM_END
29572988
2958
29592989ROM_START( sonicwi3 )
29602990   ROM_REGION( 0x200000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
29612991   ROM_LOAD16_WORD_SWAP( "097-p1.bin", 0x100000, 0x100000, CRC(0547121d) SHA1(e0bb6c614f572b74ba9a9f0d3d5b69fbc91ebc52) )
r1771r1772
54435473   ROM_LOAD16_BYTE( "268-c8c.bin", 0x3000001, 0x800000, CRC(551d720e) SHA1(ebf69e334fcaba0fda6fd432fd0970283a365d12) ) /* Plane 2,3 */
54445474ROM_END
54455475
5476ROM_START( mslug5h ) /* Encrypted Set */ /* AES release of the game but is also found in later MVS carts */
5477   ROM_REGION( 0x800000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
5478   ROM_LOAD32_WORD_SWAP( "268-p1cr2.bin", 0x000000, 0x400000, CRC(3636690a) SHA1(e0da714b4bdc6efffe1250ded02ebddb3ab6d7b3) )
5479   ROM_LOAD32_WORD_SWAP( "268-p2cr2.bin", 0x000002, 0x400000, CRC(8dfc47a2) SHA1(27d618cfbd0107a4d2a836797e967b39d2eb4851) )
5480
5481   ROM_Y_ZOOM
5482
5483   /* The Encrypted Boards do _not_ have an s1 rom, data for it comes from the Cx ROMs */
5484   ROM_REGION( 0x20000, NEOGEO_REGION_FIXED_LAYER_CARTRIDGE, 0 )
5485   ROM_FILL( 0x000000, 0x20000, 0 )
5486   ROM_REGION( 0x20000, NEOGEO_REGION_FIXED_LAYER_BIOS, 0 )
5487   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
5488
5489   ROM_REGION( 0x80000, NEOGEO_REGION_AUDIO_CPU_ENCRYPTED, 0 )
5490   /* Encrypted, we load it here for reference and replace with decrypted ROM */
5491   ROM_LOAD( "268-m1h.bin", 0x00000, 0x80000, CRC(4a5a6e0e) SHA1(df0f660f2465e1db7be5adfcaf5e88ad61a74a42) ) /* Same as MVS above, but different label */
5492   /* Decrypted */
5493   NEO_BIOS_AUDIO_64K( "268-m1_decrypted.bin",  CRC(3c0655a7) SHA1(ae839d4c2b87a7aa3dd8e5caddc43eb75ee9b732) ) /* not a 100% match for encrypted version */
5494
5495   ROM_REGION( 0x1000000, NEOGEO_REGION_AUDIO_DATA_1, 0 )
5496   /* Encrypted */
5497   ROM_LOAD( "268-v1c.bin", 0x000000, 0x800000, CRC(ae31d60c) SHA1(c42285cf4e52fea74247860813e826df5aa7600a) )
5498   ROM_LOAD( "268-v2c.bin", 0x800000, 0x800000, CRC(c40613ed) SHA1(af889570304e2867d7dfea1e94e388c06249fb67) )
5499
5500   NO_DELTAT_REGION
5501
5502   ROM_REGION( 0x4000000, NEOGEO_REGION_SPRITES, ROMREGION_DISPOSE )
5503   /* Encrypted */
5504   ROM_LOAD16_BYTE( "268-c1c.bin", 0x0000000, 0x800000, CRC(ab7c389a) SHA1(025a188de589500bf7637fa8e7a37ab24bf4312e) ) /* Plane 0,1 */
5505   ROM_LOAD16_BYTE( "268-c2c.bin", 0x0000001, 0x800000, CRC(3560881b) SHA1(493d218c92290b4770024d6ee2917c4022753b07) ) /* Plane 2,3 */
5506   ROM_LOAD16_BYTE( "268-c3c.bin", 0x1000000, 0x800000, CRC(3af955ea) SHA1(cf36b6ae9b0d12744b17cb7a928399214de894be) ) /* Plane 0,1 */
5507   ROM_LOAD16_BYTE( "268-c4c.bin", 0x1000001, 0x800000, CRC(c329c373) SHA1(5073d4079958a0ef5426885af2c9e3178f37d5e0) ) /* Plane 2,3 */
5508   ROM_LOAD16_BYTE( "268-c5c.bin", 0x2000000, 0x800000, CRC(959c8177) SHA1(889bda7c65d71172e7d89194d1269561888fe789) ) /* Plane 0,1 */
5509   ROM_LOAD16_BYTE( "268-c6c.bin", 0x2000001, 0x800000, CRC(010a831b) SHA1(aec140661e3ae35d264df416478ba15188544d91) ) /* Plane 2,3 */
5510   ROM_LOAD16_BYTE( "268-c7c.bin", 0x3000000, 0x800000, CRC(6d72a969) SHA1(968dd9a4d1209b770b9b85ea6532fa24d262a262) ) /* Plane 0,1 */
5511   ROM_LOAD16_BYTE( "268-c8c.bin", 0x3000001, 0x800000, CRC(551d720e) SHA1(ebf69e334fcaba0fda6fd432fd0970283a365d12) ) /* Plane 2,3 */
5512ROM_END
5513
54465514/* program roms are the same on the PCB version, GFX roms etc. are different arrangement */
54475515ROM_START( ms5pcb ) /* Encrypted Set */
54485516   ROM_REGION( 0x800000, NEOGEO_REGION_MAIN_CPU_CARTRIDGE, 0 )
r1771r1772
71917259GAME( 1995, samsho3a, samsho3,  neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Samurai Shodown III / Samurai Spirits - Zankurou Musouken (set 2)", 0 )
71927260GAME( 1995, fswords,  samsho3,  neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Fighters Swords (Korean release of Samurai Shodown III)", 0 )
71937261GAME( 1995, rbff1,    neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Real Bout Fatal Fury / Real Bout Garou Densetsu", 0 )
7262GAME( 1995, rbff1a,   rbff1,    neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Real Bout Fatal Fury / Real Bout Garou Densetsu (bug fix revision)", 0 )
71947263GAME( 1996, aof3,     neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Art of Fighting 3 - The Path of the Warrior / Art of Fighting - Ryuuko no Ken Gaiden", 0 )
71957264GAME( 1996, aof3k,    aof3,     neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Art of Fighting 3 - The Path of the Warrior (Korean release)", 0 ) // no Japanese title / mode
71967265GAME( 1996, kof96,    neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "The King of Fighters '96 (set 1)", 0 )
r1771r1772
72497318GAME( 2005, kf10thep, kof2002,  neogeo,   neogeo,   kf10thep, ROT0, "bootleg", "The King of Fighters 10th Anniversary Extra Plus (The King of Fighters 2002 bootleg)", 0 ) // fake SNK copyright
72507319GAME( 2004, kof2k4se, kof2002,  neogeo,   neogeo,   kof2k4se, ROT0, "bootleg", "The King of Fighters Special Edition 2004 (The King of Fighters 2002 bootleg)", 0 ) /* Hack / Bootleg of kof2002 */
72517320GAME( 2003, mslug5,   neogeo,   neogeo,   neogeo,   mslug5,   ROT0, "SNK Playmore", "Metal Slug 5", 0 )
7321GAME( 2003, mslug5h,  mslug5,   neogeo,   neogeo,   mslug5,   ROT0, "SNK Playmore", "Metal Slug 5 (AES Cart)", 0 ) /* Also found in later MVS carts */
72527322GAME( 2003, ms5pcb,   0,        neogeo,   neogeo,   ms5pcb,   ROT0, "SNK Playmore", "Metal Slug 5 (JAMMA PCB)", 0 )
72537323GAME( 2003, ms5plus,  mslug5,   neogeo,   neogeo,   ms5plus,  ROT0, "bootleg", "Metal Slug 5 Plus (bootleg)",0 )
72547324GAME( 2003, svcpcb,   0,        neogeo,   svcpcb,   svcpcb,   ROT0, "SNK Playmore", "SNK vs. CAPCOM SVC CHAOS (JAMMA PCB, set 1)", 0 ) // not a clone of neogeo because it's NOT a neogeo cart.
src/mame/drivers/omegrace.c
r1771r1772
503503   MDRV_SCREEN_SIZE(400, 300)
504504   MDRV_SCREEN_VISIBLE_AREA(522, 1566, 522, 1566)
505505
506   MDRV_PALETTE_LENGTH(32768)
507
508506   MDRV_VIDEO_START(dvg)
509507   MDRV_VIDEO_UPDATE(vector)
510508
r1771r1772
542540
543541   /* DVG PROM */
544542   ROM_REGION( 0x100, REGION_USER1, 0 )
545   ROM_LOAD( "01-34602.bin",   0x0000, 0x0100, BAD_DUMP CRC(97953db8) SHA1(8cbded64d1dd35b18c4d5cece00f77e7b2cab2ad) )
543   ROM_LOAD( "dvgprom.bin",   0x0000, 0x0100, CRC(d481e958) SHA1(d8790547dc539e25984807573097b61ec3ffe614) )
546544ROM_END
547545
548546ROM_START( deltrace )
r1771r1772
559557
560558   /* DVG PROM */
561559   ROM_REGION( 0x100, REGION_USER1, 0 )
562   ROM_LOAD( "01-34602.bin",   0x0000, 0x0100, BAD_DUMP CRC(97953db8) SHA1(8cbded64d1dd35b18c4d5cece00f77e7b2cab2ad) )
560   ROM_LOAD( "dvgprom.bin",   0x0000, 0x0100, CRC(d481e958) SHA1(d8790547dc539e25984807573097b61ec3ffe614) )
563561ROM_END
564562
565563
564/*************************************
565 *
566 *  Game specific initalization
567 *
568 *************************************/
566569
570static DRIVER_INIT( omegrace )
571{
572   int i;
573   UINT8 *prom = memory_region(REGION_USER1);
574
575   /* Omega Race has two pairs of the state PROM output
576     * lines swapped before going into the decoder.
577     * Since all other avg/dvg games connect the PROM
578     * in a consistent way to the decoder, we swap the bits
579     * here. */
580   for (i=0; i<memory_region_length(REGION_USER1); i++)
581      prom[i] = BITSWAP8(prom[i],7,6,5,4,1,0,3,2);
582}
583
584
567585/*************************************
568586 *
569587 *  Game drivers
570588 *
571589 *************************************/
572590
573GAMEL(1981, omegrace, 0,        omegrace, omegrace, 0, ROT0, "Midway",         "Omega Race", GAME_NO_COCKTAIL, layout_hoffe457 )
574GAMEL(1981, deltrace, omegrace, omegrace, omegrace, 0, ROT0, "Allied Leisure", "Delta Race", GAME_NO_COCKTAIL, layout_hoffe457 )
591GAMEL(1981, omegrace, 0,        omegrace, omegrace, omegrace, ROT0, "Midway",         "Omega Race", GAME_NO_COCKTAIL, layout_hoffe457 )
592GAMEL(1981, deltrace, omegrace, omegrace, omegrace, omegrace, ROT0, "Allied Leisure", "Delta Race", GAME_NO_COCKTAIL, layout_hoffe457 )
src/mame/drivers/dlair.c
r1771r1772
845845   MDRV_CPU_IO_MAP(dleuro_io_map,0)
846846   MDRV_CPU_VBLANK_INT(vblank_callback, 1)
847847
848   MDRV_WATCHDOG_TIME_INIT(ATTOTIME_IN_HZ(MASTER_CLOCK_EURO/(16*16*16*16*16*8)))
848   MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_HZ(MASTER_CLOCK_EURO/(16*16*16*16*16*8)))
849849
850850   MDRV_MACHINE_START(dleuro)
851851   MDRV_MACHINE_RESET(dlair)
src/mame/drivers/neogeo.c
r1771r1772
12331233   MDRV_CPU_PROGRAM_MAP(audio_map,0)
12341234   MDRV_CPU_IO_MAP(auido_io_map,0)
12351235
1236   MDRV_WATCHDOG_TIME_INIT(ATTOTIME_IN_USEC(128762))
1236   MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_USEC(128762))
12371237
12381238   MDRV_MACHINE_START(neogeo)
12391239   MDRV_MACHINE_RESET(neogeo)
src/mame/drivers/quantum.c
r1771r1772
249249   MDRV_SCREEN_SIZE(400, 300)
250250   MDRV_SCREEN_VISIBLE_AREA(0, 900, 0, 600)
251251
252   MDRV_PALETTE_LENGTH(32768)
253
254252   MDRV_VIDEO_START(avg_quantum)
255253   MDRV_VIDEO_UPDATE(vector)
256254
src/mame/drivers/sandscrp.c
r1771r1772
666611.ic4    27C2001
676712.ic5    27C2001
6868
69Is there an other alt program roms set labeled 9 & 10?
69Is there another alt program rom set labeled 9 & 10?
7070
7171*/
7272
r1771r1772
441441   MDRV_CPU_PROGRAM_MAP(sandscrp_soundmem,0)
442442   MDRV_CPU_IO_MAP(sandscrp_soundport,0)
443443
444   MDRV_WATCHDOG_TIME_INIT(ATTOTIME_IN_SEC(3))   /* a guess, and certainly wrong */
444   MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_SEC(3))   /* a guess, and certainly wrong */
445445
446446   MDRV_MACHINE_RESET(sandscrp)
447447
src/mame/drivers/gpworld.c
r1771r1772
7878
7979INLINE void draw_pixel(mame_bitmap *bitmap,const rectangle *cliprect,int x,int y,int color)
8080{
81   if (flip_screen)
81   if (flip_screen_get())
8282   {
8383      x = bitmap->width - x - 1;
8484      y = bitmap->height - y - 1;
src/mame/drivers/acommand.c
r1771r1772
109109         int xx,yy,x;
110110         int delta = 16;
111111
112         flipx ^= flip_screen;
113         flipy ^= flip_screen;
112         flipx ^= flip_screen_get();
113         flipy ^= flip_screen_get();
114114
115115         if ((pri&pri_mask)!=priority) continue;
116116
117         if (flip_screen)
117         if (flip_screen_get())
118118         {
119119            sx = 368 - sx;
120120            sy = 240 - sy;
src/mame/drivers/asterix.c
r1771r1772
183183
184184
185185
186static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 16 )
187   AM_RANGE(0x000000, 0x0fffff) AM_READ(MRA16_ROM)
188   AM_RANGE(0x100000, 0x107fff) AM_READ(MRA16_RAM)         // Main RAM.
189   AM_RANGE(0x180000, 0x1807ff) AM_READ(K053245_word_r)      // Sprites
190   AM_RANGE(0x180800, 0x180fff) AM_READ(MRA16_RAM)
191   AM_RANGE(0x200000, 0x20000f) AM_READ(K053244_word_r)
192   AM_RANGE(0x280000, 0x280fff) AM_READ(MRA16_RAM)
193   AM_RANGE(0x300000, 0x30001f) AM_READ(K053244_lsb_r)
186static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 )
187   AM_RANGE(0x000000, 0x0fffff) AM_ROM
188   AM_RANGE(0x100000, 0x107fff) AM_RAM
189   AM_RANGE(0x180000, 0x1807ff) AM_READWRITE(K053245_word_r, K053245_word_w)
190   AM_RANGE(0x180800, 0x180fff) AM_RAM                        // extra RAM, or mirror for the above?
191   AM_RANGE(0x200000, 0x20000f) AM_READWRITE(K053244_word_r, K053244_word_w)
192   AM_RANGE(0x280000, 0x280fff) AM_READWRITE(MRA16_RAM, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
193   AM_RANGE(0x300000, 0x30001f) AM_READWRITE(K053244_lsb_r, K053244_lsb_w)
194194   AM_RANGE(0x380000, 0x380001) AM_READ(input_port_0_word_r)
195195   AM_RANGE(0x380002, 0x380003) AM_READ(control1_r)
196   AM_RANGE(0x380200, 0x380203) AM_READ(asterix_sound_r)   // 053260
197   AM_RANGE(0x380600, 0x380601) AM_READ(MRA16_NOP)         // Watchdog
198   AM_RANGE(0x400000, 0x400fff) AM_READ(K056832_ram_half_word_r)   // Graphic planes
199   AM_RANGE(0x420000, 0x421fff) AM_READ(K056832_old_rom_word_r)   // Passthrough to tile roms
200ADDRESS_MAP_END
201
202static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 16 )
203   AM_RANGE(0x000000, 0x0fffff) AM_WRITE(MWA16_ROM)
204   AM_RANGE(0x100000, 0x107fff) AM_WRITE(MWA16_RAM)
205   AM_RANGE(0x180000, 0x1807ff) AM_WRITE(K053245_word_w)
206   AM_RANGE(0x180800, 0x180fff) AM_WRITE(MWA16_RAM)   // extra RAM, or mirror for the above?
207   AM_RANGE(0x200000, 0x20000f) AM_WRITE(K053244_word_w)
208   AM_RANGE(0x280000, 0x280fff) AM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
209   AM_RANGE(0x300000, 0x30001f) AM_WRITE(K053244_lsb_w)
210196   AM_RANGE(0x380100, 0x380101) AM_WRITE(control2_w)
211   AM_RANGE(0x380200, 0x380203) AM_WRITE(K053260_0_lsb_w)
197   AM_RANGE(0x380200, 0x380203) AM_READWRITE(asterix_sound_r, K053260_0_lsb_w)
212198   AM_RANGE(0x380300, 0x380301) AM_WRITE(sound_irq_w)
213199   AM_RANGE(0x380400, 0x380401) AM_WRITE(asterix_spritebank_w)
214200   AM_RANGE(0x380500, 0x38051f) AM_WRITE(K053251_lsb_w)
215   AM_RANGE(0x380600, 0x380601) AM_WRITE(MWA16_NOP)         // Watchdog
201   AM_RANGE(0x380600, 0x380601) AM_NOP                        // Watchdog
216202   AM_RANGE(0x380700, 0x380707) AM_WRITE(K056832_b_word_w)
217203   AM_RANGE(0x380800, 0x380803) AM_WRITE(protection_w)
218   AM_RANGE(0x400000, 0x400fff) AM_WRITE(K056832_ram_half_word_w)
204   AM_RANGE(0x400000, 0x400fff) AM_READWRITE(K056832_ram_half_word_r, K056832_ram_half_word_w)
205   AM_RANGE(0x420000, 0x421fff) AM_READ(K056832_old_rom_word_r)   // Passthrough to tile roms
219206   AM_RANGE(0x440000, 0x44003f) AM_WRITE(K056832_word_w)
220207ADDRESS_MAP_END
221208
222static ADDRESS_MAP_START( sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
223   AM_RANGE(0x0000, 0xefff) AM_READ(MRA8_ROM)
224   AM_RANGE(0xf000, 0xf7ff) AM_READ(MRA8_RAM)
225   AM_RANGE(0xf801, 0xf801) AM_READ(YM2151_status_port_0_r)
226   AM_RANGE(0xfa00, 0xfa2f) AM_READ(K053260_0_r)
227ADDRESS_MAP_END
228
229static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
230   AM_RANGE(0x0000, 0xefff) AM_WRITE(MWA8_ROM)
231   AM_RANGE(0xf000, 0xf7ff) AM_WRITE(MWA8_RAM)
232   AM_RANGE(0xf801, 0xf801) AM_WRITE(YM2151_data_port_0_w)
233   AM_RANGE(0xfa00, 0xfa2f) AM_WRITE(K053260_0_w)
209static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
210   AM_RANGE(0x0000, 0xefff) AM_ROM
211   AM_RANGE(0xf000, 0xf7ff) AM_RAM
212   AM_RANGE(0xf801, 0xf801) AM_READWRITE(YM2151_status_port_0_r, YM2151_data_port_0_w)
213   AM_RANGE(0xfa00, 0xfa2f) AM_READWRITE(K053260_0_r, K053260_0_w)
234214   AM_RANGE(0xfc00, 0xfc00) AM_WRITE(sound_arm_nmi_w)
235215   AM_RANGE(0xfe00, 0xfe00) AM_WRITE(YM2151_register_port_0_w)
236216ADDRESS_MAP_END
r1771r1772
276256
277257   /* basic machine hardware */
278258   MDRV_CPU_ADD(M68000, 12000000)
279   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
259   MDRV_CPU_PROGRAM_MAP(main_map,0)
280260   MDRV_CPU_VBLANK_INT(asterix_interrupt,1)
281261
282262   MDRV_CPU_ADD(Z80, 8000000)
283   /* audio CPU */
284   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
263   MDRV_CPU_PROGRAM_MAP(sound_map,0)
285264
286265   MDRV_NVRAM_HANDLER(asterix)
287266
src/mame/drivers/xxmissio.c
r1771r1772
1212#include "deprecat.h"
1313#include "sound/2203intf.h"
1414
15VIDEO_START( xxmissio );
1516VIDEO_UPDATE( xxmissio );
1617
18extern UINT8 *xxmissio_bgram;
1719extern UINT8 *xxmissio_fgram;
20extern UINT8 *xxmissio_spriteram;
1821
1922static UINT8 xxmissio_status;
2023
r1771r1772
2326WRITE8_HANDLER( xxmissio_scroll_y_w );
2427WRITE8_HANDLER( xxmissio_flipscreen_w );
2528
26READ8_HANDLER( xxmissio_videoram_r );
27WRITE8_HANDLER( xxmissio_videoram_w );
29READ8_HANDLER( xxmissio_bgram_r );
30WRITE8_HANDLER( xxmissio_bgram_w );
2831
2932WRITE8_HANDLER( xxmissio_paletteram_w );
3033
r1771r1772
112115   AM_RANGE(0xa003, 0xa003) AM_WRITE(xxmissio_flipscreen_w)
113116
114117   AM_RANGE(0xc000, 0xc7ff) AM_SHARE(1) AM_RAM AM_BASE(&xxmissio_fgram)
115   AM_RANGE(0xc800, 0xcfff) AM_SHARE(2) AM_READWRITE(xxmissio_videoram_r, xxmissio_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
116   AM_RANGE(0xd000, 0xd7ff) AM_SHARE(3) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
118   AM_RANGE(0xc800, 0xcfff) AM_SHARE(2) AM_READWRITE(xxmissio_bgram_r, xxmissio_bgram_w) AM_BASE(&xxmissio_bgram)
119   AM_RANGE(0xd000, 0xd7ff) AM_SHARE(3) AM_RAM AM_BASE(&xxmissio_spriteram)
117120
118121   AM_RANGE(0xd800, 0xdaff) AM_SHARE(4) AM_READWRITE(MRA8_RAM, xxmissio_paletteram_w) AM_BASE(&paletteram)
119122
r1771r1772
139142   AM_RANGE(0xa003, 0xa003) AM_WRITE(xxmissio_flipscreen_w)
140143
141144   AM_RANGE(0xc000, 0xc7ff) AM_SHARE(1) AM_RAM
142   AM_RANGE(0xc800, 0xcfff) AM_SHARE(2) AM_READWRITE(xxmissio_videoram_r, xxmissio_videoram_w)
145   AM_RANGE(0xc800, 0xcfff) AM_SHARE(2) AM_READWRITE(xxmissio_bgram_r, xxmissio_bgram_w)
143146   AM_RANGE(0xd000, 0xd7ff) AM_SHARE(3) AM_RAM
144147
145148   AM_RANGE(0xd800, 0xdaff) AM_SHARE(4) AM_READWRITE(MRA8_RAM, xxmissio_paletteram_w)
r1771r1772
310313   MDRV_GFXDECODE(xxmissio)
311314   MDRV_PALETTE_LENGTH(768)
312315
313   MDRV_VIDEO_START(generic)
316   MDRV_VIDEO_START(xxmissio)
314317   MDRV_VIDEO_UPDATE(xxmissio)
315318
316319   /* sound hardware */
src/mame/drivers/taito_l.c
r1771r1772
27032703ROM_END
27042704
27052705
2706
2707
2708
27062709ROM_START( kurikint )
27072710   ROM_REGION( 0xb0000, REGION_CPU1, 0 )
2708   ROM_LOAD( "b42-09.2",    0x00000, 0x20000, CRC(e97c4394) SHA1(fdeb15315166f7615d4039d5dc9c28d53cee86f2) )
2711   ROM_LOAD( "b42-09.ic2",  0x00000, 0x20000, CRC(e97c4394) SHA1(fdeb15315166f7615d4039d5dc9c28d53cee86f2) )
27092712   ROM_RELOAD(              0x10000, 0x20000 )
2710   ROM_LOAD( "b42-06.6",    0x30000, 0x20000, CRC(fa15fd65) SHA1(a810d7315878212e4e5344a24addf117ea6baeab) )
2713   ROM_LOAD( "b42-06.ic6",  0x30000, 0x20000, CRC(fa15fd65) SHA1(a810d7315878212e4e5344a24addf117ea6baeab) )
27112714
27122715   ROM_REGION( 0x10000, REGION_CPU2, 0 )
2713   ROM_LOAD( "b42-07.22",  0x00000, 0x10000, CRC(0f2719c0) SHA1(f870335a75f236f0059522f9a577dee7ca3acb2f) )
2716   ROM_LOAD( "b42-07.ic22", 0x00000, 0x10000, CRC(0f2719c0) SHA1(f870335a75f236f0059522f9a577dee7ca3acb2f) )
27142717
27152718   ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_DISPOSE )
2716   ROM_LOAD( "b42-01.1",    0x00000, 0x80000, CRC(7d1a1fec) SHA1(28311b07673686c18988400d0254533a454f07f4) )
2717   ROM_LOAD( "b42-02.5",    0x80000, 0x80000, CRC(1a52e65c) SHA1(20a1fc4d02b5928fb01444079692e23d178c6297) )
2719   ROM_LOAD( "b42-01.ic1",  0x00000, 0x80000, CRC(7d1a1fec) SHA1(28311b07673686c18988400d0254533a454f07f4) )
2720   ROM_LOAD( "b42-02.ic5",  0x80000, 0x80000, CRC(1a52e65c) SHA1(20a1fc4d02b5928fb01444079692e23d178c6297) )
27182721ROM_END
27192722
27202723ROM_START( kurikinu )
27212724   ROM_REGION( 0xb0000, REGION_CPU1, 0 )
2722   ROM_LOAD( "b42-08.2",    0x00000, 0x20000, CRC(7075122e) SHA1(55f5f0cf3b91b7b408f9c05c91f9839c43b49c5f) )
2725   ROM_LOAD( "b42-08.ic2",  0x00000, 0x20000, CRC(7075122e) SHA1(55f5f0cf3b91b7b408f9c05c91f9839c43b49c5f) )
27232726   ROM_RELOAD(              0x10000, 0x20000 )
2724   ROM_LOAD( "b42-06.6",    0x30000, 0x20000, CRC(fa15fd65) SHA1(a810d7315878212e4e5344a24addf117ea6baeab) )
2727   ROM_LOAD( "b42-06.ic6",  0x30000, 0x20000, CRC(fa15fd65) SHA1(a810d7315878212e4e5344a24addf117ea6baeab) )
27252728
27262729   ROM_REGION( 0x10000, REGION_CPU2, 0 )
2727   ROM_LOAD( "b42-07.22",  0x00000, 0x10000, CRC(0f2719c0) SHA1(f870335a75f236f0059522f9a577dee7ca3acb2f) )
2730   ROM_LOAD( "b42-07.ic22", 0x00000, 0x10000, CRC(0f2719c0) SHA1(f870335a75f236f0059522f9a577dee7ca3acb2f) )
27282731
27292732   ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_DISPOSE )
2730   ROM_LOAD( "b42-01.1",    0x00000, 0x80000, CRC(7d1a1fec) SHA1(28311b07673686c18988400d0254533a454f07f4) )
2731   ROM_LOAD( "b42-02.5",    0x80000, 0x80000, CRC(1a52e65c) SHA1(20a1fc4d02b5928fb01444079692e23d178c6297) )
2733   ROM_LOAD( "b42-01.ic1",  0x00000, 0x80000, CRC(7d1a1fec) SHA1(28311b07673686c18988400d0254533a454f07f4) )
2734   ROM_LOAD( "b42-02.ic5",  0x80000, 0x80000, CRC(1a52e65c) SHA1(20a1fc4d02b5928fb01444079692e23d178c6297) )
27322735ROM_END
27332736
27342737ROM_START( kurikinj )
27352738   ROM_REGION( 0xb0000, REGION_CPU1, 0 )
2736   ROM_LOAD( "b42_05.2",    0x00000, 0x20000, CRC(077222b8) SHA1(953fb3444f6bb0dbe0323a0fd8fc3067b106a4f6) )
2739   ROM_LOAD( "b42-05.ic2",  0x00000, 0x20000, CRC(077222b8) SHA1(953fb3444f6bb0dbe0323a0fd8fc3067b106a4f6) )
27372740   ROM_RELOAD(              0x10000, 0x20000 )
2738   ROM_LOAD( "b42-06.6",    0x30000, 0x20000, CRC(fa15fd65) SHA1(a810d7315878212e4e5344a24addf117ea6baeab) )
2741   ROM_LOAD( "b42-06.ic6",  0x30000, 0x20000, CRC(fa15fd65) SHA1(a810d7315878212e4e5344a24addf117ea6baeab) )
27392742
27402743   ROM_REGION( 0x10000, REGION_CPU2, 0 )
2741   ROM_LOAD( "b42-07.22",  0x00000, 0x10000, CRC(0f2719c0) SHA1(f870335a75f236f0059522f9a577dee7ca3acb2f) )
2744   ROM_LOAD( "b42-07.ic22", 0x00000, 0x10000, CRC(0f2719c0) SHA1(f870335a75f236f0059522f9a577dee7ca3acb2f) )
27422745
27432746   ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_DISPOSE )
2744   ROM_LOAD( "b42-01.1",    0x00000, 0x80000, CRC(7d1a1fec) SHA1(28311b07673686c18988400d0254533a454f07f4) )
2745   ROM_LOAD( "b42-02.5",    0x80000, 0x80000, CRC(1a52e65c) SHA1(20a1fc4d02b5928fb01444079692e23d178c6297) )
2747   ROM_LOAD( "b42-01.ic1",  0x00000, 0x80000, CRC(7d1a1fec) SHA1(28311b07673686c18988400d0254533a454f07f4) )
2748   ROM_LOAD( "b42-02.ic5",  0x80000, 0x80000, CRC(1a52e65c) SHA1(20a1fc4d02b5928fb01444079692e23d178c6297) )
27462749ROM_END
27472750
27482751ROM_START( kurikina )
27492752   ROM_REGION( 0xb0000, REGION_CPU1, 0 )
2750   ROM_LOAD( "kk_ic2.rom",  0x00000, 0x20000, CRC(908603f2) SHA1(f810f2501458224e9264a984f22547cc8ccc2b0e) )
2753   ROM_LOAD( "kk_ic2.ic2",  0x00000, 0x20000, CRC(908603f2) SHA1(f810f2501458224e9264a984f22547cc8ccc2b0e) )
27512754   ROM_RELOAD(              0x10000, 0x20000 )
2752   ROM_LOAD( "kk_ic6.rom",  0x30000, 0x20000, CRC(a4a957b1) SHA1(bbdb5b71ab613a8c89f7a0300abd85408951dc7e) )
2755   ROM_LOAD( "kk_ic6.ic6",  0x30000, 0x20000, CRC(a4a957b1) SHA1(bbdb5b71ab613a8c89f7a0300abd85408951dc7e) )
27532756
27542757   ROM_REGION( 0x10000, REGION_CPU2, 0 )
2755   ROM_LOAD( "b42-07.22",  0x00000, 0x10000, CRC(0f2719c0) SHA1(f870335a75f236f0059522f9a577dee7ca3acb2f) )
2758   ROM_LOAD( "b42-07.ic22", 0x00000, 0x10000, CRC(0f2719c0) SHA1(f870335a75f236f0059522f9a577dee7ca3acb2f) )
27562759
27572760   ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_DISPOSE )
27582761   ROM_LOAD( "kk_1-1l.rom", 0x00000, 0x20000, CRC(df1d4fcd) SHA1(300cad3636ea9648595c3f4bba3ca737f95f7354) )
r1771r1772
28262829
28272830ROM_START( plottina ) /* B96-09 or higher by Taito's rom numbering system, demo mode is 2 players */
28282831   ROM_REGION( 0x20000, REGION_CPU1, 0 )
2829   ROM_LOAD( "plot01.bin", 0x00000, 0x10000, CRC(5b30bc25) SHA1(df8839a90da9e5122d75b6faaf97f59499dbd316) )
2830   ROM_RELOAD(             0x10000, 0x10000 )
2832   ROM_LOAD( "plot01.ic10", 0x00000, 0x10000, CRC(5b30bc25) SHA1(df8839a90da9e5122d75b6faaf97f59499dbd316) )
2833   ROM_RELOAD(              0x10000, 0x10000 )
28312834
28322835   ROM_REGION( 0x20000, REGION_GFX1, ROMREGION_DISPOSE )
28332836   ROM_LOAD( "b96-02.ic9", 0x00000, 0x10000, CRC(6e0bad2a) SHA1(73996688cd058a2f56f61ea60144b9c673919a58) )
r1771r1772
28792882
28802883ROM_START( puzznicj )
28812884   ROM_REGION( 0x30000, REGION_CPU1, 0 )
2882   ROM_LOAD( "u11.rom",  0x00000, 0x20000, CRC(a4150b6c) SHA1(27719b8993735532cd59f4ed5693ff3143ee2336) )
2883   ROM_RELOAD(           0x10000, 0x20000 )
2885   ROM_LOAD( "u11.ic11",  0x00000, 0x20000, CRC(a4150b6c) SHA1(27719b8993735532cd59f4ed5693ff3143ee2336) )
2886   ROM_RELOAD(            0x10000, 0x20000 )
28842887
28852888   ROM_REGION( 0x0800, REGION_CPU2, 0 )   /* 2k for the microcontroller */
28862889   ROM_LOAD( "mc68705p", 0x0000, 0x0800, NO_DUMP )
28872890
28882891   ROM_REGION( 0x40000, REGION_GFX1, ROMREGION_DISPOSE )
2889   ROM_LOAD( "u10.rom",  0x00000, 0x20000, CRC(4264056c) SHA1(d2d8a170ae0f361093a5384935238605a59e5938) )
2890   ROM_LOAD( "u09.rom",  0x20000, 0x20000, CRC(3c115f8b) SHA1(8d518be01b7c4d6d993d5d9b62aab719a5c8baca) )
2892   ROM_LOAD( "u10.ic10",  0x00000, 0x20000, CRC(4264056c) SHA1(d2d8a170ae0f361093a5384935238605a59e5938) )
2893   ROM_LOAD( "u09.ic9",   0x20000, 0x20000, CRC(3c115f8b) SHA1(8d518be01b7c4d6d993d5d9b62aab719a5c8baca) )
28912894ROM_END
28922895
28932896ROM_START( puzznici )
28942897   ROM_REGION( 0x30000, REGION_CPU1, 0 )
2895   ROM_LOAD( "1.bin",  0x00000, 0x20000, CRC(4612f5e0) SHA1(dc07a365414666568537d31ef01b58f2362cadaf) )
2896   ROM_RELOAD(           0x10000, 0x20000 )
2898   ROM_LOAD( "1.ic11",  0x00000, 0x20000, CRC(4612f5e0) SHA1(dc07a365414666568537d31ef01b58f2362cadaf) )
2899   ROM_RELOAD(          0x10000, 0x20000 )
28972900
28982901   ROM_REGION( 0x0800, REGION_CPU2, 0 )   /* 2k for the microcontroller */
28992902   ROM_LOAD( "mc68705p", 0x0000, 0x0800, NO_DUMP )
29002903
29012904   ROM_REGION( 0x40000, REGION_GFX1, ROMREGION_DISPOSE )
2902   ROM_LOAD( "u10.rom",  0x00000, 0x20000, CRC(4264056c) SHA1(d2d8a170ae0f361093a5384935238605a59e5938) )
2903   ROM_LOAD( "3.bin",  0x20000, 0x20000, CRC(2bf5232a) SHA1(a8fc06bb8bae2ca6bd21e3a96c9ed38bb356d5d7) )
2905   ROM_LOAD( "u10.ic10",  0x00000, 0x20000, CRC(4264056c) SHA1(d2d8a170ae0f361093a5384935238605a59e5938) )
2906   ROM_LOAD( "3.ic9",     0x20000, 0x20000, CRC(2bf5232a) SHA1(a8fc06bb8bae2ca6bd21e3a96c9ed38bb356d5d7) )
29042907ROM_END
29052908
2909/*
2910
2911Taito's Horse Shoe
2912
2913Main PCB is a L System board with a SUB PCB for roms.
2914
2915Main (M4300189A / K1100589A):
2916   CPU: TC0090LVC (Embedded Z80 core)
2917 Sound: Yamaha YM2203C / Y3014B
2918   RAM: Four 43256 compatible type ram (Toshiba TC55257APL-10)
2919   OSC: 13.33056MHz
2920  DIPS: Two 8-way dipswitch blocks
2921
2922SUB PCB (K9100282A / J9100220A)
2923 5 Rom chips type M27C1001 labeled C47 01 through C47 05
2924 Pal 20L88CNS
2925 NEC uPD4701AC
2926
2927*/
2928
29062929ROM_START( horshoes )
29072930   ROM_REGION( 0x30000, REGION_CPU1, 0 )
2908   ROM_LOAD( "c47.03", 0x00000, 0x20000, CRC(37e15b20) SHA1(85baa0ee553e4c9fed38294ba8912f18f519e62f) )
2909   ROM_RELOAD(         0x10000, 0x20000 )
2931   ROM_LOAD( "c47-03.ic6",  0x00000, 0x20000, CRC(37e15b20) SHA1(85baa0ee553e4c9fed38294ba8912f18f519e62f) )
2932   ROM_RELOAD(              0x10000, 0x20000 )
29102933
29112934   ROM_REGION( 0x80000, REGION_GFX1, ROMREGION_DISPOSE )
2912   ROM_LOAD( "c47.02", 0x00000, 0x10000, CRC(35f96526) SHA1(e7f9b33d82b050aff49f991aa12db436421caa5b) )
2913   ROM_CONTINUE (      0x20000, 0x10000 )
2914   ROM_LOAD( "c47.04", 0x40000, 0x10000, CRC(aeac7121) SHA1(cf67688cde14d452da6d9cbd7a81593f4048ce77) )
2915   ROM_CONTINUE (      0x60000, 0x10000 )
2916   ROM_LOAD( "c47.01", 0x10000, 0x10000, CRC(031c73d8) SHA1(deef972fbf226701f9a6469ae3934129dc52ce9c) )
2917   ROM_CONTINUE (      0x30000, 0x10000 )
2918   ROM_LOAD( "c47.05", 0x50000, 0x10000, CRC(b2a3dafe) SHA1(5ffd3e296272ef3f31432005c827f057aac79497) )
2919   ROM_CONTINUE (      0x70000, 0x10000 )
2935   ROM_LOAD( "c47-02.ic5",  0x00000, 0x10000, CRC(35f96526) SHA1(e7f9b33d82b050aff49f991aa12db436421caa5b) ) /* silkscreened CH0-L */
2936   ROM_CONTINUE (           0x20000, 0x10000 )
2937   ROM_LOAD( "c47-01.ic11", 0x10000, 0x10000, CRC(031c73d8) SHA1(deef972fbf226701f9a6469ae3934129dc52ce9c) ) /* silkscreened CH1-L */
2938   ROM_CONTINUE (           0x30000, 0x10000 )
2939   ROM_LOAD( "c47-04.ic4",  0x40000, 0x10000, CRC(aeac7121) SHA1(cf67688cde14d452da6d9cbd7a81593f4048ce77) ) /* silkscreened CH0-H */
2940   ROM_CONTINUE (           0x60000, 0x10000 )
2941   ROM_LOAD( "c47-05.ic10", 0x50000, 0x10000, CRC(b2a3dafe) SHA1(5ffd3e296272ef3f31432005c827f057aac79497) ) /* silkscreened CH1-H */
2942   ROM_CONTINUE (           0x70000, 0x10000 )
29202943ROM_END
29212944
29222945ROM_START( palamed )
r1771r1772
29412964   ROM_LOAD( "cac8",  0x60000, 0x20000, CRC(d2a63799) SHA1(71b024b239834ef068b7fc20cd49aae7853e0f7c) )
29422965
29432966   ROM_REGION( 0x0200, REGION_PLDS, ROMREGION_DISPOSE )
2944   ROM_LOAD( "pal20l8b-c63-01.14",   0x0000, 0x0144, CRC(14a7dd2a) SHA1(2a39ca6069bdac553d73c34db6f50f880559113c) )
2967   ROM_LOAD( "pal20l8b-c63-01.14", 0x0000, 0x0144, CRC(14a7dd2a) SHA1(2a39ca6069bdac553d73c34db6f50f880559113c) )
29452968ROM_END
29462969
29472970ROM_START( tubeit )
29482971   ROM_REGION( 0x30000, REGION_CPU1, 0 )
29492972   ROM_LOAD( "t-i_02.6", 0x00000, 0x20000, CRC(54730669) SHA1(a44ebd31a8588a133a7552a39fa8d52ba1985e45) )
2950   ROM_RELOAD(         0x10000, 0x20000 )
2973   ROM_RELOAD(           0x10000, 0x20000 )
29512974
29522975   ROM_REGION( 0x80000, REGION_GFX1, ROMREGION_DISPOSE )
29532976   ROM_LOAD( "t-i_03.7", 0x40000, 0x40000, CRC(e1c3fed0) SHA1(cd68dbf61ed820f4aa50c630e7cb778aafb433c2) )
29542977   ROM_LOAD( "t-i_04.9", 0x00000, 0x40000, CRC(b4a6e31d) SHA1(e9abab8f19c78207f25a62104bcae1e391cbd2c0) )
29552978
29562979   ROM_REGION( 0x0200, REGION_PLDS, ROMREGION_DISPOSE )
2957   ROM_LOAD( "pal20l8b-c63-01.14",   0x0000, 0x0144, CRC(14a7dd2a) SHA1(2a39ca6069bdac553d73c34db6f50f880559113c) )
2980   ROM_LOAD( "pal20l8b-c63-01.14", 0x0000, 0x0144, CRC(14a7dd2a) SHA1(2a39ca6069bdac553d73c34db6f50f880559113c) )
29582981ROM_END
29592982
29602983ROM_START( cubybop )
r1771r1772
29712994
29722995ROM_START( plgirls )
29732996   ROM_REGION( 0x50000, REGION_CPU1, 0 )
2974   ROM_LOAD( "pg03.ic6",    0x00000, 0x40000, CRC(6ca73092) SHA1(f5679f047a29b936046c0d3677489df553ad7b41) )
2975   ROM_RELOAD(              0x10000, 0x40000 )
2997   ROM_LOAD( "pg03.ic6", 0x00000, 0x40000, CRC(6ca73092) SHA1(f5679f047a29b936046c0d3677489df553ad7b41) )
2998   ROM_RELOAD(           0x10000, 0x40000 )
29762999
29773000   ROM_REGION( 0x80000, REGION_GFX1, ROMREGION_DISPOSE )
2978   ROM_LOAD( "pg02.ic9",    0x00000, 0x40000, CRC(3cf05ca9) SHA1(502c45a5330dda1b2fbf7d3d0c9bc6e889ff07d8) )
2979   ROM_LOAD( "pg01.ic7",    0x40000, 0x40000, CRC(79e41e74) SHA1(aa8efbeeee47f84e19b639821a89a7bcd67fe7a9) )
3001   ROM_LOAD( "pg02.ic9", 0x00000, 0x40000, CRC(3cf05ca9) SHA1(502c45a5330dda1b2fbf7d3d0c9bc6e889ff07d8) )
3002   ROM_LOAD( "pg01.ic7", 0x40000, 0x40000, CRC(79e41e74) SHA1(aa8efbeeee47f84e19b639821a89a7bcd67fe7a9) )
29803003ROM_END
29813004
29823005ROM_START( plgirls2 )
29833006   ROM_REGION( 0x50000, REGION_CPU1, 0 )
2984   ROM_LOAD( "pg2_1j.ic6",  0x00000, 0x40000, CRC(f924197a) SHA1(ecaaefd1b3715ba60608e05d58be67e3c71f653a) )
2985   ROM_RELOAD(              0x10000, 0x40000 )
3007   ROM_LOAD( "pg2_1j.ic6", 0x00000, 0x40000, CRC(f924197a) SHA1(ecaaefd1b3715ba60608e05d58be67e3c71f653a) )
3008   ROM_RELOAD(             0x10000, 0x40000 )
29863009
29873010   ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_DISPOSE )
2988   ROM_LOAD( "cho-l.ic9",   0x00000, 0x80000, CRC(956384ec) SHA1(94a2b95f340e96bdccbeafd373f0dea90b8328dd) )
2989   ROM_LOAD( "cho-h.ic7",   0x80000, 0x80000, CRC(992f99b1) SHA1(c79f1014d73654740f7823812f92376d65d6b15d) )
3011   ROM_LOAD( "cho-l.ic9",  0x00000, 0x80000, CRC(956384ec) SHA1(94a2b95f340e96bdccbeafd373f0dea90b8328dd) )
3012   ROM_LOAD( "cho-h.ic7",  0x80000, 0x80000, CRC(992f99b1) SHA1(c79f1014d73654740f7823812f92376d65d6b15d) )
29903013ROM_END
29913014
29923015ROM_START( evilston )
29933016   ROM_REGION( 0xb0000, REGION_CPU1, 0 )
2994   ROM_LOAD( "c67-03.ic2",    0x00000, 0x20000, CRC(53419982) SHA1(ecc338e2237d26c5ff25b756d371b26b23beed1e) )
3017   ROM_LOAD( "c67-03.ic2",  0x00000, 0x20000, CRC(53419982) SHA1(ecc338e2237d26c5ff25b756d371b26b23beed1e) )
29953018   ROM_RELOAD(              0x10000, 0x20000 )
2996   ROM_LOAD( "c67-04.ic6",    0x30000, 0x20000, CRC(55d57e19) SHA1(8815bcaafe7ee056314b4131e3fb7963854dd6ba) )
3019   ROM_LOAD( "c67-04.ic6",  0x30000, 0x20000, CRC(55d57e19) SHA1(8815bcaafe7ee056314b4131e3fb7963854dd6ba) )
29973020
29983021   ROM_REGION( 0x80000, REGION_CPU2, 0 )
2999   ROM_LOAD( "c67-05.22",  0x00000, 0x20000, CRC(94d3a642) SHA1(af20aa5bb60a45c05eb1deba23ba30e6640ca235) )
3022   ROM_LOAD( "c67-05.ic22", 0x00000, 0x20000, CRC(94d3a642) SHA1(af20aa5bb60a45c05eb1deba23ba30e6640ca235) )
30003023
30013024   ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_DISPOSE )
3002   ROM_LOAD( "c67-01.ic1",    0x00000, 0x80000, CRC(2f351bf4) SHA1(0fb37abf3413cd11baece1c9bbca5a51b0f28938) )
3003   ROM_LOAD( "c67-02.ic5",    0x80000, 0x80000, CRC(eb4f895c) SHA1(2c902572fe5a5d4442e4dd29e8a85cb40c384140) )
3025   ROM_LOAD( "c67-01.ic1",  0x00000, 0x80000, CRC(2f351bf4) SHA1(0fb37abf3413cd11baece1c9bbca5a51b0f28938) )
3026   ROM_LOAD( "c67-02.ic5",  0x80000, 0x80000, CRC(eb4f895c) SHA1(2c902572fe5a5d4442e4dd29e8a85cb40c384140) )
30043027ROM_END
30053028
30063029
src/mame/drivers/megasys1.c
r1771r1772
102102  bootleg version of rodlandj has one instruction patched out to do exactly
103103  the same thing that we are doing (ignoring the 6295 status).
104104
105- Iganinju doesn't work properly: I have to patch lev3 irq and it severely
106  slows down at times. Strangely, it gets *better* by lowering the main CPU
107  clock from 12 to 7 MHz.
108  This is likely an interrupt timing issue: changing the order in
109  interrupt_A() from 3 2 1 to 1 2 3 makes it work reasonably well for a very
110  short while.
111  ( Fixed by Kale 21 May 2002 )
112
113105- VERY bad sprite lag in iganinju and plusalph and generally others.
114106  Is this a sprites buffer issue ?
115107
r1771r1772
118110
119111***************************************************************************/
120112
113#define SYS_A_CPU_CLOCK      (XTAL_12MHz / 2)   /* clock for main 68000 */
114#define SYS_B_CPU_CLOCK      XTAL_8MHz      /* clock for main 68000 */
115#define SYS_C_CPU_CLOCK      (XTAL_24MHz / 2)   /* clock for main 68000 */
116#define SOUND_CPU_CLOCK      XTAL_7MHz      /* clock for sound 68000 */
117#define OKI4_SOUND_CLOCK   XTAL_4MHz
118
121119#include "driver.h"
122120#include "deprecat.h"
123121#include "megasys1.h"
r1771r1772
197195   }
198196}
199197
200static INTERRUPT_GEN( interrupt_A_iganinju )
201{
202   switch ( cpu_getiloops() )
203   {
204      case 0:      cpunum_set_input_line(machine, 0, 2, HOLD_LINE);   break;
205      case 1:      cpunum_set_input_line(machine, 0, 1, HOLD_LINE);   break;
206   //  case 2:     cpunum_set_input_line(machine, 0, 1, HOLD_LINE); break;
207   }
208}
209198
210
211
212
213199static ADDRESS_MAP_START( readmem_A, ADDRESS_SPACE_PROGRAM, 16 )
214200   ADDRESS_MAP_FLAGS( AMEF_ABITS(20) )
215201   AM_RANGE(0x000000, 0x05ffff) AM_READ(MRA16_ROM)
r1771r1772
648634static MACHINE_DRIVER_START( system_A )
649635
650636   /* basic machine hardware */
651   MDRV_CPU_ADD_TAG("main", M68000, 12000000)
637   MDRV_CPU_ADD_TAG("main", M68000, SYS_A_CPU_CLOCK) /* 6MHz verified */
652638   MDRV_CPU_PROGRAM_MAP(readmem_A,writemem_A)
653639   MDRV_CPU_VBLANK_INT(interrupt_A,INTERRUPT_NUM_A)
654640
655   MDRV_CPU_ADD_TAG("sound", M68000, 7000000)
641   MDRV_CPU_ADD_TAG("sound", M68000, SOUND_CPU_CLOCK) /* 7MHz verified */
656642   /* audio CPU */
657643   MDRV_CPU_PROGRAM_MAP(sound_readmem_A,sound_writemem_A)
658644
r1771r1772
678664   /* sound hardware */
679665   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
680666
681   MDRV_SOUND_ADD(YM2151, 7000000/2)
667   MDRV_SOUND_ADD(YM2151, SOUND_CPU_CLOCK/2) /* 3.5MHz verified */
682668   MDRV_SOUND_CONFIG(ym2151_interface)
683669   MDRV_SOUND_ROUTE(0, "left", 0.80)
684670   MDRV_SOUND_ROUTE(1, "right", 0.80)
685671
686   MDRV_SOUND_ADD_TAG("OKI1",OKIM6295, 4000000)
672   MDRV_SOUND_ADD_TAG("OKI1",OKIM6295, OKI4_SOUND_CLOCK) /* 4MHz verified */
687673   MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high)
688674   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.30)
689675   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.30)
690676
691   MDRV_SOUND_ADD_TAG("OKI2",OKIM6295, 4000000)
677   MDRV_SOUND_ADD_TAG("OKI2",OKIM6295, OKI4_SOUND_CLOCK) /* 4MHz verified */
692678   MDRV_SOUND_CONFIG(okim6295_interface_region_2_pin7high)
693679   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.30)
694680   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.30)
695681MACHINE_DRIVER_END
696682
697static MACHINE_DRIVER_START( system_A_iganinju )
698
699   /* basic machine hardware */
700   MDRV_IMPORT_FROM(system_A)
701   MDRV_CPU_MODIFY("main")
702   MDRV_CPU_VBLANK_INT(interrupt_A_iganinju,INTERRUPT_NUM_A)
703MACHINE_DRIVER_END
704
705683static MACHINE_DRIVER_START( system_A_hachoo )
706684   MDRV_IMPORT_FROM(system_A)
707685   MDRV_MACHINE_RESET(megasys1_hachoo)
r1771r1772
711689
712690   /* basic machine hardware */
713691   MDRV_IMPORT_FROM(system_A)
692
693   MDRV_CPU_REPLACE("main", M68000, SYS_B_CPU_CLOCK) /* 8MHz */
714694   MDRV_CPU_MODIFY("main")
715695   MDRV_CPU_PROGRAM_MAP(readmem_B,writemem_B)
716696   MDRV_CPU_VBLANK_INT(interrupt_B,INTERRUPT_NUM_B)
r1771r1772
723703
724704   /* basic machine hardware */
725705   MDRV_IMPORT_FROM(system_B)
726   MDRV_CPU_REPLACE("main", M68000, 8000000)
727706
728   MDRV_SOUND_REPLACE("OKI1",OKIM6295, 2000000)
707   MDRV_SOUND_REPLACE("OKI1",OKIM6295, 2000000) /* correct speed, but unknown OSC + divider combo */
729708   MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high)
730709   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.30)
731710   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.30)
732711
733   MDRV_SOUND_REPLACE("OKI2",OKIM6295, 2000000)
712   MDRV_SOUND_REPLACE("OKI2",OKIM6295, 2000000) /* correct speed, but unknown OSC + divider combo */
734713   MDRV_SOUND_CONFIG(okim6295_interface_region_2_pin7high)
735714   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.30)
736715   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.30)
r1771r1772
741720
742721   /* basic machine hardware */
743722   MDRV_IMPORT_FROM(system_A)
723   MDRV_CPU_REPLACE("main", M68000, SYS_C_CPU_CLOCK) /* 12MHz */
744724   MDRV_CPU_MODIFY("main")
745725   MDRV_CPU_PROGRAM_MAP(readmem_C,writemem_C)
746726   MDRV_CPU_VBLANK_INT(interrupt_C,INTERRUPT_NUM_C)
r1771r1772
764744static MACHINE_DRIVER_START( system_D )
765745
766746   /* basic machine hardware */
767   MDRV_CPU_ADD(M68000, 10000000)   /* ? */
747   MDRV_CPU_ADD(M68000, 8000000)   /* 8MHz?? */
768748   MDRV_CPU_PROGRAM_MAP(readmem_D,writemem_D)
769749   MDRV_CPU_VBLANK_INT(interrupt_D,INTERRUPT_NUM_D)
770750
r1771r1772
825805static MACHINE_DRIVER_START( system_Z )
826806
827807   /* basic machine hardware */
828   MDRV_CPU_ADD(M68000, 6000000) /* ??? */
808   MDRV_CPU_ADD(M68000, SYS_A_CPU_CLOCK) /* 6MHz (12MHz / 2) */
829809   MDRV_CPU_PROGRAM_MAP(readmem_A,writemem_A)
830810   MDRV_CPU_VBLANK_INT(interrupt_A,INTERRUPT_NUM_A)
831811
832   MDRV_CPU_ADD(Z80, 3000000)
833   /* audio CPU */ /* ??? */
812   MDRV_CPU_ADD(Z80, 3000000) /* OSC 12MHz divided by 4 ??? */
813   /* audio CPU */
834814   MDRV_CPU_PROGRAM_MAP(sound_readmem_z80,sound_writemem_z80)
835815   MDRV_CPU_IO_MAP(sound_readport,sound_writeport)
836816
r1771r1772
39603940GAME( 1988, kickoff,  0,        system_A,          kickoff,  0,        ROT0,   "Jaleco", "Kick Off (Japan)", 0 )
39613941GAME( 1988, tshingen, 0,        system_A,          tshingen, phantasm, ROT0,   "Jaleco", "Takeda Shingen (Japan, Japanese)", 0 )
39623942GAME( 1988, tshingna, tshingen, system_A,          tshingen, phantasm, ROT0,   "Jaleco", "Shingen Samurai-Fighter (Japan, English)", 0 )
3963GAME( 1988, kazan,    0,        system_A_iganinju, kazan,    iganinju, ROT0,   "Jaleco", "Ninja Kazan (World)", 0 )
3964GAME( 1988, iganinju, kazan,    system_A_iganinju, kazan,    iganinju, ROT0,   "Jaleco", "Iga Ninjyutsuden (Japan)", 0 )
3943GAME( 1988, kazan,    0,        system_A,          kazan,    iganinju, ROT0,   "Jaleco", "Ninja Kazan (World)", 0 )
3944GAME( 1988, iganinju, kazan,    system_A,          kazan,    iganinju, ROT0,   "Jaleco", "Iga Ninjyutsuden (Japan)", 0 )
39653945GAME( 1989, astyanax, 0,        system_A,          astyanax, astyanax, ROT0,   "Jaleco", "The Astyanax", 0 )
39663946GAME( 1989, lordofk,  astyanax, system_A,          astyanax, astyanax, ROT0,   "Jaleco", "The Lord of King (Japan)", 0 )
39673947GAME( 1989, hachoo,   0,        system_A_hachoo,   hachoo,   hachoo,   ROT0,   "Jaleco", "Hachoo!", 0 )
src/mame/drivers/airbustr.c
r1771r1772
614614   MDRV_INTERLEAVE(100)   // Palette RAM is filled by sub cpu with data supplied by main cpu
615615                     // Maybe a high value is safer in order to avoid glitches
616616   MDRV_MACHINE_RESET(airbustr)
617   MDRV_WATCHDOG_TIME_INIT(ATTOTIME_IN_SEC(3))   /* a guess, and certainly wrong */
617   MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_SEC(3))   /* a guess, and certainly wrong */
618618
619619   // video hardware
620620
src/mame/drivers/cave.c
r1771r1772
23532353   MDRV_CPU_PROGRAM_MAP(mazinger_sound_readmem,mazinger_sound_writemem)
23542354   MDRV_CPU_IO_MAP(mazinger_sound_readport,mazinger_sound_writeport)
23552355
2356   MDRV_WATCHDOG_TIME_INIT(ATTOTIME_IN_SEC(3))   /* a guess, and certainly wrong */
2356   MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_SEC(3))   /* a guess, and certainly wrong */
23572357
23582358   MDRV_MACHINE_RESET(cave)
23592359   MDRV_NVRAM_HANDLER(cave)
r1771r1772
24102410   MDRV_CPU_PROGRAM_MAP(metmqstr_sound_readmem,metmqstr_sound_writemem)
24112411   MDRV_CPU_IO_MAP(metmqstr_sound_readport,metmqstr_sound_writeport)
24122412
2413   MDRV_WATCHDOG_TIME_INIT(ATTOTIME_IN_SEC(3))   /* a guess, and certainly wrong */
2413   MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_SEC(3))   /* a guess, and certainly wrong */
24142414
24152415   MDRV_MACHINE_RESET(cave)   /* start with the watchdog armed */
24162416   MDRV_NVRAM_HANDLER(cave)
src/mame/drivers/asuka.c
r1771r1772
8585      * 'bonzeadu' : region = 0x0001
8686  - These 3 games are 100% the same, only region differs !
8787  - Coinage relies on the region (code at 0x02d344) :
88      * 0x0000 (Japan) and 0x0001 (US) use TAITO_COINAGE_JAPAN_OLD
89      * 0x0002 (World) uses TAITO_COINAGE_WORLD
88      * 0x0000 (Japan) and 0x0001 (US) use TAITO_COINAGE_JAPAN_OLD_LOC()
89      * 0x0002 (World) uses TAITO_COINAGE_WORLD_LOC()
9090  - Notice screen only if region = 0x0000
9191  - Texts and game name rely on the region :
9292      * 0x0000 : most texts in Japanese - game name is "Jigoku Meguri"
r1771r1772
1251253) 'asuka*'
126126
127127  - No region
128  - BOTH sets use TAITO_COINAGE_JAPAN_OLD for coinage,
128  - BOTH sets use TAITO_COINAGE_JAPAN_OLD_LOC() for coinage,
129129    so I wonder if the World version isn't a US version
130130  - Additional notice screen in 'asukaj'
131131
r1771r1772
136136  - Sets :
137137      * 'mofflott' : region = 0x0001
138138  - Coinage relies on the region (code at 0x0145ec) :
139      * 0x0001 (Japan) and 0x0002 (US ?) use TAITO_COINAGE_JAPAN_OLD
140      * 0x0003 (World) uses TAITO_COINAGE_WORLD
139      * 0x0001 (Japan) and 0x0002 (US ?) use TAITO_COINAGE_JAPAN_OLD_LOC()
140      * 0x0003 (World) uses TAITO_COINAGE_WORLD_LOC()
141141  - Notice screen only if region = 0x0001
142142
143143
r1771r1772
153153  - These 5 games are 100% the same, only region differs !
154154    However each version requires its specific texts
155155  - Coinage relies on the region (code at 0x0013d6) :
156      * 0x0001 (Japan) uses TAITO_COINAGE_JAPAN_OLD
157      * 0x0002 (US) uses TAITO_COINAGE_US
158      * 0x0003 (World) uses TAITO_COINAGE_WORLD
156      * 0x0001 (Japan) uses TAITO_COINAGE_JAPAN_OLD_LOC()
157      * 0x0002 (US) uses TAITO_COINAGE_US_LOC()
158      * 0x0003 (World) uses TAITO_COINAGE_WORLD_LOC()
159159  - Notice screen only if region = 0x0001 or region = 0x0002
160160  - FBI logo only if region = 0x0002
161161  - I can't tell about the Italian and Japanese versions,
r1771r1772
166166
167167  - No region (not a Taito game anyway)
168168  - Coinage relies on "Coin Mode" Dip Switch (code at 0x0801c0) :
169      * "Mode A" uses TAITO_COINAGE_JAPAN_OLD
170      * "Mode B" uses TAITO_COINAGE_WORLD
169      * "Mode A" uses TAITO_COINAGE_JAPAN_OLD_LOC()
170      * "Mode B" uses TAITO_COINAGE_WORLD_LOC()
171171  - Notice screen
172172
173173
1741747) 'earthjkr'
175175
176176  - No region (not a Taito game anyway)
177  - Game uses TAITO_COINAGE_JAPAN_OLD
177  - Game uses TAITO_COINAGE_JAPAN_OLD_LOC()
178178  - Notice screen only if "Copyright" Dip Switch set to "Visco"
179179
180180
1811818) 'eto'
182182
183183  - No region (not a Taito game anyway)
184  - Game uses TAITO_COINAGE_JAPAN_OLD
184  - Game uses TAITO_COINAGE_JAPAN_OLD_LOC()
185185  - No notice screen
186186
187187
r1771r1772
202202Eto: $76d0 might be a protection check? It reads to and writes from
203203the prog rom. Doesn't seem to cause problems though.
204204
205DIP locations verified for:
206    - bonzeadv (manual)
207    - cadash (manual)
208    - asuka (manual)
209    - mofflott (manual)
210    - galmedes (manual)
211
205212***************************************************************************/
206213
207214#include "driver.h"
r1771r1772
299306             MEMORY STRUCTURES
300307***********************************************************/
301308
302static ADDRESS_MAP_START( bonzeadv_readmem, ADDRESS_SPACE_PROGRAM, 16 )
303   AM_RANGE(0x000000, 0x03ffff) AM_READ(MRA16_ROM)
304   AM_RANGE(0x080000, 0x0fffff) AM_READ(MRA16_ROM)
305   AM_RANGE(0x10c000, 0x10ffff) AM_READ(MRA16_RAM)   /* main RAM */
306   AM_RANGE(0x200000, 0x200007) AM_READ(TC0110PCR_word_r)
309static ADDRESS_MAP_START( bonzeadv_map, ADDRESS_SPACE_PROGRAM, 16 )
310   AM_RANGE(0x000000, 0x03ffff) AM_ROM
311   AM_RANGE(0x080000, 0x0fffff) AM_ROM
312   AM_RANGE(0x10c000, 0x10ffff) AM_RAM
313   AM_RANGE(0x200000, 0x200007) AM_READWRITE(TC0110PCR_word_r, TC0110PCR_step1_word_w)
307314   AM_RANGE(0x390000, 0x390001) AM_READ(input_port_0_word_r)
308   AM_RANGE(0x3b0000, 0x3b0001) AM_READ(input_port_1_word_r)
309   AM_RANGE(0x3d0000, 0x3d0001) AM_READ(MRA16_NOP)
310   AM_RANGE(0x3e0002, 0x3e0003) AM_READ(taitosound_comm16_lsb_r)
311   AM_RANGE(0x800000, 0x8007ff) AM_READ(bonzeadv_cchip_ram_r)
312   AM_RANGE(0x800802, 0x800803) AM_READ(bonzeadv_cchip_ctrl_r)
313   AM_RANGE(0xc00000, 0xc0ffff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps */
314   AM_RANGE(0xc20000, 0xc2000f) AM_READ(TC0100SCN_ctrl_word_0_r)
315   AM_RANGE(0xd00000, 0xd03fff) AM_READ(PC090OJ_word_0_r)   /* sprite ram */
316ADDRESS_MAP_END
317
318static ADDRESS_MAP_START( bonzeadv_writemem, ADDRESS_SPACE_PROGRAM, 16 )
319   AM_RANGE(0x000000, 0x03ffff) AM_WRITE(MWA16_ROM)
320   AM_RANGE(0x10c000, 0x10ffff) AM_WRITE(MWA16_RAM)
321   AM_RANGE(0x200000, 0x200007) AM_WRITE(TC0110PCR_step1_word_w)
322315   AM_RANGE(0x3a0000, 0x3a0001) AM_WRITE(asuka_spritectrl_w)
316   AM_RANGE(0x3b0000, 0x3b0001) AM_READ(input_port_1_word_r)
323317   AM_RANGE(0x3c0000, 0x3c0001) AM_WRITE(watchdog_reset16_w)
318   AM_RANGE(0x3d0000, 0x3d0001) AM_READNOP
324319   AM_RANGE(0x3e0000, 0x3e0001) AM_WRITE(taitosound_port16_lsb_w)
325   AM_RANGE(0x3e0002, 0x3e0003) AM_WRITE(taitosound_comm16_lsb_w)
326   AM_RANGE(0x800000, 0x8007ff) AM_WRITE(bonzeadv_cchip_ram_w)
327   AM_RANGE(0x800802, 0x800803) AM_WRITE(bonzeadv_cchip_ctrl_w)
320   AM_RANGE(0x3e0002, 0x3e0003) AM_READWRITE(taitosound_comm16_lsb_r, taitosound_comm16_lsb_w)
321   AM_RANGE(0x800000, 0x8007ff) AM_READWRITE(bonzeadv_cchip_ram_r, bonzeadv_cchip_ram_w)
322   AM_RANGE(0x800802, 0x800803) AM_READWRITE(bonzeadv_cchip_ctrl_r, bonzeadv_cchip_ctrl_w)
328323   AM_RANGE(0x800c00, 0x800c01) AM_WRITE(bonzeadv_cchip_bank_w)
329   AM_RANGE(0xc00000, 0xc0ffff) AM_WRITE(TC0100SCN_word_0_w)   /* tilemaps */
330   AM_RANGE(0xc20000, 0xc2000f) AM_WRITE(TC0100SCN_ctrl_word_0_w)
331   AM_RANGE(0xd00000, 0xd03fff) AM_WRITE(PC090OJ_word_0_w)   /* sprite ram */
324   AM_RANGE(0xc00000, 0xc0ffff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w)   /* tilemaps */
325   AM_RANGE(0xc20000, 0xc2000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w)
326   AM_RANGE(0xd00000, 0xd03fff) AM_READWRITE(PC090OJ_word_0_r, PC090OJ_word_0_w)   /* sprite ram */
332327ADDRESS_MAP_END
333328
334static ADDRESS_MAP_START( asuka_readmem, ADDRESS_SPACE_PROGRAM, 16 )
335   AM_RANGE(0x000000, 0x0fffff) AM_READ(MRA16_ROM)
336   AM_RANGE(0x100000, 0x103fff) AM_READ(MRA16_RAM)   /* RAM */
337   AM_RANGE(0x1076f0, 0x1076f1) AM_READ(MRA16_NOP)   /* Mofflott init does dummy reads here */
338   AM_RANGE(0x200000, 0x20000f) AM_READ(TC0110PCR_word_r)
339   AM_RANGE(0x3e0000, 0x3e0001) AM_READ(MRA16_NOP)
340   AM_RANGE(0x3e0002, 0x3e0003) AM_READ(taitosound_comm16_lsb_r)
341   AM_RANGE(0x400000, 0x40000f) AM_READ(TC0220IOC_halfword_r)
342   AM_RANGE(0xc00000, 0xc0ffff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps */
343   AM_RANGE(0xc20000, 0xc2000f) AM_READ(TC0100SCN_ctrl_word_0_r)
344   AM_RANGE(0xd00000, 0xd03fff) AM_READ(PC090OJ_word_0_r)   /* sprite ram */
345ADDRESS_MAP_END
346
347static ADDRESS_MAP_START( asuka_writemem, ADDRESS_SPACE_PROGRAM, 16 )
348   AM_RANGE(0x000000, 0x0fffff) AM_WRITE(MWA16_ROM)
349   AM_RANGE(0x100000, 0x103fff) AM_WRITE(MWA16_RAM)
350   AM_RANGE(0x200000, 0x20000f) AM_WRITE(TC0110PCR_step1_word_w)
329static ADDRESS_MAP_START( asuka_map, ADDRESS_SPACE_PROGRAM, 16 )
330   AM_RANGE(0x000000, 0x0fffff) AM_ROM
331   AM_RANGE(0x100000, 0x103fff) AM_RAM
332   AM_RANGE(0x1076f0, 0x1076f1) AM_READNOP   /* Mofflott init does dummy reads here */
333   AM_RANGE(0x200000, 0x20000f) AM_READWRITE(TC0110PCR_word_r, TC0110PCR_step1_word_w)
351334   AM_RANGE(0x3a0000, 0x3a0003) AM_WRITE(asuka_spritectrl_w)
352   AM_RANGE(0x3e0000, 0x3e0001) AM_WRITE(taitosound_port16_lsb_w)
353   AM_RANGE(0x3e0002, 0x3e0003) AM_WRITE(taitosound_comm16_lsb_w)
354   AM_RANGE(0x400000, 0x40000f) AM_WRITE(TC0220IOC_halfword_w)
355   AM_RANGE(0xc00000, 0xc0ffff) AM_WRITE(TC0100SCN_word_0_w)   /* tilemaps */
356   AM_RANGE(0xc10000, 0xc103ff) AM_WRITE(MWA16_NOP)   /* error in Asuka init code */
357   AM_RANGE(0xc20000, 0xc2000f) AM_WRITE(TC0100SCN_ctrl_word_0_w)
358   AM_RANGE(0xd00000, 0xd03fff) AM_WRITE(PC090OJ_word_0_w)   /* sprite ram */
335   AM_RANGE(0x3e0000, 0x3e0001) AM_READWRITE(MRA16_NOP, taitosound_port16_lsb_w)
336   AM_RANGE(0x3e0002, 0x3e0003) AM_READWRITE(taitosound_comm16_lsb_r, taitosound_comm16_lsb_w)
337   AM_RANGE(0x400000, 0x40000f) AM_READWRITE(TC0220IOC_halfword_r, TC0220IOC_halfword_w)
338   AM_RANGE(0xc00000, 0xc0ffff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w)   /* tilemaps */
339   AM_RANGE(0xc10000, 0xc103ff) AM_WRITENOP   /* error in Asuka init code */
340   AM_RANGE(0xc20000, 0xc2000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w)
341   AM_RANGE(0xd00000, 0xd03fff) AM_READWRITE(PC090OJ_word_0_r, PC090OJ_word_0_w)   /* sprite ram */
359342ADDRESS_MAP_END
360343
361static ADDRESS_MAP_START( cadash_readmem, ADDRESS_SPACE_PROGRAM, 16 )
362   AM_RANGE(0x000000, 0x07ffff) AM_READ(MRA16_ROM)
363   AM_RANGE(0x0c0000, 0x0c0001) AM_READ(MRA16_NOP)
364   AM_RANGE(0x0c0002, 0x0c0003) AM_READ(taitosound_comm16_lsb_r)
365   AM_RANGE(0x100000, 0x107fff) AM_READ(MRA16_RAM)   /* RAM */
366   AM_RANGE(0x800000, 0x800fff) AM_READ(MRA16_RAM)   /* network ram */
367   AM_RANGE(0x900000, 0x90000f) AM_READ(TC0220IOC_halfword_r)
368   AM_RANGE(0xa00000, 0xa0000f) AM_READ(TC0110PCR_word_r)
369   AM_RANGE(0xb00000, 0xb03fff) AM_READ(PC090OJ_word_0_r)   /* sprite ram */
370   AM_RANGE(0xc00000, 0xc0ffff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps */
371   AM_RANGE(0xc20000, 0xc2000f) AM_READ(TC0100SCN_ctrl_word_0_r)
372ADDRESS_MAP_END
373
374static ADDRESS_MAP_START( cadash_writemem, ADDRESS_SPACE_PROGRAM, 16 )
375   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(MWA16_ROM)
344static ADDRESS_MAP_START( cadash_map, ADDRESS_SPACE_PROGRAM, 16 )
345   AM_RANGE(0x000000, 0x07ffff) AM_ROM
376346   AM_RANGE(0x080000, 0x080003) AM_WRITE(asuka_spritectrl_w)
377   AM_RANGE(0x0c0000, 0x0c0001) AM_WRITE(taitosound_port16_lsb_w)
378   AM_RANGE(0x0c0002, 0x0c0003) AM_WRITE(taitosound_comm16_lsb_w)
379   AM_RANGE(0x100000, 0x107fff) AM_WRITE(MWA16_RAM)
380   AM_RANGE(0x800000, 0x800fff) AM_WRITE(MWA16_RAM)   /* network ram */
381   AM_RANGE(0x900000, 0x90000f) AM_WRITE(TC0220IOC_halfword_w)
382   AM_RANGE(0xa00000, 0xa0000f) AM_WRITE(TC0110PCR_step1_4bpg_word_w)
383   AM_RANGE(0xb00000, 0xb03fff) AM_WRITE(PC090OJ_word_0_w)   /* sprite ram */
384   AM_RANGE(0xc00000, 0xc0ffff) AM_WRITE(TC0100SCN_word_0_w)   /* tilemaps */
385   AM_RANGE(0xc20000, 0xc2000f) AM_WRITE(TC0100SCN_ctrl_word_0_w)
347   AM_RANGE(0x0c0000, 0x0c0001) AM_READWRITE(MRA16_NOP, taitosound_port16_lsb_w)
348   AM_RANGE(0x0c0002, 0x0c0003) AM_READWRITE(taitosound_comm16_lsb_r, taitosound_comm16_lsb_w)
349   AM_RANGE(0x100000, 0x107fff) AM_RAM
350   AM_RANGE(0x800000, 0x800fff) AM_RAM   /* network ram */
351   AM_RANGE(0x900000, 0x90000f) AM_READWRITE(TC0220IOC_halfword_r, TC0220IOC_halfword_w)
352   AM_RANGE(0xa00000, 0xa0000f) AM_READWRITE(TC0110PCR_word_r, TC0110PCR_step1_4bpg_word_w)
353   AM_RANGE(0xb00000, 0xb03fff) AM_READWRITE(PC090OJ_word_0_r, PC090OJ_word_0_w)   /* sprite ram */
354   AM_RANGE(0xc00000, 0xc0ffff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w)   /* tilemaps */
355   AM_RANGE(0xc20000, 0xc2000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w)
386356ADDRESS_MAP_END
387357
388static ADDRESS_MAP_START( eto_readmem, ADDRESS_SPACE_PROGRAM, 16 )
389   AM_RANGE(0x000000, 0x0fffff) AM_READ(MRA16_ROM)
390   AM_RANGE(0x100000, 0x10000f) AM_READ(TC0110PCR_word_r)
391   AM_RANGE(0x200000, 0x203fff) AM_READ(MRA16_RAM)   /* RAM */
392   AM_RANGE(0x300000, 0x30000f) AM_READ(TC0220IOC_halfword_r)
358static ADDRESS_MAP_START( eto_map, ADDRESS_SPACE_PROGRAM, 16 )   /* N.B. tc100scn mirror overlaps spriteram */
359   AM_RANGE(0x000000, 0x0fffff) AM_ROM
360   AM_RANGE(0x100000, 0x10000f) AM_READWRITE(TC0110PCR_word_r, TC0110PCR_step1_word_w)
361   AM_RANGE(0x200000, 0x203fff) AM_RAM
362   AM_RANGE(0x300000, 0x30000f) AM_READWRITE(TC0220IOC_halfword_r, TC0220IOC_halfword_w)
393363   AM_RANGE(0x400000, 0x40000f) AM_READ(TC0220IOC_halfword_r)   /* service mode mirror */
394   AM_RANGE(0x4e0000, 0x4e0001) AM_READ(MRA16_NOP)
395   AM_RANGE(0x4e0002, 0x4e0003) AM_READ(taitosound_comm16_lsb_r)
396   AM_RANGE(0xc00000, 0xc03fff) AM_READ(PC090OJ_word_0_r)   /* sprite ram */
397   AM_RANGE(0xd00000, 0xd0ffff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps */
398   AM_RANGE(0xd20000, 0xd2000f) AM_READ(TC0100SCN_ctrl_word_0_r)
399ADDRESS_MAP_END
400
401static ADDRESS_MAP_START( eto_writemem, ADDRESS_SPACE_PROGRAM, 16 )   /* N.B. tc100scn mirror overlaps spriteram */
402   AM_RANGE(0x000000, 0x0fffff) AM_WRITE(MWA16_ROM)
403   AM_RANGE(0x100000, 0x10000f) AM_WRITE(TC0110PCR_step1_word_w)
404   AM_RANGE(0x200000, 0x203fff) AM_WRITE(MWA16_RAM)
405   AM_RANGE(0x300000, 0x30000f) AM_WRITE(TC0220IOC_halfword_w)
406364   AM_RANGE(0x4a0000, 0x4a0003) AM_WRITE(asuka_spritectrl_w)
407   AM_RANGE(0x4e0000, 0x4e0001) AM_WRITE(taitosound_port16_lsb_w)
408   AM_RANGE(0x4e0002, 0x4e0003) AM_WRITE(taitosound_comm16_lsb_w)
409   AM_RANGE(0xc00000, 0xc03fff) AM_WRITE(PC090OJ_word_0_w)   /* sprite ram */
365   AM_RANGE(0x4e0000, 0x4e0001) AM_READWRITE(MRA16_NOP, taitosound_port16_lsb_w)
366   AM_RANGE(0x4e0002, 0x4e0003) AM_READWRITE(taitosound_comm16_lsb_r, taitosound_comm16_lsb_w)
367   AM_RANGE(0xc00000, 0xc03fff) AM_READWRITE(PC090OJ_word_0_r, PC090OJ_word_0_w)   /* sprite ram */
410368   AM_RANGE(0xc00000, 0xc0ffff) AM_WRITE(TC0100SCN_word_0_w)   /* service mode mirror */
411   AM_RANGE(0xd00000, 0xd0ffff) AM_WRITE(TC0100SCN_word_0_w)   /* tilemaps */
412   AM_RANGE(0xd20000, 0xd2000f) AM_WRITE(TC0100SCN_ctrl_word_0_w)
369   AM_RANGE(0xd00000, 0xd0ffff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w)   /* tilemaps */
370   AM_RANGE(0xd20000, 0xd2000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w)
413371ADDRESS_MAP_END
414372
415373
416374/***************************************************************************/
417375
418static ADDRESS_MAP_START( bonzeadv_z80_readmem, ADDRESS_SPACE_PROGRAM, 8 )
419   AM_RANGE(0x0000, 0x3fff) AM_READ(MRA8_ROM)
420   AM_RANGE(0x4000, 0x7fff) AM_READ(MRA8_BANK1)
421   AM_RANGE(0xc000, 0xdfff) AM_READ(MRA8_RAM)
422   AM_RANGE(0xe000, 0xe000) AM_READ(YM2610_status_port_0_A_r)
423   AM_RANGE(0xe001, 0xe001) AM_READ(YM2610_read_port_0_r)
424   AM_RANGE(0xe002, 0xe002) AM_READ(YM2610_status_port_0_B_r)
425   AM_RANGE(0xe201, 0xe201) AM_READ(taitosound_slave_comm_r)
426ADDRESS_MAP_END
427
428static ADDRESS_MAP_START( bonzeadv_z80_writemem, ADDRESS_SPACE_PROGRAM, 8 )
429   AM_RANGE(0x0000, 0x7fff) AM_WRITE(MWA8_ROM)
430   AM_RANGE(0xc000, 0xdfff) AM_WRITE(MWA8_RAM)
431   AM_RANGE(0xe000, 0xe000) AM_WRITE(YM2610_control_port_0_A_w)
432   AM_RANGE(0xe001, 0xe001) AM_WRITE(YM2610_data_port_0_A_w)
433   AM_RANGE(0xe002, 0xe002) AM_WRITE(YM2610_control_port_0_B_w)
376static ADDRESS_MAP_START( bonzeadv_z80_map, ADDRESS_SPACE_PROGRAM, 8 )
377   AM_RANGE(0x0000, 0x3fff) AM_ROM
378   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK(1)
379   AM_RANGE(0xc000, 0xdfff) AM_RAM
380   AM_RANGE(0xe000, 0xe000) AM_READWRITE(YM2610_status_port_0_A_r, YM2610_control_port_0_A_w)
381   AM_RANGE(0xe001, 0xe001) AM_READWRITE(YM2610_read_port_0_r, YM2610_data_port_0_A_w)
382   AM_RANGE(0xe002, 0xe002) AM_READWRITE(YM2610_status_port_0_B_r, YM2610_control_port_0_B_w)
434383   AM_RANGE(0xe003, 0xe003) AM_WRITE(YM2610_data_port_0_B_w)
435384   AM_RANGE(0xe200, 0xe200) AM_WRITE(taitosound_slave_port_w)
436   AM_RANGE(0xe201, 0xe201) AM_WRITE(taitosound_slave_comm_w)
437   AM_RANGE(0xe400, 0xe403) AM_WRITE(MWA8_NOP) /* pan */
438   AM_RANGE(0xe600, 0xe600) AM_WRITE(MWA8_NOP)
439   AM_RANGE(0xee00, 0xee00) AM_WRITE(MWA8_NOP)
440   AM_RANGE(0xf000, 0xf000) AM_WRITE(MWA8_NOP)
385   AM_RANGE(0xe201, 0xe201) AM_READWRITE(taitosound_slave_comm_r, taitosound_slave_comm_w)
386   AM_RANGE(0xe400, 0xe403) AM_WRITENOP /* pan */
387   AM_RANGE(0xe600, 0xe600) AM_WRITENOP
388   AM_RANGE(0xee00, 0xee00) AM_WRITENOP
389   AM_RANGE(0xf000, 0xf000) AM_WRITENOP
441390   AM_RANGE(0xf200, 0xf200) AM_WRITE(sound_bankswitch_w)
442391ADDRESS_MAP_END
443392
444static ADDRESS_MAP_START( z80_readmem, ADDRESS_SPACE_PROGRAM, 8 )
445   AM_RANGE(0x0000, 0x3fff) AM_READ(MRA8_ROM)
446   AM_RANGE(0x4000, 0x7fff) AM_READ(MRA8_BANK1)
447   AM_RANGE(0x8000, 0x8fff) AM_READ(MRA8_RAM)
448   AM_RANGE(0x9001, 0x9001) AM_READ(YM2151_status_port_0_r)
449   AM_RANGE(0x9002, 0x9100) AM_READ(MRA8_RAM)
450   AM_RANGE(0xa001, 0xa001) AM_READ(taitosound_slave_comm_r)
451ADDRESS_MAP_END
452
453static ADDRESS_MAP_START( z80_writemem, ADDRESS_SPACE_PROGRAM, 8 )
454   AM_RANGE(0x0000, 0x7fff) AM_WRITE(MWA8_ROM)
455   AM_RANGE(0x8000, 0x8fff) AM_WRITE(MWA8_RAM)
393static ADDRESS_MAP_START( z80_map, ADDRESS_SPACE_PROGRAM, 8 )
394   AM_RANGE(0x0000, 0x3fff) AM_ROM
395   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK(1)
396   AM_RANGE(0x8000, 0x8fff) AM_RAM
456397   AM_RANGE(0x9000, 0x9000) AM_WRITE(YM2151_register_port_0_w)
457   AM_RANGE(0x9001, 0x9001) AM_WRITE(YM2151_data_port_0_w)
398   AM_RANGE(0x9001, 0x9001) AM_READWRITE(YM2151_status_port_0_r, YM2151_data_port_0_w)
399//  AM_RANGE(0x9002, 0x9100) AM_READ(MRA8_RAM)
458400   AM_RANGE(0xa000, 0xa000) AM_WRITE(taitosound_slave_port_w)
459   AM_RANGE(0xa001, 0xa001) AM_WRITE(taitosound_slave_comm_w)
401   AM_RANGE(0xa001, 0xa001) AM_READWRITE(taitosound_slave_comm_r, taitosound_slave_comm_w)
460402   AM_RANGE(0xb000, 0xb000) AM_WRITE(asuka_msm5205_address_w)
461403   AM_RANGE(0xc000, 0xc000) AM_WRITE(asuka_msm5205_start_w)
462404   AM_RANGE(0xd000, 0xd000) AM_WRITE(asuka_msm5205_stop_w)
463405ADDRESS_MAP_END
464406
465407/* no MSM5205 */
466static ADDRESS_MAP_START( cadash_z80_writemem, ADDRESS_SPACE_PROGRAM, 8 )
467   AM_RANGE(0x0000, 0x7fff) AM_WRITE(MWA8_ROM)
468   AM_RANGE(0x8000, 0x8fff) AM_WRITE(MWA8_RAM)
408static ADDRESS_MAP_START( cadash_z80_map, ADDRESS_SPACE_PROGRAM, 8 )
409   AM_RANGE(0x0000, 0x3fff) AM_ROM
410   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK(1)
411   AM_RANGE(0x8000, 0x8fff) AM_RAM
469412   AM_RANGE(0x9000, 0x9000) AM_WRITE(YM2151_register_port_0_w)
470   AM_RANGE(0x9001, 0x9001) AM_WRITE(YM2151_data_port_0_w)
413   AM_RANGE(0x9001, 0x9001) AM_READWRITE(YM2151_status_port_0_r, YM2151_data_port_0_w)
471414   AM_RANGE(0xa000, 0xa000) AM_WRITE(taitosound_slave_port_w)
472   AM_RANGE(0xa001, 0xa001) AM_WRITE(taitosound_slave_comm_w)
415   AM_RANGE(0xa001, 0xa001) AM_READWRITE(taitosound_slave_comm_r, taitosound_slave_comm_w)
473416ADDRESS_MAP_END
474417
475418
r1771r1772
489432static INPUT_PORTS_START( bonzeadv )
490433   /* 0x390000 -> 0x10cb7c ($b7c,A5) */
491434   PORT_START_TAG("DSWA")
492   TAITO_MACHINE_COCKTAIL
493   TAITO_COINAGE_WORLD
435   TAITO_MACHINE_COCKTAIL_LOC(SWA)
436   TAITO_COINAGE_WORLD_LOC(SWA)
494437
495438   /* 0x3b0000 -> 0x10cb7e ($b7e,A5) */
496439   PORT_START_TAG("DSWB")
497   TAITO_DIFFICULTY
498   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) )            /* see notes */
499   PORT_DIPSETTING(    0x08, "40k 100k" )                       /* 300k 1000k 1500k 2000k 2500k 3000k 3500k 5000k */
500   PORT_DIPSETTING(    0x0c, "50k 150k" )                       /* 500k 1000k 2000k 3000k 4000k 5000k 6000k 7000k */
501   PORT_DIPSETTING(    0x04, "60k 200k" )                       /* 500k 1000k 2000k 3000k 4000k 5000k 6000k 7000k */
502   PORT_DIPSETTING(    0x00, "80k 250k" )                       /* 500k 1000k 2000k 3000k 4000k 5000k 6000k 7000k */
503   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) )
440   TAITO_DIFFICULTY_LOC(SWB)
441   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) )      PORT_DIPLOCATION("SWB:3,4") /* see notes */
442   PORT_DIPSETTING(    0x08, "40k 100k" )               /* 300k 1000k 1500k 2000k 2500k 3000k 3500k 5000k */
443   PORT_DIPSETTING(    0x0c, "50k 150k" )               /* 500k 1000k 2000k 3000k 4000k 5000k 6000k 7000k */
444   PORT_DIPSETTING(    0x04, "60k 200k" )               /* 500k 1000k 2000k 3000k 4000k 5000k 6000k 7000k */
445   PORT_DIPSETTING(    0x00, "80k 250k" )               /* 500k 1000k 2000k 3000k 4000k 5000k 6000k 7000k */
446   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) )         PORT_DIPLOCATION("SWB:5,6")
504447   PORT_DIPSETTING(    0x20, "2" )
505448   PORT_DIPSETTING(    0x30, "3" )
506449   PORT_DIPSETTING(    0x10, "4" )
507450   PORT_DIPSETTING(    0x00, "5" )
508   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Allow_Continue ) )
451   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Allow_Continue ) )   PORT_DIPLOCATION("SWB:7")
509452   PORT_DIPSETTING(    0x40, DEF_STR( No ) )
510453   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
511   PORT_DIPUNUSED( 0x80, IP_ACTIVE_LOW )                        /* see notes */
454   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SWB:8" )         /* see notes */
512455
513456   PORT_START_TAG("800007")
514457   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
r1771r1772
544487   PORT_INCLUDE(bonzeadv)
545488
546489   PORT_MODIFY("DSWA")
547   TAITO_COINAGE_JAPAN_OLD
490   TAITO_COINAGE_JAPAN_OLD_LOC(SWA)
548491INPUT_PORTS_END
549492
550493static INPUT_PORTS_START( asuka )
551494   /* 0x400000 -> 0x103618 */
552495   PORT_START_TAG("DSWA")
553   TAITO_MACHINE_NO_COCKTAIL
554   TAITO_COINAGE_JAPAN_OLD
496   TAITO_MACHINE_NO_COCKTAIL_LOC(SWA)
497   TAITO_COINAGE_JAPAN_OLD_LOC(SWA)
555498
556499   /* 0x400002 -> 0x10361c */
557500   PORT_START_TAG("DSWB")
558   TAITO_DIFFICULTY
559   PORT_DIPNAME( 0x0c, 0x0c, "Bonus Points" )                   /* for each plane shot after each end of level boss */
501   TAITO_DIFFICULTY_LOC(SWB)
502   PORT_DIPNAME( 0x0c, 0x0c, "Bonus Points" )            PORT_DIPLOCATION("SWB:3,4") /* for each plane shot after each end of level boss */
560503   PORT_DIPSETTING(    0x0c, "500" )
561504   PORT_DIPSETTING(    0x08, "1500" )
562505   PORT_DIPSETTING(    0x04, "2000" )
563506   PORT_DIPSETTING(    0x00, "2500" )
564   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) )
507   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) )         PORT_DIPLOCATION("SWB:5,6")
565508   PORT_DIPSETTING(    0x10, "1" )
566509   PORT_DIPSETTING(    0x20, "2" )
567510   PORT_DIPSETTING(    0x30, "3" )
568511   PORT_DIPSETTING(    0x00, "4" )
569   PORT_DIPNAME( 0xc0, 0x40, DEF_STR( Allow_Continue ) )
512   PORT_DIPNAME( 0xc0, 0x80, DEF_STR( Allow_Continue ) )   PORT_DIPLOCATION("SWB:7,8")
570513   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
571   PORT_DIPSETTING(    0xc0, "Up to Level 2" )
572   PORT_DIPSETTING(    0x80, "Up to Level 3" )
514   PORT_DIPSETTING(    0xc0, "Up To Level 2" )
515   PORT_DIPSETTING(    0x80, "Up To Level 3" )
573516   PORT_DIPSETTING(    0x40, DEF_STR( Yes ) )
574517
575518   PORT_START_TAG("IN0")
r1771r1772
594537
595538   /* 0x400000 -> 0x100a92.b */
596539   PORT_MODIFY("DSWA")
597   TAITO_MACHINE_COCKTAIL
598   TAITO_COINAGE_JAPAN_OLD
540   TAITO_MACHINE_COCKTAIL_LOC(SWA)
599541
600542   /* 0x400002 -> 0x100a93.b */
601543   PORT_MODIFY("DSWB")
602   TAITO_DIFFICULTY
603   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) )
604   PORT_DIPSETTING(    0x0c, "20k and every 50k" )
605   PORT_DIPSETTING(    0x08, "50k and every 100k" )
606   PORT_DIPSETTING(    0x04, "100k only" )
544   TAITO_DIFFICULTY_LOC(SWB)
545   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) )      PORT_DIPLOCATION("SWB:3,4")
546   PORT_DIPSETTING(    0x0c, "20k And Every 50k" )
547   PORT_DIPSETTING(    0x08, "50k And Every 100k" )
548   PORT_DIPSETTING(    0x04, "100k Only" )
607549   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
608   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) )
550   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) )         PORT_DIPLOCATION("SWB:5,6")
609551   PORT_DIPSETTING(    0x00, "2" )
610552   PORT_DIPSETTING(    0x30, "3" )
611553   PORT_DIPSETTING(    0x10, "4" )
612554   PORT_DIPSETTING(    0x20, "5" )
613   PORT_DIPNAME( 0x40, 0x40, "Invulnerability (Cheat)")
555   PORT_DIPNAME( 0x40, 0x40, "Invulnerability (Cheat)")   PORT_DIPLOCATION("SWB:7")
614556   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
615557   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
616   PORT_DIPNAME( 0x80, 0x80, "Number of Keys" )
617   PORT_DIPSETTING(    0x00, "14" ) /* Hard */
618   PORT_DIPSETTING(    0x80, "16" ) /* Easy */
558   PORT_DIPNAME( 0x80, 0x80, "Number Of Keys" )         PORT_DIPLOCATION("SWB:8")
559   PORT_DIPSETTING(    0x00, "B 14" )                  /* Hard */
560   PORT_DIPSETTING(    0x80, "A 16" )                  /* Easy */
619561INPUT_PORTS_END
620562
621563/* different players and system inputs than 'asuka' */
622564static INPUT_PORTS_START( cadash )
623565   /* 0x900000 -> 0x10317a ($317a,A5) */
624566   PORT_START_TAG("DSWA")
625   TAITO_MACHINE_NO_COCKTAIL
626   TAITO_COINAGE_WORLD
567   TAITO_MACHINE_NO_COCKTAIL_LOC(SWA)
568   TAITO_COINAGE_WORLD_LOC(SWA)
627569
628570   /* 0x900002 -> 0x10317c ($317c,A5) */
629571   PORT_START_TAG("DSWB")
630   TAITO_DIFFICULTY
631   PORT_DIPNAME( 0x0c, 0x0c, "Starting Time" )
572   TAITO_DIFFICULTY_LOC(SWB)
573   PORT_DIPNAME( 0x0c, 0x0c, "Starting Time" )         PORT_DIPLOCATION("SWB:3,4")
632574   PORT_DIPSETTING(    0x00, "5:00" )
633575   PORT_DIPSETTING(    0x04, "6:00" )
634576   PORT_DIPSETTING(    0x0c, "7:00" )
r1771r1772
639581   /*       3            8:00  */
640582   /*       4            7:00  */
641583   /*       5            9:00  */
642   PORT_DIPNAME( 0x30, 0x30, "Added Time (after round clear)" )
584   PORT_DIPNAME( 0x30, 0x30, "Added Time (after round clear)" ) PORT_DIPLOCATION("SWB:5,6")
643585   PORT_DIPSETTING(    0x00, "Default - 2:00" )
644586   PORT_DIPSETTING(    0x10, "Default - 1:00" )
645587   PORT_DIPSETTING(    0x30, "Default" )
646588   PORT_DIPSETTING(    0x20, "Default + 1:00" )
647   PORT_DIPNAME( 0xc0, 0xc0, "Communication Mode" )
589   PORT_DIPNAME( 0xc0, 0xc0, "Communication Mode" )   PORT_DIPLOCATION("SWB:7,8")
648590   PORT_DIPSETTING(    0xc0, "Stand alone" )
649591   PORT_DIPSETTING(    0x80, "Master" )
650592   PORT_DIPSETTING(    0x00, "Slave" )
r1771r1772
671613   PORT_INCLUDE(cadash)
672614
673615   PORT_MODIFY("DSWA")
674   TAITO_COINAGE_JAPAN_OLD
616   TAITO_COINAGE_JAPAN_OLD_LOC(SWA)
675617INPUT_PORTS_END
676618
677619static INPUT_PORTS_START( cadashu )
678620   PORT_INCLUDE(cadash)
679621
680622   PORT_MODIFY("DSWA")
681   TAITO_COINAGE_US
623   TAITO_COINAGE_US_LOC(SWA)
682624INPUT_PORTS_END
683625
684626static INPUT_PORTS_START( galmedes )
r1771r1772
686628
687629   /* 0x400000 -> 0x100982 */
688630   PORT_MODIFY("DSWA")
689   TAITO_MACHINE_NO_COCKTAIL
690   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) )
631   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) )      PORT_DIPLOCATION("SWA:5,6")
691632   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
692633   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
693634   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
r1771r1772
696637   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
697638   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
698639   PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
699   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) )
640   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) )      PORT_DIPLOCATION("SWA:7,8")
700641   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
701642   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
702643   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
r1771r1772
708649
709650   /* 0x400002 -> 0x100984 */
710651   PORT_MODIFY("DSWB")
711   TAITO_DIFFICULTY
712   PORT_DIPNAME( 0x0c, 0x08, DEF_STR( Bonus_Life ) )
713   PORT_DIPSETTING(    0x08, "every 100k" )
714   PORT_DIPSETTING(    0x0c, "100k and every 200k" )
715   PORT_DIPSETTING(    0x04, "150k and every 200k" )
716   PORT_DIPSETTING(    0x00, "every 200k" )
717   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) )
652   TAITO_DIFFICULTY_LOC(SWB)
653   PORT_DIPNAME( 0x0c, 0x08, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SWB:3,4")
654   PORT_DIPSETTING(    0x08, "Every 100k" )
655   PORT_DIPSETTING(    0x0c, "100k And Every 200k" )
656   PORT_DIPSETTING(    0x04, "150k And Every 200k" )
657   PORT_DIPSETTING(    0x00, "Every 200k" )
658   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) )      PORT_DIPLOCATION("SWB:5,6")
718659   PORT_DIPSETTING(    0x20, "1" )
719660   PORT_DIPSETTING(    0x10, "2" )
720661   PORT_DIPSETTING(    0x30, "3" )
721662   PORT_DIPSETTING(    0x00, "4" )
722   PORT_DIPUNUSED( 0x40, IP_ACTIVE_LOW )
723   PORT_DIPNAME( 0x80, 0x80, "Coin Mode" )
724   PORT_DIPSETTING(    0x80, "Mode A (Japan)" ) /* Mode A is TAITO_COINAGE_JAPAN_OLD */
725   PORT_DIPSETTING(    0x00, "Mode B (World)" ) /* Mode B is TAITO_COINAGE_WORLD */
663   PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SWB:7" )      /* Listed as "Unused" */
664   PORT_DIPNAME( 0x80, 0x80, "Coin Mode" )            PORT_DIPLOCATION("SWB:8")
665   PORT_DIPSETTING(    0x80, "Mode A (Japan)" )      /* Mode A is TAITO_COINAGE_JAPAN_OLD */
666   PORT_DIPSETTING(    0x00, "Mode B (World)" )      /* Mode B is TAITO_COINAGE_WORLD */
726667INPUT_PORTS_END
727668
728669static INPUT_PORTS_START( earthjkr )
729670   PORT_INCLUDE(asuka)
671   /* DSWA: 0x400000 -> 0x100932 */
730672
731   /* 0x400000 -> 0x100932 */
732   PORT_MODIFY("DSWA")
733   TAITO_MACHINE_NO_COCKTAIL
734   TAITO_COINAGE_JAPAN_OLD
735
736673   /* 0x400002 -> 0x1009842 */
737674   PORT_MODIFY("DSWB")
738   TAITO_DIFFICULTY
739   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) )
675   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SWB:3,4")
740676   PORT_DIPSETTING(    0x00, "100k and 300k" )
741677   PORT_DIPSETTING(    0x08, "100k only" )
742678   PORT_DIPSETTING(    0x04, "200k only" )
743679   PORT_DIPSETTING(    0x0c, DEF_STR( None ) )
744   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) )
680   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) )      PORT_DIPLOCATION("SWB:5,6")
745681   PORT_DIPSETTING(    0x00, "1" )
746682   PORT_DIPSETTING(    0x30, "2" )
747683   PORT_DIPSETTING(    0x20, "3" )
748684   PORT_DIPSETTING(    0x10, "4" )
749   PORT_DIPNAME( 0x40, 0x40, "Copyright" )                      /* code at 0x00b982 and 0x00dbce */
685   PORT_DIPNAME( 0x40, 0x40, "Copyright" )            PORT_DIPLOCATION("SWB:7") /* code at 0x00b982 and 0x00dbce */
750686   PORT_DIPSETTING(    0x40, "Visco" )                          /* Japan notice screen ON */
751687   PORT_DIPSETTING(    0x00, "Visco (distributed by Romstar)" ) /* Japan notice screen OFF */
752   PORT_DIPUNUSED( 0x80, IP_ACTIVE_LOW )
688   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SWB:8" )
753689INPUT_PORTS_END
754690
755691static INPUT_PORTS_START( eto )
756692   PORT_INCLUDE(asuka)
693   /* DSWA: 0x300000 -> 0x200914 */
757694
758   /* 0x300000 -> 0x200914 */
759   PORT_MODIFY("DSWA")
760   TAITO_MACHINE_NO_COCKTAIL
761   TAITO_COINAGE_JAPAN_OLD
762
763695   /* 0x300002 -> 0x200916 */
764696   PORT_MODIFY("DSWB")
765   TAITO_DIFFICULTY
766   PORT_DIPUNUSED( 0x04, IP_ACTIVE_LOW )
767   PORT_DIPUNUSED( 0x08, IP_ACTIVE_LOW )
768   PORT_DIPUNUSED( 0x10, IP_ACTIVE_LOW )
769   PORT_DIPUNUSED( 0x20, IP_ACTIVE_LOW )                        /* value stored at 0x20090a but not read back */
770   PORT_DIPUNUSED( 0x40, IP_ACTIVE_LOW )
771   PORT_DIPUNUSED( 0x80, IP_ACTIVE_LOW )
697   PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SWB:3" )
698   PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SWB:4" )
699   PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SWB:5" )
700   PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SWB:6" )   /* value stored at 0x20090a but not read back */
701   PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SWB:7" )
702   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SWB:8" )
772703INPUT_PORTS_END
773704
774705
r1771r1772
851782
852783   /* basic machine hardware */
853784   MDRV_CPU_ADD(M68000, 8000000)    /* checked on PCB */
854   MDRV_CPU_PROGRAM_MAP(bonzeadv_readmem,bonzeadv_writemem)
785   MDRV_CPU_PROGRAM_MAP(bonzeadv_map,0)
855786   MDRV_CPU_VBLANK_INT(irq4_line_hold,1)
856787
857788   MDRV_CPU_ADD(Z80,4000000)    /* sound CPU, also required for test mode */
858   MDRV_CPU_PROGRAM_MAP(bonzeadv_z80_readmem,bonzeadv_z80_writemem)
789   MDRV_CPU_PROGRAM_MAP(bonzeadv_z80_map,0)
859790
860791   MDRV_INTERLEAVE(10)
861792
r1771r1772
887818
888819   /* basic machine hardware */
889820   MDRV_CPU_ADD(M68000, XTAL_16MHz/2)   /* verified on pcb */
890   MDRV_CPU_PROGRAM_MAP(asuka_readmem,asuka_writemem)
821   MDRV_CPU_PROGRAM_MAP(asuka_map,0)
891822   MDRV_CPU_VBLANK_INT(irq5_line_hold,1)
892823
893824   MDRV_CPU_ADD(Z80, XTAL_16MHz/4)   /* verified on pcb */
894   MDRV_CPU_PROGRAM_MAP(z80_readmem,z80_writemem)
825   MDRV_CPU_PROGRAM_MAP(z80_map,0)
895826
896827   MDRV_INTERLEAVE(10)
897828
r1771r1772
926857
927858   /* basic machine hardware */
928859   MDRV_CPU_ADD(M68000, XTAL_32MHz/2)   /* 68000p12 running at 16Mhz, verified on pcb  */
929   MDRV_CPU_PROGRAM_MAP(cadash_readmem,cadash_writemem)
860   MDRV_CPU_PROGRAM_MAP(cadash_map,0)
930861   MDRV_CPU_VBLANK_INT(cadash_interrupt,1)
931862
932863   MDRV_CPU_ADD(Z80, XTAL_8MHz/2)   /* verified on pcb */
933   MDRV_CPU_PROGRAM_MAP(z80_readmem,cadash_z80_writemem)
864   MDRV_CPU_PROGRAM_MAP(cadash_z80_map,0)
934865
935866   MDRV_INTERLEAVE(10)
936867
r1771r1772
961892
962893   /* basic machine hardware */
963894   MDRV_CPU_ADD(M68000, 8000000)   /* 8 MHz ??? */
964   MDRV_CPU_PROGRAM_MAP(asuka_readmem,asuka_writemem)
895   MDRV_CPU_PROGRAM_MAP(asuka_map,0)
965896   MDRV_CPU_VBLANK_INT(irq5_line_hold,1)
966897
967898   MDRV_CPU_ADD(Z80, 4000000)   /* 4 MHz ??? */
968   MDRV_CPU_PROGRAM_MAP(z80_readmem,z80_writemem)
899   MDRV_CPU_PROGRAM_MAP(z80_map,0)
969900
970901   MDRV_INTERLEAVE(10)
971902
r1771r1772
1000931
1001932   /* basic machine hardware */
1002933   MDRV_CPU_ADD(M68000, 8000000)   /* 8 MHz ??? */
1003   MDRV_CPU_PROGRAM_MAP(asuka_readmem,asuka_writemem)
934   MDRV_CPU_PROGRAM_MAP(asuka_map,0)
1004935   MDRV_CPU_VBLANK_INT(irq5_line_hold,1)
1005936
1006937   MDRV_CPU_ADD(Z80, 4000000)   /* 4 MHz ??? */
1007   MDRV_CPU_PROGRAM_MAP(z80_readmem,cadash_z80_writemem)
938   MDRV_CPU_PROGRAM_MAP(cadash_z80_map,0)
1008939
1009940   MDRV_INTERLEAVE(10)
1010941
r1771r1772
1035966
1036967   /* basic machine hardware */
1037968   MDRV_CPU_ADD(M68000, 8000000)   /* 8 MHz ??? */
1038   MDRV_CPU_PROGRAM_MAP(eto_readmem,eto_writemem)
969   MDRV_CPU_PROGRAM_MAP(eto_map,0)
1039970   MDRV_CPU_VBLANK_INT(irq5_line_hold,1)
1040971
1041972   MDRV_CPU_ADD(Z80, 4000000)   /* 4 MHz ??? */
1042   MDRV_CPU_PROGRAM_MAP(z80_readmem,cadash_z80_writemem)
973   MDRV_CPU_PROGRAM_MAP(cadash_z80_map,0)
1043974
1044975   MDRV_INTERLEAVE(10)
1045976
src/mame/drivers/backfire.c
r1771r1772
9494{
9595   int offs;
9696
97   flip_screen = 1;
97   flip_screen_set_no_update(1);
9898
9999   for (offs = (0x1400/4)-4;offs >= 0;offs -= 4) // 0x1400 for charlien
100100   {
r1771r1772
144144         inc = 1;
145145      }
146146
147      if (flip_screen)
147      if (flip_screen_x_get())
148148      {
149149         y=240-y;
150150         x=304-x;
src/mame/drivers/starwars.c
r1771r1772
383383   MDRV_CPU_ADD(M6809, MASTER_CLOCK / 8)
384384   MDRV_CPU_PROGRAM_MAP(main_map,0)
385385   MDRV_CPU_PERIODIC_INT(irq0_line_assert, (double)MASTER_CLOCK / 4096 / 12)
386   MDRV_WATCHDOG_TIME_INIT(ATTOTIME_IN_HZ(CLOCK_3KHZ / 128))
386   MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_HZ(CLOCK_3KHZ / 128))
387387
388388   MDRV_CPU_ADD(M6809, MASTER_CLOCK / 8)
389389   /* audio CPU */
r1771r1772
398398   MDRV_SCREEN_SIZE(400, 300)
399399   MDRV_SCREEN_VISIBLE_AREA(0, 250, 0, 280)
400400
401   MDRV_PALETTE_LENGTH(32768)
402
403401   MDRV_VIDEO_START(avg_starwars)
404402   MDRV_VIDEO_UPDATE(vector)
405403
src/mame/drivers/ajax.c
r1771r1772
1515#include "sound/2151intf.h"
1616#include "sound/k007232.h"
1717
18extern UINT8 *ajax_sharedram;
19
2018static WRITE8_HANDLER( k007232_extvol_w );
2119static WRITE8_HANDLER( sound_bank_w );
2220
2321/* from machine/ajax.c */
2422WRITE8_HANDLER( ajax_bankswitch_2_w );
25READ8_HANDLER( ajax_sharedram_r );
26WRITE8_HANDLER( ajax_sharedram_w );
2723READ8_HANDLER( ajax_ls138_f10_r );
2824WRITE8_HANDLER( ajax_ls138_f10_w );
2925MACHINE_RESET( ajax );
r1771r1772
3531
3632/****************************************************************************/
3733
38static ADDRESS_MAP_START( ajax_readmem, ADDRESS_SPACE_PROGRAM, 8 )
39   AM_RANGE(0x0000, 0x01c0) AM_READ(ajax_ls138_f10_r)         /* inputs + DIPSW */
40   AM_RANGE(0x0800, 0x0807) AM_READ(K051937_r)               /* sprite control registers */
41   AM_RANGE(0x0c00, 0x0fff) AM_READ(K051960_r)               /* sprite RAM 2128SL at J7 */
42   AM_RANGE(0x1000, 0x1fff) AM_READ(MRA8_RAM)      /* palette */
43   AM_RANGE(0x2000, 0x3fff) AM_READ(ajax_sharedram_r)         /* shared RAM with the 6809 */
44   AM_RANGE(0x4000, 0x5fff) AM_READ(MRA8_RAM)               /* RAM 6264L at K10*/
45   AM_RANGE(0x6000, 0x7fff) AM_READ(MRA8_BANK2)               /* banked ROM */
46   AM_RANGE(0x8000, 0xffff) AM_READ(MRA8_ROM)               /* ROM N11 */
34static ADDRESS_MAP_START( ajax_main_map, ADDRESS_SPACE_PROGRAM, 8 )
35   AM_RANGE(0x0000, 0x01c0) AM_READWRITE(ajax_ls138_f10_r, ajax_ls138_f10_w)   /* bankswitch + sound command + FIRQ command */
36   AM_RANGE(0x0800, 0x0807) AM_READWRITE(K051937_r, K051937_w)               /* sprite control registers */
37   AM_RANGE(0x0c00, 0x0fff) AM_READWRITE(K051960_r, K051960_w)               /* sprite RAM 2128SL at J7 */
38   AM_RANGE(0x1000, 0x1fff) AM_READWRITE(MRA8_RAM, paletteram_xBBBBBGGGGGRRRRR_be_w) AM_BASE(&paletteram)/* palette */
39   AM_RANGE(0x2000, 0x3fff) AM_RAM AM_SHARE(1)                           /* shared RAM with the 6809 */
40   AM_RANGE(0x4000, 0x5fff) AM_RAM                                    /* RAM 6264L at K10 */
41   AM_RANGE(0x6000, 0x7fff) AM_ROMBANK(2)                              /* banked ROM */
42   AM_RANGE(0x8000, 0xffff) AM_ROM                                    /* ROM N11 */
4743ADDRESS_MAP_END
4844
49static ADDRESS_MAP_START( ajax_writemem, ADDRESS_SPACE_PROGRAM, 8 )
50   AM_RANGE(0x0000, 0x01c0) AM_WRITE(ajax_ls138_f10_w)         /* bankswitch + sound command + FIRQ command */
51   AM_RANGE(0x0800, 0x0807) AM_WRITE(K051937_w)               /* sprite control registers */
52   AM_RANGE(0x0c00, 0x0fff) AM_WRITE(K051960_w)               /* sprite RAM 2128SL at J7 */
53   AM_RANGE(0x1000, 0x1fff) AM_WRITE(paletteram_xBBBBBGGGGGRRRRR_be_w) AM_BASE(&paletteram)/* palette */
54   AM_RANGE(0x2000, 0x3fff) AM_WRITE(ajax_sharedram_w)         /* shared RAM with the 6809 */
55   AM_RANGE(0x4000, 0x5fff) AM_WRITE(MWA8_RAM)               /* RAM 6264L at K10 */
56   AM_RANGE(0x6000, 0x7fff) AM_WRITE(MWA8_ROM)               /* banked ROM */
57   AM_RANGE(0x8000, 0xffff) AM_WRITE(MWA8_ROM)               /* ROM N11 */
45static ADDRESS_MAP_START( ajax_sub_map, ADDRESS_SPACE_PROGRAM, 8 )
46   AM_RANGE(0x0000, 0x07ff) AM_READWRITE(K051316_0_r, K051316_0_w)   /* 051316 zoom/rotation layer */
47   AM_RANGE(0x0800, 0x080f) AM_WRITE(K051316_ctrl_0_w)            /* 051316 control registers */
48   AM_RANGE(0x1000, 0x17ff) AM_READ(K051316_rom_0_r)            /* 051316 (ROM test) */
49   AM_RANGE(0x1800, 0x1800) AM_WRITE(ajax_bankswitch_2_w)         /* bankswitch control */
50   AM_RANGE(0x2000, 0x3fff) AM_RAM AM_SHARE(1)                  /* shared RAM with the 052001 */
51   AM_RANGE(0x4000, 0x7fff) AM_READWRITE(K052109_r, K052109_w)      /* video RAM + color RAM + video registers */
52   AM_RANGE(0x8000, 0x9fff) AM_ROMBANK(1)                     /* banked ROM */
53   AM_RANGE(0xa000, 0xffff) AM_ROM                           /* ROM I16 */
5854ADDRESS_MAP_END
5955
60static ADDRESS_MAP_START( ajax_readmem_2, ADDRESS_SPACE_PROGRAM, 8 )
61   AM_RANGE(0x0000, 0x07ff) AM_READ(K051316_0_r)      /* 051316 zoom/rotation layer */
62   AM_RANGE(0x1000, 0x17ff) AM_READ(K051316_rom_0_r)   /* 051316 (ROM test) */
63   AM_RANGE(0x2000, 0x3fff) AM_READ(ajax_sharedram_r)   /* shared RAM with the 052001 */
64   AM_RANGE(0x4000, 0x7fff) AM_READ(K052109_r)         /* video RAM + color RAM + video registers */
65   AM_RANGE(0x8000, 0x9fff) AM_READ(MRA8_BANK1)         /* banked ROM */
66   AM_RANGE(0xa000, 0xffff) AM_READ(MRA8_ROM)         /* ROM I16 */
67ADDRESS_MAP_END
68
69static ADDRESS_MAP_START( ajax_writemem_2, ADDRESS_SPACE_PROGRAM, 8 )
70   AM_RANGE(0x0000, 0x07ff) AM_WRITE(K051316_0_w)         /* 051316 zoom/rotation layer */
71   AM_RANGE(0x0800, 0x080f) AM_WRITE(K051316_ctrl_0_w)      /* 051316 control registers */
72   AM_RANGE(0x1800, 0x1800) AM_WRITE(ajax_bankswitch_2_w)   /* bankswitch control */
73   AM_RANGE(0x2000, 0x3fff) AM_WRITE(ajax_sharedram_w) AM_BASE(&ajax_sharedram)/* shared RAM with the 052001 */
74   AM_RANGE(0x4000, 0x7fff) AM_WRITE(K052109_w)            /* video RAM + color RAM + video registers */
75   AM_RANGE(0x8000, 0x9fff) AM_WRITE(MWA8_ROM)            /* banked ROM */
76   AM_RANGE(0xa000, 0xffff) AM_WRITE(MWA8_ROM)            /* ROM I16 */
77ADDRESS_MAP_END
78
79static ADDRESS_MAP_START( ajax_readmem_sound, ADDRESS_SPACE_PROGRAM, 8 )
80   AM_RANGE(0x0000, 0x7fff) AM_READ(MRA8_ROM)            /* ROM F6 */
81   AM_RANGE(0x8000, 0x87ff) AM_READ(MRA8_RAM)            /* RAM 2128SL at D16 */
82   AM_RANGE(0xa000, 0xa00d) AM_READ(K007232_read_port_0_r)   /* 007232 registers (chip 1) */
83   AM_RANGE(0xb000, 0xb00d) AM_READ(K007232_read_port_1_r)   /* 007232 registers (chip 2) */
84   AM_RANGE(0xc001, 0xc001) AM_READ(YM2151_status_port_0_r)   /* YM2151 */
85   AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r)         /* soundlatch_r */
86ADDRESS_MAP_END
87
88static ADDRESS_MAP_START( ajax_writemem_sound, ADDRESS_SPACE_PROGRAM, 8 )
89   AM_RANGE(0x0000, 0x7fff) AM_WRITE(MWA8_ROM)               /* ROM F6 */
90   AM_RANGE(0x8000, 0x87ff) AM_WRITE(MWA8_RAM)               /* RAM 2128SL at D16 */
56static ADDRESS_MAP_START( ajax_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
57   AM_RANGE(0x0000, 0x7fff) AM_ROM                        /* ROM F6 */
58   AM_RANGE(0x8000, 0x87ff) AM_RAM                        /* RAM 2128SL at D16 */
9159   AM_RANGE(0x9000, 0x9000) AM_WRITE(sound_bank_w)            /* 007232 bankswitch */
92   AM_RANGE(0xa000, 0xa00d) AM_WRITE(K007232_write_port_0_w)      /* 007232 registers (chip 1) */
93   AM_RANGE(0xb000, 0xb00d) AM_WRITE(K007232_write_port_1_w)      /* 007232 registers (chip 2) */
94   AM_RANGE(0xb80c, 0xb80c) AM_WRITE(k007232_extvol_w)   /* extra volume, goes to the 007232 w/ A11 */
95                                 /* selecting a different latch for the external port */
60   AM_RANGE(0xa000, 0xa00d) AM_READWRITE(K007232_read_port_0_r, K007232_write_port_0_w)      /* 007232 registers (chip 1) */
61   AM_RANGE(0xb000, 0xb00d) AM_READWRITE(K007232_read_port_1_r, K007232_write_port_1_w)      /* 007232 registers (chip 2) */
62   AM_RANGE(0xb80c, 0xb80c) AM_WRITE(k007232_extvol_w)         /* extra volume, goes to the 007232 w/ A11 */
63                                                /* selecting a different latch for the external port */
9664   AM_RANGE(0xc000, 0xc000) AM_WRITE(YM2151_register_port_0_w)   /* YM2151 */
97   AM_RANGE(0xc001, 0xc001) AM_WRITE(YM2151_data_port_0_w)      /* YM2151 */
65   AM_RANGE(0xc001, 0xc001) AM_READWRITE(YM2151_status_port_0_r, YM2151_data_port_0_w)      /* YM2151 */
66   AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r)            /* soundlatch_r */
9867ADDRESS_MAP_END
9968
10069
r1771r1772
270239
271240   /* basic machine hardware */
272241   MDRV_CPU_ADD(KONAMI, 3000000)   /* 12/4 MHz*/
273   MDRV_CPU_PROGRAM_MAP(ajax_readmem,ajax_writemem)
242   MDRV_CPU_PROGRAM_MAP(ajax_main_map,0)
274243   MDRV_CPU_VBLANK_INT(ajax_interrupt,1)   /* IRQs triggered by the 051960 */
275244
276245   MDRV_CPU_ADD(M6809, 3000000)   /* ? */
277   MDRV_CPU_PROGRAM_MAP(ajax_readmem_2,ajax_writemem_2)
246   MDRV_CPU_PROGRAM_MAP(ajax_sub_map,0)
278247
279248   MDRV_CPU_ADD(Z80, 3579545)   /* 3.58 MHz */
280   MDRV_CPU_PROGRAM_MAP(ajax_readmem_sound,ajax_writemem_sound)
249   MDRV_CPU_PROGRAM_MAP(ajax_sound_map,0)
281250
282251   MDRV_INTERLEAVE(10)
283252
src/osd/osdepend.h
r1771r1772
106106
107107******************************************************************************/
108108
109void osd_update(int skip_redraw);
109void osd_update(running_machine *machine, int skip_redraw);
110110
111111
112112
r1771r1772
117117
118118******************************************************************************/
119119
120void osd_update_audio_stream(INT16 *buffer, int samples_this_frame);
120void osd_update_audio_stream(running_machine *machine, INT16 *buffer, int samples_this_frame);
121121
122122/*
123123  control master volume. attenuation is the attenuation in dB (a negative
src/osd/windows/windows.mak
r1771r1772
135135# make msvcprep into a pre-build step
136136# OSPREBUILD = $(VCONV)
137137
138ifneq ($(CROSS_BUILD),1)
138139# add VCONV to the build tools
139140BUILD += $(VCONV)
140141
r1771r1772
147148   @cl.exe /nologo /O1 -D_CRT_SECURE_NO_DEPRECATE -c $< /Fo$@
148149
149150endif
151endif
150152
151153
152
153154#-------------------------------------------------
154155# due to quirks of using /bin/sh, we need to
155156# explicitly specify the current path
r1771r1772
301302
302303$(RESFILE): $(WINSRC)/mame.rc $(WINOBJ)/mamevers.rc
303304
304$(WINOBJ)/mamevers.rc: $(OBJ)/build/verinfo$(EXE) $(SRC)/version.c
305$(WINOBJ)/mamevers.rc: $(BUILDOUT)/verinfo$(BUILD_EXE) $(SRC)/version.c
305306   @echo Emitting $@...
306   @$(OBJ)/build/verinfo$(EXE) $(SRC)/version.c > $@
307   @$(BUILDOUT)/verinfo$(BUILD_EXE) -b windows $(SRC)/version.c > $@
308
src/osd/windows/sound.c
r1771r1772
2020#include "osdepend.h"
2121#include "driver.h"
2222#include "osdepend.h"
23#include "deprecat.h"
2423
2524// MAMEOS headers
2625#include "winmain.h"
r1771r1772
7473//============================================================
7574
7675static void       sound_exit(running_machine *machine);
77static HRESULT      dsound_init(void);
76static HRESULT      dsound_init(running_machine *machine);
7877static void         dsound_kill(void);
7978static HRESULT      dsound_create_buffers(void);
8079static void         dsound_destroy_buffers(void);
r1771r1772
10099
101100   // attempt to initialize directsound
102101   // don't make it fatal if we can't -- we'll just run without sound
103   dsound_init();
102   dsound_init(machine);
104103}
105104
106105
r1771r1772
174173//  osd_update_audio_stream
175174//============================================================
176175
177void osd_update_audio_stream(INT16 *buffer, int samples_this_frame)
176void osd_update_audio_stream(running_machine *machine, INT16 *buffer, int samples_this_frame)
178177{
179178   int bytes_this_frame = samples_this_frame * stream_format.nBlockAlign;
180179   DWORD play_position, write_position;
r1771r1772
248247//  dsound_init
249248//============================================================
250249
251static HRESULT dsound_init(void)
250static HRESULT dsound_init(running_machine *machine)
252251{
253252   HRESULT result;
254253
r1771r1772
281280   stream_format.wBitsPerSample   = 16;
282281   stream_format.wFormatTag      = WAVE_FORMAT_PCM;
283282   stream_format.nChannels         = 2;
284   stream_format.nSamplesPerSec   = Machine->sample_rate;
283   stream_format.nSamplesPerSec   = machine->sample_rate;
285284   stream_format.nBlockAlign      = stream_format.wBitsPerSample * stream_format.nChannels / 8;
286285   stream_format.nAvgBytesPerSec   = stream_format.nSamplesPerSec * stream_format.nBlockAlign;
287286
src/osd/windows/vconv.c
r1771r1772
2525#define VS7      0x00070000
2626#define VS71   0x0007000a
2727#define VS2005   0x00080000
28#define VS2008   0x00090000
2829
2930
3031
r1771r1772
9192
9293static const translation_info ld_translate[] =
9394{
95   { VS2008,   "-lbufferoverflowu","" },
9496   { 0,      "-l*",            "*.lib" },
9597   { 0,      "-o*",            "/out:*" },
9698   { 0,      "-Wl,-Map,*",      "/map:*" },
src/osd/windows/video.c
r1771r1772
3030#include "render.h"
3131#include "rendutil.h"
3232#include "ui.h"
33#include "deprecat.h"
3433
3534// MAMEOS headers
3635#include "winmain.h"
r1771r1772
7776
7877static void check_osd_inputs(void);
7978
80static void extract_video_config(void);
81static void load_effect_overlay(const char *filename);
79static void extract_video_config(running_machine *machine);
80static void load_effect_overlay(running_machine *machine, const char *filename);
8281static float get_aspect(const char *name, int report_error);
8382static void get_resolution(const char *name, win_window_config *config, int report_error);
8483
r1771r1772
9695   add_exit_callback(machine, video_exit);
9796
9897   // extract data from the options
99   extract_video_config();
98   extract_video_config(machine);
10099
101100   // set up monitors first
102101   init_monitors();
r1771r1772
203202//  osd_update
204203//============================================================
205204
206void osd_update(int skip_redraw)
205void osd_update(running_machine *machine, int skip_redraw)
207206{
208207   win_window_info *window;
209208
r1771r1772
375374//  extract_video_config
376375//============================================================
377376
378static void extract_video_config(void)
377static void extract_video_config(running_machine *machine)
379378{
380379   const char *stemp;
381380
r1771r1772
391390#endif
392391   stemp                      = options_get_string(mame_options(), WINOPTION_EFFECT);
393392   if (strcmp(stemp, "none") != 0)
394      load_effect_overlay(stemp);
393      load_effect_overlay(machine, stemp);
395394
396395   // per-window options: extract the data
397396   get_resolution(WINOPTION_RESOLUTION0, &video_config.window[0], TRUE);
r1771r1772
449448//  load_effect_overlay
450449//============================================================
451450
452static void load_effect_overlay(const char *filename)
451static void load_effect_overlay(running_machine *machine, const char *filename)
453452{
454453   char *tempstr = malloc_or_die(strlen(filename) + 5);
455454   int numscreens;
r1771r1772
473472   }
474473
475474   // set the overlay on all screens
476   numscreens = video_screen_count(Machine->config);
475   numscreens = video_screen_count(machine->config);
477476   for (scrnum = 0; scrnum < numscreens; scrnum++)
478477      render_container_set_overlay(render_container_get_screen(scrnum), effect_bitmap);
479478
src/osd/winui/mui_opts.c
r1771r1772
27122712
27132713      astring *basename;
27142714      astring *srcname;
2715      machine_config *config = machine_config_alloc(driver->drv);
2715      machine_config *config = machine_config_alloc(driver->machine_config);
27162716
27172717      /* parse "vector.ini" for vector games */
27182718      if (isDriverVector(config))
src/osd/winui/help/docs/whatsnew.txt
r1771r1772
10.123
2-----
3
4
5MAMETesters Bugs Fixed
6----------------------
7taito_f3.c0122u8red [Aaron Giles]
8dubugchunklength0122u7gre [Aaron Giles]
9m62.c0122u7yel [Aaron Giles]
10qix.c0122u8red [Atari Ace]
11yard.c0122u7yel [Aaron Giles]
12
13
14
15Source Changes
16--------------
17Fixed crash in debugcmt with starting with no game on the command-line.
18[Andrew Gardner]
19
20Fixed PSR transfers in the ARM7 core. [R. Belmont]
21
22Fixed regression in cpu_spinuntil* calls that broke a number of games.
23[Aaron Giles]
24
25Fixed ADPCM in m62 games. Did some additional cleanup. [Aaron Giles]
26
27Fixed palette gradient for promutrv. [Pierpaolo Prazzoli]
28
29Fixed watchdog behavior when not explicitly specified. [Aaron Giles]
30
31Fixed sprite placement again in chinagat driver. [Aaron Giles]
32
33Fixed incorrect default screen siz
34
35
36
37New clones added
38----------------
39Vs. Janshi Brandnew Stars (MegaSystem32 Version) [David Haywood]
40
41
42
430.122u8
10.123u1
442-------
453
464
475MAMETesters Bugs Fixed
486----------------------
49stadhero0122u3gra [RansAckeR]
50wboy3_0119u3gra [RansAckeR]
51zerohour0122u6gra [RansAckeR]
52strahl0122u6yel [Mamesick]
53cmv801_0116gra [RansAckeR]
7jantouki0121u3gra [RansAckeR]
8mcnpshnt0120u3gra [RansAckeR]
9mjdialq2_0120u3gra [RansAckeR]
10mjifb0111u2gra [RansAckeR]
11goldbug0105u4gra [stephh]
12zn.c0122u8yel [smf]
13pwrinst2_0122u8gra [Sonikos]
5414
5515
5616
5717Source Changes
5818--------------
59Added deprecat.h that contains some deprecated/discouraged contructs.
60The idea is to create extra work if a driver wants to use these and
61hopefully gives an incentive to look for an alternate solution. Added
62#include of deprecat.h that rely on these contructs. Removed a bunch
63of unneccassary #include's from these files. [Zsolt Vasvari]
19Removed 'type' parameter from tilemap_create. [Zsolt Vasvari]
6420
65Simplified Star Fire driver. [Zsolt Vasvari]
21audio/dkong.c: [couriersud]
22 * fix dkong audio over-modulation issue with DAC sound
23 * surround the fix with a DK_REVIEW define for later review.
6624
67drawgfx changes: [Zsolt Vasvari]
68 - Removed copybitmap_remap and copyscrollbitmap_remap, neither which
69    was used by anybody
70 - Removed some obsolete commented out code
71 - Fixed up some comments
72 - Removed TRANSPARENCY_NONE case from copybitmap_core, which can
73    never happen
74 - Removed TRANSPARENCY_BLEND completely and TRANSPARENCY_BLEND_RAW
75    as an option to copybitmap. Source tree needs to be recompiled
76    as the transparancy mode enum has changed.
77 - Removed TRANSPARENCY_NONE_RAW, TRANSPARENCY_PENS_RAW and
78    TRANSPARENCY_PEN_TABLE_RAW as they were no longer used.
79 - Changed copybitmap and copyscrollbitmap. There are now 2 versions
80    of each, one without and with transparency.
25Changed the use of machine->remapped_colortable to machine->pens where
26the drivers weren't using color tables. [Zsolt Vasvari]
8127
82Fixed crash in masao. [couriersud]
28Corrected the clocks on the following pcbs: Formation Z, MagMax,
29SlapFight and Tiger Heli. Changed Oki m6295 pin 7 to "high" on Toki
30and Blood Bros. [Corrado Tomaselli]
8331
84Corrected previous i0851 timer fix to use more accurate IE SFRs.
85[Jim Stolis]
32Improve build independence for CPU/sound cores. Rescued the M65CE02
33core from bitrot hell, and fixed some MESS cores that were broken by
34the deprecat.h changes. [Atari Ace]
8635
87jedi.c updates: [Zsolt Vasvari]
88 - Changed video code to directly manipulate the game bitmap
89 - Background smoothing now happens at the same time as the background
90    is drawn
36Corrected the initial detection of extended INP files.
37[Barry Rodewald]
9138
92Fixed the CPS driver to at least display the correct clock in the
93driver info, by degrading the clock through alternate means.
94[David Haywood]
39Moved Galaxy Games emulation to tmaster.c. [Luca Elia]
9540
96m62.c changes: [couriersud]
97 * fixed wrong resistor value (22K to 2.2K) - verified on spelunkr
98    and kidniki hires pcb pictures
99 * Changed resistor network calculation based on assumption that cs
100    line is active either on tiles or sprites color prom.
41makefile/build updates: [couriersud, Aaron Giles]
42 * moved verinfo.c to src/build
43 * moved rules for verinfo to src/build/build.mak
44 * removed osdcore.h from file2str.c, verinfo.c, png2bdc.c
10145
102Simplified the video code for crgolf. [Zsolt Vasvari]
46Removed color tables from gsword, hyperspt, jailbrek, magmax,
47konamigx, markham, megazone, pandoras, rocnrope, strnskil, trackfld,
48tp84, shaolins, scotrsht, pingpong, skykid, wiping, punchout, ikki,
49rallyx, fastfred, fcombat, finalizr, flower, funworld, galivan,
50gdrawpkr, goldstar, hanaawas, higemaru, ironhors, jackal, kchamp.
51Added resnet.c color computations where appropriate. [Zsolt Vasvari]
10352
104Added PCB layouts for Penguin Bros & Puzzle De Bowling based on
105Hi-res pics. Corrected the seta2.c 68301 base clock as 50MHz / 3
106(16.66666MHz) as all the Seta2 hardware has a 50MHz OSC. Secondary OSC
107are for other chips (28MHz and or 32.53047MHz). [Brian Troha]
53Simplfied Mag Max background drawing code. [Zsolt Vasvari]
10854
109Simplified video code and adjusted some set names in the leland
110driver. [Zsolt Vasvari]
55Further altered the Exidy 440 code in preparation for moving to proper
56sound chip emulation. [Zsolt Vasvari]
11157
112Replaced tables with equations in the Sega C2 driver.
113[Nicola Salmoria]
58Unified transparency handling between scotrsht, shaolins, tp84.
59[Zsolt Vasvari]
11460
115Added checks for CROSS_BUILD=1 to omit building m68kmake.exe,
116verinfo.exe, png2bdc.exe and file2str. Enables building mame using
117mingw on linux. [couriersud]
61Split timer_adjust() into timer_adjust_oneshot() and
62timer_adjust_periodic(). Updated all call sites. [Aaron Giles]
11863
119Various Irem driver updates: [Aaron Giles]
120 * Properly tagged m52 and m62 sound boards, plus variants.
121 * Updated all connected drivers.
122 * Merged memory maps.
123 * Proper video timing in 10 yard fight.
124 * Converted troangel to tilemaps.
125 * Moved definitions to header files.
126 * Updated mpatrol, yard to use resnet for colors.
127 * Renamed mpatrol -> m52
128 * Renamed troangel -> m57
129 * Renamed yard -> m58
64Fixed some arkanoid clones INPUT_PORTS definitions that were curiously
65using PORT_START_TAG("DSW") instead of PORT_MODIFY("DSW"). [stephh]
13066
131Cleaned up 20pacgal driver, including driver state. Tried improving
132on the ROM mirroring, without any success. [Zsolt Vasvari]
67Fixed DIP switches and inputs for all games in cvs.c. [stephh]
13368
134Removed colortables from a number of drivers, as part of a larger
135move to phase out old-style colortables: gotya, gyruss, ampoker,
136circusc, clshroad, champbas, 1943, lucky8, olibochu, yamato,
137appoooh, bking, bladestl, blueprnt, carpolo, centiped, cop01,
138cosmic, ddrible, irobot, ace, alpha68k, arabian, bfm_sc2, carjmbre,
139cclimber, cherrym2, combatsc, contra, fastlane, hcastle, labyrunr,
140cham24, multigam. [Zsolt Vasvari]
69Added HOTD2-specific BIOSes. [Arzeno Fabrice]
14170
142Removed non-existent, second M6295 from Hit the Ice. Fixes missing
143sounds (e.g. team select screen). Hit the Ice/Violence Fight now
144share the same sound CPU memory maps. [Philip Bennett]
145
146Improved DIP switches according to manuals for the following drivers:
147wboy, chplft, extdwnhl, zingzip, zaxxon, congo, vanguard, zarzon,
148nibbler, segag80r.c, yard, kaneko16.c. [RansAckeR]
149
150Verified the sound roms for Rock'n 3 and added proper names. Added
151PCB layout for sound rom board only. [Brian Troha]
152
153Cleaned up Time Pilot sound board implementation: [Aaron Giles]
154 * full memory maps
155 * partial machine driver removes need for replicating filtering logic
156 * updated all relevant drivers
157
158Cleaned up Time Pilot and Tutankham drivers: [Aaron Giles]
159 * correct clocks where possible
160 * merged memory maps
161 * fully decoded memory maps
162 * replaced hacky sprite rendering in Time Pilot with partial updates
163 * save state support
164 * removed Power Surge kludge, replaced with unmapped handler control
165 * Tutankham runs at 60fps, with IRQs every other frame
166 * Proper IRQ ack in Tutankham
167 * Proper NMI generation in Time Pilot
168
169Cleaned up pooyan driver. Save states, full memory maps, proper NMI
170generation, etc. Flipped video to align better with Time Pilot.
171[Aaron Giles]
172
173Changed 6840 interrupt handling to work like the recent 6821 changes.
174Updated MPU4 driver accordingly. Updated Scorpion 2 driver to match
175MPU4 coding style. [James Wallace]
176
177Resolved all unknown dips in the galpani2 driver according to kaneko's
178docs, unified memory maps of both CPUs and repositioned a pair of
179graphic ROMS. [Luis Faria]
180
181Made some minor improvements to 1942.c & 1943.c DIPs. Improved
182segas16a.c, segas16b.c & system16.c DIPs and added DIP locations
183from manuals. [RansAckeR]
184
185Removed distinction between *_gettotalcycles() and
186*_gettotalcycles64(). All functions now return 64-bit results. Updated
187all call sites appropriately. [Aaron Giles]
188
189Further improvements to SCSP FM. [kingshriek]
190
191Moved cpu_getiloops() and cpu_scalebyfcount() to deprecat.h. Added
192#include "deprecat.h" where necessary to make this happen. Cleaned up
193cpuexec.c/.h to latest core style. Cleaned up implementation of
194extended INP header in inptport.c. Removed external access to
195cycles_currently_ran(). Replaced use of cycles_currently_ran() in
196v9938 code with mame_rand(), since that is effectively the same thing.
197[Aaron Giles]
198
199Added dip locations to about half the games in seta.c. [Brian Troha]
200
201Removed champbas color PROM. Now uses TRANSPARENCY_PENS instead of
202TRANSPARENCY_COLOR. Hooked up palette bank selector from schematics,
203though I am not sure if it is actually used by the code. Changed set
204names to match title screen, which is why baseball is spelt as
205"Base Ball". [Zsolt Vasvari]
206
207Some minor cleanup to the equites driver, including memory map
208merging. [Aaron Giles]
209
210Added new option VIDEO_UPDATE_SCANLINE, which cases VIDEO_UPDATE to
211be called for every visible scanline. Removed manual implementation
212of this in timeplt, in favor of using the new flag. There are
213probably many more drivers that can leverage this. [Aaron Giles]
214
215Added stream_get_sample_rate(), stream_get_time(), and
216stream_get_sample_period(). These functions are not really tested yet
217-- make sure they give reasonable results when first used! Updated
218streams.h header to latest core style. [Aaron Giles]
219
220Fixed reset crashes in all Z180 games. Removed the various busy loop
221and non-exact optimzations from the Z180 core. [Zsolt Vasvari]
222
223Correct colors in Birdie King 3 -- just needed a new dump. Fixed
224incorrect ROM names. Switched color decoding to use the resnet code.
71Added more accurate emulation of the priority system and the beam
72logic in stactics. Removed color table. Centered crosshair. Used
73proper game orientation. Unified memory maps. Switched game to use the
74artwork system. Set GAME_IMPERFECT_GRAPHICS until artwork is created.
22575[Zsolt Vasvari]
22676
227Cleaned up the rockola.c driver. Fixed dip switches for all games.
228Added notes about the games. [stephh]
77Added sound support to Champion Skill. Removed GAME_NO_SOUND flags.
78Increased interrupts per frame, music was too slow. Minor comments
79adjustment. [Mirko Buffoni]
22980
230Reorganized exidy440 audio code to make it easier to eventually use
231the MC3417/18 emulation directly. Added MC3418 variant support to the
232HC55516 audio code. [Zsolt Vasvari]
81Used PORT_SERVICE and PORT_SERVICE_NO_TOGGLE macros when it was
82possible. [stephh]
23383
234Updated williams driver to use VIDEO_UPDATE_SCANLINE (most bitmap-
235based drivers should.) Converted to 32bpp to catch mid-screen palette
236tweaks. Removed some unnecessary read/write handlers. [Aaron Giles]
84In the cps2 driver, Changed the GAME definitions to reflect how many
85players and how many buttons there are for each game. Rewrote the
86INPUT_PORTS definitions to use PORT_INCLUDE, PORT_MODIFY and
87PORT_CUSTOM macros. Added a few notes about the inputs when I thought
88they were needed to avoid wrong bug reports. Started to clean the
89driver. [stephh]
23790
238Improved colors in circusc, gyruss, gotya with the resnet code.
239[Zsolt Vasvari]
91Added PCB and/or chip docs updates for Blaze On (kaneko16.c),
92Sand Scorpion (sandscrp.c), Flash Point (segas16b.c). [Brian Troha]
24093
241Significant improvements to Lock-On. Added POLL input handling to the
242NEC V20/V30 core. [Philip Bennett]
94Fixed kangaroo colors by assuming an inversion not present in the
95schematics. [Nicola Salmoria]
24396
244Changed debugger-related code to be based off a new makefile define
245(DEBUGGER) which sets a new compile-time define (ENABLE_DEBUGGER).
246This means that MAME_DEBUG no longer means "enable debugger", it
247simply enables debugging features such as assertions and debug code
248in drivers. Also removed the various levels of opbase protection in
249memory.h and always just turned on full bounds checking. [Aaron Giles]
97Added the ability to pass absolute paths to mame_schedule_save() and
98mame_schedule_load(). [Nathan Woods]
25099
251Added some instructions to the H8/30xx CPU: [Luca Elia]
252  or.l ERs, ERd
253  rotl/shal.l ERd
254  not.l/neg.l ERd
255  exts.w Rd
256  sub/or/xor.l #Imm:32, ERd
257  bset/bnot/bclr.b Rn, @ERd
258  bst/bist.b #Imm:3, @ERd
259  bnot.b #Imm:3, @ERd
100Naomi/DC updates: [Samuele Zannoli]
101 - Add SH4 I/O ports
102 - Connected the 93C46 of the naomi and the x76f100 of the rom board
103    and filled them with dummy data to satisfy the BIOS
104 - Implemented some of the JVS transfers that will be needed to use
105    the controls
106 - Implemented ROM board DMA
107 - Set proper NAOMI RAM sizes (32 MB main, 8 MB for AICA)
108 - Improved PVR-TA graphics emulation
260109
261Added H8/3007 & H8/3044 variants with their memory maps. Preliminary
262implementation of the H8/3007 timers. [Luca Elia]
110Set proper ARM7 clock for Naomi. [Deunan Knute]
263111
264Added AM_WRITEONLY as a shortcut for AM_WRITE(MWAx_RAM). [Aaron Giles]
112ARM7 updates: [Anonymous]
113 - correct mode at reset (it's always 0b1....)
114 - HandlePSRTransfer: remove wrong code, correct detection of
115    privileged mode
116 - correct carry output for ROR
117 - Thumb ASR Rd,Rs: correct carry computation
118 - Thumb ldmia/stmia: correct value for writeback when the writeback
119    reg is in the list
120 - ARM ldm/stm ignore lower bits of the address
121 - most of the exceptions force the I bit
122 - ignore some flag bits in the CPSR
265123
266Cleaned up Kangaroo driver: [Aaron Giles]
267 * documented MB8841 (needs to be decapped to get code)
268 * proper video timing
269 * full memory maps
270 * simplified and more accurate video logic
124Some improvements to the Funworld driver and new games added.
125[Roberto Fresca]
126 - Switched to XTAL def.
127 - Fixed Magic Card II graphics issues.
128 - Fixed Magic Card II inputs.
129 - Fixed screen and visible area to snooker10.
130 - Renamed set monglfir to mongolnw.
131 - Renamed sets description based on languages instead of countries.
132 - Fixed some years and manufacturers.
133 - Updated technical notes.
134 - Cleaned up the driver.
271135 
272More opcode improvements to Risky Challenge. [robiza]
136Did some cleanup of the 'special case' mess that the rallyx driver
137has become. [Zsolt Vasvari]
273138
274Added DIP locations to bking.c [RansAckeR]
139Removed no longer used TRANSPARENCY_COLOR. [Zsolt Vasvari]
275140
141MC6845 updates: [Zsolt Vasvari]
142 - changed the 6845 to be handle based -- adjusted all drivers
143 - renamed crtc6845 to mc6845
144 - allow reading registers 12 and 13
145 - reading write-only registers return 0
146 - updated comments in header
147 
148Changed qix.c to RGB32 mode and made its videoram_w do the partial
149updating instead of a per scanline timer. [Zsolt Vasvari]
276150
151Fixed 'mario' and 'masao' memory maps to match the Dip Switches port
152name. [stephh]
277153
278New games added or promoted from NOT_WORKING status
279---------------------------------------------------
280Wheels Runner [Luca Elia]
154Fixed pooyan transparency. Updated to use resnet code. [Zsolt Vasvari]
281155
156Changed ZN2 clock speed to 100MHz to match board notes. [smf]
282157
158Added DIP locations for sitv, sicv, invadpt2, lrescue, invasion. Fixed
159coin2 for superinv & invasion. [RansAckeR]
283160
284New clones added
285----------------
286Lock-On (rev. C) [Philip Bennett]
287Progressive Music Trivia (Question set 4) [Andrew Gardner]
288
289
290
291New games marked as GAME_NOT_WORKING
292------------------------------------
293Puzzlet (Japan) [Luca Elia]
294Galaxy Games BIOS [Andrew Gardner]
295
296
297
2980.122u7
299-------
300
301
302MAMETesters Bugs Fixed
303----------------------
304tylz0122u5red [Zsolt Vasvari]
305stadhero0122u3gre [Zsolt Vasvari]
306stadhero0122u3ora [Zsolt Vasvari]
307asterix_1055gre [couriersud]
308blktiger37b15gre [couriersud]
309newui0118u4ora [Atari Ace]
310mpatrol0117u2gre [Aaron Giles]
311realbrk0111u4gra [Brian Troha]
312schmisr0111u5gra [Brian Troha, partial fix]
313penbros0111u5gra [Brian Troha]
314ninjakd2_0111u3gra [Nicola Salmoria]
315mnight0102gre [Nicola Salmoria]
316toki060gre [robiza, Corrado Tomaselli]
317
318
319
320Source Changes
321--------------
322Added internal divider on m680* series CPUs (except the original
323m6800). Updated clocks on all games using them to remove the explicit
324divider. [Aaron Giles]
325
326Reverted experimental D3D fix, since it breaks switchres.
327[Aaron Giles]
328
329dkong updates: [couriersud]
330 * fix dkong sound following Clock Divider update
331 * updated to use XTAL_*
332 * revert a change after sound regression in dkong.
333
334i8085.c updates: [couriersud]
335 * 8085 has an internal clock divider by 2. Changed i8085.c to reflect
336    this for I8085. I8080 still at 1.
337 * Changed driver clocks to reflect internal clock divider
338 * Added some FIXME: comments where clocks for I8085 are outside specs
339
340Space Fighter Mark II: [Zsolt Vasvari]
341 - Changed year to 1979 as per Guru's contact
342 - Renamed set 2 ROMs to allow merging
343 - Removed experimental code left in there
344
345phoenix.c updates: [couriersud]
346 * Modified I8085 clock
347 * Added dip locations
348 * consolidated inputs
349 * tagged inputs
350 * combined memory maps
351 * fixed sound issue related to (auto) save states
352
353pleiads updates: [couriersud]
354 * video timing from schematics
355 * palette from schematics (resnet.h)
356 * no more colortable
357
358survival updates: [couriersud]
359 * palette from schematics (resnet.h)
360
361Removed bogus (bad) dump of Heated Barrel US set 2. [Brian Troha]
362
363RSP Changes: [SGINut, Nicola Salmoria, Ville Linde]
364 - Initialize RSP registers to 0 in lieu of mame_rand
365 - Re-fix RSP single-stepping mode when set by another CPU
366 - Reading the RSP PC returns only the least significant 12 bits
367 - Fixed flag behavior when read out via CFC2
368 - Fixed RSP VRCP instruction to match the real hardware results
369 - Corrected VRCP element lookup
370 - Corrected unaligned DMA behavior
371
372Removed all palette_X_r functions in favor of direct RAM reads.
373[Zsolt Vasvari]
374
375Removed no longer applicable assert from VIDEO_START(generic). Removed
376VIDEO_START(generic) from drivers that didn't need it. Removed
377MDRV_VIDEO_START(generic_bitmapped) from drivers that don't need it.
378[Zsolt Vasvari]
379
380Made detection of dynamic attempts to install ROM/RAM handlers more
381aggressive. Previous checks would not catch modifications in
382DRIVER_INIT or MACHINE_START calls. Fixed a number of cases of
383incorrect usage throughout the drivers. [Aaron Giles]
384
385Changed one of the cheat calls back to using more generic switch
386detection so they can be triggered via joysticks. [Aaron Giles]
387
388Renamed sauro.c sp0256 internal rom to "sp0256-al2.bin".
389Removed BAD_DUMP flag from it as well. [couriersud]
390
391Marked HD6309 as divide-by-4 internally. Updated drivers accordingly.
392[Aaron Giles]
393
394Major cleanup to the ddragon driver: [Aaron Giles]
395 - improved video and interrupt timing
396 - consolidated common memory maps and input ports
397 - added save state support
398 - correct clocks
399
400blktiger.c updates: [couriersud]
401 * combines memory maps
402 * input ports were tagged
403 * all reads use input port tags
404 * added dip switch locations from Romstar manual
405
406Added all known variants of the tms5110 as proper chips. Updated
407dkong, cvs and scramble to use new chips. [couriersud]
408
409Converted atarifb.c to tilemaps. [Zsolt Vasvari]
410
411Switched namcos11/namcos12 over to memory_configure_bank /
412memory_set_bank. Simplified golgo 13 gun reading. [smf]
413
414mpatrol driver cleanup [Aaron Giles]
415 - merged memory maps
416 - complete memory map
417 - correct video timing
418 - correct CPU clocks
419 - replaced protection hack with actual implementation
420 - cleaned up inputs
421
422Added tilemap_get_scrollx / tilemap_get_scrolly. [Nicola Salmoria]
423
424Preserve fractional part of sample offset when looping in SCSP. Fixes
425remaining pitch stability problems. Fixed minor issue with timers
426B&C expiring. [kingshriek, R. Belmont]
427
428auto_malloc() once again actually fails when out of memory.
429[Aaron Giles]
430
431Switched zn.c to use MDRV_IMPORT_FROM. [smf]
432
433mario.c changes: [couriersud]
434 * removed all traces to video/generic.h
435 * fix flipscreen issue with autosave
436 * on a hires pcb picture, verified resistor and capacitor values
437
438Added dip locations to Real Break. Filled in a couple of dips for the
439Pachinko Gindama Shoubu games. [Brian Troha]
440
441Fixed invalid memory_install_*_handler calls in drivers/williams.c.
442Emulated external OR circuit for all drivers using the PIA chip. This
443used to be internal to the PIA emulation, but, in fact, this is
444external logic. The PIA has two seperate INTA and INTB out lines.
445This fixes at least PlayBall. [Zsolt Vasvari]
446
447Added the ability to the HC55516 emulator to take an external
448osciallator. Updated Mouse Trap to use the new interface.
449[Zsolt Vasvari]
450
451Cleaned up and merged ninjakd2, mnight and omegaf drivers into a
452single driver. Additionally: [Nicola Salmoria]
453 - added flip screen support to all games
454 - fixed sprite overdraw mode:
455    - ninjakd2 congratulations screen (e.g. stage 3) shows japanese
456       characters which were previously missing
457    - in ninjakd2, at the beginning of a level items are visible
458       during the initial fade in. I'm not sure if this is correct
459       but the other effects wouldn't work otherwise
460    - in mnight attract mode, when the big ship is firing the other
461       sprites no longer leave trails
462    - in mnight at the end of a level the screen is slowly filled
463       with balls and then slowly cleared to begin the following
464       level. Same effect in the death sequence during attract mode.
465 - added proper computation of sprites to be drawn taking into
466    account double size sprites. This fixes sticking shots in mnight
467    without need for a hack.
468 - lowered ninjakd2 PCM playback rate to 13020 (from 16000). This
469    seems to sound better and is a round division from one of the
470    master clocks.
471 - removed ROM patch that was used to avoid the input protection in
472    omegaf, added a rough but effective protection simulation.
473 - corrected some dip switches
474 - hooked up sound cpu reset line
475 - simplified ROM loading for the older games swizzling address lines
476    in driver init.
477
478Added MDRV_SOUND_ROUTE_EX to specify target input channel. Added
479input id to route struct. Fixed DISCRETE_INPUT_STREAM and added input
480channel # to DISCRETE_INPUT_STREAM. [couriersud]
481
482Fixed default debugger memory view width for CPUs with >byte-sized
483minimum. Made menu updating dynamic at click time, fixing issues with
484incorrect checkmarks. [Aaron Giles]
485
486Fixed Ninja Kuna. Cleaned up memory maps. Renamed files to ninjakun.c.
487[Zsolt Vasvari]
488
489Added MC3417 and MC3418 variants to the HC55516 sound emulation.
490Changed Mouse Trap to use MC3417. [Zsolt Vasvari]
491
492Fixed saving i8085 callbacks across a reset. Added 'pull' callback for
493the SID pin.  This is needed by the Red Alert voice board.
494[Zsolt Vasvari]
495
496Made the text displayed by the various UI sliders more intelligent.
497Basically, it will only print an index for an item if there are
498multiple of a given type. [Zsolt Vasvari]
499
500Updated jailbrek clocks and video timing based on measurements.
501[Aaron Giles]
502
503Fixed i8051 timers from firing when not enabled. Checking TCON alone
504is not enough to invoke timers. Added IE SFR flags in conditional.
505[Jim Stolis]
506
507Added a _CALL variant to all prototype macros. The use of these
508should make it easier to change the signiture of these functions in
509the future. Replaced existing calls with macro where appropriate.
510[Zsolt Vasvari]
511
512Removed VIDEO_START_CALL(generic) from all drivers not needing it,
513which were all of them. Removed VIDEO_START_CALL(generic_bitmapped)
514from jpmimpct. [Zsolt Vasvari]
515
516Changed YM2203 clock in stfight to 3MHz (compared against OST)
517[Yasuhiro Ogawa]
518
519Improved linear zoom effect resolution to address gaps in CPS3
520rendering. [OopsWare]
521
522Rewrote and modernized the redalert driver: [Zsolt Vasvari]
523 - correct colors -- in places different from the manual's description,
524    but matches the flyer perfectly
525 - added speech
526 - fixed AY-8910 sounds
527 - odds and ends
528 - corrected colors in Demoneye-X
529 - added some sound to Demoneye-X
530 - marked Demoneye-X it NOT_WORKING, due to the (still) missing 3rd
531    gfx layer that makes it impossible to pass the 2nd level.
532
533Added all the known Naomi BIOS dumps along with descriptions and
534information about region bytes & version numbers. [Brian Troha]
535
536Removed the freely distributable Exidy games' dependency on Berzerk.
537[Zsolt Vasvari]
538
539Added support for the BLX opcode in ARM7 THUMB mode. [SGINut]
540
541Verified DIP locations from manuals for scramble and 800fath.
542[RansAckeR]
543
544Changed S14001A emulator to allow setting the clock frequency instead
545of the clock multiplier. This is how the real chip works. Changed the
546Berzerk driver to set the S14001A clock as per the schematics. 
547[Zsolt Vasvari]
548
549Removed the use of the global Machine from a number of places in the
550code. [Zsolt Vasvari]
551
552Fixed issues flagged by MSVC warning C4305 (type truncation). Almost
553all of these are harmless double->float narrowing in initializers, but
554one warning spotlighted a bug in segasyse.c, where code to use a
555higher sprite number had no effect due to the insufficient range of
556UINT8. [Atari Ace]
557
558Removed /wd4550 for VS7/VS71 compilers (expression evaluates to a
559function which is missing an argument list). Fixed some VS7-specific
560issues (OPTIMIZE=0 at least compiles now). [Atari Ace]
561
562Added a missing case statement in sm8500d.c, noticed while reviewing
563dead code warnings. [Atari Ace]
564
565Corrected Diet gogo h6280 clock so that it behaves correctly with
566Charles Macdonald fix to the cpu core. Verified and corrected
567frequencies and pin 7 okim6295 on the following games:
568The new zealand story (3 z80 version), Trio The punch, Vandyke,
569paradise.c games, Downtown, Shaolin's Road and Twins.
570[Corrado Tomaselli]
571
572Removed all peplus memory hacks and game specific DRIVER_INIT. There
573are now just two DRIVER_INIT, one for normal boards and one for
574superboards. Temporarily disabled AutoHold Cheat but documented
575addresses for future update. [Jim Stolis]
576
577Added further unencrypted opcodes to risky challenge. The game now
578boots with the intro animation. [robiza]
579
580
581
582New clones added
583----------------
584Jokers Wild Poker (PP0065) [Jim Stolis]
585Double Down Stud Poker (PP0250) [Jim Stolis]
586Standard Draw Poker (PP0447) [Jim Stolis]
587Night Stocker (set 2) [Andrew Gardner]
588Trivial Pursuit (Genus I) (set 2) [Andrew Gardner]
589
590
591
5920.122u6
593-------
594
595
596MAMETesters Bugs Fixed
597----------------------
598pangpoms098u3ora [Brian Troha]
599cuebrckj0102u5gre [Zsolt Vasvari]
600astinvad0106u11gre [Aaron Giles]
601victory137b4gre [Zsolt Vasvari]
602victory37b16gre [Zsolt Vasvari]
603dcs057ora [Aaron Giles]
604pleiads0111u4gre [Robbert]
605armwrest35b9yel [David Haywood]
606gstrik20105u4gra [Brian Troha]
607narc060gra [Aaron Giles]
608mia0106u5gra [RansAckeR]
609nss_smw0115ora [Atari Ace]
610darkplnt0119u3yel [Atari Ace]
611mhhonban0120u3gra [RansAckeR]
612rollerg0111u5gra [RansAckeR]
613bionicc0109ora [RansAckeR]
614lcasino0111ora [RansAckeR]
615megaplay.c0122u4red [Atari Ace]
616nmnlnd0122u3yel [Mamesick]
617cocktail0119yel [Robbert]
618tokisens0122u3gra [RansAckeR]
619alleymas0119u3gre [RansAckeR]
620crbaloon36finalgre [Zsolt Vasvari]
621topsecrt0109gre2 [Bryan McPhail]
622quasar0122u5red [Zsolt Vasvari]
623stadhero0122u3gra [RansAckeR]
624
625
626
627Source Changes
628--------------
629Swinging Singles cleanup: [Tomasz Slanina]
630 - hooked up crt6845
631 - converted to tilemaps
632 - simplified protection(?) emulation
633 - removed tilemap, a bit more low level video hw emulation
634 - fake colors
635
636Lowerd FPS in lasso.c to avoid corrupting Chameleon's high score
637table. [Zsolt Vasvari]
638
639Removed obsolete uitext.c and all references to it. [Aaron Giles]
640
641Some more modernization/clean-up in the exidy driver. [Zsolt Vasvari]
642
643Added VIDEO_ALWAYS_UPDATED for reliable collision detection in the
644CVS driver. [Zsolt Vasvari]
645
646Cleaned up astinvad driver: [Aaron Giles]
647 * Proper video timing
648 * Hooked up 8255 PPIs
649 * Correct interrupt timing
650 * Consolidated code into single file
651
652i8039.c/mario.c updates: [couriersud]
653 * fixed movd instructions
654 * add MB8884 and M58715 cpu types
655 * moved timer hack to M58715
656 * added ram_mask for internal ram access
657 * added R.A11 as 'M' to dasm flags
658 * added EA "IO" port
659 * mario now uses M58715 as sound cpu
660 * hooked up EA line for M58715
661 * fixed portA startup value
662 * documented hardware changes to use a I8039 on a mario board
663
664sauro.c: [couriersud]
665 * revert promsize to 256 for trckydoc
666
667Added XTAL clocks to zaxxon.c. [Aaron Giles]
668
669Cleaned up cojag/jaguar driver: [Aaron Giles]
670 * proper video timing, configured by the chipset
671 * 32-bit rendering, removing 16bpp hacks
672 * support for borders
673 * proper object processor timing, including multiple passes per line
674 * added R3041 as a clone of the R3000
675 * fixed XTALs based on documentation
676
677Consolidated exidy and victory drivers. Removed complicated dirty
678tracking from victory.c. Reorganized the exidy audio hardware code.
679Changed Targ to use a loaded PROM instead of a hard-coded one. Renamed
680Side Trak to Side Track as per the title screen. [Zsolt Vasvari]
681
6826821 PIA changes: [Zsolt Vasvari]
683 - Added orthogonal accessors
684 - Removed hacky update_shared_irq_handler(), now the same
685   IRQ callback maybe called multiple times, but this shouldn't
686   be a problem
687 - IRQ lines are cleared on a reset
688
689Disabled code in the TMS5220 that set the Buffer Empty flag after a
690stop frame. This fixes Victory. This might be the incorrect fix but
691the old code wasn't working either. [Zsolt Vasvari]
692
693Hooked up revx dcs reset line. Signaled IRQ on correct CPU when DCS
694sends data back (duh). [Aaron Giles]
695
696Removed unnecessary check that could cause SCSP hangs in grdforce.
697[kingshriek]
698
699Tweaked deco156 clock speed to be 28 to prevent the games from running
700in slow motion. I suspect the 156 chip has an internal multiplier, the
701usual input pin is 7Mhz IIRC. [David Haywood]
702
703dkong.c changes: [couriersud]
704 * added equivalence circuit for Sanyo EZV audio amplifier
705 * Set DK_C159 = 0 to avoid over-aggressive high-pass filter. Solely
706    based on observations.
707 * added comment on above to source
708 * Added define DK_NO_FILTERS to turn of DAC filters and post-mixer
709    filters for debugging
710
711Adds dips for Water Balls. Adds dip port locations to all dips.
712[Brian Troha]
713
714Added CPUINFO_INT_CLOCK_MULTIPLIER to support CPU clock multipliers.
715Updated all CPU cores to return a CPUINFO_INT_CLOCK_MULTIPLIER of 1.
716Changed the core to actually respect both CPUINFO_INT_CLOCK_MULTIPLIER
717and CPUINFO_INT_CLOCK_DIVIDER. Updated a number of drivers to use
718cpunum_get_clock() instead of Machine->drv->cpu[x].clock. Raw input
719clock speeds should now be specified for all CPUs in the
720MACHINE_DRIVER. [Aaron Giles]
721
722Changed TLC43076 and games using it to RGB32. Removed global Machine
723variable where possible. [Zsolt Vasvari]
724
725Removed dirtybuffer from video/generic.c and all drivers still using
726it. Good riddance... Removed videoram_w, colorram_w and spriteram_w
727and changed all drivers using it to access RAM directly. Removed
728videoram_r, colorram_r, spriteram_r, spriteram16_r and spriteram16_w
729from video/generic.c and changed all games to use (possibly shared)
730RAM. [Zsolt Vasvari]
731
732Cleaned up memory maps in the seibu sound interfaces. Changed to use
733shared sound configs instead of statically copying them in each
734driver. [Aaron Giles]
735
736Verified and changed cpu frequencies and oki m6295 pin 7 on the
737following pcbs: Asuka&Asuka, Cadash, Equites h/w games and sound
738board, F1GP, Super Formula, Gladiator, Ping Pong king, Great
739Swordsman, Irem m52 sound board, Tropical Angel, Explosive Breakers,
740Magical Crystal, Mad Gear, Roller Aces, Chinese Hero, Simpsons,
741Golfing Greats, Time Pilot 84. [Corrado Tomaselli]
742
743Added some more static qualifiers on recent new/changed code.
161Added initialization to machine/nmk112.c. This resolves a multi-
162session audio problem reported for donpachi. Also added some variable
163initialization to machine/n64.c to fix running starsldr multi-session.
744164[Atari Ace]
745165
746Fixed dbreed72 crash introduced in 0.122u5. [Mamesick]
166Added diplocations to policetr and marked some as unused based on
167manual and schematics. [Mike Ellery]
747168
748Fixed HuC6280 low-speed mode so it uses 4 cycles instead of 3.
749[Charles MacDonald]
750
751Hand fixed Road Runner's corrupted ROM. We are 99.99% sure that the
752bad bytes are the same as the Desert Gun ones. [Zsolt Vasvari]
753
754Cleaned up leland clocks a little. Made the i186 divide-by-2 clock
755internal. [Aaron Giles]
756
757Added clocks to the MCR sound boards and some of the MCR games. Added
758TMS5220 variants TMS5200 and TMC0285 as proper chips. Changed MCR
759squawk & talk to use the TMS5200 as documented. [Aaron Giles]
760
761Cleaned up Crazy Baloon driver: proper memory maps, crystals, etc.
762Implemented the missing features of the collision detector custom IC.
763[Zsolt Vasvari]
764
765First pass at fixing the cpu clock speeds on the playstation based
766hardware. The system 10 & 12 clock speeds have been raised as they
767run on an upgraded chipset. The internal divide in the CPU core has
768been set to 4 as we have no wait states, incorrect dma timing,
769no gpu timing, no dma bus stealing and no gte timing. [smf]
770
771Fixed RET instruction on the i960 core. [Ernesto Corvi, ElSemi]
772
773Removed speedups in the gstream and limenko drivers which were
774breaking the games. [David Haywood]
775
776Fixed regression on i8039 T1 counter mode. [couriersud]
777
778Added CUSTOM_INPUT macro for defining input port callbacks. Pushed
779its usage throughout the code. [Aaron Giles]
780
781phoenix and clones: [couriersud]
782 * video timing from schematics
783 * palette from schematics (resnet.h)
784 * no more colortable
785 * added save state
786
787Minor RSP fixes: [SGINut]
788 - Fixed accumulator state on powerup by testing against real hardware
789 - Fixed single-step behavior by testing against real hardware
790
791Added save state support to atetris.c. [Svante Gerhard]
792
793Fixed up atetris memory maps and clocks according to schematics.
794[Aaron Giles]
795
796Added targ and spectar to TinyMAME. [neoforma]
797
798
799
800New games added or promoted from NOT_WORKING status
801---------------------------------------------------
802Ripper Ribbit [Aaron Giles]
803Chicken Farm [Aaron Giles]
804Crazzy Clownz [Aaron Giles]
805Space Fighter Mark II [Zsolt Vasvari, Guru]
806
807
808
809New clones added
810----------------
811Heated Barrel (US set 2) [Corrado Tomaselli]
812Player's Edge Plus (XMP00006) Multi-Poker [Jim Stolis]
813
814
815
816New games marked as GAME_NOT_WORKING
817------------------------------------
818International Toote (Germany) [Luca Elia]
819Dodge City [Roberto Fresca]
820
821
822
8230.122u5
824-------
825
826
827MAMETesters Bugs Fixed
828----------------------
829scorpion0111u5gra [couriersud]
830qbert37b14gre1 [Zsolt Vasvari]
831blktiger060gre [robiza]
832kinstc081u7gre [Aaron Giles]
833kinst2083gre [Aaron Giles]
834umk3059gre [Aaron Giles]
835umk3137b5gre [Aaron Giles]
836lasso056gre_1 [Zsolt Vasvari]
837lasso056gre_2 [Zsolt Vasvari]
838term20103u4gre [Aaron Giles]
839term20104u2gre [Aaron Giles]
840m72_0115u3yel [Mamesick, Aaron Giles]
841deadang0119u2red [David Haywood]
842tmnt095gre [Zsolt Vasvari]
843memleak0122u2ora [Atari Ace]
844junglek055gre [Zsolt Vasvari]
845
846
847
848Source Changes
849--------------
850Fixed flipped tilemap offset for scramble and clones (playable
851cocktail mode). [couriersud]
852
853Changed Exidy driver to draws the background directly from memory
854avoiding having to decode the gfx repeadately. [Zsolt Vasvari]
855
856Added machine and cpunum parameters to INTERRUPT_GEN callbacks. Fixed
857several places that were not using INTERRUPT_GEN or OPBASE_HANDLER
858macros. [Atari Ace]
859
860Minor bugfixes to the gfxlayout cleanups included in u4. [Atari Ace]
861
862Added code to debug 64-bit builds to allocate all address space below
8634GB to help find 64-bit errors. Added environment variable
864OSDDEBUGMALLOC which, if set, explicitly overrides the debug malloc
865debug settings. Added environment variable OSDDEBUG4GB which, if set,
866explicitly overrides the new 64-bit address space allocations. (Sadly
867this is necessary due to some D3D drivers being 64-bit unclean....)
868[Aaron Giles]
869
870Fixed winwork to use proper tchar functions for getenv. [Aaron Giles]
871
872Fixed bug where the 64-bit DRC was not saving rbp. [Aaron Giles]
873
874Cleaned up the lasso driver. [Zsolt Vasvari]
875
876Simplified Y-unit DMA rendering, fixing bugs and removing the macro
877voodoo. [Aaron Giles]
878
879Removed a bunch of dead code from othunder.c. [Zsolt Vasvari]
880
881Implemented proper video timing and scanline interrupts in the m72
882driver. [Mamesick, Aaron Giles]
883
884mario.c improvements: [couriersud]
885 * discrete sound
886 * hooked up z80dma
887 * combined memory maps
888 * statics in mario_state struct
889 * fixed save state issues
890 * combine sh_* writes into one routine
891
892audio/dkong.c: [couriersud]
893 * fixed LS123 constant to match TI datasheet diode circuit constant
894
895TX-1 improvements [Philip Bennett, Guru]:
896 * Fixed remaining arithmetic unit issues
897 * Added correct object colour pixel LUT PROM to tx1a
898 * Fixed x-flipping
899 * Added engine sounds
900
901Added correct DIP switch settings for Big Fight. Also corrected Cycle
902Warriors DIP switches. [Philip Bennett]
903
904Changed and verified frequencies on Ikari Warriors h/w, Tnk3, Hyper
905Sports, Jackal and S.A.R. [Corrado Tomaselli]
906
907Verified and corrected a lot of frequencies and oki6295 pin 7 on pcbs:
908Double Dribble, Chequered Flag, Diet gogo, Boulderdash, Sly Spy,
909Psycho Nics Oscar, Captain Silver, Magical Cat Adventure, Raiden,
910Superman, Twin Hawk, Vimana, Ghox, Dogyunn, truxton2, Pipi and Bibis,
911Fix Eight and Money Money. [Corrado Tomaselli]
912
913Cleaned up brkthru/darwin memory maps. Changed both games to use
914identical video timing parameters based on measurements of darwin.
915Guessed based on available information at the master clock and
916derived all game clocks from it. [Aaron Giles]
917
918Reogranized and started to clean up the CVS driver. Added emulation
919of the speech CPU. Removed CVS BIOS entry. Removed unnecessary
920patching. [Zsolt Vasvari]
921
922sauro.c: [couriersud]
923 * Hooked up sp0256 sound
924 * analyzed and commented some ports
925 * added palette_bank support without real success
926
927Reorganized the Raiden 2 driver.. a bit of extra documentation of the
928'V33' based set, which has been renamed. Nothing new working.
929[David Haywood]
930
931Fixed scan functions for kickgoal background, which were swapped.
932[David Haywood]
933
934Fixed 2650 disassembly of the sense and flag bits. Fixed incorrect
935argument order in OUT instruction. Corrected spacing. [Zsolt Vasvari]
936
937Fixed hang/crash on empty config file. [Wilbert Pol]
938
939Cleaned up tceptor memory maps. [Zsolt Vasvari]
940
941Atari System 2 driver cleanup: [Aaron Giles]
942 * Proper video timing.
943 * Full memory maps.
944 * Save state support.
945 * Removed 720 sound CPU hack in favor of prepopulated EEPROM like
946    the other games.
947
948Added support for outputting 64-bit target addresses in the i386dasm.
949[Aaron Giles]
950
951Added MESS PC-Engine emulatation system. Fixed MAME debug build under
952VC2003. [Mariusz Wojcieszek]
953
954Unified memory maps in tmnt.c and twin16.c. Reversed ROM set names
955of Cuebrick World and Japan versions. Changed some function names to
956reflect parent set. [Zsolt Vasvari]
957
958Changed Konami drivers to allocate and decode graphics using the same
959layouts. Removed the layout parameter from the decodechar() calls.
169Fixed fatal error in the maxaflex, mf_bdash and mf_achas drivers.
960170[Atari Ace]
961171
962Fixed C++ compilation errors. [Dave Dribin]
172Several more risky challenge opcodes. You can now see "gameplay".
173[robiza]
963174
964Made INPs compatible between 64-bit MAME and 32-bit MAME. [Chad]
965175
966Complete taitosj memory map from Nicola's ancient notes. General code
967clean-up. [Zsolt Vasvari]
968176
969src2html improvments: [Aaron Giles]
970 - added line numbers
971 - added link to the raw file if the src and dst dirs are the same
972 
973"Fix" for full screen switch, which makes no sense, but is included
974based on empirical evidence that is somehow works. [Emuman]
975
976
977
978177New games added or promoted from NOT_WORKING status
979178---------------------------------------------------
980Name Club Ver.3 (J 970723 V1.000) [David Haywood, Mariusz Wojcieszek]
981Blazing Lazers [Mariusz Wojcieszek, Charles MacDonald, Mr. Do]
179Galaxy Games (BIOS v1.90) [Luca Elia]
180Royal Vegas Joker Card [Roberto Fresca]
982181
983182
984183
985184New clones added
986185----------------
987Lead Angle (Japan) [Guru]
988A Question of Sport (39-960-107) [Highwayman]
989Gee Bee (F.lli Bertolino license) [Corrado Tomaselli]
186Contra (US, Set 2) [Brian Troha]
187Zero Wing (2 player simultaneous ver.) [Brian Troha]
188Sand Scorpion (Revised Hardware) [Stefan Lindberg]
189Galaxian (Taito) [Stefan Lindberg]
190Jolly Card (3x3 deal) [Roberto Fresca]
191Jolly Card Professional 2.0 [Roberto Fresca]
192Lucky Lady (3x3 deal) [Roberto Fresca]
193Lucky Lady (4x1 aces) [Roberto Fresca]
990194
991195
992196
993197New games marked as GAME_NOT_WORKING
994198------------------------------------
995Road Runner (Midway) [Zsolt Vasvari, Guru]
996Paranoia [Mariusz Wojcieszek]
997
998
999
10000.122u4
1001-------
1002
1003
1004MAMETesters Bugs Fixed
1005----------------------
1006gui0121u1gre [Aaron Giles]
1007drivedge0121u4gre [Aaron Giles]
1008bking3076u2red [Pierpaolo Prazzoli]
1009btoads0102u5gre [Aaron Giles]
1010btoads0103u1gre [Aaron Giles]
1011editableui0120u4red [Aaron Giles]
1012cheat0118red [Aaron Giles]
1013altf4_0111u4gre [Aaron Giles]
1014beastrzb097u2red [Oliver Stoneberg]
1015memoryleak0118u1ora [Oliver Stoneberg]
1016memory_leak0111u6ora [Oliver Stoneberg]
1017mahoudai0106u7yel [Philip Bennett]
1018gridiron079gre [David Haywood]
1019maniach37b11gre [David Haywood]
1020matmaniac37b14gre [David Haywood]
1021qzkklgy2_0106u6red [David Haywood]
1022warriorb0109u2gre [David Haywood]
1023vball071u1gre [Bryan McPhail]
1024d3dwindow0117u3red [Aaron Giles, Emuman]
1025arkanoid061gre [Bryan McPhail]
1026flkatck058gre [David Haywood]
1027memleak0119u3ora [Oliver Stoneberg]
1028system24_0120u3red [Atari Ace, Aaron Giles]
1029aleck64_0120red [Aaron Giles]
1030mtetrisc0115u1red [Aaron Giles]
1031suratk0122u3gra [Pierpaolo Prazzoli]
1032suratk0122u3ora [Pierpaolo Prazzoli]
1033skychut37b1yel [couriersud]
1034skychut37b6gre [couriersud]
1035darius2_0114gre [Bryan McPhail]
1036ad2083_0111u5gra [couriersud]
1037abaseb0122u3red [Zsolt Vasvari]
1038ladybug080u1gre [Zsolt Vasvari]
1039suprridr0122u2gra [Zsolt Vasvari]
1040invho2_0122u3red [Zsolt Vasvari]
1041narc37b16yel [Aaron Giles]
1042kingofb37b6gre [robiza]
1043stonebal0117u2gre [Aaron Giles]
1044wotw36b1gre [Zsolt Vasvari]
1045wallst071gre [Zsolt Vasvari]
1046mtrap37b14gre [Zsolt Vasvari]
1047pitfight0109u2gre [Aaron Giles]
1048
1049
1050
1051Source Changes
1052--------------
1053Corrected btoads clocks according XTALs on the PCB. [Aaron Giles]
1054
1055"Simplified" MC8123 decryption, though it's still more complicated
1056than I'd like it to be. [Nicola Salmoria]
1057
1058Cleaned up clocks in the itech32 driver. [Aaron Giles]
1059
1060Added partial key for FD1089B 317-0037. [Nicola Salmoria]
1061
1062Fixed bking3 clocks as per Guru readme. Added GAME_WRONG_COLORS flag
1063to bking3. [Pierpaolo Prazzoli]
1064
1065TMS34020 fixes: [Aaron Giles]
1066 * Allowed 32-bit pixel sizes
1067 * Fixed RPIX instruction
1068
1069Added new function input_poll_keyboard_switches to poll for only key
1070events. Expanded the size of the maximum simultaneously pressed
1071switches. [Aaron Giles]
1072
1073Removed GAME_IMPERFECT_GRAPHICS from all jpmimpct games bar Cluedo
1074(see driver note). [Philip Bennett]
1075
1076mario driver improvements: [couriersud]
1077 - Hooked up flipscreen
1078 - Changed monitor orientation to ROT0
1079
1080Added Z80 DMA chip [couriersud]
1081 - only implements intelligence to emulate dkong3
1082 - fixed a misleading comment in 8257dma.h
1083
1084dkong driver improvements: [couriersud]
1085 - hooked up z80dma
1086 - removed 2nd player inputs from sdbk input_ports
1087 - fixed some dump "copy/paste" bugs in dip locations
1088
1089Added redumped Turkey USA to the seta2.c driver. [Brian Troha]
1090
1091Fixed bad ram pages errors in stactics service mode.
1092[Pierpaolo Prazzoli]
1093
1094Atari updates: [Aaron Giles]
1095 - Added save state support to slapstic.
1096 - Added save state support to YM2413.
1097 - Modified slapstic code to support address range mirrors.
1098 - Cleaned up Rampart driver:
1099    - simplified rendering code
1100    - full memory map
1101    - added save state support
1102
1103Implemented decent-sounding FM in the SCSP. [kingshriek]
1104
1105Updated Naomi driver, now boots and shows some test menus (press F2
1106to get into test, use 9 to navigate). Also hooked up ROM board PIO
1107and skeleton for DMA. [R. Belmont, Samuele Zannoli, ElSemi]
1108
1109N64 improvements: [SGINut]
1110 - Move texture masking to occur after coordinate adjustment
1111 - Fix 32-bit texturing in load_tile (Mario Kart 64 title screen)
1112 - Add zero-alpha early-out (Mario 64 trees/stars, Mario Kart 64
1113    trees/karts)
1114
1115ad2083 improvements: [couriersud]
1116 * completed tms5110A code
1117 * working speech synthesis
1118 * documented analysis done on pcb pictures and findings
1119 * as a consequence, marked all sound roms as BAD DUMP
1120 * created sound driver in scramble.c
1121
1122Cleaned up graphics layouts in preparation for new format. Added new
1123GFXLAYOUT_RAW() macro to normalize definition. Added new validation
1124code. Made all remaining instances of gfx_layouts const. [Atari Ace]
1125
1126Updated Amiga driver to use formal XTALs. [Dirk Best]
1127
1128Changed 6522 emulation such that when writing to the ACR register with
1129the timer 1 in continuous counting mode, the timer 1 value should not
1130be reloaded but keep on counting. [Wilbert Pol]
1131
1132Added XTAL defines to bfm_sc2.c and cleaned up lvcards.c.
1133[James Wallace]
1134
1135Added default layout to neogeo games allowing for either cropping or
1136stretching to the alternate 304x224 layout. Removed default cropping
1137in the driver. [David Haywood, Aaron Giles]
1138
1139Fixed crash when saving state of older DCS-based games. Added save
1140state support to the midvunit driver. [Aaron Giles]
1141
1142Major improvements to Cycle Warriors video code (still not perfect,
1143but road layer works now). [Bryan McPhail]
1144
1145Major rewrite of skychut.c. There are still some glitches and it is
1146not perfect but the following has been achieved: [couriersud]
1147 * adds samples to ipm invaders - just rename your old invaders
1148    samples to ipminvad to test
1149 * added - amongst others - "capsule" dip switch to ipm invaders
1150 * sound ports identified
1151 * demo sound and cabinet type driver configuration
1152
1153Updated memory configuration for Superboard game versions in peplus
1154driver. Fixes CMOS DATA errors on reload. [Jim Stolis]
1155
1156Rewrote the CVS system video code. [Zsolt Vasvari]
1157
1158Fixed S2650 register window display. [Zsolt Vasvari]
1159
1160Added sound to Cycle Warriors and Big Fight. Corrected OKI M6295
1161clock values. [Philip Bennett]
1162
1163Fixed missing arrow in Venture on the zoomed out map, and the
1164incorrect fading twister in Hard Hat. [Zsolt Vasvari]
1165
1166
1167
1168New games added or promoted from NOT_WORKING status
1169---------------------------------------------------
1170Dangerous Curves [Philip Bennett, Dazzer]
1171Big Fight [Bryan McPhail]
1172
1173
1174
1175New clones added
1176----------------
1177Invasion - The Abductors (version 5.0) [Brian Troha]
1178Alien Syndrome (set 5, System 16A, FD1089B 317-0037) [Nicola Salmoria]
1179Dragon Spirit (Atari license) [Satoshi Suzuki]
1180
1181
1182
11830.122u3
1184-------
1185
1186
1187MAMETesters Bugs Fixed
1188----------------------
1189hstennis0103u2gra [Brian Troha]
1190edrandy0113gra [Brian Troha]
1191robocop2_0106u3gra [Brian Troha, Bryan McPhail]
1192mario0110u1gre [couriersud]
1193sbrkout0118yel [R. Belmont, Adam Bousley]
1194pestplce0122red [couriersud]
1195funkyjet055yel [Bryan McPhail]
1196liberate074u1gre [Bryan McPhail]
1197tokiu056gre [Bryan McPhail]
1198powerbls0112u4red [Pierpaolo Prazzoli]
1199wwestern0115u1yel [Atari Ace]
1200namcos1_0118u2yel [Atari Ace]
1201victnine0116u2red [Pierpaolo Prazzoli]
1202btoads0103gre [Aaron Giles]
1203
1204
1205
1206Source Changes
1207--------------
1208Fixes clocks for Orbs. [David Haywood, Tomasz Slanina]
1209
1210Fixed various 64-bit GCC warnings. [R. Belmont]
1211
1212Improves accuracy and documentation of NSS/SNES DSP-1.
1213[Andreas Naive, R. Belmont]
1214
1215Added new file xtal.h, documenting all known arcade PCB clock cystals.
1216Drivers should be updated to use these as a basis for their clocks,
1217and the list should be augmented as additional crystals are found.
1218[Guru, Aaron Giles]
1219
1220suprloco improvements: [Pierpaolo Prazzoli]
1221 * Fixed IC.34 memory test
1222 * Fixed 2nd player cocktail mode
1223 * Changed coin3 to service1
1224 
1225Cleaned up inputs/DIP switches in cninja driver. [Brian Troha]
1226
1227Rewrote mario.c: [couriersud]
1228 - rewrote driver, separate MACHINE_DRIVER(mario_audio)
1229 - palette from schematics
1230 - video timing from schematics
1231 - driver configuration switch Nintendo/Std Monitor
1232 - got rid of COLORTABLE
1233
1234Fixed typo for IO1 irq callback in hyperstone core.
1235[Pierpaolo Prazzoli]
1236
1237Added memory_get_bank() function. Fixed logging in memory.c to to use
1238%p for pointer values. [Aaron Giles]
1239
1240Fixed save states in i8051 cpu core [Pierpaolo Prazzoli]
1241
1242Implemented a few SysCtrl, Maple, and PVR/HOLLY bits for Naomi. The
1243BIOS gets slightly further but is nowhere near starting up.
1244[R. Belmont]
1245
1246Zeus updates: [Aaron Giles]
1247 * Better documented various bit latches.
1248 * Hooked up crusnexo lamp board (added layout).
1249 * Fixed year in MK4 startup test.
1250
1251Fixed TMS5110 tables. [couriersud, Lord Nightmare]
1252
1253Removed ui_popup(). Drivers should always be using popmessage()
1254instead (has been this way for a while). Augmented popmessage() so
1255that you can pass NULL to immediately dismiss any messages.
1256[Aaron Giles, thanks to Oliver Stoneberg's suggestion]
1257
1258Added ATTR_PRINTF to a number of functions that have printf semantics.
1259[Oliver Stoneberg]
1260
1261Rewrote sbrkout driver based on schematics: [Aaron Giles]
1262 * XTAL-based timing
1263 * Correct video timing
1264 * Full memory map
1265 * Correct memory usage ("zero page" RAM is shared with videoram)
1266 * Removed all input hacks
1267 * Fixed interrupt generation
1268 * Connected coin counters
1269 * Added save state support
1270
1271Fixed several UNICODE=1 issues in the debugger. Changed the Windows
1272build process to always enable UNICODE=1 for 64-bit builds.
1273[Oliver Stoneberg, Aaron Giles]
1274
1275Added save state support to btoads. [Aaron Giles]
1276
1277Fixed onna34ro mcu simulation properly. [Pierpaolo Prazzoli]
1278
1279
1280
1281New clones added
1282----------------
1283Mutant Fighter (World, EM-3) [Stefan Lindberg]
1284The Simpsons (2 Players Asia) [Arzeno Fabrice]
1285
1286
1287
12880.122u2
1289-------
1290
1291
1292MAMETesters Bugs Fixed
1293----------------------
1294pestplce0122red [couriersud]
1295hunchbkd0122red [couriersud]
1296radarscp0122yel [couriersud]
1297mwalk0122red [couriersud]
1298qtheater0122u1ora [Philip Bennett]
1299
1300
1301
1302Source Changes
1303--------------
1304Fixed M65C02 optimization. [Peter Trauner]
1305
1306TMS51xx and M58817 speech updates: [couriersud]
1307 - radarsc1 uses tms5110 speech synth
1308 - cvs games: according to PCBInfos speech chip is TMS5100.
1309    Changed driver to use TMS5100 and "game system operational" now
1310    sounds more natural
1311 - removed sound/m58817.*
1312 - added support for multiple coefficients maps to tms5110.*
1313 - added coefficient maps for TMS5100 and M58817 from documented
1314    sources to tms5110r.c
1315 - fixed interpolation factors (see tms5110r.c for reason)
1316 - made lattice calculation precision 9bit
1317 - added support for READBIT and LOADADDRESS commands to tms5110.c
1318 - more changes in line with various patents
1319 - documented TRS-02, TKG-02/03 "voice" interface
1320
1321Completed the addition of static qualifiers to all MAME symbols that
1322aren't explicitly exported. [Atari Ace]
1323
1324Named the input_seq_type enumeration and used it explicitly in several
1325places. [Nathan Woods]
1326
1327Corrected tx1 and tx1a coinage DSW assignments. Reversed buggyboy/
1328buggybjr 'Game Time' settings. [Philip Bennett]
1329
1330TMS3203x core updates: [Aaron Giles]
1331 * fixed interrupt handling
1332 * added support for edge-triggered interrupts on '32
1333 * expanded interrupt support for the '32
1334 * updated drivers using TMS3203x core to deassert interrupts
1335 * added externally accessible functions for converting '3x floating point
1336    format
1337 * updated gaelco3d driver to use new functions
1338
1339Zeus2 (+related) updates: [Aaron Giles]
1340 * fixed save states for DCS games
1341 * cleaned up Zeus2 waveram handling
1342 * added Zeus2 save state support
1343 * added preliminary model and quad rendering support for Zeus2
1344 * added support to timekpr for the ZPRAM used on Zeus2
1345 * hooked up ZPRAM in Zeus2 games
1346 * hooked up controls in Zeus2 games
1347 * updated poly.c to ensure it is idle before saving state
1348 * Added artifical Z offset of -2 to make the full screen show in crusnexo
1349
1350Replaced tekken2/tekken2a/tekken2b 'tes1wave.8k' ROM with the
1351correct, non-byte-swapped dump. [Philip Bennett]
1352
1353Added discrete 74LS624(56789) implementation [couriersud]
1354 - DISCRETE_74LS624 is a VCO needed for dkongjr
1355 - Supports Logic, Energy and Count outputs
1356
1357dkong updates: [couriersud]
1358 - Added dkongjr discrete sound
1359 - Proper interface Z80 - I8035 for dkongjr
1360 - Changed discrete sound output factors
1361 - removed samples support for dkongjr
1362 - Cosmetic changes
1363 - Fixed regression in radarscp sound
1364 - Added dipswitch locations to dkong3b
1365
1366Documentation and clock frequency improvements for seta.c: [Brian Troha]
1367 - Added the Guru's readme info for Thundercade
1368 - Corrected rom name for Thundercade
1369 - changed clocks to OSC by divider IE: 16000000/2 /* 8MHz */
1370 - Changed Orbs clock to 16MHz with note about 14.xx MHz
1371 - Changed Meta Fox's x0-006 (65c02) to same as Thundercade
1372 - Changed the YM3438 in Ultra Toukond Densetsu from 6MHz to 1600000/4
1373    /* 4MHz */ as there is no mention of 6MHz OSC on PCB
1374
1375Verified a number of clock frequencies from real PCBs.
1376[Corrado Tomaselli, Zsolt Vasvari]
1377
1378Fixed several memory leaks related to SCSI CD emulation.
1379[Oliver Stoneberg]
1380
1381Removed the increasing of the R register from each IX/IY related
1382(FD xx or DD xx) instruction on the Z80. According to documentation
1383and the behavior of the Amstrad CPC driver, this is incorrect.
1384[Barry Rodewald]
1385
1386Added initial FPU support to the SH4 core. [Samuele Zannoli]
1387
1388Adjusted most conditional logging in MAME to use the idiom
1389"do { if (VERBOSE) logerror x; } while (0)". This has the benefit that
1390the compiler checks the syntax of the logging even in the case it will
1391be eliminated, and in fact a number of cases here needed adjustments
1392to compile because of this. [Atari Ace]
1393
1394
1395
13960.122u1
1397-------
1398
1399
1400MAMETesters Bugs Fixed
1401----------------------
1402ym2610_0119u2gre [Philip Bennett]
1403
1404
1405
1406Source Changes
1407--------------
1408Zeus updates: [Aaron Giles]
1409 * Figured out data format of 2 matrix form.
1410 * Extracted data for lights.
1411 * Added backface culling which mostly works but fails sometimes, so
1412    it is disabled.
1413 * Started on some initial lighting calculations.
1414 * Cleaned up zeus wave RAM accessors.
1415 * Changed rendering code to allow for greater parallelism on multicore
1416    systems.
1417 * Removed some vestigial zeus 2 hacks.
1418 * Reduced visible area to remove artifacts.
1419 * Made right/bottom vertices inclusive to fix some gapping issues.
1420 * Fixed invasn lightgun offset.
1421
1422Zeus 2 hardware:
1423 * Fixed ROM loading, added banking support.
1424 * Separated zeus 2 video implementation from zeus implementation.
1425 * Implemented direct pixel accesses; enough to get startup screens
1426    to show.
1427 * Hooked up ZPRAM.
1428 * Fixed digital inputs for crusnexo.
1429 * Fixed default screen parameters to match the games.
1430
1431Afega/nmk16 cleanups: [David Haywood, Tomasz Slanina]
1432 * Merged afega.c and nmk16.c drivers
1433 * Removed many hacks from both.
1434 * Fixed a number of games
1435
1436Fixed C219 sample read order and implemented sign+magnitude format.
1437Removed GAME_IMPERFECT_SOUND flag from all Namco NA-1 games.
1438[Philip Bennett]
1439
1440Fixed ROM-based DCS2 system to ignore HLE transfers. (Fixes broken
1441sound in invasn.) Properly reduced internal memory on the ADSP-2104
1442variants. [Aaron Giles]
1443
1444Fixed bug that would cause events to leak through to the game when the
1445debugger was up. [Aaron Giles]
1446
1447Verified some cpu clocks of original boards using a frequency counter:
1448[Corrado Tomaselli]
1449 * Changed Success Joe Ym2203 clock from 3mhz to 4mhz
1450 * Changed Pang M6295 clock from 990khz to 1Mhz
1451 * Changed Halley Comet main cpu clock to 1.664mhz (it's not a
1452    mistake, the clock is very low)
1453 * Besides confirming clocks on some games, I modified:
1454 * Aerofighters and Turbo Force sound z80 to 5mhz
1455 * Midnight Resitance 68k cpu to 10mhz (20mhz crystal) and modified
1456    m6295 clock to 1mhz. Also confirmed pin 7 is high.
1457    (Midnight resistance has a lot of slow downs on the pcb too)
1458
1459Minor "code quality" improvements: [Atari Ace]
1460 * fixed some remaining static/const qualifier missed cases
1461 * fixed some missing #include "foo.h"
1462 * a few global names were modified to make them less generic/more
1463    consistent (voodoo.c, vrender0.c, lethal.c, rungun.c, zac2650.c)
1464 * some dead/useless code was removed (i8051.c,model1.c,romcmp.c)
1465
1466
1467
1468New games added or promoted from NOT_WORKING status
1469---------------------------------------------------
1470Invasion [Aaron Giles]
1471Buggy Boy Junior/Speed Buggy (Upright) [Philip Bennett]
1472Task Force Harrier [David Haywood, Tomasz Slanina]
1473US AAF Mustang [David Haywood, Tomasz Slanina]
1474Black Heart [David Haywood, Tomasz Slanina]
1475Red Hawk [David Haywood, Tomasz Slanina]
1476Stagger I [David Haywood, Tomasz Slanina]
1477Sen Jin - Guardian Storm [David Haywood, Tomasz Slanina]
1478Spectrum 2000 [David Haywood, Tomasz Slanina]
1479Fire Hawk [David Haywood, Tomasz Slanina]
1480
1481
1482
1483New clones added
1484----------------
1485World Class Bowling (v1.3) [Brian Troha]
199World PK Soccer V2 (ver 1.1) [David Haywood]
src/osd/winui/layout.c
r1771r1772
3333// MAME/MAMEUI headers
3434#include "bitmask.h"
3535#include "treeview.h"
36#include "driver.h"
3637#include "mui_util.h"
3738#include "resource.h"
3839#include "directories.h"
src/osd/winui/winui.mak
r1771r1772
388388
389389$(UIOBJ)/mamevers.rc: $(OBJ)/build/verinfo$(EXE) $(SRC)/version.c
390390   @echo Emitting $@...
391   @$(OBJ)/build/verinfo$(EXE) $(SRC)/version.c > $@
391   @$(OBJ)/build/verinfo$(EXE) -b winui $(SRC)/version.c > $@
392392
393393
394394
src/osd/winui/mui_util.c
r1771r1772
325325
326326int numberOfSpeakers(const machine_config *config)
327327{
328   int speakers = speaker_output_count(config);
328329   int has_sound = FALSE;
329   int speakers = 0;
330330   int sndnum;
331331
332332   /* see if we have any sound chips to report */
r1771r1772
337337         break;
338338      }
339339
340   /* if we have sound, count the number of speakers */
341   if (has_sound)
342      for (speakers = 0; speakers < ARRAY_LENGTH(config->speaker); speakers++)
343         if (config->speaker[speakers].tag == NULL)
344            break;
340   /* if we don't have sound, set speaker count to 0 */
341   if (!has_sound)
342      speakers = 0;
345343
346344   return speakers;
347345}
r1771r1772
362360         int num_speakers;
363361
364362         /* Allocate machine config */
365         config = machine_config_alloc(gamedrv->drv);
363         config = machine_config_alloc(gamedrv->machine_config);
366364
367365         gameinfo->isClone = (GetParentRomSetIndex(gamedrv) != -1);
368366         gameinfo->isBroken = ((gamedrv->flags & GAME_NOT_WORKING) != 0);
r1771r1772
386384               }
387385            }
388386         }
389         // expand_machine_driver(gamedrv->drv, &drv);
390387
391388         num_speakers = numberOfSpeakers(config);
392389
src/osd/winui/treeview.c
r1771r1772
918918   {
919919      int n;
920920      machine_config *config;
921      // expand_machine_driver(drivers[jj]->drv,&drv);
922      config = machine_config_alloc(drivers[jj]->drv);
921      config = machine_config_alloc(drivers[jj]->machine_config);
923922      for (n = 0; n < MAX_CPU; n++) {
924923         if (config->cpu[n].type != CPU_DUMMY)
925924         {
r1771r1772
974973      int n;
975974      machine_config *config;
976975
977      // expand_machine_driver(drivers[jj]->drv,&drv);
978      config = machine_config_alloc(drivers[jj]->drv);
976      config = machine_config_alloc(drivers[jj]->machine_config);
979977      // Additional range and null checking.
980978      for (n = 0; n < MAX_SOUND ; n++) {
981979         if (config->sound[n].type > SOUND_DUMMY &&
src/osd/winui/winui.c
r1771r1772
47514751
47524752      case COLUMN_TYPE:
47534753         {
4754            machine_config *config = machine_config_alloc(drivers[nItem]->drv);
4754            machine_config *config = machine_config_alloc(drivers[nItem]->machine_config);
47554755            /* Vector/Raster */
47564756            if (isDriverVector(config))
47574757               s = TEXT("Vector");
r1771r1772
52055205
52065206   case COLUMN_TYPE:
52075207      {
5208         machine_config *config1 = machine_config_alloc(drivers[index1]->drv);
5209         machine_config *config2 = machine_config_alloc(drivers[index2]->drv);
5208         machine_config *config1 = machine_config_alloc(drivers[index1]->machine_config);
5209         machine_config *config2 = machine_config_alloc(drivers[index2]->machine_config);
52105210
52115211         value = isDriverVector(config1) - isDriverVector(config2);
52125212
r1771r1772
53205320   switch (filetype)
53215321   {
53225322   case FILETYPE_INPUT_FILES :
5323      of.lpstrFilter   = TEXT(MAMENAME " input files (*.inp,*.zip)\0*.inp;*.zip\0All files (*.*)\0*.*\0");
5323      of.lpstrFilter   = TEXT(MAMENAME) TEXT(" input files (*.inp,*.zip)\0*.inp;*.zip\0All files (*.*)\0*.*\0");
53245324      break;
53255325   case FILETYPE_SAVESTATE_FILES :
5326      of.lpstrFilter   = TEXT(MAMENAME " savestate files (*.sta)\0*.sta;\0All files (*.*)\0*.*\0");
5326      of.lpstrFilter   = TEXT(MAMENAME) TEXT(" savestate files (*.sta)\0*.sta;\0All files (*.*)\0*.*\0");
53275327      break;
53285328   case FILETYPE_WAVE_FILES :
53295329      of.lpstrFilter   = TEXT("sounds (*.wav)\0*.wav;\0All files (*.*)\0*.*\0");
src/osd/winui/properties.c
r1771r1772
378378         /* Allocate machine config */
379379         if (gamedrv != NULL)
380380         {
381            config = machine_config_alloc(gamedrv->drv);
381            config = machine_config_alloc(gamedrv->machine_config);
382382         }
383383         if (!gamedrv || !g_propSheets[i].pfnFilterProc || g_propSheets[i].pfnFilterProc(config, gamedrv))
384384         {
r1771r1772
576576{
577577   int chipnum;
578578   static char buf[1024] = "";
579   machine_config *config = machine_config_alloc(drivers[nIndex]->drv);
579   machine_config *config = machine_config_alloc(drivers[nIndex]->machine_config);
580580
581581   ZeroMemory(buf, sizeof(buf));
582582
r1771r1772
613613{
614614   int chipnum;
615615   static char buf[1024];
616   machine_config *config = machine_config_alloc(drivers[nIndex]->drv);
616   machine_config *config = machine_config_alloc(drivers[nIndex]->machine_config);
617617
618618   buf[0] = 0;
619619
r1771r1772
673673static char *GameInfoScreen(UINT nIndex)
674674{
675675   static char buf[1024];
676   machine_config *config = machine_config_alloc(drivers[nIndex]->drv);
676   machine_config *config = machine_config_alloc(drivers[nIndex]->machine_config);
677677
678678   if (isDriverVector(config))
679679   {
r1771r1772
707707static char *GameInfoColors(UINT nIndex)
708708{
709709   static char buf[1024];
710   machine_config *config = machine_config_alloc(drivers[nIndex]->drv);
710   machine_config *config = machine_config_alloc(drivers[nIndex]->machine_config);
711711
712712   ZeroMemory(buf, sizeof(buf));
713713   sprintf(buf, "%d colors ", config->total_colors);
r1771r1772
23532353
23542354   if ( nIndex > -1)
23552355   {
2356      machine_config *config = machine_config_alloc(drivers[nIndex]->drv);
2356      machine_config *config = machine_config_alloc(drivers[nIndex]->machine_config);
23572357      num_speakers = numberOfSpeakers(config);
23582358      machine_config_free(config);
23592359   }
r1771r1772
23772377
23782378   if (nIndex > -1)
23792379   {
2380      config = machine_config_alloc(drivers[nIndex]->drv);
2380      config = machine_config_alloc(drivers[nIndex]->machine_config);
23812381   }
23822382
23832383   hCtrl = GetDlgItem(hWnd, IDC_USE_FM_YM3812);
r1771r1772
24192419   hCtrl = GetDlgItem(hWnd, IDC_SAMPLES);
24202420
24212421   if ( nIndex > -1 ) {
2422      config = machine_config_alloc(drivers[nIndex]->drv);
2422      config = machine_config_alloc(drivers[nIndex]->machine_config);
24232423   }
24242424   
24252425   if (hCtrl)
src/emu/cpu/cpu.mak
r1771r1772
10201020CPUOBJS += $(CPUOBJ)/m68000/m68kcpu.o $(CPUOBJ)/m68000/m68kmame.o $(CPUOBJ)/m68000/m68kops.o
10211021DBGOBJS += $(CPUOBJ)/m68000/m68kdasm.o
10221022endif
1023M68KMAKE = $(CPUOBJ)/m68000/m68kmake$(EXE)
1023M68KMAKE = $(BUILDOUT)/m68kmake$(BUILD_EXE)
10241024
10251025# when we compile source files we need to include generated files from the OBJ directory
10261026$(CPUOBJ)/m68000/%.o: $(CPUSRC)/m68000/%.c
r1771r1772
10391039
10401040# rule to build the generator
10411041ifneq ($(CROSS_BUILD),1)
1042
1043BUILD += $(M68KMAKE)
1044
10421045$(M68KMAKE): $(CPUOBJ)/m68000/m68kmake.o $(LIBOCORE)
10431046   @echo Linking $@...
10441047   $(LD) $(LDFLAGS) $(OSDBGLDFLAGS) $^ $(LIBS) -o $@
r1771r1772
12221225
12231226CPUDEFS += -DHAS_UPD7810=$(if $(filter UPD7810,$(CPUS)),1,0)
12241227CPUDEFS += -DHAS_UPD7807=$(if $(filter UPD7807,$(CPUS)),1,0)
1228CPUDEFS += -DHAS_UPD7801=$(if $(filter UPD7801,$(CPUS)),1,0)
12251229
1226ifneq ($(filter UPD7810 UPD7807,$(CPUS)),)
1230ifneq ($(filter UPD7810 UPD7807 UPD7801,$(CPUS)),)
12271231OBJDIRS += $(CPUOBJ)/upd7810
12281232CPUOBJS += $(CPUOBJ)/upd7810/upd7810.o
12291233DBGOBJS += $(CPUOBJ)/upd7810/7810dasm.o
src/emu/cpu/upd7810/7810ops.c
r1771r1772
291291{
292292   int cycles = (upd7810_icount / 4) * 4;
293293   upd7810_icount -= cycles;
294   upd7810_timers(cycles);
294   upd7810.handle_timers(cycles);
295295   PC -= 1;      /* continue executing HALT */
296296}
297297
r1771r1772
816816{
817817   int cycles = (upd7810_icount / 4) * 4;
818818   upd7810_icount -= cycles;
819   upd7810_timers(cycles);
819   upd7810.handle_timers(cycles);
820820   PC -= 1;
821821}
822822
r1771r1772
83978397static void PRE_48(void)
83988398{
83998399   RDOP(OP2);
8400   upd7810_icount -= op48[OP2].cycles;
8401   upd7810_timers(op48[OP2].cycles);
8402   (*op48[OP2].opfunc)();
8400   upd7810_icount -= upd7810.op48[OP2].cycles;
8401   upd7810.handle_timers(upd7810.op48[OP2].cycles);
8402   (*upd7810.op48[OP2].opfunc)();
84038403}
84048404
84058405/* 49: 0100 1001 xxxx xxxx */
r1771r1772
84308430static void PRE_4C(void)
84318431{
84328432   RDOP(OP2);
8433   upd7810_icount -= op4C[OP2].cycles;
8434   upd7810_timers(op4C[OP2].cycles);
8435   (*op4C[OP2].opfunc)();
8433   upd7810_icount -= upd7810.op4C[OP2].cycles;
8434   upd7810.handle_timers(upd7810.op4C[OP2].cycles);
8435   (*upd7810.op4C[OP2].opfunc)();
84368436}
84378437
84388438/* 4d: prefix */
84398439static void PRE_4D(void)
84408440{
84418441   RDOP(OP2);
8442   upd7810_icount -= op4D[OP2].cycles;
8443   upd7810_timers(op4D[OP2].cycles);
8444   (*op4D[OP2].opfunc)();
8442   upd7810_icount -= upd7810.op4D[OP2].cycles;
8443   upd7810.handle_timers(upd7810.op4D[OP2].cycles);
8444   (*upd7810.op4D[OP2].opfunc)();
84458445}
84468446
84478447/* 4e: 0100 111d dddd dddd */
r1771r1772
88208820static void PRE_60(void)
88218821{
88228822   RDOP(OP2);
8823   upd7810_icount -= op60[OP2].cycles;
8824   upd7810_timers(op60[OP2].cycles);
8825   (*op60[OP2].opfunc)();
8823   upd7810_icount -= upd7810.op60[OP2].cycles;
8824   upd7810.handle_timers(upd7810.op60[OP2].cycles);
8825   (*upd7810.op60[OP2].opfunc)();
88268826}
88278827
88288828/* 61: 0110 0001 */
r1771r1772
88838883static void PRE_64(void)
88848884{
88858885   RDOP(OP2);
8886   upd7810_icount -= op64[OP2].cycles;
8887   upd7810_timers(op64[OP2].cycles);
8888   (*op64[OP2].opfunc)();
8886   upd7810_icount -= upd7810.op64[OP2].cycles;
8887   upd7810.handle_timers(upd7810.op64[OP2].cycles);
8888   (*upd7810.op64[OP2].opfunc)();
88898889}
88908890
88918891/* 65: 0110 0101 oooo oooo xxxx xxxx */
r1771r1772
89708970static void PRE_70(void)
89718971{
89728972   RDOP(OP2);
8973   upd7810_icount -= op70[OP2].cycles;
8974   upd7810_timers(op70[OP2].cycles);
8975   (*op70[OP2].opfunc)();
8973   upd7810_icount -= upd7810.op70[OP2].cycles;
8974   upd7810.handle_timers(upd7810.op70[OP2].cycles);
8975   (*upd7810.op70[OP2].opfunc)();
89768976}
89778977
89788978/* 71: 0111 0001 oooo oooo xxxx xxxx */
r1771r1772
90059005static void PRE_74(void)
90069006{
90079007   RDOP(OP2);
9008   upd7810_icount -= op74[OP2].cycles;
9009   upd7810_timers(op74[OP2].cycles);
9010   (*op74[OP2].opfunc)();
9008   upd7810_icount -= upd7810.op74[OP2].cycles;
9009   upd7810.handle_timers(upd7810.op74[OP2].cycles);
9010   (*upd7810.op74[OP2].opfunc)();
90119011}
90129012
90139013/* 75: 0111 0101 oooo oooo xxxx xxxx */
r1771r1772
90729072       PCH=RM(w.w.l+1);
90739073
90749074   change_pc( PCD );
9075       logerror ("!!!!!!!%.4x calt %.2x %.4x; game master table position not known\n",PPC, OP, PCD);
90769075   }
90779076}
90789077
r1771r1772
93399338   change_pc(PCD);
93409339}
93419340
9341/*********************/
9342/*                   */
9343/* 7801 instructions */
9344/*                   */
9345/*********************/
9346
9347static void CALT_7801(void)
9348{
9349   PAIR w;
9350   w.d = 0;
9351
9352   w.w.l = 0x80 + 2 * (OP & 0x3f);
9353
9354   SP--;
9355   WM( SPD, PCH );
9356   SP--;
9357   WM( SPD, PCL );
9358
9359   PCL=RM(w.w.l);
9360   PCH=RM(w.w.l+1);
9361
9362   change_pc( PCD );
9363}
9364
9365/* DCR(W) and INR(W) instructions do not modify the CY register on at least 78c05 and 78c06 */
9366static void DCR_A_7801(void)
9367{
9368   UINT32 old_CY = PSW & CY;
9369   DCR_A();
9370   PSW = ( PSW & ~CY ) | old_CY;
9371}
9372
9373static void DCR_B_7801(void)
9374{
9375   UINT32 old_CY = PSW & CY;
9376   DCR_B();
9377   PSW = ( PSW & ~CY ) | old_CY;
9378}
9379
9380static void DCR_C_7801(void)
9381{
9382   UINT32 old_CY = PSW & CY;
9383   DCR_C();
9384   PSW = ( PSW & ~CY ) | old_CY;
9385}
9386
9387static void DCRW_wa_7801(void)
9388{
9389   UINT32 old_CY = PSW & CY;
9390   DCRW_wa();
9391   PSW = ( PSW & ~CY ) | old_CY;
9392}
9393
9394static void INR_A_7801(void)
9395{
9396   UINT32 old_CY = PSW & CY;
9397   INR_A();
9398   PSW = ( PSW & ~CY ) | old_CY;
9399}
9400
9401static void INR_B_7801(void)
9402{
9403   UINT32 old_CY = PSW & CY;
9404   INR_B();
9405   PSW = ( PSW & ~CY ) | old_CY;
9406}
9407
9408static void INR_C_7801(void)
9409{
9410   UINT32 old_CY = PSW & CY;
9411   INR_C();
9412   PSW = ( PSW & ~CY ) | old_CY;
9413}
9414
9415static void INRW_wa_7801(void)
9416{
9417   UINT32 old_CY = PSW & CY;
9418   INRW_wa();
9419   PSW = ( PSW & ~CY ) | old_CY;
9420}
9421
9422static void IN(void)
9423{
9424   logerror("unimplemented instruction: IN\n");
9425}
9426
9427static void OUT(void)
9428{
9429   logerror("unimplemented instruction: OUT\n");
9430}
9431
9432static void MOV_A_S(void)
9433{
9434   logerror("unimplemented instruction: MOV_A_S\n");
9435}
9436
9437static void MOV_S_A(void)
9438{
9439   logerror("unimplemented instruction: MOV_A_S\n");
9440}
9441
9442static void PEN(void)
9443{
9444   logerror("unimplemented instruction: PEN\n");
9445}
9446
9447static void PER(void)
9448{
9449   logerror("unimplemented instruction: PER\n");
9450}
9451
9452static void PEX(void)
9453{
9454   logerror("unimplemented instruction: PEX\n");
9455}
9456
9457static void SIO(void)
9458{
9459   logerror("unimplemented instruction: SIO\n");
9460}
9461
9462static void SKIT_F0(void)
9463{
9464   logerror("unimplemented instruction: SKIT_F0\n");
9465}
9466
9467static void SKNIT_F0(void)
9468{
9469   logerror("unimplemented instruction: SKNIT_F0\n");
9470}
9471
9472static void STM(void)
9473{
9474   upd7810.ovc0 = ( ( TMM & 0x04 ) ? 16 * 8 : 8 ) * TM0;
9475}
src/emu/cpu/upd7810/7810tbl.c
r1771r1772
376376static void GTI_TMM_xx(void);
377377static void GTI_V_xx(void);
378378static void HALT(void);
379static void IN(void);
379380static void INRW_wa(void);
380381static void INR_A(void);
381382static void INR_B(void);
r1771r1772
489490static void MOV_A_PD(void);
490491static void MOV_A_PF(void);
491492static void MOV_A_RXB(void);
493static void MOV_A_S(void);
492494static void MOV_A_SMH(void);
493495static void MOV_A_TMM(void);
494496static void MOV_A_PT(void);
r1771r1772
522524static void MOV_PC_A(void);
523525static void MOV_PD_A(void);
524526static void MOV_PF_A(void);
527static void MOV_S_A(void);
525528static void MOV_SMH_A(void);
526529static void MOV_SML_A(void);
527530static void MOV_TM0_A(void);
r1771r1772
730733static void ORI_SMH_xx(void);
731734static void ORI_TMM_xx(void);
732735static void ORI_V_xx(void);
736static void OUT(void);
737static void PEN(void);
738static void PER(void);
739static void PEX(void);
733740static void POP_BC(void);
734741static void POP_DE(void);
735742static void POP_EA(void);
r1771r1772
806813static void SDED_w(void);
807814static void SETB(void);
808815static void SHLD_w(void);
816static void SIO(void);
809817static void SK_bit(void);
810818static void SKN_bit(void);
811819static void SKIT_AN4(void);
r1771r1772
813821static void SKIT_AN6(void);
814822static void SKIT_AN7(void);
815823static void SKIT_ER(void);
824static void SKIT_F0(void);
816825static void SKIT_F1(void);
817826static void SKIT_F2(void);
818827static void SKIT_FAD(void);
r1771r1772
831840static void SKNIT_AN6(void);
832841static void SKNIT_AN7(void);
833842static void SKNIT_ER(void);
843static void SKNIT_F0(void);
834844static void SKNIT_F1(void);
835845static void SKNIT_F2(void);
836846static void SKNIT_FAD(void);
r1771r1772
889899static void STEAX_H_EA(void);
890900static void STEAX_H_xx(void);
891901static void STEAX_Hp(void);
902static void STM(void);
892903static void STOP(void);
893904static void SUBNBW_wa(void);
894905static void SUBNBX_B(void);
r1771r1772
10231034static void XRI_SMH_xx(void);
10241035static void XRI_TMM_xx(void);
10251036static void XRI_V_xx(void);
1037static void CALT_7801(void);
1038static void DCR_A_7801(void);
1039static void DCR_B_7801(void);
1040static void DCR_C_7801(void);
1041static void DCRW_wa_7801(void);
1042static void INR_A_7801(void);
1043static void INR_B_7801(void);
1044static void INR_C_7801(void);
1045static void INRW_wa_7801(void);
10261046
1047
10271048static const struct opcode_s op48[256] =
10281049{
10291050   {illegal,      2, 8, 8,L0|L1}, /* 00: 0100 1000 0000 0000                      */
r1771r1772
35113532   {JR,         1,10,10,L0|L1}   /* ff: 1111 1111                                */
35123533};
35133534
3535
3536/***********************************************************************
3537 *
3538 * uPD7801
3539 *
3540 **********************************************************************/
3541
3542static const struct opcode_s op48_7801[256] =
3543{
3544   /* 0x00 - 0x1F */
3545   {SKIT_F0,      2, 8, 8,L0|L1},   {SKIT_FT0,      2, 8, 8,L0|L1},
3546   {SKIT_F1,      2, 8, 8,L0|L1},   {SKIT_F2,      2, 8, 8,L0|L1},
3547   {SKIT_FST,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3548   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3549   {illegal2,       2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3550   {SK_CY,       2, 8, 8,L0|L1},   {illegal2,       2, 8, 8,L0|L1},
3551   {SK_Z,         2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3552   {PUSH_VA,      2,15,15,L0|L1},   {POP_VA,      2,15,15,L0|L1},
3553
3554   {SKNIT_F0,      2, 8, 8,L0|L1},   {SKNIT_FT0,      2, 8, 8,L0|L1},
3555   {SKNIT_F1,      2, 8, 8,L0|L1},   {SKNIT_F2,      2, 8, 8,L0|L1},
3556   {SKNIT_FST,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3557   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3558   {illegal2,      2, 8, 8,L0|L1},   {illegal,      2, 8, 8,L0|L1},
3559   {SKN_CY,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3560   {SKN_Z,       2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3561   {PUSH_BC,      2,17,17,L0|L1},   {POP_BC,      2,15,15,L0|L1},
3562
3563   /* 0x20 - 0x3F */
3564   {EI,         2, 8, 8,L0|L1},   {illegal2,       2, 8, 8,L0|L1},
3565   {illegal2,       2, 8, 8,L0|L1},   {illegal2,       2, 8, 8,L0|L1},
3566   {DI,         2, 8, 8,L0|L1},   {illegal2,       2, 8, 8,L0|L1},
3567   {illegal2,       2, 8, 8,L0|L1},   {illegal2,       2, 8, 8,L0|L1},
3568   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3569   {CLC,         2, 8, 8,L0|L1},   {STC,         2, 8, 8,L0|L1},
3570   {PEN,         2,11,11,L0|L1},   {PEX,         2,11,11,L0|L1},
3571   {PUSH_DE,       2,17,17,L0|L1},   {POP_DE,       2,15,15,L0|L1},
3572
3573   {RLL_A,         2, 8, 8,L0|L1},   {RLR_A,       2, 8, 8,L0|L1},
3574   {RLL_C,       2, 8, 8,L0|L1},   {RLR_C,       2, 8, 8,L0|L1},
3575   {SLL_A,         2, 8, 8,L0|L1},   {SLR_A,       2, 8, 8,L0|L1},
3576   {SLL_C,       2, 8, 8,L0|L1},   {SLR_C,       2, 8, 8,L0|L1},
3577   {RLD,         2,17,17,L0|L1},   {RRD,         2,17,17,L0|L1},
3578   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2,12,12,L0|L1},
3579   {PER,         2,11,11,L0|L1},   {illegal2,       2, 8, 8,L0|L1},
3580   {PUSH_HL,       2,17,17,L0|L1},   {POP_HL,       2,15,15,L0|L1},
3581
3582   /* 0x40 - 0x5F */
3583   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3584   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3585   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3586   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3587   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3588   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3589   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3590   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3591
3592   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3593   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3594   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3595   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3596   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3597   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3598   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3599   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3600
3601   /* 0x60 - 0x7F */
3602   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3603   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3604   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3605   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3606   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3607   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3608   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3609   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3610
3611   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3612   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3613   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3614   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3615   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3616   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3617   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3618   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3619
3620   /* 0x80 - 0x9F */
3621   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3622   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3623   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3624   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3625   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3626   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3627   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3628   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3629
3630   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3631   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3632   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3633   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3634   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3635   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3636   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3637   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3638
3639   /* 0xA0 - 0xBF */
3640   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3641   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3642   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3643   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3644   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3645   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3646   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3647   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3648
3649   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3650   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3651   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3652   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3653   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3654   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3655   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3656   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3657
3658   /* 0xC0 - 0xDF */
3659   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3660   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3661   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3662   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3663   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3664   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3665   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3666   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3667
3668   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3669   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3670   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3671   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3672   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3673   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3674   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3675   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3676
3677   /* 0xE0 - 0xFF */
3678   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3679   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3680   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3681   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3682   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3683   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3684   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3685   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3686
3687   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3688   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3689   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3690   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3691   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3692   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3693   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3694   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1}
3695};
3696
3697static const struct opcode_s op4C_7801[256] =
3698{
3699   /* 0x00 - 0x1F */
3700   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3701   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3702   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3703   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3704   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3705   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3706   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3707   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3708
3709   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3710   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3711   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3712   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3713   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3714   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3715   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3716   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3717
3718   /* 0x20 - 0x3F */
3719   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3720   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3721   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3722   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3723   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3724   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3725   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3726   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3727
3728   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3729   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3730   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3731   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3732   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3733   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3734   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3735   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3736
3737   /* 0x40 - 0x5F */
3738   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3739   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3740   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3741   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3742   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3743   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3744   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3745   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3746
3747   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3748   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3749   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3750   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3751   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3752   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3753   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3754   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3755
3756   /* 0x60 - 0x7F */
3757   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3758   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3759   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3760   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3761   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3762   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3763   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3764   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3765
3766   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3767   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3768   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3769   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3770   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3771   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3772   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3773   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3774
3775   /* 0x80 - 0x9F */
3776   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3777   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3778   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3779   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3780   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3781   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3782   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3783   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3784
3785   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3786   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3787   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3788   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3789   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3790   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3791   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3792   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3793
3794   /* 0xA0 - 0xBF */
3795   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3796   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3797   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3798   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3799   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3800   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3801   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3802   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3803
3804   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3805   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3806   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3807   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3808   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3809   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3810   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3811   {IN,         2,10,10,L0|L1},   {IN,         2,10,10,L0|L1},
3812
3813   /* 0xC0 - 0xDF */
3814   {MOV_A_PA,      2,10,10,L0|L1},   {MOV_A_PB,      2,10,10,L0|L1},
3815   {MOV_A_PC,      2,10,10,L0|L1},   {MOV_A_MKL,      2,10,10,L0|L1},
3816   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3817   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3818   {MOV_A_S,      2,10,10,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3819   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3820   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3821   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3822
3823   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3824   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3825   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3826   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3827   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3828   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3829   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3830   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3831
3832   /* 0xE0 - 0xFF */
3833   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3834   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3835   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3836   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3837   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3838   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3839   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3840   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3841
3842   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3843   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3844   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3845   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3846   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3847   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3848   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3849   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1}
3850};
3851
3852/* prefix 4D */
3853static const struct opcode_s op4D_7801[256] =
3854{
3855   /* 0x00 - 0x1F */
3856   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3857   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3858   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3859   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3860   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3861   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3862   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3863   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3864
3865   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3866   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3867   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3868   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3869   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3870   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3871   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3872   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3873
3874   /* 0x20 - 0x3F */
3875   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3876   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3877   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3878   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3879   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3880   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3881   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3882   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3883
3884   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3885   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3886   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3887   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3888   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3889   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3890   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3891   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3892
3893   /* 0x40 - 0x5F */
3894   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3895   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3896   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3897   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3898   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3899   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3900   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3901   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3902
3903   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3904   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3905   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3906   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3907   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3908   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3909   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3910   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3911
3912   /* 0x60 - 0x7F */
3913   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3914   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3915   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3916   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3917   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3918   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3919   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3920   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3921
3922   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3923   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3924   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3925   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3926   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3927   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3928   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3929   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3930
3931   /* 0x80 - 0x9F */
3932   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3933   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3934   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3935   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3936   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3937   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3938   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3939   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3940
3941   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3942   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3943   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3944   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3945   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3946   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3947   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3948   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3949
3950   /* 0xA0 - 0xBF */
3951   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3952   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3953   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3954   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3955   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3956   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3957   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3958   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3959
3960   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3961   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3962   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3963   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3964   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3965   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3966   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3967   {OUT,         2,10,10,L0|L1},   {OUT,         2,10,10,L0|L1},
3968
3969   /* 0xC0 - 0xDF */
3970   {MOV_PA_A,      2,10,10,L0|L1},   {MOV_PB_A,      2,10,10,L0|L1},
3971   {MOV_PC_A,      2,10,10,L0|L1},   {MOV_MKL_A,      2,10,10,L0|L1},
3972   {MOV_MB_A,      2,10,10,L0|L1},   {MOV_MC_A,      2,10,10,L0|L1},
3973   {MOV_TM0_A,    2,10,10,L0|L1},   {MOV_TM1_A,    2,10,10,L0|L1},
3974   {MOV_S_A,      2,10,10,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3975   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3976   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3977   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3978
3979   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3980   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3981   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3982   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3983   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3984   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3985   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3986   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3987
3988   /* 0xE0 - 0xFF */
3989   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3990   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3991   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3992   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3993   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3994   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3995   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3996   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3997
3998   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
3999   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4000   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4001   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4002   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4003   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4004   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4005   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1}
4006};
4007
4008/* prefix 60 */
4009static const struct opcode_s op60_7801[256] =
4010{
4011   /* 0x00 - 0x1F */
4012   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4013   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4014   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4015   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4016   {ANA_V_A,      2, 8, 8,L0|L1},   {ANA_A_A,      2, 8, 8,L0|L1},
4017   {ANA_B_A,      2, 8, 8,L0|L1},   {ANA_C_A,      2, 8, 8,L0|L1},
4018   {ANA_D_A,      2, 8, 8,L0|L1},   {ANA_E_A,      2, 8, 8,L0|L1},
4019   {ANA_H_A,      2, 8, 8,L0|L1},   {ANA_L_A,      2, 8, 8,L0|L1},
4020
4021   {XRA_V_A,      2, 8, 8,L0|L1},   {XRA_A_A,      2, 8, 8,L0|L1},
4022   {XRA_B_A,      2, 8, 8,L0|L1},   {XRA_C_A,      2, 8, 8,L0|L1},
4023   {XRA_D_A,      2, 8, 8,L0|L1},   {XRA_E_A,      2, 8, 8,L0|L1},
4024   {XRA_H_A,      2, 8, 8,L0|L1},   {XRA_L_A,      2, 8, 8,L0|L1},
4025   {ORA_V_A,      2, 8, 8,L0|L1},   {ORA_A_A,      2, 8, 8,L0|L1},
4026   {ORA_B_A,      2, 8, 8,L0|L1},   {ORA_C_A,      2, 8, 8,L0|L1},
4027   {ORA_D_A,      2, 8, 8,L0|L1},   {ORA_E_A,      2, 8, 8,L0|L1},
4028   {ORA_H_A,      2, 8, 8,L0|L1},   {ORA_L_A,      2, 8, 8,L0|L1},
4029
4030   /* 0x20 - 0x3F */
4031   {ADDNC_V_A,    2, 8, 8,L0|L1},   {ADDNC_A_A,    2, 8, 8,L0|L1},
4032   {ADDNC_B_A,    2, 8, 8,L0|L1},   {ADDNC_C_A,    2, 8, 8,L0|L1},
4033   {ADDNC_D_A,    2, 8, 8,L0|L1},   {ADDNC_E_A,    2, 8, 8,L0|L1},
4034   {ADDNC_H_A,    2, 8, 8,L0|L1},   {ADDNC_L_A,    2, 8, 8,L0|L1},
4035   {GTA_V_A,      2, 8, 8,L0|L1},   {GTA_A_A,      2, 8, 8,L0|L1},
4036   {GTA_B_A,      2, 8, 8,L0|L1},   {GTA_C_A,      2, 8, 8,L0|L1},
4037   {GTA_D_A,      2, 8, 8,L0|L1},   {GTA_E_A,      2, 8, 8,L0|L1},
4038   {GTA_H_A,      2, 8, 8,L0|L1},   {GTA_L_A,      2, 8, 8,L0|L1},
4039
4040   {SUBNB_V_A,    2, 8, 8,L0|L1},   {SUBNB_A_A,    2, 8, 8,L0|L1},
4041   {SUBNB_B_A,    2, 8, 8,L0|L1},   {SUBNB_C_A,    2, 8, 8,L0|L1},
4042   {SUBNB_D_A,    2, 8, 8,L0|L1},   {SUBNB_E_A,    2, 8, 8,L0|L1},
4043   {SUBNB_H_A,    2, 8, 8,L0|L1},   {SUBNB_L_A,    2, 8, 8,L0|L1},
4044   {LTA_V_A,      2, 8, 8,L0|L1},   {LTA_A_A,      2, 8, 8,L0|L1},
4045   {LTA_B_A,      2, 8, 8,L0|L1},   {LTA_C_A,      2, 8, 8,L0|L1},
4046   {LTA_D_A,      2, 8, 8,L0|L1},   {LTA_E_A,      2, 8, 8,L0|L1},
4047   {LTA_H_A,      2, 8, 8,L0|L1},   {LTA_L_A,      2, 8, 8,L0|L1},
4048
4049   /* 0x40 - 0x5F */
4050   {ADD_V_A,      2, 8, 8,L0|L1},   {ADD_A_A,      2, 8, 8,L0|L1},
4051   {ADD_B_A,      2, 8, 8,L0|L1},   {ADD_C_A,      2, 8, 8,L0|L1},
4052   {ADD_D_A,      2, 8, 8,L0|L1},   {ADD_E_A,      2, 8, 8,L0|L1},
4053   {ADD_H_A,      2, 8, 8,L0|L1},   {ADD_L_A,      2, 8, 8,L0|L1},
4054   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4055   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4056   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4057   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4058
4059   {ADC_V_A,      2, 8, 8,L0|L1},   {ADC_A_A,      2, 8, 8,L0|L1},
4060   {ADC_B_A,      2, 8, 8,L0|L1},   {ADC_C_A,      2, 8, 8,L0|L1},
4061   {ADC_D_A,      2, 8, 8,L0|L1},   {ADC_E_A,      2, 8, 8,L0|L1},
4062   {ADC_H_A,      2, 8, 8,L0|L1},   {ADC_L_A,      2, 8, 8,L0|L1},
4063   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4064   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4065   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4066   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4067
4068   /* 0x60 - 0x7F */
4069   {SUB_V_A,      2, 8, 8,L0|L1},   {SUB_A_A,      2, 8, 8,L0|L1},
4070   {SUB_B_A,      2, 8, 8,L0|L1},   {SUB_C_A,      2, 8, 8,L0|L1},
4071   {SUB_D_A,      2, 8, 8,L0|L1},   {SUB_E_A,      2, 8, 8,L0|L1},
4072   {SUB_H_A,      2, 8, 8,L0|L1},   {SUB_L_A,      2, 8, 8,L0|L1},
4073   {NEA_V_A,      2, 8, 8,L0|L1},   {NEA_A_A,      2, 8, 8,L0|L1},
4074   {NEA_B_A,      2, 8, 8,L0|L1},   {NEA_C_A,      2, 8, 8,L0|L1},
4075   {NEA_D_A,      2, 8, 8,L0|L1},   {NEA_E_A,      2, 8, 8,L0|L1},
4076   {NEA_H_A,      2, 8, 8,L0|L1},   {NEA_L_A,      2, 8, 8,L0|L1},
4077
4078   {SBB_V_A,      2, 8, 8,L0|L1},   {SBB_A_A,      2, 8, 8,L0|L1},
4079   {SBB_B_A,      2, 8, 8,L0|L1},   {SBB_C_A,      2, 8, 8,L0|L1},
4080   {SBB_D_A,      2, 8, 8,L0|L1},   {SBB_E_A,      2, 8, 8,L0|L1},
4081   {SBB_H_A,      2, 8, 8,L0|L1},   {SBB_L_A,      2, 8, 8,L0|L1},
4082   {EQA_V_A,      2, 8, 8,L0|L1},   {EQA_A_A,      2, 8, 8,L0|L1},
4083   {EQA_B_A,      2, 8, 8,L0|L1},   {EQA_C_A,      2, 8, 8,L0|L1},
4084   {EQA_D_A,      2, 8, 8,L0|L1},   {EQA_E_A,      2, 8, 8,L0|L1},
4085   {EQA_H_A,      2, 8, 8,L0|L1},   {EQA_L_A,      2, 8, 8,L0|L1},
4086
4087   /* 0x80 - 0x9F */
4088   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4089   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4090   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4091   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4092   {ANA_A_V,      2, 8, 8,L0|L1},   {ANA_A_A,      2, 8, 8,L0|L1},
4093   {ANA_A_B,      2, 8, 8,L0|L1},   {ANA_A_C,      2, 8, 8,L0|L1},
4094   {ANA_A_D,      2, 8, 8,L0|L1},   {ANA_A_E,      2, 8, 8,L0|L1},
4095   {ANA_A_H,      2, 8, 8,L0|L1},   {ANA_A_L,      2, 8, 8,L0|L1},
4096
4097   {XRA_A_V,      2, 8, 8,L0|L1},   {XRA_A_A,      2, 8, 8,L0|L1},
4098   {XRA_A_B,      2, 8, 8,L0|L1},   {XRA_A_C,      2, 8, 8,L0|L1},
4099   {XRA_A_D,      2, 8, 8,L0|L1},   {XRA_A_E,      2, 8, 8,L0|L1},
4100   {XRA_A_H,      2, 8, 8,L0|L1},   {XRA_A_L,      2, 8, 8,L0|L1},
4101   {ORA_A_V,      2, 8, 8,L0|L1},   {ORA_A_A,      2, 8, 8,L0|L1},
4102   {ORA_A_B,      2, 8, 8,L0|L1},   {ORA_A_C,      2, 8, 8,L0|L1},
4103   {ORA_A_D,      2, 8, 8,L0|L1},   {ORA_A_E,      2, 8, 8,L0|L1},
4104   {ORA_A_H,      2, 8, 8,L0|L1},   {ORA_A_L,      2, 8, 8,L0|L1},
4105
4106   /* 0xA0 - 0xBF */
4107   {ADDNC_A_V,    2, 8, 8,L0|L1},   {ADDNC_A_A,    2, 8, 8,L0|L1},
4108   {ADDNC_A_B,    2, 8, 8,L0|L1},   {ADDNC_A_C,    2, 8, 8,L0|L1},
4109   {ADDNC_A_D,    2, 8, 8,L0|L1},   {ADDNC_A_E,    2, 8, 8,L0|L1},
4110   {ADDNC_A_H,    2, 8, 8,L0|L1},   {ADDNC_A_L,    2, 8, 8,L0|L1},
4111   {GTA_A_V,      2, 8, 8,L0|L1},   {GTA_A_A,      2, 8, 8,L0|L1},
4112   {GTA_A_B,      2, 8, 8,L0|L1},   {GTA_A_C,      2, 8, 8,L0|L1},
4113   {GTA_A_D,      2, 8, 8,L0|L1},   {GTA_A_E,      2, 8, 8,L0|L1},
4114   {GTA_A_H,      2, 8, 8,L0|L1},   {GTA_A_L,      2, 8, 8,L0|L1},
4115
4116   {SUBNB_A_V,    2, 8, 8,L0|L1},   {SUBNB_A_A,    2, 8, 8,L0|L1},
4117   {SUBNB_A_B,    2, 8, 8,L0|L1},   {SUBNB_A_C,    2, 8, 8,L0|L1},
4118   {SUBNB_A_D,    2, 8, 8,L0|L1},   {SUBNB_A_E,    2, 8, 8,L0|L1},
4119   {SUBNB_A_H,    2, 8, 8,L0|L1},   {SUBNB_A_L,    2, 8, 8,L0|L1},
4120   {LTA_A_V,      2, 8, 8,L0|L1},   {LTA_A_A,      2, 8, 8,L0|L1},
4121   {LTA_A_B,      2, 8, 8,L0|L1},   {LTA_A_C,      2, 8, 8,L0|L1},
4122   {LTA_A_D,      2, 8, 8,L0|L1},   {LTA_A_E,      2, 8, 8,L0|L1},
4123   {LTA_A_H,      2, 8, 8,L0|L1},   {LTA_A_L,      2, 8, 8,L0|L1},
4124
4125   /* 0xC0 - 0xDF */
4126   {ADD_A_V,      2, 8, 8,L0|L1},   {ADD_A_A,      2, 8, 8,L0|L1},
4127   {ADD_A_B,      2, 8, 8,L0|L1},   {ADD_A_C,      2, 8, 8,L0|L1},
4128   {ADD_A_D,      2, 8, 8,L0|L1},   {ADD_A_E,      2, 8, 8,L0|L1},
4129   {ADD_A_H,      2, 8, 8,L0|L1},   {ADD_A_L,      2, 8, 8,L0|L1},
4130   {ONA_A_V,      2, 8, 8,L0|L1},   {ONA_A_A,      2, 8, 8,L0|L1},
4131   {ONA_A_B,      2, 8, 8,L0|L1},   {ONA_A_C,      2, 8, 8,L0|L1},
4132   {ONA_A_D,      2, 8, 8,L0|L1},   {ONA_A_E,      2, 8, 8,L0|L1},
4133   {ONA_A_H,      2, 8, 8,L0|L1},   {ONA_A_L,      2, 8, 8,L0|L1},
4134
4135   {ADC_A_V,      2, 8, 8,L0|L1},   {ADC_A_A,      2, 8, 8,L0|L1},
4136   {ADC_A_B,      2, 8, 8,L0|L1},   {ADC_A_C,      2, 8, 8,L0|L1},
4137   {ADC_A_D,      2, 8, 8,L0|L1},   {ADC_A_E,      2, 8, 8,L0|L1},
4138   {ADC_A_H,      2, 8, 8,L0|L1},   {ADC_A_L,      2, 8, 8,L0|L1},
4139   {OFFA_A_V,      2, 8, 8,L0|L1},   {OFFA_A_A,      2, 8, 8,L0|L1},
4140   {OFFA_A_B,      2, 8, 8,L0|L1},   {OFFA_A_C,      2, 8, 8,L0|L1},
4141   {OFFA_A_D,      2, 8, 8,L0|L1},   {OFFA_A_E,      2, 8, 8,L0|L1},
4142   {OFFA_A_H,      2, 8, 8,L0|L1},   {OFFA_A_L,      2, 8, 8,L0|L1},
4143
4144   /* 0xE0 - 0xFF */
4145   {SUB_A_V,      2, 8, 8,L0|L1},   {SUB_A_A,      2, 8, 8,L0|L1},
4146   {SUB_A_B,      2, 8, 8,L0|L1},   {SUB_A_C,      2, 8, 8,L0|L1},
4147   {SUB_A_D,      2, 8, 8,L0|L1},   {SUB_A_E,      2, 8, 8,L0|L1},
4148   {SUB_A_H,      2, 8, 8,L0|L1},   {SUB_A_L,      2, 8, 8,L0|L1},
4149   {NEA_A_V,      2, 8, 8,L0|L1},   {NEA_A_A,      2, 8, 8,L0|L1},
4150   {NEA_A_B,      2, 8, 8,L0|L1},   {NEA_A_C,      2, 8, 8,L0|L1},
4151   {NEA_A_D,      2, 8, 8,L0|L1},   {NEA_A_E,      2, 8, 8,L0|L1},
4152   {NEA_A_H,      2, 8, 8,L0|L1},   {NEA_A_L,      2, 8, 8,L0|L1},
4153
4154   {SBB_A_V,      2, 8, 8,L0|L1},   {SBB_A_A,      2, 8, 8,L0|L1},
4155   {SBB_A_B,      2, 8, 8,L0|L1},   {SBB_A_C,      2, 8, 8,L0|L1},
4156   {SBB_A_D,      2, 8, 8,L0|L1},   {SBB_A_E,      2, 8, 8,L0|L1},
4157   {SBB_A_H,      2, 8, 8,L0|L1},   {SBB_A_L,      2, 8, 8,L0|L1},
4158   {EQA_A_V,      2, 8, 8,L0|L1},   {EQA_A_A,      2, 8, 8,L0|L1},
4159   {EQA_A_B,      2, 8, 8,L0|L1},   {EQA_A_C,      2, 8, 8,L0|L1},
4160   {EQA_A_D,      2, 8, 8,L0|L1},   {EQA_A_E,      2, 8, 8,L0|L1},
4161   {EQA_A_H,      2, 8, 8,L0|L1},   {EQA_A_L,      2, 8, 8,L0|L1}
4162};
4163
4164/* prefix 64 */
4165static const struct opcode_s op64_7801[256] =
4166{
4167   /* 0x00 - 0x1F */
4168   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4169   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4170   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4171   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4172   {ANI_V_xx,      3,11,11,L0|L1},   {ANI_A_xx,      3,11,11,L0|L1},
4173   {ANI_B_xx,      3,11,11,L0|L1},   {ANI_C_xx,      3,11,11,L0|L1},
4174   {ANI_D_xx,      3,11,11,L0|L1},   {ANI_E_xx,      3,11,11,L0|L1},
4175   {ANI_H_xx,      3,11,11,L0|L1},   {ANI_L_xx,      3,11,11,L0|L1},
4176
4177   {XRI_V_xx,      3,11,11,L0|L1},   {XRI_A_xx,      3,11,11,L0|L1},
4178   {XRI_B_xx,      3,11,11,L0|L1},   {XRI_C_xx,      3,11,11,L0|L1},
4179   {XRI_D_xx,      3,11,11,L0|L1},   {XRI_E_xx,      3,11,11,L0|L1},
4180   {XRI_H_xx,      3,11,11,L0|L1},   {XRI_L_xx,      3,11,11,L0|L1},
4181   {ORI_V_xx,      3,11,11,L0|L1},   {ORI_A_xx,      3,11,11,L0|L1},
4182   {ORI_B_xx,      3,11,11,L0|L1},   {ORI_C_xx,      3,11,11,L0|L1},
4183   {ORI_D_xx,      3,11,11,L0|L1},   {ORI_E_xx,      3,11,11,L0|L1},
4184   {ORI_H_xx,      3,11,11,L0|L1},   {ORI_L_xx,      3,11,11,L0|L1},
4185
4186   /* 0x20 - 0x3F */
4187   {ADINC_V_xx,   3,11,11,L0|L1},   {ADINC_A_xx,   3,11,11,L0|L1},
4188   {ADINC_B_xx,   3,11,11,L0|L1},   {ADINC_C_xx,   3,11,11,L0|L1},
4189   {ADINC_D_xx,   3,11,11,L0|L1},   {ADINC_E_xx,   3,11,11,L0|L1},
4190   {ADINC_H_xx,   3,11,11,L0|L1},   {ADINC_L_xx,   3,11,11,L0|L1},
4191   {GTI_V_xx,      3,11,11,L0|L1},   {GTI_A_xx,      3,11,11,L0|L1},
4192   {GTI_B_xx,      3,11,11,L0|L1},   {GTI_C_xx,      3,11,11,L0|L1},
4193   {GTI_D_xx,      3,11,11,L0|L1},   {GTI_E_xx,      3,11,11,L0|L1},
4194   {GTI_H_xx,      3,11,11,L0|L1},   {GTI_L_xx,      3,11,11,L0|L1},
4195
4196   {SUINB_V_xx,   3,11,11,L0|L1},   {SUINB_A_xx,   3,11,11,L0|L1},
4197   {SUINB_B_xx,   3,11,11,L0|L1},   {SUINB_C_xx,   3,11,11,L0|L1},
4198   {SUINB_D_xx,   3,11,11,L0|L1},   {SUINB_E_xx,   3,11,11,L0|L1},
4199   {SUINB_H_xx,   3,11,11,L0|L1},   {SUINB_L_xx,   3,11,11,L0|L1},
4200   {LTI_V_xx,      3,11,11,L0|L1},   {LTI_A_xx,      3,11,11,L0|L1},
4201   {LTI_B_xx,      3,11,11,L0|L1},   {LTI_C_xx,      3,11,11,L0|L1},
4202   {LTI_D_xx,      3,11,11,L0|L1},   {LTI_E_xx,      3,11,11,L0|L1},
4203   {LTI_H_xx,      3,11,11,L0|L1},   {LTI_L_xx,      3,11,11,L0|L1},
4204
4205   /* 0x40 - 0x5F */
4206   {ADI_V_xx,      3,11,11,L0|L1},   {ADI_A_xx,      3,11,11,L0|L1},
4207   {ADI_B_xx,      3,11,11,L0|L1},   {ADI_C_xx,      3,11,11,L0|L1},
4208   {ADI_D_xx,      3,11,11,L0|L1},   {ADI_E_xx,      3,11,11,L0|L1},
4209   {ADI_H_xx,      3,11,11,L0|L1},   {ADI_L_xx,      3,11,11,L0|L1},
4210   {ONI_V_xx,      3,11,11,L0|L1},   {ONI_A_xx,      3,11,11,L0|L1},
4211   {ONI_B_xx,      3,11,11,L0|L1},   {ONI_C_xx,      3,11,11,L0|L1},
4212   {ONI_D_xx,      3,11,11,L0|L1},   {ONI_E_xx,      3,11,11,L0|L1},
4213   {ONI_H_xx,      3,11,11,L0|L1},   {ONI_L_xx,      3,11,11,L0|L1},
4214
4215   {ACI_V_xx,      3,11,11,L0|L1},   {ACI_A_xx,      3,11,11,L0|L1},
4216   {ACI_B_xx,      3,11,11,L0|L1},   {ACI_C_xx,      3,11,11,L0|L1},
4217   {ACI_D_xx,      3,11,11,L0|L1},   {ACI_E_xx,      3,11,11,L0|L1},
4218   {ACI_H_xx,      3,11,11,L0|L1},   {ACI_L_xx,      3,11,11,L0|L1},
4219   {OFFI_V_xx,      3,11,11,L0|L1},   {OFFI_A_xx,      3,11,11,L0|L1},
4220   {OFFI_B_xx,      3,11,11,L0|L1},   {OFFI_C_xx,      3,11,11,L0|L1},
4221   {OFFI_D_xx,      3,11,11,L0|L1},   {OFFI_E_xx,      3,11,11,L0|L1},
4222   {OFFI_H_xx,      3,11,11,L0|L1},   {OFFI_L_xx,      3,11,11,L0|L1},
4223
4224   /* 0x60 - 0x7F */
4225   {SUI_V_xx,      3,11,11,L0|L1},   {SUI_A_xx,      3,11,11,L0|L1},
4226   {SUI_B_xx,      3,11,11,L0|L1},   {SUI_C_xx,      3,11,11,L0|L1},
4227   {SUI_D_xx,      3,11,11,L0|L1},   {SUI_E_xx,      3,11,11,L0|L1},
4228   {SUI_H_xx,      3,11,11,L0|L1},   {SUI_L_xx,      3,11,11,L0|L1},
4229   {NEI_V_xx,      3,11,11,L0|L1},   {NEI_A_xx,      3,11,11,L0|L1},
4230   {NEI_B_xx,      3,11,11,L0|L1},   {NEI_C_xx,      3,11,11,L0|L1},
4231   {NEI_D_xx,      3,11,11,L0|L1},   {NEI_E_xx,      3,11,11,L0|L1},
4232   {NEI_H_xx,      3,11,11,L0|L1},   {NEI_L_xx,      3,11,11,L0|L1},
4233
4234   {SBI_V_xx,      3,11,11,L0|L1},   {SBI_A_xx,      3,11,11,L0|L1},
4235   {SBI_B_xx,      3,11,11,L0|L1},   {SBI_C_xx,      3,11,11,L0|L1},
4236   {SBI_D_xx,      3,11,11,L0|L1},   {SBI_E_xx,      3,11,11,L0|L1},
4237   {SBI_H_xx,      3,11,11,L0|L1},   {SBI_L_xx,      3,11,11,L0|L1},
4238   {EQI_V_xx,      3,11,11,L0|L1},   {EQI_A_xx,      3,11,11,L0|L1},
4239   {EQI_B_xx,      3,11,11,L0|L1},   {EQI_C_xx,      3,11,11,L0|L1},
4240   {EQI_D_xx,      3,11,11,L0|L1},   {EQI_E_xx,      3,11,11,L0|L1},
4241   {EQI_H_xx,      3,11,11,L0|L1},   {EQI_L_xx,      3,11,11,L0|L1},
4242
4243   /* 0x80 - 0x9F */
4244   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4245   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4246   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4247   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4248   {ANI_PA_xx,      3,17,17,L0|L1},   {ANI_PB_xx,      3,17,17,L0|L1},
4249   {ANI_PC_xx,      3,17,17,L0|L1},   {ANI_MKL_xx,   3,17,17,L0|L1},
4250   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4251   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4252
4253   {XRI_PA_xx,      3,17,17,L0|L1},   {XRI_PB_xx,      3,17,17,L0|L1},
4254   {XRI_PC_xx,      3,17,17,L0|L1},   {XRI_MKL_xx,   3,17,17,L0|L1},
4255   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4256   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4257   {ORI_PA_xx,      3,17,17,L0|L1},   {ORI_PB_xx,      3,17,17,L0|L1},
4258   {ORI_PC_xx,      3,17,17,L0|L1},   {ORI_MKL_xx,   3,17,17,L0|L1},
4259   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4260   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4261
4262   /* 0xA0 - 0xBF */
4263   {ADINC_PA_xx,   3,17,17,L0|L1},   {ADINC_PB_xx,   3,17,17,L0|L1},
4264   {ADINC_PC_xx,   3,17,17,L0|L1},   {ADINC_MKL_xx,   3,17,17,L0|L1},
4265   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4266   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4267   {GTI_PA_xx,      3,14,14,L0|L1},   {GTI_PB_xx,      3,14,14,L0|L1},
4268   {GTI_PC_xx,      3,14,14,L0|L1},   {GTI_MKL_xx,   3,14,14,L0|L1},
4269   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4270   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4271
4272   {SUINB_PA_xx,   3,17,17,L0|L1},   {SUINB_PB_xx,   3,17,17,L0|L1},
4273   {SUINB_PC_xx,   3,17,17,L0|L1},   {SUINB_MKL_xx,   3,17,17,L0|L1},
4274   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4275   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4276   {LTI_PA_xx,      3,14,14,L0|L1},   {LTI_PB_xx,      3,14,14,L0|L1},
4277   {LTI_PC_xx,      3,14,14,L0|L1},   {LTI_MKL_xx,   3,14,14,L0|L1},
4278   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4279   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4280
4281   /* 0xC0 - 0xDF */
4282   {ADI_PA_xx,      3,17,17,L0|L1},   {ADI_PB_xx,      3,17,17,L0|L1},
4283   {ADI_PC_xx,      3,17,17,L0|L1},   {ADI_MKL_xx,   3,17,17,L0|L1},
4284   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4285   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4286   {ONI_PA_xx,      3,14,14,L0|L1},   {ONI_PB_xx,      3,14,14,L0|L1},
4287   {ONI_PC_xx,      3,14,14,L0|L1},   {ONI_MKL_xx,   3,14,14,L0|L1},
4288   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4289   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4290
4291   {ACI_PA_xx,      3,17,17,L0|L1},   {ACI_PB_xx,      3,17,17,L0|L1},
4292   {ACI_PC_xx,      3,17,17,L0|L1},   {ACI_MKL_xx,   3,17,17,L0|L1},
4293   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4294   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4295   {OFFI_PA_xx,   3,14,14,L0|L1},   {OFFI_PB_xx,   3,14,14,L0|L1},
4296   {OFFI_PC_xx,   3,14,14,L0|L1},   {OFFI_MKL_xx,   3,14,14,L0|L1},
4297   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4298   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4299
4300   /* 0xE0 - 0xFF */
4301   {SUI_PA_xx,      3,17,17,L0|L1},   {SUI_PB_xx,      3,17,17,L0|L1},
4302   {SUI_PC_xx,      3,17,17,L0|L1},   {SUI_MKL_xx,   3,17,17,L0|L1},
4303   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4304   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4305   {NEI_PA_xx,      3,14,14,L0|L1},   {NEI_PB_xx,      3,14,14,L0|L1},
4306   {NEI_PC_xx,      3,14,14,L0|L1},   {NEI_MKL_xx,   3,14,14,L0|L1},
4307   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4308   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4309
4310   {SBI_PA_xx,      3,17,17,L0|L1},   {SBI_PB_xx,      3,17,17,L0|L1},
4311   {SBI_PC_xx,      3,17,17,L0|L1},   {SBI_MKL_xx,   3,17,17,L0|L1},
4312   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4313   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4314   {EQI_PA_xx,      3,14,14,L0|L1},   {EQI_PB_xx,      3,14,14,L0|L1},
4315   {EQI_PC_xx,      3,14,14,L0|L1},   {EQI_MKL_xx,   3,14,14,L0|L1},
4316   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4317   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1}
4318};
4319
4320/* prefix 70 */
4321static const struct opcode_s op70_7801[256] =
4322{
4323   /* 0x00 - 0x1F */
4324   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4325   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4326   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4327   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4328   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4329   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4330   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4331   {SSPD_w,      4,20,20,L0|L1},   {LSPD_w,      4,20,20,L0|L1},
4332
4333   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4334   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4335   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4336   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4337   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4338   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4339   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4340   {SBCD_w,      4,20,20,L0|L1},   {LBCD_w,      4,20,20,L0|L1},
4341
4342   /* 0x20 - 0x3F */
4343   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4344   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4345   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4346   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4347   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4348   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4349   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4350   {SDED_w,      4,20,20,L0|L1},   {LDED_w,      4,20,20,L0|L1},
4351
4352   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4353   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4354   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4355   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4356   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4357   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4358   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4359   {SHLD_w,      4,20,20,L0|L1},   {LHLD_w,      4,20,20,L0|L1},
4360
4361   /* 0x40 - 0x5F */
4362   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4363   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4364   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4365   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4366   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4367   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4368   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4369   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4370
4371   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4372   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4373   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4374   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4375   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4376   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4377   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4378   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4379
4380   /* 0x60 - 0x7F */
4381   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4382   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4383   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4384   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4385   {MOV_V_w,      4,17,17,L0|L1},   {MOV_A_w,      4,17,17,L0|L1},
4386   {MOV_B_w,      4,17,17,L0|L1},   {MOV_C_w,      4,17,17,L0|L1},
4387   {MOV_D_w,      4,17,17,L0|L1},   {MOV_E_w,      4,17,17,L0|L1},
4388   {MOV_H_w,      4,17,17,L0|L1},   {MOV_L_w,      4,17,17,L0|L1},
4389
4390   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4391   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4392   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4393   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4394   {MOV_w_V,      4,17,17,L0|L1},   {MOV_w_A,      4,17,17,L0|L1},
4395   {MOV_w_B,      4,17,17,L0|L1},   {MOV_w_C,      4,17,17,L0|L1},
4396   {MOV_w_D,      4,17,17,L0|L1},   {MOV_w_E,      4,17,17,L0|L1},
4397   {MOV_w_H,      4,17,17,L0|L1},   {MOV_w_L,      4,17,17,L0|L1},
4398
4399   /* 0x80 - 0x9F */
4400   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4401   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4402   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4403   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4404   {illegal2,      2, 8, 8,L0|L1},   {ANAX_B,      2,11,11,L0|L1},
4405   {ANAX_D,      2,11,11,L0|L1},   {ANAX_H,      2,11,11,L0|L1},
4406   {ANAX_Dp,      2,11,11,L0|L1},   {ANAX_Hp,      2,11,11,L0|L1},
4407   {ANAX_Dm,      2,11,11,L0|L1},   {ANAX_Hm,      2,11,11,L0|L1},
4408
4409   {illegal2,      2, 8, 8,L0|L1},   {XRAX_B,      2,11,11,L0|L1},
4410   {XRAX_D,      2,11,11,L0|L1},   {XRAX_H,      2,11,11,L0|L1},
4411   {XRAX_Dp,      2,11,11,L0|L1},   {XRAX_Hp,      2,11,11,L0|L1},
4412   {XRAX_Dm,      2,11,11,L0|L1},   {XRAX_Hm,      2,11,11,L0|L1},
4413   {illegal2,      2, 8, 8,L0|L1},   {ORAX_B,      2,11,11,L0|L1},
4414   {ORAX_D,      2,11,11,L0|L1},   {ORAX_H,      2,11,11,L0|L1},
4415   {ORAX_Dp,      2,11,11,L0|L1},   {ORAX_Hp,      2,11,11,L0|L1},
4416   {ORAX_Dm,      2,11,11,L0|L1},   {ORAX_Hm,      2,11,11,L0|L1},
4417
4418   /* 0xA0 - 0xBF */
4419   {illegal2,      2, 8, 8,L0|L1},   {ADDNCX_B,      2,11,11,L0|L1},
4420   {ADDNCX_D,      2,11,11,L0|L1},   {ADDNCX_H,      2,11,11,L0|L1},
4421   {ADDNCX_Dp,    2,11,11,L0|L1},   {ADDNCX_Hp,    2,11,11,L0|L1},
4422   {ADDNCX_Dm,    2,11,11,L0|L1},   {ADDNCX_Hm,    2,11,11,L0|L1},
4423   {illegal2,      2, 8, 8,L0|L1},   {GTAX_B,      2,11,11,L0|L1},
4424   {GTAX_D,      2,11,11,L0|L1},   {GTAX_H,      2,11,11,L0|L1},
4425   {GTAX_Dp,      2,11,11,L0|L1},   {GTAX_Hp,      2,11,11,L0|L1},
4426   {GTAX_Dm,      2,11,11,L0|L1},   {GTAX_Hm,      2,11,11,L0|L1},
4427
4428   {illegal2,      2, 8, 8,L0|L1},   {SUBNBX_B,      2,11,11,L0|L1},
4429   {SUBNBX_D,      2,11,11,L0|L1},   {SUBNBX_H,      2,11,11,L0|L1},
4430   {SUBNBX_Dp,    2,11,11,L0|L1},   {SUBNBX_Hp,    2,11,11,L0|L1},
4431   {SUBNBX_Dm,    2,11,11,L0|L1},   {SUBNBX_Hm,    2,11,11,L0|L1},
4432   {illegal2,      2, 8, 8,L0|L1},   {LTAX_B,      2,11,11,L0|L1},
4433   {LTAX_D,      2,11,11,L0|L1},   {LTAX_H,      2,11,11,L0|L1},
4434   {LTAX_Dp,      2,11,11,L0|L1},   {LTAX_Hp,      2,11,11,L0|L1},
4435   {LTAX_Dm,      2,11,11,L0|L1},   {LTAX_Hm,      2,11,11,L0|L1},
4436
4437   /* 0xC0 - 0xDF */
4438   {illegal2,      2, 8, 8,L0|L1},   {ADDX_B,      2,11,11,L0|L1},
4439   {ADDX_D,      2,11,11,L0|L1},   {ADDX_H,      2,11,11,L0|L1},
4440   {ADDX_Dp,      2,11,11,L0|L1},   {ADDX_Hp,      2,11,11,L0|L1},
4441   {ADDX_Dm,      2,11,11,L0|L1},   {ADDX_Hm,      2,11,11,L0|L1},
4442   {illegal2,      2, 8, 8,L0|L1},   {ONAX_B,      2,11,11,L0|L1},
4443   {ONAX_D,      2,11,11,L0|L1},   {ONAX_H,      2,11,11,L0|L1},
4444   {ONAX_Dp,      2,11,11,L0|L1},   {ONAX_Hp,      2,11,11,L0|L1},
4445   {ONAX_Dm,      2,11,11,L0|L1},   {ONAX_Hm,      2,11,11,L0|L1},
4446
4447   {illegal2,      2, 8, 8,L0|L1},   {ADCX_B,      2,11,11,L0|L1},
4448   {ADCX_D,      2,11,11,L0|L1},   {ADCX_H,      2,11,11,L0|L1},
4449   {ADCX_Dp,      2,11,11,L0|L1},   {ADCX_Hp,      2,11,11,L0|L1},
4450   {ADCX_Dm,      2,11,11,L0|L1},   {ADCX_Hm,      2,11,11,L0|L1},
4451   {illegal2,      2, 8, 8,L0|L1},   {OFFAX_B,      2,11,11,L0|L1},
4452   {OFFAX_D,      2,11,11,L0|L1},   {OFFAX_H,      2,11,11,L0|L1},
4453   {OFFAX_Dp,      2,11,11,L0|L1},   {OFFAX_Hp,      2,11,11,L0|L1},
4454   {OFFAX_Dm,      2,11,11,L0|L1},   {OFFAX_Hm,      2,11,11,L0|L1},
4455
4456   /* 0xE0 - 0xFF */
4457   {illegal2,      2, 8, 8,L0|L1},   {SUBX_B,      2,11,11,L0|L1},
4458   {SUBX_D,      2,11,11,L0|L1},   {SUBX_H,      2,11,11,L0|L1},
4459   {SUBX_Dp,      2,11,11,L0|L1},   {SUBX_Hp,      2,11,11,L0|L1},
4460   {SUBX_Dm,      2,11,11,L0|L1},   {SUBX_Hm,      2,11,11,L0|L1},
4461   {illegal2,      2, 8, 8,L0|L1},   {NEAX_B,      2,11,11,L0|L1},
4462   {NEAX_D,      2,11,11,L0|L1},   {NEAX_H,      2,11,11,L0|L1},
4463   {NEAX_Dp,      2,11,11,L0|L1},   {NEAX_Hp,      2,11,11,L0|L1},
4464   {NEAX_Dm,      2,11,11,L0|L1},   {NEAX_Hm,      2,11,11,L0|L1},
4465
4466   {illegal2,      2, 8, 8,L0|L1},   {SBBX_B,      2,11,11,L0|L1},
4467   {SBBX_D,      2,11,11,L0|L1},   {SBBX_H,      2,11,11,L0|L1},
4468   {SBBX_Dp,      2,11,11,L0|L1},   {SBBX_Hp,      2,11,11,L0|L1},
4469   {SBBX_Dm,      2,11,11,L0|L1},   {SBBX_Hm,      2,11,11,L0|L1},
4470   {illegal2,      2, 8, 8,L0|L1},   {EQAX_B,      2,11,11,L0|L1},
4471   {EQAX_D,      2,11,11,L0|L1},   {EQAX_H,      2,11,11,L0|L1},
4472   {EQAX_Dp,      2,11,11,L0|L1},   {EQAX_Hp,      2,11,11,L0|L1},
4473   {EQAX_Dm,      2,11,11,L0|L1},   {EQAX_Hm,      2,11,11,L0|L1}
4474};
4475
4476/* prefix 74 */
4477static const struct opcode_s op74_7801[256] =
4478{
4479   /* 0x00 - 0x1F */
4480   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4481   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4482   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4483   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4484   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4485   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4486   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4487   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4488
4489   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4490   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4491   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4492   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4493   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4494   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4495   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4496   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4497
4498   /* 0x20 - 0x3F */
4499   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4500   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4501   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4502   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4503   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4504   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4505   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4506   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4507
4508   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4509   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4510   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4511   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4512   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4513   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4514   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4515   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4516
4517   /* 0x40 - 0x5F */
4518   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4519   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4520   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4521   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4522   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4523   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4524   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4525   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4526
4527   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4528   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4529   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4530   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4531   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4532   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4533   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4534   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4535
4536   /* 0x60 - 0x7F */
4537   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4538   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4539   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4540   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4541   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4542   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4543   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4544   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4545
4546   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4547   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4548   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4549   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4550   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4551   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4552   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4553   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4554
4555   /* 0x80 - 0x9F */
4556   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4557   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4558   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4559   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4560   {ANAW_wa,      3,14,14,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4561   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4562   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4563   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4564
4565   {XRAW_wa,      3,14,14,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4566   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4567   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4568   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4569   {ORAW_wa,      3,14,14,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4570   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4571   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4572   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4573
4574   /* 0xA0 - 0xBF */
4575   {ADDNCW_wa,    3,14,14,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4576   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4577   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4578   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4579   {GTAW_wa,      3,14,14,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4580   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4581   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4582   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4583
4584   {SUBNBW_wa,    3,14,14,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4585   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4586   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4587   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4588   {LTAW_wa,      3,14,14,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4589   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4590   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4591   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4592
4593   /* 0xC0 - 0xDF */
4594   {ADDW_wa,      3,14,14,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4595   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4596   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4597   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4598   {ONAW_wa,      3,14,14,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4599   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4600   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4601   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4602
4603   {ADCW_wa,      3,14,14,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4604   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4605   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4606   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4607   {OFFAW_wa,      3,14,14,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4608   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4609   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4610   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4611
4612   /* 0xE0 - 0xFF */
4613   {SUBW_wa,      3,14,14,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4614   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4615   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4616   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4617   {NEAW_wa,      3,14,14,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4618   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4619   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4620   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4621
4622   {SBBW_wa,      3,14,14,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4623   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4624   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4625   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4626   {EQAW_wa,      3,14,14,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4627   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4628   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4629   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1}
4630};
4631
4632static const struct opcode_s opXX_7801[256] =
4633{
4634   /* 0x00 - 0x1F */
4635   {NOP,         1, 4, 4,L0|L1},   {HALT,         1, 6, 6,L0|L1},
4636   {INX_SP,      1, 7, 7,L0|L1},   {DCX_SP,      1, 7, 7,L0|L1},
4637   {LXI_S_w,      3,10,10,L0|L1},   {ANIW_wa_xx,   3,16,16,L0|L1},
4638   {illegal,      1, 4, 4,L0|L1},   {ANI_A_xx,      2, 7, 7,L0|L1},
4639   {RET,         1,11,11,L0|L1},   {SIO,         1, 4, 4,L0|L1},
4640   {MOV_A_B,      1, 4, 4,L0|L1},   {MOV_A_C,      1, 4, 4,L0|L1},
4641   {MOV_A_D,      1, 4, 4,L0|L1},   {MOV_A_E,      1, 4, 4,L0|L1},
4642   {MOV_A_H,      1, 4, 4,L0|L1},   {MOV_A_L,      1, 4, 4,L0|L1},
4643
4644   {EXA,         1, 4, 4,L0|L1},   {EXX,         1, 4, 4,L0|L1},
4645   {INX_BC,      1, 7, 7,L0|L1},   {DCX_BC,      1, 7, 7,L0|L1},
4646   {LXI_B_w,      3,10,10,L0|L1},   {ORIW_wa_xx,   3,16,16,L0|L1},
4647   {XRI_A_xx,      2, 7, 7,L0|L1},   {ORI_A_xx,      2, 7, 7,L0|L1},
4648   {RETS,         1,11,11,L0|L1},   {STM,         1, 4, 4,L0|L1},
4649   {MOV_B_A,      1, 4, 4,L0|L1},   {MOV_C_A,      1, 4, 4,L0|L1},
4650   {MOV_D_A,      1, 4, 4,L0|L1},   {MOV_E_A,      1, 4, 4,L0|L1},
4651   {MOV_H_A,      1, 4, 4,L0|L1},   {MOV_L_A,      1, 4, 4,L0|L1},
4652
4653   /* 0x20 - 0x3F */
4654   {INRW_wa_7801,   2,13,13,L0|L1},   {TABLE,         1,19,19,L0|L1},
4655   {INX_DE,      1, 7, 7,L0|L1},   {DCX_DE,      1, 7, 7,L0|L1},
4656   {LXI_D_w,      3,10,10,L0|L1},   {GTIW_wa_xx,   3,13,13,L0|L1},
4657   {ADINC_A_xx,   2, 7, 7,L0|L1},   {GTI_A_xx,      2, 7, 7,L0|L1},
4658   {LDAW_wa,      2,10,10,L0|L1},   {LDAX_B,      1, 7, 7,L0|L1},
4659   {LDAX_D,      1, 7, 7,L0|L1},   {LDAX_H,      1, 7, 7,L0|L1},
4660   {LDAX_Dp,      1, 7, 7,L0|L1},   {LDAX_Hp,      1, 7, 7,L0|L1},
4661   {LDAX_Dm,      1, 7, 7,L0|L1},   {LDAX_Hm,      1, 7, 7,L0|L1},
4662
4663   {DCRW_wa_7801,   2,13,13,L0|L1},   {BLOCK,         1,13,13,L0|L1},
4664   {INX_HL,      1, 7, 7,L0|L1},   {DCX_HL,      1, 7, 7,L0|L1},
4665   {LXI_H_w,      3,10,10,   L1},   {LTIW_wa_xx,   3,13,13,L0|L1},
4666   {SUINB_A_xx,   2, 7, 7,L0|L1},   {LTI_A_xx,      2, 7, 7,L0|L1},
4667   {STAW_wa,      2,10,10,L0|L1},   {STAX_B,      1, 7, 7,L0|L1},
4668   {STAX_D,      1, 7, 7,L0|L1},   {STAX_H,      1, 7, 7,L0|L1},
4669   {STAX_Dp,      1, 7, 7,L0|L1},   {STAX_Hp,      1, 7, 7,L0|L1},
4670   {STAX_Dm,      1, 7, 7,L0|L1},   {STAX_Hm,      1, 7, 7,L0|L1},
4671
4672   /* 0x40 - 0x5F */
4673   {illegal,      1, 4, 4,L0|L1},   {INR_A_7801,    1, 4, 4,L0|L1},
4674   {INR_B_7801,    1, 4, 4,L0|L1},   {INR_C_7801,    1, 4, 4,L0|L1},
4675   {CALL_w,      3,16,16,L0|L1},   {ONIW_wa_xx,   3,13,13,L0|L1},
4676   {ADI_A_xx,      2, 7, 7,L0|L1},   {ONI_A_xx,      2, 7, 7,L0|L1},
4677   {PRE_48,      1, 0, 0,L0|L1},   {MVIX_BC_xx,   2,10,10,L0|L1},
4678   {MVIX_DE_xx,   2,10,10,L0|L1},   {MVIX_HL_xx,   2,10,10,L0|L1},
4679   {PRE_4C,      1, 0, 0,L0|L1},   {PRE_4D,      1, 0, 0,L0|L1},
4680   {JRE,         2,17,17,L0|L1},   {JRE,         2,17,17,L0|L1},
4681
4682   {illegal,      1, 4, 4,L0|L1},   {DCR_A_7801,    1, 4, 4,L0|L1},
4683   {DCR_B_7801,    1, 4, 4,L0|L1},   {DCR_C_7801,    1, 4, 4,L0|L1},
4684   {JMP_w,       3,10,10,L0|L1},   {OFFIW_wa_xx,   3,13,13,L0|L1},
4685   {ACI_A_xx,      2, 7, 7,L0|L1},   {OFFI_A_xx,    2, 7, 7,L0|L1},
4686   {BIT_0_wa,      2,10,10,L0|L1},   {BIT_1_wa,      2,10,10,L0|L1},
4687   {BIT_2_wa,      2,10,10,L0|L1},   {BIT_3_wa,      2,10,10,L0|L1},
4688   {BIT_4_wa,      2,10,10,L0|L1},   {BIT_5_wa,      2,10,10,L0|L1},
4689   {BIT_6_wa,      2,10,10,L0|L1},   {BIT_7_wa,      2,10,10,L0|L1},
4690
4691   /* 0x60 - 0x7F */
4692   {PRE_60,      1, 0, 0,L0|L1},   {DAA,         1, 4, 4,L0|L1},
4693   {RETI,         1,15,15,L0|L1},   {CALB,         2,13,13,L0|L1},
4694   {PRE_64,      1, 0, 0,L0|L1},   {NEIW_wa_xx,   3,13,13,L0|L1},
4695   {SUI_A_xx,      2, 7, 7,L0|L1},   {NEI_A_xx,      2, 7, 7,L0|L1},
4696   {MVI_V_xx,      2, 7, 7,L0|L1},   {MVI_A_xx,      2, 7, 7,L0    },
4697   {MVI_B_xx,      2, 7, 7,L0|L1},   {MVI_C_xx,      2, 7, 7,L0|L1},
4698   {MVI_D_xx,      2, 7, 7,L0|L1},   {MVI_E_xx,      2, 7, 7,L0|L1},
4699   {MVI_H_xx,      2, 7, 7,L0|L1},   {MVI_L_xx,      2, 7, 7,   L1},
4700
4701   {PRE_70,      1, 0, 0,L0|L1},   {MVIW_wa_xx,   3,13,13,L0|L1},
4702   {SOFTI,       1,19,19,L0|L1},   {JB,         1, 4, 4,L0|L1},
4703   {PRE_74,      1, 0, 0,L0|L1},   {EQIW_wa_xx,   3,13,13,L0|L1},
4704   {SBI_A_xx,      2, 7, 7,L0|L1},   {EQI_A_xx,      2, 7, 7,L0|L1},
4705   {CALF,         2,16,16,L0|L1},   {CALF,         2,16,16,L0|L1},
4706   {CALF,         2,16,16,L0|L1},   {CALF,         2,16,16,L0|L1},
4707   {CALF,         2,16,16,L0|L1},   {CALF,         2,16,16,L0|L1},
4708   {CALF,         2,16,16,L0|L1},   {CALF,         2,16,16,L0|L1},
4709
4710   /* 0x80 - 0x9F */
4711   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
4712   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
4713   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
4714   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
4715   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
4716   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
4717   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
4718   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
4719
4720   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
4721   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
4722   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
4723   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
4724   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
4725   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
4726   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
4727   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
4728
4729   /* 0xA0 - 0xBF */
4730   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
4731   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
4732   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
4733   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
4734   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
4735   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
4736   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
4737   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
4738
4739   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
4740   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
4741   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
4742   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
4743   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
4744   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
4745   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
4746   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
4747
4748   /* 0xC0 - 0xDF */
4749   {JR,         1,13,13,L0|L1},   {JR,         1,13,13,L0|L1},
4750   {JR,         1,13,13,L0|L1},   {JR,         1,13,13,L0|L1},
4751   {JR,         1,13,13,L0|L1},   {JR,         1,13,13,L0|L1},
4752   {JR,         1,13,13,L0|L1},   {JR,         1,13,13,L0|L1},
4753   {JR,         1,13,13,L0|L1},   {JR,         1,13,13,L0|L1},
4754   {JR,         1,13,13,L0|L1},   {JR,         1,13,13,L0|L1},
4755   {JR,         1,13,13,L0|L1},   {JR,         1,13,13,L0|L1},
4756   {JR,         1,13,13,L0|L1},   {JR,         1,13,13,L0|L1},
4757
4758   {JR,         1,13,13,L0|L1},   {JR,         1,13,13,L0|L1},
4759   {JR,         1,13,13,L0|L1},   {JR,         1,13,13,L0|L1},
4760   {JR,         1,13,13,L0|L1},   {JR,         1,13,13,L0|L1},
4761   {JR,         1,13,13,L0|L1},   {JR,         1,13,13,L0|L1},
4762   {JR,         1,13,13,L0|L1},   {JR,         1,13,13,L0|L1},
4763   {JR,         1,13,13,L0|L1},   {JR,         1,13,13,L0|L1},
4764   {JR,         1,13,13,L0|L1},   {JR,         1,13,13,L0|L1},
4765   {JR,         1,13,13,L0|L1},   {JR,         1,13,13,L0|L1},
4766
4767   /* 0xE0 - 0xFF */
4768   {JR,         1,13,13,L0|L1},   {JR,         1,13,13,L0|L1},
4769   {JR,         1,13,13,L0|L1},   {JR,         1,13,13,L0|L1},
4770   {JR,         1,13,13,L0|L1},   {JR,         1,13,13,L0|L1},
4771   {JR,         1,13,13,L0|L1},   {JR,         1,13,13,L0|L1},
4772   {JR,         1,13,13,L0|L1},   {JR,         1,13,13,L0|L1},
4773   {JR,         1,13,13,L0|L1},   {JR,         1,13,13,L0|L1},
4774   {JR,         1,13,13,L0|L1},   {JR,         1,13,13,L0|L1},
4775   {JR,         1,13,13,L0|L1},   {JR,         1,13,13,L0|L1},
4776
4777   {JR,         1,13,13,L0|L1},   {JR,         1,13,13,L0|L1},
4778   {JR,         1,13,13,L0|L1},   {JR,         1,13,13,L0|L1},
4779   {JR,         1,13,13,L0|L1},   {JR,         1,13,13,L0|L1},
4780   {JR,         1,13,13,L0|L1},   {JR,         1,13,13,L0|L1},
4781   {JR,         1,13,13,L0|L1},   {JR,         1,13,13,L0|L1},
4782   {JR,         1,13,13,L0|L1},   {JR,         1,13,13,L0|L1},
4783   {JR,         1,13,13,L0|L1},   {JR,         1,13,13,L0|L1},
4784   {JR,         1,13,13,L0|L1},   {JR,         1,13,13,L0|L1}
4785};
4786
4787/***********************************************************************
4788 *
4789 * uPD78C05(A)
4790 *
4791 **********************************************************************/
4792
4793static const struct opcode_s op48_78c05[256] =
4794{
4795   /* 0x00 - 0x1F */
4796   {SKIT_F0,      2, 8, 8,L0|L1},   {SKIT_FT0,      2, 8, 8,L0|L1},
4797   {SKIT_F1,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4798   {SKIT_FST,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4799   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4800   {illegal2,       2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4801   {SK_CY,       2, 8, 8,L0|L1},   {illegal2,       2, 8, 8,L0|L1},
4802   {SK_Z,         2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4803   {PUSH_VA,      2,17,17,L0|L1},   {POP_VA,      2,14,14,L0|L1},
4804
4805   {SKNIT_F0,      2, 8, 8,L0|L1},   {SKNIT_FT0,      2, 8, 8,L0|L1},
4806   {SKNIT_F1,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4807   {SKNIT_FST,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4808   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4809   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4810   {SKN_CY,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4811   {SKN_Z,       2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4812   {PUSH_BC,      2,17,17,L0|L1},   {POP_BC,      2,14,14,L0|L1},
4813
4814   /* 0x20 - 0x3F */
4815   {EI,         2, 8, 8,L0|L1},   {illegal2,       2, 8, 8,L0|L1},
4816   {illegal2,       2, 8, 8,L0|L1},   {illegal2,       2, 8, 8,L0|L1},
4817   {DI,         2, 8, 8,L0|L1},   {illegal2,       2, 8, 8,L0|L1},
4818   {illegal2,       2, 8, 8,L0|L1},   {illegal2,       2, 8, 8,L0|L1},
4819   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4820   {CLC,         2, 8, 8,L0|L1},   {STC,         2, 8, 8,L0|L1},
4821   {illegal2,      2, 8, 8,L0|L1},   {PEX,         2,11,11,L0|L1},
4822   {PUSH_DE,       2,17,17,L0|L1},   {POP_DE,       2,14,14,L0|L1},
4823
4824   {RLL_A,         2, 8, 8,L0|L1},   {RLR_A,       2, 8, 8,L0|L1},
4825   {illegal2,       2, 8, 8,L0|L1},   {illegal2,       2, 8, 8,L0|L1},
4826   {illegal2,      2, 8, 8,L0|L1},   {illegal2,       2, 8, 8,L0|L1},
4827   {illegal2,       2, 8, 8,L0|L1},   {illegal2,       2, 8, 8,L0|L1},
4828   {RLD,         2,17,17,L0|L1},   {RRD,         2,17,17,L0|L1},
4829   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4830   {PER,         2, 8, 8,L0|L1},   {illegal2,       2, 8, 8,L0|L1},
4831   {PUSH_HL,       2,17,17,L0|L1},   {POP_HL,       2,14,14,L0|L1},
4832
4833   /* 0x40 - 0x5F */
4834   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4835   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4836   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4837   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4838   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4839   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4840   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4841   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4842
4843   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4844   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4845   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4846   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4847   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4848   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4849   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4850   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4851
4852   /* 0x60 - 0x7F */
4853   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4854   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4855   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4856   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4857   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4858   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4859   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4860   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4861
4862   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4863   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4864   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4865   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4866   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4867   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4868   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4869   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4870
4871   /* 0x80 - 0x9F */
4872   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4873   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4874   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4875   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4876   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4877   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4878   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4879   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4880
4881   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4882   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4883   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4884   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4885   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4886   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4887   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4888   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4889
4890   /* 0xA0 - 0xBF */
4891   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4892   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4893   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4894   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4895   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4896   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4897   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4898   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4899
4900   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4901   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4902   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4903   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4904   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4905   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4906   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4907   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4908
4909   /* 0xC0 - 0xDF */
4910   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4911   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4912   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4913   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4914   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4915   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4916   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4917   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4918
4919   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4920   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4921   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4922   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4923   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4924   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4925   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4926   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4927
4928   /* 0xE0 - 0xFF */
4929   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4930   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4931   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4932   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4933   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4934   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4935   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4936   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4937
4938   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4939   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4940   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4941   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4942   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4943   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4944   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4945   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1}
4946};
4947
4948static const struct opcode_s op4C_78c05[256] =
4949{
4950   /* 0x00 - 0x1F */
4951   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4952   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4953   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4954   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4955   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4956   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4957   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4958   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4959
4960   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4961   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4962   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4963   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4964   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4965   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4966   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4967   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4968
4969   /* 0x20 - 0x3F */
4970   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4971   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4972   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4973   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4974   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4975   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4976   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4977   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4978
4979   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4980   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4981   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4982   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4983   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4984   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4985   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4986   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4987
4988   /* 0x40 - 0x5F */
4989   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4990   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4991   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4992   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4993   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4994   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4995   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4996   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4997
4998   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
4999   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5000   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5001   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5002   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5003   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5004   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5005   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5006
5007   /* 0x60 - 0x7F */
5008   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5009   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5010   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5011   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5012   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5013   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5014   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5015   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5016
5017   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5018   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5019   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5020   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5021   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5022   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5023   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5024   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5025
5026   /* 0x80 - 0x9F */
5027   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5028   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5029   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5030   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5031   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5032   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5033   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5034   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5035
5036   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5037   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5038   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5039   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5040   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5041   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5042   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5043   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5044
5045   /* 0xA0 - 0xBF */
5046   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5047   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5048   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5049   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5050   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5051   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5052   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5053   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5054
5055   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5056   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5057   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5058   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5059   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5060   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5061   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5062   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5063
5064   /* 0xC0 - 0xDF */
5065   {MOV_A_PA,      2,10,10,L0|L1},   {MOV_A_PB,      2,10,10,L0|L1},
5066   {MOV_A_PC,      2,10,10,L0|L1},   {MOV_A_MKL,      2,10,10,L0|L1},
5067   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5068   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5069   {MOV_A_S,      2,10,10,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5070   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5071   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5072   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5073
5074   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5075   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5076   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5077   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5078   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5079   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5080   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5081   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5082
5083   /* 0xE0 - 0xFF */
5084   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5085   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5086   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5087   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5088   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5089   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5090   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5091   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5092
5093   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5094   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5095   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5096   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5097   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5098   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5099   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5100   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1}
5101};
5102
5103/* prefix 4D */
5104static const struct opcode_s op4D_78c05[256] =
5105{
5106   /* 0x00 - 0x1F */
5107   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5108   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5109   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5110   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5111   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5112   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5113   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5114   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5115
5116   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5117   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5118   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5119   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5120   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5121   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5122   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5123   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5124
5125   /* 0x20 - 0x3F */
5126   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5127   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5128   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5129   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5130   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5131   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5132   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5133   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5134
5135   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5136   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5137   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5138   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5139   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5140   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5141   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5142   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5143
5144   /* 0x40 - 0x5F */
5145   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5146   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5147   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5148   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5149   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5150   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5151   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5152   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5153
5154   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5155   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5156   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5157   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5158   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5159   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5160   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5161   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5162
5163   /* 0x60 - 0x7F */
5164   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5165   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5166   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5167   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5168   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5169   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5170   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5171   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5172
5173   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5174   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5175   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5176   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5177   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5178   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5179   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5180   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5181
5182   /* 0x80 - 0x9F */
5183   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5184   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5185   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5186   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5187   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5188   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5189   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5190   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5191
5192   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5193   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5194   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5195   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5196   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5197   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5198   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5199   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5200
5201   /* 0xA0 - 0xBF */
5202   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5203   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5204   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5205   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5206   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5207   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5208   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5209   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5210
5211   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5212   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5213   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5214   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5215   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5216   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5217   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5218   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5219
5220   /* 0xC0 - 0xDF */
5221   {MOV_PA_A,      2,10,10,L0|L1},   {MOV_PB_A,      2,10,10,L0|L1},
5222   {MOV_PC_A,      2,10,10,L0|L1},   {MOV_MKL_A,      2,10,10,L0|L1},
5223   {MOV_MB_A,      2,10,10,L0|L1},   {MOV_MC_A,      2,10,10,L0|L1},
5224   {MOV_TM0_A,    2,10,10,L0|L1},   {MOV_TM1_A,    2,10,10,L0|L1},
5225   {MOV_S_A,      2,10,10,L0|L1},   {MOV_TMM_A,      2,10,10,L0|L1},
5226   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5227   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5228   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5229
5230   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5231   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5232   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5233   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5234   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5235   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5236   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5237   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5238
5239   /* 0xE0 - 0xFF */
5240   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5241   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5242   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5243   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5244   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5245   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5246   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5247   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5248
5249   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5250   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5251   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5252   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5253   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5254   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5255   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5256   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1}
5257};
5258
5259/* prefix 60 */
5260static const struct opcode_s op60_78c05[256] =
5261{
5262   /* 0x00 - 0x1F */
5263   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5264   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5265   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5266   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5267   {illegal2,      2, 8, 8,L0|L1},   {ANA_A_A,      2, 8, 8,L0|L1},
5268   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5269   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5270   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5271
5272   {illegal2,      2, 8, 8,L0|L1},   {XRA_A_A,      2, 8, 8,L0|L1},
5273   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5274   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5275   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5276   {illegal2,      2, 8, 8,L0|L1},   {ORA_A_A,      2, 8, 8,L0|L1},
5277   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5278   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5279   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5280
5281   /* 0x20 - 0x3F */
5282   {illegal2,      2, 8, 8,L0|L1},   {ADDNC_A_A,    2, 8, 8,L0|L1},
5283   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5284   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5285   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5286   {illegal2,      2, 8, 8,L0|L1},   {GTA_A_A,      2, 8, 8,L0|L1},
5287   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5288   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5289   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5290
5291   {illegal2,      2, 8, 8,L0|L1},   {SUBNB_A_A,    2, 8, 8,L0|L1},
5292   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5293   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5294   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5295   {illegal2,      2, 8, 8,L0|L1},   {LTA_A_A,      2, 8, 8,L0|L1},
5296   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5297   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5298   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5299
5300   /* 0x40 - 0x5F */
5301   {illegal2,      2, 8, 8,L0|L1},   {ADD_A_A,      2, 8, 8,L0|L1},
5302   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5303   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5304   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5305   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5306   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5307   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5308   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5309
5310   {illegal2,      2, 8, 8,L0|L1},   {ADC_A_A,      2, 8, 8,L0|L1},
5311   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5312   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5313   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5314   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5315   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5316   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5317   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5318   /* 0x60 - 0x7F */
5319   {illegal2,      2, 8, 8,L0|L1},   {SUB_A_A,      2, 8, 8,L0|L1},
5320   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5321   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5322   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5323   {illegal2,      2, 8, 8,L0|L1},   {NEA_A_A,      2, 8, 8,L0|L1},
5324   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5325   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5326   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5327
5328   {illegal2,      2, 8, 8,L0|L1},   {SBB_A_A,      2, 8, 8,L0|L1},
5329   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5330   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5331   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5332   {illegal2,      2, 8, 8,L0|L1},   {EQA_A_A,      2, 8, 8,L0|L1},
5333   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5334   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5335   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5336
5337   /* 0x80 - 0x9F */
5338   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5339   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5340   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5341   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5342   {illegal2,      2, 8, 8,L0|L1},   {ANA_A_A,      2, 8, 8,L0|L1},
5343   {ANA_A_B,      2, 8, 8,L0|L1},   {ANA_A_C,      2, 8, 8,L0|L1},
5344   {ANA_A_D,      2, 8, 8,L0|L1},   {ANA_A_E,      2, 8, 8,L0|L1},
5345   {ANA_A_H,      2, 8, 8,L0|L1},   {ANA_A_L,      2, 8, 8,L0|L1},
5346
5347   {illegal2,      2, 8, 8,L0|L1},   {XRA_A_A,      2, 8, 8,L0|L1},
5348   {XRA_A_B,      2, 8, 8,L0|L1},   {XRA_A_C,      2, 8, 8,L0|L1},
5349   {XRA_A_D,      2, 8, 8,L0|L1},   {XRA_A_E,      2, 8, 8,L0|L1},
5350   {XRA_A_H,      2, 8, 8,L0|L1},   {XRA_A_L,      2, 8, 8,L0|L1},
5351   {illegal2,      2, 8, 8,L0|L1},   {ORA_A_A,      2, 8, 8,L0|L1},
5352   {ORA_A_B,      2, 8, 8,L0|L1},   {ORA_A_C,      2, 8, 8,L0|L1},
5353   {ORA_A_D,      2, 8, 8,L0|L1},   {ORA_A_E,      2, 8, 8,L0|L1},
5354   {ORA_A_H,      2, 8, 8,L0|L1},   {ORA_A_L,      2, 8, 8,L0|L1},
5355
5356   /* 0xA0 - 0xBF */
5357   {illegal2,      2, 8, 8,L0|L1},   {ADDNC_A_A,    2, 8, 8,L0|L1},
5358   {ADDNC_A_B,    2, 8, 8,L0|L1},   {ADDNC_A_C,    2, 8, 8,L0|L1},
5359   {ADDNC_A_D,    2, 8, 8,L0|L1},   {ADDNC_A_E,    2, 8, 8,L0|L1},
5360   {ADDNC_A_H,    2, 8, 8,L0|L1},   {ADDNC_A_L,    2, 8, 8,L0|L1},
5361   {illegal2,      2, 8, 8,L0|L1},   {GTA_A_A,      2, 8, 8,L0|L1},
5362   {GTA_A_B,      2, 8, 8,L0|L1},   {GTA_A_C,      2, 8, 8,L0|L1},
5363   {GTA_A_D,      2, 8, 8,L0|L1},   {GTA_A_E,      2, 8, 8,L0|L1},
5364   {GTA_A_H,      2, 8, 8,L0|L1},   {GTA_A_L,      2, 8, 8,L0|L1},
5365
5366   {illegal2,      2, 8, 8,L0|L1},   {SUBNB_A_A,    2, 8, 8,L0|L1},
5367   {SUBNB_A_B,    2, 8, 8,L0|L1},   {SUBNB_A_C,    2, 8, 8,L0|L1},
5368   {SUBNB_A_D,    2, 8, 8,L0|L1},   {SUBNB_A_E,    2, 8, 8,L0|L1},
5369   {SUBNB_A_H,    2, 8, 8,L0|L1},   {SUBNB_A_L,    2, 8, 8,L0|L1},
5370   {illegal2,      2, 8, 8,L0|L1},   {LTA_A_A,      2, 8, 8,L0|L1},
5371   {LTA_A_B,      2, 8, 8,L0|L1},   {LTA_A_C,      2, 8, 8,L0|L1},
5372   {LTA_A_D,      2, 8, 8,L0|L1},   {LTA_A_E,      2, 8, 8,L0|L1},
5373   {LTA_A_H,      2, 8, 8,L0|L1},   {LTA_A_L,      2, 8, 8,L0|L1},
5374
5375   /* 0xC0 - 0xDF */
5376   {illegal2,      2, 8, 8,L0|L1},   {ADD_A_A,      2, 8, 8,L0|L1},
5377   {ADD_A_B,      2, 8, 8,L0|L1},   {ADD_A_C,      2, 8, 8,L0|L1},
5378   {ADD_A_D,      2, 8, 8,L0|L1},   {ADD_A_E,      2, 8, 8,L0|L1},
5379   {ADD_A_H,      2, 8, 8,L0|L1},   {ADD_A_L,      2, 8, 8,L0|L1},
5380   {illegal2,      2, 8, 8,L0|L1},   {ONA_A_A,      2, 8, 8,L0|L1},
5381   {ONA_A_B,      2, 8, 8,L0|L1},   {ONA_A_C,      2, 8, 8,L0|L1},
5382   {ONA_A_D,      2, 8, 8,L0|L1},   {ONA_A_E,      2, 8, 8,L0|L1},
5383   {ONA_A_H,      2, 8, 8,L0|L1},   {ONA_A_L,      2, 8, 8,L0|L1},
5384
5385   {illegal2,      2, 8, 8,L0|L1},   {ADC_A_A,      2, 8, 8,L0|L1},
5386   {ADC_A_B,      2, 8, 8,L0|L1},   {ADC_A_C,      2, 8, 8,L0|L1},
5387   {ADC_A_D,      2, 8, 8,L0|L1},   {ADC_A_E,      2, 8, 8,L0|L1},
5388   {ADC_A_H,      2, 8, 8,L0|L1},   {ADC_A_L,      2, 8, 8,L0|L1},
5389   {illegal2,      2, 8, 8,L0|L1},   {OFFA_A_A,      2, 8, 8,L0|L1},
5390   {OFFA_A_B,      2, 8, 8,L0|L1},   {OFFA_A_C,      2, 8, 8,L0|L1},
5391   {OFFA_A_D,      2, 8, 8,L0|L1},   {OFFA_A_E,      2, 8, 8,L0|L1},
5392   {OFFA_A_H,      2, 8, 8,L0|L1},   {OFFA_A_L,      2, 8, 8,L0|L1},
5393
5394   /* 0xE0 - 0xFF */
5395   {illegal2,      2, 8, 8,L0|L1},   {SUB_A_A,      2, 8, 8,L0|L1},
5396   {SUB_A_B,      2, 8, 8,L0|L1},   {SUB_A_C,      2, 8, 8,L0|L1},
5397   {SUB_A_D,      2, 8, 8,L0|L1},   {SUB_A_E,      2, 8, 8,L0|L1},
5398   {SUB_A_H,      2, 8, 8,L0|L1},   {SUB_A_L,      2, 8, 8,L0|L1},
5399   {illegal2,      2, 8, 8,L0|L1},   {NEA_A_A,      2, 8, 8,L0|L1},
5400   {NEA_A_B,      2, 8, 8,L0|L1},   {NEA_A_C,      2, 8, 8,L0|L1},
5401   {NEA_A_D,      2, 8, 8,L0|L1},   {NEA_A_E,      2, 8, 8,L0|L1},
5402   {NEA_A_H,      2, 8, 8,L0|L1},   {NEA_A_L,      2, 8, 8,L0|L1},
5403
5404   {illegal2,      2, 8, 8,L0|L1},   {SBB_A_A,      2, 8, 8,L0|L1},
5405   {SBB_A_B,      2, 8, 8,L0|L1},   {SBB_A_C,      2, 8, 8,L0|L1},
5406   {SBB_A_D,      2, 8, 8,L0|L1},   {SBB_A_E,      2, 8, 8,L0|L1},
5407   {SBB_A_H,      2, 8, 8,L0|L1},   {SBB_A_L,      2, 8, 8,L0|L1},
5408   {illegal2,      2, 8, 8,L0|L1},   {EQA_A_A,      2, 8, 8,L0|L1},
5409   {EQA_A_B,      2, 8, 8,L0|L1},   {EQA_A_C,      2, 8, 8,L0|L1},
5410   {EQA_A_D,      2, 8, 8,L0|L1},   {EQA_A_E,      2, 8, 8,L0|L1},
5411   {EQA_A_H,      2, 8, 8,L0|L1},   {EQA_A_L,      2, 8, 8,L0|L1}
5412};
5413
5414/* prefix 64 */
5415static const struct opcode_s op64_78c05[256] =
5416{
5417   /* 0x00 - 0x1F */
5418   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5419   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5420   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5421   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5422   {illegal2,      2, 8, 8,L0|L1},   {ANI_A_xx,      3,11,11,L0|L1},
5423   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5424   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5425   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5426
5427   {illegal2,      2, 8, 8,L0|L1},   {XRI_A_xx,      3,11,11,L0|L1},
5428   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5429   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5430   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5431   {illegal2,      2, 8, 8,L0|L1},   {ORI_A_xx,      3,11,11,L0|L1},
5432   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5433   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5434   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5435
5436   /* 0x20 - 0x3F */
5437   {illegal2,      2, 8, 8,L0|L1},   {ADINC_A_xx,   3,11,11,L0|L1},
5438   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5439   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5440   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5441   {illegal2,      2, 8, 8,L0|L1},   {GTI_A_xx,      3,11,11,L0|L1},
5442   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5443   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5444   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5445
5446   {illegal2,      2, 8, 8,L0|L1},   {SUINB_A_xx,   3,11,11,L0|L1},
5447   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5448   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5449   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5450   {illegal2,      3, 8, 8,L0|L1},   {LTI_A_xx,      3,11,11,L0|L1},
5451   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5452   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5453   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5454
5455   /* 0x40 - 0x5F */
5456   {illegal2,      2, 8, 8,L0|L1},   {ADI_A_xx,      3,11,11,L0|L1},
5457   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5458   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5459   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5460   {illegal2,      2, 8, 8,L0|L1},   {ONI_A_xx,      3,11,11,L0|L1},
5461   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5462   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5463   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5464
5465   {illegal2,      3, 8, 8,L0|L1},   {ACI_A_xx,      3,11,11,L0|L1},
5466   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5467   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5468   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5469   {illegal2,      3, 8, 8,L0|L1},   {OFFI_A_xx,      3,11,11,L0|L1},
5470   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5471   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5472   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5473
5474   /* 0x60 - 0x7F */
5475   {illegal2,      2, 8, 8,L0|L1},   {SUI_A_xx,      3,11,11,L0|L1},
5476   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5477   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5478   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5479   {illegal2,      2, 8, 8,L0|L1},   {NEI_A_xx,      3,11,11,L0|L1},
5480   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5481   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5482   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5483
5484   {illegal2,      2, 8, 8,L0|L1},   {SBI_A_xx,      3,11,11,L0|L1},
5485   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5486   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5487   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5488   {illegal2,      2, 8, 8,L0|L1},   {EQI_A_xx,      3,11,11,L0|L1},
5489   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5490   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5491   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5492
5493   /* 0x80 - 0x9F */
5494   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5495   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5496   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5497   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5498   {ANI_PA_xx,      3,17,17,L0|L1},   {ANI_PB_xx,      3,17,17,L0|L1},
5499   {ANI_PC_xx,      3,17,17,L0|L1},   {ANI_MKL_xx,   3,17,17,L0|L1},
5500   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5501   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5502
5503   {XRI_PA_xx,      3,17,17,L0|L1},   {XRI_PB_xx,      3,17,17,L0|L1},
5504   {XRI_PC_xx,      3,17,17,L0|L1},   {XRI_MKL_xx,   3,17,17,L0|L1},
5505   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5506   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5507   {ORI_PA_xx,      3,17,17,L0|L1},   {ORI_PB_xx,      3,17,17,L0|L1},
5508   {ORI_PC_xx,      3,17,17,L0|L1},   {ORI_MKL_xx,   3,17,17,L0|L1},
5509   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5510   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5511
5512   /* 0xA0 - 0xBF */
5513   {ADINC_PA_xx,   3,17,17,L0|L1},   {ADINC_PB_xx,   3,17,17,L0|L1},
5514   {ADINC_PC_xx,   3,17,17,L0|L1},   {ADINC_MKL_xx,   3,17,17,L0|L1},
5515   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5516   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5517   {GTI_PA_xx,      3,14,14,L0|L1},   {GTI_PB_xx,      3,14,14,L0|L1},
5518   {GTI_PC_xx,      3,14,14,L0|L1},   {GTI_MKL_xx,   3,14,14,L0|L1},
5519   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5520   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5521
5522   {SUINB_PA_xx,   3,17,17,L0|L1},   {SUINB_PB_xx,   3,17,17,L0|L1},
5523   {SUINB_PC_xx,   3,17,17,L0|L1},   {SUINB_MKL_xx,   3,17,17,L0|L1},
5524   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5525   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5526   {LTI_PA_xx,      3,14,14,L0|L1},   {LTI_PB_xx,      3,14,14,L0|L1},
5527   {LTI_PC_xx,      3,14,14,L0|L1},   {LTI_MKL_xx,   3,14,14,L0|L1},
5528   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5529   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5530
5531   /* 0xC0 - 0xDF */
5532   {ADI_PA_xx,      3,17,17,L0|L1},   {ADI_PB_xx,      3,17,17,L0|L1},
5533   {ADI_PC_xx,      3,17,17,L0|L1},   {ADI_MKL_xx,   3,17,17,L0|L1},
5534   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5535   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5536   {ONI_PA_xx,      3,14,14,L0|L1},   {ONI_PB_xx,      3,14,14,L0|L1},
5537   {ONI_PC_xx,      3,14,14,L0|L1},   {ONI_MKL_xx,   3,14,14,L0|L1},
5538   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5539   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5540
5541   {ACI_PA_xx,      3,17,17,L0|L1},   {ACI_PB_xx,      3,17,17,L0|L1},
5542   {ACI_PC_xx,      3,17,17,L0|L1},   {ACI_MKL_xx,   3,17,17,L0|L1},
5543   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5544   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5545   {OFFI_PA_xx,   3,14,14,L0|L1},   {OFFI_PB_xx,   3,14,14,L0|L1},
5546   {OFFI_PC_xx,   3,14,14,L0|L1},   {OFFI_MKL_xx,   3,14,14,L0|L1},
5547   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5548   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5549
5550   /* 0xE0 - 0xFF */
5551   {SUI_PA_xx,      3,17,17,L0|L1},   {SUI_PB_xx,      3,17,17,L0|L1},
5552   {SUI_PC_xx,      3,17,17,L0|L1},   {SUI_MKL_xx,   3,17,17,L0|L1},
5553   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5554   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5555   {NEI_PA_xx,      3,14,14,L0|L1},   {NEI_PB_xx,      3,14,14,L0|L1},
5556   {NEI_PC_xx,      3,14,14,L0|L1},   {NEI_MKL_xx,   3,14,14,L0|L1},
5557   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5558   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5559
5560   {SBI_PA_xx,      3,17,17,L0|L1},   {SBI_PB_xx,      3,17,17,L0|L1},
5561   {SBI_PC_xx,      3,17,17,L0|L1},   {SBI_MKL_xx,   3,17,17,L0|L1},
5562   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5563   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5564   {EQI_PA_xx,      3,14,14,L0|L1},   {EQI_PB_xx,      3,14,14,L0|L1},
5565   {EQI_PC_xx,      3,14,14,L0|L1},   {EQI_MKL_xx,   3,14,14,L0|L1},
5566   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5567   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1}
5568};
5569
5570/* prefix 70 */
5571static const struct opcode_s op70_78c05[256] =
5572{
5573   /* 0x00 - 0x1F */
5574   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5575   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5576   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5577   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5578   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5579   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5580   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5581   {SSPD_w,      4,20,20,L0|L1},   {LSPD_w,      4,20,20,L0|L1},
5582
5583   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5584   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5585   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5586   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5587   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5588   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5589   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5590   {SBCD_w,      4,20,20,L0|L1},   {LBCD_w,      4,20,20,L0|L1},
5591
5592   /* 0x20 - 0x3F */
5593   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5594   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5595   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5596   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5597   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5598   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5599   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5600   {SDED_w,      4,20,20,L0|L1},   {LDED_w,      4,20,20,L0|L1},
5601
5602   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5603   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5604   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5605   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5606   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5607   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5608   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5609   {SHLD_w,      4,20,20,L0|L1},   {LHLD_w,      4,20,20,L0|L1},
5610
5611   /* 0x40 - 0x5F */
5612   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5613   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5614   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5615   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5616   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5617   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5618   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5619   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5620
5621   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5622   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5623   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5624   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5625   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5626   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5627   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5628   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5629
5630   /* 0x60 - 0x7F */
5631   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5632   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5633   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5634   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5635   {illegal2,      2, 8, 8,L0|L1},   {MOV_A_w,      4,17,17,L0|L1},
5636   {MOV_B_w,      4,17,17,L0|L1},   {MOV_C_w,      4,17,17,L0|L1},
5637   {MOV_D_w,      4,17,17,L0|L1},   {MOV_E_w,      4,17,17,L0|L1},
5638   {MOV_H_w,      4,17,17,L0|L1},   {MOV_L_w,      4,17,17,L0|L1},
5639
5640   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5641   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5642   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5643   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5644   {illegal2,      2, 8, 8,L0|L1},   {MOV_w_A,      4,17,17,L0|L1},
5645   {MOV_w_B,      4,17,17,L0|L1},   {MOV_w_C,      4,17,17,L0|L1},
5646   {MOV_w_D,      4,17,17,L0|L1},   {MOV_w_E,      4,17,17,L0|L1},
5647   {MOV_w_H,      4,17,17,L0|L1},   {MOV_w_L,      4,17,17,L0|L1},
5648
5649   /* 0x80 - 0x9F */
5650   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5651   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5652   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5653   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5654   {illegal2,      2, 8, 8,L0|L1},   {ANAX_B,      2,11,11,L0|L1},
5655   {ANAX_D,      2,11,11,L0|L1},   {ANAX_H,      2,11,11,L0|L1},
5656   {ANAX_Dp,      2,11,11,L0|L1},   {ANAX_Hp,      2,11,11,L0|L1},
5657   {ANAX_Dm,      2,11,11,L0|L1},   {ANAX_Hm,      2,11,11,L0|L1},
5658
5659   {illegal2,      2, 8, 8,L0|L1},   {XRAX_B,      2,11,11,L0|L1},
5660   {XRAX_D,      2,11,11,L0|L1},   {XRAX_H,      2,11,11,L0|L1},
5661   {XRAX_Dp,      2,11,11,L0|L1},   {XRAX_Hp,      2,11,11,L0|L1},
5662   {XRAX_Dm,      2,11,11,L0|L1},   {XRAX_Hm,      2,11,11,L0|L1},
5663   {illegal2,      2, 8, 8,L0|L1},   {ORAX_B,      2,11,11,L0|L1},
5664   {ORAX_D,      2,11,11,L0|L1},   {ORAX_H,      2,11,11,L0|L1},
5665   {ORAX_Dp,      2,11,11,L0|L1},   {ORAX_Hp,      2,11,11,L0|L1},
5666   {ORAX_Dm,      2,11,11,L0|L1},   {ORAX_Hm,      2,11,11,L0|L1},
5667
5668   /* 0xA0 - 0xBF */
5669   {illegal2,      2, 8, 8,L0|L1},   {ADDNCX_B,      2,11,11,L0|L1},
5670   {ADDNCX_D,      2,11,11,L0|L1},   {ADDNCX_H,      2,11,11,L0|L1},
5671   {ADDNCX_Dp,    2,11,11,L0|L1},   {ADDNCX_Hp,    2,11,11,L0|L1},
5672   {ADDNCX_Dm,    2,11,11,L0|L1},   {ADDNCX_Hm,    2,11,11,L0|L1},
5673   {illegal2,      2, 8, 8,L0|L1},   {GTAX_B,      2,11,11,L0|L1},
5674   {GTAX_D,      2,11,11,L0|L1},   {GTAX_H,      2,11,11,L0|L1},
5675   {GTAX_Dp,      2,11,11,L0|L1},   {GTAX_Hp,      2,11,11,L0|L1},
5676   {GTAX_Dm,      2,11,11,L0|L1},   {GTAX_Hm,      2,11,11,L0|L1},
5677
5678   {illegal2,      2, 8, 8,L0|L1},   {SUBNBX_B,      2,11,11,L0|L1},
5679   {SUBNBX_D,      2,11,11,L0|L1},   {SUBNBX_H,      2,11,11,L0|L1},
5680   {SUBNBX_Dp,    2,11,11,L0|L1},   {SUBNBX_Hp,    2,11,11,L0|L1},
5681   {SUBNBX_Dm,    2,11,11,L0|L1},   {SUBNBX_Hm,    2,11,11,L0|L1},
5682   {illegal2,      2, 8, 8,L0|L1},   {LTAX_B,      2,11,11,L0|L1},
5683   {LTAX_D,      2,11,11,L0|L1},   {LTAX_H,      2,11,11,L0|L1},
5684   {LTAX_Dp,      2,11,11,L0|L1},   {LTAX_Hp,      2,11,11,L0|L1},
5685   {LTAX_Dm,      2,11,11,L0|L1},   {LTAX_Hm,      2,11,11,L0|L1},
5686
5687   /* 0xC0 - 0xDF */
5688   {illegal2,      2, 8, 8,L0|L1},   {ADDX_B,      2,11,11,L0|L1},
5689   {ADDX_D,      2,11,11,L0|L1},   {ADDX_H,      2,11,11,L0|L1},
5690   {ADDX_Dp,      2,11,11,L0|L1},   {ADDX_Hp,      2,11,11,L0|L1},
5691   {ADDX_Dm,      2,11,11,L0|L1},   {ADDX_Hm,      2,11,11,L0|L1},
5692   {illegal2,      2, 8, 8,L0|L1},   {ONAX_B,      2,11,11,L0|L1},
5693   {ONAX_D,      2,11,11,L0|L1},   {ONAX_H,      2,11,11,L0|L1},
5694   {ONAX_Dp,      2,11,11,L0|L1},   {ONAX_Hp,      2,11,11,L0|L1},
5695   {ONAX_Dm,      2,11,11,L0|L1},   {ONAX_Hm,      2,11,11,L0|L1},
5696
5697   {illegal2,      2, 8, 8,L0|L1},   {ADCX_B,      2,11,11,L0|L1},
5698   {ADCX_D,      2,11,11,L0|L1},   {ADCX_H,      2,11,11,L0|L1},
5699   {ADCX_Dp,      2,11,11,L0|L1},   {ADCX_Hp,      2,11,11,L0|L1},
5700   {ADCX_Dm,      2,11,11,L0|L1},   {ADCX_Hm,      2,11,11,L0|L1},
5701   {illegal2,      2, 8, 8,L0|L1},   {OFFAX_B,      2,11,11,L0|L1},
5702   {OFFAX_D,      2,11,11,L0|L1},   {OFFAX_H,      2,11,11,L0|L1},
5703   {OFFAX_Dp,      2,11,11,L0|L1},   {OFFAX_Hp,      2,11,11,L0|L1},
5704   {OFFAX_Dm,      2,11,11,L0|L1},   {OFFAX_Hm,      2,11,11,L0|L1},
5705
5706   /* 0xE0 - 0xFF */
5707   {illegal2,      2, 8, 8,L0|L1},   {SUBX_B,      2,11,11,L0|L1},
5708   {SUBX_D,      2,11,11,L0|L1},   {SUBX_H,      2,11,11,L0|L1},
5709   {SUBX_Dp,      2,11,11,L0|L1},   {SUBX_Hp,      2,11,11,L0|L1},
5710   {SUBX_Dm,      2,11,11,L0|L1},   {SUBX_Hm,      2,11,11,L0|L1},
5711   {illegal2,      2, 8, 8,L0|L1},   {NEAX_B,      2,11,11,L0|L1},
5712   {NEAX_D,      2,11,11,L0|L1},   {NEAX_H,      2,11,11,L0|L1},
5713   {NEAX_Dp,      2,11,11,L0|L1},   {NEAX_Hp,      2,11,11,L0|L1},
5714   {NEAX_Dm,      2,11,11,L0|L1},   {NEAX_Hm,      2,11,11,L0|L1},
5715
5716   {illegal2,      2, 8, 8,L0|L1},   {SBBX_B,      2,11,11,L0|L1},
5717   {SBBX_D,      2,11,11,L0|L1},   {SBBX_H,      2,11,11,L0|L1},
5718   {SBBX_Dp,      2,11,11,L0|L1},   {SBBX_Hp,      2,11,11,L0|L1},
5719   {SBBX_Dm,      2,11,11,L0|L1},   {SBBX_Hm,      2,11,11,L0|L1},
5720   {illegal2,      2, 8, 8,L0|L1},   {EQAX_B,      2,11,11,L0|L1},
5721   {EQAX_D,      2,11,11,L0|L1},   {EQAX_H,      2,11,11,L0|L1},
5722   {EQAX_Dp,      2,11,11,L0|L1},   {EQAX_Hp,      2,11,11,L0|L1},
5723   {EQAX_Dm,      2,11,11,L0|L1},   {EQAX_Hm,      2,11,11,L0|L1}
5724};
5725
5726/* prefix 74 */
5727static const struct opcode_s op74_78c05[256] =
5728{
5729   /* 0x00 - 0x1F */
5730   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5731   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5732   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5733   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5734   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5735   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5736   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5737   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5738
5739   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5740   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5741   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5742   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5743   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5744   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5745   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5746   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5747
5748   /* 0x20 - 0x3F */
5749   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5750   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5751   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5752   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5753   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5754   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5755   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5756   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5757
5758   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5759   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5760   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5761   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5762   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5763   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5764   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5765   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5766
5767   /* 0x40 - 0x5F */
5768   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5769   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5770   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5771   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5772   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5773   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5774   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5775   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5776
5777   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5778   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5779   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5780   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5781   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5782   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5783   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5784   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5785
5786   /* 0x60 - 0x7F */
5787   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5788   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5789   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5790   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5791   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5792   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5793   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5794   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5795
5796   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5797   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5798   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5799   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5800   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5801   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5802   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5803   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5804
5805   /* 0x80 - 0x9F */
5806   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5807   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5808   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5809   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5810   {ANAW_wa,      3,14,14,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5811   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5812   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5813   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5814
5815   {XRAW_wa,      3,14,14,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5816   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5817   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5818   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5819   {ORAW_wa,      3,14,14,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5820   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5821   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5822   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5823
5824   /* 0xA0 - 0xBF */
5825   {ADDNCW_wa,    3,14,14,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5826   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5827   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5828   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5829   {GTAW_wa,      3,14,14,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5830   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5831   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5832   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5833
5834   {SUBNBW_wa,    3,14,14,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5835   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5836   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5837   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5838   {LTAW_wa,      3,14,14,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5839   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5840   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5841   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5842
5843   /* 0xC0 - 0xDF */
5844   {ADDW_wa,      3,14,14,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5845   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5846   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5847   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5848   {ONAW_wa,      3,14,14,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5849   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5850   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5851   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5852
5853   {ADCW_wa,      3,14,14,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5854   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5855   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5856   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5857   {OFFAW_wa,      3,14,14,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5858   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5859   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5860   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5861
5862   /* 0xE0 - 0xFF */
5863   {SUBW_wa,      3,14,14,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5864   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5865   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5866   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5867   {NEAW_wa,      3,14,14,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5868   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5869   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5870   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5871
5872   {SBBW_wa,      3,14,14,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5873   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5874   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5875   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5876   {EQAW_wa,      3,14,14,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5877   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5878   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1},
5879   {illegal2,      2, 8, 8,L0|L1},   {illegal2,      2, 8, 8,L0|L1}
5880};
5881
5882static const struct opcode_s opXX_78c05[256] =
5883{
5884   /* 0x00 - 0x1F */
5885   {NOP,         1, 4, 4,L0|L1},   {HALT,         1, 6, 6,L0|L1},
5886   {INX_SP,      1, 7, 7,L0|L1},   {DCX_SP,      1, 7, 7,L0|L1},
5887   {LXI_S_w,      3,10,10,L0|L1},   {ANIW_wa_xx,   3,16,16,L0|L1},
5888   {illegal,      1, 4, 4,L0|L1},   {ANI_A_xx,      2, 7, 7,L0|L1},
5889   {RET,         1,10,10,L0|L1},   {SIO,         1, 4, 4,L0|L1},
5890   {MOV_A_B,      1, 4, 4,L0|L1},   {MOV_A_C,      1, 4, 4,L0|L1},
5891   {MOV_A_D,      1, 4, 4,L0|L1},   {MOV_A_E,      1, 4, 4,L0|L1},
5892   {MOV_A_H,      1, 4, 4,L0|L1},   {MOV_A_L,      1, 4, 4,L0|L1},
5893
5894   {illegal,      1, 4, 4,L0|L1},   {illegal,      1, 4, 4,L0|L1},
5895   {INX_BC,      1, 7, 7,L0|L1},   {DCX_BC,      1, 7, 7,L0|L1},
5896   {LXI_B_w,      3,10,10,L0|L1},   {ORIW_wa_xx,   3,16,16,L0|L1},
5897   {XRI_A_xx,      2, 7, 7,L0|L1},   {ORI_A_xx,      2, 7, 7,L0|L1},
5898   {RETS,         1,10,10,L0|L1},   {STM,         1, 4, 4,L0|L1},
5899   {MOV_B_A,      1, 4, 4,L0|L1},   {MOV_C_A,      1, 4, 4,L0|L1},
5900   {MOV_D_A,      1, 4, 4,L0|L1},   {MOV_E_A,      1, 4, 4,L0|L1},
5901   {MOV_H_A,      1, 4, 4,L0|L1},   {MOV_L_A,      1, 4, 4,L0|L1},
5902
5903   /* 0x20 - 0x3F */
5904   {INRW_wa_7801,   2,13,13,L0|L1},   {illegal,      1, 4, 4,L0|L1},
5905   {INX_DE,      1, 7, 7,L0|L1},   {DCX_DE,      1, 7, 7,L0|L1},
5906   {LXI_D_w,      3,10,10,L0|L1},   {GTIW_wa_xx,   3,13,13,L0|L1},
5907   {ADINC_A_xx,   2, 7, 7,L0|L1},   {GTI_A_xx,      2, 7, 7,L0|L1},
5908   {LDAW_wa,      2,10,10,L0|L1},   {LDAX_B,      1, 7, 7,L0|L1},
5909   {LDAX_D,      1, 7, 7,L0|L1},   {LDAX_H,      1, 7, 7,L0|L1},
5910   {LDAX_Dp,      1, 7, 7,L0|L1},   {LDAX_Hp,      1, 7, 7,L0|L1},
5911   {LDAX_Dm,      1, 7, 7,L0|L1},   {LDAX_Hm,      1, 7, 7,L0|L1},
5912
5913   {DCRW_wa_7801,   2,13,13,L0|L1},   {illegal,      1, 4, 4,L0|L1},
5914   {INX_HL,      1, 7, 7,L0|L1},   {DCX_HL,      1, 7, 7,L0|L1},
5915   {LXI_H_w,      3,10,10,   L1},   {LTIW_wa_xx,   3,13,13,L0|L1},
5916   {SUINB_A_xx,   2, 7, 7,L0|L1},   {LTI_A_xx,      2, 7, 7,L0|L1},
5917   {STAW_wa,      2,10,10,L0|L1},   {STAX_B,      1, 7, 7,L0|L1},
5918   {STAX_D,      1, 7, 7,L0|L1},   {STAX_H,      1, 7, 7,L0|L1},
5919   {STAX_Dp,      1, 7, 7,L0|L1},   {STAX_Hp,      1, 7, 7,L0|L1},
5920   {STAX_Dm,      1, 7, 7,L0|L1},   {STAX_Hm,      1, 7, 7,L0|L1},
5921
5922   /* 0x40 - 0x5F */
5923   {illegal,      1, 4, 4,L0|L1},   {INR_A_7801,   1, 4, 4,L0|L1},
5924   {INR_B_7801,    1, 4, 4,L0|L1},   {INR_C_7801,    1, 4, 4,L0|L1},
5925   {CALL_w,      3,16,16,L0|L1},   {ONIW_wa_xx,   3,13,13,L0|L1},
5926   {ADI_A_xx,      2, 7, 7,L0|L1},   {ONI_A_xx,      2, 7, 7,L0|L1},
5927   {PRE_48,      1, 0, 0,L0|L1},   {illegal,      1, 4, 4,L0|L1},
5928   {illegal,      1, 4, 4,L0|L1},   {illegal,      1, 4, 4,L0|L1},
5929   {PRE_4C,      1, 0, 0,L0|L1},   {PRE_4D,      1, 0, 0,L0|L1},
5930   {JRE,         2,13,13,L0|L1},   {JRE,         2,13,13,L0|L1},
5931
5932   {illegal,      1, 4, 4,L0|L1},   {DCR_A_7801,    1, 4, 4,L0|L1},
5933   {DCR_B_7801,    1, 4, 4,L0|L1},   {DCR_C_7801,    1, 4, 4,L0|L1},
5934   {JMP_w,       3,10,10,L0|L1},   {OFFIW_wa_xx,   3,13,13,L0|L1},
5935   {ACI_A_xx,      2, 7, 7,L0|L1},   {OFFI_A_xx,    2, 7, 7,L0|L1},
5936   {illegal,      1, 4, 4,L0|L1},   {illegal,      1, 4, 4,L0|L1},
5937   {illegal,      1, 4, 4,L0|L1},   {illegal,      1, 4, 4,L0|L1},
5938   {illegal,      1, 4, 4,L0|L1},   {illegal,      1, 4, 4,L0|L1},
5939   {illegal,      1, 4, 4,L0|L1},   {illegal,      1, 4, 4,L0|L1},
5940
5941   /* 0x60 - 0x7F */
5942   {PRE_60,      1, 0, 0,L0|L1},   {DAA,         1, 4, 4,L0|L1},
5943   {RETI,         1,13,13,L0|L1},   {CALB,         2,13,13,L0|L1},
5944   {PRE_64,      1, 0, 0,L0|L1},   {NEIW_wa_xx,   3,13,13,L0|L1},
5945   {SUI_A_xx,      2, 7, 7,L0|L1},   {NEI_A_xx,      2, 7, 7,L0|L1},
5946   {illegal,      1, 4, 4,L0|L1},   {MVI_A_xx,      2, 7, 7,L0    },
5947   {MVI_B_xx,      2, 7, 7,L0|L1},   {MVI_C_xx,      2, 7, 7,L0|L1},
5948   {MVI_D_xx,      2, 7, 7,L0|L1},   {MVI_E_xx,      2, 7, 7,L0|L1},
5949   {MVI_H_xx,      2, 7, 7,L0|L1},   {MVI_L_xx,      2, 7, 7,   L1},
5950
5951   {PRE_70,      1, 0, 0,L0|L1},   {MVIW_wa_xx,   3,13,13,L0|L1},
5952   {SOFTI,       1,19,19,L0|L1},   {JB,         1, 4, 4,L0|L1},
5953   {PRE_74,      1, 0, 0,L0|L1},   {EQIW_wa_xx,   3,13,13,L0|L1},
5954   {SBI_A_xx,      2, 7, 7,L0|L1},   {EQI_A_xx,      2, 7, 7,L0|L1},
5955   {CALF,         2,13,13,L0|L1},   {CALF,         2,13,13,L0|L1},
5956   {CALF,         2,13,13,L0|L1},   {CALF,         2,13,13,L0|L1},
5957   {CALF,         2,13,13,L0|L1},   {CALF,         2,13,13,L0|L1},
5958   {CALF,         2,13,13,L0|L1},   {CALF,         2,13,13,L0|L1},
5959
5960   /* 0x80 - 0x9F */
5961   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
5962   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
5963   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
5964   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
5965   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
5966   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
5967   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
5968   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
5969
5970   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
5971   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
5972   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
5973   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
5974   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
5975   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
5976   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
5977   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
5978
5979   /* 0xA0 - 0xBF */
5980   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
5981   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
5982   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
5983   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
5984   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
5985   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
5986   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
5987   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
5988
5989   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
5990   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
5991   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
5992   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
5993   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
5994   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
5995   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
5996   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
5997
5998   /* 0xC0 - 0xDF */
5999   {JR,         1,10,10,L0|L1},   {JR,         1,10,10,L0|L1},
6000   {JR,         1,10,10,L0|L1},   {JR,         1,10,10,L0|L1},
6001   {JR,         1,10,10,L0|L1},   {JR,         1,10,10,L0|L1},
6002   {JR,         1,10,10,L0|L1},   {JR,         1,10,10,L0|L1},
6003   {JR,         1,10,10,L0|L1},   {JR,         1,10,10,L0|L1},
6004   {JR,         1,10,10,L0|L1},   {JR,         1,10,10,L0|L1},
6005   {JR,         1,10,10,L0|L1},   {JR,         1,10,10,L0|L1},
6006   {JR,         1,10,10,L0|L1},   {JR,         1,10,10,L0|L1},
6007
6008   {JR,         1,10,10,L0|L1},   {JR,         1,10,10,L0|L1},
6009   {JR,         1,10,10,L0|L1},   {JR,         1,10,10,L0|L1},
6010   {JR,         1,10,10,L0|L1},   {JR,         1,10,10,L0|L1},
6011   {JR,         1,10,10,L0|L1},   {JR,         1,10,10,L0|L1},
6012   {JR,         1,10,10,L0|L1},   {JR,         1,10,10,L0|L1},
6013   {JR,         1,10,10,L0|L1},   {JR,         1,10,10,L0|L1},
6014   {JR,         1,10,10,L0|L1},   {JR,         1,10,10,L0|L1},
6015   {JR,         1,10,10,L0|L1},   {JR,         1,10,10,L0|L1},
6016
6017   /* 0xE0 - 0xFF */
6018   {JR,         1,10,10,L0|L1},   {JR,         1,10,10,L0|L1},
6019   {JR,         1,10,10,L0|L1},   {JR,         1,10,10,L0|L1},
6020   {JR,         1,10,10,L0|L1},   {JR,         1,10,10,L0|L1},
6021   {JR,         1,10,10,L0|L1},   {JR,         1,10,10,L0|L1},
6022   {JR,         1,10,10,L0|L1},   {JR,         1,10,10,L0|L1},
6023   {JR,         1,10,10,L0|L1},   {JR,         1,10,10,L0|L1},
6024   {JR,         1,10,10,L0|L1},   {JR,         1,10,10,L0|L1},
6025   {JR,         1,10,10,L0|L1},   {JR,         1,10,10,L0|L1},
6026
6027   {JR,         1,10,10,L0|L1},   {JR,         1,10,10,L0|L1},
6028   {JR,         1,10,10,L0|L1},   {JR,         1,10,10,L0|L1},
6029   {JR,         1,10,10,L0|L1},   {JR,         1,10,10,L0|L1},
6030   {JR,         1,10,10,L0|L1},   {JR,         1,10,10,L0|L1},
6031   {JR,         1,10,10,L0|L1},   {JR,         1,10,10,L0|L1},
6032   {JR,         1,10,10,L0|L1},   {JR,         1,10,10,L0|L1},
6033   {JR,         1,10,10,L0|L1},   {JR,         1,10,10,L0|L1},
6034   {JR,         1,10,10,L0|L1},   {JR,         1,10,10,L0|L1}
6035};
6036
6037/***********************************************************************
6038 *
6039 * uPD78C06(A) - Same as uPD78C05 but with different instruction timing
6040 *
6041 **********************************************************************/
6042
6043static const struct opcode_s op48_78c06[256] =
6044{
6045   /* 0x00 - 0x1F */
6046   {SKIT_F0,      2,12,12,L0|L1},   {SKIT_FT0,      2,12,12,L0|L1},
6047   {SKIT_F1,      2,12,12,L0|L1},   {illegal2,      2,12,12,L0|L1},
6048   {SKIT_FST,      2,12,12,L0|L1},   {illegal2,      2,12,12,L0|L1},
6049   {illegal2,      2,12,12,L0|L1},   {illegal2,      2,12,12,L0|L1},
6050   {illegal2,       2,12,12,L0|L1},   {illegal2,      2,12,12,L0|L1},
6051   {SK_CY,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6052   {SK_Z,         2,12,12,L0|L1},   {illegal2,      2,12,12,L0|L1},
6053   {PUSH_VA,      2,21,21,L0|L1},   {POP_VA,      2,18,18,L0|L1},
6054
6055   {SKNIT_F0,      2,12,12,L0|L1},   {SKNIT_FT0,      2,12,12,L0|L1},
6056   {SKNIT_F1,      2,12,12,L0|L1},   {illegal2,      2,12,12,L0|L1},
6057   {SKNIT_FST,      2,12,12,L0|L1},   {illegal2,      2,12,12,L0|L1},
6058   {illegal2,      2,12,12,L0|L1},   {illegal2,      2,12,12,L0|L1},
6059   {illegal2,      2,12,12,L0|L1},   {illegal2,      2,12,12,L0|L1},
6060   {SKN_CY,      2,12,12,L0|L1},   {illegal2,      2,12,12,L0|L1},
6061   {SKN_Z,       2,12,12,L0|L1},   {illegal2,      2,12,12,L0|L1},
6062   {PUSH_BC,      2,21,21,L0|L1},   {POP_BC,      2,18,18,L0|L1},
6063
6064   /* 0x20 - 0x3F */
6065   {EI,         2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6066   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6067   {DI,         2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6068   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6069   {illegal2,      2,12,12,L0|L1},   {illegal2,      2,12,12,L0|L1},
6070   {CLC,         2,12,12,L0|L1},   {STC,         2,12,12,L0|L1},
6071   {illegal2,      2,12,12,L0|L1},   {PEX,         2,15,15,L0|L1},
6072   {PUSH_DE,       2,21,21,L0|L1},   {POP_DE,       2,18,18,L0|L1},
6073
6074   {RLL_A,         2,12,12,L0|L1},   {RLR_A,       2,12,12,L0|L1},
6075   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6076   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6077   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6078   {RLD,         2,21,21,L0|L1},   {RRD,         2,21,21,L0|L1},
6079   {illegal2,      2,12,12,L0|L1},   {illegal2,      2,12,12,L0|L1},
6080   {PER,         2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6081   {PUSH_HL,       2,21,21,L0|L1},   {POP_HL,       2,18,18,L0|L1},
6082
6083   /* 0x40 - 0x5F */
6084   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6085   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6086   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6087   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6088   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6089   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6090   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6091   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6092
6093   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6094   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6095   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6096   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6097   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6098   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6099   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6100   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6101
6102   /* 0x60 - 0x7F */
6103   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6104   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6105   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6106   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6107   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6108   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6109   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6110   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6111
6112   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6113   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6114   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6115   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6116   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6117   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6118   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6119   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6120
6121   /* 0x80 - 0x9F */
6122   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6123   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6124   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6125   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6126   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6127   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6128   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6129   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6130
6131   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6132   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6133   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6134   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6135   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6136   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6137   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6138   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6139
6140   /* 0xA0 - 0xBF */
6141   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6142   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6143   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6144   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6145   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6146   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6147   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6148   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6149
6150   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6151   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6152   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6153   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6154   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6155   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6156   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6157   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6158
6159   /* 0xC0 - 0xDF */
6160   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6161   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6162   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6163   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6164   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6165   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6166   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6167   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6168
6169   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6170   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6171   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6172   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6173   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6174   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6175   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6176   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6177
6178   /* 0xE0 - 0xFF */
6179   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6180   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6181   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6182   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6183   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6184   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6185   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6186   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6187
6188   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6189   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6190   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6191   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6192   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6193   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6194   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6195   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1}
6196};
6197
6198static const struct opcode_s op4C_78c06[256] =
6199{
6200   /* 0x00 - 0x1F */
6201   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6202   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6203   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6204   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6205   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6206   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6207   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6208   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6209
6210   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6211   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6212   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6213   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6214   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6215   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6216   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6217   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6218
6219   /* 0x20 - 0x3F */
6220   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6221   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6222   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6223   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6224   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6225   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6226   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6227   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6228
6229   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6230   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6231   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6232   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6233   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6234   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6235   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6236   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6237
6238   /* 0x40 - 0x5F */
6239   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6240   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6241   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6242   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6243   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6244   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6245   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6246   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6247
6248   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6249   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6250   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6251   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6252   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6253   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6254   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6255   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6256
6257   /* 0x60 - 0x7F */
6258   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6259   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6260   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6261   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6262   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6263   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6264   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6265   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6266
6267   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6268   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6269   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6270   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6271   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6272   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6273   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6274   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6275
6276   /* 0x80 - 0x9F */
6277   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6278   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6279   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6280   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6281   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6282   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6283   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6284   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6285
6286   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6287   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6288   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6289   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6290   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6291   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6292   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6293   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6294
6295   /* 0xA0 - 0xBF */
6296   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6297   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6298   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6299   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6300   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6301   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6302   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6303   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6304
6305   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6306   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6307   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6308   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6309   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6310   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6311   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6312   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6313
6314   /* 0xC0 - 0xDF */
6315   {MOV_A_PA,      2,14,14,L0|L1},   {MOV_A_PB,      2,14,14,L0|L1},
6316   {MOV_A_PC,      2,14,14,L0|L1},   {MOV_A_MKL,      2,14,14,L0|L1},
6317   {illegal2,      2,12,12,L0|L1},   {illegal2,      2,12,12,L0|L1},
6318   {illegal2,      2,12,12,L0|L1},   {illegal2,      2,12,12,L0|L1},
6319   {MOV_A_S,      2,14,14,L0|L1},   {illegal2,      2,12,12,L0|L1},
6320   {illegal2,      2,12,12,L0|L1},   {illegal2,      2,12,12,L0|L1},
6321   {illegal2,      2,12,12,L0|L1},   {illegal2,      2,12,12,L0|L1},
6322   {illegal2,      2,12,12,L0|L1},   {illegal2,      2,12,12,L0|L1},
6323
6324   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6325   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6326   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6327   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6328   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6329   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6330   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6331   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6332
6333   /* 0xE0 - 0xFF */
6334   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6335   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6336   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6337   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6338   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6339   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6340   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6341   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6342
6343   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6344   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6345   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6346   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6347   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6348   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6349   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6350   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1}
6351};
6352
6353/* prefix 4D */
6354static const struct opcode_s op4D_78c06[256] =
6355{
6356   /* 0x00 - 0x1F */
6357   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6358   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6359   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6360   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6361   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6362   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6363   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6364   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6365
6366   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6367   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6368   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6369   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6370   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6371   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6372   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6373   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6374
6375   /* 0x20 - 0x3F */
6376   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6377   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6378   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6379   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6380   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6381   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6382   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6383   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6384
6385   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6386   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6387   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6388   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6389   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6390   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6391   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6392   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6393
6394   /* 0x40 - 0x5F */
6395   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6396   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6397   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6398   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6399   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6400   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6401   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6402   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6403
6404   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6405   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6406   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6407   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6408   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6409   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6410   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6411   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6412
6413   /* 0x60 - 0x7F */
6414   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6415   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6416   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6417   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6418   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6419   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6420   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6421   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6422
6423   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6424   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6425   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6426   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6427   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6428   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6429   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6430   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6431
6432   /* 0x80 - 0x9F */
6433   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6434   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6435   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6436   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6437   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6438   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6439   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6440   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6441
6442   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6443   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6444   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6445   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6446   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6447   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6448   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6449   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6450
6451   /* 0xA0 - 0xBF */
6452   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6453   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6454   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6455   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6456   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6457   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6458   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6459   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6460
6461   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6462   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6463   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6464   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6465   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6466   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6467   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6468   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6469
6470   /* 0xC0 - 0xDF */
6471   {MOV_PA_A,      2,14,14,L0|L1},   {MOV_PB_A,      2,14,14,L0|L1},
6472   {MOV_PC_A,      2,14,14,L0|L1},   {MOV_MKL_A,      2,14,14,L0|L1},
6473   {MOV_MB_A,      2,14,14,L0|L1},   {MOV_MC_A,      2,14,14,L0|L1},
6474   {MOV_TM0_A,    2,14,14,L0|L1},   {MOV_TM1_A,    2,14,14,L0|L1},
6475   {MOV_S_A,      2,14,14,L0|L1},   {MOV_TMM_A,      2,14,14,L0|L1},
6476   {illegal2,      2,12,12,L0|L1},   {illegal2,      2,12,12,L0|L1},
6477   {illegal2,      2,12,12,L0|L1},   {illegal2,      2,12,12,L0|L1},
6478   {illegal2,      2,12,12,L0|L1},   {illegal2,      2,12,12,L0|L1},
6479
6480   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6481   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6482   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6483   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6484   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6485   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6486   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6487   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6488
6489   /* 0xE0 - 0xFF */
6490   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6491   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6492   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6493   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6494   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6495   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6496   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6497   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6498
6499   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6500   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6501   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6502   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6503   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6504   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6505   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6506   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1}
6507};
6508
6509/* prefix 60 */
6510static const struct opcode_s op60_78c06[256] =
6511{
6512   /* 0x00 - 0x1F */
6513   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6514   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6515   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6516   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6517   {illegal2,      2,12,12,L0|L1},   {ANA_A_A,      2,12,12,L0|L1},
6518   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6519   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6520   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6521
6522   {illegal2,      2,12,12,L0|L1},   {XRA_A_A,      2,12,12,L0|L1},
6523   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6524   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6525   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6526   {illegal2,      2,12,12,L0|L1},   {ORA_A_A,      2,12,12,L0|L1},
6527   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6528   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6529   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6530
6531   /* 0x20 - 0x3F */
6532   {illegal2,      2,12,12,L0|L1},   {ADDNC_A_A,    2,12,12,L0|L1},
6533   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6534   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6535   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6536   {illegal2,      2,12,12,L0|L1},   {GTA_A_A,      2,12,12,L0|L1},
6537   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6538   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6539   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6540
6541   {illegal2,      2,12,12,L0|L1},   {SUBNB_A_A,    2,12,12,L0|L1},
6542   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6543   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6544   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6545   {illegal2,      2,12,12,L0|L1},   {LTA_A_A,      2,12,12,L0|L1},
6546   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6547   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6548   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6549
6550   /* 0x40 - 0x5F */
6551   {illegal2,      2,12,12,L0|L1},   {ADD_A_A,      2,12,12,L0|L1},
6552   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6553   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6554   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6555   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6556   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6557   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6558   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6559
6560   {illegal2,      2,12,12,L0|L1},   {ADC_A_A,      2,12,12,L0|L1},
6561   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6562   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6563   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6564   {illegal2,      2,12,12,L0|L1},   {illegal2,      2,12,12,L0|L1},
6565   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6566   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6567   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6568
6569   /* 0x60 - 0x7F */
6570   {illegal2,      2, 8, 8,L0|L1},   {SUB_A_A,      2,12,12,L0|L1},
6571   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6572   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6573   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6574   {illegal2,      2,12,12,L0|L1},   {NEA_A_A,      2,12,12,L0|L1},
6575   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6576   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6577   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6578
6579   {illegal2,      2,12,12,L0|L1},   {SBB_A_A,      2,12,12,L0|L1},
6580   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6581   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6582   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6583   {illegal2,      2,12,12,L0|L1},   {EQA_A_A,      2,12,12,L0|L1},
6584   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6585   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6586   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6587
6588   /* 0x80 - 0x9F */
6589   {illegal2,      2,12,12,L0|L1},   {illegal2,      2,12,12,L0|L1},
6590   {illegal2,      2,12,12,L0|L1},   {illegal2,      2,12,12,L0|L1},
6591   {illegal2,      2,12,12,L0|L1},   {illegal2,      2,12,12,L0|L1},
6592   {illegal2,      2,12,12,L0|L1},   {illegal2,      2,12,12,L0|L1},
6593   {illegal2,      2,12,12,L0|L1},   {ANA_A_A,      2,12,12,L0|L1},
6594   {ANA_A_B,      2,12,12,L0|L1},   {ANA_A_C,      2,12,12,L0|L1},
6595   {ANA_A_D,      2,12,12,L0|L1},   {ANA_A_E,      2,12,12,L0|L1},
6596   {ANA_A_H,      2,12,12,L0|L1},   {ANA_A_L,      2,12,12,L0|L1},
6597
6598   {illegal2,      2,12,12,L0|L1},   {XRA_A_A,      2,12,12,L0|L1},
6599   {XRA_A_B,      2,12,12,L0|L1},   {XRA_A_C,      2,12,12,L0|L1},
6600   {XRA_A_D,      2,12,12,L0|L1},   {XRA_A_E,      2,12,12,L0|L1},
6601   {XRA_A_H,      2,12,12,L0|L1},   {XRA_A_L,      2,12,12,L0|L1},
6602   {illegal2,      2,12,12,L0|L1},   {ORA_A_A,      2,12,12,L0|L1},
6603   {ORA_A_B,      2,12,12,L0|L1},   {ORA_A_C,      2,12,12,L0|L1},
6604   {ORA_A_D,      2,12,12,L0|L1},   {ORA_A_E,      2,12,12,L0|L1},
6605   {ORA_A_H,      2,12,12,L0|L1},   {ORA_A_L,      2,12,12,L0|L1},
6606
6607   /* 0xA0 - 0xBF */
6608   {illegal2,      2,12,12,L0|L1},   {ADDNC_A_A,    2,12,12,L0|L1},
6609   {ADDNC_A_B,    2,12,12,L0|L1},   {ADDNC_A_C,    2,12,12,L0|L1},
6610   {ADDNC_A_D,    2,12,12,L0|L1},   {ADDNC_A_E,    2,12,12,L0|L1},
6611   {ADDNC_A_H,    2,12,12,L0|L1},   {ADDNC_A_L,    2,12,12,L0|L1},
6612   {illegal2,      2,12,12,L0|L1},   {GTA_A_A,      2,12,12,L0|L1},
6613   {GTA_A_B,      2,12,12,L0|L1},   {GTA_A_C,      2,12,12,L0|L1},
6614   {GTA_A_D,      2,12,12,L0|L1},   {GTA_A_E,      2,12,12,L0|L1},
6615   {GTA_A_H,      2,12,12,L0|L1},   {GTA_A_L,      2,12,12,L0|L1},
6616
6617   {illegal2,      2,12,12,L0|L1},   {SUBNB_A_A,    2,12,12,L0|L1},
6618   {SUBNB_A_B,    2,12,12,L0|L1},   {SUBNB_A_C,    2,12,12,L0|L1},
6619   {SUBNB_A_D,    2,12,12,L0|L1},   {SUBNB_A_E,    2,12,12,L0|L1},
6620   {SUBNB_A_H,    2,12,12,L0|L1},   {SUBNB_A_L,    2,12,12,L0|L1},
6621   {illegal2,      2,12,12,L0|L1},   {LTA_A_A,      2,12,12,L0|L1},
6622   {LTA_A_B,      2,12,12,L0|L1},   {LTA_A_C,      2,12,12,L0|L1},
6623   {LTA_A_D,      2,12,12,L0|L1},   {LTA_A_E,      2,12,12,L0|L1},
6624   {LTA_A_H,      2,12,12,L0|L1},   {LTA_A_L,      2,12,12,L0|L1},
6625
6626   /* 0xC0 - 0xDF */
6627   {illegal2,      2,12,12,L0|L1},   {ADD_A_A,      2,12,12,L0|L1},
6628   {ADD_A_B,      2,12,12,L0|L1},   {ADD_A_C,      2,12,12,L0|L1},
6629   {ADD_A_D,      2,12,12,L0|L1},   {ADD_A_E,      2,12,12,L0|L1},
6630   {ADD_A_H,      2,12,12,L0|L1},   {ADD_A_L,      2,12,12,L0|L1},
6631   {illegal2,      2,12,12,L0|L1},   {ONA_A_A,      2,12,12,L0|L1},
6632   {ONA_A_B,      2,12,12,L0|L1},   {ONA_A_C,      2,12,12,L0|L1},
6633   {ONA_A_D,      2,12,12,L0|L1},   {ONA_A_E,      2,12,12,L0|L1},
6634   {ONA_A_H,      2,12,12,L0|L1},   {ONA_A_L,      2,12,12,L0|L1},
6635
6636   {illegal2,      2,12,12,L0|L1},   {ADC_A_A,      2,12,12,L0|L1},
6637   {ADC_A_B,      2,12,12,L0|L1},   {ADC_A_C,      2,12,12,L0|L1},
6638   {ADC_A_D,      2,12,12,L0|L1},   {ADC_A_E,      2,12,12,L0|L1},
6639   {ADC_A_H,      2,12,12,L0|L1},   {ADC_A_L,      2,12,12,L0|L1},
6640   {illegal2,      2,12,12,L0|L1},   {OFFA_A_A,      2,12,12,L0|L1},
6641   {OFFA_A_B,      2,12,12,L0|L1},   {OFFA_A_C,      2,12,12,L0|L1},
6642   {OFFA_A_D,      2,12,12,L0|L1},   {OFFA_A_E,      2,12,12,L0|L1},
6643   {OFFA_A_H,      2,12,12,L0|L1},   {OFFA_A_L,      2,12,12,L0|L1},
6644
6645   /* 0xE0 - 0xFF */
6646   {illegal2,      2,12,12,L0|L1},   {SUB_A_A,      2,12,12,L0|L1},
6647   {SUB_A_B,      2,12,12,L0|L1},   {SUB_A_C,      2,12,12,L0|L1},
6648   {SUB_A_D,      2,12,12,L0|L1},   {SUB_A_E,      2,12,12,L0|L1},
6649   {SUB_A_H,      2,12,12,L0|L1},   {SUB_A_L,      2,12,12,L0|L1},
6650   {illegal2,      2,12,12,L0|L1},   {NEA_A_A,      2,12,12,L0|L1},
6651   {NEA_A_B,      2,12,12,L0|L1},   {NEA_A_C,      2,12,12,L0|L1},
6652   {NEA_A_D,      2,12,12,L0|L1},   {NEA_A_E,      2,12,12,L0|L1},
6653   {NEA_A_H,      2,12,12,L0|L1},   {NEA_A_L,      2,12,12,L0|L1},
6654
6655   {illegal2,      2,12,12,L0|L1},   {SBB_A_A,      2,12,12,L0|L1},
6656   {SBB_A_B,      2,12,12,L0|L1},   {SBB_A_C,      2,12,12,L0|L1},
6657   {SBB_A_D,      2,12,12,L0|L1},   {SBB_A_E,      2,12,12,L0|L1},
6658   {SBB_A_H,      2,12,12,L0|L1},   {SBB_A_L,      2,12,12,L0|L1},
6659   {illegal2,      2,12,12,L0|L1},   {EQA_A_A,      2,12,12,L0|L1},
6660   {EQA_A_B,      2,12,12,L0|L1},   {EQA_A_C,      2,12,12,L0|L1},
6661   {EQA_A_D,      2,12,12,L0|L1},   {EQA_A_E,      2,12,12,L0|L1},
6662   {EQA_A_H,      2,12,12,L0|L1},   {EQA_A_L,      2,12,12,L0|L1}
6663};
6664
6665/* prefix 64 */
6666static const struct opcode_s op64_78c06[256] =
6667{
6668   /* 0x00 - 0x1F */
6669   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6670   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6671   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6672   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6673   {illegal2,      2,12,12,L0|L1},   {ANI_A_xx,      3,17,17,L0|L1},
6674   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6675   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6676   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6677
6678   {illegal2,      2,12,12,L0|L1},   {XRI_A_xx,      3,17,17,L0|L1},
6679   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6680   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6681   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6682   {illegal2,      2,12,12,L0|L1},   {ORI_A_xx,      3,17,17,L0|L1},
6683   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6684   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6685   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6686
6687   /* 0x20 - 0x3F */
6688   {illegal2,      2,12,12,L0|L1},   {ADINC_A_xx,   3,17,17,L0|L1},
6689   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6690   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6691   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6692   {illegal2,      2,12,12,L0|L1},   {GTI_A_xx,      3,17,17,L0|L1},
6693   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6694   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6695   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6696
6697   {illegal2,      2,12,12,L0|L1},   {SUINB_A_xx,   3,17,17,L0|L1},
6698   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6699   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6700   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6701   {illegal2,      3,12,12,L0|L1},   {LTI_A_xx,      3,17,17,L0|L1},
6702   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6703   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6704   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6705
6706   /* 0x40 - 0x5F */
6707   {illegal2,      2,12,12,L0|L1},   {ADI_A_xx,      3,17,17,L0|L1},
6708   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6709   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6710   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6711   {illegal2,      2,12,12,L0|L1},   {ONI_A_xx,      3,17,17,L0|L1},
6712   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6713   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6714   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6715
6716   {illegal2,      3,12,12,L0|L1},   {ACI_A_xx,      3,17,17,L0|L1},
6717   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6718   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6719   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6720   {illegal2,      3,12,12,L0|L1},   {OFFI_A_xx,      3,17,17,L0|L1},
6721   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6722   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6723   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6724
6725   /* 0x60 - 0x7F */
6726   {illegal2,      2,12,12,L0|L1},   {SUI_A_xx,      3,17,17,L0|L1},
6727   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6728   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6729   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6730   {illegal2,      2,12,12,L0|L1},   {NEI_A_xx,      3,17,17,L0|L1},
6731   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6732   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6733   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6734
6735   {illegal2,      2,12,12,L0|L1},   {SBI_A_xx,      3,17,17,L0|L1},
6736   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6737   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6738   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6739   {illegal2,      2,12,12,L0|L1},   {EQI_A_xx,      3,17,17,L0|L1},
6740   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6741   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6742   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6743
6744   /* 0x80 - 0x9F */
6745   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6746   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6747   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6748   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6749   {ANI_PA_xx,      3,23,23,L0|L1},   {ANI_PB_xx,      3,23,23,L0|L1},
6750   {ANI_PC_xx,      3,23,23,L0|L1},   {ANI_MKL_xx,   3,23,23,L0|L1},
6751   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6752   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6753
6754   {XRI_PA_xx,      3,23,23,L0|L1},   {XRI_PB_xx,      3,23,23,L0|L1},
6755   {XRI_PC_xx,      3,23,23,L0|L1},   {XRI_MKL_xx,   3,23,23,L0|L1},
6756   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6757   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6758   {ORI_PA_xx,      3,23,23,L0|L1},   {ORI_PB_xx,      3,23,23,L0|L1},
6759   {ORI_PC_xx,      3,23,23,L0|L1},   {ORI_MKL_xx,   3,23,23,L0|L1},
6760   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6761   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6762
6763   /* 0xA0 - 0xBF */
6764   {ADINC_PA_xx,   3,23,23,L0|L1},   {ADINC_PB_xx,   3,23,23,L0|L1},
6765   {ADINC_PC_xx,   3,23,23,L0|L1},   {ADINC_MKL_xx,   3,23,23,L0|L1},
6766   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6767   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6768   {GTI_PA_xx,      3,20,20,L0|L1},   {GTI_PB_xx,      3,20,20,L0|L1},
6769   {GTI_PC_xx,      3,20,20,L0|L1},   {GTI_MKL_xx,   3,20,20,L0|L1},
6770   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6771   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6772
6773   {SUINB_PA_xx,   3,23,23,L0|L1},   {SUINB_PB_xx,   3,23,23,L0|L1},
6774   {SUINB_PC_xx,   3,23,23,L0|L1},   {SUINB_MKL_xx,   3,23,23,L0|L1},
6775   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6776   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6777   {LTI_PA_xx,      3,20,20,L0|L1},   {LTI_PB_xx,      3,20,20,L0|L1},
6778   {LTI_PC_xx,      3,20,20,L0|L1},   {LTI_MKL_xx,   3,20,20,L0|L1},
6779   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6780   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6781
6782   /* 0xC0 - 0xDF */
6783   {ADI_PA_xx,      3,23,23,L0|L1},   {ADI_PB_xx,      3,23,23,L0|L1},
6784   {ADI_PC_xx,      3,23,23,L0|L1},   {ADI_MKL_xx,   3,23,23,L0|L1},
6785   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6786   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6787   {ONI_PA_xx,      3,20,20,L0|L1},   {ONI_PB_xx,      3,20,20,L0|L1},
6788   {ONI_PC_xx,      3,20,20,L0|L1},   {ONI_MKL_xx,   3,20,20,L0|L1},
6789   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6790   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6791
6792   {ACI_PA_xx,      3,23,23,L0|L1},   {ACI_PB_xx,      3,23,23,L0|L1},
6793   {ACI_PC_xx,      3,23,23,L0|L1},   {ACI_MKL_xx,   3,23,23,L0|L1},
6794   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6795   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6796   {OFFI_PA_xx,   3,20,20,L0|L1},   {OFFI_PB_xx,   3,20,20,L0|L1},
6797   {OFFI_PC_xx,   3,20,20,L0|L1},   {OFFI_MKL_xx,   3,20,20,L0|L1},
6798   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6799   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6800
6801   /* 0xE0 - 0xFF */
6802   {SUI_PA_xx,      3,23,23,L0|L1},   {SUI_PB_xx,      3,23,23,L0|L1},
6803   {SUI_PC_xx,      3,23,23,L0|L1},   {SUI_MKL_xx,   3,23,23,L0|L1},
6804   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6805   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6806   {NEI_PA_xx,      3,20,20,L0|L1},   {NEI_PB_xx,      3,20,20,L0|L1},
6807   {NEI_PC_xx,      3,20,20,L0|L1},   {NEI_MKL_xx,   3,20,20,L0|L1},
6808   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6809   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6810
6811   {SBI_PA_xx,      3,23,23,L0|L1},   {SBI_PB_xx,      3,23,23,L0|L1},
6812   {SBI_PC_xx,      3,23,23,L0|L1},   {SBI_MKL_xx,   3,23,23,L0|L1},
6813   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6814   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6815   {EQI_PA_xx,      3,20,20,L0|L1},   {EQI_PB_xx,      3,20,20,L0|L1},
6816   {EQI_PC_xx,      3,20,20,L0|L1},   {EQI_MKL_xx,   3,20,20,L0|L1},
6817   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6818   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1}
6819};
6820
6821/* prefix 70 */
6822static const struct opcode_s op70_78c06[256] =
6823{
6824   /* 0x00 - 0x1F */
6825   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6826   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6827   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6828   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6829   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6830   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6831   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6832   {SSPD_w,      4,28,28,L0|L1},   {LSPD_w,      4,28,28,L0|L1},
6833
6834   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6835   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6836   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6837   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6838   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6839   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6840   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6841   {SBCD_w,      4,28,28,L0|L1},   {LBCD_w,      4,28,28,L0|L1},
6842
6843   /* 0x20 - 0x3F */
6844   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6845   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6846   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6847   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6848   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6849   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6850   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6851   {SDED_w,      4,28,28,L0|L1},   {LDED_w,      4,28,28,L0|L1},
6852
6853   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6854   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6855   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6856   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6857   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6858   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6859   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6860   {SHLD_w,      4,28,28,L0|L1},   {LHLD_w,      4,28,28,L0|L1},
6861
6862   /* 0x40 - 0x5F */
6863   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6864   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6865   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6866   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6867   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6868   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6869   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6870   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6871
6872   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6873   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6874   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6875   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6876   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6877   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6878   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6879   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6880
6881   /* 0x60 - 0x7F */
6882   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6883   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6884   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6885   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6886   {illegal2,      2,12,12,L0|L1},   {MOV_A_w,      4,25,25,L0|L1},
6887   {MOV_B_w,      4,25,25,L0|L1},   {MOV_C_w,      4,25,25,L0|L1},
6888   {MOV_D_w,      4,25,25,L0|L1},   {MOV_E_w,      4,25,25,L0|L1},
6889   {MOV_H_w,      4,25,25,L0|L1},   {MOV_L_w,      4,25,25,L0|L1},
6890
6891   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6892   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6893   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6894   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6895   {illegal2,      2,12,12,L0|L1},   {MOV_w_A,      4,25,25,L0|L1},
6896   {MOV_w_B,      4,25,25,L0|L1},   {MOV_w_C,      4,25,25,L0|L1},
6897   {MOV_w_D,      4,25,25,L0|L1},   {MOV_w_E,      4,25,25,L0|L1},
6898   {MOV_w_H,      4,25,25,L0|L1},   {MOV_w_L,      4,25,25,L0|L1},
6899
6900   /* 0x80 - 0x9F */
6901   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6902   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6903   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6904   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6905   {illegal2,      2,12,12,L0|L1},   {ANAX_B,      2,15,15,L0|L1},
6906   {ANAX_D,      2,15,15,L0|L1},   {ANAX_H,      2,15,15,L0|L1},
6907   {ANAX_Dp,      2,15,15,L0|L1},   {ANAX_Hp,      2,15,15,L0|L1},
6908   {ANAX_Dm,      2,15,15,L0|L1},   {ANAX_Hm,      2,15,15,L0|L1},
6909
6910   {illegal2,      2,12,12,L0|L1},   {XRAX_B,      2,15,15,L0|L1},
6911   {XRAX_D,      2,15,15,L0|L1},   {XRAX_H,      2,15,15,L0|L1},
6912   {XRAX_Dp,      2,15,15,L0|L1},   {XRAX_Hp,      2,15,15,L0|L1},
6913   {XRAX_Dm,      2,15,15,L0|L1},   {XRAX_Hm,      2,15,15,L0|L1},
6914   {illegal2,      2,12,12,L0|L1},   {ORAX_B,      2,15,15,L0|L1},
6915   {ORAX_D,      2,15,15,L0|L1},   {ORAX_H,      2,15,15,L0|L1},
6916   {ORAX_Dp,      2,15,15,L0|L1},   {ORAX_Hp,      2,15,15,L0|L1},
6917   {ORAX_Dm,      2,15,15,L0|L1},   {ORAX_Hm,      2,15,15,L0|L1},
6918
6919   /* 0xA0 - 0xBF */
6920   {illegal2,      2,12,12,L0|L1},   {ADDNCX_B,      2,15,15,L0|L1},
6921   {ADDNCX_D,      2,15,15,L0|L1},   {ADDNCX_H,      2,15,15,L0|L1},
6922   {ADDNCX_Dp,    2,15,15,L0|L1},   {ADDNCX_Hp,    2,15,15,L0|L1},
6923   {ADDNCX_Dm,    2,15,15,L0|L1},   {ADDNCX_Hm,    2,15,15,L0|L1},
6924   {illegal2,      2,12,12,L0|L1},   {GTAX_B,      2,15,15,L0|L1},
6925   {GTAX_D,      2,15,15,L0|L1},   {GTAX_H,      2,15,15,L0|L1},
6926   {GTAX_Dp,      2,15,15,L0|L1},   {GTAX_Hp,      2,15,15,L0|L1},
6927   {GTAX_Dm,      2,15,15,L0|L1},   {GTAX_Hm,      2,15,15,L0|L1},
6928
6929   {illegal2,      2,12,12,L0|L1},   {SUBNBX_B,      2,15,15,L0|L1},
6930   {SUBNBX_D,      2,15,15,L0|L1},   {SUBNBX_H,      2,15,15,L0|L1},
6931   {SUBNBX_Dp,    2,15,15,L0|L1},   {SUBNBX_Hp,    2,15,15,L0|L1},
6932   {SUBNBX_Dm,    2,15,15,L0|L1},   {SUBNBX_Hm,    2,15,15,L0|L1},
6933   {illegal2,      2,12,12,L0|L1},   {LTAX_B,      2,15,15,L0|L1},
6934   {LTAX_D,      2,15,15,L0|L1},   {LTAX_H,      2,15,15,L0|L1},
6935   {LTAX_Dp,      2,15,15,L0|L1},   {LTAX_Hp,      2,15,15,L0|L1},
6936   {LTAX_Dm,      2,15,15,L0|L1},   {LTAX_Hm,      2,15,15,L0|L1},
6937
6938   /* 0xC0 - 0xDF */
6939   {illegal2,      2,12,12,L0|L1},   {ADDX_B,      2,15,15,L0|L1},
6940   {ADDX_D,      2,15,15,L0|L1},   {ADDX_H,      2,15,15,L0|L1},
6941   {ADDX_Dp,      2,15,15,L0|L1},   {ADDX_Hp,      2,15,15,L0|L1},
6942   {ADDX_Dm,      2,15,15,L0|L1},   {ADDX_Hm,      2,15,15,L0|L1},
6943   {illegal2,      2,12,12,L0|L1},   {ONAX_B,      2,15,15,L0|L1},
6944   {ONAX_D,      2,15,15,L0|L1},   {ONAX_H,      2,15,15,L0|L1},
6945   {ONAX_Dp,      2,15,15,L0|L1},   {ONAX_Hp,      2,15,15,L0|L1},
6946   {ONAX_Dm,      2,15,15,L0|L1},   {ONAX_Hm,      2,15,15,L0|L1},
6947
6948   {illegal2,      2,12,12,L0|L1},   {ADCX_B,      2,15,15,L0|L1},
6949   {ADCX_D,      2,15,15,L0|L1},   {ADCX_H,      2,15,15,L0|L1},
6950   {ADCX_Dp,      2,15,15,L0|L1},   {ADCX_Hp,      2,15,15,L0|L1},
6951   {ADCX_Dm,      2,15,15,L0|L1},   {ADCX_Hm,      2,15,15,L0|L1},
6952   {illegal2,      2,12,12,L0|L1},   {OFFAX_B,      2,15,15,L0|L1},
6953   {OFFAX_D,      2,15,15,L0|L1},   {OFFAX_H,      2,15,15,L0|L1},
6954   {OFFAX_Dp,      2,15,15,L0|L1},   {OFFAX_Hp,      2,15,15,L0|L1},
6955   {OFFAX_Dm,      2,15,15,L0|L1},   {OFFAX_Hm,      2,15,15,L0|L1},
6956
6957   /* 0xE0 - 0xFF */
6958   {illegal2,      2,12,12,L0|L1},   {SUBX_B,      2,15,15,L0|L1},
6959   {SUBX_D,      2,15,15,L0|L1},   {SUBX_H,      2,15,15,L0|L1},
6960   {SUBX_Dp,      2,15,15,L0|L1},   {SUBX_Hp,      2,15,15,L0|L1},
6961   {SUBX_Dm,      2,15,15,L0|L1},   {SUBX_Hm,      2,15,15,L0|L1},
6962   {illegal2,      2,12,12,L0|L1},   {NEAX_B,      2,15,15,L0|L1},
6963   {NEAX_D,      2,15,15,L0|L1},   {NEAX_H,      2,15,15,L0|L1},
6964   {NEAX_Dp,      2,15,15,L0|L1},   {NEAX_Hp,      2,15,15,L0|L1},
6965   {NEAX_Dm,      2,15,15,L0|L1},   {NEAX_Hm,      2,15,15,L0|L1},
6966
6967   {illegal2,      2,12,12,L0|L1},   {SBBX_B,      2,15,15,L0|L1},
6968   {SBBX_D,      2,15,15,L0|L1},   {SBBX_H,      2,15,15,L0|L1},
6969   {SBBX_Dp,      2,15,15,L0|L1},   {SBBX_Hp,      2,15,15,L0|L1},
6970   {SBBX_Dm,      2,15,15,L0|L1},   {SBBX_Hm,      2,15,15,L0|L1},
6971   {illegal2,      2,12,12,L0|L1},   {EQAX_B,      2,15,15,L0|L1},
6972   {EQAX_D,      2,15,15,L0|L1},   {EQAX_H,      2,15,15,L0|L1},
6973   {EQAX_Dp,      2,15,15,L0|L1},   {EQAX_Hp,      2,15,15,L0|L1},
6974   {EQAX_Dm,      2,15,15,L0|L1},   {EQAX_Hm,      2,15,15,L0|L1}
6975};
6976
6977/* prefix 74 */
6978static const struct opcode_s op74_78c06[256] =
6979{
6980   /* 0x00 - 0x1F */
6981   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6982   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6983   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6984   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6985   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6986   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6987   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6988   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6989
6990   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6991   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6992   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6993   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6994   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6995   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6996   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6997   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
6998
6999   /* 0x20 - 0x3F */
7000   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7001   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7002   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7003   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7004   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7005   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7006   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7007   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7008
7009   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7010   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7011   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7012   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7013   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7014   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7015   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7016   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7017
7018   /* 0x40 - 0x5F */
7019   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7020   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7021   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7022   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7023   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7024   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7025   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7026   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7027
7028   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7029   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7030   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7031   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7032   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7033   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7034   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7035   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7036
7037   /* 0x60 - 0x7F */
7038   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7039   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7040   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7041   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7042   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7043   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7044   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7045   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7046
7047   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7048   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7049   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7050   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7051   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7052   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7053   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7054   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7055
7056   /* 0x80 - 0x9F */
7057   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7058   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7059   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7060   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7061   {ANAW_wa,      3,14,14,L0|L1},   {illegal2,      2,12,12,L0|L1},
7062   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7063   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7064   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7065
7066   {XRAW_wa,      3,14,14,L0|L1},   {illegal2,      2,12,12,L0|L1},
7067   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7068   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7069   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7070   {ORAW_wa,      3,14,14,L0|L1},   {illegal2,      2,12,12,L0|L1},
7071   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7072   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7073   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7074
7075   /* 0xA0 - 0xBF */
7076   {ADDNCW_wa,    3,14,14,L0|L1},   {illegal2,      2,12,12,L0|L1},
7077   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7078   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7079   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7080   {GTAW_wa,      3,14,14,L0|L1},   {illegal2,      2,12,12,L0|L1},
7081   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7082   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7083   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7084
7085   {SUBNBW_wa,    3,14,14,L0|L1},   {illegal2,      2,12,12,L0|L1},
7086   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7087   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7088   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7089   {LTAW_wa,      3,14,14,L0|L1},   {illegal2,      2,12,12,L0|L1},
7090   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7091   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7092   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7093
7094   /* 0xC0 - 0xDF */
7095   {ADDW_wa,      3,14,14,L0|L1},   {illegal2,      2,12,12,L0|L1},
7096   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7097   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7098   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7099   {ONAW_wa,      3,14,14,L0|L1},   {illegal2,      2,12,12,L0|L1},
7100   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7101   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7102   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7103
7104   {ADCW_wa,      3,14,14,L0|L1},   {illegal2,      2,12,12,L0|L1},
7105   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7106   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7107   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7108   {OFFAW_wa,      3,14,14,L0|L1},   {illegal2,      2,12,12,L0|L1},
7109   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7110   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7111   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7112
7113   /* 0xE0 - 0xFF */
7114   {SUBW_wa,      3,14,14,L0|L1},   {illegal2,      2,12,12,L0|L1},
7115   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7116   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7117   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7118   {NEAW_wa,      3,14,14,L0|L1},   {illegal2,      2,12,12,L0|L1},
7119   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7120   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7121   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7122
7123   {SBBW_wa,      3,14,14,L0|L1},   {illegal2,      2,12,12,L0|L1},
7124   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7125   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7126   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7127   {EQAW_wa,      3,14,14,L0|L1},   {illegal2,      2,12,12,L0|L1},
7128   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7129   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1},
7130   {illegal2,       2,12,12,L0|L1},   {illegal2,       2,12,12,L0|L1}
7131};
7132
7133static const struct opcode_s opXX_78c06[256] =
7134{
7135   /* 0x00 - 0x1F */
7136   {NOP,         1, 6, 6,L0|L1},   {HALT,         1, 6, 6,L0|L1},
7137   {INX_SP,      1, 9, 9,L0|L1},   {DCX_SP,      1, 9, 9,L0|L1},
7138   {LXI_S_w,      3,16,16,L0|L1},   {ANIW_wa_xx,   3,22,22,L0|L1},
7139   {illegal,      1, 6, 6,L0|L1},   {ANI_A_xx,      2,11,11,L0|L1},
7140   {RET,         1,12,12,L0|L1},   {SIO,         1, 6, 6,L0|L1},
7141   {MOV_A_B,      1, 6, 6,L0|L1},   {MOV_A_C,      1, 6, 6,L0|L1},
7142   {MOV_A_D,      1, 6, 6,L0|L1},   {MOV_A_E,      1, 6, 6,L0|L1},
7143   {MOV_A_H,      1, 6, 6,L0|L1},   {MOV_A_L,      1, 6, 6,L0|L1},
7144
7145   {illegal,      1, 6, 6,L0|L1},   {illegal,      1, 6, 6,L0|L1},
7146   {INX_BC,      1, 9, 9,L0|L1},   {DCX_BC,      1, 9, 9,L0|L1},
7147   {LXI_B_w,      3,16,16,L0|L1},   {ORIW_wa_xx,   3,22,2,L0|L1},
7148   {XRI_A_xx,      2,11,11,L0|L1},   {ORI_A_xx,      2,11,11,L0|L1},
7149   {RETS,         1,12,12,L0|L1},   {STM,         1, 6, 6,L0|L1},
7150   {MOV_B_A,      1, 6, 6,L0|L1},   {MOV_C_A,      1, 6, 6,L0|L1},
7151   {MOV_D_A,      1, 6, 6,L0|L1},   {MOV_E_A,      1, 6, 6,L0|L1},
7152   {MOV_H_A,      1, 6, 6,L0|L1},   {MOV_L_A,      1, 6, 6,L0|L1},
7153
7154   /* 0x20 - 0x3F */
7155   {INRW_wa_7801,   2,17,17,L0|L1},   {illegal,      1, 4, 4,L0|L1},
7156   {INX_DE,      1, 9, 9,L0|L1},   {DCX_DE,      1, 9, 9,L0|L1},
7157   {LXI_D_w,      3,16,16,L0|L1},   {GTIW_wa_xx,   3,19,19,L0|L1},
7158   {ADINC_A_xx,   2,11,11,L0|L1},   {GTI_A_xx,      2,11,11,L0|L1},
7159   {LDAW_wa,      2,14,14,L0|L1},   {LDAX_B,      1, 9, 9,L0|L1},
7160   {LDAX_D,      1, 9, 9,L0|L1},   {LDAX_H,      1, 9, 9,L0|L1},
7161   {LDAX_Dp,      1, 9, 9,L0|L1},   {LDAX_Hp,      1, 9, 9,L0|L1},
7162   {LDAX_Dm,      1, 9, 9,L0|L1},   {LDAX_Hm,      1, 9, 9,L0|L1},
7163
7164   {DCRW_wa_7801,   2,17,17,L0|L1},   {illegal,      1, 4, 4,L0|L1},
7165   {INX_HL,      1, 9, 9,L0|L1},   {DCX_HL,      1, 9, 9,L0|L1},
7166   {LXI_H_w,      3,16,16,   L1},   {LTIW_wa_xx,   3,19,19,L0|L1},
7167   {SUINB_A_xx,   2,11,11,L0|L1},   {LTI_A_xx,      2,11,11,L0|L1},
7168   {STAW_wa,      2,14,14,L0|L1},   {STAX_B,      1, 9, 9,L0|L1},
7169   {STAX_D,      1, 9, 9,L0|L1},   {STAX_H,      1, 9, 9,L0|L1},
7170   {STAX_Dp,      1, 9, 9,L0|L1},   {STAX_Hp,      1, 9, 9,L0|L1},
7171   {STAX_Dm,      1, 9, 9,L0|L1},   {STAX_Hm,      1, 9, 9,L0|L1},
7172
7173   /* 0x40 - 0x5F */
7174   {illegal,      1, 6, 6,L0|L1},   {INR_A_7801,   1, 6, 6,L0|L1},
7175   {INR_B_7801,   1, 6, 6,L0|L1},   {INR_C_7801,   1, 6, 6,L0|L1},
7176   {CALL_w,      3,22,22,L0|L1},   {ONIW_wa_xx,   3,19,19,L0|L1},
7177   {ADI_A_xx,      2,11,11,L0|L1},   {ONI_A_xx,      2,11,11,L0|L1},
7178   {PRE_48,      1, 0, 0,L0|L1},   {illegal,      1, 6, 6,L0|L1},
7179   {illegal,      1, 6, 6,L0|L1},   {illegal,      1, 6, 6,L0|L1},
7180   {PRE_4C,      1, 0, 0,L0|L1},   {PRE_4D,      1, 0, 0,L0|L1},
7181   {JRE,         2,17,17,L0|L1},   {JRE,         2,17,17,L0|L1},
7182
7183   {illegal,      1, 6, 6,L0|L1},   {DCR_A_7801,    1, 6, 6,L0|L1},
7184   {DCR_B_7801,    1, 6, 6,L0|L1},   {DCR_C_7801,    1, 6, 6,L0|L1},
7185   {JMP_w,       3,16,16,L0|L1},   {OFFIW_wa_xx,   3,19,19,L0|L1},
7186   {ACI_A_xx,      2,11,11,L0|L1},   {OFFI_A_xx,    2,11,11,L0|L1},
7187   {illegal,      1, 6, 6,L0|L1},   {illegal,      1, 6, 6,L0|L1},
7188   {illegal,      1, 6, 6,L0|L1},   {illegal,      1, 6, 6,L0|L1},
7189   {illegal,      1, 6, 6,L0|L1},   {illegal,      1, 6, 6,L0|L1},
7190   {illegal,      1, 6, 6,L0|L1},   {illegal,      1, 6, 6,L0|L1},
7191
7192   /* 0x60 - 0x7F */
7193   {PRE_60,      1, 0, 0,L0|L1},   {DAA,         1, 6, 6,L0|L1},
7194   {RETI,         1,15,15,L0|L1},   {CALB,         2,13,13,L0|L1},
7195   {PRE_64,      1, 0, 0,L0|L1},   {NEIW_wa_xx,   3,19,19,L0|L1},
7196   {SUI_A_xx,      2,11,11,L0|L1},   {NEI_A_xx,      2,11,11,L0|L1},
7197   {illegal,      1, 6, 6,L0|L1},   {MVI_A_xx,      2,11,11,L0    },
7198   {MVI_B_xx,      2,11,11,L0|L1},   {MVI_C_xx,      2,11,11,L0|L1},
7199   {MVI_D_xx,      2,11,11,L0|L1},   {MVI_E_xx,      2,11,11,L0|L1},
7200   {MVI_H_xx,      2,11,11,L0|L1},   {MVI_L_xx,      2,11,11,   L1},
7201
7202   {PRE_70,      1, 0, 0,L0|L1},   {MVIW_wa_xx,   3,13,13,L0|L1},
7203   {SOFTI,       1,19,19,L0|L1},   {JB,         1, 6, 6,L0|L1},
7204   {PRE_74,      1, 0, 0,L0|L1},   {EQIW_wa_xx,   3,19,19,L0|L1},
7205   {SBI_A_xx,      2,11,11,L0|L1},   {EQI_A_xx,      2,11,11,L0|L1},
7206   {CALF,         2,17,17,L0|L1},   {CALF,         2,17,17,L0|L1},
7207   {CALF,         2,17,17,L0|L1},   {CALF,         2,17,17,L0|L1},
7208   {CALF,         2,17,17,L0|L1},   {CALF,         2,17,17,L0|L1},
7209   {CALF,         2,17,17,L0|L1},   {CALF,         2,17,17,L0|L1},
7210
7211   /* 0x80 - 0x9F */
7212   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
7213   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
7214   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
7215   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
7216   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
7217   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
7218   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
7219   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
7220
7221   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
7222   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
7223   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
7224   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
7225   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
7226   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
7227   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
7228   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
7229
7230   /* 0xA0 - 0xBF */
7231   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
7232   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
7233   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
7234   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
7235   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
7236   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
7237   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
7238   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
7239
7240   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
7241   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
7242   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
7243   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
7244   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
7245   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
7246   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
7247   {CALT_7801,      1,19,19,L0|L1},   {CALT_7801,      1,19,19,L0|L1},
7248
7249   /* 0xC0 - 0xDF */
7250   {JR,         1,12,12,L0|L1},   {JR,         1,12,12,L0|L1},
7251   {JR,         1,12,12,L0|L1},   {JR,         1,12,12,L0|L1},
7252   {JR,         1,12,12,L0|L1},   {JR,         1,12,12,L0|L1},
7253   {JR,         1,12,12,L0|L1},   {JR,         1,12,12,L0|L1},
7254   {JR,         1,12,12,L0|L1},   {JR,         1,12,12,L0|L1},
7255   {JR,         1,12,12,L0|L1},   {JR,         1,12,12,L0|L1},
7256   {JR,         1,12,12,L0|L1},   {JR,         1,12,12,L0|L1},
7257   {JR,         1,12,12,L0|L1},   {JR,         1,12,12,L0|L1},
7258
7259   {JR,         1,12,12,L0|L1},   {JR,         1,12,12,L0|L1},
7260   {JR,         1,12,12,L0|L1},   {JR,         1,12,12,L0|L1},
7261   {JR,         1,12,12,L0|L1},   {JR,         1,12,12,L0|L1},
7262   {JR,         1,12,12,L0|L1},   {JR,         1,12,12,L0|L1},
7263   {JR,         1,12,12,L0|L1},   {JR,         1,12,12,L0|L1},
7264   {JR,         1,12,12,L0|L1},   {JR,         1,12,12,L0|L1},
7265   {JR,         1,12,12,L0|L1},   {JR,         1,12,12,L0|L1},
7266   {JR,         1,12,12,L0|L1},   {JR,         1,12,12,L0|L1},
7267
7268   /* 0xE0 - 0xFF */
7269   {JR,         1,12,12,L0|L1},   {JR,         1,12,12,L0|L1},
7270   {JR,         1,12,12,L0|L1},   {JR,         1,12,12,L0|L1},
7271   {JR,         1,12,12,L0|L1},   {JR,         1,12,12,L0|L1},
7272   {JR,         1,12,12,L0|L1},   {JR,         1,12,12,L0|L1},
7273   {JR,         1,12,12,L0|L1},   {JR,         1,12,12,L0|L1},
7274   {JR,         1,12,12,L0|L1},   {JR,         1,12,12,L0|L1},
7275   {JR,         1,12,12,L0|L1},   {JR,         1,12,12,L0|L1},
7276   {JR,         1,12,12,L0|L1},   {JR,         1,12,12,L0|L1},
7277
7278   {JR,         1,12,12,L0|L1},   {JR,         1,12,12,L0|L1},
7279   {JR,         1,12,12,L0|L1},   {JR,         1,12,12,L0|L1},
7280   {JR,         1,12,12,L0|L1},   {JR,         1,12,12,L0|L1},
7281   {JR,         1,12,12,L0|L1},   {JR,         1,12,12,L0|L1},
7282   {JR,         1,12,12,L0|L1},   {JR,         1,12,12,L0|L1},
7283   {JR,         1,12,12,L0|L1},   {JR,         1,12,12,L0|L1},
7284   {JR,         1,12,12,L0|L1},   {JR,         1,12,12,L0|L1},
7285   {JR,         1,12,12,L0|L1},   {JR,         1,12,12,L0|L1}
7286};
src/emu/cpu/upd7810/7810dasm.c
r1771r1772
1313struct dasm_s {
1414   UINT8 token;
1515   const void *args;
16   UINT8 oplen;
17   UINT8 cycles;
1816};
1917
2018enum
r1771r1772
8179   EQI,
8280   EQIW,
8381   ESUB,
82   EX,      /* 7801 */
8483   EXA,
8584   EXH,
8685   EXX,
r1771r1772
9190   GTI,
9291   GTIW,
9392   HALT,
93   IN,      /* 7801 */
9494   INR,
9595   INRW,
9696   INX,
r1771r1772
141141   ORAX,
142142   ORI,
143143   ORIW,
144   OUT,   /* 7801 */
145   PER,   /* 7801 */
146   PEX,   /* 7801 */
144147   POP,
145148   PUSH,
146149   RET,
r1771r1772
158161   SDED,
159162   SETB,   /* 7807 */
160163   SHLD,
164   SIO,   /* 7801 */
161165   SK,
162166   SKIT,
163167   SKN,
r1771r1772
172176   STAX,
173177   STC,
174178   STEAX,
179   STM,   /* 7801 */
175180   STOP,
176181   SUB,
177182   SUBNB,
r1771r1772
254259   "EQI",
255260   "EQIW",
256261   "ESUB",
262   "EX",   /* 7801 */
257263   "EXA",
258264   "EXH",
259265   "EXX",
r1771r1772
264270   "GTI",
265271   "GTIW",
266272   "HALT",
273   "IN",   /* 7801 */
267274   "INR",
268275   "INRW",
269276   "INX",
r1771r1772
314321   "ORAX",
315322   "ORI",
316323   "ORIW",
324   "OUT",   /* 7801 */
325   "PER",   /* 7801 */
326   "PEX",   /* 7801 */
317327   "POP",
318328   "PUSH",
319329   "RET",
r1771r1772
331341   "SDED",
332342   "SETB",   /* 7807 */
333343   "SHLD",
344   "SIO",   /* 7801 */
334345   "SK",
335346   "SKIT",
336347   "SKN",
r1771r1772
345356   "STAX",
346357   "STC",
347358   "STEAX",
359   "STM",   /*7801 */
348360   "STOP",
349361   "SUB",
350362   "SUBNB",
r1771r1772
366378/* prefix 48 */
367379static const struct dasm_s dasm48_7810[256] =
368380{
369   {illegal,0,     2, 8}, /* 00: 0100 1000 0000 0000                      */
370   {SLRC,"A",       2, 8}, /* 01: 0100 1000 0000 0001                      */
371   {SLRC,"B",       2, 8}, /* 02: 0100 1000 0000 0010                      */
372   {SLRC,"C",       2, 8}, /* 03: 0100 1000 0000 0011                      */
373   {illegal,0,     2, 8}, /* 04: 0100 1000 0000 0100                      */
374   {SLLC,"A",       2, 8}, /* 05: 0100 1000 0000 0101                      */
375   {SLLC,"B",       2, 8}, /* 06: 0100 1000 0000 0110                      */
376   {SLLC,"C",       2, 8}, /* 07: 0100 1000 0000 0111                      */
377   {SK,"NV",        2, 8}, /* 08: 0100 1000 0000 1000                      */
378   {illegal,0,     2, 8}, /* 09: 0100 1000 0000 1001                      */
379   {SK,"CY",        2, 8}, /* 0a: 0100 1000 0000 1010                      */
380   {SK,"HC",        2, 8}, /* 0b: 0100 1000 0000 1011                      */
381   {SK,"Z",         2, 8}, /* 0c: 0100 1000 0000 1100                      */
382   {illegal,0,     2, 8}, /* 0d: 0100 1000 0000 1101                      */
383   {illegal,0,     2, 8}, /* 0e: 0100 1000 0000 1110                      */
384   {illegal,0,     2, 8}, /* 0f: 0100 1000 0000 1111                      */
381   {illegal,0     }, /* 00: 0100 1000 0000 0000                      */
382   {SLRC,"A"       }, /* 01: 0100 1000 0000 0001                      */
383   {SLRC,"B"       }, /* 02: 0100 1000 0000 0010                      */
384   {SLRC,"C"       }, /* 03: 0100 1000 0000 0011                      */
385   {illegal,0     }, /* 04: 0100 1000 0000 0100                      */
386   {SLLC,"A"       }, /* 05: 0100 1000 0000 0101                      */
387   {SLLC,"B"       }, /* 06: 0100 1000 0000 0110                      */
388   {SLLC,"C"       }, /* 07: 0100 1000 0000 0111                      */
389   {SK,"NV"        }, /* 08: 0100 1000 0000 1000                      */
390   {illegal,0     }, /* 09: 0100 1000 0000 1001                      */
391   {SK,"CY"        }, /* 0a: 0100 1000 0000 1010                      */
392   {SK,"HC"        }, /* 0b: 0100 1000 0000 1011                      */
393   {SK,"Z"         }, /* 0c: 0100 1000 0000 1100                      */
394   {illegal,0     }, /* 0d: 0100 1000 0000 1101                      */
395   {illegal,0     }, /* 0e: 0100 1000 0000 1110                      */
396   {illegal,0     }, /* 0f: 0100 1000 0000 1111                      */
385397
386   {illegal,0,     2, 8}, /* 10: 0100 1000 0001 0000                      */
387   {illegal,0,     2, 8}, /* 11: 0100 1000 0001 0001                      */
388   {illegal,0,     2, 8}, /* 12: 0100 1000 0001 0010                      */
389   {illegal,0,     2, 8}, /* 13: 0100 1000 0001 0011                      */
390   {illegal,0,     2, 8}, /* 14: 0100 1000 0001 0100                      */
391   {illegal,0,     2, 8}, /* 15: 0100 1000 0001 0101                      */
392   {illegal,0,     2, 8}, /* 16: 0100 1000 0001 0110                      */
393   {illegal,0,     2, 8}, /* 17: 0100 1000 0001 0111                      */
394   {SKN,"NV",       2, 8}, /* 18: 0100 1000 0001 1000                      */
395   {illegal,0,     2, 8}, /* 19: 0100 1000 0001 1001                      */
396   {SKN,"CY",       2, 8}, /* 1a: 0100 1000 0001 1010                      */
397   {SKN,"HC",       2, 8}, /* 1b: 0100 1000 0001 1011                      */
398   {SKN,"Z",        2, 8}, /* 1c: 0100 1000 0001 1100                      */
399   {illegal,0,     2, 8}, /* 1d: 0100 1000 0001 1101                      */
400   {illegal,0,     2, 8}, /* 1e: 0100 1000 0001 1110                      */
401   {illegal,0,     2, 8}, /* 1f: 0100 1000 0001 1111                      */
398   {illegal,0     }, /* 10: 0100 1000 0001 0000                      */
399   {illegal,0     }, /* 11: 0100 1000 0001 0001                      */
400   {illegal,0     }, /* 12: 0100 1000 0001 0010                      */
401   {illegal,0     }, /* 13: 0100 1000 0001 0011                      */
402   {illegal,0     }, /* 14: 0100 1000 0001 0100                      */
403   {illegal,0     }, /* 15: 0100 1000 0001 0101                      */
404   {illegal,0     }, /* 16: 0100 1000 0001 0110                      */
405   {illegal,0     }, /* 17: 0100 1000 0001 0111                      */
406   {SKN,"NV"       }, /* 18: 0100 1000 0001 1000                      */
407   {illegal,0     }, /* 19: 0100 1000 0001 1001                      */
408   {SKN,"CY"       }, /* 1a: 0100 1000 0001 1010                      */
409   {SKN,"HC"       }, /* 1b: 0100 1000 0001 1011                      */
410   {SKN,"Z"        }, /* 1c: 0100 1000 0001 1100                      */
411   {illegal,0     }, /* 1d: 0100 1000 0001 1101                      */
412   {illegal,0     }, /* 1e: 0100 1000 0001 1110                      */
413   {illegal,0     }, /* 1f: 0100 1000 0001 1111                      */
402414
403   {illegal,0,     2, 8}, /* 20: 0100 1000 0010 0000                      */
404   {SLR,"A",        2, 8}, /* 21: 0100 1000 0010 0001                      */
405   {SLR,"B",        2, 8}, /* 22: 0100 1000 0010 0010                      */
406   {SLR,"C",        2, 8}, /* 23: 0100 1000 0010 0011                      */
407   {illegal,0,     2, 8}, /* 24: 0100 1000 0010 0100                      */
408   {SLL,"A",        2, 8}, /* 25: 0100 1000 0010 0101                      */
409   {SLL,"B",        2, 8}, /* 26: 0100 1000 0010 0110                      */
410   {SLL,"C",        2, 8}, /* 27: 0100 1000 0010 0111                      */
411   {JEA,0,        2, 8}, /* 28: 0100 1000 0010 1000                      */
412   {CALB,0,       2,17}, /* 29: 0100 1000 0010 1001                      */
413   {CLC,0,        2, 8}, /* 2a: 0100 1000 0010 1010                      */
414   {STC,0,        2, 8}, /* 2b: 0100 1000 0010 1011                      */
415   {illegal,0,     2,32}, /* 2c: 0100 1000 0010 1100                      */
416   {MUL,"A",        2,32}, /* 2d: 0100 1000 0010 1101                      */
417   {MUL,"B",        2,32}, /* 2e: 0100 1000 0010 1110                      */
418   {MUL,"C",        2,32}, /* 2f: 0100 1000 0010 1111                      */
415   {illegal,0     }, /* 20: 0100 1000 0010 0000                      */
416   {SLR,"A"        }, /* 21: 0100 1000 0010 0001                      */
417   {SLR,"B"        }, /* 22: 0100 1000 0010 0010                      */
418   {SLR,"C"        }, /* 23: 0100 1000 0010 0011                      */
419   {illegal,0     }, /* 24: 0100 1000 0010 0100                      */
420   {SLL,"A"        }, /* 25: 0100 1000 0010 0101                      */
421   {SLL,"B"        }, /* 26: 0100 1000 0010 0110                      */
422   {SLL,"C"        }, /* 27: 0100 1000 0010 0111                      */
423   {JEA,0        }, /* 28: 0100 1000 0010 1000                      */
424   {CALB,0       }, /* 29: 0100 1000 0010 1001                      */
425   {CLC,0        }, /* 2a: 0100 1000 0010 1010                      */
426   {STC,0        }, /* 2b: 0100 1000 0010 1011                      */
427   {illegal,0     }, /* 2c: 0100 1000 0010 1100                      */
428   {MUL,"A"        }, /* 2d: 0100 1000 0010 1101                      */
429   {MUL,"B"        }, /* 2e: 0100 1000 0010 1110                      */
430   {MUL,"C"        }, /* 2f: 0100 1000 0010 1111                      */
419431
420   {illegal,0,     2, 8}, /* 30: 0100 1000 0011 0000                      */
421   {RLR,"A",        2, 8}, /* 31: 0100 1000 0011 0001                      */
422   {RLR,"B",        2, 8}, /* 32: 0100 1000 0011 0010                      */
423   {RLR,"C",        2, 8}, /* 33: 0100 1000 0011 0011                      */
424   {illegal,0,     2, 8}, /* 34: 0100 1000 0011 0100                      */
425   {RLL,"A",        2, 8}, /* 35: 0100 1000 0011 0101                      */
426   {RLL,"B",        2, 8}, /* 36: 0100 1000 0011 0110                      */
427   {RLL,"C",        2, 8}, /* 37: 0100 1000 0011 0111                      */
428   {RLD,0,        2,17}, /* 38: 0100 1000 0011 1000                      */
429   {RRD,0,        2,17}, /* 39: 0100 1000 0011 1001                      */
430   {NEGA,0,       2, 8}, /* 3a: 0100 1000 0011 1010                      */
431   {HALT,0,       2,12}, /* 3b: 0100 1000 0011 1011                      */
432   {illegal,0,     2,59}, /* 3c: 0100 1000 0011 1100                      */
433   {DIV,"A",        2,59}, /* 3d: 0100 1000 0011 1101                      */
434   {DIV,"B",        2,59}, /* 3e: 0100 1000 0011 1110                      */
435   {DIV,"C",        2,59}, /* 3f: 0100 1000 0011 1111                      */
432   {illegal,0     }, /* 30: 0100 1000 0011 0000                      */
433   {RLR,"A"        }, /* 31: 0100 1000 0011 0001                      */
434   {RLR,"B"        }, /* 32: 0100 1000 0011 0010                      */
435   {RLR,"C"        }, /* 33: 0100 1000 0011 0011                      */
436   {illegal,0     }, /* 34: 0100 1000 0011 0100                      */
437   {RLL,"A"        }, /* 35: 0100 1000 0011 0101                      */
438   {RLL,"B"        }, /* 36: 0100 1000 0011 0110                      */
439   {RLL,"C"        }, /* 37: 0100 1000 0011 0111                      */
440   {RLD,0        }, /* 38: 0100 1000 0011 1000                      */
441   {RRD,0        }, /* 39: 0100 1000 0011 1001                      */
442   {NEGA,0       }, /* 3a: 0100 1000 0011 1010                      */
443   {HALT,0       }, /* 3b: 0100 1000 0011 1011                      */
444   {illegal,0     }, /* 3c: 0100 1000 0011 1100                      */
445   {DIV,"A"        }, /* 3d: 0100 1000 0011 1101                      */
446   {DIV,"B"        }, /* 3e: 0100 1000 0011 1110                      */
447   {DIV,"C"        }, /* 3f: 0100 1000 0011 1111                      */
436448
437   {SKIT,"NMI",     2, 8}, /* 40: 0100 1000 0100 0000                      */
438   {SKIT,"FT0",     2, 8}, /* 41: 0100 1000 0100 0001                      */
439   {SKIT,"FT1",     2, 8}, /* 42: 0100 1000 0100 0010                      */
440   {SKIT,"F1",      2, 8}, /* 43: 0100 1000 0100 0011                      */
441   {SKIT,"F2",      2, 8}, /* 44: 0100 1000 0100 0100                      */
442   {SKIT,"FE0",     2, 8}, /* 45: 0100 1000 0100 0101                      */
443   {SKIT,"FE1",     2, 8}, /* 46: 0100 1000 0100 0110                      */
444   {SKIT,"FEIN",    2, 8}, /* 47: 0100 1000 0100 0111                      */
445   {SKIT,"FAD",     2, 8}, /* 48: 0100 1000 0100 1000                      */
446   {SKIT,"FSR",     2, 8}, /* 49: 0100 1000 0100 1001                      */
447   {SKIT,"FST",     2, 8}, /* 4a: 0100 1000 0100 1010                      */
448   {SKIT,"ER",      2, 8}, /* 4b: 0100 1000 0100 1011                      */
449   {SKIT,"OV",      2, 8}, /* 4c: 0100 1000 0100 1100                      */
450   {illegal,0,     2, 8}, /* 4d: 0100 1000 0100 1101                      */
451   {illegal,0,     2, 8}, /* 4e: 0100 1000 0100 1110                      */
452   {illegal,0,     2, 8}, /* 4f: 0100 1000 0100 1111                      */
449   {SKIT,"NMI"     }, /* 40: 0100 1000 0100 0000                      */
450   {SKIT,"FT0"     }, /* 41: 0100 1000 0100 0001                      */
451   {SKIT,"FT1"     }, /* 42: 0100 1000 0100 0010                      */
452   {SKIT,"F1"      }, /* 43: 0100 1000 0100 0011                      */
453   {SKIT,"F2"      }, /* 44: 0100 1000 0100 0100                      */
454   {SKIT,"FE0"     }, /* 45: 0100 1000 0100 0101                      */
455   {SKIT,"FE1"     }, /* 46: 0100 1000 0100 0110                      */
456   {SKIT,"FEIN"    }, /* 47: 0100 1000 0100 0111                      */
457   {SKIT,"FAD"     }, /* 48: 0100 1000 0100 1000                      */
458   {SKIT,"FSR"     }, /* 49: 0100 1000 0100 1001                      */
459   {SKIT,"FST"     }, /* 4a: 0100 1000 0100 1010                      */
460   {SKIT,"ER"      }, /* 4b: 0100 1000 0100 1011                      */
461   {SKIT,"OV"      }, /* 4c: 0100 1000 0100 1100                      */
462   {illegal,0     }, /* 4d: 0100 1000 0100 1101                      */
463   {illegal,0     }, /* 4e: 0100 1000 0100 1110                      */
464   {illegal,0     }, /* 4f: 0100 1000 0100 1111                      */
453465
454   {SKIT,"AN4",     2, 8}, /* 50: 0100 1000 0101 0000                      */
455   {SKIT,"AN5",     2, 8}, /* 51: 0100 1000 0101 0001                      */
456   {SKIT,"AN6",     2, 8}, /* 52: 0100 1000 0101 0010                      */
457   {SKIT,"AN7",     2, 8}, /* 53: 0100 1000 0101 0011                      */
458   {SKIT,"SB",      2, 8}, /* 54: 0100 1000 0101 0100                      */
459   {illegal,0,     2, 8}, /* 55: 0100 1000 0101 0101                      */
460   {illegal,0,     2, 8}, /* 56: 0100 1000 0101 0110                      */
461   {illegal,0,     2, 8}, /* 57: 0100 1000 0101 0111                      */
462   {illegal,0,     2, 8}, /* 58: 0100 1000 0101 1000                      */
463   {illegal,0,     2, 8}, /* 59: 0100 1000 0101 1001                      */
464   {illegal,0,     2, 8}, /* 5a: 0100 1000 0101 1010                      */
465   {illegal,0,     2, 8}, /* 5b: 0100 1000 0101 1011                      */
466   {illegal,0,     2, 8}, /* 5c: 0100 1000 0101 1100                      */
467   {illegal,0,     2, 8}, /* 5d: 0100 1000 0101 1101                      */
468   {illegal,0,     2, 8}, /* 5e: 0100 1000 0101 1110                      */
469   {illegal,0,     2, 8}, /* 5f: 0100 1000 0101 1111                      */
466   {SKIT,"AN4"     }, /* 50: 0100 1000 0101 0000                      */
467   {SKIT,"AN5"     }, /* 51: 0100 1000 0101 0001                      */
468   {SKIT,"AN6"     }, /* 52: 0100 1000 0101 0010                      */
469   {SKIT,"AN7"     }, /* 53: 0100 1000 0101 0011                      */
470   {SKIT,"SB"      }, /* 54: 0100 1000 0101 0100                      */
471   {illegal,0     }, /* 55: 0100 1000 0101 0101                      */
472   {illegal,0     }, /* 56: 0100 1000 0101 0110                      */
473   {illegal,0     }, /* 57: 0100 1000 0101 0111                      */
474   {illegal,0     }, /* 58: 0100 1000 0101 1000                      */
475   {illegal,0     }, /* 59: 0100 1000 0101 1001                      */
476   {illegal,0     }, /* 5a: 0100 1000 0101 1010                      */
477   {illegal,0     }, /* 5b: 0100 1000 0101 1011                      */
478   {illegal,0     }, /* 5c: 0100 1000 0101 1100                      */
479   {illegal,0     }, /* 5d: 0100 1000 0101 1101                      */
480   {illegal,0     }, /* 5e: 0100 1000 0101 1110                      */
481   {illegal,0     }, /* 5f: 0100 1000 0101 1111                      */
470482
471   {SKNIT,"NMI",    2, 8}, /* 60: 0100 1000 0110 0000                      */
472   {SKNIT,"FT0",    2, 8}, /* 61: 0100 1000 0110 0001                      */
473   {SKNIT,"FT1",    2, 8}, /* 62: 0100 1000 0110 0010                      */
474   {SKNIT,"F1",     2, 8}, /* 63: 0100 1000 0110 0011                      */
475   {SKNIT,"F2",     2, 8}, /* 64: 0100 1000 0110 0100                      */
476   {SKNIT,"FE0",    2, 8}, /* 65: 0100 1000 0110 0101                      */
477   {SKNIT,"FE1",    2, 8}, /* 66: 0100 1000 0110 0110                      */
478   {SKNIT,"FEIN",   2, 8}, /* 67: 0100 1000 0110 0111                      */
479   {SKNIT,"FAD",    2, 8}, /* 68: 0100 1000 0110 1000                      */
480   {SKNIT,"FSR",    2, 8}, /* 69: 0100 1000 0110 1001                      */
481   {SKNIT,"FST",    2, 8}, /* 6a: 0100 1000 0110 1010                      */
482   {SKNIT,"ER",     2, 8}, /* 6b: 0100 1000 0110 1011                      */
483   {SKNIT,"OV",     2, 8}, /* 6c: 0100 1000 0110 1100                      */
484   {illegal,0,     2, 8}, /* 6d: 0100 1000 0110 1101                      */
485   {illegal,0,     2, 8}, /* 6e: 0100 1000 0110 1110                      */
486   {illegal,0,     2, 8}, /* 6f: 0100 1000 0110 1111                      */
483   {SKNIT,"NMI"    }, /* 60: 0100 1000 0110 0000                      */
484   {SKNIT,"FT0"    }, /* 61: 0100 1000 0110 0001                      */
485   {SKNIT,"FT1"    }, /* 62: 0100 1000 0110 0010                      */
486   {SKNIT,"F1"     }, /* 63: 0100 1000 0110 0011                      */
487   {SKNIT,"F2"     }, /* 64: 0100 1000 0110 0100                      */
488   {SKNIT,"FE0"    }, /* 65: 0100 1000 0110 0101                      */
489   {SKNIT,"FE1"    }, /* 66: 0100 1000 0110 0110                      */
490   {SKNIT,"FEIN"   }, /* 67: 0100 1000 0110 0111                      */
491   {SKNIT,"FAD"    }, /* 68: 0100 1000 0110 1000                      */
492   {SKNIT,"FSR"    }, /* 69: 0100 1000 0110 1001                      */
493   {SKNIT,"FST"    }, /* 6a: 0100 1000 0110 1010                      */
494   {SKNIT,"ER"     }, /* 6b: 0100 1000 0110 1011                      */
495   {SKNIT,"OV"     }, /* 6c: 0100 1000 0110 1100                      */
496   {illegal,0     }, /* 6d: 0100 1000 0110 1101                      */
497   {illegal,0     }, /* 6e: 0100 1000 0110 1110                      */
498   {illegal,0     }, /* 6f: 0100 1000 0110 1111                      */
487499
488   {SKNIT,"AN4",    2, 8}, /* 70: 0100 1000 0111 0000                      */
489   {SKNIT,"AN5",    2, 8}, /* 71: 0100 1000 0111 0001                      */
490   {SKNIT,"AN6",    2, 8}, /* 72: 0100 1000 0111 0010                      */
491   {SKNIT,"AN7",    2, 8}, /* 73: 0100 1000 0111 0011                      */
492   {SKNIT,"SB",     2, 8}, /* 74: 0100 1000 0111 0100                      */
493   {illegal,0,     2, 8}, /* 75: 0100 1000 0111 0101                      */
494   {illegal,0,     2, 8}, /* 76: 0100 1000 0111 0110                      */
495   {illegal,0,     2, 8}, /* 77: 0100 1000 0111 0111                      */
496   {illegal,0,     2, 8}, /* 78: 0100 1000 0111 1000                      */
497   {illegal,0,     2, 8}, /* 79: 0100 1000 0111 1001                      */
498   {illegal,0,     2, 8}, /* 7a: 0100 1000 0111 1010                      */
499   {illegal,0,     2, 8}, /* 7b: 0100 1000 0111 1011                      */
500   {illegal,0,     2, 8}, /* 7c: 0100 1000 0111 1100                      */
501   {illegal,0,     2, 8}, /* 7d: 0100 1000 0111 1101                      */
502   {illegal,0,     2, 8}, /* 7e: 0100 1000 0111 1110                      */
503   {illegal,0,     2, 8}, /* 7f: 0100 1000 0111 1111                      */
500   {SKNIT,"AN4"    }, /* 70: 0100 1000 0111 0000                      */
501   {SKNIT,"AN5"    }, /* 71: 0100 1000 0111 0001                      */
502   {SKNIT,"AN6"    }, /* 72: 0100 1000 0111 0010                      */
503   {SKNIT,"AN7"    }, /* 73: 0100 1000 0111 0011                      */
504   {SKNIT,"SB"     }, /* 74: 0100 1000 0111 0100                      */
505   {illegal,0     }, /* 75: 0100 1000 0111 0101                      */
506   {illegal,0     }, /* 76: 0100 1000 0111 0110                      */
507   {illegal,0     }, /* 77: 0100 1000 0111 0111                      */
508   {illegal,0     }, /* 78: 0100 1000 0111 1000                      */
509   {illegal,0     }, /* 79: 0100 1000 0111 1001                      */
510   {illegal,0     }, /* 7a: 0100 1000 0111 1010                      */
511   {illegal,0     }, /* 7b: 0100 1000 0111 1011                      */
512   {illegal,0     }, /* 7c: 0100 1000 0111 1100                      */
513   {illegal,0     }, /* 7d: 0100 1000 0111 1101                      */
514   {illegal,0     }, /* 7e: 0100 1000 0111 1110                      */
515   {illegal,0     }, /* 7f: 0100 1000 0111 1111                      */
504516
505   {illegal,0,     2, 8}, /* 80: 0100 1000 1000 0000                      */
506   {illegal,0,     2, 8}, /* 81: 0100 1000 1000 0001                      */
507   {LDEAX,"(DE)",   2,14}, /* 82: 0100 1000 1000 0010                      */
508   {LDEAX,"(HL)",   2,14}, /* 83: 0100 1000 1000 0011                      */
509   {LDEAX,"(DE++)", 2,14}, /* 84: 0100 1000 1000 0100                      */
510   {LDEAX,"(HL++)", 2,14}, /* 85: 0100 1000 1000 0101                      */
511   {illegal,0,     2, 8}, /* 86: 0100 1000 1000 0110                      */
512   {illegal,0,     2, 8}, /* 87: 0100 1000 1000 0111                      */
513   {illegal,0,     2, 8}, /* 88: 0100 1000 1000 1000                      */
514   {illegal,0,     2, 8}, /* 89: 0100 1000 1000 1001                      */
515   {illegal,0,     2, 8}, /* 8a: 0100 1000 1000 1010                      */
516   {LDEAX,"(DE+%b)",3,20}, /* 8b: 0100 1000 1000 1011 xxxx xxxx            */
517   {LDEAX,"(HL+A)", 2,20}, /* 8c: 0100 1000 1000 1100                      */
518   {LDEAX,"(HL+B)", 2,20}, /* 8d: 0100 1000 1000 1101                      */
519   {LDEAX,"(HL+EA)",2,20}, /* 8e: 0100 1000 1000 1110                      */
520   {LDEAX,"(HL+%b)",3,20}, /* 8f: 0100 1000 1000 1111 xxxx xxxx            */
517   {illegal,0     }, /* 80: 0100 1000 1000 0000                      */
518   {illegal,0     }, /* 81: 0100 1000 1000 0001                      */
519   {LDEAX,"(DE)"   }, /* 82: 0100 1000 1000 0010                      */
520   {LDEAX,"(HL)"   }, /* 83: 0100 1000 1000 0011                      */
521   {LDEAX,"(DE++)" }, /* 84: 0100 1000 1000 0100                      */
522   {LDEAX,"(HL++)" }, /* 85: 0100 1000 1000 0101                      */
523   {illegal,0     }, /* 86: 0100 1000 1000 0110                      */
524   {illegal,0     }, /* 87: 0100 1000 1000 0111                      */
525   {illegal,0     }, /* 88: 0100 1000 1000 1000                      */
526   {illegal,0     }, /* 89: 0100 1000 1000 1001                      */
527   {illegal,0     }, /* 8a: 0100 1000 1000 1010                      */
528   {LDEAX,"(DE+%b)"}, /* 8b: 0100 1000 1000 1011 xxxx xxxx            */
529   {LDEAX,"(HL+A)" }, /* 8c: 0100 1000 1000 1100                      */
530   {LDEAX,"(HL+B)" }, /* 8d: 0100 1000 1000 1101                      */
531   {LDEAX,"(HL+EA)"}, /* 8e: 0100 1000 1000 1110                      */
532   {LDEAX,"(HL+%b)"}, /* 8f: 0100 1000 1000 1111 xxxx xxxx            */
521533
522   {illegal,0,     2, 8}, /* 90: 0100 1000 1000 0000                      */
523   {illegal,0,     2, 8}, /* 91: 0100 1000 1000 0001                      */
524   {STEAX,"(DE)",   2,14}, /* 92: 0100 1000 1000 0010                      */
525   {STEAX,"(HL)",   2,14}, /* 93: 0100 1000 1000 0011                      */
526   {STEAX,"(DE++)", 2,14}, /* 94: 0100 1000 1000 0100                      */
527   {STEAX,"(HL++)", 2,14}, /* 95: 0100 1000 1000 0101                      */
528   {illegal,0,     2, 8}, /* 96: 0100 1000 1000 0110                      */
529   {illegal,0,     2, 8}, /* 97: 0100 1000 1000 0111                      */
530   {illegal,0,     2, 8}, /* 98: 0100 1000 1000 1000                      */
531   {illegal,0,     2, 8}, /* 99: 0100 1000 1000 1001                      */
532   {illegal,0,     2, 8}, /* 9a: 0100 1000 1000 1010                      */
533   {STEAX,"(DE+%b)",3,20}, /* 9b: 0100 1000 1000 1011 xxxx xxxx            */
534   {STEAX,"(HL+A)", 2,20}, /* 9c: 0100 1000 1000 1100                      */
535   {STEAX,"(HL+B)", 2,20}, /* 9d: 0100 1000 1000 1101                      */
536   {STEAX,"(HL+EA)",2,20}, /* 9e: 0100 1000 1000 1110                      */
537   {STEAX,"(HL+%b)",3,20}, /* 9f: 0100 1000 1000 1111 xxxx xxxx            */
534   {illegal,0     }, /* 90: 0100 1000 1000 0000                      */
535   {illegal,0     }, /* 91: 0100 1000 1000 0001                      */
536   {STEAX,"(DE)"   }, /* 92: 0100 1000 1000 0010                      */
537   {STEAX,"(HL)"   }, /* 93: 0100 1000 1000 0011                      */
538   {STEAX,"(DE++)" }, /* 94: 0100 1000 1000 0100                      */
539   {STEAX,"(HL++)" }, /* 95: 0100 1000 1000 0101                      */
540   {illegal,0     }, /* 96: 0100 1000 1000 0110                      */
541   {illegal,0     }, /* 97: 0100 1000 1000 0111                      */
542   {illegal,0     }, /* 98: 0100 1000 1000 1000                      */
543   {illegal,0     }, /* 99: 0100 1000 1000 1001                      */
544   {illegal,0     }, /* 9a: 0100 1000 1000 1010                      */
545   {STEAX,"(DE+%b)"}, /* 9b: 0100 1000 1000 1011 xxxx xxxx            */
546   {STEAX,"(HL+A)" }, /* 9c: 0100 1000 1000 1100                      */
547   {STEAX,"(HL+B)" }, /* 9d: 0100 1000 1000 1101                      */
548   {STEAX,"(HL+EA)"}, /* 9e: 0100 1000 1000 1110                      */
549   {STEAX,"(HL+%b)"}, /* 9f: 0100 1000 1000 1111 xxxx xxxx            */
538550
539   {DSLR,"EA",      2, 8}, /* a0: 0100 1000 1010 0000                      */
540   {illegal,0,     2, 8}, /* a1: 0100 1000 1010 0001                      */
541   {illegal,0,     2, 8}, /* a2: 0100 1000 1010 0010                      */
542   {illegal,0,     2, 8}, /* a3: 0100 1000 1010 0011                      */
543   {DSLL,"EA",      2, 8}, /* a4: 0100 1000 1010 0100                      */
544   {illegal,0,     2, 8}, /* a5: 0100 1000 1010 0101                      */
545   {illegal,0,     2, 8}, /* a6: 0100 1000 1010 0110                      */
546   {illegal,0,     2, 8}, /* a7: 0100 1000 1010 0111                      */
547   {TABLE,0,       2,17}, /* a8: 0100 1000 1010 1000                      */
548   {illegal,0,     2, 8}, /* a9: 0100 1000 1010 1001                      */
549   {illegal,0,     2, 8}, /* aa: 0100 1000 1010 1010                      */
550   {illegal,0,     2, 8}, /* ab: 0100 1000 1010 1011                      */
551   {illegal,0,     2, 8}, /* ac: 0100 1000 1010 1100                      */
552   {illegal,0,     2, 8}, /* ad: 0100 1000 1010 1101                      */
553   {illegal,0,     2, 8}, /* ae: 0100 1000 1010 1110                      */
554   {illegal,0,     2, 8}, /* af: 0100 1000 1010 1111                      */
551   {DSLR,"EA"      }, /* a0: 0100 1000 1010 0000                      */
552   {illegal,0     }, /* a1: 0100 1000 1010 0001                      */
553   {illegal,0     }, /* a2: 0100 1000 1010 0010                      */
554   {illegal,0     }, /* a3: 0100 1000 1010 0011                      */
555   {DSLL,"EA"      }, /* a4: 0100 1000 1010 0100                      */
556   {illegal,0     }, /* a5: 0100 1000 1010 0101                      */
557   {illegal,0     }, /* a6: 0100 1000 1010 0110                      */
558   {illegal,0     }, /* a7: 0100 1000 1010 0111                      */
559   {TABLE,0       }, /* a8: 0100 1000 1010 1000                      */
560   {illegal,0     }, /* a9: 0100 1000 1010 1001                      */
561   {illegal,0     }, /* aa: 0100 1000 1010 1010                      */
562   {illegal,0     }, /* ab: 0100 1000 1010 1011                      */
563   {illegal,0     }, /* ac: 0100 1000 1010 1100                      */
564   {illegal,0     }, /* ad: 0100 1000 1010 1101                      */
565   {illegal,0     }, /* ae: 0100 1000 1010 1110                      */
566   {illegal,0     }, /* af: 0100 1000 1010 1111                      */
555567
556   {DRLR,"EA",      2, 8}, /* b0: 0100 1000 1011 0000                      */
557   {illegal,0,     2, 8}, /* b1: 0100 1000 1011 0001                      */
558   {illegal,0,     2, 8}, /* b2: 0100 1000 1011 0010                      */
559   {illegal,0,     2, 8}, /* b3: 0100 1000 1011 0011                      */
560   {DRLL,"EA",      2, 8}, /* b4: 0100 1000 1011 0100                      */
561   {illegal,0,     2, 8}, /* b5: 0100 1000 1011 0101                      */
562   {illegal,0,     2, 8}, /* b6: 0100 1000 1011 0110                      */
563   {illegal,0,     2, 8}, /* b7: 0100 1000 1011 0111                      */
564   {illegal,0,     2, 8}, /* b8: 0100 1000 1011 1000                      */
565   {illegal,0,     2, 8}, /* b9: 0100 1000 1011 1001                      */
566   {illegal,0,     2, 8}, /* ba: 0100 1000 1011 1010                      */
567   {STOP,0,       2,12}, /* bb: 0100 1000 1011 1011                      */   /* 7810 */
568   {illegal,0,     2, 8}, /* bc: 0100 1000 1011 1100                      */
569   {illegal,0,     2, 8}, /* bd: 0100 1000 1011 1101                      */
570   {illegal,0,     2, 8}, /* be: 0100 1000 1011 1110                      */
571   {illegal,0,     2, 8}, /* bf: 0100 1000 1011 1111                      */
568   {DRLR,"EA"      }, /* b0: 0100 1000 1011 0000                      */
569   {illegal,0     }, /* b1: 0100 1000 1011 0001                      */
570   {illegal,0     }, /* b2: 0100 1000 1011 0010                      */
571   {illegal,0     }, /* b3: 0100 1000 1011 0011                      */
572   {DRLL,"EA"      }, /* b4: 0100 1000 1011 0100                      */
573   {illegal,0     }, /* b5: 0100 1000 1011 0101                      */
574   {illegal,0     }, /* b6: 0100 1000 1011 0110                      */
575   {illegal,0     }, /* b7: 0100 1000 1011 0111                      */
576   {illegal,0     }, /* b8: 0100 1000 1011 1000                      */
577   {illegal,0     }, /* b9: 0100 1000 1011 1001                      */
578   {illegal,0     }, /* ba: 0100 1000 1011 1010                      */
579   {STOP,0       }, /* bb: 0100 1000 1011 1011                      */   /* 7810 */
580   {illegal,0     }, /* bc: 0100 1000 1011 1100                      */
581   {illegal,0     }, /* bd: 0100 1000 1011 1101                      */
582   {illegal,0     }, /* be: 0100 1000 1011 1110                      */
583   {illegal,0     }, /* bf: 0100 1000 1011 1111                      */
572584
573   {DMOV,"EA,ECNT", 2,14}, /* c0: 0100 1000 1100 0000                      */
574   {DMOV,"EA,ECPT", 2,14}, /* c1: 0100 1000 1100 0001                      */   /* 7810 */
575   {illegal,0,     2, 8}, /* c2: 0100 1000 1100 0010                      */
576   {illegal,0,     2, 8}, /* c3: 0100 1000 1100 0011                      */
577   {illegal,0,     2, 8}, /* c4: 0100 1000 1100 0100                      */
578   {illegal,0,     2, 8}, /* c5: 0100 1000 1100 0101                      */
579   {illegal,0,     2, 8}, /* c6: 0100 1000 1100 0110                      */
580   {illegal,0,     2, 8}, /* c7: 0100 1000 1100 0111                      */
581   {illegal,0,     2, 8}, /* c8: 0100 1000 1100 1000                      */
582   {illegal,0,     2, 8}, /* c9: 0100 1000 1100 1001                      */
583   {illegal,0,     2, 8}, /* ca: 0100 1000 1100 1010                      */
584   {illegal,0,     2, 8}, /* cb: 0100 1000 1100 1011                      */
585   {illegal,0,     2, 8}, /* cc: 0100 1000 1100 1100                      */
586   {illegal,0,     2, 8}, /* cd: 0100 1000 1100 1101                      */
587   {illegal,0,     2, 8}, /* ce: 0100 1000 1100 1110                      */
588   {illegal,0,     2, 8}, /* cf: 0100 1000 1100 1111                      */
585   {DMOV,"EA,ECNT" }, /* c0: 0100 1000 1100 0000                      */
586   {DMOV,"EA,ECPT" }, /* c1: 0100 1000 1100 0001                      */   /* 7810 */
587   {illegal,0     }, /* c2: 0100 1000 1100 0010                      */
588   {illegal,0     }, /* c3: 0100 1000 1100 0011                      */
589   {illegal,0     }, /* c4: 0100 1000 1100 0100                      */
590   {illegal,0     }, /* c5: 0100 1000 1100 0101                      */
591   {illegal,0     }, /* c6: 0100 1000 1100 0110                      */
592   {illegal,0     }, /* c7: 0100 1000 1100 0111                      */
593   {illegal,0     }, /* c8: 0100 1000 1100 1000                      */
594   {illegal,0     }, /* c9: 0100 1000 1100 1001                      */
595   {illegal,0     }, /* ca: 0100 1000 1100 1010                      */
596   {illegal,0     }, /* cb: 0100 1000 1100 1011                      */
597   {illegal,0     }, /* cc: 0100 1000 1100 1100                      */
598   {illegal,0     }, /* cd: 0100 1000 1100 1101                      */
599   {illegal,0     }, /* ce: 0100 1000 1100 1110                      */
600   {illegal,0     }, /* cf: 0100 1000 1100 1111                      */
589601
590   {illegal,0,     2, 8}, /* d0: 0100 1000 1101 0000                      */
591   {illegal,0,     2, 8}, /* d1: 0100 1000 1101 0001                      */
592   {DMOV,"ETM0,EA", 2,14}, /* d2: 0100 1000 1101 0010                      */
593   {DMOV,"ETM1,EA", 2,14}, /* d3: 0100 1000 1101 0011                      */
594   {illegal,0,     2, 8}, /* d4: 0100 1000 1101 0100                      */
595   {illegal,0,     2, 8}, /* d5: 0100 1000 1101 0101                      */
596   {illegal,0,     2, 8}, /* d6: 0100 1000 1101 0110                      */
597   {illegal,0,     2, 8}, /* d7: 0100 1000 1101 0111                      */
598   {illegal,0,     2, 8}, /* d8: 0100 1000 1101 1000                      */
599   {illegal,0,     2, 8}, /* d9: 0100 1000 1101 1001                      */
600   {illegal,0,     2, 8}, /* da: 0100 1000 1101 1010                      */
601   {illegal,0,     2, 8}, /* db: 0100 1000 1101 1011                      */
602   {illegal,0,     2, 8}, /* dc: 0100 1000 1101 1100                      */
603   {illegal,0,     2, 8}, /* dd: 0100 1000 1101 1101                      */
604   {illegal,0,     2, 8}, /* de: 0100 1000 1101 1110                      */
605   {illegal,0,     2, 8}, /* df: 0100 1000 1101 1111                      */
602   {illegal,0     }, /* d0: 0100 1000 1101 0000                      */
603   {illegal,0     }, /* d1: 0100 1000 1101 0001                      */
604   {DMOV,"ETM0,EA" }, /* d2: 0100 1000 1101 0010                      */
605   {DMOV,"ETM1,EA" }, /* d3: 0100 1000 1101 0011                      */
606   {illegal,0     }, /* d4: 0100 1000 1101 0100                      */
607   {illegal,0     }, /* d5: 0100 1000 1101 0101                      */
608   {illegal,0     }, /* d6: 0100 1000 1101 0110                      */
609   {illegal,0     }, /* d7: 0100 1000 1101 0111                      */
610   {illegal,0     }, /* d8: 0100 1000 1101 1000                      */
611   {illegal,0     }, /* d9: 0100 1000 1101 1001                      */
612   {illegal,0     }, /* da: 0100 1000 1101 1010                      */
613   {illegal,0     }, /* db: 0100 1000 1101 1011                      */
614   {illegal,0     }, /* dc: 0100 1000 1101 1100                      */
615   {illegal,0     }, /* dd: 0100 1000 1101 1101                      */
616   {illegal,0     }, /* de: 0100 1000 1101 1110                      */
617   {illegal,0     }, /* df: 0100 1000 1101 1111                      */
606618
607   {illegal,0,     2, 8}, /* e0: 0100 1000 1110 0000                      */
608   {illegal,0,     2, 8}, /* e1: 0100 1000 1110 0001                      */
609   {illegal,0,     2, 8}, /* e2: 0100 1000 1110 0010                      */
610   {illegal,0,     2, 8}, /* e3: 0100 1000 1110 0011                      */
611   {illegal,0,     2, 8}, /* e4: 0100 1000 1110 0100                      */
612   {illegal,0,     2, 8}, /* e5: 0100 1000 1110 0101                      */
613   {illegal,0,     2, 8}, /* e6: 0100 1000 1110 0110                      */
614   {illegal,0,     2, 8}, /* e7: 0100 1000 1110 0111                      */
615   {illegal,0,     2, 8}, /* e8: 0100 1000 1110 1000                      */
616   {illegal,0,     2, 8}, /* e9: 0100 1000 1110 1001                      */
617   {illegal,0,     2, 8}, /* ea: 0100 1000 1110 1010                      */
618   {illegal,0,     2, 8}, /* eb: 0100 1000 1110 1011                      */
619   {illegal,0,     2, 8}, /* ec: 0100 1000 1110 1100                      */
620   {illegal,0,     2, 8}, /* ed: 0100 1000 1110 1101                      */
621   {illegal,0,     2, 8}, /* ee: 0100 1000 1110 1110                      */
622   {illegal,0,     2, 8}, /* ef: 0100 1000 1110 1111                      */
619   {illegal,0     }, /* e0: 0100 1000 1110 0000                      */
620   {illegal,0     }, /* e1: 0100 1000 1110 0001                      */
621   {illegal,0     }, /* e2: 0100 1000 1110 0010                      */
622   {illegal,0     }, /* e3: 0100 1000 1110 0011                      */
623   {illegal,0     }, /* e4: 0100 1000 1110 0100                      */
624   {illegal,0     }, /* e5: 0100 1000 1110 0101                      */
625   {illegal,0     }, /* e6: 0100 1000 1110 0110                      */
626   {illegal,0     }, /* e7: 0100 1000 1110 0111                      */
627   {illegal,0     }, /* e8: 0100 1000 1110 1000                      */
628   {illegal,0     }, /* e9: 0100 1000 1110 1001                      */
629   {illegal,0     }, /* ea: 0100 1000 1110 1010                      */
630   {illegal,0     }, /* eb: 0100 1000 1110 1011                      */
631   {illegal,0     }, /* ec: 0100 1000 1110 1100                      */
632   {illegal,0     }, /* ed: 0100 1000 1110 1101                      */
633   {illegal,0     }, /* ee: 0100 1000 1110 1110                      */
634   {illegal,0     }, /* ef: 0100 1000 1110 1111                      */
623635
624   {illegal,0,     2, 8}, /* f0: 0100 1000 1111 0000                      */
625   {illegal,0,     2, 8}, /* f1: 0100 1000 1111 0001                      */
626   {illegal,0,     2, 8}, /* f2: 0100 1000 1111 0010                      */
627   {illegal,0,     2, 8}, /* f3: 0100 1000 1111 0011                      */
628   {illegal,0,     2, 8}, /* f4: 0100 1000 1111 0100                      */
629   {illegal,0,     2, 8}, /* f5: 0100 1000 1111 0101                      */
630   {illegal,0,     2, 8}, /* f6: 0100 1000 1111 0110                      */
631   {illegal,0,     2, 8}, /* f7: 0100 1000 1111 0111                      */
632   {illegal,0,     2, 8}, /* f8: 0100 1000 1111 1000                      */
633   {illegal,0,     2, 8}, /* f9: 0100 1000 1111 1001                      */
634   {illegal,0,     2, 8}, /* fa: 0100 1000 1111 1010                      */
635   {illegal,0,     2, 8}, /* fb: 0100 1000 1111 1011                      */
636   {illegal,0,     2, 8}, /* fc: 0100 1000 1111 1100                      */
637   {illegal,0,     2, 8}, /* fd: 0100 1000 1111 1101                      */
638   {illegal,0,     2, 8}, /* fe: 0100 1000 1111 1110                      */
639   {illegal,0,     2, 8}   /* ff: 0100 1000 1111 1111                      */
636   {illegal,0     }, /* f0: 0100 1000 1111 0000                      */
637   {illegal,0     }, /* f1: 0100 1000 1111 0001                      */
638   {illegal,0     }, /* f2: 0100 1000 1111 0010                      */
639   {illegal,0     }, /* f3: 0100 1000 1111 0011                      */
640   {illegal,0     }, /* f4: 0100 1000 1111 0100                      */
641   {illegal,0     }, /* f5: 0100 1000 1111 0101                      */
642   {illegal,0     }, /* f6: 0100 1000 1111 0110                      */
643   {illegal,0     }, /* f7: 0100 1000 1111 0111                      */
644   {illegal,0     }, /* f8: 0100 1000 1111 1000                      */
645   {illegal,0     }, /* f9: 0100 1000 1111 1001                      */
646   {illegal,0     }, /* fa: 0100 1000 1111 1010                      */
647   {illegal,0     }, /* fb: 0100 1000 1111 1011                      */
648   {illegal,0     }, /* fc: 0100 1000 1111 1100                      */
649   {illegal,0     }, /* fd: 0100 1000 1111 1101                      */
650   {illegal,0     }, /* fe: 0100 1000 1111 1110                      */
651   {illegal,0     }   /* ff: 0100 1000 1111 1111                      */
640652};
641653
642654static const struct dasm_s dasm48_7807[256] =
643655{
644   {illegal,0,     2, 8}, /* 00: 0100 1000 0000 0000                      */
645   {SLRC,"A",       2, 8}, /* 01: 0100 1000 0000 0001                      */
646   {SLRC,"B",       2, 8}, /* 02: 0100 1000 0000 0010                      */
647   {SLRC,"C",       2, 8}, /* 03: 0100 1000 0000 0011                      */
648   {illegal,0,     2, 8}, /* 04: 0100 1000 0000 0100                      */
649   {SLLC,"A",       2, 8}, /* 05: 0100 1000 0000 0101                      */
650   {SLLC,"B",       2, 8}, /* 06: 0100 1000 0000 0110                      */
651   {SLLC,"C",       2, 8}, /* 07: 0100 1000 0000 0111                      */
652   {SK,"NV",        2, 8}, /* 08: 0100 1000 0000 1000                      */
653   {illegal,0,     2, 8}, /* 09: 0100 1000 0000 1001                      */
654   {SK,"CY",        2, 8}, /* 0a: 0100 1000 0000 1010                      */
655   {SK,"HC",        2, 8}, /* 0b: 0100 1000 0000 1011                      */
656   {SK,"Z",         2, 8}, /* 0c: 0100 1000 0000 1100                      */
657   {illegal,0,     2, 8}, /* 0d: 0100 1000 0000 1101                      */
658   {illegal,0,     2, 8}, /* 0e: 0100 1000 0000 1110                      */
659   {illegal,0,     2, 8}, /* 0f: 0100 1000 0000 1111                      */
656   {illegal,0     }, /* 00: 0100 1000 0000 0000                      */
657   {SLRC,"A"       }, /* 01: 0100 1000 0000 0001                      */
658   {SLRC,"B"       }, /* 02: 0100 1000 0000 0010                      */
659   {SLRC,"C"       }, /* 03: 0100 1000 0000 0011                      */
660   {illegal,0     }, /* 04: 0100 1000 0000 0100                      */
661   {SLLC,"A"       }, /* 05: 0100 1000 0000 0101                      */
662   {SLLC,"B"       }, /* 06: 0100 1000 0000 0110                      */
663   {SLLC,"C"       }, /* 07: 0100 1000 0000 0111                      */
664   {SK,"NV"        }, /* 08: 0100 1000 0000 1000                      */
665   {illegal,0     }, /* 09: 0100 1000 0000 1001                      */
666   {SK,"CY"        }, /* 0a: 0100 1000 0000 1010                      */
667   {SK,"HC"        }, /* 0b: 0100 1000 0000 1011                      */
668   {SK,"Z"         }, /* 0c: 0100 1000 0000 1100                      */
669   {illegal,0     }, /* 0d: 0100 1000 0000 1101                      */
670   {illegal,0     }, /* 0e: 0100 1000 0000 1110                      */
671   {illegal,0     }, /* 0f: 0100 1000 0000 1111                      */
660672
661   {illegal,0,     2, 8}, /* 10: 0100 1000 0001 0000                      */
662   {illegal,0,     2, 8}, /* 11: 0100 1000 0001 0001                      */
663   {illegal,0,     2, 8}, /* 12: 0100 1000 0001 0010                      */
664   {illegal,0,     2, 8}, /* 13: 0100 1000 0001 0011                      */
665   {illegal,0,     2, 8}, /* 14: 0100 1000 0001 0100                      */
666   {illegal,0,     2, 8}, /* 15: 0100 1000 0001 0101                      */
667   {illegal,0,     2, 8}, /* 16: 0100 1000 0001 0110                      */
668   {illegal,0,     2, 8}, /* 17: 0100 1000 0001 0111                      */
669   {SKN,"NV",       2, 8}, /* 18: 0100 1000 0001 1000                      */
670   {illegal,0,     2, 8}, /* 19: 0100 1000 0001 1001                      */
671   {SKN,"CY",       2, 8}, /* 1a: 0100 1000 0001 1010                      */
672   {SKN,"HC",       2, 8}, /* 1b: 0100 1000 0001 1011                      */
673   {SKN,"Z",        2, 8}, /* 1c: 0100 1000 0001 1100                      */
674   {illegal,0,     2, 8}, /* 1d: 0100 1000 0001 1101                      */
675   {illegal,0,     2, 8}, /* 1e: 0100 1000 0001 1110                      */
676   {illegal,0,     2, 8}, /* 1f: 0100 1000 0001 1111                      */
673   {illegal,0     }, /* 10: 0100 1000 0001 0000                      */
674   {illegal,0     }, /* 11: 0100 1000 0001 0001                      */
675   {illegal,0     }, /* 12: 0100 1000 0001 0010                      */
676   {illegal,0     }, /* 13: 0100 1000 0001 0011                      */
677   {illegal,0     }, /* 14: 0100 1000 0001 0100                      */
678   {illegal,0     }, /* 15: 0100 1000 0001 0101                      */
679   {illegal,0     }, /* 16: 0100 1000 0001 0110                      */
680   {illegal,0     }, /* 17: 0100 1000 0001 0111                      */
681   {SKN,"NV"       }, /* 18: 0100 1000 0001 1000                      */
682   {illegal,0     }, /* 19: 0100 1000 0001 1001                      */
683   {SKN,"CY"       }, /* 1a: 0100 1000 0001 1010                      */
684   {SKN,"HC"       }, /* 1b: 0100 1000 0001 1011                      */
685   {SKN,"Z"        }, /* 1c: 0100 1000 0001 1100                      */
686   {illegal,0     }, /* 1d: 0100 1000 0001 1101                      */
687   {illegal,0     }, /* 1e: 0100 1000 0001 1110                      */
688   {illegal,0     }, /* 1f: 0100 1000 0001 1111                      */
677689
678   {illegal,0,     2, 8}, /* 20: 0100 1000 0010 0000                      */
679   {SLR,"A",        2, 8}, /* 21: 0100 1000 0010 0001                      */
680   {SLR,"B",        2, 8}, /* 22: 0100 1000 0010 0010                      */
681   {SLR,"C",        2, 8}, /* 23: 0100 1000 0010 0011                      */
682   {illegal,0,     2, 8}, /* 24: 0100 1000 0010 0100                      */
683   {SLL,"A",        2, 8}, /* 25: 0100 1000 0010 0101                      */
684   {SLL,"B",        2, 8}, /* 26: 0100 1000 0010 0110                      */
685   {SLL,"C",        2, 8}, /* 27: 0100 1000 0010 0111                      */
686   {JEA,0,        2, 8}, /* 28: 0100 1000 0010 1000                      */
687   {CALB,0,       2,17}, /* 29: 0100 1000 0010 1001                      */
688   {CLC,0,        2, 8}, /* 2a: 0100 1000 0010 1010                      */
689   {STC,0,        2, 8}, /* 2b: 0100 1000 0010 1011                      */
690   {illegal,0,     2,32}, /* 2c: 0100 1000 0010 1100                      */
691   {MUL,"A",        2,32}, /* 2d: 0100 1000 0010 1101                      */
692   {MUL,"B",        2,32}, /* 2e: 0100 1000 0010 1110                      */
693   {MUL,"C",        2,32}, /* 2f: 0100 1000 0010 1111                      */
690   {illegal,0     }, /* 20: 0100 1000 0010 0000                      */
691   {SLR,"A"        }, /* 21: 0100 1000 0010 0001                      */
692   {SLR,"B"        }, /* 22: 0100 1000 0010 0010                      */
693   {SLR,"C"        }, /* 23: 0100 1000 0010 0011                      */
694   {illegal,0     }, /* 24: 0100 1000 0010 0100                      */
695   {SLL,"A"        }, /* 25: 0100 1000 0010 0101                      */
696   {SLL,"B"        }, /* 26: 0100 1000 0010 0110                      */
697   {SLL,"C"        }, /* 27: 0100 1000 0010 0111                      */
698   {JEA,0        }, /* 28: 0100 1000 0010 1000                      */
699   {CALB,0       }, /* 29: 0100 1000 0010 1001                      */
700   {CLC,0        }, /* 2a: 0100 1000 0010 1010                      */
701   {STC,0        }, /* 2b: 0100 1000 0010 1011                      */
702   {illegal,0     }, /* 2c: 0100 1000 0010 1100                      */
703   {MUL,"A"        }, /* 2d: 0100 1000 0010 1101                      */
704   {MUL,"B"        }, /* 2e: 0100 1000 0010 1110                      */
705   {MUL,"C"        }, /* 2f: 0100 1000 0010 1111                      */
694706
695   {illegal,0,     2, 8}, /* 30: 0100 1000 0011 0000                      */
696   {RLR,"A",        2, 8}, /* 31: 0100 1000 0011 0001                      */
697   {RLR,"B",        2, 8}, /* 32: 0100 1000 0011 0010                      */
698   {RLR,"C",        2, 8}, /* 33: 0100 1000 0011 0011                      */
699   {illegal,0,     2, 8}, /* 34: 0100 1000 0011 0100                      */
700   {RLL,"A",        2, 8}, /* 35: 0100 1000 0011 0101                      */
701   {RLL,"B",        2, 8}, /* 36: 0100 1000 0011 0110                      */
702   {RLL,"C",        2, 8}, /* 37: 0100 1000 0011 0111                      */
703   {RLD,0,        2,17}, /* 38: 0100 1000 0011 1000                      */
704   {RRD,0,        2,17}, /* 39: 0100 1000 0011 1001                      */
705   {NEGA,0,       2, 8}, /* 3a: 0100 1000 0011 1010                      */
706   {HALT,0,       2,12}, /* 3b: 0100 1000 0011 1011                      */
707   {illegal,0,     2,59}, /* 3c: 0100 1000 0011 1100                      */
708   {DIV,"A",        2,59}, /* 3d: 0100 1000 0011 1101                      */
709   {DIV,"B",        2,59}, /* 3e: 0100 1000 0011 1110                      */
710   {DIV,"C",        2,59}, /* 3f: 0100 1000 0011 1111                      */
707   {illegal,0     }, /* 30: 0100 1000 0011 0000                      */
708   {RLR,"A"        }, /* 31: 0100 1000 0011 0001                      */
709   {RLR,"B"        }, /* 32: 0100 1000 0011 0010                      */
710   {RLR,"C"        }, /* 33: 0100 1000 0011 0011                      */
711   {illegal,0     }, /* 34: 0100 1000 0011 0100                      */
712   {RLL,"A"        }, /* 35: 0100 1000 0011 0101                      */
713   {RLL,"B"        }, /* 36: 0100 1000 0011 0110                      */
714   {RLL,"C"        }, /* 37: 0100 1000 0011 0111                      */
715   {RLD,0        }, /* 38: 0100 1000 0011 1000                      */
716   {RRD,0        }, /* 39: 0100 1000 0011 1001                      */
717   {NEGA,0       }, /* 3a: 0100 1000 0011 1010                      */
718   {HALT,0       }, /* 3b: 0100 1000 0011 1011                      */
719   {illegal,0     }, /* 3c: 0100 1000 0011 1100                      */
720   {DIV,"A"        }, /* 3d: 0100 1000 0011 1101                      */
721   {DIV,"B"        }, /* 3e: 0100 1000 0011 1110                      */
722   {DIV,"C"        }, /* 3f: 0100 1000 0011 1111                      */
711723
712   {SKIT,"NMI",     2, 8}, /* 40: 0100 1000 0100 0000                      */
713   {SKIT,"FT0",     2, 8}, /* 41: 0100 1000 0100 0001                      */
714   {SKIT,"FT1",     2, 8}, /* 42: 0100 1000 0100 0010                      */
715   {SKIT,"F1",      2, 8}, /* 43: 0100 1000 0100 0011                      */
716   {SKIT,"F2",      2, 8}, /* 44: 0100 1000 0100 0100                      */
717   {SKIT,"FE0",     2, 8}, /* 45: 0100 1000 0100 0101                      */
718   {SKIT,"FE1",     2, 8}, /* 46: 0100 1000 0100 0110                      */
719   {SKIT,"FEIN",    2, 8}, /* 47: 0100 1000 0100 0111                      */
720   {SKIT,"FAD",     2, 8}, /* 48: 0100 1000 0100 1000                      */
721   {SKIT,"FSR",     2, 8}, /* 49: 0100 1000 0100 1001                      */
722   {SKIT,"FST",     2, 8}, /* 4a: 0100 1000 0100 1010                      */
723   {SKIT,"ER",      2, 8}, /* 4b: 0100 1000 0100 1011                      */
724   {SKIT,"OV",      2, 8}, /* 4c: 0100 1000 0100 1100                      */
725   {illegal,0,     2, 8}, /* 4d: 0100 1000 0100 1101                      */
726   {illegal,0,     2, 8}, /* 4e: 0100 1000 0100 1110                      */
727   {illegal,0,     2, 8}, /* 4f: 0100 1000 0100 1111                      */
724   {SKIT,"NMI"     }, /* 40: 0100 1000 0100 0000                      */
725   {SKIT,"FT0"     }, /* 41: 0100 1000 0100 0001                      */
726   {SKIT,"FT1"     }, /* 42: 0100 1000 0100 0010                      */
727   {SKIT,"F1"      }, /* 43: 0100 1000 0100 0011                      */
728   {SKIT,"F2"      }, /* 44: 0100 1000 0100 0100                      */
729   {SKIT,"FE0"     }, /* 45: 0100 1000 0100 0101                      */
730   {SKIT,"FE1"     }, /* 46: 0100 1000 0100 0110                      */
731   {SKIT,"FEIN"    }, /* 47: 0100 1000 0100 0111                      */
732   {SKIT,"FAD"     }, /* 48: 0100 1000 0100 1000                      */
733   {SKIT,"FSR"     }, /* 49: 0100 1000 0100 1001                      */
734   {SKIT,"FST"     }, /* 4a: 0100 1000 0100 1010                      */
735   {SKIT,"ER"      }, /* 4b: 0100 1000 0100 1011                      */
736   {SKIT,"OV"      }, /* 4c: 0100 1000 0100 1100                      */
737   {illegal,0     }, /* 4d: 0100 1000 0100 1101                      */
738   {illegal,0     }, /* 4e: 0100 1000 0100 1110                      */
739   {illegal,0     }, /* 4f: 0100 1000 0100 1111                      */
728740
729   {SKIT,"AN4",     2, 8}, /* 50: 0100 1000 0101 0000                      */
730   {SKIT,"AN5",     2, 8}, /* 51: 0100 1000 0101 0001                      */
731   {SKIT,"AN6",     2, 8}, /* 52: 0100 1000 0101 0010                      */
732   {SKIT,"AN7",     2, 8}, /* 53: 0100 1000 0101 0011                      */
733   {SKIT,"SB",      2, 8}, /* 54: 0100 1000 0101 0100                      */
734   {illegal,0,     2, 8}, /* 55: 0100 1000 0101 0101                      */
735   {illegal,0,     2, 8}, /* 56: 0100 1000 0101 0110                      */
736   {illegal,0,     2, 8}, /* 57: 0100 1000 0101 0111                      */
737   {illegal,0,     2, 8}, /* 58: 0100 1000 0101 1000                      */
738   {illegal,0,     2, 8}, /* 59: 0100 1000 0101 1001                      */
739   {illegal,0,     2, 8}, /* 5a: 0100 1000 0101 1010                      */
740   {illegal,0,     2, 8}, /* 5b: 0100 1000 0101 1011                      */
741   {illegal,0,     2, 8}, /* 5c: 0100 1000 0101 1100                      */
742   {illegal,0,     2, 8}, /* 5d: 0100 1000 0101 1101                      */
743   {illegal,0,     2, 8}, /* 5e: 0100 1000 0101 1110                      */
744   {illegal,0,     2, 8}, /* 5f: 0100 1000 0101 1111                      */
741   {SKIT,"AN4"     }, /* 50: 0100 1000 0101 0000                      */
742   {SKIT,"AN5"     }, /* 51: 0100 1000 0101 0001                      */
743   {SKIT,"AN6"     }, /* 52: 0100 1000 0101 0010                      */
744   {SKIT,"AN7"     }, /* 53: 0100 1000 0101 0011                      */
745   {SKIT,"SB"      }, /* 54: 0100 1000 0101 0100                      */
746   {illegal,0     }, /* 55: 0100 1000 0101 0101                      */
747   {illegal,0     }, /* 56: 0100 1000 0101 0110                      */
748   {illegal,0     }, /* 57: 0100 1000 0101 0111                      */
749   {illegal,0     }, /* 58: 0100 1000 0101 1000                      */
750   {illegal,0     }, /* 59: 0100 1000 0101 1001                      */
751   {illegal,0     }, /* 5a: 0100 1000 0101 1010                      */
752   {illegal,0     }, /* 5b: 0100 1000 0101 1011                      */
753   {illegal,0     }, /* 5c: 0100 1000 0101 1100                      */
754   {illegal,0     }, /* 5d: 0100 1000 0101 1101                      */
755   {illegal,0     }, /* 5e: 0100 1000 0101 1110                      */
756   {illegal,0     }, /* 5f: 0100 1000 0101 1111                      */
745757
746   {SKNIT,"NMI",    2, 8}, /* 60: 0100 1000 0110 0000                      */
747   {SKNIT,"FT0",    2, 8}, /* 61: 0100 1000 0110 0001                      */
748   {SKNIT,"FT1",    2, 8}, /* 62: 0100 1000 0110 0010                      */
749   {SKNIT,"F1",     2, 8}, /* 63: 0100 1000 0110 0011                      */
750   {SKNIT,"F2",     2, 8}, /* 64: 0100 1000 0110 0100                      */
751   {SKNIT,"FE0",    2, 8}, /* 65: 0100 1000 0110 0101                      */
752   {SKNIT,"FE1",    2, 8}, /* 66: 0100 1000 0110 0110                      */
753   {SKNIT,"FEIN",   2, 8}, /* 67: 0100 1000 0110 0111                      */
754   {SKNIT,"FAD",    2, 8}, /* 68: 0100 1000 0110 1000                      */
755   {SKNIT,"FSR",    2, 8}, /* 69: 0100 1000 0110 1001                      */
756   {SKNIT,"FST",    2, 8}, /* 6a: 0100 1000 0110 1010                      */
757   {SKNIT,"ER",     2, 8}, /* 6b: 0100 1000 0110 1011                      */
758   {SKNIT,"OV",     2, 8}, /* 6c: 0100 1000 0110 1100                      */
759   {illegal,0,     2, 8}, /* 6d: 0100 1000 0110 1101                      */
760   {illegal,0,     2, 8}, /* 6e: 0100 1000 0110 1110                      */
761   {illegal,0,     2, 8}, /* 6f: 0100 1000 0110 1111                      */
758   {SKNIT,"NMI"    }, /* 60: 0100 1000 0110 0000                      */
759   {SKNIT,"FT0"    }, /* 61: 0100 1000 0110 0001                      */
760   {SKNIT,"FT1"    }, /* 62: 0100 1000 0110 0010                      */
761   {SKNIT,"F1"     }, /* 63: 0100 1000 0110 0011                      */
762   {SKNIT,"F2"     }, /* 64: 0100 1000 0110 0100                      */
763   {SKNIT,"FE0"    }, /* 65: 0100 1000 0110 0101                      */
764   {SKNIT,"FE1"    }, /* 66: 0100 1000 0110 0110                      */
765   {SKNIT,"FEIN"   }, /* 67: 0100 1000 0110 0111                      */
766   {SKNIT,"FAD"    }, /* 68: 0100 1000 0110 1000                      */
767   {SKNIT,"FSR"    }, /* 69: 0100 1000 0110 1001                      */
768   {SKNIT,"FST"    }, /* 6a: 0100 1000 0110 1010                      */
769   {SKNIT,"ER"     }, /* 6b: 0100 1000 0110 1011                      */
770   {SKNIT,"OV"     }, /* 6c: 0100 1000 0110 1100                      */
771   {illegal,0     }, /* 6d: 0100 1000 0110 1101                      */
772   {illegal,0     }, /* 6e: 0100 1000 0110 1110                      */
773   {illegal,0     }, /* 6f: 0100 1000 0110 1111                      */
762774
763   {SKNIT,"AN4",    2, 8}, /* 70: 0100 1000 0111 0000                      */
764   {SKNIT,"AN5",    2, 8}, /* 71: 0100 1000 0111 0001                      */
765   {SKNIT,"AN6",    2, 8}, /* 72: 0100 1000 0111 0010                      */
766   {SKNIT,"AN7",    2, 8}, /* 73: 0100 1000 0111 0011                      */
767   {SKNIT,"SB",     2, 8}, /* 74: 0100 1000 0111 0100                      */
768   {illegal,0,     2, 8}, /* 75: 0100 1000 0111 0101                      */
769   {illegal,0,     2, 8}, /* 76: 0100 1000 0111 0110                      */
770   {illegal,0,     2, 8}, /* 77: 0100 1000 0111 0111                      */
771   {illegal,0,     2, 8}, /* 78: 0100 1000 0111 1000                      */
772   {illegal,0,     2, 8}, /* 79: 0100 1000 0111 1001                      */
773   {illegal,0,     2, 8}, /* 7a: 0100 1000 0111 1010                      */
774   {illegal,0,     2, 8}, /* 7b: 0100 1000 0111 1011                      */
775   {illegal,0,     2, 8}, /* 7c: 0100 1000 0111 1100                      */
776   {illegal,0,     2, 8}, /* 7d: 0100 1000 0111 1101                      */
777   {illegal,0,     2, 8}, /* 7e: 0100 1000 0111 1110                      */
778   {illegal,0,     2, 8}, /* 7f: 0100 1000 0111 1111                      */
775   {SKNIT,"AN4"    }, /* 70: 0100 1000 0111 0000                      */
776   {SKNIT,"AN5"    }, /* 71: 0100 1000 0111 0001                      */
777   {SKNIT,"AN6"    }, /* 72: 0100 1000 0111 0010                      */
778   {SKNIT,"AN7"    }, /* 73: 0100 1000 0111 0011                      */
779   {SKNIT,"SB"     }, /* 74: 0100 1000 0111 0100                      */
780   {illegal,0     }, /* 75: 0100 1000 0111 0101                      */
781   {illegal,0     }, /* 76: 0100 1000 0111 0110                      */
782   {illegal,0     }, /* 77: 0100 1000 0111 0111                      */
783   {illegal,0     }, /* 78: 0100 1000 0111 1000                      */
784   {illegal,0     }, /* 79: 0100 1000 0111 1001                      */
785   {illegal,0     }, /* 7a: 0100 1000 0111 1010                      */
786   {illegal,0     }, /* 7b: 0100 1000 0111 1011                      */
787   {illegal,0     }, /* 7c: 0100 1000 0111 1100                      */
788   {illegal,0     }, /* 7d: 0100 1000 0111 1101                      */
789   {illegal,0     }, /* 7e: 0100 1000 0111 1110                      */
790   {illegal,0     }, /* 7f: 0100 1000 0111 1111                      */
779791
780   {illegal,0,     2, 8}, /* 80: 0100 1000 1000 0000                      */
781   {illegal,0,     2, 8}, /* 81: 0100 1000 1000 0001                      */
782   {LDEAX,"(DE)",   2,14}, /* 82: 0100 1000 1000 0010                      */
783   {LDEAX,"(HL)",   2,14}, /* 83: 0100 1000 1000 0011                      */
784   {LDEAX,"(DE++)", 2,14}, /* 84: 0100 1000 1000 0100                      */
785   {LDEAX,"(HL++)", 2,14}, /* 85: 0100 1000 1000 0101                      */
786   {illegal,0,     2, 8}, /* 86: 0100 1000 1000 0110                      */
787   {illegal,0,     2, 8}, /* 87: 0100 1000 1000 0111                      */
788   {illegal,0,     2, 8}, /* 88: 0100 1000 1000 1000                      */
789   {illegal,0,     2, 8}, /* 89: 0100 1000 1000 1001                      */
790   {illegal,0,     2, 8}, /* 8a: 0100 1000 1000 1010                      */
791   {LDEAX,"(DE+%b)",3,20}, /* 8b: 0100 1000 1000 1011 xxxx xxxx            */
792   {LDEAX,"(HL+A)", 2,20}, /* 8c: 0100 1000 1000 1100                      */
793   {LDEAX,"(HL+B)", 2,20}, /* 8d: 0100 1000 1000 1101                      */
794   {LDEAX,"(HL+EA)",2,20}, /* 8e: 0100 1000 1000 1110                      */
795   {LDEAX,"(HL+%b)",3,20}, /* 8f: 0100 1000 1000 1111 xxxx xxxx            */
792   {illegal,0     }, /* 80: 0100 1000 1000 0000                      */
793   {illegal,0     }, /* 81: 0100 1000 1000 0001                      */
794   {LDEAX,"(DE)"   }, /* 82: 0100 1000 1000 0010                      */
795   {LDEAX,"(HL)"   }, /* 83: 0100 1000 1000 0011                      */
796   {LDEAX,"(DE++)" }, /* 84: 0100 1000 1000 0100                      */
797   {LDEAX,"(HL++)" }, /* 85: 0100 1000 1000 0101                      */
798   {illegal,0     }, /* 86: 0100 1000 1000 0110                      */
799   {illegal,0     }, /* 87: 0100 1000 1000 0111                      */
800   {illegal,0     }, /* 88: 0100 1000 1000 1000                      */
801   {illegal,0     }, /* 89: 0100 1000 1000 1001                      */
802   {illegal,0     }, /* 8a: 0100 1000 1000 1010                      */
803   {LDEAX,"(DE+%b)"}, /* 8b: 0100 1000 1000 1011 xxxx xxxx            */
804   {LDEAX,"(HL+A)" }, /* 8c: 0100 1000 1000 1100                      */
805   {LDEAX,"(HL+B)" }, /* 8d: 0100 1000 1000 1101                      */
806   {LDEAX,"(HL+EA)"}, /* 8e: 0100 1000 1000 1110                      */
807   {LDEAX,"(HL+%b)"}, /* 8f: 0100 1000 1000 1111 xxxx xxxx            */
796808
797   {illegal,0,     2, 8}, /* 90: 0100 1000 1000 0000                      */
798   {illegal,0,     2, 8}, /* 91: 0100 1000 1000 0001                      */
799   {STEAX,"(DE)",   2,14}, /* 92: 0100 1000 1000 0010                      */
800   {STEAX,"(HL)",   2,14}, /* 93: 0100 1000 1000 0011                      */
801   {STEAX,"(DE++)", 2,14}, /* 94: 0100 1000 1000 0100                      */
802   {STEAX,"(HL++)", 2,14}, /* 95: 0100 1000 1000 0101                      */
803   {illegal,0,     2, 8}, /* 96: 0100 1000 1000 0110                      */
804   {illegal,0,     2, 8}, /* 97: 0100 1000 1000 0111                      */
805   {illegal,0,     2, 8}, /* 98: 0100 1000 1000 1000                      */
806   {illegal,0,     2, 8}, /* 99: 0100 1000 1000 1001                      */
807   {illegal,0,     2, 8}, /* 9a: 0100 1000 1000 1010                      */
808   {STEAX,"(DE+%b)",3,20}, /* 9b: 0100 1000 1000 1011 xxxx xxxx            */
809   {STEAX,"(HL+A)", 2,20}, /* 9c: 0100 1000 1000 1100                      */
810   {STEAX,"(HL+B)", 2,20}, /* 9d: 0100 1000 1000 1101                      */
811   {STEAX,"(HL+EA)",2,20}, /* 9e: 0100 1000 1000 1110                      */
812   {STEAX,"(HL+%b)",3,20}, /* 9f: 0100 1000 1000 1111 xxxx xxxx            */
809   {illegal,0     }, /* 90: 0100 1000 1000 0000                      */
810   {illegal,0     }, /* 91: 0100 1000 1000 0001                      */
811   {STEAX,"(DE)"   }, /* 92: 0100 1000 1000 0010                      */
812   {STEAX,"(HL)"   }, /* 93: 0100 1000 1000 0011                      */
813   {STEAX,"(DE++)" }, /* 94: 0100 1000 1000 0100                      */
814   {STEAX,"(HL++)" }, /* 95: 0100 1000 1000 0101                      */
815   {illegal,0     }, /* 96: 0100 1000 1000 0110                      */
816   {illegal,0     }, /* 97: 0100 1000 1000 0111                      */
817   {illegal,0     }, /* 98: 0100 1000 1000 1000                      */
818   {illegal,0     }, /* 99: 0100 1000 1000 1001                      */
819   {illegal,0     }, /* 9a: 0100 1000 1000 1010                      */
820   {STEAX,"(DE+%b)"}, /* 9b: 0100 1000 1000 1011 xxxx xxxx            */
821   {STEAX,"(HL+A)" }, /* 9c: 0100 1000 1000 1100                      */
822   {STEAX,"(HL+B)" }, /* 9d: 0100 1000 1000 1101                      */
823   {STEAX,"(HL+EA)"}, /* 9e: 0100 1000 1000 1110                      */
824   {STEAX,"(HL+%b)"}, /* 9f: 0100 1000 1000 1111 xxxx xxxx            */
813825
814   {DSLR,"EA",      2, 8}, /* a0: 0100 1000 1010 0000                      */
815   {illegal,0,     2, 8}, /* a1: 0100 1000 1010 0001                      */
816   {illegal,0,     2, 8}, /* a2: 0100 1000 1010 0010                      */
817   {illegal,0,     2, 8}, /* a3: 0100 1000 1010 0011                      */
818   {DSLL,"EA",      2, 8}, /* a4: 0100 1000 1010 0100                      */
819   {illegal,0,     2, 8}, /* a5: 0100 1000 1010 0101                      */
820   {illegal,0,     2, 8}, /* a6: 0100 1000 1010 0110                      */
821   {illegal,0,     2, 8}, /* a7: 0100 1000 1010 0111                      */
822   {TABLE,0,       2,17}, /* a8: 0100 1000 1010 1000                      */
823   {illegal,0,     2, 8}, /* a9: 0100 1000 1010 1001                      */
824   {CMC,0,        2, 8}, /* aa: 0100 1000 1010 1010                      */   /* 7807 */
825   {illegal,0,     2, 8}, /* ab: 0100 1000 1010 1011                      */
826   {EXA,0,        2, 8}, /* ac: 0100 1000 1010 1100                      */   /* 7807 */
827   {EXR,0,        2, 8}, /* ad: 0100 1000 1010 1101                      */   /* 7807 */
828   {EXH,0,        2, 8}, /* ae: 0100 1000 1010 1110                      */   /* 7807 */
829   {EXX,0,        2, 8}, /* af: 0100 1000 1010 1111                      */   /* 7807 */
826   {DSLR,"EA"      }, /* a0: 0100 1000 1010 0000                      */
827   {illegal,0     }, /* a1: 0100 1000 1010 0001                      */
828   {illegal,0     }, /* a2: 0100 1000 1010 0010                      */
829   {illegal,0     }, /* a3: 0100 1000 1010 0011                      */
830   {DSLL,"EA"      }, /* a4: 0100 1000 1010 0100                      */
831   {illegal,0     }, /* a5: 0100 1000 1010 0101                      */
832   {illegal,0     }, /* a6: 0100 1000 1010 0110                      */
833   {illegal,0     }, /* a7: 0100 1000 1010 0111                      */
834   {TABLE,0       }, /* a8: 0100 1000 1010 1000                      */
835   {illegal,0     }, /* a9: 0100 1000 1010 1001                      */
836   {CMC,0        }, /* aa: 0100 1000 1010 1010                      */   /* 7807 */
837   {illegal,0     }, /* ab: 0100 1000 1010 1011                      */
838   {EXA,0        }, /* ac: 0100 1000 1010 1100                      */   /* 7807 */
839   {EXR,0        }, /* ad: 0100 1000 1010 1101                      */   /* 7807 */
840   {EXH,0        }, /* ae: 0100 1000 1010 1110                      */   /* 7807 */
841   {EXX,0        }, /* af: 0100 1000 1010 1111                      */   /* 7807 */
830842
831   {DRLR,"EA",      2, 8}, /* b0: 0100 1000 1011 0000                      */
832   {illegal,0,     2, 8}, /* b1: 0100 1000 1011 0001                      */
833   {illegal,0,     2, 8}, /* b2: 0100 1000 1011 0010                      */
834   {illegal,0,     2, 8}, /* b3: 0100 1000 1011 0011                      */
835   {DRLL,"EA",      2, 8}, /* b4: 0100 1000 1011 0100                      */
836   {illegal,0,     2, 8}, /* b5: 0100 1000 1011 0101                      */
837   {illegal,0,     2, 8}, /* b6: 0100 1000 1011 0110                      */
838   {illegal,0,     2, 8}, /* b7: 0100 1000 1011 0111                      */
839   {illegal,0,     2, 8}, /* b8: 0100 1000 1011 1000                      */
840   {illegal,0,     2, 8}, /* b9: 0100 1000 1011 1001                      */
841   {illegal,0,     2, 8}, /* ba: 0100 1000 1011 1010                      */
842   {illegal,0,       2, 8}, /* bb: 0100 1000 1011 1011                      */
843   {illegal,0,     2, 8}, /* bc: 0100 1000 1011 1100                      */
844   {illegal,0,     2, 8}, /* bd: 0100 1000 1011 1101                      */
845   {illegal,0,     2, 8}, /* be: 0100 1000 1011 1110                      */
846   {illegal,0,     2, 8}, /* bf: 0100 1000 1011 1111                      */
843   {DRLR,"EA"      }, /* b0: 0100 1000 1011 0000                      */
844   {illegal,0     }, /* b1: 0100 1000 1011 0001                      */
845   {illegal,0     }, /* b2: 0100 1000 1011 0010                      */
846   {illegal,0     }, /* b3: 0100 1000 1011 0011                      */
847   {DRLL,"EA"      }, /* b4: 0100 1000 1011 0100                      */
848   {illegal,0     }, /* b5: 0100 1000 1011 0101                      */
849   {illegal,0     }, /* b6: 0100 1000 1011 0110                      */
850   {illegal,0     }, /* b7: 0100 1000 1011 0111                      */
851   {illegal,0     }, /* b8: 0100 1000 1011 1000                      */
852   {illegal,0     }, /* b9: 0100 1000 1011 1001                      */
853   {illegal,0     }, /* ba: 0100 1000 1011 1010                      */
854   {illegal,0       }, /* bb: 0100 1000 1011 1011                      */
855   {illegal,0     }, /* bc: 0100 1000 1011 1100                      */
856   {illegal,0     }, /* bd: 0100 1000 1011 1101                      */
857   {illegal,0     }, /* be: 0100 1000 1011 1110                      */
858   {illegal,0     }, /* bf: 0100 1000 1011 1111                      */
847859
848   {DMOV,"EA,ECNT", 2,14}, /* c0: 0100 1000 1100 0000                      */
849   {DMOV,"EA,ECPT0",2,14}, /* c1: 0100 1000 1100 0001                      */   /* 7807 */
850   {DMOV,"EA,ECPT1",2,14}, /* c2: 0100 1000 1100 0010                      */   /* 7807 */
851   {illegal,0,     2, 8}, /* c3: 0100 1000 1100 0011                      */
852   {illegal,0,     2, 8}, /* c4: 0100 1000 1100 0100                      */
853   {illegal,0,     2, 8}, /* c5: 0100 1000 1100 0101                      */
854   {illegal,0,     2, 8}, /* c6: 0100 1000 1100 0110                      */
855   {illegal,0,     2, 8}, /* c7: 0100 1000 1100 0111                      */
856   {illegal,0,     2, 8}, /* c8: 0100 1000 1100 1000                      */
857   {illegal,0,     2, 8}, /* c9: 0100 1000 1100 1001                      */
858   {illegal,0,     2, 8}, /* ca: 0100 1000 1100 1010                      */
859   {illegal,0,     2, 8}, /* cb: 0100 1000 1100 1011                      */
860   {illegal,0,     2, 8}, /* cc: 0100 1000 1100 1100                      */
861   {illegal,0,     2, 8}, /* cd: 0100 1000 1100 1101                      */
862   {illegal,0,     2, 8}, /* ce: 0100 1000 1100 1110                      */
863   {illegal,0,     2, 8}, /* cf: 0100 1000 1100 1111                      */
860   {DMOV,"EA,ECNT" }, /* c0: 0100 1000 1100 0000                      */
861   {DMOV,"EA,ECPT0"}, /* c1: 0100 1000 1100 0001                      */   /* 7807 */
862   {DMOV,"EA,ECPT1"}, /* c2: 0100 1000 1100 0010                      */   /* 7807 */
863   {illegal,0     }, /* c3: 0100 1000 1100 0011                      */
864   {illegal,0     }, /* c4: 0100 1000 1100 0100                      */
865   {illegal,0     }, /* c5: 0100 1000 1100 0101                      */
866   {illegal,0     }, /* c6: 0100 1000 1100 0110                      */
867   {illegal,0     }, /* c7: 0100 1000 1100 0111                      */
868   {illegal,0     }, /* c8: 0100 1000 1100 1000                      */
869   {illegal,0     }, /* c9: 0100 1000 1100 1001                      */
870   {illegal,0     }, /* ca: 0100 1000 1100 1010                      */
871   {illegal,0     }, /* cb: 0100 1000 1100 1011                      */
872   {illegal,0     }, /* cc: 0100 1000 1100 1100                      */
873   {illegal,0     }, /* cd: 0100 1000 1100 1101                      */
874   {illegal,0     }, /* ce: 0100 1000 1100 1110                      */
875   {illegal,0     }, /* cf: 0100 1000 1100 1111                      */
864876
865   {illegal,0,     2, 8}, /* d0: 0100 1000 1101 0000                      */
866   {illegal,0,     2, 8}, /* d1: 0100 1000 1101 0001                      */
867   {DMOV,"ETM0,EA", 2,14}, /* d2: 0100 1000 1101 0010                      */
868   {DMOV,"ETM1,EA", 2,14}, /* d3: 0100 1000 1101 0011                      */
869   {illegal,0,     2, 8}, /* d4: 0100 1000 1101 0100                      */
870   {illegal,0,     2, 8}, /* d5: 0100 1000 1101 0101                      */
871   {illegal,0,     2, 8}, /* d6: 0100 1000 1101 0110                      */
872   {illegal,0,     2, 8}, /* d7: 0100 1000 1101 0111                      */
873   {illegal,0,     2, 8}, /* d8: 0100 1000 1101 1000                      */
874   {illegal,0,     2, 8}, /* d9: 0100 1000 1101 1001                      */
875   {illegal,0,     2, 8}, /* da: 0100 1000 1101 1010                      */
876   {illegal,0,     2, 8}, /* db: 0100 1000 1101 1011                      */
877   {illegal,0,     2, 8}, /* dc: 0100 1000 1101 1100                      */
878   {illegal,0,     2, 8}, /* dd: 0100 1000 1101 1101                      */
879   {illegal,0,     2, 8}, /* de: 0100 1000 1101 1110                      */
880   {illegal,0,     2, 8}, /* df: 0100 1000 1101 1111                      */
877   {illegal,0     }, /* d0: 0100 1000 1101 0000                      */
878   {illegal,0     }, /* d1: 0100 1000 1101 0001                      */
879   {DMOV,"ETM0,EA" }, /* d2: 0100 1000 1101 0010                      */
880   {DMOV,"ETM1,EA" }, /* d3: 0100 1000 1101 0011                      */
881   {illegal,0     }, /* d4: 0100 1000 1101 0100                      */
882   {illegal,0     }, /* d5: 0100 1000 1101 0101                      */
883   {illegal,0     }, /* d6: 0100 1000 1101 0110                      */
884   {illegal,0     }, /* d7: 0100 1000 1101 0111                      */
885   {illegal,0     }, /* d8: 0100 1000 1101 1000                      */
886   {illegal,0     }, /* d9: 0100 1000 1101 1001                      */
887   {illegal,0     }, /* da: 0100 1000 1101 1010                      */
888   {illegal,0     }, /* db: 0100 1000 1101 1011                      */
889   {illegal,0     }, /* dc: 0100 1000 1101 1100                      */
890   {illegal,0     }, /* dd: 0100 1000 1101 1101                      */
891   {illegal,0     }, /* de: 0100 1000 1101 1110                      */
892   {illegal,0     }, /* df: 0100 1000 1101 1111                      */
881893
882   {illegal,0,     2, 8}, /* e0: 0100 1000 1110 0000                      */
883   {illegal,0,     2, 8}, /* e1: 0100 1000 1110 0001                      */
884   {illegal,0,     2, 8}, /* e2: 0100 1000 1110 0010                      */
885   {illegal,0,     2, 8}, /* e3: 0100 1000 1110 0011                      */
886   {illegal,0,     2, 8}, /* e4: 0100 1000 1110 0100                      */
887   {illegal,0,     2, 8}, /* e5: 0100 1000 1110 0101                      */
888   {illegal,0,     2, 8}, /* e6: 0100 1000 1110 0110                      */
889   {illegal,0,     2, 8}, /* e7: 0100 1000 1110 0111                      */
890   {illegal,0,     2, 8}, /* e8: 0100 1000 1110 1000                      */
891   {illegal,0,     2, 8}, /* e9: 0100 1000 1110 1001                      */
892   {illegal,0,     2, 8}, /* ea: 0100 1000 1110 1010                      */
893   {illegal,0,     2, 8}, /* eb: 0100 1000 1110 1011                      */
894   {illegal,0,     2, 8}, /* ec: 0100 1000 1110 1100                      */
895   {illegal,0,     2, 8}, /* ed: 0100 1000 1110 1101                      */
896   {illegal,0,     2, 8}, /* ee: 0100 1000 1110 1110                      */
897   {illegal,0,     2, 8}, /* ef: 0100 1000 1110 1111                      */
894   {illegal,0     }, /* e0: 0100 1000 1110 0000                      */
895   {illegal,0     }, /* e1: 0100 1000 1110 0001                      */
896   {illegal,0     }, /* e2: 0100 1000 1110 0010                      */
897   {illegal,0     }, /* e3: 0100 1000 1110 0011                      */
898   {illegal,0     }, /* e4: 0100 1000 1110 0100                      */
899   {illegal,0     }, /* e5: 0100 1000 1110 0101                      */
900   {illegal,0     }, /* e6: 0100 1000 1110 0110                      */
901   {illegal,0     }, /* e7: 0100 1000 1110 0111                      */
902   {illegal,0     }, /* e8: 0100 1000 1110 1000                      */
903   {illegal,0     }, /* e9: 0100 1000 1110 1001                      */
904   {illegal,0     }, /* ea: 0100 1000 1110 1010                      */
905   {illegal,0     }, /* eb: 0100 1000 1110 1011                      */
906   {illegal,0     }, /* ec: 0100 1000 1110 1100                      */
907   {illegal,0     }, /* ed: 0100 1000 1110 1101                      */
908   {illegal,0     }, /* ee: 0100 1000 1110 1110                      */
909   {illegal,0     }, /* ef: 0100 1000 1110 1111                      */
898910
899   {illegal,0,     2, 8}, /* f0: 0100 1000 1111 0000                      */
900   {illegal,0,     2, 8}, /* f1: 0100 1000 1111 0001                      */
901   {illegal,0,     2, 8}, /* f2: 0100 1000 1111 0010                      */
902   {illegal,0,     2, 8}, /* f3: 0100 1000 1111 0011                      */
903   {illegal,0,     2, 8}, /* f4: 0100 1000 1111 0100                      */
904   {illegal,0,     2, 8}, /* f5: 0100 1000 1111 0101                      */
905   {illegal,0,     2, 8}, /* f6: 0100 1000 1111 0110                      */
906   {illegal,0,     2, 8}, /* f7: 0100 1000 1111 0111                      */
907   {illegal,0,     2, 8}, /* f8: 0100 1000 1111 1000                      */
908   {illegal,0,     2, 8}, /* f9: 0100 1000 1111 1001                      */
909   {illegal,0,     2, 8}, /* fa: 0100 1000 1111 1010                      */
910   {illegal,0,     2, 8}, /* fb: 0100 1000 1111 1011                      */
911   {illegal,0,     2, 8}, /* fc: 0100 1000 1111 1100                      */
912   {illegal,0,     2, 8}, /* fd: 0100 1000 1111 1101                      */
913   {illegal,0,     2, 8}, /* fe: 0100 1000 1111 1110                      */
914   {illegal,0,     2, 8}   /* ff: 0100 1000 1111 1111                      */
911   {illegal,0     }, /* f0: 0100 1000 1111 0000                      */
912   {illegal,0     }, /* f1: 0100 1000 1111 0001                      */
913   {illegal,0     }, /* f2: 0100 1000 1111 0010                      */
914   {illegal,0     }, /* f3: 0100 1000 1111 0011                      */
915   {illegal,0     }, /* f4: 0100 1000 1111 0100                      */
916   {illegal,0     }, /* f5: 0100 1000 1111 0101                      */
917   {illegal,0     }, /* f6: 0100 1000 1111 0110                      */
918   {illegal,0     }, /* f7: 0100 1000 1111 0111                      */
919   {illegal,0     }, /* f8: 0100 1000 1111 1000                      */
920   {illegal,0     }, /* f9: 0100 1000 1111 1001                      */
921   {illegal,0     }, /* fa: 0100 1000 1111 1010                      */
922   {illegal,0     }, /* fb: 0100 1000 1111 1011                      */
923   {illegal,0     }, /* fc: 0100 1000 1111 1100                      */
924   {illegal,0     }, /* fd: 0100 1000 1111 1101                      */
925   {illegal,0     }, /* fe: 0100 1000 1111 1110                      */
926   {illegal,0     }   /* ff: 0100 1000 1111 1111                      */
915927};
916928
917929/* prefix 4C */
918930static const struct dasm_s  dasm4C_7810[256] =
919931{
920   {illegal,0,     2, 8}, /* 00: 0100 1100 0000 0000                      */
921   {illegal,0,     2, 8}, /* 01: 0100 1100 0000 0001                      */
922   {illegal,0,     2, 8}, /* 02: 0100 1100 0000 0010                      */
923   {illegal,0,     2, 8}, /* 03: 0100 1100 0000 0011                      */
924   {illegal,0,     2, 8}, /* 04: 0100 1100 0000 0100                      */
925   {illegal,0,     2, 8}, /* 05: 0100 1100 0000 0101                      */
926   {illegal,0,     2, 8}, /* 06: 0100 1100 0000 0110                      */
927   {illegal,0,     2, 8}, /* 07: 0100 1100 0000 0111                      */
928   {illegal,0,     2, 8}, /* 08: 0100 1100 0000 1000                      */
929   {illegal,0,     2, 8}, /* 09: 0100 1100 0000 1001                      */
930   {illegal,0,     2, 8}, /* 0a: 0100 1100 0000 1010                      */
931   {illegal,0,     2, 8}, /* 0b: 0100 1100 0000 1011                      */
932   {illegal,0,     2, 8}, /* 0c: 0100 1100 0000 1100                      */
933   {illegal,0,     2, 8}, /* 0d: 0100 1100 0000 1101                      */
934   {illegal,0,     2, 8}, /* 0e: 0100 1100 0000 1110                      */
935   {illegal,0,     2, 8}, /* 0f: 0100 1100 0000 1111                      */
932   {illegal,0     }, /* 00: 0100 1100 0000 0000                      */
933   {illegal,0     }, /* 01: 0100 1100 0000 0001                      */
934   {illegal,0     }, /* 02: 0100 1100 0000 0010                      */
935   {illegal,0     }, /* 03: 0100 1100 0000 0011                      */
936   {illegal,0     }, /* 04: 0100 1100 0000 0100                      */
937   {illegal,0     }, /* 05: 0100 1100 0000 0101                      */
938   {illegal,0     }, /* 06: 0100 1100 0000 0110                      */
939   {illegal,0     }, /* 07: 0100 1100 0000 0111                      */
940   {illegal,0     }, /* 08: 0100 1100 0000 1000                      */
941   {illegal,0     }, /* 09: 0100 1100 0000 1001                      */
942   {illegal,0     }, /* 0a: 0100 1100 0000 1010                      */
943   {illegal,0     }, /* 0b: 0100 1100 0000 1011                      */
944   {illegal,0     }, /* 0c: 0100 1100 0000 1100                      */
945   {illegal,0     }, /* 0d: 0100 1100 0000 1101                      */
946   {illegal,0     }, /* 0e: 0100 1100 0000 1110                      */
947   {illegal,0     }, /* 0f: 0100 1100 0000 1111                      */
936948
937   {illegal,0,     2, 8}, /* 10: 0100 1100 0001 0000                      */
938   {illegal,0,     2, 8}, /* 11: 0100 1100 0001 0001                      */
939   {illegal,0,     2, 8}, /* 12: 0100 1100 0001 0010                      */
940   {illegal,0,     2, 8}, /* 13: 0100 1100 0001 0011                      */
941   {illegal,0,     2, 8}, /* 14: 0100 1100 0001 0100                      */
942   {illegal,0,     2, 8}, /* 15: 0100 1100 0001 0101                      */
943   {illegal,0,     2, 8}, /* 16: 0100 1100 0001 0110                      */
944   {illegal,0,     2, 8}, /* 17: 0100 1100 0001 0111                      */
945   {illegal,0,     2, 8}, /* 18: 0100 1100 0001 1000                      */
946   {illegal,0,     2, 8}, /* 19: 0100 1100 0001 1001                      */
947   {illegal,0,     2, 8}, /* 1a: 0100 1100 0001 1010                      */
948   {illegal,0,     2, 8}, /* 1b: 0100 1100 0001 1011                      */
949   {illegal,0,     2, 8}, /* 1c: 0100 1100 0001 1100                      */
950   {illegal,0,     2, 8}, /* 1d: 0100 1100 0001 1101                      */
951   {illegal,0,     2, 8}, /* 1e: 0100 1100 0001 1110                      */
952   {illegal,0,     2, 8}, /* 1f: 0100 1100 0001 1111                      */
949   {illegal,0     }, /* 10: 0100 1100 0001 0000                      */
950   {illegal,0     }, /* 11: 0100 1100 0001 0001                      */
951   {illegal,0     }, /* 12: 0100 1100 0001 0010                      */
952   {illegal,0     }, /* 13: 0100 1100 0001 0011                      */
953   {illegal,0     }, /* 14: 0100 1100 0001 0100                      */
954   {illegal,0     }, /* 15: 0100 1100 0001 0101                      */
955   {illegal,0     }, /* 16: 0100 1100 0001 0110                      */
956   {illegal,0     }, /* 17: 0100 1100 0001 0111                      */
957   {illegal,0     }, /* 18: 0100 1100 0001 1000                      */
958   {illegal,0     }, /* 19: 0100 1100 0001 1001                      */
959   {illegal,0     }, /* 1a: 0100 1100 0001 1010                      */
960   {illegal,0     }, /* 1b: 0100 1100 0001 1011                      */
961   {illegal,0     }, /* 1c: 0100 1100 0001 1100                      */
962   {illegal,0     }, /* 1d: 0100 1100 0001 1101                      */
963   {illegal,0     }, /* 1e: 0100 1100 0001 1110                      */
964   {illegal,0     }, /* 1f: 0100 1100 0001 1111                      */
953965
954   {illegal,0,     2, 8}, /* 20: 0100 1100 0010 0000                      */
955   {illegal,0,     2, 8}, /* 21: 0100 1100 0010 0001                      */
956   {illegal,0,     2, 8}, /* 22: 0100 1100 0010 0010                      */
957   {illegal,0,     2, 8}, /* 23: 0100 1100 0010 0011                      */
958   {illegal,0,     2, 8}, /* 24: 0100 1100 0010 0100                      */
959   {illegal,0,     2, 8}, /* 25: 0100 1100 0010 0101                      */
960   {illegal,0,     2, 8}, /* 26: 0100 1100 0010 0110                      */
961   {illegal,0,     2, 8}, /* 27: 0100 1100 0010 0111                      */
962   {illegal,0,     2, 8}, /* 28: 0100 1100 0010 1000                      */
963   {illegal,0,     2, 8}, /* 29: 0100 1100 0010 1001                      */
964   {illegal,0,     2, 8}, /* 2a: 0100 1100 0010 1010                      */
965   {illegal,0,     2, 8}, /* 2b: 0100 1100 0010 1011                      */
966   {illegal,0,     2, 8}, /* 2c: 0100 1100 0010 1100                      */
967   {illegal,0,     2, 8}, /* 2d: 0100 1100 0010 1101                      */
968   {illegal,0,     2, 8}, /* 2e: 0100 1100 0010 1110                      */
969   {illegal,0,     2, 8}, /* 2f: 0100 1100 0010 1111                      */
966   {illegal,0     }, /* 20: 0100 1100 0010 0000                      */
967   {illegal,0     }, /* 21: 0100 1100 0010 0001                      */
968   {illegal,0     }, /* 22: 0100 1100 0010 0010                      */
969   {illegal,0     }, /* 23: 0100 1100 0010 0011                      */
970   {illegal,0     }, /* 24: 0100 1100 0010 0100                      */
971   {illegal,0     }, /* 25: 0100 1100 0010 0101                      */
972   {illegal,0     }, /* 26: 0100 1100 0010 0110                      */
973   {illegal,0     }, /* 27: 0100 1100 0010 0111                      */
974   {illegal,0     }, /* 28: 0100 1100 0010 1000                      */
975   {illegal,0     }, /* 29: 0100 1100 0010 1001                      */
976   {illegal,0     }, /* 2a: 0100 1100 0010 1010                      */
977   {illegal,0     }, /* 2b: 0100 1100 0010 1011                      */
978   {illegal,0     }, /* 2c: 0100 1100 0010 1100                      */
979   {illegal,0     }, /* 2d: 0100 1100 0010 1101                      */
980   {illegal,0     }, /* 2e: 0100 1100 0010 1110                      */
981   {illegal,0     }, /* 2f: 0100 1100 0010 1111                      */
970982
971   {illegal,0,     2, 8}, /* 30: 0100 1100 0011 0000                      */
972   {illegal,0,     2, 8}, /* 31: 0100 1100 0011 0001                      */
973   {illegal,0,     2, 8}, /* 32: 0100 1100 0011 0010                      */
974   {illegal,0,     2, 8}, /* 33: 0100 1100 0011 0011                      */
975   {illegal,0,     2, 8}, /* 34: 0100 1100 0011 0100                      */
976   {illegal,0,     2, 8}, /* 35: 0100 1100 0011 0101                      */
977   {illegal,0,     2, 8}, /* 36: 0100 1100 0011 0110                      */
978   {illegal,0,     2, 8}, /* 37: 0100 1100 0011 0111                      */
979   {illegal,0,     2, 8}, /* 38: 0100 1100 0011 1000                      */
980   {illegal,0,     2, 8}, /* 39: 0100 1100 0011 1001                      */
981   {illegal,0,     2, 8}, /* 3a: 0100 1100 0011 1010                      */
982   {illegal,0,     2, 8}, /* 3b: 0100 1100 0011 1011                      */
983   {illegal,0,     2, 8}, /* 3c: 0100 1100 0011 1100                      */
984   {illegal,0,     2, 8}, /* 3d: 0100 1100 0011 1101                      */
985   {illegal,0,     2, 8}, /* 3e: 0100 1100 0011 1110                      */
986   {illegal,0,     2, 8}, /* 3f: 0100 1100 0011 1111                      */
983   {illegal,0     }, /* 30: 0100 1100 0011 0000                      */
984   {illegal,0     }, /* 31: 0100 1100 0011 0001                      */
985   {illegal,0     }, /* 32: 0100 1100 0011 0010                      */
986   {illegal,0     }, /* 33: 0100 1100 0011 0011                      */
987   {illegal,0     }, /* 34: 0100 1100 0011 0100                      */
988   {illegal,0     }, /* 35: 0100 1100 0011 0101                      */
989   {illegal,0     }, /* 36: 0100 1100 0011 0110                      */
990   {illegal,0     }, /* 37: 0100 1100 0011 0111                      */
991   {illegal,0     }, /* 38: 0100 1100 0011 1000                      */
992   {illegal,0     }, /* 39: 0100 1100 0011 1001                      */
993   {illegal,0     }, /* 3a: 0100 1100 0011 1010                      */
994   {illegal,0     }, /* 3b: 0100 1100 0011 1011                      */
995   {illegal,0     }, /* 3c: 0100 1100 0011 1100                      */
996   {illegal,0     }, /* 3d: 0100 1100 0011 1101                      */
997   {illegal,0     }, /* 3e: 0100 1100 0011 1110                      */
998   {illegal,0     }, /* 3f: 0100 1100 0011 1111                      */
987999
988   {illegal,0,     2, 8}, /* 40: 0100 1100 0100 0000                      */
989   {illegal,0,     2, 8}, /* 41: 0100 1100 0100 0001                      */
990   {illegal,0,     2, 8}, /* 42: 0100 1100 0100 0010                      */
991   {illegal,0,     2, 8}, /* 43: 0100 1100 0100 0011                      */
992   {illegal,0,     2, 8}, /* 44: 0100 1100 0100 0100                      */
993   {illegal,0,     2, 8}, /* 45: 0100 1100 0100 0101                      */
994   {illegal,0,     2, 8}, /* 46: 0100 1100 0100 0110                      */
995   {illegal,0,     2, 8}, /* 47: 0100 1100 0100 0111                      */
996   {illegal,0,     2, 8}, /* 48: 0100 1100 0100 1000                      */
997   {illegal,0,     2, 8}, /* 49: 0100 1100 0100 1001                      */
998   {illegal,0,     2, 8}, /* 4a: 0100 1100 0100 1010                      */
999   {illegal,0,     2, 8}, /* 4b: 0100 1100 0100 1011                      */
1000   {illegal,0,     2, 8}, /* 4c: 0100 1100 0100 1100                      */
1001   {illegal,0,     2, 8}, /* 4d: 0100 1100 0100 1101                      */
1002   {illegal,0,     2, 8}, /* 4e: 0100 1100 0100 1110                      */
1003   {illegal,0,     2, 8}, /* 4f: 0100 1100 0100 1111                      */
1000   {illegal,0     }, /* 40: 0100 1100 0100 0000                      */
1001   {illegal,0     }, /* 41: 0100 1100 0100 0001                      */
1002   {illegal,0     }, /* 42: 0100 1100 0100 0010                      */
1003   {illegal,0     }, /* 43: 0100 1100 0100 0011                      */
1004   {illegal,0     }, /* 44: 0100 1100 0100 0100                      */
1005   {illegal,0     }, /* 45: 0100 1100 0100 0101                      */
1006   {illegal,0     }, /* 46: 0100 1100 0100 0110                      */
1007   {illegal,0     }, /* 47: 0100 1100 0100 0111                      */
1008   {illegal,0     }, /* 48: 0100 1100 0100 1000                      */
1009   {illegal,0     }, /* 49: 0100 1100 0100 1001                      */
1010   {illegal,0     }, /* 4a: 0100 1100 0100 1010                      */
1011   {illegal,0     }, /* 4b: 0100 1100 0100 1011                      */
1012   {illegal,0     }, /* 4c: 0100 1100 0100 1100                      */
1013   {illegal,0     }, /* 4d: 0100 1100 0100 1101                      */
1014   {illegal,0     }, /* 4e: 0100 1100 0100 1110                      */
1015   {illegal,0     }, /* 4f: 0100 1100 0100 1111                      */
10041016
1005   {illegal,0,     2, 8}, /* 50: 0100 1100 0101 0000                      */
1006   {illegal,0,     2, 8}, /* 51: 0100 1100 0101 0001                      */
1007   {illegal,0,     2, 8}, /* 52: 0100 1100 0101 0010                      */
1008   {illegal,0,     2, 8}, /* 53: 0100 1100 0101 0011                      */
1009   {illegal,0,     2, 8}, /* 54: 0100 1100 0101 0100                      */
1010   {illegal,0,     2, 8}, /* 55: 0100 1100 0101 0101                      */
1011   {illegal,0,     2, 8}, /* 56: 0100 1100 0101 0110                      */
1012   {illegal,0,     2, 8}, /* 57: 0100 1100 0101 0111                      */
1013   {illegal,0,     2, 8}, /* 58: 0100 1100 0101 1000                      */
1014   {illegal,0,     2, 8}, /* 59: 0100 1100 0101 1001                      */
1015   {illegal,0,     2, 8}, /* 5a: 0100 1100 0101 1010                      */
1016   {illegal,0,     2, 8}, /* 5b: 0100 1100 0101 1011                      */
1017   {illegal,0,     2, 8}, /* 5c: 0100 1100 0101 1100                      */
1018   {illegal,0,     2, 8}, /* 5d: 0100 1100 0101 1101                      */
1019   {illegal,0,     2, 8}, /* 5e: 0100 1100 0101 1110                      */
1020   {illegal,0,     2, 8}, /* 5f: 0100 1100 0101 1111                      */
1017   {illegal,0     }, /* 50: 0100 1100 0101 0000                      */
1018   {illegal,0     }, /* 51: 0100 1100 0101 0001                      */
1019   {illegal,0     }, /* 52: 0100 1100 0101 0010                      */
1020   {illegal,0     }, /* 53: 0100 1100 0101 0011                      */
1021   {illegal,0     }, /* 54: 0100 1100 0101 0100                      */
1022   {illegal,0     }, /* 55: 0100 1100 0101 0101                      */
1023   {illegal,0     }, /* 56: 0100 1100 0101 0110                      */
1024   {illegal,0     }, /* 57: 0100 1100 0101 0111                      */
1025   {illegal,0     }, /* 58: 0100 1100 0101 1000                      */
1026   {illegal,0     }, /* 59: 0100 1100 0101 1001                      */
1027   {illegal,0     }, /* 5a: 0100 1100 0101 1010                      */
1028   {illegal,0     }, /* 5b: 0100 1100 0101 1011                      */
1029   {illegal,0     }, /* 5c: 0100 1100 0101 1100                      */
1030   {illegal,0     }, /* 5d: 0100 1100 0101 1101                      */
1031   {illegal,0     }, /* 5e: 0100 1100 0101 1110                      */
1032   {illegal,0     }, /* 5f: 0100 1100 0101 1111                      */
10211033
1022   {illegal,0,     2, 8}, /* 60: 0100 1100 0110 0000                      */
1023   {illegal,0,     2, 8}, /* 61: 0100 1100 0110 0001                      */
1024   {illegal,0,     2, 8}, /* 62: 0100 1100 0110 0010                      */
1025   {illegal,0,     2, 8}, /* 63: 0100 1100 0110 0011                      */
1026   {illegal,0,     2, 8}, /* 64: 0100 1100 0110 0100                      */
1027   {illegal,0,     2, 8}, /* 65: 0100 1100 0110 0101                      */
1028   {illegal,0,     2, 8}, /* 66: 0100 1100 0110 0110                      */
1029   {illegal,0,     2, 8}, /* 67: 0100 1100 0110 0111                      */
1030   {illegal,0,     2, 8}, /* 68: 0100 1100 0110 1000                      */
1031   {illegal,0,     2, 8}, /* 69: 0100 1100 0110 1001                      */
1032   {illegal,0,     2, 8}, /* 6a: 0100 1100 0110 1010                      */
1033   {illegal,0,     2, 8}, /* 6b: 0100 1100 0110 1011                      */
1034   {illegal,0,     2, 8}, /* 6c: 0100 1100 0110 1100                      */
1035   {illegal,0,     2, 8}, /* 6d: 0100 1100 0110 1101                      */
1036   {illegal,0,     2, 8}, /* 6e: 0100 1100 0110 1110                      */
1037   {illegal,0,     2, 8}, /* 6f: 0100 1100 0110 1111                      */
1034   {illegal,0     }, /* 60: 0100 1100 0110 0000                      */
1035   {illegal,0     }, /* 61: 0100 1100 0110 0001                      */
1036   {illegal,0     }, /* 62: 0100 1100 0110 0010                      */
1037   {illegal,0     }, /* 63: 0100 1100 0110 0011                      */
1038   {illegal,0     }, /* 64: 0100 1100 0110 0100                      */
1039   {illegal,0     }, /* 65: 0100 1100 0110 0101                      */
1040   {illegal,0     }, /* 66: 0100 1100 0110 0110                      */
1041   {illegal,0     }, /* 67: 0100 1100 0110 0111                      */
1042   {illegal,0     }, /* 68: 0100 1100 0110 1000                      */
1043   {illegal,0     }, /* 69: 0100 1100 0110 1001                      */
1044   {illegal,0     }, /* 6a: 0100 1100 0110 1010                      */
1045   {illegal,0     }, /* 6b: 0100 1100 0110 1011                      */
1046   {illegal,0     }, /* 6c: 0100 1100 0110 1100                      */
1047   {illegal,0     }, /* 6d: 0100 1100 0110 1101                      */
1048   {illegal,0     }, /* 6e: 0100 1100 0110 1110                      */
1049   {illegal,0     }, /* 6f: 0100 1100 0110 1111                      */
10381050
1039   {illegal,0,     2, 8}, /* 70: 0100 1100 0111 0000                      */
1040   {illegal,0,     2, 8}, /* 71: 0100 1100 0111 0001                      */
1041   {illegal,0,     2, 8}, /* 72: 0100 1100 0111 0010                      */
1042   {illegal,0,     2, 8}, /* 73: 0100 1100 0111 0011                      */
1043   {illegal,0,     2, 8}, /* 74: 0100 1100 0111 0100                      */
1044   {illegal,0,     2, 8}, /* 75: 0100 1100 0111 0101                      */
1045   {illegal,0,     2, 8}, /* 76: 0100 1100 0111 0110                      */
1046   {illegal,0,     2, 8}, /* 77: 0100 1100 0111 0111                      */
1047   {illegal,0,     2, 8}, /* 78: 0100 1100 0111 1000                      */
1048   {illegal,0,     2, 8}, /* 79: 0100 1100 0111 1001                      */
1049   {illegal,0,     2, 8}, /* 7a: 0100 1100 0111 1010                      */
1050   {illegal,0,     2, 8}, /* 7b: 0100 1100 0111 1011                      */
1051   {illegal,0,     2, 8}, /* 7c: 0100 1100 0111 1100                      */
1052   {illegal,0,     2, 8}, /* 7d: 0100 1100 0111 1101                      */
1053   {illegal,0,     2, 8}, /* 7e: 0100 1100 0111 1110                      */
1054   {illegal,0,     2, 8}, /* 7f: 0100 1100 0111 1111                      */
1051   {illegal,0     }, /* 70: 0100 1100 0111 0000                      */
1052   {illegal,0     }, /* 71: 0100 1100 0111 0001                      */
1053   {illegal,0     }, /* 72: 0100 1100 0111 0010                      */
1054   {illegal,0     }, /* 73: 0100 1100 0111 0011                      */
1055   {illegal,0     }, /* 74: 0100 1100 0111 0100                      */
1056   {illegal,0     }, /* 75: 0100 1100 0111 0101                      */
1057   {illegal,0     }, /* 76: 0100 1100 0111 0110                      */
1058   {illegal,0     }, /* 77: 0100 1100 0111 0111                      */
1059   {illegal,0     }, /* 78: 0100 1100 0111 1000                      */
1060   {illegal,0     }, /* 79: 0100 1100 0111 1001                      */
1061   {illegal,0     }, /* 7a: 0100 1100 0111 1010                      */
1062   {illegal,0     }, /* 7b: 0100 1100 0111 1011                      */
1063   {illegal,0     }, /* 7c: 0100 1100 0111 1100                      */
1064   {illegal,0     }, /* 7d: 0100 1100 0111 1101                      */
1065   {illegal,0     }, /* 7e: 0100 1100 0111 1110                      */
1066   {illegal,0     }, /* 7f: 0100 1100 0111 1111                      */
10551067
1056   {illegal,0,     2, 8}, /* 80: 0100 1100 1000 0000                      */
1057   {illegal,0,     2, 8}, /* 81: 0100 1100 1000 0001                      */
1058   {illegal,0,     2, 8}, /* 82: 0100 1100 1000 0010                      */
1059   {illegal,0,     2, 8}, /* 83: 0100 1100 1000 0011                      */
1060   {illegal,0,     2, 8}, /* 84: 0100 1100 1000 0100                      */
1061   {illegal,0,     2, 8}, /* 85: 0100 1100 1000 0101                      */
1062   {illegal,0,     2, 8}, /* 86: 0100 1100 1000 0110                      */
1063   {illegal,0,     2, 8}, /* 87: 0100 1100 1000 0111                      */
1064   {illegal,0,     2, 8}, /* 88: 0100 1100 1000 1000                      */
1065   {illegal,0,     2, 8}, /* 89: 0100 1100 1000 1001                      */
1066   {illegal,0,     2, 8}, /* 8a: 0100 1100 1000 1010                      */
1067   {illegal,0,     2, 8}, /* 8b: 0100 1100 1000 1011                      */
1068   {illegal,0,     2, 8}, /* 8c: 0100 1100 1000 1100                      */
1069   {illegal,0,     2, 8}, /* 8d: 0100 1100 1000 1101                      */
1070   {illegal,0,     2, 8}, /* 8e: 0100 1100 1000 1110                      */
1071   {illegal,0,     2, 8}, /* 8f: 0100 1100 1000 1111                      */
1068   {illegal,0     }, /* 80: 0100 1100 1000 0000                      */
1069   {illegal,0     }, /* 81: 0100 1100 1000 0001                      */
1070   {illegal,0     }, /* 82: 0100 1100 1000 0010                      */
1071   {illegal,0     }, /* 83: 0100 1100 1000 0011                      */
1072   {illegal,0     }, /* 84: 0100 1100 1000 0100                      */
1073   {illegal,0     }, /* 85: 0100 1100 1000 0101                      */
1074   {illegal,0     }, /* 86: 0100 1100 1000 0110                      */
1075   {illegal,0     }, /* 87: 0100 1100 1000 0111                      */
1076   {illegal,0     }, /* 88: 0100 1100 1000 1000                      */
1077   {illegal,0     }, /* 89: 0100 1100 1000 1001                      */
1078   {illegal,0     }, /* 8a: 0100 1100 1000 1010                      */
1079   {illegal,0     }, /* 8b: 0100 1100 1000 1011                      */
1080   {illegal,0     }, /* 8c: 0100 1100 1000 1100                      */
1081   {illegal,0     }, /* 8d: 0100 1100 1000 1101                      */
1082   {illegal,0     }, /* 8e: 0100 1100 1000 1110                      */
1083   {illegal,0     }, /* 8f: 0100 1100 1000 1111                      */
10721084
1073   {illegal,0,     2, 8}, /* 90: 0100 1100 1001 0000                      */
1074   {illegal,0,     2, 8}, /* 91: 0100 1100 1001 0001                      */
1075   {illegal,0,     2, 8}, /* 92: 0100 1100 1001 0010                      */
1076   {illegal,0,     2, 8}, /* 93: 0100 1100 1001 0011                      */
1077   {illegal,0,     2, 8}, /* 94: 0100 1100 1001 0100                      */
1078   {illegal,0,     2, 8}, /* 95: 0100 1100 1001 0101                      */
1079   {illegal,0,     2, 8}, /* 96: 0100 1100 1001 0110                      */
1080   {illegal,0,     2, 8}, /* 97: 0100 1100 1001 0111                      */
1081   {illegal,0,     2, 8}, /* 98: 0100 1100 1001 1000                      */
1082   {illegal,0,     2, 8}, /* 99: 0100 1100 1001 1001                      */
1083   {illegal,0,     2, 8}, /* 9a: 0100 1100 1001 1010                      */
1084   {illegal,0,     2, 8}, /* 9b: 0100 1100 1001 1011                      */
1085   {illegal,0,     2, 8}, /* 9c: 0100 1100 1001 1100                      */
1086   {illegal,0,     2, 8}, /* 9d: 0100 1100 1001 1101                      */
1087   {illegal,0,     2, 8}, /* 9e: 0100 1100 1001 1110                      */
1088   {illegal,0,     2, 8}, /* 9f: 0100 1100 1001 1111                      */
1085   {illegal,0     }, /* 90: 0100 1100 1001 0000                      */
1086   {illegal,0     }, /* 91: 0100 1100 1001 0001                      */
1087   {illegal,0     }, /* 92: 0100 1100 1001 0010                      */
1088   {illegal,0     }, /* 93: 0100 1100 1001 0011                      */
1089   {illegal,0     }, /* 94: 0100 1100 1001 0100                      */
1090   {illegal,0     }, /* 95: 0100 1100 1001 0101                      */
1091   {illegal,0     }, /* 96: 0100 1100 1001 0110                      */
1092   {illegal,0     }, /* 97: 0100 1100 1001 0111                      */
1093   {illegal,0     }, /* 98: 0100 1100 1001 1000                      */
1094   {illegal,0     }, /* 99: 0100 1100 1001 1001                      */
1095   {illegal,0     }, /* 9a: 0100 1100 1001 1010                      */
1096   {illegal,0     }, /* 9b: 0100 1100 1001 1011                      */
1097   {illegal,0     }, /* 9c: 0100 1100 1001 1100                      */
1098   {illegal,0     }, /* 9d: 0100 1100 1001 1101                      */
1099   {illegal,0     }, /* 9e: 0100 1100 1001 1110                      */
1100   {illegal,0     }, /* 9f: 0100 1100 1001 1111                      */
10891101
1090   {illegal,0,     2, 8}, /* a0: 0100 1100 1010 0000                      */
1091   {illegal,0,     2, 8}, /* a1: 0100 1100 1010 0001                      */
1092   {illegal,0,     2, 8}, /* a2: 0100 1100 1010 0010                      */
1093   {illegal,0,     2, 8}, /* a3: 0100 1100 1010 0011                      */
1094   {illegal,0,     2, 8}, /* a4: 0100 1100 1010 0100                      */
1095   {illegal,0,     2, 8}, /* a5: 0100 1100 1010 0101                      */
1096   {illegal,0,     2, 8}, /* a6: 0100 1100 1010 0110                      */
1097   {illegal,0,     2, 8}, /* a7: 0100 1100 1010 0111                      */
1098   {illegal,0,     2, 8}, /* a8: 0100 1100 1010 1000                      */
1099   {illegal,0,     2, 8}, /* a9: 0100 1100 1010 1001                      */
1100   {illegal,0,     2, 8}, /* aa: 0100 1100 1010 1010                      */
1101   {illegal,0,     2, 8}, /* ab: 0100 1100 1010 1011                      */
1102   {illegal,0,     2, 8}, /* ac: 0100 1100 1010 1100                      */
1103   {illegal,0,     2, 8}, /* ad: 0100 1100 1010 1101                      */
1104   {illegal,0,     2, 8}, /* ae: 0100 1100 1010 1110                      */
1105   {illegal,0,     2, 8}, /* af: 0100 1100 1010 1111                      */
1102   {illegal,0     }, /* a0: 0100 1100 1010 0000                      */
1103   {illegal,0     }, /* a1: 0100 1100 1010 0001                      */
1104   {illegal,0     }, /* a2: 0100 1100 1010 0010                      */
1105   {illegal,0     }, /* a3: 0100 1100 1010 0011                      */
1106   {illegal,0     }, /* a4: 0100 1100 1010 0100                      */
1107   {illegal,0     }, /* a5: 0100 1100 1010 0101                      */
1108   {illegal,0     }, /* a6: 0100 1100 1010 0110                      */
1109   {illegal,0     }, /* a7: 0100 1100 1010 0111                      */
1110   {illegal,0     }, /* a8: 0100 1100 1010 1000                      */
1111   {illegal,0     }, /* a9: 0100 1100 1010 1001                      */
1112   {illegal,0     }, /* aa: 0100 1100 1010 1010                      */
1113   {illegal,0     }, /* ab: 0100 1100 1010 1011                      */
1114   {illegal,0     }, /* ac: 0100 1100 1010 1100                      */
1115   {illegal,0     }, /* ad: 0100 1100 1010 1101                      */
1116   {illegal,0     }, /* ae: 0100 1100 1010 1110                      */
1117   {illegal,0     }, /* af: 0100 1100 1010 1111                      */
11061118
1107   {illegal,0,     2, 8}, /* b0: 0100 1100 1011 0000                      */
1108   {illegal,0,     2, 8}, /* b1: 0100 1100 1011 0001                      */
1109   {illegal,0,     2, 8}, /* b2: 0100 1100 1011 0010                      */
1110   {illegal,0,     2, 8}, /* b3: 0100 1100 1011 0011                      */
1111   {illegal,0,     2, 8}, /* b4: 0100 1100 1011 0100                      */
1112   {illegal,0,     2, 8}, /* b5: 0100 1100 1011 0101                      */
1113   {illegal,0,     2, 8}, /* b6: 0100 1100 1011 0110                      */
1114   {illegal,0,     2, 8}, /* b7: 0100 1100 1011 0111                      */
1115   {illegal,0,     2, 8}, /* b8: 0100 1100 1011 1000                      */
1116   {illegal,0,     2, 8}, /* b9: 0100 1100 1011 1001                      */
1117   {illegal,0,     2, 8}, /* ba: 0100 1100 1011 1010                      */
1118   {illegal,0,     2, 8}, /* bb: 0100 1100 1011 1011                      */
1119   {illegal,0,     2, 8}, /* bc: 0100 1100 1011 1100                      */
1120   {illegal,0,     2, 8}, /* bd: 0100 1100 1011 1101                      */
1121   {illegal,0,     2, 8}, /* be: 0100 1100 1011 1110                      */
1122   {illegal,0,     2, 8}, /* bf: 0100 1100 1011 1111                      */
1119   {illegal,0     }, /* b0: 0100 1100 1011 0000                      */
1120   {illegal,0     }, /* b1: 0100 1100 1011 0001                      */
1121   {illegal,0     }, /* b2: 0100 1100 1011 0010                      */
1122   {illegal,0     }, /* b3: 0100 1100 1011 0011                      */
1123   {illegal,0     }, /* b4: 0100 1100 1011 0100                      */
1124   {illegal,0     }, /* b5: 0100 1100 1011 0101                      */
1125   {illegal,0     }, /* b6: 0100 1100 1011 0110                      */
1126   {illegal,0     }, /* b7: 0100 1100 1011 0111                      */
1127   {illegal,0     }, /* b8: 0100 1100 1011 1000                      */
1128   {illegal,0     }, /* b9: 0100 1100 1011 1001                      */
1129   {illegal,0     }, /* ba: 0100 1100 1011 1010                      */
1130   {illegal,0     }, /* bb: 0100 1100 1011 1011                      */
1131   {illegal,0     }, /* bc: 0100 1100 1011 1100                      */
1132   {illegal,0     }, /* bd: 0100 1100 1011 1101                      */
1133   {illegal,0     }, /* be: 0100 1100 1011 1110                      */
1134   {illegal,0     }, /* bf: 0100 1100 1011 1111                      */
11231135
1124   {MOV,"A,PA",     2,10}, /* c0: 0100 1100 1100 0000                      */
1125   {MOV,"A,PB",     2,10}, /* c1: 0100 1100 1100 0001                      */
1126   {MOV,"A,PC",     2,10}, /* c2: 0100 1100 1100 0010                      */
1127   {MOV,"A,PD",     2,10}, /* c3: 0100 1100 1100 0011                      */
1128   {illegal,0,     2,10}, /* c4: 0100 1100 1100 0100                      */
1129   {MOV,"A,PF",     2,10}, /* c5: 0100 1100 1100 0101                      */
1130   {MOV,"A,MKH",    2,10}, /* c6: 0100 1100 1100 0110                      */
1131   {MOV,"A,MKL",    2,10}, /* c7: 0100 1100 1100 0111                      */
1132   {MOV,"A,ANM",    2,10}, /* c8: 0100 1100 1100 1000                      */   /* 7810 */
1133   {MOV,"A,SMH",    2,10}, /* c9: 0100 1100 1100 1001                      */
1134   {illegal,0,     2,10}, /* ca: 0100 1100 1100 1010                      */
1135   {MOV,"A,EOM",    2,10}, /* cb: 0100 1100 1100 1011                      */
1136   {illegal,0,     2,10}, /* cc: 0100 1100 1100 1100                      */
1137   {MOV,"A,TMM",    2,10}, /* cd: 0100 1100 1100 1101                      */
1138   {illegal,0,     2,10}, /* ce: 0100 1100 1100 1110                      */
1139   {illegal,0,     2,10}, /* cf: 0100 1100 1100 1111                      */
1136   {MOV,"A,PA"     }, /* c0: 0100 1100 1100 0000                      */
1137   {MOV,"A,PB"     }, /* c1: 0100 1100 1100 0001                      */
1138   {MOV,"A,PC"     }, /* c2: 0100 1100 1100 0010                      */
1139   {MOV,"A,PD"     }, /* c3: 0100 1100 1100 0011                      */
1140   {illegal,0     }, /* c4: 0100 1100 1100 0100                      */
1141   {MOV,"A,PF"     }, /* c5: 0100 1100 1100 0101                      */
1142   {MOV,"A,MKH"    }, /* c6: 0100 1100 1100 0110                      */
1143   {MOV,"A,MKL"    }, /* c7: 0100 1100 1100 0111                      */
1144   {MOV,"A,ANM"    }, /* c8: 0100 1100 1100 1000                      */   /* 7810 */
1145   {MOV,"A,SMH"    }, /* c9: 0100 1100 1100 1001                      */
1146   {illegal,0     }, /* ca: 0100 1100 1100 1010                      */
1147   {MOV,"A,EOM"    }, /* cb: 0100 1100 1100 1011                      */
1148   {illegal,0     }, /* cc: 0100 1100 1100 1100                      */
1149   {MOV,"A,TMM"    }, /* cd: 0100 1100 1100 1101                      */
1150   {illegal,0     }, /* ce: 0100 1100 1100 1110                      */
1151   {illegal,0     }, /* cf: 0100 1100 1100 1111                      */
11401152
1141   {illegal,0,     2,10}, /* d0: 0100 1100 1101 0000                      */
1142   {illegal,0,     2,10}, /* d1: 0100 1100 1101 0001                      */
1143   {illegal,0,     2,10}, /* d2: 0100 1100 1101 0010                      */
1144   {illegal,0,     2,10}, /* d3: 0100 1100 1101 0011                      */
1145   {illegal,0,     2,10}, /* d4: 0100 1100 1101 0100                      */
1146   {illegal,0,     2,10}, /* d5: 0100 1100 1101 0101                      */
1147   {illegal,0,     2,10}, /* d6: 0100 1100 1101 0110                      */
1148   {illegal,0,     2,10}, /* d7: 0100 1100 1101 0111                      */
1149   {illegal,0,     2,10}, /* d8: 0100 1100 1101 1000                      */
1150   {MOV,"A,RXB",    2,10}, /* d9: 0100 1100 1101 1001                      */
1151   {illegal,0,     2,10}, /* da: 0100 1100 1101 1010                      */
1152   {illegal,0,     2,10}, /* db: 0100 1100 1101 1011                      */
1153   {illegal,0,     2,10}, /* dc: 0100 1100 1101 1100                      */
1154   {illegal,0,     2,10}, /* dd: 0100 1100 1101 1101                      */
1155   {illegal,0,     2,10}, /* de: 0100 1100 1101 1110                      */
1156   {illegal,0,     2,10}, /* df: 0100 1100 1101 1111                      */
1153   {illegal,0     }, /* d0: 0100 1100 1101 0000                      */
1154   {illegal,0     }, /* d1: 0100 1100 1101 0001                      */
1155   {illegal,0     }, /* d2: 0100 1100 1101 0010                      */
1156   {illegal,0     }, /* d3: 0100 1100 1101 0011                      */
1157   {illegal,0     }, /* d4: 0100 1100 1101 0100                      */
1158   {illegal,0     }, /* d5: 0100 1100 1101 0101                      */
1159   {illegal,0     }, /* d6: 0100 1100 1101 0110                      */
1160   {illegal,0     }, /* d7: 0100 1100 1101 0111                      */
1161   {illegal,0     }, /* d8: 0100 1100 1101 1000                      */
1162   {MOV,"A,RXB"    }, /* d9: 0100 1100 1101 1001                      */
1163   {illegal,0     }, /* da: 0100 1100 1101 1010                      */
1164   {illegal,0     }, /* db: 0100 1100 1101 1011                      */
1165   {illegal,0     }, /* dc: 0100 1100 1101 1100                      */
1166   {illegal,0     }, /* dd: 0100 1100 1101 1101                      */
1167   {illegal,0     }, /* de: 0100 1100 1101 1110                      */
1168   {illegal,0     }, /* df: 0100 1100 1101 1111                      */
11571169
1158   {MOV,"A,CR0",    2,10}, /* e0: 0100 1100 1110 0000                      */   /* 7810 */
1159   {MOV,"A,CR1",    2,10}, /* e1: 0100 1100 1110 0001                      */   /* 7810 */
1160   {MOV,"A,CR2",    2,10}, /* e2: 0100 1100 1110 0010                      */   /* 7810 */
1161   {MOV,"A,CR3",    2,10}, /* e3: 0100 1100 1110 0011                      */   /* 7810 */
1162   {illegal,0,     2,10}, /* e4: 0100 1100 1110 0100                      */
1163   {illegal,0,     2,10}, /* e5: 0100 1100 1110 0101                      */
1164   {illegal,0,     2,10}, /* e6: 0100 1100 1110 0110                      */
1165   {illegal,0,     2,10}, /* e7: 0100 1100 1110 0111                      */
1166   {illegal,0,     2,10}, /* e8: 0100 1100 1110 1000                      */
1167   {illegal,0,     2,10}, /* e9: 0100 1100 1110 1001                      */
1168   {illegal,0,     2,10}, /* ea: 0100 1100 1110 1010                      */
1169   {illegal,0,     2,10}, /* eb: 0100 1100 1110 1011                      */
1170   {illegal,0,     2,10}, /* ec: 0100 1100 1110 1100                      */
1171   {illegal,0,     2,10}, /* ed: 0100 1100 1110 1101                      */
1172   {illegal,0,     2,10}, /* ee: 0100 1100 1110 1110                      */
1173   {illegal,0,     2,10}, /* ef: 0100 1100 1110 1111                      */
1170   {MOV,"A,CR0"    }, /* e0: 0100 1100 1110 0000                      */   /* 7810 */
1171   {MOV,"A,CR1"    }, /* e1: 0100 1100 1110 0001                      */   /* 7810 */
1172   {MOV,"A,CR2"    }, /* e2: 0100 1100 1110 0010                      */   /* 7810 */
1173   {MOV,"A,CR3"    }, /* e3: 0100 1100 1110 0011                      */   /* 7810 */
1174   {illegal,0     }, /* e4: 0100 1100 1110 0100                      */
1175   {illegal,0     }, /* e5: 0100 1100 1110 0101                      */
1176   {illegal,0     }, /* e6: 0100 1100 1110 0110                      */
1177   {illegal,0     }, /* e7: 0100 1100 1110 0111                      */
1178   {illegal,0     }, /* e8: 0100 1100 1110 1000                      */
1179   {illegal,0     }, /* e9: 0100 1100 1110 1001                      */
1180   {illegal,0     }, /* ea: 0100 1100 1110 1010                      */
1181   {illegal,0     }, /* eb: 0100 1100 1110 1011                      */
1182   {illegal,0     }, /* ec: 0100 1100 1110 1100                      */
1183   {illegal,0     }, /* ed: 0100 1100 1110 1101                      */
1184   {illegal,0     }, /* ee: 0100 1100 1110 1110                      */
1185   {illegal,0     }, /* ef: 0100 1100 1110 1111                      */
11741186
1175   {illegal,0,     2,10}, /* f0: 0100 1100 1111 0000                      */
1176   {illegal,0,     2,10}, /* f1: 0100 1100 1111 0001                      */
1177   {illegal,0,     2,10}, /* f2: 0100 1100 1111 0010                      */
1178   {illegal,0,     2,10}, /* f3: 0100 1100 1111 0011                      */
1179   {illegal,0,     2,10}, /* f4: 0100 1100 1111 0100                      */
1180   {illegal,0,     2,10}, /* f5: 0100 1100 1111 0101                      */
1181   {illegal,0,     2,10}, /* f6: 0100 1100 1111 0110                      */
1182   {illegal,0,     2,10}, /* f7: 0100 1100 1111 0111                      */
1183   {illegal,0,     2,10}, /* f8: 0100 1100 1111 1000                      */
1184   {illegal,0,     2,10}, /* f9: 0100 1100 1111 1001                      */
1185   {illegal,0,     2,10}, /* fa: 0100 1100 1111 1010                      */
1186   {illegal,0,     2,10}, /* fb: 0100 1100 1111 1011                      */
1187   {illegal,0,     2,10}, /* fc: 0100 1100 1111 1100                      */
1188   {illegal,0,     2,10}, /* fd: 0100 1100 1111 1101                      */
1189   {illegal,0,     2,10}, /* fe: 0100 1100 1111 1110                      */
1190   {illegal,0,     2,10}   /* ff: 0100 1100 1111 1111                      */
1187   {illegal,0     }, /* f0: 0100 1100 1111 0000                      */
1188   {illegal,0     }, /* f1: 0100 1100 1111 0001                      */
1189   {illegal,0     }, /* f2: 0100 1100 1111 0010                      */
1190   {illegal,0     }, /* f3: 0100 1100 1111 0011                      */
1191   {illegal,0     }, /* f4: 0100 1100 1111 0100                      */
1192   {illegal,0     }, /* f5: 0100 1100 1111 0101                      */
1193   {illegal,0     }, /* f6: 0100 1100 1111 0110                      */
1194   {illegal,0     }, /* f7: 0100 1100 1111 0111                      */
1195   {illegal,0     }, /* f8: 0100 1100 1111 1000                      */
1196   {illegal,0     }, /* f9: 0100 1100 1111 1001                      */
1197   {illegal,0     }, /* fa: 0100 1100 1111 1010                      */
1198   {illegal,0     }, /* fb: 0100 1100 1111 1011                      */
1199   {illegal,0     }, /* fc: 0100 1100 1111 1100                      */
1200   {illegal,0     }, /* fd: 0100 1100 1111 1101                      */
1201   {illegal,0     }, /* fe: 0100 1100 1111 1110                      */
1202   {illegal,0     }   /* ff: 0100 1100 1111 1111                      */
11911203};
11921204
11931205static const struct dasm_s  dasm4C_7807[256] =
11941206{
1195   {illegal,0,     2, 8}, /* 00: 0100 1100 0000 0000                      */
1196   {illegal,0,     2, 8}, /* 01: 0100 1100 0000 0001                      */
1197   {illegal,0,     2, 8}, /* 02: 0100 1100 0000 0010                      */
1198   {illegal,0,     2, 8}, /* 03: 0100 1100 0000 0011                      */
1199   {illegal,0,     2, 8}, /* 04: 0100 1100 0000 0100                      */
1200   {illegal,0,     2, 8}, /* 05: 0100 1100 0000 0101                      */
1201   {illegal,0,     2, 8}, /* 06: 0100 1100 0000 0110                      */
1202   {illegal,0,     2, 8}, /* 07: 0100 1100 0000 0111                      */
1203   {illegal,0,     2, 8}, /* 08: 0100 1100 0000 1000                      */
1204   {illegal,0,     2, 8}, /* 09: 0100 1100 0000 1001                      */
1205   {illegal,0,     2, 8}, /* 0a: 0100 1100 0000 1010                      */
1206   {illegal,0,     2, 8}, /* 0b: 0100 1100 0000 1011                      */
1207   {illegal,0,     2, 8}, /* 0c: 0100 1100 0000 1100                      */
1208   {illegal,0,     2, 8}, /* 0d: 0100 1100 0000 1101                      */
1209   {illegal,0,     2, 8}, /* 0e: 0100 1100 0000 1110                      */
1210   {illegal,0,     2, 8}, /* 0f: 0100 1100 0000 1111                      */
1207   {illegal,0     }, /* 00: 0100 1100 0000 0000                      */
1208   {illegal,0     }, /* 01: 0100 1100 0000 0001                      */
1209   {illegal,0     }, /* 02: 0100 1100 0000 0010                      */
1210   {illegal,0     }, /* 03: 0100 1100 0000 0011                      */
1211   {illegal,0     }, /* 04: 0100 1100 0000 0100                      */
1212   {illegal,0     }, /* 05: 0100 1100 0000 0101                      */
1213   {illegal,0     }, /* 06: 0100 1100 0000 0110                      */
1214   {illegal,0     }, /* 07: 0100 1100 0000 0111                      */
1215   {illegal,0     }, /* 08: 0100 1100 0000 1000                      */
1216   {illegal,0     }, /* 09: 0100 1100 0000 1001                      */
1217   {illegal,0     }, /* 0a: 0100 1100 0000 1010                      */
1218   {illegal,0     }, /* 0b: 0100 1100 0000 1011                      */
1219   {illegal,0     }, /* 0c: 0100 1100 0000 1100                      */
1220   {illegal,0     }, /* 0d: 0100 1100 0000 1101                      */
1221   {illegal,0     }, /* 0e: 0100 1100 0000 1110                      */
1222   {illegal,0     }, /* 0f: 0100 1100 0000 1111                      */
12111223
1212   {illegal,0,     2, 8}, /* 10: 0100 1100 0001 0000                      */
1213   {illegal,0,     2, 8}, /* 11: 0100 1100 0001 0001                      */
1214   {illegal,0,     2, 8}, /* 12: 0100 1100 0001 0010                      */
1215   {illegal,0,     2, 8}, /* 13: 0100 1100 0001 0011                      */
1216   {illegal,0,     2, 8}, /* 14: 0100 1100 0001 0100                      */
1217   {illegal,0,     2, 8}, /* 15: 0100 1100 0001 0101                      */
1218   {illegal,0,     2, 8}, /* 16: 0100 1100 0001 0110                      */
1219   {illegal,0,     2, 8}, /* 17: 0100 1100 0001 0111                      */
1220   {illegal,0,     2, 8}, /* 18: 0100 1100 0001 1000                      */
1221   {illegal,0,     2, 8}, /* 19: 0100 1100 0001 1001                      */
1222   {illegal,0,     2, 8}, /* 1a: 0100 1100 0001 1010                      */
1223   {illegal,0,     2, 8}, /* 1b: 0100 1100 0001 1011                      */
1224   {illegal,0,     2, 8}, /* 1c: 0100 1100 0001 1100                      */
1225   {illegal,0,     2, 8}, /* 1d: 0100 1100 0001 1101                      */
1226   {illegal,0,     2, 8}, /* 1e: 0100 1100 0001 1110                      */
1227   {illegal,0,     2, 8}, /* 1f: 0100 1100 0001 1111                      */
1224   {illegal,0     }, /* 10: 0100 1100 0001 0000                      */
1225   {illegal,0     }, /* 11: 0100 1100 0001 0001                      */
1226   {illegal,0     }, /* 12: 0100 1100 0001 0010                      */
1227   {illegal,0     }, /* 13: 0100 1100 0001 0011                      */
1228   {illegal,0     }, /* 14: 0100 1100 0001 0100                      */
1229   {illegal,0     }, /* 15: 0100 1100 0001 0101                      */
1230   {illegal,0     }, /* 16: 0100 1100 0001 0110                      */
1231   {illegal,0     }, /* 17: 0100 1100 0001 0111                      */
1232   {illegal,0     }, /* 18: 0100 1100 0001 1000                      */
1233   {illegal,0     }, /* 19: 0100 1100 0001 1001                      */
1234   {illegal,0     }, /* 1a: 0100 1100 0001 1010                      */
1235   {illegal,0     }, /* 1b: 0100 1100 0001 1011                      */
1236   {illegal,0     }, /* 1c: 0100 1100 0001 1100                      */
1237   {illegal,0     }, /* 1d: 0100 1100 0001 1101                      */
1238   {illegal,0     }, /* 1e: 0100 1100 0001 1110                      */
1239   {illegal,0     }, /* 1f: 0100 1100 0001 1111                      */
12281240
1229   {illegal,0,     2, 8}, /* 20: 0100 1100 0010 0000                      */
1230   {illegal,0,     2, 8}, /* 21: 0100 1100 0010 0001                      */
1231   {illegal,0,     2, 8}, /* 22: 0100 1100 0010 0010                      */
1232   {illegal,0,     2, 8}, /* 23: 0100 1100 0010 0011                      */
1233   {illegal,0,     2, 8}, /* 24: 0100 1100 0010 0100                      */
1234   {illegal,0,     2, 8}, /* 25: 0100 1100 0010 0101                      */
1235   {illegal,0,     2, 8}, /* 26: 0100 1100 0010 0110                      */
1236   {illegal,0,     2, 8}, /* 27: 0100 1100 0010 0111                      */
1237   {illegal,0,     2, 8}, /* 28: 0100 1100 0010 1000                      */
1238   {illegal,0,     2, 8}, /* 29: 0100 1100 0010 1001                      */
1239   {illegal,0,     2, 8}, /* 2a: 0100 1100 0010 1010                      */
1240   {illegal,0,     2, 8}, /* 2b: 0100 1100 0010 1011                      */
1241   {illegal,0,     2, 8}, /* 2c: 0100 1100 0010 1100                      */
1242   {illegal,0,     2, 8}, /* 2d: 0100 1100 0010 1101                      */
1243   {illegal,0,     2, 8}, /* 2e: 0100 1100 0010 1110                      */
1244   {illegal,0,     2, 8}, /* 2f: 0100 1100 0010 1111                      */
1241   {illegal,0     }, /* 20: 0100 1100 0010 0000                      */
1242   {illegal,0     }, /* 21: 0100 1100 0010 0001                      */
1243   {illegal,0     }, /* 22: 0100 1100 0010 0010                      */
1244   {illegal,0     }, /* 23: 0100 1100 0010 0011                      */
1245   {illegal,0     }, /* 24: 0100 1100 0010 0100                      */
1246   {illegal,0     }, /* 25: 0100 1100 0010 0101                      */
1247   {illegal,0     }, /* 26: 0100 1100 0010 0110                      */
1248   {illegal,0     }, /* 27: 0100 1100 0010 0111                      */
1249   {illegal,0     }, /* 28: 0100 1100 0010 1000                      */
1250   {illegal,0     }, /* 29: 0100 1100 0010 1001                      */
1251   {illegal,0     }, /* 2a: 0100 1100 0010 1010                      */
1252   {illegal,0     }, /* 2b: 0100 1100 0010 1011                      */
1253   {illegal,0     }, /* 2c: 0100 1100 0010 1100                      */
1254   {illegal,0     }, /* 2d: 0100 1100 0010 1101                      */
1255   {illegal,0     }, /* 2e: 0100 1100 0010 1110                      */
1256   {illegal,0     }, /* 2f: 0100 1100 0010 1111                      */
12451257
1246   {illegal,0,     2, 8}, /* 30: 0100 1100 0011 0000                      */
1247   {illegal,0,     2, 8}, /* 31: 0100 1100 0011 0001                      */
1248   {illegal,0,     2, 8}, /* 32: 0100 1100 0011 0010                      */
1249   {illegal,0,     2, 8}, /* 33: 0100 1100 0011 0011                      */
1250   {illegal,0,     2, 8}, /* 34: 0100 1100 0011 0100                      */
1251   {illegal,0,     2, 8}, /* 35: 0100 1100 0011 0101                      */
1252   {illegal,0,     2, 8}, /* 36: 0100 1100 0011 0110                      */
1253   {illegal,0,     2, 8}, /* 37: 0100 1100 0011 0111                      */
1254   {illegal,0,     2, 8}, /* 38: 0100 1100 0011 1000                      */
1255   {illegal,0,     2, 8}, /* 39: 0100 1100 0011 1001                      */
1256   {illegal,0,     2, 8}, /* 3a: 0100 1100 0011 1010                      */
1257   {illegal,0,     2, 8}, /* 3b: 0100 1100 0011 1011                      */
1258   {illegal,0,     2, 8}, /* 3c: 0100 1100 0011 1100                      */
1259   {illegal,0,     2, 8}, /* 3d: 0100 1100 0011 1101                      */
1260   {illegal,0,     2, 8}, /* 3e: 0100 1100 0011 1110                      */
1261   {illegal,0,     2, 8}, /* 3f: 0100 1100 0011 1111                      */
1258   {illegal,0     }, /* 30: 0100 1100 0011 0000                      */
1259   {illegal,0     }, /* 31: 0100 1100 0011 0001                      */
1260   {illegal,0     }, /* 32: 0100 1100 0011 0010                      */
1261   {illegal,0     }, /* 33: 0100 1100 0011 0011                      */
1262   {illegal,0     }, /* 34: 0100 1100 0011 0100                      */
1263   {illegal,0     }, /* 35: 0100 1100 0011 0101                      */
1264   {illegal,0     }, /* 36: 0100 1100 0011 0110                      */
1265   {illegal,0     }, /* 37: 0100 1100 0011 0111                      */
1266   {illegal,0     }, /* 38: 0100 1100 0011 1000                      */
1267   {illegal,0     }, /* 39: 0100 1100 0011 1001                      */
1268   {illegal,0     }, /* 3a: 0100 1100 0011 1010                      */
1269   {illegal,0     }, /* 3b: 0100 1100 0011 1011                      */
1270   {illegal,0     }, /* 3c: 0100 1100 0011 1100                      */
1271   {illegal,0     }, /* 3d: 0100 1100 0011 1101                      */
1272   {illegal,0     }, /* 3e: 0100 1100 0011 1110                      */
1273   {illegal,0     }, /* 3f: 0100 1100 0011 1111                      */
12621274
1263   {illegal,0,     2, 8}, /* 40: 0100 1100 0100 0000                      */
1264   {illegal,0,     2, 8}, /* 41: 0100 1100 0100 0001                      */
1265   {illegal,0,     2, 8}, /* 42: 0100 1100 0100 0010                      */
1266   {illegal,0,     2, 8}, /* 43: 0100 1100 0100 0011                      */
1267   {illegal,0,     2, 8}, /* 44: 0100 1100 0100 0100                      */
1268   {illegal,0,     2, 8}, /* 45: 0100 1100 0100 0101                      */
1269   {illegal,0,     2, 8}, /* 46: 0100 1100 0100 0110                      */
1270   {illegal,0,     2, 8}, /* 47: 0100 1100 0100 0111                      */
1271   {illegal,0,     2, 8}, /* 48: 0100 1100 0100 1000                      */
1272   {illegal,0,     2, 8}, /* 49: 0100 1100 0100 1001                      */
1273   {illegal,0,     2, 8}, /* 4a: 0100 1100 0100 1010                      */
1274   {illegal,0,     2, 8}, /* 4b: 0100 1100 0100 1011                      */
1275   {illegal,0,     2, 8}, /* 4c: 0100 1100 0100 1100                      */
1276   {illegal,0,     2, 8}, /* 4d: 0100 1100 0100 1101                      */
1277   {illegal,0,     2, 8}, /* 4e: 0100 1100 0100 1110                      */
1278   {illegal,0,     2, 8}, /* 4f: 0100 1100 0100 1111                      */
1275   {illegal,0     }, /* 40: 0100 1100 0100 0000                      */
1276   {illegal,0     }, /* 41: 0100 1100 0100 0001                      */
1277   {illegal,0     }, /* 42: 0100 1100 0100 0010                      */
1278   {illegal,0     }, /* 43: 0100 1100 0100 0011                      */
1279   {illegal,0     }, /* 44: 0100 1100 0100 0100                      */
1280   {illegal,0     }, /* 45: 0100 1100 0100 0101                      */
1281   {illegal,0     }, /* 46: 0100 1100 0100 0110                      */
1282   {illegal,0     }, /* 47: 0100 1100 0100 0111                      */
1283   {illegal,0     }, /* 48: 0100 1100 0100 1000                      */
1284   {illegal,0     }, /* 49: 0100 1100 0100 1001                      */
1285   {illegal,0     }, /* 4a: 0100 1100 0100 1010                      */
1286   {illegal,0     }, /* 4b: 0100 1100 0100 1011                      */
1287   {illegal,0     }, /* 4c: 0100 1100 0100 1100                      */
1288   {illegal,0     }, /* 4d: 0100 1100 0100 1101                      */
1289   {illegal,0     }, /* 4e: 0100 1100 0100 1110                      */
1290   {illegal,0     }, /* 4f: 0100 1100 0100 1111                      */
12791291
1280   {illegal,0,     2, 8}, /* 50: 0100 1100 0101 0000                      */
1281   {illegal,0,     2, 8}, /* 51: 0100 1100 0101 0001                      */
1282   {illegal,0,     2, 8}, /* 52: 0100 1100 0101 0010                      */
1283   {illegal,0,     2, 8}, /* 53: 0100 1100 0101 0011                      */
1284   {illegal,0,     2, 8}, /* 54: 0100 1100 0101 0100                      */
1285   {illegal,0,     2, 8}, /* 55: 0100 1100 0101 0101                      */
1286   {illegal,0,     2, 8}, /* 56: 0100 1100 0101 0110                      */
1287   {illegal,0,     2, 8}, /* 57: 0100 1100 0101 0111                      */
1288   {illegal,0,     2, 8}, /* 58: 0100 1100 0101 1000                      */
1289   {illegal,0,     2, 8}, /* 59: 0100 1100 0101 1001                      */
1290   {illegal,0,     2, 8}, /* 5a: 0100 1100 0101 1010                      */
1291   {illegal,0,     2, 8}, /* 5b: 0100 1100 0101 1011                      */
1292   {illegal,0,     2, 8}, /* 5c: 0100 1100 0101 1100                      */
1293   {illegal,0,     2, 8}, /* 5d: 0100 1100 0101 1101                      */
1294   {illegal,0,     2, 8}, /* 5e: 0100 1100 0101 1110                      */
1295   {illegal,0,     2, 8}, /* 5f: 0100 1100 0101 1111                      */
1292   {illegal,0     }, /* 50: 0100 1100 0101 0000                      */
1293   {illegal,0     }, /* 51: 0100 1100 0101 0001                      */
1294   {illegal,0     }, /* 52: 0100 1100 0101 0010                      */
1295   {illegal,0     }, /* 53: 0100 1100 0101 0011                      */
1296   {illegal,0     }, /* 54: 0100 1100 0101 0100                      */
1297   {illegal,0     }, /* 55: 0100 1100 0101 0101                      */
1298   {illegal,0     }, /* 56: 0100 1100 0101 0110                      */
1299   {illegal,0     }, /* 57: 0100 1100 0101 0111                      */
1300   {illegal,0     }, /* 58: 0100 1100 0101 1000                      */
1301   {illegal,0     }, /* 59: 0100 1100 0101 1001                      */
1302   {illegal,0     }, /* 5a: 0100 1100 0101 1010                      */
1303   {illegal,0     }, /* 5b: 0100 1100 0101 1011                      */
1304   {illegal,0     }, /* 5c: 0100 1100 0101 1100                      */
1305   {illegal,0     }, /* 5d: 0100 1100 0101 1101                      */
1306   {illegal,0     }, /* 5e: 0100 1100 0101 1110                      */
1307   {illegal,0     }, /* 5f: 0100 1100 0101 1111                      */
12961308
1297   {illegal,0,     2, 8}, /* 60: 0100 1100 0110 0000                      */
1298   {illegal,0,     2, 8}, /* 61: 0100 1100 0110 0001                      */
1299   {illegal,0,     2, 8}, /* 62: 0100 1100 0110 0010                      */
1300   {illegal,0,     2, 8}, /* 63: 0100 1100 0110 0011                      */
1301   {illegal,0,     2, 8}, /* 64: 0100 1100 0110 0100                      */
1302   {illegal,0,     2, 8}, /* 65: 0100 1100 0110 0101                      */
1303   {illegal,0,     2, 8}, /* 66: 0100 1100 0110 0110                      */
1304   {illegal,0,     2, 8}, /* 67: 0100 1100 0110 0111                      */
1305   {illegal,0,     2, 8}, /* 68: 0100 1100 0110 1000                      */
1306   {illegal,0,     2, 8}, /* 69: 0100 1100 0110 1001                      */
1307   {illegal,0,     2, 8}, /* 6a: 0100 1100 0110 1010                      */
1308   {illegal,0,     2, 8}, /* 6b: 0100 1100 0110 1011                      */
1309   {illegal,0,     2, 8}, /* 6c: 0100 1100 0110 1100                      */
1310   {illegal,0,     2, 8}, /* 6d: 0100 1100 0110 1101                      */
1311   {illegal,0,     2, 8}, /* 6e: 0100 1100 0110 1110                      */
1312   {illegal,0,     2, 8}, /* 6f: 0100 1100 0110 1111                      */
1309   {illegal,0     }, /* 60: 0100 1100 0110 0000                      */
1310   {illegal,0     }, /* 61: 0100 1100 0110 0001                      */
1311   {illegal,0     }, /* 62: 0100 1100 0110 0010                      */
1312   {illegal,0     }, /* 63: 0100 1100 0110 0011                      */
1313   {illegal,0     }, /* 64: 0100 1100 0110 0100                      */
1314   {illegal,0     }, /* 65: 0100 1100 0110 0101                      */
1315   {illegal,0     }, /* 66: 0100 1100 0110 0110                      */
1316   {illegal,0     }, /* 67: 0100 1100 0110 0111                      */
1317   {illegal,0     }, /* 68: 0100 1100 0110 1000                      */
1318   {illegal,0     }, /* 69: 0100 1100 0110 1001                      */
1319   {illegal,0     }, /* 6a: 0100 1100 0110 1010                      */
1320   {illegal,0     }, /* 6b: 0100 1100 0110 1011                      */
1321   {illegal,0     }, /* 6c: 0100 1100 0110 1100                      */
1322   {illegal,0     }, /* 6d: 0100 1100 0110 1101                      */
1323   {illegal,0     }, /* 6e: 0100 1100 0110 1110                      */
1324   {illegal,0     }, /* 6f: 0100 1100 0110 1111                      */
13131325
1314   {illegal,0,     2, 8}, /* 70: 0100 1100 0111 0000                      */
1315   {illegal,0,     2, 8}, /* 71: 0100 1100 0111 0001                      */
1316   {illegal,0,     2, 8}, /* 72: 0100 1100 0111 0010                      */
1317   {illegal,0,     2, 8}, /* 73: 0100 1100 0111 0011                      */
1318   {illegal,0,     2, 8}, /* 74: 0100 1100 0111 0100                      */
1319   {illegal,0,     2, 8}, /* 75: 0100 1100 0111 0101                      */
1320   {illegal,0,     2, 8}, /* 76: 0100 1100 0111 0110                      */
1321   {illegal,0,     2, 8}, /* 77: 0100 1100 0111 0111                      */
1322   {illegal,0,     2, 8}, /* 78: 0100 1100 0111 1000                      */
1323   {illegal,0,     2, 8}, /* 79: 0100 1100 0111 1001                      */
1324   {illegal,0,     2, 8}, /* 7a: 0100 1100 0111 1010                      */
1325   {illegal,0,     2, 8}, /* 7b: 0100 1100 0111 1011                      */
1326   {illegal,0,     2, 8}, /* 7c: 0100 1100 0111 1100                      */
1327   {illegal,0,     2, 8}, /* 7d: 0100 1100 0111 1101                      */
1328   {illegal,0,     2, 8}, /* 7e: 0100 1100 0111 1110                      */
1329   {illegal,0,     2, 8}, /* 7f: 0100 1100 0111 1111                      */
1326   {illegal,0     }, /* 70: 0100 1100 0111 0000                      */
1327   {illegal,0     }, /* 71: 0100 1100 0111 0001                      */
1328   {illegal,0     }, /* 72: 0100 1100 0111 0010                      */
1329   {illegal,0     }, /* 73: 0100 1100 0111 0011                      */
1330   {illegal,0     }, /* 74: 0100 1100 0111 0100                      */
1331   {illegal,0     }, /* 75: 0100 1100 0111 0101                      */
1332   {illegal,0     }, /* 76: 0100 1100 0111 0110                      */
1333   {illegal,0     }, /* 77: 0100 1100 0111 0111                      */
1334   {illegal,0     }, /* 78: 0100 1100 0111 1000                      */
1335   {illegal,0     }, /* 79: 0100 1100 0111 1001                      */
1336   {illegal,0     }, /* 7a: 0100 1100 0111 1010                      */
1337   {illegal,0     }, /* 7b: 0100 1100 0111 1011                      */
1338   {illegal,0     }, /* 7c: 0100 1100 0111 1100                      */
1339   {illegal,0     }, /* 7d: 0100 1100 0111 1101                      */
1340   {illegal,0     }, /* 7e: 0100 1100 0111 1110                      */
1341   {illegal,0     }, /* 7f: 0100 1100 0111 1111                      */
13301342
1331   {illegal,0,     2, 8}, /* 80: 0100 1100 1000 0000                      */
1332   {illegal,0,     2, 8}, /* 81: 0100 1100 1000 0001                      */
1333   {illegal,0,     2, 8}, /* 82: 0100 1100 1000 0010                      */
1334   {illegal,0,     2, 8}, /* 83: 0100 1100 1000 0011                      */
1335   {illegal,0,     2, 8}, /* 84: 0100 1100 1000 0100                      */
1336   {illegal,0,     2, 8}, /* 85: 0100 1100 1000 0101                      */
1337   {illegal,0,     2, 8}, /* 86: 0100 1100 1000 0110                      */
1338   {illegal,0,     2, 8}, /* 87: 0100 1100 1000 0111                      */
1339   {illegal,0,     2, 8}, /* 88: 0100 1100 1000 1000                      */
1340   {illegal,0,     2, 8}, /* 89: 0100 1100 1000 1001                      */
1341   {illegal,0,     2, 8}, /* 8a: 0100 1100 1000 1010                      */
1342   {illegal,0,     2, 8}, /* 8b: 0100 1100 1000 1011                      */
1343   {illegal,0,     2, 8}, /* 8c: 0100 1100 1000 1100                      */
1344   {illegal,0,     2, 8}, /* 8d: 0100 1100 1000 1101                      */
1345   {illegal,0,     2, 8}, /* 8e: 0100 1100 1000 1110                      */
1346   {illegal,0,     2, 8}, /* 8f: 0100 1100 1000 1111                      */
1343   {illegal,0     }, /* 80: 0100 1100 1000 0000                      */
1344   {illegal,0     }, /* 81: 0100 1100 1000 0001                      */
1345   {illegal,0     }, /* 82: 0100 1100 1000 0010                      */
1346   {illegal,0     }, /* 83: 0100 1100 1000 0011                      */
1347   {illegal,0     }, /* 84: 0100 1100 1000 0100                      */
1348   {illegal,0     }, /* 85: 0100 1100 1000 0101                      */
1349   {illegal,0     }, /* 86: 0100 1100 1000 0110                      */
1350   {illegal,0     }, /* 87: 0100 1100 1000 0111                      */
1351   {illegal,0     }, /* 88: 0100 1100 1000 1000                      */
1352   {illegal,0     }, /* 89: 0100 1100 1000 1001                      */
1353   {illegal,0     }, /* 8a: 0100 1100 1000 1010                      */
1354   {illegal,0     }, /* 8b: 0100 1100 1000 1011                      */
1355   {illegal,0     }, /* 8c: 0100 1100 1000 1100                      */
1356   {illegal,0     }, /* 8d: 0100 1100 1000 1101                      */
1357   {illegal,0     }, /* 8e: 0100 1100 1000 1110                      */
1358   {illegal,0     }, /* 8f: 0100 1100 1000 1111                      */
13471359
1348   {illegal,0,     2, 8}, /* 90: 0100 1100 1001 0000                      */
1349   {illegal,0,     2, 8}, /* 91: 0100 1100 1001 0001                      */
1350   {illegal,0,     2, 8}, /* 92: 0100 1100 1001 0010                      */
1351   {illegal,0,     2, 8}, /* 93: 0100 1100 1001 0011                      */
1352   {illegal,0,     2, 8}, /* 94: 0100 1100 1001 0100                      */
1353   {illegal,0,     2, 8}, /* 95: 0100 1100 1001 0101                      */
1354   {illegal,0,     2, 8}, /* 96: 0100 1100 1001 0110                      */
1355   {illegal,0,     2, 8}, /* 97: 0100 1100 1001 0111                      */
1356   {illegal,0,     2, 8}, /* 98: 0100 1100 1001 1000                      */
1357   {illegal,0,     2, 8}, /* 99: 0100 1100 1001 1001                      */
1358   {illegal,0,     2, 8}, /* 9a: 0100 1100 1001 1010                      */
1359   {illegal,0,     2, 8}, /* 9b: 0100 1100 1001 1011                      */
1360   {illegal,0,     2, 8}, /* 9c: 0100 1100 1001 1100                      */
1361   {illegal,0,     2, 8}, /* 9d: 0100 1100 1001 1101                      */
1362   {illegal,0,     2, 8}, /* 9e: 0100 1100 1001 1110                      */
1363   {illegal,0,     2, 8}, /* 9f: 0100 1100 1001 1111                      */
1360   {illegal,0     }, /* 90: 0100 1100 1001 0000                      */
1361   {illegal,0     }, /* 91: 0100 1100 1001 0001                      */
1362   {illegal,0     }, /* 92: 0100 1100 1001 0010                      */
1363   {illegal,0     }, /* 93: 0100 1100 1001 0011                      */
1364   {illegal,0     }, /* 94: 0100 1100 1001 0100                      */
1365   {illegal,0     }, /* 95: 0100 1100 1001 0101                      */
1366   {illegal,0     }, /* 96: 0100 1100 1001 0110                      */
1367   {illegal,0     }, /* 97: 0100 1100 1001 0111                      */
1368   {illegal,0     }, /* 98: 0100 1100 1001 1000                      */
1369   {illegal,0     }, /* 99: 0100 1100 1001 1001                      */
1370   {illegal,0     }, /* 9a: 0100 1100 1001 1010                      */
1371   {illegal,0     }, /* 9b: 0100 1100 1001 1011                      */
1372   {illegal,0     }, /* 9c: 0100 1100 1001 1100                      */
1373   {illegal,0     }, /* 9d: 0100 1100 1001 1101                      */
1374   {illegal,0     }, /* 9e: 0100 1100 1001 1110                      */
1375   {illegal,0     }, /* 9f: 0100 1100 1001 1111                      */
13641376
1365   {illegal,0,     2, 8}, /* a0: 0100 1100 1010 0000                      */
1366   {illegal,0,     2, 8}, /* a1: 0100 1100 1010 0001                      */
1367   {illegal,0,     2, 8}, /* a2: 0100 1100 1010 0010                      */
1368   {illegal,0,     2, 8}, /* a3: 0100 1100 1010 0011                      */
1369   {illegal,0,     2, 8}, /* a4: 0100 1100 1010 0100                      */
1370   {illegal,0,     2, 8}, /* a5: 0100 1100 1010 0101                      */
1371   {illegal,0,     2, 8}, /* a6: 0100 1100 1010 0110                      */
1372   {illegal,0,     2, 8}, /* a7: 0100 1100 1010 0111                      */
1373   {illegal,0,     2, 8}, /* a8: 0100 1100 1010 1000                      */
1374   {illegal,0,     2, 8}, /* a9: 0100 1100 1010 1001                      */
1375   {illegal,0,     2, 8}, /* aa: 0100 1100 1010 1010                      */
1376   {illegal,0,     2, 8}, /* ab: 0100 1100 1010 1011                      */
1377   {illegal,0,     2, 8}, /* ac: 0100 1100 1010 1100                      */
1378   {illegal,0,     2, 8}, /* ad: 0100 1100 1010 1101                      */
1379   {illegal,0,     2, 8}, /* ae: 0100 1100 1010 1110                      */
1380   {illegal,0,     2, 8}, /* af: 0100 1100 1010 1111                      */
1377   {illegal,0     }, /* a0: 0100 1100 1010 0000                      */
1378   {illegal,0     }, /* a1: 0100 1100 1010 0001                      */
1379   {illegal,0     }, /* a2: 0100 1100 1010 0010                      */
1380   {illegal,0     }, /* a3: 0100 1100 1010 0011                      */
1381   {illegal,0     }, /* a4: 0100 1100 1010 0100                      */
1382   {illegal,0     }, /* a5: 0100 1100 1010 0101                      */
1383   {illegal,0     }, /* a6: 0100 1100 1010 0110                      */
1384   {illegal,0     }, /* a7: 0100 1100 1010 0111                      */
1385   {illegal,0     }, /* a8: 0100 1100 1010 1000                      */
1386   {illegal,0     }, /* a9: 0100 1100 1010 1001                      */
1387   {illegal,0     }, /* aa: 0100 1100 1010 1010                      */
1388   {illegal,0     }, /* ab: 0100 1100 1010 1011                      */
1389   {illegal,0     }, /* ac: 0100 1100 1010 1100                      */
1390   {illegal,0     }, /* ad: 0100 1100 1010 1101                      */
1391   {illegal,0     }, /* ae: 0100 1100 1010 1110                      */
1392   {illegal,0     }, /* af: 0100 1100 1010 1111                      */
13811393
1382   {illegal,0,     2, 8}, /* b0: 0100 1100 1011 0000                      */
1383   {illegal,0,     2, 8}, /* b1: 0100 1100 1011 0001                      */
1384   {illegal,0,     2, 8}, /* b2: 0100 1100 1011 0010                      */
1385   {illegal,0,     2, 8}, /* b3: 0100 1100 1011 0011                      */
1386   {illegal,0,     2, 8}, /* b4: 0100 1100 1011 0100                      */
1387   {illegal,0,     2, 8}, /* b5: 0100 1100 1011 0101                      */
1388   {illegal,0,     2, 8}, /* b6: 0100 1100 1011 0110                      */
1389   {illegal,0,     2, 8}, /* b7: 0100 1100 1011 0111                      */
1390   {illegal,0,     2, 8}, /* b8: 0100 1100 1011 1000                      */
1391   {illegal,0,     2, 8}, /* b9: 0100 1100 1011 1001                      */
1392   {illegal,0,     2, 8}, /* ba: 0100 1100 1011 1010                      */
1393   {illegal,0,     2, 8}, /* bb: 0100 1100 1011 1011                      */
1394   {illegal,0,     2, 8}, /* bc: 0100 1100 1011 1100                      */
1395   {illegal,0,     2, 8}, /* bd: 0100 1100 1011 1101                      */
1396   {illegal,0,     2, 8}, /* be: 0100 1100 1011 1110                      */
1397   {illegal,0,     2, 8}, /* bf: 0100 1100 1011 1111                      */
1394   {illegal,0     }, /* b0: 0100 1100 1011 0000                      */
1395   {illegal,0     }, /* b1: 0100 1100 1011 0001                      */
1396   {illegal,0     }, /* b2: 0100 1100 1011 0010                      */
1397   {illegal,0     }, /* b3: 0100 1100 1011 0011                      */
1398   {illegal,0     }, /* b4: 0100 1100 1011 0100                      */
1399   {illegal,0     }, /* b5: 0100 1100 1011 0101                      */
1400   {illegal,0     }, /* b6: 0100 1100 1011 0110                      */
1401   {illegal,0     }, /* b7: 0100 1100 1011 0111                      */
1402   {illegal,0     }, /* b8: 0100 1100 1011 1000                      */
1403   {illegal,0     }, /* b9: 0100 1100 1011 1001                      */
1404   {illegal,0     }, /* ba: 0100 1100 1011 1010                      */
1405   {illegal,0     }, /* bb: 0100 1100 1011 1011                      */
1406   {illegal,0     }, /* bc: 0100 1100 1011 1100                      */
1407   {illegal,0     }, /* bd: 0100 1100 1011 1101                      */
1408   {illegal,0     }, /* be: 0100 1100 1011 1110                      */
1409   {illegal,0     }, /* bf: 0100 1100 1011 1111                      */
13981410
1399   {MOV,"A,PA",     2,10}, /* c0: 0100 1100 1100 0000                      */
1400   {MOV,"A,PB",     2,10}, /* c1: 0100 1100 1100 0001                      */
1401   {MOV,"A,PC",     2,10}, /* c2: 0100 1100 1100 0010                      */
1402   {MOV,"A,PD",     2,10}, /* c3: 0100 1100 1100 0011                      */
1403   {illegal,0,     2,10}, /* c4: 0100 1100 1100 0100                      */
1404   {MOV,"A,PF",     2,10}, /* c5: 0100 1100 1100 0101                      */
1405   {MOV,"A,MKH",    2,10}, /* c6: 0100 1100 1100 0110                      */
1406   {MOV,"A,MKL",    2,10}, /* c7: 0100 1100 1100 0111                      */
1407   {illegal,0,      2,10}, /* c8: 0100 1100 1100 1000                      */
1408   {MOV,"A,SMH",    2,10}, /* c9: 0100 1100 1100 1001                      */
1409   {illegal,0,     2,10}, /* ca: 0100 1100 1100 1010                      */
1410   {MOV,"A,EOM",    2,10}, /* cb: 0100 1100 1100 1011                      */
1411   {illegal,0,     2,10}, /* cc: 0100 1100 1100 1100                      */
1412   {MOV,"A,TMM",    2,10}, /* cd: 0100 1100 1100 1101                      */
1413   {MOV,"A,PT",     2,10}, /* ce: 0100 1100 1100 1110                      */   /* 7807 */
1414   {illegal,0,     2,10}, /* cf: 0100 1100 1100 1111                      */
1411   {MOV,"A,PA"     }, /* c0: 0100 1100 1100 0000                      */
1412   {MOV,"A,PB"     }, /* c1: 0100 1100 1100 0001                      */
1413   {MOV,"A,PC"     }, /* c2: 0100 1100 1100 0010                      */
1414   {MOV,"A,PD"     }, /* c3: 0100 1100 1100 0011                      */
1415   {illegal,0     }, /* c4: 0100 1100 1100 0100                      */
1416   {MOV,"A,PF"     }, /* c5: 0100 1100 1100 0101                      */
1417   {MOV,"A,MKH"    }, /* c6: 0100 1100 1100 0110                      */
1418   {MOV,"A,MKL"    }, /* c7: 0100 1100 1100 0111                      */
1419   {illegal,0      }, /* c8: 0100 1100 1100 1000                      */
1420   {MOV,"A,SMH"    }, /* c9: 0100 1100 1100 1001                      */
1421   {illegal,0     }, /* ca: 0100 1100 1100 1010                      */
1422   {MOV,"A,EOM"    }, /* cb: 0100 1100 1100 1011                      */
1423   {illegal,0     }, /* cc: 0100 1100 1100 1100                      */
1424   {MOV,"A,TMM"    }, /* cd: 0100 1100 1100 1101                      */
1425   {MOV,"A,PT"     }, /* ce: 0100 1100 1100 1110                      */   /* 7807 */
1426   {illegal,0     }, /* cf: 0100 1100 1100 1111                      */
14151427
1416   {illegal,0,     2,10}, /* d0: 0100 1100 1101 0000                      */
1417   {illegal,0,     2,10}, /* d1: 0100 1100 1101 0001                      */
1418   {illegal,0,     2,10}, /* d2: 0100 1100 1101 0010                      */
1419   {illegal,0,     2,10}, /* d3: 0100 1100 1101 0011                      */
1420   {illegal,0,     2,10}, /* d4: 0100 1100 1101 0100                      */
1421   {illegal,0,     2,10}, /* d5: 0100 1100 1101 0101                      */
1422   {illegal,0,     2,10}, /* d6: 0100 1100 1101 0110                      */
1423   {illegal,0,     2,10}, /* d7: 0100 1100 1101 0111                      */
1424   {illegal,0,     2,10}, /* d8: 0100 1100 1101 1000                      */
1425   {MOV,"A,RXB",    2,10}, /* d9: 0100 1100 1101 1001                      */
1426   {illegal,0,     2,10}, /* da: 0100 1100 1101 1010                      */
1427   {illegal,0,     2,10}, /* db: 0100 1100 1101 1011                      */
1428   {illegal,0,     2,10}, /* dc: 0100 1100 1101 1100                      */
1429   {illegal,0,     2,10}, /* dd: 0100 1100 1101 1101                      */
1430   {illegal,0,     2,10}, /* de: 0100 1100 1101 1110                      */
1431   {illegal,0,     2,10}, /* df: 0100 1100 1101 1111                      */
1428   {illegal,0     }, /* d0: 0100 1100 1101 0000                      */
1429   {illegal,0     }, /* d1: 0100 1100 1101 0001                      */
1430   {illegal,0     }, /* d2: 0100 1100 1101 0010                      */
1431   {illegal,0     }, /* d3: 0100 1100 1101 0011                      */
1432   {illegal,0     }, /* d4: 0100 1100 1101 0100                      */
1433   {illegal,0     }, /* d5: 0100 1100 1101 0101                      */
1434   {illegal,0     }, /* d6: 0100 1100 1101 0110                      */
1435   {illegal,0     }, /* d7: 0100 1100 1101 0111                      */
1436   {illegal,0     }, /* d8: 0100 1100 1101 1000                      */
1437   {MOV,"A,RXB"    }, /* d9: 0100 1100 1101 1001                      */
1438   {illegal,0     }, /* da: 0100 1100 1101 1010                      */
1439   {illegal,0     }, /* db: 0100 1100 1101 1011                      */
1440   {illegal,0     }, /* dc: 0100 1100 1101 1100                      */
1441   {illegal,0     }, /* dd: 0100 1100 1101 1101                      */
1442   {illegal,0     }, /* de: 0100 1100 1101 1110                      */
1443   {illegal,0     }, /* df: 0100 1100 1101 1111                      */
14321444
1433   {illegal,0,     2,10}, /* e0: 0100 1100 1110 0000                      */
1434   {illegal,0,     2,10}, /* e1: 0100 1100 1110 0001                      */
1435   {illegal,0,     2,10}, /* e2: 0100 1100 1110 0010                      */
1436   {illegal,0,     2,10}, /* e3: 0100 1100 1110 0011                      */
1437   {illegal,0,     2,10}, /* e4: 0100 1100 1110 0100                      */
1438   {illegal,0,     2,10}, /* e5: 0100 1100 1110 0101                      */
1439   {illegal,0,     2,10}, /* e6: 0100 1100 1110 0110                      */
1440   {illegal,0,     2,10}, /* e7: 0100 1100 1110 0111                      */
1441   {illegal,0,     2,10}, /* e8: 0100 1100 1110 1000                      */
1442   {illegal,0,     2,10}, /* e9: 0100 1100 1110 1001                      */
1443   {illegal,0,     2,10}, /* ea: 0100 1100 1110 1010                      */
1444   {illegal,0,     2,10}, /* eb: 0100 1100 1110 1011                      */
1445   {illegal,0,     2,10}, /* ec: 0100 1100 1110 1100                      */
1446   {illegal,0,     2,10}, /* ed: 0100 1100 1110 1101                      */
1447   {illegal,0,     2,10}, /* ee: 0100 1100 1110 1110                      */
1448   {illegal,0,     2,10}, /* ef: 0100 1100 1110 1111                      */
1445   {illegal,0     }, /* e0: 0100 1100 1110 0000                      */
1446   {illegal,0     }, /* e1: 0100 1100 1110 0001                      */
1447   {illegal,0     }, /* e2: 0100 1100 1110 0010                      */
1448   {illegal,0     }, /* e3: 0100 1100 1110 0011                      */
1449   {illegal,0     }, /* e4: 0100 1100 1110 0100                      */
1450   {illegal,0     }, /* e5: 0100 1100 1110 0101                      */
1451   {illegal,0     }, /* e6: 0100 1100 1110 0110                      */
1452   {illegal,0     }, /* e7: 0100 1100 1110 0111                      */
1453   {illegal,0     }, /* e8: 0100 1100 1110 1000                      */
1454   {illegal,0     }, /* e9: 0100 1100 1110 1001                      */
1455   {illegal,0     }, /* ea: 0100 1100 1110 1010                      */
1456   {illegal,0     }, /* eb: 0100 1100 1110 1011                      */
1457   {illegal,0     }, /* ec: 0100 1100 1110 1100                      */
1458   {illegal,0     }, /* ed: 0100 1100 1110 1101                      */
1459   {illegal,0     }, /* ee: 0100 1100 1110 1110                      */
1460   {illegal,0     }, /* ef: 0100 1100 1110 1111                      */
14491461
1450   {illegal,0,     2,10}, /* f0: 0100 1100 1111 0000                      */
1451   {illegal,0,     2,10}, /* f1: 0100 1100 1111 0001                      */
1452   {illegal,0,     2,10}, /* f2: 0100 1100 1111 0010                      */
1453   {illegal,0,     2,10}, /* f3: 0100 1100 1111 0011                      */
1454   {illegal,0,     2,10}, /* f4: 0100 1100 1111 0100                      */
1455   {illegal,0,     2,10}, /* f5: 0100 1100 1111 0101                      */
1456   {illegal,0,     2,10}, /* f6: 0100 1100 1111 0110                      */
1457   {illegal,0,     2,10}, /* f7: 0100 1100 1111 0111                      */
1458   {illegal,0,     2,10}, /* f8: 0100 1100 1111 1000                      */
1459   {illegal,0,     2,10}, /* f9: 0100 1100 1111 1001                      */
1460   {illegal,0,     2,10}, /* fa: 0100 1100 1111 1010                      */
1461   {illegal,0,     2,10}, /* fb: 0100 1100 1111 1011                      */
1462   {illegal,0,     2,10}, /* fc: 0100 1100 1111 1100                      */
1463   {illegal,0,     2,10}, /* fd: 0100 1100 1111 1101                      */
1464   {illegal,0,     2,10}, /* fe: 0100 1100 1111 1110                      */
1465   {illegal,0,     2,10}   /* ff: 0100 1100 1111 1111                      */
1462   {illegal,0     }, /* f0: 0100 1100 1111 0000                      */
1463   {illegal,0     }, /* f1: 0100 1100 1111 0001                      */
1464   {illegal,0     }, /* f2: 0100 1100 1111 0010                      */
1465   {illegal,0     }, /* f3: 0100 1100 1111 0011                      */
1466   {illegal,0     }, /* f4: 0100 1100 1111 0100                      */
1467   {illegal,0     }, /* f5: 0100 1100 1111 0101                      */
1468   {illegal,0     }, /* f6: 0100 1100 1111 0110                      */
1469   {illegal,0     }, /* f7: 0100 1100 1111 0111                      */
1470   {illegal,0     }, /* f8: 0100 1100 1111 1000                      */
1471   {illegal,0     }, /* f9: 0100 1100 1111 1001                      */
1472   {illegal,0     }, /* fa: 0100 1100 1111 1010                      */
1473   {illegal,0     }, /* fb: 0100 1100 1111 1011                      */
1474   {illegal,0     }, /* fc: 0100 1100 1111 1100                      */
1475   {illegal,0     }, /* fd: 0100 1100 1111 1101                      */
1476   {illegal,0     }, /* fe: 0100 1100 1111 1110                      */
1477   {illegal,0     }   /* ff: 0100 1100 1111 1111                      */
14661478};
14671479
14681480/* prefix 4D */
14691481static const struct dasm_s  dasm4D_7810[256] =
14701482{
1471   {illegal,0,     2, 8}, /* 00: 0100 1101 0000 0000                      */
1472   {illegal,0,     2, 8}, /* 01: 0100 1101 0000 0001                      */
1473   {illegal,0,     2, 8}, /* 02: 0100 1101 0000 0010                      */
1474   {illegal,0,     2, 8}, /* 03: 0100 1101 0000 0011                      */
1475   {illegal,0,     2, 8}, /* 04: 0100 1101 0000 0100                      */
1476   {illegal,0,     2, 8}, /* 05: 0100 1101 0000 0101                      */
1477   {illegal,0,     2, 8}, /* 06: 0100 1101 0000 0110                      */
1478   {illegal,0,     2, 8}, /* 07: 0100 1101 0000 0111                      */
1479   {illegal,0,     2, 8}, /* 08: 0100 1101 0000 1000                      */
1480   {illegal,0,     2, 8}, /* 09: 0100 1101 0000 1001                      */
1481   {illegal,0,     2, 8}, /* 0a: 0100 1101 0000 1010                      */
1482   {illegal,0,     2, 8}, /* 0b: 0100 1101 0000 1011                      */
1483   {illegal,0,     2, 8}, /* 0c: 0100 1101 0000 1100                      */
1484   {illegal,0,     2, 8}, /* 0d: 0100 1101 0000 1101                      */
1485   {illegal,0,     2, 8}, /* 0e: 0100 1101 0000 1110                      */
1486   {illegal,0,     2, 8}, /* 0f: 0100 1101 0000 1111                      */
1483   {illegal,0     }, /* 00: 0100 1101 0000 0000                      */
1484   {illegal,0     }, /* 01: 0100 1101 0000 0001                      */
1485   {illegal,0     }, /* 02: 0100 1101 0000 0010                      */
1486   {illegal,0     }, /* 03: 0100 1101 0000 0011                      */
1487   {illegal,0     }, /* 04: 0100 1101 0000 0100                      */
1488   {illegal,0     }, /* 05: 0100 1101 0000 0101                      */
1489   {illegal,0     }, /* 06: 0100 1101 0000 0110                      */
1490   {illegal,0     }, /* 07: 0100 1101 0000 0111                      */
1491   {illegal,0     }, /* 08: 0100 1101 0000 1000                      */
1492   {illegal,0     }, /* 09: 0100 1101 0000 1001                      */
1493   {illegal,0     }, /* 0a: 0100 1101 0000 1010                      */
1494   {illegal,0     }, /* 0b: 0100 1101 0000 1011                      */
1495   {illegal,0     }, /* 0c: 0100 1101 0000 1100                      */
1496   {illegal,0     }, /* 0d: 0100 1101 0000 1101                      */
1497   {illegal,0     }, /* 0e: 0100 1101 0000 1110                      */
1498   {illegal,0     }, /* 0f: 0100 1101 0000 1111                      */
14871499
1488   {illegal,0,     2, 8}, /* 10: 0100 1101 0001 0000                      */
1489   {illegal,0,     2, 8}, /* 11: 0100 1101 0001 0001                      */
1490   {illegal,0,     2, 8}, /* 12: 0100 1101 0001 0010                      */
1491   {illegal,0,     2, 8}, /* 13: 0100 1101 0001 0011                      */
1492   {illegal,0,     2, 8}, /* 14: 0100 1101 0001 0100                      */
1493   {illegal,0,     2, 8}, /* 15: 0100 1101 0001 0101                      */
1494   {illegal,0,     2, 8}, /* 16: 0100 1101 0001 0110                      */
1495   {illegal,0,     2, 8}, /* 17: 0100 1101 0001 0111                      */
1496   {illegal,0,     2, 8}, /* 18: 0100 1101 0001 1000                      */
1497   {illegal,0,     2, 8}, /* 19: 0100 1101 0001 1001                      */
1498   {illegal,0,     2, 8}, /* 1a: 0100 1101 0001 1010                      */
1499   {illegal,0,     2, 8}, /* 1b: 0100 1101 0001 1011                      */
1500   {illegal,0,     2, 8}, /* 1c: 0100 1101 0001 1100                      */
1501   {illegal,0,     2, 8}, /* 1d: 0100 1101 0001 1101                      */
1502   {illegal,0,     2, 8}, /* 1e: 0100 1101 0001 1110                      */
1503   {illegal,0,     2, 8}, /* 1f: 0100 1101 0001 1111                      */
1500   {illegal,0     }, /* 10: 0100 1101 0001 0000                      */
1501   {illegal,0     }, /* 11: 0100 1101 0001 0001                      */
1502   {illegal,0     }, /* 12: 0100 1101 0001 0010                      */
1503   {illegal,0     }, /* 13: 0100 1101 0001 0011                      */
1504   {illegal,0     }, /* 14: 0100 1101 0001 0100                      */
1505   {illegal,0     }, /* 15: 0100 1101 0001 0101                      */
1506   {illegal,0     }, /* 16: 0100 1101 0001 0110                      */
1507   {illegal,0     }, /* 17: 0100 1101 0001 0111                      */
1508   {illegal,0     }, /* 18: 0100 1101 0001 1000                      */
1509   {illegal,0     }, /* 19: 0100 1101 0001 1001                      */
1510   {illegal,0     }, /* 1a: 0100 1101 0001 1010                      */
1511   {illegal,0     }, /* 1b: 0100 1101 0001 1011                      */
1512   {illegal,0     }, /* 1c: 0100 1101 0001 1100                      */
1513   {illegal,0     }, /* 1d: 0100 1101 0001 1101                      */
1514   {illegal,0     }, /* 1e: 0100 1101 0001 1110                      */
1515   {illegal,0     }, /* 1f: 0100 1101 0001 1111                      */
15041516
1505   {illegal,0,     2, 8}, /* 20: 0100 1101 0010 0000                      */
1506   {illegal,0,     2, 8}, /* 21: 0100 1101 0010 0001                      */
1507   {illegal,0,     2, 8}, /* 22: 0100 1101 0010 0010                      */
1508   {illegal,0,     2, 8}, /* 23: 0100 1101 0010 0011                      */
1509   {illegal,0,     2, 8}, /* 24: 0100 1101 0010 0100                      */
1510   {illegal,0,     2, 8}, /* 25: 0100 1101 0010 0101                      */
1511   {illegal,0,     2, 8}, /* 26: 0100 1101 0010 0110                      */
1512   {illegal,0,     2, 8}, /* 27: 0100 1101 0010 0111                      */
1513   {illegal,0,     2, 8}, /* 28: 0100 1101 0010 1000                      */
1514   {illegal,0,     2, 8}, /* 29: 0100 1101 0010 1001                      */
1515   {illegal,0,     2, 8}, /* 2a: 0100 1101 0010 1010                      */
1516   {illegal,0,     2, 8}, /* 2b: 0100 1101 0010 1011                      */
1517   {illegal,0,     2, 8}, /* 2c: 0100 1101 0010 1100                      */
1518   {illegal,0,     2, 8}, /* 2d: 0100 1101 0010 1101                      */
1519   {illegal,0,     2, 8}, /* 2e: 0100 1101 0010 1110                      */
1520   {illegal,0,     2, 8}, /* 2f: 0100 1101 0010 1111                      */
1517   {illegal,0     }, /* 20: 0100 1101 0010 0000                      */
1518   {illegal,0     }, /* 21: 0100 1101 0010 0001                      */
1519   {illegal,0     }, /* 22: 0100 1101 0010 0010                      */
1520   {illegal,0     }, /* 23: 0100 1101 0010 0011                      */
1521   {illegal,0     }, /* 24: 0100 1101 0010 0100                      */
1522   {illegal,0     }, /* 25: 0100 1101 0010 0101                      */
1523   {illegal,0     }, /* 26: 0100 1101 0010 0110                      */
1524   {illegal,0     }, /* 27: 0100 1101 0010 0111                      */
1525   {illegal,0     }, /* 28: 0100 1101 0010 1000                      */
1526   {illegal,0     }, /* 29: 0100 1101 0010 1001                      */
1527   {illegal,0     }, /* 2a: 0100 1101 0010 1010                      */
1528   {illegal,0     }, /* 2b: 0100 1101 0010 1011                      */
1529   {illegal,0     }, /* 2c: 0100 1101 0010 1100                      */
1530   {illegal,0     }, /* 2d: 0100 1101 0010 1101                      */
1531   {illegal,0     }, /* 2e: 0100 1101 0010 1110                      */
1532   {illegal,0     }, /* 2f: 0100 1101 0010 1111                      */
15211533
1522   {illegal,0,     2, 8}, /* 30: 0100 1101 0011 0000                      */
1523   {illegal,0,     2, 8}, /* 31: 0100 1101 0011 0001                      */
1524   {illegal,0,     2, 8}, /* 32: 0100 1101 0011 0010                      */
1525   {illegal,0,     2, 8}, /* 33: 0100 1101 0011 0011                      */
1526   {illegal,0,     2, 8}, /* 34: 0100 1101 0011 0100                      */
1527   {illegal,0,     2, 8}, /* 35: 0100 1101 0011 0101                      */
1528   {illegal,0,     2, 8}, /* 36: 0100 1101 0011 0110                      */
1529   {illegal,0,     2, 8}, /* 37: 0100 1101 0011 0111                      */
1530   {illegal,0,     2, 8}, /* 38: 0100 1101 0011 1000                      */
1531   {illegal,0,     2, 8}, /* 39: 0100 1101 0011 1001                      */
1532   {illegal,0,     2, 8}, /* 3a: 0100 1101 0011 1010                      */
1533   {illegal,0,     2, 8}, /* 3b: 0100 1101 0011 1011                      */
1534   {illegal,0,     2, 8}, /* 3c: 0100 1101 0011 1100                      */
1535   {illegal,0,     2, 8}, /* 3d: 0100 1101 0011 1101                      */
1536   {illegal,0,     2, 8}, /* 3e: 0100 1101 0011 1110                      */
1537   {illegal,0,     2, 8}, /* 3f: 0100 1101 0011 1111                      */
1534   {illegal,0     }, /* 30: 0100 1101 0011 0000                      */
1535   {illegal,0     }, /* 31: 0100 1101 0011 0001                      */
1536   {illegal,0     }, /* 32: 0100 1101 0011 0010                      */
1537   {illegal,0     }, /* 33: 0100 1101 0011 0011                      */
1538   {illegal,0     }, /* 34: 0100 1101 0011 0100                      */
1539   {illegal,0     }, /* 35: 0100 1101 0011 0101                      */
1540   {illegal,0     }, /* 36: 0100 1101 0011 0110                      */
1541   {illegal,0     }, /* 37: 0100 1101 0011 0111                      */
1542   {illegal,0     }, /* 38: 0100 1101 0011 1000                      */
1543   {illegal,0     }, /* 39: 0100 1101 0011 1001                      */
1544   {illegal,0     }, /* 3a: 0100 1101 0011 1010                      */
1545   {illegal,0     }, /* 3b: 0100 1101 0011 1011                      */
1546   {illegal,0     }, /* 3c: 0100 1101 0011 1100                      */
1547   {illegal,0     }, /* 3d: 0100 1101 0011 1101                      */
1548   {illegal,0     }, /* 3e: 0100 1101 0011 1110                      */
1549   {illegal,0     }, /* 3f: 0100 1101 0011 1111                      */
15381550
1539   {illegal,0,     2, 8}, /* 40: 0100 1101 0100 0000                      */
1540   {illegal,0,     2, 8}, /* 41: 0100 1101 0100 0001                      */
1541   {illegal,0,     2, 8}, /* 42: 0100 1101 0100 0010                      */
1542   {illegal,0,     2, 8}, /* 43: 0100 1101 0100 0011                      */
1543   {illegal,0,     2, 8}, /* 44: 0100 1101 0100 0100                      */
1544   {illegal,0,     2, 8}, /* 45: 0100 1101 0100 0101                      */
1545   {illegal,0,     2, 8}, /* 46: 0100 1101 0100 0110                      */
1546   {illegal,0,     2, 8}, /* 47: 0100 1101 0100 0111                      */
1547   {illegal,0,     2, 8}, /* 48: 0100 1101 0100 1000                      */
1548   {illegal,0,     2, 8}, /* 49: 0100 1101 0100 1001                      */
1549   {illegal,0,     2, 8}, /* 4a: 0100 1101 0100 1010                      */
1550   {illegal,0,     2, 8}, /* 4b: 0100 1101 0100 1011                      */
1551   {illegal,0,     2, 8}, /* 4c: 0100 1101 0100 1100                      */
1552   {illegal,0,     2, 8}, /* 4d: 0100 1101 0100 1101                      */
1553   {illegal,0,     2, 8}, /* 4e: 0100 1101 0100 1110                      */
1554   {illegal,0,     2, 8}, /* 4f: 0100 1101 0100 1111                      */
1551   {illegal,0     }, /* 40: 0100 1101 0100 0000                      */
1552   {illegal,0     }, /* 41: 0100 1101 0100 0001                      */
1553   {illegal,0     }, /* 42: 0100 1101 0100 0010                      */
1554   {illegal,0     }, /* 43: 0100 1101 0100 0011                      */
1555   {illegal,0     }, /* 44: 0100 1101 0100 0100                      */
1556   {illegal,0     }, /* 45: 0100 1101 0100 0101                      */
1557   {illegal,0     }, /* 46: 0100 1101 0100 0110                      */
1558   {illegal,0     }, /* 47: 0100 1101 0100 0111                      */
1559   {illegal,0     }, /* 48: 0100 1101 0100 1000                      */
1560   {illegal,0     }, /* 49: 0100 1101 0100 1001                      */
1561   {illegal,0     }, /* 4a: 0100 1101 0100 1010                      */
1562   {illegal,0     }, /* 4b: 0100 1101 0100 1011                      */
1563   {illegal,0     }, /* 4c: 0100 1101 0100 1100                      */
1564   {illegal,0     }, /* 4d: 0100 1101 0100 1101                      */
1565   {illegal,0     }, /* 4e: 0100 1101 0100 1110                      */
1566   {illegal,0     }, /* 4f: 0100 1101 0100 1111                      */
15551567
1556   {illegal,0,     2, 8}, /* 50: 0100 1101 0101 0000                      */
1557   {illegal,0,     2, 8}, /* 51: 0100 1101 0101 0001                      */
1558   {illegal,0,     2, 8}, /* 52: 0100 1101 0101 0010                      */
1559   {illegal,0,     2, 8}, /* 53: 0100 1101 0101 0011                      */
1560   {illegal,0,     2, 8}, /* 54: 0100 1101 0101 0100                      */
1561   {illegal,0,     2, 8}, /* 55: 0100 1101 0101 0101                      */
1562   {illegal,0,     2, 8}, /* 56: 0100 1101 0101 0110                      */
1563   {illegal,0,     2, 8}, /* 57: 0100 1101 0101 0111                      */
1564   {illegal,0,     2, 8}, /* 58: 0100 1101 0101 1000                      */
1565   {illegal,0,     2, 8}, /* 59: 0100 1101 0101 1001                      */
1566   {illegal,0,     2, 8}, /* 5a: 0100 1101 0101 1010                      */
1567   {illegal,0,     2, 8}, /* 5b: 0100 1101 0101 1011                      */
1568   {illegal,0,     2, 8}, /* 5c: 0100 1101 0101 1100                      */
1569   {illegal,0,     2, 8}, /* 5d: 0100 1101 0101 1101                      */
1570   {illegal,0,     2, 8}, /* 5e: 0100 1101 0101 1110                      */
1571   {illegal,0,     2, 8}, /* 5f: 0100 1101 0101 1111                      */
1568   {illegal,0     }, /* 50: 0100 1101 0101 0000                      */
1569   {illegal,0     }, /* 51: 0100 1101 0101 0001                      */
1570   {illegal,0     }, /* 52: 0100 1101 0101 0010                      */
1571   {illegal,0     }, /* 53: 0100 1101 0101 0011                      */
1572   {illegal,0     }, /* 54: 0100 1101 0101 0100                      */
1573   {illegal,0     }, /* 55: 0100 1101 0101 0101                      */
1574   {illegal,0     }, /* 56: 0100 1101 0101 0110                      */
1575   {illegal,0     }, /* 57: 0100 1101 0101 0111                      */
1576   {illegal,0     }, /* 58: 0100 1101 0101 1000                      */
1577   {illegal,0     }, /* 59: 0100 1101 0101 1001                      */
1578   {illegal,0     }, /* 5a: 0100 1101 0101 1010                      */
1579   {illegal,0     }, /* 5b: 0100 1101 0101 1011                      */
1580   {illegal,0     }, /* 5c: 0100 1101 0101 1100                      */
1581   {illegal,0     }, /* 5d: 0100 1101 0101 1101                      */
1582   {illegal,0     }, /* 5e: 0100 1101 0101 1110                      */
1583   {illegal,0     }, /* 5f: 0100 1101 0101 1111                      */
15721584
1573   {illegal,0,     2, 8}, /* 60: 0100 1101 0110 0000                      */
1574   {illegal,0,     2, 8}, /* 61: 0100 1101 0110 0001                      */
1575   {illegal,0,     2, 8}, /* 62: 0100 1101 0110 0010                      */
1576   {illegal,0,     2, 8}, /* 63: 0100 1101 0110 0011                      */
1577   {illegal,0,     2, 8}, /* 64: 0100 1101 0110 0100                      */
1578   {illegal,0,     2, 8}, /* 65: 0100 1101 0110 0101                      */
1579   {illegal,0,     2, 8}, /* 66: 0100 1101 0110 0110                      */
1580   {illegal,0,     2, 8}, /* 67: 0100 1101 0110 0111                      */
1581   {illegal,0,     2, 8}, /* 68: 0100 1101 0110 1000                      */
1582   {illegal,0,     2, 8}, /* 69: 0100 1101 0110 1001                      */
1583   {illegal,0,     2, 8}, /* 6a: 0100 1101 0110 1010                      */
1584   {illegal,0,     2, 8}, /* 6b: 0100 1101 0110 1011                      */
1585   {illegal,0,     2, 8}, /* 6c: 0100 1101 0110 1100                      */
1586   {illegal,0,     2, 8}, /* 6d: 0100 1101 0110 1101                      */
1587   {illegal,0,     2, 8}, /* 6e: 0100 1101 0110 1110                      */
1588   {illegal,0,     2, 8}, /* 6f: 0100 1101 0110 1111                      */
1585   {illegal,0     }, /* 60: 0100 1101 0110 0000                      */
1586   {illegal,0     }, /* 61: 0100 1101 0110 0001                      */
1587   {illegal,0     }, /* 62: 0100 1101 0110 0010                      */
1588   {illegal,0     }, /* 63: 0100 1101 0110 0011                      */
1589   {illegal,0     }, /* 64: 0100 1101 0110 0100                      */
1590   {illegal,0     }, /* 65: 0100 1101 0110 0101                      */
1591   {illegal,0     }, /* 66: 0100 1101 0110 0110                      */
1592   {illegal,0     }, /* 67: 0100 1101 0110 0111                      */
1593   {illegal,0     }, /* 68: 0100 1101 0110 1000                      */
1594   {illegal,0     }, /* 69: 0100 1101 0110 1001                      */
1595   {illegal,0     }, /* 6a: 0100 1101 0110 1010                      */
1596   {illegal,0     }, /* 6b: 0100 1101 0110 1011                      */
1597   {illegal,0     }, /* 6c: 0100 1101 0110 1100                      */
1598   {illegal,0     }, /* 6d: 0100 1101 0110 1101                      */
1599   {illegal,0     }, /* 6e: 0100 1101 0110 1110                      */
1600   {illegal,0     }, /* 6f: 0100 1101 0110 1111                      */
15891601
1590   {illegal,0,     2, 8}, /* 70: 0100 1101 0111 0000                      */
1591   {illegal,0,     2, 8}, /* 71: 0100 1101 0111 0001                      */
1592   {illegal,0,     2, 8}, /* 72: 0100 1101 0111 0010                      */
1593   {illegal,0,     2, 8}, /* 73: 0100 1101 0111 0011                      */
1594   {illegal,0,     2, 8}, /* 74: 0100 1101 0111 0100                      */
1595   {illegal,0,     2, 8}, /* 75: 0100 1101 0111 0101                      */
1596   {illegal,0,     2, 8}, /* 76: 0100 1101 0111 0110                      */
1597   {illegal,0,     2, 8}, /* 77: 0100 1101 0111 0111                      */
1598   {illegal,0,     2, 8}, /* 78: 0100 1101 0111 1000                      */
1599   {illegal,0,     2, 8}, /* 79: 0100 1101 0111 1001                      */
1600   {illegal,0,     2, 8}, /* 7a: 0100 1101 0111 1010                      */
1601   {illegal,0,     2, 8}, /* 7b: 0100 1101 0111 1011                      */
1602   {illegal,0,     2, 8}, /* 7c: 0100 1101 0111 1100                      */
1603   {illegal,0,     2, 8}, /* 7d: 0100 1101 0111 1101                      */
1604   {illegal,0,     2, 8}, /* 7e: 0100 1101 0111 1110                      */
1605   {illegal,0,     2, 8}, /* 7f: 0100 1101 0111 1111                      */
1602   {illegal,0     }, /* 70: 0100 1101 0111 0000                      */
1603   {illegal,0     }, /* 71: 0100 1101 0111 0001                      */
1604   {illegal,0     }, /* 72: 0100 1101 0111 0010                      */
1605   {illegal,0     }, /* 73: 0100 1101 0111 0011                      */
1606   {illegal,0     }, /* 74: 0100 1101 0111 0100                      */
1607   {illegal,0     }, /* 75: 0100 1101 0111 0101                      */
1608   {illegal,0     }, /* 76: 0100 1101 0111 0110                      */
1609   {illegal,0     }, /* 77: 0100 1101 0111 0111                      */
1610   {illegal,0     }, /* 78: 0100 1101 0111 1000                      */
1611   {illegal,0     }, /* 79: 0100 1101 0111 1001                      */
1612   {illegal,0     }, /* 7a: 0100 1101 0111 1010                      */
1613   {illegal,0     }, /* 7b: 0100 1101 0111 1011                      */
1614   {illegal,0     }, /* 7c: 0100 1101 0111 1100                      */
1615   {illegal,0     }, /* 7d: 0100 1101 0111 1101                      */
1616   {illegal,0     }, /* 7e: 0100 1101 0111 1110                      */
1617   {illegal,0     }, /* 7f: 0100 1101 0111 1111                      */
16061618
1607   {illegal,0,     2, 8}, /* 80: 0100 1101 1000 0000                      */
1608   {illegal,0,     2, 8}, /* 81: 0100 1101 1000 0001                      */
1609   {illegal,0,     2, 8}, /* 82: 0100 1101 1000 0010                      */
1610   {illegal,0,     2, 8}, /* 83: 0100 1101 1000 0011                      */
1611   {illegal,0,     2, 8}, /* 84: 0100 1101 1000 0100                      */
1612   {illegal,0,     2, 8}, /* 85: 0100 1101 1000 0101                      */
1613   {illegal,0,     2, 8}, /* 86: 0100 1101 1000 0110                      */
1614   {illegal,0,     2, 8}, /* 87: 0100 1101 1000 0111                      */
1615   {illegal,0,     2, 8}, /* 88: 0100 1101 1000 1000                      */
1616   {illegal,0,     2, 8}, /* 89: 0100 1101 1000 1001                      */
1617   {illegal,0,     2, 8}, /* 8a: 0100 1101 1000 1010                      */
1618   {illegal,0,     2, 8}, /* 8b: 0100 1101 1000 1011                      */
1619   {illegal,0,     2, 8}, /* 8c: 0100 1101 1000 1100                      */
1620   {illegal,0,     2, 8}, /* 8d: 0100 1101 1000 1101                      */
1621   {illegal,0,     2, 8}, /* 8e: 0100 1101 1000 1110                      */
1622   {illegal,0,     2, 8}, /* 8f: 0100 1101 1000 1111                      */
1619   {illegal,0     }, /* 80: 0100 1101 1000 0000                      */
1620   {illegal,0     }, /* 81: 0100 1101 1000 0001                      */
1621   {illegal,0     }, /* 82: 0100 1101 1000 0010                      */
1622   {illegal,0     }, /* 83: 0100 1101 1000 0011                      */
1623   {illegal,0     }, /* 84: 0100 1101 1000 0100                      */
1624   {illegal,0     }, /* 85: 0100 1101 1000 0101                      */
1625   {illegal,0     }, /* 86: 0100 1101 1000 0110                      */
1626   {illegal,0     }, /* 87: 0100 1101 1000 0111                      */
1627   {illegal,0     }, /* 88: 0100 1101 1000 1000                      */
1628   {illegal,0     }, /* 89: 0100 1101 1000 1001                      */
1629   {illegal,0     }, /* 8a: 0100 1101 1000 1010                      */
1630   {illegal,0     }, /* 8b: 0100 1101 1000 1011                      */
1631   {illegal,0     }, /* 8c: 0100 1101 1000 1100                      */
1632   {illegal,0     }, /* 8d: 0100 1101 1000 1101                      */
1633   {illegal,0     }, /* 8e: 0100 1101 1000 1110                      */
1634   {illegal,0     }, /* 8f: 0100 1101 1000 1111                      */
16231635
1624   {illegal,0,     2, 8}, /* 90: 0100 1101 1001 0000                      */
1625   {illegal,0,     2, 8}, /* 91: 0100 1101 1001 0001                      */
1626   {illegal,0,     2, 8}, /* 92: 0100 1101 1001 0010                      */
1627   {illegal,0,     2, 8}, /* 93: 0100 1101 1001 0011                      */
1628   {illegal,0,     2, 8}, /* 94: 0100 1101 1001 0100                      */
1629   {illegal,0,     2, 8}, /* 95: 0100 1101 1001 0101                      */
1630   {illegal,0,     2, 8}, /* 96: 0100 1101 1001 0110                      */
1631   {illegal,0,     2, 8}, /* 97: 0100 1101 1001 0111                      */
1632   {illegal,0,     2, 8}, /* 98: 0100 1101 1001 1000                      */
1633   {illegal,0,     2, 8}, /* 99: 0100 1101 1001 1001                      */
1634   {illegal,0,     2, 8}, /* 9a: 0100 1101 1001 1010                      */
1635   {illegal,0,     2, 8}, /* 9b: 0100 1101 1001 1011                      */
1636   {illegal,0,     2, 8}, /* 9c: 0100 1101 1001 1100                      */
1637   {illegal,0,     2, 8}, /* 9d: 0100 1101 1001 1101                      */
1638   {illegal,0,     2, 8}, /* 9e: 0100 1101 1001 1110                      */
1639   {illegal,0,     2, 8}, /* 9f: 0100 1101 1001 1111                      */
1636   {illegal,0     }, /* 90: 0100 1101 1001 0000                      */
1637   {illegal,0     }, /* 91: 0100 1101 1001 0001                      */
1638   {illegal,0     }, /* 92: 0100 1101 1001 0010                      */
1639   {illegal,0     }, /* 93: 0100 1101 1001 0011                      */
1640   {illegal,0     }, /* 94: 0100 1101 1001 0100                      */
1641   {illegal,0     }, /* 95: 0100 1101 1001 0101                      */
1642   {illegal,0     }, /* 96: 0100 1101 1001 0110                      */
1643   {illegal,0     }, /* 97: 0100 1101 1001 0111                      */
1644   {illegal,0     }, /* 98: 0100 1101 1001 1000                      */
1645   {illegal,0     }, /* 99: 0100 1101 1001 1001                      */
1646   {illegal,0     }, /* 9a: 0100 1101 1001 1010                      */
1647   {illegal,0     }, /* 9b: 0100 1101 1001 1011                      */
1648   {illegal,0     }, /* 9c: 0100 1101 1001 1100                      */
1649   {illegal,0     }, /* 9d: 0100 1101 1001 1101                      */
1650   {illegal,0     }, /* 9e: 0100 1101 1001 1110                      */
1651   {illegal,0     }, /* 9f: 0100 1101 1001 1111                      */
16401652
1641   {illegal,0,     2, 8}, /* a0: 0100 1101 1010 0000                      */
1642   {illegal,0,     2, 8}, /* a1: 0100 1101 1010 0001                      */
1643   {illegal,0,     2, 8}, /* a2: 0100 1101 1010 0010                      */
1644   {illegal,0,     2, 8}, /* a3: 0100 1101 1010 0011                      */
1645   {illegal,0,     2, 8}, /* a4: 0100 1101 1010 0100                      */
1646   {illegal,0,     2, 8}, /* a5: 0100 1101 1010 0101                      */
1647   {illegal,0,     2, 8}, /* a6: 0100 1101 1010 0110                      */
1648   {illegal,0,     2, 8}, /* a7: 0100 1101 1010 0111                      */
1649   {illegal,0,     2, 8}, /* a8: 0100 1101 1010 1000                      */
1650   {illegal,0,     2, 8}, /* a9: 0100 1101 1010 1001                      */
1651   {illegal,0,     2, 8}, /* aa: 0100 1101 1010 1010                      */
1652   {illegal,0,     2, 8}, /* ab: 0100 1101 1010 1011                      */
1653   {illegal,0,     2, 8}, /* ac: 0100 1101 1010 1100                      */
1654   {illegal,0,     2, 8}, /* ad: 0100 1101 1010 1101                      */
1655   {illegal,0,     2, 8}, /* ae: 0100 1101 1010 1110                      */
1656   {illegal,0,     2, 8}, /* af: 0100 1101 1010 1111                      */
1653   {illegal,0     }, /* a0: 0100 1101 1010 0000                      */
1654   {illegal,0     }, /* a1: 0100 1101 1010 0001                      */
1655   {illegal,0     }, /* a2: 0100 1101 1010 0010                      */
1656   {illegal,0     }, /* a3: 0100 1101 1010 0011                      */
1657   {illegal,0     }, /* a4: 0100 1101 1010 0100                      */
1658   {illegal,0     }, /* a5: 0100 1101 1010 0101                      */
1659   {illegal,0     }, /* a6: 0100 1101 1010 0110                      */
1660   {illegal,0     }, /* a7: 0100 1101 1010 0111                      */
1661   {illegal,0     }, /* a8: 0100 1101 1010 1000                      */
1662   {illegal,0     }, /* a9: 0100 1101 1010 1001                      */
1663   {illegal,0     }, /* aa: 0100 1101 1010 1010                      */
1664   {illegal,0     }, /* ab: 0100 1101 1010 1011                      */
1665   {illegal,0     }, /* ac: 0100 1101 1010 1100                      */
1666   {illegal,0     }, /* ad: 0100 1101 1010 1101                      */
1667   {illegal,0     }, /* ae: 0100 1101 1010 1110                      */
1668   {illegal,0     }, /* af: 0100 1101 1010 1111                      */
16571669
1658   {illegal,0,     2, 8}, /* b0: 0100 1101 1011 0000                      */
1659   {illegal,0,     2, 8}, /* b1: 0100 1101 1011 0001                      */
1660   {illegal,0,     2, 8}, /* b2: 0100 1101 1011 0010                      */
1661   {illegal,0,     2, 8}, /* b3: 0100 1101 1011 0011                      */
1662   {illegal,0,     2, 8}, /* b4: 0100 1101 1011 0100                      */
1663   {illegal,0,     2, 8}, /* b5: 0100 1101 1011 0101                      */
1664   {illegal,0,     2, 8}, /* b6: 0100 1101 1011 0110                      */
1665   {illegal,0,     2, 8}, /* b7: 0100 1101 1011 0111                      */
1666   {illegal,0,     2, 8}, /* b8: 0100 1101 1011 1000                      */
1667   {illegal,0,     2, 8}, /* b9: 0100 1101 1011 1001                      */
1668   {illegal,0,     2, 8}, /* ba: 0100 1101 1011 1010                      */
1669   {illegal,0,     2, 8}, /* bb: 0100 1101 1011 1011                      */
1670   {illegal,0,     2, 8}, /* bc: 0100 1101 1011 1100                      */
1671   {illegal,0,     2, 8}, /* bd: 0100 1101 1011 1101                      */
1672   {illegal,0,     2, 8}, /* be: 0100 1101 1011 1110                      */
1673   {illegal,0,     2, 8}, /* bf: 0100 1101 1011 1111                      */
1670   {illegal,0     }, /* b0: 0100 1101 1011 0000                      */
1671   {illegal,0     }, /* b1: 0100 1101 1011 0001                      */
1672   {illegal,0     }, /* b2: 0100 1101 1011 0010                      */
1673   {illegal,0     }, /* b3: 0100 1101 1011 0011                      */
1674   {illegal,0     }, /* b4: 0100 1101 1011 0100                      */
1675   {illegal,0     }, /* b5: 0100 1101 1011 0101                      */
1676   {illegal,0     }, /* b6: 0100 1101 1011 0110                      */
1677   {illegal,0     }, /* b7: 0100 1101 1011 0111                      */
1678   {illegal,0     }, /* b8: 0100 1101 1011 1000                      */
1679   {illegal,0     }, /* b9: 0100 1101 1011 1001                      */
1680   {illegal,0     }, /* ba: 0100 1101 1011 1010                      */
1681   {illegal,0     }, /* bb: 0100 1101 1011 1011                      */
1682   {illegal,0     }, /* bc: 0100 1101 1011 1100                      */
1683   {illegal,0     }, /* bd: 0100 1101 1011 1101                      */
1684   {illegal,0     }, /* be: 0100 1101 1011 1110                      */
1685   {illegal,0     }, /* bf: 0100 1101 1011 1111                      */
16741686
1675   {MOV,"PA,A",     2,10}, /* c0: 0100 1101 1100 0000                      */
1676   {MOV,"PB,A",     2,10}, /* c1: 0100 1101 1100 0001                      */
1677   {MOV,"PC,A",     2,10}, /* c2: 0100 1101 1100 0010                      */
1678   {MOV,"PD,A",     2,10}, /* c3: 0100 1101 1100 0011                      */
1679   {illegal,0,     2,10}, /* c4: 0100 1101 1100 0100                      */
1680   {MOV,"PF,A",     2,10}, /* c5: 0100 1101 1100 0101                      */
1681   {MOV,"MKH,A",    2,10}, /* c6: 0100 1101 1100 0110                      */
1682   {MOV,"MKL,A",    2,10}, /* c7: 0100 1101 1100 0111                      */
1683   {MOV,"ANM,A",    2,10}, /* c8: 0100 1101 1100 1000                      */   /* 7810 */
1684   {MOV,"SMH,A",    2,10}, /* c9: 0100 1101 1100 1001                      */
1685   {MOV,"SML,A",    2,10}, /* ca: 0100 1101 1100 1010                      */
1686   {MOV,"EOM,A",    2,10}, /* cb: 0100 1101 1100 1011                      */
1687   {MOV,"ETMM,A",   2,10}, /* cc: 0100 1101 1100 1100                      */
1688   {MOV,"TMM,A",    2,10}, /* cd: 0100 1101 1100 1101                      */
1689   {illegal,0,     2,10}, /* ce: 0100 1101 1100 1110                      */
1690   {illegal,0,     2,10}, /* cf: 0100 1101 1100 1111                      */
1687   {MOV,"PA,A"     }, /* c0: 0100 1101 1100 0000                      */
1688   {MOV,"PB,A"     }, /* c1: 0100 1101 1100 0001                      */
1689   {MOV,"PC,A"     }, /* c2: 0100 1101 1100 0010                      */
1690   {MOV,"PD,A"     }, /* c3: 0100 1101 1100 0011                      */
1691   {illegal,0     }, /* c4: 0100 1101 1100 0100                      */
1692   {MOV,"PF,A"     }, /* c5: 0100 1101 1100 0101                      */
1693   {MOV,"MKH,A"    }, /* c6: 0100 1101 1100 0110                      */
1694   {MOV,"MKL,A"    }, /* c7: 0100 1101 1100 0111                      */
1695   {MOV,"ANM,A"    }, /* c8: 0100 1101 1100 1000                      */   /* 7810 */
1696   {MOV,"SMH,A"    }, /* c9: 0100 1101 1100 1001                      */
1697   {MOV,"SML,A"    }, /* ca: 0100 1101 1100 1010                      */
1698   {MOV,"EOM,A"    }, /* cb: 0100 1101 1100 1011                      */
1699   {MOV,"ETMM,A"   }, /* cc: 0100 1101 1100 1100                      */
1700   {MOV,"TMM,A"    }, /* cd: 0100 1101 1100 1101                      */
1701   {illegal,0     }, /* ce: 0100 1101 1100 1110                      */
1702   {illegal,0     }, /* cf: 0100 1101 1100 1111                      */
16911703
1692   {MOV,"MM,A",     2,10}, /* d0: 0100 1101 1101 0000                      */
1693   {MOV,"MCC,A",    2,10}, /* d1: 0100 1101 1101 0001                      */
1694   {MOV,"MA,A",     2,10}, /* d2: 0100 1101 1101 0010                      */
1695   {MOV,"MB,A",     2,10}, /* d3: 0100 1101 1101 0011                      */
1696   {MOV,"MC,A",     2,10}, /* d4: 0100 1101 1101 0100                      */
1697   {illegal,0,     2,10}, /* d5: 0100 1101 1101 0101                      */
1698   {illegal,0,     2,10}, /* d6: 0100 1101 1101 0110                      */
1699   {MOV,"MF,A",     2,10}, /* d7: 0100 1101 1101 0111                      */
1700   {MOV,"TXB,A",    2,10}, /* d8: 0100 1101 1101 1000                      */
1701   {illegal,0,     2,10}, /* d9: 0100 1101 1101 1001                      */
1702   {MOV,"TM0,A",    2,10}, /* da: 0100 1101 1101 1010                      */
1703   {MOV,"TM1,A",    2,10}, /* db: 0100 1101 1101 1011                      */
1704   {illegal,0,     2,10}, /* dc: 0100 1101 1101 1100                      */
1705   {illegal,0,     2,10}, /* dd: 0100 1101 1101 1101                      */
1706   {illegal,0,     2,10}, /* de: 0100 1101 1101 1110                      */
1707   {illegal,0,     2,10}, /* df: 0100 1101 1101 1111                      */
1704   {MOV,"MM,A"     }, /* d0: 0100 1101 1101 0000                      */
1705   {MOV,"MCC,A"    }, /* d1: 0100 1101 1101 0001                      */
1706   {MOV,"MA,A"     }, /* d2: 0100 1101 1101 0010                      */
1707   {MOV,"MB,A"     }, /* d3: 0100 1101 1101 0011                      */
1708   {MOV,"MC,A"     }, /* d4: 0100 1101 1101 0100                      */
1709   {illegal,0     }, /* d5: 0100 1101 1101 0101                      */
1710   {illegal,0     }, /* d6: 0100 1101 1101 0110                      */
1711   {MOV,"MF,A"     }, /* d7: 0100 1101 1101 0111                      */
1712   {MOV,"TXB,A"    }, /* d8: 0100 1101 1101 1000                      */
1713   {illegal,0     }, /* d9: 0100 1101 1101 1001                      */
1714   {MOV,"TM0,A"    }, /* da: 0100 1101 1101 1010                      */
1715   {MOV,"TM1,A"    }, /* db: 0100 1101 1101 1011                      */
1716   {illegal,0     }, /* dc: 0100 1101 1101 1100                      */
1717   {illegal,0     }, /* dd: 0100 1101 1101 1101                      */
1718   {illegal,0     }, /* de: 0100 1101 1101 1110                      */
1719   {illegal,0     }, /* df: 0100 1101 1101 1111                      */
17081720
1709   {illegal,0,     2,10}, /* e0: 0100 1101 1110 0000                      */
1710   {illegal,0,     2,10}, /* e1: 0100 1101 1110 0001                      */
1711   {illegal,0,     2,10}, /* e2: 0100 1101 1110 0010                      */
1712   {illegal,0,     2,10}, /* e3: 0100 1101 1110 0011                      */
1713   {illegal,0,     2,10}, /* e4: 0100 1101 1110 0100                      */
1714   {illegal,0,     2,10}, /* e5: 0100 1101 1110 0101                      */
1715   {illegal,0,     2,10}, /* e6: 0100 1101 1110 0110                      */
1716   {illegal,0,     2,10}, /* e7: 0100 1101 1110 0111                      */
1717   {MOV,"ZCM,A",    2,10}, /* e8: 0100 1101 1110 1000                      */   /* 7810 */
1718   {illegal,0,     2,10}, /* e9: 0100 1101 1110 1001                      */
1719   {illegal,0,     2,10}, /* ea: 0100 1101 1110 1010                      */
1720   {illegal,0,     2,10}, /* eb: 0100 1101 1110 1011                      */
1721   {illegal,0,     2,10}, /* ec: 0100 1101 1110 1100                      */
1722   {illegal,0,     2,10}, /* ed: 0100 1101 1110 1101                      */
1723   {illegal,0,     2,10}, /* ee: 0100 1101 1110 1110                      */
1724   {illegal,0,     2,10}, /* ef: 0100 1101 1110 1111                      */
1721   {illegal,0     }, /* e0: 0100 1101 1110 0000                      */
1722   {illegal,0     }, /* e1: 0100 1101 1110 0001                      */
1723   {illegal,0     }, /* e2: 0100 1101 1110 0010                      */
1724   {illegal,0     }, /* e3: 0100 1101 1110 0011                      */
1725   {illegal,0     }, /* e4: 0100 1101 1110 0100                      */
1726   {illegal,0     }, /* e5: 0100 1101 1110 0101                      */
1727   {illegal,0     }, /* e6: 0100 1101 1110 0110                      */
1728   {illegal,0     }, /* e7: 0100 1101 1110 0111                      */
1729   {MOV,"ZCM,A"    }, /* e8: 0100 1101 1110 1000                      */   /* 7810 */
1730   {illegal,0     }, /* e9: 0100 1101 1110 1001                      */
1731   {illegal,0     }, /* ea: 0100 1101 1110 1010                      */
1732   {illegal,0     }, /* eb: 0100 1101 1110 1011                      */
1733   {illegal,0     }, /* ec: 0100 1101 1110 1100                      */
1734   {illegal,0     }, /* ed: 0100 1101 1110 1101                      */
1735   {illegal,0     }, /* ee: 0100 1101 1110 1110                      */
1736   {illegal,0     }, /* ef: 0100 1101 1110 1111                      */
17251737
1726   {illegal,0,     2,10}, /* f0: 0100 1101 1111 0000                      */
1727   {illegal,0,     2,10}, /* f1: 0100 1101 1111 0001                      */
1728   {illegal,0,     2,10}, /* f2: 0100 1101 1111 0010                      */
1729   {illegal,0,     2,10}, /* f3: 0100 1101 1111 0011                      */
1730   {illegal,0,     2,10}, /* f4: 0100 1101 1111 0100                      */
1731   {illegal,0,     2,10}, /* f5: 0100 1101 1111 0101                      */
1732   {illegal,0,     2,10}, /* f6: 0100 1101 1111 0110                      */
1733   {illegal,0,     2,10}, /* f7: 0100 1101 1111 0111                      */
1734   {illegal,0,     2,10}, /* f8: 0100 1101 1111 1000                      */
1735   {illegal,0,     2,10}, /* f9: 0100 1101 1111 1001                      */
1736   {illegal,0,     2,10}, /* fa: 0100 1101 1111 1010                      */
1737   {illegal,0,     2,10}, /* fb: 0100 1101 1111 1011                      */
1738   {illegal,0,     2,10}, /* fc: 0100 1101 1111 1100                      */
1739   {illegal,0,     2,10}, /* fd: 0100 1101 1111 1101                      */
1740   {illegal,0,     2,10}, /* fe: 0100 1101 1111 1110                      */
1741   {illegal,0,     2,10}   /* ff: 0100 1101 1111 1111                      */
1738   {illegal,0     }, /* f0: 0100 1101 1111 0000                      */
1739   {illegal,0     }, /* f1: 0100 1101 1111 0001                      */
1740   {illegal,0     }, /* f2: 0100 1101 1111 0010                      */
1741   {illegal,0     }, /* f3: 0100 1101 1111 0011                      */
1742   {illegal,0     }, /* f4: 0100 1101 1111 0100                      */
1743   {illegal,0     }, /* f5: 0100 1101 1111 0101                      */
1744   {illegal,0     }, /* f6: 0100 1101 1111 0110                      */
1745   {illegal,0     }, /* f7: 0100 1101 1111 0111                      */
1746   {illegal,0     }, /* f8: 0100 1101 1111 1000                      */
1747   {illegal,0     }, /* f9: 0100 1101 1111 1001                      */
1748   {illegal,0     }, /* fa: 0100 1101 1111 1010                      */
1749   {illegal,0     }, /* fb: 0100 1101 1111 1011                      */
1750   {illegal,0     }, /* fc: 0100 1101 1111 1100                      */
1751   {illegal,0     }, /* fd: 0100 1101 1111 1101                      */
1752   {illegal,0     }, /* fe: 0100 1101 1111 1110                      */
1753   {illegal,0     }   /* ff: 0100 1101 1111 1111                      */
17421754};
17431755
17441756static const struct dasm_s  dasm4D_7807[256] =
17451757{
1746   {illegal,0,     2, 8}, /* 00: 0100 1101 0000 0000                      */
1747   {illegal,0,     2, 8}, /* 01: 0100 1101 0000 0001                      */
1748   {illegal,0,     2, 8}, /* 02: 0100 1101 0000 0010                      */
1749   {illegal,0,     2, 8}, /* 03: 0100 1101 0000 0011                      */
1750   {illegal,0,     2, 8}, /* 04: 0100 1101 0000 0100                      */
1751   {illegal,0,     2, 8}, /* 05: 0100 1101 0000 0101                      */
1752   {illegal,0,     2, 8}, /* 06: 0100 1101 0000 0110                      */
1753   {illegal,0,     2, 8}, /* 07: 0100 1101 0000 0111                      */
1754   {illegal,0,     2, 8}, /* 08: 0100 1101 0000 1000                      */
1755   {illegal,0,     2, 8}, /* 09: 0100 1101 0000 1001                      */
1756   {illegal,0,     2, 8}, /* 0a: 0100 1101 0000 1010                      */
1757   {illegal,0,     2, 8}, /* 0b: 0100 1101 0000 1011                      */
1758   {illegal,0,     2, 8}, /* 0c: 0100 1101 0000 1100                      */
1759   {illegal,0,     2, 8}, /* 0d: 0100 1101 0000 1101                      */
1760   {illegal,0,     2, 8}, /* 0e: 0100 1101 0000 1110                      */
1761   {illegal,0,     2, 8}, /* 0f: 0100 1101 0000 1111                      */
1758   {illegal,0     }, /* 00: 0100 1101 0000 0000                      */
1759   {illegal,0     }, /* 01: 0100 1101 0000 0001                      */
1760   {illegal,0     }, /* 02: 0100 1101 0000 0010                      */
1761   {illegal,0     }, /* 03: 0100 1101 0000 0011                      */
1762   {illegal,0     }, /* 04: 0100 1101 0000 0100                      */
1763   {illegal,0     }, /* 05: 0100 1101 0000 0101                      */
1764   {illegal,0     }, /* 06: 0100 1101 0000 0110                      */
1765   {illegal,0     }, /* 07: 0100 1101 0000 0111                      */
1766   {illegal,0     }, /* 08: 0100 1101 0000 1000                      */
1767   {illegal,0     }, /* 09: 0100 1101 0000 1001                      */
1768   {illegal,0     }, /* 0a: 0100 1101 0000 1010                      */
1769   {illegal,0     }, /* 0b: 0100 1101 0000 1011                      */
1770   {illegal,0     }, /* 0c: 0100 1101 0000 1100                      */
1771   {illegal,0     }, /* 0d: 0100 1101 0000 1101                      */
1772   {illegal,0     }, /* 0e: 0100 1101 0000 1110                      */
1773   {illegal,0     }, /* 0f: 0100 1101 0000 1111                      */
17621774
1763   {illegal,0,     2, 8}, /* 10: 0100 1101 0001 0000                      */
1764   {illegal,0,     2, 8}, /* 11: 0100 1101 0001 0001                      */
1765   {illegal,0,     2, 8}, /* 12: 0100 1101 0001 0010                      */
1766   {illegal,0,     2, 8}, /* 13: 0100 1101 0001 0011                      */
1767   {illegal,0,     2, 8}, /* 14: 0100 1101 0001 0100                      */
1768   {illegal,0,     2, 8}, /* 15: 0100 1101 0001 0101                      */
1769   {illegal,0,     2, 8}, /* 16: 0100 1101 0001 0110                      */
1770   {illegal,0,     2, 8}, /* 17: 0100 1101 0001 0111                      */
1771   {illegal,0,     2, 8}, /* 18: 0100 1101 0001 1000                      */
1772   {illegal,0,     2, 8}, /* 19: 0100 1101 0001 1001                      */
1773   {illegal,0,     2, 8}, /* 1a: 0100 1101 0001 1010                      */
1774   {illegal,0,     2, 8}, /* 1b: 0100 1101 0001 1011                      */
1775   {illegal,0,     2, 8}, /* 1c: 0100 1101 0001 1100                      */
1776   {illegal,0,     2, 8}, /* 1d: 0100 1101 0001 1101                      */
1777   {illegal,0,     2, 8}, /* 1e: 0100 1101 0001 1110                      */
1778   {illegal,0,     2, 8}, /* 1f: 0100 1101 0001 1111                      */
1775   {illegal,0     }, /* 10: 0100 1101 0001 0000                      */
1776   {illegal,0     }, /* 11: 0100 1101 0001 0001                      */
1777   {illegal,0     }, /* 12: 0100 1101 0001 0010                      */
1778   {illegal,0     }, /* 13: 0100 1101 0001 0011                      */
1779   {illegal,0     }, /* 14: 0100 1101 0001 0100                      */
1780   {illegal,0     }, /* 15: 0100 1101 0001 0101                      */
1781   {illegal,0     }, /* 16: 0100 1101 0001 0110                      */
1782   {illegal,0     }, /* 17: 0100 1101 0001 0111                      */
1783   {illegal,0     }, /* 18: 0100 1101 0001 1000                      */
1784   {illegal,0     }, /* 19: 0100 1101 0001 1001                      */
1785   {illegal,0     }, /* 1a: 0100 1101 0001 1010                      */
1786   {illegal,0     }, /* 1b: 0100 1101 0001 1011                      */
1787   {illegal,0     }, /* 1c: 0100 1101 0001 1100                      */
1788   {illegal,0     }, /* 1d: 0100 1101 0001 1101                      */
1789   {illegal,0     }, /* 1e: 0100 1101 0001 1110                      */
1790   {illegal,0     }, /* 1f: 0100 1101 0001 1111                      */
17791791
1780   {illegal,0,     2, 8}, /* 20: 0100 1101 0010 0000                      */
1781   {illegal,0,     2, 8}, /* 21: 0100 1101 0010 0001                      */
1782   {illegal,0,     2, 8}, /* 22: 0100 1101 0010 0010                      */
1783   {illegal,0,     2, 8}, /* 23: 0100 1101 0010 0011                      */
1784   {illegal,0,     2, 8}, /* 24: 0100 1101 0010 0100                      */
1785   {illegal,0,     2, 8}, /* 25: 0100 1101 0010 0101                      */
1786   {illegal,0,     2, 8}, /* 26: 0100 1101 0010 0110                      */
1787   {illegal,0,     2, 8}, /* 27: 0100 1101 0010 0111                      */
1788   {illegal,0,     2, 8}, /* 28: 0100 1101 0010 1000                      */
1789   {illegal,0,     2, 8}, /* 29: 0100 1101 0010 1001                      */
1790   {illegal,0,     2, 8}, /* 2a: 0100 1101 0010 1010                      */
1791   {illegal,0,     2, 8}, /* 2b: 0100 1101 0010 1011                      */
1792   {illegal,0,     2, 8}, /* 2c: 0100 1101 0010 1100                      */
1793   {illegal,0,     2, 8}, /* 2d: 0100 1101 0010 1101                      */
1794   {illegal,0,     2, 8}, /* 2e: 0100 1101 0010 1110                      */
1795   {illegal,0,     2, 8}, /* 2f: 0100 1101 0010 1111                      */
1792   {illegal,0     }, /* 20: 0100 1101 0010 0000                      */
1793   {illegal,0     }, /* 21: 0100 1101 0010 0001                      */
1794   {illegal,0     }, /* 22: 0100 1101 0010 0010                      */
1795   {illegal,0     }, /* 23: 0100 1101 0010 0011                      */
1796   {illegal,0     }, /* 24: 0100 1101 0010 0100                      */
1797   {illegal,0     }, /* 25: 0100 1101 0010 0101                      */
1798   {illegal,0     }, /* 26: 0100 1101 0010 0110                      */
1799   {illegal,0     }, /* 27: 0100 1101 0010 0111                      */
1800   {illegal,0     }, /* 28: 0100 1101 0010 1000                      */
1801   {illegal,0     }, /* 29: 0100 1101 0010 1001                      */
1802   {illegal,0     }, /* 2a: 0100 1101 0010 1010                      */
1803   {illegal,0     }, /* 2b: 0100 1101 0010 1011                      */
1804   {illegal,0     }, /* 2c: 0100 1101 0010 1100                      */
1805   {illegal,0     }, /* 2d: 0100 1101 0010 1101                      */
1806   {illegal,0     }, /* 2e: 0100 1101 0010 1110                      */
1807   {illegal,0     }, /* 2f: 0100 1101 0010 1111                      */
17961808
1797   {illegal,0,     2, 8}, /* 30: 0100 1101 0011 0000                      */
1798   {illegal,0,     2, 8}, /* 31: 0100 1101 0011 0001                      */
1799   {illegal,0,     2, 8}, /* 32: 0100 1101 0011 0010                      */
1800   {illegal,0,     2, 8}, /* 33: 0100 1101 0011 0011                      */
1801   {illegal,0,     2, 8}, /* 34: 0100 1101 0011 0100                      */
1802   {illegal,0,     2, 8}, /* 35: 0100 1101 0011 0101                      */
1803   {illegal,0,     2, 8}, /* 36: 0100 1101 0011 0110                      */
1804   {illegal,0,     2, 8}, /* 37: 0100 1101 0011 0111                      */
1805   {illegal,0,     2, 8}, /* 38: 0100 1101 0011 1000                      */
1806   {illegal,0,     2, 8}, /* 39: 0100 1101 0011 1001                      */
1807   {illegal,0,     2, 8}, /* 3a: 0100 1101 0011 1010                      */
1808   {illegal,0,     2, 8}, /* 3b: 0100 1101 0011 1011                      */
1809   {illegal,0,     2, 8}, /* 3c: 0100 1101 0011 1100                      */
1810   {illegal,0,     2, 8}, /* 3d: 0100 1101 0011 1101                      */
1811   {illegal,0,     2, 8}, /* 3e: 0100 1101 0011 1110                      */
1812   {illegal,0,     2, 8}, /* 3f: 0100 1101 0011 1111                      */
1809   {illegal,0     }, /* 30: 0100 1101 0011 0000                      */
1810   {illegal,0     }, /* 31: 0100 1101 0011 0001                      */
1811   {illegal,0     }, /* 32: 0100 1101 0011 0010                      */
1812   {illegal,0     }, /* 33: 0100 1101 0011 0011                      */
1813   {illegal,0     }, /* 34: 0100 1101 0011 0100                      */
1814   {illegal,0     }, /* 35: 0100 1101 0011 0101                      */
1815   {illegal,0     }, /* 36: 0100 1101 0011 0110                      */
1816   {illegal,0     }, /* 37: 0100 1101 0011 0111                      */
1817   {illegal,0     }, /* 38: 0100 1101 0011 1000                      */
1818   {illegal,0     }, /* 39: 0100 1101 0011 1001                      */
1819   {illegal,0     }, /* 3a: 0100 1101 0011 1010                      */
1820   {illegal,0     }, /* 3b: 0100 1101 0011 1011                      */
1821   {illegal,0     }, /* 3c: 0100 1101 0011 1100                      */
1822   {illegal,0     }, /* 3d: 0100 1101 0011 1101                      */
1823   {illegal,0     }, /* 3e: 0100 1101 0011 1110                      */
1824   {illegal,0     }, /* 3f: 0100 1101 0011 1111                      */
18131825
1814   {illegal,0,     2, 8}, /* 40: 0100 1101 0100 0000                      */
1815   {illegal,0,     2, 8}, /* 41: 0100 1101 0100 0001                      */
1816   {illegal,0,     2, 8}, /* 42: 0100 1101 0100 0010                      */
1817   {illegal,0,     2, 8}, /* 43: 0100 1101 0100 0011                      */
1818   {illegal,0,     2, 8}, /* 44: 0100 1101 0100 0100                      */
1819   {illegal,0,     2, 8}, /* 45: 0100 1101 0100 0101                      */
1820   {illegal,0,     2, 8}, /* 46: 0100 1101 0100 0110                      */
1821   {illegal,0,     2, 8}, /* 47: 0100 1101 0100 0111                      */
1822   {illegal,0,     2, 8}, /* 48: 0100 1101 0100 1000                      */
1823   {illegal,0,     2, 8}, /* 49: 0100 1101 0100 1001                      */
1824   {illegal,0,     2, 8}, /* 4a: 0100 1101 0100 1010                      */
1825   {illegal,0,     2, 8}, /* 4b: 0100 1101 0100 1011                      */
1826   {illegal,0,     2, 8}, /* 4c: 0100 1101 0100 1100                      */
1827   {illegal,0,     2, 8}, /* 4d: 0100 1101 0100 1101                      */
1828   {illegal,0,     2, 8}, /* 4e: 0100 1101 0100 1110                      */
1829   {illegal,0,     2, 8}, /* 4f: 0100 1101 0100 1111                      */
1826   {illegal,0     }, /* 40: 0100 1101 0100 0000                      */
1827   {illegal,0     }, /* 41: 0100 1101 0100 0001                      */
1828   {illegal,0     }, /* 42: 0100 1101 0100 0010                      */
1829   {illegal,0     }, /* 43: 0100 1101 0100 0011                      */
1830   {illegal,0     }, /* 44: 0100 1101 0100 0100                      */
1831   {illegal,0     }, /* 45: 0100 1101 0100 0101                      */
1832   {illegal,0     }, /* 46: 0100 1101 0100 0110                      */
1833   {illegal,0     }, /* 47: 0100 1101 0100 0111                      */
1834   {illegal,0     }, /* 48: 0100 1101 0100 1000                      */
1835   {illegal,0     }, /* 49: 0100 1101 0100 1001                      */
1836   {illegal,0     }, /* 4a: 0100 1101 0100 1010                      */
1837   {illegal,0     }, /* 4b: 0100 1101 0100 1011                      */
1838   {illegal,0     }, /* 4c: 0100 1101 0100 1100                      */
1839   {illegal,0     }, /* 4d: 0100 1101 0100 1101                      */
1840   {illegal,0     }, /* 4e: 0100 1101 0100 1110                      */
1841   {illegal,0     }, /* 4f: 0100 1101 0100 1111                      */
18301842
1831   {illegal,0,     2, 8}, /* 50: 0100 1101 0101 0000                      */
1832   {illegal,0,     2, 8}, /* 51: 0100 1101 0101 0001                      */
1833   {illegal,0,     2, 8}, /* 52: 0100 1101 0101 0010                      */
1834   {illegal,0,     2, 8}, /* 53: 0100 1101 0101 0011                      */
1835   {illegal,0,     2, 8}, /* 54: 0100 1101 0101 0100                      */
1836   {illegal,0,     2, 8}, /* 55: 0100 1101 0101 0101                      */
1837   {illegal,0,     2, 8}, /* 56: 0100 1101 0101 0110                      */
1838   {illegal,0,     2, 8}, /* 57: 0100 1101 0101 0111                      */
1839   {illegal,0,     2, 8}, /* 58: 0100 1101 0101 1000                      */
1840   {illegal,0,     2, 8}, /* 59: 0100 1101 0101 1001                      */
1841   {illegal,0,     2, 8}, /* 5a: 0100 1101 0101 1010                      */
1842   {illegal,0,     2, 8}, /* 5b: 0100 1101 0101 1011                      */
1843   {illegal,0,     2, 8}, /* 5c: 0100 1101 0101 1100                      */
1844   {illegal,0,     2, 8}, /* 5d: 0100 1101 0101 1101                      */
1845   {illegal,0,     2, 8}, /* 5e: 0100 1101 0101 1110                      */
1846   {illegal,0,     2, 8}, /* 5f: 0100 1101 0101 1111                      */
1843   {illegal,0     }, /* 50: 0100 1101 0101 0000                      */
1844   {illegal,0     }, /* 51: 0100 1101 0101 0001                      */
1845   {illegal,0     }, /* 52: 0100 1101 0101 0010                      */
1846   {illegal,0     }, /* 53: 0100 1101 0101 0011                      */
1847   {illegal,0     }, /* 54: 0100 1101 0101 0100                      */
1848   {illegal,0     }, /* 55: 0100 1101 0101 0101                      */
1849   {illegal,0     }, /* 56: 0100 1101 0101 0110                      */
1850   {illegal,0     }, /* 57: 0100 1101 0101 0111                      */
1851   {illegal,0     }, /* 58: 0100 1101 0101 1000                      */
1852   {illegal,0     }, /* 59: 0100 1101 0101 1001                      */
1853   {illegal,0     }, /* 5a: 0100 1101 0101 1010                      */
1854   {illegal,0     }, /* 5b: 0100 1101 0101 1011                      */
1855   {illegal,0     }, /* 5c: 0100 1101 0101 1100                      */
1856   {illegal,0     }, /* 5d: 0100 1101 0101 1101                      */
1857   {illegal,0     }, /* 5e: 0100 1101 0101 1110                      */
1858   {illegal,0     }, /* 5f: 0100 1101 0101 1111                      */
18471859
1848   {illegal,0,     2, 8}, /* 60: 0100 1101 0110 0000                      */
1849   {illegal,0,     2, 8}, /* 61: 0100 1101 0110 0001                      */
1850   {illegal,0,     2, 8}, /* 62: 0100 1101 0110 0010                      */
1851   {illegal,0,     2, 8}, /* 63: 0100 1101 0110 0011                      */
1852   {illegal,0,     2, 8}, /* 64: 0100 1101 0110 0100                      */
1853   {illegal,0,     2, 8}, /* 65: 0100 1101 0110 0101                      */
1854   {illegal,0,     2, 8}, /* 66: 0100 1101 0110 0110                      */
1855   {illegal,0,     2, 8}, /* 67: 0100 1101 0110 0111                      */
1856   {illegal,0,     2, 8}, /* 68: 0100 1101 0110 1000                      */
1857   {illegal,0,     2, 8}, /* 69: 0100 1101 0110 1001                      */
1858   {illegal,0,     2, 8}, /* 6a: 0100 1101 0110 1010                      */
1859   {illegal,0,     2, 8}, /* 6b: 0100 1101 0110 1011                      */
1860   {illegal,0,     2, 8}, /* 6c: 0100 1101 0110 1100                      */
1861   {illegal,0,     2, 8}, /* 6d: 0100 1101 0110 1101                      */
1862   {illegal,0,     2, 8}, /* 6e: 0100 1101 0110 1110                      */
1863   {illegal,0,     2, 8}, /* 6f: 0100 1101 0110 1111                      */
1860   {illegal,0     }, /* 60: 0100 1101 0110 0000                      */
1861   {illegal,0     }, /* 61: 0100 1101 0110 0001                      */
1862   {illegal,0     }, /* 62: 0100 1101 0110 0010                      */
1863   {illegal,0     }, /* 63: 0100 1101 0110 0011                      */
1864   {illegal,0     }, /* 64: 0100 1101 0110 0100                      */
1865   {illegal,0     }, /* 65: 0100 1101 0110 0101                      */
1866   {illegal,0     }, /* 66: 0100 1101 0110 0110                      */
1867   {illegal,0     }, /* 67: 0100 1101 0110 0111                      */
1868   {illegal,0     }, /* 68: 0100 1101 0110 1000                      */
1869   {illegal,0     }, /* 69: 0100 1101 0110 1001                      */
1870   {illegal,0     }, /* 6a: 0100 1101 0110 1010                      */
1871   {illegal,0     }, /* 6b: 0100 1101 0110 1011                      */
1872   {illegal,0     }, /* 6c: 0100 1101 0110 1100                      */
1873   {illegal,0     }, /* 6d: 0100 1101 0110 1101                      */
1874   {illegal,0     }, /* 6e: 0100 1101 0110 1110                      */
1875   {illegal,0     }, /* 6f: 0100 1101 0110 1111                      */
18641876
1865   {illegal,0,     2, 8}, /* 70: 0100 1101 0111 0000                      */
1866   {illegal,0,     2, 8}, /* 71: 0100 1101 0111 0001                      */
1867   {illegal,0,     2, 8}, /* 72: 0100 1101 0111 0010                      */
1868   {illegal,0,     2, 8}, /* 73: 0100 1101 0111 0011                      */
1869   {illegal,0,     2, 8}, /* 74: 0100 1101 0111 0100                      */
1870   {illegal,0,     2, 8}, /* 75: 0100 1101 0111 0101                      */
1871   {illegal,0,     2, 8}, /* 76: 0100 1101 0111 0110                      */
1872   {illegal,0,     2, 8}, /* 77: 0100 1101 0111 0111                      */
1873   {illegal,0,     2, 8}, /* 78: 0100 1101 0111 1000                      */
1874   {illegal,0,     2, 8}, /* 79: 0100 1101 0111 1001                      */
1875   {illegal,0,     2, 8}, /* 7a: 0100 1101 0111 1010                      */
1876   {illegal,0,     2, 8}, /* 7b: 0100 1101 0111 1011                      */
1877   {illegal,0,     2, 8}, /* 7c: 0100 1101 0111 1100                      */
1878   {illegal,0,     2, 8}, /* 7d: 0100 1101 0111 1101                      */
1879   {illegal,0,     2, 8}, /* 7e: 0100 1101 0111 1110                      */
1880   {illegal,0,     2, 8}, /* 7f: 0100 1101 0111 1111                      */
1877   {illegal,0     }, /* 70: 0100 1101 0111 0000                      */
1878   {illegal,0     }, /* 71: 0100 1101 0111 0001                      */
1879   {illegal,0     }, /* 72: 0100 1101 0111 0010                      */
1880   {illegal,0     }, /* 73: 0100 1101 0111 0011                      */
1881   {illegal,0     }, /* 74: 0100 1101 0111 0100                      */
1882   {illegal,0     }, /* 75: 0100 1101 0111 0101                      */
1883   {illegal,0     }, /* 76: 0100 1101 0111 0110                      */
1884   {illegal,0     }, /* 77: 0100 1101 0111 0111                      */
1885   {illegal,0     }, /* 78: 0100 1101 0111 1000                      */
1886   {illegal,0     }, /* 79: 0100 1101 0111 1001                      */
1887   {illegal,0     }, /* 7a: 0100 1101 0111 1010                      */
1888   {illegal,0     }, /* 7b: 0100 1101 0111 1011                      */
1889   {illegal,0     }, /* 7c: 0100 1101 0111 1100                      */
1890   {illegal,0     }, /* 7d: 0100 1101 0111 1101                      */
1891   {illegal,0     }, /* 7e: 0100 1101 0111 1110                      */
1892   {illegal,0     }, /* 7f: 0100 1101 0111 1111                      */
18811893
1882   {illegal,0,     2, 8}, /* 80: 0100 1101 1000 0000                      */
1883   {illegal,0,     2, 8}, /* 81: 0100 1101 1000 0001                      */
1884   {illegal,0,     2, 8}, /* 82: 0100 1101 1000 0010                      */
1885   {illegal,0,     2, 8}, /* 83: 0100 1101 1000 0011                      */
1886   {illegal,0,     2, 8}, /* 84: 0100 1101 1000 0100                      */
1887   {illegal,0,     2, 8}, /* 85: 0100 1101 1000 0101                      */
1888   {illegal,0,     2, 8}, /* 86: 0100 1101 1000 0110                      */
1889   {illegal,0,     2, 8}, /* 87: 0100 1101 1000 0111                      */
1890   {illegal,0,     2, 8}, /* 88: 0100 1101 1000 1000                      */
1891   {illegal,0,     2, 8}, /* 89: 0100 1101 1000 1001                      */
1892   {illegal,0,     2, 8}, /* 8a: 0100 1101 1000 1010                      */
1893   {illegal,0,     2, 8}, /* 8b: 0100 1101 1000 1011                      */
1894   {illegal,0,     2, 8}, /* 8c: 0100 1101 1000 1100                      */
1895   {illegal,0,     2, 8}, /* 8d: 0100 1101 1000 1101                      */
1896   {illegal,0,     2, 8}, /* 8e: 0100 1101 1000 1110                      */
1897   {illegal,0,     2, 8}, /* 8f: 0100 1101 1000 1111                      */
1894   {illegal,0     }, /* 80: 0100 1101 1000 0000                      */
1895   {illegal,0     }, /* 81: 0100 1101 1000 0001                      */
1896   {illegal,0     }, /* 82: 0100 1101 1000 0010                      */
1897   {illegal,0     }, /* 83: 0100 1101 1000 0011                      */
1898   {illegal,0     }, /* 84: 0100 1101 1000 0100                      */
1899   {illegal,0     }, /* 85: 0100 1101 1000 0101                      */
1900   {illegal,0     }, /* 86: 0100 1101 1000 0110                      */
1901   {illegal,0     }, /* 87: 0100 1101 1000 0111                      */
1902   {illegal,0     }, /* 88: 0100 1101 1000 1000                      */
1903   {illegal,0     }, /* 89: 0100 1101 1000 1001                      */
1904   {illegal,0     }, /* 8a: 0100 1101 1000 1010                      */
1905   {illegal,0     }, /* 8b: 0100 1101 1000 1011                      */
1906   {illegal,0     }, /* 8c: 0100 1101 1000 1100                      */
1907   {illegal,0     }, /* 8d: 0100 1101 1000 1101                      */
1908   {illegal,0     }, /* 8e: 0100 1101 1000 1110                      */
1909   {illegal,0     }, /* 8f: 0100 1101 1000 1111                      */
18981910
1899   {illegal,0,     2, 8}, /* 90: 0100 1101 1001 0000                      */
1900   {illegal,0,     2, 8}, /* 91: 0100 1101 1001 0001                      */
1901   {illegal,0,     2, 8}, /* 92: 0100 1101 1001 0010                      */
1902   {illegal,0,     2, 8}, /* 93: 0100 1101 1001 0011                      */
1903   {illegal,0,     2, 8}, /* 94: 0100 1101 1001 0100                      */
1904   {illegal,0,     2, 8}, /* 95: 0100 1101 1001 0101                      */
1905   {illegal,0,     2, 8}, /* 96: 0100 1101 1001 0110                      */
1906   {illegal,0,     2, 8}, /* 97: 0100 1101 1001 0111                      */
1907   {illegal,0,     2, 8}, /* 98: 0100 1101 1001 1000                      */
1908   {illegal,0,     2, 8}, /* 99: 0100 1101 1001 1001                      */
1909   {illegal,0,     2, 8}, /* 9a: 0100 1101 1001 1010                      */
1910   {illegal,0,     2, 8}, /* 9b: 0100 1101 1001 1011                      */
1911   {illegal,0,     2, 8}, /* 9c: 0100 1101 1001 1100                      */
1912   {illegal,0,     2, 8}, /* 9d: 0100 1101 1001 1101                      */
1913   {illegal,0,     2, 8}, /* 9e: 0100 1101 1001 1110                      */
1914   {illegal,0,     2, 8}, /* 9f: 0100 1101 1001 1111                      */
1911   {illegal,0     }, /* 90: 0100 1101 1001 0000                      */
1912   {illegal,0     }, /* 91: 0100 1101 1001 0001                      */
1913   {illegal,0     }, /* 92: 0100 1101 1001 0010                      */
1914   {illegal,0     }, /* 93: 0100 1101 1001 0011                      */
1915   {illegal,0     }, /* 94: 0100 1101 1001 0100                      */
1916   {illegal,0     }, /* 95: 0100 1101 1001 0101                      */
1917   {illegal,0     }, /* 96: 0100 1101 1001 0110                      */
1918   {illegal,0     }, /* 97: 0100 1101 1001 0111                      */
1919   {illegal,0     }, /* 98: 0100 1101 1001 1000                      */
1920   {illegal,0     }, /* 99: 0100 1101 1001 1001                      */
1921   {illegal,0     }, /* 9a: 0100 1101 1001 1010                      */
1922   {illegal,0     }, /* 9b: 0100 1101 1001 1011                      */
1923   {illegal,0     }, /* 9c: 0100 1101 1001 1100                      */
1924   {illegal,0     }, /* 9d: 0100 1101 1001 1101                      */
1925   {illegal,0     }, /* 9e: 0100 1101 1001 1110                      */
1926   {illegal,0     }, /* 9f: 0100 1101 1001 1111                      */
19151927
1916   {illegal,0,     2, 8}, /* a0: 0100 1101 1010 0000                      */
1917   {illegal,0,     2, 8}, /* a1: 0100 1101 1010 0001                      */
1918   {illegal,0,     2, 8}, /* a2: 0100 1101 1010 0010                      */
1919   {illegal,0,     2, 8}, /* a3: 0100 1101 1010 0011                      */
1920   {illegal,0,     2, 8}, /* a4: 0100 1101 1010 0100                      */
1921   {illegal,0,     2, 8}, /* a5: 0100 1101 1010 0101                      */
1922   {illegal,0,     2, 8}, /* a6: 0100 1101 1010 0110                      */
1923   {illegal,0,     2, 8}, /* a7: 0100 1101 1010 0111                      */
1924   {illegal,0,     2, 8}, /* a8: 0100 1101 1010 1000                      */
1925   {illegal,0,     2, 8}, /* a9: 0100 1101 1010 1001                      */
1926   {illegal,0,     2, 8}, /* aa: 0100 1101 1010 1010                      */
1927   {illegal,0,     2, 8}, /* ab: 0100 1101 1010 1011                      */
1928   {illegal,0,     2, 8}, /* ac: 0100 1101 1010 1100                      */
1929   {illegal,0,     2, 8}, /* ad: 0100 1101 1010 1101                      */
1930   {illegal,0,     2, 8}, /* ae: 0100 1101 1010 1110                      */
1931   {illegal,0,     2, 8}, /* af: 0100 1101 1010 1111                      */
1928   {illegal,0     }, /* a0: 0100 1101 1010 0000                      */
1929   {illegal,0     }, /* a1: 0100 1101 1010 0001                      */
1930   {illegal,0     }, /* a2: 0100 1101 1010 0010                      */
1931   {illegal,0     }, /* a3: 0100 1101 1010 0011                      */
1932   {illegal,0     }, /* a4: 0100 1101 1010 0100                      */
1933   {illegal,0     }, /* a5: 0100 1101 1010 0101                      */
1934   {illegal,0     }, /* a6: 0100 1101 1010 0110                      */
1935   {illegal,0     }, /* a7: 0100 1101 1010 0111                      */
1936   {illegal,0     }, /* a8: 0100 1101 1010 1000                      */
1937   {illegal,0     }, /* a9: 0100 1101 1010 1001                      */
1938   {illegal,0     }, /* aa: 0100 1101 1010 1010                      */
1939   {illegal,0     }, /* ab: 0100 1101 1010 1011                      */
1940   {illegal,0     }, /* ac: 0100 1101 1010 1100                      */
1941   {illegal,0     }, /* ad: 0100 1101 1010 1101                      */
1942   {illegal,0     }, /* ae: 0100 1101 1010 1110                      */
1943   {illegal,0     }, /* af: 0100 1101 1010 1111                      */
19321944
1933   {illegal,0,     2, 8}, /* b0: 0100 1101 1011 0000                      */
1934   {illegal,0,     2, 8}, /* b1: 0100 1101 1011 0001                      */
1935   {illegal,0,     2, 8}, /* b2: 0100 1101 1011 0010                      */
1936   {illegal,0,     2, 8}, /* b3: 0100 1101 1011 0011                      */
1937   {illegal,0,     2, 8}, /* b4: 0100 1101 1011 0100                      */
1938   {illegal,0,     2, 8}, /* b5: 0100 1101 1011 0101                      */
1939   {illegal,0,     2, 8}, /* b6: 0100 1101 1011 0110                      */
1940   {illegal,0,     2, 8}, /* b7: 0100 1101 1011 0111                      */
1941   {illegal,0,     2, 8}, /* b8: 0100 1101 1011 1000                      */
1942   {illegal,0,     2, 8}, /* b9: 0100 1101 1011 1001                      */
1943   {illegal,0,     2, 8}, /* ba: 0100 1101 1011 1010                      */
1944   {illegal,0,     2, 8}, /* bb: 0100 1101 1011 1011                      */
1945   {illegal,0,     2, 8}, /* bc: 0100 1101 1011 1100                      */
1946   {illegal,0,     2, 8}, /* bd: 0100 1101 1011 1101                      */
1947   {illegal,0,     2, 8}, /* be: 0100 1101 1011 1110                      */
1948   {illegal,0,     2, 8}, /* bf: 0100 1101 1011 1111                      */
1945   {illegal,0     }, /* b0: 0100 1101 1011 0000                      */
1946   {illegal,0     }, /* b1: 0100 1101 1011 0001                      */
1947   {illegal,0     }, /* b2: 0100 1101 1011 0010                      */
1948   {illegal,0     }, /* b3: 0100 1101 1011 0011                      */
1949   {illegal,0     }, /* b4: 0100 1101 1011 0100                      */
1950   {illegal,0     }, /* b5: 0100 1101 1011 0101                      */
1951   {illegal,0     }, /* b6: 0100 1101 1011 0110                      */
1952   {illegal,0     }, /* b7: 0100 1101 1011 0111                      */
1953   {illegal,0     }, /* b8: 0100 1101 1011 1000                      */
1954   {illegal,0     }, /* b9: 0100 1101 1011 1001                      */
1955   {illegal,0     }, /* ba: 0100 1101 1011 1010                      */
1956   {illegal,0     }, /* bb: 0100 1101 1011 1011                      */
1957   {illegal,0     }, /* bc: 0100 1101 1011 1100                      */
1958   {illegal,0     }, /* bd: 0100 1101 1011 1101                      */
1959   {illegal,0     }, /* be: 0100 1101 1011 1110                      */
1960   {illegal,0     }, /* bf: 0100 1101 1011 1111                      */
19491961
1950   {MOV,"PA,A",     2,10}, /* c0: 0100 1101 1100 0000                      */
1951   {MOV,"PB,A",     2,10}, /* c1: 0100 1101 1100 0001                      */
1952   {MOV,"PC,A",     2,10}, /* c2: 0100 1101 1100 0010                      */
1953   {MOV,"PD,A",     2,10}, /* c3: 0100 1101 1100 0011                      */
1954   {illegal,0,     2,10}, /* c4: 0100 1101 1100 0100                      */
1955   {MOV,"PF,A",     2,10}, /* c5: 0100 1101 1100 0101                      */
1956   {MOV,"MKH,A",    2,10}, /* c6: 0100 1101 1100 0110                      */
1957   {MOV,"MKL,A",    2,10}, /* c7: 0100 1101 1100 0111                      */
1958   {illegal,0,      2,10}, /* c8: 0100 1101 1100 1000                      */
1959   {MOV,"SMH,A",    2,10}, /* c9: 0100 1101 1100 1001                      */
1960   {MOV,"SML,A",    2,10}, /* ca: 0100 1101 1100 1010                      */
1961   {MOV,"EOM,A",    2,10}, /* cb: 0100 1101 1100 1011                      */
1962   {MOV,"ETMM,A",   2,10}, /* cc: 0100 1101 1100 1100                      */
1963   {MOV,"TMM,A",    2,10}, /* cd: 0100 1101 1100 1101                      */
1964   {illegal,0,     2,10}, /* ce: 0100 1101 1100 1110                      */
1965   {illegal,0,     2,10}, /* cf: 0100 1101 1100 1111                      */
1962   {MOV,"PA,A"     }, /* c0: 0100 1101 1100 0000                      */
1963   {MOV,"PB,A"     }, /* c1: 0100 1101 1100 0001                      */
1964   {MOV,"PC,A"     }, /* c2: 0100 1101 1100 0010                      */
1965   {MOV,"PD,A"     }, /* c3: 0100 1101 1100 0011                      */
1966   {illegal,0     }, /* c4: 0100 1101 1100 0100                      */
1967   {MOV,"PF,A"     }, /* c5: 0100 1101 1100 0101                      */
1968   {MOV,"MKH,A"    }, /* c6: 0100 1101 1100 0110                      */
1969   {MOV,"MKL,A"    }, /* c7: 0100 1101 1100 0111                      */
1970   {illegal,0      }, /* c8: 0100 1101 1100 1000                      */
1971   {MOV,"SMH,A"    }, /* c9: 0100 1101 1100 1001                      */
1972   {MOV,"SML,A"    }, /* ca: 0100 1101 1100 1010                      */
1973   {MOV,"EOM,A"    }, /* cb: 0100 1101 1100 1011                      */
1974   {MOV,"ETMM,A"   }, /* cc: 0100 1101 1100 1100                      */
1975   {MOV,"TMM,A"    }, /* cd: 0100 1101 1100 1101                      */
1976   {illegal,0     }, /* ce: 0100 1101 1100 1110                      */
1977   {illegal,0     }, /* cf: 0100 1101 1100 1111                      */
19661978
1967   {MOV,"MM,A",     2,10}, /* d0: 0100 1101 1101 0000                      */
1968   {MOV,"MCC,A",    2,10}, /* d1: 0100 1101 1101 0001                      */
1969   {MOV,"MA,A",     2,10}, /* d2: 0100 1101 1101 0010                      */
1970   {MOV,"MB,A",     2,10}, /* d3: 0100 1101 1101 0011                      */
1971   {MOV,"MC,A",     2,10}, /* d4: 0100 1101 1101 0100                      */
1972   {illegal,0,     2,10}, /* d5: 0100 1101 1101 0101                      */
1973   {illegal,0,     2,10}, /* d6: 0100 1101 1101 0110                      */
1974   {MOV,"MF,A",     2,10}, /* d7: 0100 1101 1101 0111                      */
1975   {MOV,"TXB,A",    2,10}, /* d8: 0100 1101 1101 1000                      */
1976   {illegal,0,     2,10}, /* d9: 0100 1101 1101 1001                      */
1977   {MOV,"TM0,A",    2,10}, /* da: 0100 1101 1101 1010                      */
1978   {MOV,"TM1,A",    2,10}, /* db: 0100 1101 1101 1011                      */
1979   {illegal,0,     2,10}, /* dc: 0100 1101 1101 1100                      */
1980   {illegal,0,     2,10}, /* dd: 0100 1101 1101 1101                      */
1981   {illegal,0,     2,10}, /* de: 0100 1101 1101 1110                      */
1982   {illegal,0,     2,10}, /* df: 0100 1101 1101 1111                      */
1979   {MOV,"MM,A"     }, /* d0: 0100 1101 1101 0000                      */
1980   {MOV,"MCC,A"    }, /* d1: 0100 1101 1101 0001                      */
1981   {MOV,"MA,A"     }, /* d2: 0100 1101 1101 0010                      */
1982   {MOV,"MB,A"     }, /* d3: 0100 1101 1101 0011                      */
1983   {MOV,"MC,A"     }, /* d4: 0100 1101 1101 0100                      */
1984   {illegal,0     }, /* d5: 0100 1101 1101 0101                      */
1985   {illegal,0     }, /* d6: 0100 1101 1101 0110                      */
1986   {MOV,"MF,A"     }, /* d7: 0100 1101 1101 0111                      */
1987   {MOV,"TXB,A"    }, /* d8: 0100 1101 1101 1000                      */
1988   {illegal,0     }, /* d9: 0100 1101 1101 1001                      */
1989   {MOV,"TM0,A"    }, /* da: 0100 1101 1101 1010                      */
1990   {MOV,"TM1,A"    }, /* db: 0100 1101 1101 1011                      */
1991   {illegal,0     }, /* dc: 0100 1101 1101 1100                      */
1992   {illegal,0     }, /* dd: 0100 1101 1101 1101                      */
1993   {illegal,0     }, /* de: 0100 1101 1101 1110                      */
1994   {illegal,0     }, /* df: 0100 1101 1101 1111                      */
19831995
1984   {illegal,0,     2,10}, /* e0: 0100 1101 1110 0000                      */
1985   {illegal,0,     2,10}, /* e1: 0100 1101 1110 0001                      */
1986   {illegal,0,     2,10}, /* e2: 0100 1101 1110 0010                      */
1987   {illegal,0,     2,10}, /* e3: 0100 1101 1110 0011                      */
1988   {illegal,0,     2,10}, /* e4: 0100 1101 1110 0100                      */
1989   {MOV,"MT,A",     2,10}, /* e5: 0100 1101 1110 0101                      */   /* 7807 */
1990   {illegal,0,     2,10}, /* e6: 0100 1101 1110 0110                      */
1991   {illegal,0,     2,10}, /* e7: 0100 1101 1110 0111                      */
1992   {illegal,0,     2,10}, /* e8: 0100 1101 1110 1000                      */
1993   {illegal,0,     2,10}, /* e9: 0100 1101 1110 1001                      */
1994   {illegal,0,     2,10}, /* ea: 0100 1101 1110 1010                      */
1995   {illegal,0,     2,10}, /* eb: 0100 1101 1110 1011                      */
1996   {illegal,0,     2,10}, /* ec: 0100 1101 1110 1100                      */
1997   {illegal,0,     2,10}, /* ed: 0100 1101 1110 1101                      */
1998   {illegal,0,     2,10}, /* ee: 0100 1101 1110 1110                      */
1999   {illegal,0,     2,10}, /* ef: 0100 1101 1110 1111                      */
1996   {illegal,0     }, /* e0: 0100 1101 1110 0000                      */
1997   {illegal,0     }, /* e1: 0100 1101 1110 0001                      */
1998   {illegal,0     }, /* e2: 0100 1101 1110 0010                      */
1999   {illegal,0     }, /* e3: 0100 1101 1110 0011                      */
2000   {illegal,0     }, /* e4: 0100 1101 1110 0100                      */
2001   {MOV,"MT,A"     }, /* e5: 0100 1101 1110 0101                      */   /* 7807 */
2002   {illegal,0     }, /* e6: 0100 1101 1110 0110                      */
2003   {illegal,0     }, /* e7: 0100 1101 1110 0111                      */
2004   {illegal,0     }, /* e8: 0100 1101 1110 1000                      */
2005   {illegal,0     }, /* e9: 0100 1101 1110 1001                      */
2006   {illegal,0     }, /* ea: 0100 1101 1110 1010                      */
2007   {illegal,0     }, /* eb: 0100 1101 1110 1011                      */
2008   {illegal,0     }, /* ec: 0100 1101 1110 1100                      */
2009   {illegal,0     }, /* ed: 0100 1101 1110 1101                      */
2010   {illegal,0     }, /* ee: 0100 1101 1110 1110                      */
2011   {illegal,0     }, /* ef: 0100 1101 1110 1111                      */
20002012
2001   {illegal,0,     2,10}, /* f0: 0100 1101 1111 0000                      */
2002   {illegal,0,     2,10}, /* f1: 0100 1101 1111 0001                      */
2003   {illegal,0,     2,10}, /* f2: 0100 1101 1111 0010                      */
2004   {illegal,0,     2,10}, /* f3: 0100 1101 1111 0011                      */
2005   {illegal,0,     2,10}, /* f4: 0100 1101 1111 0100                      */
2006   {illegal,0,     2,10}, /* f5: 0100 1101 1111 0101                      */
2007   {illegal,0,     2,10}, /* f6: 0100 1101 1111 0110                      */
2008   {illegal,0,     2,10}, /* f7: 0100 1101 1111 0111                      */
2009   {illegal,0,     2,10}, /* f8: 0100 1101 1111 1000                      */
2010   {illegal,0,     2,10}, /* f9: 0100 1101 1111 1001                      */
2011   {illegal,0,     2,10}, /* fa: 0100 1101 1111 1010                      */
2012   {illegal,0,     2,10}, /* fb: 0100 1101 1111 1011                      */
2013   {illegal,0,     2,10}, /* fc: 0100 1101 1111 1100                      */
2014   {illegal,0,     2,10}, /* fd: 0100 1101 1111 1101                      */
2015   {illegal,0,     2,10}, /* fe: 0100 1101 1111 1110                      */
2016   {illegal,0,     2,10}   /* ff: 0100 1101 1111 1111                      */
2013   {illegal,0     }, /* f0: 0100 1101 1111 0000                      */
2014   {illegal,0     }, /* f1: 0100 1101 1111 0001                      */
2015   {illegal,0     }, /* f2: 0100 1101 1111 0010                      */
2016   {illegal,0     }, /* f3: 0100 1101 1111 0011                      */
2017   {illegal,0     }, /* f4: 0100 1101 1111 0100                      */
2018   {illegal,0     }, /* f5: 0100 1101 1111 0101                      */
2019   {illegal,0     }, /* f6: 0100 1101 1111 0110                      */
2020   {illegal,0     }, /* f7: 0100 1101 1111 0111                      */
2021   {illegal,0     }, /* f8: 0100 1101 1111 1000                      */
2022   {illegal,0     }, /* f9: 0100 1101 1111 1001                      */
2023   {illegal,0     }, /* fa: 0100 1101 1111 1010                      */
2024   {illegal,0     }, /* fb: 0100 1101 1111 1011                      */
2025   {illegal,0     }, /* fc: 0100 1101 1111 1100                      */
2026   {illegal,0     }, /* fd: 0100 1101 1111 1101                      */
2027   {illegal,0     }, /* fe: 0100 1101 1111 1110                      */
2028   {illegal,0     }   /* ff: 0100 1101 1111 1111                      */
20172029};
20182030
20192031/* prefix 60 */
20202032static const struct dasm_s  dasm60[256] =
20212033{
2022   {illegal,0,     2, 8}, /* 00: 0110 0000 0000 0000                      */
2023   {illegal,0,     2, 8}, /* 01: 0110 0000 0000 0001                      */
2024   {illegal,0,     2, 8}, /* 02: 0110 0000 0000 0010                      */
2025   {illegal,0,     2, 8}, /* 03: 0110 0000 0000 0011                      */
2026   {illegal,0,     2, 8}, /* 04: 0110 0000 0000 0100                      */
2027   {illegal,0,     2, 8}, /* 05: 0110 0000 0000 0101                      */
2028   {illegal,0,     2, 8}, /* 06: 0110 0000 0000 0110                      */
2029   {illegal,0,     2, 8}, /* 07: 0110 0000 0000 0111                      */
2030   {ANA,"V,A",      2, 8}, /* 08: 0110 0000 0000 1000                      */
2031   {ANA,"A,A",      2, 8}, /* 09: 0110 0000 0000 1001                      */
2032   {ANA,"B,A",      2, 8}, /* 0a: 0110 0000 0000 1010                      */
2033   {ANA,"C,A",      2, 8}, /* 0b: 0110 0000 0000 1011                      */
2034   {ANA,"D,A",      2, 8}, /* 0c: 0110 0000 0000 1100                      */
2035   {ANA,"E,A",      2, 8}, /* 0d: 0110 0000 0000 1101                      */
2036   {ANA,"H,A",      2, 8}, /* 0e: 0110 0000 0000 1110                      */
2037   {ANA,"L,A",      2, 8}, /* 0f: 0110 0000 0000 1111                      */
2034   {illegal,0     }, /* 00: 0110 0000 0000 0000                      */
2035   {illegal,0     }, /* 01: 0110 0000 0000 0001                      */
2036   {illegal,0     }, /* 02: 0110 0000 0000 0010                      */
2037   {illegal,0     }, /* 03: 0110 0000 0000 0011                      */
2038   {illegal,0     }, /* 04: 0110 0000 0000 0100                      */
2039   {illegal,0     }, /* 05: 0110 0000 0000 0101                      */
2040   {illegal,0     }, /* 06: 0110 0000 0000 0110                      */
2041   {illegal,0     }, /* 07: 0110 0000 0000 0111                      */
2042   {ANA,"V,A"      }, /* 08: 0110 0000 0000 1000                      */
2043   {ANA,"A,A"      }, /* 09: 0110 0000 0000 1001                      */
2044   {ANA,"B,A"      }, /* 0a: 0110 0000 0000 1010                      */
2045   {ANA,"C,A"      }, /* 0b: 0110 0000 0000 1011                      */
2046   {ANA,"D,A"      }, /* 0c: 0110 0000 0000 1100                      */
2047   {ANA,"E,A"      }, /* 0d: 0110 0000 0000 1101                      */
2048   {ANA,"H,A"      }, /* 0e: 0110 0000 0000 1110                      */
2049   {ANA,"L,A"      }, /* 0f: 0110 0000 0000 1111                      */
20382050
2039   {XRA,"V,A",      2, 8}, /* 10: 0110 0000 0001 0000                      */
2040   {XRA,"A,A",      2, 8}, /* 11: 0110 0000 0001 0001                      */
2041   {XRA,"B,A",      2, 8}, /* 12: 0110 0000 0001 0010                      */
2042   {XRA,"C,A",      2, 8}, /* 13: 0110 0000 0001 0011                      */
2043   {XRA,"D,A",      2, 8}, /* 14: 0110 0000 0001 0100                      */
2044   {XRA,"E,A",      2, 8}, /* 15: 0110 0000 0001 0101                      */
2045   {XRA,"H,A",      2, 8}, /* 16: 0110 0000 0001 0110                      */
2046   {XRA,"L,A",      2, 8}, /* 17: 0110 0000 0001 0111                      */
2047   {ORA,"V,A",      2, 8}, /* 18: 0110 0000 0001 1000                      */
2048   {ORA,"A,A",      2, 8}, /* 19: 0110 0000 0001 1001                      */
2049   {ORA,"B,A",      2, 8}, /* 1a: 0110 0000 0001 1010                      */
2050   {ORA,"C,A",      2, 8}, /* 1b: 0110 0000 0001 1011                      */
2051   {ORA,"D,A",      2, 8}, /* 1c: 0110 0000 0001 1100                      */
2052   {ORA,"E,A",      2, 8}, /* 1d: 0110 0000 0001 1101                      */
2053   {ORA,"H,A",      2, 8}, /* 1e: 0110 0000 0001 1110                      */
2054   {ORA,"L,A",      2, 8}, /* 1f: 0110 0000 0001 1111                      */
2051   {XRA,"V,A"      }, /* 10: 0110 0000 0001 0000                      */
2052   {XRA,"A,A"      }, /* 11: 0110 0000 0001 0001                      */
2053   {XRA,"B,A"      }, /* 12: 0110 0000 0001 0010                      */
2054   {XRA,"C,A"      }, /* 13: 0110 0000 0001 0011                      */
2055   {XRA,"D,A"      }, /* 14: 0110 0000 0001 0100                      */
2056   {XRA,"E,A"      }, /* 15: 0110 0000 0001 0101                      */
2057   {XRA,"H,A"      }, /* 16: 0110 0000 0001 0110                      */
2058   {XRA,"L,A"      }, /* 17: 0110 0000 0001 0111                      */
2059   {ORA,"V,A"      }, /* 18: 0110 0000 0001 1000                      */
2060   {ORA,"A,A"      }, /* 19: 0110 0000 0001 1001                      */
2061   {ORA,"B,A"      }, /* 1a: 0110 0000 0001 1010                      */
2062   {ORA,"C,A"      }, /* 1b: 0110 0000 0001 1011                      */
2063   {ORA,"D,A"      }, /* 1c: 0110 0000 0001 1100                      */
2064   {ORA,"E,A"      }, /* 1d: 0110 0000 0001 1101                      */
2065   {ORA,"H,A"      }, /* 1e: 0110 0000 0001 1110                      */
2066   {ORA,"L,A"      }, /* 1f: 0110 0000 0001 1111                      */
20552067
2056   {ADDNC,"V,A",    2, 8}, /* 20: 0110 0000 0010 0000                      */
2057   {ADDNC,"A,A",    2, 8}, /* 21: 0110 0000 0010 0001                      */
2058   {ADDNC,"B,A",    2, 8}, /* 22: 0110 0000 0010 0010                      */
2059   {ADDNC,"C,A",    2, 8}, /* 23: 0110 0000 0010 0011                      */
2060   {ADDNC,"D,A",    2, 8}, /* 24: 0110 0000 0010 0100                      */
2061   {ADDNC,"E,A",    2, 8}, /* 25: 0110 0000 0010 0101                      */
2062   {ADDNC,"H,A",    2, 8}, /* 26: 0110 0000 0010 0110                      */
2063   {ADDNC,"L,A",    2, 8}, /* 27: 0110 0000 0010 0111                      */
2064   {GTA,"V,A",      2, 8}, /* 28: 0110 0000 0010 1000                      */
2065   {GTA,"A,A",      2, 8}, /* 29: 0110 0000 0010 1001                      */
2066   {GTA,"B,A",      2, 8}, /* 2a: 0110 0000 0010 1010                      */
2067   {GTA,"C,A",      2, 8}, /* 2b: 0110 0000 0010 1011                      */
2068   {GTA,"D,A",      2, 8}, /* 2c: 0110 0000 0010 1100                      */
2069   {GTA,"E,A",      2, 8}, /* 2d: 0110 0000 0010 1101                      */
2070   {GTA,"H,A",      2, 8}, /* 2e: 0110 0000 0010 1110                      */
2071   {GTA,"L,A",      2, 8}, /* 2f: 0110 0000 0010 1111                      */
2068   {ADDNC,"V,A"    }, /* 20: 0110 0000 0010 0000                      */
2069   {ADDNC,"A,A"    }, /* 21: 0110 0000 0010 0001                      */
2070   {ADDNC,"B,A"    }, /* 22: 0110 0000 0010 0010                      */
2071   {ADDNC,"C,A"    }, /* 23: 0110 0000 0010 0011                      */
2072   {ADDNC,"D,A"    }, /* 24: 0110 0000 0010 0100                      */
2073   {ADDNC,"E,A"    }, /* 25: 0110 0000 0010 0101                      */
2074   {ADDNC,"H,A"    }, /* 26: 0110 0000 0010 0110                      */
2075   {ADDNC,"L,A"    }, /* 27: 0110 0000 0010 0111                      */
2076   {GTA,"V,A"      }, /* 28: 0110 0000 0010 1000                      */
2077   {GTA,"A,A"      }, /* 29: 0110 0000 0010 1001                      */
2078   {GTA,"B,A"      }, /* 2a: 0110 0000 0010 1010                      */
2079   {GTA,"C,A"      }, /* 2b: 0110 0000 0010 1011                      */
2080   {GTA,"D,A"      }, /* 2c: 0110 0000 0010 1100                      */
2081   {GTA,"E,A"      }, /* 2d: 0110 0000 0010 1101                      */
2082   {GTA,"H,A"      }, /* 2e: 0110 0000 0010 1110                      */
2083   {GTA,"L,A"      }, /* 2f: 0110 0000 0010 1111                      */
20722084
2073   {SUBNB,"V,A",    2, 8}, /* 30: 0110 0000 0011 0000                      */
2074   {SUBNB,"A,A",    2, 8}, /* 31: 0110 0000 0011 0001                      */
2075   {SUBNB,"B,A",    2, 8}, /* 32: 0110 0000 0011 0010                      */
2076   {SUBNB,"C,A",    2, 8}, /* 33: 0110 0000 0011 0011                      */
2077   {SUBNB,"D,A",    2, 8}, /* 34: 0110 0000 0011 0100                      */
2078   {SUBNB,"E,A",    2, 8}, /* 35: 0110 0000 0011 0101                      */
2079   {SUBNB,"H,A",    2, 8}, /* 36: 0110 0000 0011 0110                      */
2080   {SUBNB,"L,A",    2, 8}, /* 37: 0110 0000 0011 0111                      */
2081   {LTA,"V,A",      2, 8}, /* 38: 0110 0000 0011 1000                      */
2082   {LTA,"A,A",      2, 8}, /* 39: 0110 0000 0011 1001                      */
2083   {LTA,"B,A",      2, 8}, /* 3a: 0110 0000 0011 1010                      */
2084   {LTA,"C,A",      2, 8}, /* 3b: 0110 0000 0011 1011                      */
2085   {LTA,"D,A",      2, 8}, /* 3c: 0110 0000 0011 1100                      */
2086   {LTA,"E,A",      2, 8}, /* 3d: 0110 0000 0011 1101                      */
2087   {LTA,"H,A",      2, 8}, /* 3e: 0110 0000 0011 1110                      */
2088   {LTA,"L,A",      2, 8}, /* 3f: 0110 0000 0011 1111                      */
2085   {SUBNB,"V,A"    }, /* 30: 0110 0000 0011 0000                      */
2086   {SUBNB,"A,A"    }, /* 31: 0110 0000 0011 0001                      */
2087   {SUBNB,"B,A"    }, /* 32: 0110 0000 0011 0010                      */
2088   {SUBNB,"C,A"    }, /* 33: 0110 0000 0011 0011                      */
2089   {SUBNB,"D,A"    }, /* 34: 0110 0000 0011 0100                      */
2090   {SUBNB,"E,A"    }, /* 35: 0110 0000 0011 0101                      */
2091   {SUBNB,"H,A"    }, /* 36: 0110 0000 0011 0110                      */
2092   {SUBNB,"L,A"    }, /* 37: 0110 0000 0011 0111                      */
2093   {LTA,"V,A"      }, /* 38: 0110 0000 0011 1000                      */
2094   {LTA,"A,A"      }, /* 39: 0110 0000 0011 1001                      */
2095   {LTA,"B,A"      }, /* 3a: 0110 0000 0011 1010                      */
2096   {LTA,"C,A"      }, /* 3b: 0110 0000 0011 1011                      */
2097   {LTA,"D,A"      }, /* 3c: 0110 0000 0011 1100                      */
2098   {LTA,"E,A"      }, /* 3d: 0110 0000 0011 1101                      */
2099   {LTA,"H,A"      }, /* 3e: 0110 0000 0011 1110                      */
2100   {LTA,"L,A"      }, /* 3f: 0110 0000 0011 1111                      */
20892101
2090   {ADD,"V,A",      2, 8}, /* 40: 0110 0000 0100 0000                      */
2091   {ADD,"A,A",      2, 8}, /* 41: 0110 0000 0100 0001                      */
2092   {ADD,"B,A",      2, 8}, /* 42: 0110 0000 0100 0010                      */
2093   {ADD,"C,A",      2, 8}, /* 43: 0110 0000 0100 0011                      */
2094   {ADD,"D,A",      2, 8}, /* 44: 0110 0000 0100 0100                      */
2095   {ADD,"E,A",      2, 8}, /* 45: 0110 0000 0100 0101                      */
2096   {ADD,"H,A",      2, 8}, /* 46: 0110 0000 0100 0110                      */
2097   {ADD,"L,A",      2, 8}, /* 47: 0110 0000 0100 0111                      */
2098   {illegal,0,     2, 8}, /* 48: 0110 0000 0100 1000                      */
2099   {illegal,0,     2, 8}, /* 49: 0110 0000 0100 1001                      */
2100   {illegal,0,     2, 8}, /* 4a: 0110 0000 0100 1010                      */
2101   {illegal,0,     2, 8}, /* 4b: 0110 0000 0100 1011                      */
2102   {illegal,0,     2, 8}, /* 4c: 0110 0000 0100 1100                      */
2103   {illegal,0,     2, 8}, /* 4d: 0110 0000 0100 1101                      */
2104   {illegal,0,     2, 8}, /* 4e: 0110 0000 0100 1110                      */
2105   {illegal,0,     2, 8}, /* 4f: 0110 0000 0100 1111                      */
2102   {ADD,"V,A"      }, /* 40: 0110 0000 0100 0000                      */
2103   {ADD,"A,A"      }, /* 41: 0110 0000 0100 0001                      */
2104   {ADD,"B,A"      }, /* 42: 0110 0000 0100 0010                      */
2105   {ADD,"C,A"      }, /* 43: 0110 0000 0100 0011                      */
2106   {ADD,"D,A"      }, /* 44: 0110 0000 0100 0100                      */
2107   {ADD,"E,A"      }, /* 45: 0110 0000 0100 0101                      */
2108   {ADD,"H,A"      }, /* 46: 0110 0000 0100 0110                      */
2109   {ADD,"L,A"      }, /* 47: 0110 0000 0100 0111                      */
2110   {illegal,0     }, /* 48: 0110 0000 0100 1000                      */
2111   {illegal,0     }, /* 49: 0110 0000 0100 1001                      */
2112   {illegal,0     }, /* 4a: 0110 0000 0100 1010                      */
2113   {illegal,0     }, /* 4b: 0110 0000 0100 1011                      */
2114   {illegal,0     }, /* 4c: 0110 0000 0100 1100                      */
2115   {illegal,0     }, /* 4d: 0110 0000 0100 1101                      */
2116   {illegal,0     }, /* 4e: 0110 0000 0100 1110                      */
2117   {illegal,0     }, /* 4f: 0110 0000 0100 1111                      */
21062118
2107   {ADC,"V,A",      2, 8}, /* 50: 0110 0000 0101 0000                      */
2108   {ADC,"A,A",      2, 8}, /* 51: 0110 0000 0101 0001                      */
2109   {ADC,"B,A",      2, 8}, /* 52: 0110 0000 0101 0010                      */
2110   {ADC,"C,A",      2, 8}, /* 53: 0110 0000 0101 0011                      */
2111   {ADC,"D,A",      2, 8}, /* 54: 0110 0000 0101 0100                      */
2112   {ADC,"E,A",      2, 8}, /* 55: 0110 0000 0101 0101                      */
2113   {ADC,"H,A",      2, 8}, /* 56: 0110 0000 0101 0110                      */
2114   {ADC,"L,A",      2, 8}, /* 57: 0110 0000 0101 0111                      */
2115   {illegal,0,     2, 8}, /* 58: 0110 0000 0101 1000                      */
2116   {illegal,0,     2, 8}, /* 59: 0110 0000 0101 1001                      */
2117   {illegal,0,     2, 8}, /* 5a: 0110 0000 0101 1010                      */
2118   {illegal,0,     2, 8}, /* 5b: 0110 0000 0101 1011                      */
2119   {illegal,0,     2, 8}, /* 5c: 0110 0000 0101 1100                      */
2120   {illegal,0,     2, 8}, /* 5d: 0110 0000 0101 1101                      */
2121   {illegal,0,     2, 8}, /* 5e: 0110 0000 0101 1110                      */
2122   {illegal,0,     2, 8}, /* 5f: 0110 0000 0101 1111                      */
2119   {ADC,"V,A"      }, /* 50: 0110 0000 0101 0000                      */
2120   {ADC,"A,A"      }, /* 51: 0110 0000 0101 0001                      */
2121   {ADC,"B,A"      }, /* 52: 0110 0000 0101 0010                      */
2122   {ADC,"C,A"      }, /* 53: 0110 0000 0101 0011                      */
2123   {ADC,"D,A"      }, /* 54: 0110 0000 0101 0100                      */
2124   {ADC,"E,A"      }, /* 55: 0110 0000 0101 0101                      */
2125   {ADC,"H,A"      }, /* 56: 0110 0000 0101 0110                      */
2126   {ADC,"L,A"      }, /* 57: 0110 0000 0101 0111                      */
2127   {illegal,0     }, /* 58: 0110 0000 0101 1000                      */
2128   {illegal,0     }, /* 59: 0110 0000 0101 1001                      */
2129   {illegal,0     }, /* 5a: 0110 0000 0101 1010                      */
2130   {illegal,0     }, /* 5b: 0110 0000 0101 1011                      */
2131   {illegal,0     }, /* 5c: 0110 0000 0101 1100                      */
2132   {illegal,0     }, /* 5d: 0110 0000 0101 1101                      */
2133   {illegal,0     }, /* 5e: 0110 0000 0101 1110                      */
2134   {illegal,0     }, /* 5f: 0110 0000 0101 1111                      */
21232135
2124   {SUB,"V,A",      2, 8}, /* 60: 0110 0000 0110 0000                      */
2125   {SUB,"A,A",      2, 8}, /* 61: 0110 0000 0110 0001                      */
2126   {SUB,"B,A",      2, 8}, /* 62: 0110 0000 0110 0010                      */
2127   {SUB,"C,A",      2, 8}, /* 63: 0110 0000 0110 0011                      */
2128   {SUB,"D,A",      2, 8}, /* 64: 0110 0000 0110 0100                      */
2129   {SUB,"E,A",      2, 8}, /* 65: 0110 0000 0110 0101                      */
2130   {SUB,"H,A",      2, 8}, /* 66: 0110 0000 0110 0110                      */
2131   {SUB,"L,A",      2, 8}, /* 67: 0110 0000 0110 0111                      */
2132   {NEA,"V,A",      2, 8}, /* 68: 0110 0000 0110 1000                      */
2133   {NEA,"A,A",      2, 8}, /* 69: 0110 0000 0110 1001                      */
2134   {NEA,"B,A",      2, 8}, /* 6a: 0110 0000 0110 1010                      */
2135   {NEA,"C,A",      2, 8}, /* 6b: 0110 0000 0110 1011                      */
2136   {NEA,"D,A",      2, 8}, /* 6c: 0110 0000 0110 1100                      */
2137   {NEA,"E,A",      2, 8}, /* 6d: 0110 0000 0110 1101                      */
2138   {NEA,"H,A",      2, 8}, /* 6e: 0110 0000 0110 1110                      */
2139   {NEA,"L,A",      2, 8}, /* 6f: 0110 0000 0110 1111                      */
2136   {SUB,"V,A"      }, /* 60: 0110 0000 0110 0000                      */
2137   {SUB,"A,A"      }, /* 61: 0110 0000 0110 0001                      */
2138   {SUB,"B,A"      }, /* 62: 0110 0000 0110 0010                      */
2139   {SUB,"C,A"      }, /* 63: 0110 0000 0110 0011                      */
2140   {SUB,"D,A"      }, /* 64: 0110 0000 0110 0100                      */
2141   {SUB,"E,A"      }, /* 65: 0110 0000 0110 0101                      */
2142   {SUB,"H,A"      }, /* 66: 0110 0000 0110 0110                      */
2143   {SUB,"L,A"      }, /* 67: 0110 0000 0110 0111                      */
2144   {NEA,"V,A"      }, /* 68: 0110 0000 0110 1000                      */
2145   {NEA,"A,A"      }, /* 69: 0110 0000 0110 1001                      */
2146   {NEA,"B,A"      }, /* 6a: 0110 0000 0110 1010                      */
2147   {NEA,"C,A"      }, /* 6b: 0110 0000 0110 1011                      */
2148   {NEA,"D,A"      }, /* 6c: 0110 0000 0110 1100                      */
2149   {NEA,"E,A"      }, /* 6d: 0110 0000 0110 1101                      */
2150   {NEA,"H,A"      }, /* 6e: 0110 0000 0110 1110                      */
2151   {NEA,"L,A"      }, /* 6f: 0110 0000 0110 1111                      */
21402152
2141   {SBB,"V,A",      2, 8}, /* 70: 0110 0000 0111 0000                      */
2142   {SBB,"A,A",      2, 8}, /* 71: 0110 0000 0111 0001                      */
2143   {SBB,"B,A",      2, 8}, /* 72: 0110 0000 0111 0010                      */
2144   {SBB,"C,A",      2, 8}, /* 73: 0110 0000 0111 0011                      */
2145   {SBB,"D,A",      2, 8}, /* 74: 0110 0000 0111 0100                      */
2146   {SBB,"E,A",      2, 8}, /* 75: 0110 0000 0111 0101                      */
2147   {SBB,"H,A",      2, 8}, /* 76: 0110 0000 0111 0110                      */
2148   {SBB,"L,A",      2, 8}, /* 77: 0110 0000 0111 0111                      */
2149   {EQA,"V,A",      2, 8}, /* 78: 0110 0000 0111 1000                      */
2150   {EQA,"A,A",      2, 8}, /* 79: 0110 0000 0111 1001                      */
2151   {EQA,"B,A",      2, 8}, /* 7a: 0110 0000 0111 1010                      */
2152   {EQA,"C,A",      2, 8}, /* 7b: 0110 0000 0111 1011                      */
2153   {EQA,"D,A",      2, 8}, /* 7c: 0110 0000 0111 1100                      */
2154   {EQA,"E,A",      2, 8}, /* 7d: 0110 0000 0111 1101                      */
2155   {EQA,"H,A",      2, 8}, /* 7e: 0110 0000 0111 1110                      */
2156   {EQA,"L,A",      2, 8}, /* 7f: 0110 0000 0111 1111                      */
2153   {SBB,"V,A"      }, /* 70: 0110 0000 0111 0000                      */
2154   {SBB,"A,A"      }, /* 71: 0110 0000 0111 0001                      */
2155   {SBB,"B,A"      }, /* 72: 0110 0000 0111 0010                      */
2156   {SBB,"C,A"      }, /* 73: 0110 0000 0111 0011                      */
2157   {SBB,"D,A"      }, /* 74: 0110 0000 0111 0100                      */
2158   {SBB,"E,A"      }, /* 75: 0110 0000 0111 0101                      */
2159   {SBB,"H,A"      }, /* 76: 0110 0000 0111 0110                      */
2160   {SBB,"L,A"      }, /* 77: 0110 0000 0111 0111                      */
2161   {EQA,"V,A"      }, /* 78: 0110 0000 0111 1000                      */
2162   {EQA,"A,A"      }, /* 79: 0110 0000 0111 1001                      */
2163   {EQA,"B,A"      }, /* 7a: 0110 0000 0111 1010                      */
2164   {EQA,"C,A"      }, /* 7b: 0110 0000 0111 1011                      */
2165   {EQA,"D,A"      }, /* 7c: 0110 0000 0111 1100                      */
2166   {EQA,"E,A"      }, /* 7d: 0110 0000 0111 1101                      */
2167   {EQA,"H,A"      }, /* 7e: 0110 0000 0111 1110                      */
2168   {EQA,"L,A"      }, /* 7f: 0110 0000 0111 1111                      */
21572169
2158   {illegal,0,     2, 8}, /* 80: 0110 0000 1000 0000                      */
2159   {illegal,0,     2, 8}, /* 81: 0110 0000 1000 0001                      */
2160   {illegal,0,     2, 8}, /* 82: 0110 0000 1000 0010                      */
2161   {illegal,0,     2, 8}, /* 83: 0110 0000 1000 0011                      */
2162   {illegal,0,     2, 8}, /* 84: 0110 0000 1000 0100                      */
2163   {illegal,0,     2, 8}, /* 85: 0110 0000 1000 0101                      */
2164   {illegal,0,     2, 8}, /* 86: 0110 0000 1000 0110                      */
2165   {illegal,0,     2, 8}, /* 87: 0110 0000 1000 0111                      */
2166   {ANA,"A,V",      2, 8}, /* 88: 0110 0000 1000 1000                      */
2167   {ANA,"A,A",      2, 8}, /* 89: 0110 0000 1000 1001                      */
2168   {ANA,"A,B",      2, 8}, /* 8a: 0110 0000 1000 1010                      */
2169   {ANA,"A,C",      2, 8}, /* 8b: 0110 0000 1000 1011                      */
2170   {ANA,"A,D",      2, 8}, /* 8c: 0110 0000 1000 1100                      */
2171   {ANA,"A,E",      2, 8}, /* 8d: 0110 0000 1000 1101                      */
2172   {ANA,"A,H",      2, 8}, /* 8e: 0110 0000 1000 1110                      */
2173   {ANA,"A,L",      2, 8}, /* 8f: 0110 0000 1000 1111                      */
2170   {illegal,0     }, /* 80: 0110 0000 1000 0000                      */
2171   {illegal,0     }, /* 81: 0110 0000 1000 0001                      */
2172   {illegal,0     }, /* 82: 0110 0000 1000 0010                      */
2173   {illegal,0     }, /* 83: 0110 0000 1000 0011                      */
2174   {illegal,0     }, /* 84: 0110 0000 1000 0100                      */
2175   {illegal,0     }, /* 85: 0110 0000 1000 0101                      */
2176   {illegal,0     }, /* 86: 0110 0000 1000 0110                      */
2177   {illegal,0     }, /* 87: 0110 0000 1000 0111                      */
2178   {ANA,"A,V"      }, /* 88: 0110 0000 1000 1000                      */
2179   {ANA,"A,A"      }, /* 89: 0110 0000 1000 1001                      */
2180   {ANA,"A,B"      }, /* 8a: 0110 0000 1000 1010                      */
2181   {ANA,"A,C"      }, /* 8b: 0110 0000 1000 1011                      */
2182   {ANA,"A,D"      }, /* 8c: 0110 0000 1000 1100                      */
2183   {ANA,"A,E"      }, /* 8d: 0110 0000 1000 1101                      */
2184   {ANA,"A,H"      }, /* 8e: 0110 0000 1000 1110                      */
2185   {ANA,"A,L"      }, /* 8f: 0110 0000 1000 1111                      */
21742186
2175   {XRA,"A,V",      2, 8}, /* 90: 0110 0000 1001 0000                      */
2176   {XRA,"A,A",      2, 8}, /* 91: 0110 0000 1001 0001                      */
2177   {XRA,"A,B",      2, 8}, /* 92: 0110 0000 1001 0010                      */
2178   {XRA,"A,C",      2, 8}, /* 93: 0110 0000 1001 0011                      */
2179   {XRA,"A,D",      2, 8}, /* 94: 0110 0000 1001 0100                      */
2180   {XRA,"A,E",      2, 8}, /* 95: 0110 0000 1001 0101                      */
2181   {XRA,"A,H",      2, 8}, /* 96: 0110 0000 1001 0110                      */
2182   {XRA,"A,L",      2, 8}, /* 97: 0110 0000 1001 0111                      */
2183   {ORA,"A,V",      2, 8}, /* 98: 0110 0000 1001 1000                      */
2184   {ORA,"A,A",      2, 8}, /* 99: 0110 0000 1001 1001                      */
2185   {ORA,"A,B",      2, 8}, /* 9a: 0110 0000 1001 1010                      */
2186   {ORA,"A,C",      2, 8}, /* 9b: 0110 0000 1001 1011                      */
2187   {ORA,"A,D",      2, 8}, /* 9c: 0110 0000 1001 1100                      */
2188   {ORA,"A,E",      2, 8}, /* 9d: 0110 0000 1001 1101                      */
2189   {ORA,"A,H",      2, 8}, /* 9e: 0110 0000 1001 1110                      */
2190   {ORA,"A,L",      2, 8}, /* 9f: 0110 0000 1001 1111                      */
2187   {XRA,"A,V"      }, /* 90: 0110 0000 1001 0000                      */
2188   {XRA,"A,A"      }, /* 91: 0110 0000 1001 0001                      */
2189   {XRA,"A,B"      }, /* 92: 0110 0000 1001 0010                      */
2190   {XRA,"A,C"      }, /* 93: 0110 0000 1001 0011                      */
2191   {XRA,"A,D"      }, /* 94: 0110 0000 1001 0100                      */
2192   {XRA,"A,E"      }, /* 95: 0110 0000 1001 0101                      */
2193   {XRA,"A,H"      }, /* 96: 0110 0000 1001 0110                      */
2194   {XRA,"A,L"      }, /* 97: 0110 0000 1001 0111                      */
2195   {ORA,"A,V"      }, /* 98: 0110 0000 1001 1000                      */
2196   {ORA,"A,A"      }, /* 99: 0110 0000 1001 1001                      */
2197   {ORA,"A,B"      }, /* 9a: 0110 0000 1001 1010                      */
2198   {ORA,"A,C"      }, /* 9b: 0110 0000 1001 1011                      */
2199   {ORA,"A,D"      }, /* 9c: 0110 0000 1001 1100                      */
2200   {ORA,"A,E"      }, /* 9d: 0110 0000 1001 1101                      */
2201   {ORA,"A,H"      }, /* 9e: 0110 0000 1001 1110                      */
2202   {ORA,"A,L"      }, /* 9f: 0110 0000 1001 1111                      */
21912203
2192   {ADDNC,"A,V",    2, 8}, /* a0: 0110 0000 1010 0000                      */
2193   {ADDNC,"A,A",    2, 8}, /* a1: 0110 0000 1010 0001                      */
2194   {ADDNC,"A,B",    2, 8}, /* a2: 0110 0000 1010 0010                      */
2195   {ADDNC,"A,C",    2, 8}, /* a3: 0110 0000 1010 0011                      */
2196   {ADDNC,"A,D",    2, 8}, /* a4: 0110 0000 1010 0100                      */
2197   {ADDNC,"A,E",    2, 8}, /* a5: 0110 0000 1010 0101                      */
2198   {ADDNC,"A,H",    2, 8}, /* a6: 0110 0000 1010 0110                      */
2199   {ADDNC,"A,L",    2, 8}, /* a7: 0110 0000 1010 0111                      */
2200   {GTA,"A,V",      2, 8}, /* a8: 0110 0000 1010 1000                      */
2201   {GTA,"A,A",      2, 8}, /* a9: 0110 0000 1010 1001                      */
2202   {GTA,"A,B",      2, 8}, /* aa: 0110 0000 1010 1010                      */
2203   {GTA,"A,C",      2, 8}, /* ab: 0110 0000 1010 1011                      */
2204   {GTA,"A,D",      2, 8}, /* ac: 0110 0000 1010 1100                      */
2205   {GTA,"A,E",      2, 8}, /* ad: 0110 0000 1010 1101                      */
2206   {GTA,"A,H",      2, 8}, /* ae: 0110 0000 1010 1110                      */
2207   {GTA,"A,L",      2, 8}, /* af: 0110 0000 1010 1111                      */
2204   {ADDNC,"A,V"    }, /* a0: 0110 0000 1010 0000                      */
2205   {ADDNC,"A,A"    }, /* a1: 0110 0000 1010 0001                      */
2206   {ADDNC,"A,B"    }, /* a2: 0110 0000 1010 0010                      */
2207   {ADDNC,"A,C"    }, /* a3: 0110 0000 1010 0011                      */
2208   {ADDNC,"A,D"    }, /* a4: 0110 0000 1010 0100                      */
2209   {ADDNC,"A,E"    }, /* a5: 0110 0000 1010 0101                      */
2210   {ADDNC,"A,H"    }, /* a6: 0110 0000 1010 0110                      */
2211   {ADDNC,"A,L"    }, /* a7: 0110 0000 1010 0111                      */
2212   {GTA,"A,V"      }, /* a8: 0110 0000 1010 1000                      */
2213   {GTA,"A,A"      }, /* a9: 0110 0000 1010 1001                      */
2214   {GTA,"A,B"      }, /* aa: 0110 0000 1010 1010                      */
2215   {GTA,"A,C"      }, /* ab: 0110 0000 1010 1011                      */
2216   {GTA,"A,D"      }, /* ac: 0110 0000 1010 1100                      */
2217   {GTA,"A,E"      }, /* ad: 0110 0000 1010 1101                      */
2218   {GTA,"A,H"      }, /* ae: 0110 0000 1010 1110                      */
2219   {GTA,"A,L"      }, /* af: 0110 0000 1010 1111                      */
22082220
2209   {SUBNB,"A,V",    2, 8}, /* b0: 0110 0000 1011 0000                      */
2210   {SUBNB,"A,A",    2, 8}, /* b1: 0110 0000 1011 0001                      */
2211   {SUBNB,"A,B",    2, 8}, /* b2: 0110 0000 1011 0010                      */
2212   {SUBNB,"A,C",    2, 8}, /* b3: 0110 0000 1011 0011                      */
2213   {SUBNB,"A,D",    2, 8}, /* b4: 0110 0000 1011 0100                      */
2214   {SUBNB,"A,E",    2, 8}, /* b5: 0110 0000 1011 0101                      */
2215   {SUBNB,"A,H",    2, 8}, /* b6: 0110 0000 1011 0110                      */
2216   {SUBNB,"A,L",    2, 8}, /* b7: 0110 0000 1011 0111                      */
2217   {LTA,"A,V",      2, 8}, /* b8: 0110 0000 1011 1000                      */
2218   {LTA,"A,A",      2, 8}, /* b9: 0110 0000 1011 1001                      */
2219   {LTA,"A,B",      2, 8}, /* ba: 0110 0000 1011 1010                      */
2220   {LTA,"A,C",      2, 8}, /* bb: 0110 0000 1011 1011                      */
2221   {LTA,"A,D",      2, 8}, /* bc: 0110 0000 1011 1100                      */
2222   {LTA,"A,E",      2, 8}, /* bd: 0110 0000 1011 1101                      */
2223   {LTA,"A,H",      2, 8}, /* be: 0110 0000 1011 1110                      */
2224   {LTA,"A,L",      2, 8}, /* bf: 0110 0000 1011 1111                      */
2221   {SUBNB,"A,V"    }, /* b0: 0110 0000 1011 0000                      */
2222   {SUBNB,"A,A"    }, /* b1: 0110 0000 1011 0001                      */
2223   {SUBNB,"A,B"    }, /* b2: 0110 0000 1011 0010                      */
2224   {SUBNB,"A,C"    }, /* b3: 0110 0000 1011 0011                      */
2225   {SUBNB,"A,D"    }, /* b4: 0110 0000 1011 0100                      */
2226   {SUBNB,"A,E"    }, /* b5: 0110 0000 1011 0101                      */
2227   {SUBNB,"A,H"    }, /* b6: 0110 0000 1011 0110                      */
2228   {SUBNB,"A,L"    }, /* b7: 0110 0000 1011 0111                      */
2229   {LTA,"A,V"      }, /* b8: 0110 0000 1011 1000                      */
2230   {LTA,"A,A"      }, /* b9: 0110 0000 1011 1001                      */
2231   {LTA,"A,B"      }, /* ba: 0110 0000 1011 1010                      */
2232   {LTA,"A,C"      }, /* bb: 0110 0000 1011 1011                      */
2233   {LTA,"A,D"      }, /* bc: 0110 0000 1011 1100                      */
2234   {LTA,"A,E"      }, /* bd: 0110 0000 1011 1101                      */
2235   {LTA,"A,H"      }, /* be: 0110 0000 1011 1110                      */
2236   {LTA,"A,L"      }, /* bf: 0110 0000 1011 1111                      */
22252237
2226   {ADD,"A,V",      2, 8}, /* c0: 0110 0000 1100 0000                      */
2227   {ADD,"A,A",      2, 8}, /* c1: 0110 0000 1100 0001                      */
2228   {ADD,"A,B",      2, 8}, /* c2: 0110 0000 1100 0010                      */
2229   {ADD,"A,C",      2, 8}, /* c3: 0110 0000 1100 0011                      */
2230   {ADD,"A,D",      2, 8}, /* c4: 0110 0000 1100 0100                      */
2231   {ADD,"A,E",      2, 8}, /* c5: 0110 0000 1100 0101                      */
2232   {ADD,"A,H",      2, 8}, /* c6: 0110 0000 1100 0110                      */
2233   {ADD,"A,L",      2, 8}, /* c7: 0110 0000 1100 0111                      */
2234   {ONA,"A,V",      2, 8}, /* c8: 0110 0000 1100 1000                      */
2235   {ONA,"A,A",      2, 8}, /* c9: 0110 0000 1100 1001                      */
2236   {ONA,"A,B",      2, 8}, /* ca: 0110 0000 1100 1010                      */
2237   {ONA,"A,C",      2, 8}, /* cb: 0110 0000 1100 1011                      */
2238   {ONA,"A,D",      2, 8}, /* cc: 0110 0000 1100 1100                      */
2239   {ONA,"A,E",      2, 8}, /* cd: 0110 0000 1100 1101                      */
2240   {ONA,"A,H",      2, 8}, /* ce: 0110 0000 1100 1110                      */
2241   {ONA,"A,L",      2, 8}, /* cf: 0110 0000 1100 1111                      */
2238   {ADD,"A,V"      }, /* c0: 0110 0000 1100 0000                      */
2239   {ADD,"A,A"      }, /* c1: 0110 0000 1100 0001                      */
2240   {ADD,"A,B"      }, /* c2: 0110 0000 1100 0010                      */
2241   {ADD,"A,C"      }, /* c3: 0110 0000 1100 0011                      */
2242   {ADD,"A,D"      }, /* c4: 0110 0000 1100 0100                      */
2243   {ADD,"A,E"      }, /* c5: 0110 0000 1100 0101                      */
2244   {ADD,"A,H"      }, /* c6: 0110 0000 1100 0110                      */
2245   {ADD,"A,L"      }, /* c7: 0110 0000 1100 0111                      */
2246   {ONA,"A,V"      }, /* c8: 0110 0000 1100 1000                      */
2247   {ONA,"A,A"      }, /* c9: 0110 0000 1100 1001                      */
2248   {ONA,"A,B"      }, /* ca: 0110 0000 1100 1010                      */
2249   {ONA,"A,C"      }, /* cb: 0110 0000 1100 1011                      */
2250   {ONA,"A,D"      }, /* cc: 0110 0000 1100 1100                      */
2251   {ONA,"A,E"      }, /* cd: 0110 0000 1100 1101                      */
2252   {ONA,"A,H"      }, /* ce: 0110 0000 1100 1110                      */
2253   {ONA,"A,L"      }, /* cf: 0110 0000 1100 1111                      */
22422254
2243   {ADC,"A,V",      2, 8}, /* d0: 0110 0000 1101 0000                      */
2244   {ADC,"A,A",      2, 8}, /* d1: 0110 0000 1101 0001                      */
2245   {ADC,"A,B",      2, 8}, /* d2: 0110 0000 1101 0010                      */
2246   {ADC,"A,C",      2, 8}, /* d3: 0110 0000 1101 0011                      */
2247   {ADC,"A,D",      2, 8}, /* d4: 0110 0000 1101 0100                      */
2248   {ADC,"A,E",      2, 8}, /* d5: 0110 0000 1101 0101                      */
2249   {ADC,"A,H",      2, 8}, /* d6: 0110 0000 1101 0110                      */
2250   {ADC,"A,L",      2, 8}, /* d7: 0110 0000 1101 0111                      */
2251   {OFFA,"A,V",     2, 8}, /* d8: 0110 0000 1101 1000                      */
2252   {OFFA,"A,A",     2, 8}, /* d9: 0110 0000 1101 1001                      */
2253   {OFFA,"A,B",     2, 8}, /* da: 0110 0000 1101 1010                      */
2254   {OFFA,"A,C",     2, 8}, /* db: 0110 0000 1101 1011                      */
2255   {OFFA,"A,D",     2, 8}, /* dc: 0110 0000 1101 1100                      */
2256   {OFFA,"A,E",     2, 8}, /* dd: 0110 0000 1101 1101                      */
2257   {OFFA,"A,H",     2, 8}, /* de: 0110 0000 1101 1110                      */
2258   {OFFA,"A,L",     2, 8}, /* df: 0110 0000 1101 1111                      */
2255   {ADC,"A,V"      }, /* d0: 0110 0000 1101 0000                      */
2256   {ADC,"A,A"      }, /* d1: 0110 0000 1101 0001                      */
2257   {ADC,"A,B"      }, /* d2: 0110 0000 1101 0010                      */
2258   {ADC,"A,C"      }, /* d3: 0110 0000 1101 0011                      */
2259   {ADC,"A,D"      }, /* d4: 0110 0000 1101 0100                      */
2260   {ADC,"A,E"      }, /* d5: 0110 0000 1101 0101                      */
2261   {ADC,"A,H"      }, /* d6: 0110 0000 1101 0110                      */
2262   {ADC,"A,L"      }, /* d7: 0110 0000 1101 0111                      */
2263   {OFFA,"A,V"     }, /* d8: 0110 0000 1101 1000                      */
2264   {OFFA,"A,A"     }, /* d9: 0110 0000 1101 1001                      */
2265   {OFFA,"A,B"     }, /* da: 0110 0000 1101 1010                      */
2266   {OFFA,"A,C"     }, /* db: 0110 0000 1101 1011                      */
2267   {OFFA,"A,D"     }, /* dc: 0110 0000 1101 1100                      */
2268   {OFFA,"A,E"     }, /* dd: 0110 0000 1101 1101                      */
2269   {OFFA,"A,H"     }, /* de: 0110 0000 1101 1110                      */
2270   {OFFA,"A,L"     }, /* df: 0110 0000 1101 1111                      */
22592271
2260   {SUB,"A,V",      2, 8}, /* e0: 0110 0000 1110 0000                      */
2261   {SUB,"A,A",      2, 8}, /* e1: 0110 0000 1110 0001                      */
2262   {SUB,"A,B",      2, 8}, /* e2: 0110 0000 1110 0010                      */
2263   {SUB,"A,C",      2, 8}, /* e3: 0110 0000 1110 0011                      */
2264   {SUB,"A,D",      2, 8}, /* e4: 0110 0000 1110 0100                      */
2265   {SUB,"A,E",      2, 8}, /* e5: 0110 0000 1110 0101                      */
2266   {SUB,"A,H",      2, 8}, /* e6: 0110 0000 1110 0110                      */
2267   {SUB,"A,L",      2, 8}, /* e7: 0110 0000 1110 0111                      */
2268   {NEA,"A,V",      2, 8}, /* e8: 0110 0000 1110 1000                      */
2269   {NEA,"A,A",      2, 8}, /* e9: 0110 0000 1110 1001                      */
2270   {NEA,"A,B",      2, 8}, /* ea: 0110 0000 1110 1010                      */
2271   {NEA,"A,C",      2, 8}, /* eb: 0110 0000 1110 1011                      */
2272   {NEA,"A,D",      2, 8}, /* ec: 0110 0000 1110 1100                      */
2273   {NEA,"A,E",      2, 8}, /* ed: 0110 0000 1110 1101                      */
2274   {NEA,"A,H",      2, 8}, /* ee: 0110 0000 1110 1110                      */
2275   {NEA,"A,L",      2, 8}, /* ef: 0110 0000 1110 1111                      */
2272   {SUB,"A,V"      }, /* e0: 0110 0000 1110 0000                      */
2273   {SUB,"A,A"      }, /* e1: 0110 0000 1110 0001                      */
2274   {SUB,"A,B"      }, /* e2: 0110 0000 1110 0010                      */
2275   {SUB,"A,C"      }, /* e3: 0110 0000 1110 0011                      */
2276   {SUB,"A,D"      }, /* e4: 0110 0000 1110 0100                      */
2277   {SUB,"A,E"      }, /* e5: 0110 0000 1110 0101                      */
2278   {SUB,"A,H"      }, /* e6: 0110 0000 1110 0110                      */
2279   {SUB,"A,L"      }, /* e7: 0110 0000 1110 0111                      */
2280   {NEA,"A,V"      }, /* e8: 0110 0000 1110 1000                      */
2281   {NEA,"A,A"      }, /* e9: 0110 0000 1110 1001                      */
2282   {NEA,"A,B"      }, /* ea: 0110 0000 1110 1010                      */
2283   {NEA,"A,C"      }, /* eb: 0110 0000 1110 1011                      */
2284   {NEA,"A,D"      }, /* ec: 0110 0000 1110 1100                      */
2285   {NEA,"A,E"      }, /* ed: 0110 0000 1110 1101                      */
2286   {NEA,"A,H"      }, /* ee: 0110 0000 1110 1110                      */
2287   {NEA,"A,L"      }, /* ef: 0110 0000 1110 1111                      */
22762288
2277   {SBB,"A,V",      2, 8}, /* f0: 0110 0000 1111 0000                      */
2278   {SBB,"A,A",      2, 8}, /* f1: 0110 0000 1111 0001                      */
2279   {SBB,"A,B",      2, 8}, /* f2: 0110 0000 1111 0010                      */
2280   {SBB,"A,C",      2, 8}, /* f3: 0110 0000 1111 0011                      */
2281   {SBB,"A,D",      2, 8}, /* f4: 0110 0000 1111 0100                      */
2282   {SBB,"A,E",      2, 8}, /* f5: 0110 0000 1111 0101                      */
2283   {SBB,"A,H",      2, 8}, /* f6: 0110 0000 1111 0110                      */
2284   {SBB,"A,L",      2, 8}, /* f7: 0110 0000 1111 0111                      */
2285   {EQA,"A,V",      2, 8}, /* f8: 0110 0000 1111 1000                      */
2286   {EQA,"A,A",      2, 8}, /* f9: 0110 0000 1111 1001                      */
2287   {EQA,"A,B",      2, 8}, /* fa: 0110 0000 1111 1010                      */
2288   {EQA,"A,C",      2, 8}, /* fb: 0110 0000 1111 1011                      */
2289   {EQA,"A,D",      2, 8}, /* fc: 0110 0000 1111 1100                      */
2290   {EQA,"A,E",      2, 8}, /* fd: 0110 0000 1111 1101                      */
2291   {EQA,"A,H",      2, 8}, /* fe: 0110 0000 1111 1110                      */
2292   {EQA,"A,L",      2, 8}  /* ff: 0110 0000 1111 1111                      */
2289   {SBB,"A,V"      }, /* f0: 0110 0000 1111 0000                      */
2290   {SBB,"A,A"      }, /* f1: 0110 0000 1111 0001                      */
2291   {SBB,"A,B"      }, /* f2: 0110 0000 1111 0010                      */
2292   {SBB,"A,C"      }, /* f3: 0110 0000 1111 0011                      */
2293   {SBB,"A,D"      }, /* f4: 0110 0000 1111 0100                      */
2294   {SBB,"A,E"      }, /* f5: 0110 0000 1111 0101                      */
2295   {SBB,"A,H"      }, /* f6: 0110 0000 1111 0110                      */
2296   {SBB,"A,L"      }, /* f7: 0110 0000 1111 0111                      */
2297   {EQA,"A,V"      }, /* f8: 0110 0000 1111 1000                      */
2298   {EQA,"A,A"      }, /* f9: 0110 0000 1111 1001                      */
2299   {EQA,"A,B"      }, /* fa: 0110 0000 1111 1010                      */
2300   {EQA,"A,C"      }, /* fb: 0110 0000 1111 1011                      */
2301   {EQA,"A,D"      }, /* fc: 0110 0000 1111 1100                      */
2302   {EQA,"A,E"      }, /* fd: 0110 0000 1111 1101                      */
2303   {EQA,"A,H"      }, /* fe: 0110 0000 1111 1110                      */
2304   {EQA,"A,L"      }  /* ff: 0110 0000 1111 1111                      */
22932305};
22942306
22952307/* prefix 64 */
22962308static const struct dasm_s  dasm64_7810[256] =
22972309{
2298   {MVI,"PA,%b",    3,14}, /* 00: 0110 0100 0000 0000 xxxx xxxx            */
2299   {MVI,"PB,%b",    3,14}, /* 01: 0110 0100 0000 0001 xxxx xxxx            */
2300   {MVI,"PC,%b",    3,14}, /* 02: 0110 0100 0000 0010 xxxx xxxx            */
2301   {MVI,"PD,%b",    3,14}, /* 03: 0110 0100 0000 0011 xxxx xxxx            */
2302   {illegal,0,     3,14}, /* 04: 0110 0100 0000 0100 xxxx xxxx            */
2303   {MVI,"PF,%b",    3,14}, /* 05: 0110 0100 0000 0101 xxxx xxxx            */
2304   {MVI,"MKH,%b",   3,14}, /* 06: 0110 0100 0000 0110 xxxx xxxx            */
2305   {MVI,"MKL,%b",   3,14}, /* 07: 0110 0100 0000 0111 xxxx xxxx            */
2306   {ANI,"PA,%b",    3,20}, /* 08: 0110 0100 0000 1000 xxxx xxxx            */
2307   {ANI,"PB,%b",    3,20}, /* 09: 0110 0100 0000 1001 xxxx xxxx            */
2308   {ANI,"PC,%b",    3,20}, /* 0a: 0110 0100 0000 1010 xxxx xxxx            */
2309   {ANI,"PD,%b",    3,20}, /* 0b: 0110 0100 0000 1011 xxxx xxxx            */
2310   {illegal,0,     3,20}, /* 0c: 0110 0100 0000 1100 xxxx xxxx            */
2311   {ANI,"PF,%b",    3,20}, /* 0d: 0110 0100 0000 1101 xxxx xxxx            */
2312   {ANI,"MKH,%b",   3,20}, /* 0e: 0110 0100 0000 1110 xxxx xxxx            */
2313   {ANI,"MKL,%b",   3,20}, /* 0f: 0110 0100 0000 1111 xxxx xxxx            */
2310   {MVI,"PA,%b"    }, /* 00: 0110 0100 0000 0000 xxxx xxxx            */
2311   {MVI,"PB,%b"    }, /* 01: 0110 0100 0000 0001 xxxx xxxx            */
2312   {MVI,"PC,%b"    }, /* 02: 0110 0100 0000 0010 xxxx xxxx            */
2313   {MVI,"PD,%b"    }, /* 03: 0110 0100 0000 0011 xxxx xxxx            */
2314   {illegal,0     }, /* 04: 0110 0100 0000 0100 xxxx xxxx            */
2315   {MVI,"PF,%b"    }, /* 05: 0110 0100 0000 0101 xxxx xxxx            */
2316   {MVI,"MKH,%b"   }, /* 06: 0110 0100 0000 0110 xxxx xxxx            */
2317   {MVI,"MKL,%b"   }, /* 07: 0110 0100 0000 0111 xxxx xxxx            */
2318   {ANI,"PA,%b"    }, /* 08: 0110 0100 0000 1000 xxxx xxxx            */
2319   {ANI,"PB,%b"    }, /* 09: 0110 0100 0000 1001 xxxx xxxx            */
2320   {ANI,"PC,%b"    }, /* 0a: 0110 0100 0000 1010 xxxx xxxx            */
2321   {ANI,"PD,%b"    }, /* 0b: 0110 0100 0000 1011 xxxx xxxx            */
2322   {illegal,0     }, /* 0c: 0110 0100 0000 1100 xxxx xxxx            */
2323   {ANI,"PF,%b"    }, /* 0d: 0110 0100 0000 1101 xxxx xxxx            */
2324   {ANI,"MKH,%b"   }, /* 0e: 0110 0100 0000 1110 xxxx xxxx            */
2325   {ANI,"MKL,%b"   }, /* 0f: 0110 0100 0000 1111 xxxx xxxx            */
23142326
2315   {XRI,"PA,%b",    3,20}, /* 10: 0110 0100 0001 0000 xxxx xxxx            */
2316   {XRI,"PB,%b",    3,20}, /* 11: 0110 0100 0001 0001 xxxx xxxx            */
2317   {XRI,"PC,%b",    3,20}, /* 12: 0110 0100 0001 0010 xxxx xxxx            */
2318   {XRI,"PD,%b",    3,20}, /* 13: 0110 0100 0001 0011 xxxx xxxx            */
2319   {illegal,0,     3,20}, /* 14: 0110 0100 0001 0100 xxxx xxxx            */
2320   {XRI,"PF,%b",    3,20}, /* 15: 0110 0100 0001 0101 xxxx xxxx            */
2321   {XRI,"MKH,%b",   3,20}, /* 16: 0110 0100 0001 0110 xxxx xxxx            */
2322   {XRI,"MKL,%b",   3,20}, /* 17: 0110 0100 0001 0111 xxxx xxxx            */
2323   {ORI,"PA,%b",    3,20}, /* 18: 0110 0100 0001 1000 xxxx xxxx            */
2324   {ORI,"PB,%b",    3,20}, /* 19: 0110 0100 0001 1001 xxxx xxxx            */
2325   {ORI,"PC,%b",    3,20}, /* 1a: 0110 0100 0001 1010 xxxx xxxx            */
2326   {ORI,"PD,%b",    3,20}, /* 1b: 0110 0100 0001 1011 xxxx xxxx            */
2327   {illegal,0,     3,20}, /* 1c: 0110 0100 0001 1100 xxxx xxxx            */
2328   {ORI,"PF,%b",    3,20}, /* 1d: 0110 0100 0001 1101 xxxx xxxx            */
2329   {ORI,"MKH,%b",   3,20}, /* 1e: 0110 0100 0001 1110 xxxx xxxx            */
2330   {ORI,"MKL,%b",   3,20}, /* 1f: 0110 0100 0001 1111 xxxx xxxx            */
2327   {XRI,"PA,%b"    }, /* 10: 0110 0100 0001 0000 xxxx xxxx            */
2328   {XRI,"PB,%b"    }, /* 11: 0110 0100 0001 0001 xxxx xxxx            */
2329   {XRI,"PC,%b"    }, /* 12: 0110 0100 0001 0010 xxxx xxxx            */
2330   {XRI,"PD,%b"    }, /* 13: 0110 0100 0001 0011 xxxx xxxx            */
2331   {illegal,0     }, /* 14: 0110 0100 0001 0100 xxxx xxxx            */
2332   {XRI,"PF,%b"    }, /* 15: 0110 0100 0001 0101 xxxx xxxx            */
2333   {XRI,"MKH,%b"   }, /* 16: 0110 0100 0001 0110 xxxx xxxx            */
2334   {XRI,"MKL,%b"   }, /* 17: 0110 0100 0001 0111 xxxx xxxx            */
2335   {ORI,"PA,%b"    }, /* 18: 0110 0100 0001 1000 xxxx xxxx            */
2336   {ORI,"PB,%b"    }, /* 19: 0110 0100 0001 1001 xxxx xxxx            */
2337   {ORI,"PC,%b"    }, /* 1a: 0110 0100 0001 1010 xxxx xxxx            */
2338   {ORI,"PD,%b"    }, /* 1b: 0110 0100 0001 1011 xxxx xxxx            */
2339   {illegal,0     }, /* 1c: 0110 0100 0001 1100 xxxx xxxx            */
2340   {ORI,"PF,%b"    }, /* 1d: 0110 0100 0001 1101 xxxx xxxx            */
2341   {ORI,"MKH,%b"   }, /* 1e: 0110 0100 0001 1110 xxxx xxxx            */
2342   {ORI,"MKL,%b"   }, /* 1f: 0110 0100 0001 1111 xxxx xxxx            */
23312343
2332   {ADINC,"PA,%b",  3,20}, /* 20: 0110 0100 0010 0000 xxxx xxxx            */
2333   {ADINC,"PB,%b",  3,20}, /* 21: 0110 0100 0010 0001 xxxx xxxx            */
2334   {ADINC,"PC,%b",  3,20}, /* 22: 0110 0100 0010 0010 xxxx xxxx            */
2335   {ADINC,"PD,%b",  3,20}, /* 23: 0110 0100 0010 0011 xxxx xxxx            */
2336   {illegal,0,     3,20}, /* 24: 0110 0100 0010 0100 xxxx xxxx            */
2337   {ADINC,"PF,%b",  3,20}, /* 25: 0110 0100 0010 0101 xxxx xxxx            */
2338   {ADINC,"MKH,%b", 3,20}, /* 26: 0110 0100 0010 0110 xxxx xxxx            */
2339   {ADINC,"MKL,%b", 3,20}, /* 27: 0110 0100 0010 0111 xxxx xxxx            */
2340   {GTI,"PA,%b",    3,20}, /* 28: 0110 0100 0010 1000 xxxx xxxx            */
2341   {GTI,"PB,%b",    3,20}, /* 29: 0110 0100 0010 1001 xxxx xxxx            */
2342   {GTI,"PC,%b",    3,20}, /* 2a: 0110 0100 0010 1010 xxxx xxxx            */
2343   {GTI,"PD,%b",    3,20}, /* 2b: 0110 0100 0010 1011 xxxx xxxx            */
2344   {illegal,0,     3,20}, /* 2c: 0110 0100 0010 1100 xxxx xxxx            */
2345   {GTI,"PF,%b",    3,20}, /* 2d: 0110 0100 0010 1101 xxxx xxxx            */
2346   {GTI,"MKH,%b",   3,20}, /* 2e: 0110 0100 0010 1110 xxxx xxxx            */
2347   {GTI,"MKL,%b",   3,20}, /* 2f: 0110 0100 0010 1111 xxxx xxxx            */
2344   {ADINC,"PA,%b"  }, /* 20: 0110 0100 0010 0000 xxxx xxxx            */
2345   {ADINC,"PB,%b"  }, /* 21: 0110 0100 0010 0001 xxxx xxxx            */
2346   {ADINC,"PC,%b"  }, /* 22: 0110 0100 0010 0010 xxxx xxxx            */
2347   {ADINC,"PD,%b"  }, /* 23: 0110 0100 0010 0011 xxxx xxxx            */
2348   {illegal,0     }, /* 24: 0110 0100 0010 0100 xxxx xxxx            */
2349   {ADINC,"PF,%b"  }, /* 25: 0110 0100 0010 0101 xxxx xxxx            */
2350   {ADINC,"MKH,%b" }, /* 26: 0110 0100 0010 0110 xxxx xxxx            */
2351   {ADINC,"MKL,%b" }, /* 27: 0110 0100 0010 0111 xxxx xxxx            */
2352   {GTI,"PA,%b"    }, /* 28: 0110 0100 0010 1000 xxxx xxxx            */
2353   {GTI,"PB,%b"    }, /* 29: 0110 0100 0010 1001 xxxx xxxx            */
2354   {GTI,"PC,%b"    }, /* 2a: 0110 0100 0010 1010 xxxx xxxx            */
2355   {GTI,"PD,%b"    }, /* 2b: 0110 0100 0010 1011 xxxx xxxx            */
2356   {illegal,0     }, /* 2c: 0110 0100 0010 1100 xxxx xxxx            */
2357   {GTI,"PF,%b"    }, /* 2d: 0110 0100 0010 1101 xxxx xxxx            */
2358   {GTI,"MKH,%b"   }, /* 2e: 0110 0100 0010 1110 xxxx xxxx            */
2359   {GTI,"MKL,%b"   }, /* 2f: 0110 0100 0010 1111 xxxx xxxx            */
23482360
2349   {SUINB,"PA,%b",  3,20}, /* 30: 0110 0100 0011 0000 xxxx xxxx            */
2350   {SUINB,"PB,%b",  3,20}, /* 31: 0110 0100 0011 0001 xxxx xxxx            */
2351   {SUINB,"PC,%b",  3,20}, /* 32: 0110 0100 0011 0010 xxxx xxxx            */
2352   {SUINB,"PD,%b",  3,20}, /* 33: 0110 0100 0011 0011 xxxx xxxx            */
2353   {illegal,0,     3,20}, /* 34: 0110 0100 0011 0100 xxxx xxxx            */
2354   {SUINB,"PF,%b",  3,20}, /* 35: 0110 0100 0011 0101 xxxx xxxx            */
2355   {SUINB,"MKH,%b", 3,20}, /* 36: 0110 0100 0011 0110 xxxx xxxx            */
2356   {SUINB,"MKL,%b", 3,20}, /* 37: 0110 0100 0011 0111 xxxx xxxx            */
2357   {LTI,"PA,%b",    3,20}, /* 38: 0110 0100 0011 1000 xxxx xxxx            */
2358   {LTI,"PB,%b",    3,20}, /* 39: 0110 0100 0011 1001 xxxx xxxx            */
2359   {LTI,"PC,%b",    3,20}, /* 3a: 0110 0100 0011 1010 xxxx xxxx            */
2360   {LTI,"PD,%b",    3,20}, /* 3b: 0110 0100 0011 1011 xxxx xxxx            */
2361   {illegal,0,     3,20}, /* 3c: 0110 0100 0011 1100 xxxx xxxx            */
2362   {LTI,"PF,%b",    3,20}, /* 3d: 0110 0100 0011 1101 xxxx xxxx            */
2363   {LTI,"MKH,%b",   3,20}, /* 3e: 0110 0100 0011 1110 xxxx xxxx            */
2364   {LTI,"MKL,%b",   3,20}, /* 3f: 0110 0100 0011 1111 xxxx xxxx            */
2361   {SUINB,"PA,%b"  }, /* 30: 0110 0100 0011 0000 xxxx xxxx            */
2362   {SUINB,"PB,%b"  }, /* 31: 0110 0100 0011 0001 xxxx xxxx            */
2363   {SUINB,"PC,%b"  }, /* 32: 0110 0100 0011 0010 xxxx xxxx            */
2364   {SUINB,"PD,%b"  }, /* 33: 0110 0100 0011 0011 xxxx xxxx            */
2365   {illegal,0     }, /* 34: 0110 0100 0011 0100 xxxx xxxx            */
2366   {SUINB,"PF,%b"  }, /* 35: 0110 0100 0011 0101 xxxx xxxx            */
2367   {SUINB,"MKH,%b" }, /* 36: 0110 0100 0011 0110 xxxx xxxx            */
2368   {SUINB,"MKL,%b" }, /* 37: 0110 0100 0011 0111 xxxx xxxx            */
2369   {LTI,"PA,%b"    }, /* 38: 0110 0100 0011 1000 xxxx xxxx            */
2370   {LTI,"PB,%b"    }, /* 39: 0110 0100 0011 1001 xxxx xxxx            */
2371   {LTI,"PC,%b"    }, /* 3a: 0110 0100 0011 1010 xxxx xxxx            */
2372   {LTI,"PD,%b"    }, /* 3b: 0110 0100 0011 1011 xxxx xxxx            */
2373   {illegal,0     }, /* 3c: 0110 0100 0011 1100 xxxx xxxx            */
2374   {LTI,"PF,%b"    }, /* 3d: 0110 0100 0011 1101 xxxx xxxx            */
2375   {LTI,"MKH,%b"   }, /* 3e: 0110 0100 0011 1110 xxxx xxxx            */
2376   {LTI,"MKL,%b"   }, /* 3f: 0110 0100 0011 1111 xxxx xxxx            */
23652377
2366   {ADI,"PA,%b",    3,20}, /* 40: 0110 0100 0100 0000 xxxx xxxx            */
2367   {ADI,"PB,%b",    3,20}, /* 41: 0110 0100 0100 0001 xxxx xxxx            */
2368   {ADI,"PC,%b",    3,20}, /* 42: 0110 0100 0100 0010 xxxx xxxx            */
2369   {ADI,"PD,%b",    3,20}, /* 43: 0110 0100 0100 0011 xxxx xxxx            */
2370   {illegal,0,     3,20}, /* 44: 0110 0100 0100 0100 xxxx xxxx            */
2371   {ADI,"PF,%b",    3,20}, /* 45: 0110 0100 0100 0101 xxxx xxxx            */
2372   {ADI,"MKH,%b",   3,20}, /* 46: 0110 0100 0100 0110 xxxx xxxx            */
2373   {ADI,"MKL,%b",   3,20}, /* 47: 0110 0100 0100 0111 xxxx xxxx            */
2374   {ONI,"PA,%b",    3,20}, /* 48: 0110 0100 0100 1000 xxxx xxxx            */
2375   {ONI,"PB,%b",    3,20}, /* 49: 0110 0100 0100 1001 xxxx xxxx            */
2376   {ONI,"PC,%b",    3,20}, /* 4a: 0110 0100 0100 1010 xxxx xxxx            */
2377   {ONI,"PD,%b",    3,20}, /* 4b: 0110 0100 0100 1011 xxxx xxxx            */
2378   {illegal,0,     3,20}, /* 4c: 0110 0100 0100 1100 xxxx xxxx            */
2379   {ONI,"PF,%b",    3,20}, /* 4d: 0110 0100 0100 1101 xxxx xxxx            */
2380   {ONI,"MKH,%b",   3,20}, /* 4e: 0110 0100 0100 1110 xxxx xxxx            */
2381   {ONI,"MKL,%b",   3,20}, /* 4f: 0110 0100 0100 1111 xxxx xxxx            */
2378   {ADI,"PA,%b"    }, /* 40: 0110 0100 0100 0000 xxxx xxxx            */
2379   {ADI,"PB,%b"    }, /* 41: 0110 0100 0100 0001 xxxx xxxx            */
2380   {ADI,"PC,%b"    }, /* 42: 0110 0100 0100 0010 xxxx xxxx            */
2381   {ADI,"PD,%b"    }, /* 43: 0110 0100 0100 0011 xxxx xxxx            */
2382   {illegal,0     }, /* 44: 0110 0100 0100 0100 xxxx xxxx            */
2383   {ADI,"PF,%b"    }, /* 45: 0110 0100 0100 0101 xxxx xxxx            */
2384   {ADI,"MKH,%b"   }, /* 46: 0110 0100 0100 0110 xxxx xxxx            */
2385   {ADI,"MKL,%b"   }, /* 47: 0110 0100 0100 0111 xxxx xxxx            */
2386   {ONI,"PA,%b"    }, /* 48: 0110 0100 0100 1000 xxxx xxxx            */
2387   {ONI,"PB,%b"    }, /* 49: 0110 0100 0100 1001 xxxx xxxx            */
2388   {ONI,"PC,%b"    }, /* 4a: 0110 0100 0100 1010 xxxx xxxx            */
2389   {ONI,"PD,%b"    }, /* 4b: 0110 0100 0100 1011 xxxx xxxx            */
2390   {illegal,0     }, /* 4c: 0110 0100 0100 1100 xxxx xxxx            */
2391   {ONI,"PF,%b"    }, /* 4d: 0110 0100 0100 1101 xxxx xxxx            */
2392   {ONI,"MKH,%b"   }, /* 4e: 0110 0100 0100 1110 xxxx xxxx            */
2393   {ONI,"MKL,%b"   }, /* 4f: 0110 0100 0100 1111 xxxx xxxx            */
23822394
2383   {ACI,"PA,%b",    3,20}, /* 50: 0110 0100 0101 0000 xxxx xxxx            */
2384   {ACI,"PB,%b",    3,20}, /* 51: 0110 0100 0101 0001 xxxx xxxx            */
2385   {ACI,"PC,%b",    3,20}, /* 52: 0110 0100 0101 0010 xxxx xxxx            */
2386   {ACI,"PD,%b",    3,20}, /* 53: 0110 0100 0101 0011 xxxx xxxx            */
2387   {illegal,0,     3,20}, /* 54: 0110 0100 0101 0100 xxxx xxxx            */
2388   {ACI,"PF,%b",    3,20}, /* 55: 0110 0100 0101 0101 xxxx xxxx            */
2389   {ACI,"MKH,%b",   3,20}, /* 56: 0110 0100 0101 0110 xxxx xxxx            */
2390   {ACI,"MKL,%b",   3,20}, /* 57: 0110 0100 0101 0111 xxxx xxxx            */
2391   {OFFI,"PA,%b",   3,20}, /* 58: 0110 0100 0101 1000 xxxx xxxx            */
2392   {OFFI,"PB,%b",   3,20}, /* 59: 0110 0100 0101 1001 xxxx xxxx            */
2393   {OFFI,"PC,%b",   3,20}, /* 5a: 0110 0100 0101 1010 xxxx xxxx            */
2394   {OFFI,"PD,%b",   3,20}, /* 5b: 0110 0100 0101 1011 xxxx xxxx            */
2395   {illegal,0,     3,20}, /* 5c: 0110 0100 0101 1100 xxxx xxxx            */
2396   {OFFI,"PF,%b",   3,20}, /* 5d: 0110 0100 0101 1101 xxxx xxxx            */
2397   {OFFI,"MKH,%b",  3,20}, /* 5e: 0110 0100 0101 1110 xxxx xxxx            */
2398   {OFFI,"MKL,%b",  3,20}, /* 5f: 0110 0100 0101 1111 xxxx xxxx            */
2395   {ACI,"PA,%b"    }, /* 50: 0110 0100 0101 0000 xxxx xxxx            */
2396   {ACI,"PB,%b"    }, /* 51: 0110 0100 0101 0001 xxxx xxxx            */
2397   {ACI,"PC,%b"    }, /* 52: 0110 0100 0101 0010 xxxx xxxx            */
2398   {ACI,"PD,%b"    }, /* 53: 0110 0100 0101 0011 xxxx xxxx            */
2399   {illegal,0     }, /* 54: 0110 0100 0101 0100 xxxx xxxx            */
2400   {ACI,"PF,%b"    }, /* 55: 0110 0100 0101 0101 xxxx xxxx            */
2401   {ACI,"MKH,%b"   }, /* 56: 0110 0100 0101 0110 xxxx xxxx            */
2402   {ACI,"MKL,%b"   }, /* 57: 0110 0100 0101 0111 xxxx xxxx            */
2403   {OFFI,"PA,%b"   }, /* 58: 0110 0100 0101 1000 xxxx xxxx            */
2404   {OFFI,"PB,%b"   }, /* 59: 0110 0100 0101 1001 xxxx xxxx            */
2405   {OFFI,"PC,%b"   }, /* 5a: 0110 0100 0101 1010 xxxx xxxx            */
2406   {OFFI,"PD,%b"   }, /* 5b: 0110 0100 0101 1011 xxxx xxxx            */
2407   {illegal,0     }, /* 5c: 0110 0100 0101 1100 xxxx xxxx            */
2408   {OFFI,"PF,%b"   }, /* 5d: 0110 0100 0101 1101 xxxx xxxx            */
2409   {OFFI,"MKH,%b"  }, /* 5e: 0110 0100 0101 1110 xxxx xxxx            */
2410   {OFFI,"MKL,%b"  }, /* 5f: 0110 0100 0101 1111 xxxx xxxx            */
23992411
2400   {SUI,"PA,%b",    3,20}, /* 60: 0110 0100 0110 0000 xxxx xxxx            */
2401   {SUI,"PB,%b",    3,20}, /* 61: 0110 0100 0110 0001 xxxx xxxx            */
2402   {SUI,"PC,%b",    3,20}, /* 62: 0110 0100 0110 0010 xxxx xxxx            */
2403   {SUI,"PD,%b",    3,20}, /* 63: 0110 0100 0110 0011 xxxx xxxx            */
2404   {illegal,0,     3,20}, /* 64: 0110 0100 0110 0100 xxxx xxxx            */
2405   {SUI,"PF,%b",    3,20}, /* 65: 0110 0100 0110 0101 xxxx xxxx            */
2406   {SUI,"MKH,%b",   3,20}, /* 66: 0110 0100 0110 0110 xxxx xxxx            */
2407   {SUI,"MKL,%b",   3,20}, /* 67: 0110 0100 0110 0111 xxxx xxxx            */
2408   {NEI,"PA,%b",    3,20}, /* 68: 0110 0100 0110 1000 xxxx xxxx            */
2409   {NEI,"PB,%b",    3,20}, /* 69: 0110 0100 0110 1001 xxxx xxxx            */
2410   {NEI,"PC,%b",    3,20}, /* 6a: 0110 0100 0110 1010 xxxx xxxx            */
2411   {NEI,"PD,%b",    3,20}, /* 6b: 0110 0100 0110 1011 xxxx xxxx            */
2412   {illegal,0,     3,20}, /* 6c: 0110 0100 0110 1100 xxxx xxxx            */
2413   {NEI,"PF,%b",    3,20}, /* 6d: 0110 0100 0110 1101 xxxx xxxx            */
2414   {NEI,"MKH,%b",   3,20}, /* 6e: 0110 0100 0110 1110 xxxx xxxx            */
2415   {NEI,"MKL,%b",   3,20}, /* 6f: 0110 0100 0110 1111 xxxx xxxx            */
2412   {SUI,"PA,%b"    }, /* 60: 0110 0100 0110 0000 xxxx xxxx            */
2413   {SUI,"PB,%b"    }, /* 61: 0110 0100 0110 0001 xxxx xxxx            */
2414   {SUI,"PC,%b"    }, /* 62: 0110 0100 0110 0010 xxxx xxxx            */
2415   {SUI,"PD,%b"    }, /* 63: 0110 0100 0110 0011 xxxx xxxx            */
2416   {illegal,0     }, /* 64: 0110 0100 0110 0100 xxxx xxxx            */
2417   {SUI,"PF,%b"    }, /* 65: 0110 0100 0110 0101 xxxx xxxx            */
2418   {SUI,"MKH,%b"   }, /* 66: 0110 0100 0110 0110 xxxx xxxx            */
2419   {SUI,"MKL,%b"   }, /* 67: 0110 0100 0110 0111 xxxx xxxx            */
2420   {NEI,"PA,%b"    }, /* 68: 0110 0100 0110 1000 xxxx xxxx            */
2421   {NEI,"PB,%b"    }, /* 69: 0110 0100 0110 1001 xxxx xxxx            */
2422   {NEI,"PC,%b"    }, /* 6a: 0110 0100 0110 1010 xxxx xxxx            */
2423   {NEI,"PD,%b"    }, /* 6b: 0110 0100 0110 1011 xxxx xxxx            */
2424   {illegal,0     }, /* 6c: 0110 0100 0110 1100 xxxx xxxx            */
2425   {NEI,"PF,%b"    }, /* 6d: 0110 0100 0110 1101 xxxx xxxx            */
2426   {NEI,"MKH,%b"   }, /* 6e: 0110 0100 0110 1110 xxxx xxxx            */
2427   {NEI,"MKL,%b"   }, /* 6f: 0110 0100 0110 1111 xxxx xxxx            */
24162428
2417   {SBI,"PA,%b",    3,20}, /* 70: 0110 0100 0111 0000 xxxx xxxx            */
2418   {SBI,"PB,%b",    3,20}, /* 71: 0110 0100 0111 0001 xxxx xxxx            */
2419   {SBI,"PC,%b",    3,20}, /* 72: 0110 0100 0111 0010 xxxx xxxx            */
2420   {SBI,"PD,%b",    3,20}, /* 73: 0110 0100 0111 0011 xxxx xxxx            */
2421   {illegal,0,     3,20}, /* 74: 0110 0100 0111 0100 xxxx xxxx            */
2422   {SBI,"PF,%b",    3,20}, /* 75: 0110 0100 0111 0101 xxxx xxxx            */
2423   {SBI,"MKH,%b",   3,20}, /* 76: 0110 0100 0111 0110 xxxx xxxx            */
2424   {SBI,"MKL,%b",   3,20}, /* 77: 0110 0100 0111 0111 xxxx xxxx            */
2425   {EQI,"PA,%b",    3,20}, /* 78: 0110 0100 0111 1000 xxxx xxxx            */
2426   {EQI,"PB,%b",    3,20}, /* 79: 0110 0100 0111 1001 xxxx xxxx            */
2427   {EQI,"PC,%b",    3,20}, /* 7a: 0110 0100 0111 1010 xxxx xxxx            */
2428   {EQI,"PD,%b",    3,20}, /* 7b: 0110 0100 0111 1011 xxxx xxxx            */
2429   {illegal,0,     3,20}, /* 7c: 0110 0100 0111 1100 xxxx xxxx            */
2430   {EQI,"PF,%b",    3,20}, /* 7d: 0110 0100 0111 1101 xxxx xxxx            */
2431   {EQI,"MKH,%b",   3,20}, /* 7e: 0110 0100 0111 1110 xxxx xxxx            */
2432   {EQI,"MKL,%b",   3,20}, /* 7f: 0110 0100 0111 1111 xxxx xxxx            */
2429   {SBI,"PA,%b"    }, /* 70: 0110 0100 0111 0000 xxxx xxxx            */
2430   {SBI,"PB,%b"    }, /* 71: 0110 0100 0111 0001 xxxx xxxx            */
2431   {SBI,"PC,%b"    }, /* 72: 0110 0100 0111 0010 xxxx xxxx            */
2432   {SBI,"PD,%b"    }, /* 73: 0110 0100 0111 0011 xxxx xxxx            */
2433   {illegal,0     }, /* 74: 0110 0100 0111 0100 xxxx xxxx            */
2434   {SBI,"PF,%b"    }, /* 75: 0110 0100 0111 0101 xxxx xxxx            */
2435   {SBI,"MKH,%b"   }, /* 76: 0110 0100 0111 0110 xxxx xxxx            */
2436   {SBI,"MKL,%b"   }, /* 77: 0110 0100 0111 0111 xxxx xxxx            */
2437   {EQI,"PA,%b"    }, /* 78: 0110 0100 0111 1000 xxxx xxxx            */
2438   {EQI,"PB,%b"    }, /* 79: 0110 0100 0111 1001 xxxx xxxx            */
2439   {EQI,"PC,%b"    }, /* 7a: 0110 0100 0111 1010 xxxx xxxx            */
2440   {EQI,"PD,%b"    }, /* 7b: 0110 0100 0111 1011 xxxx xxxx            */
2441   {illegal,0     }, /* 7c: 0110 0100 0111 1100 xxxx xxxx            */
2442   {EQI,"PF,%b"    }, /* 7d: 0110 0100 0111 1101 xxxx xxxx            */
2443   {EQI,"MKH,%b"   }, /* 7e: 0110 0100 0111 1110 xxxx xxxx            */
2444   {EQI,"MKL,%b"   }, /* 7f: 0110 0100 0111 1111 xxxx xxxx            */
24332445
2434   {MVI,"ANM,%b",   3,14}, /* 80: 0110 0100 1000 0000 xxxx xxxx            */   /* 7810 */
2435   {MVI,"SMH,%b",   3,14}, /* 81: 0110 0100 1000 0001 xxxx xxxx            */
2436   {illegal,0,     3,14}, /* 82: 0110 0100 1000 0010 xxxx xxxx            */
2437   {MVI,"EOM,%b",   3,14}, /* 83: 0110 0100 1000 0011 xxxx xxxx            */
2438   {illegal,0,     3,14}, /* 84: 0110 0100 1000 0100 xxxx xxxx            */
2439   {MVI,"TMM,%b",   3,14}, /* 85: 0110 0100 1000 0101 xxxx xxxx            */
2440   {illegal,0,     3,14}, /* 86: 0110 0100 1000 0110 xxxx xxxx            */
2441   {illegal,0,     3,14}, /* 87: 0110 0100 1000 0111 xxxx xxxx            */
2442   {ANI,"ANM,%b",   3,20}, /* 88: 0110 0100 1000 1000 xxxx xxxx            */   /* 7810 */
2443   {ANI,"SMH,%b",   3,20}, /* 89: 0110 0100 1000 1001 xxxx xxxx            */
2444   {illegal,0,     3,20}, /* 8a: 0110 0100 1000 1010 xxxx xxxx            */
2445   {ANI,"EOM,%b",   3,20}, /* 8b: 0110 0100 1000 1011 xxxx xxxx            */
2446   {illegal,0,     3,20}, /* 8c: 0110 0100 1000 1100 xxxx xxxx            */
2447   {ANI,"TMM,%b",   3,20}, /* 8d: 0110 0100 1000 1101 xxxx xxxx            */
2448   {illegal,0,     3,20}, /* 8e: 0110 0100 1000 1110 xxxx xxxx            */
2449   {illegal,0,     3,20}, /* 8f: 0110 0100 1000 1111 xxxx xxxx            */
2446   {MVI,"ANM,%b"   }, /* 80: 0110 0100 1000 0000 xxxx xxxx            */   /* 7810 */
2447   {MVI,"SMH,%b"   }, /* 81: 0110 0100 1000 0001 xxxx xxxx            */
2448   {illegal,0     }, /* 82: 0110 0100 1000 0010 xxxx xxxx            */
2449   {MVI,"EOM,%b"   }, /* 83: 0110 0100 1000 0011 xxxx xxxx            */
2450   {illegal,0     }, /* 84: 0110 0100 1000 0100 xxxx xxxx            */
2451   {MVI,"TMM,%b"   }, /* 85: 0110 0100 1000 0101 xxxx xxxx            */
2452   {illegal,0     }, /* 86: 0110 0100 1000 0110 xxxx xxxx            */
2453   {illegal,0     }, /* 87: 0110 0100 1000 0111 xxxx xxxx            */
2454   {ANI,"ANM,%b"   }, /* 88: 0110 0100 1000 1000 xxxx xxxx            */   /* 7810 */
2455   {ANI,"SMH,%b"   }, /* 89: 0110 0100 1000 1001 xxxx xxxx            */
2456   {illegal,0     }, /* 8a: 0110 0100 1000 1010 xxxx xxxx            */
2457   {ANI,"EOM,%b"   }, /* 8b: 0110 0100 1000 1011 xxxx xxxx            */
2458   {illegal,0     }, /* 8c: 0110 0100 1000 1100 xxxx xxxx            */
2459   {ANI,"TMM,%b"   }, /* 8d: 0110 0100 1000 1101 xxxx xxxx            */
2460   {illegal,0     }, /* 8e: 0110 0100 1000 1110 xxxx xxxx            */
2461   {illegal,0     }, /* 8f: 0110 0100 1000 1111 xxxx xxxx            */
24502462
2451   {XRI,"ANM,%b",   3,20}, /* 90: 0110 0100 1001 0000 xxxx xxxx            */   /* 7810 */
2452   {XRI,"SMH,%b",   3,20}, /* 91: 0110 0100 1001 0001 xxxx xxxx            */
2453   {illegal,0,     3,20}, /* 92: 0110 0100 1001 0010 xxxx xxxx            */
2454   {XRI,"EOM,%b",   3,20}, /* 93: 0110 0100 1001 0011 xxxx xxxx            */
2455   {illegal,0,     3,20}, /* 94: 0110 0100 1001 0100 xxxx xxxx            */
2456   {XRI,"TMM,%b",   3,20}, /* 95: 0110 0100 1001 0101 xxxx xxxx            */
2457   {illegal,0,     3,20}, /* 96: 0110 0100 1001 0110 xxxx xxxx            */
2458   {illegal,0,     3,20}, /* 97: 0110 0100 1001 0111 xxxx xxxx            */
2459   {ORI,"ANM,%b",   3,20}, /* 98: 0110 0100 1001 1000 xxxx xxxx            */   /* 7810 */
2460   {ORI,"SMH,%b",   3,20}, /* 99: 0110 0100 1001 1001 xxxx xxxx            */
2461   {illegal,0,     3,20}, /* 9a: 0110 0100 1001 1010 xxxx xxxx            */
2462   {ORI,"EOM,%b",   3,20}, /* 9b: 0110 0100 1001 1011 xxxx xxxx            */
2463   {illegal,0,     3,20}, /* 9c: 0110 0100 1001 1100 xxxx xxxx            */
2464   {ORI,"TMM,%b",   3,20}, /* 9d: 0110 0100 1001 1101 xxxx xxxx            */
2465   {illegal,0,     3,20}, /* 9e: 0110 0100 1001 1110 xxxx xxxx            */
2466   {illegal,0,     3,20}, /* 9f: 0110 0100 1001 1111 xxxx xxxx            */
2463   {XRI,"ANM,%b"   }, /* 90: 0110 0100 1001 0000 xxxx xxxx            */   /* 7810 */
2464   {XRI,"SMH,%b"   }, /* 91: 0110 0100 1001 0001 xxxx xxxx            */
2465   {illegal,0     }, /* 92: 0110 0100 1001 0010 xxxx xxxx            */
2466   {XRI,"EOM,%b"   }, /* 93: 0110 0100 1001 0011 xxxx xxxx            */
2467   {illegal,0     }, /* 94: 0110 0100 1001 0100 xxxx xxxx            */
2468   {XRI,"TMM,%b"   }, /* 95: 0110 0100 1001 0101 xxxx xxxx            */
2469   {illegal,0     }, /* 96: 0110 0100 1001 0110 xxxx xxxx            */
2470   {illegal,0     }, /* 97: 0110 0100 1001 0111 xxxx xxxx            */
2471   {ORI,"ANM,%b"   }, /* 98: 0110 0100 1001 1000 xxxx xxxx            */   /* 7810 */
2472   {ORI,"SMH,%b"   }, /* 99: 0110 0100 1001 1001 xxxx xxxx            */
2473   {illegal,0     }, /* 9a: 0110 0100 1001 1010 xxxx xxxx            */
2474   {ORI,"EOM,%b"   }, /* 9b: 0110 0100 1001 1011 xxxx xxxx            */
2475   {illegal,0     }, /* 9c: 0110 0100 1001 1100 xxxx xxxx            */
2476   {ORI,"TMM,%b"   }, /* 9d: 0110 0100 1001 1101 xxxx xxxx            */
2477   {illegal,0     }, /* 9e: 0110 0100 1001 1110 xxxx xxxx            */
2478   {illegal,0     }, /* 9f: 0110 0100 1001 1111 xxxx xxxx            */
24672479
2468   {ADINC,"ANM,%b", 3,20}, /* a0: 0110 0100 1010 0000 xxxx xxxx            */   /* 7810 */
2469   {ADINC,"SMH,%b", 3,20}, /* a1: 0110 0100 1010 0001 xxxx xxxx            */
2470   {illegal,0,     3,20}, /* a2: 0110 0100 1010 0010 xxxx xxxx            */
2471   {ADINC,"EOM,%b", 3,20}, /* a3: 0110 0100 1010 0011 xxxx xxxx            */
2472   {illegal,0,     3,20}, /* a4: 0110 0100 1010 0100 xxxx xxxx            */
2473   {ADINC,"TMM,%b", 3,20}, /* a5: 0110 0100 1010 0101 xxxx xxxx            */
2474   {illegal,0,     3,20}, /* a6: 0110 0100 1010 0110 xxxx xxxx            */
2475   {illegal,0,     3,20}, /* a7: 0110 0100 1010 0111 xxxx xxxx            */
2476   {GTI,"ANM,%b",   3,20}, /* a8: 0110 0100 1010 1000 xxxx xxxx            */   /* 7810 */
2477   {GTI,"SMH,%b",   3,20}, /* a9: 0110 0100 1010 1001 xxxx xxxx            */
2478   {illegal,0,     3,20}, /* aa: 0110 0100 1010 1010 xxxx xxxx            */
2479   {GTI,"EOM,%b",   3,20}, /* ab: 0110 0100 1010 1011 xxxx xxxx            */
2480   {illegal,0,     3,20}, /* ac: 0110 0100 1010 1100 xxxx xxxx            */
2481   {GTI,"TMM,%b",   3,20}, /* ad: 0110 0100 1010 1101 xxxx xxxx            */
2482   {illegal,0,     3,20}, /* ae: 0110 0100 1010 1110 xxxx xxxx            */
2483   {illegal,0,     3,20}, /* af: 0110 0100 1010 1111 xxxx xxxx            */
2480   {ADINC,"ANM,%b" }, /* a0: 0110 0100 1010 0000 xxxx xxxx            */   /* 7810 */
2481   {ADINC,"SMH,%b" }, /* a1: 0110 0100 1010 0001 xxxx xxxx            */
2482   {illegal,0     }, /* a2: 0110 0100 1010 0010 xxxx xxxx            */
2483   {ADINC,"EOM,%b" }, /* a3: 0110 0100 1010 0011 xxxx xxxx            */
2484   {illegal,0     }, /* a4: 0110 0100 1010 0100 xxxx xxxx            */
2485   {ADINC,"TMM,%b" }, /* a5: 0110 0100 1010 0101 xxxx xxxx            */
2486   {illegal,0     }, /* a6: 0110 0100 1010 0110 xxxx xxxx            */
2487   {illegal,0     }, /* a7: 0110 0100 1010 0111 xxxx xxxx            */
2488   {GTI,"ANM,%b"   }, /* a8: 0110 0100 1010 1000 xxxx xxxx            */   /* 7810 */
2489   {GTI,"SMH,%b"   }, /* a9: 0110 0100 1010 1001 xxxx xxxx            */
2490   {illegal,0     }, /* aa: 0110 0100 1010 1010 xxxx xxxx            */
2491   {GTI,"EOM,%b"   }, /* ab: 0110 0100 1010 1011 xxxx xxxx            */
2492   {illegal,0     }, /* ac: 0110 0100 1010 1100 xxxx xxxx            */
2493   {GTI,"TMM,%b"   }, /* ad: 0110 0100 1010 1101 xxxx xxxx            */
2494   {illegal,0     }, /* ae: 0110 0100 1010 1110 xxxx xxxx            */
2495   {illegal,0     }, /* af: 0110 0100 1010 1111 xxxx xxxx            */
24842496
2485   {SUINB,"ANM,%b", 3,20}, /* b0: 0110 0100 1011 0000 xxxx xxxx            */   /* 7810 */
2486   {SUINB,"SMH,%b", 3,20}, /* b1: 0110 0100 1011 0001 xxxx xxxx            */
2487   {illegal,0,     3,20}, /* b2: 0110 0100 1011 0010 xxxx xxxx            */
2488   {SUINB,"EOM,%b", 3,20}, /* b3: 0110 0100 1011 0011 xxxx xxxx            */
2489   {illegal,0,     3,20}, /* b4: 0110 0100 1011 0100 xxxx xxxx            */
2490   {SUINB,"TMM,%b", 3,20}, /* b5: 0110 0100 1011 0101 xxxx xxxx            */
2491   {illegal,0,     3,20}, /* b6: 0110 0100 1011 0110 xxxx xxxx            */
2492   {illegal,0,     3,20}, /* b7: 0110 0100 1011 0111 xxxx xxxx            */
2493   {LTI,"ANM,%b",   3,20}, /* b8: 0110 0100 1011 1000 xxxx xxxx            */   /* 7810 */
2494   {LTI,"SMH,%b",   3,20}, /* b9: 0110 0100 1011 1001 xxxx xxxx            */
2495   {illegal,0,     3,20}, /* ba: 0110 0100 1011 1010 xxxx xxxx            */
2496   {LTI,"EOM,%b",   3,20}, /* bb: 0110 0100 1011 1011 xxxx xxxx            */
2497   {illegal,0,     3,20}, /* bc: 0110 0100 1011 1100 xxxx xxxx            */
2498   {LTI,"TMM,%b",   3,20}, /* bd: 0110 0100 1011 1101 xxxx xxxx            */
2499   {illegal,0,     3,20}, /* be: 0110 0100 1011 1110 xxxx xxxx            */
2500   {illegal,0,     3,20}, /* bf: 0110 0100 1011 1111 xxxx xxxx            */
2497   {SUINB,"ANM,%b" }, /* b0: 0110 0100 1011 0000 xxxx xxxx            */   /* 7810 */
2498   {SUINB,"SMH,%b" }, /* b1: 0110 0100 1011 0001 xxxx xxxx            */
2499   {illegal,0     }, /* b2: 0110 0100 1011 0010 xxxx xxxx            */
2500   {SUINB,"EOM,%b" }, /* b3: 0110 0100 1011 0011 xxxx xxxx            */
2501   {illegal,0     }, /* b4: 0110 0100 1011 0100 xxxx xxxx            */
2502   {SUINB,"TMM,%b" }, /* b5: 0110 0100 1011 0101 xxxx xxxx            */
2503   {illegal,0     }, /* b6: 0110 0100 1011 0110 xxxx xxxx            */
2504   {illegal,0     }, /* b7: 0110 0100 1011 0111 xxxx xxxx            */
2505   {LTI,"ANM,%b"   }, /* b8: 0110 0100 1011 1000 xxxx xxxx            */   /* 7810 */
2506   {LTI,"SMH,%b"   }, /* b9: 0110 0100 1011 1001 xxxx xxxx            */
2507   {illegal,0     }, /* ba: 0110 0100 1011 1010 xxxx xxxx            */
2508   {LTI,"EOM,%b"   }, /* bb: 0110 0100 1011 1011 xxxx xxxx            */
2509   {illegal,0     }, /* bc: 0110 0100 1011 1100 xxxx xxxx            */
2510   {LTI,"TMM,%b"   }, /* bd: 0110 0100 1011 1101 xxxx xxxx            */
2511   {illegal,0     }, /* be: 0110 0100 1011 1110 xxxx xxxx            */
2512   {illegal,0     }, /* bf: 0110 0100 1011 1111 xxxx xxxx            */
25012513
2502   {ADI,"ANM,%b",   3,20}, /* c0: 0110 0100 1100 0000 xxxx xxxx            */   /* 7810 */
2503   {ADI,"SMH,%b",   3,20}, /* c1: 0110 0100 1100 0001 xxxx xxxx            */
2504   {illegal,0,     3,20}, /* c2: 0110 0100 1100 0010 xxxx xxxx            */
2505   {ADI,"EOM,%b",   3,20}, /* c3: 0110 0100 1100 0011 xxxx xxxx            */
2506   {illegal,0,     3,20}, /* c4: 0110 0100 1100 0100 xxxx xxxx            */
2507   {ADI,"TMM,%b",   3,20}, /* c5: 0110 0100 1100 0101 xxxx xxxx            */
2508   {illegal,0,     3,20}, /* c6: 0110 0100 1100 0110 xxxx xxxx            */
2509   {illegal,0,     3,20}, /* c7: 0110 0100 1100 0111 xxxx xxxx            */
2510   {ONI,"ANM,%b",   3,20}, /* c8: 0110 0100 1100 1000 xxxx xxxx            */   /* 7810 */
2511   {ONI,"SMH,%b",   3,20}, /* c9: 0110 0100 1100 1001 xxxx xxxx            */
2512   {illegal,0,     3,20}, /* ca: 0110 0100 1100 1010 xxxx xxxx            */
2513   {ONI,"EOM,%b",   3,20}, /* cb: 0110 0100 1100 1011 xxxx xxxx            */
2514   {illegal,0,     3,20}, /* cc: 0110 0100 1100 1100 xxxx xxxx            */
2515   {ONI,"TMM,%b",   3,20}, /* cd: 0110 0100 1100 1101 xxxx xxxx            */
2516   {illegal,0,     3,20}, /* ce: 0110 0100 1100 1110 xxxx xxxx            */
2517   {illegal,0,     3,20}, /* cf: 0110 0100 1100 1111 xxxx xxxx            */
2514   {ADI,"ANM,%b"   }, /* c0: 0110 0100 1100 0000 xxxx xxxx            */   /* 7810 */
2515   {ADI,"SMH,%b"   }, /* c1: 0110 0100 1100 0001 xxxx xxxx            */
2516   {illegal,0     }, /* c2: 0110 0100 1100 0010 xxxx xxxx            */
2517   {ADI,"EOM,%b"   }, /* c3: 0110 0100 1100 0011 xxxx xxxx            */
2518   {illegal,0     }, /* c4: 0110 0100 1100 0100 xxxx xxxx            */
2519   {ADI,"TMM,%b"   }, /* c5: 0110 0100 1100 0101 xxxx xxxx            */
2520   {illegal,0     }, /* c6: 0110 0100 1100 0110 xxxx xxxx            */
2521   {illegal,0     }, /* c7: 0110 0100 1100 0111 xxxx xxxx            */
2522   {ONI,"ANM,%b"   }, /* c8: 0110 0100 1100 1000 xxxx xxxx            */   /* 7810 */
2523   {ONI,"SMH,%b"   }, /* c9: 0110 0100 1100 1001 xxxx xxxx            */
2524   {illegal,0     }, /* ca: 0110 0100 1100 1010 xxxx xxxx            */
2525   {ONI,"EOM,%b"   }, /* cb: 0110 0100 1100 1011 xxxx xxxx            */
2526   {illegal,0     }, /* cc: 0110 0100 1100 1100 xxxx xxxx            */
2527   {ONI,"TMM,%b"   }, /* cd: 0110 0100 1100 1101 xxxx xxxx            */
2528   {illegal,0     }, /* ce: 0110 0100 1100 1110 xxxx xxxx            */
2529   {illegal,0     }, /* cf: 0110 0100 1100 1111 xxxx xxxx            */
25182530
2519   {ACI,"ANM,%b",   3,20}, /* d0: 0110 0100 1101 0000 xxxx xxxx            */   /* 7810 */
2520   {ACI,"SMH,%b",   3,20}, /* d1: 0110 0100 1101 0001 xxxx xxxx            */
2521   {illegal,0,     3,20}, /* d2: 0110 0100 1101 0010 xxxx xxxx            */
2522   {ACI,"EOM,%b",   3,20}, /* d3: 0110 0100 1101 0011 xxxx xxxx            */
2523   {illegal,0,     3,20}, /* d4: 0110 0100 1101 0100 xxxx xxxx            */
2524   {ACI,"TMM,%b",   3,20}, /* d5: 0110 0100 1101 0101 xxxx xxxx            */
2525   {illegal,0,     3,20}, /* d6: 0110 0100 1101 0110 xxxx xxxx            */
2526   {illegal,0,     3,20}, /* d7: 0110 0100 1101 0111 xxxx xxxx            */
2527   {OFFI,"ANM,%b",  3,20}, /* d8: 0110 0100 1101 1000 xxxx xxxx            */   /* 7810 */
2528   {OFFI,"SMH,%b",  3,20}, /* d9: 0110 0100 1101 1001 xxxx xxxx            */
2529   {illegal,0,     3,20}, /* da: 0110 0100 1101 1010 xxxx xxxx            */
2530   {OFFI,"EOM,%b",  3,20}, /* db: 0110 0100 1101 1011 xxxx xxxx            */
2531   {illegal,0,     3,20}, /* dc: 0110 0100 1101 1100 xxxx xxxx            */
2532   {OFFI,"TMM,%b",  3,20}, /* dd: 0110 0100 1101 1101 xxxx xxxx            */
2533   {illegal,0,     3,20}, /* de: 0110 0100 1101 1110 xxxx xxxx            */
2534   {illegal,0,     3,20}, /* df: 0110 0100 1101 1111 xxxx xxxx            */
2531   {ACI,"ANM,%b"   }, /* d0: 0110 0100 1101 0000 xxxx xxxx            */   /* 7810 */
2532   {ACI,"SMH,%b"   }, /* d1: 0110 0100 1101 0001 xxxx xxxx            */
2533   {illegal,0     }, /* d2: 0110 0100 1101 0010 xxxx xxxx            */
2534   {ACI,"EOM,%b"   }, /* d3: 0110 0100 1101 0011 xxxx xxxx            */
2535   {illegal,0     }, /* d4: 0110 0100 1101 0100 xxxx xxxx            */
2536   {ACI,"TMM,%b"   }, /* d5: 0110 0100 1101 0101 xxxx xxxx            */
2537   {illegal,0     }, /* d6: 0110 0100 1101 0110 xxxx xxxx            */
2538   {illegal,0     }, /* d7: 0110 0100 1101 0111 xxxx xxxx            */
2539   {OFFI,"ANM,%b"  }, /* d8: 0110 0100 1101 1000 xxxx xxxx            */   /* 7810 */
2540   {OFFI,"SMH,%b"  }, /* d9: 0110 0100 1101 1001 xxxx xxxx            */
2541   {illegal,0     }, /* da: 0110 0100 1101 1010 xxxx xxxx            */
2542   {OFFI,"EOM,%b"  }, /* db: 0110 0100 1101 1011 xxxx xxxx            */
2543   {illegal,0     }, /* dc: 0110 0100 1101 1100 xxxx xxxx            */
2544   {OFFI,"TMM,%b"  }, /* dd: 0110 0100 1101 1101 xxxx xxxx            */
2545   {illegal,0     }, /* de: 0110 0100 1101 1110 xxxx xxxx            */
2546   {illegal,0     }, /* df: 0110 0100 1101 1111 xxxx xxxx            */
25352547
2536   {SUI,"ANM,%b",   3,20}, /* e0: 0110 0100 1110 0000 xxxx xxxx            */   /* 7810 */
2537   {SUI,"SMH,%b",   3,20}, /* e1: 0110 0100 1110 0001 xxxx xxxx            */
2538   {illegal,0,     3,20}, /* e2: 0110 0100 1110 0010 xxxx xxxx            */
2539   {SUI,"EOM,%b",   3,20}, /* e3: 0110 0100 1110 0011 xxxx xxxx            */
2540   {illegal,0,     3,20}, /* e4: 0110 0100 1110 0100 xxxx xxxx            */
2541   {SUI,"TMM,%b",   3,20}, /* e5: 0110 0100 1110 0101 xxxx xxxx            */
2542   {illegal,0,     3,20}, /* e6: 0110 0100 1110 0110 xxxx xxxx            */
2543   {illegal,0,     3,20}, /* e7: 0110 0100 1110 0111 xxxx xxxx            */
2544   {NEI,"ANM,%b",   3,20}, /* e8: 0110 0100 1110 1000 xxxx xxxx            */   /* 7810 */
2545   {NEI,"SMH,%b",   3,20}, /* e9: 0110 0100 1110 1001 xxxx xxxx            */
2546   {illegal,0,     3,20}, /* ea: 0110 0100 1110 1010 xxxx xxxx            */
2547   {NEI,"EOM,%b",   3,20}, /* eb: 0110 0100 1110 1011 xxxx xxxx            */
2548   {illegal,0,     3,20}, /* ec: 0110 0100 1110 1100 xxxx xxxx            */
2549   {NEI,"TMM,%b",   3,20}, /* ed: 0110 0100 1110 1101 xxxx xxxx            */
2550   {illegal,0,     3,20}, /* ee: 0110 0100 1110 1110 xxxx xxxx            */
2551   {illegal,0,     3,20}, /* ef: 0110 0100 1110 1111 xxxx xxxx            */
2548   {SUI,"ANM,%b"   }, /* e0: 0110 0100 1110 0000 xxxx xxxx            */   /* 7810 */
2549   {SUI,"SMH,%b"   }, /* e1: 0110 0100 1110 0001 xxxx xxxx            */
2550   {illegal,0     }, /* e2: 0110 0100 1110 0010 xxxx xxxx            */
2551   {SUI,"EOM,%b"   }, /* e3: 0110 0100 1110 0011 xxxx xxxx            */
2552   {illegal,0     }, /* e4: 0110 0100 1110 0100 xxxx xxxx            */
2553   {SUI,"TMM,%b"   }, /* e5: 0110 0100 1110 0101 xxxx xxxx            */
2554   {illegal,0     }, /* e6: 0110 0100 1110 0110 xxxx xxxx            */
2555   {illegal,0     }, /* e7: 0110 0100 1110 0111 xxxx xxxx            */
2556   {NEI,"ANM,%b"   }, /* e8: 0110 0100 1110 1000 xxxx xxxx            */   /* 7810 */
2557   {NEI,"SMH,%b"   }, /* e9: 0110 0100 1110 1001 xxxx xxxx            */
2558   {illegal,0     }, /* ea: 0110 0100 1110 1010 xxxx xxxx            */
2559   {NEI,"EOM,%b"   }, /* eb: 0110 0100 1110 1011 xxxx xxxx            */
2560   {illegal,0     }, /* ec: 0110 0100 1110 1100 xxxx xxxx            */
2561   {NEI,"TMM,%b"   }, /* ed: 0110 0100 1110 1101 xxxx xxxx            */
2562   {illegal,0     }, /* ee: 0110 0100 1110 1110 xxxx xxxx            */
2563   {illegal,0     }, /* ef: 0110 0100 1110 1111 xxxx xxxx            */
25522564
2553   {SBI,"ANM,%b",   3,20}, /* f0: 0110 0100 1111 0000 xxxx xxxx            */   /* 7810 */
2554   {SBI,"SMH,%b",   3,20}, /* f1: 0110 0100 1111 0001 xxxx xxxx            */
2555   {illegal,0,     3,20}, /* f2: 0110 0100 1111 0010 xxxx xxxx            */
2556   {SBI,"EOM,%b",   3,20}, /* f3: 0110 0100 1111 0011 xxxx xxxx            */
2557   {illegal,0,     3,20}, /* f4: 0110 0100 1111 0100 xxxx xxxx            */
2558   {SBI,"TMM,%b",   3,20}, /* f5: 0110 0100 1111 0101 xxxx xxxx            */
2559   {illegal,0,     3,20}, /* f6: 0110 0100 1111 0110 xxxx xxxx            */
2560   {illegal,0,     3,20}, /* f7: 0110 0100 1111 0111 xxxx xxxx            */
2561   {EQI,"ANM,%b",   3,20}, /* f8: 0110 0100 1111 1000 xxxx xxxx            */   /* 7810 */
2562   {EQI,"SMH,%b",   3,20}, /* f9: 0110 0100 1111 1001 xxxx xxxx            */
2563   {illegal,0,     3,20}, /* fa: 0110 0100 1111 1010 xxxx xxxx            */
2564   {EQI,"EOM,%b",   3,20}, /* fb: 0110 0100 1111 1011 xxxx xxxx            */
2565   {illegal,0,     3,20}, /* fc: 0110 0100 1111 1100 xxxx xxxx            */
2566   {EQI,"TMM,%b",   3,20}, /* fd: 0110 0100 1111 1101 xxxx xxxx            */
2567   {illegal,0,     3,20}, /* fe: 0110 0100 1111 1110 xxxx xxxx            */
2568   {illegal,0,     3,20}   /* ff: 0110 0100 1111 1111 xxxx xxxx            */
2565   {SBI,"ANM,%b"   }, /* f0: 0110 0100 1111 0000 xxxx xxxx            */   /* 7810 */
2566   {SBI,"SMH,%b"   }, /* f1: 0110 0100 1111 0001 xxxx xxxx            */
2567   {illegal,0     }, /* f2: 0110 0100 1111 0010 xxxx xxxx            */
2568   {SBI,"EOM,%b"   }, /* f3: 0110 0100 1111 0011 xxxx xxxx            */
2569   {illegal,0     }, /* f4: 0110 0100 1111 0100 xxxx xxxx            */
2570   {SBI,"TMM,%b"   }, /* f5: 0110 0100 1111 0101 xxxx xxxx            */
2571   {illegal,0     }, /* f6: 0110 0100 1111 0110 xxxx xxxx            */
2572   {illegal,0     }, /* f7: 0110 0100 1111 0111 xxxx xxxx            */
2573   {EQI,"ANM,%b"   }, /* f8: 0110 0100 1111 1000 xxxx xxxx            */   /* 7810 */
2574   {EQI,"SMH,%b"   }, /* f9: 0110 0100 1111 1001 xxxx xxxx            */
2575   {illegal,0     }, /* fa: 0110 0100 1111 1010 xxxx xxxx            */
2576   {EQI,"EOM,%b"   }, /* fb: 0110 0100 1111 1011 xxxx xxxx            */
2577   {illegal,0     }, /* fc: 0110 0100 1111 1100 xxxx xxxx            */
2578   {EQI,"TMM,%b"   }, /* fd: 0110 0100 1111 1101 xxxx xxxx            */
2579   {illegal,0     }, /* fe: 0110 0100 1111 1110 xxxx xxxx            */
2580   {illegal,0     }   /* ff: 0110 0100 1111 1111 xxxx xxxx            */
25692581};
25702582
25712583static const struct dasm_s  dasm64_7807[256] =
25722584{
2573   {MVI,"PA,%b",    3,14}, /* 00: 0110 0100 0000 0000 xxxx xxxx            */
2574   {MVI,"PB,%b",    3,14}, /* 01: 0110 0100 0000 0001 xxxx xxxx            */
2575   {MVI,"PC,%b",    3,14}, /* 02: 0110 0100 0000 0010 xxxx xxxx            */
2576   {MVI,"PD,%b",    3,14}, /* 03: 0110 0100 0000 0011 xxxx xxxx            */
2577   {illegal,0,     3,14}, /* 04: 0110 0100 0000 0100 xxxx xxxx            */
2578   {MVI,"PF,%b",    3,14}, /* 05: 0110 0100 0000 0101 xxxx xxxx            */
2579   {MVI,"MKH,%b",   3,14}, /* 06: 0110 0100 0000 0110 xxxx xxxx            */
2580   {MVI,"MKL,%b",   3,14}, /* 07: 0110 0100 0000 0111 xxxx xxxx            */
2581   {ANI,"PA,%b",    3,20}, /* 08: 0110 0100 0000 1000 xxxx xxxx            */
2582   {ANI,"PB,%b",    3,20}, /* 09: 0110 0100 0000 1001 xxxx xxxx            */
2583   {ANI,"PC,%b",    3,20}, /* 0a: 0110 0100 0000 1010 xxxx xxxx            */
2584   {ANI,"PD,%b",    3,20}, /* 0b: 0110 0100 0000 1011 xxxx xxxx            */
2585   {illegal,0,     3,20}, /* 0c: 0110 0100 0000 1100 xxxx xxxx            */
2586   {ANI,"PF,%b",    3,20}, /* 0d: 0110 0100 0000 1101 xxxx xxxx            */
2587   {ANI,"MKH,%b",   3,20}, /* 0e: 0110 0100 0000 1110 xxxx xxxx            */
2588   {ANI,"MKL,%b",   3,20}, /* 0f: 0110 0100 0000 1111 xxxx xxxx            */
2585   {MVI,"PA,%b"    }, /* 00: 0110 0100 0000 0000 xxxx xxxx            */
2586   {MVI,"PB,%b"    }, /* 01: 0110 0100 0000 0001 xxxx xxxx            */
2587   {MVI,"PC,%b"    }, /* 02: 0110 0100 0000 0010 xxxx xxxx            */
2588   {MVI,"PD,%b"    }, /* 03: 0110 0100 0000 0011 xxxx xxxx            */
2589   {illegal,0     }, /* 04: 0110 0100 0000 0100 xxxx xxxx            */
2590   {MVI,"PF,%b"    }, /* 05: 0110 0100 0000 0101 xxxx xxxx            */
2591   {MVI,"MKH,%b"   }, /* 06: 0110 0100 0000 0110 xxxx xxxx            */
2592   {MVI,"MKL,%b"   }, /* 07: 0110 0100 0000 0111 xxxx xxxx            */
2593   {ANI,"PA,%b"    }, /* 08: 0110 0100 0000 1000 xxxx xxxx            */
2594   {ANI,"PB,%b"    }, /* 09: 0110 0100 0000 1001 xxxx xxxx            */
2595   {ANI,"PC,%b"    }, /* 0a: 0110 0100 0000 1010 xxxx xxxx            */
2596   {ANI,"PD,%b"    }, /* 0b: 0110 0100 0000 1011 xxxx xxxx            */
2597   {illegal,0     }, /* 0c: 0110 0100 0000 1100 xxxx xxxx            */
2598   {ANI,"PF,%b"    }, /* 0d: 0110 0100 0000 1101 xxxx xxxx            */
2599   {ANI,"MKH,%b"   }, /* 0e: 0110 0100 0000 1110 xxxx xxxx            */
2600   {ANI,"MKL,%b"   }, /* 0f: 0110 0100 0000 1111 xxxx xxxx            */
25892601
2590   {XRI,"PA,%b",    3,20}, /* 10: 0110 0100 0001 0000 xxxx xxxx            */
2591   {XRI,"PB,%b",    3,20}, /* 11: 0110 0100 0001 0001 xxxx xxxx            */
2592   {XRI,"PC,%b",    3,20}, /* 12: 0110 0100 0001 0010 xxxx xxxx            */
2593   {XRI,"PD,%b",    3,20}, /* 13: 0110 0100 0001 0011 xxxx xxxx            */
2594   {illegal,0,     3,20}, /* 14: 0110 0100 0001 0100 xxxx xxxx            */
2595   {XRI,"PF,%b",    3,20}, /* 15: 0110 0100 0001 0101 xxxx xxxx            */
2596   {XRI,"MKH,%b",   3,20}, /* 16: 0110 0100 0001 0110 xxxx xxxx            */
2597   {XRI,"MKL,%b",   3,20}, /* 17: 0110 0100 0001 0111 xxxx xxxx            */
2598   {ORI,"PA,%b",    3,20}, /* 18: 0110 0100 0001 1000 xxxx xxxx            */
2599   {ORI,"PB,%b",    3,20}, /* 19: 0110 0100 0001 1001 xxxx xxxx            */
2600   {ORI,"PC,%b",    3,20}, /* 1a: 0110 0100 0001 1010 xxxx xxxx            */
2601   {ORI,"PD,%b",    3,20}, /* 1b: 0110 0100 0001 1011 xxxx xxxx            */
2602   {illegal,0,     3,20}, /* 1c: 0110 0100 0001 1100 xxxx xxxx            */
2603   {ORI,"PF,%b",    3,20}, /* 1d: 0110 0100 0001 1101 xxxx xxxx            */
2604   {ORI,"MKH,%b",   3,20}, /* 1e: 0110 0100 0001 1110 xxxx xxxx            */
2605   {ORI,"MKL,%b",   3,20}, /* 1f: 0110 0100 0001 1111 xxxx xxxx            */
2602   {XRI,"PA,%b"    }, /* 10: 0110 0100 0001 0000 xxxx xxxx            */
2603   {XRI,"PB,%b"    }, /* 11: 0110 0100 0001 0001 xxxx xxxx            */
2604   {XRI,"PC,%b"    }, /* 12: 0110 0100 0001 0010 xxxx xxxx            */
2605   {XRI,"PD,%b"    }, /* 13: 0110 0100 0001 0011 xxxx xxxx            */
2606   {illegal,0     }, /* 14: 0110 0100 0001 0100 xxxx xxxx            */
2607   {XRI,"PF,%b"    }, /* 15: 0110 0100 0001 0101 xxxx xxxx            */
2608   {XRI,"MKH,%b"   }, /* 16: 0110 0100 0001 0110 xxxx xxxx            */
2609   {XRI,"MKL,%b"   }, /* 17: 0110 0100 0001 0111 xxxx xxxx            */
2610   {ORI,"PA,%b"    }, /* 18: 0110 0100 0001 1000 xxxx xxxx            */
2611   {ORI,"PB,%b"    }, /* 19: 0110 0100 0001 1001 xxxx xxxx            */
2612   {ORI,"PC,%b"    }, /* 1a: 0110 0100 0001 1010 xxxx xxxx            */
2613   {ORI,"PD,%b"    }, /* 1b: 0110 0100 0001 1011 xxxx xxxx            */
2614   {illegal,0     }, /* 1c: 0110 0100 0001 1100 xxxx xxxx            */
2615   {ORI,"PF,%b"    }, /* 1d: 0110 0100 0001 1101 xxxx xxxx            */
2616   {ORI,"MKH,%b"   }, /* 1e: 0110 0100 0001 1110 xxxx xxxx            */
2617   {ORI,"MKL,%b"   }, /* 1f: 0110 0100 0001 1111 xxxx xxxx            */
26062618
2607   {ADINC,"PA,%b",  3,20}, /* 20: 0110 0100 0010 0000 xxxx xxxx            */
2608   {ADINC,"PB,%b",  3,20}, /* 21: 0110 0100 0010 0001 xxxx xxxx            */
2609   {ADINC,"PC,%b",  3,20}, /* 22: 0110 0100 0010 0010 xxxx xxxx            */
2610   {ADINC,"PD,%b",  3,20}, /* 23: 0110 0100 0010 0011 xxxx xxxx            */
2611   {illegal,0,     3,20}, /* 24: 0110 0100 0010 0100 xxxx xxxx            */
2612   {ADINC,"PF,%b",  3,20}, /* 25: 0110 0100 0010 0101 xxxx xxxx            */
2613   {ADINC,"MKH,%b", 3,20}, /* 26: 0110 0100 0010 0110 xxxx xxxx            */
2614   {ADINC,"MKL,%b", 3,20}, /* 27: 0110 0100 0010 0111 xxxx xxxx            */
2615   {GTI,"PA,%b",    3,20}, /* 28: 0110 0100 0010 1000 xxxx xxxx            */
2616   {GTI,"PB,%b",    3,20}, /* 29: 0110 0100 0010 1001 xxxx xxxx            */
2617   {GTI,"PC,%b",    3,20}, /* 2a: 0110 0100 0010 1010 xxxx xxxx            */
2618   {GTI,"PD,%b",    3,20}, /* 2b: 0110 0100 0010 1011 xxxx xxxx            */
2619   {illegal,0,     3,20}, /* 2c: 0110 0100 0010 1100 xxxx xxxx            */
2620   {GTI,"PF,%b",    3,20}, /* 2d: 0110 0100 0010 1101 xxxx xxxx            */
2621   {GTI,"MKH,%b",   3,20}, /* 2e: 0110 0100 0010 1110 xxxx xxxx            */
2622   {GTI,"MKL,%b",   3,20}, /* 2f: 0110 0100 0010 1111 xxxx xxxx            */
2619   {ADINC,"PA,%b"  }, /* 20: 0110 0100 0010 0000 xxxx xxxx            */
2620   {ADINC,"PB,%b"  }, /* 21: 0110 0100 0010 0001 xxxx xxxx            */
2621   {ADINC,"PC,%b"  }, /* 22: 0110 0100 0010 0010 xxxx xxxx            */
2622   {ADINC,"PD,%b"  }, /* 23: 0110 0100 0010 0011 xxxx xxxx            */
2623   {illegal,0     }, /* 24: 0110 0100 0010 0100 xxxx xxxx            */
2624   {ADINC,"PF,%b"  }, /* 25: 0110 0100 0010 0101 xxxx xxxx            */
2625   {ADINC,"MKH,%b" }, /* 26: 0110 0100 0010 0110 xxxx xxxx            */
2626   {ADINC,"MKL,%b" }, /* 27: 0110 0100 0010 0111 xxxx xxxx            */
2627   {GTI,"PA,%b"    }, /* 28: 0110 0100 0010 1000 xxxx xxxx            */
2628   {GTI,"PB,%b"    }, /* 29: 0110 0100 0010 1001 xxxx xxxx            */
2629   {GTI,"PC,%b"    }, /* 2a: 0110 0100 0010 1010 xxxx xxxx            */
2630   {GTI,"PD,%b"    }, /* 2b: 0110 0100 0010 1011 xxxx xxxx            */
2631   {illegal,0     }, /* 2c: 0110 0100 0010 1100 xxxx xxxx            */
2632   {GTI,"PF,%b"    }, /* 2d: 0110 0100 0010 1101 xxxx xxxx            */
2633   {GTI,"MKH,%b"   }, /* 2e: 0110 0100 0010 1110 xxxx xxxx            */
2634   {GTI,"MKL,%b"   }, /* 2f: 0110 0100 0010 1111 xxxx xxxx            */
26232635
2624   {SUINB,"PA,%b",  3,20}, /* 30: 0110 0100 0011 0000 xxxx xxxx            */
2625   {SUINB,"PB,%b",  3,20}, /* 31: 0110 0100 0011 0001 xxxx xxxx            */
2626   {SUINB,"PC,%b",  3,20}, /* 32: 0110 0100 0011 0010 xxxx xxxx            */
2627   {SUINB,"PD,%b",  3,20}, /* 33: 0110 0100 0011 0011 xxxx xxxx            */
2628   {illegal,0,     3,20}, /* 34: 0110 0100 0011 0100 xxxx xxxx            */
2629   {SUINB,"PF,%b",  3,20}, /* 35: 0110 0100 0011 0101 xxxx xxxx            */
2630   {SUINB,"MKH,%b", 3,20}, /* 36: 0110 0100 0011 0110 xxxx xxxx            */
2631   {SUINB,"MKL,%b", 3,20}, /* 37: 0110 0100 0011 0111 xxxx xxxx            */
2632   {LTI,"PA,%b",    3,20}, /* 38: 0110 0100 0011 1000 xxxx xxxx            */
2633   {LTI,"PB,%b",    3,20}, /* 39: 0110 0100 0011 1001 xxxx xxxx            */
2634   {LTI,"PC,%b",    3,20}, /* 3a: 0110 0100 0011 1010 xxxx xxxx            */
2635   {LTI,"PD,%b",    3,20}, /* 3b: 0110 0100 0011 1011 xxxx xxxx            */
2636   {illegal,0,     3,20}, /* 3c: 0110 0100 0011 1100 xxxx xxxx            */
2637   {LTI,"PF,%b",    3,20}, /* 3d: 0110 0100 0011 1101 xxxx xxxx            */
2638   {LTI,"MKH,%b",   3,20}, /* 3e: 0110 0100 0011 1110 xxxx xxxx            */
2639   {LTI,"MKL,%b",   3,20}, /* 3f: 0110 0100 0011 1111 xxxx xxxx            */
2636   {SUINB,"PA,%b"  }, /* 30: 0110 0100 0011 0000 xxxx xxxx            */
2637   {SUINB,"PB,%b"  }, /* 31: 0110 0100 0011 0001 xxxx xxxx            */
2638   {SUINB,"PC,%b"  }, /* 32: 0110 0100 0011 0010 xxxx xxxx            */
2639   {SUINB,"PD,%b"  }, /* 33: 0110 0100 0011 0011 xxxx xxxx            */
2640   {illegal,0     }, /* 34: 0110 0100 0011 0100 xxxx xxxx            */
2641   {SUINB,"PF,%b"  }, /* 35: 0110 0100 0011 0101 xxxx xxxx            */
2642   {SUINB,"MKH,%b" }, /* 36: 0110 0100 0011 0110 xxxx xxxx            */
2643   {SUINB,"MKL,%b" }, /* 37: 0110 0100 0011 0111 xxxx xxxx            */
2644   {LTI,"PA,%b"    }, /* 38: 0110 0100 0011 1000 xxxx xxxx            */
2645   {LTI,"PB,%b"    }, /* 39: 0110 0100 0011 1001 xxxx xxxx            */
2646   {LTI,"PC,%b"    }, /* 3a: 0110 0100 0011 1010 xxxx xxxx            */
2647   {LTI,"PD,%b"    }, /* 3b: 0110 0100 0011 1011 xxxx xxxx            */
2648   {illegal,0     }, /* 3c: 0110 0100 0011 1100 xxxx xxxx            */
2649   {LTI,"PF,%b"    }, /* 3d: 0110 0100 0011 1101 xxxx xxxx            */
2650   {LTI,"MKH,%b"   }, /* 3e: 0110 0100 0011 1110 xxxx xxxx            */
2651   {LTI,"MKL,%b"   }, /* 3f: 0110 0100 0011 1111 xxxx xxxx            */
26402652
2641   {ADI,"PA,%b",    3,20}, /* 40: 0110 0100 0100 0000 xxxx xxxx            */
2642   {ADI,"PB,%b",    3,20}, /* 41: 0110 0100 0100 0001 xxxx xxxx            */
2643   {ADI,"PC,%b",    3,20}, /* 42: 0110 0100 0100 0010 xxxx xxxx            */
2644   {ADI,"PD,%b",    3,20}, /* 43: 0110 0100 0100 0011 xxxx xxxx            */
2645   {illegal,0,     3,20}, /* 44: 0110 0100 0100 0100 xxxx xxxx            */
2646   {ADI,"PF,%b",    3,20}, /* 45: 0110 0100 0100 0101 xxxx xxxx            */
2647   {ADI,"MKH,%b",   3,20}, /* 46: 0110 0100 0100 0110 xxxx xxxx            */
2648   {ADI,"MKL,%b",   3,20}, /* 47: 0110 0100 0100 0111 xxxx xxxx            */
2649   {ONI,"PA,%b",    3,20}, /* 48: 0110 0100 0100 1000 xxxx xxxx            */
2650   {ONI,"PB,%b",    3,20}, /* 49: 0110 0100 0100 1001 xxxx xxxx            */
2651   {ONI,"PC,%b",    3,20}, /* 4a: 0110 0100 0100 1010 xxxx xxxx            */
2652   {ONI,"PD,%b",    3,20}, /* 4b: 0110 0100 0100 1011 xxxx xxxx            */
2653   {illegal,0,     3,20}, /* 4c: 0110 0100 0100 1100 xxxx xxxx            */
2654   {ONI,"PF,%b",    3,20}, /* 4d: 0110 0100 0100 1101 xxxx xxxx            */
2655   {ONI,"MKH,%b",   3,20}, /* 4e: 0110 0100 0100 1110 xxxx xxxx            */
2656   {ONI,"MKL,%b",   3,20}, /* 4f: 0110 0100 0100 1111 xxxx xxxx            */
2653   {ADI,"PA,%b"    }, /* 40: 0110 0100 0100 0000 xxxx xxxx            */
2654   {ADI,"PB,%b"    }, /* 41: 0110 0100 0100 0001 xxxx xxxx            */
2655   {ADI,"PC,%b"    }, /* 42: 0110 0100 0100 0010 xxxx xxxx            */
2656   {ADI,"PD,%b"    }, /* 43: 0110 0100 0100 0011 xxxx xxxx            */
2657   {illegal,0     }, /* 44: 0110 0100 0100 0100 xxxx xxxx            */
2658   {ADI,"PF,%b"    }, /* 45: 0110 0100 0100 0101 xxxx xxxx            */
2659   {ADI,"MKH,%b"   }, /* 46: 0110 0100 0100 0110 xxxx xxxx            */
2660   {ADI,"MKL,%b"   }, /* 47: 0110 0100 0100 0111 xxxx xxxx            */
2661   {ONI,"PA,%b"    }, /* 48: 0110 0100 0100 1000 xxxx xxxx            */
2662   {ONI,"PB,%b"    }, /* 49: 0110 0100 0100 1001 xxxx xxxx            */
2663   {ONI,"PC,%b"    }, /* 4a: 0110 0100 0100 1010 xxxx xxxx            */
2664   {ONI,"PD,%b"    }, /* 4b: 0110 0100 0100 1011 xxxx xxxx            */
2665   {illegal,0     }, /* 4c: 0110 0100 0100 1100 xxxx xxxx            */
2666   {ONI,"PF,%b"    }, /* 4d: 0110 0100 0100 1101 xxxx xxxx            */
2667   {ONI,"MKH,%b"   }, /* 4e: 0110 0100 0100 1110 xxxx xxxx            */
2668   {ONI,"MKL,%b"   }, /* 4f: 0110 0100 0100 1111 xxxx xxxx            */
26572669
2658   {ACI,"PA,%b",    3,20}, /* 50: 0110 0100 0101 0000 xxxx xxxx            */
2659   {ACI,"PB,%b",    3,20}, /* 51: 0110 0100 0101 0001 xxxx xxxx            */
2660   {ACI,"PC,%b",    3,20}, /* 52: 0110 0100 0101 0010 xxxx xxxx            */
2661   {ACI,"PD,%b",    3,20}, /* 53: 0110 0100 0101 0011 xxxx xxxx            */
2662   {illegal,0,     3,20}, /* 54: 0110 0100 0101 0100 xxxx xxxx            */
2663   {ACI,"PF,%b",    3,20}, /* 55: 0110 0100 0101 0101 xxxx xxxx            */
2664   {ACI,"MKH,%b",   3,20}, /* 56: 0110 0100 0101 0110 xxxx xxxx            */
2665   {ACI,"MKL,%b",   3,20}, /* 57: 0110 0100 0101 0111 xxxx xxxx            */
2666   {OFFI,"PA,%b",   3,20}, /* 58: 0110 0100 0101 1000 xxxx xxxx            */
2667   {OFFI,"PB,%b",   3,20}, /* 59: 0110 0100 0101 1001 xxxx xxxx            */
2668   {OFFI,"PC,%b",   3,20}, /* 5a: 0110 0100 0101 1010 xxxx xxxx            */
2669   {OFFI,"PD,%b",   3,20}, /* 5b: 0110 0100 0101 1011 xxxx xxxx            */
2670   {illegal,0,     3,20}, /* 5c: 0110 0100 0101 1100 xxxx xxxx            */
2671   {OFFI,"PF,%b",   3,20}, /* 5d: 0110 0100 0101 1101 xxxx xxxx            */
2672   {OFFI,"MKH,%b",  3,20}, /* 5e: 0110 0100 0101 1110 xxxx xxxx            */
2673   {OFFI,"MKL,%b",  3,20}, /* 5f: 0110 0100 0101 1111 xxxx xxxx            */
2670   {ACI,"PA,%b"    }, /* 50: 0110 0100 0101 0000 xxxx xxxx            */
2671   {ACI,"PB,%b"    }, /* 51: 0110 0100 0101 0001 xxxx xxxx            */
2672   {ACI,"PC,%b"    }, /* 52: 0110 0100 0101 0010 xxxx xxxx            */
2673   {ACI,"PD,%b"    }, /* 53: 0110 0100 0101 0011 xxxx xxxx            */
2674   {illegal,0     }, /* 54: 0110 0100 0101 0100 xxxx xxxx            */
2675   {ACI,"PF,%b"    }, /* 55: 0110 0100 0101 0101 xxxx xxxx            */
2676   {ACI,"MKH,%b"   }, /* 56: 0110 0100 0101 0110 xxxx xxxx            */
2677   {ACI,"MKL,%b"   }, /* 57: 0110 0100 0101 0111 xxxx xxxx            */
2678   {OFFI,"PA,%b"   }, /* 58: 0110 0100 0101 1000 xxxx xxxx            */
2679   {OFFI,"PB,%b"   }, /* 59: 0110 0100 0101 1001 xxxx xxxx            */
2680   {OFFI,"PC,%b"   }, /* 5a: 0110 0100 0101 1010 xxxx xxxx            */
2681   {OFFI,"PD,%b"   }, /* 5b: 0110 0100 0101 1011 xxxx xxxx            */
2682   {illegal,0     }, /* 5c: 0110 0100 0101 1100 xxxx xxxx            */
2683   {OFFI,"PF,%b"   }, /* 5d: 0110 0100 0101 1101 xxxx xxxx            */
2684   {OFFI,"MKH,%b"  }, /* 5e: 0110 0100 0101 1110 xxxx xxxx            */
2685   {OFFI,"MKL,%b"  }, /* 5f: 0110 0100 0101 1111 xxxx xxxx            */
26742686
2675   {SUI,"PA,%b",    3,20}, /* 60: 0110 0100 0110 0000 xxxx xxxx            */
2676   {SUI,"PB,%b",    3,20}, /* 61: 0110 0100 0110 0001 xxxx xxxx            */
2677   {SUI,"PC,%b",    3,20}, /* 62: 0110 0100 0110 0010 xxxx xxxx            */
2678   {SUI,"PD,%b",    3,20}, /* 63: 0110 0100 0110 0011 xxxx xxxx            */
2679   {illegal,0,     3,20}, /* 64: 0110 0100 0110 0100 xxxx xxxx            */
2680   {SUI,"PF,%b",    3,20}, /* 65: 0110 0100 0110 0101 xxxx xxxx            */
2681   {SUI,"MKH,%b",   3,20}, /* 66: 0110 0100 0110 0110 xxxx xxxx            */
2682   {SUI,"MKL,%b",   3,20}, /* 67: 0110 0100 0110 0111 xxxx xxxx            */
2683   {NEI,"PA,%b",    3,20}, /* 68: 0110 0100 0110 1000 xxxx xxxx            */
2684   {NEI,"PB,%b",    3,20}, /* 69: 0110 0100 0110 1001 xxxx xxxx            */
2685   {NEI,"PC,%b",    3,20}, /* 6a: 0110 0100 0110 1010 xxxx xxxx            */
2686   {NEI,"PD,%b",    3,20}, /* 6b: 0110 0100 0110 1011 xxxx xxxx            */
2687   {illegal,0,     3,20}, /* 6c: 0110 0100 0110 1100 xxxx xxxx            */
2688   {NEI,"PF,%b",    3,20}, /* 6d: 0110 0100 0110 1101 xxxx xxxx            */
2689   {NEI,"MKH,%b",   3,20}, /* 6e: 0110 0100 0110 1110 xxxx xxxx            */
2690   {NEI,"MKL,%b",   3,20}, /* 6f: 0110 0100 0110 1111 xxxx xxxx            */
2687   {SUI,"PA,%b"    }, /* 60: 0110 0100 0110 0000 xxxx xxxx            */
2688   {SUI,"PB,%b"    }, /* 61: 0110 0100 0110 0001 xxxx xxxx            */
2689   {SUI,"PC,%b"    }, /* 62: 0110 0100 0110 0010 xxxx xxxx            */
2690   {SUI,"PD,%b"    }, /* 63: 0110 0100 0110 0011 xxxx xxxx            */
2691   {illegal,0     }, /* 64: 0110 0100 0110 0100 xxxx xxxx            */
2692   {SUI,"PF,%b"    }, /* 65: 0110 0100 0110 0101 xxxx xxxx            */
2693   {SUI,"MKH,%b"   }, /* 66: 0110 0100 0110 0110 xxxx xxxx            */
2694   {SUI,"MKL,%b"   }, /* 67: 0110 0100 0110 0111 xxxx xxxx            */
2695   {NEI,"PA,%b"    }, /* 68: 0110 0100 0110 1000 xxxx xxxx            */
2696   {NEI,"PB,%b"    }, /* 69: 0110 0100 0110 1001 xxxx xxxx            */
2697   {NEI,"PC,%b"    }, /* 6a: 0110 0100 0110 1010 xxxx xxxx            */
2698   {NEI,"PD,%b"    }, /* 6b: 0110 0100 0110 1011 xxxx xxxx            */
2699   {illegal,0     }, /* 6c: 0110 0100 0110 1100 xxxx xxxx            */
2700   {NEI,"PF,%b"    }, /* 6d: 0110 0100 0110 1101 xxxx xxxx            */
2701   {NEI,"MKH,%b"   }, /* 6e: 0110 0100 0110 1110 xxxx xxxx            */
2702   {NEI,"MKL,%b"   }, /* 6f: 0110 0100 0110 1111 xxxx xxxx            */
26912703
2692   {SBI,"PA,%b",    3,20}, /* 70: 0110 0100 0111 0000 xxxx xxxx            */
2693   {SBI,"PB,%b",    3,20}, /* 71: 0110 0100 0111 0001 xxxx xxxx            */
2694   {SBI,"PC,%b",    3,20}, /* 72: 0110 0100 0111 0010 xxxx xxxx            */
2695   {SBI,"PD,%b",    3,20}, /* 73: 0110 0100 0111 0011 xxxx xxxx            */
2696   {illegal,0,     3,20}, /* 74: 0110 0100 0111 0100 xxxx xxxx            */
2697   {SBI,"PF,%b",    3,20}, /* 75: 0110 0100 0111 0101 xxxx xxxx            */
2698   {SBI,"MKH,%b",   3,20}, /* 76: 0110 0100 0111 0110 xxxx xxxx            */
2699   {SBI,"MKL,%b",   3,20}, /* 77: 0110 0100 0111 0111 xxxx xxxx            */
2700   {EQI,"PA,%b",    3,20}, /* 78: 0110 0100 0111 1000 xxxx xxxx            */
2701   {EQI,"PB,%b",    3,20}, /* 79: 0110 0100 0111 1001 xxxx xxxx            */
2702   {EQI,"PC,%b",    3,20}, /* 7a: 0110 0100 0111 1010 xxxx xxxx            */
2703   {EQI,"PD,%b",    3,20}, /* 7b: 0110 0100 0111 1011 xxxx xxxx            */
2704   {illegal,0,     3,20}, /* 7c: 0110 0100 0111 1100 xxxx xxxx            */
2705   {EQI,"PF,%b",    3,20}, /* 7d: 0110 0100 0111 1101 xxxx xxxx            */
2706   {EQI,"MKH,%b",   3,20}, /* 7e: 0110 0100 0111 1110 xxxx xxxx            */
2707   {EQI,"MKL,%b",   3,20}, /* 7f: 0110 0100 0111 1111 xxxx xxxx            */
2704   {SBI,"PA,%b"    }, /* 70: 0110 0100 0111 0000 xxxx xxxx            */
2705   {SBI,"PB,%b"    }, /* 71: 0110 0100 0111 0001 xxxx xxxx            */
2706   {SBI,"PC,%b"    }, /* 72: 0110 0100 0111 0010 xxxx xxxx            */
2707   {SBI,"PD,%b"    }, /* 73: 0110 0100 0111 0011 xxxx xxxx            */
2708   {illegal,0     }, /* 74: 0110 0100 0111 0100 xxxx xxxx            */
2709   {SBI,"PF,%b"    }, /* 75: 0110 0100 0111 0101 xxxx xxxx            */
2710   {SBI,"MKH,%b"   }, /* 76: 0110 0100 0111 0110 xxxx xxxx            */
2711   {SBI,"MKL,%b"   }, /* 77: 0110 0100 0111 0111 xxxx xxxx            */
2712   {EQI,"PA,%b"    }, /* 78: 0110 0100 0111 1000 xxxx xxxx            */
2713   {EQI,"PB,%b"    }, /* 79: 0110 0100 0111 1001 xxxx xxxx            */
2714   {EQI,"PC,%b"    }, /* 7a: 0110 0100 0111 1010 xxxx xxxx            */
2715   {EQI,"PD,%b"    }, /* 7b: 0110 0100 0111 1011 xxxx xxxx            */
2716   {illegal,0     }, /* 7c: 0110 0100 0111 1100 xxxx xxxx            */
2717   {EQI,"PF,%b"    }, /* 7d: 0110 0100 0111 1101 xxxx xxxx            */
2718   {EQI,"MKH,%b"   }, /* 7e: 0110 0100 0111 1110 xxxx xxxx            */
2719   {EQI,"MKL,%b"   }, /* 7f: 0110 0100 0111 1111 xxxx xxxx            */
27082720
2709   {illegal,0,     3,20}, /* 80: 0110 0100 1000 0000 xxxx xxxx            */
2710   {MVI,"SMH,%b",   3,14}, /* 81: 0110 0100 1000 0001 xxxx xxxx            */
2711   {illegal,0,     3,14}, /* 82: 0110 0100 1000 0010 xxxx xxxx            */
2712   {MVI,"EOM,%b",   3,14}, /* 83: 0110 0100 1000 0011 xxxx xxxx            */
2713   {illegal,0,     3,14}, /* 84: 0110 0100 1000 0100 xxxx xxxx            */
2714   {MVI,"TMM,%b",   3,14}, /* 85: 0110 0100 1000 0101 xxxx xxxx            */
2715   {illegal,0,     3,14}, /* 86: 0110 0100 1000 0110 xxxx xxxx            */
2716   {illegal,0,     3,14}, /* 87: 0110 0100 1000 0111 xxxx xxxx            */
2717   {illegal,0,     3,20}, /* 88: 0110 0100 1000 1000 xxxx xxxx            */
2718   {ANI,"SMH,%b",   3,20}, /* 89: 0110 0100 1000 1001 xxxx xxxx            */
2719   {illegal,0,     3,20}, /* 8a: 0110 0100 1000 1010 xxxx xxxx            */
2720   {ANI,"EOM,%b",   3,20}, /* 8b: 0110 0100 1000 1011 xxxx xxxx            */
2721   {illegal,0,     3,20}, /* 8c: 0110 0100 1000 1100 xxxx xxxx            */
2722   {ANI,"TMM,%b",   3,20}, /* 8d: 0110 0100 1000 1101 xxxx xxxx            */
2723   {illegal,0,     3,20}, /* 8e: 0110 0100 1000 1110 xxxx xxxx            */
2724   {illegal,0,     3,20}, /* 8f: 0110 0100 1000 1111 xxxx xxxx            */
2721   {illegal,0     }, /* 80: 0110 0100 1000 0000 xxxx xxxx            */
2722   {MVI,"SMH,%b"   }, /* 81: 0110 0100 1000 0001 xxxx xxxx            */
2723   {illegal,0     }, /* 82: 0110 0100 1000 0010 xxxx xxxx            */
2724   {MVI,"EOM,%b"   }, /* 83: 0110 0100 1000 0011 xxxx xxxx            */
2725   {illegal,0     }, /* 84: 0110 0100 1000 0100 xxxx xxxx            */
2726   {MVI,"TMM,%b"   }, /* 85: 0110 0100 1000 0101 xxxx xxxx            */
2727   {illegal,0     }, /* 86: 0110 0100 1000 0110 xxxx xxxx            */
2728   {illegal,0     }, /* 87: 0110 0100 1000 0111 xxxx xxxx            */
2729   {illegal,0     }, /* 88: 0110 0100 1000 1000 xxxx xxxx            */
2730   {ANI,"SMH,%b"   }, /* 89: 0110 0100 1000 1001 xxxx xxxx            */
2731   {illegal,0     }, /* 8a: 0110 0100 1000 1010 xxxx xxxx            */
2732   {ANI,"EOM,%b"   }, /* 8b: 0110 0100 1000 1011 xxxx xxxx            */
2733   {illegal,0     }, /* 8c: 0110 0100 1000 1100 xxxx xxxx            */
2734   {ANI,"TMM,%b"   }, /* 8d: 0110 0100 1000 1101 xxxx xxxx            */
2735   {illegal,0     }, /* 8e: 0110 0100 1000 1110 xxxx xxxx            */
2736   {illegal,0     }, /* 8f: 0110 0100 1000 1111 xxxx xxxx            */
27252737
2726   {illegal,0,     3,20}, /* 90: 0110 0100 1001 0000 xxxx xxxx            */
2727   {XRI,"SMH,%b",   3,20}, /* 91: 0110 0100 1001 0001 xxxx xxxx            */
2728   {illegal,0,     3,20}, /* 92: 0110 0100 1001 0010 xxxx xxxx            */
2729   {XRI,"EOM,%b",   3,20}, /* 93: 0110 0100 1001 0011 xxxx xxxx            */
2730   {illegal,0,     3,20}, /* 94: 0110 0100 1001 0100 xxxx xxxx            */
2731   {XRI,"TMM,%b",   3,20}, /* 95: 0110 0100 1001 0101 xxxx xxxx            */
2732   {illegal,0,     3,20}, /* 96: 0110 0100 1001 0110 xxxx xxxx            */
2733   {illegal,0,     3,20}, /* 97: 0110 0100 1001 0111 xxxx xxxx            */
2734   {illegal,0,     3,20}, /* 98: 0110 0100 1001 1000 xxxx xxxx            */
2735   {ORI,"SMH,%b",   3,20}, /* 99: 0110 0100 1001 1001 xxxx xxxx            */
2736   {illegal,0,     3,20}, /* 9a: 0110 0100 1001 1010 xxxx xxxx            */
2737   {ORI,"EOM,%b",   3,20}, /* 9b: 0110 0100 1001 1011 xxxx xxxx            */
2738   {illegal,0,     3,20}, /* 9c: 0110 0100 1001 1100 xxxx xxxx            */
2739   {ORI,"TMM,%b",   3,20}, /* 9d: 0110 0100 1001 1101 xxxx xxxx            */
2740   {illegal,0,     3,20}, /* 9e: 0110 0100 1001 1110 xxxx xxxx            */
2741   {illegal,0,     3,20}, /* 9f: 0110 0100 1001 1111 xxxx xxxx            */
2738   {illegal,0     }, /* 90: 0110 0100 1001 0000 xxxx xxxx            */
2739   {XRI,"SMH,%b"   }, /* 91: 0110 0100 1001 0001 xxxx xxxx            */
2740   {illegal,0     }, /* 92: 0110 0100 1001 0010 xxxx xxxx            */
2741   {XRI,"EOM,%b"   }, /* 93: 0110 0100 1001 0011 xxxx xxxx            */
2742   {illegal,0     }, /* 94: 0110 0100 1001 0100 xxxx xxxx            */
2743   {XRI,"TMM,%b"   }, /* 95: 0110 0100 1001 0101 xxxx xxxx            */
2744   {illegal,0     }, /* 96: 0110 0100 1001 0110 xxxx xxxx            */
2745   {illegal,0     }, /* 97: 0110 0100 1001 0111 xxxx xxxx            */
2746   {illegal,0     }, /* 98: 0110 0100 1001 1000 xxxx xxxx            */
2747   {ORI,"SMH,%b"   }, /* 99: 0110 0100 1001 1001 xxxx xxxx            */
2748   {illegal,0     }, /* 9a: 0110 0100 1001 1010 xxxx xxxx            */
2749   {ORI,"EOM,%b"   }, /* 9b: 0110 0100 1001 1011 xxxx xxxx            */
2750   {illegal,0     }, /* 9c: 0110 0100 1001 1100 xxxx xxxx            */
2751   {ORI,"TMM,%b"   }, /* 9d: 0110 0100 1001 1101 xxxx xxxx            */
2752   {illegal,0     }, /* 9e: 0110 0100 1001 1110 xxxx xxxx            */
2753   {illegal,0     }, /* 9f: 0110 0100 1001 1111 xxxx xxxx            */
27422754
2743   {illegal,0,     3,20}, /* a0: 0110 0100 1010 0000 xxxx xxxx            */
2744   {ADINC,"SMH,%b", 3,20}, /* a1: 0110 0100 1010 0001 xxxx xxxx            */
2745   {illegal,0,     3,20}, /* a2: 0110 0100 1010 0010 xxxx xxxx            */
2746   {ADINC,"EOM,%b", 3,20}, /* a3: 0110 0100 1010 0011 xxxx xxxx            */
2747   {illegal,0,     3,20}, /* a4: 0110 0100 1010 0100 xxxx xxxx            */
2748   {ADINC,"TMM,%b", 3,20}, /* a5: 0110 0100 1010 0101 xxxx xxxx            */
2749   {illegal,0,     3,20}, /* a6: 0110 0100 1010 0110 xxxx xxxx            */
2750   {illegal,0,     3,20}, /* a7: 0110 0100 1010 0111 xxxx xxxx            */
2751   {illegal,0,     3,20}, /* a8: 0110 0100 1010 1000 xxxx xxxx            */
2752   {GTI,"SMH,%b",   3,20}, /* a9: 0110 0100 1010 1001 xxxx xxxx            */
2753   {illegal,0,     3,20}, /* aa: 0110 0100 1010 1010 xxxx xxxx            */
2754   {GTI,"EOM,%b",   3,20}, /* ab: 0110 0100 1010 1011 xxxx xxxx            */
2755   {illegal,0,     3,20}, /* ac: 0110 0100 1010 1100 xxxx xxxx            */
2756   {GTI,"TMM,%b",   3,20}, /* ad: 0110 0100 1010 1101 xxxx xxxx            */
2757   {GTI,"PT,%b",    3,20}, /* ae: 0110 0100 1010 1110 xxxx xxxx            */
2758   {illegal,0,     3,20}, /* af: 0110 0100 1010 1111 xxxx xxxx            */
2755   {illegal,0     }, /* a0: 0110 0100 1010 0000 xxxx xxxx            */
2756   {ADINC,"SMH,%b" }, /* a1: 0110 0100 1010 0001 xxxx xxxx            */
2757   {illegal,0     }, /* a2: 0110 0100 1010 0010 xxxx xxxx            */
2758   {ADINC,"EOM,%b" }, /* a3: 0110 0100 1010 0011 xxxx xxxx            */
2759   {illegal,0     }, /* a4: 0110 0100 1010 0100 xxxx xxxx            */
2760   {ADINC,"TMM,%b" }, /* a5: 0110 0100 1010 0101 xxxx xxxx            */
2761   {illegal,0     }, /* a6: 0110 0100 1010 0110 xxxx xxxx            */
2762   {illegal,0     }, /* a7: 0110 0100 1010 0111 xxxx xxxx            */
2763   {illegal,0     }, /* a8: 0110 0100 1010 1000 xxxx xxxx            */
2764   {GTI,"SMH,%b"   }, /* a9: 0110 0100 1010 1001 xxxx xxxx            */
2765   {illegal,0     }, /* aa: 0110 0100 1010 1010 xxxx xxxx            */
2766   {GTI,"EOM,%b"   }, /* ab: 0110 0100 1010 1011 xxxx xxxx            */
2767   {illegal,0     }, /* ac: 0110 0100 1010 1100 xxxx xxxx            */
2768   {GTI,"TMM,%b"   }, /* ad: 0110 0100 1010 1101 xxxx xxxx            */
2769   {GTI,"PT,%b"    }, /* ae: 0110 0100 1010 1110 xxxx xxxx            */
2770   {illegal,0     }, /* af: 0110 0100 1010 1111 xxxx xxxx            */
27592771
2760   {illegal,0,     3,20}, /* b0: 0110 0100 1011 0000 xxxx xxxx            */
2761   {SUINB,"SMH,%b", 3,20}, /* b1: 0110 0100 1011 0001 xxxx xxxx            */
2762   {illegal,0,     3,20}, /* b2: 0110 0100 1011 0010 xxxx xxxx            */
2763   {SUINB,"EOM,%b", 3,20}, /* b3: 0110 0100 1011 0011 xxxx xxxx            */
2764   {illegal,0,     3,20}, /* b4: 0110 0100 1011 0100 xxxx xxxx            */
2765   {SUINB,"TMM,%b", 3,20}, /* b5: 0110 0100 1011 0101 xxxx xxxx            */
2766   {illegal,0,     3,20}, /* b6: 0110 0100 1011 0110 xxxx xxxx            */
2767   {illegal,0,     3,20}, /* b7: 0110 0100 1011 0111 xxxx xxxx            */
2768   {illegal,0,     3,20}, /* b8: 0110 0100 1011 1000 xxxx xxxx            */
2769   {LTI,"SMH,%b",   3,20}, /* b9: 0110 0100 1011 1001 xxxx xxxx            */
2770   {illegal,0,     3,20}, /* ba: 0110 0100 1011 1010 xxxx xxxx            */
2771   {LTI,"EOM,%b",   3,20}, /* bb: 0110 0100 1011 1011 xxxx xxxx            */
2772   {illegal,0,     3,20}, /* bc: 0110 0100 1011 1100 xxxx xxxx            */
2773   {LTI,"TMM,%b",   3,20}, /* bd: 0110 0100 1011 1101 xxxx xxxx            */
2774   {LTI,"PT,%b",    3,20}, /* be: 0110 0100 1011 1110 xxxx xxxx            */
2775   {illegal,0,     3,20}, /* bf: 0110 0100 1011 1111 xxxx xxxx            */
2772   {illegal,0     }, /* b0: 0110 0100 1011 0000 xxxx xxxx            */
2773   {SUINB,"SMH,%b" }, /* b1: 0110 0100 1011 0001 xxxx xxxx            */
2774   {illegal,0     }, /* b2: 0110 0100 1011 0010 xxxx xxxx            */
2775   {SUINB,"EOM,%b" }, /* b3: 0110 0100 1011 0011 xxxx xxxx            */
2776   {illegal,0     }, /* b4: 0110 0100 1011 0100 xxxx xxxx            */
2777   {SUINB,"TMM,%b" }, /* b5: 0110 0100 1011 0101 xxxx xxxx            */
2778   {illegal,0     }, /* b6: 0110 0100 1011 0110 xxxx xxxx            */
2779   {illegal,0     }, /* b7: 0110 0100 1011 0111 xxxx xxxx            */
2780   {illegal,0     }, /* b8: 0110 0100 1011 1000 xxxx xxxx            */
2781   {LTI,"SMH,%b"   }, /* b9: 0110 0100 1011 1001 xxxx xxxx            */
2782   {illegal,0     }, /* ba: 0110 0100 1011 1010 xxxx xxxx            */
2783   {LTI,"EOM,%b"   }, /* bb: 0110 0100 1011 1011 xxxx xxxx            */
2784   {illegal,0     }, /* bc: 0110 0100 1011 1100 xxxx xxxx            */
2785   {LTI,"TMM,%b"   }, /* bd: 0110 0100 1011 1101 xxxx xxxx            */
2786   {LTI,"PT,%b"    }, /* be: 0110 0100 1011 1110 xxxx xxxx            */
2787   {illegal,0     }, /* bf: 0110 0100 1011 1111 xxxx xxxx            */
27762788
2777   {illegal,0,     3,20}, /* c0: 0110 0100 1100 0000 xxxx xxxx            */
2778   {ADI,"SMH,%b",   3,20}, /* c1: 0110 0100 1100 0001 xxxx xxxx            */
2779   {illegal,0,     3,20}, /* c2: 0110 0100 1100 0010 xxxx xxxx            */
2780   {ADI,"EOM,%b",   3,20}, /* c3: 0110 0100 1100 0011 xxxx xxxx            */
2781   {illegal,0,     3,20}, /* c4: 0110 0100 1100 0100 xxxx xxxx            */
2782   {ADI,"TMM,%b",   3,20}, /* c5: 0110 0100 1100 0101 xxxx xxxx            */
2783   {illegal,0,     3,20}, /* c6: 0110 0100 1100 0110 xxxx xxxx            */
2784   {illegal,0,     3,20}, /* c7: 0110 0100 1100 0111 xxxx xxxx            */
2785   {illegal,0,     3,20}, /* c8: 0110 0100 1100 1000 xxxx xxxx            */
2786   {ONI,"SMH,%b",   3,20}, /* c9: 0110 0100 1100 1001 xxxx xxxx            */
2787   {illegal,0,     3,20}, /* ca: 0110 0100 1100 1010 xxxx xxxx            */
2788   {ONI,"EOM,%b",   3,20}, /* cb: 0110 0100 1100 1011 xxxx xxxx            */
2789   {illegal,0,     3,20}, /* cc: 0110 0100 1100 1100 xxxx xxxx            */
2790   {ONI,"TMM,%b",   3,20}, /* cd: 0110 0100 1100 1101 xxxx xxxx            */
2791   {ONI,"PT,%b",    3,20}, /* ce: 0110 0100 1100 1110 xxxx xxxx            */
2792   {illegal,0,     3,20}, /* cf: 0110 0100 1100 1111 xxxx xxxx            */
2789   {illegal,0     }, /* c0: 0110 0100 1100 0000 xxxx xxxx            */
2790   {ADI,"SMH,%b"   }, /* c1: 0110 0100 1100 0001 xxxx xxxx            */
2791   {illegal,0     }, /* c2: 0110 0100 1100 0010 xxxx xxxx            */
2792   {ADI,"EOM,%b"   }, /* c3: 0110 0100 1100 0011 xxxx xxxx            */
2793   {illegal,0     }, /* c4: 0110 0100 1100 0100 xxxx xxxx            */
2794   {ADI,"TMM,%b"   }, /* c5: 0110 0100 1100 0101 xxxx xxxx            */
2795   {illegal,0     }, /* c6: 0110 0100 1100 0110 xxxx xxxx            */
2796   {illegal,0     }, /* c7: 0110 0100 1100 0111 xxxx xxxx            */
2797   {illegal,0     }, /* c8: 0110 0100 1100 1000 xxxx xxxx            */
2798   {ONI,"SMH,%b"   }, /* c9: 0110 0100 1100 1001 xxxx xxxx            */
2799   {illegal,0     }, /* ca: 0110 0100 1100 1010 xxxx xxxx            */
2800   {ONI,"EOM,%b"   }, /* cb: 0110 0100 1100 1011 xxxx xxxx            */
2801   {illegal,0     }, /* cc: 0110 0100 1100 1100 xxxx xxxx            */
2802   {ONI,"TMM,%b"   }, /* cd: 0110 0100 1100 1101 xxxx xxxx            */
2803   {ONI,"PT,%b"    }, /* ce: 0110 0100 1100 1110 xxxx xxxx            */
2804   {illegal,0     }, /* cf: 0110 0100 1100 1111 xxxx xxxx            */
27932805
2794   {illegal,0,     3,20}, /* d0: 0110 0100 1101 0000 xxxx xxxx            */
2795   {ACI,"SMH,%b",   3,20}, /* d1: 0110 0100 1101 0001 xxxx xxxx            */
2796   {illegal,0,     3,20}, /* d2: 0110 0100 1101 0010 xxxx xxxx            */
2797   {ACI,"EOM,%b",   3,20}, /* d3: 0110 0100 1101 0011 xxxx xxxx            */
2798   {illegal,0,     3,20}, /* d4: 0110 0100 1101 0100 xxxx xxxx            */
2799   {ACI,"TMM,%b",   3,20}, /* d5: 0110 0100 1101 0101 xxxx xxxx            */
2800   {illegal,0,     3,20}, /* d6: 0110 0100 1101 0110 xxxx xxxx            */
2801   {illegal,0,     3,20}, /* d7: 0110 0100 1101 0111 xxxx xxxx            */
2802   {illegal,0,     3,20}, /* d8: 0110 0100 1101 1000 xxxx xxxx            */
2803   {OFFI,"SMH,%b",  3,20}, /* d9: 0110 0100 1101 1001 xxxx xxxx            */
2804   {illegal,0,     3,20}, /* da: 0110 0100 1101 1010 xxxx xxxx            */
2805   {OFFI,"EOM,%b",  3,20}, /* db: 0110 0100 1101 1011 xxxx xxxx            */
2806   {illegal,0,     3,20}, /* dc: 0110 0100 1101 1100 xxxx xxxx            */
2807   {OFFI,"TMM,%b",  3,20}, /* dd: 0110 0100 1101 1101 xxxx xxxx            */
2808   {OFFI,"PT,%b",   3,20}, /* de: 0110 0100 1101 1110 xxxx xxxx            */
2809   {illegal,0,     3,20}, /* df: 0110 0100 1101 1111 xxxx xxxx            */
2806   {illegal,0     }, /* d0: 0110 0100 1101 0000 xxxx xxxx            */
2807   {ACI,"SMH,%b"   }, /* d1: 0110 0100 1101 0001 xxxx xxxx            */
2808   {illegal,0     }, /* d2: 0110 0100 1101 0010 xxxx xxxx            */
2809   {ACI,"EOM,%b"   }, /* d3: 0110 0100 1101 0011 xxxx xxxx            */
2810   {illegal,0     }, /* d4: 0110 0100 1101 0100 xxxx xxxx            */
2811   {ACI,"TMM,%b"   }, /* d5: 0110 0100 1101 0101 xxxx xxxx            */
2812   {illegal,0     }, /* d6: 0110 0100 1101 0110 xxxx xxxx            */
2813   {illegal,0     }, /* d7: 0110 0100 1101 0111 xxxx xxxx            */
2814   {illegal,0     }, /* d8: 0110 0100 1101 1000 xxxx xxxx            */
2815   {OFFI,"SMH,%b"  }, /* d9: 0110 0100 1101 1001 xxxx xxxx            */
2816   {illegal,0     }, /* da: 0110 0100 1101 1010 xxxx xxxx            */
2817   {OFFI,"EOM,%b"  }, /* db: 0110 0100 1101 1011 xxxx xxxx            */
2818   {illegal,0     }, /* dc: 0110 0100 1101 1100 xxxx xxxx            */
2819   {OFFI,"TMM,%b"  }, /* dd: 0110 0100 1101 1101 xxxx xxxx            */
2820   {OFFI,"PT,%b"   }, /* de: 0110 0100 1101 1110 xxxx xxxx            */
2821   {illegal,0     }, /* df: 0110 0100 1101 1111 xxxx xxxx            */
28102822
2811   {illegal,0,     3,20}, /* e0: 0110 0100 1110 0000 xxxx xxxx            */
2812   {SUI,"SMH,%b",   3,20}, /* e1: 0110 0100 1110 0001 xxxx xxxx            */
2813   {illegal,0,     3,20}, /* e2: 0110 0100 1110 0010 xxxx xxxx            */
2814   {SUI,"EOM,%b",   3,20}, /* e3: 0110 0100 1110 0011 xxxx xxxx            */
2815   {illegal,0,     3,20}, /* e4: 0110 0100 1110 0100 xxxx xxxx            */
2816   {SUI,"TMM,%b",   3,20}, /* e5: 0110 0100 1110 0101 xxxx xxxx            */
2817   {illegal,0,     3,20}, /* e6: 0110 0100 1110 0110 xxxx xxxx            */
2818   {illegal,0,     3,20}, /* e7: 0110 0100 1110 0111 xxxx xxxx            */
2819   {illegal,0,     3,20}, /* e8: 0110 0100 1110 1000 xxxx xxxx            */
2820   {NEI,"SMH,%b",   3,20}, /* e9: 0110 0100 1110 1001 xxxx xxxx            */
2821   {illegal,0,     3,20}, /* ea: 0110 0100 1110 1010 xxxx xxxx            */
2822   {NEI,"EOM,%b",   3,20}, /* eb: 0110 0100 1110 1011 xxxx xxxx            */
2823   {illegal,0,     3,20}, /* ec: 0110 0100 1110 1100 xxxx xxxx            */
2824   {NEI,"TMM,%b",   3,20}, /* ed: 0110 0100 1110 1101 xxxx xxxx            */
2825   {NEI,"PT,%b",    3,20}, /* ee: 0110 0100 1110 1110 xxxx xxxx            */
2826   {illegal,0,     3,20}, /* ef: 0110 0100 1110 1111 xxxx xxxx            */
2823   {illegal,0     }, /* e0: 0110 0100 1110 0000 xxxx xxxx            */
2824   {SUI,"SMH,%b"   }, /* e1: 0110 0100 1110 0001 xxxx xxxx            */
2825   {illegal,0     }, /* e2: 0110 0100 1110 0010 xxxx xxxx            */
2826   {SUI,"EOM,%b"   }, /* e3: 0110 0100 1110 0011 xxxx xxxx            */
2827   {illegal,0     }, /* e4: 0110 0100 1110 0100 xxxx xxxx            */
2828   {SUI,"TMM,%b"   }, /* e5: 0110 0100 1110 0101 xxxx xxxx            */
2829   {illegal,0     }, /* e6: 0110 0100 1110 0110 xxxx xxxx            */
2830   {illegal,0     }, /* e7: 0110 0100 1110 0111 xxxx xxxx            */
2831   {illegal,0     }, /* e8: 0110 0100 1110 1000 xxxx xxxx            */
2832   {NEI,"SMH,%b"   }, /* e9: 0110 0100 1110 1001 xxxx xxxx            */
2833   {illegal,0     }, /* ea: 0110 0100 1110 1010 xxxx xxxx            */
2834   {NEI,"EOM,%b"   }, /* eb: 0110 0100 1110 1011 xxxx xxxx            */
2835   {illegal,0     }, /* ec: 0110 0100 1110 1100 xxxx xxxx            */
2836   {NEI,"TMM,%b"   }, /* ed: 0110 0100 1110 1101 xxxx xxxx            */
2837   {NEI,"PT,%b"    }, /* ee: 0110 0100 1110 1110 xxxx xxxx            */
2838   {illegal,0     }, /* ef: 0110 0100 1110 1111 xxxx xxxx            */
28272839
2828   {illegal,0,     3,20}, /* f0: 0110 0100 1111 0000 xxxx xxxx            */
2829   {SBI,"SMH,%b",   3,20}, /* f1: 0110 0100 1111 0001 xxxx xxxx            */
2830   {illegal,0,     3,20}, /* f2: 0110 0100 1111 0010 xxxx xxxx            */
2831   {SBI,"EOM,%b",   3,20}, /* f3: 0110 0100 1111 0011 xxxx xxxx            */
2832   {illegal,0,     3,20}, /* f4: 0110 0100 1111 0100 xxxx xxxx            */
2833   {SBI,"TMM,%b",   3,20}, /* f5: 0110 0100 1111 0101 xxxx xxxx            */
2834   {illegal,0,     3,20}, /* f6: 0110 0100 1111 0110 xxxx xxxx            */
2835   {illegal,0,     3,20}, /* f7: 0110 0100 1111 0111 xxxx xxxx            */
2836   {illegal,0,     3,20}, /* f8: 0110 0100 1111 1000 xxxx xxxx            */
2837   {EQI,"SMH,%b",   3,20}, /* f9: 0110 0100 1111 1001 xxxx xxxx            */
2838   {illegal,0,     3,20}, /* fa: 0110 0100 1111 1010 xxxx xxxx            */
2839   {EQI,"EOM,%b",   3,20}, /* fb: 0110 0100 1111 1011 xxxx xxxx            */
2840   {illegal,0,     3,20}, /* fc: 0110 0100 1111 1100 xxxx xxxx            */
2841   {EQI,"TMM,%b",   3,20}, /* fd: 0110 0100 1111 1101 xxxx xxxx            */
2842   {EQI,"PT,%b",    3,20}, /* fe: 0110 0100 1111 1110 xxxx xxxx            */
2843   {illegal,0,     3,20}   /* ff: 0110 0100 1111 1111 xxxx xxxx            */
2840   {illegal,0     }, /* f0: 0110 0100 1111 0000 xxxx xxxx            */
2841   {SBI,"SMH,%b"   }, /* f1: 0110 0100 1111 0001 xxxx xxxx            */
2842   {illegal,0     }, /* f2: 0110 0100 1111 0010 xxxx xxxx            */
2843   {SBI,"EOM,%b"   }, /* f3: 0110 0100 1111 0011 xxxx xxxx            */
2844   {illegal,0     }, /* f4: 0110 0100 1111 0100 xxxx xxxx            */
2845   {SBI,"TMM,%b"   }, /* f5: 0110 0100 1111 0101 xxxx xxxx            */
2846   {illegal,0     }, /* f6: 0110 0100 1111 0110 xxxx xxxx            */
2847   {illegal,0     }, /* f7: 0110 0100 1111 0111 xxxx xxxx            */
2848   {illegal,0     }, /* f8: 0110 0100 1111 1000 xxxx xxxx            */
2849   {EQI,"SMH,%b"   }, /* f9: 0110 0100 1111 1001 xxxx xxxx            */
2850   {illegal,0     }, /* fa: 0110 0100 1111 1010 xxxx xxxx            */
2851   {EQI,"EOM,%b"   }, /* fb: 0110 0100 1111 1011 xxxx xxxx            */
2852   {illegal,0     }, /* fc: 0110 0100 1111 1100 xxxx xxxx            */
2853   {EQI,"TMM,%b"   }, /* fd: 0110 0100 1111 1101 xxxx xxxx            */
2854   {EQI,"PT,%b"    }, /* fe: 0110 0100 1111 1110 xxxx xxxx            */
2855   {illegal,0     }   /* ff: 0110 0100 1111 1111 xxxx xxxx            */
28442856};
28452857
28462858/* prefix 70 */
28472859static const struct dasm_s  dasm70[256] =
28482860{
2849   {illegal,0,     2, 8}, /* 00: 0111 0000 0000 0000                      */
2850   {illegal,0,     2, 8}, /* 01: 0111 0000 0000 0001                      */
2851   {illegal,0,     2, 8}, /* 02: 0111 0000 0000 0010                      */
2852   {illegal,0,     2, 8}, /* 03: 0111 0000 0000 0011                      */
2853   {illegal,0,     2, 8}, /* 04: 0111 0000 0000 0100                      */
2854   {illegal,0,     2, 8}, /* 05: 0111 0000 0000 0101                      */
2855   {illegal,0,     2, 8}, /* 06: 0111 0000 0000 0110                      */
2856   {illegal,0,     2, 8}, /* 07: 0111 0000 0000 0111                      */
2857   {illegal,0,     2, 8}, /* 08: 0111 0000 0000 1000                      */
2858   {illegal,0,     2, 8}, /* 09: 0111 0000 0000 1001                      */
2859   {illegal,0,     2, 8}, /* 0a: 0111 0000 0000 1010                      */
2860   {illegal,0,     2, 8}, /* 0b: 0111 0000 0000 1011                      */
2861   {illegal,0,     2, 8}, /* 0c: 0111 0000 0000 1100                      */
2862   {illegal,0,     2, 8}, /* 0d: 0111 0000 0000 1101                      */
2863   {SSPD,"%w",      4,20}, /* 0e: 0111 0000 0000 1110 llll llll hhhh hhhh  */
2864   {LSPD,"%w",      4,20}, /* 0f: 0111 0000 0000 1111 llll llll hhhh hhhh  */
2861   {illegal,0     }, /* 00: 0111 0000 0000 0000                      */
2862   {illegal,0     }, /* 01: 0111 0000 0000 0001                      */
2863   {illegal,0     }, /* 02: 0111 0000 0000 0010                      */
2864   {illegal,0     }, /* 03: 0111 0000 0000 0011                      */
2865   {illegal,0     }, /* 04: 0111 0000 0000 0100                      */
2866   {illegal,0     }, /* 05: 0111 0000 0000 0101                      */
2867   {illegal,0     }, /* 06: 0111 0000 0000 0110                      */
2868   {illegal,0     }, /* 07: 0111 0000 0000 0111                      */
2869   {illegal,0     }, /* 08: 0111 0000 0000 1000                      */
2870   {illegal,0     }, /* 09: 0111 0000 0000 1001                      */
2871   {illegal,0     }, /* 0a: 0111 0000 0000 1010                      */
2872   {illegal,0     }, /* 0b: 0111 0000 0000 1011                      */
2873   {illegal,0     }, /* 0c: 0111 0000 0000 1100                      */
2874   {illegal,0     }, /* 0d: 0111 0000 0000 1101                      */
2875   {SSPD,"%w"      }, /* 0e: 0111 0000 0000 1110 llll llll hhhh hhhh  */
2876   {LSPD,"%w"      }, /* 0f: 0111 0000 0000 1111 llll llll hhhh hhhh  */
28652877
2866   {illegal,0,     2, 8}, /* 10: 0111 0000 0001 0000                      */
2867   {illegal,0,     2, 8}, /* 11: 0111 0000 0001 0001                      */
2868   {illegal,0,     2, 8}, /* 12: 0111 0000 0001 0010                      */
2869   {illegal,0,     2, 8}, /* 13: 0111 0000 0001 0011                      */
2870   {illegal,0,     2, 8}, /* 14: 0111 0000 0001 0100                      */
2871   {illegal,0,     2, 8}, /* 15: 0111 0000 0001 0101                      */
2872   {illegal,0,     2, 8}, /* 16: 0111 0000 0001 0110                      */
2873   {illegal,0,     2, 8}, /* 17: 0111 0000 0001 0111                      */
2874   {illegal,0,     2, 8}, /* 18: 0111 0000 0001 1000                      */
2875   {illegal,0,     2, 8}, /* 19: 0111 0000 0001 1001                      */
2876   {illegal,0,     2, 8}, /* 1a: 0111 0000 0001 1010                      */
2877   {illegal,0,     2, 8}, /* 1b: 0111 0000 0001 1011                      */
2878   {illegal,0,     2, 8}, /* 1c: 0111 0000 0001 1100                      */
2879   {illegal,0,     2, 8}, /* 1d: 0111 0000 0001 1101                      */
2880   {SBCD,"%w",      4,20}, /* 1e: 0111 0000 0001 1110 llll llll hhhh hhhh  */
2881   {LBCD,"%w",      4,20}, /* 1f: 0111 0000 0001 1111 llll llll hhhh hhhh  */
2878   {illegal,0     }, /* 10: 0111 0000 0001 0000                      */
2879   {illegal,0     }, /* 11: 0111 0000 0001 0001                      */
2880   {illegal,0     }, /* 12: 0111 0000 0001 0010                      */
2881   {illegal,0     }, /* 13: 0111 0000 0001 0011                      */
2882   {illegal,0     }, /* 14: 0111 0000 0001 0100                      */
2883   {illegal,0     }, /* 15: 0111 0000 0001 0101                      */
2884   {illegal,0     }, /* 16: 0111 0000 0001 0110                      */
2885   {illegal,0     }, /* 17: 0111 0000 0001 0111                      */
2886   {illegal,0     }, /* 18: 0111 0000 0001 1000                      */
2887   {illegal,0     }, /* 19: 0111 0000 0001 1001                      */
2888   {illegal,0     }, /* 1a: 0111 0000 0001 1010                      */
2889   {illegal,0     }, /* 1b: 0111 0000 0001 1011                      */
2890   {illegal,0     }, /* 1c: 0111 0000 0001 1100                      */
2891   {illegal,0     }, /* 1d: 0111 0000 0001 1101                      */
2892   {SBCD,"%w"      }, /* 1e: 0111 0000 0001 1110 llll llll hhhh hhhh  */
2893   {LBCD,"%w"      }, /* 1f: 0111 0000 0001 1111 llll llll hhhh hhhh  */
28822894
2883   {illegal,0,     2, 8}, /* 20: 0111 0000 0010 0000                      */
2884   {illegal,0,     2, 8}, /* 21: 0111 0000 0010 0001                      */
2885   {illegal,0,     2, 8}, /* 22: 0111 0000 0010 0010                      */
2886   {illegal,0,     2, 8}, /* 23: 0111 0000 0010 0011                      */
2887   {illegal,0,     2, 8}, /* 24: 0111 0000 0010 0100                      */
2888   {illegal,0,     2, 8}, /* 25: 0111 0000 0010 0101                      */
2889   {illegal,0,     2, 8}, /* 26: 0111 0000 0010 0110                      */
2890   {illegal,0,     2, 8}, /* 27: 0111 0000 0010 0111                      */
2891   {illegal,0,     2, 8}, /* 28: 0111 0000 0010 1000                      */
2892   {illegal,0,     2, 8}, /* 29: 0111 0000 0010 1001                      */
2893   {illegal,0,     2, 8}, /* 2a: 0111 0000 0010 1010                      */
2894   {illegal,0,     2, 8}, /* 2b: 0111 0000 0010 1011                      */
2895   {illegal,0,     2, 8}, /* 2c: 0111 0000 0010 1100                      */
2896   {illegal,0,     2, 8}, /* 2d: 0111 0000 0010 1101                      */
2897   {SDED,"%w",      4,20}, /* 2e: 0111 0000 0010 1110 llll llll hhhh hhhh  */
2898   {LDED,"%w",      4,20}, /* 2f: 0111 0000 0010 1111 llll llll hhhh hhhh  */
2895   {illegal,0     }, /* 20: 0111 0000 0010 0000                      */
2896   {illegal,0     }, /* 21: 0111 0000 0010 0001                      */
2897   {illegal,0     }, /* 22: 0111 0000 0010 0010                      */
2898   {illegal,0     }, /* 23: 0111 0000 0010 0011                      */
2899   {illegal,0     }, /* 24: 0111 0000 0010 0100                      */
2900   {illegal,0     }, /* 25: 0111 0000 0010 0101                      */
2901   {illegal,0     }, /* 26: 0111 0000 0010 0110                      */
2902   {illegal,0     }, /* 27: 0111 0000 0010 0111                      */
2903   {illegal,0     }, /* 28: 0111 0000 0010 1000                      */
2904   {illegal,0     }, /* 29: 0111 0000 0010 1001                      */
2905   {illegal,0     }, /* 2a: 0111 0000 0010 1010                      */
2906   {illegal,0     }, /* 2b: 0111 0000 0010 1011                      */
2907   {illegal,0     }, /* 2c: 0111 0000 0010 1100                      */
2908   {illegal,0     }, /* 2d: 0111 0000 0010 1101                      */
2909   {SDED,"%w"      }, /* 2e: 0111 0000 0010 1110 llll llll hhhh hhhh  */
2910   {LDED,"%w"      }, /* 2f: 0111 0000 0010 1111 llll llll hhhh hhhh  */
28992911
2900   {illegal,0,     2, 8}, /* 30: 0111 0000 0011 0000                      */
2901   {illegal,0,     2, 8}, /* 31: 0111 0000 0011 0001                      */
2902   {illegal,0,     2, 8}, /* 32: 0111 0000 0011 0010                      */
2903   {illegal,0,     2, 8}, /* 33: 0111 0000 0011 0011                      */
2904   {illegal,0,     2, 8}, /* 34: 0111 0000 0011 0100                      */
2905   {illegal,0,     2, 8}, /* 35: 0111 0000 0011 0101                      */
2906   {illegal,0,     2, 8}, /* 36: 0111 0000 0011 0110                      */
2907   {illegal,0,     2, 8}, /* 37: 0111 0000 0011 0111                      */
2908   {illegal,0,     2, 8}, /* 38: 0111 0000 0011 1000                      */
2909   {illegal,0,     2, 8}, /* 39: 0111 0000 0011 1001                      */
2910   {illegal,0,     2, 8}, /* 3a: 0111 0000 0011 1010                      */
2911   {illegal,0,     2, 8}, /* 3b: 0111 0000 0011 1011                      */
2912   {illegal,0,     2, 8}, /* 3c: 0111 0000 0011 1100                      */
2913   {illegal,0,     2, 8}, /* 3d: 0111 0000 0011 1101                      */
2914   {SHLD,"%w",      4,20}, /* 3e: 0111 0000 0011 1110 llll llll hhhh hhhh  */
2915   {LHLD,"%w",      4,20}, /* 3f: 0111 0000 0011 1111 llll llll hhhh hhhh  */
2912   {illegal,0     }, /* 30: 0111 0000 0011 0000                      */
2913   {illegal,0     }, /* 31: 0111 0000 0011 0001                      */
2914   {illegal,0     }, /* 32: 0111 0000 0011 0010                      */
2915   {illegal,0     }, /* 33: 0111 0000 0011 0011                      */
2916   {illegal,0     }, /* 34: 0111 0000 0011 0100                      */
2917   {illegal,0     }, /* 35: 0111 0000 0011 0101                      */
2918   {illegal,0     }, /* 36: 0111 0000 0011 0110                      */
2919   {illegal,0     }, /* 37: 0111 0000 0011 0111                      */
2920   {illegal,0     }, /* 38: 0111 0000 0011 1000                      */
2921   {illegal,0     }, /* 39: 0111 0000 0011 1001                      */
2922   {illegal,0     }, /* 3a: 0111 0000 0011 1010                      */
2923   {illegal,0     }, /* 3b: 0111 0000 0011 1011                      */
2924   {illegal,0     }, /* 3c: 0111 0000 0011 1100                      */
2925   {illegal,0     }, /* 3d: 0111 0000 0011 1101                      */
2926   {SHLD,"%w"      }, /* 3e: 0111 0000 0011 1110 llll llll hhhh hhhh  */
2927   {LHLD,"%w"      }, /* 3f: 0111 0000 0011 1111 llll llll hhhh hhhh  */
29162928
2917   {EADD,"EA,V",    2,11}, /* 40: 0111 0000 0100 0000                      */
2918   {EADD,"EA,A",    2,11}, /* 41: 0111 0000 0100 0001                      */
2919   {EADD,"EA,B",    2,11}, /* 42: 0111 0000 0100 0010                      */
2920   {EADD,"EA,C",    2,11}, /* 43: 0111 0000 0100 0011                      */
2921   {illegal,0,     2, 8}, /* 44: 0111 0000 0100 0100                      */
2922   {illegal,0,     2, 8}, /* 45: 0111 0000 0100 0101                      */
2923   {illegal,0,     2, 8}, /* 46: 0111 0000 0100 0110                      */
2924   {illegal,0,     2, 8}, /* 47: 0111 0000 0100 0111                      */
2925   {illegal,0,     2, 8}, /* 48: 0111 0000 0100 1000                      */
2926   {illegal,0,     2, 8}, /* 49: 0111 0000 0100 1001                      */
2927   {illegal,0,     2, 8}, /* 4a: 0111 0000 0100 1010                      */
2928   {illegal,0,     2, 8}, /* 4b: 0111 0000 0100 1011                      */
2929   {illegal,0,     2, 8}, /* 4c: 0111 0000 0100 1100                      */
2930   {illegal,0,     2, 8}, /* 4d: 0111 0000 0100 1101                      */
2931   {illegal,0,     2, 8}, /* 4e: 0111 0000 0100 1110                      */
2932   {illegal,0,     2, 8}, /* 4f: 0111 0000 0100 1111                      */
2929   {EADD,"EA,V"    }, /* 40: 0111 0000 0100 0000                      */
2930   {EADD,"EA,A"    }, /* 41: 0111 0000 0100 0001                      */
2931   {EADD,"EA,B"    }, /* 42: 0111 0000 0100 0010                      */
2932   {EADD,"EA,C"    }, /* 43: 0111 0000 0100 0011                      */
2933   {illegal,0     }, /* 44: 0111 0000 0100 0100                      */
2934   {illegal,0     }, /* 45: 0111 0000 0100 0101                      */
2935   {illegal,0     }, /* 46: 0111 0000 0100 0110                      */
2936   {illegal,0     }, /* 47: 0111 0000 0100 0111                      */
2937   {illegal,0     }, /* 48: 0111 0000 0100 1000                      */
2938   {illegal,0     }, /* 49: 0111 0000 0100 1001                      */
2939   {illegal,0     }, /* 4a: 0111 0000 0100 1010                      */
2940   {illegal,0     }, /* 4b: 0111 0000 0100 1011                      */
2941   {illegal,0     }, /* 4c: 0111 0000 0100 1100                      */
2942   {illegal,0     }, /* 4d: 0111 0000 0100 1101                      */
2943   {illegal,0     }, /* 4e: 0111 0000 0100 1110                      */
2944   {illegal,0     }, /* 4f: 0111 0000 0100 1111                      */
29332945
2934   {illegal,0,     2, 8}, /* 50: 0111 0000 0101 0000                      */
2935   {illegal,0,     2, 8}, /* 51: 0111 0000 0101 0001                      */
2936   {illegal,0,     2, 8}, /* 52: 0111 0000 0101 0010                      */
2937   {illegal,0,     2, 8}, /* 53: 0111 0000 0101 0011                      */
2938   {illegal,0,     2, 8}, /* 54: 0111 0000 0101 0100                      */
2939   {illegal,0,     2, 8}, /* 55: 0111 0000 0101 0101                      */
2940   {illegal,0,     2, 8}, /* 56: 0111 0000 0101 0110                      */
2941   {illegal,0,     2, 8}, /* 57: 0111 0000 0101 0111                      */
2942   {illegal,0,     2, 8}, /* 58: 0111 0000 0101 1000                      */
2943   {illegal,0,     2, 8}, /* 59: 0111 0000 0101 1001                      */
2944   {illegal,0,     2, 8}, /* 5a: 0111 0000 0101 1010                      */
2945   {illegal,0,     2, 8}, /* 5b: 0111 0000 0101 1011                      */
2946   {illegal,0,     2, 8}, /* 5c: 0111 0000 0101 1100                      */
2947   {illegal,0,     2, 8}, /* 5d: 0111 0000 0101 1101                      */
2948   {illegal,0,     2, 8}, /* 5e: 0111 0000 0101 1110                      */
2949   {illegal,0,     2, 8}, /* 5f: 0111 0000 0101 1111                      */
2946   {illegal,0     }, /* 50: 0111 0000 0101 0000                      */
2947   {illegal,0     }, /* 51: 0111 0000 0101 0001                      */
2948   {illegal,0     }, /* 52: 0111 0000 0101 0010                      */
2949   {illegal,0     }, /* 53: 0111 0000 0101 0011                      */
2950   {illegal,0     }, /* 54: 0111 0000 0101 0100                      */
2951   {illegal,0     }, /* 55: 0111 0000 0101 0101                      */
2952   {illegal,0     }, /* 56: 0111 0000 0101 0110                      */
2953   {illegal,0     }, /* 57: 0111 0000 0101 0111                      */
2954   {illegal,0     }, /* 58: 0111 0000 0101 1000                      */
2955   {illegal,0     }, /* 59: 0111 0000 0101 1001                      */
2956   {illegal,0     }, /* 5a: 0111 0000 0101 1010                      */
2957   {illegal,0     }, /* 5b: 0111 0000 0101 1011                      */
2958   {illegal,0     }, /* 5c: 0111 0000 0101 1100                      */
2959   {illegal,0     }, /* 5d: 0111 0000 0101 1101                      */
2960   {illegal,0     }, /* 5e: 0111 0000 0101 1110                      */
2961   {illegal,0     }, /* 5f: 0111 0000 0101 1111                      */
29502962
2951   {ESUB,"EA,V",    2,11}, /* 60: 0111 0000 0110 0000                      */
2952   {ESUB,"EA,A",    2,11}, /* 61: 0111 0000 0110 0001                      */
2953   {ESUB,"EA,B",    2,11}, /* 62: 0111 0000 0110 0010                      */
2954   {ESUB,"EA,C",    2,11}, /* 63: 0111 0000 0110 0011                      */
2955   {illegal,0,     2, 8}, /* 64: 0111 0000 0110 0100                      */
2956   {illegal,0,     2, 8}, /* 65: 0111 0000 0110 0101                      */
2957   {illegal,0,     2, 8}, /* 66: 0111 0000 0110 0110                      */
2958   {illegal,0,     2, 8}, /* 67: 0111 0000 0110 0111                      */
2959   {MOV,"V,(%w)",   4,17}, /* 68: 0111 0000 0110 1000 llll llll hhhh hhhh  */
2960   {MOV,"A,(%w)",   4,17}, /* 69: 0111 0000 0110 1001 llll llll hhhh hhhh  */
2961   {MOV,"B,(%w)",   4,17}, /* 6a: 0111 0000 0110 1010 llll llll hhhh hhhh  */
2962   {MOV,"C,(%w)",   4,17}, /* 6b: 0111 0000 0110 1011 llll llll hhhh hhhh  */
2963   {MOV,"D,(%w)",   4,17}, /* 6c: 0111 0000 0110 1100 llll llll hhhh hhhh  */
2964   {MOV,"E,(%w)",   4,17}, /* 6d: 0111 0000 0110 1101 llll llll hhhh hhhh  */
2965   {MOV,"H,(%w)",   4,17}, /* 6e: 0111 0000 0110 1110 llll llll hhhh hhhh  */
2966   {MOV,"L,(%w)",   4,17}, /* 6f: 0111 0000 0110 1111 llll llll hhhh hhhh  */
2963   {ESUB,"EA,V"    }, /* 60: 0111 0000 0110 0000                      */
2964   {ESUB,"EA,A"    }, /* 61: 0111 0000 0110 0001                      */
2965   {ESUB,"EA,B"    }, /* 62: 0111 0000 0110 0010                      */
2966   {ESUB,"EA,C"    }, /* 63: 0111 0000 0110 0011                      */
2967   {illegal,0     }, /* 64: 0111 0000 0110 0100                      */
2968   {illegal,0     }, /* 65: 0111 0000 0110 0101                      */
2969   {illegal,0     }, /* 66: 0111 0000 0110 0110                      */
2970   {illegal,0     }, /* 67: 0111 0000 0110 0111                      */
2971   {MOV,"V,(%w)"   }, /* 68: 0111 0000 0110 1000 llll llll hhhh hhhh  */
2972   {MOV,"A,(%w)"   }, /* 69: 0111 0000 0110 1001 llll llll hhhh hhhh  */
2973   {MOV,"B,(%w)"   }, /* 6a: 0111 0000 0110 1010 llll llll hhhh hhhh  */
2974   {MOV,"C,(%w)"   }, /* 6b: 0111 0000 0110 1011 llll llll hhhh hhhh  */
2975   {MOV,"D,(%w)"   }, /* 6c: 0111 0000 0110 1100 llll llll hhhh hhhh  */
2976   {MOV,"E,(%w)"   }, /* 6d: 0111 0000 0110 1101 llll llll hhhh hhhh  */
2977   {MOV,"H,(%w)"   }, /* 6e: 0111 0000 0110 1110 llll llll hhhh hhhh  */
2978   {MOV,"L,(%w)"   }, /* 6f: 0111 0000 0110 1111 llll llll hhhh hhhh  */
29672979
2968   {illegal,0,     2, 8}, /* 70: 0111 0000 0111 0000                      */
2969   {illegal,0,     2, 8}, /* 71: 0111 0000 0111 0001                      */
2970   {illegal,0,     2, 8}, /* 72: 0111 0000 0111 0010                      */
2971   {illegal,0,     2, 8}, /* 73: 0111 0000 0111 0011                      */
2972   {illegal,0,     2, 8}, /* 74: 0111 0000 0111 0100                      */
2973   {illegal,0,     2, 8}, /* 75: 0111 0000 0111 0101                      */
2974   {illegal,0,     2, 8}, /* 76: 0111 0000 0111 0110                      */
2975   {illegal,0,     2, 8}, /* 77: 0111 0000 0111 0111                      */
2976   {MOV,"(%w),V",   4,17}, /* 78: 0111 0000 0111 1000 llll llll hhhh hhhh  */
2977   {MOV,"(%w),A",   4,17}, /* 79: 0111 0000 0111 1001 llll llll hhhh hhhh  */
2978   {MOV,"(%w),B",   4,17}, /* 7a: 0111 0000 0111 1010 llll llll hhhh hhhh  */
2979   {MOV,"(%w),C",   4,17}, /* 7b: 0111 0000 0111 1011 llll llll hhhh hhhh  */
2980   {MOV,"(%w),D",   4,17}, /* 7c: 0111 0000 0111 1100 llll llll hhhh hhhh  */
2981   {MOV,"(%w),E",   4,17}, /* 7d: 0111 0000 0111 1101 llll llll hhhh hhhh  */
2982   {MOV,"(%w),H",   4,17}, /* 7e: 0111 0000 0111 1110 llll llll hhhh hhhh  */
2983   {MOV,"(%w),L",   4,17}, /* 7f: 0111 0000 0111 1111 llll llll hhhh hhhh  */
2980   {illegal,0     }, /* 70: 0111 0000 0111 0000                      */
2981   {illegal,0     }, /* 71: 0111 0000 0111 0001                      */
2982   {illegal,0     }, /* 72: 0111 0000 0111 0010                      */
2983   {illegal,0     }, /* 73: 0111 0000 0111 0011                      */
2984   {illegal,0     }, /* 74: 0111 0000 0111 0100                      */
2985   {illegal,0     }, /* 75: 0111 0000 0111 0101                      */
2986   {illegal,0     }, /* 76: 0111 0000 0111 0110                      */
2987   {illegal,0     }, /* 77: 0111 0000 0111 0111                      */
2988   {MOV,"(%w),V"   }, /* 78: 0111 0000 0111 1000 llll llll hhhh hhhh  */
2989   {MOV,"(%w),A"   }, /* 79: 0111 0000 0111 1001 llll llll hhhh hhhh  */
2990   {MOV,"(%w),B"   }, /* 7a: 0111 0000 0111 1010 llll llll hhhh hhhh  */
2991   {MOV,"(%w),C"   }, /* 7b: 0111 0000 0111 1011 llll llll hhhh hhhh  */
2992   {MOV,"(%w),D"   }, /* 7c: 0111 0000 0111 1100 llll llll hhhh hhhh  */
2993   {MOV,"(%w),E"   }, /* 7d: 0111 0000 0111 1101 llll llll hhhh hhhh  */
2994   {MOV,"(%w),H"   }, /* 7e: 0111 0000 0111 1110 llll llll hhhh hhhh  */
2995   {MOV,"(%w),L"   }, /* 7f: 0111 0000 0111 1111 llll llll hhhh hhhh  */
29842996
2985   {illegal,0,     2, 8}, /* 80: 0111 0000 1000 0000                      */
2986   {illegal,0,     2, 8}, /* 81: 0111 0000 1000 0001                      */
2987   {illegal,0,     2, 8}, /* 82: 0111 0000 1000 0010                      */
2988   {illegal,0,     2, 8}, /* 83: 0111 0000 1000 0011                      */
2989   {illegal,0,     2, 8}, /* 84: 0111 0000 1000 0100                      */
2990   {illegal,0,     2, 8}, /* 85: 0111 0000 1000 0101                      */
2991   {illegal,0,     2, 8}, /* 86: 0111 0000 1000 0110                      */
2992   {illegal,0,     2, 8}, /* 87: 0111 0000 1000 0111                      */
2993   {illegal,0,     2,11}, /* 88: 0111 0000 1000 1000                      */
2994   {ANAX,"(BC)",    2,11}, /* 89: 0111 0000 1000 1001                      */
2995   {ANAX,"(DE)",    2,11}, /* 8a: 0111 0000 1000 1010                      */
2996   {ANAX,"(HL)",    2,11}, /* 8b: 0111 0000 1000 1011                      */
2997   {ANAX,"(DE+)",   2,11}, /* 8c: 0111 0000 1000 1100                      */
2998   {ANAX,"(HL+)",   2,11}, /* 8d: 0111 0000 1000 1101                      */
2999   {ANAX,"(DE-)",   2,11}, /* 8e: 0111 0000 1000 1110                      */
3000   {ANAX,"(HL-)",   2,11}, /* 8f: 0111 0000 1000 1111                      */
2997   {illegal,0     }, /* 80: 0111 0000 1000 0000                      */
2998   {illegal,0     }, /* 81: 0111 0000 1000 0001                      */
2999   {illegal,0     }, /* 82: 0111 0000 1000 0010                      */
3000   {illegal,0     }, /* 83: 0111 0000 1000 0011                      */
3001   {illegal,0     }, /* 84: 0111 0000 1000 0100                      */
3002   {illegal,0     }, /* 85: 0111 0000 1000 0101                      */
3003   {illegal,0     }, /* 86: 0111 0000 1000 0110                      */
3004   {illegal,0     }, /* 87: 0111 0000 1000 0111                      */
3005   {illegal,0     }, /* 88: 0111 0000 1000 1000                      */
3006   {ANAX,"(BC)"    }, /* 89: 0111 0000 1000 1001                      */
3007   {ANAX,"(DE)"    }, /* 8a: 0111 0000 1000 1010                      */
3008   {ANAX,"(HL)"    }, /* 8b: 0111 0000 1000 1011                      */
3009   {ANAX,"(DE+)"   }, /* 8c: 0111 0000 1000 1100                      */
3010   {ANAX,"(HL+)"   }, /* 8d: 0111 0000 1000 1101                      */
3011   {ANAX,"(DE-)"   }, /* 8e: 0111 0000 1000 1110                      */
3012   {ANAX,"(HL-)"   }, /* 8f: 0111 0000 1000 1111                      */
30013013
3002   {illegal,0,     2,11}, /* 90: 0111 0000 1001 0000                      */
3003   {XRAX,"(BC)",    2,11}, /* 91: 0111 0000 1001 0001                      */
3004   {XRAX,"(DE)",    2,11}, /* 92: 0111 0000 1001 0010                      */
3005   {XRAX,"(HL)",    2,11}, /* 93: 0111 0000 1001 0011                      */
3006   {XRAX,"(DE+)",   2,11}, /* 94: 0111 0000 1001 0100                      */
3007   {XRAX,"(HL+)",   2,11}, /* 95: 0111 0000 1001 0101                      */
3008   {XRAX,"(DE-)",   2,11}, /* 96: 0111 0000 1001 0110                      */
3009   {XRAX,"(HL-)",   2,11}, /* 97: 0111 0000 1001 0111                      */
3010   {illegal,0,     2, 8}, /* 98: 0111 0000 1001 1000                      */
3011   {ORAX,"(BC)",     2, 8}, /* 99: 0111 0000 1001 1001                      */
3012   {ORAX,"(DE)",     2, 8}, /* 9a: 0111 0000 1001 1010                      */
3013   {ORAX,"(HL)",     2, 8}, /* 9b: 0111 0000 1001 1011                      */
3014   {ORAX,"(DE+)",     2, 8}, /* 9c: 0111 0000 1001 1100                      */
3015   {ORAX,"(HL+)",     2, 8}, /* 9d: 0111 0000 1001 1101                      */
3016   {ORAX,"(DE-)",     2, 8}, /* 9e: 0111 0000 1001 1110                      */
3017   {ORAX,"(HL-)",     2, 8}, /* 9f: 0111 0000 1001 1111                      */
3014   {illegal,0     }, /* 90: 0111 0000 1001 0000                      */
3015   {XRAX,"(BC)"    }, /* 91: 0111 0000 1001 0001                      */
3016   {XRAX,"(DE)"    }, /* 92: 0111 0000 1001 0010                      */
3017   {XRAX,"(HL)"    }, /* 93: 0111 0000 1001 0011                      */
3018   {XRAX,"(DE+)"   }, /* 94: 0111 0000 1001 0100                      */
3019   {XRAX,"(HL+)"   }, /* 95: 0111 0000 1001 0101                      */
3020   {XRAX,"(DE-)"   }, /* 96: 0111 0000 1001 0110                      */
3021   {XRAX,"(HL-)"   }, /* 97: 0111 0000 1001 0111                      */
3022   {illegal,0     }, /* 98: 0111 0000 1001 1000                      */
3023   {ORAX,"(BC)"     }, /* 99: 0111 0000 1001 1001                      */
3024   {ORAX,"(DE)"     }, /* 9a: 0111 0000 1001 1010                      */
3025   {ORAX,"(HL)"     }, /* 9b: 0111 0000 1001 1011                      */
3026   {ORAX,"(DE+)"     }, /* 9c: 0111 0000 1001 1100                      */
3027   {ORAX,"(HL+)"     }, /* 9d: 0111 0000 1001 1101                      */
3028   {ORAX,"(DE-)"     }, /* 9e: 0111 0000 1001 1110                      */
3029   {ORAX,"(HL-)"     }, /* 9f: 0111 0000 1001 1111                      */
30183030
3019   {illegal,0,     2,11}, /* a0: 0111 0000 1010 0000                      */
3020   {ADDNCX,"(BC)",  2,11}, /* a1: 0111 0000 1010 0001                      */
3021   {ADDNCX,"(DE)",  2,11}, /* a2: 0111 0000 1010 0010                      */
3022   {ADDNCX,"(HL)",  2,11}, /* a3: 0111 0000 1010 0011                      */
3023   {ADDNCX,"(DE+)", 2,11}, /* a4: 0111 0000 1010 0100                      */
3024   {ADDNCX,"(HL+)", 2,11}, /* a5: 0111 0000 1010 0101                      */
3025   {ADDNCX,"(DE-)", 2,11}, /* a6: 0111 0000 1010 0110                      */
3026   {ADDNCX,"(HL-)", 2,11}, /* a7: 0111 0000 1010 0111                      */
3027   {illegal,0,     2,11}, /* a8: 0111 0000 1010 1000                      */
3028   {GTAX,"(BC)",    2,11}, /* a9: 0111 0000 1010 1001                      */
3029   {GTAX,"(DE)",    2,11}, /* aa: 0111 0000 1010 1010                      */
3030   {GTAX,"(HL)",    2,11}, /* ab: 0111 0000 1010 1011                      */
3031   {GTAX,"(DE+)",   2,11}, /* ac: 0111 0000 1010 1100                      */
3032   {GTAX,"(HL+)",   2,11}, /* ad: 0111 0000 1010 1101                      */
3033   {GTAX,"(DE-)",   2,11}, /* ae: 0111 0000 1010 1110                      */
3034   {GTAX,"(HL-)",   2,11}, /* af: 0111 0000 1010 1111                      */
3031   {illegal,0     }, /* a0: 0111 0000 1010 0000                      */
3032   {ADDNCX,"(BC)"  }, /* a1: 0111 0000 1010 0001                      */
3033   {ADDNCX,"(DE)"  }, /* a2: 0111 0000 1010 0010                      */
3034   {ADDNCX,"(HL)"  }, /* a3: 0111 0000 1010 0011                      */
3035   {ADDNCX,"(DE+)" }, /* a4: 0111 0000 1010 0100                      */
3036   {ADDNCX,"(HL+)" }, /* a5: 0111 0000 1010 0101                      */
3037   {ADDNCX,"(DE-)" }, /* a6: 0111 0000 1010 0110                      */
3038   {ADDNCX,"(HL-)" }, /* a7: 0111 0000 1010 0111                      */
3039   {illegal,0     }, /* a8: 0111 0000 1010 1000                      */
3040   {GTAX,"(BC)"    }, /* a9: 0111 0000 1010 1001                      */
3041   {GTAX,"(DE)"    }, /* aa: 0111 0000 1010 1010                      */
3042   {GTAX,"(HL)"    }, /* ab: 0111 0000 1010 1011                      */
3043   {GTAX,"(DE+)"   }, /* ac: 0111 0000 1010 1100                      */
3044   {GTAX,"(HL+)"   }, /* ad: 0111 0000 1010 1101                      */
3045   {GTAX,"(DE-)"   }, /* ae: 0111 0000 1010 1110                      */
3046   {GTAX,"(HL-)"   }, /* af: 0111 0000 1010 1111                      */
30353047
3036   {illegal,0,     2,11}, /* b0: 0111 0000 1011 0000                      */
3037   {SUBNBX,"(BC)",  2,11}, /* b1: 0111 0000 1011 0001                      */
3038   {SUBNBX,"(DE)",  2,11}, /* b2: 0111 0000 1011 0010                      */
3039   {SUBNBX,"(HL)",  2,11}, /* b3: 0111 0000 1011 0011                      */
3040   {SUBNBX,"(DE+)", 2,11}, /* b4: 0111 0000 1011 0100                      */
3041   {SUBNBX,"(HL+)", 2,11}, /* b5: 0111 0000 1011 0101                      */
3042   {SUBNBX,"(DE-)", 2,11}, /* b6: 0111 0000 1011 0110                      */
3043   {SUBNBX,"(HL-)", 2,11}, /* b7: 0111 0000 1011 0111                      */
3044   {illegal,0,     2,11}, /* b8: 0111 0000 1011 1000                      */
3045   {LTAX,"(BC)",    2,11}, /* b9: 0111 0000 1011 1001                      */
3046   {LTAX,"(DE)",    2,11}, /* ba: 0111 0000 1011 1010                      */
3047   {LTAX,"(HL)",    2,11}, /* bb: 0111 0000 1011 1011                      */
3048   {LTAX,"(DE+)",   2,11}, /* bc: 0111 0000 1011 1100                      */
3049   {LTAX,"(HL+)",   2,11}, /* bd: 0111 0000 1011 1101                      */
3050   {LTAX,"(DE-)",   2,11}, /* be: 0111 0000 1011 1110                      */
3051   {LTAX,"(HL-)",   2,11}, /* bf: 0111 0000 1011 1111                      */
3048   {illegal,0     }, /* b0: 0111 0000 1011 0000                      */
3049   {SUBNBX,"(BC)"  }, /* b1: 0111 0000 1011 0001                      */
3050   {SUBNBX,"(DE)"  }, /* b2: 0111 0000 1011 0010                      */
3051   {SUBNBX,"(HL)"  }, /* b3: 0111 0000 1011 0011                      */
3052   {SUBNBX,"(DE+)" }, /* b4: 0111 0000 1011 0100                      */
3053   {SUBNBX,"(HL+)" }, /* b5: 0111 0000 1011 0101                      */
3054   {SUBNBX,"(DE-)" }, /* b6: 0111 0000 1011 0110                      */
3055   {SUBNBX,"(HL-)" }, /* b7: 0111 0000 1011 0111                      */
3056   {illegal,0     }, /* b8: 0111 0000 1011 1000                      */
3057   {LTAX,"(BC)"    }, /* b9: 0111 0000 1011 1001                      */
3058   {LTAX,"(DE)"    }, /* ba: 0111 0000 1011 1010                      */
3059   {LTAX,"(HL)"    }, /* bb: 0111 0000 1011 1011                      */
3060   {LTAX,"(DE+)"   }, /* bc: 0111 0000 1011 1100                      */
3061   {LTAX,"(HL+)"   }, /* bd: 0111 0000 1011 1101                      */
3062   {LTAX,"(DE-)"   }, /* be: 0111 0000 1011 1110                      */
3063   {LTAX,"(HL-)"   }, /* bf: 0111 0000 1011 1111                      */
30523064
3053   {illegal,0,     2,11}, /* c0: 0111 0000 1100 0000                      */
3054   {ADDX,"(BC)",    2,11}, /* c1: 0111 0000 1100 0001                      */
3055   {ADDX,"(DE)",    2,11}, /* c2: 0111 0000 1100 0010                      */
3056   {ADDX,"(HL)",    2,11}, /* c3: 0111 0000 1100 0011                      */
3057   {ADDX,"(DE+)",   2,11}, /* c4: 0111 0000 1100 0100                      */
3058   {ADDX,"(HL+)",   2,11}, /* c5: 0111 0000 1100 0101                      */
3059   {ADDX,"(DE-)",   2,11}, /* c6: 0111 0000 1100 0110                      */
3060   {ADDX,"(HL-)",   2,11}, /* c7: 0111 0000 1100 0111                      */
3061   {illegal,0,     2,11}, /* c8: 0111 0000 1100 1000                      */
3062   {ONAX,"(BC)",    2,11}, /* c9: 0111 0000 1100 1001                      */
3063   {ONAX,"(DE)",    2,11}, /* ca: 0111 0000 1100 1010                      */
3064   {ONAX,"(HL)",    2,11}, /* cb: 0111 0000 1100 1011                      */
3065   {ONAX,"(DE+)",   2,11}, /* cc: 0111 0000 1100 1100                      */
3066   {ONAX,"(HL+)",   2,11}, /* cd: 0111 0000 1100 1101                      */
3067   {ONAX,"(DE-)",   2,11}, /* ce: 0111 0000 1100 1110                      */
3068   {ONAX,"(HL-)",   2,11}, /* cf: 0111 0000 1100 1111                      */
3065   {illegal,0     }, /* c0: 0111 0000 1100 0000                      */
3066   {ADDX,"(BC)"    }, /* c1: 0111 0000 1100 0001                      */
3067   {ADDX,"(DE)"    }, /* c2: 0111 0000 1100 0010                      */
3068   {ADDX,"(HL)"    }, /* c3: 0111 0000 1100 0011                      */
3069   {ADDX,"(DE+)"   }, /* c4: 0111 0000 1100 0100                      */
3070   {ADDX,"(HL+)"   }, /* c5: 0111 0000 1100 0101                      */
3071   {ADDX,"(DE-)"   }, /* c6: 0111 0000 1100 0110                      */
3072   {ADDX,"(HL-)"   }, /* c7: 0111 0000 1100 0111                      */
3073   {illegal,0     }, /* c8: 0111 0000 1100 1000                      */
3074   {ONAX,"(BC)"    }, /* c9: 0111 0000 1100 1001                      */
3075   {ONAX,"(DE)"    }, /* ca: 0111 0000 1100 1010                      */
3076   {ONAX,"(HL)"    }, /* cb: 0111 0000 1100 1011                      */
3077   {ONAX,"(DE+)"   }, /* cc: 0111 0000 1100 1100                      */
3078   {ONAX,"(HL+)"   }, /* cd: 0111 0000 1100 1101                      */
3079   {ONAX,"(DE-)"   }, /* ce: 0111 0000 1100 1110                      */
3080   {ONAX,"(HL-)"   }, /* cf: 0111 0000 1100 1111                      */
30693081
3070   {illegal,0,     2,11}, /* d0: 0111 0000 1101 0000                      */
3071   {ADCX,"(BC)",    2,11}, /* d1: 0111 0000 1101 0001                      */
3072   {ADCX,"(DE)",    2,11}, /* d2: 0111 0000 1101 0010                      */
3073   {ADCX,"(HL)",    2,11}, /* d3: 0111 0000 1101 0011                      */
3074   {ADCX,"(DE+)",   2,11}, /* d4: 0111 0000 1101 0100                      */
3075   {ADCX,"(HL+)",   2,11}, /* d5: 0111 0000 1101 0101                      */
3076   {ADCX,"(DE-)",   2,11}, /* d6: 0111 0000 1101 0110                      */
3077   {ADCX,"(HL-)",   2,11}, /* d7: 0111 0000 1101 0111                      */
3078   {illegal,0,     2,11}, /* d8: 0111 0000 1101 1000                      */
3079   {OFFAX,"(BC)",   2,11}, /* d9: 0111 0000 1101 1001                      */
3080   {OFFAX,"(DE)",   2,11}, /* da: 0111 0000 1101 1010                      */
3081   {OFFAX,"(HL)",   2,11}, /* db: 0111 0000 1101 1011                      */
3082   {OFFAX,"(DE+)",  2,11}, /* dc: 0111 0000 1101 1100                      */
3083   {OFFAX,"(HL+)",  2,11}, /* dd: 0111 0000 1101 1101                      */
3084   {OFFAX,"(DE-)",  2,11}, /* de: 0111 0000 1101 1110                      */
3085   {OFFAX,"(HL-)",  2,11}, /* df: 0111 0000 1101 1111                      */
3082   {illegal,0     }, /* d0: 0111 0000 1101 0000                      */
3083   {ADCX,"(BC)"    }, /* d1: 0111 0000 1101 0001                      */
3084   {ADCX,"(DE)"    }, /* d2: 0111 0000 1101 0010                      */
3085   {ADCX,"(HL)"    }, /* d3: 0111 0000 1101 0011                      */
3086   {ADCX,"(DE+)"   }, /* d4: 0111 0000 1101 0100                      */
3087   {ADCX,"(HL+)"   }, /* d5: 0111 0000 1101 0101                      */
3088   {ADCX,"(DE-)"   }, /* d6: 0111 0000 1101 0110                      */
3089   {ADCX,"(HL-)"   }, /* d7: 0111 0000 1101 0111                      */
3090   {illegal,0     }, /* d8: 0111 0000 1101 1000                      */
3091   {OFFAX,"(BC)"   }, /* d9: 0111 0000 1101 1001                      */
3092   {OFFAX,"(DE)"   }, /* da: 0111 0000 1101 1010                      */
3093   {OFFAX,"(HL)"   }, /* db: 0111 0000 1101 1011                      */
3094   {OFFAX,"(DE+)"  }, /* dc: 0111 0000 1101 1100                      */
3095   {OFFAX,"(HL+)"  }, /* dd: 0111 0000 1101 1101                      */
3096   {OFFAX,"(DE-)"  }, /* de: 0111 0000 1101 1110                      */
3097   {OFFAX,"(HL-)"  }, /* df: 0111 0000 1101 1111                      */
30863098
3087   {illegal,0,     2,11}, /* e0: 0111 0000 1110 0000                      */
3088   {SUBX,"(BC)",    2,11}, /* e1: 0111 0000 1110 0001                      */
3089   {SUBX,"(DE)",    2,11}, /* e2: 0111 0000 1110 0010                      */
3090   {SUBX,"(HL)",    2,11}, /* e3: 0111 0000 1110 0011                      */
3091   {SUBX,"(DE+)",   2,11}, /* e4: 0111 0000 1110 0100                      */
3092   {SUBX,"(HL+)",   2,11}, /* e5: 0111 0000 1110 0101                      */
3093   {SUBX,"(DE-)",   2,11}, /* e6: 0111 0000 1110 0110                      */
3094   {SUBX,"(HL-)",   2,11}, /* e7: 0111 0000 1110 0111                      */
3095   {illegal,0,     2,11}, /* e8: 0111 0000 1110 1000                      */
3096   {NEAX,"(BC)",    2,11}, /* e9: 0111 0000 1110 1001                      */
3097   {NEAX,"(DE)",    2,11}, /* ea: 0111 0000 1110 1010                      */
3098   {NEAX,"(HL)",    2,11}, /* eb: 0111 0000 1110 1011                      */
3099   {NEAX,"(DE+)",   2,11}, /* ec: 0111 0000 1110 1100                      */
3100   {NEAX,"(HL+)",   2,11}, /* ed: 0111 0000 1110 1101                      */
3101   {NEAX,"(DE-)",   2,11}, /* ee: 0111 0000 1110 1110                      */
3102   {NEAX,"(HL-)",   2,11}, /* ef: 0111 0000 1110 1111                      */
3099   {illegal,0     }, /* e0: 0111 0000 1110 0000                      */
3100   {SUBX,"(BC)"    }, /* e1: 0111 0000 1110 0001                      */
3101   {SUBX,"(DE)"    }, /* e2: 0111 0000 1110 0010                      */
3102   {SUBX,"(HL)"    }, /* e3: 0111 0000 1110 0011                      */
3103   {SUBX,"(DE+)"   }, /* e4: 0111 0000 1110 0100                      */
3104   {SUBX,"(HL+)"   }, /* e5: 0111 0000 1110 0101                      */
3105   {SUBX,"(DE-)"   }, /* e6: 0111 0000 1110 0110                      */
3106   {SUBX,"(HL-)"   }, /* e7: 0111 0000 1110 0111                      */
3107   {illegal,0     }, /* e8: 0111 0000 1110 1000                      */
3108   {NEAX,"(BC)"    }, /* e9: 0111 0000 1110 1001                      */
3109   {NEAX,"(DE)"    }, /* ea: 0111 0000 1110 1010                      */
3110   {NEAX,"(HL)"    }, /* eb: 0111 0000 1110 1011                      */
3111   {NEAX,"(DE+)"   }, /* ec: 0111 0000 1110 1100                      */
3112   {NEAX,"(HL+)"   }, /* ed: 0111 0000 1110 1101                      */
3113   {NEAX,"(DE-)"   }, /* ee: 0111 0000 1110 1110                      */
3114   {NEAX,"(HL-)"   }, /* ef: 0111 0000 1110 1111                      */
31033115
3104   {illegal,0,     2,11}, /* f0: 0111 0000 1111 0000                      */
3105   {SBBX,"(BC)",    2,11}, /* f1: 0111 0000 1111 0001                      */
3106   {SBBX,"(DE)",    2,11}, /* f2: 0111 0000 1111 0010                      */
3107   {SBBX,"(HL)",    2,11}, /* f3: 0111 0000 1111 0011                      */
3108   {SBBX,"(DE+)",   2,11}, /* f4: 0111 0000 1111 0100                      */
3109   {SBBX,"(HL+)",   2,11}, /* f5: 0111 0000 1111 0101                      */
3110   {SBBX,"(DE-)",   2,11}, /* f6: 0111 0000 1111 0110                      */
3111   {SBBX,"(HL-)",   2,11}, /* f7: 0111 0000 1111 0111                      */
3112   {illegal,0,     2,11}, /* f8: 0111 0000 1111 1000                      */
3113   {EQAX,"(BC)",    2,11}, /* f9: 0111 0000 1111 1001                      */
3114   {EQAX,"(DE)",    2,11}, /* fa: 0111 0000 1111 1010                      */
3115   {EQAX,"(HL)",    2,11}, /* fb: 0111 0000 1111 1011                      */
3116   {EQAX,"(DE+)",   2,11}, /* fc: 0111 0000 1111 1100                      */
3117   {EQAX,"(HL+)",   2,11}, /* fd: 0111 0000 1111 1101                      */
3118   {EQAX,"(DE-)",   2,11}, /* fe: 0111 0000 1111 1110                      */
3119   {EQAX,"(HL-)",   2,11}  /* ff: 0111 0000 1111 1111                      */
3116   {illegal,0     }, /* f0: 0111 0000 1111 0000                      */
3117   {SBBX,"(BC)"    }, /* f1: 0111 0000 1111 0001                      */
3118   {SBBX,"(DE)"    }, /* f2: 0111 0000 1111 0010                      */
3119   {SBBX,"(HL)"    }, /* f3: 0111 0000 1111 0011                      */
3120   {SBBX,"(DE+)"   }, /* f4: 0111 0000 1111 0100                      */
3121   {SBBX,"(HL+)"   }, /* f5: 0111 0000 1111 0101                      */
3122   {SBBX,"(DE-)"   }, /* f6: 0111 0000 1111 0110                      */
3123   {SBBX,"(HL-)"   }, /* f7: 0111 0000 1111 0111                      */
3124   {illegal,0     }, /* f8: 0111 0000 1111 1000                      */
3125   {EQAX,"(BC)"    }, /* f9: 0111 0000 1111 1001                      */
3126   {EQAX,"(DE)"    }, /* fa: 0111 0000 1111 1010                      */
3127   {EQAX,"(HL)"    }, /* fb: 0111 0000 1111 1011                      */
3128   {EQAX,"(DE+)"   }, /* fc: 0111 0000 1111 1100                      */
3129   {EQAX,"(HL+)"   }, /* fd: 0111 0000 1111 1101                      */
3130   {EQAX,"(DE-)"   }, /* fe: 0111 0000 1111 1110                      */
3131   {EQAX,"(HL-)"   }  /* ff: 0111 0000 1111 1111                      */
31203132};
31213133
31223134/* prefix 74 */
31233135static const struct dasm_s  dasm74[256] =
31243136{
3125   {illegal,0,     2, 8}, /* 00: 0111 0100 0000 0000                      */
3126   {illegal,0,     2, 8}, /* 01: 0111 0100 0000 0001                      */
3127   {illegal,0,     2, 8}, /* 02: 0111 0100 0000 0010                      */
3128   {illegal,0,     2, 8}, /* 03: 0111 0100 0000 0011                      */
3129   {illegal,0,     2, 8}, /* 04: 0111 0100 0000 0100                      */
3130   {illegal,0,     2, 8}, /* 05: 0111 0100 0000 0101                      */
3131   {illegal,0,     2, 8}, /* 06: 0111 0100 0000 0110                      */
3132   {illegal,0,     2, 8}, /* 07: 0111 0100 0000 0111                      */
3133   {ANI,"V,%b",     3,11}, /* 08: 0111 0100 0000 1000 xxxx xxxx            */
3134   {ANI,"A,%b",     3,11}, /* 09: 0111 0100 0000 1001 xxxx xxxx            */
3135   {ANI,"B,%b",     3,11}, /* 0a: 0111 0100 0000 1010 xxxx xxxx            */
3136   {ANI,"C,%b",     3,11}, /* 0b: 0111 0100 0000 1011 xxxx xxxx            */
3137   {ANI,"D,%b",     3,11}, /* 0c: 0111 0100 0000 1100 xxxx xxxx            */
3138   {ANI,"E,%b",     3,11}, /* 0d: 0111 0100 0000 1101 xxxx xxxx            */
3139   {ANI,"H,%b",     3,11}, /* 0e: 0111 0100 0000 1110 xxxx xxxx            */
3140   {ANI,"L,%b",     3,11}, /* 0f: 0111 0100 0000 1111 xxxx xxxx            */
3137   {illegal,0     }, /* 00: 0111 0100 0000 0000                      */
3138   {illegal,0     }, /* 01: 0111 0100 0000 0001                      */
3139   {illegal,0     }, /* 02: 0111 0100 0000 0010                      */
3140   {illegal,0     }, /* 03: 0111 0100 0000 0011                      */
3141   {illegal,0     }, /* 04: 0111 0100 0000 0100                      */
3142   {illegal,0     }, /* 05: 0111 0100 0000 0101                      */
3143   {illegal,0     }, /* 06: 0111 0100 0000 0110                      */
3144   {illegal,0     }, /* 07: 0111 0100 0000 0111                      */
3145   {ANI,"V,%b"     }, /* 08: 0111 0100 0000 1000 xxxx xxxx            */
3146   {ANI,"A,%b"     }, /* 09: 0111 0100 0000 1001 xxxx xxxx            */
3147   {ANI,"B,%b"     }, /* 0a: 0111 0100 0000 1010 xxxx xxxx            */
3148   {ANI,"C,%b"     }, /* 0b: 0111 0100 0000 1011 xxxx xxxx            */
3149   {ANI,"D,%b"     }, /* 0c: 0111 0100 0000 1100 xxxx xxxx            */
3150   {ANI,"E,%b"     }, /* 0d: 0111 0100 0000 1101 xxxx xxxx            */
3151   {ANI,"H,%b"     }, /* 0e: 0111 0100 0000 1110 xxxx xxxx            */
3152   {ANI,"L,%b"     }, /* 0f: 0111 0100 0000 1111 xxxx xxxx            */
31413153
3142   {XRI,"V,%b",     3,11}, /* 10: 0111 0100 0001 0000 xxxx xxxx            */
3143   {XRI,"A,%b",     3,11}, /* 11: 0111 0100 0001 0001 xxxx xxxx            */
3144   {XRI,"B,%b",     3,11}, /* 12: 0111 0100 0001 0010 xxxx xxxx            */
3145   {XRI,"C,%b",     3,11}, /* 13: 0111 0100 0001 0011 xxxx xxxx            */
3146   {XRI,"D,%b",     3,11}, /* 14: 0111 0100 0001 0100 xxxx xxxx            */
3147   {XRI,"E,%b",     3,11}, /* 15: 0111 0100 0001 0101 xxxx xxxx            */
3148   {XRI,"H,%b",     3,11}, /* 16: 0111 0100 0001 0110 xxxx xxxx            */
3149   {XRI,"L,%b",     3,11}, /* 17: 0111 0100 0001 0111 xxxx xxxx            */
3150   {ORI,"V,%b",     3,11}, /* 18: 0111 0100 0001 1000 xxxx xxxx            */
3151   {ORI,"A,%b",     3,11}, /* 19: 0111 0100 0001 1001 xxxx xxxx            */
3152   {ORI,"B,%b",     3,11}, /* 1a: 0111 0100 0001 1010 xxxx xxxx            */
3153   {ORI,"C,%b",     3,11}, /* 1b: 0111 0100 0001 1011 xxxx xxxx            */
3154   {ORI,"D,%b",     3,11}, /* 1c: 0111 0100 0001 1100 xxxx xxxx            */
3155   {ORI,"E,%b",     3,11}, /* 1d: 0111 0100 0001 1101 xxxx xxxx            */
3156   {ORI,"H,%b",     3,11}, /* 1e: 0111 0100 0001 1110 xxxx xxxx            */
3157   {ORI,"L,%b",     3,11}, /* 1f: 0111 0100 0001 1111 xxxx xxxx            */
3154   {XRI,"V,%b"     }, /* 10: 0111 0100 0001 0000 xxxx xxxx            */
3155   {XRI,"A,%b"     }, /* 11: 0111 0100 0001 0001 xxxx xxxx            */
3156   {XRI,"B,%b"     }, /* 12: 0111 0100 0001 0010 xxxx xxxx            */
3157   {XRI,"C,%b"     }, /* 13: 0111 0100 0001 0011 xxxx xxxx            */
3158   {XRI,"D,%b"     }, /* 14: 0111 0100 0001 0100 xxxx xxxx            */
3159   {XRI,"E,%b"     }, /* 15: 0111 0100 0001 0101 xxxx xxxx            */
3160   {XRI,"H,%b"     }, /* 16: 0111 0100 0001 0110 xxxx xxxx            */
3161   {XRI,"L,%b"     }, /* 17: 0111 0100 0001 0111 xxxx xxxx            */
3162   {ORI,"V,%b"     }, /* 18: 0111 0100 0001 1000 xxxx xxxx            */
3163   {ORI,"A,%b"     }, /* 19: 0111 0100 0001 1001 xxxx xxxx            */
3164   {ORI,"B,%b"     }, /* 1a: 0111 0100 0001 1010 xxxx xxxx            */
3165   {ORI,"C,%b"     }, /* 1b: 0111 0100 0001 1011 xxxx xxxx            */
3166   {ORI,"D,%b"     }, /* 1c: 0111 0100 0001 1100 xxxx xxxx            */
3167   {ORI,"E,%b"     }, /* 1d: 0111 0100 0001 1101 xxxx xxxx            */
3168   {ORI,"H,%b"     }, /* 1e: 0111 0100 0001 1110 xxxx xxxx            */
3169   {ORI,"L,%b"     }, /* 1f: 0111 0100 0001 1111 xxxx xxxx            */
31583170
3159   {ADINC,"V,%b",   3,11}, /* 20: 0111 0100 0010 0000 xxxx xxxx            */
3160   {ADINC,"A,%b",   3,11}, /* 21: 0111 0100 0010 0001 xxxx xxxx            */
3161   {ADINC,"B,%b",   3,11}, /* 22: 0111 0100 0010 0010 xxxx xxxx            */
3162   {ADINC,"C,%b",   3,11}, /* 23: 0111 0100 0010 0011 xxxx xxxx            */
3163   {ADINC,"D,%b",   3,11}, /* 24: 0111 0100 0010 0100 xxxx xxxx            */
3164   {ADINC,"E,%b",   3,11}, /* 25: 0111 0100 0010 0101 xxxx xxxx            */
3165   {ADINC,"H,%b",   3,11}, /* 26: 0111 0100 0010 0110 xxxx xxxx            */
3166   {ADINC,"L,%b",   3,11}, /* 27: 0111 0100 0010 0111 xxxx xxxx            */
3167   {GTI,"V,%b",     3,11}, /* 28: 0111 0100 0010 1000 xxxx xxxx            */
3168   {GTI,"A,%b",     3,11}, /* 29: 0111 0100 0010 1001 xxxx xxxx            */
3169   {GTI,"B,%b",     3,11}, /* 2a: 0111 0100 0010 1010 xxxx xxxx            */
3170   {GTI,"C,%b",     3,11}, /* 2b: 0111 0100 0010 1011 xxxx xxxx            */
3171   {GTI,"D,%b",     3,11}, /* 2c: 0111 0100 0010 1100 xxxx xxxx            */
3172   {GTI,"E,%b",     3,11}, /* 2d: 0111 0100 0010 1101 xxxx xxxx            */
3173   {GTI,"H,%b",     3,11}, /* 2e: 0111 0100 0010 1110 xxxx xxxx            */
3174   {GTI,"L,%b",     3,11}, /* 2f: 0111 0100 0010 1111 xxxx xxxx            */
3171   {ADINC,"V,%b"   }, /* 20: 0111 0100 0010 0000 xxxx xxxx            */
3172   {ADINC,"A,%b"   }, /* 21: 0111 0100 0010 0001 xxxx xxxx            */
3173   {ADINC,"B,%b"   }, /* 22: 0111 0100 0010 0010 xxxx xxxx            */
3174   {ADINC,"C,%b"   }, /* 23: 0111 0100 0010 0011 xxxx xxxx            */
3175   {ADINC,"D,%b"   }, /* 24: 0111 0100 0010 0100 xxxx xxxx            */
3176   {ADINC,"E,%b"   }, /* 25: 0111 0100 0010 0101 xxxx xxxx            */
3177   {ADINC,"H,%b"   }, /* 26: 0111 0100 0010 0110 xxxx xxxx            */
3178   {ADINC,"L,%b"   }, /* 27: 0111 0100 0010 0111 xxxx xxxx            */
3179   {GTI,"V,%b"     }, /* 28: 0111 0100 0010 1000 xxxx xxxx            */
3180   {GTI,"A,%b"     }, /* 29: 0111 0100 0010 1001 xxxx xxxx            */
3181   {GTI,"B,%b"     }, /* 2a: 0111 0100 0010 1010 xxxx xxxx            */
3182   {GTI,"C,%b"     }, /* 2b: 0111 0100 0010 1011 xxxx xxxx            */
3183   {GTI,"D,%b"     }, /* 2c: 0111 0100 0010 1100 xxxx xxxx            */
3184   {GTI,"E,%b"     }, /* 2d: 0111 0100 0010 1101 xxxx xxxx            */
3185   {GTI,"H,%b"     }, /* 2e: 0111 0100 0010 1110 xxxx xxxx            */
3186   {GTI,"L,%b"     }, /* 2f: 0111 0100 0010 1111 xxxx xxxx            */
31753187
3176   {SUINB,"V,%b",   3,11}, /* 30: 0111 0100 0011 0000 xxxx xxxx            */
3177   {SUINB,"A,%b",   3,11}, /* 31: 0111 0100 0011 0001 xxxx xxxx            */
3178   {SUINB,"B,%b",   3,11}, /* 32: 0111 0100 0011 0010 xxxx xxxx            */
3179   {SUINB,"C,%b",   3,11}, /* 33: 0111 0100 0011 0011 xxxx xxxx            */
3180   {SUINB,"D,%b",   3,11}, /* 34: 0111 0100 0011 0100 xxxx xxxx            */
3181   {SUINB,"E,%b",   3,11}, /* 35: 0111 0100 0011 0101 xxxx xxxx            */
3182   {SUINB,"H,%b",   3,11}, /* 36: 0111 0100 0011 0110 xxxx xxxx            */
3183   {SUINB,"L,%b",   3,11}, /* 37: 0111 0100 0011 0111 xxxx xxxx            */
3184   {LTI,"V,%b",     3,11}, /* 38: 0111 0100 0011 1000 xxxx xxxx            */
3185   {LTI,"A,%b",     3,11}, /* 39: 0111 0100 0011 1001 xxxx xxxx            */
3186   {LTI,"B,%b",     3,11}, /* 3a: 0111 0100 0011 1010 xxxx xxxx            */
3187   {LTI,"C,%b",     3,11}, /* 3b: 0111 0100 0011 1011 xxxx xxxx            */
3188   {LTI,"D,%b",     3,11}, /* 3c: 0111 0100 0011 1100 xxxx xxxx            */
3189   {LTI,"E,%b",     3,11}, /* 3d: 0111 0100 0011 1101 xxxx xxxx            */
3190   {LTI,"H,%b",     3,11}, /* 3e: 0111 0100 0011 1110 xxxx xxxx            */
3191   {LTI,"L,%b",     3,11}, /* 3f: 0111 0100 0011 1111 xxxx xxxx            */
3188   {SUINB,"V,%b"   }, /* 30: 0111 0100 0011 0000 xxxx xxxx            */
3189   {SUINB,"A,%b"   }, /* 31: 0111 0100 0011 0001 xxxx xxxx            */
3190   {SUINB,"B,%b"   }, /* 32: 0111 0100 0011 0010 xxxx xxxx            */
3191   {SUINB,"C,%b"   }, /* 33: 0111 0100 0011 0011 xxxx xxxx            */
3192   {SUINB,"D,%b"   }, /* 34: 0111 0100 0011 0100 xxxx xxxx            */
3193   {SUINB,"E,%b"   }, /* 35: 0111 0100 0011 0101 xxxx xxxx            */
3194   {SUINB,"H,%b"   }, /* 36: 0111 0100 0011 0110 xxxx xxxx            */
3195   {SUINB,"L,%b"   }, /* 37: 0111 0100 0011 0111 xxxx xxxx            */
3196   {LTI,"V,%b"     }, /* 38: 0111 0100 0011 1000 xxxx xxxx            */
3197   {LTI,"A,%b"     }, /* 39: 0111 0100 0011 1001 xxxx xxxx            */
3198   {LTI,"B,%b"     }, /* 3a: 0111 0100 0011 1010 xxxx xxxx            */
3199   {LTI,"C,%b"     }, /* 3b: 0111 0100 0011 1011 xxxx xxxx            */
3200   {LTI,"D,%b"     }, /* 3c: 0111 0100 0011 1100 xxxx xxxx            */
3201   {LTI,"E,%b"     }, /* 3d: 0111 0100 0011 1101 xxxx xxxx            */
3202   {LTI,"H,%b"     }, /* 3e: 0111 0100 0011 1110 xxxx xxxx            */
3203   {LTI,"L,%b"     }, /* 3f: 0111 0100 0011 1111 xxxx xxxx            */
31923204
3193   {ADI,"V,%b",     3,11}, /* 40: 0111 0100 0100 0000 xxxx xxxx            */
3194   {ADI,"A,%b",     3,11}, /* 41: 0111 0100 0100 0001 xxxx xxxx            */
3195   {ADI,"B,%b",     3,11}, /* 42: 0111 0100 0100 0010 xxxx xxxx            */
3196   {ADI,"C,%b",     3,11}, /* 43: 0111 0100 0100 0011 xxxx xxxx            */
3197   {ADI,"D,%b",     3,11}, /* 44: 0111 0100 0100 0100 xxxx xxxx            */
3198   {ADI,"E,%b",     3,11}, /* 45: 0111 0100 0100 0101 xxxx xxxx            */
3199   {ADI,"H,%b",     3,11}, /* 46: 0111 0100 0100 0110 xxxx xxxx            */
3200   {ADI,"L,%b",     3,11}, /* 47: 0111 0100 0100 0111 xxxx xxxx            */
3201   {ONI,"V,%b",     3,11}, /* 48: 0111 0100 0100 1000 xxxx xxxx            */
3202   {ONI,"A,%b",     3,11}, /* 49: 0111 0100 0100 1001 xxxx xxxx            */
3203   {ONI,"B,%b",     3,11}, /* 4a: 0111 0100 0100 1010 xxxx xxxx            */
3204   {ONI,"C,%b",     3,11}, /* 4b: 0111 0100 0100 1011 xxxx xxxx            */
3205   {ONI,"D,%b",     3,11}, /* 4c: 0111 0100 0100 1100 xxxx xxxx            */
3206   {ONI,"E,%b",     3,11}, /* 4d: 0111 0100 0100 1101 xxxx xxxx            */
3207   {ONI,"H,%b",     3,11}, /* 4e: 0111 0100 0100 1110 xxxx xxxx            */
3208   {ONI,"L,%b",     3,11}, /* 4f: 0111 0100 0100 1111 xxxx xxxx            */
3205   {ADI,"V,%b"     }, /* 40: 0111 0100 0100 0000 xxxx xxxx            */
3206   {ADI,"A,%b"     }, /* 41: 0111 0100 0100 0001 xxxx xxxx            */
3207   {ADI,"B,%b"     }, /* 42: 0111 0100 0100 0010 xxxx xxxx            */
3208   {ADI,"C,%b"     }, /* 43: 0111 0100 0100 0011 xxxx xxxx            */
3209   {ADI,"D,%b"     }, /* 44: 0111 0100 0100 0100 xxxx xxxx            */
3210   {ADI,"E,%b"     }, /* 45: 0111 0100 0100 0101 xxxx xxxx            */
3211   {ADI,"H,%b"     }, /* 46: 0111 0100 0100 0110 xxxx xxxx            */
3212   {ADI,"L,%b"     }, /* 47: 0111 0100 0100 0111 xxxx xxxx            */
3213   {ONI,"V,%b"     }, /* 48: 0111 0100 0100 1000 xxxx xxxx            */
3214   {ONI,"A,%b"     }, /* 49: 0111 0100 0100 1001 xxxx xxxx            */
3215   {ONI,"B,%b"     }, /* 4a: 0111 0100 0100 1010 xxxx xxxx            */
3216   {ONI,"C,%b"     }, /* 4b: 0111 0100 0100 1011 xxxx xxxx            */
3217   {ONI,"D,%b"     }, /* 4c: 0111 0100 0100 1100 xxxx xxxx            */
3218   {ONI,"E,%b"     }, /* 4d: 0111 0100 0100 1101 xxxx xxxx            */
3219   {ONI,"H,%b"     }, /* 4e: 0111 0100 0100 1110 xxxx xxxx            */
3220   {ONI,"L,%b"     }, /* 4f: 0111 0100 0100 1111 xxxx xxxx            */
32093221
3210   {ACI,"V,%b",     3,11}, /* 50: 0111 0100 0101 0000 xxxx xxxx            */
3211   {ACI,"A,%b",     3,11}, /* 51: 0111 0100 0101 0001 xxxx xxxx            */
3212   {ACI,"B,%b",     3,11}, /* 52: 0111 0100 0101 0010 xxxx xxxx            */
3213   {ACI,"C,%b",     3,11}, /* 53: 0111 0100 0101 0011 xxxx xxxx            */
3214   {ACI,"D,%b",     3,11}, /* 54: 0111 0100 0101 0100 xxxx xxxx            */
3215   {ACI,"E,%b",     3,11}, /* 55: 0111 0100 0101 0101 xxxx xxxx            */
3216   {ACI,"H,%b",     3,11}, /* 56: 0111 0100 0101 0110 xxxx xxxx            */
3217   {ACI,"L,%b",     3,11}, /* 57: 0111 0100 0101 0111 xxxx xxxx            */
3218   {OFFI,"V,%b",    3,11}, /* 58: 0111 0100 0101 1000 xxxx xxxx            */
3219   {OFFI,"A,%b",    3,11}, /* 59: 0111 0100 0101 1001 xxxx xxxx            */
3220   {OFFI,"B,%b",    3,11}, /* 5a: 0111 0100 0101 1010 xxxx xxxx            */
3221   {OFFI,"C,%b",    3,11}, /* 5b: 0111 0100 0101 1011 xxxx xxxx            */
3222   {OFFI,"D,%b",    3,11}, /* 5c: 0111 0100 0101 1100 xxxx xxxx            */
3223   {OFFI,"E,%b",    3,11}, /* 5d: 0111 0100 0101 1101 xxxx xxxx            */
3224   {OFFI,"H,%b",    3,11}, /* 5e: 0111 0100 0101 1110 xxxx xxxx            */
3225   {OFFI,"L,%b",    3,11}, /* 5f: 0111 0100 0101 1111 xxxx xxxx            */
3222   {ACI,"V,%b"     }, /* 50: 0111 0100 0101 0000 xxxx xxxx            */
3223   {ACI,"A,%b"     }, /* 51: 0111 0100 0101 0001 xxxx xxxx            */
3224   {ACI,"B,%b"     }, /* 52: 0111 0100 0101 0010 xxxx xxxx            */
3225   {ACI,"C,%b"     }, /* 53: 0111 0100 0101 0011 xxxx xxxx            */
3226   {ACI,"D,%b"     }, /* 54: 0111 0100 0101 0100 xxxx xxxx            */
3227   {ACI,"E,%b"     }, /* 55: 0111 0100 0101 0101 xxxx xxxx            */
3228   {ACI,"H,%b"     }, /* 56: 0111 0100 0101 0110 xxxx xxxx            */
3229   {ACI,"L,%b"     }, /* 57: 0111 0100 0101 0111 xxxx xxxx            */
3230   {OFFI,"V,%b"    }, /* 58: 0111 0100 0101 1000 xxxx xxxx            */
3231   {OFFI,"A,%b"    }, /* 59: 0111 0100 0101 1001 xxxx xxxx            */
3232   {OFFI,"B,%b"    }, /* 5a: 0111 0100 0101 1010 xxxx xxxx            */
3233   {OFFI,"C,%b"    }, /* 5b: 0111 0100 0101 1011 xxxx xxxx            */
3234   {OFFI,"D,%b"    }, /* 5c: 0111 0100 0101 1100 xxxx xxxx            */
3235   {OFFI,"E,%b"    }, /* 5d: 0111 0100 0101 1101 xxxx xxxx            */
3236   {OFFI,"H,%b"    }, /* 5e: 0111 0100 0101 1110 xxxx xxxx            */
3237   {OFFI,"L,%b"    }, /* 5f: 0111 0100 0101 1111 xxxx xxxx            */
32263238
3227   {SUI,"V,%b",     3,11}, /* 60: 0111 0100 0110 0000 xxxx xxxx            */
3228   {SUI,"A,%b",     3,11}, /* 61: 0111 0100 0110 0001 xxxx xxxx            */
3229   {SUI,"B,%b",     3,11}, /* 62: 0111 0100 0110 0010 xxxx xxxx            */
3230   {SUI,"C,%b",     3,11}, /* 63: 0111 0100 0110 0011 xxxx xxxx            */
3231   {SUI,"D,%b",     3,11}, /* 64: 0111 0100 0110 0100 xxxx xxxx            */
3232   {SUI,"E,%b",     3,11}, /* 65: 0111 0100 0110 0101 xxxx xxxx            */
3233   {SUI,"H,%b",     3,11}, /* 66: 0111 0100 0110 0110 xxxx xxxx            */
3234   {SUI,"L,%b",     3,11}, /* 67: 0111 0100 0110 0111 xxxx xxxx            */
3235   {NEI,"V,%b",     3,11}, /* 68: 0111 0100 0110 1000 xxxx xxxx            */
3236   {NEI,"A,%b",     3,11}, /* 69: 0111 0100 0110 1001 xxxx xxxx            */
3237   {NEI,"B,%b",     3,11}, /* 6a: 0111 0100 0110 1010 xxxx xxxx            */
3238   {NEI,"C,%b",     3,11}, /* 6b: 0111 0100 0110 1011 xxxx xxxx            */
3239   {NEI,"D,%b",     3,11}, /* 6c: 0111 0100 0110 1100 xxxx xxxx            */
3240   {NEI,"E,%b",     3,11}, /* 6d: 0111 0100 0110 1101 xxxx xxxx            */
3241   {NEI,"H,%b",     3,11}, /* 6e: 0111 0100 0110 1110 xxxx xxxx            */
3242   {NEI,"L,%b",     3,11}, /* 6f: 0111 0100 0110 1111 xxxx xxxx            */
3239   {SUI,"V,%b"     }, /* 60: 0111 0100 0110 0000 xxxx xxxx            */
3240   {SUI,"A,%b"     }, /* 61: 0111 0100 0110 0001 xxxx xxxx            */
3241   {SUI,"B,%b"     }, /* 62: 0111 0100 0110 0010 xxxx xxxx            */
3242   {SUI,"C,%b"     }, /* 63: 0111 0100 0110 0011 xxxx xxxx            */
3243   {SUI,"D,%b"     }, /* 64: 0111 0100 0110 0100 xxxx xxxx            */
3244   {SUI,"E,%b"     }, /* 65: 0111 0100 0110 0101 xxxx xxxx            */
3245   {SUI,"H,%b"     }, /* 66: 0111 0100 0110 0110 xxxx xxxx            */
3246   {SUI,"L,%b"     }, /* 67: 0111 0100 0110 0111 xxxx xxxx            */
3247   {NEI,"V,%b"     }, /* 68: 0111 0100 0110 1000 xxxx xxxx            */
3248   {NEI,"A,%b"     }, /* 69: 0111 0100 0110 1001 xxxx xxxx            */
3249   {NEI,"B,%b"     }, /* 6a: 0111 0100 0110 1010 xxxx xxxx            */
3250   {NEI,"C,%b"     }, /* 6b: 0111 0100 0110 1011 xxxx xxxx            */
3251   {NEI,"D,%b"     }, /* 6c: 0111 0100 0110 1100 xxxx xxxx            */
3252   {NEI,"E,%b"     }, /* 6d: 0111 0100 0110 1101 xxxx xxxx            */
3253   {NEI,"H,%b"     }, /* 6e: 0111 0100 0110 1110 xxxx xxxx            */
3254   {NEI,"L,%b"     }, /* 6f: 0111 0100 0110 1111 xxxx xxxx            */
32433255
3244   {SBI,"V,%b",     3,11}, /* 70: 0111 0100 0111 0000 xxxx xxxx            */
3245   {SBI,"A,%b",     3,11}, /* 71: 0111 0100 0111 0001 xxxx xxxx            */
3246   {SBI,"B,%b",     3,11}, /* 72: 0111 0100 0111 0010 xxxx xxxx            */
3247   {SBI,"C,%b",     3,11}, /* 73: 0111 0100 0111 0011 xxxx xxxx            */
3248   {SBI,"D,%b",     3,11}, /* 74: 0111 0100 0111 0100 xxxx xxxx            */
3249   {SBI,"E,%b",     3,11}, /* 75: 0111 0100 0111 0101 xxxx xxxx            */
3250   {SBI,"H,%b",     3,11}, /* 76: 0111 0100 0111 0110 xxxx xxxx            */
3251   {SBI,"L,%b",     3,11}, /* 77: 0111 0100 0111 0111 xxxx xxxx            */
3252   {EQI,"V,%b",     3,11}, /* 78: 0111 0100 0111 1000 xxxx xxxx            */
3253   {EQI,"A,%b",     3,11}, /* 79: 0111 0100 0111 1001 xxxx xxxx            */
3254   {EQI,"B,%b",     3,11}, /* 7a: 0111 0100 0111 1010 xxxx xxxx            */
3255   {EQI,"C,%b",     3,11}, /* 7b: 0111 0100 0111 1011 xxxx xxxx            */
3256   {EQI,"D,%b",     3,11}, /* 7c: 0111 0100 0111 1100 xxxx xxxx            */
3257   {EQI,"E,%b",     3,11}, /* 7d: 0111 0100 0111 1101 xxxx xxxx            */
3258   {EQI,"H,%b",     3,11}, /* 7e: 0111 0100 0111 1110 xxxx xxxx            */
3259   {EQI,"L,%b",     3,11}, /* 7f: 0111 0100 0111 1111 xxxx xxxx            */
3256   {SBI,"V,%b"     }, /* 70: 0111 0100 0111 0000 xxxx xxxx            */
3257   {SBI,"A,%b"     }, /* 71: 0111 0100 0111 0001 xxxx xxxx            */
3258   {SBI,"B,%b"     }, /* 72: 0111 0100 0111 0010 xxxx xxxx            */
3259   {SBI,"C,%b"     }, /* 73: 0111 0100 0111 0011 xxxx xxxx            */
3260   {SBI,"D,%b"     }, /* 74: 0111 0100 0111 0100 xxxx xxxx            */
3261   {SBI,"E,%b"     }, /* 75: 0111 0100 0111 0101 xxxx xxxx            */
3262   {SBI,"H,%b"     }, /* 76: 0111 0100 0111 0110 xxxx xxxx            */
3263   {SBI,"L,%b"     }, /* 77: 0111 0100 0111 0111 xxxx xxxx            */
3264   {EQI,"V,%b"     }, /* 78: 0111 0100 0111 1000 xxxx xxxx            */
3265   {EQI,"A,%b"     }, /* 79: 0111 0100 0111 1001 xxxx xxxx            */
3266   {EQI,"B,%b"     }, /* 7a: 0111 0100 0111 1010 xxxx xxxx            */
3267   {EQI,"C,%b"     }, /* 7b: 0111 0100 0111 1011 xxxx xxxx            */
3268   {EQI,"D,%b"     }, /* 7c: 0111 0100 0111 1100 xxxx xxxx            */
3269   {EQI,"E,%b"     }, /* 7d: 0111 0100 0111 1101 xxxx xxxx            */
3270   {EQI,"H,%b"     }, /* 7e: 0111 0100 0111 1110 xxxx xxxx            */
3271   {EQI,"L,%b"     }, /* 7f: 0111 0100 0111 1111 xxxx xxxx            */
32603272
3261   {illegal,0,     2, 8}, /* 80: 0111 0100 1000 0000                      */
3262   {illegal,0,     2, 8}, /* 81: 0111 0100 1000 0001                      */
3263   {illegal,0,     2, 8}, /* 82: 0111 0100 1000 0010                      */
3264   {illegal,0,     2, 8}, /* 83: 0111 0100 1000 0011                      */
3265   {illegal,0,     2, 8}, /* 84: 0111 0100 1000 0100                      */
3266   {illegal,0,     2, 8}, /* 85: 0111 0100 1000 0101                      */
3267   {illegal,0,     2, 8}, /* 86: 0111 0100 1000 0110                      */
3268   {illegal,0,     2, 8}, /* 87: 0111 0100 1000 0111                      */
3269   {ANAW,"%a",      3,14}, /* 88: 0111 0100 1000 1000 oooo oooo            */
3270   {illegal,0,     2, 8}, /* 89: 0111 0100 1000 1001                      */
3271   {illegal,0,     2, 8}, /* 8a: 0111 0100 1000 1010                      */
3272   {illegal,0,     2, 8}, /* 8b: 0111 0100 1000 1011                      */
3273   {illegal,0,     2, 8}, /* 8c: 0111 0100 1000 1100                      */
3274   {DAN,"EA,BC",    2,11}, /* 8d: 0111 0100 1000 1101                      */
3275   {DAN,"EA,DE",    2,11}, /* 8e: 0111 0100 1000 1110                      */
3276   {DAN,"EA,HL",    2,11}, /* 8f: 0111 0100 1000 1111                      */
3273   {illegal,0     }, /* 80: 0111 0100 1000 0000                      */
3274   {illegal,0     }, /* 81: 0111 0100 1000 0001                      */
3275   {illegal,0     }, /* 82: 0111 0100 1000 0010                      */
3276   {illegal,0     }, /* 83: 0111 0100 1000 0011                      */
3277   {illegal,0     }, /* 84: 0111 0100 1000 0100                      */
3278   {illegal,0     }, /* 85: 0111 0100 1000 0101                      */
3279   {illegal,0     }, /* 86: 0111 0100 1000 0110                      */
3280   {illegal,0     }, /* 87: 0111 0100 1000 0111                      */
3281   {ANAW,"%a"      }, /* 88: 0111 0100 1000 1000 oooo oooo            */
3282   {illegal,0     }, /* 89: 0111 0100 1000 1001                      */
3283   {illegal,0     }, /* 8a: 0111 0100 1000 1010                      */
3284   {illegal,0     }, /* 8b: 0111 0100 1000 1011                      */
3285   {illegal,0     }, /* 8c: 0111 0100 1000 1100                      */
3286   {DAN,"EA,BC"    }, /* 8d: 0111 0100 1000 1101                      */
3287   {DAN,"EA,DE"    }, /* 8e: 0111 0100 1000 1110                      */
3288   {DAN,"EA,HL"    }, /* 8f: 0111 0100 1000 1111                      */
32773289
3278   {XRAW,"%a",      3,14}, /* 90: 0111 0100 1001 0000 oooo oooo            */
3279   {illegal,0,     2, 8}, /* 91: 0111 0100 1001 0001                      */
3280   {illegal,0,     2, 8}, /* 92: 0111 0100 1001 0010                      */
3281   {illegal,0,     2, 8}, /* 93: 0111 0100 1001 0011                      */
3282   {illegal,0,     2, 8}, /* 94: 0111 0100 1001 0100                      */
3283   {DXR,"EA,BC",    2,11}, /* 95: 0111 0100 1001 0101                      */
3284   {DXR,"EA,DE",    2,11}, /* 96: 0111 0100 1001 0110                      */
3285   {DXR,"EA,HL",    2,11}, /* 97: 0111 0100 1001 0111                      */
3286   {ORAW,"%a",      3,14}, /* 98: 0111 0100 1001 1000 oooo oooo            */
3287   {illegal,0,     2, 8}, /* 99: 0111 0100 1001 1001                      */
3288   {illegal,0,     2, 8}, /* 9a: 0111 0100 1001 1010                      */
3289   {illegal,0,     2, 8}, /* 9b: 0111 0100 1001 1011                      */
3290   {illegal,0,     2, 8}, /* 9c: 0111 0100 1001 1100                      */
3291   {DOR,"EA,BC",    2,11}, /* 9d: 0111 0100 1001 1101                      */
3292   {DOR,"EA,DE",    2,11}, /* 9e: 0111 0100 1001 1110                      */
3293   {DOR,"EA,HL",    2,11}, /* 9f: 0111 0100 1001 1111                      */
3290   {XRAW,"%a"      }, /* 90: 0111 0100 1001 0000 oooo oooo            */
3291   {illegal,0     }, /* 91: 0111 0100 1001 0001                      */
3292   {illegal,0     }, /* 92: 0111 0100 1001 0010                      */
3293   {illegal,0     }, /* 93: 0111 0100 1001 0011                      */
3294   {illegal,0     }, /* 94: 0111 0100 1001 0100                      */
3295   {DXR,"EA,BC"    }, /* 95: 0111 0100 1001 0101                      */
3296   {DXR,"EA,DE"    }, /* 96: 0111 0100 1001 0110                      */
3297   {DXR,"EA,HL"    }, /* 97: 0111 0100 1001 0111                      */
3298   {ORAW,"%a"      }, /* 98: 0111 0100 1001 1000 oooo oooo            */
3299   {illegal,0     }, /* 99: 0111 0100 1001 1001                      */
3300   {illegal,0     }, /* 9a: 0111 0100 1001 1010                      */
3301   {illegal,0     }, /* 9b: 0111 0100 1001 1011                      */
3302   {illegal,0     }, /* 9c: 0111 0100 1001 1100                      */
3303   {DOR,"EA,BC"    }, /* 9d: 0111 0100 1001 1101                      */
3304   {DOR,"EA,DE"    }, /* 9e: 0111 0100 1001 1110                      */
3305   {DOR,"EA,HL"    }, /* 9f: 0111 0100 1001 1111                      */
32943306
3295   {ADDNCW,"%a",    3,14}, /* a0: 0111 0100 1010 0000 oooo oooo            */
3296   {illegal,0,     2, 8}, /* a1: 0111 0100 1010 0001                      */
3297   {illegal,0,     2, 8}, /* a2: 0111 0100 1010 0010                      */
3298   {illegal,0,     2, 8}, /* a3: 0111 0100 1010 0011                      */
3299   {illegal,0,     2, 8}, /* a4: 0111 0100 1010 0100                      */
3300   {DADDNC,"EA,BC", 2,11}, /* a5: 0111 0100 1010 0101                      */
3301   {DADDNC,"EA,DE", 2,11}, /* a6: 0111 0100 1010 0110                      */
3302   {DADDNC,"EA,HL", 2,11}, /* a7: 0111 0100 1010 0111                      */
3303   {GTAW,"%a",      3,14}, /* a8: 0111 0100 1010 1000 oooo oooo            */
3304   {illegal,0,     2, 8}, /* a9: 0111 0100 1010 1001                      */
3305   {illegal,0,     2, 8}, /* aa: 0111 0100 1010 1010                      */
3306   {illegal,0,     2, 8}, /* ab: 0111 0100 1010 1011                      */
3307   {illegal,0,     2, 8}, /* ac: 0111 0100 1010 1100                      */
3308   {DGT,"EA,BC",    2,11}, /* ad: 0111 0100 1010 1101                      */
3309   {DGT,"EA,DE",    2,11}, /* ae: 0111 0100 1010 1110                      */
3310   {DGT,"EA,HL",    2,11}, /* af: 0111 0100 1010 1111                      */
3307   {ADDNCW,"%a"    }, /* a0: 0111 0100 1010 0000 oooo oooo            */
3308   {illegal,0     }, /* a1: 0111 0100 1010 0001                      */
3309   {illegal,0     }, /* a2: 0111 0100 1010 0010                      */
3310   {illegal,0     }, /* a3: 0111 0100 1010 0011                      */
3311   {illegal,0     }, /* a4: 0111 0100 1010 0100                      */
3312   {DADDNC,"EA,BC" }, /* a5: 0111 0100 1010 0101                      */
3313   {DADDNC,"EA,DE" }, /* a6: 0111 0100 1010 0110                      */
3314   {DADDNC,"EA,HL" }, /* a7: 0111 0100 1010 0111                      */
3315   {GTAW,"%a"      }, /* a8: 0111 0100 1010 1000 oooo oooo            */
3316   {illegal,0     }, /* a9: 0111 0100 1010 1001                      */
3317   {illegal,0     }, /* aa: 0111 0100 1010 1010                      */
3318   {illegal,0     }, /* ab: 0111 0100 1010 1011                      */
3319   {illegal,0     }, /* ac: 0111 0100 1010 1100                      */
3320   {DGT,"EA,BC"    }, /* ad: 0111 0100 1010 1101                      */
3321   {DGT,"EA,DE"    }, /* ae: 0111 0100 1010 1110                      */
3322   {DGT,"EA,HL"    }, /* af: 0111 0100 1010 1111                      */
33113323
3312   {SUBNBW,"%a",    3,14}, /* b0: 0111 0100 1011 0000 oooo oooo            */
3313   {illegal,0,     2, 8}, /* b1: 0111 0100 1011 0001                      */
3314   {illegal,0,     2, 8}, /* b2: 0111 0100 1011 0010                      */
3315   {illegal,0,     2, 8}, /* b3: 0111 0100 1011 0011                      */
3316   {illegal,0,     2, 8}, /* b4: 0111 0100 1011 0100                      */
3317   {DSUBNB,"EA,BC", 2,11}, /* b5: 0111 0100 1011 0101                      */
3318   {DSUBNB,"EA,DE", 2,11}, /* b6: 0111 0100 1011 0110                      */
3319   {DSUBNB,"EA,HL", 2,11}, /* b7: 0111 0100 1011 0111                      */
3320   {LTAW,"%a",      3,14}, /* b8: 0111 0100 1011 1000 oooo oooo            */
3321   {illegal,0,     2, 8}, /* b9: 0111 0100 1011 1001                      */
3322   {illegal,0,     2, 8}, /* ba: 0111 0100 1011 1010                      */
3323   {illegal,0,     2, 8}, /* bb: 0111 0100 1011 1011                      */
3324   {illegal,0,     2, 8}, /* bc: 0111 0100 1011 1100                      */
3325   {DLT,"EA,BC",    2,11}, /* bd: 0111 0100 1011 1101                      */
3326   {DLT,"EA,DE",    2,11}, /* be: 0111 0100 1011 1110                      */
3327   {DLT,"EA,HL",    2,11}, /* bf: 0111 0100 1011 1111                      */
3324   {SUBNBW,"%a"    }, /* b0: 0111 0100 1011 0000 oooo oooo            */
3325   {illegal,0     }, /* b1: 0111 0100 1011 0001                      */
3326   {illegal,0     }, /* b2: 0111 0100 1011 0010                      */
3327   {illegal,0     }, /* b3: 0111 0100 1011 0011                      */
3328   {illegal,0     }, /* b4: 0111 0100 1011 0100                      */
3329   {DSUBNB,"EA,BC" }, /* b5: 0111 0100 1011 0101                      */
3330   {DSUBNB,"EA,DE" }, /* b6: 0111 0100 1011 0110                      */
3331   {DSUBNB,"EA,HL" }, /* b7: 0111 0100 1011 0111                      */
3332   {LTAW,"%a"      }, /* b8: 0111 0100 1011 1000 oooo oooo            */
3333   {illegal,0     }, /* b9: 0111 0100 1011 1001                      */
3334   {illegal,0     }, /* ba: 0111 0100 1011 1010                      */
3335   {illegal,0     }, /* bb: 0111 0100 1011 1011                      */
3336   {illegal,0     }, /* bc: 0111 0100 1011 1100                      */
3337   {DLT,"EA,BC"    }, /* bd: 0111 0100 1011 1101                      */
3338   {DLT,"EA,DE"    }, /* be: 0111 0100 1011 1110                      */
3339   {DLT,"EA,HL"    }, /* bf: 0111 0100 1011 1111                      */
33283340
3329   {ADDW,"%a",      3,14}, /* c0: 0111 0100 1100 0000 oooo oooo            */
3330   {illegal,0,     2, 8}, /* c1: 0111 0100 1100 0001                      */
3331   {illegal,0,     2, 8}, /* c2: 0111 0100 1100 0010                      */
3332   {illegal,0,     2, 8}, /* c3: 0111 0100 1100 0011                      */
3333   {illegal,0,     2, 8}, /* c4: 0111 0100 1100 0100                      */
3334   {DADD,"EA,BC",   2,11}, /* c5: 0111 0100 1100 0101                      */
3335   {DADD,"EA,DE",   2,11}, /* c6: 0111 0100 1100 0110                      */
3336   {DADD,"EA,HL",   2,11}, /* c7: 0111 0100 1100 0111                      */
3337   {ONAW,"%a",      3,14}, /* c8: 0111 0100 1100 1000 oooo oooo            */
3338   {illegal,0,     2, 8}, /* c9: 0111 0100 1100 1001                      */
3339   {illegal,0,     2, 8}, /* ca: 0111 0100 1100 1010                      */
3340   {illegal,0,     2, 8}, /* cb: 0111 0100 1100 1011                      */
3341   {illegal,0,     2, 8}, /* cc: 0111 0100 1100 1100                      */
3342   {DON,"EA,BC",    2,11}, /* cd: 0111 0100 1100 1101                      */
3343   {DON,"EA,DE",    2,11}, /* ce: 0111 0100 1100 1110                      */
3344   {DON,"EA,HL",    2,11}, /* cf: 0111 0100 1100 1111                      */
3341   {ADDW,"%a"      }, /* c0: 0111 0100 1100 0000 oooo oooo            */
3342   {illegal,0     }, /* c1: 0111 0100 1100 0001                      */
3343   {illegal,0     }, /* c2: 0111 0100 1100 0010                      */
3344   {illegal,0     }, /* c3: 0111 0100 1100 0011                      */
3345   {illegal,0     }, /* c4: 0111 0100 1100 0100                      */
3346   {DADD,"EA,BC"   }, /* c5: 0111 0100 1100 0101                      */
3347   {DADD,"EA,DE"   }, /* c6: 0111 0100 1100 0110                      */
3348   {DADD,"EA,HL"   }, /* c7: 0111 0100 1100 0111                      */
3349   {ONAW,"%a"      }, /* c8: 0111 0100 1100 1000 oooo oooo            */
3350   {illegal,0     }, /* c9: 0111 0100 1100 1001                      */
3351   {illegal,0     }, /* ca: 0111 0100 1100 1010                      */
3352   {illegal,0     }, /* cb: 0111 0100 1100 1011                      */
3353   {illegal,0     }, /* cc: 0111 0100 1100 1100                      */
3354   {DON,"EA,BC"    }, /* cd: 0111 0100 1100 1101                      */
3355   {DON,"EA,DE"    }, /* ce: 0111 0100 1100 1110                      */
3356   {DON,"EA,HL"    }, /* cf: 0111 0100 1100 1111                      */
33453357
3346   {ADCW,"%a",      3,14}, /* d0: 0111 0100 1101 0000 oooo oooo            */
3347   {illegal,0,     2, 8}, /* d1: 0111 0100 1101 0001                      */
3348   {illegal,0,     2, 8}, /* d2: 0111 0100 1101 0010                      */
3349   {illegal,0,     2, 8}, /* d3: 0111 0100 1101 0011                      */
3350   {illegal,0,     2, 8}, /* d4: 0111 0100 1101 0100                      */
3351   {DADC,"EA,BC",   2,11}, /* d5: 0111 0100 1101 0101                      */
3352   {DADC,"EA,DE",   2,11}, /* d6: 0111 0100 1101 0110                      */
3353   {DADC,"EA,HL",   2,11}, /* d7: 0111 0100 1101 0111                      */
3354   {OFFAW,"%a",     3,14}, /* d8: 0111 0100 1101 1000 oooo oooo            */
3355   {illegal,0,     2, 8}, /* d9: 0111 0100 1101 1001                      */
3356   {illegal,0,     2, 8}, /* da: 0111 0100 1101 1010                      */
3357   {illegal,0,     2, 8}, /* db: 0111 0100 1101 1011                      */
3358   {illegal,0,     2, 8}, /* dc: 0111 0100 1101 1100                      */
3359   {DOFF,"EA,BC",   2,11}, /* dd: 0111 0100 1101 1101                      */
3360   {DOFF,"EA,DE",   2,11}, /* de: 0111 0100 1101 1110                      */
3361   {DOFF,"EA,HL",   2,11}, /* df: 0111 0100 1101 1111                      */
3358   {ADCW,"%a"      }, /* d0: 0111 0100 1101 0000 oooo oooo            */
3359   {illegal,0     }, /* d1: 0111 0100 1101 0001                      */
3360   {illegal,0     }, /* d2: 0111 0100 1101 0010                      */
3361   {illegal,0     }, /* d3: 0111 0100 1101 0011                      */
3362   {illegal,0     }, /* d4: 0111 0100 1101 0100                      */
3363   {DADC,"EA,BC"   }, /* d5: 0111 0100 1101 0101                      */
3364   {DADC,"EA,DE"   }, /* d6: 0111 0100 1101 0110                      */
3365   {DADC,"EA,HL"   }, /* d7: 0111 0100 1101 0111                      */
3366   {OFFAW,"%a"     }, /* d8: 0111 0100 1101 1000 oooo oooo            */
3367   {illegal,0     }, /* d9: 0111 0100 1101 1001                      */
3368   {illegal,0     }, /* da: 0111 0100 1101 1010                      */
3369   {illegal,0     }, /* db: 0111 0100 1101 1011                      */
3370   {illegal,0     }, /* dc: 0111 0100 1101 1100                      */
3371   {DOFF,"EA,BC"   }, /* dd: 0111 0100 1101 1101                      */
3372   {DOFF,"EA,DE"   }, /* de: 0111 0100 1101 1110                      */
3373   {DOFF,"EA,HL"   }, /* df: 0111 0100 1101 1111                      */
33623374
3363   {SUBW,"%a",      3,14}, /* e0: 0111 0100 1110 0000 oooo oooo            */
3364   {illegal,0,     2, 8}, /* e1: 0111 0100 1110 0001                      */
3365   {illegal,0,     2, 8}, /* e2: 0111 0100 1110 0010                      */
3366   {illegal,0,     2, 8}, /* e3: 0111 0100 1110 0011                      */
3367   {illegal,0,     2, 8}, /* e4: 0111 0100 1110 0100                      */
3368   {DSUB,"EA,BC",   2,11}, /* e5: 0111 0100 1110 0101                      */
3369   {DSUB,"EA,DE",   2,11}, /* e6: 0111 0100 1110 0110                      */
3370   {DSUB,"EA,HL",   2,11}, /* e7: 0111 0100 1110 0111                      */
3371   {NEAW,"%a",      3,14}, /* e8: 0111 0100 1110 1000 oooo oooo            */
3372   {illegal,0,     2, 8}, /* e9: 0111 0100 1110 1001                      */
3373   {illegal,0,     2, 8}, /* ea: 0111 0100 1110 1010                      */
3374   {illegal,0,     2, 8}, /* eb: 0111 0100 1110 1011                      */
3375   {illegal,0,     2, 8}, /* ec: 0111 0100 1110 1100                      */
3376   {DNE,"EA,BC",    2,11}, /* ed: 0111 0100 1110 1101                      */
3377   {DNE,"EA,DE",    2,11}, /* ee: 0111 0100 1110 1110                      */
3378   {DNE,"EA,HL",    2,11}, /* ef: 0111 0100 1110 1111                      */
3375   {SUBW,"%a"      }, /* e0: 0111 0100 1110 0000 oooo oooo            */
3376   {illegal,0     }, /* e1: 0111 0100 1110 0001                      */
3377   {illegal,0     }, /* e2: 0111 0100 1110 0010                      */
3378   {illegal,0     }, /* e3: 0111 0100 1110 0011                      */
3379   {illegal,0     }, /* e4: 0111 0100 1110 0100                      */
3380   {DSUB,"EA,BC"   }, /* e5: 0111 0100 1110 0101                      */
3381   {DSUB,"EA,DE"   }, /* e6: 0111 0100 1110 0110                      */
3382   {DSUB,"EA,HL"   }, /* e7: 0111 0100 1110 0111                      */
3383   {NEAW,"%a"      }, /* e8: 0111 0100 1110 1000 oooo oooo            */
3384   {illegal,0     }, /* e9: 0111 0100 1110 1001                      */
3385   {illegal,0     }, /* ea: 0111 0100 1110 1010                      */
3386   {illegal,0     }, /* eb: 0111 0100 1110 1011                      */
3387   {illegal,0     }, /* ec: 0111 0100 1110 1100                      */
3388   {DNE,"EA,BC"    }, /* ed: 0111 0100 1110 1101                      */
3389   {DNE,"EA,DE"    }, /* ee: 0111 0100 1110 1110                      */
3390   {DNE,"EA,HL"    }, /* ef: 0111 0100 1110 1111                      */
33793391
3380   {SBBW,"%a",      3,14}, /* f0: 0111 0100 1111 0000 oooo oooo            */
3381   {illegal,0,     2, 8}, /* f1: 0111 0100 1111 0001                      */
3382   {illegal,0,     2, 8}, /* f2: 0111 0100 1111 0010                      */
3383   {illegal,0,     2, 8}, /* f3: 0111 0100 1111 0011                      */
3384   {illegal,0,     2, 8}, /* f4: 0111 0100 1111 0100                      */
3385   {DSBB,"EA,BC",   2,11}, /* f5: 0111 0100 1111 0101                      */
3386   {DSBB,"EA,DE",   2,11}, /* f6: 0111 0100 1111 0110                      */
3387   {DSBB,"EA,HL",   2,11}, /* f7: 0111 0100 1111 0111                      */
3388   {EQAW,"%a",      3,14}, /* f8: 0111 0100 1111 1000 oooo oooo            */
3389   {illegal,0,     2, 8}, /* f9: 0111 0100 1111 1001                      */
3390   {illegal,0,     2, 8}, /* fa: 0111 0100 1111 1010                      */
3391   {illegal,0,     2, 8}, /* fb: 0111 0100 1111 1011                      */
3392   {illegal,0,     2, 8}, /* fc: 0111 0100 1111 1100                      */
3393   {DEQ,"EA,BC",    2,11}, /* fd: 0111 0100 1111 1101                      */
3394   {DEQ,"EA,DE",    2,11}, /* fe: 0111 0100 1111 1110                      */
3395   {DEQ,"EA,HL",    2,11}  /* ff: 0111 0100 1111 1111                      */
3392   {SBBW,"%a"      }, /* f0: 0111 0100 1111 0000 oooo oooo            */
3393   {illegal,0     }, /* f1: 0111 0100 1111 0001                      */
3394   {illegal,0     }, /* f2: 0111 0100 1111 0010                      */
3395   {illegal,0     }, /* f3: 0111 0100 1111 0011                      */
3396   {illegal,0     }, /* f4: 0111 0100 1111 0100                      */
3397   {DSBB,"EA,BC"   }, /* f5: 0111 0100 1111 0101                      */
3398   {DSBB,"EA,DE"   }, /* f6: 0111 0100 1111 0110                      */
3399   {DSBB,"EA,HL"   }, /* f7: 0111 0100 1111 0111                      */
3400   {EQAW,"%a"      }, /* f8: 0111 0100 1111 1000 oooo oooo            */
3401   {illegal,0     }, /* f9: 0111 0100 1111 1001                      */
3402   {illegal,0     }, /* fa: 0111 0100 1111 1010                      */
3403   {illegal,0     }, /* fb: 0111 0100 1111 1011                      */
3404   {illegal,0     }, /* fc: 0111 0100 1111 1100                      */
3405   {DEQ,"EA,BC"    }, /* fd: 0111 0100 1111 1101                      */
3406   {DEQ,"EA,DE"    }, /* fe: 0111 0100 1111 1110                      */
3407   {DEQ,"EA,HL"    }  /* ff: 0111 0100 1111 1111                      */
33963408};
33973409
33983410/* main opcodes */
33993411static const struct dasm_s  dasmXX_7810[256] =
34003412{
3401   {NOP,0,        1, 4}, /* 00: 0000 0000                                */
3402   {LDAW,"%a",      2,10}, /* 01: 0000 0001 oooo oooo                      */
3403   {INX,"SP",       1, 7}, /* 02: 0000 0010                                */
3404   {DCX,"SP",       1, 7}, /* 03: 0000 0011                                */
3405   {LXI,"SP,%w",    3,10}, /* 04: 0000 0100 llll llll hhhh hhhh            */
3406   {ANIW,"%a,%b",   3,19}, /* 05: 0000 0101 oooo oooo xxxx xxxx            */
3407   {illegal,0,     1, 4}, /* 06:                                          */
3408   {ANI,"A,%b",     2, 7}, /* 07: 0000 0111 xxxx xxxx                      */
3409   {MOV,"A,EAH",    1, 4}, /* 08: 0000 1000                                */
3410   {MOV,"A,EAL",    1, 4}, /* 09: 0000 1001                                */
3411   {MOV,"A,B",      1, 4}, /* 0a: 0000 1010                                */
3412   {MOV,"A,C",      1, 4}, /* 0b: 0000 1011                                */
3413   {MOV,"A,D",      1, 4}, /* 0c: 0000 1100                                */
3414   {MOV,"A,E",      1, 4}, /* 0d: 0000 1101                                */
3415   {MOV,"A,H",      1, 4}, /* 0e: 0000 1110                                */
3416   {MOV,"A,L",      1, 4}, /* 0f: 0000 1111                                */
3413   {NOP,0        }, /* 00: 0000 0000                                */
3414   {LDAW,"%a"      }, /* 01: 0000 0001 oooo oooo                      */
3415   {INX,"SP"       }, /* 02: 0000 0010                                */
3416   {DCX,"SP"       }, /* 03: 0000 0011                                */
3417   {LXI,"SP,%w"    }, /* 04: 0000 0100 llll llll hhhh hhhh            */
3418   {ANIW,"%a,%b"   }, /* 05: 0000 0101 oooo oooo xxxx xxxx            */
3419   {illegal,0     }, /* 06:                                          */
3420   {ANI,"A,%b"     }, /* 07: 0000 0111 xxxx xxxx                      */
3421   {MOV,"A,EAH"    }, /* 08: 0000 1000                                */
3422   {MOV,"A,EAL"    }, /* 09: 0000 1001                                */
3423   {MOV,"A,B"      }, /* 0a: 0000 1010                                */
3424   {MOV,"A,C"      }, /* 0b: 0000 1011                                */
3425   {MOV,"A,D"      }, /* 0c: 0000 1100                                */
3426   {MOV,"A,E"      }, /* 0d: 0000 1101                                */
3427   {MOV,"A,H"      }, /* 0e: 0000 1110                                */
3428   {MOV,"A,L"      }, /* 0f: 0000 1111                                */
34173429
3418   {EXA,0,        1, 4}, /* 10: 0001 0000                                */   /* 7810 */
3419   {EXX,0,        1, 4}, /* 11: 0001 0001                                */   /* 7810 */
3420   {INX,"BC",       1, 7}, /* 12: 0001 0010                                */
3421   {DCX,"BC",       1, 7}, /* 13: 0001 0011                                */
3422   {LXI,"BC,%w",    3,10}, /* 14: 0001 0100 llll llll hhhh hhhh            */
3423   {ORIW,"%a,%b",   3,19}, /* 15: 0001 0101 oooo oooo xxxx xxxx            */
3424   {XRI,"A,%b",     2, 7}, /* 16: 0001 0110 xxxx xxxx                      */
3425   {ORI,"A,%b",     2, 7}, /* 17: 0001 0111 xxxx xxxx                      */
3426   {MOV,"EAH,A",    1, 4}, /* 18: 0001 1000                                */
3427   {MOV,"EAL,A",    1, 4}, /* 19: 0001 1001                                */
3428   {MOV,"B,A",      1, 4}, /* 1a: 0001 1010                                */
3429   {MOV,"C,A",      1, 4}, /* 1b: 0001 1011                                */
3430   {MOV,"D,A",      1, 4}, /* 1c: 0001 1100                                */
3431   {MOV,"E,A",      1, 4}, /* 1d: 0001 1101                                */
3432   {MOV,"H,A",      1, 4}, /* 1e: 0001 1110                                */
3433   {MOV,"L,A",      1, 4}, /* 1f: 0001 1111                                */
3430   {EXA,0        }, /* 10: 0001 0000                                */   /* 7810 */
3431   {EXX,0        }, /* 11: 0001 0001                                */   /* 7810 */
3432   {INX,"BC"       }, /* 12: 0001 0010                                */
3433   {DCX,"BC"       }, /* 13: 0001 0011                                */
3434   {LXI,"BC,%w"    }, /* 14: 0001 0100 llll llll hhhh hhhh            */
3435   {ORIW,"%a,%b"   }, /* 15: 0001 0101 oooo oooo xxxx xxxx            */
3436   {XRI,"A,%b"     }, /* 16: 0001 0110 xxxx xxxx                      */
3437   {ORI,"A,%b"     }, /* 17: 0001 0111 xxxx xxxx                      */
3438   {MOV,"EAH,A"    }, /* 18: 0001 1000                                */
3439   {MOV,"EAL,A"    }, /* 19: 0001 1001                                */
3440   {MOV,"B,A"      }, /* 1a: 0001 1010                                */
3441   {MOV,"C,A"      }, /* 1b: 0001 1011                                */
3442   {MOV,"D,A"      }, /* 1c: 0001 1100                                */
3443   {MOV,"E,A"      }, /* 1d: 0001 1101                                */
3444   {MOV,"H,A"      }, /* 1e: 0001 1110                                */
3445   {MOV,"L,A"      }, /* 1f: 0001 1111                                */
34343446
3435   {INRW,"%a",      2,16}, /* 20: 0010 0000 oooo oooo                      */
3436   {JB,0,          1, 4}, /* 21: 0010 0001                                */
3437   {INX,"DE",       1, 7}, /* 22: 0010 0010                                */
3438   {DCX,"DE",       1, 7}, /* 23: 0010 0011                                */
3439   {LXI,"DE,%w",    3,10}, /* 24: 0010 0100 llll llll hhhh hhhh            */
3440   {GTIW,"%a,%b",   3,19}, /* 25: 0010 0101 oooo oooo xxxx xxxx            */
3441   {ADINC,"A,%b",   2, 7}, /* 26: 0010 0110 xxxx xxxx                      */
3442   {GTI,"A,%b",     2, 7}, /* 27: 0010 0111 xxxx xxxx                      */
3443   {illegal,0,     1, 4}, /* 28: 0010 1000                                */
3444   {LDAX,"(BC)",    1, 7}, /* 29: 0010 1001                                */
3445   {LDAX,"(DE)",    1, 7}, /* 2a: 0010 1010                                */
3446   {LDAX,"(HL)",    1, 7}, /* 2b: 0010 1011                                */
3447   {LDAX,"(DE+)",   1, 7}, /* 2c: 0010 1100                                */
3448   {LDAX,"(HL+)",   1, 7}, /* 2d: 0010 1101                                */
3449   {LDAX,"(DE-)",   1, 7}, /* 2e: 0010 1110                                */
3450   {LDAX,"(HL-)",   1, 7}, /* 2f: 0010 1111                                */
3447   {INRW,"%a"      }, /* 20: 0010 0000 oooo oooo                      */
3448   {JB,0          }, /* 21: 0010 0001                                */
3449   {INX,"DE"       }, /* 22: 0010 0010                                */
3450   {DCX,"DE"       }, /* 23: 0010 0011                                */
3451   {LXI,"DE,%w"    }, /* 24: 0010 0100 llll llll hhhh hhhh            */
3452   {GTIW,"%a,%b"   }, /* 25: 0010 0101 oooo oooo xxxx xxxx            */
3453   {ADINC,"A,%b"   }, /* 26: 0010 0110 xxxx xxxx                      */
3454   {GTI,"A,%b"     }, /* 27: 0010 0111 xxxx xxxx                      */
3455   {illegal,0     }, /* 28: 0010 1000                                */
3456   {LDAX,"(BC)"    }, /* 29: 0010 1001                                */
3457   {LDAX,"(DE)"    }, /* 2a: 0010 1010                                */
3458   {LDAX,"(HL)"    }, /* 2b: 0010 1011                                */
3459   {LDAX,"(DE+)"   }, /* 2c: 0010 1100                                */
3460   {LDAX,"(HL+)"   }, /* 2d: 0010 1101                                */
3461   {LDAX,"(DE-)"   }, /* 2e: 0010 1110                                */
3462   {LDAX,"(HL-)"   }, /* 2f: 0010 1111                                */
34513463
3452   {DCRW,"%a",      2,16}, /* 30: 0011 0000 oooo oooo                      */
3453   {BLOCK,0,       1,13}, /* 31: 0011 0001                                */   /* 7810 */
3454   {INX,"HL",       1, 7}, /* 32: 0011 0010                                */
3455   {DCX,"HL",       1, 7}, /* 33: 0011 0011                                */
3456   {LXI,"HL,%w",    3,10}, /* 34: 0011 0100 llll llll hhhh hhhh            */
3457   {LTIW,"%a,%b",   3,19}, /* 35: 0011 0101 oooo oooo xxxx xxxx            */
3458   {SUINB,"A,%b",   2, 7}, /* 36: 0011 0110 xxxx xxxx                      */
3459   {LTI,"A,%b",     2, 7}, /* 37: 0011 0111 xxxx xxxx                      */
3460   {illegal,0,     1, 4}, /* 38:                                          */
3461   {STAX,"(BC)",    1, 7}, /* 39: 0011 1001                                */
3462   {STAX,"(DE)",    1, 7}, /* 3a: 0011 1010                                */
3463   {STAX,"(HL)",    1, 7}, /* 3b: 0011 1011                                */
3464   {STAX,"(DE+)",   1, 7}, /* 3c: 0011 1100                                */
3465   {STAX,"(HL+)",   1, 7}, /* 3d: 0011 1101                                */
3466   {STAX,"(DE-)",   1, 7}, /* 3e: 0011 1110                                */
3467   {STAX,"(HL-)",   1, 7}, /* 3f: 0011 1111                                */
3464   {DCRW,"%a"      }, /* 30: 0011 0000 oooo oooo                      */
3465   {BLOCK,0       }, /* 31: 0011 0001                                */   /* 7810 */
3466   {INX,"HL",       }, /* 32: 0011 0010                                */
3467   {DCX,"HL",       }, /* 33: 0011 0011                                */
3468   {LXI,"HL,%w"    }, /* 34: 0011 0100 llll llll hhhh hhhh            */
3469   {LTIW,"%a,%b"   }, /* 35: 0011 0101 oooo oooo xxxx xxxx            */
3470   {SUINB,"A,%b"   }, /* 36: 0011 0110 xxxx xxxx                      */
3471   {LTI,"A,%b"     }, /* 37: 0011 0111 xxxx xxxx                      */
3472   {illegal,0     }, /* 38:                                          */
3473   {STAX,"(BC)"    }, /* 39: 0011 1001                                */
3474   {STAX,"(DE)"    }, /* 3a: 0011 1010                                */
3475   {STAX,"(HL)"    }, /* 3b: 0011 1011                                */
3476   {STAX,"(DE+)"   }, /* 3c: 0011 1100                                */
3477   {STAX,"(HL+)"   }, /* 3d: 0011 1101                                */
3478   {STAX,"(DE-)"   }, /* 3e: 0011 1110                                */
3479   {STAX,"(HL-)"   }, /* 3f: 0011 1111                                */
34683480
3469   {CALL,"%w",      3,16}, /* 40: 0100 0000 llll llll hhhh hhhh            */
3470   {INR,"A",        1, 4}, /* 41: 0100 0001                                */
3471   {INR,"B",        1, 4}, /* 42: 0100 0010                                */
3472   {INR,"C",        1, 4}, /* 43: 0100 0011                                */
3473   {LXI,"EA,%w",    3,10}, /* 44: 0100 0100 llll llll hhhh hhhh            */
3474   {ONIW,"%a,%b",   3,19}, /* 45: 0100 0101 oooo oooo xxxx xxxx            */
3475   {ADI,"A,%b",     2, 7}, /* 46: 0100 0110 xxxx xxxx                      */
3476   {ONI,"A,%b",     2, 7}, /* 47: 0100 0111 xxxx xxxx                      */
3477   {0,dasm48_7810,    0, 0}, /* 48: prefix                                   */
3478   {MVIX,"BC,%b",   2,10}, /* 49: 0100 1001 xxxx xxxx                      */
3479   {MVIX,"DE,%b",   2,10}, /* 4a: 0100 1010 xxxx xxxx                      */
3480   {MVIX,"HL,%b",   2,10}, /* 4b: 0100 1011 xxxx xxxx                      */
3481   {0,dasm4C_7810,    0, 0}, /* 4c: prefix                                   */
3482   {0,dasm4D_7810,    0, 0}, /* 4d: prefix                                   */
3483   {JRE,"%d",       2,10}, /* 4e: 0100 111d dddd dddd                      */
3484   {JRE,"%d",       2,10}, /* 4f: 0100 111d dddd dddd                      */
3481   {CALL,"%w"      }, /* 40: 0100 0000 llll llll hhhh hhhh            */
3482   {INR,"A"        }, /* 41: 0100 0001                                */
3483   {INR,"B"        }, /* 42: 0100 0010                                */
3484   {INR,"C"        }, /* 43: 0100 0011                                */
3485   {LXI,"EA,%w"    }, /* 44: 0100 0100 llll llll hhhh hhhh            */
3486   {ONIW,"%a,%b"   }, /* 45: 0100 0101 oooo oooo xxxx xxxx            */
3487   {ADI,"A,%b"     }, /* 46: 0100 0110 xxxx xxxx                      */
3488   {ONI,"A,%b"     }, /* 47: 0100 0111 xxxx xxxx                      */
3489   {0,dasm48_7810   }, /* 48: prefix                                   */
3490   {MVIX,"BC,%b"   }, /* 49: 0100 1001 xxxx xxxx                      */
3491   {MVIX,"DE,%b"   }, /* 4a: 0100 1010 xxxx xxxx                      */
3492   {MVIX,"HL,%b"   }, /* 4b: 0100 1011 xxxx xxxx                      */
3493   {0,dasm4C_7810   }, /* 4c: prefix                                   */
3494   {0,dasm4D_7810   }, /* 4d: prefix                                   */
3495   {JRE,"%d"       }, /* 4e: 0100 111d dddd dddd                      */
3496   {JRE,"%d"       }, /* 4f: 0100 111d dddd dddd                      */
34853497
3486   {EXH,0,        1, 4}, /* 50: 0101 0000                                */   /* 7810 */
3487   {DCR,"A",        1, 4}, /* 51: 0101 0001                                */
3488   {DCR,"B",        1, 4}, /* 52: 0101 0010                                */
3489   {DCR,"C",        1, 4}, /* 53: 0101 0011                                */
3490   {JMP,"%w",       3,10}, /* 54: 0101 0100 llll llll hhhh hhhh            */
3491   {OFFIW,"%a,%b",  3,19}, /* 55: 0101 0101 oooo oooo xxxx xxxx            */
3492   {ACI,"A,%b",     2, 7}, /* 56: 0101 0110 xxxx xxxx                      */
3493   {OFFI,"A,%b",    2, 7}, /* 57: 0101 0111 xxxx xxxx                      */
3494   {BIT,"0,%a",     2,10}, /* 58: 0101 1000 oooo oooo                      */   /* 7810 */
3495   {BIT,"1,%a",     2,10}, /* 59: 0101 1001 oooo oooo                      */   /* 7810 */
3496   {BIT,"2,%a",     2,10}, /* 5a: 0101 1010 oooo oooo                      */   /* 7810 */
3497   {BIT,"3,%a",     2,10}, /* 5b: 0101 1011 oooo oooo                      */   /* 7810 */
3498   {BIT,"4,%a",     2,10}, /* 5c: 0101 1100 oooo oooo                      */   /* 7810 */
3499   {BIT,"5,%a",     2,10}, /* 5d: 0101 1101 oooo oooo                      */   /* 7810 */
3500   {BIT,"6,%a",     2,10}, /* 5e: 0101 1110 oooo oooo                      */   /* 7810 */
3501   {BIT,"7,%a",     2,10}, /* 5f: 0101 1111 oooo oooo                      */   /* 7810 */
3498   {EXH,0        }, /* 50: 0101 0000                                */   /* 7810 */
3499   {DCR,"A"        }, /* 51: 0101 0001                                */
3500   {DCR,"B"        }, /* 52: 0101 0010                                */
3501   {DCR,"C"        }, /* 53: 0101 0011                                */
3502   {JMP,"%w"       }, /* 54: 0101 0100 llll llll hhhh hhhh            */
3503   {OFFIW,"%a,%b"  }, /* 55: 0101 0101 oooo oooo xxxx xxxx            */
3504   {ACI,"A,%b"     }, /* 56: 0101 0110 xxxx xxxx                      */
3505   {OFFI,"A,%b"    }, /* 57: 0101 0111 xxxx xxxx                      */
3506   {BIT,"0,%a",     }, /* 58: 0101 1000 oooo oooo                      */   /* 7810 */
3507   {BIT,"1,%a",     }, /* 59: 0101 1001 oooo oooo                      */   /* 7810 */
3508   {BIT,"2,%a",     }, /* 5a: 0101 1010 oooo oooo                      */   /* 7810 */
3509   {BIT,"3,%a",     }, /* 5b: 0101 1011 oooo oooo                      */   /* 7810 */
3510   {BIT,"4,%a",     }, /* 5c: 0101 1100 oooo oooo                      */   /* 7810 */
3511   {BIT,"5,%a",     }, /* 5d: 0101 1101 oooo oooo                      */   /* 7810 */
3512   {BIT,"6,%a",     }, /* 5e: 0101 1110 oooo oooo                      */   /* 7810 */
3513   {BIT,"7,%a",     }, /* 5f: 0101 1111 oooo oooo                      */   /* 7810 */
35023514
3503   {0,dasm60,       0, 0}, /* 60: prefix                                   */
3504   {DAA,0,        1, 4}, /* 61: 0110 0001                                */
3505   {RETI,0,       1,13}, /* 62: 0110 0010                                */
3506   {STAW,"%a",      2,10}, /* 63: 0110 0011 oooo oooo                      */
3507   {0,dasm64_7810,    0, 0}, /* 64: prefix                                   */
3508   {NEIW,"%a,%b",   3,19}, /* 65: 0110 0101 oooo oooo xxxx xxxx            */
3509   {SUI,"A,%b",     2, 7}, /* 66: 0110 0110 xxxx xxxx                      */
3510   {NEI,"A,%b",     2, 7}, /* 67: 0110 0111 xxxx xxxx                      */
3511   {MVI,"V,%b",     2, 7}, /* 68: 0110 1000 xxxx xxxx                      */
3512   {MVI,"A,%b",     2, 7}, /* 69: 0110 1001 xxxx xxxx                      */
3513   {MVI,"B,%b",     2, 7}, /* 6a: 0110 1010 xxxx xxxx                      */
3514   {MVI,"C,%b",     2, 7}, /* 6b: 0110 1011 xxxx xxxx                      */
3515   {MVI,"D,%b",     2, 7}, /* 6c: 0110 1100 xxxx xxxx                      */
3516   {MVI,"E,%b",     2, 7}, /* 6d: 0110 1101 xxxx xxxx                      */
3517   {MVI,"H,%b",     2, 7}, /* 6e: 0110 1110 xxxx xxxx                      */
3518   {MVI,"L,%b",     2, 7}, /* 6f: 0110 1111 xxxx xxxx                      */
3515   {0,dasm60       }, /* 60: prefix                                   */
3516   {DAA,0        }, /* 61: 0110 0001                                */
3517   {RETI,0       }, /* 62: 0110 0010                                */
3518   {STAW,"%a"      }, /* 63: 0110 0011 oooo oooo                      */
3519   {0,dasm64_7810    }, /* 64: prefix                                   */
3520   {NEIW,"%a,%b"   }, /* 65: 0110 0101 oooo oooo xxxx xxxx            */
3521   {SUI,"A,%b"     }, /* 66: 0110 0110 xxxx xxxx                      */
3522   {NEI,"A,%b"     }, /* 67: 0110 0111 xxxx xxxx                      */
3523   {MVI,"V,%b"     }, /* 68: 0110 1000 xxxx xxxx                      */
3524   {MVI,"A,%b"     }, /* 69: 0110 1001 xxxx xxxx                      */
3525   {MVI,"B,%b"     }, /* 6a: 0110 1010 xxxx xxxx                      */
3526   {MVI,"C,%b"     }, /* 6b: 0110 1011 xxxx xxxx                      */
3527   {MVI,"D,%b"     }, /* 6c: 0110 1100 xxxx xxxx                      */
3528   {MVI,"E,%b"     }, /* 6d: 0110 1101 xxxx xxxx                      */
3529   {MVI,"H,%b"     }, /* 6e: 0110 1110 xxxx xxxx                      */
3530   {MVI,"L,%b"     }, /* 6f: 0110 1111 xxxx xxxx                      */
35193531
3520   {0,dasm70,       0, 0}, /* 70: prefix                                   */
3521   {MVIW,"%a,%b",   3,13}, /* 71: 0111 0001 oooo oooo xxxx xxxx            */
3522   {SOFTI,0,       1,16}, /* 72: 0111 0010                                */
3523   {illegal,0,     1, 0}, /* 73:                                          */
3524   {0,dasm74,       0, 0}, /* 74: prefix                                   */
3525   {EQIW,"%a,%b",   3,19}, /* 75: 0111 0101 oooo oooo xxxx xxxx            */
3526   {SBI,"A,%b",     2, 7}, /* 76: 0111 0110 xxxx xxxx                      */
3527   {EQI,"A,%b",     2, 7}, /* 77: 0111 0111 xxxx xxxx                      */
3528   {CALF,"%f",      2,13}, /* 78: 0111 1ddd dddd dddd                      */
3529   {CALF,"%f",      2,13}, /* 79: 0111 1ddd dddd dddd                      */
3530   {CALF,"%f",      2,13}, /* 7a: 0111 1ddd dddd dddd                      */
3531   {CALF,"%f",      2,13}, /* 7b: 0111 1ddd dddd dddd                      */
3532   {CALF,"%f",      2,13}, /* 7c: 0111 1ddd dddd dddd                      */
3533   {CALF,"%f",      2,13}, /* 7d: 0111 1ddd dddd dddd                      */
3534   {CALF,"%f",      2,13}, /* 7e: 0111 1ddd dddd dddd                      */
3535   {CALF,"%f",      2,13}, /* 7f: 0111 1ddd dddd dddd                      */
3532   {0,dasm70       }, /* 70: prefix                                   */
3533   {MVIW,"%a,%b"   }, /* 71: 0111 0001 oooo oooo xxxx xxxx            */
3534   {SOFTI,0       }, /* 72: 0111 0010                                */
3535   {illegal,0     }, /* 73:                                          */
3536   {0,dasm74       }, /* 74: prefix                                   */
3537   {EQIW,"%a,%b"   }, /* 75: 0111 0101 oooo oooo xxxx xxxx            */
3538   {SBI,"A,%b"     }, /* 76: 0111 0110 xxxx xxxx                      */
3539   {EQI,"A,%b"     }, /* 77: 0111 0111 xxxx xxxx                      */
3540   {CALF,"%f"      }, /* 78: 0111 1ddd dddd dddd                      */
3541   {CALF,"%f"      }, /* 79: 0111 1ddd dddd dddd                      */
3542   {CALF,"%f"      }, /* 7a: 0111 1ddd dddd dddd                      */
3543   {CALF,"%f"      }, /* 7b: 0111 1ddd dddd dddd                      */
3544   {CALF,"%f"      }, /* 7c: 0111 1ddd dddd dddd                      */
3545   {CALF,"%f"      }, /* 7d: 0111 1ddd dddd dddd                      */
3546   {CALF,"%f"      }, /* 7e: 0111 1ddd dddd dddd                      */
3547   {CALF,"%f"      }, /* 7f: 0111 1ddd dddd dddd                      */
35363548
3537   {CALT,"%t",      1,16}, /* 80: 100t tttt                                */
3538   {CALT,"%t",      1,16}, /* 81: 100t tttt                                */
3539   {CALT,"%t",      1,16}, /* 82: 100t tttt                                */
3540   {CALT,"%t",      1,16}, /* 83: 100t tttt                                */
3541   {CALT,"%t",      1,16}, /* 84: 100t tttt                                */
3542   {CALT,"%t",      1,16}, /* 85: 100t tttt                                */
3543   {CALT,"%t",      1,16}, /* 86: 100t tttt                                */
3544   {CALT,"%t",      1,16}, /* 87: 100t tttt                                */
3545   {CALT,"%t",      1,16}, /* 88: 100t tttt                                */
3546   {CALT,"%t",      1,16}, /* 89: 100t tttt                                */
3547   {CALT,"%t",      1,16}, /* 8a: 100t tttt                                */
3548   {CALT,"%t",      1,16}, /* 8b: 100t tttt                                */
3549   {CALT,"%t",      1,16}, /* 8c: 100t tttt                                */
3550   {CALT,"%t",      1,16}, /* 8d: 100t tttt                                */
3551   {CALT,"%t",      1,16}, /* 8e: 100t tttt                                */
3552   {CALT,"%t",      1,16}, /* 8f: 100t tttt                                */
3549   {CALT,"%t"      }, /* 80: 100t tttt                                */
3550   {CALT,"%t"      }, /* 81: 100t tttt                                */
3551   {CALT,"%t"      }, /* 82: 100t tttt                                */
3552   {CALT,"%t"      }, /* 83: 100t tttt                                */
3553   {CALT,"%t"      }, /* 84: 100t tttt                                */
3554   {CALT,"%t"      }, /* 85: 100t tttt                                */
3555   {CALT,"%t"      }, /* 86: 100t tttt                                */
3556   {CALT,"%t"      }, /* 87: 100t tttt                                */
3557   {CALT,"%t"      }, /* 88: 100t tttt                                */
3558   {CALT,"%t"      }, /* 89: 100t tttt                                */
3559   {CALT,"%t"      }, /* 8a: 100t tttt                                */
3560   {CALT,"%t"      }, /* 8b: 100t tttt                                */
3561   {CALT,"%t"      }, /* 8c: 100t tttt                                */
3562   {CALT,"%t"      }, /* 8d: 100t tttt                                */
3563   {CALT,"%t"      }, /* 8e: 100t tttt                                */
3564   {CALT,"%t"      }, /* 8f: 100t tttt                                */
35533565
3554   {CALT,"%t",      1,16}, /* 90: 100t tttt                                */
3555   {CALT,"%t",      1,16}, /* 91: 100t tttt                                */
3556   {CALT,"%t",      1,16}, /* 92: 100t tttt                                */
3557   {CALT,"%t",      1,16}, /* 93: 100t tttt                                */
3558   {CALT,"%t",      1,16}, /* 94: 100t tttt                                */
3559   {CALT,"%t",      1,16}, /* 95: 100t tttt                                */
3560   {CALT,"%t",      1,16}, /* 96: 100t tttt                                */
3561   {CALT,"%t",      1,16}, /* 97: 100t tttt                                */
3562   {CALT,"%t",      1,16}, /* 98: 100t tttt                                */
3563   {CALT,"%t",      1,16}, /* 99: 100t tttt                                */
3564   {CALT,"%t",      1,16}, /* 9a: 100t tttt                                */
3565   {CALT,"%t",      1,16}, /* 9b: 100t tttt                                */
3566   {CALT,"%t",      1,16}, /* 9c: 100t tttt                                */
3567   {CALT,"%t",      1,16}, /* 9d: 100t tttt                                */
3568   {CALT,"%t",      1,16}, /* 9e: 100t tttt                                */
3569   {CALT,"%t",      1,16}, /* 9f: 100t tttt                                */
3566   {CALT,"%t"      }, /* 90: 100t tttt                                */
3567   {CALT,"%t"      }, /* 91: 100t tttt                                */
3568   {CALT,"%t"      }, /* 92: 100t tttt                                */
3569   {CALT,"%t"      }, /* 93: 100t tttt                                */
3570   {CALT,"%t"      }, /* 94: 100t tttt                                */
3571   {CALT,"%t"      }, /* 95: 100t tttt                                */
3572   {CALT,"%t"      }, /* 96: 100t tttt                                */
3573   {CALT,"%t"      }, /* 97: 100t tttt                                */
3574   {CALT,"%t"      }, /* 98: 100t tttt                                */
3575   {CALT,"%t"      }, /* 99: 100t tttt                                */
3576   {CALT,"%t"      }, /* 9a: 100t tttt                                */
3577   {CALT,"%t"      }, /* 9b: 100t tttt                                */
3578   {CALT,"%t"      }, /* 9c: 100t tttt                                */
3579   {CALT,"%t"      }, /* 9d: 100t tttt                                */
3580   {CALT,"%t"      }, /* 9e: 100t tttt                                */
3581   {CALT,"%t"      }, /* 9f: 100t tttt                                */
35703582
3571   {POP,"VA",       1,10}, /* a0: 1010 0000                                */
3572   {POP,"BC",       1,10}, /* a1: 1010 0001                                */
3573   {POP,"DE",       1,10}, /* a2: 1010 0010                                */
3574   {POP,"HL",       1,10}, /* a3: 1010 0011                                */
3575   {POP,"EA",       1,10}, /* a4: 1010 0100                                */
3576   {DMOV,"EA,BC",   1, 4}, /* a5: 1010 0101                                */
3577   {DMOV,"EA,DE",   1, 4}, /* a6: 1010 0110                                */
3578   {DMOV,"EA,HL",   1, 4}, /* a7: 1010 0111                                */
3579   {INX,"EA",       1, 7}, /* a8: 1010 1000                                */
3580   {DCX,"EA",       1, 7}, /* a9: 1010 1001                                */
3581   {EI,0,          1, 4}, /* aa: 1010 1010                                */
3582   {LDAX,"(DE+%b)", 2,13}, /* ab: 1010 1011 dddd dddd                      */
3583   {LDAX,"(HL+A)",  1,13}, /* ac: 1010 1100                                */
3584   {LDAX,"(HL+B)",  1,13}, /* ad: 1010 1101                                */
3585   {LDAX,"(HL+EA)", 1,13}, /* ae: 1010 1110                                */
3586   {LDAX,"(HL+%b)", 2,13}, /* af: 1010 1111 dddd dddd                      */
3583   {POP,"VA"       }, /* a0: 1010 0000                                */
3584   {POP,"BC"       }, /* a1: 1010 0001                                */
3585   {POP,"DE"       }, /* a2: 1010 0010                                */
3586   {POP,"HL",       }, /* a3: 1010 0011                                */
3587   {POP,"EA"       }, /* a4: 1010 0100                                */
3588   {DMOV,"EA,BC"   }, /* a5: 1010 0101                                */
3589   {DMOV,"EA,DE"   }, /* a6: 1010 0110                                */
3590   {DMOV,"EA,HL"   }, /* a7: 1010 0111                                */
3591   {INX,"EA"       }, /* a8: 1010 1000                                */
3592   {DCX,"EA"       }, /* a9: 1010 1001                                */
3593   {EI,0          }, /* aa: 1010 1010                                */
3594   {LDAX,"(DE+%b)" }, /* ab: 1010 1011 dddd dddd                      */
3595   {LDAX,"(HL+A)"  }, /* ac: 1010 1100                                */
3596   {LDAX,"(HL+B)"  }, /* ad: 1010 1101                                */
3597   {LDAX,"(HL+EA)" }, /* ae: 1010 1110                                */
3598   {LDAX,"(HL+%b)" }, /* af: 1010 1111 dddd dddd                      */
35873599
3588   {PUSH,"VA",      1,13}, /* b0: 1011 0000                                */
3589   {PUSH,"BC",      1,13}, /* b1: 1011 0001                                */
3590   {PUSH,"DE",      1,13}, /* b2: 1011 0010                                */
3591   {PUSH,"HL",      1,13}, /* b3: 1011 0011                                */
3592   {PUSH,"EA",      1,13}, /* b4: 1011 0100                                */
3593   {DMOV,"BC,EA",   1, 4}, /* b5: 1011 0101                                */
3594   {DMOV,"DE,EA",   1, 4}, /* b6: 1011 0110                                */
3595   {DMOV,"HL,EA",   1, 4}, /* b7: 1011 0111                                */
3596   {RET,0,        1,10}, /* b8: 1011 1000                                */
3597   {RETS,0,       1,10}, /* b9: 1011 1001                                */
3598   {DI,0,          1, 4}, /* ba: 1011 1010                                */
3599   {STAX,"(DE+%b)", 2,13}, /* bb: 1011 1011 dddd dddd                      */
3600   {STAX,"(HL+A)",  1,13}, /* bc: 1011 1100                                */
3601   {STAX,"(HL+B)",  1,13}, /* bd: 1011 1101                                */
3602   {STAX,"(HL+EA)", 1,13}, /* be: 1011 1110                                */
3603   {STAX,"(HL+%b)", 2,13}, /* bf: 1011 1111 dddd dddd                      */
3600   {PUSH,"VA"      }, /* b0: 1011 0000                                */
3601   {PUSH,"BC"      }, /* b1: 1011 0001                                */
3602   {PUSH,"DE"      }, /* b2: 1011 0010                                */
3603   {PUSH,"HL",      }, /* b3: 1011 0011                                */
3604   {PUSH,"EA"      }, /* b4: 1011 0100                                */
3605   {DMOV,"BC,EA"   }, /* b5: 1011 0101                                */
3606   {DMOV,"DE,EA"   }, /* b6: 1011 0110                                */
3607   {DMOV,"HL,EA"   }, /* b7: 1011 0111                                */
3608   {RET,0        }, /* b8: 1011 1000                                */
3609   {RETS,0       }, /* b9: 1011 1001                                */
3610   {DI,0          }, /* ba: 1011 1010                                */
3611   {STAX,"(DE+%b)" }, /* bb: 1011 1011 dddd dddd                      */
3612   {STAX,"(HL+A)"  }, /* bc: 1011 1100                                */
3613   {STAX,"(HL+B)"  }, /* bd: 1011 1101                                */
3614   {STAX,"(HL+EA)" }, /* be: 1011 1110                                */
3615   {STAX,"(HL+%b)" }, /* bf: 1011 1111 dddd dddd                      */
36043616
3605   {JR,"%o",        1,10}, /* c0: 11oo oooo                                */
3606   {JR,"%o",        1,10}, /* c1: 11oo oooo                                */
3607   {JR,"%o",        1,10}, /* c2: 11oo oooo                                */
3608   {JR,"%o",        1,10}, /* c3: 11oo oooo                                */
3609   {JR,"%o",        1,10}, /* c4: 11oo oooo                                */
3610   {JR,"%o",        1,10}, /* c5: 11oo oooo                                */
3611   {JR,"%o",        1,10}, /* c6: 11oo oooo                                */
3612   {JR,"%o",        1,10}, /* c7: 11oo oooo                                */
3613   {JR,"%o",        1,10}, /* c8: 11oo oooo                                */
3614   {JR,"%o",        1,10}, /* c9: 11oo oooo                                */
3615   {JR,"%o",        1,10}, /* ca: 11oo oooo                                */
3616   {JR,"%o",        1,10}, /* cb: 11oo oooo                                */
3617   {JR,"%o",        1,10}, /* cc: 11oo oooo                                */
3618   {JR,"%o",        1,10}, /* cd: 11oo oooo                                */
3619   {JR,"%o",        1,10}, /* ce: 11oo oooo                                */
3620   {JR,"%o",        1,10}, /* cf: 11oo oooo                                */
3617   {JR,"%o"        }, /* c0: 11oo oooo                                */
3618   {JR,"%o"        }, /* c1: 11oo oooo                                */
3619   {JR,"%o"        }, /* c2: 11oo oooo                                */
3620   {JR,"%o"        }, /* c3: 11oo oooo                                */
3621   {JR,"%o"        }, /* c4: 11oo oooo                                */
3622   {JR,"%o"        }, /* c5: 11oo oooo                                */
3623   {JR,"%o"        }, /* c6: 11oo oooo                                */
3624   {JR,"%o"        }, /* c7: 11oo oooo                                */
3625   {JR,"%o"        }, /* c8: 11oo oooo                                */
3626   {JR,"%o"        }, /* c9: 11oo oooo                                */
3627   {JR,"%o"        }, /* ca: 11oo oooo                                */
3628   {JR,"%o"        }, /* cb: 11oo oooo                                */
3629   {JR,"%o"        }, /* cc: 11oo oooo                                */
3630   {JR,"%o"        }, /* cd: 11oo oooo                                */
3631   {JR,"%o"        }, /* ce: 11oo oooo                                */
3632   {JR,"%o"        }, /* cf: 11oo oooo                                */
36213633
3622   {JR,"%o",        1,10}, /* d0: 11oo oooo                                */
3623   {JR,"%o",        1,10}, /* d1: 11oo oooo                                */
3624   {JR,"%o",        1,10}, /* d2: 11oo oooo                                */
3625   {JR,"%o",        1,10}, /* d3: 11oo oooo                                */
3626   {JR,"%o",        1,10}, /* d4: 11oo oooo                                */
3627   {JR,"%o",        1,10}, /* d5: 11oo oooo                                */
3628   {JR,"%o",        1,10}, /* d6: 11oo oooo                                */
3629   {JR,"%o",        1,10}, /* d7: 11oo oooo                                */
3630   {JR,"%o",        1,10}, /* d8: 11oo oooo                                */
3631   {JR,"%o",        1,10}, /* d9: 11oo oooo                                */
3632   {JR,"%o",        1,10}, /* da: 11oo oooo                                */
3633   {JR,"%o",        1,10}, /* db: 11oo oooo                                */
3634   {JR,"%o",        1,10}, /* dc: 11oo oooo                                */
3635   {JR,"%o",        1,10}, /* dd: 11oo oooo                                */
3636   {JR,"%o",        1,10}, /* de: 11oo oooo                                */
3637   {JR,"%o",        1,10}, /* df: 11oo oooo                                */
3634   {JR,"%o"        }, /* d0: 11oo oooo                                */
3635   {JR,"%o"        }, /* d1: 11oo oooo                                */
3636   {JR,"%o"        }, /* d2: 11oo oooo                                */
3637   {JR,"%o"        }, /* d3: 11oo oooo                                */
3638   {JR,"%o"        }, /* d4: 11oo oooo                                */
3639   {JR,"%o"        }, /* d5: 11oo oooo                                */
3640   {JR,"%o"        }, /* d6: 11oo oooo                                */
3641   {JR,"%o"        }, /* d7: 11oo oooo                                */
3642   {JR,"%o"        }, /* d8: 11oo oooo                                */
3643   {JR,"%o"        }, /* d9: 11oo oooo                                */
3644   {JR,"%o"        }, /* da: 11oo oooo                                */
3645   {JR,"%o"        }, /* db: 11oo oooo                                */
3646   {JR,"%o"        }, /* dc: 11oo oooo                                */
3647   {JR,"%o"        }, /* dd: 11oo oooo                                */
3648   {JR,"%o"        }, /* de: 11oo oooo                                */
3649   {JR,"%o"        }, /* df: 11oo oooo                                */
36383650
3639   {JR,"%o",        1,10}, /* e0: 11oo oooo                                */
3640   {JR,"%o",        1,10}, /* e1: 11oo oooo                                */
3641   {JR,"%o",        1,10}, /* e2: 11oo oooo                                */
3642   {JR,"%o",        1,10}, /* e3: 11oo oooo                                */
3643   {JR,"%o",        1,10}, /* e4: 11oo oooo                                */
3644   {JR,"%o",        1,10}, /* e5: 11oo oooo                                */
3645   {JR,"%o",        1,10}, /* e6: 11oo oooo                                */
3646   {JR,"%o",        1,10}, /* e7: 11oo oooo                                */
3647   {JR,"%o",        1,10}, /* e8: 11oo oooo                                */
3648   {JR,"%o",        1,10}, /* e9: 11oo oooo                                */
3649   {JR,"%o",        1,10}, /* ea: 11oo oooo                                */
3650   {JR,"%o",        1,10}, /* eb: 11oo oooo                                */
3651   {JR,"%o",        1,10}, /* ec: 11oo oooo                                */
3652   {JR,"%o",        1,10}, /* ed: 11oo oooo                                */
3653   {JR,"%o",        1,10}, /* ee: 11oo oooo                                */
3654   {JR,"%o",        1,10}, /* ef: 11oo oooo                                */
3651   {JR,"%o"        }, /* e0: 11oo oooo                                */
3652   {JR,"%o"        }, /* e1: 11oo oooo                                */
3653   {JR,"%o"        }, /* e2: 11oo oooo                                */
3654   {JR,"%o"        }, /* e3: 11oo oooo                                */
3655   {JR,"%o"        }, /* e4: 11oo oooo                                */
3656   {JR,"%o"        }, /* e5: 11oo oooo                                */
3657   {JR,"%o"        }, /* e6: 11oo oooo                                */
3658   {JR,"%o"        }, /* e7: 11oo oooo                                */
3659   {JR,"%o"        }, /* e8: 11oo oooo                                */
3660   {JR,"%o"        }, /* e9: 11oo oooo                                */
3661   {JR,"%o"        }, /* ea: 11oo oooo                                */
3662   {JR,"%o"        }, /* eb: 11oo oooo                                */
3663   {JR,"%o"        }, /* ec: 11oo oooo                                */
3664   {JR,"%o"        }, /* ed: 11oo oooo                                */
3665   {JR,"%o"        }, /* ee: 11oo oooo                                */
3666   {JR,"%o"        }, /* ef: 11oo oooo                                */
36553667
3656   {JR,"%o",        1,10}, /* f0: 11oo oooo                                */
3657   {JR,"%o",        1,10}, /* f1: 11oo oooo                                */
3658   {JR,"%o",        1,10}, /* f2: 11oo oooo                                */
3659   {JR,"%o",        1,10}, /* f3: 11oo oooo                                */
3660   {JR,"%o",        1,10}, /* f4: 11oo oooo                                */
3661   {JR,"%o",        1,10}, /* f5: 11oo oooo                                */
3662   {JR,"%o",        1,10}, /* f6: 11oo oooo                                */
3663   {JR,"%o",        1,10}, /* f7: 11oo oooo                                */
3664   {JR,"%o",        1,10}, /* f8: 11oo oooo                                */
3665   {JR,"%o",        1,10}, /* f9: 11oo oooo                                */
3666   {JR,"%o",        1,10}, /* fa: 11oo oooo                                */
3667   {JR,"%o",        1,10}, /* fb: 11oo oooo                                */
3668   {JR,"%o",        1,10}, /* fc: 11oo oooo                                */
3669   {JR,"%o",        1,10}, /* fd: 11oo oooo                                */
3670   {JR,"%o",        1,10}, /* fe: 11oo oooo                                */
3671   {JR,"%o",        1,10}  /* ff: 11oo oooo                                */
3668   {JR,"%o"        }, /* f0: 11oo oooo                                */
3669   {JR,"%o"        }, /* f1: 11oo oooo                                */
3670   {JR,"%o"        }, /* f2: 11oo oooo                                */
3671   {JR,"%o"        }, /* f3: 11oo oooo                                */
3672   {JR,"%o"        }, /* f4: 11oo oooo                                */
3673   {JR,"%o"        }, /* f5: 11oo oooo                                */
3674   {JR,"%o"        }, /* f6: 11oo oooo                                */
3675   {JR,"%o"        }, /* f7: 11oo oooo                                */
3676   {JR,"%o"        }, /* f8: 11oo oooo                                */
3677   {JR,"%o"        }, /* f9: 11oo oooo                                */
3678   {JR,"%o"        }, /* fa: 11oo oooo                                */
3679   {JR,"%o"        }, /* fb: 11oo oooo                                */
3680   {JR,"%o"        }, /* fc: 11oo oooo                                */
3681   {JR,"%o"        }, /* fd: 11oo oooo                                */
3682   {JR,"%o"        }, /* fe: 11oo oooo                                */
3683   {JR,"%o"        }  /* ff: 11oo oooo                                */
36723684};
36733685
36743686static const struct dasm_s  dasmXX_7807[256] =
36753687{
3676   {NOP,0,        1, 4}, /* 00: 0000 0000                                */
3677   {LDAW,"%a",      2,10}, /* 01: 0000 0001 oooo oooo                      */
3678   {INX,"SP",       1, 7}, /* 02: 0000 0010                                */
3679   {DCX,"SP",       1, 7}, /* 03: 0000 0011                                */
3680   {LXI,"SP,%w",    3,10}, /* 04: 0000 0100 llll llll hhhh hhhh            */
3681   {ANIW,"%a,%b",   3,19}, /* 05: 0000 0101 oooo oooo xxxx xxxx            */
3682   {illegal,0,     1, 4}, /* 06:                                          */
3683   {ANI,"A,%b",     2, 7}, /* 07: 0000 0111 xxxx xxxx                      */
3684   {MOV,"A,EAH",    1, 4}, /* 08: 0000 1000                                */
3685   {MOV,"A,EAL",    1, 4}, /* 09: 0000 1001                                */
3686   {MOV,"A,B",      1, 4}, /* 0a: 0000 1010                                */
3687   {MOV,"A,C",      1, 4}, /* 0b: 0000 1011                                */
3688   {MOV,"A,D",      1, 4}, /* 0c: 0000 1100                                */
3689   {MOV,"A,E",      1, 4}, /* 0d: 0000 1101                                */
3690   {MOV,"A,H",      1, 4}, /* 0e: 0000 1110                                */
3691   {MOV,"A,L",      1, 4}, /* 0f: 0000 1111                                */
3688   {NOP,0        }, /* 00: 0000 0000                                */
3689   {LDAW,"%a"      }, /* 01: 0000 0001 oooo oooo                      */
3690   {INX,"SP"       }, /* 02: 0000 0010                                */
3691   {DCX,"SP"       }, /* 03: 0000 0011                                */
3692   {LXI,"SP,%w"    }, /* 04: 0000 0100 llll llll hhhh hhhh            */
3693   {ANIW,"%a,%b"   }, /* 05: 0000 0101 oooo oooo xxxx xxxx            */
3694   {illegal,0     }, /* 06:                                          */
3695   {ANI,"A,%b"     }, /* 07: 0000 0111 xxxx xxxx                      */
3696   {MOV,"A,EAH"    }, /* 08: 0000 1000                                */
3697   {MOV,"A,EAL"    }, /* 09: 0000 1001                                */
3698   {MOV,"A,B"      }, /* 0a: 0000 1010                                */
3699   {MOV,"A,C"      }, /* 0b: 0000 1011                                */
3700   {MOV,"A,D"      }, /* 0c: 0000 1100                                */
3701   {MOV,"A,E"      }, /* 0d: 0000 1101                                */
3702   {MOV,"A,H"      }, /* 0e: 0000 1110                                */
3703   {MOV,"A,L"      }, /* 0f: 0000 1111                                */
36923704
3693   {BLOCK,"D+",    1,13}, /* 10: 0001 0000                                */   /* 7807 */
3694   {BLOCK,"D-",    1,13}, /* 11: 0001 0001                                */   /* 7807 */
3695   {INX,"BC",       1, 7}, /* 12: 0001 0010                                */
3696   {DCX,"BC",       1, 7}, /* 13: 0001 0011                                */
3697   {LXI,"BC,%w",    3,10}, /* 14: 0001 0100 llll llll hhhh hhhh            */
3698   {ORIW,"%a,%b",   3,19}, /* 15: 0001 0101 oooo oooo xxxx xxxx            */
3699   {XRI,"A,%b",     2, 7}, /* 16: 0001 0110 xxxx xxxx                      */
3700   {ORI,"A,%b",     2, 7}, /* 17: 0001 0111 xxxx xxxx                      */
3701   {MOV,"EAH,A",    1, 4}, /* 18: 0001 1000                                */
3702   {MOV,"EAL,A",    1, 4}, /* 19: 0001 1001                                */
3703   {MOV,"B,A",      1, 4}, /* 1a: 0001 1010                                */
3704   {MOV,"C,A",      1, 4}, /* 1b: 0001 1011                                */
3705   {MOV,"D,A",      1, 4}, /* 1c: 0001 1100                                */
3706   {MOV,"E,A",      1, 4}, /* 1d: 0001 1101                                */
3707   {MOV,"H,A",      1, 4}, /* 1e: 0001 1110                                */
3708   {MOV,"L,A",      1, 4}, /* 1f: 0001 1111                                */
3705   {BLOCK,"D+"    }, /* 10: 0001 0000                                */   /* 7807 */
3706   {BLOCK,"D-"    }, /* 11: 0001 0001                                */   /* 7807 */
3707   {INX,"BC"       }, /* 12: 0001 0010                                */
3708   {DCX,"BC"       }, /* 13: 0001 0011                                */
3709   {LXI,"BC,%w"    }, /* 14: 0001 0100 llll llll hhhh hhhh            */
3710   {ORIW,"%a,%b"   }, /* 15: 0001 0101 oooo oooo xxxx xxxx            */
3711   {XRI,"A,%b"     }, /* 16: 0001 0110 xxxx xxxx                      */
3712   {ORI,"A,%b"     }, /* 17: 0001 0111 xxxx xxxx                      */
3713   {MOV,"EAH,A"    }, /* 18: 0001 1000                                */
3714   {MOV,"EAL,A"    }, /* 19: 0001 1001                                */
3715   {MOV,"B,A"      }, /* 1a: 0001 1010                                */
3716   {MOV,"C,A"      }, /* 1b: 0001 1011                                */
3717   {MOV,"D,A"      }, /* 1c: 0001 1100                                */
3718   {MOV,"E,A"      }, /* 1d: 0001 1101                                */
3719   {MOV,"H,A"      }, /* 1e: 0001 1110                                */
3720   {MOV,"L,A"      }, /* 1f: 0001 1111                                */
37093721
3710   {INRW,"%a",      2,16}, /* 20: 0010 0000 oooo oooo                      */
3711   {JB,0,          1, 4}, /* 21: 0010 0001                                */
3712   {INX,"DE",       1, 7}, /* 22: 0010 0010                                */
3713   {DCX,"DE",       1, 7}, /* 23: 0010 0011                                */
3714   {LXI,"DE,%w",    3,10}, /* 24: 0010 0100 llll llll hhhh hhhh            */
3715   {GTIW,"%a,%b",   3,19}, /* 25: 0010 0101 oooo oooo xxxx xxxx            */
3716   {ADINC,"A,%b",   2, 7}, /* 26: 0010 0110 xxxx xxxx                      */
3717   {GTI,"A,%b",     2, 7}, /* 27: 0010 0111 xxxx xxxx                      */
3718   {illegal,0,     1, 4}, /* 28: 0010 1000                                */
3719   {LDAX,"(BC)",    1, 7}, /* 29: 0010 1001                                */
3720   {LDAX,"(DE)",    1, 7}, /* 2a: 0010 1010                                */
3721   {LDAX,"(HL)",    1, 7}, /* 2b: 0010 1011                                */
3722   {LDAX,"(DE+)",   1, 7}, /* 2c: 0010 1100                                */
3723   {LDAX,"(HL+)",   1, 7}, /* 2d: 0010 1101                                */
3724   {LDAX,"(DE-)",   1, 7}, /* 2e: 0010 1110                                */
3725   {LDAX,"(HL-)",   1, 7}, /* 2f: 0010 1111                                */
3722   {INRW,"%a"      }, /* 20: 0010 0000 oooo oooo                      */
3723   {JB,0          }, /* 21: 0010 0001                                */
3724   {INX,"DE"       }, /* 22: 0010 0010                                */
3725   {DCX,"DE"       }, /* 23: 0010 0011                                */
3726   {LXI,"DE,%w"    }, /* 24: 0010 0100 llll llll hhhh hhhh            */
3727   {GTIW,"%a,%b"   }, /* 25: 0010 0101 oooo oooo xxxx xxxx            */
3728   {ADINC,"A,%b"   }, /* 26: 0010 0110 xxxx xxxx                      */
3729   {GTI,"A,%b"     }, /* 27: 0010 0111 xxxx xxxx                      */
3730   {illegal,0     }, /* 28: 0010 1000                                */
3731   {LDAX,"(BC)"    }, /* 29: 0010 1001                                */
3732   {LDAX,"(DE)"    }, /* 2a: 0010 1010                                */
3733   {LDAX,"(HL)"    }, /* 2b: 0010 1011                                */
3734   {LDAX,"(DE+)"   }, /* 2c: 0010 1100                                */
3735   {LDAX,"(HL+)"   }, /* 2d: 0010 1101                                */
3736   {LDAX,"(DE-)"   }, /* 2e: 0010 1110                                */
3737   {LDAX,"(HL-)"   }, /* 2f: 0010 1111                                */
37263738
3727   {DCRW,"%a",      2,16}, /* 30: 0011 0000 oooo oooo                      */
3728   {AND,"CY,%i",    2,10}, /* 31: 0011 0001 bbbb bbbb                      */   /* 7807 */
3729   {INX,"HL",       1, 7}, /* 32: 0011 0010                                */
3730   {DCX,"HL",       1, 7}, /* 33: 0011 0011                                */
3731   {LXI,"HL,%w",    3,10}, /* 34: 0011 0100 llll llll hhhh hhhh            */
3732   {LTIW,"%a,%b",   3,19}, /* 35: 0011 0101 oooo oooo xxxx xxxx            */
3733   {SUINB,"A,%b",   2, 7}, /* 36: 0011 0110 xxxx xxxx                      */
3734   {LTI,"A,%b",     2, 7}, /* 37: 0011 0111 xxxx xxxx                      */
3735   {illegal,0,     1, 4}, /* 38:                                          */
3736   {STAX,"(BC)",    1, 7}, /* 39: 0011 1001                                */
3737   {STAX,"(DE)",    1, 7}, /* 3a: 0011 1010                                */
3738   {STAX,"(HL)",    1, 7}, /* 3b: 0011 1011                                */
3739   {STAX,"(DE+)",   1, 7}, /* 3c: 0011 1100                                */
3740   {STAX,"(HL+)",   1, 7}, /* 3d: 0011 1101                                */
3741   {STAX,"(DE-)",   1, 7}, /* 3e: 0011 1110                                */
3742   {STAX,"(HL-)",   1, 7}, /* 3f: 0011 1111                                */
3739   {DCRW,"%a"      }, /* 30: 0011 0000 oooo oooo                      */
3740   {AND,"CY,%i"    }, /* 31: 0011 0001 bbbb bbbb                      */   /* 7807 */
3741   {INX,"HL",       }, /* 32: 0011 0010                                */
3742   {DCX,"HL",       }, /* 33: 0011 0011                                */
3743   {LXI,"HL,%w"    }, /* 34: 0011 0100 llll llll hhhh hhhh            */
3744   {LTIW,"%a,%b"   }, /* 35: 0011 0101 oooo oooo xxxx xxxx            */
3745   {SUINB,"A,%b"   }, /* 36: 0011 0110 xxxx xxxx                      */
3746   {LTI,"A,%b"     }, /* 37: 0011 0111 xxxx xxxx                      */
3747   {illegal,0     }, /* 38:                                          */
3748   {STAX,"(BC)"    }, /* 39: 0011 1001                                */
3749   {STAX,"(DE)"    }, /* 3a: 0011 1010                                */
3750   {STAX,"(HL)"    }, /* 3b: 0011 1011                                */
3751   {STAX,"(DE+)"   }, /* 3c: 0011 1100                                */
3752   {STAX,"(HL+)"   }, /* 3d: 0011 1101                                */
3753   {STAX,"(DE-)"   }, /* 3e: 0011 1110                                */
3754   {STAX,"(HL-)"   }, /* 3f: 0011 1111                                */
37433755
3744   {CALL,"%w",      3,16}, /* 40: 0100 0000 llll llll hhhh hhhh            */
3745   {INR,"A",        1, 4}, /* 41: 0100 0001                                */
3746   {INR,"B",        1, 4}, /* 42: 0100 0010                                */
3747   {INR,"C",        1, 4}, /* 43: 0100 0011                                */
3748   {LXI,"EA,%w",    3,10}, /* 44: 0100 0100 llll llll hhhh hhhh            */
3749   {ONIW,"%a,%b",   3,19}, /* 45: 0100 0101 oooo oooo xxxx xxxx            */
3750   {ADI,"A,%b",     2, 7}, /* 46: 0100 0110 xxxx xxxx                      */
3751   {ONI,"A,%b",     2, 7}, /* 47: 0100 0111 xxxx xxxx                      */
3752   {0,dasm48_7807,    0, 0}, /* 48: prefix                                   */
3753   {MVIX,"BC,%b",   2,10}, /* 49: 0100 1001 xxxx xxxx                      */
3754   {MVIX,"DE,%b",   2,10}, /* 4a: 0100 1010 xxxx xxxx                      */
3755   {MVIX,"HL,%b",   2,10}, /* 4b: 0100 1011 xxxx xxxx                      */
3756   {0,dasm4C_7807,    0, 0}, /* 4c: prefix                                   */
3757   {0,dasm4D_7807,    0, 0}, /* 4d: prefix                                   */
3758   {JRE,"%d",       2,10}, /* 4e: 0100 111d dddd dddd                      */
3759   {JRE,"%d",       2,10}, /* 4f: 0100 111d dddd dddd                      */
3760   {SKN,"%i",       2,10}, /* 50: 0101 0000 bbbb bbbb                      */   /* 7807 */
3761   {DCR,"A",        1, 4}, /* 51: 0101 0001                                */
3762   {DCR,"B",        1, 4}, /* 52: 0101 0010                                */
3763   {DCR,"C",        1, 4}, /* 53: 0101 0011                                */
3764   {JMP,"%w",       3,10}, /* 54: 0101 0100 llll llll hhhh hhhh            */
3765   {OFFIW,"%a,%b",  3,19}, /* 55: 0101 0101 oooo oooo xxxx xxxx            */
3766   {ACI,"A,%b",     2, 7}, /* 56: 0101 0110 xxxx xxxx                      */
3767   {OFFI,"A,%b",    2, 7}, /* 57: 0101 0111 xxxx xxxx                      */
3768   {SETB,"%i",      2,13}, /* 58: 0101 1000 bbbb bbbb                      */   /* 7807 */
3769   {NOT,"%i",       2,13}, /* 59: 0101 1001 bbbb bbbb                      */   /* 7807 */
3770   {MOV,"%i,CY",    2,13}, /* 5a: 0101 1010 bbbb bbbb                      */   /* 7807 */
3771   {CLR,"%i",       2,13}, /* 5b: 0101 1011 bbbb bbbb                      */   /* 7807 */
3772   {OR,"CY,%i",     2,10}, /* 5c: 0101 1100 bbbb bbbb                      */   /* 7807 */
3773   {SK,"%i",        2,10}, /* 5d: 0101 1101 bbbb bbbb                      */   /* 7807 */
3774   {XOR,"CY,%i",    2,10}, /* 5e: 0101 1110 bbbb bbbb                      */   /* 7807 */
3775   {MOV,"CY,%i",    2,10}, /* 5f: 0101 1111 bbbb bbbb                      */   /* 7807 */
3756   {CALL,"%w"      }, /* 40: 0100 0000 llll llll hhhh hhhh            */
3757   {INR,"A"        }, /* 41: 0100 0001                                */
3758   {INR,"B"        }, /* 42: 0100 0010                                */
3759   {INR,"C"        }, /* 43: 0100 0011                                */
3760   {LXI,"EA,%w"    }, /* 44: 0100 0100 llll llll hhhh hhhh            */
3761   {ONIW,"%a,%b"   }, /* 45: 0100 0101 oooo oooo xxxx xxxx            */
3762   {ADI,"A,%b"     }, /* 46: 0100 0110 xxxx xxxx                      */
3763   {ONI,"A,%b"     }, /* 47: 0100 0111 xxxx xxxx                      */
3764   {0,dasm48_7807    }, /* 48: prefix                                   */
3765   {MVIX,"BC,%b"   }, /* 49: 0100 1001 xxxx xxxx                      */
3766   {MVIX,"DE,%b"   }, /* 4a: 0100 1010 xxxx xxxx                      */
3767   {MVIX,"HL,%b"   }, /* 4b: 0100 1011 xxxx xxxx                      */
3768   {0,dasm4C_7807    }, /* 4c: prefix                                   */
3769   {0,dasm4D_7807    }, /* 4d: prefix                                   */
3770   {JRE,"%d"       }, /* 4e: 0100 111d dddd dddd                      */
3771   {JRE,"%d"       }, /* 4f: 0100 111d dddd dddd                      */
3772   {SKN,"%i"       }, /* 50: 0101 0000 bbbb bbbb                      */   /* 7807 */
3773   {DCR,"A"        }, /* 51: 0101 0001                                */
3774   {DCR,"B"        }, /* 52: 0101 0010                                */
3775   {DCR,"C"        }, /* 53: 0101 0011                                */
3776   {JMP,"%w"       }, /* 54: 0101 0100 llll llll hhhh hhhh            */
3777   {OFFIW,"%a,%b"  }, /* 55: 0101 0101 oooo oooo xxxx xxxx            */
3778   {ACI,"A,%b"     }, /* 56: 0101 0110 xxxx xxxx                      */
3779   {OFFI,"A,%b"    }, /* 57: 0101 0111 xxxx xxxx                      */
3780   {SETB,"%i"      }, /* 58: 0101 1000 bbbb bbbb                      */   /* 7807 */
3781   {NOT,"%i"       }, /* 59: 0101 1001 bbbb bbbb                      */   /* 7807 */
3782   {MOV,"%i,CY"    }, /* 5a: 0101 1010 bbbb bbbb                      */   /* 7807 */
3783   {CLR,"%i"       }, /* 5b: 0101 1011 bbbb bbbb                      */   /* 7807 */
3784   {OR,"CY,%i"     }, /* 5c: 0101 1100 bbbb bbbb                      */   /* 7807 */
3785   {SK,"%i"        }, /* 5d: 0101 1101 bbbb bbbb                      */   /* 7807 */
3786   {XOR,"CY,%i"    }, /* 5e: 0101 1110 bbbb bbbb                      */   /* 7807 */
3787   {MOV,"CY,%i"    }, /* 5f: 0101 1111 bbbb bbbb                      */   /* 7807 */
37763788
3777   {0,dasm60,       0, 0}, /* 60: prefix                                   */
3778   {DAA,0,        1, 4}, /* 61: 0110 0001                                */
3779   {RETI,0,       1,13}, /* 62: 0110 0010                                */
3780   {STAW,"%a",      2,10}, /* 63: 0110 0011 oooo oooo                      */
3781   {0,dasm64_7807,    0, 0}, /* 64: prefix                                   */
3782   {NEIW,"%a,%b",   3,19}, /* 65: 0110 0101 oooo oooo xxxx xxxx            */
3783   {SUI,"A,%b",     2, 7}, /* 66: 0110 0110 xxxx xxxx                      */
3784   {NEI,"A,%b",     2, 7}, /* 67: 0110 0111 xxxx xxxx                      */
3785   {MVI,"V,%b",     2, 7}, /* 68: 0110 1000 xxxx xxxx                      */
3786   {MVI,"A,%b",     2, 7}, /* 69: 0110 1001 xxxx xxxx                      */
3787   {MVI,"B,%b",     2, 7}, /* 6a: 0110 1010 xxxx xxxx                      */
3788   {MVI,"C,%b",     2, 7}, /* 6b: 0110 1011 xxxx xxxx                      */
3789   {MVI,"D,%b",     2, 7}, /* 6c: 0110 1100 xxxx xxxx                      */
3790   {MVI,"E,%b",     2, 7}, /* 6d: 0110 1101 xxxx xxxx                      */
3791   {MVI,"H,%b",     2, 7}, /* 6e: 0110 1110 xxxx xxxx                      */
3792   {MVI,"L,%b",     2, 7}, /* 6f: 0110 1111 xxxx xxxx                      */
3789   {0,dasm60       }, /* 60: prefix                                   */
3790   {DAA,0        }, /* 61: 0110 0001                                */
3791   {RETI,0       }, /* 62: 0110 0010                                */
3792   {STAW,"%a"      }, /* 63: 0110 0011 oooo oooo                      */
3793   {0,dasm64_7807    }, /* 64: prefix                                   */
3794   {NEIW,"%a,%b"   }, /* 65: 0110 0101 oooo oooo xxxx xxxx            */
3795   {SUI,"A,%b"     }, /* 66: 0110 0110 xxxx xxxx                      */
3796   {NEI,"A,%b"     }, /* 67: 0110 0111 xxxx xxxx                      */
3797   {MVI,"V,%b"     }, /* 68: 0110 1000 xxxx xxxx                      */
3798   {MVI,"A,%b"     }, /* 69: 0110 1001 xxxx xxxx                      */
3799   {MVI,"B,%b"     }, /* 6a: 0110 1010 xxxx xxxx                      */
3800   {MVI,"C,%b"     }, /* 6b: 0110 1011 xxxx xxxx                      */
3801   {MVI,"D,%b"     }, /* 6c: 0110 1100 xxxx xxxx                      */
3802   {MVI,"E,%b"     }, /* 6d: 0110 1101 xxxx xxxx                      */
3803   {MVI,"H,%b"     }, /* 6e: 0110 1110 xxxx xxxx                      */
3804   {MVI,"L,%b"     }, /* 6f: 0110 1111 xxxx xxxx                      */
37933805
3794   {0,dasm70,       0, 0}, /* 70: prefix                                   */
3795   {MVIW,"%a,%b",   3,13}, /* 71: 0111 0001 oooo oooo xxxx xxxx            */
3796   {SOFTI,0,       1,16}, /* 72: 0111 0010                                */
3797   {illegal,0,     1, 0}, /* 73:                                          */
3798   {0,dasm74,       0, 0}, /* 74: prefix                                   */
3799   {EQIW,"%a,%b",   3,19}, /* 75: 0111 0101 oooo oooo xxxx xxxx            */
3800   {SBI,"A,%b",     2, 7}, /* 76: 0111 0110 xxxx xxxx                      */
3801   {EQI,"A,%b",     2, 7}, /* 77: 0111 0111 xxxx xxxx                      */
3802   {CALF,"%f",      2,13}, /* 78: 0111 1ddd dddd dddd                      */
3803   {CALF,"%f",      2,13}, /* 79: 0111 1ddd dddd dddd                      */
3804   {CALF,"%f",      2,13}, /* 7a: 0111 1ddd dddd dddd                      */
3805   {CALF,"%f",      2,13}, /* 7b: 0111 1ddd dddd dddd                      */
3806   {CALF,"%f",      2,13}, /* 7c: 0111 1ddd dddd dddd                      */
3807   {CALF,"%f",      2,13}, /* 7d: 0111 1ddd dddd dddd                      */
3808   {CALF,"%f",      2,13}, /* 7e: 0111 1ddd dddd dddd                      */
3809   {CALF,"%f",      2,13}, /* 7f: 0111 1ddd dddd dddd                      */
3806   {0,dasm70       }, /* 70: prefix                                   */
3807   {MVIW,"%a,%b"   }, /* 71: 0111 0001 oooo oooo xxxx xxxx            */
3808   {SOFTI,0       }, /* 72: 0111 0010                                */
3809   {illegal,0     }, /* 73:                                          */
3810   {0,dasm74       }, /* 74: prefix                                   */
3811   {EQIW,"%a,%b"   }, /* 75: 0111 0101 oooo oooo xxxx xxxx            */
3812   {SBI,"A,%b"     }, /* 76: 0111 0110 xxxx xxxx                      */
3813   {EQI,"A,%b"     }, /* 77: 0111 0111 xxxx xxxx                      */
3814   {CALF,"%f"      }, /* 78: 0111 1ddd dddd dddd                      */
3815   {CALF,"%f"      }, /* 79: 0111 1ddd dddd dddd                      */
3816   {CALF,"%f"      }, /* 7a: 0111 1ddd dddd dddd                      */
3817   {CALF,"%f"      }, /* 7b: 0111 1ddd dddd dddd                      */
3818   {CALF,"%f"      }, /* 7c: 0111 1ddd dddd dddd                      */
3819   {CALF,"%f"      }, /* 7d: 0111 1ddd dddd dddd                      */
3820   {CALF,"%f"      }, /* 7e: 0111 1ddd dddd dddd                      */
3821   {CALF,"%f"      }, /* 7f: 0111 1ddd dddd dddd                      */
38103822
3811   {CALT,"%t",      1,16}, /* 80: 100t tttt                                */
3812   {CALT,"%t",      1,16}, /* 81: 100t tttt                                */
3813   {CALT,"%t",      1,16}, /* 82: 100t tttt                                */
3814   {CALT,"%t",      1,16}, /* 83: 100t tttt                                */
3815   {CALT,"%t",      1,16}, /* 84: 100t tttt                                */
3816   {CALT,"%t",      1,16}, /* 85: 100t tttt                                */
3817   {CALT,"%t",      1,16}, /* 86: 100t tttt                                */
3818   {CALT,"%t",      1,16}, /* 87: 100t tttt                                */
3819   {CALT,"%t",      1,16}, /* 88: 100t tttt                                */
3820   {CALT,"%t",      1,16}, /* 89: 100t tttt                                */
3821   {CALT,"%t",      1,16}, /* 8a: 100t tttt                                */
3822   {CALT,"%t",      1,16}, /* 8b: 100t tttt                                */
3823   {CALT,"%t",      1,16}, /* 8c: 100t tttt                                */
3824   {CALT,"%t",      1,16}, /* 8d: 100t tttt                                */
3825   {CALT,"%t",      1,16}, /* 8e: 100t tttt                                */
3826   {CALT,"%t",      1,16}, /* 8f: 100t tttt                                */
3823   {CALT,"%t"      }, /* 80: 100t tttt                                */
3824   {CALT,"%t"      }, /* 81: 100t tttt                                */
3825   {CALT,"%t"      }, /* 82: 100t tttt                                */
3826   {CALT,"%t"      }, /* 83: 100t tttt                                */
3827   {CALT,"%t"      }, /* 84: 100t tttt                                */
3828   {CALT,"%t"      }, /* 85: 100t tttt                                */
3829   {CALT,"%t"      }, /* 86: 100t tttt                                */
3830   {CALT,"%t"      }, /* 87: 100t tttt                                */
3831   {CALT,"%t"      }, /* 88: 100t tttt                                */
3832   {CALT,"%t"      }, /* 89: 100t tttt                                */
3833   {CALT,"%t"      }, /* 8a: 100t tttt                                */
3834   {CALT,"%t"      }, /* 8b: 100t tttt                                */
3835   {CALT,"%t"      }, /* 8c: 100t tttt                                */
3836   {CALT,"%t"      }, /* 8d: 100t tttt                                */
3837   {CALT,"%t"      }, /* 8e: 100t tttt                                */
3838   {CALT,"%t"      }, /* 8f: 100t tttt                                */
38273839
3828   {CALT,"%t",      1,16}, /* 90: 100t tttt                                */
3829   {CALT,"%t",      1,16}, /* 91: 100t tttt                                */
3830   {CALT,"%t",      1,16}, /* 92: 100t tttt                                */
3831   {CALT,"%t",      1,16}, /* 93: 100t tttt                                */
3832   {CALT,"%t",      1,16}, /* 94: 100t tttt                                */
3833   {CALT,"%t",      1,16}, /* 95: 100t tttt                                */
3834   {CALT,"%t",      1,16}, /* 96: 100t tttt                                */
3835   {CALT,"%t",      1,16}, /* 97: 100t tttt                                */
3836   {CALT,"%t",      1,16}, /* 98: 100t tttt                                */
3837   {CALT,"%t",      1,16}, /* 99: 100t tttt                                */
3838   {CALT,"%t",      1,16}, /* 9a: 100t tttt                                */
3839   {CALT,"%t",      1,16}, /* 9b: 100t tttt                                */
3840   {CALT,"%t",      1,16}, /* 9c: 100t tttt                                */
3841   {CALT,"%t",      1,16}, /* 9d: 100t tttt                                */
3842   {CALT,"%t",      1,16}, /* 9e: 100t tttt                                */
3843   {CALT,"%t",      1,16}, /* 9f: 100t tttt                                */
3840   {CALT,"%t"      }, /* 90: 100t tttt                                */
3841   {CALT,"%t"      }, /* 91: 100t tttt                                */
3842   {CALT,"%t"      }, /* 92: 100t tttt                                */
3843   {CALT,"%t"      }, /* 93: 100t tttt                                */
3844   {CALT,"%t"      }, /* 94: 100t tttt                                */
3845   {CALT,"%t"      }, /* 95: 100t tttt                                */
3846   {CALT,"%t"      }, /* 96: 100t tttt                                */
3847   {CALT,"%t"      }, /* 97: 100t tttt                                */
3848   {CALT,"%t"      }, /* 98: 100t tttt                                */
3849   {CALT,"%t"      }, /* 99: 100t tttt                                */
3850   {CALT,"%t"      }, /* 9a: 100t tttt                                */
3851   {CALT,"%t"      }, /* 9b: 100t tttt                                */
3852   {CALT,"%t"      }, /* 9c: 100t tttt                                */
3853   {CALT,"%t"      }, /* 9d: 100t tttt                                */
3854   {CALT,"%t"      }, /* 9e: 100t tttt                                */
3855   {CALT,"%t"      }, /* 9f: 100t tttt                                */
38443856
3845   {POP,"VA",       1,10}, /* a0: 1010 0000                                */
3846   {POP,"BC",       1,10}, /* a1: 1010 0001                                */
3847   {POP,"DE",       1,10}, /* a2: 1010 0010                                */
3848   {POP,"HL",       1,10}, /* a3: 1010 0011                                */
3849   {POP,"EA",       1,10}, /* a4: 1010 0100                                */
3850   {DMOV,"EA,BC",   1, 4}, /* a5: 1010 0101                                */
3851   {DMOV,"EA,DE",   1, 4}, /* a6: 1010 0110                                */
3852   {DMOV,"EA,HL",   1, 4}, /* a7: 1010 0111                                */
3853   {INX,"EA",       1, 7}, /* a8: 1010 1000                                */
3854   {DCX,"EA",       1, 7}, /* a9: 1010 1001                                */
3855   {EI,0,          1, 4}, /* aa: 1010 1010                                */
3856   {LDAX,"(DE+%b)", 2,13}, /* ab: 1010 1011 dddd dddd                      */
3857   {LDAX,"(HL+A)",  1,13}, /* ac: 1010 1100                                */
3858   {LDAX,"(HL+B)",  1,13}, /* ad: 1010 1101                                */
3859   {LDAX,"(HL+EA)", 1,13}, /* ae: 1010 1110                                */
3860   {LDAX,"(HL+%b)", 2,13}, /* af: 1010 1111 dddd dddd                      */
3857   {POP,"VA"       }, /* a0: 1010 0000                                */
3858   {POP,"BC"       }, /* a1: 1010 0001                                */
3859   {POP,"DE"       }, /* a2: 1010 0010                                */
3860   {POP,"HL",       }, /* a3: 1010 0011                                */
3861   {POP,"EA"       }, /* a4: 1010 0100                                */
3862   {DMOV,"EA,BC"   }, /* a5: 1010 0101                                */
3863   {DMOV,"EA,DE"   }, /* a6: 1010 0110                                */
3864   {DMOV,"EA,HL"   }, /* a7: 1010 0111                                */
3865   {INX,"EA"       }, /* a8: 1010 1000                                */
3866   {DCX,"EA"       }, /* a9: 1010 1001                                */
3867   {EI,0          }, /* aa: 1010 1010                                */
3868   {LDAX,"(DE+%b)" }, /* ab: 1010 1011 dddd dddd                      */
3869   {LDAX,"(HL+A)"  }, /* ac: 1010 1100                                */
3870   {LDAX,"(HL+B)"  }, /* ad: 1010 1101                                */
3871   {LDAX,"(HL+EA)" }, /* ae: 1010 1110                                */
3872   {LDAX,"(HL+%b)" }, /* af: 1010 1111 dddd dddd                      */
38613873
3862   {PUSH,"VA",      1,13}, /* b0: 1011 0000                                */
3863   {PUSH,"BC",      1,13}, /* b1: 1011 0001                                */
3864   {PUSH,"DE",      1,13}, /* b2: 1011 0010                                */
3865   {PUSH,"HL",      1,13}, /* b3: 1011 0011                                */
3866   {PUSH,"EA",      1,13}, /* b4: 1011 0100                                */
3867   {DMOV,"BC,EA",   1, 4}, /* b5: 1011 0101                                */
3868   {DMOV,"DE,EA",   1, 4}, /* b6: 1011 0110                                */
3869   {DMOV,"HL,EA",   1, 4}, /* b7: 1011 0111                                */
3870   {RET,0,        1,10}, /* b8: 1011 1000                                */
3871   {RETS,0,       1,10}, /* b9: 1011 1001                                */
3872   {DI,0,          1, 4}, /* ba: 1011 1010                                */
3873   {STAX,"(DE+%b)", 2,13}, /* bb: 1011 1011 dddd dddd                      */
3874   {STAX,"(HL+A)",  1,13}, /* bc: 1011 1100                                */
3875   {STAX,"(HL+B)",  1,13}, /* bd: 1011 1101                                */
3876   {STAX,"(HL+EA)", 1,13}, /* be: 1011 1110                                */
3877   {STAX,"(HL+%b)", 2,13}, /* bf: 1011 1111 dddd dddd                      */
3874   {PUSH,"VA"      }, /* b0: 1011 0000                                */
3875   {PUSH,"BC"      }, /* b1: 1011 0001                                */
3876   {PUSH,"DE"      }, /* b2: 1011 0010                                */
3877   {PUSH,"HL",      }, /* b3: 1011 0011                                */
3878   {PUSH,"EA"      }, /* b4: 1011 0100                                */
3879   {DMOV,"BC,EA"   }, /* b5: 1011 0101                                */
3880   {DMOV,"DE,EA"   }, /* b6: 1011 0110                                */
3881   {DMOV,"HL,EA"   }, /* b7: 1011 0111                                */
3882   {RET,0        }, /* b8: 1011 1000                                */
3883   {RETS,0       }, /* b9: 1011 1001                                */
3884   {DI,0          }, /* ba: 1011 1010                                */
3885   {STAX,"(DE+%b)" }, /* bb: 1011 1011 dddd dddd                      */
3886   {STAX,"(HL+A)"  }, /* bc: 1011 1100                                */
3887   {STAX,"(HL+B)"  }, /* bd: 1011 1101                                */
3888   {STAX,"(HL+EA)" }, /* be: 1011 1110                                */
3889   {STAX,"(HL+%b)" }, /* bf: 1011 1111 dddd dddd                      */
38783890
3879   {JR,"%o",        1,10}, /* c0: 11oo oooo                                */
3880   {JR,"%o",        1,10}, /* c1: 11oo oooo                                */
3881   {JR,"%o",        1,10}, /* c2: 11oo oooo                                */
3882   {JR,"%o",        1,10}, /* c3: 11oo oooo                                */
3883   {JR,"%o",        1,10}, /* c4: 11oo oooo                                */
3884   {JR,"%o",        1,10}, /* c5: 11oo oooo                                */
3885   {JR,"%o",        1,10}, /* c6: 11oo oooo                                */
3886   {JR,"%o",        1,10}, /* c7: 11oo oooo                                */
3887   {JR,"%o",        1,10}, /* c8: 11oo oooo                                */
3888   {JR,"%o",        1,10}, /* c9: 11oo oooo                                */
3889   {JR,"%o",        1,10}, /* ca: 11oo oooo                                */
3890   {JR,"%o",        1,10}, /* cb: 11oo oooo                                */
3891   {JR,"%o",        1,10}, /* cc: 11oo oooo                                */
3892   {JR,"%o",        1,10}, /* cd: 11oo oooo                                */
3893   {JR,"%o",        1,10}, /* ce: 11oo oooo                                */
3894   {JR,"%o",        1,10}, /* cf: 11oo oooo                                */
3891   {JR,"%o"        }, /* c0: 11oo oooo                                */
3892   {JR,"%o"        }, /* c1: 11oo oooo                                */
3893   {JR,"%o"        }, /* c2: 11oo oooo                                */
3894   {JR,"%o"        }, /* c3: 11oo oooo                                */
3895   {JR,"%o"        }, /* c4: 11oo oooo                                */
3896   {JR,"%o"        }, /* c5: 11oo oooo                                */
3897   {JR,"%o"        }, /* c6: 11oo oooo                                */
3898   {JR,"%o"        }, /* c7: 11oo oooo                                */
3899   {JR,"%o"        }, /* c8: 11oo oooo                                */
3900   {JR,"%o"        }, /* c9: 11oo oooo                                */
3901   {JR,"%o"        }, /* ca: 11oo oooo                                */
3902   {JR,"%o"        }, /* cb: 11oo oooo                                */
3903   {JR,"%o"        }, /* cc: 11oo oooo                                */
3904   {JR,"%o"        }, /* cd: 11oo oooo                                */
3905   {JR,"%o"        }, /* ce: 11oo oooo                                */
3906   {JR,"%o"        }, /* cf: 11oo oooo                                */
38953907
3896   {JR,"%o",        1,10}, /* d0: 11oo oooo                                */
3897   {JR,"%o",        1,10}, /* d1: 11oo oooo                                */
3898   {JR,"%o",        1,10}, /* d2: 11oo oooo                                */
3899   {JR,"%o",        1,10}, /* d3: 11oo oooo                                */
3900   {JR,"%o",        1,10}, /* d4: 11oo oooo                                */
3901   {JR,"%o",        1,10}, /* d5: 11oo oooo                                */
3902   {JR,"%o",        1,10}, /* d6: 11oo oooo                                */
3903   {JR,"%o",        1,10}, /* d7: 11oo oooo                                */
3904   {JR,"%o",        1,10}, /* d8: 11oo oooo                                */
3905   {JR,"%o",        1,10}, /* d9: 11oo oooo                                */
3906   {JR,"%o",        1,10}, /* da: 11oo oooo                                */
3907   {JR,"%o",        1,10}, /* db: 11oo oooo                                */
3908   {JR,"%o",        1,10}, /* dc: 11oo oooo                                */
3909   {JR,"%o",        1,10}, /* dd: 11oo oooo                                */
3910   {JR,"%o",        1,10}, /* de: 11oo oooo                                */
3911   {JR,"%o",        1,10}, /* df: 11oo oooo                                */
3908   {JR,"%o"        }, /* d0: 11oo oooo                                */
3909   {JR,"%o"        }, /* d1: 11oo oooo                                */
3910   {JR,"%o"        }, /* d2: 11oo oooo                                */
3911   {JR,"%o"        }, /* d3: 11oo oooo                                */
3912   {JR,"%o"        }, /* d4: 11oo oooo                                */
3913   {JR,"%o"        }, /* d5: 11oo oooo                                */
3914   {JR,"%o"        }, /* d6: 11oo oooo                                */
3915   {JR,"%o"        }, /* d7: 11oo oooo                                */
3916   {JR,"%o"        }, /* d8: 11oo oooo                                */
3917   {JR,"%o"        }, /* d9: 11oo oooo                                */
3918   {JR,"%o"        }, /* da: 11oo oooo                                */
3919   {JR,"%o"        }, /* db: 11oo oooo                                */
3920   {JR,"%o"        }, /* dc: 11oo oooo                                */
3921   {JR,"%o"        }, /* dd: 11oo oooo                                */
3922   {JR,"%o"        }, /* de: 11oo oooo                                */
3923   {JR,"%o"        }, /* df: 11oo oooo                                */
39123924
3913   {JR,"%o",        1,10}, /* e0: 11oo oooo                                */
3914   {JR,"%o",        1,10}, /* e1: 11oo oooo                                */
3915   {JR,"%o",        1,10}, /* e2: 11oo oooo                                */
3916   {JR,"%o",        1,10}, /* e3: 11oo oooo                                */
3917   {JR,"%o",        1,10}, /* e4: 11oo oooo                                */
3918   {JR,"%o",        1,10}, /* e5: 11oo oooo                                */
3919   {JR,"%o",        1,10}, /* e6: 11oo oooo                                */
3920   {JR,"%o",        1,10}, /* e7: 11oo oooo                                */
3921   {JR,"%o",        1,10}, /* e8: 11oo oooo                                */
3922   {JR,"%o",        1,10}, /* e9: 11oo oooo                                */
3923   {JR,"%o",        1,10}, /* ea: 11oo oooo                                */
3924   {JR,"%o",        1,10}, /* eb: 11oo oooo                                */
3925   {JR,"%o",        1,10}, /* ec: 11oo oooo                                */
3926   {JR,"%o",        1,10}, /* ed: 11oo oooo                                */
3927   {JR,"%o",        1,10}, /* ee: 11oo oooo                                */
3928   {JR,"%o",        1,10}, /* ef: 11oo oooo                                */
3925   {JR,"%o"        }, /* e0: 11oo oooo                                */
3926   {JR,"%o"        }, /* e1: 11oo oooo                                */
3927   {JR,"%o"        }, /* e2: 11oo oooo                                */
3928   {JR,"%o"        }, /* e3: 11oo oooo                                */
3929   {JR,"%o"        }, /* e4: 11oo oooo                                */
3930   {JR,"%o"        }, /* e5: 11oo oooo                                */
3931   {JR,"%o"        }, /* e6: 11oo oooo                                */
3932   {JR,"%o"        }, /* e7: 11oo oooo                                */
3933   {JR,"%o"        }, /* e8: 11oo oooo                                */
3934   {JR,"%o"        }, /* e9: 11oo oooo                                */
3935   {JR,"%o"        }, /* ea: 11oo oooo                                */
3936   {JR,"%o"        }, /* eb: 11oo oooo                                */
3937   {JR,"%o"        }, /* ec: 11oo oooo                                */
3938   {JR,"%o"        }, /* ed: 11oo oooo                                */
3939   {JR,"%o"        }, /* ee: 11oo oooo                                */
3940   {JR,"%o"        }, /* ef: 11oo oooo                                */
39293941
3930   {JR,"%o",        1,10}, /* f0: 11oo oooo                                */
3931   {JR,"%o",        1,10}, /* f1: 11oo oooo                                */
3932   {JR,"%o",        1,10}, /* f2: 11oo oooo                                */
3933   {JR,"%o",        1,10}, /* f3: 11oo oooo                                */
3934   {JR,"%o",        1,10}, /* f4: 11oo oooo                                */
3935   {JR,"%o",        1,10}, /* f5: 11oo oooo                                */
3936   {JR,"%o",        1,10}, /* f6: 11oo oooo                                */
3937   {JR,"%o",        1,10}, /* f7: 11oo oooo                                */
3938   {JR,"%o",        1,10}, /* f8: 11oo oooo                                */
3939   {JR,"%o",        1,10}, /* f9: 11oo oooo                                */
3940   {JR,"%o",        1,10}, /* fa: 11oo oooo                                */
3941   {JR,"%o",        1,10}, /* fb: 11oo oooo                                */
3942   {JR,"%o",        1,10}, /* fc: 11oo oooo                                */
3943   {JR,"%o",        1,10}, /* fd: 11oo oooo                                */
3944   {JR,"%o",        1,10}, /* fe: 11oo oooo                                */
3945   {JR,"%o",        1,10}  /* ff: 11oo oooo                                */
3942   {JR,"%o"        }, /* f0: 11oo oooo                                */
3943   {JR,"%o"        }, /* f1: 11oo oooo                                */
3944   {JR,"%o"        }, /* f2: 11oo oooo                                */
3945   {JR,"%o"        }, /* f3: 11oo oooo                                */
3946   {JR,"%o"        }, /* f4: 11oo oooo                                */
3947   {JR,"%o"        }, /* f5: 11oo oooo                                */
3948   {JR,"%o"        }, /* f6: 11oo oooo                                */
3949   {JR,"%o"        }, /* f7: 11oo oooo                                */
3950   {JR,"%o"        }, /* f8: 11oo oooo                                */
3951   {JR,"%o"        }, /* f9: 11oo oooo                                */
3952   {JR,"%o"        }, /* fa: 11oo oooo                                */
3953   {JR,"%o"        }, /* fb: 11oo oooo                                */
3954   {JR,"%o"        }, /* fc: 11oo oooo                                */
3955   {JR,"%o"        }, /* fd: 11oo oooo                                */
3956   {JR,"%o"        }, /* fe: 11oo oooo                                */
3957   {JR,"%o"        }  /* ff: 11oo oooo                                */
39463958};
39473959
3960/*********************************************************
3961 *
3962 * uPD7801
3963 *
3964 *********************************************************/
39483965
3966static const struct dasm_s dasm48_7801[256] = {
3967   /* 0x00 - 0x3F */
3968   { SKIT, "F0" },      { SKIT, "FT" },      { SKIT, "F1" },      { SKIT, "F2" },
3969   { SKIT, "FS" },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
3970   { illegal, 0 },      { illegal, 0 },      { SK, "CY" },      { illegal, 0 },
3971   { SK, "Z" },      { illegal, 0 },      { PUSH, "VA" },      { POP, "VA" },
3972
3973   { SKNIT, "F0" },   { SKNIT, "FT" },   { SKNIT, "F1" },   { SKNIT, "F2" },
3974   { SKNIT, "FS" },   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
3975   { illegal, 0 },      { illegal, 0 },      { SKN, "CY" },      { illegal, 0 },
3976   { SKN, "Z" },      { illegal, 0 },      { PUSH, "BC" },      { POP, "BC" },
3977
3978   { EI, 0 },         { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
3979   { DI, 0 },         { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
3980   { illegal, 0 },      { illegal, 0 },      { CLC, 0 },         { STC, 0 },
3981   { PER, 0 },         { PEX, 0 },         { PUSH, "DE" },      { POP, "DE" },
3982
3983   { RLL, "A" },      { RLR, "A" },      { RLL, "C" },      { RLR, "C" },
3984   { SLL, "A" },      { SLR, "A" },      { SLL, "C" },      { SLR, "C" },
3985   { RLD, 0 },         { RRD, 0 },         { illegal, 0 },      { illegal, 0 },
3986   { PER, 0 },         { illegal, 0 },      { PUSH, "HL" },      { POP, "HL" },
3987
3988   /* 0x40 - 0x7F */
3989   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
3990   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
3991   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
3992   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
3993
3994   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
3995   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
3996   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
3997   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
3998
3999   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4000   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4001   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4002   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4003
4004   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4005   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4006   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4007   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4008
4009   /* 0x80 - 0xBF */
4010   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4011   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4012   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4013   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4014
4015   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4016   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4017   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4018   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4019
4020   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4021   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4022   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4023   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4024
4025   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4026   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4027   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4028   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4029
4030   /* 0xC0 - 0xFF */
4031   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4032   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4033   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4034   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4035
4036   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4037   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4038   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4039   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4040
4041   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4042   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4043   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4044   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4045
4046   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4047   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4048   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4049   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 }
4050};
4051
4052static const struct dasm_s dasm4c_7801[256] = {
4053   /* 0x00 - 0x3F */
4054   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4055   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4056   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4057   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4058
4059   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4060   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4061   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4062   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4063
4064   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4065   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4066   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4067   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4068
4069   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4070   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4071   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4072   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4073
4074   /* 0x40 - 0x7F */
4075   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4076   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4077   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4078   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4079
4080   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4081   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4082   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4083   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4084
4085   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4086   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4087   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4088   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4089
4090   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4091   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4092   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4093   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4094
4095   /* 0x80 - 0xBF */
4096   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4097   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4098   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4099   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4100
4101   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4102   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4103   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4104   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4105
4106   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4107   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4108   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4109   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4110
4111   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4112   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4113   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4114   { IN, 0 },         { IN, 0 },         { IN, 0 },         { IN, 0 },
4115
4116   /* 0xC0 - 0xFF */
4117   { MOV, "A,PA" },   { MOV, "A,PB" },   { MOV, "A,PC" },   { MOV, "A,MK" },
4118   { MOV, "A,MB" },   { MOV, "A,MC" },   { MOV, "A,TM0" },   { MOV, "A,TM1" },
4119   { MOV, "A,S" },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4120   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4121
4122   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4123   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4124   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4125   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4126
4127   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4128   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4129   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4130   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4131
4132   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4133   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4134   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4135   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 }
4136};
4137
4138static const struct dasm_s dasm4d_7801[256] = {
4139   /* 0x00 - 0x3F */
4140   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4141   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4142   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4143   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4144
4145   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4146   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4147   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4148   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4149
4150   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4151   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4152   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4153   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4154
4155   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4156   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4157   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4158   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4159
4160   /* 0x40 - 0x7F */
4161   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4162   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4163   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4164   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4165
4166   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4167   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4168   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4169   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4170
4171   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4172   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4173   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4174   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4175
4176   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4177   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4178   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4179   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4180
4181   /* 0x80 - 0xBF */
4182   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4183   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4184   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4185   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4186
4187   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4188   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4189   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4190   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4191
4192   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4193   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4194   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4195   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4196
4197   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4198   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4199   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4200   { OUT, 0 }, { OUT, 0 }, { OUT, 0 }, { OUT, 0 },
4201
4202   /* 0xC0 - 0xFF */
4203   { MOV, "PA,A" },   { MOV, "PB,A" },   { MOV, "PC,A" },   { MOV, "MK,A" },
4204   { MOV, "MB,A" },   { MOV, "MC,A" },   { MOV, "TM0,A" },   { MOV, "TM1,A" },
4205   { MOV, "S,A" },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4206   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4207
4208   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4209   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4210   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4211   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4212
4213   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4214   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4215   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4216   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4217
4218   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4219   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4220   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4221   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 }
4222};
4223
4224static const struct dasm_s dasm60_7801[256] = {
4225   /* 0x00 - 0x3F */
4226   { illegal, 0 },      { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4227   { illegal, 0 },      { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4228   { ANA, "V,A" },      { ANA, "A,A" }, { ANA, "B,A" }, { ANA, "C,A" },
4229   { ANA, "D,A" },      { ANA, "E,A" }, { ANA, "H,A" }, { ANA, "L,A" },
4230
4231   { XRA, "V,A" },      { XRA, "A,A" }, { XRA, "B,A" }, { XRA, "C,A" },
4232   { XRA, "D,A" },      { XRA, "E,A" }, { XRA, "H,A" }, { XRA, "L,A" },
4233   { ORA, "V,A" },      { ORA, "A,A" }, { ORA, "B,A" }, { ORA, "C,A" },
4234   { ORA, "D,A" },      { ORA, "E,A" }, { ORA, "H,A" }, { ORA, "L,A" },
4235
4236   { ADDNC, "V,A" },   { ADDNC, "A,A" }, { ADDNC, "B,A" }, { ADDNC, "C,A" },
4237   { ADDNC, "D,A" },   { ADDNC, "E,A" }, { ADDNC, "H,A" }, { ADDNC, "L,A" },
4238   { GTA, "V,A" },      { GTA, "A,A" }, { GTA, "B,A" }, { GTA, "C,A" },
4239   { GTA, "D,A" },      { GTA, "E,A" }, { GTA, "H,A" }, { GTA, "L,A" },
4240
4241   { SUBNB, "V,A" },   { SUBNB, "A,A" }, { SUBNB, "B,A" }, { SUBNB, "C,A" },
4242   { SUBNB, "D,A" },   { SUBNB, "E,A" }, { SUBNB, "H,A" }, { SUBNB, "L,A" },
4243   { LTA, "V,A" },      { LTA, "A,A" }, { LTA, "B,A" }, { LTA, "C,A" },
4244   { LTA, "D,A" },      { LTA, "E,A" }, { LTA, "H,A" }, { LTA, "L,A" },
4245
4246   /* 0x40 - 0x7F */
4247   { ADD, "V,A" },      { ADD, "A,A" }, { ADD, "B,A" }, { ADD, "C,A" },
4248   { ADD, "D,A" },      { ADD, "E,A" }, { ADD, "H,A" }, { ADD, "L,A" },
4249   { illegal, 0 },      { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4250   { illegal, 0 },      { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4251
4252   { ADC, "V,A" },      { ADC, "A,A" }, { ADC, "B,A" }, { ADC, "C,A" },
4253   { ADC, "D,A" },      { ADC, "E,A" }, { ADC, "H,A" }, { ADC, "L,A" },
4254   { illegal, 0 },      { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4255   { illegal, 0 },      { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4256
4257   { SUB, "V,A" },      { SUB, "A,A" }, { SUB, "B,A" }, { SUB, "C,A" },
4258   { SUB, "D,A" },      { SUB, "E,A" }, { SUB, "H,A" }, { SUB, "L,A" },
4259   { NEA, "V,A" },      { NEA, "A,A" }, { NEA, "B,A" }, { NEA, "C,A" },
4260   { NEA, "D,A" },      { NEA, "E,A" }, { NEA, "H,A" }, { NEA, "L,A" },
4261
4262   { SBB, "V,A" },      { SBB, "A,A" }, { SBB, "B,A" }, { SBB, "C,A" },
4263   { SBB, "D,A" },      { SBB, "E,A" }, { SBB, "H,A" }, { SBB, "L,A" },
4264   { EQA, "V,A" },      { EQA, "A,A" }, { EQA, "B,A" }, { EQA, "C,A" },
4265   { EQA, "D,A" },      { EQA, "E,A" }, { EQA, "H,A" }, { EQA, "L,A" },
4266
4267   /* 0x80 - 0xBF */
4268   { illegal, 0 },      { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4269   { illegal, 0 },      { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4270   { ANA, "A,V" },      { ANA, "A,A" }, { ANA, "A,B" }, { ANA, "A,C" },
4271   { ANA, "A,D" },      { ANA, "A,E" }, { ANA, "A,H" }, { ANA, "A,L" },
4272
4273   { XRA, "A,V" },      { XRA, "A,A" }, { XRA, "A,B" }, { XRA, "A,C" },
4274   { XRA, "A,D" },      { XRA, "A,E" }, { XRA, "A,H" }, { XRA, "A,L" },
4275   { ORA, "A,V" },      { ORA, "A,A" }, { ORA, "A,B" }, { ORA, "A,C" },
4276   { ORA, "A,D" },      { ORA, "A,E" }, { ORA, "A,H" }, { ORA, "A,L" },
4277
4278   { ADDNC, "A,V" },   { ADDNC, "A,A" }, { ADDNC, "A,B" }, { ADDNC, "A,C" },
4279   { ADDNC, "A,D" },   { ADDNC, "A,E" }, { ADDNC, "A,H" }, { ADDNC, "A,L" },
4280   { GTA, "A,V" },      { GTA, "A,A" }, { GTA, "A,B" }, { GTA, "A,C" },
4281   { GTA, "A,D" },      { GTA, "A,E" }, { GTA, "A,H" }, { GTA, "A,L" },
4282
4283   { SUBNB, "A,V" },   { SUBNB, "A,A" }, { SUBNB, "A,B" }, { SUBNB, "A,C" },
4284   { SUBNB, "A,D" },   { SUBNB, "A,E" }, { SUBNB, "A,H" }, { SUBNB, "A,L" },
4285   { LTA, "A,V" },      { LTA, "A,A" }, { LTA, "A,B" }, { LTA, "A,C" },
4286   { LTA, "A,D" },      { LTA, "A,E" }, { LTA, "A,H" }, { LTA, "A,L" },
4287
4288   /* 0xC0 - 0xFF */
4289   { ADD, "A,V" },      { ADD, "A,A" }, { ADD, "A,B" }, { ADD, "A,C" },
4290   { ADD, "A,D" },      { ADD, "A,E" }, { ADD, "A,H" }, { ADD, "A,L" },
4291   { ONA, "A,V" },      { ONA, "A,A" }, { ONA, "A,B" }, { ONA, "A,C" },
4292   { ONA, "A,D" },      { ONA, "A,E" }, { ONA, "A,H" }, { ONA, "A,L" },
4293
4294   { ADC, "A,V" },      { ADC, "A,A" }, { ADC, "A,B" }, { ADC, "A,C" },
4295   { ADC, "A,D" },      { ADC, "A,E" }, { ADC, "A,H" }, { ADC, "A,L" },
4296   { OFFA, "A,V" },   { OFFA, "A,A" }, { OFFA, "A,B" }, { OFFA, "A,C" },
4297   { OFFA, "A,D" },   { OFFA, "A,E" }, { OFFA, "A,H" }, { OFFA, "A,L" },
4298
4299   { SUB, "A,V" },      { SUB, "A,A" }, { SUB, "A,B" }, { SUB, "A,C" },
4300   { SUB, "A,D" },      { SUB, "A,E" }, { SUB, "A,H" }, { SUB, "A,L" },
4301   { NEA, "A,V" },      { NEA, "A,A" }, { NEA, "A,B" }, { NEA, "A,C" },
4302   { NEA, "A,D" },      { NEA, "A,E" }, { NEA, "A,H" }, { NEA, "A,L" },
4303
4304   { SBB, "A,V" },      { SBB, "A,A" }, { SBB, "A,B" }, { SBB, "A,C" },
4305   { SBB, "A,D" },      { SBB, "A,E" }, { SBB, "A,H" }, { SBB, "A,L" },
4306   { EQA, "A,V" },      { EQA, "A,A" }, { EQA, "A,B" }, { EQA, "A,C" },
4307   { EQA, "A,D" },      { EQA, "A,E" }, { EQA, "A,H" }, { EQA, "A,L" }
4308};
4309
4310static const struct dasm_s dasm64_7801[256] = {
4311   /* 0x00 - 0x3F */
4312   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4313   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4314   { ANI, "V,%b" }, { ANI, "A,%b" }, { ANI, "B,%b" }, { ANI, "C,%b" },
4315   { ANI, "D,%b" }, { ANI, "E,%b" }, { ANI, "H,%b" }, { ANI, "L,%b" },
4316
4317   { XRI, "V,%b" }, { XRI, "A,%b" }, { XRI, "B,%b" }, { XRI, "C,%b" },
4318   { XRI, "D,%b" }, { XRI, "E,%b" }, { XRI, "H,%b" }, { XRI, "L,%b" },
4319   { ORI, "V,%b" }, { ORI, "A,%b" }, { ORI, "B,%b" }, { ORI, "C,%b" },
4320   { ORI, "D,%b" }, { ORI, "E,%b" }, { ORI, "H,%b" }, { ORI, "L,%b" },
4321
4322   { ADINC, "V,%b" }, { ADINC, "A,%b" }, { ADINC, "B,%b" }, { ADINC, "C,%b" },
4323   { ADINC, "D,%b" }, { ADINC, "E,%b" }, { ADINC, "H,%b" }, { ADINC, "L,%b" },
4324   { GTI, "V,%b" }, { GTI, "A,%b" }, { GTI, "B,%b" }, { GTI, "C,%b" },
4325   { GTI, "D,%b" }, { GTI, "E,%b" }, { GTI, "H,%b" }, { GTI, "L,%b" },
4326
4327   { SUINB, "V,%b" }, { SUINB, "A,%b" }, { SUINB, "B,%b" }, { SUINB, "C,%b" },
4328   { SUINB, "D,%b" }, { SUINB, "E,%b" }, { SUINB, "H,%b" }, { SUINB, "L,%b" },
4329   { LTI, "V,%b" }, { LTI, "A,%b" }, { LTI, "B,%b" }, { LTI, "C,%b" },
4330   { LTI, "D,%b" }, { LTI, "E,%b" }, { LTI, "H,%b" }, { LTI, "L,%b" },
4331
4332   /* 0x40 - 0x7F */
4333   { ADI, "V,%b" }, { ADI, "A,%b" }, { ADI, "B,%b" }, { ADI, "C,%b" },
4334   { ADI, "D,%b" }, { ADI, "E,%b" }, { ADI, "H,%b" }, { ADI, "L,%b" },
4335   { ONI, "V,%b" }, { ONI, "A,%b" }, { ONI, "B,%b" }, { ONI, "C,%b" },
4336   { ONI, "D,%b" }, { ONI, "E,%b" }, { ONI, "H,%b" }, { ONI, "L,%b" },
4337
4338   { ACI, "V,%b" }, { ACI, "A,%b" }, { ACI, "B,%b" }, { ACI, "C,%b" },
4339   { ACI, "D,%b" }, { ACI, "E,%b" }, { ACI, "H,%b" }, { ACI, "L,%b" },
4340   { OFFI, "V,%b" }, { OFFI, "A,%b" }, { OFFI, "B,%b" }, { OFFI, "C,%b" },
4341   { OFFI, "D,%b" }, { OFFI, "E,%b" }, { OFFI, "H,%b" }, { OFFI, "L,%b" },
4342
4343   { SUI, "V,%b" }, { SUI, "A,%b" }, { SUI, "B,%b" }, { SUI, "C,%b" },
4344   { SUI, "D,%b" }, { SUI, "E,%b" }, { SUI, "H,%b" }, { SUI, "L,%b" },
4345   { NEI, "V,%b" }, { NEI, "A,%b" }, { NEI, "B,%b" }, { NEI, "C,%b" },
4346   { NEI, "D,%b" }, { NEI, "E,%b" }, { NEI, "H,%b" }, { NEI, "L,%b" },
4347
4348   { SBI, "V,%b" }, { SBI, "A,%b" }, { SBI, "B,%b" }, { SBI, "C,%b" },
4349   { SBI, "D,%b" }, { SBI, "E,%b" }, { SBI, "H,%b" }, { SBI, "L,%b" },
4350   { EQI, "V,%b" }, { EQI, "A,%b" }, { EQI, "B,%b" }, { EQI, "C,%b" },
4351   { EQI, "D,%b" }, { EQI, "E,%b" }, { EQI, "H,%b" }, { EQI, "L,%b" },
4352
4353   /* 0x80 - 0xBF */
4354   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4355   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4356   { ANI, "PA,%b" }, { ANI, "PB,%b" }, { ANI, "PC,%b" }, { ANI, "MK,%b" },
4357   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4358
4359   { XRI, "PA,%b" }, { XRI, "PB,%b" }, { XRI, "PC,%b" }, { XRI, "MK,%b" },
4360   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4361   { ORI, "PA,%b" }, { ORI, "PB,%b" }, { ORI, "PC,%b" }, { ORI, "MK,%b" },
4362   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4363
4364   { ADINC, "PA,%b" }, { ADINC, "PB,%b" }, { ADINC, "PC,%b" }, { ADINC, "MK,%b" },
4365   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4366   { GTI, "PA,%b" }, { GTI, "PB,%b" }, { GTI, "PC,%b" }, { GTI, "MK,%b" },
4367   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4368
4369   { SUINB, "PA,%b" }, { SUINB, "PB,%b" }, { SUINB, "PC,%b" }, { SUINB, "MK,%b" },
4370   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4371   { LTI, "PA,%b" }, { LTI, "PB,%b" }, { LTI, "PC,%b" }, { LTI, "MK,%b" },
4372   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4373
4374   /* 0xC0 - 0xFF */
4375   { ADI, "PA,%b" }, { ADI, "PB,%b" }, { ADI, "PC,%b" }, { ADI, "MK,%b" },
4376   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4377   { ONI, "PA,%b" }, { ONI, "PB,%b" }, { ONI, "PC,%b" }, { ONI, "MK,%b" },
4378   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4379
4380   { ACI, "PA,%b" }, { ACI, "PB,%b" }, { ACI, "PC,%b" }, { ACI, "MK,%b" },
4381   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4382   { SUI, "PA,%b" }, { SUI, "PB,%b" }, { SUI, "PC,%b" }, { SUI, "MK,%b" },
4383   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4384
4385   { NEI, "PA,%b" }, { NEI, "PB,%b" }, { NEI, "PC,%b" }, { NEI, "MK,%b" },
4386   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4387   { SBI, "PA,%b" }, { SBI, "PB,%b" }, { SBI, "PC,%b" }, { SBI, "MK,%b" },
4388   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4389
4390   { SBI, "PA,%b" }, { SBI, "PB,%b" }, { SBI, "PC,%b" }, { SBI, "MK,%b" },
4391   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4392   { EQI, "PA,%b" }, { EQI, "PB,%b" }, { EQI, "PC,%b" }, { EQI, "MK,%b" },
4393   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 }
4394};
4395
4396static const struct dasm_s dasm70_7801[256] = {
4397   /* 0x00 - 0x3F */
4398   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4399   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4400   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4401   { illegal, 0 }, { illegal, 0 }, { SSPD, "%w" }, { LSPD, "%w" },
4402
4403   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4404   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4405   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4406   { illegal, 0 }, { illegal, 0 }, { SBCD, "%w" }, { LBCD, "%w" },
4407
4408   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4409   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4410   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4411   { illegal, 0 }, { illegal, 0 }, { SDED, "%w" }, { LDED, "%w" },
4412
4413   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4414   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4415   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4416   { illegal, 0 }, { illegal, 0 }, { SHLD, "%w" }, { LHLD, "%w" },
4417
4418   /* 0x40 - 0x7F */
4419   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4420   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4421   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4422   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4423
4424   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4425   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4426   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4427   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4428
4429   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4430   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4431   { MOV, "V,%w" }, { MOV, "A,%w" }, { MOV, "B,%w" }, { MOV, "C,%w" },
4432   { MOV, "D,%w" }, { MOV, "E,%w" }, { MOV, "H,%w" }, { MOV, "L,%w" },
4433
4434   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4435   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4436   { MOV, "%w,V" }, { MOV, "%w,A" }, { MOV, "%w,B" }, { MOV, "%w,C" },
4437   { MOV, "%w,D" }, { MOV, "%w,E" }, { MOV, "%w,H" }, { MOV, "%w,L" },
4438
4439   /* 0x80 - 0xBF */
4440   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4441   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4442   { illegal, 0 }, { ANAX, "BC" }, { ANAX, "DE" }, { ANAX, "HL" },
4443   { ANAX, "DE+" }, { ANAX, "HL+" }, { ANAX, "DE-" }, { ANAX, "HL-" },
4444
4445   { illegal, 0 }, { XRAX, "BC" }, { XRAX, "DE" }, { XRAX, "HL" },
4446   { XRAX, "DE+" }, { XRAX, "HL+" }, { XRAX, "DE-" }, { XRAX, "HL-" },
4447   { illegal, 0 }, { ORAX, "BC" }, { ORAX, "DE" }, { ORAX, "HL" },
4448   { ORAX, "DE+" }, { ORAX, "HL+" }, { ORAX, "DE-" }, { ORAX, "HL-" },
4449
4450   { illegal, 0 }, { ADDNCX, "BC" }, { ADDNCX, "DE" }, { ADDNCX, "HL" },
4451   { ADDNCX, "DE+" }, { ADDNCX, "HL+" }, { ADDNCX, "DE-" }, { ADDNCX, "HL-" },
4452   { illegal, 0 }, { GTAX, "BC" }, { GTAX, "DE" }, { GTAX, "HL" },
4453   { GTAX, "DE+" }, { GTAX, "HL+" }, { GTAX, "DE-" }, { GTAX, "HL-" },
4454
4455   { illegal, 0 }, { SUBNBX, "BC" }, { SUBNBX, "DE" }, { SUBNBX, "HL" },
4456   { SUBNBX, "DE+" }, { SUBNBX, "HL+" }, { SUBNBX,  }, { SUBNBX, "HL-" },
4457   { illegal, 0 }, { LTAX, "BC" }, { LTAX, "DE" }, { LTAX, "HL" },
4458   { LTAX, "DE+" }, { LTAX, "HL+" }, { LTAX, "DE-" }, { LTAX, "HL-" },
4459
4460   /* 0xC0 - 0xFF */
4461   { illegal, 0 }, { ADDX, "BC" }, { ADDX, "DE" }, { ADDX, "HL" },
4462   { ADDX, "DE+" }, { ADDX, "HL+" }, { ADDX, "DE-" }, { ADDX, "HL-" },
4463   { illegal, 0 }, { ONAX, "BC" }, { ONAX, "DE" }, { ONAX, "HL" },
4464   { ONAX, "DE+" }, { ONAX, "HL+" }, { ONAX, "DE-" }, { ONAX, "HL-" },
4465
4466   { illegal, 0 }, { ADCX, "BC" }, { ADCX, "DE" }, { ADCX, "HL" },
4467   { ADCX, "DE+" }, { ADCX, "HL+" }, { ADCX, "DE-" }, { ADCX, "HL-" },
4468   { illegal, 0 }, { OFFAX, "BC" }, { OFFAX, "DE" }, { OFFAX, "HL" },
4469   { OFFAX, "DE+" }, { OFFAX, "HL+" }, { OFFAX, "DE-" }, { OFFAX, "HL-" },
4470
4471   { illegal, 0 }, { SUBX, "BC" }, { SUBX, "DE" }, { SUBX, "HL" },
4472   { SUBX, "DE+" }, { SUBX, "HL+" }, { SUBX, "DE-" }, { SUBX, "HL-" },
4473   { illegal, 0 }, { NEAX, "BC" }, { NEAX, "DE" }, { NEAX, "HL" },
4474   { NEAX, "DE+" }, { NEAX, "HL+" }, { NEAX, "DE-" }, { NEAX, "HL-" },
4475
4476   { illegal, 0 }, { SBBX, "BC" }, { SBBX, "DE" }, { SBBX, "HL" },
4477   { SBBX, "DE+" }, { SBBX, "HL+" }, { SBBX, "DE-" }, { SBBX, "HL-" },
4478   { illegal, 0 }, { EQAX, "BC" }, { EQAX, "DE" }, { EQAX, "HL" },
4479   { EQAX, "DE+" }, { EQAX, "HL+" }, { EQAX, "DE-" }, { EQAX, "HL-" },
4480};
4481
4482static const struct dasm_s dasm74_7801[256] = {
4483   /* 0x00 - 0x3F */
4484   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4485   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4486   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4487   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4488
4489   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4490   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4491   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4492   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4493
4494   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4495   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4496   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4497   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4498
4499   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4500   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4501   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4502   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4503
4504   /* 0x40 - 0x7F */
4505   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4506   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4507   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4508   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4509
4510   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4511   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4512   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4513   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4514
4515   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4516   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4517   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4518   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4519
4520   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4521   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4522   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4523   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4524
4525   /* 0x80 - 0xBF */
4526   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4527   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4528   { ANAW, "%a" }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4529   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4530
4531   { XRAW, "%a" }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4532   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4533   { ORAW, "%a" }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4534   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4535
4536   { ADDNCW, "%a" }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4537   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4538   { GTAW, "%a" }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4539   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4540
4541   { SUBNBW, "%a" }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4542   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4543   { LTAW, "%a" }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4544   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4545
4546   /* 0xC0 - 0xFF */
4547   { ADDW, "%a" }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4548   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4549   { ONAW, "%a" }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4550   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4551
4552   { ADCW, "%a" }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4553   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4554   { OFFAW, "%a" }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4555   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4556
4557   { SUBW, "%a" }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4558   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4559   { NEAW, "%a" }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4560   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4561
4562   { SBBW, "%a" }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4563   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4564   { EQAW, "%a" }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 },
4565   { illegal, 0 }, { illegal, 0 }, { illegal, 0 }, { illegal, 0 }
4566};
4567
4568static const struct dasm_s dasmXX_7801[256] = {
4569   /* 0x00 - 0x3F */
4570   { NOP, 0 },         { HALT, 0 },      { INX, "SP" },      { DCX, "SP" },
4571   { LXI, "SP,%w" },   { ANIW, "%a,%b" },   { illegal, 0 },      { ANI, "A,%b" },
4572   { RET, 0 },         { SIO, 0 },         { MOV, "A,B" },      { MOV, "A,C" },
4573   { MOV, "A,D" },      { MOV, "A,E" },      { MOV, "A,H" },      { MOV, "A,L" },
4574
4575   { EX, 0 },         { EXX, 0 },         { INX, "BC" },      { DCX, "BC" },
4576   { LXI, "BC,%w" },   { ORIW, "%a,%b" },   { XRI, "A,%b" },   { ORI, "A,%b" },
4577   { RETS, 0 },      { STM, 0 },         { MOV, "B,A" },      { MOV, "C,A" },
4578   { MOV, "D,A" },      { MOV, "E,A" },      { MOV, "H,A" },      { MOV, "L,A" },
4579
4580   { INRW, "%a" },      { TABLE, 0 },      { INX, "DE" },      { DCX, "DE" },
4581   { LXI, "DE,%w" },   { GTIW, "%a,%b" },   { ADINC, "A,%b" },   { GTI, "A,%b" },
4582   { LDAW, "%a" },      { LDAX, "BC" },      { LDAX, "DE" },      { LDAX, "HL" },
4583   { LDAX, "DE+" },   { LDAX, "HL+" },   { LDAX, "DE-" },   { LDAX, "HL-" },
4584
4585   { DCRW, "%a" },      { BLOCK, 0 },      { INX, "HL" },      { DCX, "HL" },
4586   { LXI, "HL,%w" },   { LTIW, "%a,%b" },   { SUINB, "A,%b" },   { LTI, "A,%b" },
4587   { STAW, "%a" },      { STAX, "BC" },      { STAX, "DE" },      { STAX, "HL" },
4588   { STAX, "DE+" },   { STAX, "HL+" },   { STAX, "DE-" },   { STAX, "HL-" },
4589
4590   /* 0x40 - 0x7F */
4591   { illegal, 0 },      { INR, "A" },      { INR, "B" },      { INR, "C" },
4592   { CALL, "%w" },      { ONIW, "%a,%b" },   { ADI, "A,%b" },   { ONI, "A,%b" },
4593   { 0, dasm48_7801 },   { MVIX, "BC,%b" },   { MVIX, "DE,%b" },   { MVIX, "HL,%b" },
4594   { 0, dasm4c_7801 },   { 0, dasm4d_7801 },   { JRE, "%d" },      { JRE, "%d" },
4595
4596   { illegal, 0 },      { DCR, "A" },      { DCR, "B" },      { DCR, "C" },
4597   { JMP, "%w" },      { OFFIW, "%a,%b" },   { ACI, "A,%b" },   { OFFI, "A,%b" },
4598   { BIT, "0,%a" },   { BIT, "1,%a" },   { BIT," 2,%a" },   { BIT, "3,%a" },
4599   { BIT, "4,%a" },   { BIT, "5,%a" },   { BIT, "6,%a" },   { BIT, "7,%a" },
4600
4601   { 0, dasm60_7801 },   { DAA, 0 },         { RETI, 0 },      { CALB, 0 },
4602   { 0, dasm64_7801 },   { NEIW, "%a,%b" },   { SUI, "A,%b" },   { NEI, "A,%b" },
4603   { MVI, "V,%b?" },   { MVI, "A,%b" },   { MVI, "B,%b" },   { MVI, "C,%b" },
4604   { MVI, "D,%b" },   { MVI, "E,%b" },   { MVI, "H,%b" },   { MVI, "L,%b" },
4605
4606   { 0, dasm70_7801 },   { MVIW, "%a,%b" },   { SOFTI, 0 },      { JB, 0 },
4607   { 0, dasm74_7801 },   { EQIW, "%a,%b" },   { SBI, "A,%b" },   { EQI, "A,%b" },
4608   { CALF, "%f" },      { CALF, "%f" },      { CALF, "%f" },      { CALF, "%f" },
4609   { CALF, "%f" },      { CALF, "%f" },      { CALF, "%f" },      { CALF, "%f" },
4610
4611   /* 0x80 - 0xBF */
4612   { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },
4613   { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },
4614   { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },
4615   { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },
4616
4617   { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },
4618   { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },
4619   { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },
4620   { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },
4621
4622   { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },
4623   { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },
4624   { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },
4625   { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },
4626
4627   { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },
4628   { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },
4629   { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },
4630   { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },
4631
4632   /* 0xC0 - 0xFF */
4633   { JR, "%o" },      { JR, "%o" },      { JR, "%o" },      { JR, "%o" },
4634   { JR, "%o" },      { JR, "%o" },      { JR, "%o" },      { JR, "%o" },
4635   { JR, "%o" },      { JR, "%o" },      { JR, "%o" },      { JR, "%o" },
4636   { JR, "%o" },      { JR, "%o" },      { JR, "%o" },      { JR, "%o" },
4637
4638   { JR, "%o" },      { JR, "%o" },      { JR, "%o" },      { JR, "%o" },
4639   { JR, "%o" },      { JR, "%o" },      { JR, "%o" },      { JR, "%o" },
4640   { JR, "%o" },      { JR, "%o" },      { JR, "%o" },      { JR, "%o" },
4641   { JR, "%o" },      { JR, "%o" },      { JR, "%o" },      { JR, "%o" },
4642
4643   { JR, "%o" },      { JR, "%o" },      { JR, "%o" },      { JR, "%o" },
4644   { JR, "%o" },      { JR, "%o" },      { JR, "%o" },      { JR, "%o" },
4645   { JR, "%o" },      { JR, "%o" },      { JR, "%o" },      { JR, "%o" },
4646   { JR, "%o" },      { JR, "%o" },      { JR, "%o" },      { JR, "%o" },
4647
4648   { JR, "%o" },      { JR, "%o" },      { JR, "%o" },      { JR, "%o" },
4649   { JR, "%o" },      { JR, "%o" },      { JR, "%o" },      { JR, "%o" },
4650   { JR, "%o" },      { JR, "%o" },      { JR, "%o" },      { JR, "%o" },
4651   { JR, "%o" },      { JR, "%o" },      { JR, "%o" },      { JR, "%o" }
4652};
4653
4654/*********************************************************
4655 *
4656 * uPD7801
4657 *
4658 *********************************************************/
4659
4660static const struct dasm_s dasm48_78c05[256] = {
4661   /* 0x00 - 0x3F */
4662   { SKIT, "F0" },      { SKIT, "FT" },      { SKIT, "F1" },      { illegal, 0 },   /* TODO: PDF doesn't mention SKIT and SK */
4663   { SKIT, "FS" },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4664   { illegal, 0 },      { illegal, 0 },      { SK, "CY" },      { illegal, 0 },
4665   { SK, "Z" },      { illegal, 0 },      { PUSH, "VA" },      { POP, "VA" },
4666
4667   { SKNIT, "F0" },   { SKNIT, "FT" },   { SKNIT, "F1" },   { illegal, 0 },
4668   { SKNIT, "FS" },   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4669   { illegal, 0 },      { illegal, 0 },      { SKN, "CY" },      { illegal, 0 },
4670   { SKN, "Z" },      { illegal, 0 },      { PUSH, "BC" },      { POP, "BC" },
4671
4672   { EI, 0 },         { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4673   { DI, 0 },         { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4674   { illegal, 0 },      { illegal, 0 },      { CLC, 0 },         { STC, 0 },
4675   { illegal, 0 },      { PEX, 0 },         { PUSH, "DE" },      { POP, "DE" },
4676
4677   { RLL, "A" },      { RLR, "A" },      { illegal, 0 },      { illegal, 0 },
4678   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4679   { RLD, 0 },         { RRD, 0 },         { illegal, 0 },      { illegal, 0 },
4680   { PER, 0 },         { illegal, 0 },      { PUSH, "HL" },      { POP, "HL" },
4681
4682   /* 0x40 - 0x7F */
4683   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4684   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4685   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4686   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4687
4688   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4689   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4690   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4691   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4692
4693   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4694   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4695   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4696   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4697
4698   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4699   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4700   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4701   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4702
4703   /* 0x80 - 0xBF */
4704   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4705   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4706   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4707   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4708
4709   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4710   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4711   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4712   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4713
4714   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4715   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4716   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4717   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4718
4719   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4720   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4721   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4722   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4723
4724   /* 0xC0 - 0xFF */
4725   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4726   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4727   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4728   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4729
4730   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4731   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4732   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4733   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4734
4735   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4736   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4737   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4738   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4739
4740   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4741   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4742   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4743   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 }
4744};
4745
4746static const struct dasm_s dasm4c_78c05[256] = {
4747   /* 0x00 - 0x3F */
4748   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4749   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4750   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4751   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4752
4753   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4754   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4755   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4756   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4757
4758   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4759   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4760   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4761   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4762
4763   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4764   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4765   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4766   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4767
4768   /* 0x40 - 0x7F */
4769   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4770   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4771   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4772   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4773
4774   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4775   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4776   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4777   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4778
4779   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4780   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4781   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4782   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4783
4784   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4785   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4786   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4787   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4788
4789   /* 0x80 - 0xBF */
4790   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4791   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4792   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4793   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4794
4795   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4796   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4797   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4798   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4799
4800   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4801   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4802   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4803   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4804
4805   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4806   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4807   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4808   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4809
4810   /* 0xC0 - 0xFF */
4811   { MOV, "A,PA" },   { MOV, "A,PB" },   { MOV, "A,PC" },   { MOV, "A,MK" },
4812   { MOV, "A,MB" },   { MOV, "A,MC" },   { MOV, "A,TM0" },   { MOV, "A,TM1" },
4813   { MOV, "A,S" },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },   /* TODO: Figure out what regsiter C9 indicates */
4814   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4815
4816   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4817   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4818   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4819   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4820
4821   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4822   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4823   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4824   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4825
4826   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4827   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4828   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4829   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 }
4830};
4831
4832static const struct dasm_s dasm4d_78c05[256] = {
4833   /* 0x00 - 0x3F */
4834   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4835   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4836   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4837   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4838
4839   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4840   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4841   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4842   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4843
4844   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4845   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4846   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4847   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4848
4849   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4850   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4851   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4852   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4853
4854   /* 0x40 - 0x7F */
4855   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4856   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4857   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4858   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4859
4860   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4861   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4862   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4863   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4864
4865   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4866   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4867   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4868   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4869
4870   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4871   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4872   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4873   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4874
4875   /* 0x80 - 0xBF */
4876   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4877   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4878   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4879   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4880
4881   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4882   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4883   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4884   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4885
4886   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4887   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4888   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4889   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4890
4891   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4892   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4893   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4894   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4895
4896   /* 0xC0 - 0xFF */
4897   { MOV, "PA,A" },   { MOV, "PB,A" },   { MOV, "PC,A" },   { MOV, "MK,A" },
4898   { MOV, "MB,A" },   { MOV, "MC,A" },   { MOV, "TM0,A" },   { MOV, "TM1,A" },
4899   { MOV, "S,A" },      { MOV, "TMM,A" },   { illegal, 0 },      { illegal, 0 },
4900   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4901
4902   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4903   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4904   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4905   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4906
4907   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4908   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4909   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4910   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4911
4912   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4913   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4914   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4915   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 }
4916};
4917
4918static const struct dasm_s dasm60_78c05[256] = {
4919   /* 0x00 - 0x3F */
4920   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4921   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4922   { illegal, 0 },      { ANA, "A,A" },      { illegal, 0 },      { illegal, 0 },
4923   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4924
4925   { illegal, 0 },      { XRA, "A,A" },      { illegal, 0 },      { illegal, 0 },
4926   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4927   { illegal, 0 },      { ORA, "A,A" },      { illegal, 0 },      { illegal, 0 },
4928   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4929
4930   { illegal, 0 },      { ADDNC, "A,A" },   { illegal, 0 },      { illegal, 0 },
4931   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4932   { illegal, 0 },      { GTA, "A,A" },      { illegal, 0 },      { illegal, 0 },
4933   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4934
4935   { illegal, 0 },      { SUBNB, "A,A" },   { illegal, 0 },      { illegal, 0 },
4936   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4937   { illegal, 0 },      { LTA, "A,A" },      { illegal, 0 },      { illegal, 0 },
4938   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4939
4940   /* 0x40 - 0x7F */
4941   { illegal, 0 },      { ADD, "A,A" },      { illegal, 0 },      { illegal, 0 },
4942   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4943   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4944   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4945
4946   { illegal, 0 },      { ADC, "A,A" },      { illegal, 0 },      { illegal, 0 },
4947   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4948   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4949   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4950
4951   { illegal, 0 },      { SUB, "A,A" },      { illegal, 0 },      { illegal, 0 },
4952   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4953   { illegal, 0 },      { NEA, "A,A" },      { illegal, 0 },      { illegal, 0 },
4954   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4955
4956   { illegal, 0 },      { SBB, "A,A" },      { illegal, 0 },      { illegal, 0 },
4957   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4958   { illegal, 0 },      { EQA, "A,A" },      { illegal, 0 },      { illegal, 0 },
4959   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4960
4961   /* 0x80 - 0xBF */
4962   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4963   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
4964   { illegal, 0 },      { ANA, "A,A" },      { ANA, "A,B" },      { ANA, "A,C" },
4965   { ANA, "A,D" },      { ANA, "A,E" },      { ANA, "A,H" },      { ANA, "A,L" },
4966
4967   { illegal, 0 },      { XRA, "A,A" },      { XRA, "A,B" },      { XRA, "A,C" },
4968   { XRA, "A,D" },      { XRA, "A,E" },      { XRA, "A,H" },      { XRA, "A,L" },
4969   { illegal, 0 },      { ORA, "A,A" },      { ORA, "A,B" },      { ORA, "A,C" },
4970   { ORA, "A,D" },      { ORA, "A,E" },      { ORA, "A,H" },      { ORA, "A,L" },
4971
4972   { illegal, 0 },      { ADDNC, "A,A" },   { ADDNC, "A,B" },   { ADDNC, "A,C" },
4973   { ADDNC, "A,D" },   { ADDNC, "A,E" },   { ADDNC, "A,H" },   { ADDNC, "A,L" },
4974   { illegal, 0 },      { GTA, "A,A" },      { GTA, "A,B" },      { GTA, "A,C" },
4975   { GTA, "A,D" },      { GTA, "A,E" },      { GTA, "A,H" },      { GTA, "A,L" },
4976
4977   { illegal, 0 },      { SUBNB, "A,A" },   { SUBNB, "A,B" },   { SUBNB, "A,C" },
4978   { SUBNB, "A,D" },   { SUBNB, "A,E" },   { SUBNB, "A,H" },   { SUBNB, "A,L" },
4979   { illegal, 0 },      { LTA, "A,A" },      { LTA, "A,B" },      { LTA, "A,C" },
4980   { LTA, "A,D" },      { LTA, "A,E" },      { LTA, "A,H" },      { LTA, "A,L" },
4981
4982   /* 0xC0 - 0xFF */
4983   { illegal, 0 },      { ADD, "A,A" },      { ADD, "A,B" },      { ADD, "A,C" },
4984   { ADD, "A,D" },      { ADD, "A,E" },      { ADD, "A,H" },      { ADD, "A,L" },
4985   { illegal, 0 },      { ONA, "A,A" },      { ONA, "A,B" },      { ONA, "A,C" },
4986   { ONA, "A,D" },      { ONA, "A,E" },      { ONA, "A,H" },      { ONA, "A,L" },
4987
4988   { illegal, 0 },      { ADC, "A,A" },      { ADC, "A,B" },      { ADC, "A,C" },
4989   { ADC, "A,D" },      { ADC, "A,E" },      { ADC, "A,H" },      { ADC, "A,L" },
4990   { illegal, 0 },      { OFFA, "A,A" },   { OFFA, "A,B" },   { OFFA, "A,C" },
4991   { OFFA, "A,D" },   { OFFA, "A,E" },   { OFFA, "A,H" },   { OFFA, "A,L" },
4992
4993   { illegal, 0 },      { SUB, "A,A" },      { SUB, "A,B" },      { SUB, "A,C" },
4994   { SUB, "A,D" },      { SUB, "A,E" },      { SUB, "A,H" },      { SUB, "A,L" },
4995   { illegal, 0 },      { NEA, "A,A" },      { NEA, "A,B" },      { NEA, "A,C" },
4996   { NEA, "A,D" },      { NEA, "A,E" },      { NEA, "A,H" },      { NEA, "A,L" },
4997
4998   { illegal, 0 },      { SBB, "A,A" },      { SBB, "A,B" },      { SBB, "A,C" },
4999   { SBB, "A,D" },      { SBB, "A,E" },      { SBB, "A,H" },      { SBB, "A,L" },
5000   { illegal, 0 },      { EQA, "A,A" },      { EQA, "A,B" },      { EQA, "A,C" },
5001   { EQA, "A,D" },      { EQA, "A,E" },      { EQA, "A,H" },      { EQA, "A,L" }
5002};
5003
5004static const struct dasm_s dasm64_78c05[256] = {
5005   /* 0x00 - 0x3F */
5006   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5007   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5008   { illegal, 0 },      { ANI, "A,%b" },   { illegal, 0 },      { illegal, 0 },
5009   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5010
5011   { illegal, 0 },      { XRI, "A,%b" },   { illegal, 0 },      { illegal, 0 },
5012   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5013   { illegal, 0 },      { ORI, "A,%b" },   { illegal, 0 },      { illegal, 0 },
5014   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5015
5016   { illegal, 0 },      { ADINC, "A,%b" },   { illegal, 0 },      { illegal, 0 },
5017   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5018   { illegal, 0 },      { GTI, "A,%b" },   { illegal, 0 },      { illegal, 0 },
5019   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5020
5021   { illegal, 0 },      { SUINB, "A,%b" },   { illegal, 0 },      { illegal, 0 },
5022   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5023   { illegal, 0 },      { LTI, "A,%b" },   { illegal, 0 },      { illegal, 0 },
5024   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5025
5026   /* 0x40 - 0x7F */
5027   { illegal, 0 },      { ADI, "A,%b" },   { illegal, 0 },      { illegal, 0 },
5028   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5029   { illegal, 0 },      { ONI, "A,%b" },   { illegal, 0 },      { illegal, 0 },
5030   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5031
5032   { illegal, 0 },      { ACI, "A,%b" },   { illegal, 0 },      { illegal, 0 },
5033   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5034   { illegal, 0 },      { OFFI, "A,%b" },   { illegal, 0 },      { illegal, 0 },
5035   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5036
5037   { illegal, 0 },      { SUI, "A,%b" },   { illegal, 0 },      { illegal, 0 },
5038   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5039   { illegal, 0 },      { NEI, "A,%b" },   { illegal, 0 },      { illegal, 0 },
5040   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5041
5042   { illegal, 0 },      { SBI, "A,%b" },   { illegal, 0 },      { illegal, 0 },
5043   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5044   { illegal, 0 },      { EQI, "A,%b" },   { illegal, 0 },      { illegal, 0 },
5045   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5046
5047   /* 0x80 - 0xBF */
5048   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5049   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5050   { ANI, "PA,%b" },   { ANI, "PB,%b" },   { ANI, "PC,%b" },   { ANI, "MK,%b" },
5051   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5052
5053   { XRI, "PA,%b" },   { XRI, "PB,%b" },   { XRI, "PC,%b" },   { XRI, "MK,%b" },
5054   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5055   { ORI, "PA,%b" },   { ORI, "PB,%b" },   { ORI, "PC,%b" },   { ORI, "MK,%b" },
5056   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5057
5058   { ADINC, "PA,%b" }, { ADINC, "PB,%b" }, { ADINC, "PC,%b" }, { ADINC, "MK,%b" },
5059   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5060   { GTI, "PA,%b" },   { GTI, "PB,%b" },   { GTI, "PC,%b" },   { GTI, "MK,%b" },
5061   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5062
5063   { SUINB, "PA,%b" }, { SUINB, "PB,%b" }, { SUINB, "PC,%b" }, { SUINB, "MK,%b" },
5064   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5065   { LTI, "PA,%b" },   { LTI, "PB,%b" },   { LTI, "PC,%b" },   { LTI, "MK,%b" },
5066   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5067
5068   /* 0xC0 - 0xFF */
5069   { ADI, "PA,%b" },   { ADI, "PB,%b" },   { ADI, "PC,%b" },   { ADI, "MK,%b" },
5070   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5071   { ONI, "PA,%b" },   { ONI, "PB,%b" },   { ONI, "PC,%b" },   { ONI, "MK,%b" },
5072   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5073
5074   { ACI, "PA,%b" },   { ACI, "PB,%b" },   { ACI, "PC,%b" },   { ACI, "MK,%b" },
5075   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5076   { SUI, "PA,%b" },   { SUI, "PB,%b" },   { SUI, "PC,%b" },   { SUI, "MK,%b" },
5077   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5078
5079   { NEI, "PA,%b" },   { NEI, "PB,%b" },   { NEI, "PC,%b" },   { NEI, "MK,%b" },
5080   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5081   { SBI, "PA,%b" },   { SBI, "PB,%b" },   { SBI, "PC,%b" },   { SBI, "MK,%b" },
5082   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5083
5084   { SBI, "PA,%b" },   { SBI, "PB,%b" },   { SBI, "PC,%b" },   { SBI, "MK,%b" },
5085   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5086   { EQI, "PA,%b" },   { EQI, "PB,%b" },   { EQI, "PC,%b" },   { EQI, "MK,%b" },
5087   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 }
5088};
5089
5090static const struct dasm_s dasm70_78c05[256] = {
5091   /* 0x00 - 0x3F */
5092   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5093   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5094   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5095   { illegal, 0 },      { illegal, 0 },      { SSPD, "%w" },      { LSPD, "%w" },
5096
5097   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5098   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5099   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5100   { illegal, 0 },      { illegal, 0 },      { SBCD, "%w" },      { LBCD, "%w" },
5101
5102   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5103   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5104   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5105   { illegal, 0 },      { illegal, 0 },      { SDED, "%w" },      { LDED, "%w" },
5106
5107   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5108   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5109   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5110   { illegal, 0 },      { illegal, 0 },      { SHLD, "%w" },      { LHLD, "%w" },
5111
5112   /* 0x40 - 0x7F */
5113   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5114   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5115   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5116   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5117
5118   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5119   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5120   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5121   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5122
5123   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5124   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5125   { illegal, 0 },      { MOV, "A,%w" },   { MOV, "B,%w" },   { MOV, "C,%w" },
5126   { MOV, "D,%w" },   { MOV, "E,%w" },   { MOV, "H,%w" },   { MOV, "L,%w" },
5127
5128   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5129   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5130   { illegal, 0 },      { MOV, "%w,A" },   { MOV, "%w,B" },   { MOV, "%w,C" },
5131   { MOV, "%w,D" },   { MOV, "%w,E" },   { MOV, "%w,H" },   { MOV, "%w,L" },
5132
5133   /* 0x80 - 0xBF */
5134   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5135   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5136   { illegal, 0 },      { ANAX, "BC" },      { ANAX, "DE" },      { ANAX, "HL" },
5137   { ANAX, "DE+" },   { ANAX, "HL+" },   { ANAX, "DE-" },   { ANAX, "HL-" },
5138
5139   { illegal, 0 },      { XRAX, "BC" },      { XRAX, "DE" },      { XRAX, "HL" },
5140   { XRAX, "DE+" },   { XRAX, "HL+" },   { XRAX, "DE-" },   { XRAX, "HL-" },
5141   { illegal, 0 },      { ORAX, "BC" },      { ORAX, "DE" },      { ORAX, "HL" },
5142   { ORAX, "DE+" },   { ORAX, "HL+" },   { ORAX, "DE-" },   { ORAX, "HL-" },
5143
5144   { illegal, 0 },      { ADDNCX, "BC" },   { ADDNCX, "DE" },   { ADDNCX, "HL" },
5145   { ADDNCX, "DE+" },   { ADDNCX, "HL+" },   { ADDNCX, "DE-" },   { ADDNCX, "HL-" },
5146   { illegal, 0 },      { GTAX, "BC" },      { GTAX, "DE" },      { GTAX, "HL" },
5147   { GTAX, "DE+" },   { GTAX, "HL+" },   { GTAX, "DE-" },   { GTAX, "HL-" },
5148
5149   { illegal, 0 },      { SUBNBX, "BC" },   { SUBNBX, "DE" },   { SUBNBX, "HL" },
5150   { SUBNBX, "DE+" },   { SUBNBX, "HL+" },   { SUBNBX, "DE-" },   { SUBNBX, "HL-" },
5151   { illegal, 0 },      { LTAX, "BC" },      { LTAX, "DE" },      { LTAX, "HL" },
5152   { LTAX, "DE+" },   { LTAX, "HL+" },   { LTAX, "DE-" },   { LTAX, "HL-" },
5153
5154   /* 0xC0 - 0xFF */
5155   { illegal, 0 },      { ADDX, "BC" },      { ADDX, "DE" },      { ADDX, "HL" },
5156   { ADDX, "DE+" },   { ADDX, "HL+" },   { ADDX, "DE-" },   { ADDX, "HL-" },
5157   { illegal, 0 },      { ONAX, "BC" },      { ONAX, "DE" },      { ONAX, "HL" },
5158   { ONAX, "DE+" },   { ONAX, "HL+" },   { ONAX, "DE-" },   { ONAX, "HL-" },
5159
5160   { illegal, 0 },      { ADCX, "BC" },      { ADCX, "DE" },      { ADCX, "HL" },
5161   { ADCX, "DE+" },   { ADCX, "HL+" },   { ADCX, "DE-" },   { ADCX, "HL-" },
5162   { illegal, 0 },      { OFFAX, "BC" },   { OFFAX, "DE" },   { OFFAX, "HL" },
5163   { OFFAX, "DE+" },   { OFFAX, "HL+" },   { OFFAX, "DE-" },   { OFFAX, "HL-" },
5164
5165   { illegal, 0 },      { SUBX, "BC" },      { SUBX, "DE" },      { SUBX, "HL" },
5166   { SUBX, "DE+" },   { SUBX, "HL+" },   { SUBX, "DE-" },   { SUBX, "HL-" },
5167   { illegal, 0 },      { NEAX, "BC" },      { NEAX, "DE" },      { NEAX, "HL" },
5168   { NEAX, "DE+" },   { NEAX, "HL+" },   { NEAX, "DE-" },   { NEAX, "HL-" },
5169
5170   { illegal, 0 },      { SBBX, "BC" },      { SBBX, "DE" },      { SBBX, "HL" },
5171   { SBBX, "DE+" },   { SBBX, "HL+" },   { SBBX, "DE-" },   { SBBX, "HL-" },
5172   { illegal, 0 },      { EQAX, "BC" },      { EQAX, "DE" },      { EQAX, "HL" },
5173   { EQAX, "DE+" },   { EQAX, "HL+" },   { EQAX, "DE-" },   { EQAX, "HL-" },
5174};
5175
5176static const struct dasm_s dasm74_78c05[256] = {
5177   /* 0x00 - 0x3F */
5178   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5179   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5180   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5181   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5182
5183   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5184   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5185   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5186   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5187
5188   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5189   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5190   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5191   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5192
5193   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5194   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5195   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5196   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5197
5198   /* 0x40 - 0x7F */
5199   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5200   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5201   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5202   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5203
5204   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5205   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5206   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5207   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5208
5209   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5210   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5211   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5212   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5213
5214   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5215   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5216   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5217   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5218
5219   /* 0x80 - 0xBF */
5220   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5221   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5222   { ANAW, "%a" },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5223   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5224
5225   { XRAW, "%a" },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5226   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5227   { ORAW, "%a" },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5228   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5229
5230   { ADDNCW, "%a" },   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5231   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5232   { GTAW, "%a" },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5233   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5234
5235   { SUBNBW, "%a" },   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5236   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5237   { LTAW, "%a" },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5238   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5239
5240   /* 0xC0 - 0xFF */
5241   { ADDW, "%a" },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5242   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5243   { ONAW, "%a" },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5244   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5245
5246   { ADCW, "%a" },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5247   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5248   { OFFAW, "%a" },   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5249   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5250
5251   { SUBW, "%a" },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5252   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5253   { NEAW, "%a" },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5254   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5255
5256   { SBBW, "%a" },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5257   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5258   { EQAW, "%a" },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5259   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5260};
5261
5262static const struct dasm_s dasmXX_78c05[256] = {
5263   /* 0x00 - 0x3F */
5264   { NOP, 0 },         { HALT, 0 },      { INX, "SP" },      { DCX, "SP" },
5265   { LXI, "SP,%w" },   { ANIW, "%a,%b" },   { illegal, 0 },      { ANI, "A,%b" },
5266   { RET, 0 },         { SIO, 0 },         { MOV, "A,B" },      { MOV, "A,C" },
5267   { MOV, "A,D" },      { MOV, "A,E" },      { MOV, "A,H" },      { MOV, "A,L" },
5268
5269   { illegal, 0 },      { illegal, 0 },      { INX, "BC" },      { DCX, "BC" },
5270   { LXI, "BC,%w" },   { ORIW, "%a,%b" },   { XRI, "A,%b" },   { ORI, "A,%b" },
5271   { RETS, 0 },      { STM, 0 },         { MOV, "B,A" },      { MOV, "C,A" },
5272   { MOV, "D,A" },      { MOV, "E,A" },      { MOV, "H,A" },      { MOV, "L,A" },
5273
5274   { INRW, "%a" },      { illegal, 0 },      { INX, "DE" },      { DCX, "DE" },
5275   { LXI, "DE,%w" },   { GTIW, "%a,%b" },   { ADINC, "A,%b" },   { GTI, "A,%b" },
5276   { LDAW, "%a" },      { LDAX, "BC" },      { LDAX, "DE" },      { LDAX, "HL" },
5277   { LDAX, "DE+" },   { LDAX, "HL+" },   { LDAX, "DE-" },   { LDAX, "HL-" },
5278
5279   { DCRW, "%a" },      { illegal, 0 },      { INX, "HL" },      { DCX, "HL" },
5280   { LXI, "HL,%w" },   { LTIW, "%a,%b" },   { SUINB, "A,%b" },   { LTI, "A,%b" },
5281   { STAW, "%a" },      { STAX, "BC" },      { STAX, "DE" },      { STAX, "HL" },
5282   { STAX, "DE+" },   { STAX, "HL+" },   { STAX, "DE-" },   { STAX, "HL-" },
5283
5284   /* 0x40 - 0x7F */
5285   { illegal, 0 },      { INR, "A" },      { INR, "B" },      { INR, "C" },
5286   { CALL, "%w" },      { ONIW, "%a,%b" },   { ADI, "A,%b" },   { ONI, "A,%b" },
5287   { 0, dasm48_78c05 },   { illegal, 0 },   { illegal, 0 },      { illegal, 0 },
5288   { 0, dasm4c_78c05 },   { 0, dasm4d_78c05 },   { JRE, "%d" },      { JRE, "%d" },
5289
5290   { illegal, 0 },      { DCR, "A" },      { DCR, "B" },      { DCR, "C" },
5291   { JMP, "%w" },      { OFFIW, "%a,%b" },   { ACI, "A,%b" },   { OFFI, "A,%b" },
5292   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5293   { illegal, 0 },      { illegal, 0 },      { illegal, 0 },      { illegal, 0 },
5294
5295   { 0, dasm60_78c05 },   { DAA, 0 },         { RETI, 0 },      { CALB, 0 },
5296   { 0, dasm64_78c05 },   { NEIW, "%a,%b" },   { SUI, "A,%b" },   { NEI, "A,%b" },
5297   { illegal, 0 },      { MVI, "A,%b" },   { MVI, "B,%b" },   { MVI, "C,%b" },
5298   { MVI, "D,%b" },   { MVI, "E,%b" },   { MVI, "H,%b" },   { MVI, "L,%b" },
5299
5300   { 0, dasm70_78c05 },   { MVIW, "%a,%b" },   { SOFTI, 0 },      { JB, 0 },
5301   { 0, dasm74_78c05 },   { EQIW, "%a,%b" },   { SBI, "A,%b" },   { EQI, "A,%b" },
5302   { CALF, "%f" },      { CALF, "%f" },      { CALF, "%f" },      { CALF, "%f" },
5303   { CALF, "%f" },      { CALF, "%f" },      { CALF, "%f" },      { CALF, "%f" },
5304
5305   /* 0x80 - 0xBF */
5306   { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },
5307   { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },
5308   { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },
5309   { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },
5310
5311   { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },
5312   { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },
5313   { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },
5314   { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },
5315
5316   { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },
5317   { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },
5318   { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },
5319   { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },
5320
5321   { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },
5322   { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },
5323   { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },
5324   { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },      { CALT, "%t" },
5325
5326   /* 0xC0 - 0xFF */
5327   { JR, "%o" },      { JR, "%o" },      { JR, "%o" },      { JR, "%o" },
5328   { JR, "%o" },      { JR, "%o" },      { JR, "%o" },      { JR, "%o" },
5329   { JR, "%o" },      { JR, "%o" },      { JR, "%o" },      { JR, "%o" },
5330   { JR, "%o" },      { JR, "%o" },      { JR, "%o" },      { JR, "%o" },
5331
5332   { JR, "%o" },      { JR, "%o" },      { JR, "%o" },      { JR, "%o" },
5333   { JR, "%o" },      { JR, "%o" },      { JR, "%o" },      { JR, "%o" },
5334   { JR, "%o" },      { JR, "%o" },      { JR, "%o" },      { JR, "%o" },
5335   { JR, "%o" },      { JR, "%o" },      { JR, "%o" },      { JR, "%o" },
5336
5337   { JR, "%o" },      { JR, "%o" },      { JR, "%o" },      { JR, "%o" },
5338   { JR, "%o" },      { JR, "%o" },      { JR, "%o" },      { JR, "%o" },
5339   { JR, "%o" },      { JR, "%o" },      { JR, "%o" },      { JR, "%o" },
5340   { JR, "%o" },      { JR, "%o" },      { JR, "%o" },      { JR, "%o" },
5341
5342   { JR, "%o" },      { JR, "%o" },      { JR, "%o" },      { JR, "%o" },
5343   { JR, "%o" },      { JR, "%o" },      { JR, "%o" },      { JR, "%o" },
5344   { JR, "%o" },      { JR, "%o" },      { JR, "%o" },      { JR, "%o" },
5345   { JR, "%o" },      { JR, "%o" },      { JR, "%o" },      { JR, "%o" }
5346};
5347
5348
39495349/* register names for bit manipulation instructions */
39505350static const char *const regname[32] =
39515351{
r1771r1772
39595359   "illegal", "TMM",     "PT",      "illegal"
39605360};
39615361
3962static unsigned upd7810_get_reg(int reg) { cpuinfo info; upd7810_get_info(CPUINFO_INT_REGISTER + (reg), &info); return info.i; }
3963
3964static unsigned Dasm( char *buffer, unsigned pc, const struct dasm_s *dasmXX, const UINT8 *oprom, const UINT8 *opram )
5362static offs_t Dasm( char *buffer, offs_t pc, const struct dasm_s *dasmXX, const UINT8 *oprom, const UINT8 *opram, int is_7810 )
39655363{
3966   unsigned opc = pc;
3967   UINT8 op = oprom[pc++ - opc], op2, t, l;
5364   int idx = 0;
5365   UINT8 op = oprom[idx++], op2, t;
39685366   int offset;
39695367   UINT16 ea;
39705368   const char *a;
r1771r1772
39725370
39735371   t = dasmXX[op].token;
39745372   a = dasmXX[op].args;
3975   l = dasmXX[op].oplen;
39765373
39775374   /* 0 token means prefix opcode (use table from args) */
39785375   if (0 == t)
39795376   {
39805377      struct dasm_s *p_dasm = (struct dasm_s *)a;
39815378
3982      op2 = oprom[pc++ - opc];
5379      op2 = oprom[idx++];
39835380      t = p_dasm[op2].token;
39845381      a = p_dasm[op2].args;
3985      l = p_dasm[op2].oplen;
39865382   }
39875383
39885384   buffer += sprintf(buffer, "%-8.8s", token[t]);
r1771r1772
40005396         switch (*a)
40015397         {
40025398         case 'a':   /* address V * 256 + offset */
4003            op2 = opram[pc++ - opc];
4004            ea = upd7810_get_reg(UPD7810_V) * 256 + op2;
4005            buffer += sprintf(buffer, "$%04X", ea);
5399            op2 = opram[idx++];
5400            buffer += sprintf(buffer, "VV:%02X", op2);
40065401            break;
40075402         case 'b':   /* immediate byte */
4008            buffer += sprintf(buffer, "$%02X", opram[pc++ - opc]);
5403            buffer += sprintf(buffer, "$%02X", opram[idx++]);
40095404            break;
40105405         case 'w':   /* immediate word */
4011            ea = opram[pc++ - opc];
4012            ea += opram[pc++ - opc] << 8;
5406            ea = opram[idx++];
5407            ea += opram[idx++] << 8;
40135408            buffer += sprintf(buffer, "$%04X", ea);
40145409            break;
40155410         case 'd':   /* JRE address */
4016            op2 = oprom[pc++ - opc];
5411            op2 = oprom[idx++];
40175412            offset = (op & 1) ? -(256 - op2): + op2;
4018            buffer += sprintf(buffer, "$%04X", pc + offset);
5413            buffer += sprintf(buffer, "$%04X", ( pc + idx + offset ) & 0xFFFF );
40195414            break;
40205415         case 't':   /* CALT address */
4021            ea = 0x80 + 2 * (op & 0x1f);
5416            ea = 0x80 + 2 * (op & (is_7810 ? 0x1f : 0x3f));
40225417            buffer += sprintf(buffer, "($%04X)", ea);
40235418            break;
40245419         case 'f':   /* CALF address */
4025            op2 = oprom[pc++ - opc];
5420            op2 = oprom[idx++];
40265421            ea = 0x800 + 0x100 * (op & 0x07) + op2;
40275422            buffer += sprintf(buffer, "$%04X", ea);
40285423            break;
40295424         case 'o':   /* JR offset */
4030            op2 = oprom[pc++ - opc];
4031            offset = (INT8)(op << 2) >> 2;
4032            buffer += sprintf(buffer, "$%04X", pc + offset - 1);
5425            offset = ( ( op & 0x20 ) ? -0x20 : 0 ) + ( op & 0x1F );
5426            buffer += sprintf(buffer, "$%04X", ( pc + idx + offset ) & 0xFFFF );
40335427            break;
40345428         case 'i':   /* bit manipulation */
4035            op2 = oprom[pc++ - opc];
5429            op2 = oprom[idx++];
40365430            buffer += sprintf(buffer, "%s,%d", regname[op2 & 0x1f], op2 >> 5);
40375431            break;
40385432         default:
r1771r1772
40455439   }
40465440   *buffer = '\0';
40475441
4048   return l | flags | DASMFLAG_SUPPORTED;
5442   return idx | flags | DASMFLAG_SUPPORTED;
40495443}
40505444
4051unsigned upd7810_dasm( char *buffer, unsigned pc, const UINT8 *oprom, const UINT8 *opram )
5445offs_t upd7810_dasm( char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram )
40525446{
4053   return Dasm( buffer, pc, dasmXX_7810, oprom, opram );
5447   return Dasm( buffer, pc, dasmXX_7810, oprom, opram, 1 );
40545448}
40555449
4056unsigned upd7807_dasm( char *buffer, unsigned pc, const UINT8 *oprom, const UINT8 *opram )
5450offs_t upd7807_dasm( char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram )
40575451{
4058   return Dasm( buffer, pc, dasmXX_7807, oprom, opram );
5452   return Dasm( buffer, pc, dasmXX_7807, oprom, opram, 1 );
40595453}
5454
5455offs_t upd7801_dasm( char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram ) {
5456   return Dasm( buffer, pc, dasmXX_7801, oprom, opram, 0 );
5457}
5458
5459offs_t upd78c05_dasm( char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram ) {
5460   return Dasm( buffer, pc, dasmXX_78c05, oprom, opram, 0 );
5461}
5462
5463
src/emu/cpu/upd7810/upd7810.c
r1771r1772
5959 *       5B xx (CLR)
6060 *       5D xx (SK bit)
6161 *
62 * 2008-02-24 (Wilbert Pol):
63 * - Added preliminary support for uPD7801
64 *   For the uPD7801 only the basic instruction set was added. The current timer
65 *   and serial i/o implementations are most likely incorrect.
66 * - Added basic support for uPD78C05 and uPD78C06
67 *   Documentation of the actual instruction set layout is missing, so we took
68 *   the uPD7801 instruction set and only kept the instructions mentioned in
69 *   the little documentation available on the uPD78c05A/06A. The serial i/o
70 *   implementation has not been tested and is probably incorrect.
71 *
6272 *****************************************************************************/
6373/* Hau around 23 May 2004
6474  gta, gti, dgt fixed
r1771r1772
14961506   }
14971507}
14981508
1509//static void upd7801_timers(int cycles)
1510//{
1511//}
1512
1513static void upd78c05_timers(int cycles)
1514{
1515   if ( upd7810.ovc0 ) {
1516      upd7810.ovc0 -= cycles;
1517
1518      if ( upd7810.ovc0 <= 0 ) {
1519         IRR |= INTFT0;
1520         if (0x00 == (TMM & 0x03)) {
1521            TO ^= 1;
1522            if (upd7810.config.io_callback)
1523               (*upd7810.config.io_callback)(UPD7810_TO,TO);
1524         }
1525
1526         while ( upd7810.ovc0 <= 0 ) {
1527            upd7810.ovc0 += ( ( TMM & 0x04 ) ? 16 * 8 : 8 ) * TM0;
1528         }
1529      }
1530   }
1531}
1532
14991533static void upd7810_init(int index, int clock, const void *config, int (*irqcallback)(int))
15001534{
15011535   upd7810.config = *(const UPD7810_CONFIG*) config;
r1771r1772
15801614   upd7810.irq_callback = save_irqcallback;
15811615
15821616   upd7810.opXX = opXX_7810;
1617   upd7810.op48 = op48;
1618   upd7810.op4C = op4C;
1619   upd7810.op4D = op4D;
1620   upd7810.op60 = op60;
1621   upd7810.op64 = op64;
1622   upd7810.op70 = op70;
1623   upd7810.op74 = op74;
15831624   ETMM = 0xff;
15841625   TMM = 0xff;
15851626   MA = 0xff;
r1771r1772
15991640   // gamemaster falling block "and"s to enable interrupts
16001641   MKL = 0xff;
16011642   MKH = 0xff; //?
1643   upd7810.handle_timers = upd7810_timers;
16021644}
16031645
16041646static void upd7807_reset (void)
r1771r1772
16071649   upd7810.opXX = opXX_7807;
16081650}
16091651
1652static void upd7801_reset( void ) {
1653   upd7810_reset();
1654   upd7810.op48 = op48_7801;
1655   upd7810.op4C = op4C_7801;
1656   upd7810.op4D = op4D_7801;
1657   upd7810.op60 = op60_7801;
1658   upd7810.op64 = op64_7801;
1659   upd7810.op70 = op70_7801;
1660   upd7810.op74 = op74_7801;
1661   upd7810.opXX = opXX_7801;
1662}
1663
1664static void upd78c05_reset( void ) {
1665   upd7810_reset();
1666   upd7810.op48 = op48_78c05;
1667   upd7810.op4C = op4C_78c05;
1668   upd7810.op4D = op4D_78c05;
1669   upd7810.op60 = op60_78c05;
1670   upd7810.op64 = op64_78c05;
1671   upd7810.op70 = op70_78c05;
1672   upd7810.op74 = op74_78c05;
1673   upd7810.opXX = opXX_78c05;
1674   MA = 0;      /* All outputs */
1675   MC = 0xFF;   /* All inputs */
1676   V = 0xFF;   /* The vector register is always pointing to FF00 */
1677   upd7810.handle_timers = upd78c05_timers;
1678   TM0 = 0xFF;   /* Timer seems to be running from boot */
1679   upd7810.ovc0 = ( ( TMM & 0x04 ) ? 16 * 8 : 8 ) * TM0;
1680}
1681
1682static void upd78c06_reset( void ) {
1683   upd78c05_reset();
1684   upd7810.op48 = op48_78c06;
1685   upd7810.op4C = op4C_78c06;
1686   upd7810.op4D = op4D_78c06;
1687   upd7810.op60 = op60_78c06;
1688   upd7810.op64 = op64_78c06;
1689   upd7810.op70 = op70_78c06;
1690   upd7810.op74 = op74_78c06;
1691   upd7810.opXX = opXX_78c06;
1692}
1693
16101694static void upd7810_exit (void)
16111695{
16121696}
16131697
16141698static int upd7810_execute (int cycles)
16151699{
1616   const struct opcode_s *opXX = upd7810.opXX;
1617
16181700   upd7810_icount = cycles;
16191701
16201702   do
r1771r1772
16311713         * L0   for "MVI L,xx" or "LXI H,xxxx"
16321714         * L1   for "MVI A,xx"
16331715         */
1634      PSW &= ~opXX[OP].mask_l0_l1;
1716      PSW &= ~upd7810.opXX[OP].mask_l0_l1;
16351717
16361718      /* skip flag set and not SOFTI opcode? */
16371719      if ((PSW & SK) && (OP != 0x72))
16381720      {
1639         if (opXX[OP].cycles)
1721         if (upd7810.opXX[OP].cycles)
16401722         {
1641            cc = opXX[OP].cycles_skip;
1642            PC += opXX[OP].oplen - 1;
1723            cc = upd7810.opXX[OP].cycles_skip;
1724            PC += upd7810.opXX[OP].oplen - 1;
16431725         }
16441726         else
16451727         {
r1771r1772
16471729            switch (OP)
16481730            {
16491731            case 0x48:
1650               cc = op48[OP2].cycles_skip;
1651               PC += op48[OP2].oplen - 2;
1732               cc = upd7810.op48[OP2].cycles_skip;
1733               PC += upd7810.op48[OP2].oplen - 2;
16521734               break;
16531735            case 0x4c:
1654               cc = op4C[OP2].cycles_skip;
1655               PC += op4C[OP2].oplen - 2;
1736               cc = upd7810.op4C[OP2].cycles_skip;
1737               PC += upd7810.op4C[OP2].oplen - 2;
16561738               break;
16571739            case 0x4d:
1658               cc = op4D[OP2].cycles_skip;
1659               PC += op4D[OP2].oplen - 2;
1740               cc = upd7810.op4D[OP2].cycles_skip;
1741               PC += upd7810.op4D[OP2].oplen - 2;
16601742               break;
16611743            case 0x60:
1662               cc = op60[OP2].cycles_skip;
1663               PC += op60[OP2].oplen - 2;
1744               cc = upd7810.op60[OP2].cycles_skip;
1745               PC += upd7810.op60[OP2].oplen - 2;
16641746               break;
16651747            case 0x64:
1666               cc = op64[OP2].cycles_skip;
1667               PC += op64[OP2].oplen - 2;
1748               cc = upd7810.op64[OP2].cycles_skip;
1749               PC += upd7810.op64[OP2].oplen - 2;
16681750               break;
16691751            case 0x70:
1670               cc = op70[OP2].cycles_skip;
1671               PC += op70[OP2].oplen - 2;
1752               cc = upd7810.op70[OP2].cycles_skip;
1753               PC += upd7810.op70[OP2].oplen - 2;
16721754               break;
16731755            case 0x74:
1674               cc = op74[OP2].cycles_skip;
1675               PC += op74[OP2].oplen - 2;
1756               cc = upd7810.op74[OP2].cycles_skip;
1757               PC += upd7810.op74[OP2].oplen - 2;
16761758               break;
16771759            default:
16781760               fatalerror("uPD7810 internal error: check cycle counts for main");
16791761            }
16801762         }
16811763         PSW &= ~SK;
1682         upd7810_timers( cc );
1764         upd7810.handle_timers( cc );
16831765         change_pc( PCD );
16841766      }
16851767      else
16861768      {
1687         cc = opXX[OP].cycles;
1688         upd7810_timers( cc );
1689         (*opXX[OP].opfunc)();
1769         cc = upd7810.opXX[OP].cycles;
1770         upd7810.handle_timers( cc );
1771         (*upd7810.opXX[OP].opfunc)();
16901772      }
16911773      upd7810_icount -= cc;
16921774      upd7810_take_irq();
r1771r1772
20172099      default:                              upd7810_get_info(state, info);         break;
20182100   }
20192101}
2102
2103void upd7801_get_info(UINT32 state, cpuinfo *info) {
2104   switch( state ) {
2105      case CPUINFO_PTR_RESET:                     info->reset = upd7801_reset;         break;
2106#ifdef ENABLE_DEBUGGER
2107      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = upd7801_dasm;      break;
2108#endif /* ENABLE_DEBUGGER */
2109
2110      case CPUINFO_STR_NAME:                     strcpy(info->s, "uPD7801");            break;
2111
2112      default:                              upd7810_get_info(state, info);         break;
2113   }
2114}
2115
2116void upd78c05_get_info(UINT32 state, cpuinfo *info ) {
2117   switch ( state ) {
2118      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 4;                     break;
2119
2120      case CPUINFO_PTR_RESET:                     info->reset = upd78c05_reset;         break;
2121#ifdef ENABLE_DEBUGGER
2122      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = upd78c05_dasm;      break;
2123#endif /* ENABLE_DEBUGGER */
2124
2125      case CPUINFO_STR_NAME:                     strcpy(info->s, "uPD78C05");         break;
2126
2127      /* These registers are not present in the uPD78C05 cpu */
2128      case CPUINFO_STR_REGISTER + UPD7810_A2:
2129      case CPUINFO_STR_REGISTER + UPD7810_V2:
2130      case CPUINFO_STR_REGISTER + UPD7810_EA2:
2131      case CPUINFO_STR_REGISTER + UPD7810_BC2:
2132      case CPUINFO_STR_REGISTER + UPD7810_DE2:
2133      case CPUINFO_STR_REGISTER + UPD7810_HL2:
2134      case CPUINFO_STR_REGISTER + UPD7810_MA:
2135      case CPUINFO_STR_REGISTER + UPD7810_MCC:
2136      case CPUINFO_STR_REGISTER + UPD7810_MC:
2137      case CPUINFO_STR_REGISTER + UPD7810_MM:
2138      case CPUINFO_STR_REGISTER + UPD7810_MF:
2139      case CPUINFO_STR_REGISTER + UPD7810_ETMM:
2140      case CPUINFO_STR_REGISTER + UPD7810_EOM:
2141      case CPUINFO_STR_REGISTER + UPD7810_SML:
2142      case CPUINFO_STR_REGISTER + UPD7810_SMH:
2143      case CPUINFO_STR_REGISTER + UPD7810_ANM:
2144      case CPUINFO_STR_REGISTER + UPD7810_MKH:
2145      case CPUINFO_STR_REGISTER + UPD7810_ZCM:
2146      case CPUINFO_STR_REGISTER + UPD7810_CR0:
2147      case CPUINFO_STR_REGISTER + UPD7810_CR1:
2148      case CPUINFO_STR_REGISTER + UPD7810_CR2:
2149      case CPUINFO_STR_REGISTER + UPD7810_CR3:
2150      case CPUINFO_STR_REGISTER + UPD7810_RXB:
2151      case CPUINFO_STR_REGISTER + UPD7810_TXB:
2152      case CPUINFO_STR_REGISTER + UPD7810_TXD:
2153      case CPUINFO_STR_REGISTER + UPD7810_RXD:
2154      case CPUINFO_STR_REGISTER + UPD7810_SCK:
2155      case CPUINFO_STR_REGISTER + UPD7810_TI:
2156      case CPUINFO_STR_REGISTER + UPD7810_TO:
2157      case CPUINFO_STR_REGISTER + UPD7810_CI:
2158      case CPUINFO_STR_REGISTER + UPD7810_CO0:
2159      case CPUINFO_STR_REGISTER + UPD7810_CO1:      break;
2160
2161      default:                              upd7801_get_info(state, info);         break;
2162   }
2163}
2164
2165void upd78c06_get_info(UINT32 state, cpuinfo *info ) {
2166   switch ( state ) {
2167      case CPUINFO_PTR_RESET:                     info->reset = upd78c06_reset;         break;
2168
2169      case CPUINFO_STR_NAME:                     strcpy(info->s, "uPD78C06");         break;
2170
2171      default:                              upd78c05_get_info(state, info);         break;
2172   }
2173}
src/emu/cpu/upd7810/upd7810.h
r1771r1772
1111
1212// unfortunatly memory configuration differs with internal rom size
1313typedef enum {
14   TYPE_7801,
15   TYPE_78C05,
16   TYPE_78C06,
1417   TYPE_7810,
1518   TYPE_7810_GAMEMASTER, // a few modifications until internal rom dumped
1619   TYPE_7807
r1771r1772
6265#define UPD7810_INTF2      1
6366#define UPD7810_INTFE1      4
6467
65extern void upd7810_get_info(UINT32 state, cpuinfo *info);
66extern void upd7807_get_info(UINT32 state, cpuinfo *info);
68void upd7810_get_info(UINT32 state, cpuinfo *info);
69void upd7807_get_info(UINT32 state, cpuinfo *info);
70void upd7801_get_info(UINT32 state, cpuinfo *info);
71void upd78c05_get_info(UINT32 state, cpuinfo *info);
72void upd78c06_get_info(UINT32 state, cpuinfo *info);
6773
6874typedef struct {
6975   PAIR   ppc;   /* previous program counter */
r1771r1772
144150   const struct opcode_s *opXX;   /* opcode table */
145151   const struct opcode_s *op48;
146152   const struct opcode_s *op4C;
153   const struct opcode_s *op4D;
154   const struct opcode_s *op60;
155   const struct opcode_s *op64;
156   const struct opcode_s *op70;
157   const struct opcode_s *op74;
158   void (*handle_timers)(int cycles);
147159   UPD7810_CONFIG config;
148160   int (*irq_callback)(int irqline);
149161}   UPD7810;
r1771r1772
151163#ifdef ENABLE_DEBUGGER
152164offs_t upd7810_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
153165offs_t upd7807_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
166offs_t upd7801_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
167offs_t upd78c05_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
154168#endif
155169
156170#endif
src/emu/video/generic.c
r1771r1772
6060UINT16 *paletteram16_2;
6161
6262mame_bitmap *tmpbitmap;
63int flip_screen_x, flip_screen_y;
63static int flip_screen_x, flip_screen_y;
6464
6565
6666
r1771r1772
295295   spriteram_3_size = 0;
296296   tmpbitmap = NULL;
297297   flip_screen_x = flip_screen_y = 0;
298   state_save_register_item("video", 0, flip_screen_x);
299   state_save_register_item("video", 0, flip_screen_y);
298300}
299301
300302
r1771r1772
304306***************************************************************************/
305307
306308/*-------------------------------------------------
307    VIDEO_START( generic ) - general video system
308-------------------------------------------------*/
309
310VIDEO_START( generic )
311{
312   /* allocate the temporary bitmap */
313   tmpbitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
314}
315
316
317/*-------------------------------------------------
318309    VIDEO_START( generic_bitmapped ) - general video
319310    system with a bitmap
320311-------------------------------------------------*/
r1771r1772
497488
498489
499490/*-------------------------------------------------
491    flip_screen_set_no_update - set global flip
492       do not call update_flip.
493-------------------------------------------------*/
494
495void flip_screen_set_no_update(int on)
496{
497   /* flip_screen_y is not updated on purpose
498     * this function is for drivers which
499     * where writing to flip_screen_x to
500     * bypass update_flip
501     */
502   flip_screen_x = on;
503}
504
505
506/*-------------------------------------------------
500507    flip_screen_x_set - set global horizontal flip
501508-------------------------------------------------*/
502509
r1771r1772
526533}
527534
528535
536/*-------------------------------------------------
537    flip_screen_get - get global flip
538-------------------------------------------------*/
539
540int flip_screen_get(void)
541{
542   return flip_screen_x;
543}
544
545
546/*-------------------------------------------------
547    flip_screen_x_get - get global x flip
548-------------------------------------------------*/
549
550int flip_screen_x_get(void)
551{
552   return flip_screen_x;
553}
554
555
556/*-------------------------------------------------
557    flip_screen_get - get global y flip
558-------------------------------------------------*/
559
560int flip_screen_y_get(void)
561{
562   return flip_screen_y;
563}
564
565
529566/***************************************************************************
530567    COMMON PALETTE INITIALIZATION
531568***************************************************************************/
src/emu/video/generic.h
r1771r1772
6363extern UINT16 *paletteram16_2;
6464
6565extern mame_bitmap *tmpbitmap;
66extern int flip_screen_x, flip_screen_y;
6766
6867
6968
r1771r1772
9190/* set up all the common systems */
9291void generic_video_init(running_machine *machine);
9392
94/* generic video start */
95VIDEO_START( generic );
96
9793/* generic video start with a temporary bitmap */
9894VIDEO_START( generic_bitmapped );
9995
r1771r1772
122118
123119/* set global attributes */
124120void flip_screen_set(int on);
121void flip_screen_set_no_update(int on);    /* will not call update_flip */
125122void flip_screen_x_set(int on);
126123void flip_screen_y_set(int on);
127#define flip_screen flip_screen_x
124int flip_screen_get(void);
125int flip_screen_x_get(void);
126int flip_screen_y_get(void);
128127
128//#define flip_screen flip_screen_get()
129129
130130
131
131132/* ----- generic palette init routines ----- */
132133
133134PALETTE_INIT( black_and_white );
src/emu/video/s2636.c
r1771r1772
128128   s2636->y_offset = y_offset;
129129   s2636->x_offset = x_offset;
130130
131   s2636->bitmap = auto_bitmap_alloc(screen_width, screen_height, BITMAP_FORMAT_INDEXED8);
132   s2636->collision_bitmap = auto_bitmap_alloc(screen_width, screen_height, BITMAP_FORMAT_INDEXED8);
131   s2636->bitmap = auto_bitmap_alloc(screen_width, screen_height, BITMAP_FORMAT_INDEXED16);
132   s2636->collision_bitmap = auto_bitmap_alloc(screen_width, screen_height, BITMAP_FORMAT_INDEXED16);
133133
134134   return s2636;
135135}
r1771r1772
180180                  continue;
181181
182182               if (or_mode)
183                  *BITMAP_ADDR8(bitmap, ty, tx) = 0x08 | *BITMAP_ADDR8(bitmap, ty, tx) | color;
183                  *BITMAP_ADDR16(bitmap, ty, tx) = 0x08 | *BITMAP_ADDR16(bitmap, ty, tx) | color;
184184               else
185                  *BITMAP_ADDR8(bitmap, ty, tx) = 0x08 | color;
185                  *BITMAP_ADDR16(bitmap, ty, tx) = 0x08 | color;
186186            }
187187         }
188188      }
r1771r1772
233233               (y > cliprect->max_y))
234234               continue;
235235
236            checksum = checksum + *BITMAP_ADDR8(s2636->collision_bitmap, y, x);
236            checksum = checksum + *BITMAP_ADDR16(s2636->collision_bitmap, y, x);
237237         }
238238
239239      /* black out second sprite */
r1771r1772
249249               (y > cliprect->max_y))
250250               continue;
251251
252            checksum = checksum - *BITMAP_ADDR8(s2636->collision_bitmap, y, x);
252            checksum = checksum - *BITMAP_ADDR16(s2636->collision_bitmap, y, x);
253253         }
254254   }
255255
src/emu/video/mc6845.c
r1771r1772
3939   UINT8   horiz_total;
4040   UINT8   horiz_disp;
4141   UINT8   horiz_sync_pos;
42   UINT8   sync_width;
42   UINT8   horiz_sync_width;
4343   UINT8   vert_total;
4444   UINT8   vert_total_adj;
4545   UINT8   vert_disp;
r1771r1772
4949   UINT8   cursor_start_ras;
5050   UINT8   cursor_end_ras;
5151   UINT16   start_addr;
52   UINT16   cursor;
53   UINT16   light_pen;
52   UINT16   cursor_addr;
53   UINT16   light_pen_addr;
5454
55   emu_timer *display_enable_changed_timer;
55   emu_timer *de_changed_timer;
56   emu_timer *hsync_on_timer;
57   emu_timer *hsync_off_timer;
58   emu_timer *vsync_on_timer;
59   emu_timer *vsync_off_timer;
60   UINT8   cursor_state;   /* 0 = off, 1 = on */
61   UINT8   cursor_blink_count;
5662
5763   /* saved screen parameters so we don't call
5864       video_screen_configure() unneccessarily.
r1771r1772
6167   UINT16   last_vert_total;
6268   UINT16   last_max_x;
6369   UINT16   last_max_y;
70   UINT16   last_hsync_on_pos;
71   UINT16   last_hsync_off_pos;
72   UINT16   last_vsync_on_pos;
73   UINT16   last_vsync_off_pos;
6474   UINT16  current_ma;      /* the MA address currently drawn */
6575   int      has_valid_parameters;
6676};
r1771r1772
6878
6979static void mc6845_state_save_postload(void *param);
7080static void configure_screen(mc6845_t *mc6845, int postload);
71static void update_timer(mc6845_t *mc6845);
72static TIMER_CALLBACK( display_enable_changed_timer_cb );
81static void update_de_changed_timer(mc6845_t *mc6845);
82static void update_hsync_changed_timers(mc6845_t *mc6845);
83static void update_vsync_changed_timers(mc6845_t *mc6845);
84static TIMER_CALLBACK( de_changed_timer_cb );
85static TIMER_CALLBACK( vsync_on_timer_cb );
86static TIMER_CALLBACK( vsync_off_timer_cb );
87static TIMER_CALLBACK( hsync_on_timer_cb );
88static TIMER_CALLBACK( hsync_off_timer_cb );
7389
7490
7591static void mc6845_state_save_postload(void *param)
r1771r1772
8298
8399void mc6845_address_w(mc6845_t *mc6845, UINT8 data)
84100{
101   assert(mc6845 != NULL);
102
85103   mc6845->address_latch = data & 0x1f;
86104}
87105
r1771r1772
90108{
91109   UINT8 ret = 0;
92110
111   assert(mc6845 != NULL);
112
93113   switch (mc6845->address_latch)
94114   {
95      case 12:
96         /* Motorola version only */
97         ret = mc6845->start_addr >> 8;
98         break;
99      case 13:
100         /* Motorola version only */
101         ret = mc6845->start_addr;
102         break;
103      case 14:
104         ret = mc6845->cursor >> 8;
105         break;
106      case 15:
107         ret = mc6845->cursor;
108         break;
109      case 16:
110         ret = mc6845->light_pen >> 8;
111         break;
112      case 17:
113         ret = mc6845->light_pen;
114         break;
115      default:
116         /* all other registers are write only */
117         break;
115      /* 0x0c and 0x0d - Motorola device only */
116      case 0x0c:  ret = (mc6845->start_addr     >> 8) & 0xff; break;
117      case 0x0d:  ret = (mc6845->start_addr     >> 0) & 0xff; break;
118      case 0x0e:  ret = (mc6845->cursor_addr    >> 8) & 0xff; break;
119      case 0x0f:  ret = (mc6845->cursor_addr    >> 0) & 0xff; break;
120      case 0x10:  ret = (mc6845->light_pen_addr >> 8) & 0xff; break;
121      case 0x11:  ret = (mc6845->light_pen_addr >> 0) & 0xff; break;
122
123      /* all other registers are write only and return 0 */
124      default: break;
118125   }
119126
120127   return ret;
r1771r1772
123130
124131void mc6845_register_w(mc6845_t *mc6845, UINT8 data)
125132{
126   int call_configure_screen = FALSE;
127133   if (LOG)  logerror("M6845 PC %04x: reg 0x%02x = 0x%02x\n", activecpu_get_pc(), mc6845->address_latch, data);
128134
135   assert(mc6845 != NULL);
136
129137   switch (mc6845->address_latch)
130138   {
131      case 0:
132         mc6845->horiz_total = data;
133         call_configure_screen = TRUE;
134         break;
135      case 1:
136         mc6845->horiz_disp = data;
137         call_configure_screen = TRUE;
138         break;
139      case 2:
140         mc6845->horiz_sync_pos = data;
141         break;
142      case 3:
143         mc6845->sync_width = data & 0x0f;
144         break;
145      case 4:
146         mc6845->vert_total = data & 0x7f;
147         call_configure_screen = TRUE;
148         break;
149      case 5:
150         mc6845->vert_total_adj = data & 0x1f;
151         call_configure_screen = TRUE;
152         break;
153      case 6:
154         mc6845->vert_disp = data & 0x7f;
155         call_configure_screen = TRUE;
156         break;
157      case 7:
158         mc6845->vert_sync_pos = data & 0x7f;
159         break;
160      case 8:
161         mc6845->intl_skew = data & 0x03;
162         break;
163      case 9:
164         mc6845->max_ras_addr = data & 0x1f;
165         call_configure_screen = TRUE;
166         break;
167      case 10:
168         mc6845->cursor_start_ras = data & 0x7f;
169         break;
170      case 11:
171         mc6845->cursor_end_ras = data & 0x1f;
172         break;
173      case 12:
174         mc6845->start_addr &= 0x00ff;
175         mc6845->start_addr |= (data & 0x3f) << 8;
176         call_configure_screen = TRUE;
177         break;
178      case 13:
179         mc6845->start_addr &= 0xff00;
180         mc6845->start_addr |= data;
181         call_configure_screen = TRUE;
182         break;
183      case 14:
184         mc6845->cursor &= 0x00ff;
185         mc6845->cursor |= (data & 0x3f) << 8;
186         break;
187      case 15:
188         mc6845->cursor &= 0xff00;
189         mc6845->cursor |= data;
190         break;
191      case 16:   /* read-only */
192         break;
193      case 17:   /* read-only */
194         break;
195      default:
196         break;
139      case 0x00:  mc6845->horiz_total      =   data & 0xff; break;
140      case 0x01:  mc6845->horiz_disp       =   data & 0xff; break;
141      case 0x02:  mc6845->horiz_sync_pos   =   data & 0xff; break;
142      case 0x03:  mc6845->horiz_sync_width =   data & 0x0f; break;
143      case 0x04:  mc6845->vert_total       =   data & 0x7f; break;
144      case 0x05:  mc6845->vert_total_adj   =   data & 0x1f; break;
145      case 0x06:  mc6845->vert_disp        =   data & 0x7f; break;
146      case 0x07:  mc6845->vert_sync_pos    =   data & 0x7f; break;
147      case 0x08:  mc6845->intl_skew        =   data & 0x03; break;
148      case 0x09:  mc6845->max_ras_addr     =   data & 0x1f; break;
149      case 0x0a:  mc6845->cursor_start_ras =   data & 0x7f; break;
150      case 0x0b:  mc6845->cursor_end_ras   =   data & 0x1f; break;
151      case 0x0c:  mc6845->start_addr       = ((data & 0x3f) << 8) | (mc6845->start_addr & 0x00ff); break;
152      case 0x0d:  mc6845->start_addr       = ((data & 0xff) << 0) | (mc6845->start_addr & 0xff00); break;
153      case 0x0e:  mc6845->cursor_addr      = ((data & 0x3f) << 8) | (mc6845->cursor_addr & 0x00ff); break;
154      case 0x0f:  mc6845->cursor_addr      = ((data & 0xff) << 0) | (mc6845->cursor_addr & 0xff00); break;
155      case 0x10: /* read-only */ break;
156      case 0x11: /* read-only */ break;
157      default: break;
197158   }
198159
199   if (call_configure_screen)
200      configure_screen(mc6845, FALSE);
160   configure_screen(mc6845, FALSE);
201161}
202162
203163
r1771r1772
213173      UINT16 max_x = mc6845->horiz_disp * mc6845->intf->hpixels_per_column - 1;
214174      UINT16 max_y = mc6845->vert_disp * (mc6845->max_ras_addr + 1) - 1;
215175
176      /* determine the syncing positions */
177      UINT16 hsync_on_pos = mc6845->horiz_sync_pos * mc6845->intf->hpixels_per_column;
178      UINT16 hsync_off_pos = hsync_on_pos + (mc6845->horiz_sync_width * mc6845->intf->hpixels_per_column);
179      UINT16 vsync_on_pos = mc6845->vert_sync_pos * (mc6845->max_ras_addr + 1);
180      UINT16 vsync_off_pos = vsync_on_pos + 0x10;   /* this is a constant -- non-programmable */
181
216182      /* update only if screen parameters changed, unless we are coming here after loading the saved state */
217183      if (postload ||
218184          (horiz_total != mc6845->last_horiz_total) || (vert_total != mc6845->last_vert_total) ||
219         (max_x != mc6845->last_max_x) || (max_y != mc6845->last_max_y))
185         (max_x != mc6845->last_max_x) || (max_y != mc6845->last_max_y) ||
186         (hsync_on_pos != mc6845->last_hsync_on_pos) || (vsync_on_pos != mc6845->last_vsync_on_pos) ||
187         (hsync_off_pos != mc6845->last_hsync_off_pos) || (vsync_off_pos != mc6845->last_vsync_off_pos))
220188      {
221         /* update the screen only if we have valid data */
222         if ((mc6845->horiz_total > 0) && (max_x < horiz_total) && (mc6845->vert_total > 0) && (max_y < vert_total))
189         /* update the screen if we have valid data */
190         if ((horiz_total > 0) && (max_x < horiz_total) &&
191            (vert_total > 0) && (max_y < vert_total) &&
192            (hsync_off_pos <= horiz_total) && (vsync_off_pos <= vert_total) &&
193            (hsync_on_pos != hsync_off_pos))
223194         {
224195            rectangle visarea;
225196
r1771r1772
230201            visarea.max_x = max_x;
231202            visarea.max_y = max_y;
232203
233            if (LOG) logerror("M6845 config screen: HTOTAL: %x  VTOTAL: %x  MAX_X: %x  MAX_Y: %x  FPS: %f\n",
234                          horiz_total, vert_total, max_x, max_y, 1 / ATTOSECONDS_TO_DOUBLE(refresh));
204            if (LOG) logerror("M6845 config screen: HTOTAL: 0x%x  VTOTAL: 0x%x  MAX_X: 0x%x  MAX_Y: 0x%x  HSYNC: 0x%x-0x%x  VSYNC: 0x%x-0x%x  Freq: %ffps\n",
205                          horiz_total, vert_total, max_x, max_y, hsync_on_pos, hsync_off_pos - 1, vsync_on_pos, vsync_off_pos - 1, 1 / ATTOSECONDS_TO_DOUBLE(refresh));
235206
236207            video_screen_configure(mc6845->intf->scrnum, horiz_total, vert_total, &visarea, refresh);
237208
r1771r1772
244215         mc6845->last_vert_total = vert_total;
245216         mc6845->last_max_x = max_x;
246217         mc6845->last_max_y = max_y;
218         mc6845->last_hsync_on_pos = hsync_on_pos;
219         mc6845->last_hsync_off_pos = hsync_off_pos;
220         mc6845->last_vsync_on_pos = vsync_on_pos;
221         mc6845->last_vsync_off_pos = vsync_off_pos;
247222
248         update_timer(mc6845);
223         update_de_changed_timer(mc6845);
224         update_hsync_changed_timers(mc6845);
225         update_vsync_changed_timers(mc6845);
249226      }
250227   }
251228}
r1771r1772
260237}
261238
262239
263static void update_timer(mc6845_t *mc6845)
240static void update_de_changed_timer(mc6845_t *mc6845)
264241{
265   INT16 next_y;
266   UINT16 next_x;
267   attotime duration;
242   if (mc6845->has_valid_parameters && (mc6845->de_changed_timer != NULL))
243   {
244      INT16 next_y;
245      UINT16 next_x;
246      attotime duration;
268247
269   if (mc6845->has_valid_parameters && (mc6845->display_enable_changed_timer != 0))
270   {
248      /* we are in a display region, get the location of the next blanking start */
271249      if (is_display_enabled(mc6845))
272250      {
273         /* we are in a display region,
274               get the location of the next blanking start */
275
276251         /* normally, it's at end the current raster line */
277252         next_y = video_screen_get_vpos(mc6845->intf->scrnum);
278253         next_x = mc6845->last_max_x + 1;
r1771r1772
289264               next_y = -1;
290265         }
291266      }
267
268      /* we are in a blanking region, get the location of the next display start */
292269      else
293270      {
294         /* we are in a blanking region,
295               get the location of the next display start */
296271         next_x = 0;
297272         next_y = (video_screen_get_vpos(mc6845->intf->scrnum) + 1) % mc6845->last_vert_total;
298273
r1771r1772
307282      else
308283         duration = attotime_never;
309284
310      timer_adjust_oneshot(mc6845->display_enable_changed_timer, duration, 0);
285      timer_adjust_oneshot(mc6845->de_changed_timer, duration, 0);
311286   }
312287}
313288
314289
315static TIMER_CALLBACK( display_enable_changed_timer_cb )
290static void update_hsync_changed_timers(mc6845_t *mc6845)
316291{
292   if (mc6845->has_valid_parameters && (mc6845->hsync_on_timer != NULL))
293   {
294      UINT16 next_y;
295
296      /* we are before the HSYNC position, we trigger on the current line */
297      if (video_screen_get_hpos(mc6845->intf->scrnum) < mc6845->last_hsync_on_pos)
298         next_y = video_screen_get_vpos(mc6845->intf->scrnum);
299
300      /* trigger on the next line */
301      else
302         next_y = (video_screen_get_vpos(mc6845->intf->scrnum) + 1) % mc6845->last_vert_total;
303
304      /* if the next line is not in the visible region, go to the beginning of the screen */
305      if (next_y > mc6845->last_max_y)
306         next_y = 0;
307
308      timer_adjust_oneshot(mc6845->hsync_on_timer,  video_screen_get_time_until_pos(mc6845->intf->scrnum, next_y, mc6845->last_hsync_on_pos) , 0);
309      timer_adjust_oneshot(mc6845->hsync_off_timer, video_screen_get_time_until_pos(mc6845->intf->scrnum, next_y, mc6845->last_hsync_off_pos), 0);
310   }
311}
312
313
314static void update_vsync_changed_timers(mc6845_t *mc6845)
315{
316   if (mc6845->has_valid_parameters && (mc6845->vsync_on_timer != NULL))
317   {
318      timer_adjust_oneshot(mc6845->vsync_on_timer,  video_screen_get_time_until_pos(mc6845->intf->scrnum, mc6845->last_vsync_on_pos,  0), 0);
319      timer_adjust_oneshot(mc6845->vsync_off_timer, video_screen_get_time_until_pos(mc6845->intf->scrnum, mc6845->last_vsync_off_pos, 0), 0);
320   }
321}
322
323
324static TIMER_CALLBACK( de_changed_timer_cb )
325{
317326   mc6845_t *mc6845 = ptr;
318327
319328   /* call the callback function -- we know it exists */
320   mc6845->intf->display_enable_changed(mc6845->machine, mc6845, is_display_enabled(mc6845));
329   mc6845->intf->on_de_changed(mc6845->machine, mc6845, is_display_enabled(mc6845));
321330
322   update_timer(mc6845);
331   update_de_changed_timer(mc6845);
323332}
324333
325334
326UINT16 mc6845_get_ma(mc6845_t *mc6845)
335static TIMER_CALLBACK( vsync_on_timer_cb )
327336{
337   mc6845_t *mc6845 = ptr;
338
339   /* call the callback function -- we know it exists */
340   mc6845->intf->on_vsync_changed(mc6845->machine, mc6845, TRUE);
341}
342
343
344static TIMER_CALLBACK( vsync_off_timer_cb )
345{
346   mc6845_t *mc6845 = ptr;
347
348   /* call the callback function -- we know it exists */
349   mc6845->intf->on_vsync_changed(mc6845->machine, mc6845, FALSE);
350
351   update_vsync_changed_timers(mc6845);
352}
353
354
355static TIMER_CALLBACK( hsync_on_timer_cb )
356{
357   mc6845_t *mc6845 = ptr;
358
359   /* call the callback function -- we know it exists */
360   mc6845->intf->on_hsync_changed(mc6845->machine, mc6845, TRUE);
361}
362
363
364static TIMER_CALLBACK( hsync_off_timer_cb )
365{
366   mc6845_t *mc6845 = ptr;
367
368   /* call the callback function -- we know it exists */
369   mc6845->intf->on_hsync_changed(mc6845->machine, mc6845, FALSE);
370
371   update_hsync_changed_timers(mc6845);
372}
373
374
375
376static UINT16 get_ma_for_yx(mc6845_t *mc6845, int y, int x)
377{
328378   UINT16 ret;
329379
330380   if (mc6845->has_valid_parameters)
331381   {
332      /* get the current raster positions and clamp them to the visible region */
333      int y = video_screen_get_vpos(0);
334      int x = video_screen_get_hpos(0);
382      /* clamp Y/X to the visible region */
335383
336384      /* since the MA counter stops in the blanking regions, if we are in a
337385           VBLANK, both X and Y are at their max */
r1771r1772
342390         y = mc6845->last_max_y;
343391
344392      ret = (mc6845->start_addr +
345            (y / (mc6845->max_ras_addr + 1)) * mc6845->horiz_disp +
346            (x / mc6845->intf->hpixels_per_column)) & 0x3fff;
393           (y / (mc6845->max_ras_addr + 1)) * mc6845->horiz_disp +
394           (x / mc6845->intf->hpixels_per_column)) & 0x3fff;
347395   }
348396   else
349397      ret = 0;
r1771r1772
352400}
353401
354402
403UINT16 mc6845_get_ma(mc6845_t *mc6845)
404{
405   UINT16 ret;
406
407   assert(mc6845 != NULL);
408
409   if (mc6845->has_valid_parameters)
410   {
411      int y = video_screen_get_vpos(mc6845->intf->scrnum);
412      int x = video_screen_get_hpos(mc6845->intf->scrnum);
413
414      ret = get_ma_for_yx(mc6845, y, x);
415   }
416   else
417      ret = 0;
418
419   return ret;
420}
421
422
355423UINT8 mc6845_get_ra(mc6845_t *mc6845)
356424{
357425   UINT8 ret;
358426
427   assert(mc6845 != NULL);
428
359429   if (mc6845->has_valid_parameters)
360430   {
361431      /* get the current vertical raster position and clamp it to the visible region */
362      int y = video_screen_get_vpos(0);
432      int y = video_screen_get_vpos(mc6845->intf->scrnum);
363433
364434      if (y > mc6845->last_max_y)
365435         y = mc6845->last_max_y;
r1771r1772
373443}
374444
375445
446void mc6845_assert_light_pen_input(mc6845_t *mc6845)
447{
448   int y, x;
449
450   assert(mc6845 != NULL);
451
452   /* the light pen address register gets latched on the NEXT display address change */
453   y = video_screen_get_vpos(mc6845->intf->scrnum);
454   x = video_screen_get_hpos(mc6845->intf->scrnum) + mc6845->intf->hpixels_per_column;
455
456   mc6845->light_pen_addr = get_ma_for_yx(mc6845, y, x);
457}
458
459
460static void update_cursor_state(mc6845_t *mc6845)
461{
462   /* save and increment cursor counter */
463   UINT8 last_cursor_blink_count = mc6845->cursor_blink_count;
464   mc6845->cursor_blink_count = mc6845->cursor_blink_count + 1;
465
466   /* switch on cursor blinking mode */
467   switch (mc6845->cursor_start_ras & 0x60)
468   {
469      /* always on */
470      case 0x00: mc6845->cursor_state = TRUE; break;
471
472      /* always off */
473      default:
474      case 0x20: mc6845->cursor_state = FALSE; break;
475
476      /* fast blink */
477      case 0x40:
478         if ((last_cursor_blink_count & 0x10) != (mc6845->cursor_blink_count & 0x10))
479            mc6845->cursor_state = !mc6845->cursor_state;
480         break;
481
482      /* slow blink */
483      case 0x60:
484         if ((last_cursor_blink_count & 0x20) != (mc6845->cursor_blink_count & 0x20))
485            mc6845->cursor_state = !mc6845->cursor_state;
486         break;
487   }
488}
489
490
376491void mc6845_update(mc6845_t *mc6845, mame_bitmap *bitmap, const rectangle *cliprect)
377492{
378493   if (mc6845->has_valid_parameters)
r1771r1772
380495      UINT16 y;
381496
382497      /* call the set up function if any */
383      void *param = 0;
498      void *param = NULL;
384499
385500      if (mc6845->intf->begin_update)
386501         param = mc6845->intf->begin_update(mc6845->machine, mc6845, bitmap, cliprect);
387502
388      /* read the start address at the beginning of the frame */
389503      if (cliprect->min_y == 0)
504      {
505         /* read the start address at the beginning of the frame */
390506         mc6845->current_ma = mc6845->start_addr;
391507
508         /* also update the cursor state now */
509         update_cursor_state(mc6845);
510      }
511
392512      /* for each row in the visible region */
393513      for (y = cliprect->min_y; y <= cliprect->max_y; y++)
394514      {
515         /* compute the current raster line */
395516         UINT8 ra = y % (mc6845->max_ras_addr + 1);
396517
518         /* check if the cursor is visible and is on this scanline */
519         int cursor_visible = mc6845->cursor_state &&
520                         (ra >= (mc6845->cursor_start_ras & 0x1f)) &&
521                         (ra <= mc6845->cursor_end_ras) &&
522                         (mc6845->cursor_addr >= mc6845->current_ma) &&
523                         (mc6845->cursor_addr < (mc6845->current_ma + mc6845->horiz_disp));
524
525         /* compute the cursor X position, or -1 if not visible */
526         INT8 cursor_x = cursor_visible ? (mc6845->cursor_addr - mc6845->current_ma) : -1;
527
397528         /* call the external system to draw it */
398         mc6845->intf->update_row(mc6845->machine, mc6845, bitmap, cliprect, mc6845->current_ma, ra, y, mc6845->horiz_disp, param);
529         mc6845->intf->update_row(mc6845->machine, mc6845, bitmap, cliprect, mc6845->current_ma, ra, y, mc6845->horiz_disp, cursor_x, param);
399530
400531         /* update MA if the last raster address */
401532         if (ra == mc6845->max_ras_addr)
r1771r1772
405536      /* call the tear down function if any */
406537      if (mc6845->intf->end_update)
407538         mc6845->intf->end_update(mc6845->machine, mc6845, bitmap, cliprect, param);
539
540      popmessage(NULL);
408541   }
542   else
543      popmessage("Invalid MC6845 screen parameters - display disabed!!!");
409544}
410545
411546
r1771r1772
427562   mc6845->machine = machine;
428563   mc6845->intf = static_config;
429564
430   /* create the timer if the user is interested in getting display enable
431       notifications */
432   if (mc6845->intf && mc6845->intf->display_enable_changed)
433      mc6845->display_enable_changed_timer = timer_alloc(display_enable_changed_timer_cb, mc6845);
565   /* create the timers for the various pin notifications */
566   if (mc6845->intf)
567   {
568      if (mc6845->intf->on_de_changed)
569         mc6845->de_changed_timer = timer_alloc(de_changed_timer_cb, mc6845);
434570
571      if (mc6845->intf->on_hsync_changed)
572      {
573         mc6845->hsync_on_timer = timer_alloc(hsync_on_timer_cb, mc6845);
574         mc6845->hsync_off_timer = timer_alloc(hsync_off_timer_cb, mc6845);
575      }
576
577      if (mc6845->intf->on_vsync_changed)
578      {
579         mc6845->vsync_on_timer = timer_alloc(vsync_on_timer_cb, mc6845);
580         mc6845->vsync_off_timer = timer_alloc(vsync_off_timer_cb, mc6845);
581      }
582   }
583
435584   /* register for state saving */
436585   state_save_combine_module_and_tag(unique_tag, "mc6845", tag);
437586
r1771r1772
441590   state_save_register_item(unique_tag, 0, mc6845->horiz_total);
442591   state_save_register_item(unique_tag, 0, mc6845->horiz_disp);
443592   state_save_register_item(unique_tag, 0, mc6845->horiz_sync_pos);
444   state_save_register_item(unique_tag, 0, mc6845->sync_width);
593   state_save_register_item(unique_tag, 0, mc6845->horiz_sync_width);
445594   state_save_register_item(unique_tag, 0, mc6845->vert_total);
446595   state_save_register_item(unique_tag, 0, mc6845->vert_total_adj);
447596   state_save_register_item(unique_tag, 0, mc6845->vert_disp);
r1771r1772
451600   state_save_register_item(unique_tag, 0, mc6845->cursor_start_ras);
452601   state_save_register_item(unique_tag, 0, mc6845->cursor_end_ras);
453602   state_save_register_item(unique_tag, 0, mc6845->start_addr);
454   state_save_register_item(unique_tag, 0, mc6845->cursor);
455   state_save_register_item(unique_tag, 0, mc6845->light_pen);
603   state_save_register_item(unique_tag, 0, mc6845->cursor_addr);
604   state_save_register_item(unique_tag, 0, mc6845->light_pen_addr);
605   state_save_register_item(unique_tag, 0, mc6845->cursor_state);
606   state_save_register_item(unique_tag, 0, mc6845->cursor_blink_count);
456607
457608   return mc6845;
458609}
r1771r1772
483634      /* --- the following bits of info are returned as NULL-terminated strings --- */
484635      case DEVINFO_STR_NAME:                     info->s = "MC6845";                  break;
485636      case DEVINFO_STR_FAMILY:                  info->s = "MC6845 CRTC";            break;
486      case DEVINFO_STR_VERSION:                  info->s = "1.0";                  break;
637      case DEVINFO_STR_VERSION:                  info->s = "1.5";                  break;
487638      case DEVINFO_STR_SOURCE_FILE:               info->s = __FILE__;                  break;
488639      case DEVINFO_STR_CREDITS:                  info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
489640   }
490641}
642
643
644void r6545_get_info(running_machine *machine, void *token, UINT32 state, deviceinfo *info)
645{
646   switch (state)
647   {
648      /* --- the following bits of info are returned as NULL-terminated strings --- */
649      case DEVINFO_STR_NAME:                     info->s = "R6545";                  break;
650      default: mc6845_get_info(machine, token, state, info);                           break;
651   }
652}
src/emu/video/s2636.h
r1771r1772
1616
1717s2636_t *s2636_config(UINT8 *work_ram, int screen_height, int screen_width, int y_offset, int x_offset);
1818
19/* returns a BITMAP_FORMAT_INDEXED8 bitmap the size of the screen
19/* returns a BITMAP_FORMAT_INDEXED16 bitmap the size of the screen
2020   D0-D2 of each pixel is the pixel color
2121   D3 indicates whether the S2636 drew this pixel - 0 = not drawn, 1 = drawn */
2222mame_bitmap *s2636_update(s2636_t *s2636, const rectangle *cliprect);
src/emu/video/mc6845.h
r1771r1772
55    Copyright Nicola Salmoria and the MAME Team.
66    Visit http://mamedev.org for licensing and usage restrictions.
77
8    The following variations exist that are different in
9    functionality and not just in speed rating(1):
10        * Motorola 6845, 6845-1
11        * Hitachi 46505
12        * Rockwell 6545, 6545-1 (= Synertek SY6545-1)
13        * Commodore 6545-1
14
15    (1) as per the document at
16    http://www.6502.org/users/andre/hwinfo/crtc/diffs.html
17
188**********************************************************************/
199
2010#ifndef __MC6845__
r1771r1772
2515typedef struct _mc6845_interface mc6845_interface;
2616
2717#define MC6845 mc6845_get_info
18#define R6545 r6545_get_info
2819
2920
21/* callback definitions */
22typedef void * (*mc6845_begin_update_func)(running_machine *machine, mc6845_t *mc6845, mame_bitmap *bitmap, const rectangle *cliprect);
23#define MC6845_BEGIN_UPDATE(name)   void *name(running_machine *machine, mc6845_t *mc6845, mame_bitmap *bitmap, const rectangle *cliprect)
24
25typedef void (*mc6845_update_row_func)(running_machine *machine, mc6845_t *mc6845, mame_bitmap *bitmap,
26                                 const rectangle *cliprect, UINT16 ma, UINT8 ra,
27                                 UINT16 y, UINT8 x_count, INT8 cursor_x, void *param);
28#define MC6845_UPDATE_ROW(name)      void name(running_machine *machine, mc6845_t *mc6845, mame_bitmap *bitmap,   \
29                                      const rectangle *cliprect, UINT16 ma, UINT8 ra,               \
30                                      UINT16 y, UINT8 x_count, INT8 cursor_x, void *param)
31
32typedef void (*mc6845_end_update_func)(running_machine *machine, mc6845_t *mc6845,
33                                 mame_bitmap *bitmap, const rectangle *cliprect, void *param);
34#define MC6845_END_UPDATE(name)      void name(running_machine *machine, mc6845_t *mc6845,                  \
35                                      mame_bitmap *bitmap, const rectangle *cliprect, void *param)
36
37typedef void (*mc6845_on_de_changed_func)(running_machine *machine, mc6845_t *mc6845, int display_enabled);
38#define MC6845_ON_DE_CHANGED(name)   void name(running_machine *machine, mc6845_t *mc6845, int display_enabled)
39
40typedef void (*mc6845_on_hsync_changed_func)(running_machine *machine, mc6845_t *mc6845, int hsync);
41#define MC6845_ON_HSYNC_CHANGED(name)   void name(running_machine *machine, mc6845_t *mc6845, int hsync)
42
43typedef void (*mc6845_on_vsync_changed_func)(running_machine *machine, mc6845_t *mc6845, int vsync);
44#define MC6845_ON_VSYNC_CHANGED(name)   void name(running_machine *machine, mc6845_t *mc6845, int vsync)
45
46
47/* interface */
3048struct _mc6845_interface
3149{
3250   int scrnum;               /* screen we are acting on */
r1771r1772
3654   /* if specified, this gets called before any pixel update,
3755       optionally return a pointer that will be passed to the
3856       update and tear down callbacks */
39   void * (*begin_update)(running_machine *machine, mc6845_t *mc6845,
40                     mame_bitmap *bitmap, const rectangle *cliprect);
57   mc6845_begin_update_func      begin_update;
4158
4259   /* this gets called for every row, the driver must output
43       x_count * hpixels_per_column pixels */
44   void (*update_row)(running_machine *machine, mc6845_t *mc6845, mame_bitmap *bitmap,
45                  const rectangle *cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, void *param);
60       x_count * hpixels_per_column pixels.
61       cursor_x indicates the character position where the cursor is, or -1
62       if there is no cursor on this row */
63   mc6845_update_row_func         update_row;
4664
4765   /* if specified, this gets called after all row updating is complete */
48   void (*end_update)(running_machine *machine, mc6845_t *mc6845,
49                  mame_bitmap *bitmap, const rectangle *cliprect, void *param);
66   mc6845_end_update_func         end_update;
5067
51   /* if specified, this gets called for every change of the disply enable (DT pin 18) */
52   void (*display_enable_changed)(running_machine *machine, mc6845_t *mc6845, int display_enabled);
68   /* if specified, this gets called for every change of the disply enable pin (pin 18) */
69   mc6845_on_de_changed_func      on_de_changed;
70
71   /* if specified, this gets called for every change of the HSYNC pin (pin 39) */
72   mc6845_on_hsync_changed_func   on_hsync_changed;
73
74   /* if specified, this gets called for every change of the VSYNC pin (pin 40) */
75   mc6845_on_vsync_changed_func   on_vsync_changed;
5376};
5477
5578
5679/* device interface */
5780void mc6845_get_info(running_machine *machine, void *token, UINT32 state, deviceinfo *info);
81void r6545_get_info(running_machine *machine, void *token, UINT32 state, deviceinfo *info);
5882
5983/* select one of the registers for reading or writing */
6084void mc6845_address_w(mc6845_t *mc6845, UINT8 data);
r1771r1772
7195/* return the current value on the RA0-RA4 pins */
7296UINT8 mc6845_get_ra(mc6845_t *mc6845);
7397
98/* simulates the LO->HI clocking of the light pen pin (pin 3) */
99void mc6845_assert_light_pen_input(mc6845_t *mc6845);
100
74101/* updates the screen -- this will call begin_update(),
75102   followed by update_row() reapeatedly and after all row
76103   updating is complete, end_update() */
src/emu/info.c
r1771r1772
732732      {
733733         int dx = scrconfig->defstate.visarea.max_x - scrconfig->defstate.visarea.min_x + 1;
734734         int dy = scrconfig->defstate.visarea.max_y - scrconfig->defstate.visarea.min_y + 1;
735
735736         fprintf(out, " width=\"%d\"", dx);
736737         fprintf(out, " height=\"%d\"", dy);
737738      }
738739
739740      /* output refresh rate */
740741      fprintf(out, " refresh=\"%f\"", ATTOSECONDS_TO_HZ(scrconfig->defstate.refresh));
742
743      /* output raw video parameters only for games that are not vector */
744      /* and had raw parameters specified                               */
745      if ((scrconfig->type != SCREEN_TYPE_VECTOR) && !scrconfig->defstate.oldstyle_vblank_supplied)
746      {
747         int pixclock = scrconfig->defstate.width * scrconfig->defstate.height
748                       * ATTOSECONDS_TO_HZ(scrconfig->defstate.refresh);
749
750         fprintf(out, " pixclock=\"%d\"", pixclock);
751         fprintf(out, " htotal=\"%d\"", scrconfig->defstate.width);
752         fprintf(out, " hbend=\"%d\"", scrconfig->defstate.visarea.min_x);
753         fprintf(out, " hbstart=\"%d\"", scrconfig->defstate.visarea.max_x+1);
754         fprintf(out, " vtotal=\"%d\"", scrconfig->defstate.height);
755         fprintf(out, " vbend=\"%d\"", scrconfig->defstate.visarea.min_y);
756         fprintf(out, " vbstart=\"%d\"", scrconfig->defstate.visarea.max_y+1);
757      }
741758      fprintf(out, " />\n");
742759   }
743760}
r1771r1772
750767
751768static void print_game_sound(FILE *out, const game_driver *game, const machine_config *config)
752769{
770   int speakers = speaker_output_count(config);
753771   int has_sound = FALSE;
754   int speakers = 0;
755772   int sndnum;
756773
757774   /* see if we have any sound chips to report */
r1771r1772
763780      }
764781
765782   /* if we have sound, count the number of speakers */
766   if (has_sound)
767      for (speakers = 0; speakers < ARRAY_LENGTH(config->speaker); speakers++)
768         if (config->speaker[speakers].tag == NULL)
769            break;
783   if (!has_sound)
784      speakers = 0;
770785
771786   fprintf(out, "\t\t<sound channels=\"%d\"/>\n", speakers);
772787}
r1771r1772
854869
855870   /* start tracking resources and allocate the machine and input configs */
856871   begin_resource_tracking();
857   config = machine_config_alloc(game->drv);
872   config = machine_config_alloc(game->machine_config);
858873   input = input_port_allocate(game->ipt, NULL);
859874
860875   /* print the header and the game name */
r1771r1772
9891004      "\t\t\t<!ATTLIST display width CDATA #IMPLIED>\n"
9901005      "\t\t\t<!ATTLIST display height CDATA #IMPLIED>\n"
9911006      "\t\t\t<!ATTLIST display refresh CDATA #REQUIRED>\n"
1007      "\t\t\t<!ATTLIST display pixclock CDATA #IMPLIED>\n"
1008      "\t\t\t<!ATTLIST display htotal CDATA #IMPLIED>\n"
1009      "\t\t\t<!ATTLIST display hbend CDATA #IMPLIED>\n"
1010      "\t\t\t<!ATTLIST display hbstart CDATA #IMPLIED>\n"
1011      "\t\t\t<!ATTLIST display vtotal CDATA #IMPLIED>\n"
1012      "\t\t\t<!ATTLIST display vbend CDATA #IMPLIED>\n"
1013      "\t\t\t<!ATTLIST display vbstart CDATA #IMPLIED>\n"
9921014      "\t\t<!ELEMENT sound EMPTY>\n"
9931015      "\t\t\t<!ATTLIST sound channels CDATA #REQUIRED>\n"
9941016      "\t\t<!ELEMENT input (control*)>\n"
src/emu/audit.c
r1771r1772
120120
121121int audit_samples(core_options *options, const game_driver *gamedrv, audit_record **audit)
122122{
123   machine_config *config = machine_config_alloc(gamedrv->drv);
123   machine_config *config = machine_config_alloc(gamedrv->machine_config);
124124   audit_record *record;
125125   int sndnum, sampnum;
126126   int records = 0;
src/emu/video.c
r1771r1772
11861186
11871187   /* ask the OSD to update */
11881188   profiler_mark(PROFILER_BLIT);
1189   osd_update(!debug && skipped_it);
1189   osd_update(machine, !debug && skipped_it);
11901190   profiler_mark(PROFILER_END);
11911191
11921192   /* perform tasks for this frame */
src/emu/mame.c
r1771r1772
13341334      astring *sourcename;
13351335
13361336      /* parse "vector.ini" for vector games */
1337      config = machine_config_alloc(driver->drv);
1337      config = machine_config_alloc(driver->machine_config);
13381338      for (device = video_screen_first(config); device != NULL; device = video_screen_next(device))
13391339      {
13401340         const screen_config *scrconfig = device->inline_config;
r1771r1772
14191419   /* initialize the driver-related variables in the machine */
14201420   machine->gamedrv = driver;
14211421   machine->basename = mame_strdup(driver->name);
1422   machine->config = machine_config_alloc(driver->drv);
1422   machine->config = machine_config_alloc(driver->machine_config);
14231423
14241424   /* allocate the driver data */
14251425   if (machine->config->driver_data_size != 0)
r1771r1772
15881588
15891589   /* start the video and audio hardware */
15901590   video_init(machine);
1591   sound_init(machine);
15921591
15931592   /* start up the devices */
15941593   device_list_start(machine);
15951594
1595   sound_init(machine);
1596
15961597   /* call the driver's _START callbacks */
15971598   if (machine->config->machine_start != NULL) (*machine->config->machine_start)(machine);
15981599   if (machine->config->sound_start != NULL) (*machine->config->sound_start)(machine);
src/emu/inptport.c
r1771r1772
19061906{
19071907   int index;
19081908
1909   if (token.fptr == 0)
1909   if (token.i == 0)
19101910      return NULL;
1911   if (token.fptr >= INPUT_STRING_COUNT)
1911   if (token.i >= INPUT_STRING_COUNT)
19121912      return token.stringptr;
19131913   for (index = 0; index < ARRAY_LENGTH(input_port_default_strings); index++)
1914      if (input_port_default_strings[index].id == token.fptr)
1914      if (input_port_default_strings[index].id == token.i)
19151915         return input_port_default_strings[index].string;
19161916   return "(Unknown Default)";
19171917}
r1771r1772
19361936   {
19371937      UINT32 mask, defval, type, val;
19381938
1939      /* the entry is the first of a UINT32 pair */
1940      /* note that we advance IPT assuming that there is no second half */
1941      entrytype = INPUT_PORT_PAIR_UINT32(ipt++, 0);
1939      /* unpack the token from the first entry */
1940      TOKEN_GET_UINT32_UNPACK1(ipt, entrytype, 8);
19421941      switch (entrytype)
19431942      {
19441943         /* end */
r1771r1772
19471946
19481947         /* including */
19491948         case INPUT_TOKEN_INCLUDE:
1950            input_port_detokenize(param, (ipt++)->tokenptr);
1949            input_port_detokenize(param, TOKEN_GET_PTR(ipt, tokenptr));
19511950            break;
19521951
19531952         /* start of a new input port */
r1771r1772
19561955            modify_tag = NULL;
19571956            port = input_port_initialize(param, IPT_PORT, NULL, 0, 0);
19581957            if (entrytype == INPUT_TOKEN_START_TAG)
1959               port->start.tag = (ipt++)->stringptr;
1958               port->start.tag = TOKEN_GET_STRING(ipt);
19601959            break;
19611960
19621961         /* modify an existing port */
19631962         case INPUT_TOKEN_MODIFY:
1964            modify_tag = (ipt++)->stringptr;
1963            modify_tag = TOKEN_GET_STRING(ipt);
19651964            break;
19661965
19671966         /* input bit definition */
19681967         case INPUT_TOKEN_BIT:
1969            type = INPUT_PORT_PAIR_UINT32(--ipt, 1);
1970            ipt += INPUT_PORT_PAIR_TOKENS;
1971            mask = INPUT_PORT_PAIR_UINT32(ipt, 0);
1972            defval = INPUT_PORT_PAIR_UINT32(ipt, 1);
1973            ipt += INPUT_PORT_PAIR_TOKENS;
1974
1968            TOKEN_UNGET_UINT32(ipt);
1969            TOKEN_GET_UINT32_UNPACK2(ipt, entrytype, 8, type, 24);
1970            TOKEN_GET_UINT64_UNPACK2(ipt, mask, 32, defval, 32);
19751971            port = input_port_initialize(param, type, modify_tag, mask, defval);
19761972            seq_index[0] = seq_index[1] = seq_index[2] = 0;
19771973            break;
19781974
19791975         /* append a code */
19801976         case INPUT_TOKEN_CODE:
1981            val = INPUT_PORT_PAIR_UINT32(--ipt, 1);
1982            ipt += INPUT_PORT_PAIR_TOKENS;
1977            TOKEN_UNGET_UINT32(ipt);
1978            TOKEN_GET_UINT64_UNPACK2(ipt, entrytype, 8, val, 32);
19831979            if (seq_index[0] > 0)
19841980               port->seq.code[seq_index[0]++] = SEQCODE_OR;
19851981            port->seq.code[seq_index[0]++] = val;
19861982            break;
19871983
19881984         case INPUT_TOKEN_CODE_DEC:
1989            val = INPUT_PORT_PAIR_UINT32(--ipt, 1);
1990            ipt += INPUT_PORT_PAIR_TOKENS;
1985            TOKEN_UNGET_UINT32(ipt);
1986            TOKEN_GET_UINT64_UNPACK2(ipt, entrytype, 8, val, 32);
19911987            if (seq_index[1] > 0)
19921988               port->analog.decseq.code[seq_index[1]++] = SEQCODE_OR;
19931989            port->analog.decseq.code[seq_index[1]++] = val;
19941990            break;
19951991
19961992         case INPUT_TOKEN_CODE_INC:
1997            val = INPUT_PORT_PAIR_UINT32(--ipt, 1);
1998            ipt += INPUT_PORT_PAIR_TOKENS;
1993            TOKEN_UNGET_UINT32(ipt);
1994            TOKEN_GET_UINT64_UNPACK2(ipt, entrytype, 8, val, 32);
19991995            if (seq_index[2] > 0)
20001996               port->analog.incseq.code[seq_index[2]++] = SEQCODE_OR;
20011997            port->analog.incseq.code[seq_index[2]++] = val;
r1771r1772
20392035            break;
20402036
20412037         case INPUT_TOKEN_IMPULSE:
2042            port->impulse = INPUT_PORT_PAIR_UINT32(--ipt, 1);
2043            ipt += INPUT_PORT_PAIR_TOKENS;
2038            TOKEN_UNGET_UINT32(ipt);
2039            TOKEN_GET_UINT32_UNPACK2(ipt, entrytype, 8, port->impulse, 24);
20442040            break;
20452041
20462042         case INPUT_TOKEN_REVERSE:
r1771r1772
20572053
20582054         /* analog settings */
20592055         case INPUT_TOKEN_MINMAX:
2060            port->analog.min = INPUT_PORT_PAIR_UINT32(ipt, 0);
2061            port->analog.max = INPUT_PORT_PAIR_UINT32(ipt, 1);
2062            ipt += INPUT_PORT_PAIR_TOKENS;
2056            TOKEN_GET_UINT64_UNPACK2(ipt, port->analog.min, 32, port->analog.max, 32);
20632057            break;
20642058
20652059         case INPUT_TOKEN_SENSITIVITY:
2066            port->analog.sensitivity = INPUT_PORT_PAIR_UINT32(--ipt, 1);
2067            ipt += INPUT_PORT_PAIR_TOKENS;
2060            TOKEN_UNGET_UINT32(ipt);
2061            TOKEN_GET_UINT32_UNPACK2(ipt, entrytype, 8, port->analog.sensitivity, 24);
20682062            break;
20692063
20702064         case INPUT_TOKEN_KEYDELTA:
2071            port->analog.delta = port->analog.centerdelta = INPUT_PORT_PAIR_UINT32(--ipt, 1);
2072            ipt += INPUT_PORT_PAIR_TOKENS;
2065            TOKEN_UNGET_UINT32(ipt);
2066            TOKEN_GET_UINT32_UNPACK2(ipt, entrytype, 8, port->analog.delta, -24);
2067            port->analog.centerdelta = port->analog.delta;
20732068            break;
20742069
20752070         case INPUT_TOKEN_CENTERDELTA:
2076            port->analog.centerdelta = INPUT_PORT_PAIR_UINT32(--ipt, 1);
2077            ipt += INPUT_PORT_PAIR_TOKENS;
2071            TOKEN_UNGET_UINT32(ipt);
2072            TOKEN_GET_UINT32_UNPACK2(ipt, entrytype, 8, port->analog.centerdelta, -24);
20782073            break;
20792074
20802075         case INPUT_TOKEN_CROSSHAIR:
2081            port->analog.crossaxis = INPUT_PORT_PAIR_UINT32(--ipt, 1) & 0xff;
2082            port->analog.crossaltaxis = (float)((INT32)INPUT_PORT_PAIR_UINT32(ipt, 1) >> 8) / 65536.0f;
2083            ipt += INPUT_PORT_PAIR_TOKENS;
2084            port->analog.crossscale = (float)(INT32)INPUT_PORT_PAIR_UINT32(ipt, 0) / 65536.0f;
2085            port->analog.crossoffset = (float)(INT32)INPUT_PORT_PAIR_UINT32(ipt, 1) / 65536.0f;
2086            ipt += INPUT_PORT_PAIR_TOKENS;
2076            TOKEN_UNGET_UINT32(ipt);
2077            TOKEN_GET_UINT32_UNPACK3(ipt, entrytype, 8, port->analog.crossaxis, 4, port->analog.crossaltaxis, -20);
2078            TOKEN_GET_UINT64_UNPACK2(ipt, port->analog.crossscale, -32, port->analog.crossoffset, -32);
2079            port->analog.crossaltaxis *= 1.0f / 65536.0f;
2080            port->analog.crossscale *= 1.0f / 65536.0f;
2081            port->analog.crossoffset *= 1.0f / 65536.0f;
20872082            break;
20882083
20892084         case INPUT_TOKEN_FULL_TURN_COUNT:
2090            port->analog.full_turn_count = INPUT_PORT_PAIR_UINT32(--ipt, 1);
2091            ipt += INPUT_PORT_PAIR_TOKENS;
2085            TOKEN_UNGET_UINT32(ipt);
2086            TOKEN_GET_UINT32_UNPACK2(ipt, entrytype, 8, port->analog.full_turn_count, 24);
20922087            break;
20932088
20942089         case INPUT_TOKEN_POSITIONS:
2095            port->analog.max = INPUT_PORT_PAIR_UINT32(--ipt, 1);
2096            ipt += INPUT_PORT_PAIR_TOKENS;
2090            TOKEN_UNGET_UINT32(ipt);
2091            TOKEN_GET_UINT32_UNPACK2(ipt, entrytype, 8, port->analog.max, 24);
20972092            break;
20982093
20992094         case INPUT_TOKEN_WRAPS:
r1771r1772
21012096            break;
21022097
21032098         case INPUT_TOKEN_REMAP_TABLE:
2104            port->analog.remap_table = (ipt++)->remapptr;
2099            port->analog.remap_table = TOKEN_GET_PTR(ipt, ui32ptr);
21052100            break;
21062101
21072102         case INPUT_TOKEN_INVERT:
r1771r1772
21102105
21112106         /* custom callbacks */
21122107         case INPUT_TOKEN_CUSTOM:
2113            port->custom = (ipt++)->customptr;
2114            port->custom_param = (ipt++)->ptr;
2108            port->custom = TOKEN_GET_PTR(ipt, customptr);
2109            port->custom_param = (void *)TOKEN_GET_PTR(ipt, voidptr);
21152110            break;
21162111
21172112         /* dip switch definition */
21182113         case INPUT_TOKEN_DIPNAME:
2119            mask = INPUT_PORT_PAIR_UINT32(ipt, 0);
2120            defval = INPUT_PORT_PAIR_UINT32(ipt, 1);
2121            ipt += INPUT_PORT_PAIR_TOKENS;
2122
2114            TOKEN_GET_UINT64_UNPACK2(ipt, mask, 32, defval, 32);
21232115            port = input_port_initialize(param, IPT_DIPSWITCH_NAME, modify_tag, mask, defval);
21242116            seq_index[0] = seq_index[1] = seq_index[2] = 0;
21252117            port->name = input_port_string_from_token(*ipt++);
21262118            break;
21272119
21282120         case INPUT_TOKEN_DIPSETTING:
2129            defval = INPUT_PORT_PAIR_UINT32(--ipt, 1);
2130            ipt += INPUT_PORT_PAIR_TOKENS;
2131
2121            TOKEN_UNGET_UINT32(ipt);
2122            TOKEN_GET_UINT64_UNPACK2(ipt, entrytype, 8, defval, 32);
21322123            port = input_port_initialize(param, IPT_DIPSWITCH_SETTING, modify_tag, 0, defval);
21332124            seq_index[0] = seq_index[1] = seq_index[2] = 0;
21342125            port->name = input_port_string_from_token(*ipt++);
r1771r1772
21362127
21372128         /* physical location */
21382129         case INPUT_TOKEN_DIPLOCATION:
2139            input_port_parse_diplocation(port, (ipt++)->stringptr);
2130            input_port_parse_diplocation(port, TOKEN_GET_STRING(ipt));
21402131            break;
21412132
21422133         /* conditionals for dip switch settings */
21432134         case INPUT_TOKEN_CONDITION:
2144            port->condition.condition = INPUT_PORT_PAIR_UINT32(--ipt, 1);
2145            ipt += INPUT_PORT_PAIR_TOKENS;
2146            port->condition.mask = INPUT_PORT_PAIR_UINT32(ipt, 0);
2147            port->condition.value = INPUT_PORT_PAIR_UINT32(ipt, 1);
2148            ipt += INPUT_PORT_PAIR_TOKENS;
2149            port->condition.tag = (ipt++)->stringptr;
2135            TOKEN_UNGET_UINT32(ipt);
2136            TOKEN_GET_UINT32_UNPACK2(ipt, entrytype, 8, port->condition.condition, 24);
2137            TOKEN_GET_UINT64_UNPACK2(ipt, port->condition.mask, 32, port->condition.value, 32);
2138            port->condition.tag = TOKEN_GET_STRING(ipt);
21502139            break;
21512140
21522141         /* analog adjuster definition */
21532142         case INPUT_TOKEN_ADJUSTER:
2154            defval = INPUT_PORT_PAIR_UINT32(--ipt, 1);
2155            ipt += INPUT_PORT_PAIR_TOKENS;
2156
2143            TOKEN_UNGET_UINT32(ipt);
2144            TOKEN_GET_UINT64_UNPACK2(ipt, entrytype, 8, defval, 32);
21572145            port = input_port_initialize(param, IPT_ADJUSTER, modify_tag, 0xff, defval | (defval << 8));
21582146            seq_index[0] = seq_index[1] = seq_index[2] = 0;
2159            port->name = input_port_string_from_token(*ipt++);
2147            port->name = TOKEN_GET_STRING(ipt);
21602148            break;
21612149
21622150         /* configuration definition */
21632151         case INPUT_TOKEN_CONFNAME:
2164            mask = INPUT_PORT_PAIR_UINT32(ipt, 0);
2165            defval = INPUT_PORT_PAIR_UINT32(ipt, 1);
2166            ipt += INPUT_PORT_PAIR_TOKENS;
2167
2152            TOKEN_GET_UINT64_UNPACK2(ipt, mask, 32, defval, 32);
21682153            port = input_port_initialize(param, IPT_CONFIG_NAME, modify_tag, mask, defval);
21692154            seq_index[0] = seq_index[1] = seq_index[2] = 0;
21702155            port->name = input_port_string_from_token(*ipt++);
21712156            break;
21722157
21732158         case INPUT_TOKEN_CONFSETTING:
2174            defval = INPUT_PORT_PAIR_UINT32(--ipt, 1);
2175            ipt += INPUT_PORT_PAIR_TOKENS;
2176
2159            TOKEN_UNGET_UINT32(ipt);
2160            TOKEN_GET_UINT64_UNPACK2(ipt, entrytype, 8, defval, 32);
21772161            port = input_port_initialize(param, IPT_CONFIG_SETTING, modify_tag, 0, defval);
21782162            seq_index[0] = seq_index[1] = seq_index[2] = 0;
21792163            port->name = input_port_string_from_token(*ipt++);
r1771r1772
21812165
21822166#ifdef MESS
21832167         case INPUT_TOKEN_CHAR:
2184            val = INPUT_PORT_PAIR_UINT32(--ipt, 1);
2185            ipt += INPUT_PORT_PAIR_TOKENS;
2186
2168            TOKEN_UNGET_UINT32(ipt);
2169            TOKEN_GET_UINT32_UNPACK2(ipt, entrytype, 8, val, 24);
21872170            {
21882171               int ch;
21892172               for (ch = 0; port->keyboard.chars[ch] != 0; ch++)
r1771r1772
21942177
21952178         /* category definition */
21962179         case INPUT_TOKEN_CATEGORY:
2197            port->category = (UINT16) INPUT_PORT_PAIR_UINT32(--ipt, 1);
2198            ipt += INPUT_PORT_PAIR_TOKENS;
2180            TOKEN_UNGET_UINT32(ipt);
2181            TOKEN_GET_UINT32_UNPACK2(ipt, entrytype, 8, port->category, 24);
21992182            break;
22002183
22012184         case INPUT_TOKEN_CATEGORY_NAME:
2202            mask = INPUT_PORT_PAIR_UINT32(ipt, 0);
2203            defval = INPUT_PORT_PAIR_UINT32(ipt, 1);
2204            ipt += INPUT_PORT_PAIR_TOKENS;
2205
2185            TOKEN_GET_UINT64_UNPACK2(ipt, mask, 32, defval, 32);
22062186            port = input_port_initialize(param, IPT_CATEGORY_NAME, modify_tag, mask, defval);
22072187            seq_index[0] = seq_index[1] = seq_index[2] = 0;
22082188            port->name = input_port_string_from_token(*ipt++);
22092189            break;
22102190
22112191         case INPUT_TOKEN_CATEGORY_SETTING:
2212            defval = INPUT_PORT_PAIR_UINT32(--ipt, 1);
2213            ipt += INPUT_PORT_PAIR_TOKENS;
2214
2192            TOKEN_UNGET_UINT32(ipt);
2193            TOKEN_GET_UINT64_UNPACK2(ipt, entrytype, 8, defval, 32);
22152194            port = input_port_initialize(param, IPT_CATEGORY_SETTING, modify_tag, 0, defval);
22162195            seq_index[0] = seq_index[1] = seq_index[2] = 0;
22172196            port->name = input_port_string_from_token(*ipt++);
src/emu/machine/6850acia.c
r1771r1772
389389   int which = param;
390390   acia_6850 *acia_p = &acia[which];
391391
392   if (acia_p->cts_pin && *acia_p->cts_pin)
393   {
394      acia_p->status |= ACIA6850_STATUS_CTS;
395   }
396   else
397   {
398      acia_p->status &= ~ACIA6850_STATUS_CTS;
399   }
400
392401   switch (acia_p->tx_state)
393402   {
394403      case START:
src/emu/machine/z80pio.c
r1771r1772
109109   int old_state = pio->int_state[ch];
110110   int irq = 0;
111111   int data;
112   if (pio->mode[ch] == 0x13) return;
112   if (pio->mode[ch] == 0x13 || (pio->enable[ch] & PIO_INT_MASK)) return;
113113
114114   /* only check if interrupts are enabled */
115115   if (pio->enable[ch] & PIO_INT_ENABLE)
src/emu/inptport.h
r1771r1772
1616
1717#include "memory.h"
1818#include "inputseq.h"
19#include "tokenize.h"
1920
2021#ifdef MESS
2122#include "unicode.h"
r1771r1772
504505typedef union _input_port_token input_port_token;
505506union _input_port_token
506507{
507   FPTR      fptr;                        /* default value used for C89 implementations */
508   UINT32      i[INPUT_PORT_PAIR_ENTRIES];         /* one or two UINT32s */
509   float      f[INPUT_PORT_PAIR_ENTRIES];         /* one or two floats */
510   void *      ptr;                        /* a generic pointer value */
511   const char *stringptr;                     /* pointer to a string value */
512   const input_port_token *tokenptr;            /* pointer to a another token list */
513   input_port_custom_func customptr;            /* pointer to a custom input function */
514   const UINT32 *remapptr;                     /* pointer to a remap table */
508   TOKEN_COMMON_FIELDS
509   const input_port_token *tokenptr;
510   input_port_custom_func customptr;
515511};
516512
517513
r1771r1772
649645
650646#define IP_NAME_DEFAULT             NULL
651647
652/* single pointers and UINT32s are just encoded straight */
653#define INPUT_PORT_PTR(type,x)         { (FPTR)(x) }
654#define INPUT_PORT_PAIR_UINT32(vptr,x)   (vptr)->i[x]
655
656/* on 64-bit platforms, pairs of UINT32s are encoded into a single 64-bit pointer */
657#ifdef PTR64
658#ifdef LSB_FIRST
659#define INPUT_PORT_UINT32_PAIR(x,y)      { (FPTR)((UINT32)(x) | ((UINT64)(y) << 32)) }
660#else
661#define INPUT_PORT_UINT32_PAIR(x,y)      { (FPTR)((UINT32)(y) | ((UINT64)(x) << 32)) }
662#endif
663#define INPUT_PORT_UINT32(x)         INPUT_PORT_UINT32_PAIR(x,0)
664
665/* on 32-bit platforms, pairs of UINT32s are encoded in two consecutive 32-bit pointers */
666#else
667#define INPUT_PORT_UINT32(x)         { (FPTR)(UINT32)(x) }
668#define INPUT_PORT_UINT32_PAIR(x,y)      INPUT_PORT_UINT32(x), INPUT_PORT_UINT32(y)
669#endif
670
671648/* start of table */
672#define INPUT_PORTS_START(name) \
673   const input_port_token ipt_##name[] = {
649#define INPUT_PORTS_START(_name) \
650   const input_port_token ipt_##_name[] = {
674651
675652/* end of table */
676653#define INPUT_PORTS_END \
677   INPUT_PORT_UINT32(INPUT_TOKEN_END) };
654   TOKEN_UINT32_PACK1(INPUT_TOKEN_END, 8) };
678655
679656/* aliasing */
680#define INPUT_PORTS_EXTERN(name) \
681   extern const input_port_token ipt_##name[]
657#define INPUT_PORTS_EXTERN(_name) \
658   extern const input_port_token ipt_##_name[]
682659
683660/* including */
684#define PORT_INCLUDE(name) \
685   INPUT_PORT_UINT32(INPUT_TOKEN_INCLUDE), INPUT_PORT_PTR(tokenptr, &ipt_##name[0]),
661#define PORT_INCLUDE(_name) \
662   TOKEN_UINT32_PACK1(INPUT_TOKEN_INCLUDE, 8), \
663   TOKEN_PTR(tokenptr, &ipt_##_name[0]),
686664
687665/* start of a new input port */
688666#define PORT_START \
689   INPUT_PORT_UINT32(INPUT_TOKEN_START),
667   TOKEN_UINT32_PACK1(INPUT_TOKEN_START, 8),
690668
691669/* start of a new input port (with included tag) */
692#define PORT_START_TAG(tag_) \
693   INPUT_PORT_UINT32(INPUT_TOKEN_START_TAG), INPUT_PORT_PTR(stringptr, tag_),
670#define PORT_START_TAG(_tag) \
671   TOKEN_UINT32_PACK1(INPUT_TOKEN_START_TAG, 8), \
672   TOKEN_STRING(_tag),
694673
695674/* modify an existing port */
696#define PORT_MODIFY(tag_) \
697   INPUT_PORT_UINT32(INPUT_TOKEN_MODIFY), INPUT_PORT_PTR(stringptr, tag_),
675#define PORT_MODIFY(_tag) \
676   TOKEN_UINT32_PACK1(INPUT_TOKEN_MODIFY, 8), \
677   TOKEN_STRING(_tag),
698678
699679/* input bit definition */
700#define PORT_BIT(mask_,default_,type_) \
701   INPUT_PORT_UINT32_PAIR(INPUT_TOKEN_BIT, type_), INPUT_PORT_UINT32_PAIR(mask_, default_),
680#define PORT_BIT(_mask,_default,_type) \
681   TOKEN_UINT32_PACK2(INPUT_TOKEN_BIT, 8, _type, 24), \
682   TOKEN_UINT64_PACK2(_mask, 32, _default, 32),
702683
703684/* append a code */
704#define PORT_CODE(code) \
705   INPUT_PORT_UINT32_PAIR(INPUT_TOKEN_CODE, code),
685#define PORT_CODE(_code) \
686   TOKEN_UINT64_PACK2(INPUT_TOKEN_CODE, 8, _code, 32),
706687
707#define PORT_CODE_DEC(code) \
708   INPUT_PORT_UINT32_PAIR(INPUT_TOKEN_CODE_DEC, code),
688#define PORT_CODE_DEC(_code) \
689   TOKEN_UINT64_PACK2(INPUT_TOKEN_CODE_DEC, 8, _code, 32),
709690
710#define PORT_CODE_INC(code) \
711   INPUT_PORT_UINT32_PAIR(INPUT_TOKEN_CODE_INC, code),
691#define PORT_CODE_INC(_code) \
692   TOKEN_UINT64_PACK2(INPUT_TOKEN_CODE_INC, 8, _code, 32),
712693
713694/* joystick flags */
714695#define PORT_2WAY \
715   INPUT_PORT_UINT32(INPUT_TOKEN_2WAY),
696   TOKEN_UINT32_PACK1(INPUT_TOKEN_2WAY, 8),
716697
717698#define PORT_4WAY \
718   INPUT_PORT_UINT32(INPUT_TOKEN_4WAY),
699   TOKEN_UINT32_PACK1(INPUT_TOKEN_4WAY, 8),
719700
720701#define PORT_8WAY \
721   INPUT_PORT_UINT32(INPUT_TOKEN_8WAY),
702   TOKEN_UINT32_PACK1(INPUT_TOKEN_8WAY, 8),
722703
723704#define PORT_16WAY \
724   INPUT_PORT_UINT32(INPUT_TOKEN_16WAY),
705   TOKEN_UINT32_PACK1(INPUT_TOKEN_16WAY, 8),
725706
726707#define PORT_ROTATED \
727   INPUT_PORT_UINT32(INPUT_TOKEN_ROTATED),
708   TOKEN_UINT32_PACK1(INPUT_TOKEN_ROTATED, 8),
728709
729710/* general flags */
730#define PORT_NAME(name_) \
731   INPUT_PORT_UINT32(INPUT_TOKEN_NAME), INPUT_PORT_PTR(stringptr, name_),
711#define PORT_NAME(_name) \
712   TOKEN_UINT32_PACK1(INPUT_TOKEN_NAME, 8), \
713   TOKEN_STRING(_name),
732714
733715#define PORT_PLAYER(player_) \
734   INPUT_PORT_UINT32(INPUT_TOKEN_PLAYER1 + (((player_) - 1) % MAX_PLAYERS)),
716   TOKEN_UINT32_PACK1(INPUT_TOKEN_PLAYER1 + (((player_) - 1) % MAX_PLAYERS), 8),
735717
736718#define PORT_COCKTAIL \
737   INPUT_PORT_UINT32(INPUT_TOKEN_COCKTAIL),
719   TOKEN_UINT32_PACK1(INPUT_TOKEN_COCKTAIL, 8),
738720
739721#define PORT_TOGGLE \
740   INPUT_PORT_UINT32(INPUT_TOKEN_TOGGLE),
722   TOKEN_UINT32_PACK1(INPUT_TOKEN_TOGGLE, 8),
741723
742#define PORT_IMPULSE(duration_) \
743   INPUT_PORT_UINT32_PAIR(INPUT_TOKEN_IMPULSE, duration_),
724#define PORT_IMPULSE(_duration) \
725   TOKEN_UINT32_PACK2(INPUT_TOKEN_IMPULSE, 8, _duration, 24),
744726
745727#define PORT_REVERSE \
746   INPUT_PORT_UINT32(INPUT_TOKEN_REVERSE),
728   TOKEN_UINT32_PACK1(INPUT_TOKEN_REVERSE, 8),
747729
748730#define PORT_RESET \
749   INPUT_PORT_UINT32(INPUT_TOKEN_RESET),
731   TOKEN_UINT32_PACK1(INPUT_TOKEN_RESET, 8),
750732
751733#define PORT_UNUSED \
752   INPUT_PORT_UINT32(INPUT_TOKEN_UNUSED),
734   TOKEN_UINT32_PACK1(INPUT_TOKEN_UNUSED, 8),
753735
754736/* analog settings */
755/* if this macro is not used, the minimum defaluts to 0 and maximum defaluts to the mask value */
756#define PORT_MINMAX(min_,max_) \
757   INPUT_PORT_UINT32(INPUT_TOKEN_MINMAX), INPUT_PORT_UINT32_PAIR(min_, max_),
737/* if this macro is not used, the minimum defaluts to 0 and maximum defaults to the mask value */
738#define PORT_MINMAX(_min,_max) \
739   TOKEN_UINT32_PACK1(INPUT_TOKEN_MINMAX, 8), \
740   TOKEN_UINT64_PACK2(_min, 32, _max, 32),
758741
759#define PORT_SENSITIVITY(sensitivity_) \
760   INPUT_PORT_UINT32_PAIR(INPUT_TOKEN_SENSITIVITY, sensitivity_),
742#define PORT_SENSITIVITY(_sensitivity) \
743   TOKEN_UINT32_PACK2(INPUT_TOKEN_SENSITIVITY, 8, _sensitivity, 24),
761744
762#define PORT_KEYDELTA(delta_) \
763   INPUT_PORT_UINT32_PAIR(INPUT_TOKEN_KEYDELTA, delta_),
745#define PORT_KEYDELTA(_delta) \
746   TOKEN_UINT32_PACK2(INPUT_TOKEN_KEYDELTA, 8, _delta, 24),
764747
765748/* note that PORT_CENTERDELTA must appear after PORT_KEYDELTA */
766#define PORT_CENTERDELTA(delta_) \
767   INPUT_PORT_UINT32_PAIR(INPUT_TOKEN_CENTERDELTA, delta_),
749#define PORT_CENTERDELTA(_delta) \
750   TOKEN_UINT32_PACK2(INPUT_TOKEN_CENTERDELTA, 8, _delta, 24),
768751
769752#define PORT_CROSSHAIR(axis, scale, offset, altaxis) \
770   INPUT_PORT_UINT32_PAIR(INPUT_TOKEN_CROSSHAIR, CROSSHAIR_AXIS_##axis | ((INT32)((altaxis) * 65536.0f) << 8)), \
771   INPUT_PORT_UINT32_PAIR((INT32)((scale) * 65536.0f), (INT32)((offset) * 65536.0f)),
753   TOKEN_UINT32_PACK3(INPUT_TOKEN_CROSSHAIR, 8, CROSSHAIR_AXIS_##axis, 4, (INT32)((altaxis) * 65536.0f), 20), \
754   TOKEN_UINT64_PACK2((INT32)((scale) * 65536.0f), 32, (INT32)((offset) * 65536.0f), 32),
772755
773756/* how many optical counts for 1 full turn of the control */
774#define PORT_FULL_TURN_COUNT(count_)                        \
775   INPUT_PORT_UINT32_PAIR(INPUT_TOKEN_FULL_TURN_COUNT, count_),
757#define PORT_FULL_TURN_COUNT(_count) \
758   TOKEN_UINT32_PACK2(INPUT_TOKEN_FULL_TURN_COUNT, 8, _count, 24),
776759
777760/* positional controls can be binary or 1 of X */
778761/* 1 of X not completed yet */
779762/* if it is specified as PORT_REMAP_TABLE then it is binary, but remapped */
780763/* otherwise it is binary */
781#define PORT_POSITIONS(positions_)                           \
782   INPUT_PORT_UINT32_PAIR(INPUT_TOKEN_POSITIONS, positions_),
764#define PORT_POSITIONS(_positions) \
765   TOKEN_UINT32_PACK2(INPUT_TOKEN_POSITIONS, 8, _positions, 24),
783766
784767/* positional control wraps at min/max */
785#define PORT_WRAPS                        \
786   INPUT_PORT_UINT32(INPUT_TOKEN_WRAPS),
768#define PORT_WRAPS \
769   TOKEN_UINT32_PACK1(INPUT_TOKEN_WRAPS, 8),
787770
788771/* positional control uses this remap table */
789#define PORT_REMAP_TABLE(table_)                              \
790   INPUT_PORT_UINT32(INPUT_TOKEN_REMAP_TABLE), INPUT_PORT_PTR(remapptr, table_),
772#define PORT_REMAP_TABLE(_table) \
773   TOKEN_UINT32_PACK1(INPUT_TOKEN_REMAP_TABLE, 8), \
774   TOKEN_PTR(ui32ptr, _table),
791775
792776/* positional control bits are active low */
793#define PORT_INVERT                                       \
794   INPUT_PORT_UINT32(INPUT_TOKEN_INVERT),
777#define PORT_INVERT \
778   TOKEN_UINT32_PACK1(INPUT_TOKEN_INVERT, 8),
795779
796780/* custom callbacks */
797#define PORT_CUSTOM(callback_, param_) \
798   INPUT_PORT_UINT32(INPUT_TOKEN_CUSTOM), INPUT_PORT_PTR(customptr, callback_), INPUT_PORT_PTR(ptr, param_),
781#define PORT_CUSTOM(_callback, _param) \
782   TOKEN_UINT32_PACK1(INPUT_TOKEN_CUSTOM, 8), \
783   TOKEN_PTR(customptr, _callback), \
784   TOKEN_PTR(voidptr, _param),
799785
800786/* dip switch definition */
801#define PORT_DIPNAME(mask,default,name) \
802   INPUT_PORT_UINT32(INPUT_TOKEN_DIPNAME), INPUT_PORT_UINT32_PAIR(mask, default), INPUT_PORT_PTR(stringptr, name),
787#define PORT_DIPNAME(_mask,_default,_name) \
788   TOKEN_UINT32_PACK1(INPUT_TOKEN_DIPNAME, 8), \
789   TOKEN_UINT64_PACK2(_mask, 32, _default, 32), \
790   TOKEN_STRING(_name),
803791
804#define PORT_DIPSETTING(default,name) \
805   INPUT_PORT_UINT32_PAIR(INPUT_TOKEN_DIPSETTING, default), INPUT_PORT_PTR(stringptr, name),
792#define PORT_DIPSETTING(_default,_name) \
793   TOKEN_UINT64_PACK2(INPUT_TOKEN_DIPSETTING, 8, _default, 32), \
794   TOKEN_STRING(_name),
806795
807796/* physical location, of the form: name:[!]sw,[name:][!]sw,... */
808797/* note that these are specified LSB-first */
809#define PORT_DIPLOCATION(location_) \
810   INPUT_PORT_UINT32(INPUT_TOKEN_DIPLOCATION), INPUT_PORT_PTR(stringptr, location_),
798#define PORT_DIPLOCATION(_location) \
799   TOKEN_UINT32_PACK1(INPUT_TOKEN_DIPLOCATION, 8), \
800   TOKEN_STRING(_location),
811801
812802/* conditionals for dip switch settings */
813#define PORT_CONDITION(tag_,mask_,condition_,value_) \
814   INPUT_PORT_UINT32_PAIR(INPUT_TOKEN_CONDITION, condition_), INPUT_PORT_UINT32_PAIR(mask_, value_), INPUT_PORT_PTR(stringptr, tag_),
803#define PORT_CONDITION(_tag,_mask,_condition,_value) \
804   TOKEN_UINT32_PACK2(INPUT_TOKEN_CONDITION, 8, _condition, 24), \
805   TOKEN_UINT64_PACK2(_mask, 32, _value, 32), \
806   TOKEN_STRING(_tag),
815807
816808/* analog adjuster definition */
817#define PORT_ADJUSTER(default,name) \
818   INPUT_PORT_UINT32_PAIR(INPUT_TOKEN_ADJUSTER, default), INPUT_PORT_PTR(stringptr, name),
809#define PORT_ADJUSTER(_default,_name) \
810   TOKEN_UINT64_PACK2(INPUT_TOKEN_ADJUSTER, 8, _default, 32), \
811   TOKEN_STRING(_name),
819812
820813/* config definition */
821#define PORT_CONFNAME(mask,default,name) \
822   INPUT_PORT_UINT32(INPUT_TOKEN_CONFNAME), INPUT_PORT_UINT32_PAIR(mask, default), INPUT_PORT_PTR(stringptr, name),
814#define PORT_CONFNAME(_mask,_default,_name) \
815   TOKEN_UINT32_PACK1(INPUT_TOKEN_CONFNAME, 8), \
816   TOKEN_UINT64_PACK2(_mask, 32, _default, 32), \
817   TOKEN_STRING(_name),
823818
824#define PORT_CONFSETTING(default,name) \
825   INPUT_PORT_UINT32_PAIR(INPUT_TOKEN_CONFSETTING, default), INPUT_PORT_PTR(stringptr, name),
819#define PORT_CONFSETTING(_default,_name) \
820   TOKEN_UINT64_PACK2(INPUT_TOKEN_CONFSETTING, 8, _default, 32), \
821   TOKEN_STRING(_name),
826822
827823#ifdef MESS
828824/* keyboard chars */
829#define PORT_CHAR(ch)   \
830   INPUT_PORT_UINT32_PAIR(INPUT_TOKEN_CHAR, ch),
825#define PORT_CHAR(_ch) \
826   TOKEN_UINT32_PACK2(INPUT_TOKEN_CHAR, 8, _ch, 24),
831827
832828/* categories */
833#define PORT_CATEGORY(category) \
834   INPUT_PORT_UINT32_PAIR(INPUT_TOKEN_CATEGORY, category),
829#define PORT_CATEGORY(_category) \
830   TOKEN_UINT32_PACK2(INPUT_TOKEN_CHAR, 8, _category, 24),
835831
836#define PORT_CATEGORY_CLASS(mask,default,name)                   \
837   INPUT_PORT_UINT32(INPUT_TOKEN_CATEGORY_NAME), INPUT_PORT_UINT32_PAIR(mask, default), INPUT_PORT_PTR(stringptr, name),
832#define PORT_CATEGORY_CLASS(_mask,_default,_name) \
833   TOKEN_UINT32_PACK1(INPUT_TOKEN_CATEGORY_NAME, 8), \
834   TOKEN_UINT64_PACK2(_mask, 32, _default, 32), \
835   TOKEN_STRING(_name),
838836
839#define PORT_CATEGORY_ITEM(default,name,category)                \
840   INPUT_PORT_UINT32_PAIR(INPUT_TOKEN_CATEGORY_SETTING, default), INPUT_PORT_PTR(stringptr, name), INPUT_PORT_UINT32_PAIR(INPUT_TOKEN_CATEGORY, category),
837#define PORT_CATEGORY_ITEM(_default,_name,_category) \
838   TOKEN_UINT64_PACK3(INPUT_TOKEN_CATEGORY_SETTING, 8, _default, 32, _category, 32), \
839   TOKEN_STRING(_name),
841840#endif /* MESS */
842841
843842
src/emu/cpuintrf.c
r1771r1772
113113void asap_get_info(UINT32 state, cpuinfo *info);
114114void upd7810_get_info(UINT32 state, cpuinfo *info);
115115void upd7807_get_info(UINT32 state, cpuinfo *info);
116void upd7801_get_info(UINT32 state, cpuinfo *info);
117void upd78c05_get_info(UINT32 state, cpuinfo *info);
118void upd78c06_get_info(UINT32 state, cpuinfo *info);
116119void jaguargpu_get_info(UINT32 state, cpuinfo *info);
117120void jaguardsp_get_info(UINT32 state, cpuinfo *info);
118121void r3000be_get_info(UINT32 state, cpuinfo *info);
r1771r1772
553556#if (HAS_UPD7807)
554557   { CPU_UPD7807, upd7807_get_info },
555558#endif
559#if (HAS_UPD7801)
560   { CPU_UPD7801, upd7801_get_info },
561   { CPU_UPD78C05, upd78c05_get_info },
562   { CPU_UPD78C06, upd78c06_get_info },
563#endif
556564#if (HAS_JAGUAR)
557565   { CPU_JAGUARGPU, jaguargpu_get_info },
558566   { CPU_JAGUARDSP, jaguardsp_get_info },
src/emu/attotime.h
r1771r1772
6767#define HZ_TO_ATTOSECONDS(x)         ((attoseconds_t)(ATTOSECONDS_PER_SECOND / (x)))
6868
6969/* macros for converting other seconds types to attoseconds */
70#define ATTOSECONDS_IN_SEC(x)         ((x) * ATTOSECONDS_PER_SECOND)
71#define ATTOSECONDS_IN_MSEC(x)         ((x) * ATTOSECONDS_PER_MILLISECOND)
72#define ATTOSECONDS_IN_USEC(x)         ((x) * ATTOSECONDS_PER_MICROSECOND)
73#define ATTOSECONDS_IN_NSEC(x)         ((x) * ATTOSECONDS_PER_NANOSECOND)
70#define ATTOSECONDS_IN_SEC(x)         ((attoseconds_t)(x) * ATTOSECONDS_PER_SECOND)
71#define ATTOSECONDS_IN_MSEC(x)         ((attoseconds_t)(x) * ATTOSECONDS_PER_MILLISECOND)
72#define ATTOSECONDS_IN_USEC(x)         ((attoseconds_t)(x) * ATTOSECONDS_PER_MICROSECOND)
73#define ATTOSECONDS_IN_NSEC(x)         ((attoseconds_t)(x) * ATTOSECONDS_PER_NANOSECOND)
7474
7575/* macros for building attotimes from other types at runtime */
76#define ATTOTIME_IN_HZ(hz)            attotime_make(0, HZ_TO_ATTOSECONDS(hz))
77#define ATTOTIME_IN_SEC(s)            attotime_make((s)  / 1, (s) % 1 /* mod here errors on doubles, which is intended */)
78#define ATTOTIME_IN_MSEC(ms)         attotime_make((ms) / 1000, ATTOSECONDS_IN_MSEC((ms) % 1000))
79#define ATTOTIME_IN_USEC(us)         attotime_make((us) / 1000000, ATTOSECONDS_IN_USEC((us) % 1000000))
80#define ATTOTIME_IN_NSEC(ns)         attotime_make((ns) / 1000000000, ATTOSECONDS_IN_NSEC((ns) % 1000000000))
76#define ATTOTIME_IN_HZ(hz)            attotime_make((0), (HZ_TO_ATTOSECONDS(hz)))
77#define ATTOTIME_IN_SEC(s)            attotime_make(((s) / 1), ((s) % 1))
78#define ATTOTIME_IN_MSEC(ms)         attotime_make(((ms) / 1000), (ATTOSECONDS_IN_MSEC((ms) % 1000)))
79#define ATTOTIME_IN_USEC(us)         attotime_make(((us) / 1000000), (ATTOSECONDS_IN_USEC((us) % 1000000)))
80#define ATTOTIME_IN_NSEC(ns)         attotime_make(((ns) / 1000000000), (ATTOSECONDS_IN_NSEC((ns) % 1000000000)))
8181
8282/* macros for building attotimes from other types at compile time */
83#define STATIC_ATTOTIME_IN_HZ(hz)      { 0, HZ_TO_ATTOSECONDS(hz) }
84#define STATIC_ATTOTIME_IN_SEC(s)      { (s)  / 1, (s) % 1 /* mod here errors on doubles, which is intended */ }
85#define STATIC_ATTOTIME_IN_MSEC(ms)      { (ms) / 1000, ATTOSECONDS_IN_MSEC((ms) % 1000) }
86#define STATIC_ATTOTIME_IN_USEC(us)      { (us) / 1000000, ATTOSECONDS_IN_USEC((us) % 1000000) }
87#define STATIC_ATTOTIME_IN_NSEC(ns)      { (ns) / 1000000000, ATTOSECONDS_IN_NSEC((ns) % 1000000000) }
83#define STATIC_ATTOTIME_IN_HZ(hz)      { (0), (HZ_TO_ATTOSECONDS(hz)) }
84#define STATIC_ATTOTIME_IN_SEC(s)      { ((s) / 1), ((s) % 1) }
85#define STATIC_ATTOTIME_IN_MSEC(ms)      { ((ms) / 1000), (ATTOSECONDS_IN_MSEC((ms) % 1000)) }
86#define STATIC_ATTOTIME_IN_USEC(us)      { ((us) / 1000000), (ATTOSECONDS_IN_USEC((us) % 1000000)) }
87#define STATIC_ATTOTIME_IN_NSEC(ns)      { ((ns) / 1000000000), (ATTOSECONDS_IN_NSEC((ns) % 1000000000)) }
8888
89/* macros for building a reduced-resolution attotime for tokenized storage in a UINT64 */
90/* this form supports up to 1000 seconds and sacrifices 1/1000 of the full attotime resolution */
91#define UINT64_ATTOTIME_IN_HZ(hz)      ((UINT64)((ATTOSECONDS_PER_SECOND / 1000) / (hz)))
92#define UINT64_ATTOTIME_IN_SEC(s)      ((UINT64)(s) * (ATTOSECONDS_PER_SECOND / 1000))
93#define UINT64_ATTOTIME_IN_MSEC(ms)      ((UINT64)(ms) * (ATTOSECONDS_PER_SECOND / 1000 / 1000))
94#define UINT64_ATTOTIME_IN_USEC(us)      ((UINT64)(us) * (ATTOSECONDS_PER_SECOND / 1000 / 1000 / 1000))
95#define UINT64_ATTOTIME_IN_NSEC(ns)      ((UINT64)(ns) * (ATTOSECONDS_PER_SECOND / 1000 / 1000 / 1000 / 1000))
8996
90#define USEC_TO_ATTOSECONDS(us)         ((attoseconds_t)((us) * ATTOSECONDS_PER_MICROSECOND))
97/* macros for converting a UINT64 attotime to a full attotime */
98#define UINT64_ATTOTIME_TO_ATTOTIME(v)   attotime_make((v) / (ATTOSECONDS_PER_SECOND / 1000), ((v) % (ATTOSECONDS_PER_SECOND / 1000)) * 1000)
9199
92100
93101
src/emu/cpuexec.c
r1771r1772
811811
812812static TIMER_CALLBACK( watchdog_callback )
813813{
814   logerror("reset caused by the (time) watchdog\n");
814   logerror("reset caused by the watchdog\n");
815815   mame_schedule_soft_reset(machine);
816816}
817817
src/emu/cpuexec.h
r1771r1772
141141   CPU_ASAP,
142142   CPU_UPD7810,
143143   CPU_UPD7807,
144   CPU_UPD7801,
145   CPU_UPD78C05,
146   CPU_UPD78C06,
144147   CPU_JAGUARGPU,
145148   CPU_JAGUARDSP,
146149   CPU_R3000BE,
src/emu/ui.c
r1771r1772
11151115
11161116   /* display screen information */
11171117   bufptr += sprintf(bufptr, "\nVideo:\n");
1118   for (device = video_screen_first(Machine->config); device != NULL; device = video_screen_next(device))
1118   if (scrcount == 0)
1119      buffer += sprintf(bufptr, "None\n");
1120   else
11191121   {
1120      int index = device_list_index(Machine->config->devicelist, VIDEO_SCREEN, device->tag);
1121      const screen_config *scrconfig = device->inline_config;
1122      for (device = video_screen_first(Machine->config); device != NULL; device = video_screen_next(device))
1123      {
1124         int index = device_list_index(Machine->config->devicelist, VIDEO_SCREEN, device->tag);
1125         const screen_config *scrconfig = device->inline_config;
11221126
1123      if (scrcount > 1)
1124         bufptr += sprintf(bufptr, "Screen %d: ", index + 1);
1127         if (scrcount > 1)
1128            bufptr += sprintf(bufptr, "Screen %d: ", index + 1);
11251129
1126      if (scrconfig->type == SCREEN_TYPE_VECTOR)
1127         bufptr += sprintf(bufptr, "Vector\n");
1128      else
1129         bufptr += sprintf(bufptr, "Resolution:\n%d " UTF8_MULTIPLY " %d (%s) %f" UTF8_NBSP "Hz\n",
1130               Machine->screen[0].visarea.max_x - Machine->screen[0].visarea.min_x + 1,
1131               Machine->screen[0].visarea.max_y - Machine->screen[0].visarea.min_y + 1,
1132               (Machine->gamedrv->flags & ORIENTATION_SWAP_XY) ? "V" : "H",
1133               ATTOSECONDS_TO_HZ(Machine->screen[0].refresh));
1130         if (scrconfig->type == SCREEN_TYPE_VECTOR)
1131            bufptr += sprintf(bufptr, "Vector\n");
1132         else
1133            bufptr += sprintf(bufptr, "%d " UTF8_MULTIPLY " %d (%s) %f" UTF8_NBSP "Hz\n",
1134                  scrconfig->defstate.visarea.max_x - scrconfig->defstate.visarea.min_x + 1,
1135                  scrconfig->defstate.visarea.max_y - scrconfig->defstate.visarea.min_y + 1,
1136                  (Machine->gamedrv->flags & ORIENTATION_SWAP_XY) ? "V" : "H",
1137                  ATTOSECONDS_TO_HZ(scrconfig->defstate.refresh));
1138      }
11341139   }
11351140
11361141   return bufptr - buffer;
src/emu/sound.c
r1771r1772
7272struct _speaker_info
7373{
7474   const speaker_config *speaker;         /* pointer to the speaker info */
75   const char *   tag;               /* speaker tag */
7576   sound_stream *   mixer_stream;         /* mixing stream */
7677   int            inputs;               /* number of input streams */
7778   speaker_input *   input;               /* array of input information */
r1771r1772
9394static int totalsnd;
9495static sound_info sound[MAX_SOUND];
9596
96static int totalspeakers;
97static speaker_info speaker[MAX_SPEAKER];
98
9997static INT16 *finalmix;
10098static UINT32 finalmix_leftover;
10199static INT32 *leftmix, *rightmix;
r1771r1772
120118static void sound_save(int config_type, xml_data_node *parentnode);
121119static TIMER_CALLBACK( sound_update );
122120static void start_sound_chips(void);
123static void start_speakers(void);
124121static void route_sound(void);
125122static void mixer_update(void *param, stream_sample_t **inputs, stream_sample_t **buffer, int length);
126123
r1771r1772
136133
137134INLINE speaker_info *find_speaker_by_tag(const char *tag)
138135{
139   int spknum;
140
141   /* attempt to find the speaker in our list */
142   for (spknum = 0; spknum < totalspeakers; spknum++)
143      if (strcmp(speaker[spknum].speaker->tag, tag) == 0)
144         return &speaker[spknum];
145   return NULL;
136   const device_config *speaker = device_list_find_by_tag(Machine->config->devicelist, SPEAKER_OUTPUT, tag);
137   return (speaker == NULL) ? NULL : speaker->token;
146138}
147139
148140
r1771r1772
179171   /* handle -nosound */
180172   nosound_mode = !options_get_bool(mame_options(), OPTION_SOUND);
181173   if (nosound_mode)
182      Machine->sample_rate = 11025;
174      machine->sample_rate = 11025;
183175
184176   /* count the speakers */
185   for (totalspeakers = 0; Machine->config->speaker[totalspeakers].tag; totalspeakers++) ;
186   VPRINTF(("total speakers = %d\n", totalspeakers));
177   VPRINTF(("total speakers = %d\n", speaker_output_count(machine->config)));
187178
188179   /* allocate memory for mix buffers */
189   leftmix = auto_malloc(Machine->sample_rate * sizeof(*leftmix));
190   rightmix = auto_malloc(Machine->sample_rate * sizeof(*rightmix));
191   finalmix = auto_malloc(Machine->sample_rate * sizeof(*finalmix));
180   leftmix = auto_malloc(machine->sample_rate * sizeof(*leftmix));
181   rightmix = auto_malloc(machine->sample_rate * sizeof(*rightmix));
182   finalmix = auto_malloc(machine->sample_rate * sizeof(*finalmix));
192183
193184   /* allocate a global timer for sound timing */
194185   sound_update_timer = timer_alloc(sound_update, NULL);
r1771r1772
202193   VPRINTF(("start_sound_chips\n"));
203194   start_sound_chips();
204195
205   /* then create all the speakers */
206   VPRINTF(("start_speakers\n"));
207   start_speakers();
208
209196   /* finally, do all the routing */
210197   VPRINTF(("route_sound\n"));
211198   route_sound();
r1771r1772
240227   if (wavfile != NULL)
241228      wav_close(wavfile);
242229
243#ifdef MAME_DEBUG
244{
245   int spknum;
246
247   /* log the maximum sample values for all speakers */
248   for (spknum = 0; spknum < totalspeakers; spknum++)
249      if (speaker[spknum].max_sample > 0)
250      {
251         speaker_info *spk = &speaker[spknum];
252         mame_printf_debug("Speaker \"%s\" - max = %d (gain *= %f) - %d%% samples clipped\n", spk->speaker->tag, spk->max_sample, 32767.0 / (spk->max_sample ? spk->max_sample : 1), (int)((double)spk->clipped_samples * 100.0 / spk->total_samples));
253      }
254}
255#endif /* MAME_DEBUG */
256
257230   /* stop all the sound chips */
258231   for (sndnum = 0; sndnum < MAX_SOUND; sndnum++)
259232      if (Machine->config->sound[sndnum].type != SOUND_DUMMY)
260233         sndintrf_exit_sound(sndnum);
261234
262235   /* reset variables */
263   totalspeakers = 0;
264236   totalsnd = 0;
265   memset(&speaker, 0, sizeof(speaker));
266237   memset(&sound, 0, sizeof(sound));
267238}
268239
r1771r1772
363334
364335
365336/*-------------------------------------------------
366    start_speakers - loop over all speakers and
367    initialize them
368-------------------------------------------------*/
369
370static void start_speakers(void)
371{
372   /* reset the speaker array */
373   memset(speaker, 0, sizeof(speaker));
374
375   /* start up all the speakers */
376   for (totalspeakers = 0; totalspeakers < MAX_SPEAKER; totalspeakers++)
377   {
378      const speaker_config *mspeaker = &Machine->config->speaker[totalspeakers];
379      speaker_info *info;
380
381      /* stop when we hit an empty entry */
382      if (mspeaker->tag == NULL)
383         break;
384
385      /* zap all the info */
386      info = &speaker[totalspeakers];
387      memset(info, 0, sizeof(*info));
388
389      /* copy in all the relevant info */
390      info->speaker = mspeaker;
391      info->mixer_stream = NULL;
392      info->inputs = 0;
393   }
394}
395
396
397/*-------------------------------------------------
398337    route_sound - route sound outputs to target
399338    inputs
400339-------------------------------------------------*/
401340
402341static void route_sound(void)
403342{
404   int sndnum, spknum, routenum, outputnum;
343   int sndnum, routenum, outputnum;
344   const device_config *curspeak;
405345
406346   /* iterate over all the sound chips */
407347   for (sndnum = 0; sndnum < totalsnd; sndnum++)
r1771r1772
436376
437377   /* now allocate the mixers and input data */
438378   streams_set_tag(Machine, NULL);
439   for (spknum = 0; spknum < totalspeakers; spknum++)
379   for (curspeak = speaker_output_first(Machine->config); curspeak != NULL; curspeak = speaker_output_next(curspeak))
440380   {
441      speaker_info *info = &speaker[spknum];
381      speaker_info *info = curspeak->token;
442382      if (info->inputs != 0)
443383      {
444384         info->mixer_stream = stream_create(info->inputs, 1, Machine->sample_rate, info, mixer_update);
r1771r1772
446386         info->inputs = 0;
447387      }
448388      else
449         logerror("Warning: speaker \"%s\" has no inputs\n", info->speaker->tag);
389         logerror("Warning: speaker \"%s\" has no inputs\n", info->tag);
450390   }
451391
452392   /* iterate again over all the sound chips */
r1771r1772
480420                        namebuf[0] = '\0';
481421
482422                        /* speaker name, if more than one speaker */
483                  if (totalspeakers > 1)
484                     sprintf(namebuf, "%sSpeaker '%s': ", namebuf, speaker->speaker->tag);
423                  if (speaker_output_count(Machine->config) > 1)
424                     sprintf(namebuf, "%sSpeaker '%s': ", namebuf, speaker->tag);
485425
486426                        /* device name */
487427                  sprintf(namebuf, "%s%s ", namebuf, sndnum_name(sndnum));
r1771r1772
697637static TIMER_CALLBACK( sound_update )
698638{
699639   UINT32 finalmix_step, finalmix_offset;
640   const device_config *curspeak;
700641   int samples_this_update = 0;
701   int sample, spknum;
642   int sample;
702643
703644   VPRINTF(("sound_update\n"));
704645
705646   profiler_mark(PROFILER_SOUND);
706647
707648   /* force all the speaker streams to generate the proper number of samples */
708   for (spknum = 0; spknum < totalspeakers; spknum++)
649   for (curspeak = speaker_output_first(Machine->config); curspeak != NULL; curspeak = speaker_output_next(curspeak))
709650   {
710      speaker_info *spk = &speaker[spknum];
651      speaker_info *spk = curspeak->token;
711652      const stream_sample_t *stream_buf;
712653
713654      /* get the output buffer */
r1771r1772
796737   /* play the result */
797738   if (finalmix_offset > 0)
798739   {
799      osd_update_audio_stream(finalmix, finalmix_offset / 2);
740      osd_update_audio_stream(machine, finalmix, finalmix_offset / 2);
800741      if (wavfile != NULL)
801742         wav_add_data_16(wavfile, finalmix, finalmix_offset);
802743   }
r1771r1772
836777
837778
838779/***************************************************************************
780    SPEAKER OUTPUT DEVICE INTERFACE
781***************************************************************************/
782
783/*-------------------------------------------------
784    speaker_output_start - device start callback
785    for a speaker
786-------------------------------------------------*/
787
788static void *speaker_output_start(running_machine *machine, const char *tag, const void *static_config, const void *inline_config)
789{
790   speaker_info *info;
791
792   /* allocate memory for the speaker information */
793   info = auto_malloc(sizeof(*info));
794   memset(info, 0, sizeof(*info));
795
796   /* copy in all the relevant info */
797   info->speaker = inline_config;
798   info->tag = tag;
799   return info;
800}
801
802
803/*-------------------------------------------------
804    speaker_output_stop - device stop callback
805    for a speaker
806-------------------------------------------------*/
807
808static void speaker_output_stop(running_machine *machine, void *token)
809{
810#ifdef MAME_DEBUG
811   speaker_info *info = token;
812
813   /* log the maximum sample values for all speakers */
814   if (info->max_sample > 0)
815      mame_printf_debug("Speaker \"%s\" - max = %d (gain *= %f) - %d%% samples clipped\n", info->tag, info->max_sample, 32767.0 / (info->max_sample ? info->max_sample : 1), (int)((double)info->clipped_samples * 100.0 / info->total_samples));
816#endif /* MAME_DEBUG */
817}
818
819
820/*-------------------------------------------------
821    speaker_output_set_info - device set info
822    callback
823-------------------------------------------------*/
824
825static void speaker_output_set_info(running_machine *machine, void *token, UINT32 state, const deviceinfo *info)
826{
827   switch (state)
828   {
829      /* no parameters to set */
830   }
831}
832
833
834/*-------------------------------------------------
835    speaker_output_get_info - device get info
836    callback
837-------------------------------------------------*/
838
839void speaker_output_get_info(running_machine *machine, void *token, UINT32 state, deviceinfo *info)
840{
841   switch (state)
842   {
843      /* --- the following bits of info are returned as 64-bit signed integers --- */
844      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = sizeof(speaker_config);      break;
845
846      /* --- the following bits of info are returned as pointers to data or functions --- */
847      case DEVINFO_FCT_SET_INFO:                  info->set_info = speaker_output_set_info;break;
848      case DEVINFO_FCT_START:                     info->start = speaker_output_start;      break;
849      case DEVINFO_FCT_STOP:                     info->stop = speaker_output_stop;      break;
850      case DEVINFO_FCT_RESET:                     /* Nothing */                     break;
851
852      /* --- the following bits of info are returned as NULL-terminated strings --- */
853      case DEVINFO_STR_NAME:                     info->s = "Speaker";               break;
854      case DEVINFO_STR_FAMILY:                  info->s = "Sound";                  break;
855      case DEVINFO_STR_VERSION:                  info->s = "1.0";                  break;
856      case DEVINFO_STR_SOURCE_FILE:               info->s = __FILE__;                  break;
857      case DEVINFO_STR_CREDITS:                  info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
858   }
859}
860
861
862
863/***************************************************************************
839864    MISCELLANEOUS HELPERS
840865***************************************************************************/
841866
r1771r1772
874899
875900INLINE speaker_info *index_to_input(int index, int *input)
876901{
877   int count = 0, speakernum;
902   const device_config *curspeak;
903   int count = 0;
878904
879905   /* scan through the speakers until we find the indexed input */
880   for (speakernum = 0; speakernum < totalspeakers; speakernum++)
906   for (curspeak = speaker_output_first(Machine->config); curspeak != NULL; curspeak = speaker_output_next(curspeak))
881907   {
882      if (index < count + speaker[speakernum].inputs)
908      speaker_info *info = curspeak->token;
909      if (index < count + info->inputs)
883910      {
884911         *input = index - count;
885         return &speaker[speakernum];
912         return info;
886913      }
887      count += speaker[speakernum].inputs;
914      count += info->inputs;
888915   }
889916
890917   /* index out of range */
r1771r1772
899926
900927int sound_get_user_gain_count(void)
901928{
902   int count = 0, speakernum;
929   const device_config *curspeak;
930   int count = 0;
903931
904932   /* count up the number of speaker inputs */
905   for (speakernum = 0; speakernum < totalspeakers; speakernum++)
906      count += speaker[speakernum].inputs;
933   for (curspeak = speaker_output_first(Machine->config); curspeak != NULL; curspeak = speaker_output_next(curspeak))
934   {
935      speaker_info *info = curspeak->token;
936      count += info->inputs;
937   }
907938   return count;
908939}
909940
src/emu/sound.h
r1771r1772
2626
2727
2828/***************************************************************************
29    MACROS
30***************************************************************************/
31
32/* these functions are macros primarily due to include file ordering */
33/* plus, they are very simple */
34#define speaker_output_count(config)      device_list_items((config)->devicelist, SPEAKER_OUTPUT)
35#define speaker_output_first(config)      device_list_first((config)->devicelist, SPEAKER_OUTPUT)
36#define speaker_output_next(previous)      device_list_next((previous), SPEAKER_OUTPUT)
37
38
39
40/***************************************************************************
2941    TYPE DEFINITIONS
3042***************************************************************************/
3143
r1771r1772
5769typedef struct _speaker_config speaker_config;
5870struct _speaker_config
5971{
60   const char *tag;               /* tag for this speaker */
6172   float      x, y, z;            /* positioning vector */
6273};
6374
r1771r1772
8798int sound_find_sndnum_by_tag(const char *tag);
8899
89100
101/* ----- sound speaker device interface ----- */
102
103/* device get info callback */
104#define SPEAKER_OUTPUT speaker_output_get_info
105void speaker_output_get_info(running_machine *machine, void *token, UINT32 state, deviceinfo *info);
106
107
90108#endif   /* __SOUND_H__ */
src/emu/tokenize.h
r0r1772
1/***************************************************************************
2
3    tokenize.h
4
5    Common definitions and macros for tokenizing definitions.
6
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
9
10***************************************************************************/
11
12#pragma once
13
14#ifndef __TOKENIZE_H__
15#define __TOKENIZE_H__
16
17
18/***************************************************************************
19    CONSTANTS
20***************************************************************************/
21
22/* tokens per item */
23#define TOKENS_PER_PTR         (1)
24#define TOKENS_PER_UINT32      (1)
25#define TOKENS_PER_UINT64      (8 / sizeof(FPTR))
26#define TOKENS_PER_ATTOTIME      (TOKENS_PER_UINT32 + TOKENS_PER_UINT64)
27
28
29
30/***************************************************************************
31    MACROS
32***************************************************************************/
33
34/* include this at the top of your union to get the standard fields */
35#define TOKEN_COMMON_FIELDS      \
36   FPTR         i;         \
37   const char *   stringptr;   \
38   const void *   voidptr;   \
39   const UINT8 *   ui8ptr;      \
40   const INT8 *   i8ptr;      \
41   const UINT16 *   ui16ptr;   \
42   const INT16 *   i16ptr;      \
43   const UINT32 *   ui32ptr;   \
44   const INT32 *   i32ptr;      \
45   const UINT64 *   ui64ptr;   \
46   const INT64 *   i64ptr;      \
47
48
49/* ----- compile-time token generation macros ----- */
50
51/* GCC and C99 compilers can use designated initializers for type safety */
52#if (defined(__GNUC__) && (__GNUC__ >= 3)) || (defined(_STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
53#define TOKEN_VALUE(field,a)      { .field = (a) }
54#else
55#define TOKEN_VALUE(field,a)   { (FPTR)(a) }
56#endif
57
58/* token output primitives */
59/* note that regardless of the endianness, UINT64s are packed LSW first */
60#define TOKEN_PTR(field,p)      TOKEN_VALUE(field, p)
61#define TOKEN_STRING(p)         TOKEN_VALUE(stringptr, p)
62#define TOKEN_UINT32(a)         TOKEN_VALUE(i, a)
63#ifdef PTR64
64#define TOKEN_UINT64(a)         TOKEN_VALUE(i, a)
65#else
66#define TOKEN_UINT64(a)         TOKEN_VALUE(i, (UINT32)(a)), TOKEN_VALUE(i, (UINT32)((a) >> 32))
67#endif
68
69/* mask a value to a fixed number of bits and then shift it */
70#define SHIFT_AND_MASK32(val, bits, shift)      (((UINT32)(val) & ((1 << (bits)) - 1)) << (shift))
71#define SHIFT_AND_MASK64(val, bits, shift)      (((UINT64)(val) & (((UINT64)1 << (bits)) - 1)) << (shift))
72
73/* 32-bit integer packing */
74#define TOKEN_UINT32_PACK1(val1, bits1) \
75   TOKEN_UINT32(SHIFT_AND_MASK32((val1), (bits1), 0))
76
77#define TOKEN_UINT32_PACK2(val1, bits1, val2, bits2) \
78   TOKEN_UINT32(SHIFT_AND_MASK32((val1), (bits1), 0) | \
79             SHIFT_AND_MASK32((val2), (bits2), (bits1)))
80
81#define TOKEN_UINT32_PACK3(val1, bits1, val2, bits2, val3, bits3) \
82   TOKEN_UINT32(SHIFT_AND_MASK32((val1), (bits1), 0) | \
83             SHIFT_AND_MASK32((val2), (bits2), (bits1)) | \
84             SHIFT_AND_MASK32((val3), (bits3), (bits1)+(bits2)))
85
86#define TOKEN_UINT32_PACK4(val1, bits1, val2, bits2, val3, bits3, val4, bits4) \
87   TOKEN_UINT32(SHIFT_AND_MASK32((val1), (bits1), 0) | \
88             SHIFT_AND_MASK32((val2), (bits2), (bits1)) | \
89             SHIFT_AND_MASK32((val3), (bits3), (bits1)+(bits2)) | \
90             SHIFT_AND_MASK32((val4), (bits4), (bits1)+(bits2)+(bits3)))
91
92/* 64-bit integer packing */
93#define TOKEN_UINT64_PACK1(val1, bits1) \
94   TOKEN_UINT64(SHIFT_AND_MASK64((val1), (bits1), 0))
95
96#define TOKEN_UINT64_PACK2(val1, bits1, val2, bits2) \
97   TOKEN_UINT64(SHIFT_AND_MASK64((val1), (bits1), 0) | \
98             SHIFT_AND_MASK64((val2), (bits2), (bits1)))
99
100#define TOKEN_UINT64_PACK3(val1, bits1, val2, bits2, val3, bits3) \
101   TOKEN_UINT64(SHIFT_AND_MASK64((val1), (bits1), 0) | \
102             SHIFT_AND_MASK64((val2), (bits2), (bits1)) | \
103             SHIFT_AND_MASK64((val3), (bits3), (bits1)+(bits2)))
104
105#define TOKEN_UINT64_PACK4(val1, bits1, val2, bits2, val3, bits3, val4, bits4) \
106   TOKEN_UINT64(SHIFT_AND_MASK64((val1), (bits1), 0) | \
107             SHIFT_AND_MASK64((val2), (bits2), (bits1)) | \
108             SHIFT_AND_MASK64((val3), (bits3), (bits1)+(bits2)) | \
109             SHIFT_AND_MASK64((val4), (bits4), (bits1)+(bits2)+(bits3)))
110
111
112
113/* ----- run-time token extraction macros ----- */
114
115/* token fetch and advance primitives */
116#define TOKEN_GET_PTR(tp,field)      (((tp)++)->field)
117#define TOKEN_GET_STRING(tp)      (((tp)++)->stringptr)
118#define TOKEN_GET_UINT32(tp)      (((tp)++)->i)
119#ifdef PTR64
120#define TOKEN_EXTRACT_UINT64(tp,a)   do { (a) = (tp)->i; (tp)++; } while (0)
121#else
122#define TOKEN_EXTRACT_UINT64(tp,a)   do { (a) = (tp)[0].i | ((UINT64)(tp)[1].i << 32); (tp) += 2; } while (0)
123#endif
124
125/* token unfetch primitives */
126#define TOKEN_UNGET_PTR(tp)         ((tp)--)
127#define TOKEN_UNGET_STRING(tp)      ((tp)--)
128#define TOKEN_UNGET_UINT32(tp)      ((tp)--)
129#define TOKEN_UNGET_UINT64(tp)      ((tp) -= 8 / sizeof(FPTR))
130
131/* extract a value from a fixed number of bits; if bits is negative, treat it as a signed value */
132#define UNSHIFT_AND_MASK32(src, val, bits, shift)   do { \
133   if ((bits) < 0) \
134      (val) = token_sign_extend32((src) >> (shift), -(bits)); \
135   else \
136      (val) = token_zero_extend32((src) >> (shift), (bits)); \
137} while (0)
138
139#define UNSHIFT_AND_MASK64(src, val, bits, shift)   do { \
140   if ((bits) < 0) \
141      (val) = token_sign_extend64((src) >> (shift), -(bits)); \
142   else \
143      (val) = token_zero_extend64((src) >> (shift), (bits)); \
144} while (0)
145
146/* cheesy inline absolute value */
147#define TOKENABS(v)      (((v) < 0) ? -(v) : (v))
148
149/* 32-bit integer unpacking */
150#define TOKEN_GET_UINT32_UNPACK1(tp, val1, bits1) do { \
151   UINT32 token32 = TOKEN_GET_UINT32(tp); \
152   UNSHIFT_AND_MASK32(token32, val1, (bits1), 0); \
153} while (0)
154
155#define TOKEN_GET_UINT32_UNPACK2(tp, val1, bits1, val2, bits2) do { \
156   UINT32 token32 = TOKEN_GET_UINT32(tp); \
157   UINT8 shift = 0; \
158   UNSHIFT_AND_MASK32(token32, val1, (bits1), shift); shift += TOKENABS(bits1); \
159   UNSHIFT_AND_MASK32(token32, val2, (bits2), shift); \
160} while (0)
161
162#define TOKEN_GET_UINT32_UNPACK3(tp, val1, bits1, val2, bits2, val3, bits3) do { \
163   UINT32 token32 = TOKEN_GET_UINT32(tp); \
164   UINT8 shift = 0; \
165   UNSHIFT_AND_MASK32(token32, val1, (bits1), shift); shift += TOKENABS(bits1); \
166   UNSHIFT_AND_MASK32(token32, val2, (bits2), shift); shift += TOKENABS(bits2); \
167   UNSHIFT_AND_MASK32(token32, val3, (bits3), shift); \
168} while (0)
169
170#define TOKEN_GET_UINT32_UNPACK4(tp, val1, bits1, val2, bits2, val3, bits3, val4, bits4) do { \
171   UINT32 token32 = TOKEN_GET_UINT32(tp); \
172   UINT8 shift = 0; \
173   UNSHIFT_AND_MASK32(token32, val1, (bits1), shift); shift += TOKENABS(bits1); \
174   UNSHIFT_AND_MASK32(token32, val2, (bits2), shift); shift += TOKENABS(bits2); \
175   UNSHIFT_AND_MASK32(token32, val3, (bits3), shift); shift += TOKENABS(bits3); \
176   UNSHIFT_AND_MASK32(token32, val4, (bits4), shift); \
177} while (0)
178
179/* 64-bit integer unpacking */
180#define TOKEN_GET_UINT64_UNPACK1(tp, val1, bits1) do { \
181   UINT64 token64; \
182   TOKEN_EXTRACT_UINT64(tp, token64); \
183   UNSHIFT_AND_MASK64(token64, val1, (bits1), 0); \
184} while (0)
185
186#define TOKEN_GET_UINT64_UNPACK2(tp, val1, bits1, val2, bits2) do { \
187   UINT64 token64; \
188   UINT8 shift = 0; \
189   TOKEN_EXTRACT_UINT64(tp, token64); \
190   UNSHIFT_AND_MASK64(token64, val1, (bits1), shift); shift += TOKENABS(bits1); \
191   UNSHIFT_AND_MASK64(token64, val2, (bits2), shift); \
192} while (0)
193
194#define TOKEN_GET_UINT64_UNPACK3(tp, val1, bits1, val2, bits2, val3, bits3) do { \
195   UINT64 token64; \
196   UINT8 shift = 0; \
197   TOKEN_EXTRACT_UINT64(tp, token64); \
198   UNSHIFT_AND_MASK64(token64, val1, (bits1), shift); shift += TOKENABS(bits1); \
199   UNSHIFT_AND_MASK64(token64, val2, (bits2), shift); shift += TOKENABS(bits2); \
200   UNSHIFT_AND_MASK64(token64, val3, (bits3), shift); \
201} while (0)
202
203#define TOKEN_GET_UINT64_UNPACK4(tp, val1, bits1, val2, bits2, val3, bits3, val4, bits4) do { \
204   UINT64 token64; \
205   UINT8 shift = 0; \
206   TOKEN_EXTRACT_UINT64(tp, token64); \
207   UNSHIFT_AND_MASK64(token64, val1, (bits1), shift); shift += TOKENABS(bits1); \
208   UNSHIFT_AND_MASK64(token64, val2, (bits2), shift); shift += TOKENABS(bits2); \
209   UNSHIFT_AND_MASK64(token64, val3, (bits3), shift); shift += TOKENABS(bits3); \
210   UNSHIFT_AND_MASK64(token64, val4, (bits4), shift); \
211} while (0)
212
213
214
215/***************************************************************************
216    INLINE FUNCTIONS
217***************************************************************************/
218
219INLINE UINT32 token_zero_extend32(UINT32 val, UINT8 bits)
220{
221   return val & (((UINT32)1 << bits) - 1);
222}
223
224INLINE INT32 token_sign_extend32(UINT32 val, UINT8 bits)
225{
226   return (INT32)(val << (32 - bits)) >> (32 - bits);
227}
228
229INLINE UINT64 token_zero_extend64(UINT64 val, UINT8 bits)
230{
231   return val & (((UINT64)1 << bits) - 1);
232}
233
234INLINE INT64 token_sign_extend64(UINT64 val, UINT8 bits)
235{
236   return (INT64)(val << (64 - bits)) >> (64 - bits);
237}
238
239#endif
src/emu/driver.h
r1771r1772
1919    MACROS (must be *before* the includes below)
2020***************************************************************************/
2121
22#include "mamecore.h"
23
2224#define DRIVER_INIT(name)         void driver_init_##name(running_machine *machine)
2325#define DRIVER_INIT_CALL(name)      driver_init_##name(machine)
2426
r1771r1772
7072#define video_update_NULL          NULL
7173
7274
75typedef void (*driver_init_func)(running_machine *machine);
76typedef void (*nvram_handler_func)(running_machine *machine, mame_file *file, int read_or_write);
77typedef void (*memcard_handler_func)(running_machine *machine, mame_file *file, int action);
78typedef void (*machine_start_func)(running_machine *machine);
79typedef void (*machine_reset_func)(running_machine *machine);
80typedef void (*sound_start_func)(running_machine *machine);
81typedef void (*sound_reset_func)(running_machine *machine);
82typedef void (*video_start_func)(running_machine *machine);
83typedef void (*video_reset_func)(running_machine *machine);
84typedef void (*palette_init_func)(running_machine *machine, const UINT8 *color_prom);
85typedef void (*video_eof_func)(running_machine *machine);
86typedef UINT32 (*video_update_func)(running_machine *machine, int screen, mame_bitmap *bitmap, const rectangle *cliprect);
7387
88
89
7490/***************************************************************************
7591    INCLUDES
7692***************************************************************************/
r1771r1772
147163   const char *      description;            /* full name of the game */
148164   const char *      year;                  /* year the game was released */
149165   const char *      manufacturer;            /* manufacturer of the game */
150   void             (*drv)(machine_config *);   /* machine driver constructor */
166   const machine_config_token *machine_config;      /* machine driver tokens */
151167   const input_port_token *ipt;               /* pointer to array of input port tokens */
152168   void            (*driver_init)(running_machine *machine); /* DRIVER_INIT callback */
153169   const rom_entry *   rom;                  /* pointer to list of ROMs for the game */
r1771r1772
179195   FULLNAME,                        \
180196   #YEAR,                           \
181197   COMPANY,                        \
182   construct_##MACHINE,               \
198   machine_config_##MACHINE,            \
183199   ipt_##INPUT,                     \
184200   driver_init_##INIT,                  \
185201   rom_##NAME,                        \
src/emu/drawgfx.c
r1771r1772
99
1010*********************************************************************/
1111
12#ifndef DECLARE
12#ifndef DECLAREG
1313
1414#include "driver.h"
1515#include "profiler.h"
r1771r1772
603603static int afterdrawmask = 31;
604604int pdrawgfx_shadow_lowpri = 0;
605605
606
607/* 8-bit version */
606/* 8-bit version (only used to generate the draw_scanline family of functions) */
608607#define DATA_TYPE UINT8
609608#define DEPTH 8
610
611#define DECLARE(function,args,body)
612#define DECLAREG(function,args,body)
613
614#define HMODULO 1
615#define VMODULO dstmodulo
616#define COMMON_ARGS                                          \
617      const UINT8 *srcdata,int srcwidth,int srcheight,int srcmodulo,   \
618      int leftskip,int topskip,int flipx,int flipy,               \
619      DATA_TYPE *dstdata,int dstwidth,int dstheight,int dstmodulo
620
621#define RAW 1
622#define COLOR_ARG unsigned int colorbase,UINT8 *pridata,UINT32 pmask
623#define INCREMENT_DST(n) {dstdata+=(n);pridata += (n);}
624#define LOOKUP(n) (colorbase + (n))
625#define SETPIXELCOLOR(dest,n) { if (((1 << (pridata[dest] & 0x1f)) & pmask) == 0) { if (pridata[dest] & 0x80) { dstdata[dest] = palette_shadow_table[n];} else { dstdata[dest] = (n);} } pridata[dest] = (pridata[dest] & 0x7f) | afterdrawmask; }
626#define DECLARE_SWAP_RAW_PRI(function,args,body) static void function##_raw_pri8 args body
627#include "drawgfx.c"
628#undef DECLARE_SWAP_RAW_PRI
629#undef COLOR_ARG
630#undef LOOKUP
631#undef SETPIXELCOLOR
632#undef RAW
633
634#define RAW 0
635#define COLOR_ARG const pen_t *paldata,UINT8 *pridata,UINT32 pmask
636#define LOOKUP(n) (paldata[n])
637#define SETPIXELCOLOR(dest,n) { if (((1 << (pridata[dest] & 0x1f)) & pmask) == 0) { if (pridata[dest] & 0x80) { dstdata[dest] = palette_shadow_table[n];} else { dstdata[dest] = (n);} } pridata[dest] = (pridata[dest] & 0x7f) | afterdrawmask; }
638#define DECLARE_SWAP_RAW_PRI(function,args,body) static void function##_pri8 args body
639#include "drawgfx.c"
640#undef DECLARE_SWAP_RAW_PRI
641#undef COLOR_ARG
642#undef LOOKUP
643#undef INCREMENT_DST
644#undef SETPIXELCOLOR
645#undef RAW
646
647#define RAW 1
648#define COLOR_ARG unsigned int colorbase
649#define INCREMENT_DST(n) {dstdata+=(n);}
650#define LOOKUP(n) (colorbase + (n))
651#define SETPIXELCOLOR(dest,n) {dstdata[dest] = (n);}
652#define DECLARE_SWAP_RAW_PRI(function,args,body) static void function##_raw8 args body
653#include "drawgfx.c"
654#undef DECLARE_SWAP_RAW_PRI
655#undef COLOR_ARG
656#undef LOOKUP
657#undef SETPIXELCOLOR
658#undef RAW
659
660#define RAW 0
661#define COLOR_ARG const pen_t *paldata
662#define LOOKUP(n) (paldata[n])
663#define SETPIXELCOLOR(dest,n) {dstdata[dest] = (n);}
664#define DECLARE_SWAP_RAW_PRI(function,args,body) static void function##8 args body
665#include "drawgfx.c"
666#undef DECLARE_SWAP_RAW_PRI
667#undef COLOR_ARG
668#undef LOOKUP
669#undef INCREMENT_DST
670#undef SETPIXELCOLOR
671
672#undef HMODULO
673#undef VMODULO
674#undef COMMON_ARGS
675#undef DECLARE
676#undef DECLAREG
677
678#define DECLARE(function,args,body) static void function##8 args body
679609#define DECLAREG(function,args,body) void function##8 args body
680#define DECLARE_SWAP_RAW_PRI(function,args,body)
681#define BLOCKMOVE(function,flipx,args) \
682   if (flipx) blockmove_##function##_flipx##8 args ; \
683   else blockmove_##function##8 args
684#define BLOCKMOVELU(function,args) \
685   blockmove_##function##8 args
686#define BLOCKMOVERAW(function,args) \
687   blockmove_##function##_raw##8 args
688#define BLOCKMOVEPRI(function,args) \
689   blockmove_##function##_pri##8 args
690#define BLOCKMOVERAWPRI(function,args) \
691   blockmove_##function##_raw_pri##8 args
692610#include "drawgfx.c"
693#undef DECLARE
694#undef DECLARE_SWAP_RAW_PRI
695611#undef DECLAREG
696#undef BLOCKMOVE
697#undef BLOCKMOVELU
698#undef BLOCKMOVERAW
699#undef BLOCKMOVEPRI
700#undef BLOCKMOVERAWPRI
701
702#undef RAW
703612#undef DEPTH
704613#undef DATA_TYPE
705614
r1771r1772
938847      const rectangle *clip,int transparency,int transparent_color,
939848      mame_bitmap *pri_buffer,UINT32 pri_mask)
940849{
941   assert_always(gfx, "drawgfx() gfx == 0");
850   assert(dest != NULL);
851   assert((dest->bpp == 16) || (dest->bpp == 32));
852   assert(gfx != NULL);
942853
943854   code %= gfx->total_elements;
944855
945856   if (transparency != TRANSPARENCY_PEN_RAW)
946857      color %= gfx->total_colors;
947858
948   if ((dest->format == BITMAP_FORMAT_INDEXED8 || dest->format == BITMAP_FORMAT_INDEXED16 || dest->format == BITMAP_FORMAT_INDEXED32) &&
859   if ((dest->format == BITMAP_FORMAT_INDEXED16 || dest->format == BITMAP_FORMAT_INDEXED32) &&
949860      (transparency == TRANSPARENCY_ALPHA || transparency == TRANSPARENCY_ALPHARANGE))
950861   {
951862      transparency = TRANSPARENCY_PEN;
r1771r1772
973884         transparency = TRANSPARENCY_NONE;
974885   }
975886
976   if (dest->bpp == 8)
977      drawgfx_core8(dest,gfx,code,color,flipx,flipy,sx,sy,clip,transparency,transparent_color,pri_buffer,pri_mask);
978   else if (dest->bpp == 16)
887   if (dest->bpp == 16)
979888      drawgfx_core16(dest,gfx,code,color,flipx,flipy,sx,sy,clip,transparency,transparent_color,pri_buffer,pri_mask);
980   else if (dest->bpp == 32)
889   else
981890      drawgfx_core32(dest,gfx,code,color,flipx,flipy,sx,sy,clip,transparency,transparent_color,pri_buffer,pri_mask);
982891}
983892
r1771r1772
1017926static void copybitmap_common(mame_bitmap *dest,mame_bitmap *src,int flipx,int flipy,int sx,int sy,
1018927      const rectangle *clip,int transparency,int transparent_color)
1019928{
929   assert(dest != NULL);
930   assert(src != NULL);
931   assert((dest->bpp == 16) || (dest->bpp == 32));
932   assert(dest->bpp == src->bpp);
933
1020934   profiler_mark(PROFILER_COPYBITMAP);
1021935
1022   if (dest->bpp == 8)
1023      copybitmap_core8(dest,src,flipx,flipy,sx,sy,clip,transparency,transparent_color);
1024   else if (dest->bpp == 16)
936   if (dest->bpp == 16)
1025937      copybitmap_core16(dest,src,flipx,flipy,sx,sy,clip,transparency,transparent_color);
1026   else if (dest->bpp == 32)
938   else
1027939      copybitmap_core32(dest,src,flipx,flipy,sx,sy,clip,transparency,transparent_color);
1028940
1029941   profiler_mark(PROFILER_END);
r1771r1772
1063975   int srcwidth,srcheight,destwidth,destheight;
1064976   rectangle orig_clip;
1065977
978   assert(dest != NULL);
979   assert(src != NULL);
980   assert((dest->bpp == 16) || (dest->bpp == 32));
981   assert(dest->bpp == src->bpp);
982   assert((rows != 0) || (rowscroll == NULL));
983   assert((rows == 0) || (rowscroll != NULL));
984   assert((cols != 0) || (colscroll == NULL));
985   assert((cols == 0) || (colscroll != NULL));
986
1066987   if (clip)
1067988   {
1068989      orig_clip.min_x = clip->min_x;
r1771r1772
13081229      UINT32 startx,UINT32 starty,int incxx,int incxy,int incyx,int incyy,int wraparound,
13091230      const rectangle *clip,int transparency,int transparent_color,UINT32 priority)
13101231{
1232   assert(dest != NULL);
1233   assert(src != NULL);
1234   assert((dest->bpp == 16) || (dest->bpp == 32));
1235   assert(dest->bpp == src->bpp);
1236
13111237   profiler_mark(PROFILER_COPYBITMAP);
13121238
13131239   /* cheat, the core doesn't support TRANSPARENCY_NONE yet */
r1771r1772
13231249      return;
13241250   }
13251251
1326   if (dest->bpp == 8)
1327      copyrozbitmap_core8(dest,src,startx,starty,incxx,incxy,incyx,incyy,wraparound,clip,transparency,transparent_color,priority);
1328   else if (dest->bpp == 16)
1252   if (dest->bpp == 16)
13291253      copyrozbitmap_core16(dest,src,startx,starty,incxx,incxy,incyx,incyy,wraparound,clip,transparency,transparent_color,priority);
1330   else if (dest->bpp == 32)
1254   else
13311255      copyrozbitmap_core32(dest,src,startx,starty,incxx,incxy,incyx,incyy,wraparound,clip,transparency,transparent_color,priority);
13321256
13331257   profiler_mark(PROFILER_END);
r1771r1772
13401264      const rectangle *clip,int transparency,int transparent_color,
13411265      int scalex, int scaley,mame_bitmap *pri_buffer,UINT32 pri_mask)
13421266{
1343   rectangle myclip;
1267   /* verify arguments */
1268   assert(dest_bmp != NULL);
1269   assert((dest_bmp->bpp == 16) || (dest_bmp->bpp == 32));
1270   assert(gfx != NULL);
13441271
1345   UINT8 ah, al;
1272   if ((scalex == 0) || (scaley == 0)) return;
13461273
1347   al = (pdrawgfx_shadow_lowpri) ? 0 : 0x80;
1348
1349   if (!scalex || !scaley) return;
1350
13511274   if (scalex == 0x10000 && scaley == 0x10000)
13521275   {
13531276      common_drawgfx(dest_bmp,gfx,code,color,flipx,flipy,sx,sy,clip,transparency,transparent_color,pri_buffer,pri_mask);
13541277      return;
13551278   }
13561279
1357   if ((dest_bmp->format == BITMAP_FORMAT_INDEXED8 || dest_bmp->format == BITMAP_FORMAT_INDEXED16 || dest_bmp->format == BITMAP_FORMAT_INDEXED32) &&
1280   if ((dest_bmp->format == BITMAP_FORMAT_INDEXED16 || dest_bmp->format == BITMAP_FORMAT_INDEXED32) &&
13581281      (transparency == TRANSPARENCY_ALPHA || transparency == TRANSPARENCY_ALPHARANGE))
13591282   {
13601283      transparency = TRANSPARENCY_PEN;
r1771r1772
13721295   /* force clip to bitmap boundary */
13731296   if (clip)
13741297   {
1298      rectangle myclip;
1299
13751300      myclip.min_x = clip->min_x;
13761301      myclip.max_x = clip->max_x;
13771302      myclip.min_y = clip->min_y;
r1771r1772
13861311   }
13871312
13881313
1389   /* 8-bit destination bitmap */
1390   if (dest_bmp->bpp == 8)
1314   /* 16-bit destination bitmap */
1315   if (dest_bmp->bpp == 16)
13911316   {
1392      if( gfx )
1317      const pen_t *pal = &Machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
1318      UINT8 *source_base = gfx->gfxdata + (code % gfx->total_elements) * gfx->char_modulo;
1319
1320      int sprite_screen_height = (scaley*gfx->height+0x8000)>>16;
1321      int sprite_screen_width = (scalex*gfx->width+0x8000)>>16;
1322
1323      if (sprite_screen_width && sprite_screen_height)
13931324      {
1394         UINT32 palbase = gfx->color_base + gfx->color_granularity * (color % gfx->total_colors);
1395         UINT8 *source_base = gfx->gfxdata + (code % gfx->total_elements) * gfx->char_modulo;
1325         /* compute sprite increment per screen pixel */
1326         int dx = (gfx->width<<16)/sprite_screen_width;
1327         int dy = (gfx->height<<16)/sprite_screen_height;
13961328
1397         int sprite_screen_height = (scaley*gfx->height+0x8000)>>16;
1398         int sprite_screen_width = (scalex*gfx->width+0x8000)>>16;
1329         int ex = sx+sprite_screen_width;
1330         int ey = sy+sprite_screen_height;
13991331
1400         if (sprite_screen_width && sprite_screen_height)
1332         int x_index_base;
1333         int y_index;
1334
1335         if( flipx )
14011336         {
1402            /* compute sprite increment per screen pixel */
1403            int dx = (gfx->width<<16)/sprite_screen_width;
1404            int dy = (gfx->height<<16)/sprite_screen_height;
1337            x_index_base = (sprite_screen_width-1)*dx;
1338            dx = -dx;
1339         }
1340         else
1341         {
1342            x_index_base = 0;
1343         }
14051344
1406            int ex = sx+sprite_screen_width;
1407            int ey = sy+sprite_screen_height;
1345         if( flipy )
1346         {
1347            y_index = (sprite_screen_height-1)*dy;
1348            dy = -dy;
1349         }
1350         else
1351         {
1352            y_index = 0;
1353         }
14081354
1409            int x_index_base;
1410            int y_index;
1411
1412            if( flipx )
1413            {
1414               x_index_base = (sprite_screen_width-1)*dx;
1415               dx = -dx;
1355         if( clip )
1356         {
1357            if( sx < clip->min_x)
1358            { /* clip left */
1359               int pixels = clip->min_x-sx;
1360               sx += pixels;
1361               x_index_base += pixels*dx;
14161362            }
1417            else
1418            {
1419               x_index_base = 0;
1363            if( sy < clip->min_y )
1364            { /* clip top */
1365               int pixels = clip->min_y-sy;
1366               sy += pixels;
1367               y_index += pixels*dy;
14201368            }
1421
1422            if( flipy )
1423            {
1424               y_index = (sprite_screen_height-1)*dy;
1425               dy = -dy;
1369            /* NS 980211 - fixed incorrect clipping */
1370            if( ex > clip->max_x+1 )
1371            { /* clip right */
1372               int pixels = ex-clip->max_x-1;
1373               ex -= pixels;
14261374            }
1427            else
1428            {
1429               y_index = 0;
1375            if( ey > clip->max_y+1 )
1376            { /* clip bottom */
1377               int pixels = ey-clip->max_y-1;
1378               ey -= pixels;
14301379            }
1380         }
14311381
1432            if( clip )
1433            {
1434               if( sx < clip->min_x)
1435               { /* clip left */
1436                  int pixels = clip->min_x-sx;
1437                  sx += pixels;
1438                  x_index_base += pixels*dx;
1439               }
1440               if( sy < clip->min_y )
1441               { /* clip top */
1442                  int pixels = clip->min_y-sy;
1443                  sy += pixels;
1444                  y_index += pixels*dy;
1445               }
1446               /* NS 980211 - fixed incorrect clipping */
1447               if( ex > clip->max_x+1 )
1448               { /* clip right */
1449                  int pixels = ex-clip->max_x-1;
1450                  ex -= pixels;
1451               }
1452               if( ey > clip->max_y+1 )
1453               { /* clip bottom */
1454                  int pixels = ey-clip->max_y-1;
1455                  ey -= pixels;
1456               }
1457            }
1382         if( ex>sx )
1383         { /* skip if inner loop doesn't draw anything */
1384            int y;
14581385
1459            if( ex>sx )
1460            { /* skip if inner loop doesn't draw anything */
1461               int y;
1462
1463               /* case 0: TRANSPARENCY_NONE */
1464               if (transparency == TRANSPARENCY_NONE)
1386            /* case 0: TRANSPARENCY_NONE */
1387            if (transparency == TRANSPARENCY_NONE)
1388            {
1389               if (pri_buffer)
14651390               {
1466                  if (pri_buffer)
1391                  if (gfx->flags & GFX_ELEMENT_PACKED)
14671392                  {
1468                     if (gfx->flags & GFX_ELEMENT_PACKED)
1393                     for( y=sy; y<ey; y++ )
14691394                     {
1470                        for( y=sy; y<ey; y++ )
1471                        {
1472                           UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1473                           UINT8 *dest = BITMAP_ADDR8(dest_bmp, y, 0);
1474                           UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
1395                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1396                        UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
1397                        UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
14751398
1476                           int x, x_index = x_index_base;
1477                           for( x=sx; x<ex; x++ )
1478                           {
1479                              if (((1 << pri[x]) & pri_mask) == 0)
1480                                 dest[x] = palbase + ((source[x_index>>17] >> ((x_index & 0x10000) >> 14)) & 0x0f);
1481                              pri[x] = 31;
1482                              x_index += dx;
1483                           }
1484
1485                           y_index += dy;
1486                        }
1487                     }
1488                     else
1489                     {
1490                        for( y=sy; y<ey; y++ )
1399                        int x, x_index = x_index_base;
1400                        for( x=sx; x<ex; x++ )
14911401                        {
1492                           UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1493                           UINT8 *dest = BITMAP_ADDR8(dest_bmp, y, 0);
1494                           UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
1495
1496                           int x, x_index = x_index_base;
1497                           for( x=sx; x<ex; x++ )
1498                           {
1499                              if (((1 << pri[x]) & pri_mask) == 0)
1500                                 dest[x] = palbase + source[x_index>>16];
1501                              x_index += dx;
1502                           }
1503
1504                           y_index += dy;
1402                           if (((1 << pri[x]) & pri_mask) == 0)
1403                              dest[x] = pal[(source[x_index>>17] >> ((x_index & 0x10000) >> 14)) & 0x0f];
1404                           pri[x] = 31;
1405                           x_index += dx;
15051406                        }
1407
1408                        y_index += dy;
15061409                     }
15071410                  }
15081411                  else
15091412                  {
1510                     if (gfx->flags & GFX_ELEMENT_PACKED)
1413                     for( y=sy; y<ey; y++ )
15111414                     {
1512                        for( y=sy; y<ey; y++ )
1513                        {
1514                           UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1515                           UINT8 *dest = BITMAP_ADDR8(dest_bmp, y, 0);
1415                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1416                        UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
1417                        UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
15161418
1517                           int x, x_index = x_index_base;
1518                           for( x=sx; x<ex; x++ )
1519                           {
1520                              dest[x] = palbase + ((source[x_index>>17] >> ((x_index & 0x10000) >> 14)) & 0x0f);
1521                              x_index += dx;
1522                           }
1523
1524                           y_index += dy;
1525                        }
1526                     }
1527                     else
1528                     {
1529                        for( y=sy; y<ey; y++ )
1419                        int x, x_index = x_index_base;
1420                        for( x=sx; x<ex; x++ )
15301421                        {
1531                           UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1532                           UINT8 *dest = BITMAP_ADDR8(dest_bmp, y, 0);
1533
1534                           int x, x_index = x_index_base;
1535                           for( x=sx; x<ex; x++ )
1536                           {
1537                              dest[x] = palbase + source[x_index>>16];
1538                              x_index += dx;
1539                           }
1540
1541                           y_index += dy;
1422                           if (((1 << pri[x]) & pri_mask) == 0)
1423                              dest[x] = pal[source[x_index>>16]];
1424                           pri[x] = 31;
1425                           x_index += dx;
15421426                        }
1543                     }
1544                  }
1545               }
15461427
1547               /* case 1: TRANSPARENCY_PEN */
1548               if (transparency == TRANSPARENCY_PEN)
1549               {
1550                  if (pri_buffer)
1551                  {
1552                     if (gfx->flags & GFX_ELEMENT_PACKED)
1553                     {
1554                        for( y=sy; y<ey; y++ )
1555                        {
1556                           UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1557                           UINT8 *dest = BITMAP_ADDR8(dest_bmp, y, 0);
1558                           UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
1559
1560                           int x, x_index = x_index_base;
1561                           for( x=sx; x<ex; x++ )
1562                           {
1563                              int c = (source[x_index>>17] >> ((x_index & 0x10000) >> 14)) & 0x0f;
1564                              if( c != transparent_color )
1565                              {
1566                                 if (((1 << pri[x]) & pri_mask) == 0)
1567                                    dest[x] = palbase + c;
1568                                 pri[x] = 31;
1569                              }
1570                              x_index += dx;
1571                           }
1572
1573                           y_index += dy;
1574                        }
1428                        y_index += dy;
15751429                     }
1576                     else
1577                     {
1578                        for( y=sy; y<ey; y++ )
1579                        {
1580                           UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1581                           UINT8 *dest = BITMAP_ADDR8(dest_bmp, y, 0);
1582                           UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
1583
1584                           int x, x_index = x_index_base;
1585                           for( x=sx; x<ex; x++ )
1586                           {
1587                              int c = source[x_index>>16];
1588                              if( c != transparent_color )
1589                              {
1590                                 if (((1 << pri[x]) & pri_mask) == 0)
1591                                    dest[x] = palbase + c;
1592                                 pri[x] = 31;
1593                              }
1594                              x_index += dx;
1595                           }
1596
1597                           y_index += dy;
1598                        }
1599                     }
16001430                  }
1601                  else
1602                  {
1603                     if (gfx->flags & GFX_ELEMENT_PACKED)
1604                     {
1605                        for( y=sy; y<ey; y++ )
1606                        {
1607                           UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1608                           UINT8 *dest = BITMAP_ADDR8(dest_bmp, y, 0);
1609
1610                           int x, x_index = x_index_base;
1611                           for( x=sx; x<ex; x++ )
1612                           {
1613                              int c = (source[x_index>>17] >> ((x_index & 0x10000) >> 14)) & 0x0f;
1614                              if( c != transparent_color ) dest[x] = palbase + c;
1615                              x_index += dx;
1616                           }
1617
1618                           y_index += dy;
1619                        }
1620                     }
1621                     else
1622                     {
1623                        for( y=sy; y<ey; y++ )
1624                        {
1625                           UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1626                           UINT8 *dest = BITMAP_ADDR8(dest_bmp, y, 0);
1627
1628                           int x, x_index = x_index_base;
1629                           for( x=sx; x<ex; x++ )
1630                           {
1631                              int c = source[x_index>>16];
1632                              if( c != transparent_color ) dest[x] = palbase + c;
1633                              x_index += dx;
1634                           }
1635
1636                           y_index += dy;
1637                        }
1638                     }
1639                  }
16401431               }
1641
1642               /* case 1b: TRANSPARENCY_PEN_RAW */
1643               if (transparency == TRANSPARENCY_PEN_RAW)
1432               else
16441433               {
1645                  if (pri_buffer)
1434                  if (gfx->flags & GFX_ELEMENT_PACKED)
16461435                  {
16471436                     for( y=sy; y<ey; y++ )
16481437                     {
16491438                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1650                        UINT8 *dest = BITMAP_ADDR8(dest_bmp, y, 0);
1651                        UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
1439                        UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
16521440
16531441                        int x, x_index = x_index_base;
16541442                        for( x=sx; x<ex; x++ )
16551443                        {
1656                           int c = source[x_index>>16];
1657                           if( c != transparent_color )
1658                           {
1659                              if (((1 << pri[x]) & pri_mask) == 0)
1660                                 dest[x] = color + c;
1661                              pri[x] = 31;
1662                           }
1444                           dest[x] = pal[(source[x_index>>17] >> ((x_index & 0x10000) >> 14)) & 0x0f];
16631445                           x_index += dx;
16641446                        }
16651447
r1771r1772
16711453                     for( y=sy; y<ey; y++ )
16721454                     {
16731455                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1674                        UINT8 *dest = BITMAP_ADDR8(dest_bmp, y, 0);
1456                        UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
16751457
16761458                        int x, x_index = x_index_base;
16771459                        for( x=sx; x<ex; x++ )
16781460                        {
1679                           int c = source[x_index>>16];
1680                           if( c != transparent_color ) dest[x] = color + c;
1461                           dest[x] = pal[source[x_index>>16]];
16811462                           x_index += dx;
16821463                        }
16831464
r1771r1772
16851466                     }
16861467                  }
16871468               }
1469            }
16881470
1689               /* case 2: TRANSPARENCY_PENS */
1690               if (transparency == TRANSPARENCY_PENS)
1471            /* case 1: TRANSPARENCY_PEN */
1472            if (transparency == TRANSPARENCY_PEN)
1473            {
1474               if (pri_buffer)
16911475               {
1692                  if (pri_buffer)
1476                  if (gfx->flags & GFX_ELEMENT_PACKED)
16931477                  {
16941478                     for( y=sy; y<ey; y++ )
16951479                     {
16961480                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1697                        UINT8 *dest = BITMAP_ADDR8(dest_bmp, y, 0);
1481                        UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
16981482                        UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
16991483
17001484                        int x, x_index = x_index_base;
17011485                        for( x=sx; x<ex; x++ )
17021486                        {
1703                           int c = source[x_index>>16];
1704                           if (((1 << c) & transparent_color) == 0)
1487                           int c = (source[x_index>>17] >> ((x_index & 0x10000) >> 14)) & 0x0f;
1488                           if( c != transparent_color )
17051489                           {
17061490                              if (((1 << pri[x]) & pri_mask) == 0)
1707                                 dest[x] = palbase + c;
1491                                 dest[x] = pal[c];
17081492                              pri[x] = 31;
17091493                           }
17101494                           x_index += dx;
r1771r1772
17181502                     for( y=sy; y<ey; y++ )
17191503                     {
17201504                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1721                        UINT8 *dest = BITMAP_ADDR8(dest_bmp, y, 0);
1505                        UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
1506                        UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
17221507
17231508                        int x, x_index = x_index_base;
17241509                        for( x=sx; x<ex; x++ )
17251510                        {
17261511                           int c = source[x_index>>16];
1727                           if (((1 << c) & transparent_color) == 0)
1728                              dest[x] = palbase + c;
1512                           if( c != transparent_color )
1513                           {
1514                              if (((1 << pri[x]) & pri_mask) == 0)
1515                                 dest[x] = pal[c];
1516                              pri[x] = 31;
1517                           }
17291518                           x_index += dx;
17301519                        }
17311520
r1771r1772
17331522                     }
17341523                  }
17351524               }
1736
1737               /* case 3: TRANSPARENCY_PEN_TABLE */
1738               if (transparency == TRANSPARENCY_PEN_TABLE)
1525               else
17391526               {
1740                  pen_t *palette_shadow_table = Machine->shadow_table;
1741                  if (pri_buffer)
1527                  if (gfx->flags & GFX_ELEMENT_PACKED)
17421528                  {
17431529                     for( y=sy; y<ey; y++ )
17441530                     {
17451531                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1746                        UINT8 *dest = BITMAP_ADDR8(dest_bmp, y, 0);
1747                        UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
1532                        UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
17481533
17491534                        int x, x_index = x_index_base;
17501535                        for( x=sx; x<ex; x++ )
17511536                        {
1752                           int c = source[x_index>>16];
1753                           if( c != transparent_color )
1754                           {
1755                              switch(gfx_drawmode_table[c])
1756                              {
1757                              case DRAWMODE_SOURCE:
1758                                 if (((1 << (pri[x] & 0x1f)) & pri_mask) == 0)
1759                                 {
1760                                    if (pri[x] & 0x80)
1761                                       dest[x] = palette_shadow_table[palbase + c];
1762                                    else
1763                                       dest[x] = palbase + c;
1764                                 }
1765                                 pri[x] = (pri[x] & 0x7f) | 31;
1766                                 break;
1767                              case DRAWMODE_SHADOW:
1768                                 if (((1 << pri[x]) & pri_mask) == 0)
1769                                    dest[x] = palette_shadow_table[dest[x]];
1770                                 pri[x] |= al;
1771                                 break;
1772                              }
1773                           }
1537                           int c = (source[x_index>>17] >> ((x_index & 0x10000) >> 14)) & 0x0f;
1538                           if( c != transparent_color ) dest[x] = pal[c];
17741539                           x_index += dx;
17751540                        }
17761541
r1771r1772
17821547                     for( y=sy; y<ey; y++ )
17831548                     {
17841549                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1785                        UINT8 *dest = BITMAP_ADDR8(dest_bmp, y, 0);
1550                        UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
17861551
17871552                        int x, x_index = x_index_base;
17881553                        for( x=sx; x<ex; x++ )
17891554                        {
17901555                           int c = source[x_index>>16];
1791                           if( c != transparent_color )
1792                           {
1793                              switch(gfx_drawmode_table[c])
1794                              {
1795                              case DRAWMODE_SOURCE:
1796                                 dest[x] = palbase + c;
1797                                 break;
1798                              case DRAWMODE_SHADOW:
1799                                 dest[x] = palette_shadow_table[dest[x]];
1800                                 break;
1801                              }
1802                           }
1556                           if( c != transparent_color ) dest[x] = pal[c];
18031557                           x_index += dx;
18041558                        }
18051559
r1771r1772
18081562                  }
18091563               }
18101564            }
1811         }
1812      }
1813   }
18141565
1815   /* 16-bit destination bitmap */
1816   else if (dest_bmp->bpp == 16)
1817   {
1818      if( gfx )
1819      {
1820         const pen_t *pal = &Machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
1821         UINT8 *source_base = gfx->gfxdata + (code % gfx->total_elements) * gfx->char_modulo;
1822
1823         int sprite_screen_height = (scaley*gfx->height+0x8000)>>16;
1824         int sprite_screen_width = (scalex*gfx->width+0x8000)>>16;
1825
1826         if (sprite_screen_width && sprite_screen_height)
1827         {
1828            /* compute sprite increment per screen pixel */
1829            int dx = (gfx->width<<16)/sprite_screen_width;
1830            int dy = (gfx->height<<16)/sprite_screen_height;
1831
1832            int ex = sx+sprite_screen_width;
1833            int ey = sy+sprite_screen_height;
1834
1835            int x_index_base;
1836            int y_index;
1837
1838            if( flipx )
1566            /* case 1b: TRANSPARENCY_PEN_RAW */
1567            if (transparency == TRANSPARENCY_PEN_RAW)
18391568            {
1840               x_index_base = (sprite_screen_width-1)*dx;
1841               dx = -dx;
1842            }
1843            else
1844            {
1845               x_index_base = 0;
1846            }
1847
1848            if( flipy )
1849            {
1850               y_index = (sprite_screen_height-1)*dy;
1851               dy = -dy;
1852            }
1853            else
1854            {
1855               y_index = 0;
1856            }
1857
1858            if( clip )
1859            {
1860               if( sx < clip->min_x)
1861               { /* clip left */
1862                  int pixels = clip->min_x-sx;
1863                  sx += pixels;
1864                  x_index_base += pixels*dx;
1865               }
1866               if( sy < clip->min_y )
1867               { /* clip top */
1868                  int pixels = clip->min_y-sy;
1869                  sy += pixels;
1870                  y_index += pixels*dy;
1871               }
1872               /* NS 980211 - fixed incorrect clipping */
1873               if( ex > clip->max_x+1 )
1874               { /* clip right */
1875                  int pixels = ex-clip->max_x-1;
1876                  ex -= pixels;
1877               }
1878               if( ey > clip->max_y+1 )
1879               { /* clip bottom */
1880                  int pixels = ey-clip->max_y-1;
1881                  ey -= pixels;
1882               }
1883            }
1884
1885            if( ex>sx )
1886            { /* skip if inner loop doesn't draw anything */
1887               int y;
1888
1889               /* case 0: TRANSPARENCY_NONE */
1890               if (transparency == TRANSPARENCY_NONE)
1569               if (pri_buffer)
18911570               {
1892                  if (pri_buffer)
1571                  for( y=sy; y<ey; y++ )
18931572                  {
1894                     if (gfx->flags & GFX_ELEMENT_PACKED)
1895                     {
1896                        for( y=sy; y<ey; y++ )
1897                        {
1898                           UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1899                           UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
1900                           UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
1573                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1574                     UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
1575                     UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
19011576
1902                           int x, x_index = x_index_base;
1903                           for( x=sx; x<ex; x++ )
1904                           {
1905                              if (((1 << pri[x]) & pri_mask) == 0)
1906                                 dest[x] = pal[(source[x_index>>17] >> ((x_index & 0x10000) >> 14)) & 0x0f];
1907                              pri[x] = 31;
1908                              x_index += dx;
1909                           }
1910
1911                           y_index += dy;
1912                        }
1913                     }
1914                     else
1577                     int x, x_index = x_index_base;
1578                     for( x=sx; x<ex; x++ )
19151579                     {
1916                        for( y=sy; y<ey; y++ )
1580                        int c = source[x_index>>16];
1581                        if( c != transparent_color )
19171582                        {
1918                           UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1919                           UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
1920                           UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
1921
1922                           int x, x_index = x_index_base;
1923                           for( x=sx; x<ex; x++ )
1924                           {
1925                              if (((1 << pri[x]) & pri_mask) == 0)
1926                                 dest[x] = pal[source[x_index>>16]];
1927                              pri[x] = 31;
1928                              x_index += dx;
1929                           }
1930
1931                           y_index += dy;
1583                           if (((1 << pri[x]) & pri_mask) == 0)
1584                              dest[x] = color + c;
1585                           pri[x] = 31;
19321586                        }
1587                        x_index += dx;
19331588                     }
1589
1590                     y_index += dy;
19341591                  }
1935                  else
1592               }
1593               else
1594               {
1595                  for( y=sy; y<ey; y++ )
19361596                  {
1937                     if (gfx->flags & GFX_ELEMENT_PACKED)
1938                     {
1939                        for( y=sy; y<ey; y++ )
1940                        {
1941                           UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1942                           UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
1597                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1598                     UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
19431599
1944                           int x, x_index = x_index_base;
1945                           for( x=sx; x<ex; x++ )
1946                           {
1947                              dest[x] = pal[(source[x_index>>17] >> ((x_index & 0x10000) >> 14)) & 0x0f];
1948                              x_index += dx;
1949                           }
1950
1951                           y_index += dy;
1952                        }
1953                     }
1954                     else
1600                     int x, x_index = x_index_base;
1601                     for( x=sx; x<ex; x++ )
19551602                     {
1956                        for( y=sy; y<ey; y++ )
1957                        {
1958                           UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1959                           UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
1960
1961                           int x, x_index = x_index_base;
1962                           for( x=sx; x<ex; x++ )
1963                           {
1964                              dest[x] = pal[source[x_index>>16]];
1965                              x_index += dx;
1966                           }
1967
1968                           y_index += dy;
1969                        }
1603                        int c = source[x_index>>16];
1604                        if( c != transparent_color ) dest[x] = color + c;
1605                        x_index += dx;
19701606                     }
1607
1608                     y_index += dy;
19711609                  }
19721610               }
1611            }
19731612
1974               /* case 1: TRANSPARENCY_PEN */
1975               if (transparency == TRANSPARENCY_PEN)
1613            /* case 2: TRANSPARENCY_PENS */
1614            if (transparency == TRANSPARENCY_PENS)
1615            {
1616               if (pri_buffer)
19761617               {
1977                  if (pri_buffer)
1618                  for( y=sy; y<ey; y++ )
19781619                  {
1979                     if (gfx->flags & GFX_ELEMENT_PACKED)
1980                     {
1981                        for( y=sy; y<ey; y++ )
1982                        {
1983                           UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1984                           UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
1985                           UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
1620                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1621                     UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
1622                     UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
19861623
1987                           int x, x_index = x_index_base;
1988                           for( x=sx; x<ex; x++ )
1989                           {
1990                              int c = (source[x_index>>17] >> ((x_index & 0x10000) >> 14)) & 0x0f;
1991                              if( c != transparent_color )
1992                              {
1993                                 if (((1 << pri[x]) & pri_mask) == 0)
1994                                    dest[x] = pal[c];
1995                                 pri[x] = 31;
1996                              }
1997                              x_index += dx;
1998                           }
1999
2000                           y_index += dy;
2001                        }
2002                     }
2003                     else
1624                     int x, x_index = x_index_base;
1625                     for( x=sx; x<ex; x++ )
20041626                     {
2005                        for( y=sy; y<ey; y++ )
1627                        int c = source[x_index>>16];
1628                        if (((1 << c) & transparent_color) == 0)
20061629                        {
2007                           UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2008                           UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
2009                           UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
2010
2011                           int x, x_index = x_index_base;
2012                           for( x=sx; x<ex; x++ )
2013                           {
2014                              int c = source[x_index>>16];
2015                              if( c != transparent_color )
2016                              {
2017                                 if (((1 << pri[x]) & pri_mask) == 0)
2018                                    dest[x] = pal[c];
2019                                 pri[x] = 31;
2020                              }
2021                              x_index += dx;
2022                           }
2023
2024                           y_index += dy;
1630                           if (((1 << pri[x]) & pri_mask) == 0)
1631                              dest[x] = pal[c];
1632                           pri[x] = 31;
20251633                        }
1634                        x_index += dx;
20261635                     }
1636
1637                     y_index += dy;
20271638                  }
2028                  else
1639               }
1640               else
1641               {
1642                  for( y=sy; y<ey; y++ )
20291643                  {
2030                     if (gfx->flags & GFX_ELEMENT_PACKED)
2031                     {
2032                        for( y=sy; y<ey; y++ )
2033                        {
2034                           UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2035                           UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
1644                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1645                     UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
20361646
2037                           int x, x_index = x_index_base;
2038                           for( x=sx; x<ex; x++ )
2039                           {
2040                              int c = (source[x_index>>17] >> ((x_index & 0x10000) >> 14)) & 0x0f;
2041                              if( c != transparent_color ) dest[x] = pal[c];
2042                              x_index += dx;
2043                           }
2044
2045                           y_index += dy;
2046                        }
2047                     }
2048                     else
1647                     int x, x_index = x_index_base;
1648                     for( x=sx; x<ex; x++ )
20491649                     {
2050                        for( y=sy; y<ey; y++ )
2051                        {
2052                           UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2053                           UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
2054
2055                           int x, x_index = x_index_base;
2056                           for( x=sx; x<ex; x++ )
2057                           {
2058                              int c = source[x_index>>16];
2059                              if( c != transparent_color ) dest[x] = pal[c];
2060                              x_index += dx;
2061                           }
2062
2063                           y_index += dy;
2064                        }
1650                        int c = source[x_index>>16];
1651                        if (((1 << c) & transparent_color) == 0)
1652                           dest[x] = pal[c];
1653                        x_index += dx;
20651654                     }
1655
1656                     y_index += dy;
20661657                  }
20671658               }
1659            }
20681660
2069               /* case 1b: TRANSPARENCY_PEN_RAW */
2070               if (transparency == TRANSPARENCY_PEN_RAW)
1661            /* case 3: TRANSPARENCY_PEN_TABLE */
1662            if (transparency == TRANSPARENCY_PEN_TABLE)
1663            {
1664               pen_t *palette_shadow_table = Machine->shadow_table;
1665               if (pri_buffer)
20711666               {
2072                  if (pri_buffer)
1667                  UINT8 al = (pdrawgfx_shadow_lowpri) ? 0 : 0x80;
1668
1669                  for( y=sy; y<ey; y++ )
20731670                  {
2074                     for( y=sy; y<ey; y++ )
2075                     {
2076                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2077                        UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
2078                        UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
1671                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1672                     UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
1673                     UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
20791674
2080                        int x, x_index = x_index_base;
2081                        for( x=sx; x<ex; x++ )
1675                     int x, x_index = x_index_base;
1676                     for( x=sx; x<ex; x++ )
1677                     {
1678                        int c = source[x_index>>16];
1679                        if( c != transparent_color )
20821680                        {
2083                           int c = source[x_index>>16];
2084                           if( c != transparent_color )
1681                           UINT8 ah;
1682
1683                           switch(gfx_drawmode_table[c])
20851684                           {
1685                           case DRAWMODE_SOURCE:
1686                              ah = pri[x];
1687                              if (((1 << (ah & 0x1f)) & pri_mask) == 0)
1688                              {
1689                                 if (ah & 0x80)
1690                                    dest[x] = palette_shadow_table[pal[c]];
1691                                 else
1692                                    dest[x] = pal[c];
1693                              }
1694                              pri[x] = (ah & 0x7f) | 31;
1695                              break;
1696                           case DRAWMODE_SHADOW:
20861697                              if (((1 << pri[x]) & pri_mask) == 0)
2087                                 dest[x] = color + c;
2088                              pri[x] = 31;
1698                                 dest[x] = palette_shadow_table[dest[x]];
1699                              pri[x] |= al;
1700                              break;
20891701                           }
2090                           x_index += dx;
20911702                        }
2092
2093                        y_index += dy;
1703                        x_index += dx;
20941704                     }
2095                  }
2096                  else
2097                  {
2098                     for( y=sy; y<ey; y++ )
2099                     {
2100                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2101                        UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
21021705
2103                        int x, x_index = x_index_base;
2104                        for( x=sx; x<ex; x++ )
2105                        {
2106                           int c = source[x_index>>16];
2107                           if( c != transparent_color ) dest[x] = color + c;
2108                           x_index += dx;
2109                        }
2110
2111                        y_index += dy;
2112                     }
1706                     y_index += dy;
21131707                  }
21141708               }
2115
2116               /* case 2: TRANSPARENCY_PENS */
2117               if (transparency == TRANSPARENCY_PENS)
1709               else
21181710               {
2119                  if (pri_buffer)
1711                  for( y=sy; y<ey; y++ )
21201712                  {
2121                     for( y=sy; y<ey; y++ )
2122                     {
2123                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2124                        UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
2125                        UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
1713                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1714                     UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
21261715
2127                        int x, x_index = x_index_base;
2128                        for( x=sx; x<ex; x++ )
1716                     int x, x_index = x_index_base;
1717                     for( x=sx; x<ex; x++ )
1718                     {
1719                        int c = source[x_index>>16];
1720                        if( c != transparent_color )
21291721                        {
2130                           int c = source[x_index>>16];
2131                           if (((1 << c) & transparent_color) == 0)
1722                           switch(gfx_drawmode_table[c])
21321723                           {
2133                              if (((1 << pri[x]) & pri_mask) == 0)
2134                                 dest[x] = pal[c];
2135                              pri[x] = 31;
1724                           case DRAWMODE_SOURCE:
1725                              dest[x] = pal[c];
1726                              break;
1727                           case DRAWMODE_SHADOW:
1728                              dest[x] = palette_shadow_table[dest[x]];
1729                              break;
21361730                           }
2137                           x_index += dx;
21381731                        }
2139
2140                        y_index += dy;
1732                        x_index += dx;
21411733                     }
2142                  }
2143                  else
2144                  {
2145                     for( y=sy; y<ey; y++ )
2146                     {
2147                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2148                        UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
21491734
2150                        int x, x_index = x_index_base;
2151                        for( x=sx; x<ex; x++ )
2152                        {
2153                           int c = source[x_index>>16];
2154                           if (((1 << c) & transparent_color) == 0)
2155                              dest[x] = pal[c];
2156                           x_index += dx;
2157                        }
2158
2159                        y_index += dy;
2160                     }
1735                     y_index += dy;
21611736                  }
21621737               }
1738            }
21631739
2164               /* case 3: TRANSPARENCY_PEN_TABLE */
2165               if (transparency == TRANSPARENCY_PEN_TABLE)
1740            /* case 6: TRANSPARENCY_ALPHA */
1741            if (transparency == TRANSPARENCY_ALPHA)
1742            {
1743               if (pri_buffer)
21661744               {
2167                  pen_t *palette_shadow_table = Machine->shadow_table;
2168                  if (pri_buffer)
1745                  for( y=sy; y<ey; y++ )
21691746                  {
2170                     for( y=sy; y<ey; y++ )
2171                     {
2172                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2173                        UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
2174                        UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
1747                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1748                     UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
1749                     UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
21751750
2176                        int x, x_index = x_index_base;
2177                        for( x=sx; x<ex; x++ )
2178                        {
2179                           int c = source[x_index>>16];
2180                           if( c != transparent_color )
2181                           {
2182                              switch(gfx_drawmode_table[c])
2183                              {
2184                              case DRAWMODE_SOURCE:
2185                                 ah = pri[x];
2186                                 if (((1 << (ah & 0x1f)) & pri_mask) == 0)
2187                                 {
2188                                    if (ah & 0x80)
2189                                       dest[x] = palette_shadow_table[pal[c]];
2190                                    else
2191                                       dest[x] = pal[c];
2192                                 }
2193                                 pri[x] = (ah & 0x7f) | 31;
2194                                 break;
2195                              case DRAWMODE_SHADOW:
2196                                 if (((1 << pri[x]) & pri_mask) == 0)
2197                                    dest[x] = palette_shadow_table[dest[x]];
2198                                 pri[x] |= al;
2199                                 break;
2200                              }
2201                           }
2202                           x_index += dx;
2203                        }
2204
2205                        y_index += dy;
2206                     }
2207                  }
2208                  else
2209                  {
2210                     for( y=sy; y<ey; y++ )
1751                     int x, x_index = x_index_base;
1752                     for( x=sx; x<ex; x++ )
22111753                     {
2212                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2213                        UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
2214
2215                        int x, x_index = x_index_base;
2216                        for( x=sx; x<ex; x++ )
1754                        int c = source[x_index>>16];
1755                        if( c != transparent_color )
22171756                        {
2218                           int c = source[x_index>>16];
2219                           if( c != transparent_color )
2220                           {
2221                              switch(gfx_drawmode_table[c])
2222                              {
2223                              case DRAWMODE_SOURCE:
2224                                 dest[x] = pal[c];
2225                                 break;
2226                              case DRAWMODE_SHADOW:
2227                                 dest[x] = palette_shadow_table[dest[x]];
2228                                 break;
2229                              }
2230                           }
2231                           x_index += dx;
1757                           if (((1 << pri[x]) & pri_mask) == 0)
1758                              dest[x] = alpha_blend16(dest[x], pal[c]);
1759                           pri[x] = 31;
22321760                        }
2233
2234                        y_index += dy;
1761                        x_index += dx;
22351762                     }
1763
1764                     y_index += dy;
22361765                  }
22371766               }
2238
2239               /* case 6: TRANSPARENCY_ALPHA */
2240               if (transparency == TRANSPARENCY_ALPHA)
1767               else
22411768               {
2242                  if (pri_buffer)
1769                  for( y=sy; y<ey; y++ )
22431770                  {
2244                     for( y=sy; y<ey; y++ )
2245                     {
2246                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2247                        UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
2248                        UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
1771                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1772                     UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
22491773
2250                        int x, x_index = x_index_base;
2251                        for( x=sx; x<ex; x++ )
2252                        {
2253                           int c = source[x_index>>16];
2254                           if( c != transparent_color )
2255                           {
2256                              if (((1 << pri[x]) & pri_mask) == 0)
2257                                 dest[x] = alpha_blend16(dest[x], pal[c]);
2258                              pri[x] = 31;
2259                           }
2260                           x_index += dx;
2261                        }
2262
2263                        y_index += dy;
2264                     }
2265                  }
2266                  else
2267                  {
2268                     for( y=sy; y<ey; y++ )
1774                     int x, x_index = x_index_base;
1775                     for( x=sx; x<ex; x++ )
22691776                     {
2270                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2271                        UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
2272
2273                        int x, x_index = x_index_base;
2274                        for( x=sx; x<ex; x++ )
2275                        {
2276                           int c = source[x_index>>16];
2277                           if( c != transparent_color ) dest[x] = alpha_blend16(dest[x], pal[c]);
2278                           x_index += dx;
2279                        }
2280
2281                        y_index += dy;
1777                        int c = source[x_index>>16];
1778                        if( c != transparent_color ) dest[x] = alpha_blend16(dest[x], pal[c]);
1779                        x_index += dx;
22821780                     }
1781
1782                     y_index += dy;
22831783                  }
22841784               }
1785            }
22851786
2286               /* pjp 31/5/02 */
2287               /* case 7: TRANSPARENCY_ALPHARANGE */
2288               if (transparency == TRANSPARENCY_ALPHARANGE)
1787            /* pjp 31/5/02 */
1788            /* case 7: TRANSPARENCY_ALPHARANGE */
1789            if (transparency == TRANSPARENCY_ALPHARANGE)
1790            {
1791               if (pri_buffer)
22891792               {
2290                  if (pri_buffer)
1793                  for( y=sy; y<ey; y++ )
22911794                  {
2292                     for( y=sy; y<ey; y++ )
2293                     {
2294                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2295                        UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
2296                        UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
1795                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1796                     UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
1797                     UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
22971798
2298                        int x, x_index = x_index_base;
2299                        for( x=sx; x<ex; x++ )
2300                        {
2301                           int c = source[x_index>>16];
2302                           if( c != transparent_color )
2303                           {
2304                              if (((1 << pri[x]) & pri_mask) == 0)
2305                              {
2306                                 if( gfx_alpharange_table[c] == 0xff )
2307                                    dest[x] = pal[c];
2308                                 else
2309                                    dest[x] = alpha_blend_r16(dest[x], pal[c], gfx_alpharange_table[c]);
2310                              }
2311                              pri[x] = 31;
2312                           }
2313                           x_index += dx;
2314                        }
2315
2316                        y_index += dy;
2317                     }
2318                  }
2319                  else
2320                  {
2321                     for( y=sy; y<ey; y++ )
1799                     int x, x_index = x_index_base;
1800                     for( x=sx; x<ex; x++ )
23221801                     {
2323                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2324                        UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
2325
2326                        int x, x_index = x_index_base;
2327                        for( x=sx; x<ex; x++ )
1802                        int c = source[x_index>>16];
1803                        if( c != transparent_color )
23281804                        {
2329                           int c = source[x_index>>16];
2330                           if( c != transparent_color )
1805                           if (((1 << pri[x]) & pri_mask) == 0)
23311806                           {
23321807                              if( gfx_alpharange_table[c] == 0xff )
23331808                                 dest[x] = pal[c];
23341809                              else
23351810                                 dest[x] = alpha_blend_r16(dest[x], pal[c], gfx_alpharange_table[c]);
23361811                           }
2337                           x_index += dx;
1812                           pri[x] = 31;
23381813                        }
1814                        x_index += dx;
1815                     }
23391816
2340                        y_index += dy;
1817                     y_index += dy;
1818                  }
1819               }
1820               else
1821               {
1822                  for( y=sy; y<ey; y++ )
1823                  {
1824                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1825                     UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
1826
1827                     int x, x_index = x_index_base;
1828                     for( x=sx; x<ex; x++ )
1829                     {
1830                        int c = source[x_index>>16];
1831                        if( c != transparent_color )
1832                        {
1833                           if( gfx_alpharange_table[c] == 0xff )
1834                              dest[x] = pal[c];
1835                           else
1836                              dest[x] = alpha_blend_r16(dest[x], pal[c], gfx_alpharange_table[c]);
1837                        }
1838                        x_index += dx;
23411839                     }
1840
1841                     y_index += dy;
23421842                  }
23431843               }
23441844            }
r1771r1772
23491849   /* 32-bit destination bitmap */
23501850   else
23511851   {
2352      if( gfx )
1852      const pen_t *pal = &Machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
1853      UINT8 *source_base = gfx->gfxdata + (code % gfx->total_elements) * gfx->char_modulo;
1854
1855      int sprite_screen_height = (scaley*gfx->height+0x8000)>>16;
1856      int sprite_screen_width = (scalex*gfx->width+0x8000)>>16;
1857
1858      if (sprite_screen_width && sprite_screen_height)
23531859      {
2354         const pen_t *pal = &Machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
2355         UINT8 *source_base = gfx->gfxdata + (code % gfx->total_elements) * gfx->char_modulo;
1860         /* compute sprite increment per screen pixel */
1861         int dx = (gfx->width<<16)/sprite_screen_width;
1862         int dy = (gfx->height<<16)/sprite_screen_height;
23561863
2357         int sprite_screen_height = (scaley*gfx->height+0x8000)>>16;
2358         int sprite_screen_width = (scalex*gfx->width+0x8000)>>16;
1864         int ex = sx+sprite_screen_width;
1865         int ey = sy+sprite_screen_height;
23591866
2360         if (sprite_screen_width && sprite_screen_height)
1867         int x_index_base;
1868         int y_index;
1869
1870         if( flipx )
23611871         {
2362            /* compute sprite increment per screen pixel */
2363            int dx = (gfx->width<<16)/sprite_screen_width;
2364            int dy = (gfx->height<<16)/sprite_screen_height;
1872            x_index_base = (sprite_screen_width-1)*dx;
1873            dx = -dx;
1874         }
1875         else
1876         {
1877            x_index_base = 0;
1878         }
23651879
2366            int ex = sx+sprite_screen_width;
2367            int ey = sy+sprite_screen_height;
1880         if( flipy )
1881         {
1882            y_index = (sprite_screen_height-1)*dy;
1883            dy = -dy;
1884         }
1885         else
1886         {
1887            y_index = 0;
1888         }
23681889
2369            int x_index_base;
2370            int y_index;
2371
2372            if( flipx )
2373            {
2374               x_index_base = (sprite_screen_width-1)*dx;
2375               dx = -dx;
1890         if( clip )
1891         {
1892            if( sx < clip->min_x)
1893            { /* clip left */
1894               int pixels = clip->min_x-sx;
1895               sx += pixels;
1896               x_index_base += pixels*dx;
23761897            }
2377            else
2378            {
2379               x_index_base = 0;
1898            if( sy < clip->min_y )
1899            { /* clip top */
1900               int pixels = clip->min_y-sy;
1901               sy += pixels;
1902               y_index += pixels*dy;
23801903            }
2381
2382            if( flipy )
2383            {
2384               y_index = (sprite_screen_height-1)*dy;
2385               dy = -dy;
1904            /* NS 980211 - fixed incorrect clipping */
1905            if( ex > clip->max_x+1 )
1906            { /* clip right */
1907               int pixels = ex-clip->max_x-1;
1908               ex -= pixels;
23861909            }
2387            else
2388            {
2389               y_index = 0;
1910            if( ey > clip->max_y+1 )
1911            { /* clip bottom */
1912               int pixels = ey-clip->max_y-1;
1913               ey -= pixels;
23901914            }
1915         }
23911916
2392            if( clip )
2393            {
2394               if( sx < clip->min_x)
2395               { /* clip left */
2396                  int pixels = clip->min_x-sx;
2397                  sx += pixels;
2398                  x_index_base += pixels*dx;
2399               }
2400               if( sy < clip->min_y )
2401               { /* clip top */
2402                  int pixels = clip->min_y-sy;
2403                  sy += pixels;
2404                  y_index += pixels*dy;
2405               }
2406               /* NS 980211 - fixed incorrect clipping */
2407               if( ex > clip->max_x+1 )
2408               { /* clip right */
2409                  int pixels = ex-clip->max_x-1;
2410                  ex -= pixels;
2411               }
2412               if( ey > clip->max_y+1 )
2413               { /* clip bottom */
2414                  int pixels = ey-clip->max_y-1;
2415                  ey -= pixels;
2416               }
2417            }
1917         if( ex>sx )
1918         { /* skip if inner loop doesn't draw anything */
1919            int y;
24181920
2419            if( ex>sx )
2420            { /* skip if inner loop doesn't draw anything */
2421               int y;
2422
2423               /* case 0: TRANSPARENCY_NONE */
2424               if (transparency == TRANSPARENCY_NONE)
1921            /* case 0: TRANSPARENCY_NONE */
1922            if (transparency == TRANSPARENCY_NONE)
1923            {
1924               if (pri_buffer)
24251925               {
2426                  if (pri_buffer)
1926                  for( y=sy; y<ey; y++ )
24271927                  {
2428                     for( y=sy; y<ey; y++ )
2429                     {
2430                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2431                        UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
2432                        UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
1928                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1929                     UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
1930                     UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
24331931
2434                        int x, x_index = x_index_base;
2435                        for( x=sx; x<ex; x++ )
2436                        {
2437                           if (((1 << pri[x]) & pri_mask) == 0)
2438                              dest[x] = pal[source[x_index>>16]];
2439                           pri[x] = 31;
2440                           x_index += dx;
2441                        }
2442
2443                        y_index += dy;
1932                     int x, x_index = x_index_base;
1933                     for( x=sx; x<ex; x++ )
1934                     {
1935                        if (((1 << pri[x]) & pri_mask) == 0)
1936                           dest[x] = pal[source[x_index>>16]];
1937                        pri[x] = 31;
1938                        x_index += dx;
24441939                     }
1940
1941                     y_index += dy;
24451942                  }
2446                  else
1943               }
1944               else
1945               {
1946                  for( y=sy; y<ey; y++ )
24471947                  {
2448                     for( y=sy; y<ey; y++ )
2449                     {
2450                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2451                        UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
1948                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1949                     UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
24521950
2453                        int x, x_index = x_index_base;
2454                        for( x=sx; x<ex; x++ )
2455                        {
2456                           dest[x] = pal[source[x_index>>16]];
2457                           x_index += dx;
2458                        }
2459
2460                        y_index += dy;
1951                     int x, x_index = x_index_base;
1952                     for( x=sx; x<ex; x++ )
1953                     {
1954                        dest[x] = pal[source[x_index>>16]];
1955                        x_index += dx;
24611956                     }
1957
1958                     y_index += dy;
24621959                  }
24631960               }
1961            }
24641962
2465               /* case 1: TRANSPARENCY_PEN */
2466               if (transparency == TRANSPARENCY_PEN)
1963            /* case 1: TRANSPARENCY_PEN */
1964            if (transparency == TRANSPARENCY_PEN)
1965            {
1966               if (pri_buffer)
24671967               {
2468                  if (pri_buffer)
1968                  for( y=sy; y<ey; y++ )
24691969                  {
2470                     for( y=sy; y<ey; y++ )
2471                     {
2472                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2473                        UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
2474                        UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
1970                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1971                     UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
1972                     UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
24751973
2476                        int x, x_index = x_index_base;
2477                        for( x=sx; x<ex; x++ )
1974                     int x, x_index = x_index_base;
1975                     for( x=sx; x<ex; x++ )
1976                     {
1977                        int c = source[x_index>>16];
1978                        if( c != transparent_color )
24781979                        {
2479                           int c = source[x_index>>16];
2480                           if( c != transparent_color )
2481                           {
2482                              if (((1 << pri[x]) & pri_mask) == 0)
2483                                 dest[x] = pal[c];
2484                              pri[x] = 31;
2485                           }
2486                           x_index += dx;
1980                           if (((1 << pri[x]) & pri_mask) == 0)
1981                              dest[x] = pal[c];
1982                           pri[x] = 31;
24871983                        }
2488
2489                        y_index += dy;
1984                        x_index += dx;
24901985                     }
1986
1987                     y_index += dy;
24911988                  }
2492                  else
1989               }
1990               else
1991               {
1992                  for( y=sy; y<ey; y++ )
24931993                  {
2494                     for( y=sy; y<ey; y++ )
2495                     {
2496                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2497                        UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
1994                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1995                     UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
24981996
2499                        int x, x_index = x_index_base;
2500                        for( x=sx; x<ex; x++ )
2501                        {
2502                           int c = source[x_index>>16];
2503                           if( c != transparent_color ) dest[x] = pal[c];
2504                           x_index += dx;
2505                        }
2506
2507                        y_index += dy;
1997                     int x, x_index = x_index_base;
1998                     for( x=sx; x<ex; x++ )
1999                     {
2000                        int c = source[x_index>>16];
2001                        if( c != transparent_color ) dest[x] = pal[c];
2002                        x_index += dx;
25082003                     }
2004
2005                     y_index += dy;
25092006                  }
25102007               }
2008            }
25112009
2512               /* case 1b: TRANSPARENCY_PEN_RAW */
2513               if (transparency == TRANSPARENCY_PEN_RAW)
2010            /* case 1b: TRANSPARENCY_PEN_RAW */
2011            if (transparency == TRANSPARENCY_PEN_RAW)
2012            {
2013               if (pri_buffer)
25142014               {
2515                  if (pri_buffer)
2015                  for( y=sy; y<ey; y++ )
25162016                  {
2517                     for( y=sy; y<ey; y++ )
2518                     {
2519                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2520                        UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
2521                        UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
2017                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2018                     UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
2019                     UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
25222020
2523                        int x, x_index = x_index_base;
2524                        for( x=sx; x<ex; x++ )
2021                     int x, x_index = x_index_base;
2022                     for( x=sx; x<ex; x++ )
2023                     {
2024                        int c = source[x_index>>16];
2025                        if( c != transparent_color )
25252026                        {
2526                           int c = source[x_index>>16];
2527                           if( c != transparent_color )
2528                           {
2529                              if (((1 << pri[x]) & pri_mask) == 0)
2530                                 dest[x] = color + c;
2531                              pri[x] = 31;
2532                           }
2533                           x_index += dx;
2027                           if (((1 << pri[x]) & pri_mask) == 0)
2028                              dest[x] = color + c;
2029                           pri[x] = 31;
25342030                        }
2535
2536                        y_index += dy;
2031                        x_index += dx;
25372032                     }
2033
2034                     y_index += dy;
25382035                  }
2539                  else
2036               }
2037               else
2038               {
2039                  for( y=sy; y<ey; y++ )
25402040                  {
2541                     for( y=sy; y<ey; y++ )
2542                     {
2543                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2544                        UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
2041                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2042                     UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
25452043
2546                        int x, x_index = x_index_base;
2547                        for( x=sx; x<ex; x++ )
2548                        {
2549                           int c = source[x_index>>16];
2550                           if( c != transparent_color ) dest[x] = color + c;
2551                           x_index += dx;
2552                        }
2553
2554                        y_index += dy;
2044                     int x, x_index = x_index_base;
2045                     for( x=sx; x<ex; x++ )
2046                     {
2047                        int c = source[x_index>>16];
2048                        if( c != transparent_color ) dest[x] = color + c;
2049                        x_index += dx;
25552050                     }
2051
2052                     y_index += dy;
25562053                  }
25572054               }
2055            }
25582056
2559               /* case 2: TRANSPARENCY_PENS */
2560               if (transparency == TRANSPARENCY_PENS)
2057            /* case 2: TRANSPARENCY_PENS */
2058            if (transparency == TRANSPARENCY_PENS)
2059            {
2060               if (pri_buffer)
25612061               {
2562                  if (pri_buffer)
2062                  for( y=sy; y<ey; y++ )
25632063                  {
2564                     for( y=sy; y<ey; y++ )
2565                     {
2566                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2567                        UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
2568                        UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
2064                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2065                     UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
2066                     UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
25692067
2570                        int x, x_index = x_index_base;
2571                        for( x=sx; x<ex; x++ )
2068                     int x, x_index = x_index_base;
2069                     for( x=sx; x<ex; x++ )
2070                     {
2071                        int c = source[x_index>>16];
2072                        if (((1 << c) & transparent_color) == 0)
25722073                        {
2573                           int c = source[x_index>>16];
2574                           if (((1 << c) & transparent_color) == 0)
2575                           {
2576                              if (((1 << pri[x]) & pri_mask) == 0)
2577                                 dest[x] = pal[c];
2578                              pri[x] = 31;
2579                           }
2580                           x_index += dx;
2074                           if (((1 << pri[x]) & pri_mask) == 0)
2075                              dest[x] = pal[c];
2076                           pri[x] = 31;
25812077                        }
2582
2583                        y_index += dy;
2078                        x_index += dx;
25842079                     }
2080
2081                     y_index += dy;
25852082                  }
2586                  else
2083               }
2084               else
2085               {
2086                  for( y=sy; y<ey; y++ )
25872087                  {
2588                     for( y=sy; y<ey; y++ )
2589                     {
2590                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2591                        UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
2088                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2089                     UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
25922090
2593                        int x, x_index = x_index_base;
2594                        for( x=sx; x<ex; x++ )
2595                        {
2596                           int c = source[x_index>>16];
2597                           if (((1 << c) & transparent_color) == 0)
2598                              dest[x] = pal[c];
2599                           x_index += dx;
2600                        }
2601
2602                        y_index += dy;
2091                     int x, x_index = x_index_base;
2092                     for( x=sx; x<ex; x++ )
2093                     {
2094                        int c = source[x_index>>16];
2095                        if (((1 << c) & transparent_color) == 0)
2096                           dest[x] = pal[c];
2097                        x_index += dx;
26032098                     }
2099
2100                     y_index += dy;
26042101                  }
26052102               }
2103            }
26062104
2607               /* case 3: TRANSPARENCY_PEN_TABLE */
2608               if (transparency == TRANSPARENCY_PEN_TABLE)
2609               {
2610                  pen_t *palette_shadow_table = Machine->shadow_table;
2611                  UINT8 *source, *pri;
2612                  UINT32 *dest;
2613                  int c, x, x_index;
2105            /* case 3: TRANSPARENCY_PEN_TABLE */
2106            if (transparency == TRANSPARENCY_PEN_TABLE)
2107            {
2108               pen_t *palette_shadow_table = Machine->shadow_table;
2109               UINT8 *source;
2110               UINT8 *pri;
2111               UINT32 *dest;
2112               int c, x, x_index;
2113               UINT8 al, ah;
26142114
2615                  if (pri_buffer)
2115               if (pri_buffer)
2116               {
2117                  for( y=sy; y<ey; y++ )
26162118                  {
2617                     for( y=sy; y<ey; y++ )
2119                     source = source_base + (y_index>>16) * gfx->line_modulo;
2120                     y_index += dy;
2121                     dest = BITMAP_ADDR32(dest_bmp, y, 0);
2122                     pri = BITMAP_ADDR8(pri_buffer, y, 0);
2123                     x_index = x_index_base;
2124
2125                     for( x=sx; x<ex; x++ )
26182126                     {
2619                        source = source_base + (y_index>>16) * gfx->line_modulo;
2620                        y_index += dy;
2621                        dest = BITMAP_ADDR32(dest_bmp, y, 0);
2622                        pri = BITMAP_ADDR8(pri_buffer, y, 0);
2623                        x_index = x_index_base;
2127                        int ebx = x_index;
2128                        x_index += dx;
2129                        ebx >>= 16;
2130                        al = pri[x];
2131                        c = source[ebx];
2132                        ah = al;
2133                        al &= 0x1f;
26242134
2625                        for( x=sx; x<ex; x++ )
2626                        {
2627                           int ebx = x_index;
2628                           x_index += dx;
2629                           ebx >>= 16;
2630                           al = pri[x];
2631                           c = source[ebx];
2632                           ah = al;
2633                           al &= 0x1f;
2135                        if (gfx_drawmode_table[c] == DRAWMODE_NONE) continue;
26342136
2635                           if (gfx_drawmode_table[c] == DRAWMODE_NONE) continue;
2636
2637                           if (!(1<<al & pri_mask))
2137                        if (!(1<<al & pri_mask))
2138                        {
2139                           if (gfx_drawmode_table[c] == DRAWMODE_SOURCE)
26382140                           {
2639                              if (gfx_drawmode_table[c] == DRAWMODE_SOURCE)
2640                              {
2641                                 ah &= 0x7f;
2642                                 ebx = pal[c];
2643                                 ah |= 0x1f;
2644                                 dest[x] = ebx;
2645                                 pri[x] = ah;
2646                              }
2647                              else if (!(ah & 0x80))
2648                              {
2649                                 ebx = SHADOW32(palette_shadow_table,dest[x]);
2650                                 pri[x] |= 0x80;
2651                                 dest[x] = ebx;
2652                              }
2141                              ah &= 0x7f;
2142                              ebx = pal[c];
2143                              ah |= 0x1f;
2144                              dest[x] = ebx;
2145                              pri[x] = ah;
26532146                           }
2147                           else if (!(ah & 0x80))
2148                           {
2149                              ebx = SHADOW32(palette_shadow_table,dest[x]);
2150                              pri[x] |= 0x80;
2151                              dest[x] = ebx;
2152                           }
26542153                        }
26552154                     }
26562155                  }
2657                  else
2156               }
2157               else
2158               {
2159                  for( y=sy; y<ey; y++ )
26582160                  {
2659                     for( y=sy; y<ey; y++ )
2161                     source = source_base + (y_index>>16) * gfx->line_modulo;
2162                     y_index += dy;
2163                     dest = BITMAP_ADDR32(dest_bmp, y, 0);
2164                     x_index = x_index_base;
2165
2166                     for( x=sx; x<ex; x++ )
26602167                     {
2661                        source = source_base + (y_index>>16) * gfx->line_modulo;
2662                        y_index += dy;
2663                        dest = BITMAP_ADDR32(dest_bmp, y, 0);
2664                        x_index = x_index_base;
2168                        c = source[x_index>>16];
2169                        x_index += dx;
26652170
2666                        for( x=sx; x<ex; x++ )
2667                        {
2668                           c = source[x_index>>16];
2669                           x_index += dx;
2670
2671                           if (gfx_drawmode_table[c] == DRAWMODE_NONE) continue;
2672                           if (gfx_drawmode_table[c] == DRAWMODE_SOURCE)
2673                              dest[x] = pal[c];
2674                           else
2675                              dest[x] = SHADOW32(palette_shadow_table,dest[x]);
2676                        }
2171                        if (gfx_drawmode_table[c] == DRAWMODE_NONE) continue;
2172                        if (gfx_drawmode_table[c] == DRAWMODE_SOURCE)
2173                           dest[x] = pal[c];
2174                        else
2175                           dest[x] = SHADOW32(palette_shadow_table,dest[x]);
26772176                     }
26782177                  }
26792178               }
2179            }
26802180
2681               /* case 6: TRANSPARENCY_ALPHA */
2682               if (transparency == TRANSPARENCY_ALPHA)
2181            /* case 6: TRANSPARENCY_ALPHA */
2182            if (transparency == TRANSPARENCY_ALPHA)
2183            {
2184               if (pri_buffer)
26832185               {
2684                  if (pri_buffer)
2186                  for( y=sy; y<ey; y++ )
26852187                  {
2686                     for( y=sy; y<ey; y++ )
2687                     {
2688                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2689                        UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
2690                        UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
2188                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2189                     UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
2190                     UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
26912191
2692                        int x, x_index = x_index_base;
2693                        for( x=sx; x<ex; x++ )
2192                     int x, x_index = x_index_base;
2193                     for( x=sx; x<ex; x++ )
2194                     {
2195                        int c = source[x_index>>16];
2196                        if( c != transparent_color )
26942197                        {
2695                           int c = source[x_index>>16];
2696                           if( c != transparent_color )
2697                           {
2698                              if (((1 << pri[x]) & pri_mask) == 0)
2699                                 dest[x] = alpha_blend32(dest[x], pal[c]);
2700                              pri[x] = 31;
2701                           }
2702                           x_index += dx;
2198                           if (((1 << pri[x]) & pri_mask) == 0)
2199                              dest[x] = alpha_blend32(dest[x], pal[c]);
2200                           pri[x] = 31;
27032201                        }
2704
2705                        y_index += dy;
2202                        x_index += dx;
27062203                     }
2204
2205                     y_index += dy;
27072206                  }
2708                  else
2207               }
2208               else
2209               {
2210                  for( y=sy; y<ey; y++ )
27092211                  {
2710                     for( y=sy; y<ey; y++ )
2711                     {
2712                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2713                        UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
2212                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2213                     UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
27142214
2715                        int x, x_index = x_index_base;
2716                        for( x=sx; x<ex; x++ )
2717                        {
2718                           int c = source[x_index>>16];
2719                           if( c != transparent_color ) dest[x] = alpha_blend32(dest[x], pal[c]);
2720                           x_index += dx;
2721                        }
2722
2723                        y_index += dy;
2215                     int x, x_index = x_index_base;
2216                     for( x=sx; x<ex; x++ )
2217                     {
2218                        int c = source[x_index>>16];
2219                        if( c != transparent_color ) dest[x] = alpha_blend32(dest[x], pal[c]);
2220                        x_index += dx;
27242221                     }
2222
2223                     y_index += dy;
27252224                  }
27262225               }
2226            }
27272227
2728               /* pjp 31/5/02 */
2729               /* case 7: TRANSPARENCY_ALPHARANGE */
2730               if (transparency == TRANSPARENCY_ALPHARANGE)
2228            /* pjp 31/5/02 */
2229            /* case 7: TRANSPARENCY_ALPHARANGE */
2230            if (transparency == TRANSPARENCY_ALPHARANGE)
2231            {
2232               if (pri_buffer)
27312233               {
2732                  if (pri_buffer)
2234                  for( y=sy; y<ey; y++ )
27332235                  {
2734                     for( y=sy; y<ey; y++ )
2735                     {
2736                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2737                        UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
2738                        UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
2236                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2237                     UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
2238                     UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
27392239
2740                        int x, x_index = x_index_base;
2741                        for( x=sx; x<ex; x++ )
2742                        {
2743                           int c = source[x_index>>16];
2744                           if( c != transparent_color )
2745                           {
2746                              if (((1 << pri[x]) & pri_mask) == 0)
2747                              {
2748                                 if( gfx_alpharange_table[c] == 0xff )
2749                                    dest[x] = pal[c];
2750                                 else
2751                                    dest[x] = alpha_blend_r32(dest[x], pal[c], gfx_alpharange_table[c]);
2752                              }
2753                              pri[x] = 31;
2754                           }
2755                           x_index += dx;
2756                        }
2757
2758                        y_index += dy;
2759                     }
2760                  }
2761                  else
2762                  {
2763                     for( y=sy; y<ey; y++ )
2240                     int x, x_index = x_index_base;
2241                     for( x=sx; x<ex; x++ )
27642242                     {
2765                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2766                        UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
2767
2768                        int x, x_index = x_index_base;
2769                        for( x=sx; x<ex; x++ )
2243                        int c = source[x_index>>16];
2244                        if( c != transparent_color )
27702245                        {
2771                           int c = source[x_index>>16];
2772                           if( c != transparent_color )
2246                           if (((1 << pri[x]) & pri_mask) == 0)
27732247                           {
27742248                              if( gfx_alpharange_table[c] == 0xff )
27752249                                 dest[x] = pal[c];
27762250                              else
27772251                                 dest[x] = alpha_blend_r32(dest[x], pal[c], gfx_alpharange_table[c]);
27782252                           }
2779                           x_index += dx;
2253                           pri[x] = 31;
27802254                        }
2255                        x_index += dx;
2256                     }
27812257
2782                        y_index += dy;
2258                     y_index += dy;
2259                  }
2260               }
2261               else
2262               {
2263                  for( y=sy; y<ey; y++ )
2264                  {
2265                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2266                     UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
2267
2268                     int x, x_index = x_index_base;
2269                     for( x=sx; x<ex; x++ )
2270                     {
2271                        int c = source[x_index>>16];
2272                        if( c != transparent_color )
2273                        {
2274                           if( gfx_alpharange_table[c] == 0xff )
2275                              dest[x] = pal[c];
2276                           else
2277                              dest[x] = alpha_blend_r32(dest[x], pal[c], gfx_alpharange_table[c]);
2278                        }
2279                        x_index += dx;
27832280                     }
2281
2282                     y_index += dy;
27842283                  }
27852284               }
27862285            }
r1771r1772
28222321}
28232322
28242323
2825#else /* DECLARE */
2324#else /* DECLAREG */
28262325
2326#if (DEPTH != 8)
28272327/* -------------------- included inline section --------------------- */
2828
2829/* this is #included to generate 8-bit and 16-bit versions */
2830
28312328#define ADJUST_8                                       \
28322329   int ydir;                                          \
28332330   if (flipy)                                          \
r1771r1772
32412738   }
32422739})
32432740
3244
32452741#if (RAW == 0)
32462742#define PEN_IS_OPAQUE ((1<<col)&transmask) == 0
32472743
r1771r1772
33532849#endif
33542850
33552851#if (RAW == 0)
3356#if DEPTH == 32
2852#if (DEPTH == 32)
33572853DECLARE_SWAP_RAW_PRI(blockmove_8toN_pen_table,(COMMON_ARGS,
33582854      COLOR_ARG,int transcolor),
33592855{
r1771r1772
35143010#endif
35153011#endif
35163012
3517#if DEPTH >= 16
3518
35193013#if (RAW == 0)
35203014DECLARE_SWAP_RAW_PRI(blockmove_8toN_alpha,(COMMON_ARGS,
35213015      COLOR_ARG,int transpen),
r1771r1772
36953189})
36963190#endif
36973191
3698#else
3699
3700#if (RAW == 0)
3701DECLARE_SWAP_RAW_PRI(blockmove_8toN_alpha,(COMMON_ARGS,
3702      COLOR_ARG,int transpen),{})
3703
3704DECLARE_SWAP_RAW_PRI(blockmove_8toN_alpharange,(COMMON_ARGS,
3705      COLOR_ARG,int transpen),{})
3706#endif
3707
3708#endif
3709
37103192DECLARE(blockmove_NtoN_opaque_noremap,(
37113193      const DATA_TYPE *srcdata,int srcwidth,int srcheight,int srcmodulo,
37123194      DATA_TYPE *dstdata,int dstmodulo),
r1771r1772
37663248   int ex;
37673249   int ey;
37683250
3769
37703251   /* check bounds */
37713252   ox = sx;
37723253   oy = sy;
r1771r1772
39003381   int ex;
39013382   int ey;
39023383
3903
39043384   /* check bounds */
39053385   ox = sx;
39063386   oy = sy;
r1771r1772
39743454   const int heightshifted = srcbitmap->height << 16;
39753455   DATA_TYPE *dest;
39763456
3977
39783457   if (clip)
39793458   {
39803459      startx += clip->min_x * incxx + clip->min_y * incyx;
r1771r1772
42373716   }
42383717})
42393718
3719#endif /* (DEPTH != 8) */
3720
42403721DECLAREG(draw_scanline, (
42413722      mame_bitmap *bitmap,int x,int y,int length,
42423723      const DATA_TYPE *src,const pen_t *pens,int transparent_pen),
42433724{
4244   /* 8bpp destination */
4245   if (bitmap->bpp == 8)
4246   {
4247      UINT8 *dst = BITMAP_ADDR8(bitmap, y, x);
4248      int xadv = 1;
3725   assert(bitmap != NULL);
3726   assert((bitmap->bpp == 16) || (bitmap->bpp == 32));
3727   assert(src != NULL);
3728   assert(length > 0);
3729   assert(x >= 0);
3730   assert(y >= 0);
42493731
4250      /* with pen lookups */
4251      if (pens)
4252      {
4253         if (transparent_pen == -1)
4254            while (length--)
4255            {
4256               *dst = pens[*src++];
4257               dst += xadv;
4258            }
4259         else
4260            while (length--)
4261            {
4262               UINT32 spixel = *src++;
4263               if (spixel != transparent_pen)
4264                  *dst = pens[spixel];
4265               dst += xadv;
4266            }
4267      }
4268
4269      /* without pen lookups */
4270      else
4271      {
4272         if (transparent_pen == -1)
4273            while (length--)
4274            {
4275               *dst = *src++;
4276               dst += xadv;
4277            }
4278         else
4279            while (length--)
4280            {
4281               UINT32 spixel = *src++;
4282               if (spixel != transparent_pen)
4283                  *dst = spixel;
4284               dst += xadv;
4285            }
4286      }
4287   }
4288
42893732   /* 16bpp destination */
4290   else if (bitmap->bpp == 16)
3733   if (bitmap->bpp == 16)
42913734   {
42923735      UINT16 *dst = BITMAP_ADDR16(bitmap, y, x);
42933736      int xadv = 1;
r1771r1772
43323775   }
43333776
43343777   /* 32bpp destination */
4335   else if (bitmap->bpp == 32)
3778   else
43363779   {
43373780      UINT32 *dst = BITMAP_ADDR32(bitmap, y, x);
43383781      int xadv = 1;
r1771r1772
43813824      mame_bitmap *bitmap,int x,int y,int length,
43823825      const DATA_TYPE *src,const pen_t *pens,int transparent_pen,int pri),
43833826{
4384   /* 8bpp destination */
4385   if (bitmap->bpp == 8)
4386   {
4387      UINT8 *dsti = BITMAP_ADDR8(bitmap, y, x);
4388      UINT8 *dstp = BITMAP_ADDR8(priority_bitmap, y, x);
4389      int xadv = 1;
3827   assert(bitmap != NULL);
3828   assert((bitmap->bpp == 16) || (bitmap->bpp == 32));
3829   assert(length > 0);
3830   assert(x >= 0);
3831   assert(y >= 0);
43903832
4391      /* with pen lookups */
4392      if (pens)
4393      {
4394         if (transparent_pen == -1)
4395            while (length--)
4396            {
4397               *dsti = pens[*src++];
4398               *dstp = pri;
4399               dsti += xadv;
4400               dstp += xadv;
4401            }
4402         else
4403            while (length--)
4404            {
4405               UINT32 spixel = *src++;
4406               if (spixel != transparent_pen)
4407               {
4408                  *dsti = pens[spixel];
4409                  *dstp = pri;
4410               }
4411               dsti += xadv;
4412               dstp += xadv;
4413            }
4414      }
4415
4416      /* without pen lookups */
4417      else
4418      {
4419         if (transparent_pen == -1)
4420            while (length--)
4421            {
4422               *dsti = *src++;
4423               *dstp = pri;
4424               dsti += xadv;
4425               dstp += xadv;
4426            }
4427         else
4428            while (length--)
4429            {
4430               UINT32 spixel = *src++;
4431               if (spixel != transparent_pen)
4432               {
4433                  *dsti = spixel;
4434                  *dstp = pri;
4435               }
4436               dsti += xadv;
4437               dstp += xadv;
4438            }
4439      }
4440   }
4441
44423833   /* 16bpp destination */
4443   else if (bitmap->bpp == 16)
3834   if (bitmap->bpp == 16)
44443835   {
44453836      UINT16 *dsti = BITMAP_ADDR16(bitmap, y, x);
44463837      UINT8 *dstp = BITMAP_ADDR8(priority_bitmap, y, x);
r1771r1772
44983889   }
44993890
45003891   /* 32bpp destination */
4501   else if (bitmap->bpp == 32)
3892   else
45023893   {
45033894      UINT32 *dsti = BITMAP_ADDR32(bitmap, y, x);
45043895      UINT8 *dstp = BITMAP_ADDR8(priority_bitmap, y, x);
r1771r1772
45613952      mame_bitmap *bitmap,int x,int y,int length,
45623953      DATA_TYPE *dst),
45633954{
4564   /* 8bpp destination */
4565   if (bitmap->bpp == 8)
4566   {
4567      UINT8 *src = BITMAP_ADDR8(bitmap, y, x);
4568      int xadv = 1;
3955   assert(bitmap != NULL);
3956   assert((bitmap->bpp == 16) || (bitmap->bpp == 32));
3957   assert(dst != NULL);
3958   assert(length > 0);
3959   assert(x >= 0);
3960   assert(y >= 0);
45693961
4570      while (length--)
4571      {
4572         *dst++ = *src;
4573         src += xadv;
4574      }
4575   }
4576
45773962   /* 16bpp destination */
4578   else if (bitmap->bpp == 16)
3963   if (bitmap->bpp == 16)
45793964   {
45803965      UINT16 *src = BITMAP_ADDR16(bitmap, y, x);
45813966      int xadv = 1;
r1771r1772
45883973   }
45893974
45903975   /* 32bpp destination */
4591   else if (bitmap->bpp == 32)
3976   else
45923977   {
45933978      UINT32 *src = BITMAP_ADDR32(bitmap, y, x);
45943979      int xadv = 1;
r1771r1772
46013986   }
46023987})
46033988
4604#endif /* DECLARE */
3989#endif /* DECLAREG */
src/emu/clifront.c
r1771r1772
558558   for (drvindex = 0; drivers[drvindex]; drvindex++)
559559      if (mame_strwildcmp(gamename, drivers[drvindex]->name) == 0)
560560      {
561         machine_config *config = machine_config_alloc(drivers[drvindex]->drv);
561         machine_config *config = machine_config_alloc(drivers[drvindex]->machine_config);
562562         int sndnum;
563563
564564         /* find samples interfaces */
src/emu/mconfig.c
r1771r1772
1010***************************************************************************/
1111
1212#include "driver.h"
13#include "devintrf.h"
1314#include <ctype.h>
1415
1516
1617/***************************************************************************
17    MACHINE_CONFIGURATIONS
18    FUNCTION PROTOTYPES
1819***************************************************************************/
1920
21static void machine_config_detokenize(machine_config *config, const machine_config_token *tokens);
22
23
24
25/***************************************************************************
26    MACHINE CONFIGURATIONS
27***************************************************************************/
28
2029/*-------------------------------------------------
2130    machine_config_alloc - allocate a new
2231    machine configuration and populate it using
2332    the supplied constructor
2433-------------------------------------------------*/
2534
26machine_config *machine_config_alloc(void (*constructor)(machine_config *))
35machine_config *machine_config_alloc(const machine_config_token *tokens)
2736{
2837   machine_config *config;
2938
r1771r1772
3342      return NULL;
3443   memset(config, 0, sizeof(*config));
3544
36   /* call the function to construct the data */
37   (*constructor)(config);
45   /* parse tokens into the config */
46   machine_config_detokenize(config, tokens);
3847   return config;
3948}
4049
r1771r1772
120129
121130
122131/*-------------------------------------------------
123    machine_config_add_speaker - add a speaker during
124    machine driver expansion
125-------------------------------------------------*/
126
127speaker_config *machine_config_add_speaker(machine_config *machine, const char *tag, float x, float y, float z)
128{
129   int speakernum;
130
131   for (speakernum = 0; speakernum < MAX_SPEAKER; speakernum++)
132      if (machine->speaker[speakernum].tag == NULL)
133      {
134         machine->speaker[speakernum].tag = tag;
135         machine->speaker[speakernum].x = x;
136         machine->speaker[speakernum].y = y;
137         machine->speaker[speakernum].z = z;
138         return &machine->speaker[speakernum];
139      }
140
141   fatalerror("Out of speakers!\n");
142   return NULL;
143}
144
145
146/*-------------------------------------------------
147    machine_config_find_speaker - find a tagged speaker
148    system during machine driver expansion
149-------------------------------------------------*/
150
151speaker_config *machine_config_find_speaker(machine_config *machine, const char *tag)
152{
153   int speakernum;
154
155   for (speakernum = 0; speakernum < MAX_SPEAKER; speakernum++)
156      if (machine->speaker[speakernum].tag && strcmp(machine->speaker[speakernum].tag, tag) == 0)
157         return &machine->speaker[speakernum];
158
159   fatalerror("Can't find speaker '%s'!\n", tag);
160   return NULL;
161}
162
163
164/*-------------------------------------------------
165    machine_config_remove_speaker - remove a tagged speaker
166    system during machine driver expansion
167-------------------------------------------------*/
168
169void machine_config_remove_speaker(machine_config *machine, const char *tag)
170{
171   int speakernum;
172
173   for (speakernum = 0; speakernum < MAX_SPEAKER; speakernum++)
174      if (machine->speaker[speakernum].tag && strcmp(machine->speaker[speakernum].tag, tag) == 0)
175      {
176         memmove(&machine->speaker[speakernum], &machine->speaker[speakernum + 1], sizeof(machine->speaker[0]) * (MAX_SPEAKER - speakernum - 1));
177         memset(&machine->speaker[MAX_SPEAKER - 1], 0, sizeof(machine->speaker[0]));
178         return;
179      }
180
181   fatalerror("Can't find speaker '%s'!\n", tag);
182}
183
184
185/*-------------------------------------------------
186132    machine_config_add_sound - add a sound system during
187133    machine driver expansion
188134-------------------------------------------------*/
r1771r1772
244190
245191   fatalerror("Can't find sound '%s'!\n", tag);
246192}
193
194
195/*-------------------------------------------------
196    machine_config_detokenize - detokenize a
197    machine config
198-------------------------------------------------*/
199
200static void machine_config_detokenize(machine_config *config, const machine_config_token *tokens)
201{
202   UINT32 entrytype = MCONFIG_TOKEN_INVALID;
203   device_config *device = NULL;
204   cpu_config *cpu = NULL;
205   sound_config *sound = NULL;
206
207   /* loop over tokens until we hit the end */
208   while (entrytype != MCONFIG_TOKEN_END)
209   {
210      device_type devtype;
211      const char *tag;
212      int size, offset, type, bits;
213      UINT32 data32, clock, gain;
214      UINT64 data64;
215
216      /* unpack the token from the first entry */
217      TOKEN_GET_UINT32_UNPACK1(tokens, entrytype, 8);
218      switch (entrytype)
219      {
220         /* end */
221         case MCONFIG_TOKEN_END:
222            break;
223
224         /* including */
225         case MCONFIG_TOKEN_INCLUDE:
226            machine_config_detokenize(config, TOKEN_GET_PTR(tokens, tokenptr));
227            break;
228
229         /* device management */
230         case MCONFIG_TOKEN_DEVICE_ADD:
231            devtype = TOKEN_GET_PTR(tokens, devtype);
232            tag = TOKEN_GET_STRING(tokens);
233            device = device_list_add(&config->devicelist, devtype, tag);
234            break;
235
236         case MCONFIG_TOKEN_DEVICE_REMOVE:
237            devtype = TOKEN_GET_PTR(tokens, devtype);
238            tag = TOKEN_GET_STRING(tokens);
239            device_list_remove(&config->devicelist, devtype, tag);
240            device = NULL;
241            break;
242
243         case MCONFIG_TOKEN_DEVICE_MODIFY:
244            devtype = TOKEN_GET_PTR(tokens, devtype);
245            tag = TOKEN_GET_STRING(tokens);
246            device = (device_config *)device_list_find_by_tag(config->devicelist, devtype, tag);
247            if (device == NULL)
248               fatalerror("Unable to find device: type=%s tag=%s\n", devtype_name(devtype), tag);
249            break;
250
251         case MCONFIG_TOKEN_DEVICE_CONFIG:
252            assert(device != NULL);
253            device->static_config = TOKEN_GET_PTR(tokens, voidptr);
254            break;
255
256         case MCONFIG_TOKEN_DEVICE_CONFIG_DATA32:
257            assert(device != NULL);
258            TOKEN_UNGET_UINT32(tokens);
259            TOKEN_GET_UINT32_UNPACK3(tokens, entrytype, 8, size, 6, offset, 12);
260            data32 = TOKEN_GET_UINT32(tokens);
261            switch (size)
262            {
263               case 1: *(UINT8 *) ((UINT8 *)device->inline_config + offset) = data32; break;
264               case 2: *(UINT16 *)((UINT8 *)device->inline_config + offset) = data32; break;
265               case 4: *(UINT32 *)((UINT8 *)device->inline_config + offset) = data32; break;
266            }
267            break;
268
269         case MCONFIG_TOKEN_DEVICE_CONFIG_DATA64:
270            assert(device != NULL);
271            TOKEN_UNGET_UINT32(tokens);
272            TOKEN_GET_UINT32_UNPACK3(tokens, entrytype, 8, size, 6, offset, 12);
273            TOKEN_EXTRACT_UINT64(tokens, data64);
274            switch (size)
275            {
276               case 1: *(UINT8 *) ((UINT8 *)device->inline_config + offset) = data64; break;
277               case 2: *(UINT16 *)((UINT8 *)device->inline_config + offset) = data64; break;
278               case 4: *(UINT32 *)((UINT8 *)device->inline_config + offset) = data64; break;
279               case 8: *(UINT64 *)((UINT8 *)device->inline_config + offset) = data64; break;
280            }
281            break;
282
283         case MCONFIG_TOKEN_DEVICE_CONFIG_DATAFP32:
284            assert(device != NULL);
285            TOKEN_UNGET_UINT32(tokens);
286            TOKEN_GET_UINT32_UNPACK4(tokens, entrytype, 8, size, 6, bits, 6, offset, 12);
287            data32 = TOKEN_GET_UINT32(tokens);
288            switch (size)
289            {
290               case 4: *(float *)((UINT8 *)device->inline_config + offset) = (float)(INT32)data32 / (float)(1 << bits); break;
291               case 8: *(double *)((UINT8 *)device->inline_config + offset) = (double)(INT32)data32 / (double)(1 << bits); break;
292            }
293            break;
294
295         case MCONFIG_TOKEN_DEVICE_CONFIG_DATAFP64:
296            assert(device != NULL);
297            TOKEN_UNGET_UINT32(tokens);
298            TOKEN_GET_UINT32_UNPACK4(tokens, entrytype, 8, size, 6, bits, 6, offset, 12);
299            TOKEN_EXTRACT_UINT64(tokens, data64);
300            switch (size)
301            {
302               case 4: *(float *)((UINT8 *)device->inline_config + offset) = (float)(INT64)data64 / (float)((UINT64)1 << bits); break;
303               case 8: *(double *)((UINT8 *)device->inline_config + offset) = (double)(INT64)data64 / (double)((UINT64)1 << bits); break;
304            }
305            break;
306
307
308         /* add/modify/remove/replace CPUs */
309         case MCONFIG_TOKEN_CPU_ADD:
310            TOKEN_UNGET_UINT32(tokens);
311            TOKEN_GET_UINT64_UNPACK3(tokens, entrytype, 8, type, 24, clock, 32);
312            tag = TOKEN_GET_STRING(tokens);
313            cpu = machine_config_add_cpu(config, tag, type, clock);
314            break;
315
316         case MCONFIG_TOKEN_CPU_MODIFY:
317            tag = TOKEN_GET_STRING(tokens);
318            cpu = machine_config_find_cpu(config, tag);
319            break;
320
321         case MCONFIG_TOKEN_CPU_REMOVE:
322            tag = TOKEN_GET_STRING(tokens);
323            machine_config_remove_cpu(config, tag);
324            cpu = NULL;
325            break;
326
327         case MCONFIG_TOKEN_CPU_REPLACE:
328            TOKEN_UNGET_UINT32(tokens);
329            TOKEN_GET_UINT64_UNPACK3(tokens, entrytype, 8, type, 24, clock, 32);
330            tag = TOKEN_GET_STRING(tokens);
331            cpu = machine_config_find_cpu(config, tag);
332            if (cpu == NULL)
333               fatalerror("Unable to find CPU: tag=%s\n", tag);
334            cpu->type = type;
335            cpu->clock = clock;
336            break;
337
338         /* CPU parameters */
339         case MCONFIG_TOKEN_CPU_FLAGS:
340            assert(cpu != NULL);
341            TOKEN_UNGET_UINT32(tokens);
342            TOKEN_GET_UINT32_UNPACK2(tokens, entrytype, 8, cpu->flags, 24);
343            break;
344
345         case MCONFIG_TOKEN_CPU_CONFIG:
346            assert(cpu != NULL);
347            cpu->reset_param = TOKEN_GET_PTR(tokens, voidptr);
348            break;
349
350         case MCONFIG_TOKEN_CPU_PROGRAM_MAP:
351            assert(cpu != NULL);
352            cpu->construct_map[ADDRESS_SPACE_PROGRAM][0] = (construct_map_t)TOKEN_GET_PTR(tokens, voidptr);
353            cpu->construct_map[ADDRESS_SPACE_PROGRAM][1] = (construct_map_t)TOKEN_GET_PTR(tokens, voidptr);
354            break;
355
356         case MCONFIG_TOKEN_CPU_DATA_MAP:
357            assert(cpu != NULL);
358            cpu->construct_map[ADDRESS_SPACE_DATA][0] = (construct_map_t)TOKEN_GET_PTR(tokens, voidptr);
359            cpu->construct_map[ADDRESS_SPACE_DATA][1] = (construct_map_t)TOKEN_GET_PTR(tokens, voidptr);
360            break;
361
362         case MCONFIG_TOKEN_CPU_IO_MAP:
363            assert(cpu != NULL);
364            cpu->construct_map[ADDRESS_SPACE_IO][0] = (construct_map_t)TOKEN_GET_PTR(tokens, voidptr);
365            cpu->construct_map[ADDRESS_SPACE_IO][1] = (construct_map_t)TOKEN_GET_PTR(tokens, voidptr);
366            break;
367
368         case MCONFIG_TOKEN_CPU_VBLANK_INT:
369            assert(cpu != NULL);
370            TOKEN_UNGET_UINT32(tokens);
371            TOKEN_GET_UINT32_UNPACK2(tokens, entrytype, 8, cpu->vblank_interrupts_per_frame, 24);
372            cpu->vblank_interrupt = TOKEN_GET_PTR(tokens, interrupt);
373            break;
374
375         case MCONFIG_TOKEN_CPU_PERIODIC_INT:
376            assert(cpu != NULL);
377            TOKEN_UNGET_UINT32(tokens);
378            TOKEN_GET_UINT32_UNPACK2(tokens, entrytype, 8, data32, 24);
379            cpu->timed_interrupt_period = HZ_TO_ATTOSECONDS(data32);
380            cpu->timed_interrupt = TOKEN_GET_PTR(tokens, interrupt);
381            break;
382
383         /* core parameters */
384         case MCONFIG_TOKEN_DRIVER_DATA:
385            TOKEN_UNGET_UINT32(tokens);
386            TOKEN_GET_UINT32_UNPACK2(tokens, entrytype, 8, config->driver_data_size, 24);
387            break;
388
389         case MCONFIG_TOKEN_INTERLEAVE:
390            TOKEN_UNGET_UINT32(tokens);
391            TOKEN_GET_UINT32_UNPACK2(tokens, entrytype, 8, config->cpu_slices_per_frame, 24);
392            break;
393
394         case MCONFIG_TOKEN_WATCHDOG_VBLANK:
395            TOKEN_UNGET_UINT32(tokens);
396            TOKEN_GET_UINT32_UNPACK2(tokens, entrytype, 8, config->watchdog_vblank_count, 24);
397            break;
398
399         case MCONFIG_TOKEN_WATCHDOG_TIME:
400            TOKEN_EXTRACT_UINT64(tokens, data64);
401            config->watchdog_time = UINT64_ATTOTIME_TO_ATTOTIME(data64);
402            break;
403
404         /* core functions */
405         case MCONFIG_TOKEN_MACHINE_START:
406            config->machine_start = TOKEN_GET_PTR(tokens, machine_start);
407            break;
408
409         case MCONFIG_TOKEN_MACHINE_RESET:
410            config->machine_reset = TOKEN_GET_PTR(tokens, machine_reset);
411            break;
412
413         case MCONFIG_TOKEN_NVRAM_HANDLER:
414            config->nvram_handler = TOKEN_GET_PTR(tokens, nvram_handler);
415            break;
416
417         case MCONFIG_TOKEN_MEMCARD_HANDLER:
418            config->memcard_handler = TOKEN_GET_PTR(tokens, memcard_handler);
419            break;
420
421         /* core video parameters */
422         case MCONFIG_TOKEN_VIDEO_ATTRIBUTES:
423            TOKEN_UNGET_UINT32(tokens);
424            TOKEN_GET_UINT32_UNPACK2(tokens, entrytype, 8, config->video_attributes, 24);
425            break;
426
427         case MCONFIG_TOKEN_GFXDECODE:
428            config->gfxdecodeinfo = TOKEN_GET_PTR(tokens, gfxdecode);
429            break;
430
431         case MCONFIG_TOKEN_PALETTE_LENGTH:
432            TOKEN_UNGET_UINT32(tokens);
433            TOKEN_GET_UINT32_UNPACK2(tokens, entrytype, 8, config->total_colors, 24);
434            break;
435
436         case MCONFIG_TOKEN_DEFAULT_LAYOUT:
437            config->default_layout = TOKEN_GET_STRING(tokens);
438            break;
439
440         /* core video functions */
441         case MCONFIG_TOKEN_PALETTE_INIT:
442            config->init_palette = TOKEN_GET_PTR(tokens, palette_init);
443            break;
444
445         case MCONFIG_TOKEN_VIDEO_START:
446            config->video_start = TOKEN_GET_PTR(tokens, video_start);
447            break;
448
449         case MCONFIG_TOKEN_VIDEO_RESET:
450            config->video_reset = TOKEN_GET_PTR(tokens, video_reset);
451            break;
452
453         case MCONFIG_TOKEN_VIDEO_EOF:
454            config->video_eof = TOKEN_GET_PTR(tokens, video_eof);
455            break;
456
457         case MCONFIG_TOKEN_VIDEO_UPDATE:
458            config->video_update = TOKEN_GET_PTR(tokens, video_update);
459            break;
460
461         /* core sound functions */
462         case MCONFIG_TOKEN_SOUND_START:
463            config->sound_start = TOKEN_GET_PTR(tokens, sound_start);
464            break;
465
466         case MCONFIG_TOKEN_SOUND_RESET:
467            config->sound_reset = TOKEN_GET_PTR(tokens, sound_reset);
468            break;
469
470         /* add/remove/replace sounds */
471         case MCONFIG_TOKEN_SOUND_ADD:
472            TOKEN_UNGET_UINT32(tokens);
473            TOKEN_GET_UINT64_UNPACK3(tokens, entrytype, 8, type, 24, clock, 32);
474            tag = TOKEN_GET_STRING(tokens);
475            sound = machine_config_add_sound(config, tag, type, clock);
476            break;
477
478         case MCONFIG_TOKEN_SOUND_REMOVE:
479            machine_config_remove_sound(config, TOKEN_GET_STRING(tokens));
480            break;
481
482         case MCONFIG_TOKEN_SOUND_MODIFY:
483            tag = TOKEN_GET_STRING(tokens);
484            sound = machine_config_find_sound(config, tag);
485            if (sound == NULL)
486               fatalerror("Unable to find sound: tag=%s\n", tag);
487            sound->routes = 0;
488            break;
489
490         case MCONFIG_TOKEN_SOUND_CONFIG:
491            assert(sound != NULL);
492            sound->config = TOKEN_GET_PTR(tokens, voidptr);
493            break;
494
495         case MCONFIG_TOKEN_SOUND_REPLACE:
496            TOKEN_UNGET_UINT32(tokens);
497            TOKEN_GET_UINT64_UNPACK3(tokens, entrytype, 8, type, 24, clock, 32);
498            tag = TOKEN_GET_STRING(tokens);
499            sound = machine_config_find_sound(config, tag);
500            if (sound == NULL)
501               fatalerror("Unable to find sound: tag=%s\n", tag);
502            sound->type = type;
503            sound->clock = clock;
504            sound->config = NULL;
505            sound->routes = 0;
506            break;
507
508         case MCONFIG_TOKEN_SOUND_ROUTE:
509            assert(sound != NULL);
510            TOKEN_UNGET_UINT32(tokens);
511            TOKEN_GET_UINT64_UNPACK4(tokens, entrytype, 8, sound->route[sound->routes].output, -12, sound->route[sound->routes].input, -12, gain, 32);
512            sound->route[sound->routes].gain = (float)gain / 16777216.0f;
513            sound->route[sound->routes].target = TOKEN_GET_STRING(tokens);
514            sound->routes++;
515            break;
516      }
517   }
518}
src/emu/timer.h
r1771r1772
3333
3434/* macros for the RC time constant on a 555 timer IC */
3535/* R is in ohms, C is in farads */
36#define PERIOD_OF_555_MONOSTABLE(r,c)   ATTOTIME_IN_NSEC((attoseconds_t)(1100000000 * (double)(r) * (double)(c)))
37#define PERIOD_OF_555_ASTABLE(r1,r2,c)   ATTOTIME_IN_NSEC((attoseconds_t)( 693000000 * ((double)(r1) + 2.0 * (double)(r2)) * (double)(c)))
36#define PERIOD_OF_555_MONOSTABLE_NSEC(r,c)   ((attoseconds_t)(1100000000 * (double)(r) * (double)(c)))
37#define PERIOD_OF_555_ASTABLE_NSEC(r1,r2,c)   ((attoseconds_t)( 693000000 * ((double)(r1) + 2.0 * (double)(r2)) * (double)(c)))
38#define PERIOD_OF_555_MONOSTABLE(r,c)      ATTOTIME_IN_NSEC(PERIOD_OF_555_MONOSTABLE_NSEC(r,c))
39#define PERIOD_OF_555_ASTABLE(r1,r2,c)      ATTOTIME_IN_NSEC(PERIOD_OF_555_ASTABLE_NSEC(r1,r2,c))
3840
3941/* macros that map all allocations to provide file/line/functions to the callee */
4042#define timer_alloc(c,ptr)            _timer_alloc_internal(c, ptr, __FILE__, __LINE__, #c)
src/emu/validity.c
r1771r1772
8383INLINE const char *input_port_string_from_index(UINT32 index)
8484{
8585   input_port_token token;
86   token.fptr = index;
86   token.i = index;
8787   return input_port_string_from_token(token);
8888}
8989
r1771r1772
364364    information
365365-------------------------------------------------*/
366366
367static int validate_driver(int drivnum, const machine_config *drv)
367static int validate_driver(int drivnum, const machine_config *config)
368368{
369369   const game_driver *driver = drivers[drivnum];
370370   const game_driver *clone_of;
r1771r1772
416416
417417#ifndef MESS
418418   /* make sure sound-less drivers are flagged */
419   if ((driver->flags & GAME_IS_BIOS_ROOT) == 0 && drv->sound[0].type == SOUND_DUMMY && (driver->flags & GAME_NO_SOUND) == 0 && strcmp(driver->name, "minivadr"))
419   if ((driver->flags & GAME_IS_BIOS_ROOT) == 0 && config->sound[0].type == SOUND_DUMMY && (driver->flags & GAME_NO_SOUND) == 0 && strcmp(driver->name, "minivadr"))
420420   {
421421      mame_printf_error("%s: %s missing GAME_NO_SOUND flag\n", driver->source_file, driver->name);
422422      error = TRUE;
r1771r1772
475475    validate_roms - validate ROM definitions
476476-------------------------------------------------*/
477477
478static int validate_roms(int drivnum, const machine_config *drv, UINT32 *region_length)
478static int validate_roms(int drivnum, const machine_config *config, UINT32 *region_length)
479479{
480480   const game_driver *driver = drivers[drivnum];
481481   const rom_entry *romp;
r1771r1772
603603    validate_cpu - validate CPUs and memory maps
604604-------------------------------------------------*/
605605
606static int validate_cpu(int drivnum, const machine_config *drv, const UINT32 *region_length)
606static int validate_cpu(int drivnum, const machine_config *config, const UINT32 *region_length)
607607{
608608   const game_driver *driver = drivers[drivnum];
609609   int error = FALSE;
r1771r1772
613613   for (cpunum = 0; cpunum < MAX_CPU; cpunum++)
614614   {
615615      extern void dummy_get_info(UINT32 state, cpuinfo *info);
616      const cpu_config *cpu = &drv->cpu[cpunum];
616      const cpu_config *cpu = &config->cpu[cpunum];
617617      int spacenum;
618618
619619      /* skip empty entries */
r1771r1772
666666
667667         /* construct the maps */
668668         map = addrmap;
669         construct_address_map(map, drv, cpunum, spacenum);
669         construct_address_map(map, config, cpunum, spacenum);
670670
671671         /* if this is an empty map, just skip it */
672672         if (IS_AMENTRY_END(map))
r1771r1772
771771    configurations
772772-------------------------------------------------*/
773773
774static int validate_display(int drivnum, const machine_config *drv)
774static int validate_display(int drivnum, const machine_config *config)
775775{
776776   const game_driver *driver = drivers[drivnum];
777777   const device_config *device;
r1771r1772
779779   int error = FALSE;
780780
781781   /* loop over screens */
782   for (device = video_screen_first(drv); device != NULL; device = video_screen_next(device))
782   for (device = video_screen_first(config); device != NULL; device = video_screen_next(device))
783783   {
784784      const screen_config *scrconfig = device->inline_config;
785785
r1771r1772
823823   }
824824
825825   /* check for empty palette */
826   if (palette_modes && drv->total_colors == 0)
826   if (palette_modes && config->total_colors == 0)
827827   {
828828      mame_printf_error("%s: %s has zero palette entries\n", driver->source_file, driver->name);
829829      error = TRUE;
r1771r1772
838838    configuration
839839-------------------------------------------------*/
840840
841static int validate_gfx(int drivnum, const machine_config *drv, const UINT32 *region_length)
841static int validate_gfx(int drivnum, const machine_config *config, const UINT32 *region_length)
842842{
843843   const game_driver *driver = drivers[drivnum];
844844   int error = FALSE;
845845   int gfxnum;
846846
847847   /* bail if no gfx */
848   if (!drv->gfxdecodeinfo)
848   if (!config->gfxdecodeinfo)
849849      return FALSE;
850850
851851   /* iterate over graphics decoding entries */
852   for (gfxnum = 0; gfxnum < MAX_GFX_ELEMENTS && drv->gfxdecodeinfo[gfxnum].memory_region != -1; gfxnum++)
852   for (gfxnum = 0; gfxnum < MAX_GFX_ELEMENTS && config->gfxdecodeinfo[gfxnum].memory_region != -1; gfxnum++)
853853   {
854      const gfx_decode_entry *gfx = &drv->gfxdecodeinfo[gfxnum];
854      const gfx_decode_entry *gfx = &config->gfxdecodeinfo[gfxnum];
855855      int region = gfx->memory_region;
856      int xscale = (drv->gfxdecodeinfo[gfxnum].xscale == 0) ? 1 : drv->gfxdecodeinfo[gfxnum].xscale;
857      int yscale = (drv->gfxdecodeinfo[gfxnum].yscale == 0) ? 1 : drv->gfxdecodeinfo[gfxnum].yscale;
856      int xscale = (config->gfxdecodeinfo[gfxnum].xscale == 0) ? 1 : config->gfxdecodeinfo[gfxnum].xscale;
857      int yscale = (config->gfxdecodeinfo[gfxnum].yscale == 0) ? 1 : config->gfxdecodeinfo[gfxnum].yscale;
858858      const gfx_layout *gl = gfx->gfxlayout;
859859      int israw = (gl->planeoffset[0] == GFX_RAW);
860860      int planes = gl->planes;
r1771r1772
987987    validate_inputs - validate input configuration
988988-------------------------------------------------*/
989989
990static int validate_inputs(int drivnum, const machine_config *drv, input_port_entry **memory)
990static int validate_inputs(int drivnum, const machine_config *config, input_port_entry **memory)
991991{
992992   const char *demo_sounds = input_port_string_from_index(INPUT_STRING_Demo_Sounds);
993993   const char *flipscreen = input_port_string_from_index(INPUT_STRING_Flip_Screen);
r1771r1772
12661266    speaker configuration
12671267-------------------------------------------------*/
12681268
1269static int validate_sound(int drivnum, const machine_config *drv)
1269static int validate_sound(int drivnum, const machine_config *config)
12701270{
12711271   const game_driver *driver = drivers[drivnum];
1272   int speaknum, sndnum;
1272   const device_config *curspeak, *checkspeak;
12731273   int error = FALSE;
1274   int sndnum;
12741275
12751276   /* make sure the speaker layout makes sense */
1276   for (speaknum = 0; speaknum < MAX_SPEAKER && drv->speaker[speaknum].tag; speaknum++)
1277   for (curspeak = speaker_output_first(config); curspeak != NULL; curspeak = speaker_output_next(curspeak))
12771278   {
12781279      int check;
12791280
12801281      /* check for duplicate tags */
1281      for (check = 0; check < MAX_SPEAKER && drv->speaker[check].tag; check++)
1282         if (speaknum != check && drv->speaker[check].tag && !strcmp(drv->speaker[speaknum].tag, drv->speaker[check].tag))
1282      for (checkspeak = speaker_output_first(config); checkspeak != NULL; checkspeak = speaker_output_next(checkspeak))
1283         if (checkspeak != curspeak && strcmp(checkspeak->tag, curspeak->tag) == 0)
12831284         {
1284            mame_printf_error("%s: %s has multiple speakers tagged as '%s'\n", driver->source_file, driver->name, drv->speaker[speaknum].tag);
1285            mame_printf_error("%s: %s has multiple speakers tagged as '%s'\n", driver->source_file, driver->name, checkspeak->tag);
12851286            error = TRUE;
12861287         }
12871288
12881289      /* make sure there are no sound chips with the same tag */
1289      for (check = 0; check < MAX_SOUND && drv->sound[check].type != SOUND_DUMMY; check++)
1290         if (drv->sound[check].tag && !strcmp(drv->speaker[speaknum].tag, drv->sound[check].tag))
1290      for (check = 0; check < MAX_SOUND && config->sound[check].type != SOUND_DUMMY; check++)
1291         if (config->sound[check].tag && strcmp(curspeak->tag, config->sound[check].tag) == 0)
12911292         {
1292            mame_printf_error("%s: %s has both a speaker and a sound chip tagged as '%s'\n", driver->source_file, driver->name, drv->speaker[speaknum].tag);
1293            mame_printf_error("%s: %s has both a speaker and a sound chip tagged as '%s'\n", driver->source_file, driver->name, curspeak->tag);
12931294            error = TRUE;
12941295         }
12951296   }
12961297
12971298   /* make sure the sounds are wired to the speakers correctly */
1298   for (sndnum = 0; sndnum < MAX_SOUND && drv->sound[sndnum].type != SOUND_DUMMY; sndnum++)
1299   for (sndnum = 0; sndnum < MAX_SOUND && config->sound[sndnum].type != SOUND_DUMMY; sndnum++)
12991300   {
13001301      int routenum;
13011302
13021303      /* loop over all the routes */
1303      for (routenum = 0; routenum < drv->sound[sndnum].routes; routenum++)
1304      for (routenum = 0; routenum < config->sound[sndnum].routes; routenum++)
13041305      {
13051306         /* find a speaker with the requested tag */
1306         for (speaknum = 0; speaknum < MAX_SPEAKER && drv->speaker[speaknum].tag; speaknum++)
1307            if (!strcmp(drv->sound[sndnum].route[routenum].target, drv->speaker[speaknum].tag))
1307         for (checkspeak = speaker_output_first(config); checkspeak != NULL; checkspeak = speaker_output_next(checkspeak))
1308            if (strcmp(config->sound[sndnum].route[routenum].target, checkspeak->tag) == 0)
13081309               break;
13091310
13101311         /* if we didn't find one, look for another sound chip with the tag */
1311         if (speaknum >= MAX_SPEAKER || !drv->speaker[speaknum].tag)
1312         if (checkspeak == NULL)
13121313         {
13131314            int check;
13141315
1315            for (check = 0; check < MAX_SOUND && drv->sound[check].type != SOUND_DUMMY; check++)
1316               if (check != sndnum && drv->sound[check].tag && !strcmp(drv->sound[check].tag, drv->sound[sndnum].route[routenum].target))
1316            for (check = 0; check < MAX_SOUND && config->sound[check].type != SOUND_DUMMY; check++)
1317               if (check != sndnum && config->sound[check].tag && strcmp(config->sound[check].tag, config->sound[sndnum].route[routenum].target) == 0)
13171318                  break;
13181319
13191320            /* if we didn't find one, it's an error */
1320            if (check >= MAX_SOUND || drv->sound[check].type == SOUND_DUMMY)
1321            if (check >= MAX_SOUND || config->sound[check].type == SOUND_DUMMY)
13211322            {
1322               mame_printf_error("%s: %s attempting to route sound to non-existant speaker '%s'\n", driver->source_file, driver->name, drv->sound[sndnum].route[routenum].target);
1323               mame_printf_error("%s: %s attempting to route sound to non-existant speaker '%s'\n", driver->source_file, driver->name, config->sound[sndnum].route[routenum].target);
13231324               error = TRUE;
13241325            }
13251326         }
r1771r1772
14131414
14141415      /* expand the machine driver */
14151416      expansion -= osd_profiling_ticks();
1416      config = machine_config_alloc(driver->drv);
1417      config = machine_config_alloc(driver->machine_config);
14171418      expansion += osd_profiling_ticks();
14181419
14191420      /* validate the driver entry */
src/emu/mconfig.h
r1771r1772
1515#define __MCONFIG_H__
1616
1717#include "devintrf.h"
18#include <stddef.h>
1819
1920
2021/***************************************************************************
2122    CONSTANTS
2223***************************************************************************/
2324
24/* maxima */
25#define MAX_SPEAKER          4
25/* token types */
26enum
27{
28   MCONFIG_TOKEN_INVALID,
29   MCONFIG_TOKEN_END,
30   MCONFIG_TOKEN_INCLUDE,
2631
32   MCONFIG_TOKEN_DEVICE_ADD,
33   MCONFIG_TOKEN_DEVICE_REMOVE,
34   MCONFIG_TOKEN_DEVICE_MODIFY,
35   MCONFIG_TOKEN_DEVICE_CONFIG,
36   MCONFIG_TOKEN_DEVICE_CONFIG_DATA32,
37   MCONFIG_TOKEN_DEVICE_CONFIG_DATA64,
38   MCONFIG_TOKEN_DEVICE_CONFIG_DATAFP32,
39   MCONFIG_TOKEN_DEVICE_CONFIG_DATAFP64,
2740
41   MCONFIG_TOKEN_CPU_ADD,
42   MCONFIG_TOKEN_CPU_MODIFY,
43   MCONFIG_TOKEN_CPU_REMOVE,
44   MCONFIG_TOKEN_CPU_REPLACE,
45   MCONFIG_TOKEN_CPU_FLAGS,
46   MCONFIG_TOKEN_CPU_CONFIG,
47   MCONFIG_TOKEN_CPU_PROGRAM_MAP,
48   MCONFIG_TOKEN_CPU_DATA_MAP,
49   MCONFIG_TOKEN_CPU_IO_MAP,
50   MCONFIG_TOKEN_CPU_VBLANK_INT,
51   MCONFIG_TOKEN_CPU_PERIODIC_INT,
2852
53   MCONFIG_TOKEN_DRIVER_DATA,
54   MCONFIG_TOKEN_INTERLEAVE,
55   MCONFIG_TOKEN_WATCHDOG_VBLANK,
56   MCONFIG_TOKEN_WATCHDOG_TIME,
57
58   MCONFIG_TOKEN_MACHINE_START,
59   MCONFIG_TOKEN_MACHINE_RESET,
60   MCONFIG_TOKEN_NVRAM_HANDLER,
61   MCONFIG_TOKEN_MEMCARD_HANDLER,
62
63   MCONFIG_TOKEN_VIDEO_ATTRIBUTES,
64   MCONFIG_TOKEN_GFXDECODE,
65   MCONFIG_TOKEN_PALETTE_LENGTH,
66   MCONFIG_TOKEN_DEFAULT_LAYOUT,
67
68   MCONFIG_TOKEN_PALETTE_INIT,
69   MCONFIG_TOKEN_VIDEO_START,
70   MCONFIG_TOKEN_VIDEO_RESET,
71   MCONFIG_TOKEN_VIDEO_EOF,
72   MCONFIG_TOKEN_VIDEO_UPDATE,
73
74   MCONFIG_TOKEN_SOUND_START,
75   MCONFIG_TOKEN_SOUND_RESET,
76
77   MCONFIG_TOKEN_SOUND_ADD,
78   MCONFIG_TOKEN_SOUND_REMOVE,
79   MCONFIG_TOKEN_SOUND_MODIFY,
80   MCONFIG_TOKEN_SOUND_CONFIG,
81   MCONFIG_TOKEN_SOUND_REPLACE,
82   MCONFIG_TOKEN_SOUND_ROUTE,
83};
84
85
2986/* ----- flags for video_attributes ----- */
3087
3188/* should VIDEO_UPDATE by called at the start of VBLANK or at the end? */
r1771r1772
84141   UINT32            (*video_update)(running_machine *machine, int screen, mame_bitmap *bitmap, const rectangle *cliprect); /* video update callback */
85142
86143   sound_config      sound[MAX_SOUND];         /* array of sound chips in the system */
87   speaker_config      speaker[MAX_SPEAKER];      /* array of speakers in the system */
88144
89145   void            (*sound_start)(running_machine *machine);      /* one-time sound start callback */
90146   void            (*sound_reset)(running_machine *machine);      /* sound reset callback */
r1771r1772
98154    MACROS FOR BUILDING MACHINE DRIVERS
99155***************************************************************************/
100156
101/* use this to declare external references to a machine driver */
102#define MACHINE_DRIVER_EXTERN(game)                              \
103   void construct_##game(machine_config *machine)                  \
157/* this type is used to encode machine configuration definitions */
158typedef union _machine_config_token machine_config_token;
159union _machine_config_token
160{
161   TOKEN_COMMON_FIELDS
162   const machine_config_token *tokenptr;
163   const gfx_decode_entry *gfxdecode;
164   device_type devtype;
165   void (*interrupt)(running_machine *machine, int cpunum);
166   driver_init_func driver_init;
167   nvram_handler_func nvram_handler;
168   memcard_handler_func memcard_handler;
169   machine_start_func machine_start;
170   machine_reset_func machine_reset;
171   sound_start_func sound_start;
172   sound_reset_func sound_reset;
173   video_start_func video_start;
174   video_reset_func video_reset;
175   palette_init_func palette_init;
176   video_eof_func video_eof;
177   video_update_func video_update;
178};
104179
105180
181
106182/* start/end tags for the machine driver */
107#define MACHINE_DRIVER_START(game)                               \
108   void construct_##game(machine_config *machine)                  \
109   {                                                   \
110      cpu_config *cpu = NULL;                                 \
111      sound_config *sound = NULL;                              \
112      device_config *device = NULL;                           \
113      (void)cpu;                                          \
114      (void)sound;                                       \
115      (void)device;                                       \
183#define MACHINE_DRIVER_START(_name) \
184   const machine_config_token machine_config_##_name[] = {
116185
117#define MACHINE_DRIVER_END                                     \
118   }                                                   \
186#define MACHINE_DRIVER_END \
187   TOKEN_UINT32_PACK1(MCONFIG_TOKEN_END, 8) };
119188
189/* use this to declare external references to a machine driver */
190#define MACHINE_DRIVER_EXTERN(_name) \
191   extern const machine_config_token machine_config_##_name[];
120192
193
121194/* importing data from other machine drivers */
122#define MDRV_IMPORT_FROM(game)                                  \
123   construct_##game(machine);                                  \
195#define MDRV_IMPORT_FROM(_name) \
196   TOKEN_UINT32_PACK1(MCONFIG_TOKEN_INCLUDE, 8), \
197   TOKEN_PTR(tokenptr, machine_config_##_name),
124198
125199
126200/* add/remove/config devices */
127#define MDRV_DEVICE_ADD(_tag, _type)                           \
128   device = device_list_add(&machine->devicelist, _type, _tag);      \
201#define MDRV_DEVICE_ADD(_tag, _type) \
202   TOKEN_UINT32_PACK1(MCONFIG_TOKEN_DEVICE_ADD, 8), \
203   TOKEN_PTR(devtype, _type), \
204   TOKEN_STRING(_tag),
129205
130#define MDRV_DEVICE_REMOVE(_tag, _type)                           \
131   device_list_remove(&machine->devicelist, _type, _tag);            \
206#define MDRV_DEVICE_REMOVE(_tag, _type) \
207   TOKEN_UINT32_PACK1(MCONFIG_TOKEN_DEVICE_REMOVE, 8), \
208   TOKEN_PTR(devtype, _type), \
209   TOKEN_STRING(_tag),
132210
133#define MDRV_DEVICE_MODIFY(_tag, _type)                           \
134   device = (device_config *)device_list_find_by_tag(machine->devicelist, _type, _tag); \
211#define MDRV_DEVICE_MODIFY(_tag, _type)   \
212   TOKEN_UINT32_PACK1(MCONFIG_TOKEN_DEVICE_MODIFY, 8), \
213   TOKEN_PTR(devtype, _type), \
214   TOKEN_STRING(_tag),
135215
136#define MDRV_DEVICE_CONFIG(_config)                              \
137   device->static_config = &(_config);                           \
216#define MDRV_DEVICE_CONFIG(_config) \
217   TOKEN_UINT32_PACK1(MCONFIG_TOKEN_DEVICE_CONFIG, 8), \
218   TOKEN_PTR(voidptr, &(_config)),
138219
139#define MDRV_DEVICE_CONFIG_DATA(_struct, _field, _val)               \
140   ((_struct *)device->inline_config)->_field = (_val);            \
220#define MDRV_DEVICE_CONFIG_DATA32(_struct, _field, _val) \
221   TOKEN_UINT32_PACK3(MCONFIG_TOKEN_DEVICE_CONFIG_DATA32, 8, sizeof(((_struct *)NULL)->_field), 6, offsetof(_struct, _field), 12), \
222   TOKEN_UINT32((UINT32)(_val)),
141223
224#define MDRV_DEVICE_CONFIG_DATA64(_struct, _field, _val) \
225   TOKEN_UINT32_PACK3(MCONFIG_TOKEN_DEVICE_CONFIG_DATA64, 8, sizeof(((_struct *)NULL)->_field), 6, offsetof(_struct, _field), 12), \
226   TOKEN_UINT64((UINT64)(_val)),
142227
228#define MDRV_DEVICE_CONFIG_DATAFP32(_struct, _field, _val, _fixbits) \
229   TOKEN_UINT32_PACK4(MCONFIG_TOKEN_DEVICE_CONFIG_DATAFP32, 8, sizeof(((_struct *)NULL)->_field), 6, _fixbits, 6, offsetof(_struct, _field), 12), \
230   TOKEN_UINT32((UINT32)((float)(_val) * (float)(1 << (_fixbits)))),
231
232#define MDRV_DEVICE_CONFIG_DATAFP64(_struct, _field, _val, _fixbits) \
233   TOKEN_UINT32_PACK4(MCONFIG_TOKEN_DEVICE_CONFIG_DATAFP64, 8, sizeof(((_struct *)NULL)->_field), 6, _fixbits, 6, offsetof(_struct, _field), 12), \
234   TOKEN_UINT64((UINT64)((float)(_val) * (float)((UINT64)1 << (_fixbits)))),
235
236#ifdef PTR64
237#define MDRV_DEVICE_CONFIG_DATAPTR(_struct, _field, _val) MDRV_DEVICE_CONFIG_DATA64(_struct, _field, _val)
238#else
239#define MDRV_DEVICE_CONFIG_DATAPTR(_struct, _field, _val) MDRV_DEVICE_CONFIG_DATA32(_struct, _field, _val)
240#endif
241
242
143243/* add/modify/remove/replace CPUs */
144#define MDRV_CPU_ADD_TAG(tag, type, clock)                        \
145   cpu = machine_config_add_cpu(machine, (tag), CPU_##type, (clock));         \
244#define MDRV_CPU_ADD_TAG(_tag, _type, _clock) \
245   TOKEN_UINT64_PACK3(MCONFIG_TOKEN_CPU_ADD, 8, CPU_##_type, 24, _clock, 32), \
246   TOKEN_STRING(_tag),
146247
147#define MDRV_CPU_ADD(type, clock)                              \
148   MDRV_CPU_ADD_TAG(NULL, type, clock)                           \
248#define MDRV_CPU_ADD(_type, _clock) \
249   MDRV_CPU_ADD_TAG(NULL, _type, _clock)
149250
150#define MDRV_CPU_MODIFY(tag)                                 \
151   cpu = machine_config_find_cpu(machine, tag);                        \
251#define MDRV_CPU_MODIFY(_tag) \
252   TOKEN_UINT32_PACK1(MCONFIG_TOKEN_CPU_MODIFY, 8), \
253   TOKEN_STRING(_tag),
152254
153#define MDRV_CPU_REMOVE(tag)                                 \
154   machine_config_remove_cpu(machine, tag);                           \
155   cpu = NULL;                                             \
255#define MDRV_CPU_REMOVE(_tag) \
256   TOKEN_UINT32_PACK1(MCONFIG_TOKEN_CPU_REMOVE, 8), \
257   TOKEN_STRING(_tag),
156258
157#define MDRV_CPU_REPLACE(tag, _type, _clock)                     \
158   cpu = machine_config_find_cpu(machine, tag);                        \
159   cpu->type = (CPU_##_type);                                 \
160   cpu->clock = (_clock);                                    \
259#define MDRV_CPU_REPLACE(_tag, _type, _clock) \
260   TOKEN_UINT64_PACK3(MCONFIG_TOKEN_CPU_REPLACE, 8, CPU_##_type, 24, _clock, 32), \
261   TOKEN_STRING(_tag),
161262
162263
163264/* CPU parameters */
164#define MDRV_CPU_FLAGS(_flags)                                 \
165   if (cpu)                                             \
166      cpu->flags = (_flags);                                 \
265#define MDRV_CPU_FLAGS(_flags) \
266   TOKEN_UINT32_PACK2(MCONFIG_TOKEN_CPU_FLAGS, 8, _flags, 24),
167267
168#define MDRV_CPU_CONFIG(config)                                 \
169   if (cpu)                                             \
170      cpu->reset_param = &(config);                           \
268#define MDRV_CPU_CONFIG(_config) \
269   TOKEN_UINT32_PACK1(MCONFIG_TOKEN_CPU_CONFIG, 8), \
270   TOKEN_PTR(voidptr, &(_config)),
171271
172#define MDRV_CPU_PROGRAM_MAP(readmem, writemem)                     \
173   if (cpu)                                             \
174   {                                                   \
175      cpu->construct_map[ADDRESS_SPACE_PROGRAM][0] = (construct_map_##readmem); \
176      cpu->construct_map[ADDRESS_SPACE_PROGRAM][1] = (construct_map_##writemem); \
177   }                                                   \
272#define MDRV_CPU_PROGRAM_MAP(_map1, _map2) \
273   TOKEN_UINT32_PACK1(MCONFIG_TOKEN_CPU_PROGRAM_MAP, 8), \
274   TOKEN_PTR(voidptr, construct_map_##_map1), \
275   TOKEN_PTR(voidptr, construct_map_##_map2), \
178276
179#define MDRV_CPU_DATA_MAP(readmem, writemem)                     \
180   if (cpu)                                             \
181   {                                                   \
182      cpu->construct_map[ADDRESS_SPACE_DATA][0] = (construct_map_##readmem); \
183      cpu->construct_map[ADDRESS_SPACE_DATA][1] = (construct_map_##writemem); \
184   }                                                   \
277#define MDRV_CPU_DATA_MAP(_map1, _map2)   \
278   TOKEN_UINT32_PACK1(MCONFIG_TOKEN_CPU_DATA_MAP, 8), \
279   TOKEN_PTR(voidptr, construct_map_##_map1), \
280   TOKEN_PTR(voidptr, construct_map_##_map2), \
185281
186#define MDRV_CPU_IO_MAP(readmem, writemem)                        \
187   if (cpu)                                             \
188   {                                                   \
189      cpu->construct_map[ADDRESS_SPACE_IO][0] = (construct_map_##readmem); \
190      cpu->construct_map[ADDRESS_SPACE_IO][1] = (construct_map_##writemem); \
191   }                                                   \
282#define MDRV_CPU_IO_MAP(_map1, _map2) \
283   TOKEN_UINT32_PACK1(MCONFIG_TOKEN_CPU_IO_MAP, 8), \
284   TOKEN_PTR(voidptr, construct_map_##_map1), \
285   TOKEN_PTR(voidptr, construct_map_##_map2), \
192286
193#define MDRV_CPU_VBLANK_INT(func, rate)                           \
194   if (cpu)                                             \
195   {                                                   \
196      cpu->vblank_interrupt = func;                           \
197      cpu->vblank_interrupts_per_frame = (rate);                  \
198   }                                                   \
287#define MDRV_CPU_VBLANK_INT(_func, _rate) \
288   TOKEN_UINT32_PACK2(MCONFIG_TOKEN_CPU_VBLANK_INT, 8, _rate, 24), \
289   TOKEN_PTR(interrupt, _func),
199290
200#define MDRV_CPU_PERIODIC_INT(func, rate)                        \
201   if (cpu)                                             \
202   {                                                   \
203      cpu->timed_interrupt = func;                           \
204      cpu->timed_interrupt_period = HZ_TO_ATTOSECONDS(rate);         \
205   }                                                   \
291#define MDRV_CPU_PERIODIC_INT(_func, _rate)   \
292   TOKEN_UINT32_PACK2(MCONFIG_TOKEN_CPU_PERIODIC_INT, 8, _rate, 24), \
293   TOKEN_PTR(interrupt, _func),
206294
207295
208296/* core parameters */
209#define MDRV_DRIVER_DATA(_struct)                              \
210   machine->driver_data_size = sizeof(_struct);                  \
297#define MDRV_DRIVER_DATA(_struct) \
298   TOKEN_UINT32_PACK2(MCONFIG_TOKEN_DRIVER_DATA, 8, sizeof(_struct), 24),
211299
212#define MDRV_INTERLEAVE(interleave)                              \
213   machine->cpu_slices_per_frame = (interleave);                  \
300#define MDRV_INTERLEAVE(_interleave) \
301   TOKEN_UINT32_PACK2(MCONFIG_TOKEN_INTERLEAVE, 8, _interleave, 24),
214302
215#define MDRV_WATCHDOG_VBLANK_INIT(watch_count)                     \
216   machine->watchdog_vblank_count = (watch_count);                  \
303#define MDRV_WATCHDOG_VBLANK_INIT(_count) \
304   TOKEN_UINT32_PACK2(MCONFIG_TOKEN_WATCHDOG_VBLANK, 8, _count, 24),
217305
218#define MDRV_WATCHDOG_TIME_INIT(time)                           \
219   machine->watchdog_time = (time);                           \
306#define MDRV_WATCHDOG_TIME_INIT(_time) \
307   TOKEN_UINT32_PACK1(MCONFIG_TOKEN_WATCHDOG_TIME, 8), \
308   TOKEN_UINT64(_time),
220309
221310
222311/* core functions */
223#define MDRV_MACHINE_START(name)                              \
224   machine->machine_start = machine_start_##name;                  \
312#define MDRV_MACHINE_START(_func) \
313   TOKEN_UINT32_PACK1(MCONFIG_TOKEN_MACHINE_START, 8), \
314   TOKEN_PTR(machine_start, machine_start_##_func),
225315
226#define MDRV_MACHINE_RESET(name)                              \
227   machine->machine_reset = machine_reset_##name;                  \
316#define MDRV_MACHINE_RESET(_func) \
317   TOKEN_UINT32_PACK1(MCONFIG_TOKEN_MACHINE_RESET, 8), \
318   TOKEN_PTR(machine_reset, machine_reset_##_func),
228319
229#define MDRV_NVRAM_HANDLER(name)                              \
230   machine->nvram_handler = nvram_handler_##name;                  \
320#define MDRV_NVRAM_HANDLER(_func) \
321   TOKEN_UINT32_PACK1(MCONFIG_TOKEN_NVRAM_HANDLER, 8), \
322   TOKEN_PTR(nvram_handler, nvram_handler_##_func),
231323
232#define MDRV_MEMCARD_HANDLER(name)                              \
233   machine->memcard_handler = memcard_handler_##name;               \
324#define MDRV_MEMCARD_HANDLER(_func) \
325   TOKEN_UINT32_PACK1(MCONFIG_TOKEN_MEMCARD_HANDLER, 8), \
326   TOKEN_PTR(memcard_handler, memcard_handler_##_func),
234327
235328
236329/* core video parameters */
237#define MDRV_VIDEO_ATTRIBUTES(flags)                           \
238   machine->video_attributes = (flags);                        \
330#define MDRV_VIDEO_ATTRIBUTES(_flags) \
331   TOKEN_UINT32_PACK2(MCONFIG_TOKEN_VIDEO_ATTRIBUTES, 8, _flags, 24),
239332
240#define MDRV_GFXDECODE(gfx)                                    \
241   machine->gfxdecodeinfo = (gfxdecodeinfo_##gfx);                  \
333#define MDRV_GFXDECODE(_gfx) \
334   TOKEN_UINT32_PACK1(MCONFIG_TOKEN_GFXDECODE, 8), \
335   TOKEN_PTR(gfxdecode, gfxdecodeinfo_##_gfx),
242336
243#define MDRV_PALETTE_LENGTH(length)                              \
244   machine->total_colors = (length);                           \
337#define MDRV_PALETTE_LENGTH(_length) \
338   TOKEN_UINT32_PACK2(MCONFIG_TOKEN_PALETTE_LENGTH, 8, _length, 24),
245339
246#define MDRV_DEFAULT_LAYOUT(layout)                              \
247   machine->default_layout = &(layout)[0];                        \
340#define MDRV_DEFAULT_LAYOUT(_layout) \
341   TOKEN_UINT32_PACK1(MCONFIG_TOKEN_DEFAULT_LAYOUT, 8), \
342   TOKEN_STRING(&(_layout)[0]),
248343
249344
250345/* core video functions */
251#define MDRV_PALETTE_INIT(name)                                 \
252   machine->init_palette = palette_init_##name;                  \
346#define MDRV_PALETTE_INIT(_func) \
347   TOKEN_UINT32_PACK1(MCONFIG_TOKEN_PALETTE_INIT, 8), \
348   TOKEN_PTR(palette_init, palette_init_##_func),
253349
254#define MDRV_VIDEO_START(name)                                 \
255   machine->video_start = video_start_##name;                     \
350#define MDRV_VIDEO_START(_func) \
351   TOKEN_UINT32_PACK1(MCONFIG_TOKEN_VIDEO_START, 8), \
352   TOKEN_PTR(video_start, video_start_##_func),
256353
257#define MDRV_VIDEO_RESET(name)                                 \
258   machine->video_reset = video_reset_##name;                     \
354#define MDRV_VIDEO_RESET(_func) \
355   TOKEN_UINT32_PACK1(MCONFIG_TOKEN_VIDEO_RESET, 8), \
356   TOKEN_PTR(video_reset, video_reset_##_func),
259357
260#define MDRV_VIDEO_EOF(name)                                 \
261   machine->video_eof = video_eof_##name;                        \
358#define MDRV_VIDEO_EOF(_func) \
359   TOKEN_UINT32_PACK1(MCONFIG_TOKEN_VIDEO_EOF, 8), \
360   TOKEN_PTR(video_eof, video_eof_##_func),
262361
263#define MDRV_VIDEO_UPDATE(name)                                 \
264   machine->video_update = video_update_##name;                  \
362#define MDRV_VIDEO_UPDATE(_func) \
363   TOKEN_UINT32_PACK1(MCONFIG_TOKEN_VIDEO_UPDATE, 8), \
364   TOKEN_PTR(video_update, video_update_##_func),
265365
266366
267367/* add/remove screens */
268#define MDRV_SCREEN_ADD(tag, _type)                              \
269   MDRV_DEVICE_ADD(tag, VIDEO_SCREEN)                           \
270   MDRV_DEVICE_CONFIG_DATA(screen_config, type, SCREEN_TYPE_##_type)   \
368#define MDRV_SCREEN_ADD(_tag, _type) \
369   MDRV_DEVICE_ADD(_tag, VIDEO_SCREEN) \
370   MDRV_DEVICE_CONFIG_DATA32(screen_config, type, SCREEN_TYPE_##_type)
271371
272#define MDRV_SCREEN_REMOVE(tag)                                 \
273   MDRV_DEVICE_REMOVE(tag, VIDEO_SCREEN)                        \
372#define MDRV_SCREEN_REMOVE(_tag) \
373   MDRV_DEVICE_REMOVE(_tag, VIDEO_SCREEN)
274374
275#define MDRV_SCREEN_MODIFY(tag)                                 \
276   MDRV_DEVICE_MODIFY(tag, VIDEO_SCREEN)                        \
375#define MDRV_SCREEN_MODIFY(_tag) \
376   MDRV_DEVICE_MODIFY(_tag, VIDEO_SCREEN)
277377
278#define MDRV_SCREEN_FORMAT(_format)                              \
279   MDRV_DEVICE_CONFIG_DATA(screen_config, defstate.format, _format)   \
378#define MDRV_SCREEN_FORMAT(_format) \
379   MDRV_DEVICE_CONFIG_DATA32(screen_config, defstate.format, _format)
280380
281#define MDRV_SCREEN_TYPE(_type)                                 \
282   MDRV_DEVICE_CONFIG_DATA(screen_config, type, SCREEN_TYPE_##_type)   \
381#define MDRV_SCREEN_TYPE(_type) \
382   MDRV_DEVICE_CONFIG_DATA32(screen_config, type, SCREEN_TYPE_##_type)
283383
284#define MDRV_SCREEN_RAW_PARAMS(pixclock, htotal, hbend, hbstart, vtotal, vbend, vbstart) \
285   MDRV_DEVICE_CONFIG_DATA(screen_config, defstate.refresh, HZ_TO_ATTOSECONDS(pixclock) * (htotal) * (vtotal))   \
286   MDRV_DEVICE_CONFIG_DATA(screen_config, defstate.vblank, ((HZ_TO_ATTOSECONDS(pixclock) * (htotal) * (vtotal)) / (vtotal)) * ((vtotal) - ((vbstart) - (vbend))))   \
287   MDRV_DEVICE_CONFIG_DATA(screen_config, defstate.width, htotal)      \
288   MDRV_DEVICE_CONFIG_DATA(screen_config, defstate.height, vtotal)      \
289   MDRV_DEVICE_CONFIG_DATA(screen_config, defstate.visarea.min_x, hbend) \
290   MDRV_DEVICE_CONFIG_DATA(screen_config, defstate.visarea.max_x, (hbstart) - 1) \
291   MDRV_DEVICE_CONFIG_DATA(screen_config, defstate.visarea.min_y, vbend) \
292   MDRV_DEVICE_CONFIG_DATA(screen_config, defstate.visarea.max_y, (vbstart) - 1) \
384#define MDRV_SCREEN_RAW_PARAMS(_pixclock, _htotal, _hbend, _hbstart, _vtotal, _vbend, _vbstart) \
385   MDRV_DEVICE_CONFIG_DATA64(screen_config, defstate.refresh, HZ_TO_ATTOSECONDS(_pixclock) * (_htotal) * (_vtotal)) \
386   MDRV_DEVICE_CONFIG_DATA64(screen_config, defstate.vblank, ((HZ_TO_ATTOSECONDS(_pixclock) * (_htotal) * (_vtotal)) / (_vtotal)) * ((_vtotal) - ((_vbstart) - (_vbend)))) \
387   MDRV_DEVICE_CONFIG_DATA32(screen_config, defstate.width, _htotal)   \
388   MDRV_DEVICE_CONFIG_DATA32(screen_config, defstate.height, _vtotal)   \
389   MDRV_DEVICE_CONFIG_DATA32(screen_config, defstate.visarea.min_x, _hbend) \
390   MDRV_DEVICE_CONFIG_DATA32(screen_config, defstate.visarea.max_x, (_hbstart) - 1) \
391   MDRV_DEVICE_CONFIG_DATA32(screen_config, defstate.visarea.min_y, _vbend) \
392   MDRV_DEVICE_CONFIG_DATA32(screen_config, defstate.visarea.max_y, (_vbstart) - 1)
293393
294#define MDRV_SCREEN_REFRESH_RATE(rate)                           \
295   MDRV_DEVICE_CONFIG_DATA(screen_config, defstate.refresh, HZ_TO_ATTOSECONDS(rate)) \
394#define MDRV_SCREEN_REFRESH_RATE(_rate) \
395   MDRV_DEVICE_CONFIG_DATA64(screen_config, defstate.refresh, HZ_TO_ATTOSECONDS(_rate))
296396
297#define MDRV_SCREEN_VBLANK_TIME(time)                           \
298   MDRV_DEVICE_CONFIG_DATA(screen_config, defstate.vblank, time)      \
299   MDRV_DEVICE_CONFIG_DATA(screen_config, defstate.oldstyle_vblank_supplied, TRUE) \
397#define MDRV_SCREEN_VBLANK_TIME(_time) \
398   MDRV_DEVICE_CONFIG_DATA64(screen_config, defstate.vblank, _time) \
399   MDRV_DEVICE_CONFIG_DATA32(screen_config, defstate.oldstyle_vblank_supplied, TRUE)
300400
301#define MDRV_SCREEN_SIZE(_width, _height)                        \
302   MDRV_DEVICE_CONFIG_DATA(screen_config, defstate.width, _width)      \
303   MDRV_DEVICE_CONFIG_DATA(screen_config, defstate.height, _height)   \
401#define MDRV_SCREEN_SIZE(_width, _height) \
402   MDRV_DEVICE_CONFIG_DATA32(screen_config, defstate.width, _width) \
403   MDRV_DEVICE_CONFIG_DATA32(screen_config, defstate.height, _height)
304404
305#define MDRV_SCREEN_VISIBLE_AREA(minx, maxx, miny, maxy)            \
306   MDRV_DEVICE_CONFIG_DATA(screen_config, defstate.visarea.min_x, minx) \
307   MDRV_DEVICE_CONFIG_DATA(screen_config, defstate.visarea.max_x, maxx) \
308   MDRV_DEVICE_CONFIG_DATA(screen_config, defstate.visarea.min_y, miny) \
309   MDRV_DEVICE_CONFIG_DATA(screen_config, defstate.visarea.max_y, maxy) \
405#define MDRV_SCREEN_VISIBLE_AREA(_minx, _maxx, _miny, _maxy) \
406   MDRV_DEVICE_CONFIG_DATA32(screen_config, defstate.visarea.min_x, _minx) \
407   MDRV_DEVICE_CONFIG_DATA32(screen_config, defstate.visarea.max_x, _maxx) \
408   MDRV_DEVICE_CONFIG_DATA32(screen_config, defstate.visarea.min_y, _miny) \
409   MDRV_DEVICE_CONFIG_DATA32(screen_config, defstate.visarea.max_y, _maxy)
310410
311411#define MDRV_SCREEN_DEFAULT_POSITION(_xscale, _xoffs, _yscale, _yoffs)   \
312   MDRV_DEVICE_CONFIG_DATA(screen_config, xoffset, (float)(_xoffs))    \
313   MDRV_DEVICE_CONFIG_DATA(screen_config, xscale, (float)(_xscale))    \
314   MDRV_DEVICE_CONFIG_DATA(screen_config, yoffset, (float)(_yoffs))    \
315   MDRV_DEVICE_CONFIG_DATA(screen_config, yscale, (float)(_yscale))    \
412   MDRV_DEVICE_CONFIG_DATAFP32(screen_config, xoffset, _xoffs, 24) \
413   MDRV_DEVICE_CONFIG_DATAFP32(screen_config, xscale, _xscale, 24) \
414   MDRV_DEVICE_CONFIG_DATAFP32(screen_config, yoffset, _yoffs, 24) \
415   MDRV_DEVICE_CONFIG_DATAFP32(screen_config, yscale, _yscale, 24)
316416
317417
318418/* add/remove speakers */
319#define MDRV_SPEAKER_ADD(tag, x, y, z)                           \
320   machine_config_add_speaker(machine, (tag), (float)(x), (float)(y), (float)(z));   \
419#define MDRV_SPEAKER_ADD(_tag, _x, _y, _z) \
420   MDRV_DEVICE_ADD(_tag, SPEAKER_OUTPUT) \
421   MDRV_DEVICE_CONFIG_DATAFP32(speaker_config, x, _x, 24) \
422   MDRV_DEVICE_CONFIG_DATAFP32(speaker_config, y, _y, 24) \
423   MDRV_DEVICE_CONFIG_DATAFP32(speaker_config, z, _z, 24)
321424
322#define MDRV_SPEAKER_REMOVE(tag)                              \
323   machine_config_remove_speaker(machine, (tag));                        \
425#define MDRV_SPEAKER_REMOVE(_tag) \
426   MDRV_DEVICE_REMOVE(_tag, SPEAKER_OUTPUT)
324427
325#define MDRV_SPEAKER_STANDARD_MONO(tag)                           \
326   MDRV_SPEAKER_ADD(tag, 0.0, 0.0, 1.0)                        \
428#define MDRV_SPEAKER_STANDARD_MONO(_tag) \
429   MDRV_SPEAKER_ADD(_tag, 0.0, 0.0, 1.0)
327430
328#define MDRV_SPEAKER_STANDARD_STEREO(tagl, tagr)                  \
329   MDRV_SPEAKER_ADD(tagl, -0.2, 0.0, 1.0)                        \
330   MDRV_SPEAKER_ADD(tagr, 0.2, 0.0, 1.0)                        \
431#define MDRV_SPEAKER_STANDARD_STEREO(_tagl, _tagr) \
432   MDRV_SPEAKER_ADD(_tagl, -0.2, 0.0, 1.0) \
433   MDRV_SPEAKER_ADD(_tagr, 0.2, 0.0, 1.0)
331434
332435
333436/* core sound functions */
334#define MDRV_SOUND_START(name)                                 \
335   machine->sound_start = sound_start_##name;                     \
437#define MDRV_SOUND_START(_func) \
438   TOKEN_UINT32_PACK1(MCONFIG_TOKEN_SOUND_START, 8), \
439   TOKEN_PTR(sound_start, sound_start_##_func),
336440
337#define MDRV_SOUND_RESET(name)                                 \
338   machine->sound_reset = sound_reset_##name;                     \
441#define MDRV_SOUND_RESET(_func) \
442   TOKEN_UINT32_PACK1(MCONFIG_TOKEN_SOUND_RESET, 8), \
443   TOKEN_PTR(sound_start, sound_reset_##_func),
339444
340445
341446/* add/remove/replace sounds */
342#define MDRV_SOUND_ADD_TAG(tag, type, clock)                     \
343   sound = machine_config_add_sound(machine, (tag), SOUND_##type, (clock));   \
447#define MDRV_SOUND_ADD_TAG(_tag, _type, _clock) \
448   TOKEN_UINT64_PACK3(MCONFIG_TOKEN_SOUND_ADD, 8, SOUND_##_type, 24, _clock, 32), \
449   TOKEN_STRING(_tag),
344450
345#define MDRV_SOUND_ADD(type, clock)                              \
346   MDRV_SOUND_ADD_TAG(NULL, type, clock)                        \
451#define MDRV_SOUND_ADD(_type, _clock) \
452   MDRV_SOUND_ADD_TAG(NULL, _type, _clock)
347453
348#define MDRV_SOUND_REMOVE(tag)                                 \
349   machine_config_remove_sound(machine, tag);                           \
454#define MDRV_SOUND_REMOVE(_tag) \
455   TOKEN_UINT32_PACK1(MCONFIG_TOKEN_SOUND_REMOVE, 8), \
456   TOKEN_STRING(_tag),
350457
351#define MDRV_SOUND_MODIFY(tag)                                 \
352   sound = machine_config_find_sound(machine, tag);                     \
353   sound->routes = 0;                                       \
458#define MDRV_SOUND_MODIFY(_tag) \
459   TOKEN_UINT32_PACK1(MCONFIG_TOKEN_SOUND_MODIFY, 8), \
460   TOKEN_STRING(_tag),
354461
355#define MDRV_SOUND_CONFIG(_config)                              \
356   if (sound)                                             \
357      sound->config = &(_config);                              \
462#define MDRV_SOUND_CONFIG(_config) \
463   TOKEN_UINT32_PACK1(MCONFIG_TOKEN_SOUND_CONFIG, 8), \
464   TOKEN_PTR(voidptr, &(_config)),
358465
359#define MDRV_SOUND_REPLACE(tag, _type, _clock)                     \
360   sound = machine_config_find_sound(machine, tag);                     \
361   if (sound)                                             \
362   {                                                   \
363      sound->type = SOUND_##_type;                           \
364      sound->clock = (_clock);                              \
365      sound->config = NULL;                                 \
366      sound->routes = 0;                                    \
367   }                                                   \
466#define MDRV_SOUND_REPLACE(_tag, _type, _clock) \
467   TOKEN_UINT64_PACK3(MCONFIG_TOKEN_SOUND_REPLACE, 8, SOUND_##_type, 24, _clock, 32), \
468   TOKEN_STRING(_tag),
368469
369470#define MDRV_SOUND_ROUTE_EX(_output, _target, _gain, _input)         \
370   if (sound)                                             \
371   {                                                   \
372      sound->route[sound->routes].output = (_output);               \
373      sound->route[sound->routes].target = (_target);               \
374      sound->route[sound->routes].gain = (float)(_gain);            \
375      sound->route[sound->routes].input = (_input);               \
376      sound->routes++;                                    \
377   }                                                   \
471   TOKEN_UINT64_PACK4(MCONFIG_TOKEN_SOUND_ROUTE, 8, _output, 12, _input, 12, (UINT32)((float)(_gain) * 16777216.0f), 32), \
472   TOKEN_STRING(_target),
378473
379#define MDRV_SOUND_ROUTE(_output, _target, _gain)                  \
380   MDRV_SOUND_ROUTE_EX(_output, _target, _gain, -1)               \
474#define MDRV_SOUND_ROUTE(_output, _target, _gain) \
475   MDRV_SOUND_ROUTE_EX(_output, _target, _gain, -1)
381476
382477
383478
r1771r1772
389484/* ----- machine configurations ----- */
390485
391486/* allocate a new machine configuration and populate it using the supplied constructor */
392machine_config *machine_config_alloc(void (*constructor)(machine_config *));
487machine_config *machine_config_alloc(const machine_config_token *tokens);
393488
394489/* release memory allocated for a machine configuration */
395490void machine_config_free(machine_config *config);
r1771r1772
402497cpu_config *machine_config_find_cpu(machine_config *machine, const char *tag);
403498void machine_config_remove_cpu(machine_config *machine, const char *tag);
404499
405speaker_config *machine_config_add_speaker(machine_config *machine, const char *tag, float x, float y, float z);
406speaker_config *machine_config_find_speaker(machine_config *machine, const char *tag);
407void machine_config_remove_speaker(machine_config *machine, const char *tag);
408
409500sound_config *machine_config_add_sound(machine_config *machine, const char *tag, sound_type type, int clock);
410501sound_config *machine_config_find_sound(machine_config *machine, const char *tag);
411502void machine_config_remove_sound(machine_config *machine, const char *tag);
src/emu/drivers/xtal.h
r1771r1772
5757   XTAL_5MHz          = 5000000,      /* Mutant Night */
5858   XTAL_6MHz          = 6000000,
5959   XTAL_6_144MHz      = 6144000,      /* Used on Alpha Denshi early 80's games sound board */
60   XTAL_7MHz          = 7000000,      /* Jaleco Mega System PCBs */
6061   XTAL_7_15909MHz      = 7159090,      /* Blood Bros */
6162   XTAL_7_3728MHz      = 7372800,
6263   XTAL_8MHz          = 8000000,      /* Extremely common, used on 100's of PCBs */
r1771r1772
6465   XTAL_10MHz         = 10000000,
6566   XTAL_10_595MHz     = 10595000,      /* Mad Alien */
6667   XTAL_10_738635MHz   = 10738635,      /* TMS9918 family */
67   XTAL_11MHz         = 11000000,      /* Mario I8039 sound */
68   XTAL_11MHz      = 11000000,      /* Mario I8039 sound */
6869   XTAL_11_0592MHz     = 11059200,      /* Lethal Justice */
6970   XTAL_11_2MHz        = 11200000,      /* New York, New York */
7071   XTAL_11_289MHz     = 11289000,      /* Vanguard */
r1771r1772
8182   XTAL_14_31818MHz     = 14318180,      /* Extremely common, used on 100's of PCBs */
8283   XTAL_14_705882MHz     = 14705882,      /* Aleck64 */
8384   XTAL_14_7456MHz    = 14745600,      /* Namco System 12 & System Super 22/23 for H8/3002 CPU */
84   XTAL_15MHz         = 15000000,      /* Sinclair QL */
85   XTAL_15MHz      = 15000000,      /* Sinclair QL */
8586   XTAL_15_468MHz     = 15468000,      /* Bank Panic h/w, Sega G80 */
8687   XTAL_16MHz         = 16000000,      /* Extremely common, used on 100's of PCBs */
8788   XTAL_16_9344MHz     = 16934400,      /* Usually used to drive 90's Yamaha OPL/FM chips */
r1771r1772
132133   XTAL_66_6667MHz      = 66666700,      /* later Midway games */
133134   XTAL_67_7376MHz     = 67737600,      /* PSX-based h/w, Sony ZN1-2-based */
134135   XTAL_73_728MHz     = 73728000,      /* Ms. Pac-Man/Galaga 20th Anniversary */
135   XTAL_100MHz        = 100000000,   /* PSX-based Namco System 12, Vegas, Sony ZN1-2-based */
136   XTAL_101_4912MHz     = 101491200,   /* PSX-based Namco System 10 */
136   XTAL_100MHz        = 100000000,      /* PSX-based Namco System 12, Vegas, Sony ZN1-2-based */
137   XTAL_101_4912MHz     = 101491200,      /* PSX-based Namco System 10 */
137138
138139/* Resonators (There are probably more. Almost always used for driving OKI sound chips) */
139140
r1771r1772
141142   XTAL_400kHz         = 400000,      /* Used on Great Swordman h/w */
142143   XTAL_455kHz         = 455000,      /* Used on Gladiator h/w */
143144   XTAL_640kHz         = 640000,
144   XTAL_1_056MHz      = 1056000       /* used on Trio The Punch */
145   XTAL_1_056MHz         = 1056000       /* used on Trio The Punch */
145146};
146147
147148
src/mess/mslegacy.c
r1771r1772
147147   return 0;
148148}
149149
150
151
152/***************************************************************************
153    GENERIC VIDEO
154***************************************************************************/
155
156/*-------------------------------------------------
157    VIDEO_START( generic ) - general video system
158-------------------------------------------------*/
159
160VIDEO_START( generic )
161{
162   /* allocate the temporary bitmap */
163   tmpbitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
164}
165
166
src/mess/mslegacy.h
r1771r1772
9696VIDEO_UPDATE(crtc6845);
9797void crtc6845_config(int index, const struct _mc6845_interface *intf);
9898
99/* generic video */
100VIDEO_START(generic);
99101
100102
101103#endif /* MSLEGACY_H */
src/mess/tools/messtest/testmess.c
r1771r1772
1818#include "video/generic.h"
1919#include "render.h"
2020#include "messopts.h"
21#include "deprecat.h"
2221
2322#ifdef ENABLE_DEBUGGER
2423#include "debug/debugcpu.h"
r1771r1772
170169
171170
172171
173static void dump_screenshot(int write_file)
172static void dump_screenshot(running_machine *machine, int write_file)
174173{
175174   file_error filerr;
176175   mame_file *fp;
r1771r1772
199198                  break;
200199            }
201200
202            video_screen_save_snapshot(Machine, fp, scrnum);
201            video_screen_save_snapshot(machine, fp, scrnum);
203202            report_message(MSG_INFO, "Saved screenshot as %s", buf);
204203         }
205204         else
r1771r1772
420419   if (current_testcase.wavwrite)
421420   {
422421      snprintf(buf, sizeof(buf) / sizeof(buf[0]), "snap/_%s.wav", current_testcase.name);
423      wavptr = wav_open(buf, Machine->sample_rate, 2);
422      wavptr = wav_open(buf, machine->sample_rate, 2);
424423   }
425424   else
426425   {
427426      wavptr = NULL;
428427   }
429   samples_this_frame = (int) ((double)Machine->sample_rate / (double)Machine->screen[0].refresh);
428   samples_this_frame = (int) ((double)machine->sample_rate / (double)machine->screen[0].refresh);
430429   return samples_this_frame;
431430}
432431
r1771r1772
444443
445444
446445
447void osd_update_audio_stream(INT16 *buffer, int samples_this_frame)
446void osd_update_audio_stream(running_machine *machine, INT16 *buffer, int samples_this_frame)
448447{
449   if (wavptr && (Machine->sample_rate != 0))
448   if (wavptr && (machine->sample_rate != 0))
450449      wav_add_data_16(wavptr, buffer, samples_this_frame * 2);
451450}
452451
453452
454453
455static void find_switch(const char *switch_name, const char *switch_setting,
454static void find_switch(running_machine *machine, const char *switch_name, const char *switch_setting,
456455   int switch_type, int switch_setting_type,
457456   input_port_entry **in_switch, input_port_entry **in_switch_setting)
458457{
r1771r1772
462461   *in_switch_setting = NULL;
463462
464463   /* find switch with the name */
465   in = Machine->input_ports;
464   in = machine->input_ports;
466465   while(in->type != IPT_END)
467466   {
468467      if (in->type == switch_type && input_port_active(in)
r1771r1772
490489
491490/* ----------------------------------------------------------------------- */
492491
493static void command_wait(void)
492static void command_wait(running_machine *machine)
494493{
495494   attotime current_time = timer_get_time();
496495
r1771r1772
509508
510509
511510
512static void command_input(void)
511static void command_input(running_machine *machine)
513512{
514513   /* post a set of characters to the emulation */
515514   if (state == STATE_READY)
r1771r1772
533532
534533
535534
536static void command_rawinput(void)
535static void command_rawinput(running_machine *machine)
537536{
538537   int parts;
539538   attotime current_time = timer_get_time();
r1771r1772
587586
588587
589588
590static void command_screenshot(void)
589static void command_screenshot(running_machine *machine)
591590{
592   dump_screenshot(TRUE);
591   dump_screenshot(machine, TRUE);
593592}
594593
595594
596595
597static void command_checkblank(void)
596static void command_checkblank(running_machine *machine)
598597{
599   dump_screenshot(FALSE);
598   dump_screenshot(machine, FALSE);
600599}
601600
602601
603602
604static void command_switch(void)
603static void command_switch(running_machine *machine)
605604{
606605   input_port_entry *switch_name;
607606   input_port_entry *switch_setting;
r1771r1772
627626      }
628627   }
629628
630   find_switch(current_command->u.switch_args.name, current_command->u.switch_args.value,
629   find_switch(machine, current_command->u.switch_args.name, current_command->u.switch_args.value,
631630      IPT_DIPSWITCH_NAME, IPT_DIPSWITCH_SETTING, &switch_name, &switch_setting);
632631
633632   if (!switch_name || !switch_setting)
634633   {
635      find_switch(current_command->u.switch_args.name, current_command->u.switch_args.value,
634      find_switch(machine, current_command->u.switch_args.name, current_command->u.switch_args.value,
636635         IPT_CONFIG_NAME, IPT_CONFIG_SETTING, &switch_name, &switch_setting);
637636   }
638637
r1771r1772
655654}
656655
657656
658static void command_image_preload(void)
657static void command_image_preload(running_machine *machine)
659658{
660659   state = STATE_ABORTED;
661660   report_message(MSG_FAILURE, "Image preloads must be at the beginning");
662661}
663662
664663
665static void command_image_loadcreate(void)
664static void command_image_loadcreate(running_machine *machine)
666665{
667666   mess_image *image;
668667   int device_type;
r1771r1772
741740   }
742741
743742   success = FALSE;
744   for (gamedrv = Machine->gamedrv; !success && gamedrv; gamedrv = mess_next_compatible_driver(gamedrv))
743   for (gamedrv = machine->gamedrv; !success && gamedrv; gamedrv = mess_next_compatible_driver(gamedrv))
745744   {
746745      /* assemble the full path */
747746      filepath = assemble_software_path(astring_alloc(), gamedrv, filename);
r1771r1772
773772
774773
775774
776static void command_verify_memory(void)
775static void command_verify_memory(running_machine *machine)
777776{
778777   int i = 0;
779778   offs_t offset, offset_start, offset_end;
r1771r1772
842841
843842
844843
845static void command_verify_image(void)
844static void command_verify_image(running_machine *machine)
846845{
847846   const UINT8 *verify_data;
848847   size_t verify_data_size;
r1771r1772
900899
901900
902901
903static void command_trace(void)
902static void command_trace(running_machine *machine)
904903{
905904#ifdef ENABLE_DEBUGGER
906905   int cpunum;
r1771r1772
930929
931930
932931
933static void command_soft_reset(void)
932static void command_soft_reset(running_machine *machine)
934933{
935   mame_schedule_soft_reset(Machine);
934   mame_schedule_soft_reset(machine);
936935}
937936
938937
939938
940static void command_hard_reset(void)
939static void command_hard_reset(running_machine *machine)
941940{
942   mame_schedule_hard_reset(Machine);
941   mame_schedule_hard_reset(machine);
943942}
944943
945944
946945
947static void command_end(void)
946static void command_end(running_machine *machine)
948947{
949948   /* at the end of our test */
950949   state = STATE_DONE;
951950   final_time = timer_get_time();
952   mame_schedule_exit(Machine);
951   mame_schedule_exit(machine);
953952}
954953
955954
r1771r1772
959958struct command_procmap_entry
960959{
961960   messtest_command_type_t command_type;
962   void (*proc)(void);
961   void (*proc)(running_machine *machine);
963962};
964963
965964static const struct command_procmap_entry commands[] =
r1771r1772
981980   { MESSTEST_COMMAND_END,            command_end }
982981};
983982
984void osd_update(int skip_redraw)
983void osd_update(running_machine *machine, int skip_redraw)
985984{
986985   int i;
987986   attotime time_limit;
r1771r1772
1000999   /* if we have already aborted or completed, our work is done */
10011000   if ((state == STATE_ABORTED) || (state == STATE_DONE))
10021001   {
1003      mame_schedule_exit(Machine);
1002      mame_schedule_exit(machine);
10041003      return;
10051004   }
10061005
r1771r1772
10291028   {
10301029      if (current_command->command_type == commands[i].command_type)
10311030      {
1032         commands[i].proc();
1031         commands[i].proc(machine);
10331032         break;
10341033      }
10351034   }
r1771r1772
10441043         (current_command[0].command_type != MESSTEST_COMMAND_SCREENSHOT) &&
10451044         (current_command[1].command_type == MESSTEST_COMMAND_END))
10461045      {
1047         dump_screenshot(TRUE);
1046         dump_screenshot(machine, TRUE);
10481047      }
10491048
10501049      current_command++;
r1771r1772
10531052
10541053
10551054
1056#if 0
1057/* still need to work out some kinks here */
1058const struct KeyboardInfo *osd_get_key_list(void)
1059{
1060   int i;
1061
1062   if (!ki)
1063   {
1064      ki = auto_malloc((__code_key_last - __code_key_first + 1) * sizeof(struct KeyboardInfo));
1065
1066      for (i = __code_key_first; i <= __code_key_last; i++)
1067      {
1068         ki[i - __code_key_first].name = "Dummy";
1069         ki[i - __code_key_first].code = i;
1070         ki[i - __code_key_first].standardcode = i;
1071      }
1072   }
1073   return ki;
1074}
1075
1076const struct JoystickInfo *osd_get_joy_list(void)
1077{
1078   int i;
1079
1080   if (!ji)
1081   {
1082      ji = auto_malloc((__code_joy_last - __code_joy_first + 1) * sizeof(struct JoystickInfo));
1083
1084      for (i = __code_joy_first; i <= __code_joy_last; i++)
1085      {
1086         ji[i - __code_joy_first].name = "Dummy";
1087         ji[i - __code_joy_first].code = i;
1088         ji[i - __code_joy_first].standardcode = i;
1089      }
1090   }
1091   return ji;
1092}
1093
1094static int is_input_pressed(int inputcode)
1095{
1096   return 0;
1097}
1098
1099int osd_is_joy_pressed(int joycode)
1100{
1101   return is_input_pressed(joycode);
1102}
1103
1104int osd_is_key_pressed(int keycode)
1105{
1106   return is_input_pressed(keycode);
1107}
1108#endif
1109
1110
11111055char *rompath_extra;
11121056
11131057
src/mess/includes/cbmb.h
r1771r1772
130130
131131/*----------- defined in video/cbmb.c -----------*/
132132
133void cbm600_update_row(running_machine *machine, mc6845_t *mc6845, mame_bitmap *bitmap, const rectangle *cliprect, UINT16 ma,
134                  UINT8 ra, UINT16 y, UINT8 x_count, void *param);
135void cbm700_update_row(running_machine *machine, mc6845_t *mc6845, mame_bitmap *bitmap, const rectangle *cliprect, UINT16 ma,
136                  UINT8 ra, UINT16 y, UINT8 x_count, void *param);
133MC6845_UPDATE_ROW( cbm600_update_row );
134MC6845_UPDATE_ROW( cbm700_update_row );
137135
138136void cbm600_vh_init(void);
139137void cbm700_vh_init(void);
src/mess/includes/pet.h
r1771r1772
1313/*----------- defined in video/pet.c -----------*/
1414
1515/* call to init videodriver */
16extern void pet_vh_init (void);
17extern void pet80_vh_init (void);
18extern void superpet_vh_init (void);
19extern VIDEO_UPDATE( pet );
20void pet40_update_row(running_machine *machine, mc6845_t *mc6845, mame_bitmap *bitmap, const rectangle *cliprect, UINT16 ma,
21                 UINT8 ra, UINT16 y, UINT8 x_count, void *param);
22void pet80_update_row(running_machine *machine, mc6845_t *mc6845, mame_bitmap *bitmap, const rectangle *cliprect, UINT16 ma,
23                 UINT8 ra, UINT16 y, UINT8 x_count, void *param);
16void pet_vh_init (void);
17void pet80_vh_init (void);
18void superpet_vh_init (void);
19VIDEO_UPDATE( pet );
20MC6845_UPDATE_ROW( pet40_update_row );
21MC6845_UPDATE_ROW( pet80_update_row );
2422
2523extern int pet_font;
2624
src/mess/video/cbmb.c
r1771r1772
88#include "deprecat.h"
99#include "includes/cbmb.h"
1010#include "video/mc6845.h"
11#include "mslegacy.h"
1112
1213
1314static int cbmb_font=0;
r1771r1772
6162   cbmb_font=font;
6263}
6364
64void cbm600_update_row(running_machine *machine, mc6845_t *mc6845, mame_bitmap *bitmap, const rectangle *cliprect, UINT16 ma,
65                  UINT8 ra, UINT16 y, UINT8 x_count, void *param) {
65MC6845_UPDATE_ROW( cbm600_update_row )
66{
6667   int i;
6768
6869   for( i = 0; i < x_count; i++ ) {
r1771r1772
7475   }
7576}
7677
77void cbm700_update_row(running_machine *machine, mc6845_t *mc6845, mame_bitmap *bitmap, const rectangle *cliprect, UINT16 ma,
78                  UINT8 ra, UINT16 y, UINT8 x_count, void *param) {
78MC6845_UPDATE_ROW( cbm700_update_row )
79{
7980   int i;
8081
8182   for( i = 0; i < x_count; i++ ) {
src/mess/video/mbee.c
r1771r1772
99#include "driver.h"
1010#include "includes/mbee.h"
1111#include "deprecat.h"
12#include "mslegacy.h"
1213
1314typedef struct {       // CRTC 6545
1415   UINT8 horizontal_total;
src/mess/video/kim1.c
r1771r1772
99
1010#include "driver.h"
1111#include "includes/kim1.h"
12#include "mslegacy.h"
1213
1314PALETTE_INIT( kim1 )
1415{
src/mess/video/cgenie.c
r1771r1772
88
99#include "driver.h"
1010#include "includes/cgenie.h"
11#include "mslegacy.h"
1112
1213int cgenie_font_offset[4] = {0, 0, 0, 0};
1314
src/mess/video/pet.c
r1771r1772
8484}
8585
8686
87void pet40_update_row(running_machine *machine, mc6845_t *mc6845, mame_bitmap *bitmap, const rectangle *cliprect, UINT16 ma,
88                 UINT8 ra, UINT16 y, UINT8 x_count, void *param) {
87MC6845_UPDATE_ROW( pet40_update_row )
88{
8989   int i;
9090
9191   for( i = 0; i < x_count; i++ ) {
r1771r1772
9393   }
9494}
9595
96void pet80_update_row(running_machine *machine, mc6845_t *mc6845, mame_bitmap *bitmap, const rectangle *cliprect, UINT16 ma,
97                 UINT8 ra, UINT16 y, UINT8 x_count, void *param) {
96MC6845_UPDATE_ROW( pet80_update_row )
97{
9898   int i;
9999
100100   for( i = 0; i < x_count; i++ ) {
src/mess/video/pc_video.c
r1771r1772
1111#include "memconv.h"
1212#include "includes/crtc6845.h"
1313#include "video/pc_video.h"
14#include "mslegacy.h"
1415
1516
1617
src/mess/video/mekd2.c
r1771r1772
99******************************************************************************/
1010
1111#include "driver.h"
12
12#include "mslegacy.h"
1313#include "includes/mekd2.h"
1414
1515PALETTE_INIT( mekd2 )
src/mess/video/p2000m.c
r1771r1772
77**********************************************************************/
88
99#include "driver.h"
10#include "mslegacy.h"
1011#include "includes/p2000t.h"
1112
1213
src/mess/video/intv.c
r1771r1772
22#include "deprecat.h"
33#include "includes/intv.h"
44#include "video/stic.h"
5#include "mslegacy.h"
56
67#define FOREGROUND_BIT 0x0010
78
src/mess/video/jupiter.c
r1771r1772
99#include "driver.h"
1010#include "deprecat.h"
1111#include "includes/jupiter.h"
12#include "mslegacy.h"
1213
1314
1415UINT8 *jupiter_charram;
src/mess/messdrv.h
r1771r1772
8686   FULLNAME,                        \
8787   #YEAR,                           \
8888   COMPANY,                        \
89   construct_##MACHINE,               \
89   machine_config_##MACHINE,            \
9090   ipt_##INPUT,                     \
9191   driver_init_##INIT,                  \
9292   rom_##NAME,                        \
r1771r1772
106106   FULLNAME,                        \
107107   #YEAR,                           \
108108   COMPANY,                        \
109   construct_##MACHINE,               \
109   machine_config_##MACHINE,            \
110110   ipt_##INPUT,                     \
111111   driver_init_##INIT,                  \
112112   rom_##NAME,                        \
src/mess/inputx.h
r1771r1772
5151#define UCHAR_SHIFT_BEGIN   (UCHAR_SHIFT_1)
5252#define UCHAR_SHIFT_END      (UCHAR_SHIFT_2)
5353
54#define PORT_CHAR(ch)   \
55   INPUT_PORT_UINT32_PAIR(INPUT_TOKEN_CHAR, ch),
5654
5755
58
5956/***************************************************************************
6057
6158   Prototypes
src/mess/machine/svi318.c
r1771r1772
429429   return INIT_PASS;
430430}
431431
432static void svi806_crtc6845_update_row(running_machine *machine, mc6845_t *mc6845, mame_bitmap *bitmap, const rectangle *cliprect, UINT16 ma,
433                              UINT8 ra, UINT16 y, UINT8 x_count, void *param ) {
432static MC6845_UPDATE_ROW( svi806_crtc6845_update_row )
433{
434434   int i;
435435
436436   for( i = 0; i < x_count; i++ )
src/mess/drivers/mpf1.c
r1771r1772
3333#include "machine/z80sio.h"
3434#include "mscommon.h"
3535#include "sound/dac.h"
36#include "mslegacy.h"
3637
3738#define VERBOSE_LEVEL ( 0 )
3839
src/mess/drivers/astrocde.c
r1771r1772
3838#include "sound/astrocde.h"
3939#include "includes/astrocde.h"
4040#include "devices/cartslot.h"
41#include "mslegacy.h"
4142
4243/****************************************************************************
4344 * Bally Astrocade
src/mess/drivers/nascom1.c
r1771r1772
5151/* Core includes */
5252#include "driver.h"
5353#include "includes/nascom1.h"
54#include "mslegacy.h"
5455
5556/* Components */
5657#include "cpu/z80/z80.h"
src/mess/drivers/einstein.c
r1771r1772
228228//  0,// Cursor status
229229//};
230230
231static void einstein_6845_update_row(running_machine *machine, mc6845_t *mc6845, mame_bitmap *bitmap, const rectangle *cliprect, UINT16 ma,
232                            UINT8 ra, UINT16 y, UINT8 x_count, void *param) {
231static MC6845_UPDATE_ROW( einstein_6845_update_row )
232{
233233   /* TODO: Verify implementation */
234234   unsigned char *data = memory_region(REGION_CPU1) + 0x012000;
235235   unsigned char data_byte;
docs/messnew.txt
r1771r1772
3434
3535Source Changes:
3636----------------
37- The core is based on MAME 0.123u2.  This incorporates all features of the
37- The core is based on MAME 0.123u3.  This incorporates all features of the
3838  update to this core.  [MAME team]
3939
4040
makefile
r1771r1772
4343OSD = windows
4444endif
4545
46ifndef CROSS_BUILD_OSD
47CROSS_BUILD_OSD = $(OSD)
48endif
4649
4750
4851#-------------------------------------------------
r1771r1772
187190EXE = .exe
188191endif
189192
193ifndef BUILD_EXE
194BUILD_EXE = $(EXE)
195endif
196
190197# compiler, linker and utilities
191198AR = @ar
192199CC = @gcc
r1771r1772
442449
443450all: maketree buildtools emulator tools
444451
452#-------------------------------------------------
453# defines needed by multiple make files
454#-------------------------------------------------
445455
456BUILDSRC = $(SRC)/build
457BUILDOBJ = $(OBJ)/build
458BUILDOUT = $(BUILDOBJ)
446459
447460#-------------------------------------------------
448461# include the various .mak files
r1771r1772
456469include $(SRC)/emu/emu.mak
457470include $(SRC)/lib/lib.mak
458471include $(SRC)/build/build.mak
472-include $(SRC)/osd/$(CROSS_BUILD_OSD)/build.mak
459473include $(SRC)/tools/tools.mak
460474
461475# combine the various definitions to one

Previous 15994 Revisions Next


© 1998-2018 The MESS Team