Previous 199869 Revisions Next

r36468 Thursday 19th March, 2015 at 02:18:00 UTC by Peter Ferrie
font_windows.c: don't crash if no memory for bitmap [Peter Ferrie]

more graceful exit will occur when next malloc() fails, and condition
might be temporary
[src/emu/cpu/hmcs40]hmcs40.c hmcs40d.c hmcs40op.inc
[src/lib/formats]ti99_dsk.c
[src/mame]mame.lst
[src/mame/drivers]cps1.c psikyo.c supdrapo.c suprgolf.c suprloco.c suprridr.c
[src/mame/includes]suprloco.h suprridr.h
[src/mame/video]cps1.c suprloco.c suprridr.c
[src/mess/drivers]a7800.c ti99_4x.c
[src/osd/modules/font]font_windows.c

trunk/src/emu/cpu/hmcs40/hmcs40.c
r244979r244980
459459{
460460   m_icount--;
461461   push_stack();
462   m_ie = 0;
463462   
464463   // line 0/1 for external interrupt, let's use 2 for t/c interrupt
465464   int line = (m_iri) ? m_eint_line : 2;
r244979r244980
467466   // vector $3f, on page 0(timer/counter), or page 1(external)
468467   // external interrupt has priority over t/c interrupt
469468   m_pc = 0x3f | (m_iri ? 0x40 : 0);
470   if (m_iri)
471      m_iri = 0;
472   else
473      m_irt = 0;
469   m_iri = m_irt = 0;
470   m_ie = 0;
474471
475472   standard_irq_callback(line);
476473}
r244979r244980
557554     
558555      // LPU is handled 1 cycle later
559556      if ((m_prev_op & 0x3e0) == 0x340)
560      {
561         if ((m_op & 0x1c0) != 0x1c0)
562            logerror("%s LPU without BR/CAL at $%04X\n", tag(), m_prev_pc);
563
564557         m_pc = ((m_page << 6) | (m_pc & 0x3f)) & m_pcmask;
565      }
566558
567559      // check/handle interrupt, but not in the middle of a long jump
568560      if (m_ie && (m_iri || m_irt) && (m_op & 0x3e0) != 0x340)
r244979r244980
575567      // fetch next opcode
576568      debugger_instruction_hook(this, m_pc);
577569      m_op = m_program->read_word(m_pc << 1) & 0x3ff;
578      m_i = BITSWAP8(m_op,7,6,5,4,0,1,2,3) & 0xf; // reversed bit-order for immediate param (except for XAMR?)
570      m_i = BITSWAP8(m_op,7,6,5,4,0,1,2,3) & 0xf; // reversed bit-order for immediate param
579571      increment_pc();
580572
573/*
574
575op_ayy();  -
576op_syy();  -
577op_am();   - 34 234 4c
578op_sm()???:- 234
579op_daa();  - 46
580op_das();  - 45
581op_nega(); -
582op_anem(); - 324 124
583op_bnem(); - 267 024
584op_alem(); - 324 124
585op_blem(); - 267 024
586op_lay();  - 118
587
588*/
589
581590      // handle opcode
582591      switch (m_op)
583592      {
584         // unknown: lay, ayy, syy, am, anem, alem, bnem, blem, nega
585         
586593         case 0x118:
587594            op_lay(); // probably lay
588595            break;
589         case 0x034:
590            op_am(); // probably am
591            break;
592
593
596         case 0x267:
597            op_blem(); break; // bnem or blem
594598         case 0x124:
595            op_illegal();
596            //op_alem(); // alem or anem
597            //op_ayy();
599            op_alem(); // alem or anem
598600            break;
599601         case 0x324:
600            op_illegal();
601            //op_anem(); // "
602            break;
603
602            op_anem(); break; // "
604603         case 0x024:
604            //op_nega();
605            //op_am();
605606            op_illegal();
606            //op_nega();
607607            break;
608
609
610
611608         case 0x234:
609            // sm?
610#if 0
611            m_a = ram_r() - m_a;
612            m_s = ~m_a >> 4 & 1;
613            m_a &= 0xf;
614#else
615            op_am();
616#endif
617            break;
618         case 0x04c:
612619            op_illegal();
613            //op_nega();
620            //m_c ^= 1;
621            //op_lat();
614622            break;
615623
616624
617625
618626
619
620
621
622627         /* 0x000 */
623628         
624629         case 0x000: case 0x001: case 0x002: case 0x003:
r244979r244980
633638         case 0x020: case 0x021: case 0x022: case 0x023:
634639            op_lbm(); break;
635640         case 0x030:
636/* ok */      op_amc(); break;
641            op_amc(); break;
637642         case 0x03c:
638643            op_lta(); break;
639644         
640645         case 0x040:
641646/* ok */      op_lxa(); break;
642         case 0x045:
643/* ok */      op_das(); break;
644         case 0x046:
645/* ok */      op_daa(); break;
646         case 0x04c:
647/* ok */      op_rec(); break;
647         case 0x04b:
648            op_rec(); break;
648649         case 0x04f:
649/* ok */      op_sec(); break;
650            op_sec(); break;
650651         case 0x050:
651652            op_lya(); break;
652653         case 0x054:
r244979r244980
751752         case 0x225:
752753/* ok */      op_rotl(); break;
753754         case 0x230:
754/* ok */      op_smc(); break;
755            op_smc(); break;
755756         case 0x23c:
756757            op_lat(); break;
757758         
r244979r244980
765766            op_dy(); break;
766767         case 0x260:
767768/* ok */      op_lab(); break;
768         case 0x267:
769         case 0x264:
769770            op_db(); break;
770771         case 0x270: case 0x271: case 0x272: case 0x273: case 0x274: case 0x275: case 0x276: case 0x277:
771772         case 0x278: case 0x279: case 0x27a: case 0x27b: case 0x27c: case 0x27d: case 0x27e: case 0x27f:
trunk/src/emu/cpu/hmcs40/hmcs40d.c
r244979r244980
9696   mLBM,   mLBM,   mLBM,   mLBM,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,
9797   mAMC,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mLTA,   mILL,   mILL,   mILL,
9898   /* 0x040 */
99   mLXA,   mILL,   mILL,   mILL,   mILL,   mDAS,   mDAA,   mILL,   mILL,   mILL,   mILL,   mILL,   mREC,   mILL,   mILL,   mSEC,
99   mLXA,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mREC,   mILL,   mILL,   mILL,   mSEC,
100100   mLYA,   mILL,   mILL,   mILL,   mIY,    mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,
101101   mLBA,   mILL,   mILL,   mILL,   mIB,    mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,
102102   mLAI,   mLAI,   mLAI,   mLAI,   mLAI,   mLAI,   mLAI,   mLAI,   mLAI,   mLAI,   mLAI,   mLAI,   mLAI,   mLAI,   mLAI,   mLAI,
r244979r244980
142142   /* 0x240 */
143143   mLASPX, mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mTC,
144144   mLASPY, mILL,   mILL,   mILL,   mDY,    mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,
145   mLAB,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mDB,    mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,
145   mLAB,   mILL,   mILL,   mILL,   mDB,    mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,   mILL,
146146   mALEI,  mALEI,  mALEI,  mALEI,  mALEI,  mALEI,  mALEI,  mALEI,  mALEI,  mALEI,  mALEI,  mALEI,  mALEI,  mALEI,  mALEI,  mALEI,
147147   /* 0x280 */
148148   mYNEI,  mYNEI,  mYNEI,  mYNEI,  mYNEI,  mYNEI,  mYNEI,  mYNEI,  mYNEI,  mYNEI,  mYNEI,  mYNEI,  mYNEI,  mYNEI,  mYNEI,  mYNEI,
trunk/src/emu/cpu/hmcs40/hmcs40op.inc
r244979r244980
662662   if (o & 0x100)
663663   {
664664      // B3 B2 B1 B0 A0 A1 A2 A3
665      m_a = BITSWAP8(o,7,6,5,4,0,1,2,3) & 0xf;
665      m_a = BITSWAP8((UINT8)o,7,6,5,4,0,1,2,3) & 0xf;
666666      m_b = o >> 4 & 0xf;
667667   }
668668   if (o & 0x200)
669669   {
670670      // R20 R21 R22 R23 R30 R31 R32 R33
671      o = BITSWAP8(o,0,1,2,3,4,5,6,7);
671      o = BITSWAP8((UINT8)o,0,1,2,3,4,5,6,7);
672672      write_r(2, o & 0xf);
673673      write_r(3, o >> 4 & 0xf);
674674   }
trunk/src/lib/formats/ti99_dsk.c
r244979r244980
835835      have_vib = true;
836836   }
837837
838   // Do we have a broken VIB? The Pascal disks are known to have such incomplete VIBs
839   if (heads == 0 || sector_count == 0) have_vib = false;
840
841838   // We're also checking the size of the image
842839   int cell_size1 = 0;
843840   int sector_count1 = 0;
trunk/src/mame/drivers/cps1.c
r244979r244980
93529352   ROM_LOAD( "ioc1.ic1",     0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) )
93539353ROM_END
93549354
9355/* B-Board 91634B-2  - all roms have 91634B on the labels */
9356ROM_START( cworld2jb )
9357   ROM_REGION( CODE_SIZE, "maincpu", 0 )      /* 68000 code */
9358   ROM_LOAD16_WORD_SWAP( "q5 - 23_91634b.8f", 0x00000, 0x80000, CRC(709f577f) SHA1(3e0615d01f22eb1bf75cbd26dc80ca5a6d08120e) )
9359   ROM_LOAD16_WORD_SWAP( "q5 - 22_91634b.7f", 0x80000, 0x80000, CRC(93248458) SHA1(9dcdc6838f52efc9a0a6333fd0d734946db12dbd) )
9360
9361   ROM_REGION( 0x200000, "gfx", 0 )
9362   ROMX_LOAD( "q5 - 01_91634b.3a", 0x000000, 0x80000, CRC(09d0e7ce) SHA1(ea502b975986222acce82ce8396348af72e1df72) , ROM_GROUPWORD | ROM_SKIP(6) )
9363   ROMX_LOAD( "q5 - 02_91634b.4a", 0x000002, 0x80000, CRC(22e4ce9a) SHA1(9e49aec8e1d6d15a68da63e69765b82fd53a9562) , ROM_GROUPWORD | ROM_SKIP(6) )
9364   ROMX_LOAD( "q5 - 03_91634b.5a", 0x000004, 0x80000, CRC(f7b3aed6) SHA1(bdfb4d5988307b07ad878ac9129954d14da8769b) , ROM_GROUPWORD | ROM_SKIP(6) )
9365   ROMX_LOAD( "q5 - 04_91634b.6a", 0x000006, 0x80000, CRC(520c6c88) SHA1(19ba8ca3d75aae71cdf471e6307e86a5df8a2851) , ROM_GROUPWORD | ROM_SKIP(6) )
9366
9367   ROM_REGION( 0x18000, "audiocpu", 0 ) /* 64k for the audio CPU (+banks) */
9368   ROM_LOAD( "q5 - 09_91634b.12a", 0x00000, 0x08000, CRC(e14dc524) SHA1(0020a9002572002458fbfe45e8a959cb90de3f03) )
9369   ROM_CONTINUE(           0x10000, 0x08000 )
9370
9371   ROM_REGION( 0x40000, "oki", 0 ) /* Samples */
9372   ROM_LOAD( "q5 - 18_91634b.11c", 0x00000, 0x20000, CRC(d10c1b68) SHA1(2423241f3340d8ab1b6bf9514ca8c3bba1273873) )
9373   ROM_LOAD( "q5 - 19_91634b.12c", 0x20000, 0x20000, CRC(7d17e496) SHA1(a274b94ec4f042dddc239ecb9ac2e1e2375f5eb2) )
9374
9375   ROM_REGION( 0x0200, "aboardplds", 0 )
9376   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
9377   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
9378   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
9379   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
9380   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
9381
9382   ROM_REGION( 0x0200, "bboardplds", 0 )
9383   ROM_LOAD( "q563b.1a",     0x0000, 0x0117, NO_DUMP )
9384   ROM_LOAD( "iob1.12d",     0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) )
9385   ROM_LOAD( "bprg1.11d",    0x0000, 0x0117, CRC(31793da7) SHA1(400fa7ac517421c978c1ee7773c30b9ed0c5d3f3) )
9386
9387   ROM_REGION( 0x0200, "cboardplds", 0 ) // checkme
9388   ROM_LOAD( "ioc1.ic7",     0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) )
9389   ROM_LOAD( "c632.ic1",     0x0000, 0x0117, CRC(0fbd9270) SHA1(d7e737b20c44d41e29ca94be56114b31934dde81) )
9390ROM_END
9391
93929355/* B-Board 89624B-3 */
93939356ROM_START( varth )
93949357   ROM_REGION( CODE_SIZE, "maincpu", 0 )      /* 68000 code */
r244979r244980
1175511718GAME( 1992, sf2dongb,    sf2ce,    cps1_12MHz, sf2,      cps_state,   sf2dongb, ROT0,   "bootleg", "Street Fighter II': Champion Edition (Dongfang Bubai protection, bootleg)", GAME_SUPPORTS_SAVE ) // 920313 - based on World version
1175611719GAME( 1992, cworld2j,    0,        cps1_12MHz, cworld2j, cps_state,   cps1,     ROT0,   "Capcom", "Adventure Quiz Capcom World 2 (Japan 920611)", GAME_SUPPORTS_SAVE )
1175711720GAME( 1992, cworld2ja,   cworld2j, cps1_12MHz, cworld2j, cps_state,   cps1,     ROT0,   "Capcom", "Adventure Quiz Capcom World 2 (Japan 920611, B-Board 90629B-3, no battery)", GAME_SUPPORTS_SAVE )
11758GAME( 1992, cworld2jb,   cworld2j, cps1_12MHz, cworld2j, cps_state,   cps1,     ROT0,   "Capcom", "Adventure Quiz Capcom World 2 (Japan 920611, B-Board 91634B-2)", GAME_SUPPORTS_SAVE )
1175911721GAME( 1992, varth,       0,        cps1_12MHz, varth,    cps_state,   cps1,     ROT270, "Capcom", "Varth: Operation Thunderstorm (World 920714)", GAME_SUPPORTS_SAVE )  // "ETC"    // 12MHz verified
1176011722GAME( 1992, varthr1,     varth,    cps1_12MHz, varth,    cps_state,   cps1,     ROT270, "Capcom", "Varth: Operation Thunderstorm (World 920612)", GAME_SUPPORTS_SAVE )  // "ETC"
1176111723GAME( 1992, varthu,      varth,    cps1_12MHz, varth,    cps_state,   cps1,     ROT270, "Capcom (Romstar license)", "Varth: Operation Thunderstorm (USA 920612)", GAME_SUPPORTS_SAVE )
trunk/src/mame/drivers/psikyo.c
r244979r244980
14061406
14071407ROM_END
14081408
1409
1410ROM_START( btlkroadk )
1411
1412   ROM_REGION( 0x100000, "maincpu", 0 )        /* Main CPU Code */
1413   ROM_LOAD32_WORD_SWAP( "4(dot).u46", 0x000000, 0x040000, CRC(e724d429) SHA1(8b5f80366fd22d6f7e7d8a9623de4fe231303267) ) // 1&0
1414   ROM_LOAD32_WORD_SWAP( "5(dot).u39", 0x000002, 0x040000, CRC(c0d65765) SHA1(a6a26e6b9693a2ef245e9aaa4c9daa888aebb360)) // 3&2
1415
1416   ROM_REGION( 0x020000, "audiocpu", 0 )       /* Sound CPU Code */
1417   ROM_LOAD( "3(k).u71", 0x00000, 0x20000, CRC(e0f0c597) SHA1(cc337633f1f579baf0f8ba1dd65c5d51122a7e97) )
1418
1419   ROM_REGION( 0x700000, "gfx1", 0 )   /* Sprites */
1420   ROM_LOAD( "u14.bin",  0x000000, 0x200000, CRC(282d89c3) SHA1(3b4b17f4a37efa2f7e232488aaba7c77d10c84d2) )
1421   ROM_LOAD( "u24.bin",  0x200000, 0x200000, CRC(bbe9d3d1) SHA1(9da0b0b993e8271a8119e9c2f602e52325983f79) )
1422   ROM_LOAD( "u15.bin",  0x400000, 0x200000, CRC(d4d1b07c) SHA1(232109db8f6e137fbc8826f38a96057067cb19dc) )
1423//  ROM_LOAD( "u25.bin",  0x600000, 0x100000  NOT PRESENT
1424
1425   ROM_REGION( 0x200000, "gfx2", 0 )   /* Layers 0 + 1 */
1426   ROM_LOAD( "u33.bin",  0x000000, 0x200000, CRC(4c8577f1) SHA1(d27043514632954a06667ac63f4a4e4a31870511) )
1427
1428   ROM_REGION( 0x100000, "ymsnd", 0 )  /* ADPCM Samples */
1429   ROM_LOAD( "u56.bin",  0x000000, 0x100000, CRC(51d73682) SHA1(562038d08e9a4389ffa39f3a659b2a29b94dc156) )
1430
1431   ROM_REGION( 0x080000, "ymsnd.deltat", 0 )   /* DELTA-T Samples */
1432   ROM_LOAD( "u64.bin",  0x000000, 0x080000, CRC(0f33049f) SHA1(ca4fd5f3906685ace1af40b75f5678231d7324e8) )
1433
1434   ROM_REGION( 0x040000, "spritelut", 0 )  /* Sprites LUT */
1435   ROM_LOAD( "u3.bin",  0x000000, 0x040000, CRC(30d541ed) SHA1(6f7fb5f5ecbce7c086185392de164ebb6887e780) )
1436
1437   ROM_REGION( 0x0400, "plds", 0 )
1438   ROM_LOAD( "tibpal16l8.u69", 0x0000, 0x0104, NO_DUMP ) /* PAL is read protected */
1439   ROM_LOAD( "tibpal16l8.u19", 0x0200, 0x0104, NO_DUMP ) /* PAL is read protected */
1440
1441ROM_END
1442
14431409/***************************************************************************
14441410
14451411                            Strikers 1945 (Japan, unprotected)
r244979r244980
19901956
19911957***************************************************************************/
19921958
1959/* Working Games */
19931960GAME( 1993, samuraia, 0,        sngkace,  samuraia, psikyo_state, sngkace,  ROT270, "Psikyo", "Samurai Aces (World)", GAME_SUPPORTS_SAVE ) // Banpresto?
19941961GAME( 1993, sngkace,  samuraia, sngkace,  sngkace, psikyo_state,  sngkace,  ROT270, "Psikyo", "Sengoku Ace (Japan)", GAME_SUPPORTS_SAVE ) // Banpresto?
1995
19961962GAME( 1994, gunbird,  0,        gunbird,  gunbird, psikyo_state,  gunbird,  ROT270, "Psikyo", "Gunbird (World)", GAME_SUPPORTS_SAVE )
19971963GAME( 1994, gunbirdk, gunbird,  gunbird,  gunbirdj, psikyo_state, gunbird,  ROT270, "Psikyo", "Gunbird (Korea)", GAME_SUPPORTS_SAVE )
19981964GAME( 1994, gunbirdj, gunbird,  gunbird,  gunbirdj, psikyo_state, gunbird,  ROT270, "Psikyo", "Gunbird (Japan)", GAME_SUPPORTS_SAVE )
1999
20001965GAME( 1994, btlkroad, 0,        gunbird,  btlkroad, psikyo_state, gunbird,  ROT0,   "Psikyo", "Battle K-Road", GAME_SUPPORTS_SAVE )
2001GAME( 1994, btlkroadk, btlkroad,gunbird,  btlkroad, psikyo_state, gunbird,  ROT0,   "Psikyo", "Battle K-Road (Korean PCB)", GAME_SUPPORTS_SAVE ) // game code is still multi-region, but sound rom appears to be Korea specific at least
2002
20031966GAME( 1995, s1945,    0,        s1945,    s1945, psikyo_state,    s1945,    ROT270, "Psikyo", "Strikers 1945 (World)", GAME_SUPPORTS_SAVE )
20041967GAME( 1995, s1945a,   s1945,    s1945,    s1945a, psikyo_state,   s1945a,   ROT270, "Psikyo", "Strikers 1945 (Japan / World)", GAME_SUPPORTS_SAVE ) // Region dip - 0x0f=Japan, anything else=World
20051968GAME( 1995, s1945j,   s1945,    s1945,    s1945j, psikyo_state,   s1945j,   ROT270, "Psikyo", "Strikers 1945 (Japan)", GAME_SUPPORTS_SAVE )
20061969GAME( 1995, s1945jn,  s1945,    gunbird,  s1945j, psikyo_state,   s1945jn,  ROT270, "Psikyo", "Strikers 1945 (Japan, unprotected)", GAME_SUPPORTS_SAVE )
20071970GAME( 1995, s1945k,   s1945,    s1945,    s1945j, psikyo_state,   s1945,    ROT270, "Psikyo", "Strikers 1945 (Korea)", GAME_SUPPORTS_SAVE )
20081971GAME( 1995, s1945bl,  s1945,    s1945bl,  s1945bl, psikyo_state,  s1945bl,  ROT270, "bootleg","Strikers 1945 (Hong Kong, bootleg)", GAME_SUPPORTS_SAVE )
2009
20101972GAME( 1996, tengai,   0,        s1945,    tengai, psikyo_state,   tengai,   ROT0,   "Psikyo", "Tengai (World)", GAME_SUPPORTS_SAVE )
20111973GAME( 1996, tengaij,  tengai,   s1945,    tengaij, psikyo_state,  tengai,   ROT0,   "Psikyo", "Sengoku Blade: Sengoku Ace Episode II / Tengai", GAME_SUPPORTS_SAVE ) // Region dip - 0x0f=Japan, anything else=World
trunk/src/mame/drivers/supdrapo.c
r244979r244980
2727
2828  - Reworked inputs to match the standard poker inputs names/layout.
2929  - Hooked the payout switch.
30  - Hooked a watchdog circuitry, that seems intended to reset
30  - Hooked a watchdog circuitery, that seems intended to reset
3131     the game and/or an external device.
3232  - Added machine start & reset.
3333  - All clocks pre defined.
34  - Added ay8910 interface as a preliminary attempt to analyze the unknown
34  - Added ay8910 interfase as a preliminary attempt to analyze the unknown
3535     port writes when these ports are set as input.
3636  - Figured out the following DIP switches:
3737     Auto Bet (No, Yes).
r244979r244980
7272public:
7373   supdrapo_state(const machine_config &mconfig, device_type type, const char *tag)
7474      : driver_device(mconfig, type, tag),
75      m_maincpu(*this, "maincpu"),
76      m_gfxdecode(*this, "gfxdecode"),
77      m_palette(*this, "palette"),
7875      m_col_line(*this, "col_line"),
7976      m_videoram(*this, "videoram"),
80      m_char_bank(*this, "char_bank") { }
77      m_char_bank(*this, "char_bank"),
78      m_maincpu(*this, "maincpu"),
79      m_gfxdecode(*this, "gfxdecode"),
80      m_palette(*this, "palette") { }
8181
82   required_device<cpu_device> m_maincpu;
83   required_device<gfxdecode_device> m_gfxdecode;
84   required_device<palette_device> m_palette;
85   
8682   required_shared_ptr<UINT8> m_col_line;
8783   required_shared_ptr<UINT8> m_videoram;
8884   required_shared_ptr<UINT8> m_char_bank;
89   
9085   UINT8 m_wdog;
91   
92   DECLARE_READ8_MEMBER(rng_r);
86   DECLARE_READ8_MEMBER(sdpoker_rng_r);
9387   DECLARE_WRITE8_MEMBER(wdog8000_w);
9488   DECLARE_WRITE8_MEMBER(debug8004_w);
9589   DECLARE_WRITE8_MEMBER(debug7c00_w);
r244979r244980
9791   DECLARE_WRITE8_MEMBER(payout_w);
9892   DECLARE_WRITE8_MEMBER(ay8910_outputa_w);
9993   DECLARE_WRITE8_MEMBER(ay8910_outputb_w);
100   
10194   virtual void machine_start();
10295   virtual void machine_reset();
10396   virtual void video_start();
10497   DECLARE_PALETTE_INIT(supdrapo);
105   
106   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
98   UINT32 screen_update_supdrapo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
99   required_device<cpu_device> m_maincpu;
100   required_device<gfxdecode_device> m_gfxdecode;
101   required_device<palette_device> m_palette;
107102};
108103
109104
r244979r244980
116111}
117112
118113
119UINT32 supdrapo_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
114UINT32 supdrapo_state::screen_update_supdrapo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
120115{
121116   int x, y;
122117   int count;
r244979r244980
176171                            R/W Handlers
177172**********************************************************************/
178173
179READ8_MEMBER(supdrapo_state::rng_r)
174READ8_MEMBER(supdrapo_state::sdpoker_rng_r)
180175{
181176   return machine().rand();
182177}
r244979r244980
256251
257252void supdrapo_state::machine_start()
258253{
259   save_item(NAME(m_wdog));
260254}
261255
262256
r244979r244980
288282   AM_RANGE(0x8005, 0x8005) AM_READ_PORT("SW1")
289283   AM_RANGE(0x8006, 0x8006) AM_READ_PORT("SW2")
290284   AM_RANGE(0x9000, 0x90ff) AM_RAM AM_SHARE("nvram")
291   AM_RANGE(0x9400, 0x9400) AM_READ(rng_r)
285   AM_RANGE(0x9400, 0x9400) AM_READ(sdpoker_rng_r)
292286   AM_RANGE(0x9800, 0x9801) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
293287ADDRESS_MAP_END
294288
r244979r244980
459453   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
460454   MCFG_SCREEN_SIZE(256, 256)
461455   MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
462   MCFG_SCREEN_UPDATE_DRIVER(supdrapo_state, screen_update)
456   MCFG_SCREEN_UPDATE_DRIVER(supdrapo_state, screen_update_supdrapo)
463457   MCFG_SCREEN_PALETTE("palette")
464458
465459   MCFG_GFXDECODE_ADD("gfxdecode", "palette", supdrapo)
r244979r244980
606600**********************************************************************/
607601
608602/*    YEAR  NAME       PARENT    MACHINE   INPUT     INIT  ROT     COMPANY                               FULLNAME                   FLAGS... */
609GAME( 1983, supdrapo,  0,        supdrapo, supdrapo, driver_device, 0,    ROT90, "Valadon Automation (Stern Electronics license)", "Super Draw Poker (set 1)", GAME_SUPPORTS_SAVE )
610GAME( 1983, supdrapoa, supdrapo, supdrapo, supdrapo, driver_device, 0,    ROT90, "Valadon Automation / Jeutel", "Super Draw Poker (set 2)", GAME_SUPPORTS_SAVE )
611GAME( 1983, supdrapob, supdrapo, supdrapo, supdrapo, driver_device, 0,    ROT90, "bootleg", "Super Draw Poker (bootleg)", GAME_SUPPORTS_SAVE )
603GAME( 1983, supdrapo,  0,        supdrapo, supdrapo, driver_device, 0,    ROT90, "Valadon Automation (Stern Electronics license)", "Super Draw Poker (set 1)", 0 )
604GAME( 1983, supdrapoa, supdrapo, supdrapo, supdrapo, driver_device, 0,    ROT90, "Valadon Automation / Jeutel", "Super Draw Poker (set 2)", 0 )
605GAME( 1983, supdrapob, supdrapo, supdrapo, supdrapo, driver_device, 0,    ROT90, "bootleg", "Super Draw Poker (bootleg)", 0 )
trunk/src/mame/drivers/suprgolf.c
r244979r244980
3333public:
3434   suprgolf_state(const machine_config &mconfig, device_type type, const char *tag)
3535      : driver_device(mconfig, type, tag),
36      m_videoram(*this, "videoram"),
3637      m_maincpu(*this, "maincpu"),
3738      m_msm(*this, "msm"),
3839      m_gfxdecode(*this, "gfxdecode"),
39      m_palette(*this, "palette"),
40      m_videoram(*this, "videoram") { }
40      m_palette(*this, "palette") { }
4141
42   required_device<cpu_device> m_maincpu;
43   required_device<msm5205_device> m_msm;
44   required_device<gfxdecode_device> m_gfxdecode;
45   required_device<palette_device> m_palette;
46
47   required_shared_ptr<UINT8> m_videoram;
48
4942   tilemap_t *m_tilemap;
43   required_shared_ptr<UINT8> m_videoram;
5044   UINT8 *m_paletteram;
5145   UINT8 *m_bg_vram;
5246   UINT16 *m_bg_fb;
r244979r244980
6054   UINT8 m_palette_switch;
6155   UINT8 m_bg_vreg_test;
6256   UINT8 m_toggle;
63   
64   DECLARE_READ8_MEMBER(videoram_r);
65   DECLARE_WRITE8_MEMBER(videoram_w);
66   DECLARE_READ8_MEMBER(bg_vram_r);
67   DECLARE_WRITE8_MEMBER(bg_vram_w);
68   DECLARE_WRITE8_MEMBER(pen_w);
57   DECLARE_READ8_MEMBER(suprgolf_videoram_r);
58   DECLARE_WRITE8_MEMBER(suprgolf_videoram_w);
59   DECLARE_READ8_MEMBER(suprgolf_bg_vram_r);
60   DECLARE_WRITE8_MEMBER(suprgolf_bg_vram_w);
61   DECLARE_WRITE8_MEMBER(suprgolf_pen_w);
6962   DECLARE_WRITE8_MEMBER(adpcm_data_w);
7063   DECLARE_WRITE8_MEMBER(rom2_bank_select_w);
71   DECLARE_READ8_MEMBER(vregs_r);
72   DECLARE_WRITE8_MEMBER(vregs_w);
64   DECLARE_READ8_MEMBER(suprgolf_vregs_r);
65   DECLARE_WRITE8_MEMBER(suprgolf_vregs_w);
7366   DECLARE_READ8_MEMBER(rom_bank_select_r);
7467   DECLARE_WRITE8_MEMBER(rom_bank_select_w);
7568   DECLARE_READ8_MEMBER(pedal_extra_bits_r);
7669   DECLARE_READ8_MEMBER(p1_r);
7770   DECLARE_READ8_MEMBER(p2_r);
78   DECLARE_WRITE8_MEMBER(writeA);
79   DECLARE_WRITE8_MEMBER(writeB);
80   DECLARE_WRITE_LINE_MEMBER(adpcm_int);
81   
82   TILE_GET_INFO_MEMBER(get_tile_info);
83
71   DECLARE_WRITE8_MEMBER(suprgolf_writeA);
72   DECLARE_WRITE8_MEMBER(suprgolf_writeB);
8473   DECLARE_DRIVER_INIT(suprgolf);
74   TILE_GET_INFO_MEMBER(get_tile_info);
8575    virtual void machine_start();
8676   virtual void machine_reset();
8777   virtual void video_start();
88   
89   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
78   UINT32 screen_update_suprgolf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
79   DECLARE_WRITE_LINE_MEMBER(irqhandler);
80   DECLARE_WRITE_LINE_MEMBER(adpcm_int);
81   required_device<cpu_device> m_maincpu;
82   required_device<msm5205_device> m_msm;
83   required_device<gfxdecode_device> m_gfxdecode;
84   required_device<palette_device> m_palette;
9085};
9186
9287TILE_GET_INFO_MEMBER(suprgolf_state::get_tile_info)
r244979r244980
109104   m_fg_fb = auto_alloc_array(machine(), UINT16, 0x2000*0x20);
110105
111106   m_tilemap->set_transparent_pen(15);
112   
113   save_item(NAME(m_bg_bank));
114   save_item(NAME(m_vreg_bank));
115   save_item(NAME(m_vreg_pen));
116   save_item(NAME(m_palette_switch));
117   save_item(NAME(m_bg_vreg_test));
118   save_pointer(NAME(m_paletteram), 0x1000);
119   save_pointer(NAME(m_bg_vram), 0x2000*0x20);
120   save_pointer(NAME(m_bg_fb), 0x2000*0x20);
121   save_pointer(NAME(m_fg_fb), 0x2000*0x20);
122107}
123108
124UINT32 suprgolf_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
109UINT32 suprgolf_state::screen_update_suprgolf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
125110{
126111   int x,y,count,color;
127112   bitmap.fill(m_palette->black_pen(), cliprect);
r244979r244980
165150   return 0;
166151}
167152
168READ8_MEMBER(suprgolf_state::videoram_r)
153READ8_MEMBER(suprgolf_state::suprgolf_videoram_r)
169154{
170155   if (m_palette_switch)
171156      return m_paletteram[offset];
r244979r244980
173158      return m_videoram[offset];
174159}
175160
176WRITE8_MEMBER(suprgolf_state::videoram_w)
161WRITE8_MEMBER(suprgolf_state::suprgolf_videoram_w)
177162{
178163   if(m_palette_switch)
179164   {
r244979r244980
195180   }
196181}
197182
198READ8_MEMBER(suprgolf_state::vregs_r)
183READ8_MEMBER(suprgolf_state::suprgolf_vregs_r)
199184{
200185   return m_vreg_bank;
201186}
202187
203WRITE8_MEMBER(suprgolf_state::vregs_w)
188WRITE8_MEMBER(suprgolf_state::suprgolf_vregs_w)
204189{
205190   //printf("%02x\n",data);
206191
r244979r244980
215200   //  printf("Video regs with data %02x activated\n",data);
216201}
217202
218READ8_MEMBER(suprgolf_state::bg_vram_r)
203READ8_MEMBER(suprgolf_state::suprgolf_bg_vram_r)
219204{
220205   return m_bg_vram[offset+m_bg_bank*0x2000];
221206}
222207
223WRITE8_MEMBER(suprgolf_state::bg_vram_w)
208WRITE8_MEMBER(suprgolf_state::suprgolf_bg_vram_w)
224209{
225210   UINT8 hi_nibble,lo_nibble;
226211   UINT8 hi_dirty_dot,lo_dirty_dot; // helpers
r244979r244980
269254{
270255    membank("bank1")->configure_entries(0, 16, memregion("user2")->base(), 0x4000);
271256    membank("bank2")->configure_entries(0, 64, memregion("user1")->base(), 0x4000);
272   
273   save_item(NAME(m_rom_bank));
274   save_item(NAME(m_msm5205next));
275   save_item(NAME(m_msm_nmi_mask));
276   save_item(NAME(m_toggle));
277257}
278258
279WRITE8_MEMBER(suprgolf_state::pen_w)
259WRITE8_MEMBER(suprgolf_state::suprgolf_pen_w)
280260{
281261   m_vreg_pen = data;
282262}
r244979r244980
337317   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1")
338318   AM_RANGE(0x4000, 0x4000) AM_WRITE(rom2_bank_select_w )
339319   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank2")
340   AM_RANGE(0xc000, 0xdfff) AM_READWRITE(bg_vram_r, bg_vram_w ) // banked background vram
341   AM_RANGE(0xe000, 0xefff) AM_READWRITE(videoram_r, videoram_w ) AM_SHARE("videoram") //foreground vram + paletteram
342   AM_RANGE(0xf000, 0xf000) AM_WRITE(pen_w )
320   AM_RANGE(0xc000, 0xdfff) AM_READWRITE(suprgolf_bg_vram_r, suprgolf_bg_vram_w ) // banked background vram
321   AM_RANGE(0xe000, 0xefff) AM_READWRITE(suprgolf_videoram_r, suprgolf_videoram_w ) AM_SHARE("videoram") //foreground vram + paletteram
322   AM_RANGE(0xf000, 0xf000) AM_WRITE(suprgolf_pen_w )
343323   AM_RANGE(0xf800, 0xffff) AM_RAM
344324ADDRESS_MAP_END
345325
r244979r244980
436416   PORT_DIPUNUSED_DIPLOC( 0x80, 0x00, "SW2:8" )
437417INPUT_PORTS_END
438418
439WRITE8_MEMBER(suprgolf_state::writeA)
419WRITE8_MEMBER(suprgolf_state::suprgolf_writeA)
440420{
441421   osd_printf_debug("ymwA\n");
442422}
443423
444WRITE8_MEMBER(suprgolf_state::writeB)
424WRITE8_MEMBER(suprgolf_state::suprgolf_writeB)
445425{
446426   osd_printf_debug("ymwA\n");
447427}
448428
429WRITE_LINE_MEMBER(suprgolf_state::irqhandler)
430{
431   //m_maincpu->set_input_line(INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE);
432}
433
449434WRITE_LINE_MEMBER(suprgolf_state::adpcm_int)
450435{
451436   m_msm->reset_w(0);
r244979r244980
500485   MCFG_I8255_IN_PORTA_CB(IOPORT("SYSTEM"))
501486   MCFG_I8255_IN_PORTB_CB(READ8(suprgolf_state, rom_bank_select_r))
502487   MCFG_I8255_OUT_PORTB_CB(WRITE8(suprgolf_state, rom_bank_select_w))
503   MCFG_I8255_IN_PORTC_CB(READ8(suprgolf_state, vregs_r))
504   MCFG_I8255_OUT_PORTC_CB(WRITE8(suprgolf_state, vregs_w))
488   MCFG_I8255_IN_PORTC_CB(READ8(suprgolf_state, suprgolf_vregs_r))
489   MCFG_I8255_OUT_PORTC_CB(WRITE8(suprgolf_state, suprgolf_vregs_w))
505490
506491   /* video hardware */
507492   MCFG_SCREEN_ADD("screen", RASTER)
r244979r244980
509494   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
510495   MCFG_SCREEN_SIZE(256, 256)
511496   MCFG_SCREEN_VISIBLE_AREA(0, 255, 0, 191)
512   MCFG_SCREEN_UPDATE_DRIVER(suprgolf_state, screen_update)
497   MCFG_SCREEN_UPDATE_DRIVER(suprgolf_state, screen_update_suprgolf)
513498   MCFG_SCREEN_PALETTE("palette")
514499
515500   MCFG_GFXDECODE_ADD("gfxdecode", "palette", suprgolf)
r244979r244980
519504   MCFG_SPEAKER_STANDARD_MONO("mono")
520505
521506   MCFG_SOUND_ADD("ymsnd", YM2203, MASTER_CLOCK/4) /* guess */
522   //MCFG_YM2203_IRQ_HANDLER(INPUTLINE("maincpu", INPUT_LINE_NMI))
507   MCFG_YM2203_IRQ_HANDLER(WRITELINE(suprgolf_state, irqhandler))
523508   MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW0"))
524509   MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW1"))
525   MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(suprgolf_state, writeA))
526   MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(suprgolf_state, writeB))
510   MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(suprgolf_state, suprgolf_writeA))
511   MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(suprgolf_state, suprgolf_writeB))
527512   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
528513
529514   MCFG_SOUND_ADD("msm", MSM5205, XTAL_384kHz) /* guess */
r244979r244980
636621   ROM[0x6d72+(0x4000*3)-0x4000] = 0x20; //patch ROM check
637622}
638623
639GAME( 1989, suprgolf,  0,         suprgolf,  suprgolf, suprgolf_state,  suprgolf, ROT0, "Nasco", "Super Crowns Golf (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
640GAME( 1989, albatross, suprgolf,  suprgolf,  suprgolf, driver_device,  0,        ROT0, "Nasco", "Albatross (US Prototype?)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL| GAME_SUPPORTS_SAVE )
624GAME( 1989, suprgolf,  0,         suprgolf,  suprgolf, suprgolf_state,  suprgolf, ROT0, "Nasco", "Super Crowns Golf (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL )
625GAME( 1989, albatross, suprgolf,  suprgolf,  suprgolf, driver_device,  0,        ROT0, "Nasco", "Albatross (US Prototype?)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL )
trunk/src/mame/drivers/suprloco.c
r244979r244980
55driver by Zsolt Vasvari
66
77TODO:
8- Bit 5 in control_w is pulsed when loco turns "super". This is supposed
8- Bit 5 in suprloco_control_w is pulsed when loco turns "super". This is supposed
99  to make red parts of sprites blink to purple, it's not clear how this is
1010  implemented in hardware, there's a hack to support it.
1111
r244979r244980
2525#include "sound/sn76496.h"
2626#include "includes/suprloco.h"
2727
28WRITE8_MEMBER(suprloco_state::soundport_w)
28WRITE8_MEMBER(suprloco_state::suprloco_soundport_w)
2929{
3030   soundlatch_byte_w(space, 0, data);
3131   m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
r244979r244980
4242   AM_RANGE(0xd800, 0xd800) AM_READ_PORT("P2")
4343   AM_RANGE(0xe000, 0xe000) AM_READ_PORT("DSW1")
4444   AM_RANGE(0xe001, 0xe001) AM_READ_PORT("DSW2")
45   AM_RANGE(0xe800, 0xe800) AM_WRITE(soundport_w)
46   AM_RANGE(0xe801, 0xe801) AM_READWRITE(control_r, control_w)
47   AM_RANGE(0xf000, 0xf6ff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram")
45   AM_RANGE(0xe800, 0xe800) AM_WRITE(suprloco_soundport_w)
46   AM_RANGE(0xe801, 0xe801) AM_READWRITE(suprloco_control_r, suprloco_control_w)
47   AM_RANGE(0xf000, 0xf6ff) AM_RAM_WRITE(suprloco_videoram_w) AM_SHARE("videoram")
4848   AM_RANGE(0xf700, 0xf7df) AM_RAM /* unused */
49   AM_RANGE(0xf7e0, 0xf7ff) AM_RAM_WRITE(scrollram_w) AM_SHARE("scrollram")
49   AM_RANGE(0xf7e0, 0xf7ff) AM_RAM_WRITE(suprloco_scrollram_w) AM_SHARE("scrollram")
5050   AM_RANGE(0xf800, 0xffff) AM_RAM
5151ADDRESS_MAP_END
5252
r244979r244980
175175   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(5000))
176176   MCFG_SCREEN_SIZE(32*8, 32*8)
177177   MCFG_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 0*8, 28*8-1)
178   MCFG_SCREEN_UPDATE_DRIVER(suprloco_state, screen_update)
178   MCFG_SCREEN_UPDATE_DRIVER(suprloco_state, screen_update_suprloco)
179179   MCFG_SCREEN_PALETTE("palette")
180180
181181   MCFG_GFXDECODE_ADD("gfxdecode", "palette", suprloco)
r244979r244980
297297
298298
299299
300GAME( 1982, suprloco,         0, suprloco, suprloco, suprloco_state, suprloco, ROT0, "Sega", "Super Locomotive (Rev.A)", GAME_SUPPORTS_SAVE )
301GAME( 1982, suprlocoo, suprloco, suprloco, suprloco, suprloco_state, suprloco, ROT0, "Sega", "Super Locomotive", GAME_SUPPORTS_SAVE )
300GAME( 1982, suprloco,         0, suprloco, suprloco, suprloco_state, suprloco, ROT0, "Sega", "Super Locomotive (Rev.A)", 0 )
301GAME( 1982, suprlocoo, suprloco, suprloco, suprloco, suprloco_state, suprloco, ROT0, "Sega", "Super Locomotive", 0 )
trunk/src/mame/drivers/suprridr.c
r244979r244980
8989#include "sound/ay8910.h"
9090
9191
92void suprridr_state::machine_start()
93{
94   save_item(NAME(m_nmi_enable));
95   save_item(NAME(m_sound_data));
96}
97
9892/*************************************
9993 *
10094 *  Interrupt generation
r244979r244980
170164static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, suprridr_state )
171165   AM_RANGE(0x0000, 0x7fff) AM_ROM
172166   AM_RANGE(0x8000, 0x87ff) AM_RAM
173   AM_RANGE(0x8800, 0x8bff) AM_RAM_WRITE(bgram_w) AM_SHARE("bgram")
174   AM_RANGE(0x9000, 0x97ff) AM_RAM_WRITE(fgram_w) AM_SHARE("fgram")
167   AM_RANGE(0x8800, 0x8bff) AM_RAM_WRITE(suprridr_bgram_w) AM_SHARE("bgram")
168   AM_RANGE(0x9000, 0x97ff) AM_RAM_WRITE(suprridr_fgram_w) AM_SHARE("fgram")
175169   AM_RANGE(0x9800, 0x983f) AM_RAM
176170   AM_RANGE(0x9840, 0x987f) AM_RAM AM_SHARE("spriteram")
177171   AM_RANGE(0x9880, 0x9bff) AM_RAM
r244979r244980
179173   AM_RANGE(0xa800, 0xa800) AM_READ_PORT("SYSTEM")
180174   AM_RANGE(0xb000, 0xb000) AM_READ_PORT("DSW") AM_WRITE(nmi_enable_w)
181175   AM_RANGE(0xb002, 0xb003) AM_WRITE(coin_lock_w)
182   AM_RANGE(0xb006, 0xb006) AM_WRITE(flipx_w)
183   AM_RANGE(0xb007, 0xb007) AM_WRITE(flipy_w)
176   AM_RANGE(0xb006, 0xb006) AM_WRITE(suprridr_flipx_w)
177   AM_RANGE(0xb007, 0xb007) AM_WRITE(suprridr_flipy_w)
184178   AM_RANGE(0xb800, 0xb800) AM_WRITE(sound_data_w)
185   AM_RANGE(0xc801, 0xc801) AM_WRITE(fgdisable_w)
186   AM_RANGE(0xc802, 0xc802) AM_WRITE(fgscrolly_w)
187   AM_RANGE(0xc804, 0xc804) AM_WRITE(bgscrolly_w)
179   AM_RANGE(0xc801, 0xc801) AM_WRITE(suprridr_fgdisable_w)
180   AM_RANGE(0xc802, 0xc802) AM_WRITE(suprridr_fgscrolly_w)
181   AM_RANGE(0xc804, 0xc804) AM_WRITE(suprridr_bgscrolly_w)
188182   AM_RANGE(0xc000, 0xefff) AM_ROM
189183ADDRESS_MAP_END
190184
r244979r244980
229223#define SUPRRIDR_P1_CONTROL_PORT_TAG    ("CONTP1")
230224#define SUPRRIDR_P2_CONTROL_PORT_TAG    ("CONTP2")
231225
232CUSTOM_INPUT_MEMBER(suprridr_state::control_r)
226CUSTOM_INPUT_MEMBER(suprridr_state::suprridr_control_r)
233227{
234228   UINT32 ret;
235229
236230   /* screen flip multiplexes controls */
237   if (is_screen_flipped())
231   if (suprridr_is_screen_flipped())
238232      ret = ioport(SUPRRIDR_P2_CONTROL_PORT_TAG)->read();
239233   else
240234      ret = ioport(SUPRRIDR_P1_CONTROL_PORT_TAG)->read();
r244979r244980
245239
246240static INPUT_PORTS_START( suprridr )
247241   PORT_START("INPUTS")
248   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, suprridr_state, control_r, NULL)
242   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, suprridr_state,suprridr_control_r, NULL)
249243
250244   PORT_START("SYSTEM")
251245   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
r244979r244980
359353   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
360354   MCFG_SCREEN_SIZE(32*8, 32*8)
361355   MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
362   MCFG_SCREEN_UPDATE_DRIVER(suprridr_state, screen_update)
356   MCFG_SCREEN_UPDATE_DRIVER(suprridr_state, screen_update_suprridr)
363357   MCFG_SCREEN_PALETTE("palette")
364358
365359   MCFG_GFXDECODE_ADD("gfxdecode", "palette", suprridr)
r244979r244980
429423 *
430424 *************************************/
431425
432GAME( 1983, suprridr, 0, suprridr, suprridr, driver_device, 0, ROT90, "Taito Corporation (Venture Line license)", "Super Rider", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
426GAME( 1983, suprridr, 0, suprridr, suprridr, driver_device, 0, ROT90, "Taito Corporation (Venture Line license)", "Super Rider", GAME_IMPERFECT_SOUND )
trunk/src/mame/includes/suprloco.h
r244979r244980
33public:
44   suprloco_state(const machine_config &mconfig, device_type type, const char *tag)
55      : driver_device(mconfig, type, tag),
6      m_maincpu(*this, "maincpu"),
7      m_audiocpu(*this, "audiocpu"),
8      m_gfxdecode(*this, "gfxdecode"),
96      m_spriteram(*this, "spriteram"),
107      m_videoram(*this, "videoram"),
11      m_scrollram(*this, "scrollram") { }
12     
13   required_device<cpu_device> m_maincpu;
14   required_device<cpu_device> m_audiocpu;
15   required_device<gfxdecode_device> m_gfxdecode;
8      m_scrollram(*this, "scrollram"),
9      m_maincpu(*this, "maincpu"),
10      m_audiocpu(*this, "audiocpu"),
11      m_gfxdecode(*this, "gfxdecode") { }
1612
1713   required_shared_ptr<UINT8> m_spriteram;
1814   required_shared_ptr<UINT8> m_videoram;
1915   required_shared_ptr<UINT8> m_scrollram;
20   
2116   tilemap_t *m_bg_tilemap;
2217   int m_control;
2318
24   DECLARE_WRITE8_MEMBER(soundport_w);
25   DECLARE_WRITE8_MEMBER(videoram_w);
26   DECLARE_WRITE8_MEMBER(scrollram_w);
27   DECLARE_WRITE8_MEMBER(control_w);
28   DECLARE_READ8_MEMBER(control_r);
29   
19   DECLARE_WRITE8_MEMBER(suprloco_soundport_w);
20   DECLARE_WRITE8_MEMBER(suprloco_videoram_w);
21   DECLARE_WRITE8_MEMBER(suprloco_scrollram_w);
22   DECLARE_WRITE8_MEMBER(suprloco_control_w);
23   DECLARE_READ8_MEMBER(suprloco_control_r);
24   DECLARE_DRIVER_INIT(suprloco);
3025   TILE_GET_INFO_MEMBER(get_tile_info);
31   
3226   virtual void video_start();
3327   DECLARE_PALETTE_INIT(suprloco);
34   DECLARE_DRIVER_INIT(suprloco);
35   
36   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
28   UINT32 screen_update_suprloco(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
3729   inline void draw_pixel(bitmap_ind16 &bitmap,const rectangle &cliprect,int x,int y,int color,int flip);
3830   void draw_sprite(bitmap_ind16 &bitmap,const rectangle &cliprect,int spr_number);
3931   void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
32   required_device<cpu_device> m_maincpu;
33   required_device<cpu_device> m_audiocpu;
34   required_device<gfxdecode_device> m_gfxdecode;
4035};
trunk/src/mame/includes/suprridr.h
r244979r244980
1111public:
1212   suprridr_state(const machine_config &mconfig, device_type type, const char *tag)
1313      : driver_device(mconfig, type, tag),
14      m_fgram(*this, "fgram"),
15      m_bgram(*this, "bgram"),
16      m_spriteram(*this, "spriteram"),
1417      m_maincpu(*this, "maincpu"),
1518      m_audiocpu(*this, "audiocpu"),
1619      m_gfxdecode(*this, "gfxdecode"),
17      m_palette(*this, "palette"),
18      m_fgram(*this, "fgram"),
19      m_bgram(*this, "bgram"),
20      m_spriteram(*this, "spriteram") { }
20      m_palette(*this, "palette")  { }
2121
22   required_device<cpu_device> m_maincpu;
23   required_device<cpu_device> m_audiocpu;
24   required_device<gfxdecode_device> m_gfxdecode;
25   required_device<palette_device> m_palette;
26
27   required_shared_ptr<UINT8> m_fgram;
28   required_shared_ptr<UINT8> m_bgram;
29   required_shared_ptr<UINT8> m_spriteram;
30
3122   UINT8 m_nmi_enable;
3223   UINT8 m_sound_data;
24   required_shared_ptr<UINT8> m_fgram;
25   required_shared_ptr<UINT8> m_bgram;
3326   tilemap_t *m_fg_tilemap;
3427   tilemap_t *m_bg_tilemap;
3528   tilemap_t *m_bg_tilemap_noscroll;
3629   UINT8 m_flipx;
3730   UINT8 m_flipy;
38   
31   required_shared_ptr<UINT8> m_spriteram;
3932   DECLARE_WRITE8_MEMBER(nmi_enable_w);
4033   DECLARE_WRITE8_MEMBER(sound_data_w);
4134   DECLARE_WRITE8_MEMBER(sound_irq_ack_w);
4235   DECLARE_WRITE8_MEMBER(coin_lock_w);
43   DECLARE_WRITE8_MEMBER(flipx_w);
44   DECLARE_WRITE8_MEMBER(flipy_w);
45   DECLARE_WRITE8_MEMBER(fgdisable_w);
46   DECLARE_WRITE8_MEMBER(fgscrolly_w);
47   DECLARE_WRITE8_MEMBER(bgscrolly_w);
48   DECLARE_WRITE8_MEMBER(bgram_w);
49   DECLARE_WRITE8_MEMBER(fgram_w);
36   DECLARE_WRITE8_MEMBER(suprridr_flipx_w);
37   DECLARE_WRITE8_MEMBER(suprridr_flipy_w);
38   DECLARE_WRITE8_MEMBER(suprridr_fgdisable_w);
39   DECLARE_WRITE8_MEMBER(suprridr_fgscrolly_w);
40   DECLARE_WRITE8_MEMBER(suprridr_bgscrolly_w);
41   DECLARE_WRITE8_MEMBER(suprridr_bgram_w);
42   DECLARE_WRITE8_MEMBER(suprridr_fgram_w);
43   DECLARE_CUSTOM_INPUT_MEMBER(suprridr_control_r);
5044   DECLARE_READ8_MEMBER(sound_data_r);
51   
52   DECLARE_CUSTOM_INPUT_MEMBER(control_r);
53   
5445   TILE_GET_INFO_MEMBER(get_tile_info);
5546   TILE_GET_INFO_MEMBER(get_tile_info2);
56   
57   INTERRUPT_GEN_MEMBER(main_nmi_gen);
58   TIMER_CALLBACK_MEMBER(delayed_sound_w);
59   
60   virtual void machine_start();
6147   virtual void video_start();
6248   DECLARE_PALETTE_INIT(suprridr);
63   
64   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
65   int is_screen_flipped();
49   UINT32 screen_update_suprridr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
50   INTERRUPT_GEN_MEMBER(main_nmi_gen);
51   TIMER_CALLBACK_MEMBER(delayed_sound_w);
52   int suprridr_is_screen_flipped();
53   required_device<cpu_device> m_maincpu;
54   required_device<cpu_device> m_audiocpu;
55   required_device<gfxdecode_device> m_gfxdecode;
56   required_device<palette_device> m_palette;
6657};
trunk/src/mame/mame.lst
r244979r244980
32373237sf2b            // bootleg
32383238cworld2j        // 11/06/1992 (c) 1992 (Japan)
32393239cworld2ja       // 11/06/1992 (c) 1992 (Japan)
3240cworld2jb       // 11/06/1992 (c) 1992 (Japan)
32413240varth           // 14/07/1992 (c) 1992 (World)
32423241varthr1         // 12/06/1992 (c) 1992 (World)
32433242varthu          // 12/06/1992 (c) 1992 (USA)
r244979r244980
87748773gunbirdk        // (c) 1994
87758774gunbirdj        // (c) 1994
87768775btlkroad        // (c) 1994
8777btlkroadk      // (c) 1994
87788776s1945           // (c) 1995
87798777s1945a          // (c) 1995
87808778s1945j          // (c) 1995
trunk/src/mame/video/cps1.c
r244979r244980
15321532   {"varthj",      CPS_B_21_BT5, mapper_VA22B },   /* CPSB test has been patched out (72=0001) register is also written to, possibly leftover from development */
15331533   {"cworld2j",    CPS_B_21_BT6, mapper_Q522B,  0x36, 0, 0x34 },   /* (ports 36, 34 probably leftover input code from another game) */
15341534   {"cworld2ja",   CPS_B_21_DEF, mapper_Q522B }, // patched set, no battery, could be desuicided
1535   {"cworld2jb",   CPS_B_21_BT6, mapper_Q522B,  0x36, 0, 0x34 }, // actually Q563B
15361535   {"wof",         CPS_B_21_QS1, mapper_TK263B },
15371536   {"wofr1",       CPS_B_21_DEF, mapper_TK263B },  // patched set coming from a desuicided board?
15381537   {"wofa",        CPS_B_21_DEF, mapper_TK263B },  // patched set coming from a desuicided board?
trunk/src/mame/video/suprloco.c
r244979r244980
11/***************************************************************************
22
3  suprloco.c
3  video.c
44
55  Functions to emulate the video hardware of the machine.
66
r244979r244980
9898   m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(suprloco_state::get_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32,32);
9999
100100   m_bg_tilemap->set_scroll_rows(32);
101   
102   save_item(NAME(m_control));
103101}
104102
105103
r244979r244980
110108
111109***************************************************************************/
112110
113WRITE8_MEMBER(suprloco_state::videoram_w)
111WRITE8_MEMBER(suprloco_state::suprloco_videoram_w)
114112{
115113   m_videoram[offset] = data;
116114   m_bg_tilemap->mark_tile_dirty(offset/2);
117115}
118116
119WRITE8_MEMBER(suprloco_state::scrollram_w)
117WRITE8_MEMBER(suprloco_state::suprloco_scrollram_w)
120118{
121119   int adj = flip_screen() ? -8 : 8;
122120
r244979r244980
124122   m_bg_tilemap->set_scrollx(offset, data - adj);
125123}
126124
127WRITE8_MEMBER(suprloco_state::control_w)
125WRITE8_MEMBER(suprloco_state::suprloco_control_w)
128126{
129127   /* There is probably a palette select in here */
130128
r244979r244980
150148}
151149
152150
153READ8_MEMBER(suprloco_state::control_r)
151READ8_MEMBER(suprloco_state::suprloco_control_r)
154152{
155153   return m_control;
156154}
r244979r244980
258256   }
259257}
260258
261UINT32 suprloco_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
259UINT32 suprloco_state::screen_update_suprloco(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
262260{
263261   m_bg_tilemap->draw(screen, bitmap, cliprect, 0,0);
264262   draw_sprites(bitmap,cliprect);
trunk/src/mame/video/suprridr.c
r244979r244980
4444   m_bg_tilemap_noscroll = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(suprridr_state::get_tile_info),this),  TILEMAP_SCAN_ROWS,       8,8, 32,32);
4545
4646   m_fg_tilemap->set_transparent_pen(0);
47   
48   save_item(NAME(m_flipx));
49   save_item(NAME(m_flipy));
5047}
5148
5249
r244979r244980
9491 *
9592 *************************************/
9693
97WRITE8_MEMBER(suprridr_state::flipx_w)
94WRITE8_MEMBER(suprridr_state::suprridr_flipx_w)
9895{
9996   m_flipx = data & 1;
10097   machine().tilemap().set_flip_all((m_flipx ? TILEMAP_FLIPX : 0) | (m_flipy ? TILEMAP_FLIPY : 0));
10198}
10299
103100
104WRITE8_MEMBER(suprridr_state::flipy_w)
101WRITE8_MEMBER(suprridr_state::suprridr_flipy_w)
105102{
106103   m_flipy = data & 1;
107104   machine().tilemap().set_flip_all((m_flipx ? TILEMAP_FLIPX : 0) | (m_flipy ? TILEMAP_FLIPY : 0));
108105}
109106
110107
111WRITE8_MEMBER(suprridr_state::fgdisable_w)
108WRITE8_MEMBER(suprridr_state::suprridr_fgdisable_w)
112109{
113110   m_fg_tilemap->enable(~data & 1);
114111}
115112
116113
117WRITE8_MEMBER(suprridr_state::fgscrolly_w)
114WRITE8_MEMBER(suprridr_state::suprridr_fgscrolly_w)
118115{
119116   m_fg_tilemap->set_scrolly(0, data);
120117}
121118
122119
123WRITE8_MEMBER(suprridr_state::bgscrolly_w)
120WRITE8_MEMBER(suprridr_state::suprridr_bgscrolly_w)
124121{
125122   m_bg_tilemap->set_scrolly(0, data);
126123}
127124
128125
129int suprridr_state::is_screen_flipped()
126int suprridr_state::suprridr_is_screen_flipped()
130127{
131128   return m_flipx;  /* or is it flipy? */
132129}
r244979r244980
139136 *
140137 *************************************/
141138
142WRITE8_MEMBER(suprridr_state::bgram_w)
139WRITE8_MEMBER(suprridr_state::suprridr_bgram_w)
143140{
144141   m_bgram[offset] = data;
145142   m_bg_tilemap->mark_tile_dirty(offset);
r244979r244980
147144}
148145
149146
150WRITE8_MEMBER(suprridr_state::fgram_w)
147WRITE8_MEMBER(suprridr_state::suprridr_fgram_w)
151148{
152149   m_fgram[offset] = data;
153150   m_fg_tilemap->mark_tile_dirty(offset);
r244979r244980
161158 *
162159 *************************************/
163160
164UINT32 suprridr_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
161UINT32 suprridr_state::screen_update_suprridr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
165162{
163   UINT8 *spriteram = m_spriteram;
166164   rectangle subclip;
165   int i;
167166   const rectangle &visarea = screen.visible_area();
168167
169168   /* render left 4 columns with no scroll */
r244979r244980
189188   m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
190189
191190   /* draw the sprites */
192   for (int i = 0; i < 48; i++)
191   for (i = 0; i < 48; i++)
193192   {
194      int code = (m_spriteram[i*4+1] & 0x3f) | ((m_spriteram[i*4+2] >> 1) & 0x40);
195      int color = m_spriteram[i*4+2] & 0x7f;
196      int fx = m_spriteram[i*4+1] & 0x40;
197      int fy = m_spriteram[i*4+1] & 0x80;
198      int x = m_spriteram[i*4+3];
199      int y = 240 - m_spriteram[i*4+0];
193      int code = (spriteram[i*4+1] & 0x3f) | ((spriteram[i*4+2] >> 1) & 0x40);
194      int color = spriteram[i*4+2] & 0x7f;
195      int fx = spriteram[i*4+1] & 0x40;
196      int fy = spriteram[i*4+1] & 0x80;
197      int x = spriteram[i*4+3];
198      int y = 240 - spriteram[i*4+0];
200199
201200      if (m_flipx)
202201      {
trunk/src/mess/drivers/a7800.c
r244979r244980
117117   m_maria(*this, "maria"),
118118   m_io_joysticks(*this, "joysticks"),
119119   m_io_buttons(*this, "buttons"),
120   m_io_vblank(*this, "vblank"),
120121   m_io_console_buttons(*this, "console_buttons"),
121122   m_cart(*this, "cartslot"),
122   m_screen(*this, "screen"),
123   m_bios(*this, "maincpu") { }
123   m_screen(*this, "screen") { }
124124
125125   int m_lines;
126126   int m_ispal;
r244979r244980
132132   int m_p2_one_button;
133133   int m_bios_enabled;
134134
135   UINT8 *m_bios;
136
135137   DECLARE_READ8_MEMBER(bios_or_cart_r);
136138   DECLARE_WRITE8_MEMBER(ram0_w);
137139   DECLARE_READ8_MEMBER(tia_r);
r244979r244980
156158   required_device<atari_maria_device> m_maria;
157159   required_ioport m_io_joysticks;
158160   required_ioport m_io_buttons;
161   required_ioport m_io_vblank;
159162   required_ioport m_io_console_buttons;
160163   required_device<a78_cart_slot_device> m_cart;
161164   required_device<screen_device> m_screen;
162   required_region_ptr<UINT8> m_bios;
163165};
164166
165167
r244979r244980
280282static ADDRESS_MAP_START( a7800_mem, AS_PROGRAM, 8, a7800_state )
281283   AM_RANGE(0x0000, 0x001f) AM_MIRROR(0x300) AM_READWRITE(tia_r, tia_w)
282284   AM_RANGE(0x0020, 0x003f) AM_MIRROR(0x300) AM_DEVREADWRITE("maria", atari_maria_device, read, write)
283   AM_RANGE(0x0040, 0x00ff) AM_RAMBANK("zpmirror") // mirror of 0x2040-0x20ff, for zero page
284   AM_RANGE(0x0140, 0x01ff) AM_RAMBANK("spmirror") // mirror of 0x2140-0x21ff, for stack page
285   AM_RANGE(0x0040, 0x00ff) AM_RAMBANK("ram0")     // RAM (6116 block 0)
286   AM_RANGE(0x0140, 0x01ff) AM_RAMBANK("ram1")     // RAM (6116 block 1)
285287   AM_RANGE(0x0280, 0x02ff) AM_DEVREADWRITE("riot", riot6532_device, read, write)
286   AM_RANGE(0x0480, 0x04ff) AM_RAM AM_SHARE("riot_ram") AM_MIRROR(0x100)
287   AM_RANGE(0x1800, 0x1fff) AM_RAM AM_SHARE("6116_1")
288   AM_RANGE(0x2000, 0x27ff) AM_RAM AM_SHARE("6116_2") AM_MIRROR(0x0800)
289                             // According to the official Software Guide, the RAM at 0x2000 is
290                             // repeatedly mirrored up to 0x3fff, but this is evidently incorrect
291                             // because the High Score Cartridge maps ROM at 0x3000-0x3fff
292                             // Hardware tests show that only the mirror at 0x2800-0x2fff actually
293                             // exists, and only on some hardware (MARIA? motherboard?) revisions
288   AM_RANGE(0x0480, 0x04ff) AM_MIRROR(0x100) AM_RAMBANK("riot_ram")
289   AM_RANGE(0x1800, 0x27ff) AM_RAMBANK("main_ram")
290
291   AM_RANGE(0x2040, 0x20ff) AM_RAMBANK("ram0")     // mirror (6116 block 0)
292   AM_RANGE(0x2140, 0x21ff) AM_RAMBANK("ram1")     // mirror (6116 block 1)
293
294   AM_RANGE(0x2800, 0x2fff) AM_RAMBANK("mirror")   // these should mirror "main_ram" (according to docs)
295   AM_RANGE(0x3000, 0x37ff) AM_RAMBANK("mirror")   // but system have issues in such case...
296   AM_RANGE(0x3800, 0x3fff) AM_RAMBANK("mirror")
294297   AM_RANGE(0x4000, 0xffff) AM_DEVWRITE("cartslot", a78_cart_slot_device, write_40xx)
295298   AM_RANGE(0x4000, 0xbfff) AM_DEVREAD("cartslot", a78_cart_slot_device, read_40xx)
296299   AM_RANGE(0xc000, 0xffff) AM_READ(bios_or_cart_r)    // here also the BIOS can be accessed
r244979r244980
319322   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON1)       PORT_PLAYER(1)
320323   PORT_BIT(0xF0, IP_ACTIVE_LOW, IPT_UNUSED)
321324
325   PORT_START("vblank")
326   PORT_BIT(0x7F, IP_ACTIVE_LOW, IPT_UNUSED)
327   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_VBLANK("screen")
328
322329   PORT_START("console_buttons")
323330   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER)  PORT_NAME("Reset")         PORT_CODE(KEYCODE_R)
324331   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER)  PORT_NAME("Select")        PORT_CODE(KEYCODE_S)
r244979r244980
12991306
13001307void a7800_state::machine_start()
13011308{
1309   m_bios = machine().root_device().memregion("maincpu")->base() + 0xc000;
13021310   save_item(NAME(m_p1_one_button));
13031311   save_item(NAME(m_p2_one_button));
13041312   save_item(NAME(m_bios_enabled));
r244979r244980
13061314   save_item(NAME(m_ctrl_reg));
13071315   save_item(NAME(m_maria_flag));
13081316
1309   // set up RAM mirrors
1310   UINT8 *ram = reinterpret_cast<UINT8 *>(memshare("6116_2")->ptr());
1311   membank("zpmirror")->set_base(ram + 0x0040);
1312   membank("spmirror")->set_base(ram + 0x0140);
1313
13141317   // install additional handlers, if needed
13151318   if (m_cart->exists())
13161319   {
r244979r244980
14171420***************************************************************************/
14181421
14191422ROM_START( a7800 )
1420   ROM_REGION(0x4000, "maincpu", ROMREGION_ERASEFF)
1423   ROM_REGION(0x10000, "maincpu", ROMREGION_ERASEFF)
14211424   ROM_SYSTEM_BIOS( 0, "a7800", "Atari 7800" )
1422   ROMX_LOAD("7800.u7", 0x3000, 0x1000, CRC(5d13730c) SHA1(d9d134bb6b36907c615a594cc7688f7bfcef5b43), ROM_BIOS(1))
1425   ROMX_LOAD("7800.u7", 0xf000, 0x1000, CRC(5d13730c) SHA1(d9d134bb6b36907c615a594cc7688f7bfcef5b43), ROM_BIOS(1))
14231426   ROM_SYSTEM_BIOS( 1, "a7800pr", "Atari 7800 (prototype with Asteroids)" )
1424   ROMX_LOAD("c300558-001a.u7", 0x0000, 0x4000, CRC(a0e10edf) SHA1(14584b1eafe9721804782d4b1ac3a4a7313e455f), ROM_BIOS(2))
1427   ROMX_LOAD("c300558-001a.u7", 0xc000, 0x4000, CRC(a0e10edf) SHA1(14584b1eafe9721804782d4b1ac3a4a7313e455f), ROM_BIOS(2))
14251428ROM_END
14261429
14271430ROM_START( a7800p )
1428   ROM_REGION(0x4000, "maincpu", ROMREGION_ERASEFF)
1429   ROM_LOAD("7800pal.rom", 0x0000, 0x4000, CRC(d5b61170) SHA1(5a140136a16d1d83e4ff32a19409ca376a8df874))
1431   ROM_REGION(0x10000, "maincpu", ROMREGION_ERASEFF)
1432   ROM_LOAD("7800pal.rom", 0xc000, 0x4000, CRC(d5b61170) SHA1(5a140136a16d1d83e4ff32a19409ca376a8df874))
14301433ROM_END
14311434
14321435
trunk/src/mess/drivers/ti99_4x.c
r244979r244980
351351   PORT_START("ALPHA") /* one more port for Alpha line */
352352      PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Alpha Lock") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE
353353
354   /* another version of Alpha Lock which is non-toggling; this is useful when we want to attach
355       a real TI keyboard for input. For home computers, the Alpha Lock / Shift Lock was a physically
356       locking key. */
357   PORT_START("ALPHA1")
358      PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Alpha Lock non-toggle") PORT_CODE(KEYCODE_RWIN)
359
360354INPUT_PORTS_END
361355
362356
r244979r244980
468462         // the line enough to make the TMS9901 sense the low level.
469463         // A reported, feasible fix was to cut the line and insert a diode
470464         // below the Alphalock key.
471         if ((ioport("ALPHABUG")!=0) && (m_model!=MODEL_4)) answer |= (ioport("ALPHA")->read() | ioport("ALPHA1")->read());
465         if ((ioport("ALPHABUG")!=0) && (m_model!=MODEL_4)) answer |= ioport("ALPHA")->read();
472466      }
473467      else
474468      {
r244979r244980
476470      }
477471      if (m_check_alphalock)  // never true for TI-99/4
478472      {
479         answer &= ~(ioport("ALPHA")->read() | ioport("ALPHA1")->read());
473         answer &= ~(ioport("ALPHA")->read());
480474      }
481475      answer = (answer << 3);
482476      if (m_int1 == CLEAR_LINE) answer |= 0x02;
trunk/src/osd/modules/font/font_windows.c
r244979r244980
169169   // create a DIB to render to
170170   BYTE *bits;
171171   HBITMAP dib = CreateDIBSection(dummyDC, &info, DIB_RGB_COLORS, reinterpret_cast<VOID **>(&bits), NULL, 0);
172   HGDIOBJ oldbitmap = SelectObject(dummyDC, dib);
173172
174   // clear the bitmap
175   int rowbytes = bmwidth / 8;
176   memset(bits, 0, rowbytes * bmheight);
173   if (dib)
174   {
175      HGDIOBJ oldbitmap = SelectObject(dummyDC, dib);
177176
178   // now draw the character
179   WCHAR tempchar = chnum;
180   SetTextColor(dummyDC, RGB(0xff, 0xff, 0xff));
181   SetBkColor(dummyDC, RGB(0x00, 0x00, 0x00));
182   ExtTextOutW(dummyDC, 50 + abc.abcA, 50, ETO_OPAQUE, NULL, &tempchar, 1, NULL);
177      // clear the bitmap
178      int rowbytes = bmwidth / 8;
179      memset(bits, 0, rowbytes * bmheight);
183180
184   // characters are expected to be full-height
185   rectangle actbounds;
186   actbounds.min_y = 50;
187   actbounds.max_y = 50 + metrics.tmHeight - 1;
181      // now draw the character
182      WCHAR tempchar = chnum;
183      SetTextColor(dummyDC, RGB(0xff, 0xff, 0xff));
184      SetBkColor(dummyDC, RGB(0x00, 0x00, 0x00));
185      ExtTextOutW(dummyDC, 50 + abc.abcA, 50, ETO_OPAQUE, NULL, &tempchar, 1, NULL);
188186
189   // determine the actual left of the character
190   for (actbounds.min_x = 0; actbounds.min_x < rowbytes; actbounds.min_x++)
191   {
192      BYTE *offs = bits + actbounds.min_x;
193      UINT8 summary = 0;
194      for (int y = 0; y < bmheight; y++)
195         summary |= offs[y * rowbytes];
196      if (summary != 0)
187      // characters are expected to be full-height
188      rectangle actbounds;
189      actbounds.min_y = 50;
190      actbounds.max_y = 50 + metrics.tmHeight - 1;
191
192      // determine the actual left of the character
193      for (actbounds.min_x = 0; actbounds.min_x < rowbytes; actbounds.min_x++)
197194      {
198         actbounds.min_x *= 8;
199         if (!(summary & 0x80)) actbounds.min_x++;
200         if (!(summary & 0xc0)) actbounds.min_x++;
201         if (!(summary & 0xe0)) actbounds.min_x++;
202         if (!(summary & 0xf0)) actbounds.min_x++;
203         if (!(summary & 0xf8)) actbounds.min_x++;
204         if (!(summary & 0xfc)) actbounds.min_x++;
205         if (!(summary & 0xfe)) actbounds.min_x++;
206         break;
195         BYTE *offs = bits + actbounds.min_x;
196         UINT8 summary = 0;
197         for (int y = 0; y < bmheight; y++)
198            summary |= offs[y * rowbytes];
199         if (summary != 0)
200         {
201            actbounds.min_x *= 8;
202            if (!(summary & 0x80)) actbounds.min_x++;
203            if (!(summary & 0xc0)) actbounds.min_x++;
204            if (!(summary & 0xe0)) actbounds.min_x++;
205            if (!(summary & 0xf0)) actbounds.min_x++;
206            if (!(summary & 0xf8)) actbounds.min_x++;
207            if (!(summary & 0xfc)) actbounds.min_x++;
208            if (!(summary & 0xfe)) actbounds.min_x++;
209            break;
210         }
207211      }
208   }
209212
210   // determine the actual right of the character
211   for (actbounds.max_x = rowbytes - 1; actbounds.max_x >= 0; actbounds.max_x--)
212   {
213      BYTE *offs = bits + actbounds.max_x;
214      UINT8 summary = 0;
215      for (int y = 0; y < bmheight; y++)
216         summary |= offs[y * rowbytes];
217      if (summary != 0)
213      // determine the actual right of the character
214      for (actbounds.max_x = rowbytes - 1; actbounds.max_x >= 0; actbounds.max_x--)
218215      {
219         actbounds.max_x *= 8;
220         if (summary & 0x7f) actbounds.max_x++;
221         if (summary & 0x3f) actbounds.max_x++;
222         if (summary & 0x1f) actbounds.max_x++;
223         if (summary & 0x0f) actbounds.max_x++;
224         if (summary & 0x07) actbounds.max_x++;
225         if (summary & 0x03) actbounds.max_x++;
226         if (summary & 0x01) actbounds.max_x++;
227         break;
216         BYTE *offs = bits + actbounds.max_x;
217         UINT8 summary = 0;
218         for (int y = 0; y < bmheight; y++)
219            summary |= offs[y * rowbytes];
220         if (summary != 0)
221         {
222            actbounds.max_x *= 8;
223            if (summary & 0x7f) actbounds.max_x++;
224            if (summary & 0x3f) actbounds.max_x++;
225            if (summary & 0x1f) actbounds.max_x++;
226            if (summary & 0x0f) actbounds.max_x++;
227            if (summary & 0x07) actbounds.max_x++;
228            if (summary & 0x03) actbounds.max_x++;
229            if (summary & 0x01) actbounds.max_x++;
230            break;
231         }
228232      }
229   }
230233
231   // allocate a new bitmap
232   if (actbounds.max_x >= actbounds.min_x && actbounds.max_y >= actbounds.min_y)
233   {
234      bitmap.allocate(actbounds.max_x + 1 - actbounds.min_x, actbounds.max_y + 1 - actbounds.min_y);
234      // allocate a new bitmap
235      if (actbounds.max_x >= actbounds.min_x && actbounds.max_y >= actbounds.min_y)
236      {
237         bitmap.allocate(actbounds.max_x + 1 - actbounds.min_x, actbounds.max_y + 1 - actbounds.min_y);
235238
236      // copy the bits into it
237      for (int y = 0; y < bitmap.height(); y++)
238      {
239         UINT32 *dstrow = &bitmap.pix32(y);
240         UINT8 *srcrow = &bits[(y + actbounds.min_y) * rowbytes];
241         for (int x = 0; x < bitmap.width(); x++)
239         // copy the bits into it
240         for (int y = 0; y < bitmap.height(); y++)
242241         {
243            int effx = x + actbounds.min_x;
244            dstrow[x] = ((srcrow[effx / 8] << (effx % 8)) & 0x80) ? rgb_t(0xff, 0xff, 0xff, 0xff) : rgb_t(0x00, 0xff, 0xff, 0xff);
242            UINT32 *dstrow = &bitmap.pix32(y);
243            UINT8 *srcrow = &bits[(y + actbounds.min_y) * rowbytes];
244            for (int x = 0; x < bitmap.width(); x++)
245            {
246               int effx = x + actbounds.min_x;
247               dstrow[x] = ((srcrow[effx / 8] << (effx % 8)) & 0x80) ? rgb_t(0xff, 0xff, 0xff, 0xff) : rgb_t(0x00, 0xff, 0xff, 0xff);
248            }
245249         }
250
251         // set the final offset values
252         xoffs = actbounds.min_x - (50 + abc.abcA);
253         yoffs = actbounds.max_y - (50 + metrics.tmAscent);
246254      }
247255
248      // set the final offset values
249      xoffs = actbounds.min_x - (50 + abc.abcA);
250      yoffs = actbounds.max_y - (50 + metrics.tmAscent);
256      // de-select the font and release the DC
257      SelectObject(dummyDC, oldbitmap);
258      DeleteObject(dib);
251259   }
252260
253   // de-select the font and release the DC
254   SelectObject(dummyDC, oldbitmap);
255   DeleteObject(dib);
256261   SelectObject(dummyDC, oldfont);
257262   DeleteDC(dummyDC);
258263   return bitmap.valid();


Previous 199869 Revisions Next


© 1997-2024 The MAME Team