Previous 199869 Revisions Next

r23624 Tuesday 11th June, 2013 at 07:16:42 UTC by Miodrag Milanović
Cleanups and version bump
[hash]ep64_cart.xml
[src]version.c
[src/emu]dislot.c emu.mak machine.c memory.h
[src/emu/cpu/rsp]rsp.h
[src/emu/debug]dvbpoints.c dvbpoints.h
[src/emu/machine]7200fifo.c 7200fifo.h adc1038.h adc1213x.h ay31015.c ay31015.h com8116.c generic.c idectrl.c idectrl.h idehd.c im6402.c machine.mak mb14241.h mc68901.c mm58274c.c mm58274c.h pit8253.c pit8253.h rf5c296.c rp5h01.c rp5h01.h serflash.c serflash.h tms6100.c tms6100.h z80dart.c z80dart.h
[src/emu/sound]msm5205.c sp0256.c sp0256.h speaker.c speaker.h ymf271.c ymz280b.c
[src/emu/video]cdp1861.c cdp1862.c huc6270.h msm6255.c tms9927.c tms9927.h upd7227.c upd7227.h video.mak
[src/lib/formats]bml3_dsk.c td0_dsk.c
[src/mame]mame.lst
[src/mame/audio]flower.c geebee.c redbaron.h snes_snd.c snes_snd.h warpwarp.c warpwarp.h
[src/mame/drivers]8080bw.c alpha68k.c ambush.c asteroid.c btime.c ddealer.c decocass.c firebeat.c fruitpc.c galaxold.c galdrvr.c gaplus.c jpmsru.c mappy.c maygayep.c mazerbla.c mil4000.c mpu4.c mpu4hw.c proconn.c qix.c quakeat.c savquest.c seibuspi.c speedbal.c statriv2.c stuntair.c taito_f3.c tempest.c zn.c
[src/mame/includes]bzone.h dkong.h exidy440.h flower.h galaxold.h gaplus.h mappy.h nmk16.h pgm.h playch10.h powerins.h seibuspi.h snowbros.h speedbal.h taito_b.h taitoair.h toypop.h vertigo.h vsnes.h warpwarp.h
[src/mame/layout]speedbal.lay
[src/mame/machine]mathbox.h midikbd.h mpeg573.c mpeg573.h namcoio.c namcoio.h naomig1.c nmk112.c nmk112.h pgmprot5.c taitoio.c taitoio.h
[src/mame/video]kan_pand.c kan_pand.h powervr2.c powervr2.h seibuspi.c
[src/mess/audio]dave.c dave.h mac.c mea8000.c mea8000.h upd1771.c upd1771.h
[src/mess/drivers]a7000.c abc80.c altos5.c applix.c argo.c attache.c bml3.c chessmst.c concept.c cortex.c ep64.c gba.c hx20.c intv.c juicebox.c pasogo.c pc.c pc1512.c pes.c pet.c pv1000.c ql.c qx10.c samcoupe.c scv.c sdk86.c sg1000.c snes.c softbox.c superslave.c tec1.c victor9k.c vip.c vk100.c vt100.c
[src/mess/includes]abc1600.h bw12.h ep64.h gba.h hx20.h mac.h pc1512.h sg1000.h sms.h superslave.h tandy2k.h v1050.h victor9k.h vixen.h wangpc.h
[src/mess/machine]abc99.c abc99.h abckb.h apollo.c bbc.c concept.c concept_exp.c concept_exp.h ds1315.c ds1315.h ep64_exdos.c ep64_exdos.h ep64exp.h gba_rom.c gba_rom.h gba_slot.c gba_slot.h intv.c mboard.c mc68328.c mc68328.h md_rom.c md_rom.h msx.c pce.c pce_cd.c pce_cd.h pce_rom.c pce_rom.h pce_slot.c pce_slot.h s3c44b0.c s3c44b0.h sega8_rom.c sega8_rom.h sega8_slot.c sega8_slot.h sms.c sns_sa1.c sns_sdd1.c sns_sgb.c sns_sgb.h sns_spc7110.c sns_spc7110.h softbox.h upd71071.c victor9kb.h vp575.c wangpc_mcc.c zx8302.h
[src/mess/video]gba.c gf4500.c gf4500.h newport.c newport.h nick.c nick.h stic.c stic.h vic4567.c vic4567.h vtvideo.c vtvideo.h
[src/osd/sdl]debugqt.c debugqtdasmwindow.c debugqtmainwindow.c
[src/osd/windows]d3dhlsl.c d3dhlsl.h debugwin.c window.c windows.mak winmain.c
[src/tools]jedutil.c

trunk/src/tools/jedutil.c
r23623r23624
498498   {22, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 280}};    /* Registered Output */
499499
500500static pin_fuse_rows _82s153pinfuserows[] = {
501    {9,  NO_OUTPUT_ENABLE_FUSE_ROW, 0, 0},
502    {11, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 0},
503    {12, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 0},
504    {13, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 0},
505    {14, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 0},
506    {15, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 0},
507    {16, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 0},
508    {17, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 0},
509    {18, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 0},
510    {19, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 0}};
501   {9,  NO_OUTPUT_ENABLE_FUSE_ROW, 0, 0},
502   {11, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 0},
503   {12, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 0},
504   {13, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 0},
505   {14, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 0},
506   {15, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 0},
507   {16, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 0},
508   {17, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 0},
509   {18, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 0},
510   {19, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 0}};
511511
512512static pin_fuse_rows pls153pinfuserows[] = {
513    {9,  1472, 0, 0},
514    {11, 1508, 0, 0},
515    {12, 1544, 0, 0},
516    {13, 1580, 0, 0},
517    {14, 1616, 0, 0},
518    {15, 1652, 0, 0},
519    {16, 1688, 0, 0},
520    {17, 1724, 0, 0},
521    {18, 1760, 0, 0},
522    {19, 1796, 0, 0}};
513   {9,  1472, 0, 0},
514   {11, 1508, 0, 0},
515   {12, 1544, 0, 0},
516   {13, 1580, 0, 0},
517   {14, 1616, 0, 0},
518   {15, 1652, 0, 0},
519   {16, 1688, 0, 0},
520   {17, 1724, 0, 0},
521   {18, 1760, 0, 0},
522   {19, 1796, 0, 0}};
523523
524524static pin_fuse_rows ck2605pinfuserows[] = {
525    {9,  736,  0, 0},
526    {11, 772,  0, 0},
527    {12, 808,  0, 0},
528    {13, 844,  0, 0},
529    {14, 880,  0, 0},
530    {15, 916,  0, 0},
531    {16, 952,  0, 0},
532    {17, 988,  0, 0},
533    {18, 1024, 0, 0},
534    {19, 1060, 0, 0}};
525   {9,  736,  0, 0},
526   {11, 772,  0, 0},
527   {12, 808,  0, 0},
528   {13, 844,  0, 0},
529   {14, 880,  0, 0},
530   {15, 916,  0, 0},
531   {16, 952,  0, 0},
532   {17, 988,  0, 0},
533   {18, 1024, 0, 0},
534   {19, 1060, 0, 0}};
535535
536536static pin_fuse_columns pal10l8pinfusecolumns[] = {
537537   {1, 3, 2},
r23623r23624
912912   {23, 3, 2}};
913913
914914static pin_fuse_columns _82s153pinfusecolumns[] = {
915    {1,  0, 0},
916    {2,  0, 0},
917    {3,  0, 0},
918    {4,  0, 0},
919    {5,  0, 0},
920    {6,  0, 0},
921    {7,  0, 0},
922    {8,  0, 0},
923    {9,  0, 0},
924    {11, 0, 0},
925    {12, 0, 0},
926    {13, 0, 0},
927    {14, 0, 0},
928    {15, 0, 0},
929    {16, 0, 0},
930    {17, 0, 0},
931    {18, 0, 0},
932    {19, 0, 0}};
915   {1,  0, 0},
916   {2,  0, 0},
917   {3,  0, 0},
918   {4,  0, 0},
919   {5,  0, 0},
920   {6,  0, 0},
921   {7,  0, 0},
922   {8,  0, 0},
923   {9,  0, 0},
924   {11, 0, 0},
925   {12, 0, 0},
926   {13, 0, 0},
927   {14, 0, 0},
928   {15, 0, 0},
929   {16, 0, 0},
930   {17, 0, 0},
931   {18, 0, 0},
932   {19, 0, 0}};
933933
934934static pin_fuse_columns pls153pinfusecolumns[] = {
935    {1,  1,  0},
936    {2,  3,  2},
937    {3,  5,  4},
938    {4,  7,  6},
939    {5,  9,  8},
940    {6,  11, 10},
941    {7,  13, 12},
942    {8,  15, 14},
943    {9,  17, 16},
944    {11, 19, 18},
945    {12, 21, 20},
946    {13, 23, 22},
947    {14, 25, 24},
948    {15, 27, 26},
949    {16, 29, 28},
950    {17, 31, 30},
951    {18, 33, 32},
952    {19, 35, 34}};
935   {1,  1,  0},
936   {2,  3,  2},
937   {3,  5,  4},
938   {4,  7,  6},
939   {5,  9,  8},
940   {6,  11, 10},
941   {7,  13, 12},
942   {8,  15, 14},
943   {9,  17, 16},
944   {11, 19, 18},
945   {12, 21, 20},
946   {13, 23, 22},
947   {14, 25, 24},
948   {15, 27, 26},
949   {16, 29, 28},
950   {17, 31, 30},
951   {18, 33, 32},
952   {19, 35, 34}};
953953
954954static pin_fuse_columns ck2605pinfusecolumns[] = {
955    {1,  1,  0},
956    {2,  3,  2},
957    {3,  5,  4},
958    {4,  7,  6},
959    {5,  9,  8},
960    {6,  11, 10},
961    {7,  13, 12},
962    {8,  15, 14},
963    {9,  17, 16},
964    {11, 19, 18},
965    {12, 21, 20},
966    {13, 23, 22},
967    {14, 25, 24},
968    {15, 27, 26},
969    {16, 29, 28},
970    {17, 31, 30},
971    {18, 33, 32},
972    {19, 35, 34}};
955   {1,  1,  0},
956   {2,  3,  2},
957   {3,  5,  4},
958   {4,  7,  6},
959   {5,  9,  8},
960   {6,  11, 10},
961   {7,  13, 12},
962   {8,  15, 14},
963   {9,  17, 16},
964   {11, 19, 18},
965   {12, 21, 20},
966   {13, 23, 22},
967   {14, 25, 24},
968   {15, 27, 26},
969   {16, 29, 28},
970   {17, 31, 30},
971   {18, 33, 32},
972   {19, 35, 34}};
973973
974974static pal_data paldata[] = {
975975   {"PAL10L8",
r23623r23624
10811081      config_peel18cv8_pins,
10821082      NULL,
10831083      get_peel18cv8_pin_fuse_state},
1084    {"GAL18V10",
1084   {"GAL18V10",
10851085      gal18v10pinfuserows, ARRAY_LEN(gal18v10pinfuserows),
10861086      gal18v10pinfusecolumns, ARRAY_LEN(gal18v10pinfusecolumns),
10871087      print_gal18v10_product_terms,
r23623r23624
11231123      config_pal20r8_pins,
11241124      NULL,
11251125      NULL},/*
1126   {"PAL20X4", NULL, 0, NULL, 0, NULL, NULL, NULL, NULL},
1127   {"PAL20X8", NULL, 0, NULL, 0, NULL, NULL, NULL, NULL},
1128   {"PAL20X10", NULL, 0, NULL, 0, NULL, NULL, NULL, NULL},
1129   {"PAL22V10", NULL, 0, NULL, 0, NULL, NULL, NULL, NULL},
1130   {"GAL20V8A", NULL, 0, NULL, 0, NULL, NULL, NULL, NULL},
1131   {"GAL22V10", NULL, 0, NULL, 0, NULL, NULL, NULL, NULL},
1132   {"PLS100", NULL, 0, NULL, 0, NULL, NULL, NULL, NULL},*/
1126    {"PAL20X4", NULL, 0, NULL, 0, NULL, NULL, NULL, NULL},
1127    {"PAL20X8", NULL, 0, NULL, 0, NULL, NULL, NULL, NULL},
1128    {"PAL20X10", NULL, 0, NULL, 0, NULL, NULL, NULL, NULL},
1129    {"PAL22V10", NULL, 0, NULL, 0, NULL, NULL, NULL, NULL},
1130    {"GAL20V8A", NULL, 0, NULL, 0, NULL, NULL, NULL, NULL},
1131    {"GAL22V10", NULL, 0, NULL, 0, NULL, NULL, NULL, NULL},
1132    {"PLS100", NULL, 0, NULL, 0, NULL, NULL, NULL, NULL},*/
11331133   {"82S153",
11341134      _82s153pinfuserows, ARRAY_LEN(_82s153pinfuserows),
11351135      _82s153pinfusecolumns, ARRAY_LEN(_82s153pinfusecolumns),
r23623r23624
11441144      config_pls153_pins,
11451145      NULL,
11461146      NULL},
1147    {"CK2605",
1147   {"CK2605",
11481148      ck2605pinfuserows, ARRAY_LEN(ck2605pinfuserows),
11491149      ck2605pinfusecolumns, ARRAY_LEN(ck2605pinfusecolumns),
11501150      print_ck2605_product_terms,
r23623r23624
21552155
21562156static void print_82s153_product_terms(const pal_data* pal, const jed_data* jed)
21572157{
2158    fprintf(stderr, "Print of product terms not supported for this device\n");
2158   fprintf(stderr, "Print of product terms not supported for this device\n");
21592159}
21602160
21612161
r23623r23624
21802180   printf("Equations:\n\n");
21812181
21822182   for (index = 0; index < outputpinscount; ++index)
2183    {
2183   {
21842184      flags = outputpins[index].flags;
21852185
21862186      indent = 0;
r23623r23624
21962196
21972197      printf("%s", buffer);
21982198
2199        haveterms = 0;
2199      haveterms = 0;
22002200      indent += strlen(buffer);
22012201
22022202      fuse_rows = find_fuse_rows(pal, outputpins[index].pin);
2203        fuserow = 0;
2203      fuserow = 0;
22042204
2205        if (outputpins[index].pin != 9)
2206        {
2207            or_column = 19 - outputpins[index].pin;
2208        }
2209        else
2210        {
2211            or_column = 9;
2212        }
2205      if (outputpins[index].pin != 9)
2206      {
2207         or_column = 19 - outputpins[index].pin;
2208      }
2209      else
2210      {
2211         or_column = 9;
2212      }
22132213
2214        for (row = 0; row < 32; ++row)
2215        {
2216             if (!jed_get_fuse(jed, fuserow + columncount + or_column))
2217            {
2218                generate_product_terms(pal, jed, fuserow, buffer);
2214      for (row = 0; row < 32; ++row)
2215      {
2216         if (!jed_get_fuse(jed, fuserow + columncount + or_column))
2217         {
2218            generate_product_terms(pal, jed, fuserow, buffer);
22192219
2220             if (strlen(buffer) > 0)
2221             {
2222                if (haveterms)
2223                {
2224                   printf(" +\n");
2220            if (strlen(buffer) > 0)
2221            {
2222               if (haveterms)
2223               {
2224                  printf(" +\n");
22252225
2226                   for (indentindex = 0; indentindex < indent; ++indentindex)
2227                   {
2228                      printf(" ");
2229                   }
2230                }
2231                else
2232                {
2233                   haveterms = 1;
2234                }
2226                  for (indentindex = 0; indentindex < indent; ++indentindex)
2227                  {
2228                     printf(" ");
2229                  }
2230               }
2231               else
2232               {
2233                  haveterms = 1;
2234               }
22352235
2236                printf("%s", buffer);
2237             }
2238            }
2236               printf("%s", buffer);
2237            }
2238         }
22392239
2240            fuserow += (columncount + 10);
2241        }
2242       
2243        printf("\n");
2240         fuserow += (columncount + 10);
2241      }
22442242
2243      printf("\n");
2244
22452245      /* output enable equations */
22462246
22472247      printf("o%d.oe = ", outputpins[index].pin);
r23623r23624
22582258      }
22592259
22602260      printf("\n");
2261    }
2261   }
22622262}
22632263
22642264
r23623r23624
22832283   printf("Equations:\n\n");
22842284
22852285   for (index = 0; index < outputpinscount; ++index)
2286    {
2286   {
22872287      flags = outputpins[index].flags;
22882288
22892289      indent = 0;
r23623r23624
22992299
23002300      printf("%s", buffer);
23012301
2302        haveterms = 0;
2302      haveterms = 0;
23032303      indent += strlen(buffer);
23042304
23052305      fuse_rows = find_fuse_rows(pal, outputpins[index].pin);
2306        fuserow = 0;
2306      fuserow = 0;
23072307
2308        if (outputpins[index].pin != 9)
2309        {
2310            or_column = 19 - outputpins[index].pin;
2311        }
2312        else
2313        {
2314            or_column = 9;
2315        }
2308      if (outputpins[index].pin != 9)
2309      {
2310         or_column = 19 - outputpins[index].pin;
2311      }
2312      else
2313      {
2314         or_column = 9;
2315      }
23162316
2317        for (row = 0; row < 16; ++row)
2318        {
2319             if (!jed_get_fuse(jed, fuserow + columncount + or_column))
2320            {
2321                generate_product_terms(pal, jed, fuserow, buffer);
2317      for (row = 0; row < 16; ++row)
2318      {
2319         if (!jed_get_fuse(jed, fuserow + columncount + or_column))
2320         {
2321            generate_product_terms(pal, jed, fuserow, buffer);
23222322
2323             if (strlen(buffer) > 0)
2324             {
2325                if (haveterms)
2326                {
2327                   printf(" +\n");
2323            if (strlen(buffer) > 0)
2324            {
2325               if (haveterms)
2326               {
2327                  printf(" +\n");
23282328
2329                   for (indentindex = 0; indentindex < indent; ++indentindex)
2330                   {
2331                      printf(" ");
2332                   }
2333                }
2334                else
2335                {
2336                   haveterms = 1;
2337                }
2329                  for (indentindex = 0; indentindex < indent; ++indentindex)
2330                  {
2331                     printf(" ");
2332                  }
2333               }
2334               else
2335               {
2336                  haveterms = 1;
2337               }
23382338
2339                printf("%s", buffer);
2340             }
2341            }
2339               printf("%s", buffer);
2340            }
2341         }
23422342
2343            fuserow += (columncount + 10);
2344        }
2345       
2346        printf("\n");
2343         fuserow += (columncount + 10);
2344      }
23472345
2346      printf("\n");
2347
23482348      /* output enable equations */
23492349
23502350      printf("o%d.oe = ", outputpins[index].pin);
r23623r23624
23612361      }
23622362
23632363      printf("\n");
2364    }
2364   }
23652365}
23662366
23672367
r23623r23624
34263426
34273427   output_pin_count = 0;
34283428
3429    for (index = 0; index < pal->pinfuserowscount; ++index)
3430    {
3431       if (does_output_enable_fuse_row_allow_output(pal, jed, pal->pinfuserows[index].fuserowoutputenable))
3432        {
3433          output_pins[output_pin_count].pin = pal->pinfuserows[index].pin;
3434          output_pins[output_pin_count].flags = OUTPUT_COMBINATORIAL | OUTPUT_FEEDBACK_OUTPUT;
3429   for (index = 0; index < pal->pinfuserowscount; ++index)
3430   {
3431      if (does_output_enable_fuse_row_allow_output(pal, jed, pal->pinfuserows[index].fuserowoutputenable))
3432      {
3433         output_pins[output_pin_count].pin = pal->pinfuserows[index].pin;
3434         output_pins[output_pin_count].flags = OUTPUT_COMBINATORIAL | OUTPUT_FEEDBACK_OUTPUT;
34353435
34363436         if (jed_get_fuse(jed, 1832 + (9 - index)))
34373437         {
r23623r23624
34423442            output_pins[output_pin_count].flags |= OUTPUT_ACTIVEHIGH;
34433443         }
34443444
3445          ++output_pin_count;
3446        }
3447    }
3445         ++output_pin_count;
3446      }
3447   }
34483448
34493449   set_input_pins(input_pins, ARRAY_LEN(input_pins));
34503450   set_output_pins(output_pins, output_pin_count);
r23623r23624
34653465
34663466   output_pin_count = 0;
34673467
3468    for (index = 0; index < pal->pinfuserowscount; ++index)
3469    {
3470       if (does_output_enable_fuse_row_allow_output(pal, jed, pal->pinfuserows[index].fuserowoutputenable))
3471        {
3472          output_pins[output_pin_count].pin = pal->pinfuserows[index].pin;
3473          output_pins[output_pin_count].flags = OUTPUT_COMBINATORIAL | OUTPUT_FEEDBACK_OUTPUT;
3468   for (index = 0; index < pal->pinfuserowscount; ++index)
3469   {
3470      if (does_output_enable_fuse_row_allow_output(pal, jed, pal->pinfuserows[index].fuserowoutputenable))
3471      {
3472         output_pins[output_pin_count].pin = pal->pinfuserows[index].pin;
3473         output_pins[output_pin_count].flags = OUTPUT_COMBINATORIAL | OUTPUT_FEEDBACK_OUTPUT;
34743474
34753475         if (jed_get_fuse(jed, 1096 + (9 - index)))
34763476         {
r23623r23624
34813481            output_pins[output_pin_count].flags |= OUTPUT_ACTIVEHIGH;
34823482         }
34833483
3484          ++output_pin_count;
3485        }
3486    }
3484         ++output_pin_count;
3485      }
3486   }
34873487
34883488   set_input_pins(input_pins, ARRAY_LEN(input_pins));
34893489   set_output_pins(output_pins, output_pin_count);
trunk/src/osd/sdl/debugqtdasmwindow.c
r23623r23624
107107DasmWindow::~DasmWindow()
108108{
109109}
110       
111       
110
111
112112void DasmWindow::cpuChanged(int index)
113113{
114114   m_dasmView->view()->set_source(*m_dasmView->view()->source_list().by_index(index));
trunk/src/osd/sdl/debugqtmainwindow.c
r23623r23624
297297
298298   // Send along the command
299299   debug_console_execute_command(*m_machine,
300                          command.toLocal8Bit().data(),
301                          true);
300                           command.toLocal8Bit().data(),
301                           true);
302302
303303   // Add history & set the index to be the top of the stack
304304   addToHistory(command);
r23623r23624
328328      refreshAll();
329329      return;
330330   }
331   
331
332332   // File dialog
333333   QString filename = QFileDialog::getOpenFileName(this,
334334                                       "Select an image file",
335335                                       QDir::currentPath(),
336336                                       tr("All files (*.*)"));
337   
337
338338   if (img->load(filename.toUtf8().data()) != IMAGE_INIT_PASS)
339339   {
340340      debug_console_printf(*m_machine, "Image could not be mounted.\n");
341341      refreshAll();
342342      return;
343343   }
344   
344
345345   // Activate the unmount menu option
346346   QAction* unmountAct = sender()->parent()->findChild<QAction*>("unmount");
347347   unmountAct->setEnabled(true);
348   
348
349349   // Set the mount name
350350   QMenu* parentMenuItem = dynamic_cast<QMenu*>(sender()->parent());
351351   QString baseString = parentMenuItem->title();
r23623r23624
364364   const int imageIndex = dynamic_cast<QAction*>(sender())->data().toInt();
365365   image_interface_iterator iter(m_machine->root_device());
366366   device_image_interface *img = iter.byindex(imageIndex);
367   
367
368368   img->unload();
369   
369
370370   // Deactivate the unmount menu option
371371   dynamic_cast<QAction*>(sender())->setEnabled(false);
372   
372
373373   // Set the mount name
374374   QMenu* parentMenuItem = dynamic_cast<QMenu*>(sender()->parent());
375375   QString baseString = parentMenuItem->title();
r23623r23624
411411void MainWindow::createImagesMenu()
412412{
413413   QMenu* imagesMenu = menuBar()->addMenu("&Images");
414   
414
415415   int interfaceIndex = 0;
416416   image_interface_iterator iter(m_machine->root_device());
417417   for (device_image_interface *img = iter.first(); img != NULL; img = iter.next())
418418   {
419419      astring menuName;
420420      menuName.format("%s : %s", img->device().name(), img->exists() ? img->filename() : "[empty slot]");
421     
421
422422      QMenu* interfaceMenu = imagesMenu->addMenu(menuName.cstr());
423423      interfaceMenu->setObjectName(img->device().name());
424     
424
425425      QAction* mountAct = new QAction("Mount...", interfaceMenu);
426426      QAction* unmountAct = new QAction("Unmount", interfaceMenu);
427427      mountAct->setObjectName("mount");
r23623r23624
430430      unmountAct->setData(QVariant(interfaceIndex));
431431      connect(mountAct, SIGNAL(triggered(bool)), this, SLOT(mountImage(bool)));
432432      connect(unmountAct, SIGNAL(triggered(bool)), this, SLOT(unmountImage(bool)));
433     
433
434434      if (!img->exists())
435435         unmountAct->setEnabled(false);
436     
436
437437      interfaceMenu->addAction(mountAct);
438438      interfaceMenu->addAction(unmountAct);
439     
439
440440      // TODO: Cassette operations
441     
441
442442      interfaceIndex++;
443443   }
444444}
trunk/src/osd/sdl/debugqt.c
r23623r23624
6565   if (parentnode == NULL)
6666      return;
6767
68    for (int i = 0; i < xmlConfigurations.size(); i++)
69        delete xmlConfigurations[i];
68   for (int i = 0; i < xmlConfigurations.size(); i++)
69      delete xmlConfigurations[i];
7070   xmlConfigurations.clear();
7171
7272   // Configuration load
r23623r23624
7979         case WindowQtConfig::WIN_TYPE_MAIN:         xmlConfigurations.push_back(new MainWindowQtConfig()); break;
8080         case WindowQtConfig::WIN_TYPE_MEMORY:       xmlConfigurations.push_back(new MemoryWindowQtConfig()); break;
8181         case WindowQtConfig::WIN_TYPE_DASM:         xmlConfigurations.push_back(new DasmWindowQtConfig()); break;
82         case WindowQtConfig::WIN_TYPE_LOG:           xmlConfigurations.push_back(new LogWindowQtConfig()); break;
82         case WindowQtConfig::WIN_TYPE_LOG:          xmlConfigurations.push_back(new LogWindowQtConfig()); break;
8383         case WindowQtConfig::WIN_TYPE_BREAK_POINTS: xmlConfigurations.push_back(new BreakpointsWindowQtConfig()); break;
8484         default: continue;
8585      }
r23623r23624
9494   if (config_type != CONFIG_TYPE_GAME)
9595      return;
9696
97    for (int i = 0; i < xmlConfigurations.size(); i++)
98    {
99        WindowQtConfig* config = xmlConfigurations[i];
97   for (int i = 0; i < xmlConfigurations.size(); i++)
98   {
99      WindowQtConfig* config = xmlConfigurations[i];
100100
101101      // Create an xml node
102102      xml_data_node *debugger_node;
r23623r23624
112112
113113static void gather_save_configurations()
114114{
115    for (int i = 0; i < xmlConfigurations.size(); i++)
116        delete xmlConfigurations[i];
115   for (int i = 0; i < xmlConfigurations.size(); i++)
116      delete xmlConfigurations[i];
117117   xmlConfigurations.clear();
118118
119119   // Loop over all the open windows
r23623r23624
163163
164164static void setup_additional_startup_windows(running_machine& machine, std::vector<WindowQtConfig*>& configList)
165165{
166    for (int i = 0; i < configList.size(); i++)
167    {
168        WindowQtConfig* config = configList[i];
169       
166   for (int i = 0; i < configList.size(); i++)
167   {
168      WindowQtConfig* config = configList[i];
169
170170      WindowQt* foo = NULL;
171171      switch (config->m_type)
172172      {
trunk/src/osd/windows/winmain.c
r23623r23624
396396   { WINOPTION_VECTOR_LENGTH_RATIO";vecsize",                  "500.0",     OPTION_FLOAT,      "Vector fade length (4.0 - vectors fade the most at and above 4 pixels, etc.)" },
397397   /* Bloom below this line */
398398   { NULL,                                                     NULL,        OPTION_HEADER,     "BLOOM POST-PROCESSING OPTIONS" },
399   { WINOPTION_VECTOR_BLOOM_SCALE,                             "0.3",       OPTION_FLOAT,      "Intensity factor for vector bloom" },
400   { WINOPTION_RASTER_BLOOM_SCALE,                             "0.225",     OPTION_FLOAT,      "Intensity factor for raster bloom" },
401   { WINOPTION_BLOOM_LEVEL0_WEIGHT,                          "1.0",       OPTION_FLOAT,      "Bloom level 0  (full-size target) weight" },
402   { WINOPTION_BLOOM_LEVEL1_WEIGHT,                          "0.21",      OPTION_FLOAT,      "Bloom level 1  (half-size target) weight" },
403   { WINOPTION_BLOOM_LEVEL2_WEIGHT,                          "0.19",      OPTION_FLOAT,      "Bloom level 2  (quarter-size target) weight" },
404   { WINOPTION_BLOOM_LEVEL3_WEIGHT,                          "0.17",      OPTION_FLOAT,      "Bloom level 3  (.) weight" },
405   { WINOPTION_BLOOM_LEVEL4_WEIGHT,                          "0.15",      OPTION_FLOAT,      "Bloom level 4  (.) weight" },
406   { WINOPTION_BLOOM_LEVEL5_WEIGHT,                          "0.14",      OPTION_FLOAT,      "Bloom level 5  (.) weight" },
407   { WINOPTION_BLOOM_LEVEL6_WEIGHT,                          "0.13",      OPTION_FLOAT,      "Bloom level 6  (.) weight" },
408   { WINOPTION_BLOOM_LEVEL7_WEIGHT,                          "0.12",      OPTION_FLOAT,      "Bloom level 7  (.) weight" },
409   { WINOPTION_BLOOM_LEVEL8_WEIGHT,                          "0.11",      OPTION_FLOAT,      "Bloom level 8  (.) weight" },
410   { WINOPTION_BLOOM_LEVEL9_WEIGHT,                          "0.10",      OPTION_FLOAT,      "Bloom level 9  (.) weight" },
411   { WINOPTION_BLOOM_LEVEL10_WEIGHT,                           "0.09",      OPTION_FLOAT,      "Bloom level 10 (1x1 target) weight" },
399   { WINOPTION_VECTOR_BLOOM_SCALE,                             "0.3",       OPTION_FLOAT,      "Intensity factor for vector bloom" },
400   { WINOPTION_RASTER_BLOOM_SCALE,                             "0.225",     OPTION_FLOAT,      "Intensity factor for raster bloom" },
401   { WINOPTION_BLOOM_LEVEL0_WEIGHT,                            "1.0",       OPTION_FLOAT,      "Bloom level 0  (full-size target) weight" },
402   { WINOPTION_BLOOM_LEVEL1_WEIGHT,                            "0.21",      OPTION_FLOAT,      "Bloom level 1  (half-size target) weight" },
403   { WINOPTION_BLOOM_LEVEL2_WEIGHT,                            "0.19",      OPTION_FLOAT,      "Bloom level 2  (quarter-size target) weight" },
404   { WINOPTION_BLOOM_LEVEL3_WEIGHT,                            "0.17",      OPTION_FLOAT,      "Bloom level 3  (.) weight" },
405   { WINOPTION_BLOOM_LEVEL4_WEIGHT,                            "0.15",      OPTION_FLOAT,      "Bloom level 4  (.) weight" },
406   { WINOPTION_BLOOM_LEVEL5_WEIGHT,                            "0.14",      OPTION_FLOAT,      "Bloom level 5  (.) weight" },
407   { WINOPTION_BLOOM_LEVEL6_WEIGHT,                            "0.13",      OPTION_FLOAT,      "Bloom level 6  (.) weight" },
408   { WINOPTION_BLOOM_LEVEL7_WEIGHT,                            "0.12",      OPTION_FLOAT,      "Bloom level 7  (.) weight" },
409   { WINOPTION_BLOOM_LEVEL8_WEIGHT,                            "0.11",      OPTION_FLOAT,      "Bloom level 8  (.) weight" },
410   { WINOPTION_BLOOM_LEVEL9_WEIGHT,                            "0.10",      OPTION_FLOAT,      "Bloom level 9  (.) weight" },
411   { WINOPTION_BLOOM_LEVEL10_WEIGHT,                           "0.09",      OPTION_FLOAT,      "Bloom level 10 (1x1 target) weight" },
412412
413413   // per-window options
414414   { NULL,                                           NULL,       OPTION_HEADER,     "PER-WINDOW VIDEO OPTIONS" },
trunk/src/osd/windows/d3dhlsl.c
r23623r23624
8888
8989namespace d3d
9090{
91
9291hlsl_options shaders::s_hlsl_presets[4] =
9392{
9493   {   // 25% Shadow mask, 50% Scanlines, 3% Pincushion, 0 defocus, No Tint, 0.9 Exponent, 5% Floor, 25% Phosphor Return, 120% Saturation
trunk/src/osd/windows/d3dhlsl.h
r23623r23624
182182
183183   struct slider_desc
184184   {
185      const char *      name;
186      int               minval;
187      int               defval;
188      int               maxval;
189      int               step;
185      const char *        name;
186      int                 minval;
187      int                 defval;
188      int                 maxval;
189      int                 step;
190190      INT32 (*adjustor)(running_machine &, void *, astring *, INT32);
191191   };
192192
r23623r23624
282282   render_target *         targethead;
283283   cache_target *          cachehead;
284284
285   static slider_desc       s_sliders[];
285   static slider_desc      s_sliders[];
286286   static hlsl_options     s_hlsl_presets[4];
287287};
288288
trunk/src/osd/windows/debugwin.c
r23623r23624
469469   // get other metrics
470470   hscroll_height = GetSystemMetrics(SM_CYHSCROLL);
471471   vscroll_width = GetSystemMetrics(SM_CXVSCROLL);
472   
472
473473   // ensure we get called on the way out
474474   machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(debugwin_destroy_windows), &machine()));
475475}
trunk/src/osd/windows/window.c
r23623r23624
19471947   return false;
19481948}
19491949#endif
1950
trunk/src/osd/windows/windows.mak
r23623r23624
358358   $(MOC) $(INCPATH) $(DEFS) $< -o $@
359359
360360OSDOBJS += \
361 $(SDLOBJ)/debugqt.o \
362 $(SDLOBJ)/debugqtview.o \
363 $(SDLOBJ)/debugqtwindow.o \
364 $(SDLOBJ)/debugqtlogwindow.o \
365 $(SDLOBJ)/debugqtdasmwindow.o \
366 $(SDLOBJ)/debugqtmainwindow.o \
367 $(SDLOBJ)/debugqtmemorywindow.o \
368 $(SDLOBJ)/debugqtbreakpointswindow.o \
369 $(SDLOBJ)/debugqtview.moc.o \
370 $(SDLOBJ)/debugqtwindow.moc.o \
371 $(SDLOBJ)/debugqtlogwindow.moc.o \
372 $(SDLOBJ)/debugqtdasmwindow.moc.o \
373 $(SDLOBJ)/debugqtmainwindow.moc.o \
374 $(SDLOBJ)/debugqtmemorywindow.moc.o \
375 $(SDLOBJ)/debugqtbreakpointswindow.moc.o
361   $(SDLOBJ)/debugqt.o \
362   $(SDLOBJ)/debugqtview.o \
363   $(SDLOBJ)/debugqtwindow.o \
364   $(SDLOBJ)/debugqtlogwindow.o \
365   $(SDLOBJ)/debugqtdasmwindow.o \
366   $(SDLOBJ)/debugqtmainwindow.o \
367   $(SDLOBJ)/debugqtmemorywindow.o \
368   $(SDLOBJ)/debugqtbreakpointswindow.o \
369   $(SDLOBJ)/debugqtview.moc.o \
370   $(SDLOBJ)/debugqtwindow.moc.o \
371   $(SDLOBJ)/debugqtlogwindow.moc.o \
372   $(SDLOBJ)/debugqtdasmwindow.moc.o \
373   $(SDLOBJ)/debugqtmainwindow.moc.o \
374   $(SDLOBJ)/debugqtmemorywindow.moc.o \
375   $(SDLOBJ)/debugqtbreakpointswindow.moc.o
376376endif
377377
378378#-------------------------------------------------
trunk/src/emu/emu.mak
r23623r23624
135135   $(EMUOBJ)/sound/flt_vol.o \
136136   $(EMUOBJ)/sound/flt_rc.o \
137137   $(EMUOBJ)/sound/wavwrite.o \
138   $(EMUOBJ)/sound/samples.o   \
138   $(EMUOBJ)/sound/samples.o   \
139139
140140EMUDRIVEROBJS = \
141141   $(EMUDRIVERS)/empty.o \
142142   $(EMUDRIVERS)/testcpu.o \
143   
143
144144EMUMACHINEOBJS = \
145    $(EMUMACHINE)/generic.o     \
146   $(EMUMACHINE)/ram.o        \
147   $(EMUMACHINE)/nvram.o        \
145   $(EMUMACHINE)/generic.o     \
146   $(EMUMACHINE)/ram.o         \
147   $(EMUMACHINE)/nvram.o       \
148148   $(EMUMACHINE)/laserdsc.o    \
149149   $(EMUMACHINE)/net_lib.o     \
150150   $(EMUMACHINE)/netlist.o     \
151   
151
152152EMUIMAGEDEVOBJS = \
153153   $(EMUIMAGEDEV)/bitbngr.o    \
154154   $(EMUIMAGEDEV)/cartslot.o   \
r23623r23624
165165
166166
167167EMUVIDEOOBJS = \
168   $(EMUVIDEO)/generic.o      \
169   $(EMUVIDEO)/resnet.o       \
170   $(EMUVIDEO)/rgbutil.o      \
171   $(EMUVIDEO)/vector.o      \
168   $(EMUVIDEO)/generic.o       \
169   $(EMUVIDEO)/resnet.o        \
170   $(EMUVIDEO)/rgbutil.o       \
171   $(EMUVIDEO)/vector.o        \
172172
173173
174174LIBEMUOBJS = $(EMUOBJS) $(EMUSOUNDOBJS) $(EMUDRIVEROBJS) $(EMUMACHINEOBJS) $(EMUIMAGEDEVOBJS) $(EMUVIDEOOBJS)
trunk/src/emu/machine/pit8253.c
r23623r23624
7575//  device_start - device-specific startup
7676//-------------------------------------------------
7777
78void pit8253_device::common_start( int device_type )
78void pit8253_device::common_start( int device_type )
7979{
8080   m_device_type = device_type;
81   
81
8282   /* register for state saving */
8383   for (int timerno = 0; timerno < PIT8253_MAX_TIMER; timerno++)
8484   {
8585      pit8253_timer *timer = get_timer(timerno);
86     
86
8787      /* initialize timer */
8888      timer->clockin = m_intf_timer[timerno].clockin;
8989      timer->updatetimer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pit8253_device::update_timer_cb),this));
9090      timer->updatetimer->adjust(attotime::never, timerno);
91     
91
9292      /* resolve callbacks */
9393      timer->in_gate_func.resolve(m_intf_timer[timerno].in_gate_func, *this);
9494      timer->out_out_func.resolve(m_intf_timer[timerno].out_out_func, *this);
95     
95
9696      /* set up state save values */
9797      save_item(NAME(timer->clockin), timerno);
9898      save_item(NAME(timer->control), timerno);
r23623r23624
144144      timer->rmsb = timer->wmsb = 0;
145145      timer->count = timer->value = timer->latch = 0;
146146      timer->lowcount = 0;
147     
147
148148      if (!timer->in_gate_func.isnull())
149149         timer->gate = timer->in_gate_func();
150150      else
151151         timer->gate = 1;
152     
152
153153      timer->output = 2;  /* output is undetermined */
154154      timer->latched_count = 0;
155155      timer->latched_status = 0;
156156      timer->null_count = 1;
157157      timer->cycles_to_output = CYCLES_NEVER;
158     
158
159159      timer->last_updated = machine().time();
160     
160
161161      update(timer);
162162   }
163163}
r23623r23624
311311   LOG2(("pit8253: simulate2(): simulating %d cycles for %d in mode %d, bcd = %d, phase = %d, gate = %d, output %d, value = 0x%04x\n",
312312         (int)elapsed_cycles, timer->index, mode, bcd, timer->phase, pit8253_gate(timer), timer->output, timer->value));
313313
314   switch (mode)
314   switch (mode)
315315   {
316316   case 0:
317317      /* Mode 0: (Interrupt on Terminal Count)
r23623r23624
342342         if (elapsed_cycles >= 0 && timer->phase == 1)
343343         {
344344            /* Counter load cycle */
345            if (elapsed_cycles > 0)
345            if (elapsed_cycles > 0)
346346            {
347347               --elapsed_cycles;
348348               timer->phase = 2;
r23623r23624
406406      if (elapsed_cycles >= 0 && timer->phase == 1)
407407      {
408408         /* Counter load cycle, output goes low */
409         if (elapsed_cycles > 0)
409         if (elapsed_cycles > 0)
410410         {
411411            --elapsed_cycles;
412412            timer->phase = 2;
r23623r23624
472472      {
473473         if (elapsed_cycles >= 0 && timer->phase == 1)
474474         {
475            if (elapsed_cycles > 0)
475            if (elapsed_cycles > 0)
476476            {
477477               --elapsed_cycles;
478478               timer->phase = 2;
r23623r23624
552552      {
553553         if (elapsed_cycles >= 0 && timer->phase == 1)
554554         {
555            if (elapsed_cycles > 0)
555            if (elapsed_cycles > 0)
556556            {
557557               --elapsed_cycles;
558558               timer->phase = 2;
r23623r23624
560560            load_counter_value(timer);
561561         }
562562
563         if (elapsed_cycles > 0)
563         if (elapsed_cycles > 0)
564564         {
565565            adjusted_value = adjusted_count(bcd, timer->value);
566566
r23623r23624
635635      {
636636         if (elapsed_cycles >= 0 && timer->phase == 1)
637637         {
638            if (elapsed_cycles > 0)
638            if (elapsed_cycles > 0)
639639            {
640640               --elapsed_cycles;
641641               timer->phase = 2;
r23623r23624
799799            timer->rmsb = 1 - timer->rmsb;
800800            --timer->latched_count;
801801         }
802         else
802         else
803803         {
804804            value = masked_value(timer);
805805
806806            /* Read back current count */
807            switch(CTRL_ACCESS(timer->control))
807            switch(CTRL_ACCESS(timer->control))
808808            {
809809            case 0:
810810            default:
r23623r23624
892892      if (timer->latched_count == 0)
893893      {
894894         value = masked_value(timer);
895         switch(CTRL_ACCESS(timer->control))
895         switch(CTRL_ACCESS(timer->control))
896896         {
897897         case 0:
898898            /* This should never happen */
r23623r23624
928928
929929   LOG2(("pit8253: write(): offset=%d data=0x%02x\n", offset, data));
930930
931   if (timer == NULL)
931   if (timer == NULL)
932932   {
933933      /* Write to mode control register */
934934      timer = get_timer((data >> 6) & 3);
r23623r23624
982982      if (machine().time() > timer->last_updated && timer->clockin != 0)
983983         middle_of_a_cycle = 1;
984984
985      switch(CTRL_ACCESS(timer->control))
985      switch(CTRL_ACCESS(timer->control))
986986      {
987987      case 0:
988988         /* This should never happen */
r23623r23624
11241124WRITE_LINE_MEMBER( pit8253_device::clk0_w ) { set_clock_signal(0, state); }
11251125WRITE_LINE_MEMBER( pit8253_device::clk1_w ) { set_clock_signal(1, state); }
11261126WRITE_LINE_MEMBER( pit8253_device::clk2_w ) { set_clock_signal(2, state); }
1127
trunk/src/emu/machine/pit8253.h
r23623r23624
2929
3030
3131/* device types */
32enum
32enum
3333{
3434   TYPE_PIT8253 = 0,
3535   TYPE_PIT8254
r23623r23624
5252   int index;                      /* index number of the timer */
5353   double clockin;                 /* input clock frequency in Hz */
5454   int clock;                      /* clock signal when clockin is 0 */
55   
55
5656   devcb_resolved_read_line    in_gate_func;   /* callback for gate input */
5757   devcb_resolved_write_line   out_out_func;   /* callback function for when output changes */
58   
58
5959   attotime last_updated;          /* time when last updated */
60   
60
6161   emu_timer *updatetimer;         /* MAME timer to process updates */
62   
62
6363   UINT16 value;                   /* current counter value ("CE" in Intel docs) */
6464   UINT16 latch;                   /* latched counter value ("OL" in Intel docs) */
6565   UINT16 count;                   /* new counter value ("CR" in Intel docs) */
r23623r23624
6969   INT32 rmsb;                     /* 1 = Next read is MSB of 16-bit value */
7070   INT32 wmsb;                     /* 1 = Next write is MSB of 16-bit value */
7171   INT32 output;                       /* 0 = low, 1 = high */
72   
72
7373   INT32 gate;                     /* gate input (0 = low, 1 = high) */
7474   INT32 latched_count;                /* number of bytes of count latched */
7575   INT32 latched_status;               /* 1 = status latched (8254 only) */
7676   INT32 null_count;                   /* 1 = mode control or count written, 0 = count loaded */
7777   INT32 phase;                        /* see phase definition tables in simulate2(), below */
78   
78
7979   UINT32 cycles_to_output;        /* cycles until output callback called */
8080};
8181
r23623r23624
9090
9191   DECLARE_READ8_MEMBER(read);
9292   DECLARE_WRITE8_MEMBER(write);
93   
93
9494   WRITE_LINE_MEMBER(clk0_w);
9595   WRITE_LINE_MEMBER(clk1_w);
9696   WRITE_LINE_MEMBER(clk2_w);
97   
97
9898   WRITE_LINE_MEMBER(gate0_w);
9999   WRITE_LINE_MEMBER(gate1_w);
100100   WRITE_LINE_MEMBER(gate2_w);
101   
102   
101
102
103103   /* In the 8253/8254 the CLKx input lines can be attached to a regular clock
104104    signal. Another option is to use the output from one timer as the input
105105    clock to another timer.
106   
106
107107    The functions below should supply both functionalities. If the signal is
108108    a regular clock signal, use the pit8253_set_clockin function. If the
109109    CLKx input signal is the output of the different source, set the new_clockin
r23623r23624
113113   int get_output(int timer);
114114   void set_clockin(int timer, double new_clockin);
115115
116   
116
117117protected:
118118   // device-level overrides
119119   virtual void device_config_complete();
120120   virtual void device_start();
121121   virtual void device_reset();
122122
123   
123
124124   // internal state
125125   void common_start(int device_type);
126126   pit8253_timer *get_timer(int which);
r23623r23624
138138   void set_clock_signal(int timerno, int state);
139139
140140   TIMER_CALLBACK_MEMBER(update_timer_cb);
141   
141
142142   int m_device_type;
143143
144144   pit8253_timer m_timers[PIT8253_MAX_TIMER];
trunk/src/emu/machine/mc68901.c
r23623r23624
12321232         if (data & UCR_PARITY_EVEN)
12331233         {
12341234            if (LOG) logerror("MC68901 '%s' Parity : Even\n", tag());
1235           
1235
12361236            parity_code = SERIAL_PARITY_EVEN;
12371237         }
12381238         else
trunk/src/emu/machine/idehd.c
r23623r23624
239239
240240void ide_hdd_device::device_start()
241241{
242//   save_item(NAME(features));
242//  save_item(NAME(features));
243243
244244   save_item(NAME(cur_cylinder));
245245   save_item(NAME(cur_sector));
trunk/src/emu/machine/adc1213x.h
r23623r23624
4040   DECLARE_WRITE8_MEMBER( conv_w );
4141   DECLARE_READ8_MEMBER( do_r );
4242   DECLARE_READ8_MEMBER( eoc_r );
43   
43
4444protected:
4545   // device-level overrides
4646   virtual void device_config_complete();
4747   virtual void device_start();
4848   virtual void device_reset();
49   
49
5050   void convert(int channel, int bits16, int lsbfirst);
5151
5252   adc1213x_input_convert_func m_input_callback_r_func;
53   
53
5454   private:
5555   // internal state
5656   int m_cycle;
trunk/src/emu/machine/machine.mak
r23623r23624
1515
1616
1717#-------------------------------------------------
18#
18#
1919#-------------------------------------------------
2020
2121ifneq ($(filter NCR53C7XX,$(MACHINES)),)
r23623r23624
2424endif
2525
2626#-------------------------------------------------
27#
27#
2828#-------------------------------------------------
2929
3030ifneq ($(filter LSI53C810,$(MACHINES)),)
r23623r23624
3333endif
3434
3535#-------------------------------------------------
36#
36#
3737#-------------------------------------------------
3838
3939ifneq ($(filter 6522VIA,$(MACHINES)),)
r23623r23624
4141endif
4242
4343#-------------------------------------------------
44#
44#
4545#-------------------------------------------------
4646
4747ifneq ($(filter TPI6525,$(MACHINES)),)
r23623r23624
4949endif
5050
5151#-------------------------------------------------
52#
52#
5353#-------------------------------------------------
5454
5555ifneq ($(filter 6526CIA,$(MACHINES)),)
r23623r23624
5757endif
5858
5959#-------------------------------------------------
60#
60#
6161#-------------------------------------------------
6262
6363ifneq ($(filter RIOT6532,$(MACHINES)),)
r23623r23624
6565endif
6666
6767#-------------------------------------------------
68#
68#
6969#-------------------------------------------------
7070
7171ifneq ($(filter 6821PIA,$(MACHINES)),)
r23623r23624
7373endif
7474
7575#-------------------------------------------------
76#
76#
7777#-------------------------------------------------
7878
7979ifneq ($(filter 6840PTM,$(MACHINES)),)
r23623r23624
8181endif
8282
8383#-------------------------------------------------
84#
84#
8585#-------------------------------------------------
8686
8787ifneq ($(filter ACIA6850,$(MACHINES)),)
r23623r23624
8989endif
9090
9191#-------------------------------------------------
92#
92#
9393#-------------------------------------------------
9494
9595ifneq ($(filter 68681,$(MACHINES)),)
96MACHINEOBJS += $(MACHINEOBJ)/68681.o
96MACHINEOBJS += $(MACHINEOBJ)/68681.o
9797MACHINEOBJS += $(MACHINEOBJ)/n68681.o
9898endif
9999
100100#-------------------------------------------------
101#
101#
102102#-------------------------------------------------
103103
104104ifneq ($(filter 7200FIFO,$(MACHINES)),)
r23623r23624
106106endif
107107
108108#-------------------------------------------------
109#
109#
110110#-------------------------------------------------
111111
112112ifneq ($(filter TTL74123,$(MACHINES)),)
113MACHINEOBJS += $(MACHINEOBJ)/74123.o
113MACHINEOBJS += $(MACHINEOBJ)/74123.o
114114endif
115115
116116#-------------------------------------------------
117#
117#
118118#-------------------------------------------------
119119
120120ifneq ($(filter TTL74145,$(MACHINES)),)
121MACHINEOBJS += $(MACHINEOBJ)/74145.o
121MACHINEOBJS += $(MACHINEOBJ)/74145.o
122122endif
123123
124124#-------------------------------------------------
125#
125#
126126#-------------------------------------------------
127127
128128ifneq ($(filter TTL74148,$(MACHINES)),)
129MACHINEOBJS += $(MACHINEOBJ)/74148.o
129MACHINEOBJS += $(MACHINEOBJ)/74148.o
130130endif
131131
132132#-------------------------------------------------
133#
133#
134134#-------------------------------------------------
135135
136136ifneq ($(filter TTL74153,$(MACHINES)),)
137MACHINEOBJS += $(MACHINEOBJ)/74153.o
137MACHINEOBJS += $(MACHINEOBJ)/74153.o
138138endif
139139
140140#-------------------------------------------------
141#
141#
142142#-------------------------------------------------
143143
144144ifneq ($(filter TTL74181,$(MACHINES)),)
145MACHINEOBJS += $(MACHINEOBJ)/74181.o
145MACHINEOBJS += $(MACHINEOBJ)/74181.o
146146endif
147147
148148#-------------------------------------------------
149#
149#
150150#-------------------------------------------------
151151
152152ifneq ($(filter TTL7474,$(MACHINES)),)
153MACHINEOBJS += $(MACHINEOBJ)/7474.o 
153MACHINEOBJS += $(MACHINEOBJ)/7474.o
154154endif
155155
156156#-------------------------------------------------
157#
157#
158158#-------------------------------------------------
159159
160160ifneq ($(filter KBDC8042,$(MACHINES)),)
r23623r23624
162162endif
163163
164164#-------------------------------------------------
165#
165#
166166#-------------------------------------------------
167167
168168ifneq ($(filter I8257,$(MACHINES)),)
r23623r23624
170170endif
171171
172172#-------------------------------------------------
173#
173#
174174#-------------------------------------------------
175175
176176ifneq ($(filter AAKARTDEV,$(MACHINES)),)
r23623r23624
178178endif
179179
180180#-------------------------------------------------
181#
181#
182182#-------------------------------------------------
183183
184184ifneq ($(filter ADC0808,$(MACHINES)),)
r23623r23624
186186endif
187187
188188#-------------------------------------------------
189#
189#
190190#-------------------------------------------------
191191
192192ifneq ($(filter ADC083X,$(MACHINES)),)
r23623r23624
194194endif
195195
196196#-------------------------------------------------
197#
197#
198198#-------------------------------------------------
199199
200200ifneq ($(filter ADC1038,$(MACHINES)),)
r23623r23624
202202endif
203203
204204#-------------------------------------------------
205#
205#
206206#-------------------------------------------------
207207
208208ifneq ($(filter ADC1213X,$(MACHINES)),)
r23623r23624
210210endif
211211
212212#-------------------------------------------------
213#
213#
214214#-------------------------------------------------
215215
216216ifneq ($(filter AM53CF96,$(MACHINES)),)
r23623r23624
218218endif
219219
220220#-------------------------------------------------
221#
221#
222222#-------------------------------------------------
223223
224224ifneq ($(filter AM9517A,$(MACHINES)),)
r23623r23624
226226endif
227227
228228#-------------------------------------------------
229#
229#
230230#-------------------------------------------------
231231
232232ifneq ($(filter AMIGAFDC,$(MACHINES)),)
r23623r23624
234234endif
235235
236236#-------------------------------------------------
237#
237#
238238#-------------------------------------------------
239239
240240ifneq ($(filter AT28C16,$(MACHINES)),)
r23623r23624
242242endif
243243
244244#-------------------------------------------------
245#
245#
246246#-------------------------------------------------
247247
248248ifneq ($(filter AT29040,$(MACHINES)),)
r23623r23624
250250endif
251251
252252#-------------------------------------------------
253#
253#
254254#-------------------------------------------------
255255
256256ifneq ($(filter AT45DBXX,$(MACHINES)),)
r23623r23624
258258endif
259259
260260#-------------------------------------------------
261#
261#
262262#-------------------------------------------------
263263
264264ifneq ($(filter ATAFLASH,$(MACHINES)),)
r23623r23624
268268endif
269269
270270#-------------------------------------------------
271#
271#
272272#-------------------------------------------------
273273
274274ifneq ($(filter AY31015,$(MACHINES)),)
r23623r23624
276276endif
277277
278278#-------------------------------------------------
279#
279#
280280#-------------------------------------------------
281281
282282ifneq ($(filter BANKDEV,$(MACHINES)),)
r23623r23624
284284endif
285285
286286#-------------------------------------------------
287#
287#
288288#-------------------------------------------------
289289
290290ifneq ($(filter CDP1852,$(MACHINES)),)
r23623r23624
292292endif
293293
294294#-------------------------------------------------
295#
295#
296296#-------------------------------------------------
297297
298298ifneq ($(filter CDP1871,$(MACHINES)),)
r23623r23624
300300endif
301301
302302#-------------------------------------------------
303#
303#
304304#-------------------------------------------------
305305
306306ifneq ($(filter COM8116,$(MACHINES)),)
r23623r23624
308308endif
309309
310310#-------------------------------------------------
311#
311#
312312#-------------------------------------------------
313313
314314ifneq ($(filter CR589,$(MACHINES)),)
315MACHINEOBJS += $(MACHINEOBJ)/cr589.o
315MACHINEOBJS += $(MACHINEOBJ)/cr589.o
316316endif
317317
318318#-------------------------------------------------
319#
319#
320320#-------------------------------------------------
321321
322322ifneq ($(filter CTRONICS,$(MACHINES)),)
r23623r23624
324324endif
325325
326326#-------------------------------------------------
327#
327#
328328#-------------------------------------------------
329329
330330ifneq ($(filter DS1302,$(MACHINES)),)
r23623r23624
332332endif
333333
334334#-------------------------------------------------
335#
335#
336336#-------------------------------------------------
337337
338338ifneq ($(filter DS2401,$(MACHINES)),)
r23623r23624
340340endif
341341
342342#-------------------------------------------------
343#
343#
344344#-------------------------------------------------
345345
346346ifneq ($(filter DS2404,$(MACHINES)),)
r23623r23624
348348endif
349349
350350#-------------------------------------------------
351#
351#
352352#-------------------------------------------------
353353
354354ifneq ($(filter DS75160A,$(MACHINES)),)
r23623r23624
356356endif
357357
358358#-------------------------------------------------
359#
359#
360360#-------------------------------------------------
361361
362362ifneq ($(filter DS75161A,$(MACHINES)),)
r23623r23624
364364endif
365365
366366#-------------------------------------------------
367#
367#
368368#-------------------------------------------------
369369
370370ifneq ($(filter E0516,$(MACHINES)),)
371MACHINEOBJS += $(MACHINEOBJ)/e0516.o
371MACHINEOBJS += $(MACHINEOBJ)/e0516.o
372372endif
373373
374374#-------------------------------------------------
375#
375#
376376#-------------------------------------------------
377377
378378ifneq ($(filter EEPROMDEV,$(MACHINES)),)
r23623r23624
380380endif
381381
382382#-------------------------------------------------
383#
383#
384384#-------------------------------------------------
385385
386386ifneq ($(filter ER2055,$(MACHINES)),)
r23623r23624
388388endif
389389
390390#-------------------------------------------------
391#
391#
392392#-------------------------------------------------
393393
394394ifneq ($(filter ER59256,$(MACHINES)),)
r23623r23624
396396endif
397397
398398#-------------------------------------------------
399#
399#
400400#-------------------------------------------------
401401
402402ifneq ($(filter F3853,$(MACHINES)),)
403MACHINEOBJS += $(MACHINEOBJ)/f3853.o
403MACHINEOBJS += $(MACHINEOBJ)/f3853.o
404404endif
405405
406406#-------------------------------------------------
407#
407#
408408#-------------------------------------------------
409409
410410ifneq ($(filter I2CMEM,$(MACHINES)),)
r23623r23624
412412endif
413413
414414#-------------------------------------------------
415#
415#
416416#-------------------------------------------------
417417
418418ifneq ($(filter I8155,$(MACHINES)),)
419MACHINEOBJS += $(MACHINEOBJ)/i8155.o
419MACHINEOBJS += $(MACHINEOBJ)/i8155.o
420420endif
421421
422422#-------------------------------------------------
423#
423#
424424#-------------------------------------------------
425425
426426ifneq ($(filter I8212,$(MACHINES)),)
427MACHINEOBJS += $(MACHINEOBJ)/i8212.o
427MACHINEOBJS += $(MACHINEOBJ)/i8212.o
428428endif
429429
430430#-------------------------------------------------
431#
431#
432432#-------------------------------------------------
433433
434434ifneq ($(filter I8214,$(MACHINES)),)
435MACHINEOBJS += $(MACHINEOBJ)/i8214.o
435MACHINEOBJS += $(MACHINEOBJ)/i8214.o
436436endif
437437
438438#-------------------------------------------------
439#
439#
440440#-------------------------------------------------
441441
442442ifneq ($(filter I8243,$(MACHINES)),)
443MACHINEOBJS += $(MACHINEOBJ)/i8243.o
443MACHINEOBJS += $(MACHINEOBJ)/i8243.o
444444endif
445445
446446#-------------------------------------------------
447#
447#
448448#-------------------------------------------------
449449
450450ifneq ($(filter I8251,$(MACHINES)),)
451MACHINEOBJS += $(MACHINEOBJ)/i8251.o
451MACHINEOBJS += $(MACHINEOBJ)/i8251.o
452452endif
453453
454454#-------------------------------------------------
455#
455#
456456#-------------------------------------------------
457457
458458ifneq ($(filter I8279,$(MACHINES)),)
459MACHINEOBJS += $(MACHINEOBJ)/i8279.o
459MACHINEOBJS += $(MACHINEOBJ)/i8279.o
460460endif
461461
462462#-------------------------------------------------
463#
463#
464464#-------------------------------------------------
465465
466466ifneq ($(filter I8355,$(MACHINES)),)
467MACHINEOBJS += $(MACHINEOBJ)/i8355.o
467MACHINEOBJS += $(MACHINEOBJ)/i8355.o
468468endif
469469
470470#-------------------------------------------------
471#
471#
472472#-------------------------------------------------
473473
474474ifneq ($(filter IDE,$(MACHINES)),)
475475MACHINEOBJS += $(MACHINEOBJ)/idectrl.o
476MACHINEOBJS += $(MACHINEOBJ)/idehd.o
476MACHINEOBJS += $(MACHINEOBJ)/idehd.o
477477endif
478478
479479#-------------------------------------------------
480#
480#
481481#-------------------------------------------------
482482
483483ifneq ($(filter IM6402,$(MACHINES)),)
r23623r23624
485485endif
486486
487487#-------------------------------------------------
488#
488#
489489#-------------------------------------------------
490490
491491ifneq ($(filter INS8154,$(MACHINES)),)
r23623r23624
493493endif
494494
495495#-------------------------------------------------
496#
496#
497497#-------------------------------------------------
498498
499499ifneq ($(filter INS8250,$(MACHINES)),)
r23623r23624
501501endif
502502
503503#-------------------------------------------------
504#
504#
505505#-------------------------------------------------
506506
507507ifneq ($(filter INTELFLASH,$(MACHINES)),)
r23623r23624
509509endif
510510
511511#-------------------------------------------------
512#
512#
513513#-------------------------------------------------
514514
515515ifneq ($(filter JVS,$(MACHINES)),)
r23623r23624
518518endif
519519
520520#-------------------------------------------------
521#
521#
522522#-------------------------------------------------
523523
524524ifneq ($(filter K033906,$(MACHINES)),)
r23623r23624
526526endif
527527
528528#-------------------------------------------------
529#
529#
530530#-------------------------------------------------
531531
532532ifneq ($(filter K053252,$(MACHINES)),)
r23623r23624
534534endif
535535
536536#-------------------------------------------------
537#
537#
538538#-------------------------------------------------
539539
540540ifneq ($(filter K056230,$(MACHINES)),)
r23623r23624
542542endif
543543
544544#-------------------------------------------------
545#
545#
546546#-------------------------------------------------
547547
548548ifneq ($(filter LATCH8,$(MACHINES)),)
r23623r23624
550550endif
551551
552552#-------------------------------------------------
553#
553#
554554#-------------------------------------------------
555555
556556ifneq ($(filter LC89510,$(MACHINES)),)
r23623r23624
558558endif
559559
560560#-------------------------------------------------
561#
561#
562562#-------------------------------------------------
563563
564564ifneq ($(filter LDPR8210,$(MACHINES)),)
r23623r23624
566566endif
567567
568568#-------------------------------------------------
569#
569#
570570#-------------------------------------------------
571571
572572ifneq ($(filter LDSTUB,$(MACHINES)),)
r23623r23624
574574endif
575575
576576#-------------------------------------------------
577#
577#
578578#-------------------------------------------------
579579
580580ifneq ($(filter LDV1000,$(MACHINES)),)
r23623r23624
584584endif
585585
586586#-------------------------------------------------
587#
587#
588588#-------------------------------------------------
589589
590590ifneq ($(filter LDVP931,$(MACHINES)),)
r23623r23624
592592endif
593593
594594#-------------------------------------------------
595#
595#
596596#-------------------------------------------------
597597
598598ifneq ($(filter LINFLASH,$(MACHINES)),)
r23623r23624
600600endif
601601
602602#-------------------------------------------------
603#
603#
604604#-------------------------------------------------
605605
606606ifneq ($(filter M6M80011AP,$(MACHINES)),)
r23623r23624
608608endif
609609
610610#-------------------------------------------------
611#
611#
612612#-------------------------------------------------
613613
614614ifneq ($(filter MATSUCD,$(MACHINES)),)
r23623r23624
616616endif
617617
618618#-------------------------------------------------
619#
619#
620620#-------------------------------------------------
621621
622622ifneq ($(filter MB14241,$(MACHINES)),)
r23623r23624
624624endif
625625
626626#-------------------------------------------------
627#
627#
628628#-------------------------------------------------
629629
630630ifneq ($(filter MB3773,$(MACHINES)),)
r23623r23624
632632endif
633633
634634#-------------------------------------------------
635#
635#
636636#-------------------------------------------------
637637
638638ifneq ($(filter MB87078,$(MACHINES)),)
r23623r23624
640640endif
641641
642642#-------------------------------------------------
643#
643#
644644#-------------------------------------------------
645645
646646ifneq ($(filter MB89371,$(MACHINES)),)
r23623r23624
648648endif
649649
650650#-------------------------------------------------
651#
651#
652652#-------------------------------------------------
653653
654654ifneq ($(filter MC146818,$(MACHINES)),)
r23623r23624
656656endif
657657
658658#-------------------------------------------------
659#
659#
660660#-------------------------------------------------
661661
662662ifneq ($(filter MC2661,$(MACHINES)),)
r23623r23624
664664endif
665665
666666#-------------------------------------------------
667#
667#
668668#-------------------------------------------------
669669
670670ifneq ($(filter MC6843,$(MACHINES)),)
r23623r23624
672672endif
673673
674674#-------------------------------------------------
675#
675#
676676#-------------------------------------------------
677677
678678ifneq ($(filter MC6846,$(MACHINES)),)
r23623r23624
680680endif
681681
682682#-------------------------------------------------
683#
683#
684684#-------------------------------------------------
685685
686686ifneq ($(filter MC6852,$(MACHINES)),)
r23623r23624
688688endif
689689
690690#-------------------------------------------------
691#
691#
692692#-------------------------------------------------
693693
694694ifneq ($(filter MC6854,$(MACHINES)),)
r23623r23624
696696endif
697697
698698#-------------------------------------------------
699#
699#
700700#-------------------------------------------------
701701
702702ifneq ($(filter MC68901,$(MACHINES)),)
r23623r23624
704704endif
705705
706706#-------------------------------------------------
707#
707#
708708#-------------------------------------------------
709709
710710ifneq ($(filter MCCS1850,$(MACHINES)),)
r23623r23624
712712endif
713713
714714#-------------------------------------------------
715#
715#
716716#-------------------------------------------------
717717
718718ifneq ($(filter MCF5206E,$(MACHINES)),)
r23623r23624
720720endif
721721
722722#-------------------------------------------------
723#
723#
724724#-------------------------------------------------
725725
726726ifneq ($(filter MICROTOUCH,$(MACHINES)),)
r23623r23624
728728endif
729729
730730#-------------------------------------------------
731#
731#
732732#-------------------------------------------------
733733
734734ifneq ($(filter MM58274C,$(MACHINES)),)
r23623r23624
736736endif
737737
738738#-------------------------------------------------
739#
739#
740740#-------------------------------------------------
741741
742742ifneq ($(filter MM74C922,$(MACHINES)),)
r23623r23624
744744endif
745745
746746#-------------------------------------------------
747#
747#
748748#-------------------------------------------------
749749
750750ifneq ($(filter MOS6526,$(MACHINES)),)
r23623r23624
752752endif
753753
754754#-------------------------------------------------
755#
755#
756756#-------------------------------------------------
757757
758758ifneq ($(filter MOS6529,$(MACHINES)),)
r23623r23624
760760endif
761761
762762#-------------------------------------------------
763#
763#
764764#-------------------------------------------------
765765
766766ifneq ($(filter MIOT6530,$(MACHINES)),)
r23623r23624
768768endif
769769
770770#-------------------------------------------------
771#
771#
772772#-------------------------------------------------
773773
774774ifneq ($(filter MOS6551,$(MACHINES)),)
r23623r23624
776776endif
777777
778778#-------------------------------------------------
779#
779#
780780#-------------------------------------------------
781781
782782ifneq ($(filter MSM5832,$(MACHINES)),)
r23623r23624
784784endif
785785
786786#-------------------------------------------------
787#
787#
788788#-------------------------------------------------
789789
790790ifneq ($(filter MSM58321,$(MACHINES)),)
r23623r23624
792792endif
793793
794794#-------------------------------------------------
795#
795#
796796#-------------------------------------------------
797797
798798ifneq ($(filter MSM6242,$(MACHINES)),)
r23623r23624
800800endif
801801
802802#-------------------------------------------------
803#
803#
804804#-------------------------------------------------
805805
806806ifneq ($(filter NCR539x,$(MACHINES)),)
r23623r23624
809809endif
810810
811811#-------------------------------------------------
812#
812#
813813#-------------------------------------------------
814814
815815ifneq ($(filter NMC9306,$(MACHINES)),)
r23623r23624
817817endif
818818
819819#-------------------------------------------------
820#
820#
821821#-------------------------------------------------
822822
823823ifneq ($(filter NSCSI,$(MACHINES)),)
r23623r23624
827827endif
828828
829829#-------------------------------------------------
830#
830#
831831#-------------------------------------------------
832832
833833ifneq ($(filter PCF8593,$(MACHINES)),)
r23623r23624
835835endif
836836
837837#-------------------------------------------------
838#
838#
839839#-------------------------------------------------
840840
841841ifneq ($(filter PCI,$(MACHINES)),)
842MACHINEOBJS += $(MACHINEOBJ)/pci.o   
842MACHINEOBJS += $(MACHINEOBJ)/pci.o
843843endif
844844
845845#-------------------------------------------------
846#
846#
847847#-------------------------------------------------
848848
849849ifneq ($(filter PCKEYBRD,$(MACHINES)),)
r23623r23624
851851endif
852852
853853#-------------------------------------------------
854#
854#
855855#-------------------------------------------------
856856
857857ifneq ($(filter PD4990A_OLD,$(MACHINES)),)
r23623r23624
859859endif
860860
861861#-------------------------------------------------
862#
862#
863863#-------------------------------------------------
864864
865865ifneq ($(filter PIC8259,$(MACHINES)),)
r23623r23624
867867endif
868868
869869#-------------------------------------------------
870#
870#
871871#-------------------------------------------------
872872
873873ifneq ($(filter PIT8253,$(MACHINES)),)
r23623r23624
875875endif
876876
877877#-------------------------------------------------
878#
878#
879879#-------------------------------------------------
880880
881881ifneq ($(filter PLA,$(MACHINES)),)
882MACHINEOBJS += $(MACHINEOBJ)/pla.o   
882MACHINEOBJS += $(MACHINEOBJ)/pla.o
883883endif
884884
885885#-------------------------------------------------
886#
886#
887887#-------------------------------------------------
888888
889889ifneq ($(filter RF5C296,$(MACHINES)),)
r23623r23624
892892endif
893893
894894#-------------------------------------------------
895#
895#
896896#-------------------------------------------------
897897
898898ifneq ($(filter ROC10937,$(MACHINES)),)
r23623r23624
900900endif
901901
902902#-------------------------------------------------
903#
903#
904904#-------------------------------------------------
905905
906906ifneq ($(filter RP5C01,$(MACHINES)),)
r23623r23624
908908endif
909909
910910#-------------------------------------------------
911#
911#
912912#-------------------------------------------------
913913
914914ifneq ($(filter RP5C15,$(MACHINES)),)
r23623r23624
916916endif
917917
918918#-------------------------------------------------
919#
919#
920920#-------------------------------------------------
921921
922922ifneq ($(filter RP5H01,$(MACHINES)),)
r23623r23624
924924endif
925925
926926#-------------------------------------------------
927#
927#
928928#-------------------------------------------------
929929
930930ifneq ($(filter RTC4543,$(MACHINES)),)
r23623r23624
932932endif
933933
934934#-------------------------------------------------
935#
935#
936936#-------------------------------------------------
937937
938938ifneq ($(filter RTC65271,$(MACHINES)),)
r23623r23624
940940endif
941941
942942#-------------------------------------------------
943#
943#
944944#-------------------------------------------------
945945
946946ifneq ($(filter RTC9701,$(MACHINES)),)
r23623r23624
948948endif
949949
950950#-------------------------------------------------
951#
951#
952952#-------------------------------------------------
953953
954954ifneq ($(filter S3520CF,$(MACHINES)),)
r23623r23624
956956endif
957957
958958#-------------------------------------------------
959#
959#
960960#-------------------------------------------------
961961
962962ifneq ($(filter S3C2400,$(MACHINES)),)
r23623r23624
964964endif
965965
966966#-------------------------------------------------
967#
967#
968968#-------------------------------------------------
969969
970970ifneq ($(filter S3C2410,$(MACHINES)),)
r23623r23624
972972endif
973973
974974#-------------------------------------------------
975#
975#
976976#-------------------------------------------------
977977
978978ifneq ($(filter S3C2440,$(MACHINES)),)
r23623r23624
980980endif
981981
982982#-------------------------------------------------
983#
983#
984984#-------------------------------------------------
985985
986986ifneq ($(filter SATURN,$(MACHINES)),)
r23623r23624
988988endif
989989
990990#-------------------------------------------------
991#
991#
992992#-------------------------------------------------
993993
994994ifneq ($(filter SCSI,$(MACHINES)),)
r23623r23624
10011001endif
10021002
10031003#-------------------------------------------------
1004#
1004#
10051005#-------------------------------------------------
10061006
10071007ifneq ($(filter SCUDSP,$(MACHINES)),)
r23623r23624
10091009endif
10101010
10111011#-------------------------------------------------
1012#
1012#
10131013#-------------------------------------------------
10141014
10151015ifneq ($(filter SEIBU_COP,$(MACHINES)),)
r23623r23624
10171017endif
10181018
10191019#-------------------------------------------------
1020#
1020#
10211021#-------------------------------------------------
10221022
10231023ifneq ($(filter SERFLASH,$(MACHINES)),)
r23623r23624
10251025endif
10261026
10271027#-------------------------------------------------
1028#
1028#
10291029#-------------------------------------------------
10301030
10311031ifneq ($(filter SMC91C9X,$(MACHINES)),)
r23623r23624
10331033endif
10341034
10351035#-------------------------------------------------
1036#
1036#
10371037#-------------------------------------------------
10381038
10391039ifneq ($(filter SMPC,$(MACHINES)),)
1040MACHINEOBJS += $(MACHINEOBJ)/smpc.o 
1040MACHINEOBJS += $(MACHINEOBJ)/smpc.o
10411041endif
10421042
10431043#-------------------------------------------------
1044#
1044#
10451045#-------------------------------------------------
10461046
10471047ifneq ($(filter STVCD,$(MACHINES)),)
1048MACHINEOBJS += $(MACHINEOBJ)/stvcd.o
1048MACHINEOBJS += $(MACHINEOBJ)/stvcd.o
10491049endif
10501050
10511051#-------------------------------------------------
1052#
1052#
10531053#-------------------------------------------------
10541054
10551055ifneq ($(filter TC0091LVC,$(MACHINES)),)
r23623r23624
10571057endif
10581058
10591059#-------------------------------------------------
1060#
1060#
10611061#-------------------------------------------------
10621062
10631063ifneq ($(filter TIMEKPR,$(MACHINES)),)
r23623r23624
10651065endif
10661066
10671067#-------------------------------------------------
1068#
1068#
10691069#-------------------------------------------------
10701070
10711071ifneq ($(filter TMP68301,$(MACHINES)),)
r23623r23624
10731073endif
10741074
10751075#-------------------------------------------------
1076#
1076#
10771077#-------------------------------------------------
10781078
10791079ifneq ($(filter TMS6100,$(MACHINES)),)
r23623r23624
10811081endif
10821082
10831083#-------------------------------------------------
1084#
1084#
10851085#-------------------------------------------------
10861086
10871087ifneq ($(filter TMS9901,$(MACHINES)),)
r23623r23624
10891089endif
10901090
10911091#-------------------------------------------------
1092#
1092#
10931093#-------------------------------------------------
10941094
10951095ifneq ($(filter TMS9902,$(MACHINES)),)
r23623r23624
10971097endif
10981098
10991099#-------------------------------------------------
1100#
1100#
11011101#-------------------------------------------------
11021102
11031103ifneq ($(filter UPD1990A,$(MACHINES)),)
r23623r23624
11051105endif
11061106
11071107#-------------------------------------------------
1108#
1108#
11091109#-------------------------------------------------
11101110
11111111ifneq ($(filter UPD4701,$(MACHINES)),)
r23623r23624
11131113endif
11141114
11151115#-------------------------------------------------
1116#
1116#
11171117#-------------------------------------------------
11181118
11191119ifneq ($(filter UPD7002,$(MACHINES)),)
r23623r23624
11211121endif
11221122
11231123#-------------------------------------------------
1124#
1124#
11251125#-------------------------------------------------
11261126
11271127ifneq ($(filter UPD765,$(MACHINES)),)
r23623r23624
11291129endif
11301130
11311131#-------------------------------------------------
1132#
1132#
11331133#-------------------------------------------------
11341134
11351135ifneq ($(filter V3021,$(MACHINES)),)
1136MACHINEOBJS += $(MACHINEOBJ)/v3021.o
1136MACHINEOBJS += $(MACHINEOBJ)/v3021.o
11371137endif
11381138
11391139#-------------------------------------------------
1140#
1140#
11411141#-------------------------------------------------
11421142
11431143ifneq ($(filter WD_FDC,$(MACHINES)),)
r23623r23624
11461146endif
11471147
11481148#-------------------------------------------------
1149#
1149#
11501150#-------------------------------------------------
11511151
11521152ifneq ($(filter WD11C00_17,$(MACHINES)),)
r23623r23624
11541154endif
11551155
11561156#-------------------------------------------------
1157#
1157#
11581158#-------------------------------------------------
11591159
11601160ifneq ($(filter WD17XX,$(MACHINES)),)
r23623r23624
11621162endif
11631163
11641164#-------------------------------------------------
1165#
1165#
11661166#-------------------------------------------------
11671167
11681168ifneq ($(filter WD2010,$(MACHINES)),)
r23623r23624
11701170endif
11711171
11721172#-------------------------------------------------
1173#
1173#
11741174#-------------------------------------------------
11751175
11761176ifneq ($(filter WD33C93,$(MACHINES)),)
r23623r23624
11791179endif
11801180
11811181#-------------------------------------------------
1182#
1182#
11831183#-------------------------------------------------
11841184
11851185ifneq ($(filter X2212,$(MACHINES)),)
1186MACHINEOBJS += $(MACHINEOBJ)/x2212.o
1186MACHINEOBJS += $(MACHINEOBJ)/x2212.o
11871187endif
11881188
11891189#-------------------------------------------------
1190#
1190#
11911191#-------------------------------------------------
11921192
11931193ifneq ($(filter X76F041,$(MACHINES)),)
r23623r23624
11961196endif
11971197
11981198#-------------------------------------------------
1199#
1199#
12001200#-------------------------------------------------
12011201
12021202ifneq ($(filter X76F100,$(MACHINES)),)
r23623r23624
12051205endif
12061206
12071207#-------------------------------------------------
1208#
1208#
12091209#-------------------------------------------------
12101210
12111211ifneq ($(filter Z80CTC,$(MACHINES)),)
r23623r23624
12131213endif
12141214
12151215#-------------------------------------------------
1216#
1216#
12171217#-------------------------------------------------
12181218
12191219ifneq ($(filter Z80DART,$(MACHINES)),)
r23623r23624
12211221endif
12221222
12231223#-------------------------------------------------
1224#
1224#
12251225#-------------------------------------------------
12261226
12271227ifneq ($(filter Z80DMA,$(MACHINES)),)
r23623r23624
12291229endif
12301230
12311231#-------------------------------------------------
1232#
1232#
12331233#-------------------------------------------------
12341234
12351235ifneq ($(filter Z80PIO,$(MACHINES)),)
r23623r23624
12371237endif
12381238
12391239#-------------------------------------------------
1240#
1240#
12411241#-------------------------------------------------
12421242
12431243ifneq ($(filter Z80SIO,$(MACHINES)),)
r23623r23624
12451245endif
12461246
12471247#-------------------------------------------------
1248#
1248#
12491249#-------------------------------------------------
12501250
12511251ifneq ($(filter Z80STI,$(MACHINES)),)
r23623r23624
12531253endif
12541254
12551255#-------------------------------------------------
1256#
1256#
12571257#-------------------------------------------------
12581258
12591259ifneq ($(filter Z8536,$(MACHINES)),)
1260MACHINEOBJS += $(MACHINEOBJ)/z8536.o
1260MACHINEOBJS += $(MACHINEOBJ)/z8536.o
12611261endif
12621262
12631263#-------------------------------------------------
1264#
1264#
12651265#-------------------------------------------------
12661266
12671267ifneq ($(filter SECFLASH,$(MACHINES)),)
r23623r23624
12691269endif
12701270
12711271#-------------------------------------------------
1272#
1272#
12731273#-------------------------------------------------
12741274
12751275ifneq ($(filter PCCARD,$(MACHINES)),)
r23623r23624
12771277endif
12781278
12791279#-------------------------------------------------
1280#
1280#
12811281#-------------------------------------------------
12821282
12831283ifneq ($(filter I8255,$(MACHINES)),)
1284MACHINEOBJS += $(MACHINEOBJ)/i8255.o
1284MACHINEOBJS += $(MACHINEOBJ)/i8255.o
12851285endif
12861286
12871287$(MACHINEOBJ)/s3c2400.o:    $(MACHINESRC)/s3c24xx.c
trunk/src/emu/machine/tms6100.c
r23623r23624
8585   : device_t(mconfig, TMS6100, "TMS6100", tag, owner, clock)
8686{
8787}
88   
88
8989const device_type M58819 = &device_creator<m58819_device>;
9090
9191m58819_device::m58819_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
9292   : tms6100_device(mconfig, M58819, "M58819", tag, owner, clock)
9393{
9494}
95   
95
9696//-------------------------------------------------
9797//  device_config_complete - perform any
9898//  operations now that the configuration is
r23623r23624
231231{
232232   return m_data;
233233}
234
235
trunk/src/emu/machine/tms6100.h
r23623r23624
1010public:
1111   tms6100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
1212   tms6100_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
13   
13
1414   DECLARE_WRITE_LINE_MEMBER( tms6100_m0_w );
1515   DECLARE_WRITE_LINE_MEMBER( tms6100_m1_w );
1616   DECLARE_WRITE_LINE_MEMBER( tms6100_romclock_w );
r23623r23624
3434   UINT8  m_tms_clock;
3535   UINT8  m_data;
3636   UINT8  m_state;
37   
38   const UINT8 *m_rom;   
3937
38   const UINT8 *m_rom;
39
4040};
4141
4242extern const device_type TMS6100;
trunk/src/emu/machine/z80dart.c
r23623r23624
2020
2121    TODO:
2222
23   - devcb2
24   - i8274 DMA scheme
23    - devcb2
24    - i8274 DMA scheme
2525    - break detection
2626    - wr0 reset tx interrupt pending
2727    - wait/ready
r23623r23624
494494   {
495495      m_rx_data_fifo[i] = 0;
496496      m_rx_error_fifo[i] = 0;
497   }   
497   }
498498}
499499
500500
r23623r23624
929929      LOG(("Z80DART \"%s\" Channel %c : Parity %s\n", m_owner->tag(), 'A' + m_index, (data & WR4_PARITY_EVEN) ? "Even" : "Odd"));
930930      LOG(("Z80DART \"%s\" Channel %c : Stop Bits %f\n", m_owner->tag(), 'A' + m_index, get_stop_bits()));
931931      LOG(("Z80DART \"%s\" Channel %c : Clock Mode %uX\n", m_owner->tag(), 'A' + m_index, get_clock_mode()));
932     
932
933933      update_serial();
934934      break;
935935
r23623r23624
12791279   {
12801280      if (m_wr[1] & WR4_PARITY_EVEN)
12811281         parity_code = SERIAL_PARITY_EVEN;
1282      else
1282      else
12831283         parity_code = SERIAL_PARITY_ODD;
12841284   }
12851285
trunk/src/emu/machine/z80dart.h
r23623r23624
360360
361361   enum
362362   {
363      WR2_DATA_XFER_INT        = 0x00, // not supported
364      WR2_DATA_XFER_DMA_INT     = 0x01, // not supported
365      WR2_DATA_XFER_DMA         = 0x02, // not supported
366      WR2_DATA_XFER_ILLEGAL     = 0x03, // not supported
367      WR2_DATA_XFER_MASK        = 0x03, // not supported
368      WR2_PRIORITY           = 0x04, // not supported
369      WR2_MODE_8085_1           = 0x00, // not supported
370      WR2_MODE_8085_2           = 0x08, // not supported
371      WR2_MODE_8086_8088         = 0x10, // not supported
372      WR2_MODE_ILLEGAL        = 0x18, // not supported
373      WR2_MODE_MASK           = 0x18, // not supported
374      WR2_VECTORED_INT        = 0x20, // not supported
363      WR2_DATA_XFER_INT         = 0x00, // not supported
364      WR2_DATA_XFER_DMA_INT     = 0x01, // not supported
365      WR2_DATA_XFER_DMA         = 0x02, // not supported
366      WR2_DATA_XFER_ILLEGAL     = 0x03, // not supported
367      WR2_DATA_XFER_MASK        = 0x03, // not supported
368      WR2_PRIORITY              = 0x04, // not supported
369      WR2_MODE_8085_1           = 0x00, // not supported
370      WR2_MODE_8085_2           = 0x08, // not supported
371      WR2_MODE_8086_8088        = 0x10, // not supported
372      WR2_MODE_ILLEGAL          = 0x18, // not supported
373      WR2_MODE_MASK             = 0x18, // not supported
374      WR2_VECTORED_INT          = 0x20, // not supported
375375      WR2_PIN10_SYNDETB_RTSB    = 0x80  // not supported
376376   };
377377
trunk/src/emu/machine/adc1038.h
r23623r23624
4747   virtual void device_config_complete();
4848   virtual void device_start();
4949   virtual void device_reset();
50   
50
5151   adc1038_input_read_func           m_input_callback_r_func;
5252
5353   private:
trunk/src/emu/machine/7200fifo.c
r23623r23624
4141   m_ef_handler.resolve();
4242   m_ff_handler.resolve();
4343   m_hf_handler.resolve();
44   
44
4545   // state save
4646   save_item(NAME(m_read_ptr));
4747   save_item(NAME(m_write_ptr));
r23623r23624
6060   memset(m_buffer, 0, m_ram_size * sizeof(UINT16));
6161   m_read_ptr = 0;
6262   m_write_ptr = 0;
63   
63
6464   m_ef = 1;
6565   m_ff = 0;
6666   m_hf = 0;
67   
67
6868   if (!m_ef_handler.isnull()) m_ef_handler(m_ef);
6969   if (!m_ff_handler.isnull()) m_ff_handler(m_ff);
7070   if (!m_hf_handler.isnull()) m_hf_handler(m_hf);
r23623r23624
8282
8383   m_buffer[m_write_ptr] = data & 0x1ff;
8484   m_write_ptr = (m_write_ptr + 1) % m_ram_size;
85   
85
8686   // update flags
8787   if (m_ef)
8888   {
r23623r23624
110110      logerror("IDT7200 %s fifo_read underflow!\n", tag());
111111      return 0x1ff;
112112   }
113   
113
114114   UINT16 ret = m_buffer[m_read_ptr];
115115   m_read_ptr = (m_read_ptr + 1) % m_ram_size;
116116
r23623r23624
126126      m_ef = 1;
127127      if (!m_ef_handler.isnull()) m_ef_handler(m_ef);
128128   }
129   
129
130130   else if (((m_read_ptr + m_ram_size / 2) % m_ram_size) == m_write_ptr)
131131   {
132132      m_hf = 0;
133133      if (!m_hf_handler.isnull()) m_hf_handler(m_hf);
134134   }
135   
135
136136   return ret;
137137}
trunk/src/emu/machine/mb14241.h
r23623r23624
1212{
1313public:
1414   mb14241_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
15   
15
1616   DECLARE_WRITE8_MEMBER ( shift_count_w );
1717   DECLARE_WRITE8_MEMBER ( shift_data_w );
1818   DECLARE_READ8_MEMBER( shift_result_r );
r23623r23624
2525
2626private:
2727   // internal state
28   
28
2929   UINT16 m_shift_data;  /* 15 bits only */
3030   UINT8 m_shift_count;  /* 3 bits */
3131};
trunk/src/emu/machine/7200fifo.h
r23623r23624
9393   DECLARE_READ_LINE_MEMBER( ef_r ) { return m_ef; }
9494   DECLARE_READ_LINE_MEMBER( ff_r ) { return m_ff; }
9595   DECLARE_READ_LINE_MEMBER( hf_r ) { return m_hf; }
96   
96
9797   // normal configuration
9898   DECLARE_WRITE16_MEMBER( data_word_w ) { fifo_write(data); }
9999   DECLARE_READ16_MEMBER( data_word_r ) { return (UINT16)fifo_read(); }
r23623r23624
113113
114114   UINT16* m_buffer;
115115   int m_ram_size;
116   
116
117117   int m_read_ptr;
118118   int m_write_ptr;
119   
119
120120   int m_ef; // empty flag
121121   int m_ff; // full flag
122122   int m_hf; // half-full flag
123   
123
124124   devcb2_write_line m_ef_handler;
125125   devcb2_write_line m_ff_handler;
126126   devcb2_write_line m_hf_handler;
trunk/src/emu/machine/idectrl.c
r23623r23624
9797      LOG(("IDE interrupt assert\n"));
9898   else
9999      LOG(("IDE interrupt clear\n"));
100   
100
101101   /* signal an interrupt */
102102   m_irq_handler(state);
103103   interrupt_pending = state;
r23623r23624
885885         break;
886886   }
887887
888//   printf( "read via config %04x %04x %04x\n", offset, result, mem_mask );
888//  printf( "read via config %04x %04x %04x\n", offset, result, mem_mask );
889889   return result;
890890}
891891
r23623r23624
10091009         break;
10101010   }
10111011
1012//   printf( "read cs0 %04x %04x %04x\n", offset, result, mem_mask );
1012//  printf( "read cs0 %04x %04x %04x\n", offset, result, mem_mask );
10131013
10141014   /* return the result */
10151015   return result;
r23623r23624
10711071         break;
10721072   }
10731073
1074//   printf( "read cs1 %04x %04x %04x\n", offset, result, mem_mask );
1074//  printf( "read cs1 %04x %04x %04x\n", offset, result, mem_mask );
10751075
10761076   /* return the result */
10771077   return result;
r23623r23624
10861086
10871087WRITE8_MEMBER( ide_controller_device::write_via_config )
10881088{
1089//   printf( "write via config %04x %04x %04x\n", offset, data, mem_mask );
1089//  printf( "write via config %04x %04x %04x\n", offset, data, mem_mask );
10901090
10911091   /* logit */
10921092   LOG(("%s:IDE via config write to %X = %08X, mem_mask=%d\n", machine().describe_context(), offset, data, mem_mask));
r23623r23624
11391139
11401140WRITE16_MEMBER( ide_controller_device::write_cs0 )
11411141{
1142//   printf( "write cs0 %04x %04x %04x\n", offset, data, mem_mask );
1142//  printf( "write cs0 %04x %04x %04x\n", offset, data, mem_mask );
11431143
11441144   switch (offset)
11451145   {
r23623r23624
12291229
12301230WRITE16_MEMBER( ide_controller_device::write_cs1 )
12311231{
1232//   printf( "write cs1 %04x %04x %04x\n", offset, data, mem_mask );
1232//  printf( "write cs1 %04x %04x %04x\n", offset, data, mem_mask );
12331233
12341234   /* logit */
12351235   LOG(("%s:IDE cs1 write to %X = %08X, mem_mask=%d\n", machine().describe_context(), offset, data, mem_mask));
trunk/src/emu/machine/idectrl.h
r23623r23624
100100   DECLARE_READ16_MEMBER(read_cs1_pc);
101101   DECLARE_WRITE16_MEMBER(write_cs0_pc);
102102   DECLARE_WRITE16_MEMBER(write_cs1_pc);
103   
103
104104   virtual void set_irq(int state);
105105   virtual void set_dmarq(int state);
106106   void read_sector_done();
trunk/src/emu/machine/rf5c296.c
r23623r23624
8989   case 0x3e1:
9090      data = reg_r(m_rf5c296_reg);
9191      break;
92     
92
9393   default:
9494      data = m_pccard->read_memory(space, offset, mem_mask);
9595      break;
trunk/src/emu/machine/generic.c
r23623r23624
301301   running_machine &machine = device.machine();
302302
303303   // start with either basename or basename_biosnum
304   result.cpy(machine.basename());   
304   result.cpy(machine.basename());
305305   if (device.machine().root_device().system_bios() != 0 && device.machine().root_device().default_bios() != device.machine().root_device().system_bios())
306306      result.catprintf("_%d", device.machine().root_device().system_bios() - 1);
307307
trunk/src/emu/machine/rp5h01.c
r23623r23624
33    RP5H01
44
55    TODO:
6    - follow the datasheet better (all dumps presumably needs to be redone
7     from scratch?)
6    - follow the datasheet better (all dumps presumably needs to be redone
7      from scratch?)
88
99***************************************************************************/
1010
r23623r23624
187187   /* return the data */
188188   return (m_data[byte] >> bit) & 1;
189189}
190
191
trunk/src/emu/machine/rp5h01.h
r23623r23624
2727{
2828public:
2929   rp5h01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
30   
30
3131   DECLARE_WRITE8_MEMBER( enable_w );   /* /CE */
3232   DECLARE_WRITE8_MEMBER( reset_w );    /* RESET */
3333   DECLARE_WRITE8_MEMBER( cs_w );   /* CS */
trunk/src/emu/machine/serflash.c
r23623r23624
4646{
4747   m_flash_enab = 0;
4848   flash_hard_reset(machine());
49   
49
5050   m_last_flash_cmd = 0x00;
5151   m_flash_addr_seq = 0;
5252   m_flash_addr = 0;
r23623r23624
6161
6262void serflash_device::nvram_default()
6363{
64
6564}
6665
6766
r23623r23624
9897
9998void serflash_device::nvram_write(emu_file &file)
10099{
101
102100   if (m_length % FLASH_PAGE_SIZE) return; // region size must be multiple of flash page size
103101   int size = m_length /= FLASH_PAGE_SIZE;
104102
r23623r23624
167165
168166      switch (data)
169167      {
170         case 0x00:   // READ
168         case 0x00:  // READ
171169            m_flash_addr_seq = 0;
172170            break;
173171
r23623r23624
175173            m_flash_addr_seq = 0;
176174            break;
177175
178         case 0x70:   // READ STATUS
176         case 0x70:  // READ STATUS
179177            flash_change_state( space.machine(), STATE_READ_STATUS );
180178            break;
181179
182         case 0x80:   // PAGE / CACHE PROGRAM
180         case 0x80:  // PAGE / CACHE PROGRAM
183181            m_flash_addr_seq = 0;
184182            // this actually seems to be set with the next 2 writes?
185183            m_flash_page_addr = 0;
186184            break;
187185
188         case 0x90:   // READ ID
186         case 0x90:  // READ ID
189187            flash_change_state( space.machine(), STATE_READ_ID );
190188            break;
191189
192         case 0xff:   // RESET
190         case 0xff:  // RESET
193191            flash_change_state( space.machine(), STATE_IDLE );
194192            break;
195193
r23623r23624
203201   {
204202      switch (m_flash_cmd_prev)
205203      {
206         case 0x00:   // READ
204         case 0x00:  // READ
207205            if (data == 0x30)
208206            {
209
210
211207               memcpy(m_flash_page_data, m_region + m_flash_row * FLASH_PAGE_SIZE, FLASH_PAGE_SIZE);
212208               m_flash_page_addr = m_flash_col;
213209               m_flash_page_index = m_flash_row;
r23623r23624
306302         switch( m_flash_read_seq++ )
307303         {
308304            case 0:
309               data = 0xEC;   // Manufacturer
305               data = 0xEC;    // Manufacturer
310306               break;
311307            case 1:
312               data = 0xF1;   // Device
308               data = 0xF1;    // Device
313309               break;
314310            case 2:
315               data = 0x00;   // XX
311               data = 0x00;    // XX
316312               break;
317313            case 3:
318               data = 0x15;   // Flags
314               data = 0x15;    // Flags
319315               m_flash_read_seq = 0;
320316               break;
321317         }
r23623r23624
342338
343339      default:
344340      {
345      //   logerror("%08x FLASH: unknown read in state %s\n",0x00/*m_maincpu->pc()*/, m_flash_state_name[m_flash_state]);
341      //  logerror("%08x FLASH: unknown read in state %s\n",0x00/*m_maincpu->pc()*/, m_flash_state_name[m_flash_state]);
346342      }
347343   }
348344
r23623r23624
412408      logerror("set flash block to %08x\n", m_flash_addr);
413409   }
414410}
415
trunk/src/emu/machine/serflash.h
r23623r23624
66#define __SERFLASH_H__
77
88
9#define FLASH_PAGE_SIZE   (2048+64)
9#define FLASH_PAGE_SIZE (2048+64)
1010
1111
1212
r23623r23624
1818//**************************************************************************
1919
2020#define MCFG_SERFLASH_ADD(_tag) \
21   MCFG_DEVICE_ADD(_tag, SERFLASH, 0) \
22
21   MCFG_DEVICE_ADD(_tag, SERFLASH, 0)
2322//**************************************************************************
2423//  TYPE DEFINITIONS
2524//**************************************************************************
2625
2726class serflash_device;
2827
29typedef enum                     { STATE_IDLE = 0,   STATE_READ,      STATE_READ_ID,   STATE_READ_STATUS, STATE_BLOCK_ERASE, STATE_PAGE_PROGRAM   } flash_state_t;
30//const char *m_flash_state_name[] =   { "IDLE",         "READ",         "READ_ID",      "READ_STATUS",     "BLOCK ERASE",     "PAGE PROGRAM"      };
28typedef enum                            { STATE_IDLE = 0,   STATE_READ,     STATE_READ_ID,  STATE_READ_STATUS, STATE_BLOCK_ERASE, STATE_PAGE_PROGRAM    } flash_state_t;
29//const char *m_flash_state_name[] =    { "IDLE",           "READ",         "READ_ID",      "READ_STATUS",     "BLOCK ERASE",     "PAGE PROGRAM"        };
3130
3231// custom initialization for default state
3332typedef device_delegate<void (serflash_device &, void *, size_t)> serflash_init_delegate;
r23623r23624
105104
106105
107106#endif
108
trunk/src/emu/machine/ay31015.c
r23623r23624
122122   const ay31015_config *intf = reinterpret_cast<const ay31015_config *>(static_config());
123123   if (intf != NULL)
124124      *static_cast<ay31015_config *>(this) = *intf;
125   
125
126126   // or initialize to defaults if none provided
127127   else
128128   {
r23623r23624
143143   m_read_si.resolve(read_si_cb, *this);
144144   m_write_so.resolve(write_so_cb, *this);
145145   m_status_changed.resolve(status_changed_cb, *this);
146   
146
147147   m_tx_clock = transmitter_clock;
148148   m_rx_clock = receiver_clock;
149   
149
150150   m_rx_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ay31015_device::rx_process),this));
151151   m_tx_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ay31015_device::tx_process),this));
152   
152
153153   update_rx_timer();
154154   update_tx_timer();
155155
r23623r23624
184184{
185185   m_control_reg = 0;
186186   m_rx_data = 0;
187   
187
188188   internal_reset();
189189}
190190
r23623r23624
566566{
567567   /* total pulses = 16 * data-bits */
568568   UINT8 t1;
569   
569
570570   if (m_control_reg & CONTROL_NB2)
571571      t1 = (m_control_reg & CONTROL_NB1) ? 8 : 7;
572572   else
573573      t1 = (m_control_reg & CONTROL_NB1) ? 6 : 5;
574   
574
575575   m_total_pulses = t1 << 4;                    /* total clock pulses to load a byte */
576576   m_second_stop_bit = ((m_control_reg & CONTROL_TSB) ? 16 : 0);     /* 2nd stop bit */
577577   if ((t1 == 5) && (m_second_stop_bit == 16))
r23623r23624
730730      update_status_pins();
731731   }
732732}
733
trunk/src/emu/machine/ay31015.h
r23623r23624
7474   ay31015_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
7575   ~ay31015_device() {}
7676
77   
77
7878   /* Set an input pin */
7979   void set_input_pin( ay31015_input_pin_t pin, int data );
80   
81   
80
81
8282   /* Get an output pin */
8383   int get_output_pin( ay31015_output_pin_t pin );
84   
85   
84
85
8686   /* Set a new transmitter clock (new_clock is in Hz) */
8787   void set_transmitter_clock( double new_clock );
88   
89   
88
89
9090   /* Set a new receiver clock (new_clock is in Hz) */
9191   void set_receiver_clock( double new_clock );
92   
93   
92
93
9494   /* Reead the received data */
9595   /* The received data is available on RD8-RD1 (pins 5-12) */
9696   UINT8 get_received_data();
97   
98   
97
98
9999   /* Set the transmitter buffer */
100100   /* The data to transmit is set on DB1-DB8 (pins 26-33) */
101101   void set_transmit_data( UINT8 data );
102   
102
103103protected:
104104   // device-level overrides
105105   virtual void device_config_complete();
r23623r23624
120120   TIMER_CALLBACK_MEMBER(tx_process);
121121
122122   int m_pins[41];
123   
123
124124   UINT8 m_control_reg;
125125   UINT8 m_status_reg;
126126   UINT16 m_second_stop_bit; // 0, 8, 16
127127   UINT16 m_total_pulses;    // bits * 16
128128   UINT8 m_internal_sample;
129   
129
130130   state_t m_rx_state;
131131   UINT8 m_rx_data;      // byte being received
132132   UINT8 m_rx_buffer;    // received byte waiting to be accepted by computer
r23623r23624
135135   UINT16 m_rx_pulses;   // total pulses left
136136   double m_rx_clock;
137137   emu_timer *m_rx_timer;
138   
138
139139   state_t m_tx_state;
140140   UINT8 m_tx_data;      // byte being sent
141141   UINT8 m_tx_buffer;    // next byte to send
r23623r23624
143143   UINT16 m_tx_pulses;   // total pulses left
144144   double m_tx_clock;
145145   emu_timer *m_tx_timer;
146   
146
147147   devcb_resolved_read8    m_read_si;                /* SI - pin 20 - This will be called whenever the SI pin is sampled. Optional */
148148   devcb_resolved_write8   m_write_so;               /* SO - pin 25 - This will be called whenever data is put on the SO pin. Optional */
149149   devcb_resolved_write8   m_status_changed;         /* This will be called whenever one of the status pins may have changed. Optional */
r23623r23624
153153{
154154public:
155155   ay51013_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
156   
156
157157protected:
158158   virtual void internal_reset();
159159
160160};
161161
162extern const device_type AY31015;   // For AY-3-1014A, AY-3-1015(D) and HD6402 variants
163extern const device_type AY51013;   // For AY-3-1014, AY-5-1013 and AY-6-1013 variants
162extern const device_type AY31015;   // For AY-3-1014A, AY-3-1015(D) and HD6402 variants
163extern const device_type AY51013;   // For AY-3-1014, AY-5-1013 and AY-6-1013 variants
164164
165165
166166
trunk/src/emu/machine/mm58274c.c
r23623r23624
9999   save_item(NAME(m_minutes2));
100100   save_item(NAME(m_seconds1));
101101   save_item(NAME(m_seconds2));
102   save_item(NAME(m_tenths));   
102   save_item(NAME(m_tenths));
103103}
104104
105105//-------------------------------------------------
r23623r23624
109109void mm58274c_device::device_reset()
110110{
111111   system_time systime;
112   
112
113113   /* get the current date/time from the core */
114114   machine().current_datetime(systime);
115   
115
116116   m_clk_set = systime.local_time.year & 3 << 2;
117117   if (m_mode24)
118118      m_clk_set |= clk_set_24;
119   
119
120120   /* The clock count starts on 1st January 1900 */
121121   m_wday = 1 + ((systime.local_time.weekday - m_day1) % 7);
122122   m_years1 = (systime.local_time.year / 10) % 10;
r23623r23624
175175         reply = m_status;
176176         m_status = 0;
177177         break;
178         
178
179179      case 0x01:   /* Tenths of Seconds */
180180         reply = m_tenths;
181181         break;
182         
182
183183      case 0x02:   /* Units Seconds */
184184         reply = m_seconds2;
185185         break;
186         
186
187187      case 0x03:   /* Tens Seconds */
188188         reply = m_seconds1;
189189         break;
190         
190
191191      case 0x04:  /* Units Minutes */
192192         reply = m_minutes2;
193193         break;
194         
194
195195      case 0x05:   /* Tens Minutes */
196196         reply = m_minutes1;
197197         break;
198         
198
199199      case 0x06:   /* Units Hours */
200200         reply = m_hours2;
201201         break;
202         
202
203203      case 0x07:   /* Tens Hours */
204204         reply = m_hours1;
205205         break;
206         
206
207207      case 0x08:   /* Units Days */
208208         reply = m_days2;
209209         break;
210         
210
211211      case 0x09:   /* Tens Days */
212212         reply = m_days1;
213213         break;
214         
214
215215      case 0x0a:   /* Units Months */
216216         reply = m_months2;
217217         break;
218         
218
219219      case 0x0b:   /* Tens Months */
220220         reply = m_months1;
221221         break;
222         
222
223223      case 0x0c:   /* Units Years */
224224         reply = m_years2;
225225         break;
226         
226
227227      case 0x0d:   /* Tens Years */
228228         reply = m_years1;
229229         break;
230         
230
231231      case 0x0e:   /* Day of Week */
232232         reply = m_wday;
233233         break;
234         
234
235235      case 0x0f:   /* Clock Setting & Interrupt Registers */
236         if (m_control & ctl_intsel)   /* interrupt register */
236         if (m_control & ctl_intsel) /* interrupt register */
237237            reply = m_int_ctl;
238         else   /* clock setting register */
238         else    /* clock setting register */
239239         {
240            if (m_clk_set & clk_set_24)   /* 24-hour mode */
240            if (m_clk_set & clk_set_24) /* 24-hour mode */
241241               reply = m_clk_set & ~clk_set_pm;
242            else   /* 12-hour mode */
242            else    /* 12-hour mode */
243243               reply = m_clk_set;
244244         }
245245         break;
246         
246
247247      default:
248248         reply = 0;
249249         break;
r23623r23624
261261   switch (offset)
262262   {
263263      case 0x00:   /* Control Register (test mode and interrupt not emulated) */
264         if ((!(m_control & ctl_intstop)) && (data & ctl_intstop))   /* interrupt stop */
264         if ((!(m_control & ctl_intstop)) && (data & ctl_intstop))   /* interrupt stop */
265265            m_interrupt_timer->enable(0);
266         else if ((m_control & ctl_intstop) && (!(data & ctl_intstop)))   /* interrupt run */
266         else if ((m_control & ctl_intstop) && (!(data & ctl_intstop)))  /* interrupt run */
267267         {
268268            attotime period = interrupt_period_table(m_int_ctl & int_ctl_dly);
269           
269
270270            m_interrupt_timer->adjust(period, 0, m_int_ctl & int_ctl_rpt ? period : attotime::zero);
271271         }
272         if (data & ctl_clkstop)   /* stopping the clock clears the tenth counter */
272         if (data & ctl_clkstop) /* stopping the clock clears the tenth counter */
273273            m_tenths = 0;
274274         m_control = data;
275275         break;
276         
276
277277      case 0x01:   /* Tenths of Seconds: cannot be written */
278278         break;
279         
279
280280      case 0x02:   /* Units Seconds */
281281         m_seconds2 = data;
282282         break;
283         
283
284284      case 0x03:   /* Tens Seconds */
285285         m_seconds1 = data;
286286         break;
287         
287
288288      case 0x04:   /* Units Minutes */
289289         m_minutes2 = data;
290290         break;
291         
291
292292      case 0x05:   /* Tens Minutes */
293293         m_minutes1 = data;
294294         break;
295         
295
296296      case 0x06:   /* Units Hours */
297297         m_hours2 = data;
298298         break;
299         
299
300300      case 0x07:   /* Tens Hours */
301301         m_hours1 = data;
302302         break;
303         
303
304304      case 0x08:   /* Units Days */
305305         m_days2 = data;
306306         break;
307         
307
308308      case 0x09:   /* Tens Days */
309309         m_days1 = data;
310310         break;
311         
311
312312      case 0x0a:   /* Units Months */
313313         m_months2 = data;
314314         break;
315         
315
316316      case 0x0b:   /* Tens Months */
317317         m_months1 = data;
318318         break;
319         
319
320320      case 0x0c:   /* Units Years */
321321         m_years2 = data;
322322         break;
323         
323
324324      case 0x0d:   /* Tens Years */
325325         m_years1 = data;
326326         break;
327         
327
328328      case 0x0e:   /* Day of Week */
329329         m_wday = data;
330330         break;
331         
331
332332      case 0x0f:   /* Clock Setting & Interrupt Registers */
333         if (m_control & ctl_intsel)   /* interrupt register (not emulated) */
333         if (m_control & ctl_intsel) /* interrupt register (not emulated) */
334334         {
335335            m_int_ctl = data;
336            if (!(m_control & ctl_intstop))   /* interrupt run */
336            if (!(m_control & ctl_intstop)) /* interrupt run */
337337            {
338338               attotime period = interrupt_period_table(m_int_ctl & int_ctl_dly);
339               
339
340340               m_interrupt_timer->adjust(period, 0, m_int_ctl & int_ctl_rpt ? period : attotime::zero);
341341            }
342342         }
343         else   /* clock setting register */
343         else    /* clock setting register */
344344         {
345345            m_clk_set = data;
346346#if 0
347            if (m_clk_set & clk_set_24)   /* 24-hour mode */
347            if (m_clk_set & clk_set_24) /* 24-hour mode */
348348               m_clk_set &= ~clk_set_pm;
349349#endif
350350         }
r23623r23624
482482      }
483483   }
484484}
485
trunk/src/emu/machine/mm58274c.h
r23623r23624
2626public:
2727   mm58274c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
2828   ~mm58274c_device() {}
29   
29
3030   DECLARE_READ8_MEMBER(read);
3131   DECLARE_WRITE8_MEMBER(write);
3232
r23623r23624
4242private:
4343   // internal state
4444   attotime interrupt_period_table(int val);
45   
45
4646   int m_status;     /* status register (*read* from address 0 = control register) */
4747   int m_control;    /* control register (*write* to address 0) */
48   
48
4949   int m_clk_set;    /* clock setting register */
5050   int m_int_ctl;    /* interrupt control register */
51   
52   
51
52
5353   int m_wday;       /* day of the week (1-7 (1=day1 as set in init)) */
5454   int m_years1;     /* years (BCD: 0-99) */
5555   int m_years2;
r23623r23624
6464   int m_seconds1;   /* seconds (BCD : 0-59) */
6565   int m_seconds2;
6666   int m_tenths;     /* tenths of second (BCD : 0-9) */
67   
67
6868   emu_timer *m_increment_rtc;
6969   emu_timer *m_interrupt_timer;
7070};
trunk/src/emu/machine/com8116.c
r23623r23624
4848
4949com8116_device::com8116_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
5050   : device_t(mconfig, COM8116, "COM8116", tag, owner, clock),
51     m_write_fx4(*this),
52     m_write_fr(*this),
53     m_write_ft(*this)
51      m_write_fx4(*this),
52      m_write_fr(*this),
53      m_write_ft(*this)
5454{
5555}
5656
trunk/src/emu/machine/im6402.c
r23623r23624
278278   }
279279   else
280280   {
281      set_tbre(CLEAR_LINE);     
281      set_tbre(CLEAR_LINE);
282282   }
283283}
284284
trunk/src/emu/debug/dvbpoints.c
r23623r23624
22
33    dvpoints.c
44
5   Breakpoint debugger view.
5    Breakpoint debugger view.
66
77****************************************************************************
88
r23623r23624
131131
132132void debug_view_breakpoints::pad_astring_to_length(astring& str, int len)
133133{
134    int diff = len - str.len();
135    if (diff > 0)
136    {
137        astring buffer;
138        buffer.expand(diff);
139        for (int i = 0; i < diff; i++)
140            buffer.catprintf(" ");
141        str.catprintf("%s", buffer.cstr());
142    }
134   int diff = len - str.len();
135   if (diff > 0)
136   {
137      astring buffer;
138      buffer.expand(diff);
139      for (int i = 0; i < diff; i++)
140         buffer.catprintf(" ");
141      str.catprintf("%s", buffer.cstr());
142   }
143143}
144144
145145//-------------------------------------------------
r23623r23624
162162      for (device_debug::breakpoint *bp = debugInterface.breakpoint_first(); bp != NULL; bp = bp->next())
163163         numBPs++;
164164      bpList = new device_debug::breakpoint*[numBPs];
165     
165
166166      // Collect
167167      int i = 1;
168168      for (device_debug::breakpoint *bp = debugInterface.breakpoint_first(); bp != NULL; bp = bp->next())
r23623r23624
176176   for (int row = 0; row < m_visible.y; row++)
177177   {
178178      UINT32 effrow = m_topleft.y + row;
179     
179
180180      // Header
181181      if (effrow == 0)
182182      {
r23623r23624
195195      if (bpi < numBPs && bpi >= 0)
196196      {
197197         device_debug::breakpoint* bp = bpList[bpi];
198         
199          astring buffer;
198
199         astring buffer;
200200         buffer.printf("%x", bp->index());
201201         pad_astring_to_length(buffer, 5);
202202         buffer.catprintf("%c", bp->enabled() ? 'X' : 'O');
r23623r23624
213213            buffer.catprintf("%s", bp->action());
214214            pad_astring_to_length(buffer, 60);
215215         }
216         
216
217217         for (int i = 0; i < m_visible.x; i++)
218218         {
219219            dest->byte = (i < buffer.len()) ? buffer[i] : ' ';
r23623r23624
222222         }
223223         continue;
224224      }
225     
225
226226      // Fill the remaining vertical space
227227      for (int i = 0; i < m_visible.x; i++)
228228      {
r23623r23624
231231         dest++;
232232      }
233233   }
234   
234
235235   delete bpList;
236236}
trunk/src/emu/debug/dvbpoints.h
r23623r23624
22
33    dvpoints.h
44
5   Breakpoint debugger view.
5    Breakpoint debugger view.
66
77****************************************************************************
88
r23623r23624
7777   // internal helpers
7878   void enumerate_sources();
7979   bool recompute(offs_t pc, int startline, int lines);
80    void pad_astring_to_length(astring& str, int len);
80   void pad_astring_to_length(astring& str, int len);
8181
8282   // internal state
8383};
trunk/src/emu/cpu/rsp/rsp.h
r23623r23624
1616#ifndef __RSP_H__
1717#define __RSP_H__
1818
19#define USE_SIMD      (0)
19#define USE_SIMD        (0)
2020
2121#if USE_SIMD
2222#include <tmmintrin.h>
trunk/src/emu/video/cdp1861.c
r23623r23624
4141
4242cdp1861_device::cdp1861_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
4343   : device_t(mconfig, CDP1861, "CDP1861", tag, owner, clock),
44     m_write_irq(*this),
45     m_write_dma_out(*this),
46     m_write_efx(*this)
44      m_write_irq(*this),
45      m_write_dma_out(*this),
46      m_write_efx(*this)
4747{
4848}
4949
trunk/src/emu/video/video.mak
r23623r23624
1515
1616
1717#-------------------------------------------------
18#
18#
1919#-------------------------------------------------
2020
2121ifneq ($(filter SEGA315_5124,$(VIDEOS)),)
22VIDEOOBJS+= $(VIDEOOBJ)/315_5124.o
22VIDEOOBJS+= $(VIDEOOBJ)/315_5124.o
2323endif
2424
2525#-------------------------------------------------
26#
26#
2727#-------------------------------------------------
2828
2929ifneq ($(filter BUFSPRITE,$(VIDEOS)),)
r23623r23624
3131endif
3232
3333#-------------------------------------------------
34#
34#
3535#-------------------------------------------------
3636
3737ifneq ($(filter CDP1861,$(VIDEOS)),)
38VIDEOOBJS+= $(VIDEOOBJ)/cdp1861.o 
38VIDEOOBJS+= $(VIDEOOBJ)/cdp1861.o
3939endif
4040
4141#-------------------------------------------------
42#
42#
4343#-------------------------------------------------
4444
4545ifneq ($(filter CDP1862,$(VIDEOS)),)
46VIDEOOBJS+= $(VIDEOOBJ)/cdp1862.o 
46VIDEOOBJS+= $(VIDEOOBJ)/cdp1862.o
4747endif
4848
4949#-------------------------------------------------
50#
50#
5151#-------------------------------------------------
5252
5353ifneq ($(filter CRT9007,$(VIDEOS)),)
54VIDEOOBJS+= $(VIDEOOBJ)/crt9007.o 
54VIDEOOBJS+= $(VIDEOOBJ)/crt9007.o
5555endif
5656
5757#-------------------------------------------------
58#
58#
5959#-------------------------------------------------
6060
6161ifneq ($(filter CRT9021,$(VIDEOS)),)
62VIDEOOBJS+= $(VIDEOOBJ)/crt9021.o 
62VIDEOOBJS+= $(VIDEOOBJ)/crt9021.o
6363endif
6464
6565#-------------------------------------------------
66#
66#
6767#-------------------------------------------------
6868
6969ifneq ($(filter CRT9212,$(VIDEOS)),)
70VIDEOOBJS+= $(VIDEOOBJ)/crt9212.o 
70VIDEOOBJS+= $(VIDEOOBJ)/crt9212.o
7171endif
7272
7373#-------------------------------------------------
74#
74#
7575#-------------------------------------------------
7676
7777ifneq ($(filter DL1416,$(VIDEOS)),)
r23623r23624
7979endif
8080
8181#-------------------------------------------------
82#
82#
8383#-------------------------------------------------
8484
8585ifneq ($(filter DM9368,$(VIDEOS)),)
r23623r23624
8787endif
8888
8989#-------------------------------------------------
90#
90#
9191#-------------------------------------------------
9292
9393ifneq ($(filter EF9340_1,$(VIDEOS)),)
94VIDEOOBJS+= $(VIDEOOBJ)/ef9340_1.o
94VIDEOOBJS+= $(VIDEOOBJ)/ef9340_1.o
9595endif
9696
9797#-------------------------------------------------
98#
98#
9999#-------------------------------------------------
100100
101101ifneq ($(filter H63484,$(VIDEOS)),)
102VIDEOOBJS+= $(VIDEOOBJ)/h63484.o   
102VIDEOOBJS+= $(VIDEOOBJ)/h63484.o
103103endif
104104
105105#-------------------------------------------------
106#
106#
107107#-------------------------------------------------
108108
109109ifneq ($(filter HD44102,$(VIDEOS)),)
110VIDEOOBJS+= $(VIDEOOBJ)/hd44102.o 
110VIDEOOBJS+= $(VIDEOOBJ)/hd44102.o
111111endif
112112
113113#-------------------------------------------------
114#
114#
115115#-------------------------------------------------
116116
117117ifneq ($(filter HD44352,$(VIDEOS)),)
118VIDEOOBJS+= $(VIDEOOBJ)/hd44352.o 
118VIDEOOBJS+= $(VIDEOOBJ)/hd44352.o
119119endif
120120
121121#-------------------------------------------------
122#
122#
123123#-------------------------------------------------
124124
125125ifneq ($(filter HD44780,$(VIDEOS)),)
126VIDEOOBJS+= $(VIDEOOBJ)/hd44780.o 
126VIDEOOBJS+= $(VIDEOOBJ)/hd44780.o
127127endif
128128
129129#-------------------------------------------------
130#
130#
131131#-------------------------------------------------
132132
133133ifneq ($(filter HD61830,$(VIDEOS)),)
134VIDEOOBJS+= $(VIDEOOBJ)/hd61830.o 
134VIDEOOBJS+= $(VIDEOOBJ)/hd61830.o
135135endif
136136
137137#-------------------------------------------------
138#
138#
139139#-------------------------------------------------
140140
141141ifneq ($(filter HD63484,$(VIDEOS)),)
142VIDEOOBJS+= $(VIDEOOBJ)/hd63484.o 
142VIDEOOBJS+= $(VIDEOOBJ)/hd63484.o
143143endif
144144
145145#-------------------------------------------------
146#
146#
147147#-------------------------------------------------
148148
149149ifneq ($(filter HD66421,$(VIDEOS)),)
150VIDEOOBJS+= $(VIDEOOBJ)/hd66421.o 
150VIDEOOBJS+= $(VIDEOOBJ)/hd66421.o
151151endif
152152
153153#-------------------------------------------------
154#
154#
155155#-------------------------------------------------
156156
157157ifneq ($(filter HUC6202,$(VIDEOS)),)
158VIDEOOBJS+= $(VIDEOOBJ)/huc6202.o 
158VIDEOOBJS+= $(VIDEOOBJ)/huc6202.o
159159endif
160160
161161#-------------------------------------------------
162#
162#
163163#-------------------------------------------------
164164
165165ifneq ($(filter HUC6260,$(VIDEOS)),)
166VIDEOOBJS+= $(VIDEOOBJ)/huc6260.o 
166VIDEOOBJS+= $(VIDEOOBJ)/huc6260.o
167167endif
168168
169169#-------------------------------------------------
170#
170#
171171#-------------------------------------------------
172172
173173ifneq ($(filter HUC6261,$(VIDEOS)),)
174VIDEOOBJS+= $(VIDEOOBJ)/huc6261.o 
174VIDEOOBJS+= $(VIDEOOBJ)/huc6261.o
175175endif
176176
177177#-------------------------------------------------
178#
178#
179179#-------------------------------------------------
180180
181181ifneq ($(filter HUC6270,$(VIDEOS)),)
182VIDEOOBJS+= $(VIDEOOBJ)/huc6270.o 
182VIDEOOBJS+= $(VIDEOOBJ)/huc6270.o
183183endif
184184
185185#-------------------------------------------------
186#
186#
187187#-------------------------------------------------
188188
189189ifneq ($(filter HUC6272,$(VIDEOS)),)
190VIDEOOBJS+= $(VIDEOOBJ)/huc6272.o 
190VIDEOOBJS+= $(VIDEOOBJ)/huc6272.o
191191endif
192192
193193#-------------------------------------------------
194#
194#
195195#-------------------------------------------------
196196
197197ifneq ($(filter I8244,$(VIDEOS)),)
198VIDEOOBJS+= $(VIDEOOBJ)/i8244.o   
198VIDEOOBJS+= $(VIDEOOBJ)/i8244.o
199199endif
200200
201201#-------------------------------------------------
202#
202#
203203#-------------------------------------------------
204204
205205ifneq ($(filter I8275,$(VIDEOS)),)
206206VIDEOOBJS+= $(VIDEOOBJ)/i8275.o         \
207         $(VIDEOOBJ)/i8275x.o
207         $(VIDEOOBJ)/i8275x.o
208208endif
209209
210210#-------------------------------------------------
211#
211#
212212#-------------------------------------------------
213213
214ifneq ($(filter K053250,$(VIDEOS)),)         
214ifneq ($(filter K053250,$(VIDEOS)),)
215215VIDEOOBJS+= $(VIDEOOBJ)/k053250.o
216216endif
217217
218218#-------------------------------------------------
219#
219#
220220#-------------------------------------------------
221221
222222ifneq ($(filter M50458,$(VIDEOS)),)
223VIDEOOBJS+= $(VIDEOOBJ)/m50458.o   
223VIDEOOBJS+= $(VIDEOOBJ)/m50458.o
224224endif
225225
226226#-------------------------------------------------
227#
227#
228228#-------------------------------------------------
229229
230230ifneq ($(filter MB90082,$(VIDEOS)),)
231VIDEOOBJS+= $(VIDEOOBJ)/mb90082.o 
231VIDEOOBJS+= $(VIDEOOBJ)/mb90082.o
232232endif
233233
234234#-------------------------------------------------
235#
235#
236236#-------------------------------------------------
237237
238238ifneq ($(filter MC6845,$(VIDEOS)),)
239VIDEOOBJS+= $(VIDEOOBJ)/mc6845.o   
239VIDEOOBJS+= $(VIDEOOBJ)/mc6845.o
240240endif
241241
242242#-------------------------------------------------
243#
243#
244244#-------------------------------------------------
245245
246246ifneq ($(filter MC6847,$(VIDEOS)),)
247VIDEOOBJS+= $(VIDEOOBJ)/mc6847.o   
247VIDEOOBJS+= $(VIDEOOBJ)/mc6847.o
248248endif
249249
250250#-------------------------------------------------
251#
251#
252252#-------------------------------------------------
253253
254254ifneq ($(filter MSM6255,$(VIDEOS)),)
255VIDEOOBJS+= $(VIDEOOBJ)/msm6255.o 
255VIDEOOBJS+= $(VIDEOOBJ)/msm6255.o
256256endif
257257
258258#-------------------------------------------------
259#
259#
260260#-------------------------------------------------
261261
262262ifneq ($(filter PC_CGA,$(VIDEOS)),)
263263VIDEOOBJS+= $(VIDEOOBJ)/pc_cga.o        \
264         $(VIDEOOBJ)/cgapal.o
264         $(VIDEOOBJ)/cgapal.o
265265endif
266266
267267#-------------------------------------------------
268#
268#
269269#-------------------------------------------------
270270
271ifneq ($(filter PC_VGA,$(VIDEOS)),)         
272VIDEOOBJS+= $(VIDEOOBJ)/pc_vga.o   
271ifneq ($(filter PC_VGA,$(VIDEOS)),)
272VIDEOOBJS+= $(VIDEOOBJ)/pc_vga.o
273273endif
274274
275275#-------------------------------------------------
276#
276#
277277#-------------------------------------------------
278278
279279ifneq ($(filter POLY,$(VIDEOS)),)
280VIDEOOBJS+= $(VIDEOOBJ)/poly.o
280VIDEOOBJS+= $(VIDEOOBJ)/poly.o
281281endif
282282
283283#-------------------------------------------------
284#
284#
285285#-------------------------------------------------
286286
287287ifneq ($(filter PSX,$(VIDEOS)),)
288VIDEOOBJS+= $(VIDEOOBJ)/psx.o
288VIDEOOBJS+= $(VIDEOOBJ)/psx.o
289289endif
290290
291291#-------------------------------------------------
292#
292#
293293#-------------------------------------------------
294294
295295ifneq ($(filter RAMDAC,$(VIDEOS)),)
296VIDEOOBJS+= $(VIDEOOBJ)/ramdac.o
296VIDEOOBJS+= $(VIDEOOBJ)/ramdac.o
297297endif
298298
299299#-------------------------------------------------
300#
300#
301301#-------------------------------------------------
302302
303303ifneq ($(filter S2636,$(VIDEOS)),)
304VIDEOOBJS+= $(VIDEOOBJ)/s2636.o
304VIDEOOBJS+= $(VIDEOOBJ)/s2636.o
305305endif
306306
307307#-------------------------------------------------
308#
308#
309309#-------------------------------------------------
310310
311311ifneq ($(filter SAA5050,$(VIDEOS)),)
r23623r23624
313313endif
314314
315315#-------------------------------------------------
316#
316#
317317#-------------------------------------------------
318318ifneq ($(filter SED1330,$(VIDEOS)),)
319319VIDEOOBJS+= $(VIDEOOBJ)/sed1330.o
320320endif
321321
322322#-------------------------------------------------
323#
323#
324324#-------------------------------------------------
325325
326326ifneq ($(filter STVVDP,$(VIDEOS)),)
r23623r23624
329329endif
330330
331331#-------------------------------------------------
332#
332#
333333#-------------------------------------------------
334334
335335ifneq ($(filter TLC34076,$(VIDEOS)),)
336VIDEOOBJS+= $(VIDEOOBJ)/tlc34076.o
336VIDEOOBJS+= $(VIDEOOBJ)/tlc34076.o
337337endif
338338
339339#-------------------------------------------------
340#
340#
341341#-------------------------------------------------
342342
343343ifneq ($(filter TMS34061,$(VIDEOS)),)
344VIDEOOBJS+= $(VIDEOOBJ)/tms34061.o
344VIDEOOBJS+= $(VIDEOOBJ)/tms34061.o
345345endif
346346
347347#-------------------------------------------------
348#
348#
349349#-------------------------------------------------
350350
351351ifneq ($(filter TMS3556,$(VIDEOS)),)
352VIDEOOBJS+= $(VIDEOOBJ)/tms3556.o
352VIDEOOBJS+= $(VIDEOOBJ)/tms3556.o
353353endif
354354
355355#-------------------------------------------------
356#
356#
357357#-------------------------------------------------
358358
359359ifneq ($(filter TMS9927,$(VIDEOS)),)
360VIDEOOBJS+= $(VIDEOOBJ)/tms9927.o
360VIDEOOBJS+= $(VIDEOOBJ)/tms9927.o
361361endif
362362
363363#-------------------------------------------------
364#
364#
365365#-------------------------------------------------
366366
367367ifneq ($(filter TMS9928A,$(VIDEOS)),)
r23623r23624
369369endif
370370
371371#-------------------------------------------------
372#
372#
373373#-------------------------------------------------
374374
375375ifneq ($(filter UPD3301,$(VIDEOS)),)
r23623r23624
377377endif
378378
379379#-------------------------------------------------
380#
380#
381381#-------------------------------------------------
382382
383383ifneq ($(filter UPD7220,$(VIDEOS)),)
384VIDEOOBJS+= $(VIDEOOBJ)/upd7220.o
384VIDEOOBJS+= $(VIDEOOBJ)/upd7220.o
385385endif
386386
387387#-------------------------------------------------
388#
388#
389389#-------------------------------------------------
390390
391391ifneq ($(filter UPD7227,$(VIDEOS)),)
r23623r23624
393393endif
394394
395395#-------------------------------------------------
396#
396#
397397#-------------------------------------------------
398398
399399ifneq ($(filter V9938,$(VIDEOS)),)
400VIDEOOBJS+= $(VIDEOOBJ)/v9938.o
400VIDEOOBJS+= $(VIDEOOBJ)/v9938.o
401401endif
402402
403403#-------------------------------------------------
404#
404#
405405#-------------------------------------------------
406406
407407ifneq ($(filter VOODOO,$(VIDEOS)),)
trunk/src/emu/video/msm6255.c
r23623r23624
198198
199199
200200//-------------------------------------------------
201//  ir_w -
201//  ir_w -
202202//-------------------------------------------------
203203
204204WRITE8_MEMBER( msm6255_device::ir_w )
r23623r23624
257257
258258
259259//-------------------------------------------------
260//  dr_w -
260//  dr_w -
261261//-------------------------------------------------
262262
263263WRITE8_MEMBER( msm6255_device::dr_w )
trunk/src/emu/video/cdp1862.c
r23623r23624
7878
7979cdp1862_device::cdp1862_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
8080   : device_t(mconfig, CDP1862, "CDP1862", tag, owner, clock),
81     m_read_rd(*this),
82     m_read_bd(*this),
83     m_read_gd(*this)
81      m_read_rd(*this),
82      m_read_bd(*this),
83      m_read_gd(*this)
8484{
8585}
8686
trunk/src/emu/video/tms9927.c
r23623r23624
8585{
8686   assert(clock() > 0);
8787   assert(m_hpixels_per_column > 0);
88     
88
8989   /* copy the initial parameters */
9090   m_clock = clock();
91     
91
9292   /* get the screen device */
9393   m_screen = downcast<screen_device *>(machine().device(m_screen_tag));
9494   assert(m_screen != NULL);
95     
95
9696   /* get the self-load PROM */
9797   if (m_selfload_region != NULL)
9898   {
r23623r23624
102102
103103   /* register for state saving */
104104   machine().save().register_postload(save_prepost_delegate(FUNC(tms9927_device::state_postload), this));
105   
105
106106   save_item(NAME(m_reg));
107107   save_item(NAME(m_start_datarow));
108108   save_item(NAME(m_reset));
r23623r23624
123123void tms9927_device::device_stop()
124124{
125125   mame_printf_debug("TMS9937: Final params: (%d, %d, %d, %d, %d, %d, %d)\n",
126                 m_clock,
127                 m_total_hpix,
128                 0, m_visible_hpix,
129                 m_total_vpix,
130                 0, m_visible_vpix);
126                  m_clock,
127                  m_total_hpix,
128                  0, m_visible_hpix,
129                  m_total_vpix,
130                  0, m_visible_vpix);
131131}
132132
133133
r23623r23624
300300
301301   m_screen->configure(m_total_hpix, m_total_vpix, visarea, refresh);
302302}
303
trunk/src/emu/video/tms9927.h
r23623r23624
3333   int screen_reset();
3434   int upscroll_offset();
3535   int cursor_bounds(rectangle &bounds);
36   
36
3737protected:
3838   // device-level overrides
3939   virtual void device_config_complete();
r23623r23624
4646   void state_postload();
4747   void recompute_parameters(int postload);
4848   void generic_access(address_space &space, offs_t offset);
49   
49
5050   // internal state
5151   screen_device *m_screen;
5252   const UINT8 *m_selfload;
53   
53
5454   /* live state */
5555   UINT32  m_clock;
5656   UINT8   m_reg[9];
5757   UINT8   m_start_datarow;
5858   UINT8   m_reset;
59   
59
6060   /* derived state; no need to save */
6161   UINT8   m_valid_config;
6262   UINT16  m_total_hpix, m_total_vpix;
trunk/src/emu/video/upd7227.c
r23623r23624
4444
4545upd7227_device::upd7227_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
4646   : device_t(mconfig, UPD7227, "uPD7227", tag, owner, clock),
47     device_memory_interface(mconfig, *this),
48     m_space_config("videoram", ENDIANNESS_BIG, 8, 7, 0, *ADDRESS_MAP_NAME(upd7227_map)),
49     m_cs(1),
50     m_cd(1),
51     m_sck(1),
52     m_si(1),
53     m_so(1)
47      device_memory_interface(mconfig, *this),
48      m_space_config("videoram", ENDIANNESS_BIG, 8, 7, 0, *ADDRESS_MAP_NAME(upd7227_map)),
49      m_cs(1),
50      m_cd(1),
51      m_sck(1),
52      m_si(1),
53      m_so(1)
5454{
5555}
5656
trunk/src/emu/video/upd7227.h
r23623r23624
6363private:
6464   enum
6565   {
66      CMD_SMM       = 0x18,
67      CMD_SFF       = 0x10,
68      CMD_LDPI       = 0x80,
69      CMD_SWM       = 0x64,
70      CMD_SRM       = 0x60,
71      CMD_SANDM       = 0x6c,
72      CMD_SORM       = 0x68,
73      CMD_SCM       = 0x72,
74      CMD_BSET       = 0x40,
75      CMD_BRESET       = 0x20,
76      CMD_DISP_ON    = 0x09,
77      CMD_DISP_OFF    = 0x08
66      CMD_SMM         = 0x18,
67      CMD_SFF         = 0x10,
68      CMD_LDPI        = 0x80,
69      CMD_SWM         = 0x64,
70      CMD_SRM         = 0x60,
71      CMD_SANDM       = 0x6c,
72      CMD_SORM        = 0x68,
73      CMD_SCM         = 0x72,
74      CMD_BSET        = 0x40,
75      CMD_BRESET      = 0x20,
76      CMD_DISP_ON     = 0x09,
77      CMD_DISP_OFF    = 0x08
7878   };
7979
8080   int m_sx;
trunk/src/emu/video/huc6270.h
r23623r23624
6767      HUC6270_VDW,
6868      HUC6270_VCR
6969   };
70   
70
7171   enum huc6270_h_state {
7272      HUC6270_HDS,
7373      HUC6270_HDW,
trunk/src/emu/dislot.c
r23623r23624
4343
4444   return options;
4545}
46   
46
4747void device_slot_interface::static_set_card_machine_config(device_t &device, const char *card, const machine_config_constructor machine_config)
4848{
4949   static_alloc_card_options(device, card)->m_machine_config = machine_config;
trunk/src/emu/memory.h
r23623r23624
937937
938938
939939// device delegate macros
940#define READ8_DELEGATE(_class, _member)                  read8_delegate(FUNC(_class::_member), this)
941#define WRITE8_DELEGATE(_class, _member)               write8_delegate(FUNC(_class::_member), this)
942#define READ16_DELEGATE(_class, _member)               read16_delegate(FUNC(_class::_member), this)
943#define WRITE16_DELEGATE(_class, _member)               write16_delegate(FUNC(_class::_member), this)
944#define READ32_DELEGATE(_class, _member)               read32_delegate(FUNC(_class::_member), this)
945#define WRITE32_DELEGATE(_class, _member)               write32_delegate(FUNC(_class::_member), this)
946#define READ64_DELEGATE(_class, _member)               read64_delegate(FUNC(_class::_member), this)
947#define WRITE64_DELEGATE(_class, _member)               write64_delegate(FUNC(_class::_member), this)
940#define READ8_DELEGATE(_class, _member)                     read8_delegate(FUNC(_class::_member), this)
941#define WRITE8_DELEGATE(_class, _member)                    write8_delegate(FUNC(_class::_member), this)
942#define READ16_DELEGATE(_class, _member)                    read16_delegate(FUNC(_class::_member), this)
943#define WRITE16_DELEGATE(_class, _member)                   write16_delegate(FUNC(_class::_member), this)
944#define READ32_DELEGATE(_class, _member)                    read32_delegate(FUNC(_class::_member), this)
945#define WRITE32_DELEGATE(_class, _member)                   write32_delegate(FUNC(_class::_member), this)
946#define READ64_DELEGATE(_class, _member)                    read64_delegate(FUNC(_class::_member), this)
947#define WRITE64_DELEGATE(_class, _member)                   write64_delegate(FUNC(_class::_member), this)
948948
949#define READ8_DEVICE_DELEGATE(_device, _class, _member)      read8_delegate(FUNC(_class::_member), (_class *)_device)
950#define WRITE8_DEVICE_DELEGATE(_device, _class, _member)   write8_delegate(FUNC(_class::_member), (_class *)_device)
951#define READ16_DEVICE_DELEGATE(_device, _class, _member)   read16_delegate(FUNC(_class::_member), (_class *)_device)
952#define WRITE16_DEVICE_DELEGATE(_device, _class, _member)   write16_delegate(FUNC(_class::_member), (_class *)_device)
953#define READ32_DEVICE_DELEGATE(_device, _class, _member)   read32_delegate(FUNC(_class::_member), (_class *)_device)
954#define WRITE32_DEVICE_DELEGATE(_device, _class, _member)   write32_delegate(FUNC(_class::_member), (_class *)_device)
955#define READ64_DEVICE_DELEGATE(_device, _class, _member)   read64_delegate(FUNC(_class::_member), (_class *)_device)
956#define WRITE64_DEVICE_DELEGATE(_device, _class, _member)   write64_delegate(FUNC(_class::_member), (_class *)_device)
949#define READ8_DEVICE_DELEGATE(_device, _class, _member)     read8_delegate(FUNC(_class::_member), (_class *)_device)
950#define WRITE8_DEVICE_DELEGATE(_device, _class, _member)    write8_delegate(FUNC(_class::_member), (_class *)_device)
951#define READ16_DEVICE_DELEGATE(_device, _class, _member)    read16_delegate(FUNC(_class::_member), (_class *)_device)
952#define WRITE16_DEVICE_DELEGATE(_device, _class, _member)   write16_delegate(FUNC(_class::_member), (_class *)_device)
953#define READ32_DEVICE_DELEGATE(_device, _class, _member)    read32_delegate(FUNC(_class::_member), (_class *)_device)
954#define WRITE32_DEVICE_DELEGATE(_device, _class, _member)   write32_delegate(FUNC(_class::_member), (_class *)_device)
955#define READ64_DEVICE_DELEGATE(_device, _class, _member)    read64_delegate(FUNC(_class::_member), (_class *)_device)
956#define WRITE64_DEVICE_DELEGATE(_device, _class, _member)   write64_delegate(FUNC(_class::_member), (_class *)_device)
957957
958958
959959// helper macro for merging data with the memory mask
trunk/src/emu/machine.c
r23623r23624
559559      statename_str.cpy("%g");
560560   else
561561      statename_str.cpy(option);
562   
562
563563   // strip any extension in the provided statename
564564   int index = statename_str.rchr(0, '.');
565565   if (index != -1)
566566      statename_str.substr(0, index);
567   
567
568568   // handle %d in the template (for image devices)
569569   astring statename_dev("%d_");
570570   int pos = statename_str.find(0, statename_dev);
571   
571
572572   if (pos != -1)
573573   {
574574      // if more %d are found, revert to default and ignore them all
r23623r23624
578578      else
579579      {
580580         int name_found = 0;
581         
581
582582         // find length of the device name
583583         int end1 = statename_str.find(pos + 3, "/");
584584         int end2 = statename_str.find(pos + 3, "%");
585585         int end = -1;
586         
586
587587         if ((end1 != -1) && (end2 != -1))
588588            end = MIN(end1, end2);
589589         else if (end1 != -1)
r23623r23624
592592            end = end2;
593593         else
594594            end = statename_str.len();
595         
595
596596         if (end - pos < 3)
597597            fatalerror("Something very wrong is going on!!!\n");
598         
598
599599         // copy the device name to an astring
600600         astring devname_str;
601601         devname_str.cpysubstr(statename_str, pos + 3, end - pos - 3);
602602         //printf("check template: %s\n", devname_str.cstr());
603         
603
604604         // verify that there is such a device for this system
605605         image_interface_iterator iter(root_device());
606606         for (device_image_interface *image = iter.first(); image != NULL; image = iter.next())
r23623r23624
608608            // get the device name
609609            astring tempdevname(image->brief_instance_name());
610610            //printf("check device: %s\n", tempdevname.cstr());
611           
611
612612            if (devname_str.cmp(tempdevname) == 0)
613613            {
614614               // verify that such a device has an image mounted
615615               if (image->basename_noext() != NULL)
616616               {
617617                  astring filename(image->basename_noext());
618                 
618
619619                  // setup snapname and remove the %d_
620620                  statename_str.replace(0, devname_str, filename);
621621                  statename_str.del(pos, 3);
622622                  //printf("check image: %s\n", filename.cstr());
623                 
623
624624                  name_found = 1;
625625               }
626626            }
627627         }
628         
628
629629         // or fallback to default
630630         if (name_found == 0)
631631            statename_str.cpy("%g");
632632      }
633633   }
634   
634
635635   // substitute path and gamename up front
636636   statename_str.replace(0, "/", PATH_SEPARATOR);
637637   statename_str.replace(0, "%g", basename());
trunk/src/emu/sound/msm5205.c
r23623r23624
8585   const msm5205_interface *intf = reinterpret_cast<const msm5205_interface *>(static_config());
8686   if (intf != NULL)
8787      *static_cast<msm5205_interface *>(this) = *intf;
88   
88
8989   // or initialize to defaults if none provided
9090   else
9191   {
9292      memset(&m_vclk_cb, 0, sizeof(m_vclk_cb));
9393      m_select = 0;
9494   }
95   
95
9696}
9797
9898//-------------------------------------------------
r23623r23624
103103{
104104   m_mod_clock = clock();
105105   m_vclk_callback.resolve(m_vclk_cb, *this);
106   
106
107107   /* compute the difference tables */
108108   compute_tables();
109   
109
110110   /* stream system initialize */
111111   m_stream = machine().sound().stream_alloc(*this, 0, 1, clock(), this);
112112   m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(msm5205_device::vclk_callback), this));
113   
113
114114   /* register for save states */
115115   save_item(NAME(m_mod_clock));
116116   save_item(NAME(m_data));
r23623r23624
127127//-------------------------------------------------
128128
129129void msm5205_device::device_reset()
130{   
130{
131131   /* initialize work */
132132   m_data    = 0;
133133   m_vclk    = 0;
134134   m_reset   = 0;
135135   m_signal  = 0;
136136   m_step    = 0;
137   
137
138138   /* timer and bitwidth set */
139139   playmode_w(m_select);
140140}
r23623r23624
189189   int new_signal;
190190
191191   /* callback user handler and latch next data */
192   if (!m_vclk_callback.isnull())
192   if (!m_vclk_callback.isnull())
193193      m_vclk_callback(1);
194194
195195   /* reset check at last hiedge of VCLK */
r23623r23624
237237      if (m_vclk != vclk)
238238      {
239239         m_vclk = vclk;
240         if (!vclk)
240         if (!vclk)
241241            vclk_callback(this, 0);
242242      }
243243   }
r23623r23624
325325void msm5205_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
326326{
327327   stream_sample_t *buffer = outputs[0];
328   
328
329329   /* if this voice is active */
330330   if(m_signal)
331331   {
trunk/src/emu/sound/ymf271.c
r23623r23624
11361136         slot->ch3_level = data & 0xf;
11371137         break;
11381138      }
1139     
1139
11401140      default:
11411141         break;
11421142   }
r23623r23624
13181318         if (!m_irq_handler.isnull())
13191319            m_irq_handler(1);
13201320      }
1321     
1321
13221322      // reload timer
13231323      m_timA->adjust(attotime::from_hz(m_clock) * (384 * 4 * (256 - m_timerA)), 0);
13241324      break;
r23623r23624
13341334         if (!m_irq_handler.isnull())
13351335            m_irq_handler(1);
13361336      }
1337     
1337
13381338      // reload timer
13391339      m_timB->adjust(attotime::from_hz(m_clock) * (384 * 16 * (256 - m_timerB)), 0);
13401340      break;
r23623r23624
14471447            if (!m_ext_rw && !m_ext_write_handler.isnull())
14481448               m_ext_write_handler(m_ext_address, data);
14491449            break;
1450         
1450
14511451         default:
14521452            break;
14531453      }
r23623r23624
17371737      m_slots[i].active = 0;
17381738      m_slots[i].volume = 0;
17391739   }
1740   
1740
17411741   // reset timers and IRQ
17421742   m_timA->reset();
17431743   m_timB->reset();
1744   
1744
17451745   m_irqstate = 0;
17461746   m_status = 0;
17471747   m_enable = 0;
trunk/src/emu/sound/ymz280b.c
r23623r23624
1717   8-bit PCM, 16-bit PCM ...... 0.172 to 88.2kHz in 512 steps
1818  256 steps total level and 16 steps panpot can be set
1919  Voice signal is output in stereo 16-bit 2's complement MSB-first format
20 
20
2121  TODO:
2222  - Is memory handling 100% correct? At the moment, Konami firebeat.c is the only
2323    hardware currently emulated that uses external handlers.
trunk/src/emu/sound/speaker.c
r23623r23624
9999   const speaker_interface *intf = reinterpret_cast<const speaker_interface *>(static_config());
100100   if (intf != NULL)
101101      *static_cast<speaker_interface *>(this) = *intf;
102   
102
103103   // or initialize to defaults if none provided
104104   else
105105   {
r23623r23624
116116{
117117   int i;
118118   double x;
119   
119
120120   m_channel = machine().sound().stream_alloc(*this, 0, 1, machine().sample_rate(), this);
121121
122122   m_level = 0;
r23623r23624
137137   /* Note: To avoid time drift due to floating point inaccuracies,
138138    * it is good if the speaker time synchronizes itself with the stream timing regularly.
139139    */
140   
140
141141   /* Compute filter kernel; */
142142   /* (Done for each device though the data is shared...
143143    *  No problem really, but should be done as part of system init if I knew how)
r23623r23624
157157#define FILTER_STEP  (M_PI / 2 / RATE_MULTIPLIER)
158158   /* Distribute symmetrically on x axis; center has x=0 if length is odd */
159159   for (i = 0,             x = (0.5 - FILTER_LENGTH / 2.) * FILTER_STEP;
160       i < FILTER_LENGTH;
161       i++,                x += FILTER_STEP)
160         i < FILTER_LENGTH;
161         i++,                x += FILTER_STEP)
162162   {
163163      if (x == 0)
164164         m_ampl[i] = 1;
r23623r23624
180180   save_item(NAME(m_channel_last_sample_time));
181181   save_item(NAME(m_interm_sample_index));
182182   save_item(NAME(m_last_update_time));
183   
183
184184   machine().save().register_postload(save_prepost_delegate(FUNC(speaker_sound_device::speaker_postload), this));
185185}
186186
r23623r23624
201201   int volume = m_levels[m_level];
202202   double filtered_volume;
203203   attotime sampled_time = attotime::zero;
204   
204
205205   if (samples > 0)
206206   {
207207      /* Prepare to update time state */
208208      sampled_time = attotime(0, m_channel_sample_period);
209209      if (samples > 1)
210210         sampled_time *= samples;
211     
211
212212      /* Note: since the stream is in the process of being updated,
213213       * stream->sample_time() will return the time before the update! (MAME 0.130)
214214       * Avoid using it here in order to avoid a subtle dependence on the stream implementation.
215215       */
216216   }
217   
217
218218   if (samples-- > 0)
219219   {
220220      /* Note that first interm. sample may be composed... */
221221      filtered_volume = update_interm_samples_get_filtered_volume(volume);
222     
222
223223      /* Composite volume is now quantized to the stream resolution */
224224      *buffer++ = (stream_sample_t)filtered_volume;
225     
225
226226      /* Any additional samples will be homogeneous, however may need filtering across samples: */
227227      while (samples-- > 0)
228228      {
229229         filtered_volume = update_interm_samples_get_filtered_volume(volume);
230230         *buffer++ = (stream_sample_t)filtered_volume;
231231      }
232     
232
233233      /* Update the time state */
234234      m_channel_last_sample_time += sampled_time;
235235      m_channel_next_sample_time = m_channel_last_sample_time + attotime(0, m_channel_sample_period);
r23623r23624
289289
290290   /* Finally update speaker state before returning */
291291   m_level = new_level;
292   
292
293293}
294294
295295
r23623r23624
394394
395395   return filtered_volume;
396396}
397
398
trunk/src/emu/sound/speaker.h
r23623r23624
1212#define __SOUND_SPEAKER_H__
1313
1414// Length of anti-aliasing filter kernel, measured in number of intermediate samples
15enum
15enum
1616{
1717   FILTER_LENGTH = 64
1818};
r23623r23624
4848
4949   // Updates the composed volume array according to time
5050   void update_interm_samples(attotime time, int volume);
51   
51
5252   // Updates the composed volume array and returns final filtered volume of next stream sample
5353   double update_interm_samples_get_filtered_volume(int volume);
54   
54
5555   void finalize_interm_sample(int volume);
5656   void init_next_interm_sample();
5757   inline double make_fraction(attotime a, attotime b, double timediv);
5858   double get_filtered_volume();
59   
59
6060   // Kernel (pulse response) for filtering across samples (while we avoid fancy filtering within samples)
6161   double m_ampl[FILTER_LENGTH];
62   
62
6363   sound_stream *m_channel;
6464   int m_level;
65   
65
6666   /* The volume of a composed sample grows incrementally each time the speaker is over-sampled.
6767    * That is in effect a basic average filter.
6868    * Another filter can and will be applied to the array of composed samples.
trunk/src/emu/sound/sp0256.c
r23623r23624
2727    the sp0256_start() call.
2828
2929    If the memory map contents is modified during execution (accross of ROM
30    bank switching) the bitrevbuff() call must be called after the section
30    bank switching) the bitrevbuff() call must be called after the section
3131    of ROM is modified.
3232*/
3333
r23623r23624
112112   const sp0256_interface *intf = reinterpret_cast<const sp0256_interface *>(static_config());
113113   if (intf != NULL)
114114      *static_cast<sp0256_interface *>(this) = *intf;
115   
115
116116   // or initialize to defaults if none provided
117117   else
118118   {
119119      memset(&m_lrq_cb, 0, sizeof(m_lrq_cb));
120120      memset(&m_sby_cb, 0, sizeof(m_sby_cb));
121121   }
122   
122
123123}
124124
125125//-------------------------------------------------
r23623r23624
132132   m_sby.resolve(m_sby_cb, *this);
133133   m_drq(1);
134134   m_sby(1);
135   
135
136136   m_stream = machine().sound().stream_alloc(*this, 0, 1, clock() / CLOCK_DIVIDER, this);
137   
137
138138   /* -------------------------------------------------------------------- */
139139   /*  Configure our internal variables.                                   */
140140   /* -------------------------------------------------------------------- */
141141   m_filt.rng = 1;
142   
142
143143   /* -------------------------------------------------------------------- */
144144   /*  Allocate a scratch buffer for generating ~10kHz samples.             */
145145   /* -------------------------------------------------------------------- */
r23623r23624
147147   save_pointer(NAME(m_scratch), SCBUF_SIZE);
148148
149149   m_sc_head = m_sc_tail = 0;
150   
150
151151   /* -------------------------------------------------------------------- */
152152   /*  Set up the microsequencer's initial state.                          */
153153   /* -------------------------------------------------------------------- */
r23623r23624
156156   m_lrq      = 0x8000;
157157   m_page     = 0x1000 << 3;
158158   m_silent   = 1;
159   
159
160160   /* -------------------------------------------------------------------- */
161161   /*  Setup the ROM.                                                      */
162162   /* -------------------------------------------------------------------- */
r23623r23624
165165   // see http://forums.bannister.org/ubbthreads.php?ubb=showflat&Number=72385#Post72385
166166   // TODO: because of this, check if the bitrev functions are even used anywhere else
167167   // bitrevbuff(m_rom, 0, 0xffff);
168   
168
169169   m_lrq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sp0256_device::set_lrq_timer_proc),this));
170170
171171   // save device variables
r23623r23624
208208{
209209   // reset FIFO and SP0256
210210   m_fifo_head = m_fifo_tail = m_fifo_bitp = 0;
211   
211
212212   memset(&m_filt, 0, sizeof(m_filt));
213213   m_halted   = 1;
214214   m_filt.rpt = -1;
r23623r23624
223223   m_silent   = 1;
224224   m_drq(1);
225225   SET_SBY(1)
226   
226
227227   m_lrq = 0;
228228   m_lrq_timer->adjust(attotime::from_ticks(50, m_clock));
229229}
r23623r23624
11961196      LOG(("sp0256: Droped ALD write\n"));
11971197      return;
11981198   }
1199   
1199
12001200   /* ---------------------------------------------------------------- */
12011201   /*  Set LRQ to "busy" and load the 8 LSBs of the data into the ALD  */
12021202   /*  reg.  We take the command address, and multiply by 2 bytes to   */
r23623r23624
12061206   m_ald = (0xff & data) << 4;
12071207   m_drq(0);
12081208   SET_SBY(0)
1209   
1209
12101210   return;
12111211}
12121212
r23623r23624
12141214{
12151215   // force stream update
12161216   m_stream->update();
1217   
1217
12181218   return m_lrq == 0x8000;
12191219}
12201220
12211221READ_LINE_MEMBER( sp0256_device::sby_r )
12221222{
1223   // TODO: force stream update??   
1223   // TODO: force stream update??
12241224
12251225   return m_sby_line;
12261226}
r23623r23624
12341234   {
12351235      return m_lrq;
12361236   }
1237   
1237
12381238   /* -------------------------------------------------------------------- */
12391239   /*  Offset 1 returns the SPB640 FIFO full status on bit 15.             */
12401240   /* -------------------------------------------------------------------- */
r23623r23624
12421242   {
12431243      return (m_fifo_head - m_fifo_tail) >= 64 ? 0x8000 : 0;
12441244   }
1245   
1245
12461246   /* -------------------------------------------------------------------- */
12471247   /*  Just return 255 for all other addresses in our range.               */
12481248   /* -------------------------------------------------------------------- */
r23623r23624
12561256      ald_w(space, 0, data & 0xff);
12571257      return;
12581258   }
1259   
1259
12601260   if (offset == 1)
12611261   {
12621262      /* ---------------------------------------------------------------- */
12631263      /*  If Bit 10 is set, reset the FIFO, and SP0256.                   */
12641264      /* ---------------------------------------------------------------- */
1265     
1265
12661266      if (data & 0x400)
12671267      {
12681268         m_fifo_head = m_fifo_tail = m_fifo_bitp = 0;
12691269         device_reset();
12701270         return;
12711271      }
1272     
1272
12731273      /* ---------------------------------------------------------------- */
12741274      /*  If the FIFO is full, drop the data.                             */
12751275      /* ---------------------------------------------------------------- */
r23623r23624
12781278         LOG(("spb640: Dropped FIFO write\n"));
12791279         return;
12801280      }
1281     
1281
12821282      /* ---------------------------------------------------------------- */
12831283      /*  FIFO up the lower 10 bits of the data.                          */
12841284      /* ---------------------------------------------------------------- */
1285     
1285
12861286      LOG(("spb640: WR_FIFO %.3X %d.%d %d\n", data & 0x3ff,
1287          m_fifo_tail, m_fifo_bitp, m_fifo_head));
1288     
1287            m_fifo_tail, m_fifo_bitp, m_fifo_head));
1288
12891289      m_fifo[m_fifo_head++ & 63] = data & 0x3ff;
1290     
1290
12911291      return;
12921292   }
12931293}
r23623r23624
13131313   stream_sample_t *output = outputs[0];
13141314   int output_index = 0;
13151315   int length, did_samp/*, old_idx*/;
1316   
1316
13171317   while (output_index < samples)
13181318   {
13191319      /* ---------------------------------------------------------------- */
13201320      /*  First, drain as much of our scratch buffer as we can into the   */
13211321      /*  sound buffer.                                                  */
13221322      /* ---------------------------------------------------------------- */
1323     
1323
13241324      while (m_sc_tail != m_sc_head)
13251325      {
13261326         output[output_index++] = m_scratch[m_sc_tail++ & SCBUF_MASK];
13271327         m_sc_tail &= SCBUF_MASK;
1328         
1328
13291329         if (output_index > samples)
13301330            break;
13311331      }
1332     
1332
13331333      /* ---------------------------------------------------------------- */
13341334      /*  If output outputs is full, then we're done.                      */
13351335      /* ---------------------------------------------------------------- */
13361336      if (output_index > samples)
13371337         break;
1338     
1338
13391339      length = samples - output_index;
1340     
1340
13411341      /* ---------------------------------------------------------------- */
13421342      /*  Process the current set of filter coefficients as long as the   */
13431343      /*  repeat count holds up and we have room in our scratch buffer.   */
r23623r23624
13471347      if (length > 0) do
13481348      {
13491349         int do_samp;
1350         
1350
13511351         /* ------------------------------------------------------------ */
13521352         /*  If our repeat count expired, emulate the microsequencer.    */
13531353         /* ------------------------------------------------------------ */
13541354         if (m_filt.rpt <= 0)
13551355            micro();
1356         
1356
13571357         /* ------------------------------------------------------------ */
13581358         /*  Do as many samples as we can.                               */
13591359         /* ------------------------------------------------------------ */
13601360         do_samp = length - did_samp;
13611361         if (m_sc_head + do_samp - m_sc_tail > SCBUF_SIZE)
13621362            do_samp = m_sc_tail + SCBUF_SIZE - m_sc_head;
1363         
1363
13641364         if (do_samp == 0) break;
1365         
1365
13661366         if (m_silent && m_filt.rpt <= 0)
13671367         {
13681368            int y = m_sc_head;
1369           
1369
13701370            for (int x = 0; x < do_samp; x++)
13711371               m_scratch[y++ & SCBUF_MASK] = 0;
13721372            m_sc_head += do_samp;
r23623r23624
13751375         else
13761376         {
13771377            did_samp += lpc12_update(&m_filt, do_samp,
1378                              m_scratch, &m_sc_head);
1378                                 m_scratch, &m_sc_head);
13791379         }
1380         
1380
13811381         m_sc_head &= SCBUF_MASK;
1382         
1382
13831383      } while (m_filt.rpt >= 0 && length > did_samp);
13841384   }
13851385}
trunk/src/emu/sound/sp0256.h
r23623r23624
8181   DECLARE_READ_LINE_MEMBER(sby_r);
8282   DECLARE_READ16_MEMBER(spb640_r);
8383   DECLARE_WRITE16_MEMBER(spb640_w);
84   
84
8585   TIMER_CALLBACK_MEMBER(set_lrq_timer_proc);
8686   void set_clock(int clock);
8787   void bitrevbuff(UINT8 *buffer, unsigned int start, unsigned int length);
88   
88
8989protected:
9090   // device-level overrides
9191   virtual void device_config_complete();
r23623r23624
9797private:
9898   UINT32 getb(int len);
9999   void micro();
100   
100
101101   sound_stream  *m_stream;          /* MAME core sound stream                       */
102102   devcb_resolved_write_line m_drq;  /* Data request callback                        */
103103   devcb_resolved_write_line m_sby;  /* Standby callback                             */
104104
105105   int            m_sby_line;        /* Standby line state                           */
106106   int            m_cur_len;         /* Fullness of current sound buffer.            */
107   
107
108108   int            m_silent;          /* Flag: SP0256 is silent.                      */
109   
109
110110   INT16         *m_scratch;         /* Scratch buffer for audio.                    */
111111   UINT32         m_sc_head;         /* Head pointer into scratch circular buf       */
112112   UINT32         m_sc_tail;         /* Tail pointer into scratch circular buf       */
113   
113
114114   struct lpc12_t m_filt;            /* 12-pole filter                               */
115115   int            m_lrq;             /* Load ReQuest.  == 0 if we can accept a load  */
116116   int            m_ald;             /* Address LoaD.  < 0 if no command pending.    */
r23623r23624
120120   int            m_halted;          /* True when CPU is halted.                     */
121121   UINT32         m_mode;            /* Mode register.                               */
122122   UINT32         m_page;            /* Page set by SETPAGE                          */
123   
123
124124   UINT32         m_fifo_head;       /* FIFO head pointer (where new data goes).     */
125125   UINT32         m_fifo_tail;       /* FIFO tail pointer (where data comes from).   */
126126   UINT32         m_fifo_bitp;       /* FIFO bit-pointer (for partial decles).       */
127127   UINT16         m_fifo[64];        /* The 64-decle FIFO.                           */
128   
128
129129   UINT8          *m_rom;            /* 64K ROM.                                     */
130130
131131   emu_timer *m_lrq_timer;
trunk/src/lib/formats/bml3_dsk.c
r23623r23624
3636
3737
3838LEGACY_FLOPPY_OPTIONS_START( bml3 )
39   LEGACY_FLOPPY_OPTION( bml3_dsk, "bm3",      "BML3 floppy disk image",   bml3_dsk_identify, bml3_dsk_construct, NULL,
39   LEGACY_FLOPPY_OPTION( bml3_dsk, "bm3",      "BML3 floppy disk image",   bml3_dsk_identify, bml3_dsk_construct, NULL,
4040         HEADS([2])
4141         TRACKS([40])
4242         SECTORS([16])
trunk/src/lib/formats/td0_dsk.c
r23623r23624
10221022}
10231023
10241024const floppy_format_type FLOPPY_TD0_FORMAT = &floppy_image_format_creator<td0_format>;
1025
1026
trunk/src/version.c
r23623r23624
3838***************************************************************************/
3939
4040extern const char build_version[];
41const char build_version[] = "0.148u5 ("__DATE__")";
41const char build_version[] = "0.149 ("__DATE__")";
trunk/src/mess/drivers/sg1000.c
r23623r23624
741741   /* register for state saving */
742742   save_item(NAME(m_keylatch));
743743
744   if (m_cartslot && (m_cartslot->get_type() == SEGA8_BASIC_L3 || m_cartslot->get_type() == SEGA8_MUSIC_EDITOR
744   if (m_cartslot && (m_cartslot->get_type() == SEGA8_BASIC_L3 || m_cartslot->get_type() == SEGA8_MUSIC_EDITOR
745745                        || m_cartslot->get_type() == SEGA8_DAHJEE_TYPEA || m_cartslot->get_type() == SEGA8_DAHJEE_TYPEB))
746746   {
747747      m_maincpu->space(AS_PROGRAM).install_read_handler(0xc000, 0xffff, 0, 0, read8_delegate(FUNC(sega8_cart_slot_device::read_ram),(sega8_cart_slot_device*)m_cartslot));
trunk/src/mess/drivers/hx20.c
r23623r23624
88
99/*
1010
11   TODO:
11    TODO:
1212
13   - m6800.c rewrite
14   - keyboard interrupt
15   - LCD controller
16   - serial
17   - SW6 read
18   - RS-232
19   - microcassette
20   - printer
21   - ROM cartridge
22   - floppy TF-20
23   - barcode reader
13    - m6800.c rewrite
14    - keyboard interrupt
15    - LCD controller
16    - serial
17    - SW6 read
18    - RS-232
19    - microcassette
20    - printer
21    - ROM cartridge
22    - floppy TF-20
23    - barcode reader
2424
2525*/
2626
r23623r23624
8484READ8_MEMBER( hx20_state::krtn89_r )
8585{
8686   /*
87   
87
8888       bit     description
89   
89
9090       0       KRTN8
9191       1       KRTN9
92       2       
93       3       
94       4       
95       5       
92       2
93       3
94       4
95       5
9696       6       _PWSW
9797       7       _BUSY
98   
98
9999   */
100100
101101   UINT8 data = 0xff;
r23623r23624
120120WRITE8_MEMBER( hx20_state::lcd_cs_w )
121121{
122122   /*
123   
123
124124       bit     description
125   
125
126126       0       LCD CS bit 0
127127       1       LCD CS bit 1
128128       2       LCD CS bit 2
r23623r23624
131131       5       SERIAL POUT
132132       6       MO1
133133       7       MO2
134   
134
135135   */
136136
137137   logerror("LCD CS %02x\n", data);
r23623r23624
153153   case 5: m_lcdc4->cs_w(0); break;
154154   case 6: m_lcdc5->cs_w(0); break;
155155   }
156   
156
157157   int cd = BIT(data, 3);
158158
159159   m_lcdc0->cd_w(cd);
r23623r23624
187187READ8_MEMBER( hx20_state::main_p1_r )
188188{
189189   /*
190   
190
191191       bit     description
192   
192
193193       0       RS-232 DSR
194194       1       RS-232 CTS
195       2       
195       2
196196       3       _INT EX
197197       4       _PWA
198198       5       _K.B REQUEST
199199       6       SERIAL PIN
200200       7       CARTRIDGE MI1 (0=ROM, 1=microcassette)
201   
201
202202   */
203203
204204   UINT8 data = 0x98;
r23623r23624
224224WRITE8_MEMBER( hx20_state::main_p1_w )
225225{
226226   /*
227   
227
228228       bit     description
229   
230       0       
231       1       
232       2       
233       3       
234       4       
235       5       
236       6       
237       7       
238   
229
230       0
231       1
232       2
233       3
234       4
235       5
236       6
237       7
238
239239   */
240240}
241241
r23623r23624
247247READ8_MEMBER( hx20_state::main_p2_r )
248248{
249249   /*
250   
250
251251       bit     description
252   
252
253253       0       bar code reader data
254       1       
254       1
255255       2       SLAVE P34
256256       3       RX
257       4       
258       5       
259       6       
260       7       
261   
257       4
258       5
259       6
260       7
261
262262   */
263   
263
264264   UINT8 data = M6801_MODE_4;
265265
266266   // serial
267267   data &= ~(!m_slave_flag << 2);
268   
268
269269   if (m_slave_sio)
270270      data |= m_slave_rx << 3;
271271   else
r23623r23624
282282WRITE8_MEMBER( hx20_state::main_p2_w )
283283{
284284   /*
285   
285
286286       bit     description
287   
288       0       
287
288       0
289289       1       RS-232 TXD
290290       2       serial select (0=peripheral, 1=slave 6301)
291       3       
291       3
292292       4       TX
293       5       
294       6       
295       7       
296   
293       5
294       6
295       7
296
297297   */
298298
299299   // RS-232
r23623r23624
316316READ8_MEMBER( hx20_state::slave_p1_r )
317317{
318318   /*
319   
319
320320       bit     description
321   
322       0       
323       1       
324       2       
325       3       
326       4       
327       5       
321
322       0
323       1
324       2
325       3
326       4
327       5
328328       6       printer reset pulse
329329       7       printer timing pulse
330   
330
331331   */
332332
333333   UINT8 data = 0;
r23623r23624
343343WRITE8_MEMBER( hx20_state::slave_p1_w )
344344{
345345   /*
346   
346
347347       bit     description
348   
348
349349       0       printer head 1 (1=on)
350350       1       printer head 2
351351       2       printer head 3
352352       3       printer head 4
353353       4       printer motor (0=on)
354354       5       speaker (1=on)
355       6       
356       7       
357   
355       6
356       7
357
358358   */
359359
360360   // speaker
r23623r23624
369369READ8_MEMBER( hx20_state::slave_p2_r )
370370{
371371   /*
372   
372
373373       bit     description
374   
374
375375       0       RS-232 RXD / microcassette (0=read, 1=write)
376       1       
377       2       
376       1
377       2
378378       3       TX
379       4       
380       5       
381       6       
382       7       
383   
379       4
380       5
381       6
382       7
383
384384   */
385   
385
386386   UINT8 data = M6801_MODE_7;
387387
388388   // serial
r23623r23624
399399WRITE8_MEMBER( hx20_state::slave_p2_w )
400400{
401401   /*
402   
402
403403       bit     description
404   
405       0       
404
405       0
406406       1       microcassette internal clock, write data
407407       2       serial select (0=brake, 1=normal)
408       3       
408       3
409409       4       RX
410       5       
411       6       
412       7       
413   
410       5
411       6
412       7
413
414414   */
415415
416416   // serial
r23623r23624
425425READ8_MEMBER( hx20_state::slave_p3_r )
426426{
427427   /*
428   
428
429429       bit     description
430   
431       0       
432       1       
430
431       0
432       1
433433       2       external cassette read data
434       3       
435       4       
436       5       
437       6       
438       7       
439   
434       3
435       4
436       5
437       6
438       7
439
440440   */
441441
442442   UINT8 data = 0;
r23623r23624
452452WRITE8_MEMBER( hx20_state::slave_p3_w )
453453{
454454   /*
455   
455
456456       bit     description
457   
457
458458       0       external cassette remote (0=on)
459459       1       RS-232 RTS
460       2       
460       2
461461       3       external cassette write data
462462       4       slave status flag
463463       5       bar code power (1=on)
464464       6       RS-232 power (1=on)
465465       7       program power (1=on)
466   
466
467467   */
468468
469469   // RS-232
r23623r23624
481481READ8_MEMBER( hx20_state::slave_p4_r )
482482{
483483   /*
484   
484
485485       bit     description
486   
486
487487       0       PLUG 2
488       1       
489       2       
490       3       
491       4       
492       5       
493       6       
488       1
489       2
490       3
491       4
492       5
493       6
494494       7       RS-232 CD
495   
495
496496   */
497   
497
498498   UINT8 data = 0;
499499
500500   // RS-232
r23623r23624
511511WRITE8_MEMBER( hx20_state::slave_p4_w )
512512{
513513   /*
514   
514
515515       bit     description
516   
517       0       
516
517       0
518518       1       port enable always on / printer motor control (0=open, 1=brake)
519519       2       clear shift register / microcassette power switch (1=on)
520520       3       ROM cartridge power switch (1=on) / microcassette command
521521       4       ROM address counter clear / clock
522522       5       cassette/RS-232 select (0=RS-232, 1=microcassette)
523523       6       ROM cartridge select / microcassette clock (0=counter, 1=head switch)
524       7       
525   
524       7
525
526526   */
527527}
528528
r23623r23624
598598static INPUT_PORTS_START( hx20 )
599599   PORT_START("KSC0")
600600   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR('_')
601   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!')
601   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!')
602602   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('\"')
603603   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#')
604604   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$')
r23623r23624
871871   MCFG_RS232_PORT_ADD(RS232_TAG, rs232_intf, default_rs232_devices, NULL)
872872   MCFG_CASSETTE_ADD(CASSETTE_TAG, default_cassette_interface)
873873   MCFG_EPSON_SIO_ADD("sio", "tf20")
874   
874
875875   // internal ram
876876   MCFG_RAM_ADD(RAM_TAG)
877877   MCFG_RAM_DEFAULT_SIZE("16K")
trunk/src/mess/drivers/scv.c
r23623r23624
7171
7272   ioport_port *m_key[8];
7373   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
74   
74
7575   void scv_set_banks();
7676   inline void plot_sprite_part( bitmap_ind16 &bitmap, UINT8 x, UINT8 y, UINT8 pat, UINT8 col, UINT8 screen_sprite_start_line );
7777   inline void draw_sprite( bitmap_ind16 &bitmap, UINT8 x, UINT8 y, UINT8 tile_idx, UINT8 col, UINT8 left, UINT8 right, UINT8 top, UINT8 bottom, UINT8 clip_y, UINT8 screen_sprite_start_line );
r23623r23624
421421      case TIMER_VB:
422422         {
423423            int vpos = machine().primary_screen->vpos();
424         
424
425425            switch( vpos )
426426            {
427427            case 240:
r23623r23624
784784   save_item(NAME(m_porta));
785785   save_item(NAME(m_portc));
786786   save_item(NAME(m_cart_ram_enabled));
787   
787
788788   machine().save().register_postload(save_prepost_delegate(FUNC(scv_state::scv_postload), this));
789789}
790790
trunk/src/mess/drivers/gba.c
r23623r23624
19201920   AM_RANGE(0x05000000, 0x050003ff) AM_RAM_WRITE(gba_pram_w) AM_SHARE("gba_pram")  // Palette RAM
19211921   AM_RANGE(0x06000000, 0x06017fff) AM_RAM_WRITE(gba_vram_w) AM_SHARE("gba_vram")  // VRAM
19221922   AM_RANGE(0x07000000, 0x070003ff) AM_RAM_WRITE(gba_oam_w) AM_SHARE("gba_oam")    // OAM
1923   //AM_RANGE(0x08000000, 0x0cffffff)   // cart ROM + mirrors, mapped here at machine_start if a cart is present
1923   //AM_RANGE(0x08000000, 0x0cffffff)  // cart ROM + mirrors, mapped here at machine_start if a cart is present
19241924   AM_RANGE(0x10000000, 0xffffffff) AM_READ(gba_10000000_r) // for "Justice League Chronicles" (game bug)
19251925ADDRESS_MAP_END
19261926
r23623r23624
21172117   /* and an IRQ handling timer */
21182118   m_irq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gba_state::handle_irq),this));
21192119   m_irq_timer->adjust(attotime::never);
2120   
2120
21212121   // install the cart ROM into the address map, if present
21222122   m_cartslot->install_rom();
21232123
r23623r23624
21442144      m_maincpu->space(AS_PROGRAM).install_read_handler(0xe000000, 0xe01ffff, read32_delegate(FUNC(gba_cart_slot_device::read_ram),(gba_cart_slot_device*)m_cartslot));
21452145      m_maincpu->space(AS_PROGRAM).install_write_handler(0xe000000, 0xe01ffff, write32_delegate(FUNC(gba_cart_slot_device::write_ram),(gba_cart_slot_device*)m_cartslot));
21462146   }
2147   
2147
21482148   save_item(NAME(m_DISPSTAT));
21492149   save_item(NAME(m_BG2X));
21502150   save_item(NAME(m_BG2Y));
r23623r23624
22412241   SLOT_INTERFACE_INTERNAL("gba_eeprom",      GBA_ROM_EEPROM)
22422242   SLOT_INTERFACE_INTERNAL("gba_eeprom_4k",   GBA_ROM_EEPROM)
22432243   SLOT_INTERFACE_INTERNAL("gba_eeprom_64k",  GBA_ROM_EEPROM64)
2244   SLOT_INTERFACE_INTERNAL("gba_flash",       GBA_ROM_FLASH)   // Panasonic
2245   SLOT_INTERFACE_INTERNAL("gba_flash_512",   GBA_ROM_FLASH)   // Panasonic
2246   SLOT_INTERFACE_INTERNAL("gba_flash_1m",    GBA_ROM_FLASH1M)   // Sanyo
2244   SLOT_INTERFACE_INTERNAL("gba_flash",       GBA_ROM_FLASH)   // Panasonic
2245   SLOT_INTERFACE_INTERNAL("gba_flash_512",   GBA_ROM_FLASH)   // Panasonic
2246   SLOT_INTERFACE_INTERNAL("gba_flash_1m",    GBA_ROM_FLASH1M) // Sanyo
22472247SLOT_INTERFACE_END
22482248
22492249
trunk/src/mess/drivers/altos5.c
r23623r23624
129129   // normalise bank number (4x becomes 0x; 2x and 1x are already ok)
130130   return data & 0x3f;
131131}
132   
132
133133void altos5_state::setup_banks(UINT8 source)
134134{
135135   offs_t offs,temp;
r23623r23624
248248{
249249   DEVCB_DRIVER_LINE_MEMBER(altos5_state, busreq_w),
250250   DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_IRQ0),
251   DEVCB_NULL,   // BAO, not used
251   DEVCB_NULL, // BAO, not used
252252   DEVCB_DRIVER_MEMBER(altos5_state, memory_read_byte),
253253   DEVCB_DRIVER_MEMBER(altos5_state, memory_write_byte),
254254   DEVCB_DRIVER_MEMBER(altos5_state, io_read_byte),
r23623r23624
300300d0: L = a HD is present
301301d1: L = a 2nd hard drive is present
302302d2: unused configuration input (must be H to skip HD boot)
303d3: selected floppy is single(L) or double sided(H)
303d3: selected floppy is single(L) or double sided(H)
304304d7: IRQ from FDC
305305*/
306306READ8_MEMBER( altos5_state::port08_r )
trunk/src/mess/drivers/vt100.c
r23623r23624
2727#include "video/vtvideo.h"
2828#include "vt100.lh"
2929
30#define RS232_TAG      "rs232"
31#define COM5016T_TAG   "com5016t"
30#define RS232_TAG       "rs232"
31#define COM5016T_TAG    "com5016t"
3232
3333class vt100_state : public driver_device
3434{
trunk/src/mess/drivers/chessmst.c
r23623r23624
2323      : driver_device(mconfig, type, tag),
2424         m_maincpu(*this, "maincpu"),
2525         m_speaker(*this, "speaker")
26          { }
26            { }
2727
2828   required_device<cpu_device> m_maincpu;
2929   required_device<speaker_sound_device> m_speaker;
trunk/src/mess/drivers/superslave.c
r23623r23624
104104WRITE8_MEMBER( superslave_state::memctrl_w )
105105{
106106   /*
107   
107
108108       bit     description
109   
109
110110       0       Memory bank 0 on
111111       1       Memory bank 1 on
112       2       
113       3       
112       2
113       3
114114       4       Unswitched memory boundary bit 0
115115       5       Unswitched memory boundary bit 1
116116       6       Unswitched memory boundary bit 2
117117       7       Unswitched memory boundary bit 3
118   
118
119119   */
120120
121121   m_memctrl = data;
r23623r23624
129129READ8_MEMBER( superslave_state::status_r)
130130{
131131   /*
132   
132
133133       bit     description
134   
134
135135       0       Sense Switch (0=closed)
136136       1       Parity error (1=error)
137137       2       Syncerr (1=error)
r23623r23624
140140       5       Data Set Ready 2
141141       6       Data Set Ready 1
142142       7       Data Set Ready 0
143   
143
144144   */
145145
146146   UINT8 data = 1;
r23623r23624
162162WRITE8_MEMBER( superslave_state::cmd_w )
163163{
164164   /*
165   
165
166166       bit     description
167   
167
168168       0       Prom enable (1=enabled)
169169       1       Clear Parity (1=cleared)
170170       2       Clear Syncerr (1=cleared)
r23623r23624
173173       5       Command bit 5
174174       6       Command bit 6
175175       7       Command bit 7
176   
176
177177   */
178178
179179   m_cmd = data;
trunk/src/mess/drivers/ql.c
r23623r23624
144144       bit     description
145145
146146       0       Serial data input (SER2 RxD, SER1 TxD)
147       1       
148       2       
149       3       
150       4       
151       5       
152       6       
147       1
148       2
149       3
150       4
151       5
152       6
153153       7       ZX8302 serial link input/output (COMDATA)
154154
155155   */
r23623r23624
176176
177177       bit     description
178178
179       0       
179       0
180180       1       Speaker output
181181       2       Interrupt output (IPL0-2)
182182       3       Interrupt output (IPL1)
183183       4       Serial Clear-to-Send output (SER1 CTS)
184184       5       Serial Data Terminal Ready output (SER2 DTR)
185       6       
185       6
186186       7       ZX8302 serial link input/output (COMDATA)
187187
188188   */
r23623r23624
10741074//-------------------------------------------------
10751075
10761076static MACHINE_CONFIG_DERIVED( opd, ql )
1077    // internal ram
1078    MCFG_RAM_MODIFY(RAM_TAG)
1079    MCFG_RAM_DEFAULT_SIZE("128K")
1080    MCFG_RAM_EXTRA_OPTIONS("256K")
1077   // internal ram
1078   MCFG_RAM_MODIFY(RAM_TAG)
1079   MCFG_RAM_DEFAULT_SIZE("128K")
1080   MCFG_RAM_EXTRA_OPTIONS("256K")
10811081MACHINE_CONFIG_END
10821082
10831083
trunk/src/mess/drivers/pv1000.c
r23623r23624
3535      UINT16  period;
3636      UINT8   val;
3737   }       m_voice[4];
38   
38
3939   sound_stream    *m_sh_channel;
4040};
4141
r23623r23624
9595
9696/*
9797 plgDavid's audio implementation/analysis notes:
98
98
9999 Sound appears to be 3 50/50 pulse voices made by cutting the main clock by 1024,
100100 then by the value of the 6bit period registers.
101101 This creates a surprisingly accurate pitch range.
102
102
103103 Note: the register periods are inverted.
104104 */
105105
106106void pv1000_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
107107{
108108   stream_sample_t *buffer = outputs[0];
109   
109
110110   while (samples > 0)
111111   {
112112      *buffer=0;
113     
113
114114      for (int i = 0; i < 3; i++)
115115      {
116116         UINT32 per = (0x3f - (m_voice[i].period & 0x3f));
117         
118         if (per != 0)   //OFF!
117
118         if (per != 0)   //OFF!
119119            *buffer += m_voice[i].val * 8192;
120         
120
121121         m_voice[i].count++;
122         
122
123123         if (m_voice[i].count >= per)
124124         {
125125            m_voice[i].count = 0;
126126            m_voice[i].val = !m_voice[i].val;
127127         }
128128      }
129     
129
130130      buffer++;
131131      samples--;
132132   }
r23623r23624
412412
413413   m_gfxram = memregion("gfxram")->base();
414414   save_pointer(NAME(m_gfxram), 0x400);
415   
415
416416   save_item(NAME(m_io_regs));
417417   save_item(NAME(m_fd_data));
418418   save_item(NAME(m_pcg_bank));
trunk/src/mess/drivers/applix.c
r23623r23624
954954
955955DRIVER_INIT_MEMBER(applix_state, applix)
956956{
957
958957   floppy_connector *con = machine().device<floppy_connector>("wd1772:0");
959958   floppy_image_device *floppy = con ? con->get_device() : 0;
960959   if (floppy)
trunk/src/mess/drivers/ep64.c
r23623r23624
1313Enterprise Computers Ltd. 1985
1414
1515MAIN PCB Layout
16--------------- 
16---------------
1717                                        DUAL
1818|-----------| 9V                        TAPE_IN/OUT                             RES
19|HEATSINK   | DC_IN             MON1    AND REMOTE     SR1    PR1   CN2A CN1A   |-|                     
19|HEATSINK   | DC_IN             MON1    AND REMOTE     SR1    PR1   CN2A CN1A   |-|
2020|           |--||---|--||--|--| |--| |-||-||-||-||-| |----| |-----| |--| |--| |-|-|------|
21|-----------|7805   | MOD  |  |-|  |-|             |-|    |-|     |-|  |-|  |-|   EXP2 --|EXTERNAL           
21|-----------|7805   | MOD  |  |-|  |-|             |-|    |-|     |-|  |-|  |-|   EXP2 --|EXTERNAL
2222        |---+7805   |      |                         74LS06 74LS273 74LS86 74LS32      --|EXPANSION
2323        |   |       |------|             74LS244                                       --|CONNECTOR
2424        |   |78L12 POT1  LM386                               |-----|   |-----|   EXP1  --|
r23623r23624
2727        |   |            4.433619MHz     74LS145 POT3 LED    |-----|   |-----|         --|
2828        |---+                                                                          --|
2929            |                            74LS74      74LS244  74LS244  74LS245 |---------|
30            |                                                                  |           
30            |                                                                  |
3131            | 74LS373                    4164  4164  74F157                    |
3232            |                                                                  |
3333            | 16-2-103   LM339    LM324  4164  4164  74F157           EXOS.IC2 |
r23623r23624
3838            |------------------------------------------------------------------|
3939Notes: (all IC's shown)
4040           Z80A - Z80A CPU, clock input 4MHz [8/2]
41       EXOS.IC2 - 32k x8-bit mask ROM usually 23256 manufactured by GI (DIP24). Contains EXOS operating
42                  system and built-in word processor software. A few official revisions were made and
41       EXOS.IC2 - 32k x8-bit mask ROM usually 23256 manufactured by GI (DIP24). Contains EXOS operating
42                  system and built-in word processor software. A few official revisions were made and
4343                  there were a few unofficial revision made with additional capabilities and bug-fixes
4444                  ROM labelling of some official versions found....
4545                  9256DS-0019 (C)1984 INTELLIGENT SOFTWARE LTD ENTER 08-45-A GI
r23623r23624
7777            MOD - Astec UM1233 TV modulator
7878            RES - Reset push button switch
7979           MON1 - Monitor output connector. Pinout is....
80           
80
8181                            Green  A1 B1 NC
8282                            Ground A2 B2 Ground
8383                  Mono Comp. Video A3 B3 Blue
r23623r23624
8585                             VSync A5 B5 Composite Sync
8686                                NC A6 B6 Mode Switch
8787                        Left Audio A7 B7 Right Audio
88           
88
8989            SR1 - Serial/Network connector. Pinout is....
90           
90
9191                         Reference A1 B1 Ground
9292                                 - A2 B2 -
9393                               RTS A3 B3 Data Out
9494                               CTS A4 B4 Data In
9595
9696            PR1 - Printer connector. Pinout is....
97                 
97
9898                            Ground A1 B1 Ground
9999                            Strobe A2 B2 Ready
100100                            Data 3 A3 B3 Data 4
r23623r23624
104104                            Data 0 A7 B7 Data 7
105105
106106           CN2A - Joystick 2 connector
107           CN1A - Joystick 1 connector
107           CN1A - Joystick 1 connector
108108                  Pinout is....
109                 
109
110110                          Keyboard J A1 B1 Ground
111111                          Keyboard L A2 B2 Keyboard K
112112                                   - A3 B3 -
r23623r23624
116116
117117
118118Internal Memory Expansion PCB Layout
119------------------------------------     
119------------------------------------
120120
121121|---------------------|
122122|  4164 74LS00 PL3 PL2|
r23623r23624
138138
139139/*
140140
141   TODO:
141    TODO:
142142
143   - POST RAM errors
144   - rewrite DAVE to output to discrete DAC
145   - rewrite NICK
146   - cassette
147   - external joysticks
143    - POST RAM errors
144    - rewrite DAVE to output to discrete DAC
145    - rewrite NICK
146    - cassette
147    - external joysticks
148148
149   http://ep.homeserver.hu/Dokumentacio/Konyvek/
149    http://ep.homeserver.hu/Dokumentacio/Konyvek/
150150
151151*/
152152
r23623r23624
191191WRITE8_MEMBER( ep64_state::wr0_w )
192192{
193193   /*
194   
194
195195       bit     description
196   
196
197197       0       KEY A
198198       1       KEY B
199199       2       KEY C
r23623r23624
202202       5       CASSETTE OUT
203203       6       REMOTE 1
204204       7       REMOTE 2
205   
205
206206   */
207207
208208   // keyboard
r23623r23624
228228READ8_MEMBER( ep64_state::rd1_r )
229229{
230230   /*
231   
231
232232       bit     description
233   
233
234234       0       KBJ
235235       1       KBK
236236       2       KBL
r23623r23624
239239       5       SERIAL/NET STATUS IN
240240       6       CASSETTE IN
241241       7       ?
242   
242
243243   */
244244
245245   UINT8 data = 0;
r23623r23624
265265WRITE8_MEMBER( ep64_state::wr2_w )
266266{
267267   /*
268   
268
269269       bit     description
270   
270
271271       0       SERIAL/NET DATA OUT
272272       1       SERIAL/NET STATUS OUT
273       2       
274       3       
275       4       
276       5       
277       6       
278       7       
279   
273       2
274       3
275       4
276       5
277       6
278       7
279
280280   */
281281
282282   // serial
r23623r23624
596596   ROM_CART_LOAD( "cart", 0x00000, 0x10000, ROM_MIRROR )
597597ROM_END
598598
599#define rom_phc64   rom_ep64
599#define rom_phc64   rom_ep64
600600
601601
602602//-------------------------------------------------
trunk/src/mess/drivers/argo.c
r23623r23624
3535
3636   argo_state(const machine_config &mconfig, device_type type, const char *tag)
3737      : driver_device(mconfig, type, tag),
38        m_maincpu(*this, "maincpu"),
39        m_p_videoram(*this, "p_videoram"){ }
38         m_maincpu(*this, "maincpu"),
39         m_p_videoram(*this, "p_videoram"){ }
4040
4141   required_device<cpu_device> m_maincpu;
4242   DECLARE_WRITE8_MEMBER(argo_videoram_w);
trunk/src/mess/drivers/tec1.c
r23623r23624
258258   else
259259   if (m_kbd_row == 3)
260260      i = m_io_line3->read();
261   
261
262262   /* if previous key is still held, bail out */
263263   if (i)
264264      if (tec1_convert_col_to_bin(i, m_kbd_row) == m_kbd)
trunk/src/mess/drivers/softbox.c
r23623r23624
55    http://mikenaberezny.com/hardware/pet-cbm/sse-softbox-z80-computer/
66
77
8   Using the Corvus hard disk
9   --------------------------
8    Using the Corvus hard disk
9    --------------------------
1010
11   The SoftBox distribution disk (softbox-distrib.d80) is configured for
12   a CBM 8050 as CP/M drives A/B and a 10MB Corvus hard disk as drives C/D.
11    The SoftBox distribution disk (softbox-distrib.d80) is configured for
12    a CBM 8050 as CP/M drives A/B and a 10MB Corvus hard disk as drives C/D.
1313
14   Use the CHDMAN utility to create a 10MB hard disk image for the Corvus:
14    Use the CHDMAN utility to create a 10MB hard disk image for the Corvus:
1515
16   $ chdman createhd -o /path/to/corvus10mb.chd -chs 358,3,20 -ss 512
16    $ chdman createhd -o /path/to/corvus10mb.chd -chs 358,3,20 -ss 512
1717
18   Start the SoftBox emulator with the floppy and hard disk images mounted:
18    Start the SoftBox emulator with the floppy and hard disk images mounted:
1919
20   $ mess softbox -flop1 /path/to/softbox-distrib.d80 \
21                  -hard1 /path/to/corvus10mb.chd
20    $ mess softbox -flop1 /path/to/softbox-distrib.d80 \
21                   -hard1 /path/to/corvus10mb.chd
2222
23   Before the Corvus can be used under CP/M, it must be prepared
24   by running DIAG.COM and FORMAT.COM.
23    Before the Corvus can be used under CP/M, it must be prepared
24    by running DIAG.COM and FORMAT.COM.
2525
26   DIAG.COM
26    DIAG.COM
2727
28   Enter "diag" (no arguments) at the CP/M prompt to run the Corvus diagnostics
29   program.  This program will perform the Corvus low-level format.
28    Enter "diag" (no arguments) at the CP/M prompt to run the Corvus diagnostics
29    program.  This program will perform the Corvus low-level format.
3030
31   Select option 6 (Update Controller Code) at the menu.
32   Enter "corvb184.fmt" when prompted for the filename.
33   Enter "y" at the confirmation prompts.
34   Enter "1" for the Corvus drive number (two prompts).
35   After formatting is complete, it will return to the menu.
31    Select option 6 (Update Controller Code) at the menu.
32    Enter "corvb184.fmt" when prompted for the filename.
33    Enter "y" at the confirmation prompts.
34    Enter "1" for the Corvus drive number (two prompts).
35    After formatting is complete, it will return to the menu.
3636
37   Select option 3 (Read Controller Code Version #) at the menu.
38   Enter "1" for the Corvus drive number.
39   It should report "V18.4AP" and then return to the menu.
37    Select option 3 (Read Controller Code Version #) at the menu.
38    Enter "1" for the Corvus drive number.
39    It should report "V18.4AP" and then return to the menu.
4040
41   Select option 9 to return to CP/M.
41    Select option 9 to return to CP/M.
4242
43   FORMAT.COM
43    FORMAT.COM
4444
45   Enter "format" (no arguments) at the CP/M prompt to run the SoftBox disk
46   format program.  This program will perform the CP/M filesystem format.
45    Enter "format" (no arguments) at the CP/M prompt to run the SoftBox disk
46    format program.  This program will perform the CP/M filesystem format.
4747
48   Enter drive letter "c" at the prompt.
49   Enter "y" to confirm the format.
50   After formatting is complete, it will prompt for a drive letter again.
48    Enter drive letter "c" at the prompt.
49    Enter "y" to confirm the format.
50    After formatting is complete, it will prompt for a drive letter again.
5151
52   Enter drive letter "d" at the prompt.
53   Enter "y" to confirm the format.
54   After formatting is complete, it will prompt for a drive letter again.
52    Enter drive letter "d" at the prompt.
53    Enter "y" to confirm the format.
54    After formatting is complete, it will prompt for a drive letter again.
5555
56   Press RETURN to return to CP/M.
56    Press RETURN to return to CP/M.
5757
58   STAT.COM
58    STAT.COM
5959
60   After all steps are completed, drives C and D should be usable from
61   CP/M.  Each drive is one half of the Corvus 10MB disk.  Running the
62   command "stat c: dsk:" should show 4712 kilobyte drive capacity.
63   Drive D should show the same information.
60    After all steps are completed, drives C and D should be usable from
61    CP/M.  Each drive is one half of the Corvus 10MB disk.  Running the
62    command "stat c: dsk:" should show 4712 kilobyte drive capacity.
63    Drive D should show the same information.
6464
6565
66   Using other Corvus hard disk sizes
67   ----------------------------------
66    Using other Corvus hard disk sizes
67    ----------------------------------
6868
69   The SoftBox supports 5, 10, and 20 MB hard disks.  The distribution disk
70   is configured for 10 MB as explained above.  To use other sizes, make
71   a new image with CHDMAN.  See the top of src/mess/includes/corvushd.h
72   for the parameters for the other drives.
69    The SoftBox supports 5, 10, and 20 MB hard disks.  The distribution disk
70    is configured for 10 MB as explained above.  To use other sizes, make
71    a new image with CHDMAN.  See the top of src/mess/includes/corvushd.h
72    for the parameters for the other drives.
7373
74   After the image has been created and the SoftBox emulator started with
75   it mounted, the SoftBox BIOS needs to be told what size Corvus hard
76   disk is attached.  Use the NEWSYS.COM utility to reconfigure the drive
77   size.  When NEWSYS prompts for a source drive, enter "a" (the drive letter
78   of the CP/M distribution disk).  Use option "d" (Disk drive assignment)
79   to reconfigure the Corvus size.  After the change has been made, use option
80   "s" (Save new system) to write the configuration to the floppy (drive A) and
81   option "e" (Execute new system) to restart CP/M with the configuration. 
82   DIAG.COM and FORMAT.COM can then be used to format the hard disk.
74    After the image has been created and the SoftBox emulator started with
75    it mounted, the SoftBox BIOS needs to be told what size Corvus hard
76    disk is attached.  Use the NEWSYS.COM utility to reconfigure the drive
77    size.  When NEWSYS prompts for a source drive, enter "a" (the drive letter
78    of the CP/M distribution disk).  Use option "d" (Disk drive assignment)
79    to reconfigure the Corvus size.  After the change has been made, use option
80    "s" (Save new system) to write the configuration to the floppy (drive A) and
81    option "e" (Execute new system) to restart CP/M with the configuration.
82    DIAG.COM and FORMAT.COM can then be used to format the hard disk.
8383
8484*/
8585
trunk/src/mess/drivers/concept.c
r23623r23624
237237   MCFG_MOS6551_ADD(ACIA_1_TAG, XTAL_1_8432MHz, NULL)
238238
239239   MCFG_CONCEPT_EXP_PORT_ADD("exp1", concept_exp_devices, NULL)
240   MCFG_CONCEPT_EXP_PORT_ADD("exp2", concept_exp_devices, "fdc")   // Flat cable Hard Disk Controller in Slot 2
241   MCFG_CONCEPT_EXP_PORT_ADD("exp3", concept_exp_devices, "hdc")   // Floppy Disk Controller in Slot 3
240   MCFG_CONCEPT_EXP_PORT_ADD("exp2", concept_exp_devices, "fdc")   // Flat cable Hard Disk Controller in Slot 2
241   MCFG_CONCEPT_EXP_PORT_ADD("exp3", concept_exp_devices, "hdc")   // Floppy Disk Controller in Slot 3
242242   MCFG_CONCEPT_EXP_PORT_ADD("exp4", concept_exp_devices, NULL)
243243
244244   // 2x RS232 ports!
r23623r23624
249249   ROM_REGION16_BE(0x100000,"maincpu",0)   /* 68k rom and ram */
250250
251251   // concept boot ROM
252   ROM_SYSTEM_BIOS(0, "lvl8", "Level 8" )   // v0?
252   ROM_SYSTEM_BIOS(0, "lvl8", "Level 8" )  // v0?
253253   ROMX_LOAD("bootl08h", 0x010000, 0x1000, CRC(ee479f51) SHA1(b20ba18564672196076e46507020c6d69a640a2f), ROM_BIOS(1) | ROM_SKIP(1))
254254   ROMX_LOAD("bootl08l", 0x010001, 0x1000, CRC(acaefd07) SHA1(de0c7eaacaf4c0652aa45e523cebce2b2993c437), ROM_BIOS(1) | ROM_SKIP(1))
255255
256   ROM_SYSTEM_BIOS(1, "lvl7", "Level 7" )   // v0? v1?
256   ROM_SYSTEM_BIOS(1, "lvl7", "Level 7" )  // v0? v1?
257257   ROMX_LOAD("cc07h", 0x010000, 0x1000, CRC(455abac8) SHA1(b12e1580220242d34eafed1b486cebd89e823c8b), ROM_BIOS(2) | ROM_SKIP(1))
258258   ROMX_LOAD("cc07l", 0x010001, 0x1000, CRC(107a3830) SHA1(0ea12ef13b0d11fcd83b306b3a1bb8014ba910c0), ROM_BIOS(2) | ROM_SKIP(1))
259259
260   ROM_SYSTEM_BIOS(2, "lvl6", "Level 6" )   // v0?
260   ROM_SYSTEM_BIOS(2, "lvl6", "Level 6" )  // v0?
261261   ROMX_LOAD("cc06h", 0x010000, 0x1000, CRC(66b6b259) SHA1(1199a38ef3e94f695e8da6a7c80c6432da3cb80c), ROM_BIOS(3) | ROM_SKIP(1))
262262   ROMX_LOAD("cc06l", 0x010001, 0x1000, CRC(600940d3) SHA1(c3278bf23b3b1c35ea1e3da48a05e877862a8345), ROM_BIOS(3) | ROM_SKIP(1))
263263
264264#if 0
265265   // version 1 lvl 7 release
266   ROM_LOAD16_BYTE("bootl17h", 0x010000, 0x1000, CRC(6dd9718f))   // where does this come from?
266   ROM_LOAD16_BYTE("bootl17h", 0x010000, 0x1000, CRC(6dd9718f))    // where does this come from?
267267   ROM_LOAD16_BYTE("bootl17l", 0x010001, 0x1000, CRC(107a3830))
268268#elif 0
269269   // version $F lvl 8 (development version found on a floppy disk along with
trunk/src/mess/drivers/qx10.c
r23623r23624
4545
4646#define MAIN_CLK    15974400
4747
48#define RS232_TAG   "rs232"
48#define RS232_TAG   "rs232"
4949
5050/*
5151    Driver data
r23623r23624
696696/* TODO: shift break */
697697/*INPUT_CHANGED_MEMBER(qx10_state::key_stroke)
698698{
699   if(newval && !oldval)
700   {
701      m_keyb.rx = (UINT8)(FPTR)(param) & 0x7f;
702      m_pic_m->ir4_w(1);
703   }
699    if(newval && !oldval)
700    {
701        m_keyb.rx = (UINT8)(FPTR)(param) & 0x7f;
702        m_pic_m->ir4_w(1);
703    }
704704
705   if(oldval && !newval)
706      m_keyb.rx = 0;
705    if(oldval && !newval)
706        m_keyb.rx = 0;
707707}*/
708708
709709static INPUT_PORTS_START( qx10 )
trunk/src/mess/drivers/cortex.c
r23623r23624
1616        TMS9929   - Video
1717        TMS9911   - DMA to floppy
1818        TMS9909   - Floppy Disk Controller
19   AY-5-2376 - Keyboard controller
19    AY-5-2376 - Keyboard controller
2020
2121****************************************************************************/
2222
trunk/src/mess/drivers/abc80.c
r23623r23624
215215   PORT_DIPUNKNOWN_DIPLOC( 0x20, IP_ACTIVE_LOW, "SW1:6" )
216216   PORT_DIPUNKNOWN_DIPLOC( 0x40, IP_ACTIVE_LOW, "SW1:7" )
217217   PORT_DIPUNKNOWN_DIPLOC( 0x80, IP_ACTIVE_LOW, "SW1:8" )
218   
218
219219   PORT_START("SW2")
220220   PORT_DIPUNKNOWN_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW2:1" )
221221   PORT_DIPUNKNOWN_DIPLOC( 0x02, IP_ACTIVE_LOW, "SW2:2" )
trunk/src/mess/drivers/bml3.c
r23623r23624
806806TIMER_DEVICE_CALLBACK_MEMBER(bml3_state::keyboard_callback)
807807{
808808   static const char *const portnames[3] = { "key1","key2","key3" };
809    int i,port_i,scancode,trigger = 0;
809   int i,port_i,scancode,trigger = 0;
810810
811    if(!m_keyb_press_flag)
812    {
813       m_keyb_scancode = (m_keyb_scancode + 1) & 0x7F;
814       scancode = m_keyb_scancode;
811   if(!m_keyb_press_flag)
812   {
813      m_keyb_scancode = (m_keyb_scancode + 1) & 0x7F;
814      scancode = m_keyb_scancode;
815815
816       if (scancode == 0x7F)
817       {
818          if (m_keyb_empty_scan == 1)
819          {
820             // full scan completed with no keypress
821             m_keyb_press = 0;
822             if (!m_keyb_counter_operation_disabled)
823                trigger = !0;
824           }
825          if (m_keyb_empty_scan > 0)
826             m_keyb_empty_scan--;
827        }
828       else if (scancode < 32*3)
829       {
830          port_i = scancode / 32;
831          i = scancode % 32;
816      if (scancode == 0x7F)
817      {
818         if (m_keyb_empty_scan == 1)
819         {
820            // full scan completed with no keypress
821            m_keyb_press = 0;
822            if (!m_keyb_counter_operation_disabled)
823               trigger = !0;
824         }
825         if (m_keyb_empty_scan > 0)
826            m_keyb_empty_scan--;
827      }
828      else if (scancode < 32*3)
829      {
830         port_i = scancode / 32;
831         i = scancode % 32;
832832         if((ioport(portnames[port_i])->read()>>i) & 1)
833833         {
834             m_keyb_empty_scan = 2;
835             trigger = !0;
836          }
837       }
838       if (trigger)
839       {
840          m_keyb_press_flag = 1;
841          m_keyb_press = m_keyb_scancode | 0x80;
842          if (!m_keyb_interrupt_disabled)
834            m_keyb_empty_scan = 2;
835            trigger = !0;
836         }
837      }
838      if (trigger)
839      {
840         m_keyb_press_flag = 1;
841         m_keyb_press = m_keyb_scancode | 0x80;
842         if (!m_keyb_interrupt_disabled)
843843            m_maincpu->set_input_line(M6809_IRQ_LINE, HOLD_LINE);
844       }
845       /*
846       else {
847          // #$# ? don't need this
848         m_maincpu->set_input_line(M6809_IRQ_LINE, CLEAR_LINE);
849       }
850       */
851    }
844      }
845      /*
846      else {
847          // #$# ? don't need this
848          m_maincpu->set_input_line(M6809_IRQ_LINE, CLEAR_LINE);
849      }
850      */
851   }
852852
853853}
854854
r23623r23624
11671167   MCFG_PIA6821_ADD("pia6821", bml3_pia_config)
11681168   MCFG_ACIA6850_ADD("acia6850", bml3_acia_if)
11691169
1170    /* floppy */
1170   /* floppy */
11711171   // #$# not sure what wd17xx model, this is just a guess
1172    MCFG_WD1773_ADD("fdc", bml3_wd17xx_interface )
1173    MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(bml3_floppy_interface)
1172   MCFG_WD1773_ADD("fdc", bml3_wd17xx_interface )
1173   MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(bml3_floppy_interface)
11741174
11751175   /* Audio */
11761176   MCFG_SPEAKER_STANDARD_MONO("mono")
trunk/src/mess/drivers/victor9k.c
r23623r23624
99
1010/*
1111
12   Sector format
13   -------------
12    Sector format
13    -------------
1414
15   Header sync
16   Sector header (header ID, track ID, sector ID, and checksum)
17   Gap 1
18   Data Sync
19   Data field (data sync, data ID, data bytes, and checksum)
20   Gap 2
15    Header sync
16    Sector header (header ID, track ID, sector ID, and checksum)
17    Gap 1
18    Data Sync
19    Data field (data sync, data ID, data bytes, and checksum)
20    Gap 2
2121
22   Track format
23   ------------
24   
25   ZONE      LOWER HEAD   UPPER HEAD    SECTORS      ROTATIONAL
26   NUMBER      TRACKS      TRACKS      PER TRACK    PERIOD (MS)
22    Track format
23    ------------
2724
28   0          0-3         unused      19          237.9
29   1          4-15      0-7         18          224.5
30   2          16-26      8-18      17          212.2
31   3          27-37      19-29      16          199.9
32   4          38-48      30-40      15          187.6
33   5          49-59      41-51      14          175.3
34   6          60-70      52-62      13          163.0
35   7          71-79      63-74      12         149.6
36   8          unused      75-79      11          144.0
25    ZONE        LOWER HEAD  UPPER HEAD  SECTORS     ROTATIONAL
26    NUMBER      TRACKS      TRACKS      PER TRACK   PERIOD (MS)
3727
28    0           0-3         unused      19          237.9
29    1           4-15        0-7         18          224.5
30    2           16-26       8-18        17          212.2
31    3           27-37       19-29       16          199.9
32    4           38-48       30-40       15          187.6
33    5           49-59       41-51       14          175.3
34    6           60-70       52-62       13          163.0
35    7           71-79       63-74       12          149.6
36    8           unused      75-79       11          144.0
37
3838*/
3939
4040/*
r23623r23624
6767READ8_MEMBER( victor9k_state::floppy_p1_r )
6868{
6969   /*
70   
70
7171       bit     description
72   
72
7373       0       L0MS0
7474       1       L0MS1
7575       2       L0MS2
r23623r23624
7878       5       L1MS1
7979       6       L1MS2
8080       7       L1MS3
81   
81
8282   */
8383
8484   return m_lms;
r23623r23624
9292READ8_MEMBER( victor9k_state::floppy_p2_r )
9393{
9494   /*
95   
95
9696       bit     description
97   
98       0       
99       1       
100       2       
101       3       
102       4       
103       5       
97
98       0
99       1
100       2
101       3
102       4
103       5
104104       6       RDY0
105105       7       RDY1
106   
106
107107   */
108108
109109   UINT8 data = 0;
r23623r23624
122122WRITE8_MEMBER( victor9k_state::floppy_p2_w )
123123{
124124   /*
125   
125
126126       bit     description
127   
127
128128       0       START0
129129       1       STOP0
130130       2       START1
131131       3       STOP1
132132       4       SEL1
133133       5       SEL0
134       6       
135       7       
136   
134       6
135       7
136
137137   */
138138
139139   if (BIT(data, 0)) m_floppy0->mon_w(0);
r23623r23624
142142   if (BIT(data, 3)) m_floppy1->mon_w(1);
143143
144144   int sel0 = BIT(data, 5);
145   
145
146146   if (m_sel0 && !sel0)
147147   {
148148      m_da0 = m_da;
r23623r23624
152152   m_sel0 = sel0;
153153
154154   int sel1 = BIT(data, 4);
155   
155
156156   if (m_sel1 && !sel1)
157157   {
158158      m_da1 = m_da;
r23623r23624
10341034
10351035   // single/double sided
10361036   data |= (m_drive ? m_floppy1->twosid_r() : m_floppy0->twosid_r()) << 5;
1037   
1037
10381038   return data;
10391039}
10401040
r23623r23624
11481148void victor9k_state::ready1_cb(floppy_image_device *device, int state)
11491149{
11501150   m_rdy1 = state;
1151   
1151
11521152   m_via5->write_cb2(m_rdy1);
11531153}
11541154
trunk/src/mess/drivers/pc1512.c
r23623r23624
473473   offs_t addr = offset & 0x3ff;
474474   bool decoded = false;
475475
476   if      (                 addr <= 0x00f) { data = m_dmac->read(space, offset & 0x0f); decoded = true; }
476   if      (                 addr <= 0x00f) { data = m_dmac->read(space, offset & 0x0f); decoded = true; }
477477   else if (addr >= 0x020 && addr <= 0x021) { data = m_pic->read(space, offset & 0x01); decoded = true; }
478478   else if (addr >= 0x040 && addr <= 0x043) { data = m_pit->read(space, offset & 0x03); decoded = true; }
479479   else if (addr >= 0x060 && addr <= 0x06f) { data = system_r(space, offset & 0x0f); decoded = true; }
trunk/src/mess/drivers/a7000.c
r23623r23624
55    very preliminary driver by Angelo Salese,
66    based on work by Tomasz Slanina and Tom Walker
77
8   TODO:
9   - probably needs a full rewrite & merge with ssfindo.c
8    TODO:
9    - probably needs a full rewrite & merge with ssfindo.c
1010
1111    ???
1212    bp (0382827C) (second trigger)
trunk/src/mess/drivers/sdk86.c
r23623r23624
3131#include "machine/serial.h"
3232#include "sdk86.lh"
3333
34#define I8251_TAG      "i8251"
35#define RS232_TAG        "rs232"
34#define I8251_TAG       "i8251"
35#define RS232_TAG       "rs232"
3636
3737
3838class sdk86_state : public driver_device
r23623r23624
4040public:
4141   sdk86_state(const machine_config &mconfig, device_type type, const char *tag)
4242      : driver_device(mconfig, type, tag) ,
43        m_maincpu(*this, "maincpu"),
44        m_usart(*this, I8251_TAG)
43         m_maincpu(*this, "maincpu"),
44         m_usart(*this, I8251_TAG)
4545   { }
4646
4747   required_device<cpu_device> m_maincpu;
trunk/src/mess/drivers/pc.c
r23623r23624
15671567   MCFG_DEVICE_REMOVE("pit8253")
15681568
15691569   MCFG_PIT8253_ADD( "pit8253", pcjr_pit8253_config )
1570   
1570
15711571   MCFG_FLOPPY_DRIVE_ADD("fdc:0", asst128_floppies, "525ssqd", pc_state::asst128_formats)
15721572   MCFG_FLOPPY_DRIVE_ADD("fdc:1", asst128_floppies, "525ssqd", pc_state::asst128_formats)
15731573
r23623r23624
20382038ROM_START( t1000sl )
20392039   ROM_REGION(0x100000,"maincpu", 0)
20402040
2041    // 8076312.hu1 - most likely v01.04.00
2042    // 8075312.hu2
2041   // 8076312.hu1 - most likely v01.04.00
2042   // 8075312.hu2
20432043
20442044
20452045   // partlist says it has 1 128kbyte rom
trunk/src/mess/drivers/juicebox.c
r23623r23624
258258   address_space &space = m_maincpu->space(AS_PROGRAM);
259259
260260   smc_init();
261   
261
262262   space.install_readwrite_handler(0x01c00000, 0x01c0000b, 0, 0, read32_delegate(FUNC(s3c44b0_device::cpuwrap_r), &(*m_s3c44b0)),  write32_delegate(FUNC(s3c44b0_device::cpuwrap_w), &(*m_s3c44b0)));
263263   space.install_readwrite_handler(0x01d00000, 0x01d0002b, 0, 0, read32_delegate(FUNC(s3c44b0_device::uart_0_r), &(*m_s3c44b0)),  write32_delegate(FUNC(s3c44b0_device::uart_0_w), &(*m_s3c44b0)));
264264   space.install_readwrite_handler(0x01d04000, 0x01d0402b, 0, 0, read32_delegate(FUNC(s3c44b0_device::uart_1_r), &(*m_s3c44b0)),  write32_delegate(FUNC(s3c44b0_device::uart_1_w), &(*m_s3c44b0)));
trunk/src/mess/drivers/snes.c
r23623r23624
531531READ8_MEMBER( snes_console_state::snessa1_hi_r )
532532{
533533   UINT16 address = offset & 0xffff;
534   
534
535535   if (offset < 0x400000)
536536   {
537537      if (address < 0x2000)
r23623r23624
539539      else if (address < 0x6000)
540540      {
541541         if (address >= 0x2200 && address < 0x2400)
542            return m_cartslot->chip_read(space, offset);   // SA-1 Regs
542            return m_cartslot->chip_read(space, offset);    // SA-1 Regs
543543         else if (address >= 0x3000 && address < 0x3800)
544            return m_cartslot->chip_read(space, offset);   // Internal SA-1 RAM (2K)
544            return m_cartslot->chip_read(space, offset);    // Internal SA-1 RAM (2K)
545545         else
546546            return snes_r_io(space, address);
547547      }
548548      else if (address < 0x8000)
549         return m_cartslot->chip_read(space, offset);      // SA-1 BWRAM
549         return m_cartslot->chip_read(space, offset);        // SA-1 BWRAM
550550      else
551551         return m_cartslot->read_h(space, offset);
552552   }
r23623r23624
557557READ8_MEMBER( snes_console_state::snessa1_lo_r )
558558{
559559   UINT16 address = offset & 0xffff;
560   
560
561561   if (offset < 0x400000)
562562   {
563563      if (address < 0x2000)
r23623r23624
565565      else if (address < 0x6000)
566566      {
567567         if (address >= 0x2200 && address < 0x2400)
568            return m_cartslot->chip_read(space, offset);   // SA-1 Regs
568            return m_cartslot->chip_read(space, offset);    // SA-1 Regs
569569         else if (address >= 0x3000 && address < 0x3800)
570            return m_cartslot->chip_read(space, offset);   // Internal SA-1 RAM (2K)
570            return m_cartslot->chip_read(space, offset);    // Internal SA-1 RAM (2K)
571571         else
572572            return snes_r_io(space, address);
573573      }
574574      else if (address < 0x8000)
575         return m_cartslot->chip_read(space, offset);      // SA-1 BWRAM
575         return m_cartslot->chip_read(space, offset);        // SA-1 BWRAM
576576      else
577577         return m_cartslot->read_l(space, offset);
578578   }
579579   else if (offset < 0x500000)
580      return m_cartslot->chip_read(space, offset);      // SA-1 BWRAM (not mirrored above!)
580      return m_cartslot->chip_read(space, offset);        // SA-1 BWRAM (not mirrored above!)
581581   else
582      return snes_r_io(space, address);               // nothing mapped here!
582      return snes_r_io(space, address);                   // nothing mapped here!
583583}
584584
585585WRITE8_MEMBER( snes_console_state::snessa1_hi_w )
r23623r23624
592592      else if (address < 0x6000)
593593      {
594594         if (address >= 0x2200 && address < 0x2400)
595            m_cartslot->chip_write(space, offset, data);   // SA-1 Regs
595            m_cartslot->chip_write(space, offset, data);    // SA-1 Regs
596596         else if (address >= 0x3000 && address < 0x3800)
597            m_cartslot->chip_write(space, offset, data);   // Internal SA-1 RAM (2K)
597            m_cartslot->chip_write(space, offset, data);    // Internal SA-1 RAM (2K)
598598         else
599599            snes_w_io(space, address, data);
600600      }
601601      else if (address < 0x8000)
602         m_cartslot->chip_write(space, offset, data);      // SA-1 BWRAM
602         m_cartslot->chip_write(space, offset, data);        // SA-1 BWRAM
603603   }
604604}
605605
606606WRITE8_MEMBER( snes_console_state::snessa1_lo_w )
607607{
608608   if (offset >= 0x400000 && offset < 0x500000)
609      m_cartslot->chip_write(space, offset, data);      // SA-1 BWRAM (not mirrored above!)
609      m_cartslot->chip_write(space, offset, data);        // SA-1 BWRAM (not mirrored above!)
610610   else
611611      snessfx_hi_w(space, offset, data, 0xff);
612612}
r23623r23624
886886READ8_MEMBER( snes_console_state::snessgb_hi_r )
887887{
888888   UINT16 address = offset & 0xffff;
889   
889
890890   if (offset < 0x400000)
891891   {
892892      if (address < 0x2000)
trunk/src/mess/drivers/vip.c
r23623r23624
762762
763763   MCFG_VIP_BYTEIO_PORT_ADD(VIP_BYTEIO_PORT_TAG, vip_byteio_cards, NULL, WRITELINE(vip_state, byteio_inst_w))
764764   MCFG_VIP_EXPANSION_SLOT_ADD(VIP_EXPANSION_SLOT_TAG, XTAL_3_52128MHz/2, vip_expansion_cards, NULL)
765    MCFG_VIP_EXPANSION_SLOT_CALLBACKS(WRITELINE(vip_state, exp_int_w), WRITELINE(vip_state, exp_dma_out_w), WRITELINE(vip_state, exp_dma_in_w))
765   MCFG_VIP_EXPANSION_SLOT_CALLBACKS(WRITELINE(vip_state, exp_int_w), WRITELINE(vip_state, exp_dma_out_w), WRITELINE(vip_state, exp_dma_in_w))
766766
767767   // devices
768768   MCFG_QUICKLOAD_ADD("quickload", vip_state, vip, "bin,c8,c8x", 0)
trunk/src/mess/drivers/intv.c
r23623r23624
9494
9595   for (int i = 0; i < 16; i++)
9696   {
97      r = intv_colors[i * 3 + 0];
98      g = intv_colors[i * 3 + 1];
97      r = intv_colors[i * 3 + 0];
98      g = intv_colors[i * 3 + 1];
9999      b = intv_colors[i * 3 + 2];
100100      colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
101101      colortable_palette_set_color(machine().colortable, i + 16, MAKE_RGB(r, g, b));
trunk/src/mess/drivers/pes.c
r23623r23624
223223******************************************************************************/
224224/*static TIMER_CALLBACK_MEMBER(pes_state::serial_read_cb )
225225{
226   timer_set(attotime::from_hz(10000), TIMER_OUTFIFO_READ);
226    timer_set(attotime::from_hz(10000), TIMER_OUTFIFO_READ);
227227}*/
228228
229229DRIVER_INIT_MEMBER(pes_state,pes)
trunk/src/mess/drivers/vk100.c
r23623r23624
153153#include "machine/serial.h"
154154#include "vk100.lh"
155155
156#define RS232_TAG      "rs232"
157#define COM5016T_TAG   "com5016t"
156#define RS232_TAG       "rs232"
157#define COM5016T_TAG    "com5016t"
158158
159159class vk100_state : public driver_device
160160{
trunk/src/mess/drivers/pet.c
r23623r23624
668668
669669   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7_PAD)      PORT_CHAR(UCHAR_MAMEKEY(7_PAD))
670670   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0_PAD)      PORT_CHAR(UCHAR_MAMEKEY(0_PAD))
671   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7)          PORT_CHAR('7') PORT_CHAR('\'')
671   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7)          PORT_CHAR('7') PORT_CHAR('\'')
672672   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4)          PORT_CHAR('4') PORT_CHAR('$')
673673   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1)          PORT_CHAR('1') PORT_CHAR('!')
674674
trunk/src/mess/drivers/pasogo.c
r23623r23624
3030|----------------------------|
3131Notes: (all ICs shown)
3232
33       VG230    - Vadem VG230 single-chip PC platform. Contains 16 MHz NEC uPD70116H V30HL CPU
34                  (which is a high-speed low-power 8086 variation), IBM PC/XT-compatible core
33       VG230    - Vadem VG230 single-chip PC platform. Contains 16 MHz NEC uPD70116H V30HL CPU
34                  (which is a high-speed low-power 8086 variation), IBM PC/XT-compatible core
3535                  logic, LCD controller (CGA/AT&T640x400), keyboard matrix scanner, dual PCMCIA
3636                  2.1 card controller, EMS 4.0 hardware support for up to 64MB, built-in timer
3737                  PIC/DMA/UART/RTC controllers. The clock input is 32.2200MHz. An internal divider
3838                  creates a 16.11MHz clock for the V30HL CPU.
39       HM514800 - Hitachi HM514800 512k x8-bit DRAM         
39       HM514800 - Hitachi HM514800 512k x8-bit DRAM
4040       MC14071  - Motorola MC14071 Quad 2-input OR gate
4141       74HC04   - 74HC04 Hex inverter
4242       LM2937   - Texas Instruments LM2937ES-5 voltage regulator (Max 26V input, 5V output at 500mA)
r23623r23624
4545       VOL      - Volume pot
4646       CN5      - 5 pin connector for 4-way control pad (up/down/left/right/ground)
4747       CN4      - 5 pin connector for on/off switch and 2 buttons
48       CN3      - 2 pin power input from 6x AA-battery compartment (input voltage is 9V DC)       
49       CN2      - Flat cable connector for video out to LCD panel. When the LCD is powered on the pixels
50                  are blue. The LCD panel PCB has part number 97-44264-8 LMG6912RPFC LMG6910RPGR
48       CN3      - 2 pin power input from 6x AA-battery compartment (input voltage is 9V DC)
49       CN2      - Flat cable connector for video out to LCD panel. When the LCD is powered on the pixels
50                  are blue. The LCD panel PCB has part number 97-44264-8 LMG6912RPFC LMG6910RPGR
5151                  and contains the following parts.....
5252                  Matsushita 53008HEB-8
5353                  Sanyo LA6324N quad operational amplifier
5454                  Hitachi BD66285BFC LCD controller IC (x3)
5555                  Hitachi BD66284BFC LCD controller IC (x4)
56                  The LCD flat cable has several wires but 2 of them have frequencies which measure
56                  The LCD flat cable has several wires but 2 of them have frequencies which measure
5757                  69.9161Hz and 16.7798kHz. These are assumed to be VSync and HSync
5858       CN1      - Cart slot
5959       X1       - Marked 322. Measures 32.21732MHz so this is a common 32.22MHz OSC.
6060       X2       - No markings. Measures 32.768kHz and used for the RTC
6161       *        - These parts are on the other side of the PCB
62       
6362
63
6464Carts
6565-----
66All of the carts are identical. Most have only one surface mounted mask ROM. Either a
67MX23C8100 (8M) or YRM0442 (4M). Some are populated with additional parts including a 62256
6832kx8 SRAM, a 3v coin battery and a MM1081N reset chip plus a few resistors/capacitors and
66All of the carts are identical. Most have only one surface mounted mask ROM. Either a
67MX23C8100 (8M) or YRM0442 (4M). Some are populated with additional parts including a 62256
6832kx8 SRAM, a 3v coin battery and a MM1081N reset chip plus a few resistors/capacitors and
6969a transistor. All parts are surface mounted.
7070
7171PT-GMEM01B
r23623r23624
214214   UINT8 m_pc_spkrdata;
215215   UINT8 m_pc_input;
216216
217    int m_ppi_portc_switch_high;
218    int m_ppi_speaker;
219    int m_ppi_keyboard_clear;
220    UINT8 m_ppi_keyb_clock;
221    UINT8 m_ppi_portb;
222    UINT8 m_ppi_clock_signal;
223    UINT8 m_ppi_data_signal;
224    UINT8 m_ppi_shift_register;
225    UINT8 m_ppi_shift_enable;
217   int m_ppi_portc_switch_high;
218   int m_ppi_speaker;
219   int m_ppi_keyboard_clear;
220   UINT8 m_ppi_keyb_clock;
221   UINT8 m_ppi_portb;
222   UINT8 m_ppi_clock_signal;
223   UINT8 m_ppi_data_signal;
224   UINT8 m_ppi_shift_register;
225   UINT8 m_ppi_shift_enable;
226226
227227};
228228
trunk/src/mess/drivers/attache.c
r23623r23624
6868public:
6969   attache_state(const machine_config &mconfig, device_type type, const char *tag)
7070      : driver_device(mconfig, type, tag),
71        m_maincpu(*this,"maincpu"),
72        m_rom(*this,"boot"),
73        m_ram(*this,RAM_TAG),
74        m_char_rom(*this,"video"),
75        m_rtc(*this,"rtc"),
76        m_psg(*this,"psg"),
77        m_fdc(*this,"fdc"),
78        m_sio(*this,"sio"),
79        m_pio(*this,"pio"),
80        m_ctc(*this,"ctc"),
81        m_crtc(*this,"crtc"),
82        m_dma(*this, "dma"),
83        m_floppy0(*this, "fdc:0:525dd"),
84        m_floppy1(*this, "fdc:1:525dd"),
85        m_kb_row0(*this, "row0"),
86        m_kb_row1(*this, "row1"),
87        m_kb_row2(*this, "row2"),
88        m_kb_row3(*this, "row3"),
89        m_kb_row4(*this, "row4"),
90        m_kb_row5(*this, "row5"),
91        m_kb_row6(*this, "row6"),
92        m_kb_row7(*this, "row7"),
93        m_kb_mod(*this, "modifiers"),
94        m_membank1(*this, "bank1"),
95        m_membank2(*this, "bank2"),
96        m_membank3(*this, "bank3"),
97        m_membank4(*this, "bank4"),
98        m_membank5(*this, "bank5"),
99        m_membank6(*this, "bank6"),
100        m_membank7(*this, "bank7"),
101        m_membank8(*this, "bank8"),
102        m_nvram(*this, "nvram"),
103        m_rom_active(true),
104        m_gfx_enabled(false),
105        m_kb_clock(true),
106        m_kb_empty(true)
71         m_maincpu(*this,"maincpu"),
72         m_rom(*this,"boot"),
73         m_ram(*this,RAM_TAG),
74         m_char_rom(*this,"video"),
75         m_rtc(*this,"rtc"),
76         m_psg(*this,"psg"),
77         m_fdc(*this,"fdc"),
78         m_sio(*this,"sio"),
79         m_pio(*this,"pio"),
80         m_ctc(*this,"ctc"),
81         m_crtc(*this,"crtc"),
82         m_dma(*this, "dma"),
83         m_floppy0(*this, "fdc:0:525dd"),
84         m_floppy1(*this, "fdc:1:525dd"),
85         m_kb_row0(*this, "row0"),
86         m_kb_row1(*this, "row1"),
87         m_kb_row2(*this, "row2"),
88         m_kb_row3(*this, "row3"),
89         m_kb_row4(*this, "row4"),
90         m_kb_row5(*this, "row5"),
91         m_kb_row6(*this, "row6"),
92         m_kb_row7(*this, "row7"),
93         m_kb_mod(*this, "modifiers"),
94         m_membank1(*this, "bank1"),
95         m_membank2(*this, "bank2"),
96         m_membank3(*this, "bank3"),
97         m_membank4(*this, "bank4"),
98         m_membank5(*this, "bank5"),
99         m_membank6(*this, "bank6"),
100         m_membank7(*this, "bank7"),
101         m_membank8(*this, "bank8"),
102         m_nvram(*this, "nvram"),
103         m_rom_active(true),
104         m_gfx_enabled(false),
105         m_kb_clock(true),
106         m_kb_empty(true)
107107   { }
108108
109109   // PIO port B operation select
r23623r23624
235235{
236236   UINT8 x,y,bit,scan,data;
237237   UINT8 dbl_mode = 0;  // detemines which half of character to display when using double size attribute,
238                        // as it can start on either odd or even character cells.
238                     // as it can start on either odd or even character cells.
239239
240240   // Graphics output (if enabled)
241241   if(m_gfx_enabled)
r23623r23624
542542
543543WRITE8_MEMBER(attache_state::pio_portA_w)
544544{
545   //   AO-7 = LATCH DATA OUT:
546   //   LO = MOTOR ON
547   //   L1 = GRAPHICS ENABLE
548   //   L2 = /EPROM ENABLE
549   //   L3-7 = DISPLAY BRIGHTNESS
550   //   AO-7 = 8910 DATA I/O:
551   //   AO-3 = 5832 DO-3 I/O
552   //   A4-7 = 5832 AO-3 OUT
553   //   AO-3 = 5101 DO-3 I/O
554   //   A4-7 = 5101 AO-3 OUT
545   //  AO-7 = LATCH DATA OUT:
546   //  LO = MOTOR ON
547   //  L1 = GRAPHICS ENABLE
548   //  L2 = /EPROM ENABLE
549   //  L3-7 = DISPLAY BRIGHTNESS
550   //  AO-7 = 8910 DATA I/O:
551   //  AO-3 = 5832 DO-3 I/O
552   //  A4-7 = 5832 AO-3 OUT
553   //  AO-3 = 5101 DO-3 I/O
554   //  A4-7 = 5101 AO-3 OUT
555555   m_pio_porta = data;
556556}
557557
558558WRITE8_MEMBER(attache_state::pio_portB_w)
559559{
560   //   BO-1 = 5101 A4-5
561   //   B2-4 = OPERATION SELECT
562   //   0 = 8910 ADDR LOAD
563   //   1 = 8910 DATA LOAD
564   //   2 = 5832 WRITE
565   //   3 = 5832 READ
566   //   4 = 5101 WRITE
567   //   5 = 5101 READ
568   //   6 = LATCH LOAD
569   //   7 = NO-OP
560   //  BO-1 = 5101 A4-5
561   //  B2-4 = OPERATION SELECT
562   //  0 = 8910 ADDR LOAD
563   //  1 = 8910 DATA LOAD
564   //  2 = 5832 WRITE
565   //  3 = 5832 READ
566   //  4 = 5101 WRITE
567   //  5 = 5101 READ
568   //  6 = LATCH LOAD
569   //  7 = NO-OP
570570   //B5 = /'138 OPERATION STROBE
571571   //B6 = /KEYBOARD DATA IN
572572   //B7 = /KEYBOARD CLOCK OUT
r23623r23624
646646   case DISP_CHAR:
647647      m_char_ram[(m_char_line*128)+(param & 0x7f)] = data;
648648      break;
649//   default:
650//      logerror("Unimplemented display operation %02x data %02x param %02x\n",m_current_cmd,data,param);
649//  default:
650//      logerror("Unimplemented display operation %02x data %02x param %02x\n",m_current_cmd,data,param);
651651   }
652652}
653653
r23623r23624
756756
757757WRITE_LINE_MEMBER( attache_state::fdc_dack_w )
758758{
759
760759}
761760
762761static ADDRESS_MAP_START( attache_map , AS_PROGRAM, 8, attache_state)
r23623r23624
10401039
10411040   MCFG_RAM_ADD(RAM_TAG)
10421041   MCFG_RAM_DEFAULT_SIZE("64k")
1043   
1042
10441043   MCFG_SOFTWARE_LIST_ADD("disk_list","attache")
10451044MACHINE_CONFIG_END
10461045
trunk/src/mess/drivers/samcoupe.c
r23623r23624
5555
5656
5757/***************************************************************************
58   TIMERS
58    TIMERS
5959***************************************************************************/
6060
6161void samcoupe_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
trunk/src/mess/audio/mac.c
r23623r23624
8282{
8383   INT16 last_val = 0;
8484   stream_sample_t *buffer = outputs[0];
85   
85
8686   if ((m_mac_model == MODEL_MAC_PORTABLE) || (m_mac_model == MODEL_MAC_PB100))
8787   {
8888      memset(buffer, 0, samples * sizeof(*buffer));
8989      return;
9090   }
91   
91
9292   /* if we're not enabled, just fill with 0 */
9393   if (machine().sample_rate() == 0)
9494   {
9595      memset(buffer, 0, samples * sizeof(*buffer));
9696      return;
9797   }
98   
98
9999   /* fill in the sample */
100100   while (samples && m_snd_cache_len)
101101   {
r23623r23624
105105      m_snd_cache_len--;
106106      samples--;
107107   }
108   
108
109109   while (samples--)
110110   {
111111      /* should never happen */
trunk/src/mess/audio/upd1771.c
r23623r23624
240240   const upd1771_interface *intf = reinterpret_cast<const upd1771_interface *>(static_config());
241241   if (intf != NULL)
242242      *static_cast<upd1771_interface *>(this) = *intf;
243   
243
244244   // or initialize to defaults if none provided
245245   else
246246   {
r23623r23624
256256{
257257   /* resolve callbacks */
258258   m_ack_out_func.resolve(m_ack_callback, *this);
259   
259
260260   m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(upd1771c_device::ack_callback),this));
261   
261
262262   m_channel = machine().sound().stream_alloc(*this, 0, 1, clock() / 4, this);
263   
263
264264   save_item(NAME(m_packet));
265265   save_item(NAME(m_index));
266266   save_item(NAME(m_expected_bytes));
r23623r23624
385385         m_index = 0;
386386         //logerror( "upd1771_w: ----------------silence  state reset\n");
387387         break;
388         
388
389389      case 1:
390390         if (m_index == 10)
391391         {
392392            m_state = STATE_NOISE;
393393            m_index = 0;
394           
394
395395            m_nw_timbre = (m_packet[1] & 0xe0) >> 5;
396396            m_nw_period = ((UINT32)m_packet[2] + 1) << 7;
397397            m_nw_volume = m_packet[3] & 0x1f;
398           
398
399399            //very long clocked periods.. used for engine drones
400400            m_n_period[0] = (((UINT32)m_packet[4]) + 1) << 7;
401401            m_n_period[1] = (((UINT32)m_packet[5]) + 1) << 7;
402402            m_n_period[2] = (((UINT32)m_packet[6]) + 1) << 7;
403           
403
404404            m_n_volume[0] = m_packet[7] & 0x1f;
405405            m_n_volume[1] = m_packet[8] & 0x1f;
406406            m_n_volume[2] = m_packet[9] & 0x1f;
407           
407
408408            //logerror( "upd1771_w: ----------------noise state reset\n");
409409         }
410410         else
411411            m_timer->adjust(attotime::from_ticks(512, clock()));
412412         break;
413   
413
414414      case 2:
415415         if (m_index == 4)
416416         {
r23623r23624
421421            //smaller periods dont all equal to 0x20
422422            if (m_t_period < 0x20)
423423               m_t_period = 0x20;
424           
424
425425            m_t_volume =  m_packet[3] & 0x1f;
426426            m_state = STATE_TONE;
427427            m_index = 0;
428428         }
429429         else
430            m_timer->adjust(attotime::from_ticks(512, clock()));         
430            m_timer->adjust(attotime::from_ticks(512, clock()));
431431         break;
432432
433433      case 0x1f:
434434         //6Khz(ish) DIGI playback
435         
435
436436         //end capture
437437         if (m_index >= 2 && m_packet[m_index - 2] == 0xfe && m_packet[m_index - 1] == 0x00)
438438         {
r23623r23624
481481void upd1771c_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
482482{
483483   stream_sample_t *buffer = outputs[0];
484   
484
485485   switch (m_state)
486486   {
487487      case STATE_TONE:
488488         //logerror( "upd1771_STATE_TONE samps:%d %d %d %d %d %d\n",(int)samples,
489489         //    (int)m_t_timbre,(int)m_t_offset,(int)m_t_volume,(int)m_t_period,(int)m_t_tpos);
490         
490
491491         while (--samples >= 0)
492492         {
493493            *buffer++ = (WAVEFORMS[m_t_timbre][m_t_tpos]) * m_t_volume * 2;
494           
494
495495            m_t_ppos++;
496496            if (m_t_ppos >= m_t_period)
497497            {
498498               m_t_tpos++;
499499               if (m_t_tpos == 32)
500500                  m_t_tpos = m_t_offset;
501               
501
502502               m_t_ppos = 0;
503503            }
504504         }
505505         break;
506         
506
507507      case STATE_NOISE:
508508         while (--samples >= 0)
509509         {
510510            *buffer = 0;
511           
511
512512            //"wavetable-LFSR" component
513513            int wlfsr_val = ((int)noise_tbl[m_nw_tpos]) - 127;//data too wide
514           
514
515515            m_nw_ppos++;
516516            if (m_nw_ppos >= m_nw_period)
517517            {
r23623r23624
520520                  m_nw_tpos = 0;
521521               m_nw_ppos = 0;
522522            }
523           
523
524524            //mix in each of the noise's 3 pulse components
525525            char res[3];
526526            for (int i = 0; i < 3; ++i)
r23623r23624
535535            }
536536            //not quite, but close.
537537            *buffer+= (
538                     (wlfsr_val * m_nw_volume) |
539                     (res[0] * m_n_volume[0]) |
540                     (res[1] * m_n_volume[1]) |
541                     (res[2] * m_n_volume[2])
542                     ) ;
543           
538                     (wlfsr_val * m_nw_volume) |
539                     (res[0] * m_n_volume[0]) |
540                     (res[1] * m_n_volume[1]) |
541                     (res[2] * m_n_volume[2])
542                     ) ;
543
544544            buffer++;
545545         }
546546         break;
547         
547
548548      default:
549549         //fill buffer with silence
550550         while (--samples >= 0)
trunk/src/mess/audio/mea8000.c
r23623r23624
130130   const mea8000_interface *intf = reinterpret_cast<const mea8000_interface *>(static_config());
131131   if (intf != NULL)
132132      *static_cast<mea8000_interface *>(this) = *intf;
133   
133
134134   // or initialize to defaults if none provided
135135   else
136136   {
r23623r23624
146146   m_req_out.resolve(m_req_out_cb, *this);
147147
148148   m_dac = machine().device<dac_device>(m_channel);
149   
149
150150   init_tables();
151   
151
152152   m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mea8000_device::timer_expire),this));
153153
154154   save_item(NAME(m_state));
r23623r23624
176176   save_item(NAME(m_last_pitch));
177177   save_item(NAME(m_pitch));
178178   save_item(NAME(m_noise));
179}   
179}
180180
181181//-------------------------------------------------
182182//  device_reset - device-specific reset
r23623r23624
210210
211211void mea8000_device::update_req()
212212{
213
214213   // actually, req pulses less than 3us for each new byte,
215214   // it goes back up if there space left in the buffer, or stays low if the
216215   // buffer contains a complete frame and the CPU nees to wait for the next
r23623r23624
557556      else
558557      {
559558         /* enqueue frame byte */
560         LOG(("$%04x %f: mea8000_w data %02X in frame pos %i\n", machine().firstcpu->pcbase(), machine().time().as_double(),
559         LOG(("$%04x %f: mea8000_w data %02X in frame pos %i\n", machine().firstcpu->pcbase(), machine().time().as_double(),
561560               data, m_bufpos));
562561         m_buf[m_bufpos] = data;
563562         m_bufpos++;
trunk/src/mess/audio/upd1771.h
r23623r23624
3636   DECLARE_READ8_MEMBER( read );
3737   DECLARE_WRITE8_MEMBER( write );
3838   WRITE_LINE_MEMBER( pcm_write );
39   
39
4040protected:
4141   // device-level overrides
4242   virtual void device_config_complete();
r23623r23624
5757   UINT8   m_packet[MAX_PACKET_SIZE];
5858   UINT32  m_index;
5959   UINT8   m_expected_bytes;
60   
60
6161   UINT8   m_state;//0:silence, 1 noise, 2 tone
6262   UINT8   m_pc3;
63   
63
6464   //tone
6565   UINT8    m_t_timbre; //[0;  7]
6666   UINT8    m_t_offset; //[0; 32]
r23623r23624
6868   UINT8    m_t_volume; //[0; 31]
6969   UINT8    m_t_tpos;//timbre pos
7070   UINT16   m_t_ppos;//period pos
71   
71
7272   //noise wavetable LFSR
7373   UINT8    m_nw_timbre; //[0;  7]
7474   UINT8    m_nw_volume; //[0; 31]
7575   UINT32   m_nw_period;
7676   UINT32   m_nw_tpos;   //timbre pos
7777   UINT32   m_nw_ppos;   //period pos
78   
78
7979   //noise pulse components
8080   UINT8    m_n_value[3];  //[0;1]
8181   UINT16   m_n_volume[3]; //[0; 31]
trunk/src/mess/audio/dave.c
r23623r23624
5555
5656dave_device::dave_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
5757   : device_t(mconfig, DAVE, "DAVE", tag, owner, clock, "dave", __FILE__),
58     device_memory_interface(mconfig, *this),
59     device_sound_interface(mconfig, *this),
60     m_program_space_config("program", ENDIANNESS_LITTLE, 8, 22, 0, *ADDRESS_MAP_NAME(program_map)),
61     m_io_space_config("i/o", ENDIANNESS_LITTLE, 8, 16, 0, *ADDRESS_MAP_NAME(io_map)),
62     m_write_irq(*this),
63     m_write_lh(*this),
64     m_write_rh(*this)
58      device_memory_interface(mconfig, *this),
59      device_sound_interface(mconfig, *this),
60      m_program_space_config("program", ENDIANNESS_LITTLE, 8, 22, 0, *ADDRESS_MAP_NAME(program_map)),
61      m_io_space_config("i/o", ENDIANNESS_LITTLE, 8, 16, 0, *ADDRESS_MAP_NAME(io_map)),
62      m_write_irq(*this),
63      m_write_lh(*this),
64      m_write_rh(*this)
6565{
6666}
6767
r23623r23624
8080   // allocate timers
8181   m_timer_1hz = timer_alloc(TIMER_1HZ);
8282   m_timer_1hz->adjust(attotime::from_hz(2), 0, attotime::from_hz(2));
83   
83
8484   m_timer_50hz = timer_alloc(TIMER_50HZ);
8585   m_timer_50hz->adjust(attotime::from_hz(2000), 0, attotime::from_hz(2000));
8686
r23623r23624
101101      m_count[i] = (STEP * machine().sample_rate()) / 125000;
102102      m_level[i] = 0;
103103   }
104   
104
105105   /* dave has 3 tone channels and 1 noise channel.
106106    the volumes are mixed internally and output as left and right volume */
107   
107
108108   /* 3 tone channels + 1 noise channel */
109109   m_sound_stream_var = machine().sound().stream_alloc(*this, 0, 2, machine().sample_rate(), this);
110110}
r23623r23624
186186   int output_volumes[8];
187187   int left_volume;
188188   int right_volume;
189   
189
190190   //logerror("sound update!\n");
191   
191
192192   buffer1 = outputs[0];
193193   buffer2 = outputs[1];
194   
194
195195   while (samples)
196196   {
197197      int vol[4];
198     
198
199199      /* vol[] keeps track of how long each square wave stays */
200200      /* in the 1 position during the sample period. */
201201      vol[0] = vol[1] = vol[2] = vol[3] = 0;
202     
202
203203      for (int i = 0; i < 3; i++)
204204      {
205205         if ((m_regs[7] & (1 << i))==0)
r23623r23624
230230               vol[i] -= m_count[i];
231231         }
232232      }
233     
233
234234      /* update volume outputs */
235     
235
236236      /* setup output volumes for each channel */
237237      /* channel 0 */
238238      output_volumes[0] = ((m_level[0] & m_level_and[0]) | m_level_or[0]) & m_mame_volumes[0];
r23623r23624
246246      /* channel 3 */
247247      output_volumes[6] = ((m_level[3] & m_level_and[6]) | m_level_or[6]) & m_mame_volumes[3];
248248      output_volumes[7] = ((m_level[3] & m_level_and[7]) | m_level_or[7]) & m_mame_volumes[7];
249     
249
250250      left_volume = (output_volumes[0] + output_volumes[2] + output_volumes[4] + output_volumes[6])>>2;
251251      right_volume = (output_volumes[1] + output_volumes[3] + output_volumes[5] + output_volumes[7])>>2;
252     
252
253253      *(buffer1++) = left_volume;
254254      *(buffer2++) = right_volume;
255     
255
256256      samples--;
257257   }
258258}
r23623r23624
600600
601601
602602//-------------------------------------------------
603//  update_interrupt -
603//  update_interrupt -
604604//-------------------------------------------------
605605
606606void dave_device::update_interrupt()
trunk/src/mess/audio/mea8000.h
r23623r23624
5252{
5353   /* output channel */
5454   const char *   m_channel;
55   
55
5656   /* 1-bit 'ready' output, not negated */
5757   devcb_write8   m_req_out_cb;
5858};
r23623r23624
105105
106106   /* state */
107107   mea8000_state m_state; /* current state */
108   
108
109109   UINT8 m_buf[4]; /* store 4 consecutive data to form a frame info */
110110   UINT8 m_bufpos; /* new byte to write in frame info buffer */
111   
111
112112   UINT8 m_cont; /* if no data 0=stop 1=repeat last frame */
113113   UINT8 m_roe;  /* enable req output, now unimplemented */
114   
114
115115   UINT16 m_framelength;  /* in samples */
116116   UINT16 m_framepos;     /* in samples */
117117   UINT16 m_framelog;     /* log2 of framelength */
118   
118
119119   INT16 m_lastsample, m_sample; /* output samples are interpolated */
120   
120
121121   UINT32 m_phi; /* absolute phase for frequency / noise generator */
122   
122
123123   filter_t m_f[4]; /* filters */
124   
124
125125   UINT16 m_last_ampl, m_ampl;    /* amplitude * 1000 */
126126   UINT16 m_last_pitch, m_pitch;  /* pitch of sawtooth signal, in Hz */
127127   UINT8  m_noise;
128   
128
129129   emu_timer *m_timer;
130   
130
131131   devcb_resolved_write8 m_req_out;
132132
133   
133
134134   int m_cos_table[TABLE_LEN];  /* fm => cos coefficient */
135135   int m_exp_table[TABLE_LEN];  /* bw => exp coefficient */
136136   int m_exp2_table[TABLE_LEN]; /* bw => 2*exp coefficient */
137137   int m_noise_table[NOISE_LEN];
138   
138
139139};
140140
141141extern const device_type MEA8000;
trunk/src/mess/audio/dave.h
r23623r23624
2727///*************************************************************************
2828
2929#define MCFG_DAVE_ADD(_tag, _clock, _irq, _program_map, _io_map) \
30    MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") \
30   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") \
3131   MCFG_SOUND_ADD(_tag, DAVE, _clock) \
3232   MCFG_SOUND_ROUTE(0, "lspeaker", 0.25) \
3333   MCFG_SOUND_ROUTE(1, "rspeaker", 0.25) \
34    MCFG_DEVICE_ADDRESS_MAP(AS_PROGRAM, _program_map) \
35    MCFG_DEVICE_ADDRESS_MAP(AS_IO, _io_map) \
34   MCFG_DEVICE_ADDRESS_MAP(AS_PROGRAM, _program_map) \
35   MCFG_DEVICE_ADDRESS_MAP(AS_IO, _io_map) \
3636   downcast<dave_device *>(device)->set_irq_callback(DEVCB2_##_irq);
3737
3838
r23623r23624
8989
9090   enum
9191   {
92      IRQ_50HZ_DIVIDER   = 0x01,
93      IRQ_50HZ_LATCH      = 0x02,
94      IRQ_1HZ_DIVIDER      = 0x04,
95      IRQ_1HZ_LATCH      = 0x08,
96      IRQ_INT1         = 0x10,
97      IRQ_INT1_LATCH      = 0x20,
98      IRQ_INT2         = 0x40,
99      IRQ_INT2_LATCH      = 0x80,
92      IRQ_50HZ_DIVIDER    = 0x01,
93      IRQ_50HZ_LATCH      = 0x02,
94      IRQ_1HZ_DIVIDER     = 0x04,
95      IRQ_1HZ_LATCH       = 0x08,
96      IRQ_INT1            = 0x10,
97      IRQ_INT1_LATCH      = 0x20,
98      IRQ_INT2            = 0x40,
99      IRQ_INT2_LATCH      = 0x80,
100100      IRQ_LATCH           = IRQ_INT2_LATCH | IRQ_INT1_LATCH | IRQ_1HZ_LATCH | IRQ_50HZ_LATCH
101101   };
102102
r23623r23624
122122   int m_period[4];
123123   int m_count[4];
124124   int m_level[4];
125   
125
126126   /* these are used to force channels on/off */
127127   /* if one of the or values is 0x0ff, this means
128128    the volume will be forced on,else it is dependant on
r23623r23624
131131   /* if one of the values is 0x00, this means the
132132    volume is forced off, else it is dependant on the wave */
133133   int m_level_and[8];
134   
134
135135   /* these are the current channel volumes in MAME form */
136136   int m_mame_volumes[8];
137   
137
138138   /* update step */
139139   //int m_update_step;
140   
140
141141   sound_stream *m_sound_stream_var;
142142};
143143
trunk/src/mess/machine/upd71071.c
r23623r23624
100100   const upd71071_intf *intf = reinterpret_cast<const upd71071_intf *>(static_config());
101101   if (intf != NULL)
102102      *static_cast<upd71071_intf *>(this) = *intf;
103   
103
104104   // or initialize to defaults if none provided
105105   else
106106   {
trunk/src/mess/machine/sms.c
r23623r23624
694694{
695695   bool bios_selected = false;
696696   bool cartridge_selected = false;
697   
697
698698   m_mapper[offset] = data;
699699   m_mainram[0x1ffc + offset] = data;
700700
r23623r23624
703703      if (!(m_bios_port & IO_CARTRIDGE) || (m_is_gamegear && m_BIOS == NULL))
704704         cartridge_selected = true;
705705      else
706         return;   // nothing to page in
706         return; // nothing to page in
707707   }
708708   else
709709   {
710710      if (!m_BIOS)
711         return;   // nothing to page in
711         return; // nothing to page in
712712      bios_selected = true;
713713   }
714   
714
715715   switch (offset)
716716   {
717717      case 0: // Control RAM/ROM
718         if (!(data & 0x08) && !(m_bios_port & IO_BIOS_ROM) && bios_selected)   // BIOS ROM
718         if (!(data & 0x08) && !(m_bios_port & IO_BIOS_ROM) && bios_selected)    // BIOS ROM
719719         {
720720            if (!m_has_bios_0400 && !m_has_bios_2000)
721721            {
r23623r23624
723723               m_bios_page[2] = m_mapper[3];
724724            }
725725         }
726         else if (cartridge_selected)   // CART ROM/RAM
726         else if (cartridge_selected)    // CART ROM/RAM
727727         {
728728            m_bank_enabled[2] = ENABLE_CART;
729729            m_cartslot->write_mapper(space, offset, data);
730730         }
731731         break;
732         
732
733733      case 1: // Select 16k ROM bank for 0400-3fff
734734      case 2: // Select 16k ROM bank for 4000-7fff
735735      case 3: // Select 16k ROM bank for 8000-bfff
r23623r23624
761761            return m_BIOS[(m_bios_page[3] * 0x4000) + (offset & 0x3fff)];
762762      }
763763      if (m_bank_enabled[3] == ENABLE_CART)
764         return m_cartslot->read_cart(space, offset);
764         return m_cartslot->read_cart(space, offset);
765765      if (m_card && m_bank_enabled[3] == ENABLE_CARD)
766         return m_card->read_cart(space, offset);
766         return m_card->read_cart(space, offset);
767767   }
768768   else
769769   {
r23623r23624
773773            return m_BIOS[(m_bios_page[0] * 0x4000) + (offset & 0x3fff)];
774774      }
775775      if (m_bank_enabled[0] == ENABLE_CART)
776         return m_cartslot->read_cart(space, offset);
776         return m_cartslot->read_cart(space, offset);
777777      if (m_card && m_bank_enabled[0] == ENABLE_CARD)
778         return m_card->read_cart(space, offset);
779   }   
778         return m_card->read_cart(space, offset);
779   }
780780   return m_region_maincpu->base()[offset];
781781}
782782
r23623r23624
789789   }
790790
791791   if (m_bank_enabled[1] == ENABLE_CART)
792      return m_cartslot->read_cart(space, offset + 0x4000);
792      return m_cartslot->read_cart(space, offset + 0x4000);
793793   if (m_card && m_bank_enabled[1] == ENABLE_CARD)
794      return m_card->read_cart(space, offset + 0x4000);
794      return m_card->read_cart(space, offset + 0x4000);
795795
796796   return m_region_maincpu->base()[offset];
797797}
r23623r23624
805805   }
806806
807807   if (m_bank_enabled[2] == ENABLE_CART)
808      return m_cartslot->read_cart(space, offset + 0x8000);
808      return m_cartslot->read_cart(space, offset + 0x8000);
809809   if (m_card && m_bank_enabled[2] == ENABLE_CARD)
810      return m_card->read_cart(space, offset + 0x8000);
810      return m_card->read_cart(space, offset + 0x8000);
811811
812812   return m_region_maincpu->base()[offset];
813813}
r23623r23624
827827            return m_BIOS[(m_bios_page[3] * 0x4000) + (offset & 0x3fff)];
828828      }
829829      if (m_bank_enabled[3] == ENABLE_CART)
830         return m_slots[m_current_cartridge]->read_cart(space, offset);
830         return m_slots[m_current_cartridge]->read_cart(space, offset);
831831      if (m_bank_enabled[3] == ENABLE_CARD)
832         return m_cards[m_current_cartridge]->read_cart(space, offset);
832         return m_cards[m_current_cartridge]->read_cart(space, offset);
833833   }
834834   else
835835   {
r23623r23624
839839            return m_BIOS[(m_bios_page[0] * 0x4000) + (offset & 0x3fff)];
840840      }
841841      if (m_bank_enabled[0] == ENABLE_CART)
842         return m_slots[m_current_cartridge]->read_cart(space, offset);
842         return m_slots[m_current_cartridge]->read_cart(space, offset);
843843      if (m_bank_enabled[0] == ENABLE_CARD)
844         return m_cards[m_current_cartridge]->read_cart(space, offset);
845   }   
844         return m_cards[m_current_cartridge]->read_cart(space, offset);
845   }
846846
847847   return m_region_maincpu->base()[offset];
848848}
r23623r23624
855855         return m_BIOS[(m_bios_page[1] * 0x4000) + (offset & 0x3fff)];
856856   }
857857   if (m_bank_enabled[1] == ENABLE_CART)
858      return m_slots[m_current_cartridge]->read_cart(space, offset + 0x4000);
858      return m_slots[m_current_cartridge]->read_cart(space, offset + 0x4000);
859859   if (m_bank_enabled[1] == ENABLE_CARD)
860      return m_cards[m_current_cartridge]->read_cart(space, offset + 0x4000);
861   
860      return m_cards[m_current_cartridge]->read_cart(space, offset + 0x4000);
861
862862   return m_region_maincpu->base()[offset];
863863}
864864
r23623r23624
868868   {
869869      if (m_BIOS)
870870         return m_BIOS[(m_bios_page[2] * 0x4000) + (offset & 0x3fff)];
871   }   
871   }
872872   if (m_bank_enabled[2] == ENABLE_CART)
873      return m_slots[m_current_cartridge]->read_cart(space, offset + 0x8000);
873      return m_slots[m_current_cartridge]->read_cart(space, offset + 0x8000);
874874   if (m_bank_enabled[2] == ENABLE_CARD)
875      return m_cards[m_current_cartridge]->read_cart(space, offset + 0x8000);
876   
875      return m_cards[m_current_cartridge]->read_cart(space, offset + 0x8000);
876
877877   return m_region_maincpu->base()[offset];
878878}
879879
r23623r23624
882882   // this might only work because we are not emulating properly the cart/card selection system
883883   // it will have to be reviewed when proper emulation is worked on!
884884   if (m_bank_enabled[0] == ENABLE_CART)
885      m_slots[m_current_cartridge]->write_cart(space, offset, data);
885      m_slots[m_current_cartridge]->write_cart(space, offset, data);
886886   if (m_bank_enabled[0] == ENABLE_CARD)
887      m_cards[m_current_cartridge]->write_cart(space, offset, data);
887      m_cards[m_current_cartridge]->write_cart(space, offset, data);
888888}
889889
890890READ8_MEMBER(smssdisp_state::store_cart_peek)
891891{
892892   if (m_bank_enabled[1] == ENABLE_CART)
893      return m_slots[m_current_cartridge]->read_cart(space, 0x4000 + (offset & 0x1fff));
893      return m_slots[m_current_cartridge]->read_cart(space, 0x4000 + (offset & 0x1fff));
894894   if (m_bank_enabled[1] == ENABLE_CARD)
895      return m_cards[m_current_cartridge]->read_cart(space, 0x4000 + (offset & 0x1fff));
896   
895      return m_cards[m_current_cartridge]->read_cart(space, 0x4000 + (offset & 0x1fff));
896
897897   return m_region_maincpu->base()[offset];
898898}
899899
r23623r23624
10551055MACHINE_START_MEMBER(sms_state,sms)
10561056{
10571057   char str[7];
1058   
1058
10591059   m_rapid_fire_timer = timer_alloc(TIMER_RAPID_FIRE);
10601060   m_rapid_fire_timer->adjust(attotime::from_hz(10), 0, attotime::from_hz(10));
10611061
r23623r23624
11321132
11331133   // a bunch of SG1000 carts (compatible with SG1000 Mark III) can access directly system RAM... let's install here the necessary handlers
11341134   // TODO: are BASIC and Music actually compatible with Mark III??
1135   if (m_cartslot->get_type() == SEGA8_BASIC_L3 || m_cartslot->get_type() == SEGA8_MUSIC_EDITOR
1135   if (m_cartslot->get_type() == SEGA8_BASIC_L3 || m_cartslot->get_type() == SEGA8_MUSIC_EDITOR
11361136         || m_cartslot->get_type() == SEGA8_DAHJEE_TYPEA || m_cartslot->get_type() == SEGA8_DAHJEE_TYPEB)
11371137   {
11381138      m_maincpu->space(AS_PROGRAM).install_read_handler(0xc000, 0xffff, 0, 0, read8_delegate(FUNC(sega8_cart_slot_device::read_ram),(sega8_cart_slot_device*)m_cartslot));
r23623r23624
12061206
12071207   logerror("switching in part of %s slot #%d\n", slottype ? "card" : "cartridge", slot );
12081208   /* cartridge? slot #0 */
1209//   if (slottype == 0)
1210//      m_current_cartridge = slot;
1209//  if (slottype == 0)
1210//      m_current_cartridge = slot;
12111211
12121212   setup_rom();
12131213}
trunk/src/mess/machine/sns_spc7110.c
r23623r23624
318318      + map(3, 24) + map(2, 16) + map(1,  8) + map(0,  0);
319319#undef map
320320   }
321   
321
322322   state_save_register_item(machine, "SNES_SPC7110", NULL, 0, m_decomp_mode);
323323   state_save_register_item(machine, "SNES_SPC7110", NULL, 0, m_decomp_offset);
324324   state_save_register_item_pointer(machine, "SNES_SPC7110", NULL, 0, m_decomp_buffer, SPC7110_DECOMP_BUFFER_SIZE);
r23623r23624
331331      state_save_register_item(machine, "SNES_SPC7110", NULL, i, m_context[i].index);
332332      state_save_register_item(machine, "SNES_SPC7110", NULL, i, m_context[i].invert);
333333   }
334   
334
335335   state_save_register_item(machine, "SNES_SPC7110", NULL, 0, m_m0_val);
336336   state_save_register_item(machine, "SNES_SPC7110", NULL, 0, m_m0_in);
337337   state_save_register_item(machine, "SNES_SPC7110", NULL, 0, m_m0_span);
r23623r23624
349349   state_save_register_item(machine, "SNES_SPC7110", NULL, 0, m_m1_inverts);
350350   state_save_register_item(machine, "SNES_SPC7110", NULL, 0, m_m1_lps);
351351   state_save_register_item(machine, "SNES_SPC7110", NULL, 0, m_m1_in_count);
352   
352
353353   state_save_register_item(machine, "SNES_SPC7110", NULL, 0, m_m2_pixelorder);
354354   state_save_register_item(machine, "SNES_SPC7110", NULL, 0, m_m2_realorder);
355355   state_save_register_item(machine, "SNES_SPC7110", NULL, 0, m_m2_bitplanebuffer);
r23623r23624
455455}
456456
457457void SPC7110_Decomp::mode0(UINT8 init, UINT8 *ROM, UINT32 len)
458{   
458{
459459   if (init == 1)
460460   {
461461      m_m0_out = m_m0_inverts = m_m0_lps = 0;
trunk/src/mess/machine/sns_spc7110.h
r23623r23624
3636   void mode2(UINT8 init, UINT8 *ROM, UINT32 len);
3737
3838private:
39   
39
4040   UINT8 dataread(UINT8 *ROM, UINT32 len);
4141   UINT8 probability(UINT32 n);
4242   UINT8 next_lps(UINT32 n);
r23623r23624
4444   UINT8 toggle_invert(UINT32 n);
4545   UINT32 morton_2x8(UINT32 data);
4646   UINT32 morton_4x8(UINT32 data);
47   
47
4848   UINT32 m_decomp_mode;
4949   UINT32 m_decomp_offset;
50   
50
5151   UINT8 *m_decomp_buffer;
5252   UINT32 m_decomp_buffer_rdoffset;
5353   UINT32 m_decomp_buffer_wroffset;
5454   UINT32 m_decomp_buffer_length;
55   
55
5656   struct ContextState
5757   {
5858      UINT8 index;
5959      UINT8 invert;
6060   } m_context[32];
61   
61
6262   UINT32 m_morton16[2][256];
6363   UINT32 m_morton32[4][256];
6464
trunk/src/mess/machine/softbox.h
r23623r23624
7474
7575
7676
77#endif
No newline at end of file
77#endif
trunk/src/mess/machine/concept.c
r23623r23624
5858   /* clear keyboard interface state */
5959   m_KeyQueueHead = m_KeyQueueLen = 0;
6060   memset(m_KeyStateSave, 0, sizeof(m_KeyStateSave));
61   
61
6262   m_exp[0] = machine().device<concept_exp_port_device>("exp1");
6363   m_exp[1] = machine().device<concept_exp_port_device>("exp2");
6464   m_exp[2] = machine().device<concept_exp_port_device>("exp3");
r23623r23624
248248      /* I/O slot regs */
249249      switch ((offset >> 4) & 7)
250250      {
251         case 1:   // IO1 registers
252         case 2:   // IO2 registers
253         case 3:   // IO3 registers
254         case 4:   // IO4 registers
251         case 1: // IO1 registers
252         case 2: // IO2 registers
253         case 3: // IO3 registers
254         case 4: // IO4 registers
255255            return m_exp[((offset >> 4) & 7) - 1]->reg_r(space, offset & 0x0f);
256256         break;
257257
r23623r23624
261261      }
262262      break;
263263
264   case 1:   // IO1 ROM
265   case 2:   // IO2 ROM
266   case 3:   // IO3 ROM
267   case 4:   // IO4 ROM
264   case 1: // IO1 ROM
265   case 2: // IO2 ROM
266   case 3: // IO3 ROM
267   case 4: // IO4 ROM
268268      LOG(("concept_io_r: Slot ROM memory accessed for slot %d at address 0x03%4.4x\n", ((offset >> 8) & 7) - 1, offset << 1));
269269      return m_exp[((offset >> 8) & 7) - 1]->rom_r(space, offset & 0xff);
270270      break;
r23623r23624
373373      /* I/O slot regs */
374374      switch ((offset >> 4) & 7)
375375      {
376         case 1:   // IO1 registers
377         case 2:   // IO2 registers
378         case 3:   // IO3 registers
379         case 4:   // IO4 registers
376         case 1: // IO1 registers
377         case 2: // IO2 registers
378         case 3: // IO3 registers
379         case 4: // IO4 registers
380380            return m_exp[((offset >> 4) & 7) - 1]->reg_w(space, offset & 0x0f, data);
381381            break;
382382
383         default:   // ???
383         default:    // ???
384384            logerror("concept_io_w: Slot I/O memory written for unknown purpose at address 0x03%4.4x, data: 0x%4.4x\n", offset << 1, data);
385385            break;
386386      }
387387      break;
388388
389   case 1:   // IO1 ROM
390   case 2:   // IO2 ROM
391   case 3:   // IO3 ROM
392   case 4:   // IO4 ROM
389   case 1: // IO1 ROM
390   case 2: // IO2 ROM
391   case 3: // IO3 ROM
392   case 4: // IO4 ROM
393393      LOG(("concept_io_w: Slot ROM memory written to for slot %d at address 0x03%4.4x, data: 0x%4.4x\n", ((offset >> 8) & 7) - 1, offset << 1, data));
394394      return m_exp[((offset >> 8) & 7) - 1]->rom_w(space, offset & 0xff, data);
395395      break;
r23623r23624
463463      break;
464464   }
465465}
466
trunk/src/mess/machine/ep64_exdos.c
r23623r23624
1212Floppy Drive Controller PCB Layout
1313----------------------------------
1414
15INTELLIGENT SOFTWARE LTD DISK CONTROLLER
15INTELLIGENT SOFTWARE LTD DISK CONTROLLER
1616ISS1
1717 |--------------------------------------------|
1818 |                                            |
r23623r23624
5454//  MACROS/CONSTANTS
5555//**************************************************************************
5656
57#define WD1770_TAG   "u1"
57#define WD1770_TAG  "u1"
5858
5959
6060
r23623r23624
180180READ8_MEMBER( ep64_exdos_device::read )
181181{
182182   /*
183   
183
184184       bit     description
185   
186       0       
185
186       0
187187       1       INTRQ
188       2       
189       3       
190       4       
191       5       
188       2
189       3
190       4
191       5
192192       6       DCHG
193193       7       DRQ
194   
194
195195   */
196196
197197   UINT8 data = 0;
r23623r23624
212212WRITE8_MEMBER( ep64_exdos_device::write )
213213{
214214   /*
215   
215
216216       bit     description
217   
217
218218       0       SELECT 0
219219       1       SELECT 1
220220       2       SELECT 2
r23623r23624
223223       5       _DDEN
224224       6       DISK CHANGE RESET
225225       7       IN USE
226   
226
227227   */
228228
229229   m_floppy = NULL;
trunk/src/mess/machine/ep64_exdos.h
r23623r23624
2626// ======================> ep64_exdos_device
2727
2828class ep64_exdos_device : public device_t,
29                    public device_ep64_expansion_bus_card_interface
29                     public device_ep64_expansion_bus_card_interface
3030{
3131public:
3232   // construction/destruction
trunk/src/mess/machine/gba_rom.c
r23623r23624
11/***********************************************************************************************************
22
3
3
44 Game Boy Advance cart emulation
55
66
77 We support carts with several kind of Save RAM (actual SRAM, Flash RAM or EEPROM)
8 
9 
108
9
10
1111 ***********************************************************************************************************/
1212
1313
r23623r23624
120120{
121121   astring tempstring;
122122   m_rom = (UINT32 *)memregion(this->subtag(tempstring, "cartridge"))->base();
123   
123
124124   // for the moment we use a custom eeprom implementation, so we alloc/save it as nvram
125125   nvram_alloc(machine(), 0x2000);
126126   m_eeprom = auto_alloc(machine(), gba_eeprom_device(machine(), (UINT8*)get_nvram_base(), get_nvram_size(), 14));
r23623r23624
140140{
141141   if (m_nvram && offset < m_nvram_size/4)
142142      return m_nvram[offset];
143   else   // this cannot actually happen...
143   else    // this cannot actually happen...
144144      return 0xffffffff;
145145}
146146
r23623r23624
168168READ32_MEMBER(gba_rom_flash_device::read_ram)
169169{
170170   UINT32 rv = 0;
171   
171
172172   offset &= m_flash_mask;
173   
174   if (mem_mask & 0xff)
173
174   if (mem_mask & 0xff)
175175      rv |= m_flash->read(offset * 4);
176   if (mem_mask & 0xff00)
176   if (mem_mask & 0xff00)
177177      rv |= m_flash->read((offset * 4) + 1) << 8;
178   if (mem_mask & 0xff0000)
178   if (mem_mask & 0xff0000)
179179      rv |= m_flash->read((offset * 4) + 2) << 16;
180   if (mem_mask & 0xff000000)
180   if (mem_mask & 0xff000000)
181181      rv |= m_flash->read((offset * 4) + 3) << 24;
182   
182
183183   return rv;
184184}
185185
186186WRITE32_MEMBER(gba_rom_flash_device::write_ram)
187187{
188188   offset &= m_flash_mask;
189   
189
190190   switch (mem_mask)
191191   {
192192      case 0xff:
r23623r23624
220220READ32_MEMBER(gba_rom_flash1m_device::read_ram)
221221{
222222   UINT32 rv = 0;
223   
223
224224   offset &= m_flash_mask;
225225
226   if (mem_mask & 0xff)
226   if (mem_mask & 0xff)
227227      rv |= m_flash->read(offset * 4);
228   if (mem_mask & 0xff00)
228   if (mem_mask & 0xff00)
229229      rv |= m_flash->read((offset * 4) + 1) << 8;
230   if (mem_mask & 0xff0000)
230   if (mem_mask & 0xff0000)
231231      rv |= m_flash->read((offset * 4) + 2) << 16;
232   if (mem_mask & 0xff000000)
232   if (mem_mask & 0xff000000)
233233      rv |= m_flash->read((offset * 4) + 3) << 24;
234   
234
235235   return rv;
236236}
237237
r23623r23624
262262
263263/*-------------------------------------------------
264264 Carts with EEPROM
265 
266 TODO: can this sketchy EEPROM device be merged
265
266 TODO: can this sketchy EEPROM device be merged
267267 with the core implementation?
268268 -------------------------------------------------*/
269269
r23623r23624
288288UINT32 gba_eeprom_device::read()
289289{
290290   UINT32 out;
291   
291
292292   switch (m_state)
293293   {
294294      case EEP_IDLE:
295295//          printf("eeprom_r: @ %x, mask %08x (state %d) (PC=%x) = %d\n", offset, ~mem_mask, m_state, activecpu_get_pc(), 1);
296296         return 0x00010001;  // "ready"
297         
297
298298      case EEP_READFIRST:
299299         m_count--;
300         
300
301301         if (!m_count)
302302         {
303303            m_count = 64;
r23623r23624
318318            m_addr++;
319319            m_bits = 8;
320320         }
321         
321
322322         out = (m_eep_data & 0x80) ? 1 : 0;
323323         out |= (out<<16);
324324         m_eep_data <<= 1;
325         
325
326326         m_bits--;
327327         m_count--;
328         
328
329329         if (!m_count)
330330         {
331331            m_state = EEP_IDLE;
332332         }
333         
333
334334//          printf("out = %08x\n", out);
335335//          printf("eeprom_r: @ %x, mask %08x (state %d) (PC=%x) = %08x\n", offset, ~mem_mask, m_state, activecpu_get_pc(), out);
336336         return out;
r23623r23624
348348         if (data == 1)
349349            m_state++;
350350         break;
351         
351
352352      case EEP_COMMAND:
353353         if (data == 1)
354354            m_command = EEP_READFIRST;
r23623r23624
358358         m_count = m_addr_bits;
359359         m_addr = 0;
360360         break;
361         
361
362362      case EEP_ADDR:
363363         m_addr <<= 1;
364364         m_addr |= (data & 1);
r23623r23624
377377            }
378378         }
379379         break;
380         
380
381381      case EEP_AFTERADDR:
382382         m_state = m_command;
383383         m_count = 64;
r23623r23624
386386         if (m_state == EEP_READFIRST)
387387            m_count = 4;
388388         break;
389         
389
390390      case EEP_WRITE:
391391         m_eep_data <<= 1;
392392         m_eep_data |= (data & 1);
393393         m_bits--;
394394         m_count--;
395         
395
396396         if (m_bits == 0)
397397         {
398398            mame_printf_verbose("%08x: EEPROM: %02x to %x\n", machine().device("maincpu")->safe_pc(), m_eep_data, m_addr);
r23623r23624
404404            m_eep_data = 0;
405405            m_bits = 8;
406406         }
407         
407
408408         if (!m_count)
409409            m_state = EEP_AFTERWRITE;
410410         break;
411         
411
412412      case EEP_AFTERWRITE:
413413         m_state = EEP_IDLE;
414414         break;
r23623r23624
434434
435435   if (~mem_mask == 0x0000ffff)
436436      data >>= 16;
437   
437
438438   m_eeprom->write(data);
439439}
440440
r23623r23624
443443   // Larger games have smaller access to EERPOM content
444444   if (m_rom_size > (16 * 1024 * 1024) && offset < 0xffff00/4)
445445      return 0xffffffff;
446   
446
447447   return m_eeprom->read();
448448}
449449
r23623r23624
452452   // Larger games have smaller access to EEPROM content
453453   if (m_rom_size > (16 * 1024 * 1024) && offset < 0xffff00/4)
454454      return;
455   
455
456456   if (~mem_mask == 0x0000ffff)
457457      data >>= 16;
458   
458
459459   m_eeprom->write(data);
460460}
461
trunk/src/mess/machine/gba_rom.h
r23623r23624
1919   virtual void device_start();
2020   virtual const rom_entry *device_rom_region() const;
2121   virtual void device_reset();
22   
22
2323   // reading and writing
2424   virtual DECLARE_READ32_MEMBER(read_rom) { return m_rom[offset]; }
2525};
r23623r23624
3131public:
3232   // construction/destruction
3333   gba_rom_sram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
34   
34
3535   // reading and writing
3636   virtual DECLARE_READ32_MEMBER(read_ram);
3737   virtual DECLARE_WRITE32_MEMBER(write_ram);
r23623r23624
4444public:
4545   // construction/destruction
4646   gba_rom_flash_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
47   
47
4848   // device-level overrides
4949   virtual machine_config_constructor device_mconfig_additions() const;
5050   virtual void device_reset();
51   
51
5252   // reading and writing
5353   virtual DECLARE_READ32_MEMBER(read_ram);
5454   virtual DECLARE_WRITE32_MEMBER(write_ram);
r23623r23624
6666public:
6767   // construction/destruction
6868   gba_rom_flash1m_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
69   
69
7070   // device-level overrides
7171   virtual machine_config_constructor device_mconfig_additions() const;
7272   virtual void device_reset();
73   
73
7474   // reading and writing
7575   virtual DECLARE_READ32_MEMBER(read_ram);
7676   virtual DECLARE_WRITE32_MEMBER(write_ram);
77   
77
7878private:
7979   //UINT32 m_flash_size;
8080   UINT32 m_flash_mask;
r23623r23624
115115   int m_bits;
116116   int m_addr_bits;
117117   UINT8 m_eep_data;
118   
118
119119   running_machine& m_machine;
120120};
121121
r23623r23624
127127public:
128128   // construction/destruction
129129   gba_rom_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
130   
130
131131   // device-level overrides
132132   virtual void device_start();
133   
133
134134   // reading and writing
135135   virtual DECLARE_READ32_MEMBER(read_ram);
136136   virtual DECLARE_WRITE32_MEMBER(write_ram);
r23623r23624
147147public:
148148   // construction/destruction
149149   gba_rom_eeprom64_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
150   
150
151151   // device-level overrides
152152   virtual void device_start();
153   
153
154154   // reading and writing
155155   virtual DECLARE_READ32_MEMBER(read_ram);
156156   virtual DECLARE_WRITE32_MEMBER(write_ram);
157   
157
158158private:
159159   gba_eeprom_device *m_eeprom;
160160};
trunk/src/mess/machine/sns_sa1.c
r23623r23624
5353
5454void sns_sa1_device::device_start()
5555{
56   
5756}
5857
5958void sns_sa1_device::device_reset()
r23623r23624
7877   m_bwram_sa1 = 0;
7978   m_bwram_sa1_source = 0;
8079   m_bwram_sa1_format = 0;
81   m_bwram_write_snes = 1;
80   m_bwram_write_snes = 1;
8281   m_bwram_write_sa1 = 1;
8382   m_bwpa_sa1 = 0x0f;
8483   m_iram_write_snes = 1;
r23623r23624
220219            UINT32 data = (var_length_read(space, m_vda + 0) <<  0) | (var_length_read(space, m_vda + 1) <<  8)
221220                                             | (var_length_read(space, m_vda + 2) << 16);
222221            data >>= m_vbit;
223           
224            if (m_drm == 1)
222
223            if (m_drm == 1)
225224            {
226225               //auto-increment mode
227226               m_vbit += m_vlen;
228227               m_vda += (m_vbit >> 3);
229228               m_vbit &= 7;
230229            }
231           
230
232231            value = (data >> 8) & 0xff;
233232         }
234233         break;
r23623r23624
255254            // reset sa-1?
256255         }
257256         m_sa1_ctrl = data;
258     
257
259258         if (BIT(m_sa1_ctrl, 7))
260259         {
261260            // IRQ
trunk/src/mess/machine/sega8_slot.c
r23623r23624
11/***********************************************************************************************************
2 
3 
2
3
44 Sega 8-bit cart emulation
55 (through slot devices)
66
77 Master System (Mark III) and Game Gear memory map can access 3 x 16K banks of ROM in
8 0x0000-0xbfff memory range. These banks can however point to different ROM or RAM area
8 0x0000-0xbfff memory range. These banks can however point to different ROM or RAM area
99 of the cart (or to BIOS banks, but these are handled directly in SMS emulation).
10
10
1111 Hence, carts can interface with the main system through the following handlers
1212 * read_cart : to read from ROM/RAM in memory range [0000-bfff]
1313 * write_cart : to write to ROM/RAM in memory range [0000-bfff]
r23623r23624
1717 Note about Sega Card / MyCard: the data contained in these matches the data in carts, it's only
1818 the connector to be different. We emulate this with a variant of the slot having different media
1919 switch and different interface (the latter not implemented yet)
20
20
2121 TODO:
2222 - investigate SG-1000 carts so to reduce duplicated code and to add full .sg support to sg1000m3
23
23
2424 ***********************************************************************************************************/
2525
2626
r23623r23624
8181      m_rom = auto_alloc_array_clear(machine, UINT8, size);
8282      m_rom_size = size;
8383      m_rom_page_count = size / 0x4000;
84      if (!m_rom_page_count)
85         m_rom_page_count = 1;   // we compute rom pages through (XXX % m_rom_page_count)!
84      if (!m_rom_page_count)
85         m_rom_page_count = 1;   // we compute rom pages through (XXX % m_rom_page_count)!
8686      late_bank_setup();
8787   }
8888}
r23623r23624
221221int sega8_cart_slot_device::verify_cart( UINT8 *magic, int size )
222222{
223223   int retval = IMAGE_VERIFY_FAIL;
224   
224
225225   // Verify the file is a valid image - check $7ff0 for "TMR SEGA"
226226   if (size >= 0x8000)
227227   {
228228      if (!strncmp((char*)&magic[0x7ff0], "TMR SEGA", 8))
229         retval = IMAGE_VERIFY_PASS;     
229         retval = IMAGE_VERIFY_PASS;
230230   }
231   
231
232232   return retval;
233233}
234234
r23623r23624
256256   {
257257      if (!memcmp(&rom[0x7ff0], signatures[0], 16) || !memcmp(&rom[0x7ff0], signatures[1], 16))
258258         xoff = 41;
259     
259
260260      if (!memcmp(&rom[0x7ff0], signatures[2], 16))
261261         xoff = 50;
262     
262
263263      if (!memcmp(&rom[0x7ff0], signatures[3], 16))
264264         xoff = 48;
265     
265
266266      if (!memcmp(&rom[0x7ff0], signatures[4], 16))
267267         xoff = 45;
268     
268
269269      if (!memcmp(&rom[0x7ff0], signatures[5], 16))
270270         xoff = 54;
271     
271
272272   }
273273
274274   m_cart->set_lphaser_xoffs(xoff);
r23623r23624
313313         // Codemasters cart can have 64KB of RAM (Ernie Els Golf? or 8KB?) and no battery
314314         m_cart->ram_alloc(machine(), 0x10000);
315315         m_cart->set_has_battery(FALSE);
316      }   
316      }
317317      else
318318      {
319         // for generic carts loaded from fullpath we have no way to know exactly if there was RAM,
320         // how much RAM was in the cart and if there was a battery so we always alloc 32KB and
319         // for generic carts loaded from fullpath we have no way to know exactly if there was RAM,
320         // how much RAM was in the cart and if there was a battery so we always alloc 32KB and
321321         // we save its content only if the game enable the RAM
322322         m_cart->set_late_battery(TRUE);
323323         m_cart->ram_alloc(machine(), 0x08000);
r23623r23624
328328      // from softlist we rely on the xml to only allocate the correct amount of RAM and to save it only if a battery was present
329329      const char *battery = get_feature("battery");
330330      m_cart->set_late_battery(FALSE);
331     
331
332332      if (get_software_region_length("ram"))
333333         m_cart->ram_alloc(machine(), get_software_region_length("ram"));
334334
335335      if (battery && !strcmp(battery, "yes"))
336336         m_cart->set_has_battery(TRUE);
337   }   
337   }
338338}
339339
340340bool sega8_cart_slot_device::call_load()
r23623r23624
350350         seterror(IMAGE_ERROR_UNSPECIFIED, "Attempted loading a card larger than 32KB");
351351         return IMAGE_INIT_FAIL;
352352      }
353         
353
354354      // check for header
355355      if ((len % 0x4000) == 512)
356356      {
357357         offset = 512;
358358         len -= 512;
359359      }
360   
360
361361      // make sure that we only get complete (0x4000) rom banks
362362      if (len & 0x3fff)
363363         len = ((len >> 14) + 1) << 14;
364     
364
365365      m_cart->rom_alloc(machine(), len);
366366      ROM = m_cart->get_rom_base();
367     
367
368368      if (software_entry() == NULL)
369369      {
370370         fseek(offset, SEEK_SET);
r23623r23624
372372      }
373373      else
374374         memcpy(ROM, get_software_region("rom") + offset, len);
375     
375
376376      /* check the image */
377377      if (verify_cart(ROM, len) == IMAGE_VERIFY_FAIL)
378378         logerror("Warning loading image: verify_cart failed\n");
r23623r23624
381381         m_type = sega8_get_pcb_id(get_feature("slot") ? get_feature("slot") : "rom");
382382      else
383383         m_type = get_cart_type(ROM, len);
384     
384
385385      set_lphaser_xoffset(ROM, len);
386386
387387      setup_ram();
388     
388
389389      // Check for gamegear cartridges with PIN 42 set to SMS mode
390390      if (software_entry() != NULL)
391391      {
r23623r23624
398398      // we attempt to load a battery because the game might have it!
399399      if (m_cart->get_ram_size() && (m_cart->get_has_battery() || m_cart->get_late_battery()))
400400         battery_load(m_cart->get_ram_base(), m_cart->get_ram_size(), 0x00);
401     
401
402402      //printf("Type: %s\n", sega8_get_slot(type));
403     
403
404404      internal_header_logging(ROM + offset, len, m_cart->get_ram_size());
405     
405
406406      return IMAGE_INIT_PASS;
407407   }
408408
r23623r23624
452452 - gamegear Pete Sampras Tennis
453453 - gamegear S.S. Lucifer
454454 - 95 - gamegear Micro Machines 2 - Turbo Tournament
455
455
456456 The Korean game Jang Pung II also seems to use a codemasters style mapper.
457457 */
458458int sms_state::detect_codemasters_mapper( UINT8 *rom )
459459{
460460   static const UINT8 jang_pung2[16] = { 0x00, 0xba, 0x38, 0x0d, 0x00, 0xb8, 0x38, 0x0c, 0x00, 0xb6, 0x38, 0x0b, 0x00, 0xb4, 0x38, 0x0a };
461   
461
462462   if (((rom[0x7fe0] & 0x0f ) <= 9) && (rom[0x7fe3] == 0x93 || rom[0x7fe3] == 0x94 || rom[0x7fe3] == 0x95) &&  rom[0x7fef] == 0x00)
463463      return 1;
464   
464
465465   if (!memcmp(&rom[0x7ff0], jang_pung2, 16))
466466      return 1;
467   
467
468468   return 0;
469469}
470470
r23623r23624
477477      { 0x41, 0x48, 0x37, 0x37, 0x44, 0x37, 0x4e, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20 }, /* Sangokushi 3 */
478478   };
479479   int i;
480   
480
481481   for (i = 0; i < 2; i++)
482482   {
483483      if (!memcmp(&rom[0x7ff0], signatures[i], 16))
r23623r23624
518518            { i += 2; _6000++; continue; }
519519         }
520520      }
521     
521
522522      LOG(("Mapper test: _0002 = %d, _8000 = %d, _a000 = %d, _ffff = %d\n", _0002, _8000, _a000, _ffff));
523     
523
524524      // 2 is a security measure, although tests on existing ROM showed it was not needed
525525      if (_0002 > _ffff + 2 || (_0002 > 0 && _ffff == 0))
526526      {
r23623r23624
545545   if (len >= 0x8000)
546546   {
547547      int x2000_3000 = 0, xd000_e000_f000 = 0, x2000_ff = 0;
548     
548
549549      for (int i = 0; i < 0x8000; i++)
550550      {
551551         if (ROM[i] == 0x32)
552552         {
553553            UINT16 addr = ROM[i + 1] | (ROM[i + 2] << 8);
554           
554
555555            switch (addr & 0xf000)
556556            {
557557               case 0x2000:
r23623r23624
559559                  i += 2;
560560                  x2000_3000++;
561561                  break;
562                 
562
563563               case 0xd000:
564564               case 0xe000:
565565               case 0xf000:
r23623r23624
582582            type = SEGA8_DAHJEE_TYPEA;
583583      }
584584   }
585   
585
586586   // Terebi Oekaki (TV Draw)
587587   if (!strncmp((const char *)&ROM[0x13b3], "annakmn", 7))
588588      type = SEGA8_TEREBIOEKAKI;
r23623r23624
590590   // The Castle (ROM+RAM)
591591   if (!strncmp((const char *)&ROM[0x1cc3], "ASCII 1986", 10))
592592      type = SEGA8_CASTLE;
593   
593
594594   // BASIC Level 3
595595   if (!strncmp((const char *)&ROM[0x6a20], "SC-3000 BASIC Level 3 ver 1.0", 29))
596596      type = SEGA8_BASIC_L3;
597   
597
598598   // Music Editor
599599   if (!strncmp((const char *)&ROM[0x0841], "PIANO", 5) || !strncmp((const char *)&ROM[0x0841], "music", 5))
600600      type = SEGA8_MUSIC_EDITOR;
601   
602   
601
602
603603   return type;
604604}
605605/*-------------------------------------------------
r23623r23624
724724      0x10000,
725725      0x20000,
726726   };
727   
727
728728   char reserved[10];
729729   UINT8 version, csum_size, region, serial[3];
730730   UINT16 checksum, csum = 0;
731731   UINT32 csum_end = 0;
732   
732
733733   // LOG FILE DETAILS
734734   logerror("FILE DETAILS\n" );
735735   logerror("============\n" );
r23623r23624
741741   if (nvram_len)
742742      logerror("RAM (Allocated) Size: 0x%X - Battery: %s\n", nvram_len, m_cart->get_has_battery() ? "Yes" : "No");
743743   logerror("\n" );
744   
745   
744
745
746746   // LOG HEADER DETAILS
747747   if (len < 0x8000)
748748      return;
749749
750750   for (int i = 0; i < 10; i++)
751751      reserved[i] = ROM[0x7ff0 + i];
752   
752
753753   checksum = ROM[0x7ffa] | (ROM[0x7ffb] << 8);
754   
754
755755   for (int i = 0; i < 3; i++)
756756      serial[i] = ROM[0x7ffc + i];
757757   serial[2] &= 0x0f;
758   
758
759759   version = (ROM[0x7ffe] & 0xf0) >> 4;
760   
760
761761   csum_size = ROM[0x7fff] & 0x0f;
762762   csum_end = csum_length[csum_size];
763763   if (!csum_end || csum_end > len)
764764      csum_end = len;
765   
765
766766   region = (ROM[0x7fff] & 0xf0) >> 4;
767   
767
768768   // compute cart checksum to compare with expected one
769769   for (int i = 0; i < csum_end; i++)
770770   {
r23623r23624
772772      {
773773         csum += ROM[i];
774774         csum &= 0xffff;
775      }         
775      }
776776   }
777   
777
778778   logerror("INTERNAL HEADER\n" );
779779   logerror("===============\n" );
780780   logerror("Reserved String: %.10s\n", reserved);
r23623r23624
785785   logerror("Software Revision: %x\n", version);
786786   logerror("\n" );
787787
788   
788
789789   if (m_type == SEGA8_CODEMASTERS)
790790   {
791791      UINT8 day, month, year, hour, minute;
792792      csum = 0;
793     
793
794794      day = ROM[0x7fe1];
795795      month = ROM[0x7fe2];
796796      year = ROM[0x7fe3];
r23623r23624
808808            csum &= 0xffff;
809809         }
810810      }
811     
811
812812      logerror("CODEMASTERS HEADER\n" );
813813      logerror("==================\n" );
814814      logerror("Build date & time: %x/%x/%x %.2x:%.2x\n", day, month, year, hour, minute);
trunk/src/mess/machine/pce_slot.c
r23623r23624
9696      // setup the rom_bank_map array to faster ROM read
9797      for (i = 0; i < size / 0x20000 && i < 8; i++)
9898         rom_bank_map[i] = i;
99     
99
100100      // fill up remaining blocks with mirrors
101101      while (i % 8)
102102      {
r23623r23624
110110      }
111111   }
112112   // check bank map!
113//   for (i = 0; i < 8; i++)
114//   {
115//      printf("bank %3d = %3d\t", i, rom_bank_map[i]);
116//   }
113//  for (i = 0; i < 8; i++)
114//  {
115//      printf("bank %3d = %3d\t", i, rom_bank_map[i]);
116//  }
117117}
118118
119119
r23623r23624
218218      UINT32 offset = 0;
219219      UINT32 len = (software_entry() == NULL) ? length() : get_software_region_length("rom");
220220      UINT8 *ROM;
221     
221
222222      // From fullpath, check for presence of a header and skip it
223223      if (software_entry() == NULL && (len % 0x4000) == 512)
224224      {
r23623r23624
227227         len -= offset;
228228         fseek(offset, SEEK_SET);
229229      }
230     
230
231231      m_cart->rom_alloc(machine(), len);
232232      ROM = m_cart->get_rom_base();
233233
r23623r23624
240240      if (ROM[0x1fff] < 0xe0)
241241      {
242242         UINT8 decrypted[256];
243         
243
244244         /* Initialize decryption table */
245245         for (int i = 0; i < 256; i++)
246246            decrypted[i] = ((i & 0x01) << 7) | ((i & 0x02) << 5) | ((i & 0x04) << 3) | ((i & 0x08) << 1) | ((i & 0x10) >> 1) | ((i & 0x20 ) >> 3) | ((i & 0x40) >> 5) | ((i & 0x80) >> 7);
247         
247
248248         /* Decrypt ROM image */
249249         for (int i = 0; i < len; i++)
250250            ROM[i] = decrypted[ROM[i]];
r23623r23624
253253      m_cart->rom_map_setup(len);
254254
255255      if (software_entry() == NULL)
256         m_type = get_cart_type(ROM, len);         
256         m_type = get_cart_type(ROM, len);
257257      else
258258      {
259259         const char *pcb_name = get_feature("slot");
260260         if (pcb_name)
261261            m_type = pce_get_pcb_id(pcb_name);
262      }   
262      }
263263      //printf("Type: %s\n", pce_get_slot(m_type));
264264
265265      if (m_type == PCE_POPULOUS)
r23623r23624
296296
297297
298298/*-------------------------------------------------
299 get_cart_type - code to detect NVRAM type from
299 get_cart_type - code to detect NVRAM type from
300300 fullpath
301301 -------------------------------------------------*/
302302
r23623r23624
307307   /* Check for Street fighter 2 */
308308   if (len == 0x280000)
309309      type = PCE_SF2;
310   
310
311311   /* Check for Populous */
312312   if (len >= 0x1f26 + 8 && !memcmp(ROM + 0x1f26, "POPULOUS", 8))
313313      type = PCE_POPULOUS;
314   
314
315315   // Check for CD system card v3 which adds on-cart RAM to the system
316316   if (!memcmp(ROM + 0x3FFB6, "PC Engine CD-ROM SYSTEM", 23))
317317   {
r23623r23624
382382void pce_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 len)
383383{
384384}
385
trunk/src/mess/machine/sega8_slot.h
r23623r23624
4848   // a few carts (for SG1000) acts as a RAM expansion, taking control of the system RAM in 0xc000-0xffff
4949   virtual DECLARE_READ8_MEMBER(read_ram) { return 0xff; }
5050   virtual DECLARE_WRITE8_MEMBER(write_ram) {}
51   
51
5252   void rom_alloc(running_machine &machine, UINT32 size);
5353   void ram_alloc(running_machine &machine, UINT32 size);
54   
54
5555   virtual void late_bank_setup() {}
56   
56
5757   void set_has_battery(bool val) { has_battery = val; }
5858   bool get_has_battery() { return has_battery; }
5959   void set_late_battery(bool val) { m_late_battery_enable = val; }
r23623r23624
6262   int get_lphaser_xoffs() { return m_lphaser_xoffs; }
6363   void set_sms_mode(int val) { m_sms_mode = val; }
6464   int get_sms_mode() { return m_sms_mode; }
65   
65
6666//protected:
6767   UINT8* get_rom_base() { return m_rom; }
6868   UINT8* get_ram_base() { return m_ram; }
r23623r23624
8181   int m_rom_page_count;
8282
8383   bool has_battery;
84   
85   // we use this variable for fullpath loading only: in this case, RAM is always allocated,
84
85   // we use this variable for fullpath loading only: in this case, RAM is always allocated,
8686   // but we set has_battery only if RAM is actually enabled during game...
87   bool m_late_battery_enable;   
87   bool m_late_battery_enable;
8888
8989   int m_lphaser_xoffs;
9090   int m_sms_mode;
r23623r23624
218218   MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
219219   static_cast<sega8_card_slot_device *>(device)->set_mandatory(FALSE); \
220220   static_cast<sega8_card_slot_device *>(device)->set_intf("sms_card"); \
221   static_cast<sega8_card_slot_device *>(device)->set_ext("bin"); \
222
221   static_cast<sega8_card_slot_device *>(device)->set_ext("bin");
223222#define MCFG_SG1000_CARD_ADD(_tag,_slot_intf,_def_slot) \
224223   MCFG_DEVICE_ADD(_tag, SEGA8_CARD_SLOT, 0) \
225224   MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
226225   static_cast<sega8_card_slot_device *>(device)->set_intf("sg1000_cart"); \
227   static_cast<sega8_card_slot_device *>(device)->set_ext("bin,sg"); \
226   static_cast<sega8_card_slot_device *>(device)->set_ext("bin,sg");
228227
229228
230
231229#endif
trunk/src/mess/machine/pce_slot.h
r23623r23624
4444   UINT32 m_ram_size;
4545
4646   void rom_map_setup(UINT32 size);
47   
47
4848   UINT8 rom_bank_map[8];    // 128K chunks of rom
4949};
5050
trunk/src/mess/machine/ep64exp.h
r23623r23624
5757//  MACROS / CONSTANTS
5858//**************************************************************************
5959
60#define EP64_EXPANSION_BUS_TAG   "exp"
60#define EP64_EXPANSION_BUS_TAG  "exp"
6161
6262
6363
r23623r23624
8686class device_ep64_expansion_bus_card_interface;
8787
8888class ep64_expansion_bus_slot_device : public device_t,
89                              public device_slot_interface
89                              public device_slot_interface
9090{
9191   friend class device_ep64_expansion_bus_card_interface;
9292
trunk/src/mess/machine/abc99.c
r23623r23624
153153//-------------------------------------------------
154154
155155static ADDRESS_MAP_START( abc99_z5_io, AS_IO, 8, abc99_device )
156/*   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_READ(z5_p1_r)
157   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(z5_p2_w)
158   AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_WRITENOP // Z2 CLK
159   AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(z5_t1_r)*/
156/*  AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_READ(z5_p1_r)
157    AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(z5_p2_w)
158    AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_WRITENOP // Z2 CLK
159    AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(z5_t1_r)*/
160160ADDRESS_MAP_END
161161
162162
trunk/src/mess/machine/abc99.h
r23623r23624
6464      TIMER_SERIAL,
6565      TIMER_MOUSE
6666   };
67   
67
6868   enum
6969   {
7070      LED_1 = 0,
trunk/src/mess/machine/pce_rom.c
r23623r23624
11/***********************************************************************************************************
22
3
3
44 PC-Engine & Turbografx-16 cart emulation
5 
65
6
77 ***********************************************************************************************************/
88
99
r23623r23624
9898   int bank = offset / 0x20000;
9999   if (m_ram && offset >= 0x80000 && offset < 0x88000)
100100      return m_ram[offset];
101   
101
102102   return m_rom[rom_bank_map[bank] * 0x20000 + (offset & 0x1ffff)];
103103}
104104
r23623r23624
122122   if (offset >= 0x1ff0 && offset < 0x1ff4)
123123      m_bank_base = offset & 3;
124124}
125
trunk/src/mess/machine/sega8_rom.c
r23623r23624
11/***********************************************************************************************************
22
33 Sega 8-bit cart emulation (for Master System, GameGear and SG-1000)
4
4
55 TODO: implement proper ROM & RAM mirroring when the cart size is not a power of 2K (e.g. 24K or 48K)
66
77 ***********************************************************************************************************/
r23623r23624
318318 -------------------------------------------------*/
319319
320320/*-------------------------------------------------
321
321
322322 Base Sega 8bit carts, possibly with bankswitch
323323 (only used by Mark III, SMS and GG games)
324
324
325325 -------------------------------------------------*/
326326
327327READ8_MEMBER(sega8_rom_device::read_cart)
328328{
329329   int bank = offset / 0x4000;
330   
330
331331   if (bank == 2 && m_ram && m_ram_enabled)
332332      return m_ram[(m_ram_base * 0x4000 + (offset & 0x3fff)) % m_ram_size];
333333
334   if (offset < 0x400)   // first 1k is hardcoded
334   if (offset < 0x400) // first 1k is hardcoded
335335      return m_rom[offset];
336336
337337   return m_rom[m_rom_bank_base[bank] * 0x4000 + (offset & 0x3fff)];
r23623r23624
340340WRITE8_MEMBER(sega8_rom_device::write_cart)
341341{
342342   int bank = offset / 0x4000;
343   
343
344344   if (bank == 2 && m_ram && m_ram_enabled)
345345      m_ram[(m_ram_base * 0x4000 + (offset & 0x3fff)) % m_ram_size] = data;
346346}
r23623r23624
362362         else
363363            m_ram_enabled = 0;
364364         break;
365         
365
366366      case 1: // Select 16k ROM bank for 0000-3fff
367367      case 2: // Select 16k ROM bank for 4000-7fff
368368      case 3: // Select 16k ROM bank for 8000-bfff
369369         m_rom_bank_base[offset - 1] = data  % m_rom_page_count;
370370         break;
371   }   
371   }
372372}
373373
374374
375375/*-------------------------------------------------
376 
377 Sega Card Catcher is a passthrough adapter for
378 SG-1000 to load games in MyCard format into the
376
377 Sega Card Catcher is a passthrough adapter for
378 SG-1000 to load games in MyCard format into the
379379 main cartslot
380
380
381381 -------------------------------------------------*/
382382
383383READ8_MEMBER(sega8_cardcatch_device::read_cart)
384384{
385385   if (offset < 0x8000)
386386      return m_card->read_cart(space, offset);
387   
387
388388   return 0xff;
389389}
390390
r23623r23624
409409}
410410
411411/*-------------------------------------------------
412 
413 Othello is a SG-1000 game featuring 2K of
412
413 Othello is a SG-1000 game featuring 2K of
414414 oncart RAM, mapped at 0x8000-0x9fff.
415415 Is RAM mirrored? For now we assume so...
416
416
417417 -------------------------------------------------*/
418418
419419READ8_MEMBER(sega8_othello_device::read_cart)
r23623r23624
421421   // 8K of RAM sits in 0x8000-0x9fff
422422   if (offset >= 0x8000 && offset < 0xa000)
423423      return m_ram[offset & 0x7ff];
424   
424
425425   return m_rom[offset % m_rom_size];
426426}
427427
r23623r23624
434434
435435
436436/*-------------------------------------------------
437 
438 The Castle is a SG-1000 game featuring 8K of
437
438 The Castle is a SG-1000 game featuring 8K of
439439 oncart RAM, mapped at 0x8000-0x9fff
440
440
441441 -------------------------------------------------*/
442442
443443READ8_MEMBER(sega8_castle_device::read_cart)
r23623r23624
445445   // 8K of RAM sits in 0x8000-0x9fff
446446   if (offset >= 0x8000 && offset < 0xa000)
447447      return m_ram[offset & 0x1fff];
448   
448
449449   return m_rom[offset % m_rom_size];
450450}
451451
r23623r23624
458458
459459
460460/*-------------------------------------------------
461 
462 BASIC Level III cart featured 32K of
461
462 BASIC Level III cart featured 32K of
463463 oncart RAM, mapped at 0x8000-0xffff?
464
464
465465 -------------------------------------------------*/
466466
467467READ8_MEMBER(sega8_basic_l3_device::read_cart)
r23623r23624
469469   // 8K of RAM sits in 0x8000-0x9fff
470470   if (offset >= 0x8000)
471471      return m_ram[offset & 0x3fff];
472   
472
473473   return m_rom[offset % m_rom_size];
474474}
475475
r23623r23624
492492
493493
494494/*-------------------------------------------------
495 
496 Music Editor cart featured 10K of oncart RAM, mapped
495
496 Music Editor cart featured 10K of oncart RAM, mapped
497497 in 0x8000-0x9fff and 0xc000-0xffff
498
498
499499 -------------------------------------------------*/
500500
501501READ8_MEMBER(sega8_music_editor_device::read_cart)
r23623r23624
503503   // 8K of RAM sits in 0x8000-0x9fff
504504   if (offset >= 0x8000 && offset < 0xa000)
505505      return m_ram[offset & 0x1fff];
506   
506
507507   return m_rom[offset % m_rom_size];
508508}
509509
r23623r23624
530530
531531
532532/*-------------------------------------------------
533
533
534534 SG-1000 Terebi Oekaki using a Tablet input device
535
535
536536 -------------------------------------------------*/
537537
538538/*
539
539
540540 Terebi Oekaki (TV Draw)
541
541
542542 Address Access  Bits
543543 7       6   5   4   3   2   1   0
544544 $6000   W       -       -   -   -   -   -   -   AXIS
545545 $8000   R       BUSY    -   -   -   -   -   -   PRESS
546546 $A000   R/W     DATA
547
547
548548 AXIS: write 0 to select X axis, 1 to select Y axis.
549549 BUSY: reads 1 when graphic board is busy sampling position, else 0.
550550 PRESS: reads 0 when pen is touching graphic board, else 1.
551551 DATA: when pen is touching graphic board, return 8-bit sample position for currently selected axis (X is in the 0-255 range, Y in the 0-191 range). Else, return 0.
552
552
553553 */
554554
555555
556556READ8_MEMBER(sega8_terebi_device::read_cart)
557557{
558558   int bank = offset / 0x4000;
559   
559
560560   if (offset == 0x8000)
561561      return m_tvdraw_pen->read();
562562   if (offset == 0xa000)
563563      return m_tvdraw_data;
564   
564
565565   return m_rom[m_rom_bank_base[bank] * 0x4000 + (offset & 0x3fff)];
566566}
567567
r23623r23624
573573         if (data & 0x01)
574574         {
575575            m_tvdraw_data = m_tvdraw_x->read();
576           
576
577577            if (m_tvdraw_data < 4) m_tvdraw_data = 4;
578578            if (m_tvdraw_data > 251) m_tvdraw_data = 251;
579579         }
r23623r23624
604604
605605
606606/*-------------------------------------------------
607
607
608608 Dahjee carts were sold with a RAM expansion pass-through
609 cart (which we don't emulate separately for the
610 moment) which allowed to play on old SG1000 machines
609 cart (which we don't emulate separately for the
610 moment) which allowed to play on old SG1000 machines
611611 some MSX conversions requiring more RAM than available
612
612
613613 Two kind of expansion existed (for different games),
614 one with 9K of RAM (Type A) and one with 8K of
614 one with 9K of RAM (Type A) and one with 8K of
615615 RAM (Type B).
616
616
617617 -------------------------------------------------*/
618618
619619// TYPE A
r23623r23624
622622   // 8K of RAM sits in 0x2000-0x3fff
623623   if (offset >= 0x2000 && offset < 0x4000)
624624      return m_ram[offset & 0x1fff];
625   
625
626626   return m_rom[offset % m_rom_size];
627627}
628628
r23623r23624
670670
671671
672672/*-------------------------------------------------
673
673
674674 Sega carts + EEPROM, used for some GameGear baseball
675675 games
676
676
677677 -------------------------------------------------*/
678678
679679
680680READ8_MEMBER(sega8_eeprom_device::read_cart)
681681{
682682   int bank = offset / 0x4000;
683   
683
684684   if (offset == 0x8000 && m_93c46_enabled)
685685   {
686686      UINT8 value = (m_93c46_lines & 0xfc) | 0x02;
687687      value |= m_eeprom->read_bit() ? 1 : 0;
688688      return value;
689689   }
690   
691   if (offset < 0x400)   // first 1k is hardcoded
690
691   if (offset < 0x400) // first 1k is hardcoded
692692      return m_rom[offset];
693   
693
694694   return m_rom[m_rom_bank_base[bank] * 0x4000 + (offset & 0x3fff)];
695695}
696696
r23623r23624
719719         m_93c46_enabled = BIT(data, 3);
720720         logerror("eeprom %s\n", m_93c46_enabled ? "enabled" : "disabled");
721721         break;
722         
722
723723      case 1: // Select 16k ROM bank for 0000-3fff
724724      case 2: // Select 16k ROM bank for 4000-7fff
725725      case 3: // Select 16k ROM bank for 8000-bfff
726726         m_rom_bank_base[offset - 1] = data % m_rom_page_count;
727727         break;
728   }   
728   }
729729}
730730
731731MACHINE_CONFIG_FRAGMENT( gg_eeprom )
r23623r23624
739739
740740
741741/*-------------------------------------------------
742
742
743743 Codemasters carts, possibly having on cart RAM
744744 (Ernie Els Golf)
745
745
746746 -------------------------------------------------*/
747747
748748READ8_MEMBER(sega8_codemasters_device::read_cart)
749749{
750750   int bank = offset / 0x2000;
751   
751
752752   if (bank == 5 && m_ram && m_ram_enabled)
753753      return m_ram[(m_ram_base * 0x2000 + (offset & 0x1fff)) % m_ram_size];
754   
754
755755   return m_rom[m_rom_bank_base[bank/2] * 0x4000 + (offset & 0x3fff)];
756756}
757757
r23623r23624
786786}
787787
788788/*-------------------------------------------------
789
789
790790 HES 4 PAK All Action cart
791
791
792792 -------------------------------------------------*/
793793
794794
r23623r23624
814814
815815
816816/*-------------------------------------------------
817
817
818818 base Zemina carts, allowing for 8K bankswitch
819
819
820820 -------------------------------------------------*/
821821
822822READ8_MEMBER(sega8_zemina_device::read_cart)
823823{
824824   int bank = offset / 0x2000;
825   
825
826826   if (bank >= 4 && m_ram && m_ram_enabled)
827827      return m_ram[(m_ram_base * 0x2000 + (offset & 0x1fff)) % m_ram_size];
828   
828
829829   return m_rom[m_rom_bank_base[bank] * 0x2000 + (offset & 0x1fff)];
830830}
831831
832832WRITE8_MEMBER(sega8_zemina_device::write_cart)
833833{
834834   int bank = offset / 0x2000;
835   
835
836836   if (bank >= 4 && m_ram && m_ram_enabled)
837837      m_ram[(m_ram_base * 0x2000 + (offset & 0x1fff)) % m_ram_size] = data;
838838
r23623r23624
857857}
858858
859859/*-------------------------------------------------
860
860
861861 Zemina cart used for Nemesis: same as above, but
862862 different bank layout at start (see late_bank_setup)
863
863
864864 -------------------------------------------------*/
865865
866866/*-------------------------------------------------
867
867
868868 Daiou cart used for SMS Janggun-ui Adeul
869
869
870870 the game expects to access 256 x 8K banks:
871871 first 64 are just the game, second 64 are a mirror of the first ones
872872 upper 128 are the same as the previous but with bytes in reverse order
873873 probably as a shortcut to get sprite flipping for free from hw
874874 so if bit7 of current bank page is set, we swap the result
875
875
876876 -------------------------------------------------*/
877877
878878READ8_MEMBER(sega8_janggun_device::read_cart)
879879{
880880   int bank = offset / 0x2000;
881   
881
882882   if (m_rom_bank_base[bank] < 0x80)
883883      return m_rom[(m_rom_bank_base[bank] & 0x3f) * 0x2000 + (offset & 0x1fff)];
884884   else
r23623r23624
911911   {
912912      case 0:
913913         break;
914         
914
915915      case 1: // Select 16k ROM bank for 0000-3fff
916916      case 2: // Select 16k ROM bank for 4000-7fff
917917      case 3: // Select 16k ROM bank for 8000-bfff
918918         m_rom_bank_base[(offset - 1) * 2] = (data  % m_rom_page_count) * 2;
919919         m_rom_bank_base[(offset - 1) * 2 + 1] = (data  % m_rom_page_count) * 2 + 1;
920920         break;
921   }   
921   }
922922}
923923
924924
925925/*-------------------------------------------------
926 
927 Korean cart, used e.g. in Dodgeball King,
926
927 Korean cart, used e.g. in Dodgeball King,
928928 uses writes to 0xa000 for bankswitch
929
929
930930 -------------------------------------------------*/
931931
932932WRITE8_MEMBER(sega8_korean_device::write_cart)
933933{
934934   int bank = offset / 0x4000;
935   
935
936936   if (bank == 2 && m_ram && m_ram_enabled)
937937      m_ram[m_ram_base * 0x4000 + (offset & 0x3fff)] = data;
938938
939939   if (offset == 0xa000)
940940      m_rom_bank_base[2] = data % m_rom_page_count;
941941}
942
trunk/src/mess/machine/pce_rom.h
r23623r23624
1313   // construction/destruction
1414   pce_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
1515   pce_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
16   
16
1717   // device-level overrides
1818   virtual void device_start() {}
1919   virtual void device_reset() {}
20   
20
2121   // reading and writing
2222   virtual DECLARE_READ8_MEMBER(read_cart);
2323};
r23623r23624
5757public:
5858   // construction/destruction
5959   pce_sf2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
60   
60
6161   // device-level overrides
6262   virtual void device_start();
6363   virtual void device_reset();
64   
64
6565   // reading and writing
6666   virtual DECLARE_READ8_MEMBER(read_cart);
6767   virtual DECLARE_WRITE8_MEMBER(write_cart);
trunk/src/mess/machine/sega8_rom.h
r23623r23624
4141public:
4242   // construction/destruction
4343   sega8_cardcatch_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
44   
44
4545   // reading and writing
4646   virtual DECLARE_READ8_MEMBER(read_cart);
4747   virtual DECLARE_WRITE8_MEMBER(write_cart);
4848   virtual DECLARE_WRITE8_MEMBER(write_mapper) {}
49   
49
5050   virtual machine_config_constructor device_mconfig_additions() const;
51   
51
5252protected:
5353   required_device<sega8_card_slot_device> m_card;
5454};
r23623r23624
6161public:
6262   // construction/destruction
6363   sega8_othello_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
64   
64
6565   // reading and writing
6666   virtual DECLARE_READ8_MEMBER(read_cart);
6767   virtual DECLARE_WRITE8_MEMBER(write_cart);
r23623r23624
7676public:
7777   // construction/destruction
7878   sega8_castle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
79   
79
8080   // reading and writing
8181   virtual DECLARE_READ8_MEMBER(read_cart);
8282   virtual DECLARE_WRITE8_MEMBER(write_cart);
r23623r23624
9191public:
9292   // construction/destruction
9393   sega8_basic_l3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
94   
94
9595   // reading and writing
9696   virtual DECLARE_READ8_MEMBER(read_cart);
9797   virtual DECLARE_WRITE8_MEMBER(write_cart);
9898   virtual DECLARE_WRITE8_MEMBER(write_mapper) {}
99   
99
100100   // has internal RAM which overwrites the system one!
101101   virtual DECLARE_READ8_MEMBER(read_ram);
102102   virtual DECLARE_WRITE8_MEMBER(write_ram);
r23623r23624
110110public:
111111   // construction/destruction
112112   sega8_music_editor_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
113   
113
114114   // reading and writing
115115   virtual DECLARE_READ8_MEMBER(read_cart);
116116   virtual DECLARE_WRITE8_MEMBER(write_cart);
117117   virtual DECLARE_WRITE8_MEMBER(write_mapper) {}
118   
118
119119   // has internal RAM which overwrites the system one!
120120   virtual DECLARE_READ8_MEMBER(read_ram);
121121   virtual DECLARE_WRITE8_MEMBER(write_ram);
r23623r23624
129129public:
130130   // construction/destruction
131131   sega8_terebi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
132   
132
133133   // device-level overrides
134134   virtual void device_start();
135135   virtual ioport_constructor device_input_ports() const;
136136   virtual void device_reset();
137   
137
138138   required_ioport m_tvdraw_x;
139139   required_ioport m_tvdraw_y;
140140   required_ioport m_tvdraw_pen;
141   
141
142142   // reading and writing
143143   virtual DECLARE_READ8_MEMBER(read_cart);
144144   virtual DECLARE_WRITE8_MEMBER(write_cart);
145145   virtual DECLARE_WRITE8_MEMBER(write_mapper) {}
146   
146
147147protected:
148148   UINT8 m_tvdraw_data;
149149};
r23623r23624
156156public:
157157   // construction/destruction
158158   sega8_dahjee_typea_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
159   
159
160160   // reading and writing
161161   virtual DECLARE_READ8_MEMBER(read_cart);
162162   virtual DECLARE_WRITE8_MEMBER(write_cart);
163163   virtual DECLARE_WRITE8_MEMBER(write_mapper) {}
164   
164
165165   // has internal RAM which overwrites the system one!
166166   virtual DECLARE_READ8_MEMBER(read_ram);
167167   virtual DECLARE_WRITE8_MEMBER(write_ram);
r23623r23624
175175public:
176176   // construction/destruction
177177   sega8_dahjee_typeb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
178   
178
179179   // reading and writing
180180   virtual DECLARE_READ8_MEMBER(read_cart);
181181   virtual DECLARE_WRITE8_MEMBER(write_cart) {}
182182   virtual DECLARE_WRITE8_MEMBER(write_mapper) {}
183   
183
184184   // has internal RAM which overwrites the system one!
185185   virtual DECLARE_READ8_MEMBER(read_ram);
186186   virtual DECLARE_WRITE8_MEMBER(write_ram);
r23623r23624
197197public:
198198   // construction/destruction
199199   sega8_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
200   
200
201201   // device-level overrides
202202   virtual void device_start();
203203   virtual machine_config_constructor device_mconfig_additions() const;
204204   virtual void device_reset();
205   
205
206206   virtual void late_bank_setup();
207   
207
208208   // reading and writing
209209   virtual DECLARE_READ8_MEMBER(read_cart);
210210   virtual DECLARE_WRITE8_MEMBER(write_cart);
211211   virtual DECLARE_WRITE8_MEMBER(write_mapper);
212     
212
213213protected:
214214   UINT8 m_rom_bank_base[3];
215   
215
216216   required_device<eeprom_device> m_eeprom;
217217   int m_93c46_enabled;
218218   UINT8 m_93c46_lines;
r23623r23624
227227public:
228228   // construction/destruction
229229   sega8_codemasters_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
230   
230
231231   // device-level overrides
232232   virtual void device_start();
233233   virtual void device_reset();
234   
234
235235   virtual void late_bank_setup();
236   
236
237237   // reading and writing
238238   virtual DECLARE_READ8_MEMBER(read_cart);
239239   virtual DECLARE_WRITE8_MEMBER(write_cart);
240240   // no mapper write for this!
241   
241
242242protected:
243243   UINT8 m_rom_bank_base[3];
244244   UINT8 m_ram_base;
r23623r23624
253253public:
254254   // construction/destruction
255255   sega8_4pak_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
256   
256
257257   // device-level overrides
258258   virtual void device_start();
259259   virtual void device_reset();
r23623r23624
275275   // construction/destruction
276276   sega8_zemina_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
277277   sega8_zemina_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
278   
278
279279   // device-level overrides
280280   virtual void device_start();
281281   virtual void device_reset();
282   
282
283283   virtual void late_bank_setup();
284   
284
285285   // reading and writing
286286   virtual DECLARE_READ8_MEMBER(read_cart);
287287   virtual DECLARE_WRITE8_MEMBER(write_cart);
288288   // no mapper write for this!
289   
289
290290protected:
291291   UINT8 m_rom_bank_base[6];
292292   UINT8 m_ram_base;
r23623r23624
301301public:
302302   // construction/destruction
303303   sega8_nemesis_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
304   
304
305305   virtual void late_bank_setup();
306306};
307307
r23623r23624
317317
318318   // device-level overrides
319319   virtual void device_start() { save_item(NAME(m_rom_bank_base)); }
320   
320
321321   virtual void late_bank_setup();
322   
322
323323   // reading and writing
324324   virtual DECLARE_READ8_MEMBER(read_cart);
325325   virtual DECLARE_WRITE8_MEMBER(write_cart);
326326   virtual DECLARE_WRITE8_MEMBER(write_mapper);
327   
327
328328protected:
329329   UINT8 m_rom_bank_base[6];
330330};
r23623r23624
337337public:
338338   // construction/destruction
339339   sega8_korean_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
340   
340
341341   virtual void late_bank_setup();
342   
342
343343   // reading and writing
344344   virtual DECLARE_WRITE8_MEMBER(write_cart);
345345   virtual DECLARE_WRITE8_MEMBER(write_mapper) {}
trunk/src/mess/machine/bbc.c
r23623r23624
14171417
14181418
14191419READ_LINE_MEMBER( bbc_state::bbc_rxd_r )
1420{
1421   return ( m_serproc_data & 0x40 ) ? m_rs232->rx() : m_rxd_cass;
1420{
1421   return ( m_serproc_data & 0x40 ) ? m_rs232->rx() : m_rxd_cass;
14221422}
14231423
14241424
r23623r23624
14291429
14301430
14311431READ_LINE_MEMBER( bbc_state::bbc_cts_r )
1432{
1432{
14331433   return ( m_serproc_data & 0x40 ) ? m_rs232->cts_r() : 0;
14341434}
14351435
trunk/src/mess/machine/gba_slot.c
r23623r23624
159159   {
160160      UINT8 *ROM = (UINT8 *)m_cart->get_rom_base();
161161      UINT32 cart_size;
162     
162
163163      if (software_entry() == NULL)
164164      {
165165         cart_size = length();
r23623r23624
169169            return IMAGE_INIT_FAIL;
170170         }
171171         fread(ROM, cart_size);
172         m_cart->set_rom_size(cart_size);   // we store the actual game size...
172         m_cart->set_rom_size(cart_size);    // we store the actual game size...
173173
174         m_type = get_cart_type(ROM, cart_size);         
174         m_type = get_cart_type(ROM, cart_size);
175175      }
176176      else
177177      {
r23623r23624
184184            return IMAGE_INIT_FAIL;
185185         }
186186         memcpy(ROM, get_software_region("rom"), cart_size);
187         m_cart->set_rom_size(cart_size);   // we store the actual game size...
188         
187         m_cart->set_rom_size(cart_size);    // we store the actual game size...
188
189189         if (pcb_name)
190190            m_type = gba_get_pcb_id(pcb_name);
191191
r23623r23624
249249
250250
251251/*-------------------------------------------------
252 get_cart_type - code to detect NVRAM type from
252 get_cart_type - code to detect NVRAM type from
253253 fullpath
254254 -------------------------------------------------*/
255255
r23623r23624
305305         chip |= GBA_CHIP_RTC;
306306   }
307307   mame_printf_info("GBA: Detected (ROM) %s\n", gba_chip_string(chip).cstr());
308   
308
309309   // fix for games which return more than one kind of chip: either it is one of the known titles, or we default to no battery
310310   if (gba_chip_has_conflict(chip))
311311   {
312312      char game_code[5] = { 0 };
313313      bool resolved = FALSE;
314     
314
315315      if (len >= 0xac + 4)
316316         memcpy(game_code, ROM + 0xac, 4);
317     
317
318318      mame_printf_info("GBA: Game Code \"%s\"\n", game_code);
319319
320320      chip &= ~(GBA_CHIP_EEPROM | GBA_CHIP_EEPROM_4K | GBA_CHIP_EEPROM_64K | GBA_CHIP_FLASH | GBA_CHIP_FLASH_1M | GBA_CHIP_FLASH_512 | GBA_CHIP_SRAM);
r23623r23624
333333      if (!resolved)
334334         mame_printf_warning("GBA: NVRAM is disabled because multiple NVRAM chips were detected!\n");
335335   }
336   
336
337337   // fix for games which are known to require an eeprom with 14-bit addressing (64 kbit)
338338   if (chip & GBA_CHIP_EEPROM)
339339   {
r23623r23624
341341
342342      if (len >= 0xac + 4)
343343         memcpy(game_code, ROM + 0xac, 4);
344     
344
345345      mame_printf_info("GBA: Game Code \"%s\"\n", game_code);
346346
347347      for (int i = 0; i < sizeof(gba_chip_fix_eeprom_list) / sizeof(gba_chip_fix_eeprom_item); i++)
r23623r23624
462462
463463
464464/*-------------------------------------------------
465 Install ROM - directly point system address map
465 Install ROM - directly point system address map
466466 to the cart ROM region so to avoid the memory
467467 system additional load
468468 -------------------------------------------------*/
r23623r23624
481481      machine().root_device().membank("rom3")->set_base(machine().root_device().memregion(m_cart->device().subtag(tempstring, "cartridge"))->base());
482482   }
483483}
484
trunk/src/mess/machine/gba_slot.h
r23623r23624
4242   void set_rom_size(UINT32 val) { m_rom_size = val; }
4343
4444   // internal state
45   UINT32 *m_rom;   // this points to the cart rom region
45   UINT32 *m_rom;  // this points to the cart rom region
4646   UINT32 *m_nvram;
47   UINT32 m_rom_size;   // this is the actual game size, not the rom region size!
47   UINT32 m_rom_size;  // this is the actual game size, not the rom region size!
4848   UINT32 m_nvram_size;
4949};
5050
r23623r23624
119119
120120
121121//------------------------------------------------------------------------
122//
122//
123123// Misc structs to attempt NVRAM identification when loading from fullpath
124//
124//
125125//------------------------------------------------------------------------
126126
127127
trunk/src/mess/machine/s3c44b0.c
r23623r23624
6161   const s3c44b0_interface *intf = reinterpret_cast<const s3c44b0_interface *>(static_config());
6262   if (intf != NULL)
6363      *static_cast<s3c44b0_interface *>(this) = *intf;
64   
64
6565   // or initialize to defaults if none provided
6666   else
6767   {
r23623r23624
8383   m_sda_w.resolve(i2c_itf.sda_w, *this);
8484   m_adc_data_r.resolve(adc_itf.data_r, *this);
8585   m_i2s_data_w.resolve(i2s_itf.data_w, *this);
86   
87   
86
87
8888   for (int i = 0; i < 6; i++) m_pwm.timer[i] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(s3c44b0_device::pwm_timer_exp),this));
8989   for (int i = 0; i < 2; i++) m_uart[i].timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(s3c44b0_device::uart_timer_exp),this));
9090   for (int i = 0; i < 2; i++) m_zdma[i].timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(s3c44b0_device::zdma_timer_exp),this));
r23623r23624
114114   save_item(NAME(m_irq.regs.f_ispc));
115115   save_item(NAME(m_irq.line_irq));
116116   save_item(NAME(m_irq.line_fiq));
117   
117
118118   save_item(NAME(m_clkpow.regs.pllcon));
119119   save_item(NAME(m_clkpow.regs.clkcon));
120120   save_item(NAME(m_clkpow.regs.clkslow));
121121   save_item(NAME(m_clkpow.regs.locktime));
122   
122
123123   // FIXME: how to save m_lcd.bitmap which gets allocated/freed during emulation?
124124   save_item(NAME(m_lcd.regs.lcdcon1));
125125   save_item(NAME(m_lcd.regs.lcdcon2));
r23623r23624
149149   save_item(NAME(m_lcd.vpos_max));
150150   save_item(NAME(m_lcd.vpos_end));
151151   save_item(NAME(m_lcd.frame_time));
152   
152
153153   machine().save().register_postload(save_prepost_delegate(FUNC(s3c44b0_device::s3c44b0_postload), this));
154   
154
155155   for (int i = 0; i < 2; i++)
156156   {
157157      save_item(NAME(m_zdma[i].regs.dcon), i);
r23623r23624
161161      save_item(NAME(m_zdma[i].regs.dcsrc), i);
162162      save_item(NAME(m_zdma[i].regs.dcdst), i);
163163      save_item(NAME(m_zdma[i].regs.dccnt), i);
164     
164
165165      save_item(NAME(m_bdma[i].regs.dcon), i);
166166      save_item(NAME(m_bdma[i].regs.disrc), i);
167167      save_item(NAME(m_bdma[i].regs.didst), i);
r23623r23624
169169      save_item(NAME(m_bdma[i].regs.dcsrc), i);
170170      save_item(NAME(m_bdma[i].regs.dcdst), i);
171171      save_item(NAME(m_bdma[i].regs.dccnt), i);
172     
172
173173      save_item(NAME(m_uart[i].regs.ulcon), i);
174174      save_item(NAME(m_uart[i].regs.ucon), i);
175175      save_item(NAME(m_uart[i].regs.ufcon), i);
r23623r23624
182182      save_item(NAME(m_uart[i].regs.urxh), i);
183183      save_item(NAME(m_uart[i].regs.ubrdiv), i);
184184   }
185   
185
186186   save_item(NAME(m_sio.regs.siocon));
187187   save_item(NAME(m_sio.regs.siodat));
188188   save_item(NAME(m_sio.regs.sbrdr));
189189   save_item(NAME(m_sio.regs.itvcnt));
190190   save_item(NAME(m_sio.regs.dcntz));
191   
191
192192   save_item(NAME(m_pwm.regs.tcfg0));
193193   save_item(NAME(m_pwm.regs.tcfg1));
194194   save_item(NAME(m_pwm.regs.tcon));
r23623r23624
212212   save_item(NAME(m_pwm.cnt));
213213   save_item(NAME(m_pwm.cmp));
214214   save_item(NAME(m_pwm.freq));
215   
215
216216   save_item(NAME(m_wdt.regs.wtcon));
217217   save_item(NAME(m_wdt.regs.wtdat));
218218   save_item(NAME(m_wdt.regs.wtcnt));
219   
219
220220   save_item(NAME(m_iic.regs.iiccon));
221221   save_item(NAME(m_iic.regs.iicstat));
222222   save_item(NAME(m_iic.regs.iicadd));
223223   save_item(NAME(m_iic.regs.iicds));
224224   save_item(NAME(m_iic.count));
225   
225
226226   save_item(NAME(m_iis.regs.iiscon));
227227   save_item(NAME(m_iis.regs.iismod));
228228   save_item(NAME(m_iis.regs.iispsr));
r23623r23624
230230   save_item(NAME(m_iis.regs.iisfifo));
231231   save_item(NAME(m_iis.fifo));
232232   save_item(NAME(m_iis.fifo_index));
233   
233
234234   save_item(NAME(m_gpio.regs.gpacon));
235235   save_item(NAME(m_gpio.regs.gpadat));
236236   save_item(NAME(m_gpio.regs.gpbcon));
r23623r23624
253253   save_item(NAME(m_gpio.regs.spucr));
254254   save_item(NAME(m_gpio.regs.extint));
255255   save_item(NAME(m_gpio.regs.extintpnd));
256   
256
257257   save_item(NAME(m_adc.regs.adccon));
258258   save_item(NAME(m_adc.regs.adcpsr));
259259   save_item(NAME(m_adc.regs.adcdat));
260   
260
261261   save_item(NAME(m_cpuwrap.regs.syscfg));
262262   save_item(NAME(m_cpuwrap.regs.ncachbe0));
263263   save_item(NAME(m_cpuwrap.regs.ncachbe1));
trunk/src/mess/machine/s3c44b0.h
r23623r23624
635635public:
636636   s3c44b0_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
637637   ~s3c44b0_device() {}
638   
638
639639   DECLARE_READ32_MEMBER(lcd_r);
640640   DECLARE_READ32_MEMBER(clkpow_r);
641641   DECLARE_READ32_MEMBER(irq_r);
r23623r23624
680680   virtual void device_config_complete();
681681   virtual void device_start();
682682   virtual void device_reset();
683   
683
684684private:
685685   // internal state
686686   // LCD Controller
r23623r23624
754754   void adc_stop();
755755   void adc_recalc();
756756   TIMER_CALLBACK_MEMBER(adc_timer_exp);
757   
757
758758   // SIO
759759   void sio_start();
760760   void sio_stop();
trunk/src/mess/machine/mc68328.c
r23623r23624
4747   const mc68328_interface *intf = reinterpret_cast<const mc68328_interface *>(static_config());
4848   if (intf != NULL)
4949      *static_cast<mc68328_interface *>(this) = *intf;
50   
50
5151   // or initialize to defaults if none provided
5252   else
5353   {
r23623r23624
8484//-------------------------------------------------
8585
8686void mc68328_device::device_start()
87{   
87{
8888   m_out_port_a.resolve(m_out_port_a_func, *this);
8989   m_out_port_b.resolve(m_out_port_b_func, *this);
9090   m_out_port_c.resolve(m_out_port_c_func, *this);
r23623r23624
9595   m_out_port_j.resolve(m_out_port_j_func, *this);
9696   m_out_port_k.resolve(m_out_port_k_func, *this);
9797   m_out_port_m.resolve(m_out_port_m_func, *this);
98   
98
9999   m_in_port_a.resolve(m_in_port_a_func, *this);
100100   m_in_port_b.resolve(m_in_port_b_func, *this);
101101   m_in_port_c.resolve(m_in_port_c_func, *this);
r23623r23624
108108   m_in_port_m.resolve(m_in_port_m_func, *this);
109109
110110   m_out_pwm.resolve(m_out_pwm_func, *this);
111   
111
112112   m_out_spim.resolve(m_out_spim_func, *this);
113113   m_in_spim.resolve(m_in_spim_func, *this);
114114
r23623r23624
155155   m_regs.csd1 = 0x00010006;
156156   m_regs.csd2 = 0x00010006;
157157   m_regs.csd3 = 0x00010006;
158   
158
159159   m_regs.pllcr = 0x2400;
160160   m_regs.pllfsr = 0x0123;
161161   m_regs.pctlr = 0x1f;
162   
162
163163   m_regs.ivr = 0x00;
164164   m_regs.icr = 0x0000;
165165   m_regs.imr = 0x00ffffff;
166166   m_regs.iwr = 0x00ffffff;
167167   m_regs.isr = 0x00000000;
168168   m_regs.ipr = 0x00000000;
169   
169
170170   m_regs.padir = 0x00;
171171   m_regs.padata = 0x00;
172172   m_regs.pasel = 0x00;
r23623r23624
206206   m_regs.pmdata = 0x00;
207207   m_regs.pmpuen = 0xff;
208208   m_regs.pmsel = 0xff;
209   
209
210210   m_regs.pwmc = 0x0000;
211211   m_regs.pwmp = 0x0000;
212212   m_regs.pwmw = 0x0000;
213213   m_regs.pwmcnt = 0x0000;
214   
214
215215   m_regs.tctl[0] = m_regs.tctl[1] = 0x0000;
216216   m_regs.tprer[0] = m_regs.tprer[1] = 0x0000;
217217   m_regs.tcmp[0] = m_regs.tcmp[1] = 0xffff;
r23623r23624
221221   m_regs.wctlr = 0x0000;
222222   m_regs.wcmpr = 0xffff;
223223   m_regs.wcn = 0x0000;
224   
224
225225   m_regs.spisr = 0x0000;
226   
226
227227   m_regs.spimdata = 0x0000;
228228   m_regs.spimcont = 0x0000;
229   
229
230230   m_regs.ustcnt = 0x0000;
231231   m_regs.ubaud = 0x003f;
232232   m_regs.urx = 0x0000;
233233   m_regs.utx = 0x0000;
234234   m_regs.umisc = 0x0000;
235   
235
236236   m_regs.lssa = 0x00000000;
237237   m_regs.lvpw = 0xff;
238238   m_regs.lxmax = 0x03ff;
r23623r23624
251251   m_regs.lposr = 0x00;
252252   m_regs.lfrcm = 0xb9;
253253   m_regs.lgpmr = 0x1073;
254   
254
255255   m_regs.hmsr = 0x00000000;
256256   m_regs.alarm = 0x00000000;
257257   m_regs.rtcctl = 0x00;
258258   m_regs.rtcisr = 0x00;
259259   m_regs.rtcienr = 0x00;
260260   m_regs.stpwtch = 0x00;
261   
261
262262   m_rtc->adjust(attotime::from_hz(1), 0, attotime::from_hz(1));
263263}
264264
r23623r23624
27352735   UINT16 word;
27362736   UINT16 *line;
27372737   int y, x, b;
2738   
2738
27392739   if (m_regs.lckcon & LCKCON_LCDC_EN)
27402740   {
27412741      for (y = 0; y < 160; y++)
27422742      {
27432743         line = &bitmap.pix16(y);
2744         
2744
27452745         for (x = 0; x < 160; x += 16)
27462746         {
27472747            word = *(video_ram++);
r23623r23624
27572757      for (y = 0; y < 160; y++)
27582758      {
27592759         line = &bitmap.pix16(y);
2760         
2760
27612761         for (x = 0; x < 160; x++)
27622762         {
27632763            line[x] = 0;
r23623r23624
29052905   save_item(NAME(m_regs.rtcienr));
29062906   save_item(NAME(m_regs.stpwtch));
29072907}
2908
trunk/src/mess/machine/sns_sdd1.c
r23623r23624
435435   save_item(NAME(m_sdd1_enable));
436436   save_item(NAME(m_xfer_enable));
437437   save_item(NAME(m_mmc));
438   
438
439439   for (int i = 0; i < 8; i++)
440440   {
441441      save_item(NAME(m_dma[i].addr), i);
trunk/src/mess/machine/mc68328.h
r23623r23624
11/**********************************************************************
2
2
33 Motorola 68328 ("DragonBall") System-on-a-Chip implementation
4
4
55 By MooglyGuy
66 contact mooglyguy@gmail.com with licensing and usage questions.
7
7
88 **********************************************************************/
99
1010/*****************************************************************************************************************
11
11
1212                                                             P P P P P P P   P P P P P P P
1313                                                             E E E E E E E   J J J J J J J
1414                                                             1 2 3 4 5 6 7   0 1 2 3 4 5 6
r23623r23624
8080                                                         1   2                   P
8181                                                                                 I
8282                                                                                 O
83
83
8484                   Figure 12-1. MC68328 144-Lead Plastic Thin-Quad Flat Pack Pin Assignment
85
85
8686                      Source: MC68328 (DragonBall)(tm) Integrated Processor User's Manual
87
87
8888 *****************************************************************************************************************/
8989
9090#ifndef __MC68328_H__
r23623r23624
412412struct mc68328_interface
413413{
414414   const char *m68k_cpu_tag;
415   
415
416416   devcb_write8  m_out_port_a_func;    /* 8-bit output */
417417   devcb_write8  m_out_port_b_func;    /* 8-bit output */
418418   devcb_write8  m_out_port_c_func;    /* 8-bit output */
r23623r23624
423423   devcb_write8  m_out_port_j_func;    /* 8-bit output */
424424   devcb_write8  m_out_port_k_func;    /* 8-bit output */
425425   devcb_write8  m_out_port_m_func;    /* 8-bit output */
426   
426
427427   devcb_read8   m_in_port_a_func;     /* 8-bit input */
428428   devcb_read8   m_in_port_b_func;     /* 8-bit input */
429429   devcb_read8   m_in_port_c_func;     /* 8-bit input */
r23623r23624
434434   devcb_read8   m_in_port_j_func;     /* 8-bit input */
435435   devcb_read8   m_in_port_k_func;     /* 8-bit input */
436436   devcb_read8   m_in_port_m_func;     /* 8-bit input */
437   
437
438438   devcb_write8  m_out_pwm_func;       /* 1-bit output */
439   
439
440440   devcb_write16 m_out_spim_func;      /* 16-bit output */
441441   devcb_read16  m_in_spim_func;       /* 16-bit input */
442442
r23623r23624
449449   // $(FF)FFF000
450450   UINT8   scr;        // System Control Register
451451   UINT8   unused0[255];
452   
452
453453   // $(FF)FFF100
454454   UINT16  grpbasea;   // Chip Select Group A Base Register
455455   UINT16  grpbaseb;   // Chip Select Group B Base Register
r23623r23624
476476   UINT32  csd2;       // Group D Chip Select 2 Register
477477   UINT32  csd3;       // Group D Chip Select 3 Register
478478   UINT8   unused1[176];
479   
479
480480   // $(FF)FFF200
481481   UINT16  pllcr;      // PLL Control Register
482482   UINT16  pllfsr;     // PLL Frequency Select Register
483483   UINT8   pad2[3];
484484   UINT8   pctlr;      // Power Control Register
485485   UINT8   unused3[248];
486   
486
487487   // $(FF)FFF300
488488   UINT8   ivr;        // Interrupt Vector Register
489489   UINT8   unused4[1];
r23623r23624
493493   UINT32  isr;        // Interrupt Status Register
494494   UINT32  ipr;        // Interrupt Pending Register
495495   UINT8   unused5[236];
496   
496
497497   // $(FF)FFF400
498498   UINT8   padir;      // Port A Direction Register
499499   UINT8   padata;     // Port A Data Register
500500   UINT8   unused6[1];
501501   UINT8   pasel;      // Port A Select Register
502502   UINT8   unused7[4];
503   
503
504504   UINT8   pbdir;      // Port B Direction Register
505505   UINT8   pbdata;     // Port B Data Register
506506   UINT8   unused8[1];
507507   UINT8   pbsel;      // Port B Select Register
508508   UINT8   unused9[4];
509   
509
510510   UINT8   pcdir;      // Port C Direction Register
511511   UINT8   pcdata;     // Port C Data Register
512512   UINT8   unused10[1];
513513   UINT8   pcsel;      // Port C Select Register
514514   UINT8   unused11[4];
515   
515
516516   UINT8   pddir;      // Port D Direction Register
517517   UINT8   pddata;     // Port D Data Register
518518   UINT8   pdpuen;     // Port D Pullup Enable Register
r23623r23624
521521   UINT8   pdirqen;    // Port D IRQ Enable Register
522522   UINT8   pddataedge; // Port D Data Edge Level
523523   UINT8   pdirqedge;  // Port D IRQ Edge Register
524   
524
525525   UINT8   pedir;      // Port E Direction Register
526526   UINT8   pedata;     // Port E Data Register
527527   UINT8   pepuen;     // Port E Pullup Enable Register
528528   UINT8   pesel;      // Port E Select Register
529529   UINT8   unused14[4];
530   
530
531531   UINT8   pfdir;      // Port F Direction Register
532532   UINT8   pfdata;     // Port F Data Register
533533   UINT8   pfpuen;     // Port F Pullup Enable Register
534534   UINT8   pfsel;      // Port F Select Register
535535   UINT8   unused15[4];
536   
536
537537   UINT8   pgdir;      // Port G Direction Register
538538   UINT8   pgdata;     // Port G Data Register
539539   UINT8   pgpuen;     // Port G Pullup Enable Register
540540   UINT8   pgsel;      // Port G Select Register
541541   UINT8   unused16[4];
542   
542
543543   UINT8   pjdir;      // Port J Direction Register
544544   UINT8   pjdata;     // Port J Data Register
545545   UINT8   unused17[1];
r23623r23624
550550   UINT8   pkpuen;     // Port K Pullup Enable Register
551551   UINT8   pksel;      // Port K Select Register
552552   UINT8   unused19[4];
553   
553
554554   UINT8   pmdir;      // Port M Direction Register
555555   UINT8   pmdata;     // Port M Data Register
556556   UINT8   pmpuen;     // Port M Pullup Enable Register
557557   UINT8   pmsel;      // Port M Select Register
558558   UINT8   unused20[180];
559   
559
560560   // $(FF)FFF500
561561   UINT16  pwmc;       // PWM Control Register
562562   UINT16  pwmp;       // PWM Period Register
563563   UINT16  pwmw;       // PWM Width Register
564564   UINT16  pwmcnt;     // PWN Counter
565565   UINT8   unused21[248];
566   
566
567567   // $(FF)FFF600
568568   UINT16  tctl[2];    // Timer Control Register
569569   UINT16  tprer[2];   // Timer Prescaler Register
r23623r23624
576576   UINT16  wcn;        // Watchdog Counter
577577   UINT8   tclear[2];  // Timer Clearable Status
578578   UINT8   unused22[224];
579   
579
580580   // $(FF)FFF700
581581   UINT16  spisr;      // SPIS Register
582582   UINT8   unused23[254];
583   
583
584584   // $(FF)FFF800
585585   UINT16  spimdata;   // SPIM Data Register
586586   UINT16  spimcont;   // SPIM Control/Status Register
587587   UINT8   unused24[252];
588   
588
589589   // $(FF)FFF900
590590   UINT16  ustcnt;     // UART Status/Control Register
591591   UINT16  ubaud;      // UART Baud Control Register
r23623r23624
593593   UINT16  utx;        // UART TX Register
594594   UINT16  umisc;      // UART Misc Register
595595   UINT8   unused25[246];
596   
596
597597   // $(FF)FFFA00
598598   UINT32  lssa;       // Screen Starting Address Register
599599   UINT8   unused26[1];
r23623r23624
625625   UINT8   lfrcm;      // Frame Rate Control Modulation Register
626626   UINT16  lgpmr;      // Gray Palette Mapping Register
627627   UINT8   unused37[204];
628   
628
629629   // $(FF)FFFB00
630630   UINT32  hmsr;       // RTC Hours Minutes Seconds Register
631631   UINT32  alarm;      // RTC Alarm Register
r23623r23624
657657   virtual void device_config_complete();
658658   virtual void device_start();
659659   virtual void device_reset();
660   
661private:   
660
661private:
662662   // internal state
663663   void set_interrupt_line(UINT32 line, UINT32 active);
664664   void poll_port_d_interrupts();
665665   UINT32 get_timer_frequency(UINT32 index);
666666   void maybe_start_timer(UINT32 index, UINT32 new_enable);
667667   void timer_compare_event(UINT32 index);
668   
668
669669   void register_state_save();
670670
671671   TIMER_CALLBACK_MEMBER(timer1_hit);
r23623r23624
674674   TIMER_CALLBACK_MEMBER(rtc_tick);
675675
676676   mc68328_regs_t m_regs;
677   
677
678678   emu_timer *m_gptimer[2];
679679   emu_timer *m_rtc;
680680   emu_timer *m_pwm;
681   
681
682682   devcb_resolved_write8  m_out_port_a;    /* 8-bit output */
683683   devcb_resolved_write8  m_out_port_b;    /* 8-bit output */
684684   devcb_resolved_write8  m_out_port_c;    /* 8-bit output */
r23623r23624
689689   devcb_resolved_write8  m_out_port_j;    /* 8-bit output */
690690   devcb_resolved_write8  m_out_port_k;    /* 8-bit output */
691691   devcb_resolved_write8  m_out_port_m;    /* 8-bit output */
692   
692
693693   devcb_resolved_read8   m_in_port_a;     /* 8-bit input */
694694   devcb_resolved_read8   m_in_port_b;     /* 8-bit input */
695695   devcb_resolved_read8   m_in_port_c;     /* 8-bit input */
r23623r23624
700700   devcb_resolved_read8   m_in_port_j;     /* 8-bit input */
701701   devcb_resolved_read8   m_in_port_k;     /* 8-bit input */
702702   devcb_resolved_read8   m_in_port_m;     /* 8-bit input */
703   
703
704704   devcb_resolved_write8  m_out_pwm;       /* 1-bit output */
705   
705
706706   devcb_resolved_write16 m_out_spim;      /* 16-bit output */
707707   devcb_resolved_read16  m_in_spim;       /* 16-bit input */
708708
709   devcb_resolved_write_line m_spim_xch_trigger;   // not really a write_line, fix when converting to devcb2!
709   devcb_resolved_write_line m_spim_xch_trigger;   // not really a write_line, fix when converting to devcb2!
710710
711711   cpu_device *m_cpu;
712712};
trunk/src/mess/machine/wangpc_mcc.c
r23623r23624
272272      case 0x06/2:
273273         m_sio->cd_ba_w(space, offset >> 1, data & 0xff);
274274         break;
275     
275
276276      case 0x08/2:
277277      case 0x0a/2:
278278      case 0x0c/2:
trunk/src/mess/machine/abckb.h
r23623r23624
2020//  MACROS / CONSTANTS
2121//**************************************************************************
2222
23#define ABC_KEYBOARD_PORT_TAG   "kb"
23#define ABC_KEYBOARD_PORT_TAG   "kb"
2424
2525
2626
trunk/src/mess/machine/intv.c
r23623r23624
250250{
251251   if (m_bus_copy_mode || !m_stic->read_stic_handshake())
252252      return m_stic->read(space, offset, mem_mask);
253   else
253   else
254254      return offset;
255255}
256256
r23623r23624
266266   //logerror("read: %d = GRAM(%d)\n",state->m_gram[offset],offset);
267267   if (m_bus_copy_mode || !m_stic->read_stic_handshake())
268268      return m_stic->gram_read(space, offset, mem_mask);
269   else
270      return offset;   
269   else
270      return offset;
271271}
272272
273273WRITE16_MEMBER( intv_state::intv_gram_w )
r23623r23624
345345      if (data == 0x7a50)
346346      {
347347         m_ecs_bank_src[1] = 1;
348         m_bank2->set_base(m_bank_base[m_ecs_bank_src[1]] + (0x7000 << 1));      // ECS ROM at 0x7000 is on page 1
348         m_bank2->set_base(m_bank_base[m_ecs_bank_src[1]] + (0x7000 << 1));      // ECS ROM at 0x7000 is on page 1
349349      }
350350      else if (data == 0x7a51 )
351351      {
r23623r23624
619619   if (m_is_ecs)
620620   {
621621      // ECS can switch between the maincpu and the ecs roms
622      m_ecs_bank_src[0] = 0;   // CPU
623      m_ecs_bank_src[1] = 1;   // ECS
624      m_ecs_bank_src[2] = 0;   // CPU
625      m_ecs_bank_src[3] = 0;   // CPU
622      m_ecs_bank_src[0] = 0;  // CPU
623      m_ecs_bank_src[1] = 1;  // ECS
624      m_ecs_bank_src[2] = 0;  // CPU
625      m_ecs_bank_src[3] = 0;  // CPU
626626      m_bank_base[0] = m_region_maincpu->base();
627627      m_bank_base[1] = m_region_ecs_rom->base();
628628      m_bank1->set_base(m_bank_base[m_ecs_bank_src[0]] + (0x2000 << 1));
r23623r23624
684684      save_item(NAME(m_ecs_bank_src));
685685      machine().save().register_postload(save_prepost_delegate(FUNC(intv_state::ecs_banks_restore), this));
686686   }
687   
687
688688   // intvkbd
689689   if (m_is_keybd)
690690   {
trunk/src/mess/machine/mboard.c
r23623r23624
109109      else
110110      {
111111         /* looking for a piece in this line and clear bit in data if found */
112         
112
113113         for (i_AH = 0; i_AH < 8; i_AH = i_AH + 1)
114114            if (IsPiece(64 - (i_18 * 8 + 8 - i_AH)))
115115               data &= ~(1 << i_AH);           // clear bit
116         
116
117117         read_board_flag = TRUE;
118118      }
119119   }
trunk/src/mess/machine/victor9kb.h
r23623r23624
3232
3333#define MCFG_VICTOR9K_KEYBOARD_ADD(_kbrdy) \
3434   MCFG_DEVICE_ADD(VICTOR9K_KEYBOARD_TAG, VICTOR9K_KEYBOARD, 0) \
35   downcast<victor9k_keyboard_device *>(device)->set_kbrdy_callback(DEVCB2_##_kbrdy); \
35   downcast<victor9k_keyboard_device *>(device)->set_kbrdy_callback(DEVCB2_##_kbrdy);
3636
3737
38
3938//**************************************************************************
4039//  TYPE DEFINITIONS
4140//**************************************************************************
trunk/src/mess/machine/msx.c
r23623r23624
858858
859859         size = layout->size;
860860         option = layout->option;
861         
861
862862         if (layout->type != SLOT_CARTRIDGE1 && layout->type != SLOT_CARTRIDGE2)
863863         {
864864            int size_tmp = 0;
trunk/src/mess/machine/zx8302.h
r23623r23624
172172
173173   enum
174174   {
175      INT_GAP                = 0x01,
175      INT_GAP                 = 0x01,
176176      INT_INTERFACE           = 0x02,
177177      INT_TRANSMIT            = 0x04,
178178      INT_FRAME               = 0x08,
r23623r23624
181181
182182   enum
183183   {
184      STATUS_NETWORK_PORT    = 0x01,
184      STATUS_NETWORK_PORT     = 0x01,
185185      STATUS_TX_BUFFER_FULL   = 0x02,
186186      STATUS_RX_BUFFER_FULL   = 0x04,
187187      STATUS_MICRODRIVE_GAP   = 0x08,
trunk/src/mess/machine/sns_sgb.c
r23623r23624
11/***********************************************************************************************************
2
2
33 Super Game Boy emulation (for SNES/SFC)
4
4
55 Copyright MESS Team.
66 Visit http://mamedev.org for licensing and usage restrictions.
77
88 TODO: almost everything
9
9
1010 ***********************************************************************************************************/
1111
1212
r23623r23624
123123   UINT16 address = offset & 0xffff;
124124
125125   //LY counter
126   if (address == 0x6000)
126   if (address == 0x6000)
127127   {
128128      m_sgb_ly = 0;// GameBoy PPU LY here
129129      m_sgb_row = m_lcd_row;
130130      return m_sgb_ly;
131131   }
132   
132
133133   //command ready port
134   if (address == 0x6002)
134   if (address == 0x6002)
135135   {
136136      bool data = (m_packetsize > 0);
137      if (data)
137      if (data)
138138      {
139         for (int i = 0; i < 16; i++)
139         for (int i = 0; i < 16; i++)
140140            m_joy_pckt[i] = m_packet_data[0][i];
141         m_packetsize--;   
141         m_packetsize--;
142142
143143         //hack because we still don't emulate input packets!
144144         if (!m_packetsize) m_packetsize = 64;
145145
146146         // shift packet
147         for (int i = 0; i < m_packetsize; i++)
147         for (int i = 0; i < m_packetsize; i++)
148148            for (int j = 0; j < 16; j++)
149149               m_packet_data[i][j] = m_packet_data[i + 1][j];
150150      }
151151      return data;
152152   }
153   
153
154154   //ICD2 revision
155   if (address == 0x600f)
155   if (address == 0x600f)
156156      return 0x21;
157   
157
158158   //command port
159   if ((address & 0xfff0) == 0x7000)
159   if ((address & 0xfff0) == 0x7000)
160160      return m_joy_pckt[address & 0x0f];
161   
161
162162   //VRAM port
163   if (address == 0x7800)
163   if (address == 0x7800)
164164   {
165165      UINT8 data = m_lcd_output[m_vram_offs];
166166      m_vram_offs = (m_vram_offs + 1) % 320;
167167      return data;
168168   }
169169
170   return 0x00;   // this should never happen?
170   return 0x00;    // this should never happen?
171171}
172172
173void sns_rom_sgb_device::lcd_render(UINT32 *source)
173void sns_rom_sgb_device::lcd_render(UINT32 *source)
174174{
175175   memset(m_lcd_output, 0x00, 320 * sizeof(UINT16));
176   
176
177177   for (int y = 0; y < 8; y++)
178178   {
179      for (int x = 0; x < 160; x++)
179      for (int x = 0; x < 160; x++)
180180      {
181181         UINT32 pixel = *source++;
182182         UINT16 addr = y * 2 + (x / 8 * 16);
r23623r23624
189189WRITE8_MEMBER( sns_rom_sgb_device::chip_write )
190190{
191191   UINT16 address = offset & 0xffff;
192   
192
193193   //VRAM port
194   if (address == 0x6001)
194   if (address == 0x6001)
195195   {
196196      m_vram = data;
197197      m_vram_offs = 0;
198     
198
199199      UINT8 offset = (m_sgb_row - (4 - (m_vram - (m_sgb_ly & 3)))) & 3;
200200      lcd_render(m_lcd_buffer + offset * 160 * 8);
201     
201
202202      return;
203203   }
204   
204
205205   //control port
206   if (address == 0x6003)
206   if (address == 0x6003)
207207   {
208      if ((m_port & 0x80) == 0x00 && (data & 0x80) == 0x80)
208      if ((m_port & 0x80) == 0x00 && (data & 0x80) == 0x80)
209209      {
210210         //reset
211211      }
212212
213      switch (data & 3)
213      switch (data & 3)
214214      {
215215         //change CPU frequency
216216      }
217217      m_port = data;
218218      return;
219219   }
220   
221   if (address == 0x6004)
220
221   if (address == 0x6004)
222222   {
223223      //joypad 1
224      m_joy1 = data;
225      return;
224      m_joy1 = data;
225      return;
226226   }
227   if (address == 0x6005)
227   if (address == 0x6005)
228228   {
229229      //joypad 2
230      m_joy2 = data;
231      return;
230      m_joy2 = data;
231      return;
232232   }
233   if (address == 0x6006)
233   if (address == 0x6006)
234234   {
235235      //joypad 3
236      m_joy3 = data;
237      return;
236      m_joy3 = data;
237      return;
238238   }
239   if (address == 0x6007)
239   if (address == 0x6007)
240240   {
241241      //joypad 4
242      m_joy4 = data;
243      return;
242      m_joy4 = data;
243      return;
244244   }
245   
246}
247245
246}
trunk/src/mess/machine/sns_sgb.h
r23623r23624
1414public:
1515   // construction/destruction
1616   sns_rom_sgb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
17   
17
1818   // device-level overrides
1919   virtual void device_start();
2020   virtual void device_reset();
r23623r23624
2525   virtual DECLARE_READ8_MEMBER(read_h);
2626   virtual DECLARE_READ8_MEMBER(chip_read);
2727   virtual DECLARE_WRITE8_MEMBER(chip_write);
28   
28
2929   virtual DECLARE_READ8_MEMBER(gb_cart_r);
3030   virtual DECLARE_WRITE8_MEMBER(gb_bank_w);
3131   virtual DECLARE_READ8_MEMBER(gb_ram_r);
trunk/src/mess/machine/concept_exp.c
r23623r23624
11/**********************************************************************
2
2
33 Corvus Concept expansion port emulation
4
4
55 Copyright MESS Team.
66 Visit http://mamedev.org for licensing and usage restrictions.
7 
8 
7
8
99 FIXME: Concept expansion ports should just use the Apple II Bus device!
10 The code below is outdated and inaccurate!
11 
10 The code below is outdated and inaccurate!
11
1212 **********************************************************************/
1313
1414#include "machine/concept_exp.h"
r23623r23624
8282{
8383   if (m_card)
8484      return m_card->reg_r(space, offset);
85   
85
8686   return 0;
8787}
8888
r23623r23624
139139   LS_8IN_bit      = 5,    // 1 if 8" floppy drive?
140140   LS_DSKCHG_bit   = 6,    // 0 if disk changed, 1 if not
141141   LS_SD_bit       = 7,    // 1 if single density
142   
142
143143   LS_DRQ_mask     = (1 << LS_DRQ_bit),
144144   LS_INT_mask     = (1 << LS_INT_bit),
145145   LS_SS_mask      = (1 << LS_SS_bit),
r23623r23624
156156   LC_MOTOROF_bit  = 5,    // 1 if motor to be turned off
157157   LC_FLP8IN_bit   = 6,    // 1 to select 8", 0 for 5"1/4 (which I knew what it means)
158158   LC_FMMFM_bit    = 7,    // 1 to select single density, 0 for double
159   
159
160160   LC_FLPSD1_mask  = (1 << LC_FLPSD1_bit),
161161   LC_DE0_mask     = (1 << LC_DE0_bit),
162162   LC_DE1_mask     = (1 << LC_DE1_bit),
r23623r23624
209209{
210210   switch (offset)
211211   {
212      case  0:   // LOCAL STATUS REG
212      case  0:    // LOCAL STATUS REG
213213         return m_fdc_local_status;
214         
215      case  8:   // FDC STATUS REG
214
215      case  8:    // FDC STATUS REG
216216         return wd17xx_status_r(m_wd179x, space, offset);
217         
218      case  9:   // FDC TRACK REG
217
218      case  9:    // FDC TRACK REG
219219         return wd17xx_track_r(m_wd179x, space, offset);
220         
221      case 10:   // FDC SECTOR REG
220
221      case 10:    // FDC SECTOR REG
222222         return wd17xx_sector_r(m_wd179x, space, offset);
223         
224      case 11:   // FDC DATA REG
223
224      case 11:    // FDC DATA REG
225225         return wd17xx_data_r(m_wd179x, space, offset);
226226   }
227   
227
228228   return 0;
229229}
230230
r23623r23624
234234
235235   switch (offset)
236236   {
237      case 0:      // LOCAL COMMAND REG
237      case 0:     // LOCAL COMMAND REG
238238         m_fdc_local_command = data;
239         
239
240240         wd17xx_set_side(m_wd179x, (data & LC_FLPSD1_mask) != 0);
241241         current_drive = ((data >> LC_DE0_bit) & 1) | ((data >> (LC_DE1_bit-1)) & 2);
242242         wd17xx_set_drive(m_wd179x, current_drive);
r23623r23624
246246         wd17xx_dden_w(m_wd179x, BIT(data, 7));
247247         floppy_drive_set_ready_state(floppy_get_device(machine(), current_drive), 1, 0);
248248         break;
249         
250      case  8:   // FDC COMMAMD REG
249
250      case  8:    // FDC COMMAMD REG
251251         wd17xx_command_w(m_wd179x, space, offset, data);
252252         break;
253         
254      case  9:   // FDC TRACK REG
253
254      case  9:    // FDC TRACK REG
255255         wd17xx_track_w(m_wd179x, space, offset, data);
256256         break;
257         
258      case 10:   // FDC SECTOR REG
257
258      case 10:    // FDC SECTOR REG
259259         wd17xx_sector_w(m_wd179x, space, offset, data);
260260         break;
261         
262      case 11:   // FDC DATA REG
261
262      case 11:    // FDC DATA REG
263263         wd17xx_data_w(m_wd179x, space, offset, data);
264264         break;
265265   }
r23623r23624
276276#if 1
277277/* SSSD 8" */
278278LEGACY_FLOPPY_OPTION(concept, "img", "Corvus Concept 8\" SSSD disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
279                HEADS([1])
280                TRACKS([77])
281                SECTORS([26])
282                SECTOR_LENGTH([128])
283                FIRST_SECTOR_ID([1]))
279                  HEADS([1])
280                  TRACKS([77])
281                  SECTORS([26])
282                  SECTOR_LENGTH([128])
283                  FIRST_SECTOR_ID([1]))
284284#elif 0
285285/* SSDD 8" (according to ROMs) */
286286LEGACY_FLOPPY_OPTION(concept, "img", "Corvus Concept 8\" SSDD disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
287                HEADS([1])
288                TRACKS([77])
289                SECTORS([26])
290                SECTOR_LENGTH([256])
291                FIRST_SECTOR_ID([1]))
287                  HEADS([1])
288                  TRACKS([77])
289                  SECTORS([26])
290                  SECTOR_LENGTH([256])
291                  FIRST_SECTOR_ID([1]))
292292#elif 0
293293/* Apple II DSDD 5"1/4 (according to ROMs) */
294294LEGACY_FLOPPY_OPTION(concept, "img", "Corvus Concept Apple II 5\"1/4 DSDD disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
295                HEADS([2])
296                TRACKS([35])
297                SECTORS([16])
298                SECTOR_LENGTH([256])
299                FIRST_SECTOR_ID([1]))
295                  HEADS([2])
296                  TRACKS([35])
297                  SECTORS([16])
298                  SECTOR_LENGTH([256])
299                  FIRST_SECTOR_ID([1]))
300300#elif 0
301301/* actual formats found */
302302LEGACY_FLOPPY_OPTION(concept, "img", "Corvus Concept 5\"1/4 DSDD disk image (256-byte sectors)", basicdsk_identify_default, basicdsk_construct_default, NULL,
303                HEADS([2])
304                TRACKS([80])
305                SECTORS([16])
306                SECTOR_LENGTH([256])
307                FIRST_SECTOR_ID([1]))
303                  HEADS([2])
304                  TRACKS([80])
305                  SECTORS([16])
306                  SECTOR_LENGTH([256])
307                  FIRST_SECTOR_ID([1]))
308308#else
309309LEGACY_FLOPPY_OPTION(concept, "img", "Corvus Concept 5\"1/4 DSDD disk image (512-byte sectors)", basicdsk_identify_default, basicdsk_construct_default, NULL,
310                HEADS([2])
311                TRACKS([80])
312                SECTORS([9])
313                SECTOR_LENGTH([512])
314                FIRST_SECTOR_ID([1]))
310                  HEADS([2])
311                  TRACKS([80])
312                  SECTORS([9])
313                  SECTOR_LENGTH([512])
314                  FIRST_SECTOR_ID([1]))
315315#endif
316316LEGACY_FLOPPY_OPTIONS_END
317317
r23623r23624
358358{
359359   switch (offset)
360360   {
361      case 0:      // HDC Data Register
361      case 0:     // HDC Data Register
362362         return corvus_hdc_data_r(space, offset);
363         
364      case 1:      // HDC Status Register
363
364      case 1:     // HDC Status Register
365365         return corvus_hdc_status_r(space, offset);
366366   }
367   
367
368368   return 0;
369369}
370370
r23623r23624
373373{
374374   switch (offset)
375375   {
376      case 0:      // HDC Data Register
376      case 0:     // HDC Data Register
377377         corvus_hdc_data_w(space, offset, data);
378378         break;
379379   }
r23623r23624
396396{
397397   return MACHINE_CONFIG_NAME(hdc);
398398}
399
trunk/src/mess/machine/concept_exp.h
r23623r23624
5454public:
5555   // construction/destruction
5656   concept_exp_card_device(const machine_config &mconfig, device_t &device);
57   
57
5858   DECLARE_READ8_MEMBER( reg_r ) { return 0xff; }
5959   DECLARE_READ8_MEMBER( rom_r ) { return 0xff; }
6060   DECLARE_WRITE8_MEMBER( reg_w ) {}
6161   DECLARE_WRITE8_MEMBER( rom_w ) {}
62   
62
6363protected:
6464};
6565
r23623r23624
7070public:
7171   // construction/destruction
7272   concept_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
73   
73
7474   DECLARE_READ8_MEMBER(reg_r);
7575   DECLARE_READ8_MEMBER(rom_r);
7676   DECLARE_WRITE8_MEMBER(reg_w);
7777
7878   DECLARE_WRITE_LINE_MEMBER(intrq_w);
7979   DECLARE_WRITE_LINE_MEMBER(drq_w);
80   
80
8181   // device-level overrides
8282   virtual void device_start();
8383   virtual void device_reset();
8484   virtual machine_config_constructor device_mconfig_additions() const;
85   
85
8686protected:
8787   device_t *m_wd179x;
8888
r23623r23624
9696public:
9797   // construction/destruction
9898   concept_hdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
99   
99
100100   DECLARE_READ8_MEMBER( reg_r );
101101   DECLARE_READ8_MEMBER( rom_r );
102102   DECLARE_WRITE8_MEMBER( reg_w );
trunk/src/mess/machine/md_rom.c
r23623r23624
12121212         // data output mode bit 1 ? (never written by game)
12131213         break;
12141214      default:
1215         if (data & 0x100)   // data input (only connected to D0 ?)
1215         if (data & 0x100)   // data input (only connected to D0 ?)
12161216         {
12171217            // 4-bit hardware register ($400004 corresponds to bit0, $400006 to bit1, etc)
12181218            int shift = (offset - 2) & 3;
trunk/src/mess/machine/md_rom.h
r23623r23624
155155public:
156156   // construction/destruction
157157   md_rom_16mj2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
158   
158
159159   // reading and writing
160160   virtual DECLARE_READ16_MEMBER(read);
161161};
r23623r23624
447447public:
448448   // construction/destruction
449449   md_rom_tekkensp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
450   
450
451451   // device-level overrides
452452   virtual void device_start();
453453   virtual void device_reset();
454   
454
455455   // reading and writing
456456   virtual DECLARE_READ16_MEMBER(read);
457457   virtual DECLARE_WRITE16_MEMBER(write);
458   
458
459459private:
460460   UINT16 m_reg;
461461};
trunk/src/mess/machine/apollo.c
r23623r23624
691691
692692READ8_MEMBER( apollo_state::apollo_pic8259_get_slave_ack )
693693{
694       MLOG1(("apollo_pic8259_get_slave_ack: offset=%x", offset));
694      MLOG1(("apollo_pic8259_get_slave_ack: offset=%x", offset));
695695
696       return offset == 3 ? m_pic8259_slave->inta_r() : 0;
696      return offset == 3 ? m_pic8259_slave->inta_r() : 0;
697697}
698698
699699WRITE_LINE_MEMBER( apollo_state::apollo_pic8259_master_set_int_line ) {
trunk/src/mess/machine/ds1315.c
r23623r23624
216216      We always return the host's time when asked.
217217   */
218218}
219
220
trunk/src/mess/machine/ds1315.h
r23623r23624
4848
4949   void fill_raw_data();
5050   void input_raw_data();
51   
51
5252   int m_count;
5353   ds1315_mode_t m_mode;
5454   UINT8 m_raw_data[8*8];
trunk/src/mess/machine/vp575.c
r23623r23624
6565
6666static MACHINE_CONFIG_FRAGMENT( vp575 )
6767   MCFG_VIP_EXPANSION_SLOT_ADD("exp1", XTAL_3_52128MHz/2, vip_expansion_cards, NULL)
68    MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp1_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp1_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp1_dma_in_w))
68   MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp1_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp1_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp1_dma_in_w))
6969   MCFG_VIP_EXPANSION_SLOT_ADD("exp2", XTAL_3_52128MHz/2, vip_expansion_cards, NULL)
70    MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp2_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp2_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp2_dma_in_w))
70   MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp2_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp2_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp2_dma_in_w))
7171   MCFG_VIP_EXPANSION_SLOT_ADD("exp3", XTAL_3_52128MHz/2, vip_expansion_cards, NULL)
72    MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp3_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp3_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp3_dma_in_w))
72   MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp3_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp3_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp3_dma_in_w))
7373   MCFG_VIP_EXPANSION_SLOT_ADD("exp4", XTAL_3_52128MHz/2, vip_expansion_cards, NULL)
74    MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp4_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp4_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp4_dma_in_w))
74   MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp4_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp4_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp4_dma_in_w))
7575   MCFG_VIP_EXPANSION_SLOT_ADD("exp5", XTAL_3_52128MHz/2, vip_expansion_cards, NULL)
76    MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp5_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp5_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp5_dma_in_w))
76   MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp5_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp5_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp5_dma_in_w))
7777MACHINE_CONFIG_END
7878
7979
trunk/src/mess/machine/pce_cd.c
r23623r23624
9898   /* set up adpcm related things */
9999   m_adpcm_ram = auto_alloc_array_clear(machine(), UINT8, PCE_ADPCM_RAM_SIZE);
100100   m_adpcm_clock_divider = 1;
101   
101
102102   /* Set up cd command buffer */
103103   m_command_buffer = auto_alloc_array_clear(machine(), UINT8, PCE_CD_COMMAND_BUFFER_SIZE);
104104   m_command_buffer_index = 0;
105   
105
106106   /* Set up Arcade Card RAM buffer */
107107   m_acard_ram = auto_alloc_array_clear(machine(), UINT8, PCE_ACARD_RAM_SIZE);
108   
108
109109   m_data_buffer = auto_alloc_array_clear(machine(), UINT8, 8192);
110110   m_data_buffer_size = 0;
111111   m_data_buffer_index = 0;
112   
112
113113   m_subcode_buffer = auto_alloc_array(machine(), UINT8, 96);
114   
114
115115   m_data_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pce_cd_device::data_timer_callback),this));
116116   m_data_timer->adjust(attotime::never);
117117   m_adpcm_dma_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pce_cd_device::adpcm_dma_timer_callback),this));
118118   m_adpcm_dma_timer->adjust(attotime::never);
119   
119
120120   m_cdda_fadeout_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pce_cd_device::cdda_fadeout_callback),this));
121121   m_cdda_fadeout_timer->adjust(attotime::never);
122122   m_cdda_fadein_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pce_cd_device::cdda_fadein_callback),this));
123123   m_cdda_fadein_timer->adjust(attotime::never);
124   
124
125125   m_adpcm_fadeout_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pce_cd_device::adpcm_fadeout_callback),this));
126126   m_adpcm_fadeout_timer->adjust(attotime::never);
127127   m_adpcm_fadein_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pce_cd_device::adpcm_fadein_callback),this));
r23623r23624
187187}
188188
189189void pce_cd_device::device_reset()
190{   
190{
191191   m_adpcm_read_buf = 0;
192192   m_adpcm_write_buf = 0;
193   
193
194194   // TODO: add CD-DA stop command here
195195   //m_cdda_status = PCE_CD_CDDA_OFF;
196196   //m_cdda->stop_audio();
197197
198198   memset(m_regs, 0, sizeof(m_regs));
199   
199
200200   m_regs[0x0c] |= PCE_CD_ADPCM_STOP_FLAG;
201201   m_regs[0x0c] &= ~PCE_CD_ADPCM_PLAY_FLAG;
202202   //m_regs[0x03] = (m_regs[0x03] & ~0x0c) | (PCE_CD_SAMPLE_STOP_PLAY);
r23623r23624
286286WRITE_LINE_MEMBER( pce_cd_device::msm5205_int )
287287{
288288   UINT8 msm_data;
289   
289
290290   //  popmessage("%08x %08x %08x %02x %02x",m_msm_start_addr,m_msm_end_addr,m_msm_half_addr,m_regs[0x0c],m_regs[0x0d]);
291   
291
292292   if (m_msm_idle)
293293      return;
294   
294
295295   /* Supply new ADPCM data */
296296   msm_data = (m_msm_nibble) ? (m_adpcm_ram[m_msm_start_addr] & 0x0f) : ((m_adpcm_ram[m_msm_start_addr] & 0xf0) >> 4);
297   
297
298298   m_msm->data_w(msm_data);
299299   m_msm_nibble ^= 1;
300   
300
301301   if (m_msm_nibble == 0)
302302   {
303303      m_msm_start_addr++;
304     
304
305305      if (m_msm_start_addr == m_msm_half_addr)
306306      {
307307         //set_irq_line(PCE_CD_IRQ_SAMPLE_FULL_PLAY, CLEAR_LINE);
308308         //set_irq_line(PCE_CD_IRQ_SAMPLE_HALF_PLAY, ASSERT_LINE);
309309      }
310     
310
311311      if (m_msm_start_addr > m_msm_end_addr)
312312      {
313313         //set_irq_line(PCE_CD_IRQ_SAMPLE_HALF_PLAY, CLEAR_LINE);
r23623r23624
328328   m_scsi_MSG = 0;
329329   m_message_after_status = 1;
330330   m_status_sent = m_message_sent = 0;
331   
331
332332   if (status == SCSI_STATUS_OK)
333333   {
334334      m_regs[0x01] = 0x00;
r23623r23624
361361   UINT32 frame = ((m_command_buffer[1] & 0x1f) << 16) | (m_command_buffer[2] << 8) | m_command_buffer[3];
362362   UINT32 frame_count = m_command_buffer[4];
363363   printf("%08x %08x\n",frame,frame_count);
364   
364
365365   /* Check for presence of a CD */
366366   if (!m_cd_file)
367367   {
368368      reply_status_byte(SCSI_CHECK_CONDITION);
369369      return;
370370   }
371   
371
372372   if (m_cdda_status != PCE_CD_CDDA_OFF)
373373   {
374374      m_cdda_status = PCE_CD_CDDA_OFF;
375375      m_cdda->stop_audio();
376376      m_end_mark = 0;
377377   }
378   
378
379379   m_current_frame = frame;
380380   m_end_frame = frame + frame_count;
381   
381
382382   if (frame_count == 0)
383383   {
384384      /* Star Breaker uses this */
r23623r23624
389389   {
390390      m_data_timer->adjust(attotime::from_hz(PCE_CD_DATA_FRAMES_PER_SECOND), 0, attotime::from_hz(PCE_CD_DATA_FRAMES_PER_SECOND));
391391   }
392   
392
393393   /* TODO: correct place? */
394394   set_irq_line(PCE_CD_IRQ_TRANSFER_READY, ASSERT_LINE);
395395}
r23623r23624
398398void pce_cd_device::nec_set_audio_start_position()
399399{
400400   UINT32  frame = 0;
401   
401
402402   if (!m_cd_file)
403403   {
404404      /* Throw some error here */
405405      reply_status_byte(SCSI_CHECK_CONDITION);
406406      return;
407407   }
408   
408
409409   switch (m_command_buffer[9] & 0xC0)
410410   {
411411      case 0x00:
r23623r23624
415415      case 0x40:
416416      {
417417         UINT8 m,s,f;
418         
418
419419         m = bcd_2_dec(m_command_buffer[2]);
420420         s = bcd_2_dec(m_command_buffer[3]);
421421         f = bcd_2_dec(m_command_buffer[4]);
422         
422
423423         frame = f + 75 * (s + m * 60);
424424         // PCE tries to be clever here and set (start of track + track pregap size) to skip the pregap
425425         // (I guess it wants the TOC to have the real start sector for data tracks and the start of the pregap for audio?)
r23623r23624
434434         //assert(NULL == nec_set_audio_start_position);
435435         break;
436436   }
437   
437
438438   m_current_frame = frame;
439   
439
440440   if (m_cdda_status == PCE_CD_CDDA_PAUSED)
441441   {
442442      m_cdda_status = PCE_CD_CDDA_OFF;
r23623r23624
463463         m_cdda_play_mode = 3;
464464      }
465465   }
466   
466
467467   reply_status_byte(SCSI_STATUS_OK);
468468   set_irq_line(PCE_CD_IRQ_TRANSFER_DONE, ASSERT_LINE);
469469}
r23623r23624
472472void pce_cd_device::nec_set_audio_stop_position()
473473{
474474   UINT32  frame = 0;
475   
475
476476   if (!m_cd_file)
477477   {
478478      /* Throw some error here */
479479      reply_status_byte(SCSI_CHECK_CONDITION);
480480      return;
481481   }
482   
482
483483   switch (m_command_buffer[9] & 0xC0)
484484   {
485485      case 0x00:
r23623r23624
489489      case 0x40:
490490      {
491491         UINT8 m,s,f;
492         
492
493493         m = bcd_2_dec(m_command_buffer[2]);
494494         s = bcd_2_dec(m_command_buffer[3]);
495495         f = bcd_2_dec(m_command_buffer[4]);
496         
496
497497         frame = f + 75 * (s + m * 60);
498498         //      if (frame >= 525) // TODO: seven seconds gap? O_o
499499         //          frame -= 525;
r23623r23624
507507         //assert(NULL == nec_set_audio_start_position);
508508         break;
509509   }
510   
510
511511   m_end_frame = frame;
512512   m_cdda_play_mode = m_command_buffer[1] & 0x03;
513   
513
514514   if (m_cdda_play_mode)
515515   {
516516      if (m_cdda_status == PCE_CD_CDDA_PAUSED)
r23623r23624
533533      m_end_mark = 0;
534534//      assert(NULL == nec_set_audio_stop_position);
535535   }
536   
536
537537   reply_status_byte(SCSI_STATUS_OK);
538538   set_irq_line(PCE_CD_IRQ_TRANSFER_DONE, ASSERT_LINE);
539539}
r23623r23624
547547      reply_status_byte(SCSI_CHECK_CONDITION);
548548      return;
549549   }
550   
550
551551   /* If there was no cdda playing, throw an error */
552552   if (m_cdda_status == PCE_CD_CDDA_OFF)
553553   {
554554      reply_status_byte(SCSI_CHECK_CONDITION);
555555      return;
556556   }
557   
557
558558   m_cdda_status = PCE_CD_CDDA_PAUSED;
559559   m_current_frame = m_cdda->get_audio_lba();
560560   m_cdda->pause_audio(1);
r23623r23624
566566{
567567   /* WP - I do not have access to chds with subchannel information yet, so I'm faking something here */
568568   UINT32 msf_abs, msf_rel, track, frame;
569   
569
570570   if (!m_cd_file)
571571   {
572572      /* Throw some error here */
573573      reply_status_byte(SCSI_CHECK_CONDITION);
574574      return;
575575   }
576   
576
577577   frame = m_current_frame;
578   
578
579579   switch (m_cdda_status)
580580   {
581581      case PCE_CD_CDDA_PAUSED:
r23623r23624
590590         m_data_buffer[0] = 3;
591591         break;
592592   }
593   
593
594594   msf_abs = lba_to_msf_alt(frame);
595595   track = cdrom_get_track(m_cd_file, frame);
596596   msf_rel = lba_to_msf_alt(frame - cdrom_get_track_start(m_cd_file, track));
597   
597
598598   m_data_buffer[1] = 0x01 | ((cdrom_get_track_type(m_cd_file, cdrom_get_track(m_cd_file, track+1)) == CD_TRACK_AUDIO) ? 0x00 : 0x40);
599599   m_data_buffer[2] = dec_2_bcd(track+1);       /* track */
600600   m_data_buffer[3] = 1;                          /* index */
r23623r23624
605605   m_data_buffer[8] = dec_2_bcd((msf_abs >> 8) & 0xFF); /* S (absolute) */
606606   m_data_buffer[9] = dec_2_bcd(msf_abs & 0xFF);          /* F (absolute) */
607607   m_data_buffer_size = 10;
608   
608
609609   m_data_buffer_index = 0;
610610   m_data_transferred = 1;
611611   m_scsi_IO = 1;
r23623r23624
618618   UINT32 frame, msf, track = 0;
619619   const cdrom_toc *toc;
620620   logerror("nec get dir info\n");
621   
621
622622   if (!m_cd_file)
623623   {
624624      /* Throw some error here */
625625      reply_status_byte(SCSI_CHECK_CONDITION);
626626   }
627   
627
628628   toc = cdrom_get_toc(m_cd_file);
629   
629
630630   switch (m_command_buffer[1])
631631   {
632632      case 0x00:      /* Get first and last track numbers */
r23623r23624
638638         frame = toc->tracks[toc->numtrks-1].logframeofs;
639639         frame += toc->tracks[toc->numtrks-1].frames;
640640         msf = lba_to_msf(frame + 150);
641         
641
642642         m_data_buffer[0] = (msf >> 16) & 0xFF;   /* M */
643643         m_data_buffer[1] = (msf >> 8) & 0xFF;    /* S */
644644         m_data_buffer[2] = msf & 0xFF;             /* F */
r23623r23624
672672//          assert(pce_cd_nec_get_dir_info == NULL);  // Not implemented yet
673673         break;
674674   }
675   
675
676676   m_data_buffer_index = 0;
677677   m_data_transferred = 1;
678678   m_scsi_IO = 1;
r23623r23624
702702      { 0xDE,10, &pce_cd_device::nec_get_dir_info },               /* NEC GET DIR INFO */
703703      { 0xFF, 1, &pce_cd_device::end_of_list }                     /* end of list marker */
704704   };
705   
705
706706   if (m_scsi_REQ && m_scsi_ACK)
707707   {
708708      /* Command byte received */
709709      logerror("Command byte $%02X received\n", m_regs[0x01]);
710     
710
711711      /* Check for buffer overflow */
712712      assert(m_command_buffer_index < PCE_CD_COMMAND_BUFFER_SIZE);
713     
713
714714      m_command_buffer[m_command_buffer_index] = m_regs[0x01];
715715      m_command_buffer_index++;
716716      m_scsi_REQ = 0;
717717   }
718   
718
719719   if (! m_scsi_REQ && ! m_scsi_ACK && m_command_buffer_index)
720720   {
721721      int i = 0;
722     
722
723723      logerror("Check if command done\n");
724     
724
725725      for(i = 0; m_command_buffer[0] > pce_cd_commands[i].command_byte; i++);
726     
726
727727      /* Check for unknown commands */
728728      if (m_command_buffer[0] != pce_cd_commands[i].command_byte)
729729      {
r23623r23624
732732            popmessage("CD command 0x03 issued (Request Sense), contact MESSdev");
733733      }
734734      assert(m_command_buffer[0] == pce_cd_commands[i].command_byte);
735     
735
736736      if (m_command_buffer_index == pce_cd_commands[i].command_size)
737737      {
738738         //printf("%02x command issued\n",m_command_buffer[0]);
r23623r23624
757757         m_scsi_REQ = 0;
758758         m_status_sent = 1;
759759      }
760     
760
761761      if (! m_scsi_REQ && ! m_scsi_ACK && m_status_sent)
762762      {
763763         m_status_sent = 0;
r23623r23624
777777      {
778778         m_scsi_REQ = 0;
779779      }
780     
780
781781      if (! m_scsi_REQ && ! m_scsi_ACK)
782782      {
783783         if (m_data_buffer_index == m_data_buffer_size)
r23623r23624
814814      m_scsi_REQ = 0;
815815      m_message_sent = 1;
816816   }
817   
817
818818   if (! m_scsi_REQ && ! m_scsi_ACK && m_message_sent)
819819   {
820820      m_message_sent = 0;
r23623r23624
842842      }
843843      m_scsi_last_RST = m_scsi_RST;
844844   }
845   
845
846846   /* Check if bus can be freed */
847847   if (! m_scsi_SEL && ! m_scsi_BSY && m_selected)
848848   {
r23623r23624
851851      m_scsi_CD = m_scsi_MSG = m_scsi_IO = m_scsi_REQ = 0;
852852      set_irq_line(PCE_CD_IRQ_TRANSFER_DONE, CLEAR_LINE);
853853   }
854   
854
855855   /* Select the CD device */
856856   if (m_scsi_SEL)
857857   {
r23623r23624
863863         m_scsi_MSG = m_scsi_IO = 0;
864864      }
865865   }
866   
866
867867   if (m_scsi_ATN)
868868   {
869869   }
r23623r23624
900900         }
901901      }
902902   }
903   
903
904904   /* FIXME: presumably CD-DA needs an irq interface for this */
905905   if (m_cdda->audio_ended() && m_end_mark == 1)
906906   {
r23623r23624
919919      m_regs[0x03] |= num;
920920   else
921921      m_regs[0x03] &= ~num;
922   
922
923923   if (m_regs[0x02] & m_regs[0x03] & 0x7c)
924924   {
925925      //printf("IRQ PEND = %02x MASK = %02x IRQ ENABLE %02X\n",m_regs[0x02] & m_regs[0x03] & 0x7c,m_regs[0x02] & 0x7c,m_regs[0x03] & 0x7c);
r23623r23624
945945      {
946946         logerror("Succesfully read mode1 frame #%d\n", m_current_frame);
947947      }
948     
948
949949      m_data_buffer_index = 0;
950950      m_data_buffer_size = 2048;
951951      m_current_frame++;
952     
952
953953      m_scsi_IO = 1;
954954      m_scsi_CD = 0;
955     
955
956956      if (m_current_frame == m_end_frame)
957957      {
958958         /* We are done, disable the timer */
r23623r23624
997997TIMER_CALLBACK_MEMBER(pce_cd_device::cdda_fadeout_callback)
998998{
999999   m_cdda_volume -= 0.1;
1000   
1000
10011001   if (m_cdda_volume <= 0)
10021002   {
10031003      m_cdda_volume = 0.0;
r23623r23624
10141014TIMER_CALLBACK_MEMBER(pce_cd_device::cdda_fadein_callback)
10151015{
10161016   m_cdda_volume += 0.1;
1017   
1017
10181018   if (m_cdda_volume >= 100.0)
10191019   {
10201020      m_cdda_volume = 100.0;
r23623r23624
10311031TIMER_CALLBACK_MEMBER(pce_cd_device::adpcm_fadeout_callback)
10321032{
10331033   m_adpcm_volume -= 0.1;
1034   
1034
10351035   if (m_adpcm_volume <= 0)
10361036   {
10371037      m_adpcm_volume = 0.0;
r23623r23624
10481048TIMER_CALLBACK_MEMBER(pce_cd_device::adpcm_fadein_callback)
10491049{
10501050   m_adpcm_volume += 0.1;
1051   
1051
10521052   if (m_adpcm_volume >= 100.0)
10531053   {
10541054      m_adpcm_volume = 100.0;
r23623r23624
10661066WRITE8_MEMBER(pce_cd_device::intf_w)
10671067{
10681068   logerror("%04X: write to CD interface offset %02X, data %02X\n", space.device().safe_pc(), offset, data);
1069   
1069
10701070   switch (offset & 0xf)
10711071   {
10721072      case 0x00:  /* CDC status */
r23623r23624
11341134            adpcm_stop(0);
11351135            m_msm->reset_w(1);
11361136         }
1137         
1137
11381138         if ((data & 0x40) && ((m_regs[0x0D] & 0x40) == 0)) // ADPCM play
11391139         {
11401140            m_msm_start_addr = (m_adpcm_read_ptr);
r23623r23624
11431143            m_msm_nibble = 0;
11441144            adpcm_play();
11451145            m_msm->reset_w(0);
1146           
1146
11471147            //popmessage("%08x %08x",m_adpcm_read_ptr,m_adpcm_length);
11481148         }
11491149         else if ((data & 0x40) == 0)
r23623r23624
11521152            adpcm_stop(0);
11531153            m_msm->reset_w(1);
11541154         }
1155         
1155
11561156         m_msm_repeat = BIT(data, 5);
1157         
1157
11581158         if (data & 0x10) //ADPCM set length
11591159         {
11601160            m_adpcm_length = (m_regs[0x09] << 8) | m_regs[0x08];
r23623r23624
12731273   {
12741274      m_adpcm_ram[m_adpcm_write_ptr] = get_cd_data_byte();
12751275      m_adpcm_write_ptr = (m_adpcm_write_ptr + 1) & 0xFFFF;
1276     
1276
12771277      m_regs[0x0c] &= ~4;
12781278   }
12791279}
r23623r23624
12881288   else
12891289   {
12901290      UINT8 res;
1291     
1291
12921292      res = m_adpcm_ram[m_adpcm_read_ptr];
12931293      m_adpcm_read_ptr = ((m_adpcm_read_ptr + 1) & 0xffff);
1294     
1294
12951295      return res;
12961296   }
12971297}
r23623r23624
13561356         data = 0xFF;
13571357         break;
13581358   }
1359   
1359
13601360   return data;
13611361}
13621362
r23623r23624
13701370READ8_MEMBER(pce_cd_device::acard_r)
13711371{
13721372   UINT8 r_num;
1373   
1373
13741374   if ((offset & 0x2e0) == 0x2e0)
13751375   {
13761376      switch (offset & 0x2ef)
r23623r23624
13841384         case 0x2ee: return 0x10;
13851385         case 0x2ef: return 0x51;
13861386      }
1387     
1387
13881388      return 0;
13891389   }
1390   
1390
13911391   r_num = (offset & 0x30) >> 4;
1392   
1392
13931393   switch (offset & 0x0f)
13941394   {
13951395      case 0x00:
r23623r23624
14001400            res = m_acard_ram[(m_acard_base_addr[r_num] + m_acard_addr_offset[r_num]) & 0x1fffff];
14011401         else
14021402            res = m_acard_ram[m_acard_base_addr[r_num] & 0x1fffff];
1403         
1403
14041404         if (m_acard_ctrl[r_num] & 0x1)
14051405         {
14061406            if (m_acard_ctrl[r_num] & 0x10)
r23623r23624
14131413               m_acard_addr_offset[r_num] += m_acard_addr_inc[r_num];
14141414            }
14151415         }
1416         
1416
14171417         return res;
14181418      }
14191419      case 0x02: return (m_acard_base_addr[r_num] >> 0) & 0xff;
r23623r23624
14261426      case 0x09: return m_acard_ctrl[r_num];
14271427      default:   return 0;
14281428   }
1429   
1429
14301430   return 0;
14311431}
14321432
14331433WRITE8_MEMBER(pce_cd_device::acard_w)
14341434{
14351435   UINT8 w_num;
1436   
1436
14371437   if ((offset & 0x2e0) == 0x2e0)
14381438   {
14391439      switch (offset & 0x0f)
r23623r23624
14451445         case 4:
14461446         {
14471447            m_acard_shift_reg = data & 0x0f;
1448           
1448
14491449            if (m_acard_shift_reg != 0)
14501450            {
14511451               m_acard_shift = (m_acard_shift_reg < 8) ?
r23623r23624
14601460   else
14611461   {
14621462      w_num = (offset & 0x30) >> 4;
1463     
1463
14641464      switch (offset & 0x0f)
14651465      {
14661466         case 0x00:
r23623r23624
14691469               m_acard_ram[(m_acard_base_addr[w_num] + m_acard_addr_offset[w_num]) & 0x1fffff] = data;
14701470            else
14711471               m_acard_ram[m_acard_base_addr[w_num] & 0x1FFFFF] = data;
1472           
1472
14731473            if (m_acard_ctrl[w_num] & 0x1)
14741474            {
14751475               if (m_acard_ctrl[w_num] & 0x10)
r23623r23624
14821482                  m_acard_addr_offset[w_num] += m_acard_addr_inc[w_num];
14831483               }
14841484            }
1485           
1485
14861486            break;
1487           
1487
14881488         case 0x02: m_acard_base_addr[w_num] = (data & 0xff) | (m_acard_base_addr[w_num] & 0xffff00);  break;
14891489         case 0x03: m_acard_base_addr[w_num] = (data << 8) | (m_acard_base_addr[w_num] & 0xff00ff);        break;
14901490         case 0x04: m_acard_base_addr[w_num] = (data << 16) | (m_acard_base_addr[w_num] & 0x00ffff);   break;
14911491         case 0x05: m_acard_addr_offset[w_num] = (data & 0xff) | (m_acard_addr_offset[w_num] & 0xff00);    break;
14921492         case 0x06:
14931493            m_acard_addr_offset[w_num] = (data << 8) | (m_acard_addr_offset[w_num] & 0x00ff);
1494           
1494
14951495            if ((m_acard_ctrl[w_num] & 0x60) == 0x40)
14961496            {
14971497               m_acard_base_addr[w_num] += m_acard_addr_offset[w_num] + ((m_acard_ctrl[w_num] & 0x08) ? 0xff0000 : 0);
trunk/src/mess/machine/pce_cd.h
r23623r23624
105105   UINT8   m_msm_nibble;
106106   UINT8   m_msm_idle;
107107   UINT8   m_msm_repeat;
108   
108
109109   /* SCSI signals */
110110   int     m_scsi_BSY;   /* Busy. Bus in use */
111111   int     m_scsi_SEL;   /* Select. Initiator has won arbitration and has selected a target */
r23623r23624
128128   int     m_data_buffer_size;
129129   int     m_data_buffer_index;
130130   int     m_data_transferred;
131   
131
132132   /* Arcade Card specific */
133133   UINT8   *m_acard_ram;
134134   UINT8   m_acard_latch;
r23623r23624
138138   UINT16  m_acard_addr_inc[4];
139139   UINT32  m_acard_shift;
140140   UINT8   m_acard_shift_reg;
141   
141
142142   UINT32  m_current_frame;
143143   UINT32  m_end_frame;
144144   UINT32  m_last_frame;
r23623r23624
151151   required_device<cdda_device> m_cdda;
152152   required_device<nvram_device> m_nvram;
153153   required_device<cdrom_image_device> m_cdrom;
154   
154
155155   cdrom_file  *m_cd_file;
156156   const cdrom_toc*    m_toc;
157157   emu_timer   *m_data_timer;
158158   emu_timer   *m_adpcm_dma_timer;
159   
159
160160   emu_timer   *m_cdda_fadeout_timer;
161161   emu_timer   *m_cdda_fadein_timer;
162162   double  m_cdda_volume;
trunk/src/mess/machine/pce.c
r23623r23624
120120      m_sys3_card = 1;
121121      m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x080000, 0x087fff, read8_delegate(FUNC(pce_state::pce_cd_acard_wram_r),this),write8_delegate(FUNC(pce_state::pce_cd_acard_wram_w),this));
122122   }
123   
123
124124   if (m_cartslot->get_type() == PCE_CDSYS3U)
125125   {
126126      m_sys3_card = 3;
r23623r23624
213213
214214   if (offset & 0x200 && m_sys3_card && m_acard) // route Arcade Card handling ports
215215      return m_cd->acard_w(space, offset, data);
216   
216
217217   m_cd->intf_w(space, offset, data);
218218
219219   m_cd->update();
r23623r23624
238238         case 0xc7: return 0x03;
239239      }
240240   }
241   
241
242242   return m_cd->intf_r(space, offset);
243243}
244244
trunk/src/mess/video/newport.h
r23623r23624
116116public:
117117   newport_video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
118118   ~newport_video_device() {}
119   
120   
119
120
121121   DECLARE_READ32_MEMBER( rex3_r );
122122   DECLARE_WRITE32_MEMBER( rex3_w );
123   
123
124124   UINT32 screen_update(screen_device &device, bitmap_rgb32 &bitmap, const rectangle &cliprect);
125   
125
126126protected:
127127   // device-level overrides
128128   virtual void device_config_complete();
129129   virtual void device_start();
130130   virtual void device_reset();
131   
132private:   
131
132private:
133133   // internal state
134   
134
135135   DECLARE_READ32_MEMBER( cmap0_r );
136136   DECLARE_WRITE32_MEMBER( cmap0_w );
137137   DECLARE_READ32_MEMBER( cmap1_r );
r23623r23624
142142   DECLARE_READ32_MEMBER( vc2_r );
143143   DECLARE_WRITE32_MEMBER( vc2_w );
144144   void DoREX3Command();
145   
145
146146   VC2_t  m_VC2;
147147   XMAP_t m_XMAP0;
148148   XMAP_t m_XMAP1;
149149   REX3_t m_REX3;
150150   UINT32 *m_base;
151151   UINT8  m_nDrawGreen;
152   CMAP_t m_CMAP0;   
152   CMAP_t m_CMAP0;
153153};
154154
155155
trunk/src/mess/video/gba.c
r23623r23624
5353      for (int x = 0; x < 240; x++)
5454      {
5555         mask[x] = out_mask;
56         
56
5757         if ((obj_win[x] & 0x80000000) == 0)
5858            mask[x] = m_WINOUT >> 8;
59         
59
6060         if (inwin1)
6161         {
6262            if (is_in_window(x, 1))
6363               mask[x] = in1_mask;
6464         }
65         
65
6666         if (inwin0)
6767         {
6868            if (is_in_window(x, 0))
r23623r23624
8787      mode_mask = ~0x0b;
8888   }
8989
90   
90
9191   if (mode_mask)
9292   {
9393      for (int x = 0; x < 240; x++)
r23623r23624
103103   UINT8 inWin0Mask = m_WININ & 0x00ff;
104104   UINT8 inWin1Mask = m_WININ >> 8;
105105   UINT8 outMask = m_WINOUT & 0x00ff;
106   UINT8 masks[240];   // this puts together WinMasks with the fact that some modes/submodes skip specific layers!
107   
106   UINT8 masks[240];   // this puts together WinMasks with the fact that some modes/submodes skip specific layers!
107
108108   if (submode == GBA_SUBMODE2)
109109   {
110110      if (m_DISPCNT & DISPCNT_WIN0_EN)
r23623r23624
117117         else
118118            inWindow0 |= (y >= v0 || y < v1) ? 1 : 0;
119119      }
120     
120
121121      if (m_DISPCNT & DISPCNT_WIN1_EN)
122122      {
123123         UINT8 v0 = m_WIN1V >> 8;
r23623r23624
129129            inWindow1 |= (y >= v0 || y < v1) ? 1 : 0;
130130      }
131131   }
132   
132
133133   // Draw BG
134134   switch (mode)
135135   {
r23623r23624
154154         draw_roz_bitmap_scanline(line2, y, DISPCNT_BG2_EN, m_BG2CNT, m_BG2X, m_BG2Y, m_BG2PA, m_BG2PB, m_BG2PC, m_BG2PD, &m_gfxBG2X, &m_gfxBG2Y, m_gfxBG2Changed, bpp);
155155         break;
156156   }
157   
157
158158   // Draw OAM
159159   draw_gba_oam(lineOBJ, y);
160160   if (submode == GBA_SUBMODE2)
r23623r23624
162162
163163   memset(masks, 0xff, sizeof(masks));
164164   update_mask(&masks[0], mode, submode, lineOBJWin, inWindow0, inWindow1, inWin0Mask, inWin1Mask, outMask);
165   
165
166166   for (int x = 0; x < 240; x++)
167167   {
168168      UINT32 color = backdrop;
169169      UINT8 top = 0x20;
170     
170
171171      if ((UINT8)(line0[x] >> 24) < (UINT8)(color >> 24) && masks[x] & 0x01)
172172      {
173173         color = line0[x];
174174         top = 0x01;
175175      }
176     
176
177177      if ((UINT8)(line1[x] >> 24) < (UINT8)(color >> 24) && masks[x] & 0x02)
178178      {
179179         color = line1[x];
180180         top = 0x02;
181181      }
182     
182
183183      if ((UINT8)(line2[x] >> 24) < (UINT8)(color >> 24) && masks[x] & 0x04)
184184      {
185185         color = line2[x];
186186         top = 0x04;
187187      }
188     
188
189189      if ((UINT8)(line3[x] >> 24) < (UINT8)(color >> 24) && masks[x] & 0x08)
190190      {
191191         color = line3[x];
192192         top = 0x08;
193193      }
194     
194
195195      if ((UINT8)(lineOBJ[x] >> 24) < (UINT8)(color >> 24) && masks[x] & 0x10)
196196      {
197197         color = lineOBJ[x];
198198         top = 0x10;
199199      }
200     
200
201201      if (color & 0x00010000)
202202      {
203203         if (submode != GBA_SUBMODE0 || top == 0x10)
204204         {
205205            UINT32 back = backdrop;
206206            UINT8 top2 = 0x20;
207           
207
208208            if ((UINT8)(line0[x] >> 24) < (UINT8)(back >> 24) && masks[x] & 0x01)
209209            {
210210               back = line0[x];
211211               top2 = 0x01;
212212            }
213           
213
214214            if ((UINT8)(line1[x] >> 24) < (UINT8)(back >> 24) && masks[x] & 0x02)
215215            {
216216               back = line1[x];
217217               top2 = 0x02;
218218            }
219           
219
220220            if ((UINT8)(line2[x] >> 24) < (UINT8)(back >> 24) && masks[x] & 0x04)
221221            {
222222               back = line2[x];
223223               top2 = 0x04;
224224            }
225           
225
226226            if ((UINT8)(line3[x] >> 24) < (UINT8)(back >> 24) && masks[x] & 0x08)
227227            {
228228               back = line3[x];
229229               top2 = 0x08;
230230            }
231           
231
232232            if (top2 & (m_BLDCNT >> BLDCNT_TP2_SHIFT))
233233               color = alpha_blend_pixel(color, back, coeff[m_BLDALPHA & 0x1f], coeff[(m_BLDALPHA >> 8) & 0x1f]);
234234            else
r23623r23624
260260               {
261261                  UINT32 back = backdrop;
262262                  UINT8 top2 = 0x20;
263                 
263
264264                  if ((UINT8)(line0[x] >> 24) < (UINT8)(back >> 24) && masks[x] & 0x01)
265265                  {
266266                     if (top != 0x01)
r23623r23624
269269                        top2 = 0x01;
270270                     }
271271                  }
272                 
272
273273                  if ((UINT8)(line1[x] >> 24) < (UINT8)(back >> 24) && masks[x] & 0x02)
274274                  {
275275                     if (top != 0x02)
r23623r23624
278278                        top2 = 0x02;
279279                     }
280280                  }
281                 
281
282282                  if ((UINT8)(line2[x] >> 24) < (UINT8)(back >> 24) && masks[x] & 0x04)
283283                  {
284284                     if (top != 0x04)
r23623r23624
287287                        top2 = 0x04;
288288                     }
289289                  }
290                 
290
291291                  if ((UINT8)(line3[x] >> 24) < (UINT8)(back >> 24) && masks[x] & 0x08)
292292                  {
293293                     if (top != 0x08)
r23623r23624
296296                        top2 = 0x08;
297297                     }
298298                  }
299                 
299
300300                  if ((UINT8)(lineOBJ[x] >> 24) < (UINT8)(back >> 24) && masks[x] & 0x10)
301301                  {
302302                     if (top != 0x10)
r23623r23624
305305                        top2 = 0x10;
306306                     }
307307                  }
308                 
308
309309                  if (top2 & (m_BLDCNT >> BLDCNT_TP2_SHIFT))
310310                     color = alpha_blend_pixel(color, back, coeff[m_BLDALPHA & 0x1f], coeff[(m_BLDALPHA >> 8) & 0x1f]);
311311               }
r23623r23624
320320         }
321321      }
322322      lineMix[x] = color;
323   }   
323   }
324324   if (mode == GBA_MODE1 || mode == GBA_MODE2 || mode == GBA_MODE345)
325325      m_gfxBG2Changed = 0;
326326   if (mode == GBA_MODE2)
r23623r23624
336336   INT32 sy = (depth == 4) ? 128 : 160;
337337   UINT32 prio = ((ctrl & BGCNT_PRIORITY) << 25) + 0x1000000;
338338   INT32 cx, cy, pixx, pixy, x;
339   
339
340340   if ((depth == 8) && (m_DISPCNT & DISPCNT_FRAMESEL))
341341      src8 += 0xa000;
342   
342
343343   if ((depth == 4) && (m_DISPCNT & DISPCNT_FRAMESEL))
344344      src16 += 0xa000/2;
345   
345
346346   // sign extend roz parameters
347347   if (X & 0x08000000) X |= 0xf0000000;
348348   if (Y & 0x08000000) Y |= 0xf0000000;
r23623r23624
350350   if (PB & 0x8000) PB |= 0xffff0000;
351351   if (PC & 0x8000) PC |= 0xffff0000;
352352   if (PD & 0x8000) PD |= 0xffff0000;
353   
353
354354   if(ypos == 0)
355355      changed = 3;
356   
356
357357   if(changed & 1)
358358      *currentx = X;
359359   else
360360      *currentx += PB;
361   
361
362362   if(changed & 2)
363363      *currenty = Y;
364364   else
365365      *currenty += PD;
366   
366
367367   cx = *currentx;
368368   cy = *currenty;
369   
369
370370   if(ctrl & BGCNT_MOSAIC)
371371   {
372372      INT32 mosaic_line = ((m_MOSAIC & 0xf0) >> 4) + 1;
r23623r23624
374374      cx = X + tempy*PB;
375375      cy = Y + tempy*PD;
376376   }
377   
377
378378   pixx = cx >> 8;
379379   pixy = cy >> 8;
380   
380
381381   for(x = 0; x < 240; x++)
382382   {
383383      if(pixx < 0 || pixy < 0 || pixx >= sx || pixy >= sy)
r23623r23624
396396            scanline[x] = src16[pixy*sx + pixx] | prio;
397397         }
398398      }
399     
399
400400      cx += PA;
401401      cy += PC;
402     
402
403403      pixx = cx >> 8;
404404      pixy = cy >> 8;
405405   }
406   
406
407407   if(ctrl & BGCNT_MOSAIC)
408408   {
409409      INT32 mosaicx = (m_MOSAIC & 0x0f) + 1;
r23623r23624
508508            // shall we shift for (ctrl & BGCNT_PALETTE256)?? or is not effective for ROZ?
509509            tile = mgba_vram[mapbase + (pixx >> 3) + (pixy >> 3) * (sizes[size] >> 3)];
510510            pixel = mgba_vram[base + (tile << 6) + (tiley << 3) + tilex];
511           
511
512512            // plot it
513513            scanline[x] = pixel ? (pgba_pram[pixel] | prio) : 0x80000000;
514514         }
515         
515
516516         cx += PA;
517517         cy += PC;
518         
518
519519         pixx = cx >> 8;
520520         pixy = cy >> 8;
521         
521
522522         if(ctrl & BGCNT_PALETTESET_WRAP)
523523         {
524524            pixx %= sizes[size];
r23623r23624
573573
574574   for (x = 0; x < 240; x++)
575575      scanline[x] = 0x80000000;
576     
576
577577   if(m_DISPCNT & enablemask)
578578   {
579     
580579      switch((ctrl & BGCNT_SCREENSIZE) >> BGCNT_SCREENSIZE_SHIFT)
581580      {
582581         case 1:
r23623r23624
590589            height = 512;
591590            break;
592591      }
593     
592
594593      maskx = width - 1;
595594      masky = height - 1;
596     
595
597596      pixx = hofs & maskx;
598597      pixy = (vofs + ypos) & masky;
599     
598
600599      if(use_mosaic)
601600      {
602601         if((ypos % mosaicy) != 0)
r23623r23624
605604            pixy = (vofs + mosaicy) & masky;
606605         }
607606      }
608     
607
609608      if(pixy > 255 && height > 256)
610609      {
611610         pixy &= 0x000000ff;
r23623r23624
615614            screendata += 0x400;
616615         }
617616      }
618     
617
619618      stride = (pixy >> 3) << 5;
620     
619
621620      UINT16 *src = screendata + 0x400 * (pixx >> 8) + ((pixx & 255) >> 3) + stride;
622621      for(x = 0; x < 240; x++)
623622      {
r23623r23624
627626         INT32 tiley = pixy & 7;
628627         UINT8 color;
629628         UINT8 palindex;
630         
629
631630         if(data & TILEOBJ_HFLIP)
632631         {
633632            tilex = 7 - tilex;
r23623r23624
636635         {
637636            tiley = 7 - tiley;
638637         }
639         
638
640639         if (ctrl & BGCNT_PALETTE256)
641640         {
642641            color = chardata[(tile << 6) + (tiley << 3) + tilex];
r23623r23624
645644         else
646645         {
647646            color = chardata[(tile << 5) + (tiley << 2) + (tilex >> 1)];
648           
647
649648            if (tilex & 1)
650649               color >>= 4;
651650            else
652651               color &= 0x0f;
653652            palindex = (data >> 8) & 0x00f0;
654         }           
653         }
655654
656655         if (color)
657656            scanline[x] = palette[palindex + color] | priority;
658657         else
659658            scanline[x] = 0x80000000;
660         
659
661660         if (data & TILEOBJ_HFLIP)
662661         {
663662            if (tilex == 0)
r23623r23624
669668         {
670669            src++;
671670         }
672         
671
673672         pixx++;
674673         if(pixx == 256)
675674         {
r23623r23624
689688            src = screendata + stride;
690689         }
691690      }
692     
691
693692      if(use_mosaic)
694693      {
695694         if(mosaicx > 1)
r23623r23624
707706            }
708707         }
709708      }
710     
709
711710   }
712711}
713712
r23623r23624
722721
723722   for (x = 0; x < 240; x++)
724723      scanline[x] = 0x80000000;
725   
724
726725   if (m_DISPCNT & DISPCNT_OBJWIN_EN)
727726   {
728727      for( gba_oamindex = 127; gba_oamindex >= 0; gba_oamindex-- )
r23623r23624
11701169
11711170   for (x = 0; x < 240; x++)
11721171      scanline[x] = 0x80000000;
1173   
1172
11741173   if( m_DISPCNT & DISPCNT_OBJ_EN )
11751174   {
11761175      for( gba_oamindex = 0; gba_oamindex < 128; gba_oamindex++ )
r23623r23624
18611860      depth = 8;
18621861   else if ((m_DISPCNT & 7) == 5)
18631862      depth = 4;
1864   
1863
18651864   //printf("mode = %d, %d\n", m_DISPCNT & 7, submode);
18661865
18671866   switch(m_DISPCNT & 7)
r23623r23624
18801879         fatalerror("Invalid screen mode (6 or 7)!\n");
18811880         break;
18821881   }
1883   
1882
18841883   for (int x = 0; x < 240; x++)
18851884   {
18861885      scanline[x] = m_xferscan[6][1024 + x] & 0x7fff;
trunk/src/mess/video/vic4567.c
r23623r23624
159159   const vic3_interface *intf = reinterpret_cast<const vic3_interface *>(static_config());
160160   if (intf != NULL)
161161      *static_cast<vic3_interface *>(this) = *intf;
162   
162
163163   // or initialize to defaults if none provided
164164   else
165165   {
r23623r23624
184184void vic3_device::device_start()
185185{
186186   int width, height;
187   
187
188188   m_cpu = machine().device(cpu_tag);
189189   m_main_screen = machine().device<screen_device>(screen_tag);
190190   width = m_main_screen->width();
191191   height = m_main_screen->height();
192   
192
193193   m_bitmap = auto_bitmap_ind16_alloc(machine(), width, height);
194   
194
195195   m_type = vic_type;
196   
196
197197   m_dma_read.resolve(dma_read, *this);
198198   m_dma_read_color.resolve(dma_read_color, *this);
199199   m_interrupt.resolve(irq, *this);
200   
200
201201   m_port_changed.resolve(port_changed, *this);
202   
202
203203   m_c64_mem_r.resolve(c64_mem_r, *this);
204   
204
205205   m_lightpen_button_cb.resolve(button_cb, *this);
206206   m_lightpen_x_cb.resolve(x_cb, *this);
207207   m_lightpen_y_cb.resolve(y_cb, *this);
208   
208
209209   m_screen[0] = auto_alloc_array(machine(), UINT8, 216 * 656 / 8);
210   
210
211211   for (int i = 1; i < 216; i++)
212212      m_screen[i] = m_screen[i - 1] + 656 / 8;
213   
213
214214   for (int i = 0; i < 256; i++)
215215   {
216216      m_foreground[i] = 0;
r23623r23624
223223      if ((i & 0xc0) > 0x40)
224224         m_foreground[i] |= 0xc0;
225225   }
226   
226
227227   for (int i = 0; i < 256; i++)
228228   {
229229      m_expandx[i] = 0;
r23623r23624
244244      if (i & 0x80)
245245         m_expandx[i] |= 0xc000;
246246   }
247   
247
248248   for (int i = 0; i < 256; i++)
249249   {
250250      m_expandx_multi[i] = 0;
r23623r23624
265265      if (i & 0x80)
266266         m_expandx_multi[i] |= 0xa000;
267267   }
268   
268
269269   save_item(NAME(m_reg));
270   
270
271271   save_item(NAME(m_on));
272   
272
273273   //save_item(NAME(m_bitmap));
274   
274
275275   save_item(NAME(m_lines));
276   
276
277277   save_item(NAME(m_chargenaddr));
278278   save_item(NAME(m_videoaddr));
279279   save_item(NAME(m_bitmapaddr));
280   
280
281281   save_item(NAME(m_x_begin));
282282   save_item(NAME(m_x_end));
283283   save_item(NAME(m_y_begin));
284284   save_item(NAME(m_y_end));
285   
285
286286   save_item(NAME(m_c64_bitmap));
287287   save_item(NAME(m_bitmapmulti));
288288   save_item(NAME(m_mono));
r23623r23624
290290   save_item(NAME(m_ecmcolor));
291291   save_item(NAME(m_colors));
292292   save_item(NAME(m_spritemulti));
293   
293
294294   save_item(NAME(m_lastline));
295295   save_item(NAME(m_rasterline));
296296   save_item(NAME(m_interlace));
297   
297
298298   save_item(NAME(m_columns));
299299   save_item(NAME(m_rows));
300   
300
301301   save_item(NAME(m_shift));
302302   save_item(NAME(m_foreground));
303303   save_item(NAME(m_multi_collision));
304   
304
305305   save_item(NAME(m_palette_red));
306306   save_item(NAME(m_palette_green));
307307   save_item(NAME(m_palette_blue));
308308   save_item(NAME(m_palette_dirty));
309   
309
310310   for (int i = 0; i < 8; i++)
311311   {
312312      save_item(NAME(m_sprites[i].x), i);
r23623r23624
332332void vic3_device::device_reset()
333333{
334334   memset(m_reg, 0, ARRAY_LENGTH(m_reg));
335   
335
336336   m_on = 1;
337   
337
338338   m_interlace = 0;
339339   m_columns = 640;
340340   m_rows = 200;
341341   m_lines = VIC2_LINES;
342   
342
343343   memset(&m_sprites, 0, sizeof(m_sprites));
344   
344
345345   m_chargenaddr = 0;
346346   m_videoaddr = 0;
347347   m_bitmapaddr = 0;
348   
348
349349   m_x_begin = 0;
350350   m_x_end = 0;
351351   m_y_begin = 0;
352352   m_y_end = 0;
353   
353
354354   for (int i = 0; i < 2; i++)
355355   {
356356      m_c64_bitmap[i] = 0;
357357      m_mono[i] = 0;
358358      m_ecmcolor[i] = 0;
359359   }
360   
360
361361   for (int i = 0; i < 4; i++)
362362   {
363363      m_bitmapmulti[i] = 0;
r23623r23624
365365      m_colors[i] = 0;
366366      m_spritemulti[i] = 0;
367367   }
368   
368
369369   m_lastline = 0;
370370   m_rasterline = 0;
371   
371
372372   memset(m_shift, 0, ARRAY_LENGTH(m_shift));
373373   memset(m_multi_collision, 0, ARRAY_LENGTH(m_multi_collision));
374374   memset(m_palette_red, 0, ARRAY_LENGTH(m_palette_red));
375375   memset(m_palette_green, 0, ARRAY_LENGTH(m_palette_green));
376376   memset(m_palette_blue, 0, ARRAY_LENGTH(m_palette_blue));
377   
377
378378   m_palette_dirty = 0;
379379}
380380
r23623r23624
535535
536536   if ((y < YPOS) || (y >= (VIC2_STARTVISIBLELINES + VIC2_VISIBLELINES)) || (xbegin <= 1) || (xbegin >= (VIC2_STARTVISIBLECOLUMNS + VIC2_VISIBLECOLUMNS)))
537537      return;
538   
538
539539   for (x = 0, mask = 0xc0, shift = 6; x < 8; x += 2, mask >>= 2, shift -= 2)
540540   {
541541      if (code & mask)
r23623r23624
14991499      break;
15001500   case 0x30:
15011501      m_reg[offset] = data;
1502      if (!m_port_changed.isnull())
1502      if (!m_port_changed.isnull())
15031503      {
15041504         DBG_LOG(2, "vic write", ("%.2x:%.2x\n", offset, data));
15051505         m_reg[offset] = data;
r23623r23624
20582058   copybitmap(bitmap, *m_bitmap, 0, 0, 0, 0, cliprect);
20592059   return 0;
20602060}
2061
2062
trunk/src/mess/video/vic4567.h
r23623r23624
4747struct vic3_sprite
4848{
4949   int x, y;
50   
50
5151   int repeat;                         /* expand, line once drawn */
5252   int line;                           /* 0 not painting, else painting */
53   
53
5454   /* buffer for currently painted line */
5555   int paintedline[8];
5656   UINT8 bitmap[8][SPRITE_BASE_X_SIZE * 2 / 8 + 1  /*for simplier sprite collision detection*/];
r23623r23624
151151   DECLARE_WRITE8_MEMBER(port_w);
152152   DECLARE_WRITE8_MEMBER(palette_w);
153153   DECLARE_READ8_MEMBER(port_r);
154   
154
155155   void raster_interrupt_gen();
156156   UINT32 video_update(bitmap_ind16 &bitmap, const rectangle &cliprect);
157157
r23623r23624
184184   void draw_bitplanes();
185185
186186   TIMER_CALLBACK_MEMBER(timer_timeout);
187   
187
188188   vic3_type  m_type;
189   
189
190190   screen_device *m_main_screen;         // screen which sets bitmap properties
191   
191
192192   device_t *m_cpu;
193   
193
194194   UINT8 m_reg[0x80];
195195   int m_on;                             /* rastering of the screen */
196   
196
197197   int m_lines;
198   
198
199199   UINT16 m_chargenaddr, m_videoaddr, m_bitmapaddr;
200   
200
201201   bitmap_ind16 *m_bitmap;
202202   int m_x_begin, m_x_end;
203203   int m_y_begin, m_y_end;
204   
204
205205   UINT16 m_c64_bitmap[2], m_bitmapmulti[4], m_mono[2], m_multi[4], m_ecmcolor[2], m_colors[4], m_spritemulti[4];
206   
206
207207   int m_lastline, m_rasterline;
208   
208
209209   int m_interlace;
210210   int m_columns, m_rows;
211   
211
212212   /* background/foreground for sprite collision */
213213   UINT8 *m_screen[216], m_shift[216];
214   
214
215215   /* convert multicolor byte to background/foreground for sprite collision */
216216   UINT8 m_foreground[256];
217217   UINT16 m_expandx[256];
218218   UINT16 m_expandx_multi[256];
219   
219
220220   /* converts sprite multicolor info to info for background collision checking */
221221   UINT8 m_multi_collision[256];
222   
222
223223   vic3_sprite m_sprites[8];
224   
224
225225   /* DMA */
226226   devcb_resolved_read8    m_dma_read;
227227   devcb_resolved_read8    m_dma_read_color;
228   
228
229229   /* IRQ */
230230   devcb_resolved_write_line m_interrupt;
231   
231
232232   /* Port Changed */
233233   devcb_resolved_write8   m_port_changed;
234   
234
235235   /* lightpen */
236236   devcb_resolved_read8 m_lightpen_button_cb;
237237   devcb_resolved_read8 m_lightpen_x_cb;
238238   devcb_resolved_read8 m_lightpen_y_cb;
239   
239
240240   /* C64 memory access */
241241   devcb_resolved_read8      m_c64_mem_r;
242   
242
243243   /* palette - vic3 specific items (the ones above are used for VIC II as well) */
244244   UINT8 m_palette_red[0x100];
245245   UINT8 m_palette_green[0x100];
trunk/src/mess/video/vtvideo.c
r23623r23624
5656   const vt_video_interface *intf = reinterpret_cast<const vt_video_interface *>(static_config());
5757   if (intf != NULL)
5858      *static_cast<vt_video_interface *>(this) = *intf;
59   
59
6060   // or initialize to defaults if none provided
6161   else
6262   {
r23623r23624
7676   /* resolve callbacks */
7777   m_in_ram_func.resolve(m_in_ram_cb, *this);
7878   m_clear_video_interrupt.resolve(m_clear_video_cb, *this);
79   
79
8080   /* get the screen device */
8181   m_screen = machine().device<screen_device>(m_screen_tag);
8282   assert(m_screen != NULL);
83   
83
8484   m_gfx = machine().root_device().memregion(m_char_rom_tag)->base();
8585   assert(m_gfx != NULL);
86   
86
8787   // LBA7 is scan line frequency update
8888   machine().scheduler().timer_pulse(attotime::from_nsec(31778), timer_expired_delegate(FUNC(vt100_video_device::lba7_change),this));
8989
90   
90
9191   save_item(NAME(m_lba7));
9292   save_item(NAME(m_scroll_latch));
9393   save_item(NAME(m_blink_flip_flop));
r23623r23624
108108{
109109   palette_set_color_rgb(machine(), 0, 0x00, 0x00, 0x00); // black
110110   palette_set_color_rgb(machine(), 1, 0xff, 0xff, 0xff); // white
111   
111
112112   m_height = 25;
113113   m_lba7 = 0;
114   
114
115115   m_scroll_latch = 0;
116116   m_blink_flip_flop = 0;
117117   m_reverse_field = 0;
118118   m_basic_attribute = 0;
119   
119
120120   m_columns = 80;
121121   m_frequency = 60;
122122   m_interlaced = 1;
r23623r23624
151151
152152WRITE8_MEMBER( vt100_video_device::dc012_w )
153153{
154   if (!(data & 0x08))
154   if (!(data & 0x08))
155155   {
156      if (!(data & 0x04))
156      if (!(data & 0x04))
157157      {
158158         // set lower part scroll
159159         m_scroll_latch = (m_scroll_latch & 0x0c) | (data & 0x03);
160      }
161      else
160      }
161      else
162162      {
163163         // set higher part scroll
164164         m_scroll_latch = (m_scroll_latch & 0x03) | ((data & 0x03) << 2);
165165      }
166   }
167   else
166   }
167   else
168168   {
169      switch (data & 0x0f)
169      switch (data & 0x0f)
170170      {
171171         case 0x08:
172172            // toggle blink flip flop
r23623r23624
206206
207207WRITE8_MEMBER( vt100_video_device::dc011_w )
208208{
209   if (!BIT(data, 5))
209   if (!BIT(data, 5))
210210   {
211211      UINT8 col = m_columns;
212      if (!BIT(data, 4))
212      if (!BIT(data, 4))
213213      {
214214         m_columns = 80;
215      }
216      else
215      }
216      else
217217      {
218218         m_columns = 132;
219219      }
220      if (col != m_columns)
220      if (col != m_columns)
221221      {
222222         recompute_parameters();
223223      }
224224      m_interlaced = 1;
225   }
226   else
225   }
226   else
227227   {
228      if (!BIT(data, 4))
228      if (!BIT(data, 4))
229229      {
230230         m_frequency = 60;
231231         m_skip_lines = 2;
232      }
233      else
232      }
233      else
234234      {
235235         m_frequency = 50;
236236         m_skip_lines = 5;
r23623r23624
252252
253253   for (int i = 0; i < 10; i++)
254254   {
255      switch (display_type)
255      switch (display_type)
256256      {
257257         case 0 : // bottom half, double height
258258                  j = (i >> 1) + 5; break;
r23623r23624
268268
269269      line = m_gfx[(code & 0x7f) * 16 + j];
270270
271      if (m_basic_attribute == 1)
271      if (m_basic_attribute == 1)
272272      {
273273         if ((code & 0x80) == 0x80)
274274            invert = 1;
r23623r23624
280280      {
281281         prevbit = bit;
282282         bit = BIT((line << b), 7);
283         if (double_width)
283         if (double_width)
284284         {
285285            bitmap.pix16(y * 10 + i, x * 20 + b * 2)     =  (bit | prevbit) ^ invert;
286286            bitmap.pix16(y * 10 + i, x * 20 + b * 2 + 1) =  bit ^ invert;
287         }
288         else
287         }
288         else
289289         {
290290            bitmap.pix16(y * 10 + i, x * 10 + b) =  (bit | prevbit) ^ invert;
291291         }
292292      }
293293      prevbit = bit;
294294      // char interleave is filled with last bit
295      if (double_width)
295      if (double_width)
296296      {
297297         bitmap.pix16(y * 10 + i, x * 20 + 16) =  (bit | prevbit) ^ invert;
298298         bitmap.pix16(y * 10 + i, x * 20 + 17) =  bit ^ invert;
299299         bitmap.pix16(y * 10 + i, x * 20 + 18) =  bit ^ invert;
300300         bitmap.pix16(y * 10 + i, x * 20 + 19) =  bit ^ invert;
301      }
302      else
301      }
302      else
303303      {
304304         bitmap.pix16(y * 10 + i, x * 10 + 8) =  (bit | prevbit) ^ invert;
305305         bitmap.pix16(y * 10 + i, x * 10 + 9) =  bit ^ invert;
r23623r23624
319319   UINT8 display_type = 3;  // binary 11
320320   UINT16 temp = 0;
321321
322   if (m_in_ram_func(0) != 0x7f)
322   if (m_in_ram_func(0) != 0x7f)
323323      return;
324324
325   while (line < (m_height + m_skip_lines))
325   while (line < (m_height + m_skip_lines))
326326   {
327327      code = m_in_ram_func(addr + xpos);
328      if (code == 0x7f)
328      if (code == 0x7f)
329329      {
330330         // end of line, fill empty till end of line
331         if (line >= m_skip_lines)
331         if (line >= m_skip_lines)
332332         {
333333            for (x = xpos; x < ((display_type == 2) ? (m_columns / 2) : m_columns); x++)
334334            {
r23623r23624
342342         if (addr & 0x1000) addr &= 0xfff; else addr |= 0x2000;
343343         scroll_region = (temp >> 15) & 1;
344344         display_type  = (temp >> 13) & 3;
345         if (line >= m_skip_lines)
345         if (line >= m_skip_lines)
346346         {
347347            ypos++;
348348         }
349349         xpos = 0;
350350         line++;
351      }
352      else
351      }
352      else
353353      {
354354         // display regular char
355         if (line >= m_skip_lines)
355         if (line >= m_skip_lines)
356356         {
357357            display_char(bitmap, code, xpos, ypos, scroll_region, display_type);
358358         }
359359         xpos++;
360         if (xpos > m_columns)
360         if (xpos > m_columns)
361361         {
362362            line++;
363363            xpos = 0;
r23623r23624
375375
376376   for (int i = 0; i < 10; i++)
377377   {
378      switch (display_type)
378      switch (display_type)
379379      {
380380         case 0 : // bottom half, double height
381381                  j = (i >> 1) + 5; break;
r23623r23624
390390      if (j == 0) j = 15; else j = j - 1;
391391
392392      line = m_gfx[code * 16 + j];
393      if (m_basic_attribute == 1)
393      if (m_basic_attribute == 1)
394394      {
395         if ((code & 0x80) == 0x80)
395         if ((code & 0x80) == 0x80)
396396         {
397397            line = line ^ 0xff;
398398         }
r23623r23624
401401      for (int b = 0; b < 8; b++)
402402      {
403403         bit = BIT((line << b), 7);
404         if (double_width)
404         if (double_width)
405405         {
406406            bitmap.pix16(y * 10 + i, x * 20 + b * 2)     = bit;
407407            bitmap.pix16(y * 10 + i, x * 20 + b * 2 + 1) = bit;
408         }
409         else
408         }
409         else
410410         {
411411            bitmap.pix16(y * 10 + i, x * 10 + b) = bit;
412412         }
413413      }
414414      // char interleave is filled with last bit
415      if (double_width)
415      if (double_width)
416416      {
417417         bitmap.pix16(y * 10 + i, x * 20 + 16) = bit;
418418         bitmap.pix16(y * 10 + i, x * 20 + 17) = bit;
419419         bitmap.pix16(y * 10 + i, x * 20 + 18) = bit;
420420         bitmap.pix16(y * 10 + i, x * 20 + 19) = bit;
421      }
422      else
421      }
422      else
423423      {
424424         bitmap.pix16(y * 10 + i, x * 10 + 8) = bit;
425425         bitmap.pix16(y * 10 + i, x * 10 + 9) = bit;
r23623r23624
440440   UINT8 display_type = 3;  // binary 11
441441   UINT16 temp = 0;
442442
443   while (line < (m_height + m_skip_lines))
443   while (line < (m_height + m_skip_lines))
444444   {
445445      code = m_in_ram_func(addr + xpos);
446      if (code == 0xff)
446      if (code == 0xff)
447447      {
448448         // end of line, fill empty till end of line
449         if (line >= m_skip_lines)
449         if (line >= m_skip_lines)
450450         {
451451            for (x = xpos; x < ((display_type == 2) ? (m_columns / 2) : m_columns); x++)
452452            {
r23623r23624
462462         temp = m_in_ram_func(attr_addr);
463463         scroll_region = (temp) & 1;
464464         display_type = (temp>> 1) & 3;
465         if (line >= m_skip_lines)
465         if (line >= m_skip_lines)
466466         {
467467            ypos++;
468468         }
469469         xpos = 0;
470470         line++;
471      }
472      else
471      }
472      else
473473      {
474474         // display regular char
475         if (line >= m_skip_lines)
475         if (line >= m_skip_lines)
476476         {
477477            display_char(bitmap, code, xpos, ypos, scroll_region, display_type);
478478         }
479479         xpos++;
480         if (xpos > m_columns)
480         if (xpos > m_columns)
481481         {
482482            line++;
483483            xpos = 0;
trunk/src/mess/video/vtvideo.h
r23623r23624
1919{
2020   const char *m_screen_tag;     /* screen we are acting on */
2121   const char *m_char_rom_tag; /* character rom region */
22   
22
2323   /* this gets called for every memory read */
2424   devcb_read8         m_in_ram_cb;
2525   devcb_write8        m_clear_video_cb;
r23623r23624
5454
5555   devcb_resolved_read8        m_in_ram_func;
5656   devcb_resolved_write8       m_clear_video_interrupt;
57   
57
5858   screen_device *m_screen;  /* screen */
5959   UINT8 *m_gfx;     /* content of char rom */
60   
60
6161   int m_lba7;
62   
62
6363   // dc012 attributes
6464   UINT8 m_scroll_latch;
6565   UINT8 m_blink_flip_flop;
trunk/src/mess/video/stic.c
r23623r23624
11/**********************************************************************
2
2
33 General Instruments AY-3-8900-1 a.k.a. Standard Television Interface Chip
44 (STIC) emulation for Mattel Intellivision
5
5
66 Copyright MESS Team.
77 Visit http://mamedev.org for licensing and usage restrictions.
8
8
99 *********************************************************************/
1010
1111#include "emu.h"
r23623r23624
4242void stic_device::device_start()
4343{
4444   machine().primary_screen->register_screen_bitmap(m_bitmap);
45   
45
4646   save_item(NAME(m_stic_registers));
4747   save_item(NAME(m_gramdirty));
4848   save_item(NAME(m_gram));
r23623r23624
123123   m_col_delay = 0;
124124   m_row_delay = 0;
125125   m_left_edge_inhibit = 0;
126   m_top_edge_inhibit = 0;   
126   m_top_edge_inhibit = 0;
127127}
128128
129129ROM_START( stic_grom )
r23623r23624
149149void stic_device::intv_set_pixel(bitmap_ind16 &bitmap, int x, int y, UINT32 color)
150150{
151151   int w, h;
152   
152
153153   // output scaling
154154   x *= m_x_scale;
155155   y *= m_y_scale;
156156   color = SET_COLOR(color);
157   
157
158158   for (h = 0; h < m_y_scale; h++)
159159      for (w = 0; w < m_x_scale; w++)
160160         bitmap.pix16(y + h, x + w) = color;
r23623r23624
174174int stic_device::sprites_collide(int spriteNum1, int spriteNum2)
175175{
176176   INT16 x0, y0, w0, h0, x1, y1, w1, h1, x2, y2, w2, h2;
177   
177
178178   intv_sprite_type* s1 = &m_sprite[spriteNum1];
179179   intv_sprite_type* s2 = &m_sprite[spriteNum2];
180   
180
181181   x0 = STIC_OVERSCAN_LEFT_WIDTH + m_col_delay - STIC_CARD_WIDTH;
182182   y0 = STIC_OVERSCAN_TOP_HEIGHT + m_row_delay - STIC_CARD_HEIGHT;
183183   x1 = (s1->xpos + x0) * STIC_X_SCALE; y1 = (s1->ypos + y0) * STIC_Y_SCALE;
r23623r23624
186186   w2 = (s2->doublex ? 2 : 1) * STIC_CARD_WIDTH;
187187   h1 = (s1->quady ? 4 : 1) * (s1->doubley ? 2 : 1) * (s1->doubleyres ? 2 : 1) * STIC_CARD_HEIGHT;
188188   h2 = (s2->quady ? 4 : 1) * (s2->doubley ? 2 : 1) * (s2->doubleyres ? 2 : 1) * STIC_CARD_HEIGHT;
189   
189
190190   if ((x1 >= x2 + w2) || (y1 >= y2 + h2) ||
191191      (x2 >= x1 + w1) || (y2 >= y1 + h1))
192192      return FALSE;
193   
193
194194   // iterate over the intersecting bits to see if any touch
195195   x0 = MAX(x1, x2);
196196   y0 = MAX(y1, y2);
r23623r23624
209209            return TRUE;
210210      }
211211   }
212   
212
213213   return FALSE;
214214}
215215
r23623r23624
221221      intv_sprite_type* s1 = &m_sprite[i];
222222      if (s1->xpos == 0 || !s1->coll)
223223         continue;
224     
224
225225      for (int j = i + 1; j < STIC_MOBS; j++)
226226      {
227227         intv_sprite_type* s2 = &m_sprite[j];
228228         if (s2->xpos == 0 || !s2->coll)
229229            continue;
230         
230
231231         if (sprites_collide(i, j))
232232         {
233233            s1->collision |= (1 << j);
r23623r23624
246246   INT32 nextX;
247247   INT32 nextY;
248248   INT32 xInc;
249   
249
250250   UINT8* memory = m_grom_region->base();
251   
251
252252   for (int i = 0; i < STIC_MOBS; i++)
253253   {
254254      intv_sprite_type* s = &m_sprite[i];
255     
255
256256      if (s->grom)
257257         cardMemoryLocation = (s->card * STIC_CARD_HEIGHT);
258258      else
259259         cardMemoryLocation = ((s->card & 0x003F) * STIC_CARD_HEIGHT);
260     
260
261261      pixelSize = (s->quady ? 4 : 1) * (s->doubley ? 2 : 1);
262262      spritePixelHeight = pixelSize * (s->doubleyres ? 2 : 1) * STIC_CARD_HEIGHT;
263     
263
264264      for (int j = 0; j < spritePixelHeight; j++)
265265      {
266266         nextMemoryLocation = (cardMemoryLocation + (j/pixelSize));
r23623r23624
273273         nextX = (s->xflip ? ((s->doublex ? 2 : 1) * STIC_CARD_WIDTH - 1) : 0);
274274         nextY = (s->yflip ? (spritePixelHeight - j - 1) : j);
275275         xInc = (s->xflip ? -1: 1);
276         
276
277277         for (int k = 0; k < STIC_CARD_WIDTH * (1 + s->doublex); k++)
278278         {
279279            m_sprite_buffers[i][nextX + k * xInc][nextY] = (nextData & (1 << ((STIC_CARD_WIDTH - 1) - k / (1 + s->doublex)))) != 0;
r23623r23624
285285void stic_device::render_line(bitmap_ind16 &bitmap, UINT8 nextByte, UINT16 x, UINT16 y, UINT8 fgcolor, UINT8 bgcolor)
286286{
287287   UINT32 color;
288   
288
289289   for (int i = 0; i < STIC_CARD_WIDTH; i++)
290290   {
291291      color = (nextByte & (1 << ((STIC_CARD_WIDTH - 1) - i)) ? fgcolor : bgcolor);
r23623r23624
308308   UINT8 csPtr = 0;
309309   UINT16 nextCard;
310310   UINT8 *ram = m_grom_region->base();
311   
311
312312   for (h = 0, nexty = (STIC_OVERSCAN_TOP_HEIGHT + m_row_delay) * STIC_Y_SCALE;
313       h < STIC_BACKTAB_HEIGHT;
314       h++, nexty += STIC_CARD_HEIGHT * STIC_Y_SCALE)
313         h < STIC_BACKTAB_HEIGHT;
314         h++, nexty += STIC_CARD_HEIGHT * STIC_Y_SCALE)
315315   {
316316      for (w = 0, nextx = (STIC_OVERSCAN_LEFT_WIDTH + m_col_delay) * STIC_X_SCALE;
317          w < STIC_BACKTAB_WIDTH;
318          w++, nextx += STIC_CARD_WIDTH * STIC_X_SCALE)
317            w < STIC_BACKTAB_WIDTH;
318            w++, nextx += STIC_CARD_WIDTH * STIC_X_SCALE)
319319      {
320320         nextCard = m_backtab_buffer[h][w];
321         
321
322322         // colored squares mode
323323         if ((nextCard & (STIC_CSTM_FG3|STIC_CSTM_SEL)) == STIC_CSTM_FG3)
324324         {
r23623r23624
329329            UINT8 color3 = ((nextCard & STIC_CSQM_D2) >> 11) |
330330            ((nextCard & (STIC_CSQM_D10)) >> 9);
331331            render_colored_squares(bitmap, nextx, nexty,
332                              (color0 == 7 ? csColor : (color0 | FOREGROUND_BIT)),
333                              (color1 == 7 ? csColor : (color1 | FOREGROUND_BIT)),
334                              (color2 == 7 ? csColor : (color2 | FOREGROUND_BIT)),
335                              (color3 == 7 ? csColor : (color3 | FOREGROUND_BIT)));
332                              (color0 == 7 ? csColor : (color0 | FOREGROUND_BIT)),
333                              (color1 == 7 ? csColor : (color1 | FOREGROUND_BIT)),
334                              (color2 == 7 ? csColor : (color2 | FOREGROUND_BIT)),
335                              (color3 == 7 ? csColor : (color3 | FOREGROUND_BIT)));
336336         }
337337         //color stack mode
338338         else
r23623r23624
340340            UINT8 isGrom;
341341            UINT16 memoryLocation, fgcolor, bgcolor;
342342            UINT8* memory;
343           
343
344344            //advance the color pointer, if necessary
345345            if (nextCard & STIC_CSTM_ADV)
346346               csPtr = (csPtr+1) & (STIC_CSRS - 1);
347           
347
348348            fgcolor = ((nextCard & STIC_CSTM_FG3) >> 9) |
349349            (nextCard & (STIC_CSTM_FG20)) | FOREGROUND_BIT;
350350            bgcolor = m_stic_registers[STIC_CSR + csPtr] & STIC_CSR_BG;
351           
351
352352            isGrom = !(nextCard & STIC_CSTM_SEL);
353353            if (isGrom)
354354            {
r23623r23624
378378   UINT16 nextCard, memoryLocation;
379379   UINT8* memory;
380380   UINT8* ram = m_grom_region->base();
381   
381
382382   for (h = 0, nexty = (STIC_OVERSCAN_TOP_HEIGHT + m_row_delay) * STIC_Y_SCALE;
383       h < STIC_BACKTAB_HEIGHT;
384       h++, nexty += STIC_CARD_HEIGHT * STIC_Y_SCALE)
383         h < STIC_BACKTAB_HEIGHT;
384         h++, nexty += STIC_CARD_HEIGHT * STIC_Y_SCALE)
385385   {
386386      for (w = 0, nextx = (STIC_OVERSCAN_LEFT_WIDTH + m_col_delay) * STIC_X_SCALE;
387          w < STIC_BACKTAB_WIDTH;
388          w++, nextx += STIC_CARD_WIDTH * STIC_X_SCALE)
387            w < STIC_BACKTAB_WIDTH;
388            w++, nextx += STIC_CARD_WIDTH * STIC_X_SCALE)
389389      {
390390         nextCard = m_backtab_buffer[h][w];
391391         fgcolor = (nextCard & STIC_FBM_FG) | FOREGROUND_BIT;
392392         bgcolor = ((nextCard & STIC_FBM_BG2) >> 11) |
393393         ((nextCard & STIC_FBM_BG310) >> 9);
394         
394
395395         isGrom = !(nextCard & STIC_FBM_SEL);
396396         if (isGrom)
397397         {
r23623r23624
421421   INT16 leftX, nextY;
422422   INT16 leftBorder, rightBorder, topBorder, bottomBorder;
423423   INT32 nextX;
424   
424
425425   for (int i = STIC_MOBS - 1; i >= 0; i--)
426426   {
427427      intv_sprite_type *s = &m_sprite[i];
428428      if (s->xpos == 0 || (!s->coll && !s->visible))
429429         continue;
430     
430
431431      borderCollision = FALSE;
432432      foregroundCollision = FALSE;
433     
433
434434      spritePixelHeight = (s->quady ? 4 : 1) * (s->doubley ? 2 : 1) * (s->doubleyres ? 2 : 1) * STIC_CARD_HEIGHT;
435435      width = (s->doublex ? 2 : 1) * STIC_CARD_WIDTH;
436     
436
437437      leftX = (s->xpos - STIC_CARD_WIDTH + STIC_OVERSCAN_LEFT_WIDTH + m_col_delay) * STIC_X_SCALE;
438438      nextY = (s->ypos - STIC_CARD_HEIGHT + STIC_OVERSCAN_TOP_HEIGHT + m_row_delay) * STIC_Y_SCALE;
439     
439
440440      leftBorder =  (STIC_OVERSCAN_LEFT_WIDTH + (m_left_edge_inhibit ? STIC_CARD_WIDTH : 0)) * STIC_X_SCALE;
441441      rightBorder = (STIC_OVERSCAN_LEFT_WIDTH + STIC_BACKTAB_WIDTH * STIC_CARD_WIDTH - 1 - 1) * STIC_X_SCALE;
442442      topBorder = (STIC_OVERSCAN_TOP_HEIGHT + (m_top_edge_inhibit ? STIC_CARD_HEIGHT : 0)) * STIC_Y_SCALE;
443443      bottomBorder = (STIC_OVERSCAN_TOP_HEIGHT + STIC_BACKTAB_HEIGHT * STIC_CARD_HEIGHT) * STIC_Y_SCALE - 1;
444     
444
445445      for (y = 0; y < spritePixelHeight; y++)
446446      {
447447         for (x = 0; x < width; x++)
r23623r23624
449449            //if this sprite pixel is not on, then don't paint it
450450            if (!m_sprite_buffers[i][x][y])
451451               continue;
452           
452
453453            nextX = leftX + x;
454454            //if the next pixel location is on the border, then we
455455            //have a border collision and we can ignore painting it
r23623r23624
459459               borderCollision = TRUE;
460460               continue;
461461            }
462           
462
463463            currentPixel = intv_get_pixel(bitmap, nextX, nextY);
464           
464
465465            //check for foreground collision
466466            if (currentPixel & FOREGROUND_BIT)
467467            {
r23623r23624
469469               if (s->behind_foreground)
470470                  continue;
471471            }
472           
472
473473            if (s->visible)
474474            {
475475               intv_set_pixel(bitmap, nextX, nextY, s->color | (currentPixel & FOREGROUND_BIT));
r23623r23624
477477         }
478478         nextY++;
479479      }
480     
480
481481      //update the collision bits
482482      if (s->coll)
483483      {
r23623r23624
506506   int row,col;
507507   int fgcolor,bgcolor = 0;
508508   int code;
509   
509
510510   int colora, colorb, colorc, colord;
511   
511
512512   int n_bit;
513513   int p_bit;
514514   int g_bit;
515   
515
516516   int j;
517   
517
518518   int x0 = STIC_OVERSCAN_LEFT_WIDTH + m_col_delay;
519519   int y0 = STIC_OVERSCAN_TOP_HEIGHT + m_row_delay;
520   
520
521521   if (m_color_stack_mode == 1)
522522   {
523523      m_color_stack_offset = 0;
r23623r23624
526526         for(col = 0; col < STIC_BACKTAB_WIDTH; col++)
527527         {
528528            value = m_ram16[offs];
529           
529
530530            n_bit = value & STIC_CSTM_ADV;
531531            p_bit = value & STIC_CSTM_FG3;
532532            g_bit = value & STIC_CSTM_SEL;
533           
533
534534            if (p_bit && (!g_bit)) // colored squares mode
535535            {
536536               colora = value & STIC_CSQM_A;
r23623r23624
554554                  m_color_stack_offset += 1;
555555                  m_color_stack_offset &= (STIC_CSRS - 1);
556556               }
557               
557
558558               if (p_bit) // pastel color set
559559                  fgcolor = (value & STIC_CSTM_FG20) + 8;
560560               else
561561                  fgcolor = value & STIC_CSTM_FG20;
562               
562
563563               bgcolor = m_stic_registers[STIC_CSR + m_color_stack_offset];
564564               code = (value & STIC_CSTM_C)>>3;
565               
565
566566               if (g_bit) // read from gram
567567               {
568568                  code &= (STIC_CSTM_C50 >> 3);  // keep from going outside the array
569569                  //if (m_gramdirtybytes[code] == 1)
570570                  {
571571                     decodechar(machine().gfx[1],
572                              code,
573                              m_gram,
574                              machine().config()->gfxdecodeinfo[1].gfxlayout);
572                              code,
573                              m_gram,
574                              machine().config()->gfxdecodeinfo[1].gfxlayout);
575575                     m_gramdirtybytes[code] = 0;
576576                  }
577577                  // Draw GRAM char
r23623r23624
580580                        bgcolor*16+fgcolor,
581581                        0,0, (x0 + col * STIC_CARD_WIDTH) * STIC_X_SCALE, (y0 + row * STIC_CARD_HEIGHT) * STIC_Y_SCALE,
582582                        0,transparency,bgcolor);
583                 
583
584584                  for(j=0;j<8;j++)
585585                  {
586586                     //intv_set_pixel(bitmap, (x0 + col * STIC_CARD_WIDTH + j) * STIC_X_SCALE, (y0 + row * STIC_CARD_HEIGHT + 7) * STIC_Y_SCALE + 1, 1);
587587                  }
588                 
588
589589               }
590590               else // read from grom
591591               {
r23623r23624
594594                        bgcolor*16+fgcolor,
595595                        0,0, (x0 + col * STIC_CARD_WIDTH) * STIC_X_SCALE, (y0 + row * STIC_CARD_HEIGHT) * STIC_Y_SCALE,
596596                        0,transparency,bgcolor);
597                 
597
598598                  for(j=0;j<8;j++)
599599                  {
600600                     //intv_set_pixel(bitmap, (x0 + col * STIC_CARD_WIDTH + j) * STIC_X_SCALE, (y0 + row * STIC_CARD_HEIGHT + 7) * STIC_Y_SCALE + 1, 2);
r23623r23624
616616            fgcolor = value & STIC_FBM_FG;
617617            bgcolor = ((value & STIC_FBM_BG2) >> 11) + ((value & STIC_FBM_BG310) >> 9);
618618            code = (value & STIC_FBM_C) >> 3;
619           
619
620620            if (value & STIC_FBM_SEL) // read for GRAM
621621            {
622622               //if (m_gramdirtybytes[code] == 1)
623623               {
624624                  decodechar(machine().gfx[1],
625                           code,
626                           m_gram,
627                           machine().config()->gfxdecodeinfo[1].gfxlayout);
625                           code,
626                           m_gram,
627                           machine().config()->gfxdecodeinfo[1].gfxlayout);
628628                  m_gramdirtybytes[code] = 0;
629629               }
630630               // Draw GRAM char
r23623r23624
656656   int code;
657657   int x0 = STIC_OVERSCAN_LEFT_WIDTH + m_col_delay - STIC_CARD_WIDTH;
658658   int y0 = STIC_OVERSCAN_TOP_HEIGHT + m_row_delay - STIC_CARD_HEIGHT;
659   
659
660660   for (int i = STIC_MOBS - 1; i >= 0; --i)
661661   {
662662      intv_sprite_type *s = &m_sprite[i];
r23623r23624
671671               //if (m_gramdirtybytes[code] == 1)
672672               {
673673                  decodechar(machine().gfx[1],
674                           code,
675                           m_gram,
676                           machine().config()->gfxdecodeinfo[1].gfxlayout);
674                           code,
675                           m_gram,
676                           machine().config()->gfxdecodeinfo[1].gfxlayout);
677677                  m_gramdirtybytes[code] = 0;
678678               }
679679               // Draw GRAM char
680680               drawgfxzoom_transpen(bitmap,&machine().screen[0].visarea,machine().gfx[1],
681                               code,
682                               s->color,
683                               s->xflip,s->yflip,
684                               (s->xpos + x0) * STIC_X_SCALE, (s->ypos + y0) * STIC_Y_SCALE,
685                               0x8000 * s->xsize, 0x8000 * s->ysize,0);
681                                 code,
682                                 s->color,
683                                 s->xflip,s->yflip,
684                                 (s->xpos + x0) * STIC_X_SCALE, (s->ypos + y0) * STIC_Y_SCALE,
685                                 0x8000 * s->xsize, 0x8000 * s->ysize,0);
686686            }
687687            else
688688            {
689689               //if ((m_gramdirtybytes[code] == 1) || (m_gramdirtybytes[code+1] == 1))
690690               {
691691                  decodechar(machine().gfx[1],
692                           code,
693                           m_gram,
694                           machine().config()->gfxdecodeinfo[1].gfxlayout);
692                           code,
693                           m_gram,
694                           machine().config()->gfxdecodeinfo[1].gfxlayout);
695695                  decodechar(machine().gfx[1],
696                           code+1,
697                           m_gram,
698                           machine().config()->gfxdecodeinfo[1].gfxlayout);
696                           code+1,
697                           m_gram,
698                           machine().config()->gfxdecodeinfo[1].gfxlayout);
699699                  m_gramdirtybytes[code] = 0;
700700                  m_gramdirtybytes[code+1] = 0;
701701               }
702702               // Draw GRAM char
703703               drawgfxzoom_transpen(bitmap,&machine().screen[0].visarea,machine().gfx[1],
704                               code,
705                               s->color,
706                               s->xflip,s->yflip,
707                               (s->xpos + x0) * STIC_X_SCALE, (s->ypos + y0) * STIC_Y_SCALE + s->yflip * s->ysize * STIC_CARD_HEIGHT,
708                               0x8000*s->xsize, 0x8000*s->ysize,0);
704                                 code,
705                                 s->color,
706                                 s->xflip,s->yflip,
707                                 (s->xpos + x0) * STIC_X_SCALE, (s->ypos + y0) * STIC_Y_SCALE + s->yflip * s->ysize * STIC_CARD_HEIGHT,
708                                 0x8000*s->xsize, 0x8000*s->ysize,0);
709709               drawgfxzoom_transpen(bitmap,&machine().screen[0].visarea,machine().gfx[1],
710                               code+1,
711                               s->color,
712                               s->xflip,s->yflip,
713                               (s->xpos + x0) * STIC_X_SCALE, (s->ypos + y0) * STIC_Y_SCALE + (1 - s->yflip) * s->ysize * STIC_CARD_HEIGHT,
714                               0x8000*s->xsize, 0x8000*s->ysize,0);
710                                 code+1,
711                                 s->color,
712                                 s->xflip,s->yflip,
713                                 (s->xpos + x0) * STIC_X_SCALE, (s->ypos + y0) * STIC_Y_SCALE + (1 - s->yflip) * s->ysize * STIC_CARD_HEIGHT,
714                                 0x8000*s->xsize, 0x8000*s->ysize,0);
715715            }
716716         }
717717         else
r23623r23624
720720            {
721721               // Draw GROM char
722722               drawgfxzoom_transpen(bitmap,&machine().screen[0].visarea,machine().gfx[0],
723                               code,
724                               s->color,
725                               s->xflip,s->yflip,
726                               (s->xpos + x0) * STIC_X_SCALE, (s->ypos + y0) * STIC_Y_SCALE,
727                               0x8000*s->xsize, 0x8000*s->ysize,0);
723                                 code,
724                                 s->color,
725                                 s->xflip,s->yflip,
726                                 (s->xpos + x0) * STIC_X_SCALE, (s->ypos + y0) * STIC_Y_SCALE,
727                                 0x8000*s->xsize, 0x8000*s->ysize,0);
728728            }
729729            else
730730            {
731731               drawgfxzoom_transpen(bitmap,&machine().screen[0].visarea,machine().gfx[0],
732                               code,
733                               s->color,
734                               s->xflip,s->yflip,
735                               (s->xpos + x0) * STIC_X_SCALE, (s->ypos + y0) * STIC_Y_SCALE + s->yflip * s->ysize * STIC_CARD_HEIGHT,
736                               0x8000*s->xsize, 0x8000*s->ysize,0);
732                                 code,
733                                 s->color,
734                                 s->xflip,s->yflip,
735                                 (s->xpos + x0) * STIC_X_SCALE, (s->ypos + y0) * STIC_Y_SCALE + s->yflip * s->ysize * STIC_CARD_HEIGHT,
736                                 0x8000*s->xsize, 0x8000*s->ysize,0);
737737               drawgfxzoom_transpen(bitmap,&machine().screen[0].visarea,machine().gfx[0],
738                               code+1,
739                               s->color,
740                               s->xflip,s->yflip,
741                               (s->xpos + x0) * STIC_X_SCALE, (s->ypos + y0) * STIC_Y_SCALE + (1 - s->yflip) * s->ysize * STIC_CARD_HEIGHT,
742                               0x8000*s->xsize, 0x8000*s->ysize,0);
738                                 code+1,
739                                 s->color,
740                                 s->xflip,s->yflip,
741                                 (s->xpos + x0) * STIC_X_SCALE, (s->ypos + y0) * STIC_Y_SCALE + (1 - s->yflip) * s->ysize * STIC_CARD_HEIGHT,
742                                 0x8000*s->xsize, 0x8000*s->ysize,0);
743743            }
744744         }
745745      }
r23623r23624
751751{
752752   intv_plot_box(bitmap, 0, 0, (STIC_OVERSCAN_LEFT_WIDTH + (m_left_edge_inhibit ? STIC_CARD_WIDTH : m_col_delay)) * STIC_X_SCALE, (STIC_OVERSCAN_TOP_HEIGHT + STIC_BACKTAB_HEIGHT * STIC_CARD_HEIGHT + STIC_OVERSCAN_BOTTOM_HEIGHT) * STIC_Y_SCALE, m_border_color);
753753   intv_plot_box(bitmap, (STIC_OVERSCAN_LEFT_WIDTH + STIC_BACKTAB_WIDTH * STIC_CARD_WIDTH - 1) * STIC_X_SCALE, 0, STIC_OVERSCAN_RIGHT_WIDTH, (STIC_OVERSCAN_TOP_HEIGHT + STIC_BACKTAB_HEIGHT * STIC_CARD_HEIGHT + STIC_OVERSCAN_BOTTOM_HEIGHT) * STIC_Y_SCALE, m_border_color);
754   
754
755755   intv_plot_box(bitmap, 0, 0, (STIC_OVERSCAN_LEFT_WIDTH + STIC_BACKTAB_WIDTH * STIC_CARD_WIDTH - 1 + STIC_OVERSCAN_RIGHT_WIDTH) * STIC_X_SCALE, (STIC_OVERSCAN_TOP_HEIGHT + (m_top_edge_inhibit ? STIC_CARD_HEIGHT : m_row_delay)) * STIC_Y_SCALE, m_border_color);
756756   intv_plot_box(bitmap, 0, (STIC_OVERSCAN_TOP_HEIGHT + STIC_BACKTAB_HEIGHT * STIC_CARD_HEIGHT) * STIC_Y_SCALE, (STIC_OVERSCAN_LEFT_WIDTH + STIC_BACKTAB_WIDTH * STIC_CARD_WIDTH - 1 + STIC_OVERSCAN_RIGHT_WIDTH) * STIC_X_SCALE, STIC_OVERSCAN_BOTTOM_HEIGHT * STIC_Y_SCALE, m_border_color);
757757}
r23623r23624
765765      render_background(m_bitmap);
766766      // Render the sprites into their buffers
767767      render_sprites();
768      for (int i = 0; i < STIC_MOBS; i++)
768      for (int i = 0; i < STIC_MOBS; i++)
769769         m_sprite[i].collision = 0;
770770      // Copy the sprites to the background
771771      copy_sprites_to_background(m_bitmap);
772772      determine_sprite_collisions();
773      for (int i = 0; i < STIC_MOBS; i++)
773      for (int i = 0; i < STIC_MOBS; i++)
774774         m_stic_registers[STIC_MCR + i] |= m_sprite[i].collision;
775775      /* draw the screen borders if enabled */
776776      draw_borders(m_bitmap);
r23623r23624
951951         //logerror("unmapped write to STIC register %02X: %04X\n", offset, data);
952952         break;
953953   }
954   
954
955955   if (offset < sizeof(m_stic_registers) / sizeof(m_stic_registers[0]))
956956      m_stic_registers[offset] = data;
957957}
trunk/src/mess/video/stic.h
r23623r23624
476476   // construction/destruction
477477   stic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
478478   virtual ~stic_device();
479   
479
480480   DECLARE_READ16_MEMBER(read);
481481   DECLARE_READ16_MEMBER(gram_read);
482482   DECLARE_READ16_MEMBER(grom_read) { if (offset > 0x800) printf("help! %X\n", offset); return (0xff00 | m_grom_region->base()[offset]); }
r23623r23624
488488   int read_stic_handshake() { return m_stic_handshake; }
489489   void set_x_scale(int val) { m_x_scale = val; }
490490   void set_y_scale(int val) { m_y_scale = val; }
491   
491
492492   // device-level overrides
493493   virtual void device_start();
494494   virtual const rom_entry *device_rom_region() const;
495495   virtual void device_reset();
496   
496
497497   void screenrefresh();
498498   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
499499
500500private:
501   
501
502502   required_memory_region m_grom_region;
503503
504504   void intv_set_pixel(bitmap_ind16 &bitmap, int x, int y, UINT32 color);
r23623r23624
514514   void copy_sprites_to_background(bitmap_ind16 &bitmap);
515515   void render_background(bitmap_ind16 &bitmap);
516516   void draw_borders(bitmap_ind16 &bitmap);
517   
517
518518#ifdef UNUSED_CODE
519519   void draw_background(bitmap_ind16 &bitmap, int transparency);
520520   void draw_sprites(bitmap_ind16 &bitmap, int behind_foreground);
521521#endif
522     
522
523523   bitmap_ind16 m_bitmap;
524   
524
525525   intv_sprite_type m_sprite[STIC_MOBS];
526526   UINT8 m_sprite_buffers[STIC_MOBS][STIC_CARD_WIDTH * 2][STIC_CARD_HEIGHT * 4 * 2 * 2];
527527   UINT16 m_backtab_buffer[STIC_BACKTAB_HEIGHT][STIC_BACKTAB_WIDTH];
r23623r23624
539539
540540   UINT8 m_gramdirty;
541541   UINT8 m_gram[512];
542   UINT8 m_gramdirtybytes[512];   
542   UINT8 m_gramdirtybytes[512];
543543};
544544
545545// device type definition
trunk/src/mess/video/nick.c
r23623r23624
104104
105105nick_device::nick_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
106106   : device_t(mconfig, NICK, "NICK", tag, owner, clock, "nick", __FILE__),
107     device_memory_interface(mconfig, *this),
108     m_space_config("vram", ENDIANNESS_LITTLE, 8, 16, 0, *ADDRESS_MAP_NAME(nick_map)),
109     m_write_virq(*this),
110     horizontal_clock(0),
111     m_scanline_count(0),
112     m_FIXBIAS(0),
113     m_BORDER(0),
114     m_LPL(0),
115     m_LPH(0),
116     m_LD1(0),
117     m_LD2(0),
118     m_virq(CLEAR_LINE)
107      device_memory_interface(mconfig, *this),
108      m_space_config("vram", ENDIANNESS_LITTLE, 8, 16, 0, *ADDRESS_MAP_NAME(nick_map)),
109      m_write_virq(*this),
110      horizontal_clock(0),
111      m_scanline_count(0),
112      m_FIXBIAS(0),
113      m_BORDER(0),
114      m_LPL(0),
115      m_LPH(0),
116      m_LD1(0),
117      m_LD2(0),
118      m_virq(CLEAR_LINE)
119119{
120120}
121121
r23623r23624
243243
244244
245245//-------------------------------------------------
246//  fixbias_w -
246//  fixbias_w -
247247//-------------------------------------------------
248248
249249WRITE8_MEMBER( nick_device::fixbias_w )
r23623r23624
253253
254254
255255//-------------------------------------------------
256//  border_w -
256//  border_w -
257257//-------------------------------------------------
258258
259259WRITE8_MEMBER( nick_device::border_w )
r23623r23624
263263
264264
265265//-------------------------------------------------
266//  lpl_w -
266//  lpl_w -
267267//-------------------------------------------------
268268
269269WRITE8_MEMBER( nick_device::lpl_w )
r23623r23624
275275
276276
277277//-------------------------------------------------
278//  lph_w -
278//  lph_w -
279279//-------------------------------------------------
280280
281281WRITE8_MEMBER( nick_device::lph_w )
r23623r23624
287287
288288
289289//-------------------------------------------------
290//  initialize_palette -
290//  initialize_palette -
291291//-------------------------------------------------
292292
293293void nick_device::initialize_palette()
r23623r23624
305305   for (int i = 0; i < 256; i++)
306306   {
307307      /*
308     
308
309309          bit     description
310     
310
311311          PC0     100R -- RED
312312          PC1     100R -- GREEN
313313          PC2      82R -- BLUE
r23623r23624
316316          PC5     220R -- BLUE
317317          PC6     470R -- RED
318318          PC7     470R -- GREEN
319     
319
320320      */
321321
322322      int ra = BIT(i, 0);
r23623r23624
340340   for (int i = 0; i < 256; i++)
341341   {
342342      int pen_index;
343     
343
344344      pen_index = (BIT(i, 7) << 0) | (BIT(i, 3) << 1);
345345      m_pen_idx_4col[i] = pen_index;
346     
346
347347      pen_index =  (BIT(i, 7) << 0) | (BIT(i, 3) << 1) |  (BIT(i, 5) << 2) | (BIT(i, 1) << 3);
348348      m_pen_idx_16col[i] = pen_index;
349349   }
r23623r23624
437437   int col_index[2];
438438   int pen_index;
439439   UINT8 data = data_byte;
440   
440
441441   col_index[0] = get_color_index(pen0);
442442   col_index[1] = get_color_index(pen1);
443   
443
444444   for (int i = 0; i < 8; i++)
445445   {
446446      pen_index = col_index[BIT(data, 7)];
trunk/src/mess/video/nick.h
r23623r23624
6666// ======================> nick_device
6767
6868class nick_device :  public device_t,
69                public device_memory_interface
69                  public device_memory_interface
7070{
7171public:
7272   // construction/destruction
r23623r23624
132132   UINT8 horizontal_clock;
133133   /* current scanline within LPT */
134134   UINT8 m_scanline_count;
135   
135
136136   UINT8 m_FIXBIAS;
137137   UINT8 m_BORDER;
138138   UINT8 m_LPL;
139139   UINT8 m_LPH;
140   
140
141141   UINT16 m_LD1;
142142   UINT16 m_LD2;
143   
143
144144   LPT_ENTRY   m_LPT;
145   
145
146146   UINT32 *m_dest;
147147   int m_dest_pos;
148148   int m_dest_max_pos;
149   
149
150150   UINT8 m_reg[4];
151   
151
152152   /* first clock visible on left hand side */
153153   int m_first_visible_clock;
154154   /* first clock visible on right hand side */
155155   int m_last_visible_clock;
156   
156
157157   /* given a bit pattern, this will get the pen index */
158158   UINT8 m_pen_idx_4col[256];
159159   /* given a bit pattern, this will get the pen index */
trunk/src/mess/video/gf4500.c
r23623r23624
7474{
7575   m_screen_x = m_screen_y = 0;
7676   m_screen_x_max = m_screen_y_max = m_screen_x_min = m_screen_y_min = 0;
77}   
77}
7878
7979
8080void gf4500_device::vram_write16( UINT16 data )
r23623r23624
180180      }
181181   }
182182}
183
trunk/src/mess/video/gf4500.h
r23623r23624
1515public:
1616   gf4500_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
1717   ~gf4500_device() {}
18   
19   
18
19
2020   DECLARE_READ32_MEMBER( read );
2121   DECLARE_WRITE32_MEMBER( write );
2222
r23623r23624
2727   virtual void device_config_complete();
2828   virtual void device_start();
2929   virtual void device_reset();
30   
31private:   
30
31private:
3232   // internal state
3333
3434   void vram_write16(UINT16 data);
35   
35
3636   UINT32 *m_data;
3737   int m_screen_x;
3838   int m_screen_y;
trunk/src/mess/video/newport.c
r23623r23624
102102void newport_video_device::device_start()
103103{
104104   m_base = auto_alloc_array_clear(machine(), UINT32, (1280+64) * (1024+64));
105   
105
106106   save_pointer(NAME(m_base), (1280+64) * (1024+64));
107107   save_item(NAME(m_VC2.nRegister));
108108   save_item(NAME(m_VC2.nRAM));
r23623r23624
203203   m_REX3.nDrawMode0 = 0x00000000;
204204   m_REX3.nDrawMode1 = 0x3002f001;
205205   m_REX3.nDCBMode = 0x00000780;
206   m_REX3.nKludge_SkipLine = 0;   
207}   
206   m_REX3.nKludge_SkipLine = 0;
207}
208208
209209
210210UINT32 newport_video_device::screen_update(screen_device &device, bitmap_rgb32 &bitmap, const rectangle &cliprect)
r23623r23624
214214   {
215215      UINT32 *src = &m_base[1344 * y];
216216      UINT32 *dest = &bitmap.pix32(y, cliprect.min_x);
217     
217
218218      /* loop over columns */
219219      for (int x = cliprect.min_x; x < cliprect.max_x; x++)
220220      {
trunk/src/mess/includes/sg1000.h
r23623r23624
2929#define UPD9255_1_TAG   "upd9255_1"
3030#define CENTRONICS_TAG  "centronics"
3131#define TMS9918A_TAG    "tms9918a"
32#define RS232_TAG      "rs232"
33#define CARTSLOT_TAG   "slot"
32#define RS232_TAG       "rs232"
33#define CARTSLOT_TAG    "slot"
3434
3535
3636INPUT_PORTS_EXTERN( sk1100 );
trunk/src/mess/includes/victor9k.h
r23623r23624
4343#define M6522_4_TAG     "1f"
4444#define M6522_5_TAG     "1k"
4545#define M6522_6_TAG     "1h"
46#define DAC0808_0_TAG   "5b"
47#define DAC0808_1_TAG   "5c"
46#define DAC0808_0_TAG   "5b"
47#define DAC0808_1_TAG   "5c"
4848#define CENTRONICS_TAG  "centronics"
4949#define RS232_A_TAG     "rs232a"
5050#define RS232_B_TAG     "rs232b"
r23623r23624
203203   int m_rdy1;
204204   int m_ds0;
205205   int m_ds1;
206   UINT8 m_lms;                          /* motor speed */
206   UINT8 m_lms;                         /* motor speed */
207207   int m_st[2];                        /* stepper phase */
208208   int m_stp[2];                        /* stepper enable */
209209   int m_drive;                        /* selected drive */
trunk/src/mess/includes/tandy2k.h
r23623r23624
3535#define WD1010_TAG      "u18"
3636#define WD1100_11_TAG   "u12"
3737#define CENTRONICS_TAG  "centronics"
38#define RS232_TAG      "rs232"
38#define RS232_TAG       "rs232"
3939
4040class tandy2k_state : public driver_device
4141{
trunk/src/mess/includes/gba.h
r23623r23624
265265
266266   inline void update_mask(UINT8* mask, int mode, int submode, UINT32* obj_win, UINT8 inwin0, UINT8 inwin1, UINT8 in0_mask, UINT8 in1_mask, UINT8 out_mask);
267267   void draw_modes(int mode, int submode, int y, UINT32* line0, UINT32* line1, UINT32* line2, UINT32* line3, UINT32* lineOBJ, UINT32* lineOBJWin, UINT32* lineMix, int bpp);
268   
268
269269protected:
270270   required_memory_region m_region_maincpu;
271271   required_ioport m_io_in0;
trunk/src/mess/includes/superslave.h
r23623r23624
1313#include "machine/z80dart.h"
1414#include "machine/z80pio.h"
1515
16#define Z80_TAG        "u45"
17#define Z80DART_0_TAG   "u14"
18#define Z80DART_1_TAG   "u30"
19#define Z80PIO_TAG      "u43"
20#define AM9519_TAG      "u13"
21#define BR1941_TAG      "u12"
16#define Z80_TAG         "u45"
17#define Z80DART_0_TAG   "u14"
18#define Z80DART_1_TAG   "u30"
19#define Z80PIO_TAG      "u43"
20#define AM9519_TAG      "u13"
21#define BR1941_TAG      "u12"
2222#define RS232_A_TAG     "rs232a"
2323#define RS232_B_TAG     "rs232b"
2424#define RS232_C_TAG     "rs232c"
r23623r23624
2929public:
3030   superslave_state(const machine_config &mconfig, device_type type, const char *tag)
3131      : driver_device(mconfig, type, tag),
32        m_maincpu(*this, Z80_TAG),
33        m_dart0(*this, Z80DART_0_TAG),
34        m_dart1(*this, Z80DART_1_TAG),
35        m_dbrg(*this, BR1941_TAG),
36        m_ram(*this, RAM_TAG),
37        m_rs232a(*this, RS232_A_TAG),
38        m_rs232b(*this, RS232_B_TAG),
39        m_rs232c(*this, RS232_C_TAG),
40        m_rs232d(*this, RS232_D_TAG),
41        m_rom(*this, Z80_TAG),
42        m_memctrl(0x01),
43        m_cmd(0x01)
32         m_maincpu(*this, Z80_TAG),
33         m_dart0(*this, Z80DART_0_TAG),
34         m_dart1(*this, Z80DART_1_TAG),
35         m_dbrg(*this, BR1941_TAG),
36         m_ram(*this, RAM_TAG),
37         m_rs232a(*this, RS232_A_TAG),
38         m_rs232b(*this, RS232_B_TAG),
39         m_rs232c(*this, RS232_C_TAG),
40         m_rs232d(*this, RS232_D_TAG),
41         m_rom(*this, Z80_TAG),
42         m_memctrl(0x01),
43         m_cmd(0x01)
4444   { }
4545
4646   required_device<cpu_device> m_maincpu;
trunk/src/mess/includes/vixen.h
r23623r23624
2020#define P8251A_TAG      "c3"
2121#define DISCRETE_TAG    "discrete"
2222#define SCREEN_TAG      "screen"
23#define RS232_TAG      "rs232"
23#define RS232_TAG       "rs232"
2424
2525class vixen_state : public driver_device
2626{
trunk/src/mess/includes/mac.h
r23623r23624
152152public:
153153   mac_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
154154   ~mac_sound_device() {}
155   
155
156156   void enable_sound(int on);
157157   void set_sound_buffer(int buffer);
158158   void set_volume(int volume);
r23623r23624
167167   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
168168private:
169169   // internal state
170   
170
171171   ram_device *m_ram;
172172   model_t m_mac_model;
173173
trunk/src/mess/includes/wangpc.h
r23623r23624
3636#define SCN2661_TAG     "scn2661"
3737#define UPD765_TAG      "upd765"
3838#define CENTRONICS_TAG  "centronics"
39#define RS232_TAG      "rs232"
39#define RS232_TAG       "rs232"
4040
4141class wangpc_state : public driver_device
4242{
trunk/src/mess/includes/ep64.h
r23623r23624
2424#include "video/nick.h"
2525
2626#define Z80_TAG         "u1"
27#define DAVE_TAG      "u3"
28#define NICK_TAG      "u4"
29#define CENTRONICS_TAG   "centronics"
30#define RS232_TAG      "rs232"
31#define CASSETTE1_TAG   "cassette1"
32#define CASSETTE2_TAG   "cassette2"
33#define SCREEN_TAG      "screen"
27#define DAVE_TAG        "u3"
28#define NICK_TAG        "u4"
29#define CENTRONICS_TAG  "centronics"
30#define RS232_TAG       "rs232"
31#define CASSETTE1_TAG   "cassette1"
32#define CASSETTE2_TAG   "cassette2"
33#define SCREEN_TAG      "screen"
3434
3535class ep64_state : public driver_device
3636{
3737public:
3838   ep64_state(const machine_config &mconfig, device_type type, const char *tag)
3939      : driver_device(mconfig, type, tag),
40        m_maincpu(*this, Z80_TAG),
41        m_dave(*this, DAVE_TAG),
42        m_nick(*this, NICK_TAG),
43        m_centronics(*this, CENTRONICS_TAG),
44        m_rs232(*this, RS232_TAG),
45        m_cassette1(*this, CASSETTE1_TAG),
46        m_cassette2(*this, CASSETTE2_TAG),
47        m_ram(*this, RAM_TAG),
48        m_rom(*this, Z80_TAG),
49        m_y0(*this, "Y0"),
50        m_y1(*this, "Y1"),
51        m_y2(*this, "Y2"),
52        m_y3(*this, "Y3"),
53        m_y4(*this, "Y4"),
54        m_y5(*this, "Y5"),
55        m_y6(*this, "Y6"),
56        m_y7(*this, "Y7"),
57        m_y8(*this, "Y8"),
58        m_y9(*this, "Y9")
40         m_maincpu(*this, Z80_TAG),
41         m_dave(*this, DAVE_TAG),
42         m_nick(*this, NICK_TAG),
43         m_centronics(*this, CENTRONICS_TAG),
44         m_rs232(*this, RS232_TAG),
45         m_cassette1(*this, CASSETTE1_TAG),
46         m_cassette2(*this, CASSETTE2_TAG),
47         m_ram(*this, RAM_TAG),
48         m_rom(*this, Z80_TAG),
49         m_y0(*this, "Y0"),
50         m_y1(*this, "Y1"),
51         m_y2(*this, "Y2"),
52         m_y3(*this, "Y3"),
53         m_y4(*this, "Y4"),
54         m_y5(*this, "Y5"),
55         m_y6(*this, "Y6"),
56         m_y7(*this, "Y7"),
57         m_y8(*this, "Y8"),
58         m_y9(*this, "Y9")
5959   { }
6060
6161   required_device<cpu_device> m_maincpu;
r23623r23624
8080
8181   virtual void machine_start();
8282   virtual void machine_reset();
83   
83
8484   DECLARE_READ8_MEMBER( rd0_r );
8585   DECLARE_WRITE8_MEMBER( wr0_w );
8686   DECLARE_READ8_MEMBER( rd1_r );
trunk/src/mess/includes/v1050.h
r23623r23624
4343#define TIMER_ACK_TAG           "timer_ack"
4444#define TIMER_RST_TAG           "timer_rst"
4545#define SASIBUS_TAG             "sasi"
46#define RS232_TAG            "rs232"
46#define RS232_TAG               "rs232"
4747
4848#define V1050_VIDEORAM_SIZE     0x8000
4949#define V1050_VIDEORAM_MASK     0x7fff
trunk/src/mess/includes/bw12.h
r23623r23624
2828#define AY3600PRO002_TAG    "ic74"
2929#define CENTRONICS_TAG      "centronics"
3030#define FLOPPY_TIMER_TAG    "motor_off"
31#define RS232_A_TAG        "rs232a"
32#define RS232_B_TAG        "rs232b"
31#define RS232_A_TAG         "rs232a"
32#define RS232_B_TAG         "rs232b"
3333
3434#define BW12_VIDEORAM_MASK  0x7ff
3535#define BW12_CHARROM_MASK   0xfff
trunk/src/mess/includes/pc1512.h
r23623r23624
3636#define SPEAKER_TAG     "speaker"
3737#define ISA_BUS_TAG     "isa"
3838#define SCREEN_TAG      "screen"
39#define RS232_TAG      "rs232"
39#define RS232_TAG       "rs232"
4040
4141class pc1512_state : public driver_device
4242{
trunk/src/mess/includes/sms.h
r23623r23624
102102   device_t *m_left_lcd;
103103   device_t *m_right_lcd;
104104   address_space *m_space;
105   
105
106106   UINT8 m_bios_page_count;
107107   UINT8 m_fm_detect;
108108   UINT8 m_ctrl_reg;
r23623r23624
113113   UINT8 m_input_port0;
114114   UINT8 m_input_port1;
115115   UINT8 m_gg_sio[5];
116   
116
117117   // [0] for 0x400-0x3fff, [1] for 0x4000-0x7fff, [2] for 0x8000-0xffff, [3] for 0x0000-0x0400
118118   int m_bank_enabled[4];
119119   UINT8 m_bios_page[4];
120   
120
121121   // for gamegear LCD persistence hack
122122   bitmap_rgb32 m_prev_bitmap;
123123
r23623r23624
168168   UINT8 m_frame_sscope_state;
169169
170170   // these are only used by the Store Display unit, but we keep them here temporarily to avoid the need of separate start/reset
171   UINT8 m_store_control;   
171   UINT8 m_store_control;
172172   int m_current_cartridge;
173173   sega8_cart_slot_device *m_slots[16];
174174   sega8_card_slot_device *m_cards[16];
r23623r23624
241241   : sms_state(mconfig, type, tag),
242242   m_control_cpu(*this, "control")
243243   { }
244   
244
245245   required_device<cpu_device> m_control_cpu;
246246
247247   DECLARE_READ8_MEMBER(sms_store_cart_select_r);
r23623r23624
251251   DECLARE_READ8_MEMBER(sms_store_control_r);
252252   DECLARE_WRITE8_MEMBER(sms_store_control_w);
253253   DECLARE_DRIVER_INIT(smssdisp);
254   
254
255255   DECLARE_READ8_MEMBER(store_read_0000);
256256   DECLARE_READ8_MEMBER(store_read_4000);
257257   DECLARE_READ8_MEMBER(store_read_8000);
258258   DECLARE_READ8_MEMBER(store_cart_peek);
259259   DECLARE_WRITE8_MEMBER(store_write_cart);
260   
260
261261   DECLARE_WRITE_LINE_MEMBER(sms_store_int_callback);
262262};
263263
trunk/src/mess/includes/hx20.h
r23623r23624
1414#include "sound/speaker.h"
1515#include "rendlay.h"
1616
17#define HD6301V1_MAIN_TAG   "8g"
18#define HD6301V1_SLAVE_TAG   "6d"
19#define MC146818_TAG      "6g"
20#define UPD7227_0_TAG      "lcdc0"
21#define UPD7227_1_TAG      "lcdc1"
22#define UPD7227_2_TAG      "lcdc2"
23#define UPD7227_3_TAG      "lcdc3"
24#define UPD7227_4_TAG      "lcdc4"
25#define UPD7227_5_TAG      "lcdc5"
26#define SPEAKER_TAG         "speaker"
27#define CASSETTE_TAG      "cassette"
28#define RS232_TAG           "rs232"
29#define SCREEN_TAG         "screen"
17#define HD6301V1_MAIN_TAG   "8g"
18#define HD6301V1_SLAVE_TAG  "6d"
19#define MC146818_TAG        "6g"
20#define UPD7227_0_TAG       "lcdc0"
21#define UPD7227_1_TAG       "lcdc1"
22#define UPD7227_2_TAG       "lcdc2"
23#define UPD7227_3_TAG       "lcdc3"
24#define UPD7227_4_TAG       "lcdc4"
25#define UPD7227_5_TAG       "lcdc5"
26#define SPEAKER_TAG         "speaker"
27#define CASSETTE_TAG        "cassette"
28#define RS232_TAG           "rs232"
29#define SCREEN_TAG          "screen"
3030
3131class hx20_state : public driver_device
3232{
3333public:
3434   hx20_state(const machine_config &mconfig, device_type type, const char *tag)
3535      : driver_device(mconfig, type, tag),
36        m_maincpu(*this, HD6301V1_MAIN_TAG),
37        m_subcpu(*this, HD6301V1_SLAVE_TAG),
38        m_rtc(*this, MC146818_TAG),
39        m_lcdc0(*this, UPD7227_0_TAG),
40        m_lcdc1(*this, UPD7227_1_TAG),
41        m_lcdc2(*this, UPD7227_2_TAG),
42        m_lcdc3(*this, UPD7227_3_TAG),
43        m_lcdc4(*this, UPD7227_4_TAG),
44        m_lcdc5(*this, UPD7227_5_TAG),
45        m_speaker(*this, SPEAKER_TAG),
46        m_cassette(*this, CASSETTE_TAG),
47        m_rs232(*this, RS232_TAG),
48        m_sio(*this, "sio"),
49        m_ksc0(*this, "KSC0"),
50        m_ksc1(*this, "KSC1"),
51        m_ksc2(*this, "KSC2"),
52        m_ksc3(*this, "KSC3"),
53        m_ksc4(*this, "KSC4"),
54        m_ksc5(*this, "KSC5"),
55        m_ksc6(*this, "KSC6"),
56        m_ksc7(*this, "KSC7"),
57        m_sw6(*this, "SW6"),
58        m_slave_rx(1),
59        m_slave_tx(1),
60        m_slave_flag(1),
61        m_rtc_irq(CLEAR_LINE),
62        m_kbrequest(1)
36         m_maincpu(*this, HD6301V1_MAIN_TAG),
37         m_subcpu(*this, HD6301V1_SLAVE_TAG),
38         m_rtc(*this, MC146818_TAG),
39         m_lcdc0(*this, UPD7227_0_TAG),
40         m_lcdc1(*this, UPD7227_1_TAG),
41         m_lcdc2(*this, UPD7227_2_TAG),
42         m_lcdc3(*this, UPD7227_3_TAG),
43         m_lcdc4(*this, UPD7227_4_TAG),
44         m_lcdc5(*this, UPD7227_5_TAG),
45         m_speaker(*this, SPEAKER_TAG),
46         m_cassette(*this, CASSETTE_TAG),
47         m_rs232(*this, RS232_TAG),
48         m_sio(*this, "sio"),
49         m_ksc0(*this, "KSC0"),
50         m_ksc1(*this, "KSC1"),
51         m_ksc2(*this, "KSC2"),
52         m_ksc3(*this, "KSC3"),
53         m_ksc4(*this, "KSC4"),
54         m_ksc5(*this, "KSC5"),
55         m_ksc6(*this, "KSC6"),
56         m_ksc7(*this, "KSC7"),
57         m_sw6(*this, "SW6"),
58         m_slave_rx(1),
59         m_slave_tx(1),
60         m_slave_flag(1),
61         m_rtc_irq(CLEAR_LINE),
62         m_kbrequest(1)
6363   { }
6464
6565   required_device<cpu_device> m_maincpu;
trunk/src/mess/includes/abc1600.h
r23623r23624
4242#define BUS0X_TAG           "bus0x"
4343#define BUS1_TAG            "bus1"
4444#define BUS2_TAG            "bus2"
45#define RS232_A_TAG        "rs232a"
46#define RS232_B_TAG        "rs232b"
45#define RS232_A_TAG         "rs232a"
46#define RS232_B_TAG         "rs232b"
4747
4848
4949
trunk/src/mame/layout/speedbal.lay
r23623r23624
7575      <bezel name="digit10" element="digit">
7676         <bounds left="10" top="-20" right="20" bottom="-8" />
7777      </bezel>
78       <bezel name="digit20" element="digit">
78      <bezel name="digit20" element="digit">
7979         <bounds left="20" top="-20" right="30" bottom="-8" />
8080      </bezel>
81         <bezel name="digit30" element="digit">
81      <bezel name="digit30" element="digit">
8282         <bounds left="30" top="-20" right="40" bottom="-8" />
8383      </bezel>
8484      <bezel name="digit40" element="digit">
r23623r23624
193193
194194
195195   </view>
196   
196
197197</mamelayout>
trunk/src/mame/drivers/asteroid.c
r23623r23624
392392
393393static INPUT_PORTS_START( aerolitos )
394394   PORT_INCLUDE( asteroid )
395   
395
396396   PORT_MODIFY("DSW1") // this bootleg was for the Spanish market, so set it to Spanish by default
397397   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Language ) ) PORT_DIPLOCATION("SW:1,2")
398398   PORT_DIPSETTING (   0x00, DEF_STR( English ) )
trunk/src/mame/drivers/mil4000.c
r23623r23624
502502
503503  Sound: 1x U6295 (U53)
504504
505  RAM:  2x 6116.
505  RAM:  2x 6116.
506506        2x 6264 (prg RAM)
507507        2x 62256 (near battery)
508508
r23623r23624
518518
519519*/
520520ROM_START( top21 )
521   ROM_REGION( 0x100000, "maincpu", 0 )   // 68000 code
521   ROM_REGION( 0x100000, "maincpu", 0 )    // 68000 code
522522   ROM_LOAD16_BYTE( "odd_1-2.u75",  0x000001, 0x80000, CRC(ce4f2a74) SHA1(f9a9043da924ddba16f49d6856dbcfd8f066c824) )
523523   ROM_LOAD16_BYTE( "even_1-2.u76", 0x000000, 0x80000, CRC(8d645456) SHA1(06c59816f259168f15503b276fc28c947e17cc60) )
524   ROM_COPY( "maincpu",            0x080000, 0x00000, 0x80000 )   // copying the second halves to the right offset
524   ROM_COPY( "maincpu",            0x080000, 0x00000, 0x80000 )    // copying the second halves to the right offset
525525
526526   ROM_REGION( 0xa0000, "gfx1", 0 )
527527   ROM_LOAD( "36.u36",     0x000000, 0x20000, CRC(071883f7) SHA1(16b5c251975394bb94c0d32277912ea99280c21c) )
528   ROM_LOAD( "35.u35",     0x020000, 0x20000, CRC(cdc8cc44) SHA1(ce703e7f050465b1bc07800eb84eb7f127ebbddb) )   // double size. 2nd half empty
528   ROM_LOAD( "35.u35",     0x020000, 0x20000, CRC(cdc8cc44) SHA1(ce703e7f050465b1bc07800eb84eb7f127ebbddb) )   // double size. 2nd half empty
529529   ROM_IGNORE(                       0x20000)
530530   ROM_LOAD( "34.u34",     0x040000, 0x20000, CRC(bdbe7360) SHA1(3038f66d57a43afea9d6c05908bfb50167a881c2) )
531531   ROM_LOAD( "33.u33",     0x060000, 0x20000, CRC(670584b0) SHA1(23772404b5e5066828c59d9baa03b732a80db676) )
532532   ROM_LOAD( "32.u32",     0x080000, 0x20000, CRC(c5bc3950) SHA1(aebaae91ade0c221ba14186fde78206996cdec30) )
533533
534   ROM_REGION( 0x80000, "oki", 0 )   // 6295 samples (first half empty)
534   ROM_REGION( 0x80000, "oki", 0 ) // 6295 samples (first half empty)
535535   ROM_LOAD( "audio.u64",  0x00000, 0x80000, CRC(4f70a9bc) SHA1(83f0664eadf923ed45e3e18bfcefafb85163c4a0) )
536   ROM_COPY( "oki",        0x40000, 0x00000, 0x40000 )   // copying the second half to the right offset
536   ROM_COPY( "oki",        0x40000, 0x00000, 0x40000 ) // copying the second half to the right offset
537537
538   ROM_REGION( 0x4000, "mcu", 0 )   // MCU code
538   ROM_REGION( 0x4000, "mcu", 0 )  // MCU code
539539   ROM_LOAD( "pic16c65b_top21.u60", 0x0000, 0x4000, NO_DUMP )
540540
541   ROM_REGION( 0x10000, "nvram", 0 )   // default NVRAM (2x 62256)
541   ROM_REGION( 0x10000, "nvram", 0 )   // default NVRAM (2x 62256)
542542   ROM_LOAD( "top21_nvram.bin", 0x00000, 0x10000, CRC(638726ce) SHA1(c55c77df5fbddfb19acf50f1b4467c63c818d5e7) )
543543ROM_END
544544
trunk/src/mame/drivers/ddealer.c
r23623r23624
11/*********************************************************************************************************
22
3   Double Dealer (c)NMK 1991
3    Double Dealer (c)NMK 1991
44
5   driver by Angelo Salese & David Haywood, based on early work by Tomasz Slanina
5    driver by Angelo Salese & David Haywood, based on early work by Tomasz Slanina
66
7   Appears to be a down-grade of the nmk16 HW
7    Appears to be a down-grade of the nmk16 HW
88
9   TODO:
10   -When you use the "gun card" the game gives "minus" points,but points are always added,inaccurate protection?
11   -Understand better the video emulation and convert it to tilemaps;
12   -A Double Dealer manual is needed for the coinage settings and coin/credit simulation;
13   -Decap + emulate MCU, required if the random number generation is going to be accurate;
9    TODO:
10    -When you use the "gun card" the game gives "minus" points,but points are always added,inaccurate protection?
11    -Understand better the video emulation and convert it to tilemaps;
12    -A Double Dealer manual is needed for the coinage settings and coin/credit simulation;
13    -Decap + emulate MCU, required if the random number generation is going to be accurate;
1414
1515==========================================================================================================
16   --
16    --
1717
18   pcb marked  GD91071
18    pcb marked  GD91071
1919
20   68000P10
21   YM2203C
22   91071-3 (Mask ROM)
23   NMK-110 8131 ( Mitsubishi M50747 MCU ?)
24   NMK 901
25   NMK 902
26   NMK 903 x2
27   82S135N ("5")
28   82S129N ("6")
29   xtals 16.000 MHz and  6.000 MHz
30   DSW x2
20    68000P10
21    YM2203C
22    91071-3 (Mask ROM)
23    NMK-110 8131 ( Mitsubishi M50747 MCU ?)
24    NMK 901
25    NMK 902
26    NMK 903 x2
27    82S135N ("5")
28    82S129N ("6")
29    xtals 16.000 MHz and  6.000 MHz
30    DSW x2
3131
32   --
32    --
3333
34   Few words about protection:
34    Few words about protection:
3535
36   - Work RAM at $fe000 - $fffff is shared with MCU . Maybe whole $f0000-$fffff is shared ...
37   - After boot, game writes random-looking data to work RAM:
36    - Work RAM at $fe000 - $fffff is shared with MCU . Maybe whole $f0000-$fffff is shared ...
37    - After boot, game writes random-looking data to work RAM:
3838
39   00052C: 33FC 1234 000F E086        move.w  #$1234, $fe086.l
40   000534: 33FC 5678 000F E164        move.w  #$5678, $fe164.l
41   00053C: 33FC 9CA3 000F E62E        move.w  #$9ca3, $fe62e.l
42   000544: 33FC ABA2 000F E734        move.w  #$aba2, $fe734.l
43   00054C: 33FC B891 000F E828        move.w  #$b891, $fe828.l
44   000554: 33FC C760 000F E950        move.w  #$c760, $fe950.l
45   00055C: 33FC D45F 000F EA7C        move.w  #$d45f, $fea7c.l
46   000564: 33FC E32E 000F ED4A        move.w  #$e32e, $fed4a.l
39    00052C: 33FC 1234 000F E086        move.w  #$1234, $fe086.l
40    000534: 33FC 5678 000F E164        move.w  #$5678, $fe164.l
41    00053C: 33FC 9CA3 000F E62E        move.w  #$9ca3, $fe62e.l
42    000544: 33FC ABA2 000F E734        move.w  #$aba2, $fe734.l
43    00054C: 33FC B891 000F E828        move.w  #$b891, $fe828.l
44    000554: 33FC C760 000F E950        move.w  #$c760, $fe950.l
45    00055C: 33FC D45F 000F EA7C        move.w  #$d45f, $fea7c.l
46    000564: 33FC E32E 000F ED4A        move.w  #$e32e, $fed4a.l
4747
48   Some (or maybe all ?) of above enables random generator at $fe010 - $fe017
48    Some (or maybe all ?) of above enables random generator at $fe010 - $fe017
4949
50   - There's also MCU response (write/read/test) test just after these writes.
51     (probably data used in the check depends on above writes). It's similar to
52     jalmah.c tests, but num of responses is different, and  shared ram is
53     used to communicate with MCU
50    - There's also MCU response (write/read/test) test just after these writes.
51      (probably data used in the check depends on above writes). It's similar to
52      jalmah.c tests, but num of responses is different, and  shared ram is
53      used to communicate with MCU
5454
55   - After last check (or maybe durning tests ... no idea)
56      MCU writes $4ef900000604 (jmp $604) to $fe000 and game jumps to this address.
55    - After last check (or maybe durning tests ... no idea)
56      MCU writes $4ef900000604 (jmp $604) to $fe000 and game jumps to this address.
5757
58   - code at $604  writes $20.w to $fe018 and $1.w to $fe01e.
59     As result shared ram $fe000 - $fe007 is cleared.
58    - code at $604  writes $20.w to $fe018 and $1.w to $fe01e.
59      As result shared ram $fe000 - $fe007 is cleared.
6060
61   Also many, many other reads/writes  from/to shared mem.
62   Few checks every interrupt:
61    Also many, many other reads/writes  from/to shared mem.
62    Few checks every interrupt:
6363
6464    interrupt, lvl1
6565
trunk/src/mame/drivers/statriv2.c
r23623r23624
8585      m_tms(*this, "tms"),
8686      m_videoram(*this, "videoram"),
8787      m_question_offset(*this, "question_offset")
88      { }
88         { }
8989
9090   required_device<cpu_device> m_maincpu;
9191   required_device<tms9927_device> m_tms;
trunk/src/mame/drivers/ambush.c
r23623r23624
286286
287287ROM_START( ambushh )
288288   ROM_REGION( 0x10000, "maincpu", 0 )
289   /* displays an M ("Mal" is Bad in Spanish) next to ROM 1 during the test, why is internal checksum wrong (0x02 instead of 0x00) ?
289   /* displays an M ("Mal" is Bad in Spanish) next to ROM 1 during the test, why is internal checksum wrong (0x02 instead of 0x00) ?
290290      I think the ROM has been hacked(?)
291291   */
292292   ROM_LOAD( "a1_hack.i7",    0x0000, 0x2000, CRC(a7cd149d) SHA1(470ebe60bc23a7908fb96caef8074d65f8c57625) )
293   // 1A6D:   0C -> 00
294   // 1A75:   18 -> 0D
295   // 1A76:   D5 -> 18
296   // 1A77:   00 -> D6
293   // 1A6D:    0C -> 00
294   // 1A75:    18 -> 0D
295   // 1A76:    D5 -> 18
296   // 1A77:    00 -> D6
297297
298298   ROM_LOAD( "a2.g7",    0x2000, 0x2000, CRC(8328d88a) SHA1(690f0af10a0550566b67ee570f849b2764448d15) )
299299   ROM_LOAD( "a3.f7",    0x4000, 0x2000, CRC(8db57ab5) SHA1(5cc7d7ebdfc91fb8d9ed52836d70c1de68001402) )
trunk/src/mame/drivers/gaplus.c
r23623r23624
272272{
273273   if(m_main_irq_mask)
274274      m_maincpu->set_input_line(0, ASSERT_LINE);
275   
275
276276   if (!m_namco58xx->read_reset_line())       /* give the cpu a tiny bit of time to write the command before processing it */
277277      timer_set(attotime::from_usec(50), TIMER_NAMCOIO_RUN, 1);
278   
278
279279   if (!m_namco56xx->read_reset_line())       /* give the cpu a tiny bit of time to write the command before processing it */
280280      timer_set(attotime::from_usec(50), TIMER_NAMCOIO_RUN, 0);
281281}
r23623r23624
960960DRIVER_INIT_MEMBER(gaplus_state,gaplus)
961961{
962962   UINT8 *rom;
963   
963
964964   rom = memregion("gfx1")->base();
965965   for (int i = 0;i < 0x2000;i++)
966966      rom[i + 0x2000] = rom[i] >> 4;
967   
967
968968   rom = memregion("gfx2")->base() + 0x6000;
969969   for (int i = 0;i < 0x2000;i++)
970970      rom[i + 0x2000] = rom[i] << 4;
971   
971
972972   m_type = GAME_GAPLUS;
973973}
974974
trunk/src/mame/drivers/maygayep.c
r23623r23624
66046604
66056605#define EP_TREAS_SOUND \
66066606   ROM_REGION( 0x100000, "ymz", 0 ) \
6607   ROM_LOAD( "treas1_6.s0", 0x000000, 0x080000, CRC(df792dc0) SHA1(96647eb579a3a60f1a4a2bea53d7a13030838437) )
6607   ROM_LOAD( "treas1_6.s0", 0x000000, 0x080000, CRC(df792dc0) SHA1(96647eb579a3a60f1a4a2bea53d7a13030838437) )
66086608
66096609ROM_START( ep_treas )
66106610   ROM_REGION( 0x080000, "maincpu", 0 )
trunk/src/mame/drivers/savquest.c
r23623r23624
423423            */
424424
425425            if ((data8 == 0x94)
426             || (data8 == 0x9e)
427             || (data8 == 0xa4)
428             || (data8 == 0xb2)
429             || (data8 == 0xbe)
430             || (data8 == 0xd0)
431               )
426               || (data8 == 0x9e)
427               || (data8 == 0xa4)
428               || (data8 == 0xb2)
429               || (data8 == 0xbe)
430               || (data8 == 0xd0)
431               )
432432            {
433433               return;
434434            }
435435
436436            if ((data8 == 0x8a)
437             || (data8 == 0x8e)
438             || (data8 == 0xca)
439             || (data8 == 0xd2)
440             || (data8 == 0xe2)
441             || (data8 == 0xf0)
442             || (data8 == 0xfc)
443               )
437               || (data8 == 0x8e)
438               || (data8 == 0xca)
439               || (data8 == 0xd2)
440               || (data8 == 0xe2)
441               || (data8 == 0xf0)
442               || (data8 == 0xfc)
443               )
444444            {
445445               /* someone with access to the actual dongle could dump the true values
446446                  I've never seen it so I just determined the relevant bits instead
r23623r23624
509509      }
510510
511511      if ((m_haspstate == HASPSTATE_PASSBEG)
512       && (data8 & 1)
513         )
512         && (data8 & 1)
513         )
514514      {
515515         m_hasp_tmppass[m_hasp_passind] = data8;
516516
trunk/src/mame/drivers/proconn.c
r23623r23624
55  what's the difference between the platforms, sound hardware?
66
77  Some early Proconn hardware was used for Maygay stuff, so this may be a bit of a mix.
8 
8
99  Error codes:
10 
11  ERROR   1   EPROM FAILED
12  ERROR   3   RAM CORRUPTION DETECTED (common on PC90 boards)
13  ERROR   10   RAM FAILURE
14  ERROR   20   METERS DISCONNECTED
15  ERROR   21   CASH IN METER FAIL
16  ERROR   22   CASH OUT METER FAIL
17  ERROR 25   REFILL METER FAIL
18  ERROR 30   REEL 1 FAIL
19  ERROR 31   REEL 2 FAIL
20  ERROR 32   REEL 3 FAIL
21  ERROR 99   SECURITY CARD MISSING OR FAILED, OR INCORRECT FOR PROGRAM
10
11  ERROR 1   EPROM FAILED
12  ERROR 3   RAM CORRUPTION DETECTED (common on PC90 boards)
13  ERROR 10  RAM FAILURE
14  ERROR 20  METERS DISCONNECTED
15  ERROR 21  CASH IN METER FAIL
16  ERROR 22  CASH OUT METER FAIL
17  ERROR 25  REFILL METER FAIL
18  ERROR 30  REEL 1 FAIL
19  ERROR 31  REEL 2 FAIL
20  ERROR 32  REEL 3 FAIL
21  ERROR 99  SECURITY CARD MISSING OR FAILED, OR INCORRECT FOR PROGRAM
2222*/
2323
2424
trunk/src/mame/drivers/seibuspi.c
r23623r23624
3030
3131      This code is also in the main PRG ROM at offset 0x1ffffc, even on single
3232      board games. Known regions are:
33   
33
3434          0x01 Japan
3535          0x10 US
3636          0x20 Taiwan
r23623r23624
951951
952952
953953static ADDRESS_MAP_START( base_map, AS_PROGRAM, 32, seibuspi_state )
954//   AM_RANGE(0x00000104, 0x00000107) AM_WRITENOP // ?
955//   AM_RANGE(0x00000108, 0x0000010b) AM_WRITENOP // ?
954//  AM_RANGE(0x00000104, 0x00000107) AM_WRITENOP // ?
955//  AM_RANGE(0x00000108, 0x0000010b) AM_WRITENOP // ?
956956   AM_RANGE(0x00000000, 0x000003ff) AM_RAM
957957   AM_RANGE(0x00000414, 0x00000417) AM_WRITENOP // bg gfx decryption key, see machine/seibuspi.c
958958   AM_RANGE(0x00000418, 0x0000041b) AM_READWRITE(spi_layer_bank_r, spi_layer_bank_w)
r23623r23624
10591059      m_z80_lastbank = bank;
10601060      membank("bank1")->set_entry(bank);
10611061   }
1062   
1062
10631063   // d3: watchdog?
10641064}
10651065
r23623r23624
10671067{
10681068   coin_counter_w(machine(), 0, data & 1);
10691069   coin_counter_w(machine(), 1, data & 2);
1070   
1070
10711071   // coin latch used by single boards
10721072   if (data)
10731073      m_sb_coin_latch = 0xa0 | data;
r23623r23624
19031903   MCFG_DEVICE_REMOVE("ds2404")
19041904
19051905   MCFG_EEPROM_ADD("eeprom", eeprom_intf)
1906   
1906
19071907   // Z80 is Z84C0006PCS instead of Z84C0008PEC
19081908   // clock is unknown, possibly slower than 7.159MHz
19091909MACHINE_CONFIG_END
trunk/src/mame/drivers/mazerbla.c
r23623r23624
2020 - four 'test button' style switches
2121 - one 4Mhz xtal @A1
2222 - this same board is shared with cliff hanger (clifhgr.c)
23
23
2424CFB-1000 - video/subcpu board
2525 - this board has a sub-cpu on it and four roms (six sockets for roms, two empty)
2626   - the roms go in sockets "ROM0"@G8, "ROM2"@K8, "ROM3"@K10, "ROM4"@K11
trunk/src/mame/drivers/stuntair.c
r23623r23624
149149      int b = (data&0xc0)>>6;
150150      int g = (data&0x38)>>3;
151151      int r = (data&0x07)>>0;
152     
152
153153      palette_set_color(machine,i,MAKE_RGB(r<<5,g<<5,b<<6));
154154   }
155155
trunk/src/mame/drivers/qix.c
r23623r23624
3131          The kram3 set used to be playable with the implementation in the MAME M6809
3232          CPU core, encrypting only the first byte in 10 xx and 11 xx opcodes.
3333          This should get a cleaner implementation. Until then, kram3 is broken on purpose.
34         
34
3535          According to the QIX and Kram schematics, these games should be using 68A90Es.
3636          The 6809E has a 'Last Instruction Cycle' pin that is likely tied in with the encryption:
3737          "LIC is HIGH during the last cycle of every instruction and its transition from
trunk/src/mame/drivers/alpha68k.c
r23623r23624
27512751
27522752ROM_START( skysoldrbl )
27532753   ROM_REGION( 0x80000, "maincpu", 0 )
2754   ROM_LOAD16_BYTE( "g.bin",     0x00000, 0x10000, CRC(4d3273e9) SHA1(7ddaba59114180fe371d2326fc49d6274e58f5c9) )   //different from other set
2755   ROM_LOAD16_BYTE( "c.bin",     0x00001, 0x10000, CRC(86c7af62) SHA1(4092558f3c11130e917d06b8d43f8f00815e4148) )   //different from other set
2754   ROM_LOAD16_BYTE( "g.bin",     0x00000, 0x10000, CRC(4d3273e9) SHA1(7ddaba59114180fe371d2326fc49d6274e58f5c9) )  //different from other set
2755   ROM_LOAD16_BYTE( "c.bin",     0x00001, 0x10000, CRC(86c7af62) SHA1(4092558f3c11130e917d06b8d43f8f00815e4148) )  //different from other set
27562756   ROM_LOAD16_BYTE( "e.bin",     0x20000, 0x10000, CRC(03115b75) SHA1(e36f2eab0198bf6b5b419aacc593b3790b479e81) )
27572757   ROM_LOAD16_BYTE( "a.bin",     0x20001, 0x10000, CRC(7aa103c7) SHA1(1907b92a3769089e01af36f74e0ff30e7a8f178c) )
27582758   ROM_LOAD16_BYTE( "h-gtop.bin",     0x40000, 0x10000, CRC(f41dfeab) SHA1(1b4f68c0f55e89a9dcd0fae8fb26074b97b5303a) )
27592759   ROM_LOAD16_BYTE( "d-ctop.bin",     0x40001, 0x10000, CRC(56560a3c) SHA1(c57c33d3935c23d56ae256981e4c3dcd80fb86a2) )
27602760   ROM_LOAD16_BYTE( "f-etop.bin",     0x60000, 0x10000, CRC(60a52583) SHA1(975d309ba55730c87cb5ea786c4d2d82358a1b73) )
27612761   ROM_LOAD16_BYTE( "b-atop.bin",     0x60001, 0x10000, CRC(028fd31b) SHA1(feb18a7217c107bb5f8e5c5ec5bc4173e977286b) )
2762   
2762
27632763   ROM_REGION( 0x80000, "audiocpu", 0 )   /* Sound CPU */
27642764   ROM_LOAD( "33.ic11",            0x00000, 0x08000, CRC(b711fad4) SHA1(0a9515cb36b8d03ee5f7e0669a9948571b4ec34e) )
27652765   ROM_CONTINUE(                0x18000, 0x08000 )
r23623r23624
27812781   ROM_LOAD( "30.ic43",         0x040000, 0x10000, CRC(9eb10d3d) SHA1(ba1445e2c166f72a67295d595990efbdd3460736) )
27822782   ROM_LOAD( "31.ic44",         0x050000, 0x10000, CRC(6b6c4e56) SHA1(1af79c5931be2eb1421172e6e7877a97681fdb84) )
27832783   ROM_LOAD( "32.ic45",         0x060000, 0x10000, CRC(fdf55eca) SHA1(0c61ab8fc60c69c4d3fa976976f42bda63c06549) )
2784   ROM_LOAD( "29.ic42",         0x070000, 0x10000, CRC(cf888369) SHA1(d1ef5b2c81bbf4e039cc6cfee8339700a1dbb4ca) )   //different from other set (is one of them bad?)
2784   ROM_LOAD( "29.ic42",         0x070000, 0x10000, CRC(cf888369) SHA1(d1ef5b2c81bbf4e039cc6cfee8339700a1dbb4ca) )  //different from other set (is one of them bad?)
27852785   ROM_LOAD( "18.ica1",         0x080000, 0x10000, CRC(08419273) SHA1(0ded4b60b0ce17a922fb7170f992c4f6c75be895) )
27862786   ROM_LOAD( "17.ic30",         0x090000, 0x10000, CRC(6258a61b) SHA1(d56a9f1dfa02dc59935f03b86a134076e3039bf4) )
27872787   ROM_LOAD( "20.ica3",         0x0a0000, 0x10000, CRC(5e716c62) SHA1(9427cd1578221ee48f4a8d8a24a232cb9e9b2206) )
r23623r23624
33773377GAME( 1987, btlfieldb, timesold, btlfieldb,      btlfieldb, alpha68k_state,btlfieldb,ROT90, "bootleg",                                           "Battle Field (bootleg)", GAME_SUPPORTS_SAVE )
33783378
33793379GAME( 1988, skysoldr,  0,        alpha68k_II,    skysoldr, alpha68k_state, skysoldr, ROT90, "Alpha Denshi Co. (SNK of America/Romstar license)", "Sky Soldiers (US)", GAME_SUPPORTS_SAVE )
3380GAME( 1988, skysoldrbl,skysoldr, alpha68k_II,    skysoldr, alpha68k_state, skysoldr, ROT90, "bootleg",                                  "Sky Soldiers (bootleg)", GAME_SUPPORTS_SAVE )
3380GAME( 1988, skysoldrbl,skysoldr, alpha68k_II,    skysoldr, alpha68k_state, skysoldr, ROT90, "bootleg",                                          "Sky Soldiers (bootleg)", GAME_SUPPORTS_SAVE )
33813381
33823382
33833383GAME( 1988, goldmedl,  0,        alpha68k_II_gm, goldmedl, alpha68k_state, goldmedl, ROT0,  "SNK",                                               "Gold Medalist (set 1)", GAME_SUPPORTS_SAVE )
trunk/src/mame/drivers/galaxold.c
r23623r23624
637637   AM_RANGE(0x6805, 0x6805) AM_DEVWRITE_LEGACY(GAL_AUDIO, galaxian_shoot_enable_w)
638638   AM_RANGE(0x6806, 0x6807) AM_DEVWRITE_LEGACY(GAL_AUDIO, galaxian_vol_w)
639639   AM_RANGE(0x7000, 0x7000) AM_READ_PORT("IN2") AM_WRITE(galaxold_nmi_enable_w)
640//   AM_RANGE(0x7001, 0x7001)
640//  AM_RANGE(0x7001, 0x7001)
641641   AM_RANGE(0x7002, 0x7002) AM_WRITE(galaxold_coin_counter_w)
642642   AM_RANGE(0x7003, 0x7003) AM_WRITE(scrambold_background_enable_w)
643643   AM_RANGE(0x7004, 0x7004) AM_WRITE(galaxold_stars_enable_w)
r23623r23624
645645   AM_RANGE(0x7007, 0x7007) AM_WRITE(galaxold_flip_screen_y_w)
646646   AM_RANGE(0x7800, 0x7800) AM_READ(watchdog_reset_r)
647647   AM_RANGE(0x7800, 0x7800) AM_DEVWRITE_LEGACY(GAL_AUDIO, galaxian_pitch_w)
648//   AM_RANGE(0x8102, 0x8102) AM_READ(scramblb_protection_1_r)
648//  AM_RANGE(0x8102, 0x8102) AM_READ(scramblb_protection_1_r)
649649   AM_RANGE(0x8202, 0x8202) AM_READ(scrambler_protection_2_r)
650650ADDRESS_MAP_END
651651
652652WRITE8_MEMBER( galaxold_state::guttang_rombank_w )
653653{
654//   printf("rombank %02x\n",data);
654//  printf("rombank %02x\n",data);
655655   if (data&1)
656656   {
657657      UINT8 *rom = memregion("maincpu")->base();
r23623r23624
21042104   PORT_DIPNAME( 0x40, 0x40, "IN1:7" )
21052105   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
21062106   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2107   PORT_DIPNAME( 0x80, 0x80, "IN1:8" )
2107   PORT_DIPNAME( 0x80, 0x80, "IN1:8" )
21082108   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
21092109   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
21102110
r23623r23624
21302130   PORT_DIPNAME( 0x40, 0x40, "IN2:7" )
21312131   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
21322132   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2133   PORT_DIPNAME( 0x80, 0x80, "IN2:8" )
2133   PORT_DIPNAME( 0x80, 0x80, "IN2:8" )
21342134   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
21352135   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
21362136INPUT_PORTS_END
r23623r23624
23682368   /* video hardware */
23692369   MCFG_PALETTE_LENGTH(32+2+64+1)  /* 32 for the characters, 2 for the bullets, 64 for the stars, 1 for background */
23702370
2371//   MCFG_PALETTE_INIT_OVERRIDE(galaxold_state,scrambold)
2371//  MCFG_PALETTE_INIT_OVERRIDE(galaxold_state,scrambold)
23722372   MCFG_VIDEO_START_OVERRIDE(galaxold_state,mooncrst)
23732373MACHINE_CONFIG_END
23742374
r23623r23624
32823282   ROM_REGION( 0x2000, "gfx1", 0 )
32833283   ROM_LOAD( "gg9-2732.rom",           0x0000, 0x1000, CRC(be6bf522) SHA1(23a09409b7de4bfdb970e4ff23d89a2439a0aee5) )
32843284   ROM_LOAD( "gg10-2732.rom",          0x1000, 0x1000, CRC(b04c34c5) SHA1(a37db70ce67d64daa5f0c41cce1136d1c9d8c175) )
3285   
3285
32863286   ROM_REGION( 0x0020, "proms", 0 ) // no PROM was present..
32873287   ROM_LOAD( "mmi6331.6l", 0x0000, 0x0020, BAD_DUMP CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
32883288ROM_END
trunk/src/mame/drivers/firebeat.c
r23623r23624
193193
194194   UINT8 m_extend_board_irq_enable;
195195   UINT8 m_extend_board_irq_active;
196//   emu_timer *m_keyboard_timer;
196//  emu_timer *m_keyboard_timer;
197197   GCU_REGS m_gcu[2];
198198   int m_tick;
199199   int m_layer;
r23623r23624
209209   UINT8 m_temp_data[64*1024];
210210   int m_cab_data_ptr;
211211   const int * m_cur_cab_data;
212//   int m_keyboard_state[2];
212//  int m_keyboard_state[2];
213213   UINT8 m_spu_shared_ram[0x400];
214214   IBUTTON m_ibutton;
215215   int m_ibutton_state;
r23623r23624
239239   DECLARE_WRITE32_MEMBER(atapi_command_w);
240240   DECLARE_READ32_MEMBER(atapi_control_r);
241241   DECLARE_WRITE32_MEMBER(atapi_control_w);
242//   DECLARE_READ32_MEMBER(comm_uart_r);
243//   DECLARE_WRITE32_MEMBER(comm_uart_w);
242//  DECLARE_READ32_MEMBER(comm_uart_r);
243//  DECLARE_WRITE32_MEMBER(comm_uart_w);
244244   DECLARE_READ32_MEMBER(cabinet_r);
245245   DECLARE_READ32_MEMBER(keyboard_wheel_r);
246246   DECLARE_READ8_MEMBER(midi_uart_r);
r23623r23624
257257   DECLARE_READ32_MEMBER(ppc_spu_share_r);
258258   DECLARE_WRITE32_MEMBER(ppc_spu_share_w);
259259   DECLARE_READ16_MEMBER(spu_unk_r);
260//   TIMER_CALLBACK_MEMBER(keyboard_timer_callback);
260//  TIMER_CALLBACK_MEMBER(keyboard_timer_callback);
261261   void gcu_draw_object(bitmap_ind16 &bitmap, const rectangle &cliprect, int chip, UINT32 *cmd);
262262   void gcu_fill_rect(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT32 *cmd);
263263   void gcu_draw_character(bitmap_ind16 &bitmap, const rectangle &cliprect, int chip, UINT32 *cmd);
r23623r23624
14041404/*
14051405READ32_MEMBER(firebeat_state::comm_uart_r )
14061406{
1407   UINT32 r = 0;
1407    UINT32 r = 0;
14081408
1409   if (ACCESSING_BITS_24_31)
1410   {
1411      r |= pc16552d_0_r(space, (offset*4)+0) << 24;
1412   }
1413   if (ACCESSING_BITS_16_23)
1414   {
1415      r |= pc16552d_0_r(space, (offset*4)+1) << 16;
1416   }
1417   if (ACCESSING_BITS_8_15)
1418   {
1419      r |= pc16552d_0_r(space, (offset*4)+2) << 8;
1420   }
1421   if (ACCESSING_BITS_0_7)
1422   {
1423      r |= pc16552d_0_r(space, (offset*4)+3) << 0;
1424   }
1409    if (ACCESSING_BITS_24_31)
1410    {
1411        r |= pc16552d_0_r(space, (offset*4)+0) << 24;
1412    }
1413    if (ACCESSING_BITS_16_23)
1414    {
1415        r |= pc16552d_0_r(space, (offset*4)+1) << 16;
1416    }
1417    if (ACCESSING_BITS_8_15)
1418    {
1419        r |= pc16552d_0_r(space, (offset*4)+2) << 8;
1420    }
1421    if (ACCESSING_BITS_0_7)
1422    {
1423        r |= pc16552d_0_r(space, (offset*4)+3) << 0;
1424    }
14251425
1426   return r;
1426    return r;
14271427}
14281428
14291429WRITE32_MEMBER(firebeat_state::comm_uart_w )
14301430{
1431   if (ACCESSING_BITS_24_31)
1432   {
1433      pc16552d_0_w(space, (offset*4)+0, (data >> 24) & 0xff);
1434   }
1435   if (ACCESSING_BITS_16_23)
1436   {
1437      pc16552d_0_w(space, (offset*4)+1, (data >> 16) & 0xff);
1438   }
1439   if (ACCESSING_BITS_8_15)
1440   {
1441      pc16552d_0_w(space, (offset*4)+2, (data >> 8) & 0xff);
1442   }
1443   if (ACCESSING_BITS_0_7)
1444   {
1445      pc16552d_0_w(space, (offset*4)+3, (data >> 0) & 0xff);
1446   }
1431    if (ACCESSING_BITS_24_31)
1432    {
1433        pc16552d_0_w(space, (offset*4)+0, (data >> 24) & 0xff);
1434    }
1435    if (ACCESSING_BITS_16_23)
1436    {
1437        pc16552d_0_w(space, (offset*4)+1, (data >> 16) & 0xff);
1438    }
1439    if (ACCESSING_BITS_8_15)
1440    {
1441        pc16552d_0_w(space, (offset*4)+2, (data >> 8) & 0xff);
1442    }
1443    if (ACCESSING_BITS_0_7)
1444    {
1445        pc16552d_0_w(space, (offset*4)+3, (data >> 0) & 0xff);
1446    }
14471447}
14481448
14491449static void comm_uart_irq_callback(running_machine &machine, int channel, int value)
14501450{
1451   // TODO
1452   //m_maincpu->set_input_line(INPUT_LINE_IRQ2, ASSERT_LINE);
1451    // TODO
1452    //m_maincpu->set_input_line(INPUT_LINE_IRQ2, ASSERT_LINE);
14531453}
14541454*/
14551455static const ins8250_interface firebeat_com0_interface =
r23623r23624
15691569/*
15701570static const int keyboard_notes[24] =
15711571{
1572   0x3c,   // C1
1573   0x3d,   // C1#
1574   0x3e,   // D1
1575   0x3f,   // D1#
1576   0x40,   // E1
1577   0x41,   // F1
1578   0x42,   // F1#
1579   0x43,   // G1
1580   0x44,   // G1#
1581   0x45,   // A1
1582   0x46,   // A1#
1583   0x47,   // B1
1584   0x48,   // C2
1585   0x49,   // C2#
1586   0x4a,   // D2
1587   0x4b,   // D2#
1588   0x4c,   // E2
1589   0x4d,   // F2
1590   0x4e,   // F2#
1591   0x4f,   // G2
1592   0x50,   // G2#
1593   0x51,   // A2
1594   0x52,   // A2#
1595   0x53,   // B2
1572    0x3c,   // C1
1573    0x3d,   // C1#
1574    0x3e,   // D1
1575    0x3f,   // D1#
1576    0x40,   // E1
1577    0x41,   // F1
1578    0x42,   // F1#
1579    0x43,   // G1
1580    0x44,   // G1#
1581    0x45,   // A1
1582    0x46,   // A1#
1583    0x47,   // B1
1584    0x48,   // C2
1585    0x49,   // C2#
1586    0x4a,   // D2
1587    0x4b,   // D2#
1588    0x4c,   // E2
1589    0x4d,   // F2
1590    0x4e,   // F2#
1591    0x4f,   // G2
1592    0x50,   // G2#
1593    0x51,   // A2
1594    0x52,   // A2#
1595    0x53,   // B2
15961596};
15971597
15981598TIMER_CALLBACK_MEMBER(firebeat_state::keyboard_timer_callback)
15991599{
1600   static const int kb_uart_channel[2] = { 1, 0 };
1601   static const char *const keynames[] = { "KEYBOARD_P1", "KEYBOARD_P2" };
1602   int keyboard;
1603   int i;
1600    static const int kb_uart_channel[2] = { 1, 0 };
1601    static const char *const keynames[] = { "KEYBOARD_P1", "KEYBOARD_P2" };
1602    int keyboard;
1603    int i;
16041604
1605   for (keyboard=0; keyboard < 2; keyboard++)
1606   {
1607      UINT32 kbstate = ioport(keynames[keyboard])->read();
1608      int uart_channel = kb_uart_channel[keyboard];
1605    for (keyboard=0; keyboard < 2; keyboard++)
1606    {
1607        UINT32 kbstate = ioport(keynames[keyboard])->read();
1608        int uart_channel = kb_uart_channel[keyboard];
16091609
1610      if (kbstate != m_keyboard_state[keyboard])
1611      {
1612         for (i=0; i < 24; i++)
1613         {
1614            int kbnote = keyboard_notes[i];
1610        if (kbstate != m_keyboard_state[keyboard])
1611        {
1612            for (i=0; i < 24; i++)
1613            {
1614                int kbnote = keyboard_notes[i];
16151615
1616            if ((m_keyboard_state[keyboard] & (1 << i)) != 0 && (kbstate & (1 << i)) == 0)
1617            {
1618               // key was on, now off -> send Note Off message
1619               pc16552d_rx_data(machine(), 1, uart_channel, 0x80);
1620               pc16552d_rx_data(machine(), 1, uart_channel, kbnote);
1621               pc16552d_rx_data(machine(), 1, uart_channel, 0x7f);
1622            }
1623            else if ((m_keyboard_state[keyboard] & (1 << i)) == 0 && (kbstate & (1 << i)) != 0)
1624            {
1625               // key was off, now on -> send Note On message
1626               pc16552d_rx_data(machine(), 1, uart_channel, 0x90);
1627               pc16552d_rx_data(machine(), 1, uart_channel, kbnote);
1628               pc16552d_rx_data(machine(), 1, uart_channel, 0x7f);
1629            }
1630         }
1631      }
1632      else
1633      {
1634         // no messages, send Active Sense message instead
1635         pc16552d_rx_data(machine(), 1, uart_channel, 0xfe);
1636      }
1616                if ((m_keyboard_state[keyboard] & (1 << i)) != 0 && (kbstate & (1 << i)) == 0)
1617                {
1618                    // key was on, now off -> send Note Off message
1619                    pc16552d_rx_data(machine(), 1, uart_channel, 0x80);
1620                    pc16552d_rx_data(machine(), 1, uart_channel, kbnote);
1621                    pc16552d_rx_data(machine(), 1, uart_channel, 0x7f);
1622                }
1623                else if ((m_keyboard_state[keyboard] & (1 << i)) == 0 && (kbstate & (1 << i)) != 0)
1624                {
1625                    // key was off, now on -> send Note On message
1626                    pc16552d_rx_data(machine(), 1, uart_channel, 0x90);
1627                    pc16552d_rx_data(machine(), 1, uart_channel, kbnote);
1628                    pc16552d_rx_data(machine(), 1, uart_channel, 0x7f);
1629                }
1630            }
1631        }
1632        else
1633        {
1634            // no messages, send Active Sense message instead
1635            pc16552d_rx_data(machine(), 1, uart_channel, 0xfe);
1636        }
16371637
1638      m_keyboard_state[keyboard] = kbstate;
1639   }
1638        m_keyboard_state[keyboard] = kbstate;
1639    }
16401640}
16411641*/
16421642// Extend board IRQs
r23623r23624
19841984   PORT_BIT( 0xff, 0x80, IPT_PADDLE_V ) PORT_MINMAX(0xff, 0x00) PORT_SENSITIVITY(30) PORT_KEYDELTA(10)
19851985
19861986/*
1987   PORT_START("KEYBOARD_P1")
1988   PORT_BIT( 0x000001, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 C1") PORT_CODE(KEYCODE_Q)
1989   PORT_BIT( 0x000002, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 C1#") PORT_CODE(KEYCODE_W)
1990   PORT_BIT( 0x000004, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 D1") PORT_CODE(KEYCODE_E)
1991   PORT_BIT( 0x000008, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 D1#") PORT_CODE(KEYCODE_R)
1992   PORT_BIT( 0x000010, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 E1") PORT_CODE(KEYCODE_T)
1993   PORT_BIT( 0x000020, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 F1") PORT_CODE(KEYCODE_Y)
1994   PORT_BIT( 0x000040, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 F1#") PORT_CODE(KEYCODE_U)
1995   PORT_BIT( 0x000080, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 G1") PORT_CODE(KEYCODE_I)
1996   PORT_BIT( 0x000100, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 G1#") PORT_CODE(KEYCODE_O)
1997   PORT_BIT( 0x000200, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 A1") PORT_CODE(KEYCODE_A)
1998   PORT_BIT( 0x000400, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 A1#") PORT_CODE(KEYCODE_S)
1999   PORT_BIT( 0x000800, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 B1") PORT_CODE(KEYCODE_D)
2000   PORT_BIT( 0x001000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 C2") PORT_CODE(KEYCODE_F)
2001   PORT_BIT( 0x002000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 C2#") PORT_CODE(KEYCODE_G)
2002   PORT_BIT( 0x004000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 D2") PORT_CODE(KEYCODE_H)
2003   PORT_BIT( 0x008000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 D2#") PORT_CODE(KEYCODE_J)
2004   PORT_BIT( 0x010000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 E2") PORT_CODE(KEYCODE_K)
2005   PORT_BIT( 0x020000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 F2") PORT_CODE(KEYCODE_L)
2006   PORT_BIT( 0x040000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 F2#") PORT_CODE(KEYCODE_Z)
2007   PORT_BIT( 0x080000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 G2") PORT_CODE(KEYCODE_X)
2008   PORT_BIT( 0x100000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 G2#") PORT_CODE(KEYCODE_C)
2009   PORT_BIT( 0x200000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 A2") PORT_CODE(KEYCODE_V)
2010   PORT_BIT( 0x400000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 A2#") PORT_CODE(KEYCODE_B)
2011   PORT_BIT( 0x800000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 B2") PORT_CODE(KEYCODE_N)
1987    PORT_START("KEYBOARD_P1")
1988    PORT_BIT( 0x000001, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 C1") PORT_CODE(KEYCODE_Q)
1989    PORT_BIT( 0x000002, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 C1#") PORT_CODE(KEYCODE_W)
1990    PORT_BIT( 0x000004, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 D1") PORT_CODE(KEYCODE_E)
1991    PORT_BIT( 0x000008, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 D1#") PORT_CODE(KEYCODE_R)
1992    PORT_BIT( 0x000010, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 E1") PORT_CODE(KEYCODE_T)
1993    PORT_BIT( 0x000020, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 F1") PORT_CODE(KEYCODE_Y)
1994    PORT_BIT( 0x000040, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 F1#") PORT_CODE(KEYCODE_U)
1995    PORT_BIT( 0x000080, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 G1") PORT_CODE(KEYCODE_I)
1996    PORT_BIT( 0x000100, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 G1#") PORT_CODE(KEYCODE_O)
1997    PORT_BIT( 0x000200, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 A1") PORT_CODE(KEYCODE_A)
1998    PORT_BIT( 0x000400, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 A1#") PORT_CODE(KEYCODE_S)
1999    PORT_BIT( 0x000800, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 B1") PORT_CODE(KEYCODE_D)
2000    PORT_BIT( 0x001000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 C2") PORT_CODE(KEYCODE_F)
2001    PORT_BIT( 0x002000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 C2#") PORT_CODE(KEYCODE_G)
2002    PORT_BIT( 0x004000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 D2") PORT_CODE(KEYCODE_H)
2003    PORT_BIT( 0x008000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 D2#") PORT_CODE(KEYCODE_J)
2004    PORT_BIT( 0x010000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 E2") PORT_CODE(KEYCODE_K)
2005    PORT_BIT( 0x020000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 F2") PORT_CODE(KEYCODE_L)
2006    PORT_BIT( 0x040000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 F2#") PORT_CODE(KEYCODE_Z)
2007    PORT_BIT( 0x080000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 G2") PORT_CODE(KEYCODE_X)
2008    PORT_BIT( 0x100000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 G2#") PORT_CODE(KEYCODE_C)
2009    PORT_BIT( 0x200000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 A2") PORT_CODE(KEYCODE_V)
2010    PORT_BIT( 0x400000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 A2#") PORT_CODE(KEYCODE_B)
2011    PORT_BIT( 0x800000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 B2") PORT_CODE(KEYCODE_N)
20122012
2013   PORT_START("KEYBOARD_P2")
2014   PORT_BIT( 0x000001, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 C1") PORT_CODE(KEYCODE_Q)
2015   PORT_BIT( 0x000002, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 C1#") PORT_CODE(KEYCODE_W)
2016   PORT_BIT( 0x000004, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 D1") PORT_CODE(KEYCODE_E)
2017   PORT_BIT( 0x000008, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 D1#") PORT_CODE(KEYCODE_R)
2018   PORT_BIT( 0x000010, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 E1") PORT_CODE(KEYCODE_T)
2019   PORT_BIT( 0x000020, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 F1") PORT_CODE(KEYCODE_Y)
2020   PORT_BIT( 0x000040, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 F1#") PORT_CODE(KEYCODE_U)
2021   PORT_BIT( 0x000080, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 G1") PORT_CODE(KEYCODE_I)
2022   PORT_BIT( 0x000100, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 G1#") PORT_CODE(KEYCODE_O)
2023   PORT_BIT( 0x000200, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 A1") PORT_CODE(KEYCODE_A)
2024   PORT_BIT( 0x000400, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 A1#") PORT_CODE(KEYCODE_S)
2025   PORT_BIT( 0x000800, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 B1") PORT_CODE(KEYCODE_D)
2026   PORT_BIT( 0x001000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 C2") PORT_CODE(KEYCODE_F)
2027   PORT_BIT( 0x002000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 C2#") PORT_CODE(KEYCODE_G)
2028   PORT_BIT( 0x004000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 D2") PORT_CODE(KEYCODE_H)
2029   PORT_BIT( 0x008000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 D2#") PORT_CODE(KEYCODE_J)
2030   PORT_BIT( 0x010000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 E2") PORT_CODE(KEYCODE_K)
2031   PORT_BIT( 0x020000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 F2") PORT_CODE(KEYCODE_L)
2032   PORT_BIT( 0x040000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 F2#") PORT_CODE(KEYCODE_Z)
2033   PORT_BIT( 0x080000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 G2") PORT_CODE(KEYCODE_X)
2034   PORT_BIT( 0x100000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 G2#") PORT_CODE(KEYCODE_C)
2035   PORT_BIT( 0x200000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 A2") PORT_CODE(KEYCODE_V)
2036   PORT_BIT( 0x400000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 A2#") PORT_CODE(KEYCODE_B)
2037   PORT_BIT( 0x800000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 B2") PORT_CODE(KEYCODE_N)
2013    PORT_START("KEYBOARD_P2")
2014    PORT_BIT( 0x000001, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 C1") PORT_CODE(KEYCODE_Q)
2015    PORT_BIT( 0x000002, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 C1#") PORT_CODE(KEYCODE_W)
2016    PORT_BIT( 0x000004, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 D1") PORT_CODE(KEYCODE_E)
2017    PORT_BIT( 0x000008, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 D1#") PORT_CODE(KEYCODE_R)
2018    PORT_BIT( 0x000010, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 E1") PORT_CODE(KEYCODE_T)
2019    PORT_BIT( 0x000020, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 F1") PORT_CODE(KEYCODE_Y)
2020    PORT_BIT( 0x000040, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 F1#") PORT_CODE(KEYCODE_U)
2021    PORT_BIT( 0x000080, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 G1") PORT_CODE(KEYCODE_I)
2022    PORT_BIT( 0x000100, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 G1#") PORT_CODE(KEYCODE_O)
2023    PORT_BIT( 0x000200, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 A1") PORT_CODE(KEYCODE_A)
2024    PORT_BIT( 0x000400, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 A1#") PORT_CODE(KEYCODE_S)
2025    PORT_BIT( 0x000800, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 B1") PORT_CODE(KEYCODE_D)
2026    PORT_BIT( 0x001000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 C2") PORT_CODE(KEYCODE_F)
2027    PORT_BIT( 0x002000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 C2#") PORT_CODE(KEYCODE_G)
2028    PORT_BIT( 0x004000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 D2") PORT_CODE(KEYCODE_H)
2029    PORT_BIT( 0x008000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 D2#") PORT_CODE(KEYCODE_J)
2030    PORT_BIT( 0x010000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 E2") PORT_CODE(KEYCODE_K)
2031    PORT_BIT( 0x020000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 F2") PORT_CODE(KEYCODE_L)
2032    PORT_BIT( 0x040000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 F2#") PORT_CODE(KEYCODE_Z)
2033    PORT_BIT( 0x080000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 G2") PORT_CODE(KEYCODE_X)
2034    PORT_BIT( 0x100000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 G2#") PORT_CODE(KEYCODE_C)
2035    PORT_BIT( 0x200000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 A2") PORT_CODE(KEYCODE_V)
2036    PORT_BIT( 0x400000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 A2#") PORT_CODE(KEYCODE_B)
2037    PORT_BIT( 0x800000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 B2") PORT_CODE(KEYCODE_N)
20382038*/
20392039INPUT_PORTS_END
20402040
r23623r23624
23552355
23562356   atapi_init();
23572357
2358//   pc16552d_init(machine(), 0, 19660800, comm_uart_irq_callback, 0);     // Network UART
2359//   pc16552d_init(machine(), 1, 24000000, midi_uart_irq_callback, 0);     // MIDI UART
2358//  pc16552d_init(machine(), 0, 19660800, comm_uart_irq_callback, 0);     // Network UART
2359//  pc16552d_init(machine(), 1, 24000000, midi_uart_irq_callback, 0);     // MIDI UART
23602360
23612361   m_extend_board_irq_enable = 0x3f;
23622362   m_extend_board_irq_active = 0x00;
r23623r23624
23872387void firebeat_state::init_keyboard()
23882388{
23892389   // set keyboard timer
2390//   m_keyboard_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(firebeat_state::keyboard_timer_callback),this));
2391//   m_keyboard_timer->adjust(attotime::from_msec(10), 0, attotime::from_msec(10));
2390//  m_keyboard_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(firebeat_state::keyboard_timer_callback),this));
2391//  m_keyboard_timer->adjust(attotime::from_msec(10), 0, attotime::from_msec(10));
23922392}
23932393
23942394DRIVER_INIT_MEMBER(firebeat_state,kbm)
trunk/src/mame/drivers/jpmsru.c
r23623r23624
182182
183183GAME(198?, j_nuddup2,j_nuddup   ,jpmsru_4,jpmsru, jpmsru_state,jpmsru,ROT0,   "JPM","Nudge Double Up (JPM SRU, set 2)",                     GAME_IS_SKELETON_MECHANICAL )
184184
185GAME(198?, j_unk   ,0          ,jpmsru_4,jpmsru, jpmsru_state,jpmsru,ROT0,   "JPM?","Unknown SRU Game (JPM?)",                     GAME_IS_SKELETON_MECHANICAL )
185GAME(198?, j_unk    ,0          ,jpmsru_4,jpmsru, jpmsru_state,jpmsru,ROT0,   "JPM?","Unknown SRU Game (JPM?)",                     GAME_IS_SKELETON_MECHANICAL )
186186
187187// this one is different again?
188188GAME(198?, j_plus2  ,0          ,jpmsru_4,jpmsru, jpmsru_state,jpmsru,ROT0,   "JPM","Plus 2 (JPM)",                     GAME_IS_SKELETON_MECHANICAL )
trunk/src/mame/drivers/fruitpc.c
r23623r23624
8484
8585static INPUT_PORTS_START( fruitpc )
8686   PORT_START("pc_keyboard_0")
87//   PORT_BIT ( 0x0001, 0x0000, IPT_UNUSED )     /* unused scancode 0 */
88//   AT_KEYB_HELPER( 0x0002, "Esc",          KEYCODE_Q           ) /* Esc                         01  81 */
87//  PORT_BIT ( 0x0001, 0x0000, IPT_UNUSED )     /* unused scancode 0 */
88//  AT_KEYB_HELPER( 0x0002, "Esc",          KEYCODE_Q           ) /* Esc                         01  81 */
8989
9090   PORT_START("pc_keyboard_1")
91//   AT_KEYB_HELPER( 0x0010, "T",            KEYCODE_T           ) /* T                           14  94 */
92//   AT_KEYB_HELPER( 0x0020, "Y",            KEYCODE_Y           ) /* Y                           15  95 */
93//   AT_KEYB_HELPER( 0x0100, "O",            KEYCODE_O           ) /* O                           18  98 */
94//   AT_KEYB_HELPER( 0x1000, "Enter",        KEYCODE_ENTER       ) /* Enter                       1C  9C */
91//  AT_KEYB_HELPER( 0x0010, "T",            KEYCODE_T           ) /* T                           14  94 */
92//  AT_KEYB_HELPER( 0x0020, "Y",            KEYCODE_Y           ) /* Y                           15  95 */
93//  AT_KEYB_HELPER( 0x0100, "O",            KEYCODE_O           ) /* O                           18  98 */
94//  AT_KEYB_HELPER( 0x1000, "Enter",        KEYCODE_ENTER       ) /* Enter                       1C  9C */
9595
9696   PORT_START("pc_keyboard_2")
9797
9898   PORT_START("pc_keyboard_3")
99//   AT_KEYB_HELPER( 0x0001, "B",            KEYCODE_B           ) /* B                           30  B0 */
100//   AT_KEYB_HELPER( 0x0002, "N",            KEYCODE_N           ) /* N                           31  B1 */
101//   AT_KEYB_HELPER( 0x0800, "F1",           KEYCODE_S           ) /* F1                          3B  BB */
99//  AT_KEYB_HELPER( 0x0001, "B",            KEYCODE_B           ) /* B                           30  B0 */
100//  AT_KEYB_HELPER( 0x0002, "N",            KEYCODE_N           ) /* N                           31  B1 */
101//  AT_KEYB_HELPER( 0x0800, "F1",           KEYCODE_S           ) /* F1                          3B  BB */
102102//  AT_KEYB_HELPER( 0x8000, "F5",           KEYCODE_F5          )
103103
104104   PORT_START("pc_keyboard_4")
r23623r23624
107107   PORT_START("pc_keyboard_5")
108108
109109   PORT_START("pc_keyboard_6")
110//   AT_KEYB_HELPER( 0x0040, "(MF2)Cursor Up",       KEYCODE_UP          ) /* Up                          67  e7 */
111//   AT_KEYB_HELPER( 0x0080, "(MF2)Page Up",         KEYCODE_PGUP        ) /* Page Up                     68  e8 */
112//   AT_KEYB_HELPER( 0x0100, "(MF2)Cursor Left",     KEYCODE_LEFT        ) /* Left                        69  e9 */
113//   AT_KEYB_HELPER( 0x0200, "(MF2)Cursor Right",        KEYCODE_RIGHT       ) /* Right                       6a  ea */
114//   AT_KEYB_HELPER( 0x0800, "(MF2)Cursor Down",     KEYCODE_DOWN        ) /* Down                        6c  ec */
115//   AT_KEYB_HELPER( 0x1000, "(MF2)Page Down",       KEYCODE_PGDN        ) /* Page Down                   6d  ed */
116//   AT_KEYB_HELPER( 0x4000, "Del",                      KEYCODE_A           ) /* Delete                      6f  ef */
110//  AT_KEYB_HELPER( 0x0040, "(MF2)Cursor Up",       KEYCODE_UP          ) /* Up                          67  e7 */
111//  AT_KEYB_HELPER( 0x0080, "(MF2)Page Up",         KEYCODE_PGUP        ) /* Page Up                     68  e8 */
112//  AT_KEYB_HELPER( 0x0100, "(MF2)Cursor Left",     KEYCODE_LEFT        ) /* Left                        69  e9 */
113//  AT_KEYB_HELPER( 0x0200, "(MF2)Cursor Right",        KEYCODE_RIGHT       ) /* Right                       6a  ea */
114//  AT_KEYB_HELPER( 0x0800, "(MF2)Cursor Down",     KEYCODE_DOWN        ) /* Down                        6c  ec */
115//  AT_KEYB_HELPER( 0x1000, "(MF2)Page Down",       KEYCODE_PGDN        ) /* Page Down                   6d  ed */
116//  AT_KEYB_HELPER( 0x4000, "Del",                      KEYCODE_A           ) /* Delete                      6f  ef */
117117
118118   PORT_START("pc_keyboard_7")
119119
trunk/src/mame/drivers/mpu4.c
r23623r23624
18851885/*
18861886Coinworld data
18871887
1888Error Number   Cause of alarm         Comments
188911              1 GBP coin in         These alarms go off when a coin is jammed in the mech, or if the Mars anti-strimming alarm is activated. 
1888Error Number    Cause of alarm        Comments
188911              1 GBP coin in         These alarms go off when a coin is jammed in the mech, or if the Mars anti-strimming alarm is activated.
1890189012              50p coin in           The machine will lock up for a short amount of time, whilst sounding as alarm tone.
1891189113              20p coin in           Error 15 can be caused by having DIL switch 6 in the wrong position for your coin mech loom.
1892189214              10p coin in
1893189315               5p coin in
189416               2 GBP coin in
189416              2 GBP coin in
1895189521              Reel 1 alarm          The faulty reel will flash. Nothing more will happen until the machine is reset
1896189622              Reel 2 alarm
189723               Reel 3 alarm
189842               Ram Cleared             The RAM is cleared when the machine is turned on for the first time, or when the price of play is changed. The alarm
189723              Reel 3 alarm
189842              Ram Cleared           The RAM is cleared when the machine is turned on for the first time, or when the price of play is changed. The alarm
18991899                                      clears after a short time
190051              Checksum error         The machine will lock up completely if the eprom has failed, or if the security chip is missing or has failed
190051             Checksum error         The machine will lock up completely if the eprom has failed, or if the security chip is missing or has failed
1901190154             Security chip fail
1902190261             Cash in meter failure  The machine will not run if the cash in, or cash out meters are not connected properly.
190362              Cash out meter failure
190471             Datapack error         If the machine is in protocol mode, and a datapack is not connected, then the machine alarms. It will reset after a 
190362             Cash out meter failure
190471             Datapack error         If the machine is in protocol mode, and a datapack is not connected, then the machine alarms. It will reset after a
19051905                                      time, and have another go at transmitting the data
190672              Sound card fail         If the sound card is missing, or the wrong sound eprom is fitted, the machine alarms on power on. The machine will then
190672             Sound card fail        If the sound card is missing, or the wrong sound eprom is fitted, the machine alarms on power on. The machine will then
19071907                                      operate in silence.
190899              Payout tubes empty     If one of the tubes runs dry, the machine will attempt to compensate by paying from the other tube. If this runs dry
190899             Payout tubes empty     If one of the tubes runs dry, the machine will attempt to compensate by paying from the other tube. If this runs dry
19091909                                      as well, the machine will lock up, requiring a refill before games can continue. The alarm tone is a softer, more friendly one.
19101910*/
19111911
trunk/src/mame/drivers/mpu4hw.c
r23623r23624
18011801   PORT_DIPNAME( 0x0C, 0x00, "Jackpot" ) PORT_DIPLOCATION("DIL1:03,04")
18021802   PORT_DIPSETTING(    0x04, "15 GBP" )
18031803   PORT_DIPSETTING(    0x00, "10 GBP" )
1804   PORT_DIPSETTING(    0x08, "5 GBP" )   
1804   PORT_DIPSETTING(    0x08, "5 GBP" )
18051805   PORT_DIPNAME( 0x10, 0x00, "Hold Mode" ) PORT_DIPLOCATION("DIL1:05")
18061806   PORT_DIPSETTING(    0x00, "Show Hints" )
18071807   PORT_DIPSETTING(    0x10, "Auto Hold" )
r23623r23624
18131813   PORT_DIPSETTING(    0x40, "Fat motor" )
18141814   PORT_DIPNAME( 0x80, 0x00, "Payout Tube" ) PORT_DIPLOCATION("DIL1:05")
18151815   PORT_DIPSETTING(    0x00, "20p" )
1816   PORT_DIPSETTING(    0x80, "10p" )   
1816   PORT_DIPSETTING(    0x80, "10p" )
18171817
18181818   PORT_MODIFY("DIL2")
18191819   PORT_DIPNAME( 0x07, 0x00, "Stake Setting" )
18201820   PORT_DIPSETTING(    0x00, "Not fitted / 5p"  )
18211821   PORT_DIPSETTING(    0x01, "10p" )
18221822   PORT_DIPSETTING(    0x02, "20p" )
1823   PORT_DIPSETTING(    0x03, "25p" )   
1823   PORT_DIPSETTING(    0x03, "25p" )
18241824   PORT_DIPSETTING(    0x04, "30p" )
18251825   PORT_BIT(0xE0, IP_ACTIVE_HIGH, IPT_UNUSED)
18261826   INPUT_PORTS_END
1827   
1827
18281828INPUT_PORTS_START( mpu4jackpot8tkn )
18291829   PORT_INCLUDE( mpu4 )
18301830
trunk/src/mame/drivers/decocass.c
r23623r23624
16571657/* 11 */ GAME( 1981, clocknch,  decocass, clocknch, clocknch, decocass_state, decocass, ROT270, "Data East Corporation", "Lock'n'Chase (DECO Cassette)", 0 )
16581658/* 12 */ // 1981.08 Flash Boy/DECO Kid
16591659/* 13 */ GAME( 1981, cprogolf,  decocass, cprogolf, cprogolf, decocass_state, decocass, ROT270, "Data East Corporation", "Tournament Pro Golf (DECO Cassette)", 0 )
1660      GAME( 1981, cprogolfj, cprogolf, cprogolfj,cprogolf, decocass_state, decocass, ROT270, "Data East Corporation", "Tournament Pro Golf (DECO Cassette, Japan)", 0 )
1660         GAME( 1981, cprogolfj, cprogolf, cprogolfj,cprogolf, decocass_state, decocass, ROT270, "Data East Corporation", "Tournament Pro Golf (DECO Cassette, Japan)", 0 )
16611661/* 14 */ GAME( 1981, cdsteljn,  decocass, cdsteljn, cdsteljn, decocass_state, cdsteljn, ROT270, "Data East Corporation", "DS Telejan (DECO Cassette, Japan)", 0 )
16621662/* 15 */ GAME( 1981, cluckypo,  decocass, cluckypo, decocass, decocass_state, decocass, ROT270, "Data East Corporation", "Lucky Poker (DECO Cassette)", 0 )
16631663/* 16 */ GAME( 1981, ctisland,  decocass, ctisland, decocass, decocass_state, decocrom, ROT270, "Data East Corporation", "Treasure Island (DECO Cassette, set 1)", 0 )
1664       GAME( 1981, ctisland2, ctisland, ctisland, decocass, decocass_state, decocrom, ROT270, "Data East Corporation", "Treasure Island (DECO Cassette, set 2)", 0 )
1665       GAME( 1981, ctisland3, ctisland, ctisland, decocass, decocass_state, decocrom, ROT270, "Data East Corporation", "Treasure Island (DECO Cassette, set 3)", GAME_NOT_WORKING ) /* Different Bitswap? */
1664         GAME( 1981, ctisland2, ctisland, ctisland, decocass, decocass_state, decocrom, ROT270, "Data East Corporation", "Treasure Island (DECO Cassette, set 2)", 0 )
1665         GAME( 1981, ctisland3, ctisland, ctisland, decocass, decocass_state, decocrom, ROT270, "Data East Corporation", "Treasure Island (DECO Cassette, set 3)", GAME_NOT_WORKING ) /* Different Bitswap? */
16661666/* 17 */ // 1981.10 Bobbitto
16671667/* 18 */ GAME( 1982, cexplore,  decocass, cexplore, cexplore, decocass_state, decocass, ROT270, "Data East Corporation", "Explorer (DECO Cassette)", GAME_NOT_WORKING )
16681668/* 19 */ GAME( 1982, cdiscon1,  decocass, cdiscon1, decocass, decocass_state, decocass, ROT270, "Data East Corporation", "Disco No.1 (DECO Cassette)", 0 )
1669      GAME( 1982, csweetht,  cdiscon1, cdiscon1, decocass, decocass_state, decocass, ROT270, "Data East Corporation", "Sweet Heart (DECO Cassette)", 0 )
1669         GAME( 1982, csweetht,  cdiscon1, cdiscon1, decocass, decocass_state, decocass, ROT270, "Data East Corporation", "Sweet Heart (DECO Cassette)", 0 )
16701670/* 20 */ GAME( 1982, ctornado,  decocass, ctornado, ctornado, decocass_state, decocass, ROT270, "Data East Corporation", "Tornado (DECO Cassette)", 0 )
16711671/* 21 */ GAME( 1982, cmissnx,   decocass, cmissnx,  cmissnx, decocass_state,  decocass, ROT270, "Data East Corporation", "Mission-X (DECO Cassette)", 0 )
16721672/* 22 */ GAME( 1982, cptennis,  decocass, cptennis, decocass, decocass_state, decocass, ROT270, "Data East Corporation", "Pro Tennis (DECO Cassette)", 0 )
r23623r23624
16751675/* 25 */ GAME( 1982, cadanglr,  decocass, cfishing, cfishing, decocass_state, decocass, ROT270, "Data East Corporation", "Angler Dangler (DECO Cassette)", 0 )
16761676/* 25 */ GAME( 1982, cfishing,  cadanglr, cfishing, cfishing, decocass_state, decocass, ROT270, "Data East Corporation", "Fishing (DECO Cassette)", 0 )
16771677/* 26 */ GAME( 1983, cbtime,    decocass, cbtime,   cbtime, decocass_state,   decocass, ROT270, "Data East Corporation", "Burger Time (DECO Cassette)", 0 )
1678      GAME( 1982, chamburger,cbtime,   cbtime,   cbtime, decocass_state,   decocass, ROT270, "Data East Corporation", "Hamburger (DECO Cassette, Japan)", 0 )
1678         GAME( 1982, chamburger,cbtime,   cbtime,   cbtime, decocass_state,   decocass, ROT270, "Data East Corporation", "Hamburger (DECO Cassette, Japan)", 0 )
16791679/* 27 */ GAME( 1982, cburnrub,  decocass, cburnrub, decocass, decocass_state, decocass, ROT270, "Data East Corporation", "Burnin' Rubber (DECO Cassette, set 1)", 0 )
1680       GAME( 1982, cburnrub2, cburnrub, cburnrub, decocass, decocass_state, decocass, ROT270, "Data East Corporation", "Burnin' Rubber (DECO Cassette, set 2)", 0 )
1681       GAME( 1982, cbnj,      cburnrub, cburnrub, decocass, decocass_state, decocass, ROT270, "Data East Corporation", "Bump 'n' Jump (DECO Cassette)", 0 )
1680         GAME( 1982, cburnrub2, cburnrub, cburnrub, decocass, decocass_state, decocass, ROT270, "Data East Corporation", "Burnin' Rubber (DECO Cassette, set 2)", 0 )
1681         GAME( 1982, cbnj,      cburnrub, cburnrub, decocass, decocass_state, decocass, ROT270, "Data East Corporation", "Bump 'n' Jump (DECO Cassette)", 0 )
16821682/* 28 */ GAME( 1983, cgraplop,  decocass, cgraplop, cgraplop, decocass_state, decocass, ROT270, "Data East Corporation", "Cluster Buster (DECO Cassette)", 0 )
1683      GAME( 1983, cgraplop2, cgraplop, cgraplop2,cgraplop, decocass_state, decocass, ROT270, "Data East Corporation", "Graplop (no title screen) (DECO Cassette)", 0 ) // a version with title screen exists, see reference videos
1683         GAME( 1983, cgraplop2, cgraplop, cgraplop2,cgraplop, decocass_state, decocass, ROT270, "Data East Corporation", "Graplop (no title screen) (DECO Cassette)", 0 ) // a version with title screen exists, see reference videos
16841684/* 29 */ GAME( 1983, clapapa,   decocass, clapapa,  decocass, decocass_state, decocass, ROT270, "Data East Corporation", "Rootin' Tootin' / La-Pa-Pa (DECO Cassette)" , 0) /* Displays 'La-Pa-Pa during attract */
1685      GAME( 1983, clapapa2,  clapapa,  clapapa,  decocass, decocass_state, decocass, ROT270, "Data East Corporation", "Rootin' Tootin' (DECO Cassette)" , 0) /* Displays 'Rootin' Tootin' during attract */
1685         GAME( 1983, clapapa2,  clapapa,  clapapa,  decocass, decocass_state, decocass, ROT270, "Data East Corporation", "Rootin' Tootin' (DECO Cassette)" , 0) /* Displays 'Rootin' Tootin' during attract */
16861686/* 30 */ GAME( 1983, cskater,   decocass, cskater,  cskater, decocass_state,  decocass, ROT270, "Data East Corporation", "Skater (DECO Cassette, Japan)", 0 )
16871687/* 31 */ GAME( 1983, cprobowl,  decocass, cprobowl, decocass, decocass_state, decocass, ROT270, "Data East Corporation", "Pro Bowling (DECO Cassette)", 0 )
16881688/* 32 */ GAME( 1983, cnightst,  decocass, cnightst, cnightst, decocass_state, decocass, ROT270, "Data East Corporation", "Night Star (DECO Cassette, set 1)", 0 )
1689      GAME( 1983, cnightst2, cnightst, cnightst, cnightst, decocass_state, decocass, ROT270, "Data East Corporation", "Night Star (DECO Cassette, set 2)", 0 )
1689         GAME( 1983, cnightst2, cnightst, cnightst, cnightst, decocass_state, decocass, ROT270, "Data East Corporation", "Night Star (DECO Cassette, set 2)", 0 )
16901690/* 33 */ GAME( 1983, cpsoccer,  decocass, cpsoccer, cpsoccer, decocass_state, decocass, ROT270, "Data East Corporation", "Pro Soccer (DECO Cassette)", 0 )
1691      GAME( 1983, cpsoccerj, cpsoccer, cpsoccer, cpsoccer, decocass_state, decocass, ROT270, "Data East Corporation", "Pro Soccer (DECO Cassette, Japan)", 0 )
1691         GAME( 1983, cpsoccerj, cpsoccer, cpsoccer, cpsoccer, decocass_state, decocass, ROT270, "Data East Corporation", "Pro Soccer (DECO Cassette, Japan)", 0 )
16921692/* 34 */ GAME( 1983, csdtenis,  decocass, csdtenis, csdtenis, decocass_state, decocass, ROT270, "Data East Corporation", "Super Doubles Tennis (DECO Cassette, Japan)", GAME_WRONG_COLORS )
16931693/* 35 */ GAME( 1985, cflyball,  decocass, cflyball, decocass, decocass_state, decocass, ROT270, "Data East Corporation", "Flying Ball (DECO Cassette)", 0 )
16941694/* 36 */ // 1984.04 Genesis/Boomer Rang'r
16951695/* 37 */ GAME( 1983, czeroize,  decocass, czeroize, decocass, decocass_state, decocass, ROT270, "Data East Corporation", "Zeroize (DECO Cassette)", 0 )
16961696/* 38 */ GAME( 1984, cscrtry,   decocass, type4,    cscrtry, decocass_state,  decocass, ROT270, "Data East Corporation", "Scrum Try (DECO Cassette, set 1)", 0 )
1697      GAME( 1984, cscrtry2,  cscrtry,  type4,    cscrtry, decocass_state,  decocass, ROT270, "Data East Corporation", "Scrum Try (DECO Cassette, set 2)", 0 )
1697         GAME( 1984, cscrtry2,  cscrtry,  type4,    cscrtry, decocass_state,  decocass, ROT270, "Data East Corporation", "Scrum Try (DECO Cassette, set 2)", 0 )
16981698/* 39 */ GAME( 1984, cppicf,    decocass, cppicf,   decocass, decocass_state, decocass, ROT270, "Data East Corporation", "Peter Pepper's Ice Cream Factory (DECO Cassette, set 1)", 0 )
1699      GAME( 1984, cppicf2,   cppicf,   cppicf,   decocass, decocass_state, decocass, ROT270, "Data East Corporation", "Peter Pepper's Ice Cream Factory (DECO Cassette, set 2)", 0 )
1699         GAME( 1984, cppicf2,   cppicf,   cppicf,   decocass, decocass_state, decocass, ROT270, "Data East Corporation", "Peter Pepper's Ice Cream Factory (DECO Cassette, set 2)", 0 )
17001700/* 40 */ GAME( 1984, cfghtice,  decocass, cfghtice, cfghtice, decocass_state, decocass, ROT270, "Data East Corporation", "Fighting Ice Hockey (DECO Cassette)", 0 )
17011701/* 41 */ GAME( 1984, coozumou,  decocass, type4,    cscrtry, decocass_state,  decocass, ROT270, "Data East Corporation", "Oozumou - The Grand Sumo (DECO Cassette, Japan)", 0 )
17021702/* 42 */ // 1984.08 Hellow Gateball // not a typo, this is official spelling
trunk/src/mame/drivers/mappy.c
r23623r23624
578578void mappy_state::common_latch_w(UINT32 offset)
579579{
580580   int bit = offset & 1;
581   
581
582582   switch (offset & 0x0e)
583583   {
584584      case 0x00:  /* INT ON 2 */
r23623r23624
586586         if (!bit)
587587            m_subcpu->set_input_line(0, CLEAR_LINE);
588588         break;
589         
589
590590      case 0x02:  /* INT ON */
591591         m_main_irq_mask = bit;
592592         if (!bit)
593593            m_maincpu->set_input_line(0, CLEAR_LINE);
594594         break;
595         
595
596596      case 0x04:  /* n.c. */
597597         break;
598         
598
599599      case 0x06:  /* SOUND ON */
600600         mappy_sound_enable(machine().device("namco"), bit);
601601         break;
602         
602
603603      case 0x0a:  /* SUB RESET */
604604         m_subcpu->set_input_line(INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
605605         break;
606         
606
607607      case 0x0c:  /* n.c. */
608608         break;
609         
609
610610      case 0x0e:  /* n.c. */
611611         break;
612612   }
r23623r23624
638638
639639      default:
640640         common_latch_w(offset);
641         break;         
641         break;
642642   }
643643}
644644
r23623r23624
662662      case 0x0c:
663663         m_subcpu2->set_input_line(INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
664664         break;
665         
665
666666      default:
667667         common_latch_w(offset);
668         break;         
668         break;
669669   }
670670}
671671
r23623r23624
697697               break;
698698         }
699699         break;
700         
700
701701      default:
702702         common_latch_w(offset);
703         break;         
703         break;
704704   }
705705}
706706
r23623r23624
17141714
17151715   MCFG_WATCHDOG_VBLANK_INIT(8)
17161716   MCFG_QUANTUM_TIME(attotime::from_hz(6000))    /* 100 CPU slices per frame - an high value to ensure proper */
1717                                      /* synchronization of the CPUs */
1717                                       /* synchronization of the CPUs */
17181718
17191719   MCFG_MACHINE_START_OVERRIDE(mappy_state,mappy)
17201720   MCFG_MACHINE_RESET_OVERRIDE(mappy_state,superpac)
r23623r23624
17921792
17931793   MCFG_WATCHDOG_VBLANK_INIT(8)
17941794   MCFG_QUANTUM_TIME(attotime::from_hz(6000))    /* 100 CPU slices per frame - an high value to ensure proper */
1795                                      /* synchronization of the CPUs */
1795                                       /* synchronization of the CPUs */
17961796   MCFG_MACHINE_START_OVERRIDE(mappy_state,mappy)
17971797   MCFG_MACHINE_RESET_OVERRIDE(mappy_state,phozon)
17981798
r23623r23624
18321832
18331833   MCFG_WATCHDOG_VBLANK_INIT(8)
18341834   MCFG_QUANTUM_TIME(attotime::from_hz(6000))    /* 100 CPU slices per frame - an high value to ensure proper */
1835                                      /* synchronization of the CPUs */
1835                                       /* synchronization of the CPUs */
18361836   MCFG_MACHINE_START_OVERRIDE(mappy_state,mappy)
18371837   MCFG_MACHINE_RESET_OVERRIDE(mappy_state,mappy)
18381838
trunk/src/mame/drivers/taito_f3.c
r23623r23624
11/***************************************************************************
22
33    Taito F3 Package System (aka F3 Cybercore System)
4   
4
55    Emulation by Bryan McPhail, mish@tendril.co.uk/mish@mame.net
66    Thanks to Ian Schmidt and Stiletto for sound information!
77    Major thanks to Aaron Giles for sound info, figuring out the 68K/ES5505
trunk/src/mame/drivers/galdrvr.c
r23623r23624
4646
4747static INPUT_PORTS_START( galaxianbl )
4848   PORT_INCLUDE(galaxian)
49   
49
5050   PORT_MODIFY("IN2")
5151   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Bonus_Life ) )
5252   PORT_DIPSETTING(    0x00, DEF_STR(None) )
r23623r23624
50755075   ROM_LOAD( "07.bin",     0x3000, 0x0800, CRC(8e9ac0fc) SHA1(ddc11ad20ecbd954098becf7d7a1bbe6cddeda1b) )
50765076   ROM_LOAD( "08.bin",     0x3800, 0x0800, CRC(020a8e2f) SHA1(b64438cb043252565d8a4f3f58f4a4f78a276ba2) )
50775077
5078   ROM_REGION( 0x2000, "gfx1", 0 )   // not present in this set
5078   ROM_REGION( 0x2000, "gfx1", 0 ) // not present in this set
50795079   ROM_LOAD( "mcs_b",        0x0000, 0x0800, CRC(fb0f1f81) SHA1(38a6679a8b69bc1870a0e67e692131c42f9535c8) )
50805080   ROM_LOAD( "mcs_d",        0x0800, 0x0800, CRC(13932a15) SHA1(b8885c555c6ad7021be55c6925a0a0872c1b6abd) )
50815081   ROM_LOAD( "mcs_a",        0x1000, 0x0800, CRC(631ebb5a) SHA1(5bc9493afa76c55858b8c8849524cbc77dc838fc) )
trunk/src/mame/drivers/zn.c
r23623r23624
21322132   AM_RANGE(0x1f000000, 0x1f7fffff) AM_ROMBANK("bankedroms")
21332133   AM_RANGE(0x1fb00000, 0x1fb00003) AM_WRITE16(coh1001l_latch_w, 0x0000ffff)
21342134   AM_RANGE(0x1fb00000, 0x1fb00003) AM_WRITE8(coh1001l_bank_w, 0x00ff0000)
2135   
2135
21362136   AM_IMPORT_FROM(zn_map)
21372137ADDRESS_MAP_END
21382138
r23623r23624
23682368static ADDRESS_MAP_START(coh1002m_map, AS_PROGRAM, 32, zn_state)
23692369   AM_RANGE(0x1f000000, 0x1f7fffff) AM_ROMBANK("bankedroms")
23702370   AM_RANGE(0x1fb00004, 0x1fb00007) AM_WRITE8(coh1002m_bank_w, 0x00ff0000)
2371   
2371
23722372   AM_IMPORT_FROM(zn_map)
23732373ADDRESS_MAP_END
23742374
r23623r23624
23942394   AM_RANGE(0x1fb00000, 0x1fb00003) AM_DEVREAD8("cbaj_fifo2", fifo7200_device, data_byte_r, 0x000000ff)
23952395   AM_RANGE(0x1fb00000, 0x1fb00003) AM_DEVWRITE8("cbaj_fifo1", fifo7200_device, data_byte_w, 0x000000ff)
23962396   AM_RANGE(0x1fb00000, 0x1fb00003) AM_READ8(cbaj_sound_main_status_r, 0xff000000)
2397   
2397
23982398   AM_IMPORT_FROM(coh1002m_map)
23992399ADDRESS_MAP_END
24002400
r23623r23624
24262426   MCFG_CPU_ADD("audiocpu", Z80, XTAL_32MHz/8)
24272427   MCFG_CPU_PROGRAM_MAP(cbaj_z80_map)
24282428   MCFG_CPU_IO_MAP(cbaj_z80_port_map)
2429   
2429
24302430   MCFG_FIFO7200_ADD("cbaj_fifo1", 0x400) // LH540202
24312431   MCFG_FIFO7200_ADD("cbaj_fifo2", 0x400) // "
24322432
trunk/src/mame/drivers/8080bw.c
r23623r23624
30233023  Attack Force, by E.G.S., Italy
30243024  Not much information is available for this game.
30253025  It may have had an amber monitor?
3026 
3026
30273027  XTAL 20MHz
3028 
3028
30293029  TODO: sound
30303030
30313031*****************************************************/
r23623r23624
30733073   UINT8 *rom = memregion("maincpu")->base();
30743074   UINT32 len = memregion("maincpu")->bytes();
30753075   UINT8 *buffer = auto_alloc_array(machine(), UINT8, len);
3076   
3076
30773077   // swap a8/a9
30783078   for (int i = 0; i < len; i++)
30793079      buffer[BITSWAP16(i, 15,14,13,12,11,10,8,9, 7,6,5,4,3,2,1,0)] = rom[i];
r23623r23624
45544554   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
45554555   ROM_LOAD( "30a.bin",       0x0000, 0x0400, CRC(c12e3386) SHA1(72b1d3d67a83edf0be0b0c37ef6dcffba450f16f) )
45564556   ROM_LOAD( "36a.bin",       0x0400, 0x0400, CRC(6738dcb9) SHA1(e4c68553fc3f2d3db3d251b9cb325e2409d9c02a) )
4557   ROM_LOAD( "31a.bin",      0x0800, 0x0400, CRC(787a4658) SHA1(5be3143bdba6a32256603be94400034a8ea1fda6) )
4557   ROM_LOAD( "31a.bin",       0x0800, 0x0400, CRC(787a4658) SHA1(5be3143bdba6a32256603be94400034a8ea1fda6) )
45584558   ROM_LOAD( "37a.bin",       0x0c00, 0x0400, CRC(ad6bfbbe) SHA1(5f5437b6c8e7dfe9649b25040862f8a51d8c43ed) )
45594559   ROM_LOAD( "32a.bin",       0x1000, 0x0400, CRC(cbe0a711) SHA1(6e5f4214a4b48b70464005f4263c9b1ec3cbbeb1) )
45604560   ROM_LOAD( "33a.bin",       0x1800, 0x0400, CRC(53147393) SHA1(57e078f1734e382e8a46be09c133daab30c75681) )
trunk/src/mame/drivers/btime.c
r23623r23624
900900INPUT_PORTS_END
901901
902902static INPUT_PORTS_START( caractn2 ) /* 2/3 Lives Dip changes in this set */
903        PORT_INCLUDE( bnj )
903      PORT_INCLUDE( bnj )
904904
905        PORT_MODIFY("DSW2")
905      PORT_MODIFY("DSW2")
906906   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) ) PORT_DIPLOCATION("7D:1")
907907   PORT_DIPSETTING(    0x01, "2" )
908908   PORT_DIPSETTING(    0x00, "3" )
trunk/src/mame/drivers/tempest.c
r23623r23624
288288   tempest_state(const machine_config &mconfig, device_type type, const char *tag)
289289      : driver_device(mconfig, type, tag),
290290      m_maincpu(*this, "maincpu"),
291      m_mathbox(*this, "mathbox")   { }
291      m_mathbox(*this, "mathbox") { }
292292
293293   required_device<cpu_device> m_maincpu;
294294   required_device<mathbox_device> m_mathbox;
295   
295
296296   UINT8 m_player_select;
297297   DECLARE_WRITE8_MEMBER(wdclr_w);
298298   DECLARE_WRITE8_MEMBER(tempest_led_w);
trunk/src/mame/drivers/quakeat.c
r23623r23624
9292static ADDRESS_MAP_START( quake_io, AS_IO, 32, quakeat_state )
9393   AM_IMPORT_FROM(pcat32_io_common)
9494   AM_RANGE(0x00e8, 0x00eb) AM_NOP
95//   AM_RANGE(0x01f0, 0x01f7) AM_DEVREADWRITE16("ide", ide_controller_device, read_cs0_pc, write_cs0_pc, 0xffffffff)
95//  AM_RANGE(0x01f0, 0x01f7) AM_DEVREADWRITE16("ide", ide_controller_device, read_cs0_pc, write_cs0_pc, 0xffffffff)
9696   AM_RANGE(0x0300, 0x03af) AM_NOP
9797   AM_RANGE(0x03b0, 0x03df) AM_NOP
9898//  AM_RANGE(0x0278, 0x027b) AM_WRITE(pnp_config_w)
trunk/src/mame/drivers/speedbal.c
r23623r23624
8080{
8181   if (!m_leds_start)
8282      return;
83   
83
8484   m_leds_start = false;
8585
8686   // Each hypothetical led block has 3 7seg leds.
r23623r23624
362362
363363   for (int i=0;i<0x8000;i++)
364364   {
365     
366365      // some bits are ^ 0x05
367366      /*if ((i&0x30) == 0x00)
368367      {
369         if ((( i & 0x0f ) > 0x08)  &&  (( i & 0x0f ) < 0x0f)) MUSICBALL_XOR05
368          if ((( i & 0x0f ) > 0x08)  &&  (( i & 0x0f ) < 0x0f)) MUSICBALL_XOR05
370369      }
371370      */
372371
trunk/src/mame/mame.lst
r23623r23624
173173zerotime        // hack
174174starfght        // hack
175175galaxbsf        // hack
176galaxianbl      // bootleg
176galaxianbl      // bootleg
177177kamakazi3       // Video Games (UK) Ltd., hack or bootleg?
178178tst_galx        // Galaxian Test ROM
179179gmgalax         // bootleg
r23623r23624
186186gteikob2        // bootleg
187187galemp          // (c) Taito do Brasil
188188asideral        // bootleg
189pajaroes      // bootleg
189pajaroes        // bootleg
190190spacbatt        // bootleg
191191spacbat2        // bootleg
192192spacempr        // bootleg
r23623r23624
246246eagle3          // [1980] Centuri
247247spctbird        // (c) Fortrek
248248mooncptc        // bootleg (Petaco S.A.)
249mooncrsl      // bootleg (Laguna S.A.)
249mooncrsl        // bootleg (Laguna S.A.)
250250fantastc        // (c) Taito (Brazil) - rewrite of Galaga
251251timefgtr        // (c) Taito (Brazil) - rewrite of Time Pilot
252252kong            // (c) Taito (Brazil) - rewrite of Donkey Kong
r23623r23624
300300scramblebb      // bootleg?
301301scramblb        // bootleg
302302scramb2         // bootleg
303scrambler      // bootleg
303scrambler       // bootleg
304304explorer        // bootleg
305305strfbomb        // bootleg
306scrambp         // bootleg (Billport S.A.)
307scrampt         // bootleg (Petaco S.A.)
306scrambp         // bootleg (Billport S.A.)
307scrampt         // bootleg (Petaco S.A.)
308308atlantis        // (c) 1981 Comsoft
309309atlantis2       // (c) 1981 Comsoft
310310theend          // (c) 1980 Konami
r23623r23624
412412ccboot          // bootleg
413413ccboot2         // bootleg
414414ccbootmr        // Model Racing bootleg
415cclimbroper      // Operamatic bootleg
415cclimbroper     // Operamatic bootleg
416416ckong           // (c) 1981 (Kyoei)
417417ckongo          // bootleg (Orca)
418418ckongalc        // bootleg (Alca)
r23623r23624
680680griffon         // bootleg (Videotron)
681681nextfase        // bootleg
682682phoenixs        // bootleg (Sonic)
683avefenix      //
683avefenix        //
684684pleiads         // (c) 1981 Tehkan
685685pleiadsb2       // bootleg
686686pleiadbl        // bootleg
r23623r23624
14931493spceking        // (c) 1978 Leijac Corporation (Konami)
14941494spcewars        // (c) 1978 Sanritsu
14951495astropal        // (c) 19?? Sidam
1496attackfc      // (c) 1979? E.G.S.
1496attackfc        // (c) 1979? E.G.S.
14971497cosmo           // TDS & Mints
14981498darthvdr        // bootleg
14991499ultrainv
r23623r23624
27512751mayday          // bootleg
27522752maydaya         // bootleg
27532753maydayb         // bootleg
2754batlzone      // bootleg?
2754batlzone        // bootleg?
27552755colony7         // (c) 1981 Taito
27562756colony7a        // (c) 1981 Taito
27572757jin             // Falcon bootleg/hack
r23623r23624
40864086starrkr         // (c) 1981 Sega
40874087brdrlins        // Sidam bootleg
40884088brdrlinb        // Karateco bootleg
4089brdrlinet      // (c) 1981 Sega
4089brdrlinet       // (c) 1981 Sega
40904090digger          // 684-691 no copyright notice
40914091pulsar          // 790-805 (c) 1981 Sega
40924092heiankyo        // (c) [1979?] Denki Onkyo
r23623r23624
54635463ctornado        // 20 1982.05 Tornado
54645464cmissnx         // 21 1982.04 Mission-X/Zoar
54655465cptennis        // 22 1982.06 Pro Tennis
5466cprogolf18      // 23 1982.?? 18 Hole Pro Golf
5466cprogolf18      // 23 1982.?? 18 Hole Pro Golf
54675467            // 24 1982.07 Tsumego Kaisyou
54685468cadanglr        // 25 1982.10 Angler Dangler
54695469cfishing        // 25 1982.10 Fishing
r23623r23624
65756575asteroid2       // 035127-035145    (c) 1979
65766576asteroid1       // 035127-035145    no copyright notice
65776577asteroidb       // (bootleg)
6578aerolitos      // Rodmar Elec. bootleg
6578aerolitos       // Rodmar Elec. bootleg
65796579asterock        // Sidam bootleg    (c) 1979
65806580asterockv       // Videotron bootleg(c) 1979
65816581hyperspc        // Rumiano bootleg  (c) 1979
r23623r23624
69946994satansat        // (c) 1981 SNK
69956995satansata       // (c) 1981 SNK
69966996zarzon          // (c) 1981 Taito, gameplay says SNK
6997satansatind      // bootleg
6997satansatind     // bootleg
69986998vanguard        // (c) 1981 SNK
69996999vanguardc       // (c) 1981 SNK + Centuri
70007000vanguardj       // (c) 1981 SNK
r23623r23624
74307430btlfield        // Alpha-68K96II 'BT' (c) 1987
74317431btlfieldb       // bootleg
74327432skysoldr        // Alpha-68K96II 'SS' (c) 1988 SNK (Romstar with dip switch)
7433skysoldrbl      // bootleg
7433skysoldrbl      // bootleg
74347434goldmedl        // Alpha-68K96II 'GM' (c) 1988 SNK
74357435goldmedla       // Alpha-68K96II 'GM' (c) 1988 SNK
74367436goldmedlb       // Alpha-68K96II bootleg
r23623r23624
74557455ssozumo         // TA-0008 (c) 1984
74567456mystston        // TA-0010 (c) 1984
74577457myststono       // TA-0010 (c) 1984
7458myststonoi      // PCB manufactured by Itisa
7458myststonoi      // PCB manufactured by Itisa
74597459dogfgt          // TA-0011 (c) 1984
74607460dogfgtu         // TA-0011 (c) 1985 Data East USA, Inc.
74617461dogfgtj         // TA-0011 (c) 1984
r23623r23624
88998899
89008900// Tecfri games
89018901ambush          // (c) 1983
8902ambushh         // (c) 1983
8902ambushh         // (c) 1983
89038903ambushj         // (c) 1983 Nippon Amuse license
89048904ambushv         // (c) 1983 Volt Electronics license
89058905holeland        // (c) 1984
r23623r23624
89078907crzrallya       // (c) 1985
89088908crzrallyg       // (c) 1985
89098909speedbal        // (c) 1987
8910musicbal      // (c) 1987
8910musicbal        // (c) 1987
89118911sauro           // (c) 1987
89128912saurop          // (c) 1987
89138913trckydoc        // (c) 1987
r23623r23624
3063230632
3063330633number1    // 1996 San Remo Games
3063430634gluck2     // 1992 Yung Yu / CYE
30635
30636
trunk/src/mame/audio/redbaron.h
r23623r23624
99{
1010public:
1111   redbaron_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
12   
12
1313   DECLARE_WRITE8_MEMBER( sounds_w );
14   
14
1515protected:
1616   // device-level overrides
1717   virtual void device_start();
trunk/src/mame/audio/snes_snd.c
r23623r23624
176176void snes_sound_device::device_start()
177177{
178178   m_channel = machine().sound().stream_alloc(*this, 0, 2, 32000, this);
179   
179
180180   m_ram = auto_alloc_array_clear(machine(), UINT8, SNES_SPCRAM_SIZE);
181   
181
182182   /* put IPL image at the top of RAM */
183183   memcpy(m_ipl_region, machine().root_device().memregion("sound_ipl")->base(), 64);
184   
184
185185   /* Initialize the timers */
186186   m_timer[0] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(snes_sound_device::spc_timer),this));
187187   m_timer[0]->adjust(attotime::from_hz(8000),  0, attotime::from_hz(8000));
r23623r23624
192192   m_timer[2] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(snes_sound_device::spc_timer),this));
193193   m_timer[2]->adjust(attotime::from_hz(64000), 2, attotime::from_hz(64000));
194194   m_timer[2]->enable(false);
195   
195
196196   state_register();
197197   save_pointer(NAME(m_ram), SNES_SPCRAM_SIZE);
198198}
r23623r23624
205205{
206206   /* default to ROM visible */
207207   m_ram[0xf1] = 0x80;
208   
208
209209   /* Sort out the ports */
210210   for (int i = 0; i < 4; i++)
211211   {
212212      m_port_in[i] = 0;
213213      m_port_out[i] = 0;
214214   }
215   
215
216216   dsp_reset();
217217}
218218
r23623r23624
12421242void snes_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
12431243{
12441244   short mix[2];
1245   
1245
12461246   for (int i = 0; i < samples; i++)
12471247   {
12481248      mix[0] = mix[1] = 0;
12491249      dsp_update(mix);
1250     
1250
12511251      /* Update the buffers */
12521252      outputs[0][i] = (stream_sample_t)mix[0];
12531253      outputs[1][i] = (stream_sample_t)mix[1];
trunk/src/mame/audio/geebee.c
r23623r23624
1212
1313
1414const device_type GEEBEE = &device_creator<geebee_sound_device>;
15
15
1616geebee_sound_device::geebee_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1717   : device_t(mconfig, GEEBEE, "Gee Bee Custom", tag, owner, clock),
1818      device_sound_interface(mconfig, *this),
r23623r23624
2626      m_vcount(0)
2727{
2828}
29
29
3030//-------------------------------------------------
3131//  device_config_complete - perform any
3232//  operations now that the configuration is
3333//  complete
3434//-------------------------------------------------
35
35
3636void geebee_sound_device::device_config_complete()
3737{
3838}
39
39
4040//-------------------------------------------------
4141//  device_start - device-specific startup
4242//-------------------------------------------------
r23623r23624
6060   save_item(NAME(m_noise));
6161   save_item(NAME(m_vcount));
6262}
63
63
6464void geebee_sound_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
6565{
6666   switch (id)
r23623r23624
6969         if (--m_volume < 0)
7070            m_volume = 0;
7171         break;
72         
72
7373      default:
7474         assert_always(FALSE, "Unknown id in geebee_device::device_timer");
7575   }
r23623r23624
8181   m_sound_latch = data;
8282   m_volume = 0x7fff; /* set volume */
8383   m_noise = 0x0000;  /* reset noise shifter */
84    /* faster decay enabled? */
84   /* faster decay enabled? */
8585   if( m_sound_latch & 8 )
86    {
87       /*
88        * R24 is 10k, Rb is 0, C57 is 1uF
86   {
87      /*
88       * R24 is 10k, Rb is 0, C57 is 1uF
8989       * charge time t1 = 0.693 * (R24 + Rb) * C57 -> 0.22176s
9090       * discharge time t2 = 0.693 * (Rb) * C57 -> 0
9191       * Then C33 is only charged via D6 (1N914), not discharged!
r23623r23624
114114//-------------------------------------------------
115115
116116void geebee_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
117 {
118    stream_sample_t *buffer = outputs[0];
119 
120    while (samples--)
121    {
117   {
118   stream_sample_t *buffer = outputs[0];
119
120   while (samples--)
121   {
122122      *buffer++ = m_sound_signal;
123       /* 1V = HSYNC = 18.432MHz / 3 / 2 / 384 = 8000Hz */
124       {
123      /* 1V = HSYNC = 18.432MHz / 3 / 2 / 384 = 8000Hz */
124      {
125125         m_vcount++;
126          /* noise clocked with raising edge of 2V */
126         /* noise clocked with raising edge of 2V */
127127         if ((m_vcount & 3) == 2)
128          {
129             /* bit0 = bit0 ^ !bit10 */
128         {
129            /* bit0 = bit0 ^ !bit10 */
130130            if ((m_noise & 1) == ((m_noise >> 10) & 1))
131131               m_noise = ((m_noise << 1) & 0xfffe) | 1;
132             else
132            else
133133               m_noise = (m_noise << 1) & 0xfffe;
134          }
134         }
135135         switch (m_sound_latch & 7)
136          {
137          case 0: /* 4V */
136         {
137         case 0: /* 4V */
138138            m_sound_signal = (m_vcount & 0x04) ? m_decay[m_volume] : 0;
139             break;
140          case 1: /* 8V */
139            break;
140         case 1: /* 8V */
141141            m_sound_signal = (m_vcount & 0x08) ? m_decay[m_volume] : 0;
142             break;
143          case 2: /* 16V */
142            break;
143         case 2: /* 16V */
144144            m_sound_signal = (m_vcount & 0x10) ? m_decay[m_volume] : 0;
145             break;
146          case 3: /* 32V */
145            break;
146         case 3: /* 32V */
147147            m_sound_signal = (m_vcount & 0x20) ? m_decay[m_volume] : 0;
148             break;
149          case 4: /* TONE1 */
148            break;
149         case 4: /* TONE1 */
150150            m_sound_signal = !(m_vcount & 0x01) && !(m_vcount & 0x10) ? m_decay[m_volume] : 0;
151             break;
152          case 5: /* TONE2 */
151            break;
152         case 5: /* TONE2 */
153153            m_sound_signal = !(m_vcount & 0x02) && !(m_vcount & 0x20) ? m_decay[m_volume] : 0;
154             break;
155          case 6: /* TONE3 */
154            break;
155         case 6: /* TONE3 */
156156            m_sound_signal = !(m_vcount & 0x04) && !(m_vcount & 0x40) ? m_decay[m_volume] : 0;
157             break;
158          default: /* NOISE */
159             /* QH of 74164 #4V */
157            break;
158         default: /* NOISE */
159            /* QH of 74164 #4V */
160160            m_sound_signal = (m_noise & 0x8000) ? m_decay[m_volume] : 0;
161          }
162         
163       }
164    }
165}
No newline at end of file
161         }
162
163      }
164   }
165}
trunk/src/mame/audio/snes_snd.h
r23623r23624
7373   DECLARE_WRITE8_MEMBER( spc_io_w );
7474   DECLARE_WRITE8_MEMBER( spc_ram_w );
7575   DECLARE_WRITE8_MEMBER( spc_port_in );
76   
77//   UINT8 *spc_get_ram() { return m_ram; }
7876
77//  UINT8 *spc_get_ram() { return m_ram; }
78
7979protected:
8080   // device-level overrides
8181   virtual void device_config_complete();
r23623r23624
8686   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
8787
8888private:
89   
89
9090   DECLARE_READ8_MEMBER(dsp_io_r);
9191   DECLARE_WRITE8_MEMBER(dsp_io_w);
9292   TIMER_CALLBACK_MEMBER(spc_timer);
r23623r23624
9494   void dsp_update(short *sound_ptr);
9595   int advance_envelope(int v);
9696   void state_register();
97   
97
9898   // internal state
9999   UINT8                   *m_ram;
100100   sound_stream            *m_channel;
101101   UINT8                   m_dsp_regs[256];      /* DSP registers */
102102   UINT8                   m_ipl_region[64];     /* SPC top 64 bytes */
103   
103
104104   int                     m_keyed_on;
105105   int                     m_keys;               /* 8-bits for 8 voices */
106106   voice_state_type        m_voice_state[8];
107   
107
108108   /* Noise stuff */
109109   int                     m_noise_cnt;
110110   int                     m_noise_lev;
111   
111
112112   /* These are for the FIR echo filter */
113113#ifndef NO_ECHO
114114   short                   m_fir_lbuf[8];
r23623r23624
116116   int                     m_fir_ptr;
117117   int                     m_echo_ptr;
118118#endif
119   
119
120120   /* timers */
121121   emu_timer               *m_timer[3];
122122   UINT8                   m_enabled[3];
123123   UINT16                  m_counter[3];
124   
124
125125   /* IO ports */
126126   UINT8                   m_port_in[4];         /* SPC input ports */
127127   UINT8                   m_port_out[4];        /* SPC output ports */
trunk/src/mame/audio/warpwarp.c
r23623r23624
1515
1616
1717const device_type WARPWARP = &device_creator<warpwarp_sound_device>;
18
18
1919warpwarp_sound_device::warpwarp_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2020   : device_t(mconfig, WARPWARP, "Warp Warp Custom", tag, owner, clock),
2121      device_sound_interface(mconfig, *this),
r23623r23624
4343//  operations now that the configuration is
4444//  complete
4545//-------------------------------------------------
46
46
4747void warpwarp_sound_device::device_config_complete()
4848{
4949}
50
50
5151//-------------------------------------------------
5252//  device_start - device-specific startup
5353//-------------------------------------------------
r23623r23624
7777   save_item(NAME(m_mcarry));
7878   save_item(NAME(m_mcount));
7979}
80
80
8181void warpwarp_sound_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
8282{
8383   switch (id)
8484   {
85      case TIMER_SOUND_VOLUME_DECAY:         
85      case TIMER_SOUND_VOLUME_DECAY:
8686         if (--m_sound_volume < 0)
8787            m_sound_volume = 0;
8888         break;
89         
89
9090      case TIMER_MUSIC_VOLUME_DECAY:
9191         if (--m_music_volume < 0)
9292            m_music_volume = 0;
9393         break;
94         
94
9595      default:
9696         assert_always(FALSE, "Unknown id in warpwarp_sound_device::device_timer");
9797   }
9898}
99
99
100100WRITE8_MEMBER( warpwarp_sound_device::sound_w )
101101{
102102   m_channel->update();
103103   m_sound_latch = data & 0x0f;
104104   m_sound_volume = 0x7fff; /* set sound_volume */
105105   m_noise = 0x0000;  /* reset noise shifter */
106 
107    /* faster decay enabled? */
106
107   /* faster decay enabled? */
108108   if( m_sound_latch & 8 )
109    {
110       /*
111        * R85(?) is 10k, Rb is 0, C92 is 1uF
109   {
110      /*
111       * R85(?) is 10k, Rb is 0, C92 is 1uF
112112       * charge time t1 = 0.693 * (R24 + Rb) * C57 -> 0.22176s
113113       * discharge time t2 = 0.693 * (Rb) * C57 -> 0
114114       * C90(?) is only charged via D17 (1N914), no discharge!
r23623r23624
139139   m_channel->update();
140140   m_music1_latch = data & 0x3f;
141141}
142
142
143143WRITE8_MEMBER( warpwarp_sound_device::music2_w )
144144{
145145   m_channel->update();
146146   m_music2_latch = data & 0x3f;
147147   m_music_volume = 0x7fff;
148    /* fast decay enabled? */
148   /* fast decay enabled? */
149149   if( m_music2_latch & 0x10 )
150    {
151       /*
152        * Ra (R83?) is 10k, Rb is 0, C92 is 1uF
150   {
151      /*
152       * Ra (R83?) is 10k, Rb is 0, C92 is 1uF
153153       * charge time t1 = 0.693 * (Ra + Rb) * C -> 0.22176s
154154       * discharge time is (nearly) zero, because Rb is zero
155155       * C95(?) is only charged via D17, not discharged!
r23623r23624
180180//-------------------------------------------------
181181
182182void warpwarp_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
183 {
184    stream_sample_t *buffer = outputs[0];
185 
186    while (samples--)
187    {
183   {
184   stream_sample_t *buffer = outputs[0];
185
186   while (samples--)
187   {
188188      *buffer++ = (m_sound_signal + m_music_signal) / 2;
189189
190190      /*
r23623r23624
198198       * ...
199199       * 48 =  64 steps -> 3000 Hz
200200       * ...
201        * 63 =   4 steps -> 48 kHz
202        */
201       * 63 =   4 steps -> 48 kHz
202       */
203203
204204      m_mcarry -= CLOCK_16H / (4 * (64 - m_music1_latch));
205205      while( m_mcarry < 0 )
206       {
206      {
207207         m_mcarry += CLOCK_16H;
208208         m_mcount++;
209209         m_music_signal = (m_mcount & ~m_music2_latch & 15) ? m_decay[m_music_volume] : 0;
210          /* override by noise gate? */
210         /* override by noise gate? */
211211         if( (m_music2_latch & 32) && (m_noise & 0x8000) )
212212            m_music_signal = m_decay[m_music_volume];
213       }
214 
215       /* clock 1V = 8kHz */
213      }
214
215      /* clock 1V = 8kHz */
216216      m_vcarry -= CLOCK_1V;
217217      while (m_vcarry < 0)
218       {
218      {
219219         m_vcarry += CLOCK_16H;
220220         m_vcount++;
221 
222          /* noise is clocked with raising edge of 2V */
221
222         /* noise is clocked with raising edge of 2V */
223223         if ((m_vcount & 3) == 2)
224          {
225             /* bit0 = bit0 ^ !bit10 */
224         {
225            /* bit0 = bit0 ^ !bit10 */
226226            if ((m_noise & 1) == ((m_noise >> 10) & 1))
227227               m_noise = (m_noise << 1) | 1;
228             else
228            else
229229               m_noise = m_noise << 1;
230          }
231 
230         }
231
232232         switch (m_sound_latch & 7)
233          {
234          case 0: /* 4V */
233         {
234         case 0: /* 4V */
235235            m_sound_signal = (m_vcount & 0x04) ? m_decay[m_sound_volume] : 0;
236             break;
237          case 1: /* 8V */
236            break;
237         case 1: /* 8V */
238238            m_sound_signal = (m_vcount & 0x08) ? m_decay[m_sound_volume] : 0;
239             break;
240          case 2: /* 16V */
239            break;
240         case 2: /* 16V */
241241            m_sound_signal = (m_vcount & 0x10) ? m_decay[m_sound_volume] : 0;
242             break;
243          case 3: /* 32V */
242            break;
243         case 3: /* 32V */
244244            m_sound_signal = (m_vcount & 0x20) ? m_decay[m_sound_volume] : 0;
245             break;
246          case 4: /* TONE1 */
245            break;
246         case 4: /* TONE1 */
247247            m_sound_signal = !(m_vcount & 0x01) && !(m_vcount & 0x10) ? m_decay[m_sound_volume] : 0;
248             break;
249          case 5: /* TONE2 */
248            break;
249         case 5: /* TONE2 */
250250            m_sound_signal = !(m_vcount & 0x02) && !(m_vcount & 0x20) ? m_decay[m_sound_volume] : 0;
251             break;
252          case 6: /* TONE3 */
251            break;
252         case 6: /* TONE3 */
253253            m_sound_signal = !(m_vcount & 0x04) && !(m_vcount & 0x40) ? m_decay[m_sound_volume] : 0;
254             break;
255          default: /* NOISE */
256             /* QH of 74164 #4V */
254            break;
255         default: /* NOISE */
256            /* QH of 74164 #4V */
257257            m_sound_signal = (m_noise & 0x8000) ? m_decay[m_sound_volume] : 0;
258          }
259 
260       }
261    }
262}
No newline at end of file
258         }
259
260      }
261   }
262}
trunk/src/mame/audio/warpwarp.h
r23623r23624
33{
44public:
55   geebee_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
6   
6
77   enum
88   {
99      TIMER_VOLUME_DECAY
1010   };
11   
11
1212   DECLARE_WRITE8_MEMBER( sound_w );
13   
13
1414protected:
1515   // device-level overrides
1616   virtual void device_config_complete();
r23623r23624
1818
1919   // sound stream update overrides
2020   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
21   
21
2222   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
23   
23
2424private:
2525   // internal state
2626   UINT16 *m_decay;
r23623r23624
4949      TIMER_SOUND_VOLUME_DECAY,
5050      TIMER_MUSIC_VOLUME_DECAY
5151   };
52   
53   
52
53
5454   DECLARE_WRITE8_MEMBER( sound_w );
5555   DECLARE_WRITE8_MEMBER( music1_w );
5656   DECLARE_WRITE8_MEMBER( music2_w );
r23623r23624
5959   // device-level overrides
6060   virtual void device_config_complete();
6161   virtual void device_start();
62   
62
6363   // sound stream update overrides
6464   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
65   
65
6666   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
67   
67
6868private:
6969   // internal state
7070   INT16 *m_decay;
trunk/src/mame/audio/flower.c
r23623r23624
140140      for (voice = m_channel_list; voice < m_last_channel; voice++)
141141         voice->ecount += (voice->ecount < (1<<22));
142142      break;
143     
143
144144      default:
145145         assert_always(FALSE, "Unknown id in flower_sound_device::device_timer");
146146   }
trunk/src/mame/machine/namcoio.c
r23623r23624
141141      : namcoio_device(mconfig, NAMCO59XX, "Namco 59xx", tag, owner, clock, "59xx")
142142{
143143   m_device_type = TYPE_NAMCO59XX;
144}   
144}
145145
146146//-------------------------------------------------
147147//  device_config_complete - perform any
r23623r23624
155155   const namcoio_interface *intf = reinterpret_cast<const namcoio_interface *>(static_config());
156156   if (intf != NULL)
157157      *static_cast<namcoio_interface *>(this) = *intf;
158   
158
159159   // or initialize to defaults if none provided
160160   else
161161   {
trunk/src/mame/machine/namcoio.h
r23623r23624
1717public:
1818   namcoio_device(const machine_config &mconfig, device_type type, const char* name, const char *tag, device_t *owner, UINT32 clock, const char *shortname);
1919
20   
20
2121   DECLARE_READ8_MEMBER( read );
2222   DECLARE_WRITE8_MEMBER( write );
2323
r23623r23624
2929   virtual void device_config_complete();
3030   virtual void device_start();
3131   virtual void device_reset();
32   
32
3333   int m_device_type;
34   
34
3535   enum {
3636         TYPE_NAMCO56XX,
3737         TYPE_NAMCO58XX,
3838         TYPE_NAMCO59XX,
3939      };
40   
40
4141   // internal state
4242   UINT8          m_ram[16];
4343
r23623r23624
5151   INT32          m_coins_per_cred[2];
5252   INT32          m_creds_per_coin[2];
5353   INT32          m_in_count;
54   
54
5555   void handle_coins( int swap );
5656
5757   virtual void customio_run() {}
58   
58
5959private:
6060
6161};
trunk/src/mame/machine/pgmprot5.c
r23623r23624
4444// All tables all xored by 'warning' information at $1354ee (drgw2)
4545static const UINT8 drgw2_source_data[0x08][0xec] =
4646{
47   { 0, },   // Region 0, not used
48   {    // Region 1, $13A886
49      0x67, 0x51, 0xF3, 0x19, 0xA0, 0x11, 0xB1, 0x11, 0xB0, 0xEE, 0xE3, 0xF6, 0xBE, 0x81, 0x35, 0xE3,
50      0xFB, 0xE6, 0xEF, 0xDF, 0x61, 0x01, 0xFA, 0x22, 0x5D, 0x43, 0x01, 0xA5, 0x3B, 0x17, 0xD4, 0x74,
51      0xF0, 0xF4, 0xF3, 0x43, 0xB5, 0x19, 0x04, 0xD5, 0x84, 0xCE, 0x87, 0xFE, 0x35, 0x3E, 0xC4, 0x3C,
52      0xC7, 0x85, 0x2A, 0x33, 0x00, 0x86, 0xD0, 0x4D, 0x65, 0x4B, 0xF9, 0xE9, 0xC0, 0xBA, 0xAA, 0x77,
53      0x9E, 0x66, 0xF6, 0x0F, 0x4F, 0x3A, 0xB6, 0xF1, 0x64, 0x9A, 0xE9, 0x25, 0x1A, 0x5F, 0x22, 0xA3,
54      0xA2, 0xBF, 0x4B, 0x77, 0x3F, 0x34, 0xC9, 0x6E, 0xDB, 0x12, 0x5C, 0x33, 0xA5, 0x8B, 0x6C, 0xB1,
55      0x74, 0xC8, 0x40, 0x4E, 0x2F, 0xE7, 0x46, 0xAE, 0x99, 0xFC, 0xB0, 0x55, 0x54, 0xDF, 0xA7, 0xA1,
56      0x0F, 0x5E, 0x49, 0xCF, 0x56, 0x3C, 0x90, 0x2B, 0xAC, 0x65, 0x6E, 0xDB, 0x58, 0x3E, 0xC9, 0x00,
57      0xAE, 0x53, 0x4D, 0x92, 0xFA, 0x40, 0xB2, 0x6B, 0x65, 0x4B, 0x90, 0x8A, 0x0C, 0xE2, 0xA5, 0x9A,
58      0xD0, 0x20, 0x29, 0x55, 0xA4, 0x44, 0xAC, 0x51, 0x87, 0x54, 0x53, 0x34, 0x24, 0x4B, 0x81, 0x67,
59      0x34, 0x4C, 0x5F, 0x31, 0x4E, 0xF2, 0xF1, 0x19, 0x18, 0x1C, 0x34, 0x38, 0xE1, 0x81, 0x17, 0xCF,
60      0x24, 0xB9, 0x9A, 0xCB, 0x34, 0x51, 0x50, 0x59, 0x44, 0xB1, 0x0B, 0x50, 0x95, 0x6C, 0x48, 0x7E,
61      0x14, 0xA4, 0xC6, 0xD9, 0xD3, 0xA5, 0xD6, 0xD0, 0xC5, 0x97, 0xF0, 0x45, 0xD0, 0x98, 0x51, 0x91,
62      0x9F, 0xA3, 0x43, 0x51, 0x05, 0x90, 0xEE, 0xCA, 0x7E, 0x5F, 0x72, 0x53, 0xB1, 0xD3, 0xAF, 0x36,
47   { 0, }, // Region 0, not used
48   {   // Region 1, $13A886
49      0x67, 0x51, 0xF3, 0x19, 0xA0, 0x11, 0xB1, 0x11, 0xB0, 0xEE, 0xE3, 0xF6, 0xBE, 0x81, 0x35, 0xE3,
50      0xFB, 0xE6, 0xEF, 0xDF, 0x61, 0x01, 0xFA, 0x22, 0x5D, 0x43, 0x01, 0xA5, 0x3B, 0x17, 0xD4, 0x74,
51      0xF0, 0xF4, 0xF3, 0x43, 0xB5, 0x19, 0x04, 0xD5, 0x84, 0xCE, 0x87, 0xFE, 0x35, 0x3E, 0xC4, 0x3C,
52      0xC7, 0x85, 0x2A, 0x33, 0x00, 0x86, 0xD0, 0x4D, 0x65, 0x4B, 0xF9, 0xE9, 0xC0, 0xBA, 0xAA, 0x77,
53      0x9E, 0x66, 0xF6, 0x0F, 0x4F, 0x3A, 0xB6, 0xF1, 0x64, 0x9A, 0xE9, 0x25, 0x1A, 0x5F, 0x22, 0xA3,
54      0xA2, 0xBF, 0x4B, 0x77, 0x3F, 0x34, 0xC9, 0x6E, 0xDB, 0x12, 0x5C, 0x33, 0xA5, 0x8B, 0x6C, 0xB1,
55      0x74, 0xC8, 0x40, 0x4E, 0x2F, 0xE7, 0x46, 0xAE, 0x99, 0xFC, 0xB0, 0x55, 0x54, 0xDF, 0xA7, 0xA1,
56      0x0F, 0x5E, 0x49, 0xCF, 0x56, 0x3C, 0x90, 0x2B, 0xAC, 0x65, 0x6E, 0xDB, 0x58, 0x3E, 0xC9, 0x00,
57      0xAE, 0x53, 0x4D, 0x92, 0xFA, 0x40, 0xB2, 0x6B, 0x65, 0x4B, 0x90, 0x8A, 0x0C, 0xE2, 0xA5, 0x9A,
58      0xD0, 0x20, 0x29, 0x55, 0xA4, 0x44, 0xAC, 0x51, 0x87, 0x54, 0x53, 0x34, 0x24, 0x4B, 0x81, 0x67,
59      0x34, 0x4C, 0x5F, 0x31, 0x4E, 0xF2, 0xF1, 0x19, 0x18, 0x1C, 0x34, 0x38, 0xE1, 0x81, 0x17, 0xCF,
60      0x24, 0xB9, 0x9A, 0xCB, 0x34, 0x51, 0x50, 0x59, 0x44, 0xB1, 0x0B, 0x50, 0x95, 0x6C, 0x48, 0x7E,
61      0x14, 0xA4, 0xC6, 0xD9, 0xD3, 0xA5, 0xD6, 0xD0, 0xC5, 0x97, 0xF0, 0x45, 0xD0, 0x98, 0x51, 0x91,
62      0x9F, 0xA3, 0x43, 0x51, 0x05, 0x90, 0xEE, 0xCA, 0x7E, 0x5F, 0x72, 0x53, 0xB1, 0xD3, 0xAF, 0x36,
6363      0x08, 0x75, 0xB0, 0x9B, 0xE0, 0x0D, 0x43, 0x88, 0xAA, 0x27, 0x44, 0x11
6464   },
65   { 0, },   // Region 2, not used
66   { 0, },   // Region 3, not used
67   { 0, },   // Region 4, not used
68   {   // Region 5, $13ab42 (drgw2c)
69      0x7F, 0x41, 0xF3, 0x39, 0xA0, 0x11, 0xA1, 0x11, 0xB0, 0xA2, 0x4C, 0x23, 0x13, 0xE9, 0x25, 0x3D,
70      0x0F, 0x72, 0x3A, 0x9D, 0xB5, 0x96, 0xD1, 0xDA, 0x07, 0x29, 0x41, 0x9A, 0xAD, 0x70, 0xBA, 0x46,
71      0x63, 0x2B, 0x7F, 0x3D, 0xBE, 0x40, 0xAD, 0xD4, 0x4C, 0x73, 0x27, 0x58, 0xA7, 0x65, 0xDC, 0xD6,
72      0xFD, 0xDE, 0xB5, 0x6E, 0xD6, 0x6C, 0x75, 0x1A, 0x32, 0x45, 0xD5, 0xE3, 0x6A, 0x14, 0x6D, 0x80,
73      0x84, 0x15, 0xAF, 0xCC, 0x7B, 0x61, 0x51, 0x82, 0x40, 0x53, 0x7F, 0x38, 0xA0, 0xD6, 0x8F, 0x61,
74      0x79, 0x19, 0xE5, 0x99, 0x84, 0xD8, 0x78, 0x27, 0x3F, 0x16, 0x97, 0x78, 0x4F, 0x7B, 0x0C, 0xA6,
75      0x37, 0xDB, 0xC6, 0x0C, 0x24, 0xB4, 0xC7, 0x94, 0x9D, 0x92, 0xD2, 0x3B, 0xD5, 0x11, 0x6F, 0x0A,
76      0xDB, 0x76, 0x66, 0xE7, 0xCD, 0x18, 0x2B, 0x66, 0xD8, 0x41, 0x40, 0x58, 0xA2, 0x01, 0x1E, 0x6D,
77      0x44, 0x75, 0xE7, 0x19, 0x4F, 0xB2, 0xE8, 0xC4, 0x96, 0x77, 0x62, 0x02, 0xC9, 0xDC, 0x59, 0xF3,
78      0x43, 0x8D, 0xC8, 0xFE, 0x9E, 0x2A, 0xBA, 0x32, 0x3B, 0x62, 0xE3, 0x92, 0x6E, 0xC2, 0x08, 0x4D,
79      0x51, 0xCD, 0xF9, 0x3A, 0x3E, 0xC9, 0x50, 0x27, 0x21, 0x25, 0x97, 0xD7, 0x0E, 0xF8, 0x39, 0x38,
80      0xF5, 0x86, 0x94, 0x93, 0xBF, 0xEB, 0x18, 0xA8, 0xFC, 0x24, 0xF5, 0xF9, 0x99, 0x20, 0x3D, 0xCD,
81      0x2C, 0x94, 0x25, 0x79, 0x28, 0x77, 0x8F, 0x2F, 0x10, 0x69, 0x86, 0x30, 0x43, 0x01, 0xD7, 0x9A,
82      0x17, 0xE3, 0x47, 0x37, 0xBD, 0x62, 0x75, 0x42, 0x78, 0xF4, 0x2B, 0x57, 0x4C, 0x0A, 0xDB, 0x53,
65   { 0, }, // Region 2, not used
66   { 0, }, // Region 3, not used
67   { 0, }, // Region 4, not used
68   {   // Region 5, $13ab42 (drgw2c)
69      0x7F, 0x41, 0xF3, 0x39, 0xA0, 0x11, 0xA1, 0x11, 0xB0, 0xA2, 0x4C, 0x23, 0x13, 0xE9, 0x25, 0x3D,
70      0x0F, 0x72, 0x3A, 0x9D, 0xB5, 0x96, 0xD1, 0xDA, 0x07, 0x29, 0x41, 0x9A, 0xAD, 0x70, 0xBA, 0x46,
71      0x63, 0x2B, 0x7F, 0x3D, 0xBE, 0x40, 0xAD, 0xD4, 0x4C, 0x73, 0x27, 0x58, 0xA7, 0x65, 0xDC, 0xD6,
72      0xFD, 0xDE, 0xB5, 0x6E, 0xD6, 0x6C, 0x75, 0x1A, 0x32, 0x45, 0xD5, 0xE3, 0x6A, 0x14, 0x6D, 0x80,
73      0x84, 0x15, 0xAF, 0xCC, 0x7B, 0x61, 0x51, 0x82, 0x40, 0x53, 0x7F, 0x38, 0xA0, 0xD6, 0x8F, 0x61,
74      0x79, 0x19, 0xE5, 0x99, 0x84, 0xD8, 0x78, 0x27, 0x3F, 0x16, 0x97, 0x78, 0x4F, 0x7B, 0x0C, 0xA6,
75      0x37, 0xDB, 0xC6, 0x0C, 0x24, 0xB4, 0xC7, 0x94, 0x9D, 0x92, 0xD2, 0x3B, 0xD5, 0x11, 0x6F, 0x0A,
76      0xDB, 0x76, 0x66, 0xE7, 0xCD, 0x18, 0x2B, 0x66, 0xD8, 0x41, 0x40, 0x58, 0xA2, 0x01, 0x1E, 0x6D,
77      0x44, 0x75, 0xE7, 0x19, 0x4F, 0xB2, 0xE8, 0xC4, 0x96, 0x77, 0x62, 0x02, 0xC9, 0xDC, 0x59, 0xF3,
78      0x43, 0x8D, 0xC8, 0xFE, 0x9E, 0x2A, 0xBA, 0x32, 0x3B, 0x62, 0xE3, 0x92, 0x6E, 0xC2, 0x08, 0x4D,
79      0x51, 0xCD, 0xF9, 0x3A, 0x3E, 0xC9, 0x50, 0x27, 0x21, 0x25, 0x97, 0xD7, 0x0E, 0xF8, 0x39, 0x38,
80      0xF5, 0x86, 0x94, 0x93, 0xBF, 0xEB, 0x18, 0xA8, 0xFC, 0x24, 0xF5, 0xF9, 0x99, 0x20, 0x3D, 0xCD,
81      0x2C, 0x94, 0x25, 0x79, 0x28, 0x77, 0x8F, 0x2F, 0x10, 0x69, 0x86, 0x30, 0x43, 0x01, 0xD7, 0x9A,
82      0x17, 0xE3, 0x47, 0x37, 0xBD, 0x62, 0x75, 0x42, 0x78, 0xF4, 0x2B, 0x57, 0x4C, 0x0A, 0xDB, 0x53,
8383      0x4D, 0xA1, 0x0A, 0xD6, 0x3A, 0x16, 0x15, 0xAA, 0x2C, 0x6C, 0x39, 0x42
8484   },
85   {   // Region 6, $13ab42 (drgw2), $13ab2e (dw2v100x)
86      0x12, 0x09, 0xF3, 0x29, 0xA0, 0x11, 0xA0, 0x11, 0xB0, 0xD5, 0x66, 0xA1, 0x28, 0x4A, 0x21, 0xC0,
87      0xD3, 0x9B, 0x86, 0x80, 0x57, 0x6F, 0x41, 0xC2, 0xE4, 0x2F, 0x0B, 0x91, 0xBD, 0x3A, 0x7A, 0xBA,
88      0x00, 0xE5, 0x35, 0x02, 0x74, 0x7D, 0x8B, 0x21, 0x57, 0x10, 0x0F, 0xAE, 0x44, 0xBB, 0xE2, 0x37,
89      0x18, 0x7B, 0x52, 0x3D, 0x8C, 0x59, 0x9E, 0x20, 0x1F, 0x0A, 0xCC, 0x1C, 0x8E, 0x6A, 0xD7, 0x95,
90      0x2B, 0x34, 0xB0, 0x82, 0x6D, 0xFD, 0x25, 0x33, 0xAA, 0x3B, 0x2B, 0x70, 0x15, 0x87, 0x31, 0x5D,
91      0xBB, 0x29, 0x19, 0x95, 0xD5, 0x8E, 0x24, 0x28, 0x5E, 0xD0, 0x20, 0x83, 0x46, 0x4A, 0x21, 0x70,
92      0x5B, 0xCD, 0xAE, 0x7B, 0x61, 0xA1, 0xFA, 0xF4, 0x2B, 0x84, 0x15, 0x6E, 0x36, 0x5D, 0x1B, 0x24,
93      0x0F, 0x09, 0x3A, 0x61, 0x38, 0x0F, 0x18, 0x35, 0x11, 0x38, 0xB4, 0xBD, 0xEE, 0xF7, 0xEC, 0x0F,
94      0x1D, 0xB7, 0x48, 0x01, 0xAA, 0x09, 0x8F, 0x61, 0xB5, 0x0F, 0x1D, 0x26, 0x39, 0x2E, 0x8C, 0xD6,
95      0x26, 0x5C, 0x3D, 0x23, 0x63, 0xE9, 0x6B, 0x97, 0xB4, 0x9F, 0x7B, 0xB6, 0xBA, 0xA0, 0x7C, 0xC6,
96      0x25, 0xA1, 0x73, 0x36, 0x67, 0x7F, 0x74, 0x1E, 0x1D, 0xDA, 0x70, 0xBF, 0xA5, 0x63, 0x35, 0x39,
97      0x24, 0x8C, 0x9F, 0x85, 0x16, 0xD8, 0x50, 0x95, 0x71, 0xC0, 0xF6, 0x1E, 0x6D, 0x80, 0xED, 0x15,
98      0xEB, 0x63, 0xE9, 0x1B, 0xF6, 0x78, 0x31, 0xC6, 0x5C, 0xDD, 0x19, 0xBD, 0xDF, 0xA7, 0xEC, 0x50,
99      0x22, 0xAD, 0xBB, 0xF6, 0xEB, 0xD6, 0xA3, 0x20, 0xC9, 0xE6, 0x9F, 0xCB, 0xF2, 0x97, 0xB9, 0x54,
85   {   // Region 6, $13ab42 (drgw2), $13ab2e (dw2v100x)
86      0x12, 0x09, 0xF3, 0x29, 0xA0, 0x11, 0xA0, 0x11, 0xB0, 0xD5, 0x66, 0xA1, 0x28, 0x4A, 0x21, 0xC0,
87      0xD3, 0x9B, 0x86, 0x80, 0x57, 0x6F, 0x41, 0xC2, 0xE4, 0x2F, 0x0B, 0x91, 0xBD, 0x3A, 0x7A, 0xBA,
88      0x00, 0xE5, 0x35, 0x02, 0x74, 0x7D, 0x8B, 0x21, 0x57, 0x10, 0x0F, 0xAE, 0x44, 0xBB, 0xE2, 0x37,
89      0x18, 0x7B, 0x52, 0x3D, 0x8C, 0x59, 0x9E, 0x20, 0x1F, 0x0A, 0xCC, 0x1C, 0x8E, 0x6A, 0xD7, 0x95,
90      0x2B, 0x34, 0xB0, 0x82, 0x6D, 0xFD, 0x25, 0x33, 0xAA, 0x3B, 0x2B, 0x70, 0x15, 0x87, 0x31, 0x5D,
91      0xBB, 0x29, 0x19, 0x95, 0xD5, 0x8E, 0x24, 0x28, 0x5E, 0xD0, 0x20, 0x83, 0x46, 0x4A, 0x21, 0x70,
92      0x5B, 0xCD, 0xAE, 0x7B, 0x61, 0xA1, 0xFA, 0xF4, 0x2B, 0x84, 0x15, 0x6E, 0x36, 0x5D, 0x1B, 0x24,
93      0x0F, 0x09, 0x3A, 0x61, 0x38, 0x0F, 0x18, 0x35, 0x11, 0x38, 0xB4, 0xBD, 0xEE, 0xF7, 0xEC, 0x0F,
94      0x1D, 0xB7, 0x48, 0x01, 0xAA, 0x09, 0x8F, 0x61, 0xB5, 0x0F, 0x1D, 0x26, 0x39, 0x2E, 0x8C, 0xD6,
95      0x26, 0x5C, 0x3D, 0x23, 0x63, 0xE9, 0x6B, 0x97, 0xB4, 0x9F, 0x7B, 0xB6, 0xBA, 0xA0, 0x7C, 0xC6,
96      0x25, 0xA1, 0x73, 0x36, 0x67, 0x7F, 0x74, 0x1E, 0x1D, 0xDA, 0x70, 0xBF, 0xA5, 0x63, 0x35, 0x39,
97      0x24, 0x8C, 0x9F, 0x85, 0x16, 0xD8, 0x50, 0x95, 0x71, 0xC0, 0xF6, 0x1E, 0x6D, 0x80, 0xED, 0x15,
98      0xEB, 0x63, 0xE9, 0x1B, 0xF6, 0x78, 0x31, 0xC6, 0x5C, 0xDD, 0x19, 0xBD, 0xDF, 0xA7, 0xEC, 0x50,
99      0x22, 0xAD, 0xBB, 0xF6, 0xEB, 0xD6, 0xA3, 0x20, 0xC9, 0xE6, 0x9F, 0xCB, 0xF2, 0x97, 0xB9, 0x54,
100100      0x12, 0x66, 0xA6, 0xBE, 0x4A, 0x12, 0x43, 0xEC, 0x00, 0xEA, 0x49, 0x02
101101   },
102   { 0, }   // Region 7, not used
102   { 0, }  // Region 7, not used
103103};
104104
105105void pgm_012_025_state::drgw2_protection_calculate_hold(int y, int z)
r23623r23624
142142{
143143   switch (m_drgw2_cmd)
144144   {
145           case 0x05:
145         case 0x05:
146146      {
147147         switch (m_drgw2_ptr)
148148         {
r23623r23624
169169         drgw2_protection_calculate_hilo();
170170         return 0;
171171
172   //   case 0x13: // Read to $80eeb8
173   //   case 0x1f: // Read to $80eeb8
174   //   case 0xf4: // Read to $80eeb8
175   //   case 0xf6: // Read to $80eeb8
176   //   case 0xf8: // Read to $80eeb8
177   //      return 0;
178   
179   //   default:
180   //      logerror("%06x: warning, reading with igs003_reg = %02x\n", space.device().safe_pc(), m_drgw2_cmd);
172   //  case 0x13: // Read to $80eeb8
173   //  case 0x1f: // Read to $80eeb8
174   //  case 0xf4: // Read to $80eeb8
175   //  case 0xf6: // Read to $80eeb8
176   //  case 0xf8: // Read to $80eeb8
177   //      return 0;
178
179   //  default:
180   //      logerror("%06x: warning, reading with igs003_reg = %02x\n", space.device().safe_pc(), m_drgw2_cmd);
181181   }
182182
183183   return 0;
r23623r23624
205205         drgw2_protection_calculate_hold(m_drgw2_cmd & 0x0f, data & 0xff);
206206      break;
207207
208   //   case 0x08: // Used only on init..
209   //   case 0x09:
210   //   case 0x0a:
211   //   case 0x0b:
212   //   case 0x0c:
213   //   break;
208   //  case 0x08: // Used only on init..
209   //  case 0x09:
210   //  case 0x0a:
211   //  case 0x0b:
212   //  case 0x0c:
213   //  break;
214214
215   //   case 0x15: // ????
216   //   case 0x17:
217   //   case 0xf2:
218   //   break;
215   //  case 0x15: // ????
216   //  case 0x17:
217   //  case 0xf2:
218   //  break;
219219
220   //   default:
221   //      logerror("%06x: warning, writing to igs003_reg %02x = %02x\n", space.device().safe_pc(), m_drgw2_cmd, data);
220   //  default:
221   //      logerror("%06x: warning, writing to igs003_reg %02x = %02x\n", space.device().safe_pc(), m_drgw2_cmd, data);
222222   }
223223}
224224
r23623r23624
250250static ADDRESS_MAP_START( drgw2_mem, AS_PROGRAM, 16, pgm_012_025_state )
251251   AM_IMPORT_FROM(pgm_mem)
252252   AM_RANGE(0x100000, 0x1fffff) AM_ROMBANK("bank1") /* Game ROM */
253   AM_RANGE(0xd00000, 0xd00fff) AM_NOP   // Written, but never read back? Related to the protection device?
253   AM_RANGE(0xd00000, 0xd00fff) AM_NOP // Written, but never read back? Related to the protection device?
254254   AM_RANGE(0xd80000, 0xd80003) AM_READWRITE(drgw2_d80000_protection_r, drgw2_d80000_protection_w)
255255ADDRESS_MAP_END
256256
trunk/src/mame/machine/naomig1.c
r23623r23624
2525
2626naomi_g1_device::naomi_g1_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
2727   : device_t(mconfig, type, name, tag, owner, clock),
28     irq_cb(*this)
28      irq_cb(*this)
2929{
3030}
3131
trunk/src/mame/machine/nmk112.c
r23623r23624
3030
3131void nmk112_device::device_config_complete()
3232{
33
3433}
3534
3635//-------------------------------------------------
r23623r23624
4039void nmk112_device::device_start()
4140{
4241   const nmk112_interface *intf = (const nmk112_interface *)static_config();
43   
42
4443   if (intf->rgn0 == NULL)
4544   {
4645      m_rom0 = NULL;
trunk/src/mame/machine/nmk112.h
r23623r23624
3232   virtual void device_config_complete();
3333   virtual void device_start();
3434   virtual void device_reset();
35   
35
3636private:
3737   void do_bankswitch( int offset, int data );
3838   void postload_bankswitch();
39   
39
4040   // internal state
41   
41
4242   /* which chips have their sample address table divided into pages */
4343   UINT8 m_page_mask;
4444
trunk/src/mame/machine/mpeg573.c
r23623r23624
4242MACHINE_CONFIG_END
4343
4444mpeg573_device::mpeg573_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
45  : device_t(mconfig, MPEG573, "Konami 573 digital audio board", tag, owner, clock, "mpeg573", __FILE__),
45   : device_t(mconfig, MPEG573, "Konami 573 digital audio board", tag, owner, clock, "mpeg573", __FILE__),
4646   mas3507d(*this, "mpeg"),
4747   digital_id(*this, "digital_id"),
48    output_cb(*this)
48   output_cb(*this)
4949{
5050}
5151
r23623r23624
156156WRITE16_MEMBER(mpeg573_device::mpeg_ctrl_w)
157157{
158158   logerror("FPGA MPEG control %c%c%c\n",
159          data & 0x8000 ? '#' : '.',
160          data & 0x4000 ? '#' : '.',
161          data & 0x2000 ? '#' : '.');
159            data & 0x8000 ? '#' : '.',
160            data & 0x4000 ? '#' : '.',
161            data & 0x2000 ? '#' : '.');
162162}
163163
164164WRITE16_MEMBER(mpeg573_device::ram_write_adr_high_w)
trunk/src/mame/machine/mpeg573.h
r23623r23624
44#include "sound/mas3507d.h"
55#include "machine/ds2401.h"
66
7#define MCFG_MPEG573_ADD(_tag, _clock, _output_cb )   \
7#define MCFG_MPEG573_ADD(_tag, _clock, _output_cb ) \
88   MCFG_DEVICE_ADD(_tag, MPEG573, _clock) \
99   downcast<mpeg573_device *>(device)->set_output_cb(DEVCB2_##_output_cb);
1010
11#define MCFG_MPEG573_OUTPUT_CALLBACK( _output_cb )   \
11#define MCFG_MPEG573_OUTPUT_CALLBACK( _output_cb )  \
1212   downcast<mpeg573_device *>(device)->set_output_cb(DEVCB2_##_output_cb);
1313
1414class mpeg573_device : public device_t
trunk/src/mame/machine/mathbox.h
r23623r23624
1111
1212#define MCFG_MATHBOX_ADD(_tag) \
1313   MCFG_DEVICE_ADD(_tag, MATHBOX, 0)
14   
1514
15
1616/* ----- device interface ----- */
1717class mathbox_device : public device_t
1818{
1919public:
2020   mathbox_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
21   
21
2222   DECLARE_WRITE8_MEMBER( go_w );
2323   DECLARE_READ8_MEMBER( status_r );
2424   DECLARE_READ8_MEMBER( lo_r );
trunk/src/mame/machine/midikbd.h
r23623r23624
88   devcb = &midi_keyboard_device::static_set_tx_callback(*device, DEVCB2_##_devcb);
99
1010class midi_keyboard_device : public device_t,
11                      public device_serial_interface
11                        public device_serial_interface
1212{
1313public:
1414   midi_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
trunk/src/mame/machine/taitoio.c
r23623r23624
7171   const tc0220ioc_interface *intf = reinterpret_cast<const tc0220ioc_interface *>(static_config());
7272   if (intf != NULL)
7373   *static_cast<tc0220ioc_interface *>(this) = *intf;
74   
74
7575   // or initialize to defaults if none provided
7676   else
7777   {
r23623r23624
216216   const tc0510nio_interface *intf = reinterpret_cast<const tc0510nio_interface *>(static_config());
217217   if (intf != NULL)
218218   *static_cast<tc0510nio_interface *>(this) = *intf;
219   
219
220220   // or initialize to defaults if none provided
221221   else
222222   {
r23623r23624
362362   const tc0640fio_interface *intf = reinterpret_cast<const tc0640fio_interface *>(static_config());
363363   if (intf != NULL)
364364   *static_cast<tc0640fio_interface *>(this) = *intf;
365   
365
366366   // or initialize to defaults if none provided
367367   else
368368   {
trunk/src/mame/machine/taitoio.h
r23623r23624
4848public:
4949   tc0220ioc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
5050   ~tc0220ioc_device() {}
51   
51
5252   DECLARE_READ8_MEMBER( read );
5353   DECLARE_WRITE8_MEMBER( write );
5454   DECLARE_READ8_MEMBER( port_r );
5555   DECLARE_WRITE8_MEMBER( port_w );
5656   DECLARE_READ8_MEMBER( portreg_r );
5757   DECLARE_WRITE8_MEMBER( portreg_w );
58   
58
5959protected:
6060   // device-level overrides
6161   virtual void device_config_complete();
r23623r23624
115115public:
116116   tc0640fio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
117117   ~tc0640fio_device() {}
118   
118
119119   DECLARE_READ8_MEMBER( read );
120120   DECLARE_WRITE8_MEMBER( write );
121121   DECLARE_READ16_MEMBER( halfword_r );
r23623r23624
159159   MCFG_DEVICE_ADD(_tag, TC0640FIO, 0) \
160160   MCFG_DEVICE_CONFIG(_interface)
161161
162   
162
163163#endif  /* __TAITOIO_H__ */
trunk/src/mame/includes/dkong.h
r23623r23624
104104   device_t *m_dev_vp2;        /* virtual port 2 */
105105   device_t *m_dev_6h;
106106   optional_device<discrete_device> m_discrete;
107   
107
108108   /* memory pointers */
109109   required_shared_ptr<UINT8> m_video_ram;
110110   required_shared_ptr<UINT8> m_sprite_ram;
111   
111
112112   /* machine states */
113113   UINT8               m_hardware_type;
114114   UINT8               m_nmi_mask;
trunk/src/mame/includes/gaplus.h
r23623r23624
1616   {
1717      TIMER_NAMCOIO_RUN
1818   };
19   
19
2020   enum
2121   {
2222      GAME_GAPLUS = 0,
2323      GAME_GAPLUSD,
2424      GAME_GALAGA3
2525   };
26   
26
2727   gaplus_state(const machine_config &mconfig, device_type type, const char *tag)
2828      : driver_device(mconfig, type, tag),
2929      m_maincpu(*this, "maincpu"),
r23623r23624
3333      m_customio_3(*this,"customio_3"),
3434      m_videoram(*this,"videoram"),
3535      m_spriteram(*this,"spriteram") { }
36   
36
3737   required_device<cpu_device> m_maincpu;
3838   required_device<cpu_device> m_subcpu;
3939   required_device<cpu_device> m_subcpu2;
r23623r23624
4545   namco56xx_device *m_namco56xx;
4646
4747   int m_type;
48   
48
4949   tilemap_t *m_bg_tilemap;
5050   UINT8 m_starfield_control[4];
5151   int m_total_stars;
r23623r23624
8686   void starfield_init();
8787   void starfield_render(bitmap_ind16 &bitmap);
8888   void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect );
89   
89
9090protected:
9191   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
9292};
trunk/src/mame/includes/vertigo.h
r23623r23624
8989   vertigo_state(const machine_config &mconfig, device_type type, const char *tag)
9090      : driver_device(mconfig, type, tag),
9191         m_maincpu(*this, "maincpu"),
92         m_audiocpu(*this, "audiocpu"), 
92         m_audiocpu(*this, "audiocpu"),
9393         m_pit(*this, "pit8254"),
9494         m_vectorram(*this, "vectorram")
9595   { }
trunk/src/mame/includes/snowbros.h
r23623r23624
2525   int m_sb3_music;
2626   UINT8 m_semicom_prot_offset;
2727   UINT8 *m_spriteram;
28   
28
2929   DECLARE_WRITE16_MEMBER(snowbros_flipscreen_w);
3030   DECLARE_WRITE16_MEMBER(snowbros_irq4_ack_w);
3131   DECLARE_WRITE16_MEMBER(snowbros_irq3_ack_w);
trunk/src/mame/includes/seibuspi.h
r23623r23624
11/***************************************************************************
22
33    Seibu SPI hardware
4   
4
55***************************************************************************/
66
77#include "machine/intelfsh.h"
trunk/src/mame/includes/powerins.h
r23623r23624
1414      m_spriteram(*this, "spriteram")
1515      { }
1616
17   
17
1818   required_device<cpu_device> m_maincpu;
1919   optional_device<cpu_device> m_soundcpu;
2020   optional_device<nmk112_device> m_nmk112;
trunk/src/mame/includes/taito_b.h
r23623r23624
2828      m_tc0180vcu(*this, "tc0180vcu"),
2929      m_tc0640fio(*this, "tc0640fio"),
3030      m_tc0220ioc(*this, "tc0220ioc"),
31      m_tc0510nio(*this, "tc0510nio")   { }
31      m_tc0510nio(*this, "tc0510nio") { }
3232
3333   /* memory pointers */
3434   required_shared_ptr<UINT16> m_spriteram;
trunk/src/mame/includes/vsnes.h
r23623r23624
1111
1212   required_device<cpu_device> m_maincpu;
1313   optional_device<cpu_device> m_subcpu;
14     
14
1515   required_shared_ptr<UINT8> m_work_ram;
1616   optional_shared_ptr<UINT8> m_work_ram_1;
1717   int m_coin;
trunk/src/mame/includes/flower.h
r23623r23624
7878   {
7979   TIMER_CLOCK_EFFECT
8080   };
81   
81
8282   DECLARE_WRITE8_MEMBER( sound1_w );
8383   DECLARE_WRITE8_MEMBER( sound2_w );
8484
r23623r23624
8787   virtual void device_config_complete();
8888   virtual void device_start();
8989   virtual void device_reset();
90   
90
9191   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
9292
9393   // sound stream update overrides
r23623r23624
9696private:
9797   void make_mixer_table(int voices, int gain);
9898   void show_soundregs();
99   
99
100100   // internal state
101101   emu_timer *m_effect_timer;
102102
trunk/src/mame/includes/mappy.h
r23623r23624
2626      GAME_DIGDUG2,
2727      GAME_MOTOS
2828   };
29   
29
3030   mappy_state(const machine_config &mconfig, device_type type, const char *tag)
3131      : driver_device(mconfig, type, tag),
3232      m_videoram(*this, "videoram"),
r23623r23624
3838
3939   required_shared_ptr<UINT8> m_videoram;
4040   required_shared_ptr<UINT8> m_spriteram;
41   
41
4242   required_device<cpu_device> m_maincpu;
4343   required_device<cpu_device> m_subcpu;
4444   optional_device<cpu_device> m_subcpu2;
r23623r23624
4949   namco58xx_device *m_namco58xx_1;
5050   namco58xx_device *m_namco58xx_2;
5151   namco59xx_device *m_namco59xx;
52   
52
5353   // per-game variable to distinguish between the various IO chip config
5454   int m_type;
5555
trunk/src/mame/includes/galaxold.h
r23623r23624
129129   DECLARE_WRITE8_MEMBER(rockclim_scroll_w);
130130   DECLARE_WRITE8_MEMBER(guttang_rombank_w);
131131
132   
133132
133
134134   DECLARE_READ8_MEMBER(rockclim_videoram_r);
135135   DECLARE_WRITE8_MEMBER(dambustr_bg_split_line_w);
136136   DECLARE_WRITE8_MEMBER(dambustr_bg_color_w);
trunk/src/mame/includes/taitoair.h
r23623r23624
4444   required_shared_ptr<UINT16> m_paletteram;
4545   required_shared_ptr<UINT16> m_gradram;
4646   required_shared_ptr<UINT16> m_backregs;
47   
47
4848   /* video-related */
4949   taitoair_poly  m_q;
5050
trunk/src/mame/includes/speedbal.h
r23623r23624
1616
1717   bool m_leds_start;
1818   UINT32 m_leds_shiftreg;
19   
19
2020   tilemap_t *m_bg_tilemap;
2121   tilemap_t *m_fg_tilemap;
2222
trunk/src/mame/includes/toypop.h
r23623r23624
2525   required_shared_ptr<UINT8> m_spriteram;
2626   required_shared_ptr<UINT8> m_m68000_sharedram;
2727   required_shared_ptr<UINT16> m_bg_image;
28   
28
2929   required_device<cpu_device> m_maincpu;
3030   required_device<cpu_device> m_audiocpu;
3131   required_device<cpu_device> m_subcpu;
3232   required_device<namco58xx_device> m_namco58xx;
3333   required_device<namco56xx_device> m_namco56xx_1;
3434   required_device<namco56xx_device> m_namco56xx_2;
35   
35
3636   tilemap_t *m_bg_tilemap;
3737
3838   int m_bitmapflip;
trunk/src/mame/includes/warpwarp.h
r23623r23624
88      m_maincpu(*this, "maincpu"),
99      m_warpwarp_sound(*this, "warpwarp_custom"),
1010      m_geebee_sound(*this, "geebee_custom"),
11       m_geebee_videoram(*this, "geebee_videoram"),
11      m_geebee_videoram(*this, "geebee_videoram"),
1212      m_videoram(*this, "videoram")
1313      { }
14
14
1515   required_device<cpu_device> m_maincpu;
1616   optional_device<warpwarp_sound_device> m_warpwarp_sound;
1717   optional_device<geebee_sound_device> m_geebee_sound;
trunk/src/mame/includes/nmk16.h
r23623r23624
192192   void decode_tdragonb();
193193   void decode_ssmissin();
194194   DECLARE_WRITE_LINE_MEMBER(ym2203_irqhandler);
195   
195
196196};
trunk/src/mame/includes/exidy440.h
r23623r23624
11/*************************************************************************
22
3   Exidy 440 hardware
3    Exidy 440 hardware
44
55*************************************************************************/
66
trunk/src/mame/includes/bzone.h
r23623r23624
2121      m_discrete(*this, "discrete"),
2222      m_redbaronsound(*this, "custom")
2323      { }
24   
24
2525   required_device<cpu_device> m_maincpu;
2626   required_device<mathbox_device> m_mathbox;
2727   optional_device<discrete_device> m_discrete;
r23623r23624
4545
4646/*----------- defined in audio/bzone.c -----------*/
4747MACHINE_CONFIG_EXTERN( bzone_audio );
48
49
50
51
trunk/src/mame/includes/pgm.h
r23623r23624
400400
401401   const UINT8 (*m_drgw2_source_data)[0xec];
402402
403   UINT16         m_drgw2_prot_hold;
404   UINT16         m_drgw2_prot_hilo;
405   UINT16         m_drgw2_prot_hilo_select;
403   UINT16        m_drgw2_prot_hold;
404   UINT16        m_drgw2_prot_hilo;
405   UINT16        m_drgw2_prot_hilo_select;
406406   int           m_drgw2_cmd;
407407   int           m_drgw2_ptr;
408408
trunk/src/mame/includes/playch10.h
r23623r23624
2121
2222   required_device<cpu_device> m_maincpu;
2323   optional_device<rp5h01_device> m_rp5h01;
24   
24
2525   required_shared_ptr<UINT8> m_ram_8w;
2626   required_shared_ptr<UINT8> m_videoram;
2727   required_shared_ptr<UINT8> m_timedata;
trunk/src/mame/video/kan_pand.c
r23623r23624
6969   const kaneko_pandora_interface *intf = reinterpret_cast<const kaneko_pandora_interface *>(static_config());
7070   if (intf != NULL)
7171      *static_cast<kaneko_pandora_interface *>(this) = *intf;
72   
72
7373   // or initialize to defaults if none provided
7474   else
7575   {
r23623r23624
305305   }
306306
307307   return m_spriteram[offset] | (m_spriteram[offset] << 8);
308}
No newline at end of file
308}
trunk/src/mame/video/kan_pand.h
r23623r23624
2929   ~kaneko_pandora_device() {}
3030
3131   DECLARE_WRITE8_MEMBER ( spriteram_w );
32   DECLARE_READ8_MEMBER( spriteram_r );   
32   DECLARE_READ8_MEMBER( spriteram_r );
3333   DECLARE_WRITE16_MEMBER( spriteram_LSB_w );
3434   DECLARE_READ16_MEMBER( spriteram_LSB_r );
3535   void update( bitmap_ind16 &bitmap, const rectangle &cliprect );
3636   void set_clear_bitmap( int clear );
3737   void eof();
3838   void set_bg_pen( int pen );
39   
39
4040protected:
4141   // device-level overrides
4242   virtual void device_config_complete();
4343   virtual void device_start();
4444   virtual void device_reset();
45   
45
4646   void draw( bitmap_ind16 &bitmap, const rectangle &cliprect );
4747
4848private:
4949   // internal state
50   screen_device   *m_screen;
51   UINT8 *         m_spriteram;
52   bitmap_ind16    *m_sprites_bitmap; /* bitmap to render sprites to, Pandora seems to be frame'buffered' */
53   int             m_clear_bitmap;
54   int            m_bg_pen; // might work some other way..
50   screen_device   *m_screen;
51   UINT8 *         m_spriteram;
52   bitmap_ind16    *m_sprites_bitmap; /* bitmap to render sprites to, Pandora seems to be frame'buffered' */
53   int             m_clear_bitmap;
54   int             m_bg_pen; // might work some other way..
5555};
5656
5757extern const device_type KANEKO_PANDORA;
trunk/src/mame/video/powervr2.c
r23623r23624
16651665}
16661666
16671667void powervr2_device::render_span(bitmap_rgb32 &bitmap, texinfo *ti,
1668                          float y0, float y1,
1669                          float xl, float xr,
1670                          float ul, float ur,
1671                          float vl, float vr,
1672                          float wl, float wr,
1673                          float dxldy, float dxrdy,
1674                          float duldy, float durdy,
1675                          float dvldy, float dvrdy,
1676                          float dwldy, float dwrdy)
1668                           float y0, float y1,
1669                           float xl, float xr,
1670                           float ul, float ur,
1671                           float vl, float vr,
1672                           float wl, float wr,
1673                           float dxldy, float dxrdy,
1674                           float duldy, float durdy,
1675                           float dvldy, float dvrdy,
1676                           float dwldy, float dwrdy)
16771677{
16781678   float dy;
16791679   int yy0, yy1;
r23623r23624
24042404}
24052405
24062406TIMER_CALLBACK_MEMBER(powervr2_device::endofrender_tsp)
2407{   
2407{
24082408   irq_cb(EOR_TSP_IRQ); // TSP end of render
24092409
24102410   endofrender_timer_tsp->adjust(attotime::never);
r23623r23624
26242624
26252625powervr2_device::powervr2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
26262626   : device_t(mconfig, POWERVR2, "PowerVR 2", tag, owner, clock),
2627     irq_cb(*this)
2627      irq_cb(*this)
26282628{
26292629}
26302630
trunk/src/mame/video/powervr2.h
r23623r23624
11#ifndef __POWERVR2_H__
22#define __POWERVR2_H__
33
4#define MCFG_POWERVR2_ADD(_tag, _irq_cb)                            \
4#define MCFG_POWERVR2_ADD(_tag, _irq_cb)                                \
55   MCFG_DEVICE_ADD(_tag, POWERVR2, 0)                                  \
66   downcast<powervr2_device *>(device)->set_irq_cb(DEVCB2_ ## _irq_cb);
77
r23623r23624
107107
108108   UINT64 *dc_texture_ram;
109109   UINT64 *dc_framebuffer_ram;
110   
110
111111   UINT64 *pvr2_texture_ram;
112112   UINT64 *pvr2_framebuffer_ram;
113113   UINT64 *elan_ram;
r23623r23624
277277
278278   void render_hline(bitmap_rgb32 &bitmap, texinfo *ti, int y, float xl, float xr, float ul, float ur, float vl, float vr, float wl, float wr);
279279   void render_span(bitmap_rgb32 &bitmap, texinfo *ti,
280                float y0, float y1,
281                float xl, float xr,
282                float ul, float ur,
283                float vl, float vr,
284                float wl, float wr,
285                float dxldy, float dxrdy,
286                float duldy, float durdy,
287                float dvldy, float dvrdy,
288                float dwldy, float dwrdy);
280                  float y0, float y1,
281                  float xl, float xr,
282                  float ul, float ur,
283                  float vl, float vr,
284                  float wl, float wr,
285                  float dxldy, float dxrdy,
286                  float duldy, float durdy,
287                  float dvldy, float dvrdy,
288                  float dwldy, float dwrdy);
289289   void sort_vertices(const vert *v, int *i0, int *i1, int *i2);
290290   void render_tri_sorted(bitmap_rgb32 &bitmap, texinfo *ti, const vert *v0, const vert *v1, const vert *v2);
291291   void render_tri(bitmap_rgb32 &bitmap, texinfo *ti, const vert *v);
r23623r23624
296296   static UINT32 dilate1(UINT32 value,int bits);
297297   void computedilated();
298298   void pvr_build_parameterconfig();
299   void process_ta_fifo();   
299   void process_ta_fifo();
300300   void debug_paletteram();
301301};
302302
trunk/src/mame/video/seibuspi.c
r23623r23624
11/***************************************************************************
22
33    Seibu SPI hardware
4   
4
55    Functions to emulate the video hardware
66
77***************************************************************************/
trunk/hash/ep64_cart.xml
r23623r23624
11<?xml version="1.0"?>
22<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd">
33<softwarelist name="ep64_cart" description="Enterprise Sixty Four cartridges">
4   
4
55   <software name="basic">
66      <description>BASIC (v2.1)</description>
77      <year>198?</year>

Previous 199869 Revisions Next


© 1997-2024 The MAME Team