diff options
Diffstat (limited to 'src')
326 files changed, 6695 insertions, 2228 deletions
diff --git a/src/build/makedep.c b/src/build/makedep.c index 8e135871d09..09ca9a75b49 100644 --- a/src/build/makedep.c +++ b/src/build/makedep.c @@ -11,6 +11,7 @@ #include <string.h> #include <ctype.h> #include <zlib.h> +#include <assert.h> #include "osdcore.h" #include "astring.h" #include "corefile.h" diff --git a/src/build/makemak.c b/src/build/makemak.c index 9f83357cac4..dfbd36cfef3 100644 --- a/src/build/makemak.c +++ b/src/build/makemak.c @@ -11,6 +11,7 @@ #include <string.h> #include <ctype.h> #include <zlib.h> +#include <assert.h> #include "osdcore.h" #include "astring.h" #include "corefile.h" diff --git a/src/emu/bus/nes/nes_pcb.inc b/src/emu/bus/nes/nes_pcb.inc index 5feb92384e1..748e865631c 100644 --- a/src/emu/bus/nes/nes_pcb.inc +++ b/src/emu/bus/nes/nes_pcb.inc @@ -312,6 +312,7 @@ static const nes_pcb pcb_list[] = { "unl_dance", UNSUPPORTED_BOARD }, { "bmc_hik_kof", UNSUPPORTED_BOARD }, { "onebus", UNSUPPORTED_BOARD }, + { "coolboy", UNSUPPORTED_BOARD }, { "a9746", UNSUPPORTED_BOARD }, { "dance2k", UNSUPPORTED_BOARD }, { "pec586", UNSUPPORTED_BOARD }, diff --git a/src/emu/cpu/h8/h8.c b/src/emu/cpu/h8/h8.c index 3a7a3c27789..8d773ea7a5e 100644 --- a/src/emu/cpu/h8/h8.c +++ b/src/emu/cpu/h8/h8.c @@ -107,8 +107,9 @@ void h8_device::device_start() } save_item(NAME(PPC)); - save_item(NAME(PC)); save_item(NAME(NPC)); + save_item(NAME(PC)); + save_item(NAME(PIR)); save_item(NAME(IR)); save_item(NAME(R)); save_item(NAME(EXR)); diff --git a/src/emu/cpu/hmcs40/hmcs40.c b/src/emu/cpu/hmcs40/hmcs40.c index bbf4b4327bd..c279f07aec0 100644 --- a/src/emu/cpu/hmcs40/hmcs40.c +++ b/src/emu/cpu/hmcs40/hmcs40.c @@ -315,7 +315,7 @@ void hmcs40_cpu_device::device_reset() UINT8 hmcs40_cpu_device::read_r(int index) { index &= 7; - UINT8 inp = 0xf; + UINT8 inp = 0; switch (index) { @@ -459,6 +459,7 @@ void hmcs40_cpu_device::do_interrupt() { m_icount--; push_stack(); + m_ie = 0; // line 0/1 for external interrupt, let's use 2 for t/c interrupt int line = (m_iri) ? m_eint_line : 2; @@ -466,8 +467,10 @@ void hmcs40_cpu_device::do_interrupt() // vector $3f, on page 0(timer/counter), or page 1(external) // external interrupt has priority over t/c interrupt m_pc = 0x3f | (m_iri ? 0x40 : 0); - m_iri = m_irt = 0; - m_ie = 0; + if (m_iri) + m_iri = 0; + else + m_irt = 0; standard_irq_callback(line); } @@ -554,10 +557,15 @@ void hmcs40_cpu_device::execute_run() // LPU is handled 1 cycle later if ((m_prev_op & 0x3e0) == 0x340) + { + if ((m_op & 0x1c0) != 0x1c0) + logerror("%s LPU without BR/CAL at $%04X\n", tag(), m_prev_pc); + m_pc = ((m_page << 6) | (m_pc & 0x3f)) & m_pcmask; + } - // check/handle interrupt - else if (m_ie && (m_iri || m_irt)) + // check/handle interrupt, but not in the middle of a long jump + if (m_ie && (m_iri || m_irt) && (m_op & 0x3e0) != 0x340) do_interrupt(); // remember previous state @@ -567,106 +575,65 @@ void hmcs40_cpu_device::execute_run() // fetch next opcode debugger_instruction_hook(this, m_pc); m_op = m_program->read_word(m_pc << 1) & 0x3ff; - m_i = BITSWAP8(m_op,7,6,5,4,0,1,2,3) & 0xf; // reversed bit-order for immediate param + m_i = BITSWAP8(m_op,7,6,5,4,0,1,2,3) & 0xf; // reversed bit-order for 4-bit immediate param (except for XAMR, REDD, SEDD) increment_pc(); -/* - -op_ayy(); - -op_syy(); - -op_am(); - 34 234 4c -op_sm()???:- 234 -op_daa(); - 46 -op_das(); - 45 -op_nega(); - -op_anem(); - 324 124 -op_bnem(); - 267 024 -op_alem(); - 324 124 -op_blem(); - 267 024 -op_lay(); - 118 - -*/ - // handle opcode switch (m_op) { - case 0x118: - op_lay(); // probably lay - break; - case 0x267: - op_blem(); break; // bnem or blem - case 0x124: - op_alem(); // alem or anem - break; - case 0x324: - op_anem(); break; // " - case 0x024: - //op_nega(); - //op_am(); - op_illegal(); - break; - case 0x234: - // sm? -#if 0 - m_a = ram_r() - m_a; - m_s = ~m_a >> 4 & 1; - m_a &= 0xf; -#else - op_am(); -#endif - break; - case 0x04c: - op_illegal(); - //m_c ^= 1; - //op_lat(); - break; - - - - /* 0x000 */ case 0x000: case 0x001: case 0x002: case 0x003: -/* ok */ op_xsp(); break; + op_xsp(); break; case 0x004: case 0x005: case 0x006: case 0x007: op_sem(); break; case 0x008: case 0x009: case 0x00a: case 0x00b: -/* ok */ op_lam(); break; + op_lam(); break; case 0x010: case 0x011: case 0x012: case 0x013: case 0x014: case 0x015: case 0x016: case 0x017: case 0x018: case 0x019: case 0x01a: case 0x01b: case 0x01c: case 0x01d: case 0x01e: case 0x01f: -/* ok */ op_lmiiy(); break; + op_lmiiy(); break; case 0x020: case 0x021: case 0x022: case 0x023: op_lbm(); break; + case 0x024: + op_blem(); break; case 0x030: op_amc(); break; + case 0x034: + op_am(); break; case 0x03c: op_lta(); break; case 0x040: -/* ok */ op_lxa(); break; - case 0x04b: + op_lxa(); break; + case 0x045: + op_das(); break; + case 0x046: + op_daa(); break; + case 0x04c: op_rec(); break; case 0x04f: op_sec(); break; case 0x050: op_lya(); break; case 0x054: -/* ok */ op_iy(); break; + op_iy(); break; + case 0x058: + op_ayy(); break; case 0x060: op_lba(); break; case 0x064: op_ib(); break; case 0x070: case 0x071: case 0x072: case 0x073: case 0x074: case 0x075: case 0x076: case 0x077: case 0x078: case 0x079: case 0x07a: case 0x07b: case 0x07c: case 0x07d: case 0x07e: case 0x07f: -/* ok */ op_lai(); break; + op_lai(); break; case 0x080: case 0x081: case 0x082: case 0x083: case 0x084: case 0x085: case 0x086: case 0x087: case 0x088: case 0x089: case 0x08a: case 0x08b: case 0x08c: case 0x08d: case 0x08e: case 0x08f: -/* ok */ op_ai(); break; + op_ai(); break; case 0x090: -/* ok */ op_sed(); break; + op_sed(); break; case 0x094: -/* ok */ op_td(); break; + op_td(); break; case 0x0a0: op_seif1(); break; case 0x0a1: @@ -674,7 +641,7 @@ op_lay(); - 118 case 0x0a2: op_seif0(); break; case 0x0a4: -/* ok */ op_seie(); break; + op_seie(); break; case 0x0a5: op_setf(); break; @@ -687,30 +654,34 @@ op_lay(); - 118 op_lbr(); break; case 0x0f0: case 0x0f1: case 0x0f2: case 0x0f3: case 0x0f4: case 0x0f5: case 0x0f6: case 0x0f7: case 0x0f8: case 0x0f9: case 0x0fa: case 0x0fb: case 0x0fc: case 0x0fd: case 0x0fe: case 0x0ff: -/* ok */ op_xamr(); break; + op_xamr(); break; /* 0x100 */ -/* ok */ case 0x110: case 0x111: + case 0x110: case 0x111: op_lmaiy(); break; -/* ok */ case 0x114: case 0x115: + case 0x114: case 0x115: op_lmady(); break; + case 0x118: + op_lay(); break; case 0x120: op_or(); break; + case 0x124: + op_anem(); break; case 0x140: case 0x141: case 0x142: case 0x143: case 0x144: case 0x145: case 0x146: case 0x147: case 0x148: case 0x149: case 0x14a: case 0x14b: case 0x14c: case 0x14d: case 0x14e: case 0x14f: -/* ok */ op_lxi(); break; + op_lxi(); break; case 0x150: case 0x151: case 0x152: case 0x153: case 0x154: case 0x155: case 0x156: case 0x157: case 0x158: case 0x159: case 0x15a: case 0x15b: case 0x15c: case 0x15d: case 0x15e: case 0x15f: -/* ok */ op_lyi(); break; + op_lyi(); break; case 0x160: case 0x161: case 0x162: case 0x163: case 0x164: case 0x165: case 0x166: case 0x167: case 0x168: case 0x169: case 0x16a: case 0x16b: case 0x16c: case 0x16d: case 0x16e: case 0x16f: -/* ok */ op_lbi(); break; + op_lbi(); break; case 0x170: case 0x171: case 0x172: case 0x173: case 0x174: case 0x175: case 0x176: case 0x177: case 0x178: case 0x179: case 0x17a: case 0x17b: case 0x17c: case 0x17d: case 0x17e: case 0x17f: -/* ok */ op_lti(); break; + op_lti(); break; case 0x1a0: op_tif1(); break; @@ -731,7 +702,7 @@ op_lay(); - 118 case 0x1e8: case 0x1e9: case 0x1ea: case 0x1eb: case 0x1ec: case 0x1ed: case 0x1ee: case 0x1ef: case 0x1f0: case 0x1f1: case 0x1f2: case 0x1f3: case 0x1f4: case 0x1f5: case 0x1f6: case 0x1f7: case 0x1f8: case 0x1f9: case 0x1fa: case 0x1fb: case 0x1fc: case 0x1fd: case 0x1fe: case 0x1ff: -/* ok */ op_br(); break; + op_br(); break; /* 0x200 */ @@ -741,42 +712,48 @@ op_lay(); - 118 case 0x204: case 0x205: case 0x206: case 0x207: op_rem(); break; case 0x208: case 0x209: case 0x20a: case 0x20b: -/* ok */ op_xma(); break; + op_xma(); break; case 0x210: case 0x211: case 0x212: case 0x213: case 0x214: case 0x215: case 0x216: case 0x217: case 0x218: case 0x219: case 0x21a: case 0x21b: case 0x21c: case 0x21d: case 0x21e: case 0x21f: op_mnei(); break; case 0x220: case 0x221: case 0x222: case 0x223: -/* ok */ op_xmb(); break; + op_xmb(); break; case 0x224: -/* ok */ op_rotr(); break; + op_rotr(); break; case 0x225: -/* ok */ op_rotl(); break; + op_rotl(); break; case 0x230: op_smc(); break; + case 0x234: + op_alem(); break; case 0x23c: op_lat(); break; case 0x240: -/* ok */ op_laspx(); break; + op_laspx(); break; + case 0x244: + op_nega(); break; case 0x24f: op_tc(); break; case 0x250: -/* ok */ op_laspy(); break; + op_laspy(); break; case 0x254: op_dy(); break; + case 0x258: + op_syy(); break; case 0x260: -/* ok */ op_lab(); break; - case 0x264: + op_lab(); break; + case 0x267: op_db(); break; case 0x270: case 0x271: case 0x272: case 0x273: case 0x274: case 0x275: case 0x276: case 0x277: case 0x278: case 0x279: case 0x27a: case 0x27b: case 0x27c: case 0x27d: case 0x27e: case 0x27f: -/* ok */ op_alei(); break; + op_alei(); break; case 0x280: case 0x281: case 0x282: case 0x283: case 0x284: case 0x285: case 0x286: case 0x287: case 0x288: case 0x289: case 0x28a: case 0x28b: case 0x28c: case 0x28d: case 0x28e: case 0x28f: -/* ok */ op_ynei(); break; + op_ynei(); break; case 0x290: -/* ok */ op_red(); break; + op_red(); break; case 0x2a0: op_reif1(); break; case 0x2a1: @@ -786,10 +763,10 @@ op_lay(); - 118 case 0x2a4: op_reie(); break; case 0x2a5: -/* ok */ op_retf(); break; + op_retf(); break; case 0x2c0: case 0x2c1: case 0x2c2: case 0x2c3: case 0x2c4: case 0x2c5: case 0x2c6: case 0x2c7: -/* ok */ op_lra(); break; + op_lra(); break; case 0x2d0: case 0x2d1: case 0x2d2: case 0x2d3: case 0x2d4: case 0x2d5: case 0x2d6: case 0x2d7: case 0x2d8: case 0x2d9: case 0x2da: case 0x2db: case 0x2dc: case 0x2dd: case 0x2de: case 0x2df: op_redd(); break; @@ -800,21 +777,23 @@ op_lay(); - 118 /* 0x300 */ case 0x320: op_comb(); break; + case 0x324: + op_bnem(); break; case 0x340: case 0x341: case 0x342: case 0x343: case 0x344: case 0x345: case 0x346: case 0x347: case 0x348: case 0x349: case 0x34a: case 0x34b: case 0x34c: case 0x34d: case 0x34e: case 0x34f: case 0x350: case 0x351: case 0x352: case 0x353: case 0x354: case 0x355: case 0x356: case 0x357: case 0x358: case 0x359: case 0x35a: case 0x35b: case 0x35c: case 0x35d: case 0x35e: case 0x35f: -/* ok */ op_lpu(); break; + op_lpu(); break; case 0x360: case 0x361: case 0x362: case 0x363: case 0x364: case 0x365: case 0x366: case 0x367: op_tbr(); break; case 0x368: case 0x369: case 0x36a: case 0x36b: case 0x36c: case 0x36d: case 0x36e: case 0x36f: -/* ok */ op_p(); break; + op_p(); break; case 0x3a4: -/* ok */ op_rtni(); break; + op_rtni(); break; case 0x3a7: -/* ok */ op_rtn(); break; + op_rtn(); break; case 0x3c0: case 0x3c1: case 0x3c2: case 0x3c3: case 0x3c4: case 0x3c5: case 0x3c6: case 0x3c7: case 0x3c8: case 0x3c9: case 0x3ca: case 0x3cb: case 0x3cc: case 0x3cd: case 0x3ce: case 0x3cf: @@ -824,7 +803,7 @@ op_lay(); - 118 case 0x3e8: case 0x3e9: case 0x3ea: case 0x3eb: case 0x3ec: case 0x3ed: case 0x3ee: case 0x3ef: case 0x3f0: case 0x3f1: case 0x3f2: case 0x3f3: case 0x3f4: case 0x3f5: case 0x3f6: case 0x3f7: case 0x3f8: case 0x3f9: case 0x3fa: case 0x3fb: case 0x3fc: case 0x3fd: case 0x3fe: case 0x3ff: -/* ok */ op_cal(); break; + op_cal(); break; default: diff --git a/src/emu/cpu/hmcs40/hmcs40d.c b/src/emu/cpu/hmcs40/hmcs40d.c index 08aecd78110..e16fa8ed618 100644 --- a/src/emu/cpu/hmcs40/hmcs40d.c +++ b/src/emu/cpu/hmcs40/hmcs40d.c @@ -55,7 +55,7 @@ static const INT8 s_bits[] = 2, 2, 2, 6, 6, 5, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -4, 0, 0, 0, - 0, 0, 0, -4, -4, 3, 3, 3, 3, 3, + 0, 0, 0, 4, 4, 3, 3, 3, 3, 3, 0, 0 }; @@ -87,96 +87,98 @@ static const INT16 s_next_pc[0x40] = }; +#define m mILL static const UINT8 hmcs40_mnemonic[0x400] = { -/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ +/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ /* 0x000 */ - mNOP, mXSP, mXSP, mXSP, mSEM, mSEM, mSEM, mSEM, mLAM, mLAM, mLAM, mLAM, mILL, mILL, mILL, mILL, - mLMIIY, mLMIIY, mLMIIY, mLMIIY, mLMIIY, mLMIIY, mLMIIY, mLMIIY, mLMIIY, mLMIIY, mLMIIY, mLMIIY, mLMIIY, mLMIIY, mLMIIY, mLMIIY, - mLBM, mLBM, mLBM, mLBM, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mAMC, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mLTA, mILL, mILL, mILL, + mNOP, mXSP, mXSP, mXSP, mSEM, mSEM, mSEM, mSEM, mLAM, mLAM, mLAM, mLAM, m, m, m, m, + mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY, + mLBM, mLBM, mLBM, mLBM, mBLEM, m, m, m, m, m, m, m, m, m, m, m, + mAMC, m, m, m, mAM, m, m, m, m, m, m, m, mLTA, m, m, m, /* 0x040 */ - mLXA, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mREC, mILL, mILL, mILL, mSEC, - mLYA, mILL, mILL, mILL, mIY, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mLBA, mILL, mILL, mILL, mIB, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, + mLXA, m, m, m, m, mDAS, mDAA, m, m, m, m, m, mREC, m, m, mSEC, + mLYA, m, m, m, mIY, m, m, m, mAYY, m, m, m, m, m, m, m, + mLBA, m, m, m, mIB, m, m, m, m, m, m, m, m, m, m, m, + mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, /* 0x080 */ - mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, - mSED, mILL, mILL, mILL, mTD, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mSEIF1, mSECF, mSEIF0, mILL, mSEIE, mSETF, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, + mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, + mSED, m, m, m, mTD, m, m, m, m, m, m, m, m, m, m, m, + mSEIF1,mSECF, mSEIF0,m, mSEIE, mSETF, m, m, m, m, m, m, m, m, m, m, + m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, /* 0x0c0 */ - mLAR, mLAR, mLAR, mLAR, mLAR, mLAR, mLAR, mLAR, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, - mLBR, mLBR, mLBR, mLBR, mLBR, mLBR, mLBR, mLBR, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, + mLAR, mLAR, mLAR, mLAR, mLAR, mLAR, mLAR, mLAR, m, m, m, m, m, m, m, m, + mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, + mLBR, mLBR, mLBR, mLBR, mLBR, mLBR, mLBR, mLBR, m, m, m, m, m, m, m, m, + mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, -/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ +/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ /* 0x100 */ - mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mLMAIY, mLMAIY, mILL, mILL, mLMADY, mLMADY, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mOR, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, + m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, + mLMAIY,mLMAIY,m, m, mLMADY,mLMADY,m, m, mLAY, m, m, m, m, m, m, m, + mOR, m, m, m, mANEM, m, m, m, m, m, m, m, m, m, m, m, + m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, /* 0x140 */ - mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, - mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, - mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, - mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, + mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, + mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, + mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, + mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, /* 0x180 */ - mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mTIF1, mTI1, mTIF0, mTI0, mILL, mTTF, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, + m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, + m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, + mTIF1, mTI1, mTIF0, mTI0, m, mTTF, m, m, m, m, m, m, m, m, m, m, + m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, /* 0x1c0 */ - mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, - mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, - mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, - mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, + mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, + mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, + mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, + mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, -/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ +/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ /* 0x200 */ - mTM, mTM, mTM, mTM, mREM, mREM, mREM, mREM, mXMA, mXMA, mXMA, mXMA, mILL, mILL, mILL, mILL, - mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, - mXMB, mXMB, mXMB, mXMB, mROTR, mROTL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mSMC, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mLAT, mILL, mILL, mILL, + mTM, mTM, mTM, mTM, mREM, mREM, mREM, mREM, mXMA, mXMA, mXMA, mXMA, m, m, m, m, + mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, + mXMB, mXMB, mXMB, mXMB, mROTR, mROTL, m, m, m, m, m, m, m, m, m, m, + mSMC, m, m, m, mALEM, m, m, m, m, m, m, m, mLAT, m, m, m, /* 0x240 */ - mLASPX, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mTC, - mLASPY, mILL, mILL, mILL, mDY, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mLAB, mILL, mILL, mILL, mDB, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, + mLASPX,m, m, m, mNEGA, m, m, m, m, m, m, m, m, m, m, mTC, + mLASPY,m, m, m, mDY, m, m, m, mSYY, m, m, m, m, m, m, m, + mLAB, m, m, m, m, m, m, mDB, m, m, m, m, m, m, m, m, + mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, /* 0x280 */ - mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, - mRED, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mREIF1, mRECF, mREIF0, mILL, mREIE, mRETF, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, + mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, + mRED, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, + mREIF1,mRECF, mREIF0,m, mREIE, mRETF, m, m, m, m, m, m, m, m, m, m, + m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, /* 0x2c0 */ - mLRA, mLRA, mLRA, mLRA, mLRA, mLRA, mLRA, mLRA, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, - mLRB, mLRB, mLRB, mLRB, mLRB, mLRB, mLRB, mLRB, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, + mLRA, mLRA, mLRA, mLRA, mLRA, mLRA, mLRA, mLRA, m, m, m, m, m, m, m, m, + mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, + mLRB, mLRB, mLRB, mLRB, mLRB, mLRB, mLRB, mLRB, m, m, m, m, m, m, m, m, + m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, -/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ +/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ /* 0x300 */ - mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mCOMB, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, + m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, + m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, + mCOMB, m, m, m, mBNEM, m, m, m, m, m, m, m, m, m, m, m, + m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, /* 0x340 */ - mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, - mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, - mTBR, mTBR, mTBR, mTBR, mTBR, mTBR, mTBR, mTBR, mP, mP, mP, mP, mP, mP, mP, mP, - mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, + mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, + mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, + mTBR, mTBR, mTBR, mTBR, mTBR, mTBR, mTBR, mTBR, mP, mP, mP, mP, mP, mP, mP, mP, + m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, /* 0x380 */ - mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mILL, mILL, mILL, mILL, mRTNI, mILL, mILL, mRTN, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, + m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, + m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, + m, m, m, m, mRTNI, m, m, mRTN, m, m, m, m, m, m, m, m, + m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, /* 0x3c0 */ - mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, - mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, - mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, - mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL + mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, + mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, + mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, + mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL }; +#undef m diff --git a/src/emu/cpu/hmcs40/hmcs40op.inc b/src/emu/cpu/hmcs40/hmcs40op.inc index 15c6d309755..9732d86f53f 100644 --- a/src/emu/cpu/hmcs40/hmcs40op.inc +++ b/src/emu/cpu/hmcs40/hmcs40op.inc @@ -618,13 +618,13 @@ void hmcs40_cpu_device::op_td() void hmcs40_cpu_device::op_sedd() { // SEDD n: Set Discrete I/O Latch Direct - write_d(m_i, 1); + write_d(m_op & 0xf, 1); } void hmcs40_cpu_device::op_redd() { // REDD n: Reset Discrete I/O Latch Direct - write_d(m_i, 0); + write_d(m_op & 0xf, 0); } void hmcs40_cpu_device::op_lar() @@ -662,13 +662,13 @@ void hmcs40_cpu_device::op_p() if (o & 0x100) { // B3 B2 B1 B0 A0 A1 A2 A3 - m_a = BITSWAP8((UINT8)o,7,6,5,4,0,1,2,3) & 0xf; + m_a = BITSWAP8(o,7,6,5,4,0,1,2,3) & 0xf; m_b = o >> 4 & 0xf; } if (o & 0x200) { // R20 R21 R22 R23 R30 R31 R32 R33 - o = BITSWAP8((UINT8)o,0,1,2,3,4,5,6,7); + o = BITSWAP8(o,0,1,2,3,4,5,6,7); write_r(2, o & 0xf); write_r(3, o >> 4 & 0xf); } diff --git a/src/emu/cpu/i386/i386.h b/src/emu/cpu/i386/i386.h index e994a7aa006..b2bcd3c0056 100644 --- a/src/emu/cpu/i386/i386.h +++ b/src/emu/cpu/i386/i386.h @@ -962,6 +962,7 @@ struct I386_CALL_GATE void pentium_cmovg_r32_rm32(); void pentium_movnti_m16_r16(); void pentium_movnti_m32_r32(); + void i386_cyrix_special(); void i386_cyrix_unknown(); void pentium_cmpxchg8b_m64(); void pentium_movntq_m64_r64(); @@ -1004,6 +1005,12 @@ struct I386_CALL_GATE void mmx_paddw_r64_rm64(); void mmx_paddd_r64_rm64(); void mmx_emms(); + void i386_cyrix_svdc(); + void i386_cyrix_rsdc(); + void i386_cyrix_svldt(); + void i386_cyrix_rsldt(); + void i386_cyrix_svts(); + void i386_cyrix_rsts(); void mmx_movd_r64_rm32(); void mmx_movq_r64_rm64(); void mmx_movd_rm32_r64(); diff --git a/src/emu/cpu/i386/i386ops.h b/src/emu/cpu/i386/i386ops.h index 6523dafd144..c540a7d3c16 100644 --- a/src/emu/cpu/i386/i386ops.h +++ b/src/emu/cpu/i386/i386ops.h @@ -329,6 +329,10 @@ const i386_device::X86_OPCODE i386_device::s_x86_opcode_table[] = { 0x32, OP_2BYTE|OP_PENTIUM, &i386_device::pentium_rdmsr, &i386_device::pentium_rdmsr, false}, { 0x38, OP_2BYTE|OP_PENTIUM, &i386_device::i386_decode_three_byte38, &i386_device::i386_decode_three_byte38,false}, { 0x3A, OP_2BYTE|OP_PENTIUM, &i386_device::i386_decode_three_byte3a, &i386_device::i386_decode_three_byte3a,false}, + { 0x3A, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_special, &i386_device::i386_cyrix_special, false}, + { 0x3B, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_special, &i386_device::i386_cyrix_special, false}, + { 0x3C, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_special, &i386_device::i386_cyrix_special, false}, + { 0x3D, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_special, &i386_device::i386_cyrix_special, false}, { 0x40, OP_2BYTE|OP_PENTIUM, &i386_device::pentium_cmovo_r16_rm16, &i386_device::pentium_cmovo_r32_rm32, false}, { 0x41, OP_2BYTE|OP_PENTIUM, &i386_device::pentium_cmovno_r16_rm16, &i386_device::pentium_cmovno_r32_rm32, false}, { 0x42, OP_2BYTE|OP_PENTIUM, &i386_device::pentium_cmovb_r16_rm16, &i386_device::pentium_cmovb_r32_rm32, false}, @@ -384,6 +388,12 @@ const i386_device::X86_OPCODE i386_device::s_x86_opcode_table[] = { 0x75, OP_2BYTE|OP_MMX, &i386_device::mmx_pcmpeqw_r64_rm64, &i386_device::mmx_pcmpeqw_r64_rm64, false}, { 0x76, OP_2BYTE|OP_MMX, &i386_device::mmx_pcmpeqd_r64_rm64, &i386_device::mmx_pcmpeqd_r64_rm64, false}, { 0x77, OP_2BYTE|OP_MMX, &i386_device::mmx_emms, &i386_device::mmx_emms, false}, + { 0x78, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_svdc, &i386_device::i386_cyrix_svdc, false}, + { 0x79, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_rsdc, &i386_device::i386_cyrix_rsdc, false}, + { 0x7a, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_svldt, &i386_device::i386_cyrix_svldt, false}, + { 0x7b, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_rsldt, &i386_device::i386_cyrix_rsldt, false}, + { 0x7c, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_svts, &i386_device::i386_cyrix_svts, false}, + { 0x7d, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_rsts, &i386_device::i386_cyrix_rsts, false}, { 0x7e, OP_2BYTE|OP_MMX, &i386_device::mmx_movd_rm32_r64, &i386_device::mmx_movd_rm32_r64, false}, { 0x7f, OP_2BYTE|OP_MMX, &i386_device::mmx_movq_rm64_r64, &i386_device::mmx_movq_rm64_r64, false}, { 0x80, OP_2BYTE|OP_I386, &i386_device::i386_jo_rel16, &i386_device::i386_jo_rel32, false}, diff --git a/src/emu/cpu/i386/pentops.inc b/src/emu/cpu/i386/pentops.inc index 348bd71becd..c7a341d9ba7 100644 --- a/src/emu/cpu/i386/pentops.inc +++ b/src/emu/cpu/i386/pentops.inc @@ -1062,6 +1062,18 @@ void i386_device::pentium_movnti_m32_r32() // Opcode 0f c3 } } +void i386_device::i386_cyrix_special() // Opcode 0x0f 3a-3d +{ +/* +0f 3a BB0_RESET (set BB0 pointer = base) +0f 3b BB1_RESET (set BB1 pointer = base) +0f 3c CPU_WRITE (write special CPU memory-mapped register, [ebx] = eax) +0f 3d CPU_READ (read special CPU memory-mapped register, eax, = [ebx]) +*/ + + CYCLES(1); +} + void i386_device::i386_cyrix_unknown() // Opcode 0x0f 74 { logerror("Unemulated 0x0f 0x74 opcode called\n"); @@ -1970,6 +1982,262 @@ void i386_device::mmx_emms() // Opcode 0f 77 CYCLES(1); // TODO: correct cycle count } +void i386_device::i386_cyrix_svdc() // Opcode 0f 78 +{ + UINT8 modrm = FETCH(); + + if( modrm < 0xc0 ) { + UINT32 ea = GetEA(modrm,0); + int index = (modrm >> 3) & 7; + int limit; + switch (index) + { + case 0: + { + index = ES; + break; + } + + case 2: + { + index = SS; + break; + } + + case 3: + { + index = DS; + break; + } + + case 4: + { + index = FS; + break; + } + + case 5: + { + index = GS; + break; + } + + default: + { + i386_trap(6, 0, 0); + } + } + + limit = m_sreg[index].limit; + + if (m_sreg[index].flags & 0x8000) //G bit + { + limit >>= 12; + } + + WRITE16(ea + 0, limit); + WRITE32(ea + 2, m_sreg[index].base); + WRITE16(ea + 5, m_sreg[index].flags); //replace top 8 bits of base + WRITE8(ea + 7, m_sreg[index].base >> 24); + WRITE16(ea + 8, m_sreg[index].selector); + } else { + i386_trap(6, 0, 0); + } + CYCLES(1); // TODO: correct cycle count +} + +void i386_device::i386_cyrix_rsdc() // Opcode 0f 79 +{ + UINT8 modrm = FETCH(); + + if( modrm < 0xc0 ) { + UINT32 ea = GetEA(modrm,0); + int index = (modrm >> 3) & 7; + UINT16 flags; + UINT32 base; + UINT32 limit; + switch (index) + { + case 0: + { + index = ES; + break; + } + + case 2: + { + index = SS; + break; + } + + case 3: + { + index = DS; + break; + } + + case 4: + { + index = FS; + break; + } + + case 5: + { + index = GS; + break; + } + + default: + { + i386_trap(6, 0, 0); + } + } + + base = (READ32(ea + 2) & 0x00ffffff) | (READ8(ea + 7) << 24); + flags = READ16(ea + 5); + limit = READ16(ea + 0) | ((flags & 3) << 16); + + if (flags & 0x8000) //G bit + { + limit = (limit << 12) | 0xfff; + } + + m_sreg[index].selector = READ16(ea + 8); + m_sreg[index].flags = flags; + m_sreg[index].base = base; + m_sreg[index].limit = limit; + } else { + i386_trap(6, 0, 0); + } + CYCLES(1); // TODO: correct cycle count +} + +void i386_device::i386_cyrix_svldt() // Opcode 0f 7a +{ + if ( PROTECTED_MODE && !V8086_MODE ) + { + UINT8 modrm = FETCH(); + + if( !(modrm & 0xf8) ) { + UINT32 ea = GetEA(modrm,0); + UINT32 limit = m_ldtr.limit; + + if (m_ldtr.flags & 0x8000) //G bit + { + limit >>= 12; + } + + WRITE16(ea + 0, limit); + WRITE32(ea + 2, m_ldtr.base); + WRITE16(ea + 5, m_ldtr.flags); //replace top 8 bits of base + WRITE8(ea + 7, m_ldtr.base >> 24); + WRITE16(ea + 8, m_ldtr.segment); + } else { + i386_trap(6, 0, 0); + } + } else { + i386_trap(6, 0, 0); + } + CYCLES(1); // TODO: correct cycle count +} + +void i386_device::i386_cyrix_rsldt() // Opcode 0f 7b +{ + if ( PROTECTED_MODE && !V8086_MODE ) + { + if(m_CPL) + FAULT(FAULT_GP,0) + + UINT8 modrm = FETCH(); + + if( !(modrm & 0xf8) ) { + UINT32 ea = GetEA(modrm,0); + UINT16 flags = READ16(ea + 5); + UINT32 base = (READ32(ea + 2) | 0x00ffffff) | (READ8(ea + 7) << 24); + UINT32 limit = READ16(ea + 0) | ((flags & 3) << 16); + I386_SREG seg; + + if (flags & 0x8000) //G bit + { + limit = (limit << 12) | 0xfff; + } + + memset(&seg, 0, sizeof(seg)); + seg.selector = READ16(ea + 8); + i386_load_protected_mode_segment(&seg,NULL); + m_ldtr.limit = limit; + m_ldtr.base = base; + m_ldtr.flags = flags; + } else { + i386_trap(6, 0, 0); + } + } else { + i386_trap(6, 0, 0); + } + CYCLES(1); // TODO: correct cycle count +} + +void i386_device::i386_cyrix_svts() // Opcode 0f 7c +{ + if ( PROTECTED_MODE ) + { + UINT8 modrm = FETCH(); + + if( !(modrm & 0xf8) ) { + UINT32 ea = GetEA(modrm,0); + UINT32 limit = m_task.limit; + + if (m_task.flags & 0x8000) //G bit + { + limit >>= 12; + } + + WRITE16(ea + 0, limit); + WRITE32(ea + 2, m_task.base); + WRITE16(ea + 5, m_task.flags); //replace top 8 bits of base + WRITE8(ea + 7, m_task.base >> 24); + WRITE16(ea + 8, m_task.segment); + } else { + i386_trap(6, 0, 0); + } + } else { + i386_trap(6, 0, 0); + } +} + +void i386_device::i386_cyrix_rsts() // Opcode 0f 7d +{ + if ( PROTECTED_MODE ) + { + if(m_CPL) + FAULT(FAULT_GP,0) + + UINT8 modrm = FETCH(); + + if( !(modrm & 0xf8) ) { + UINT32 ea = GetEA(modrm,0); + UINT16 flags = READ16(ea + 5); + UINT32 base = (READ32(ea + 2) | 0x00ffffff) | (READ8(ea + 7) << 24); + UINT32 limit = READ16(ea + 0) | ((flags & 3) << 16); + + if (flags & 0x8000) //G bit + { + limit = (limit << 12) | 0xfff; + } + m_task.segment = READ16(ea + 8); + m_task.limit = limit; + m_task.base = base; + m_task.flags = flags; + } else { + i386_trap(6, 0, 0); + } + } else { + i386_trap(6, 0, 0); + } + CYCLES(1); // TODO: correct cycle count +} + void i386_device::mmx_movd_r64_rm32() // Opcode 0f 6e { MMXPROLOG(); diff --git a/src/emu/cpu/i960/i960.c b/src/emu/cpu/i960/i960.c index 74666a6671e..8ddd2b6ec3e 100644 --- a/src/emu/cpu/i960/i960.c +++ b/src/emu/cpu/i960/i960.c @@ -1436,7 +1436,7 @@ void i960_cpu_device::execute_op(UINT32 opcode) case 0xd: // cosr m_icount -= 406; t1f = get_1_rif(opcode); - set_rif(opcode, sin(t1f)); + set_rif(opcode, cos(t1f)); break; case 0xe: // tanr diff --git a/src/emu/cpu/sharc/sharc.c b/src/emu/cpu/sharc/sharc.c index 5139c896e37..7505535ff64 100644 --- a/src/emu/cpu/sharc/sharc.c +++ b/src/emu/cpu/sharc/sharc.c @@ -355,9 +355,7 @@ void adsp21062_device::device_start() m_lcstack[i] = 0; m_lastack[i] = 0; } - m_lstkp = 0; m_pcstk = 0; - m_pcstkp = 0; m_laddr.addr = m_laddr.code = m_laddr.loop_type = 0; m_curlcntr = 0; m_lcntr = 0; @@ -682,6 +680,8 @@ void adsp21062_device::device_reset() m_idle = 0; m_stky = 0x5400000; + m_lstkp = 0; + m_pcstkp = 0; m_interrupt_active = 0; } diff --git a/src/emu/emucore.h b/src/emu/emucore.h index 23f8808a739..899ee9fa670 100644 --- a/src/emu/emucore.h +++ b/src/emu/emucore.h @@ -15,6 +15,7 @@ #define __EMUCORE_H__ // standard C includes +#include <assert.h> #include <math.h> #include <stdio.h> #include <string.h> @@ -218,7 +219,10 @@ inline void operator--(_Type &value, int) { value = (_Type)((int)value - 1); } #undef assert #undef assert_always -#ifdef MAME_DEBUG +#if defined(MAME_DEBUG_FAST) +#define assert(x) do { } while (0) +#define assert_always(x, msg) do { if (!(x)) throw emu_fatalerror("Fatal error: %s\nCaused by assert: %s:%d: %s", msg, __FILE__, __LINE__, #x); } while (0) +#elif defined(MAME_DEBUG) #define assert(x) do { if (!(x)) throw emu_fatalerror("assert: %s:%d: %s", __FILE__, __LINE__, #x); } while (0) #define assert_always(x, msg) do { if (!(x)) throw emu_fatalerror("Fatal error: %s\nCaused by assert: %s:%d: %s", msg, __FILE__, __LINE__, #x); } while (0) #else diff --git a/src/emu/emuopts.c b/src/emu/emuopts.c index 0b3c785fd5d..7c1bd9560cb 100644 --- a/src/emu/emuopts.c +++ b/src/emu/emuopts.c @@ -68,6 +68,7 @@ const options_entry emu_options::s_option_entries[] = { OPTION_SNAPBILINEAR, "1", OPTION_BOOLEAN, "specify if the snapshot/movie should have bilinear filtering applied" }, { OPTION_STATENAME, "%g", OPTION_STRING, "override of the default state subfolder naming; %g == gamename" }, { OPTION_BURNIN, "0", OPTION_BOOLEAN, "create burn-in snapshots for each screen" }, + { OPTION_DUMMYWRITE, "0", OPTION_BOOLEAN, "indicates if a snapshot should be created if each frame" }, // performance options { NULL, NULL, OPTION_HEADER, "CORE PERFORMANCE OPTIONS" }, diff --git a/src/emu/emuopts.h b/src/emu/emuopts.h index 17deb586576..ece89e1d09f 100644 --- a/src/emu/emuopts.h +++ b/src/emu/emuopts.h @@ -73,6 +73,7 @@ enum #define OPTION_RECORD "record" #define OPTION_MNGWRITE "mngwrite" #define OPTION_AVIWRITE "aviwrite" +#define OPTION_DUMMYWRITE "dummywrite" #define OPTION_WAVWRITE "wavwrite" #define OPTION_SNAPNAME "snapname" #define OPTION_SNAPSIZE "snapsize" @@ -241,6 +242,7 @@ public: const char *record() const { return value(OPTION_RECORD); } const char *mng_write() const { return value(OPTION_MNGWRITE); } const char *avi_write() const { return value(OPTION_AVIWRITE); } + bool dummy_write() const { return bool_value(OPTION_DUMMYWRITE); } const char *wav_write() const { return value(OPTION_WAVWRITE); } const char *snap_name() const { return value(OPTION_SNAPNAME); } const char *snap_size() const { return value(OPTION_SNAPSIZE); } diff --git a/src/emu/luaengine.c b/src/emu/luaengine.c index f066bdeda6d..c8bb21eedc3 100644 --- a/src/emu/luaengine.c +++ b/src/emu/luaengine.c @@ -130,7 +130,7 @@ lua_engine::hook::hook() cb = -1; } -#ifdef SDLMAME_SOLARIS +#if defined(SDLMAME_SOLARIS) || defined(__ANDROID__) #undef _L #endif diff --git a/src/emu/machine/machine.mak b/src/emu/machine/machine.mak index 327e9ff739a..85bfb92139d 100644 --- a/src/emu/machine/machine.mak +++ b/src/emu/machine/machine.mak @@ -1255,6 +1255,7 @@ MACHINEOBJS += $(MACHINEOBJ)/lpc.o MACHINEOBJS += $(MACHINEOBJ)/lpc-acpi.o MACHINEOBJS += $(MACHINEOBJ)/lpc-rtc.o MACHINEOBJS += $(MACHINEOBJ)/lpc-pit.o +MACHINEOBJS += $(MACHINEOBJ)/vrc4373.o endif #------------------------------------------------- diff --git a/src/emu/machine/mcf5206e.c b/src/emu/machine/mcf5206e.c index 5429cc16482..d7b99c42483 100644 --- a/src/emu/machine/mcf5206e.c +++ b/src/emu/machine/mcf5206e.c @@ -672,7 +672,7 @@ TIMER_CALLBACK_MEMBER(mcf5206e_peripheral_device::timer1_callback) debuglogtimer("timer1_callback\n"); m_TER1 |= 0x02; - timer1->adjust(attotime::from_msec(10)); // completely made up value just to fire our timers for now + m_timer1->adjust(attotime::from_msec(10)); // completely made up value just to fire our timers for now } @@ -703,11 +703,11 @@ WRITE16_MEMBER( mcf5206e_peripheral_device::TMR1_w) if (m_TMR1 & 0x0001) { - timer1->adjust(attotime::from_seconds(1)); // completely made up value just to fire our timers for now + m_timer1->adjust(attotime::from_seconds(1)); // completely made up value just to fire our timers for now } else { - timer1->adjust(attotime::never); + m_timer1->adjust(attotime::never); } @@ -859,8 +859,26 @@ void mcf5206e_peripheral_device::device_start() { init_regs(true); - timer1 = machine().scheduler().timer_alloc( timer_expired_delegate( FUNC( mcf5206e_peripheral_device::timer1_callback ), this) ); - + m_timer1 = machine().scheduler().timer_alloc( timer_expired_delegate( FUNC( mcf5206e_peripheral_device::timer1_callback ), this) ); + + save_item(NAME(m_ICR)); + save_item(NAME(m_CSAR)); + save_item(NAME(m_CSMR)); + save_item(NAME(m_CSCR)); + save_item(NAME(m_DMCR)); + save_item(NAME(m_PAR)); + save_item(NAME(m_TMR1)); + save_item(NAME(m_TRR1)); + save_item(NAME(m_TER1)); + save_item(NAME(m_TCN1)); + save_item(NAME(m_PPDDR)); + save_item(NAME(m_PPDAT)); + save_item(NAME(m_IMR)); + save_item(NAME(m_MBCR)); + save_item(NAME(m_MBSR)); + save_item(NAME(m_MFDR)); + save_item(NAME(m_MBDR)); + save_item(NAME(m_coldfire_regs)); } void mcf5206e_peripheral_device::device_reset() @@ -868,7 +886,7 @@ void mcf5206e_peripheral_device::device_reset() m_cpu = (cpu_device*)machine().device(":maincpu"); // hack. this device should really be attached to a modern CPU core init_regs(false); - timer1->adjust(attotime::never); + m_timer1->adjust(attotime::never); } READ32_MEMBER(mcf5206e_peripheral_device::dev_r) diff --git a/src/emu/machine/mcf5206e.h b/src/emu/machine/mcf5206e.h index 8bda69d7cfb..84c9003eafe 100644 --- a/src/emu/machine/mcf5206e.h +++ b/src/emu/machine/mcf5206e.h @@ -1,6 +1,6 @@ /*************************************************************************** - Konami 033906 + MCF5206E Peripherals ***************************************************************************/ @@ -183,7 +183,7 @@ private: UINT16 m_DMCR; UINT16 m_PAR; - emu_timer *timer1; + emu_timer *m_timer1; UINT16 m_TMR1; UINT16 m_TRR1; UINT8 m_TER1; diff --git a/src/emu/machine/tmp68301.c b/src/emu/machine/tmp68301.c index 3c88faf7f8f..9795e075b4a 100644 --- a/src/emu/machine/tmp68301.c +++ b/src/emu/machine/tmp68301.c @@ -99,8 +99,15 @@ tmp68301_device::tmp68301_device(const machine_config &mconfig, const char *tag, device_memory_interface(mconfig, *this), m_in_parallel_cb(*this), m_out_parallel_cb(*this), + m_imr(0), + m_iisr(0), + m_scr(0), + m_pdir(0), m_space_config("regs", ENDIANNESS_LITTLE, 16, 10, 0, NULL, *ADDRESS_MAP_NAME(tmp68301_regs)) { + memset(m_regs, 0, sizeof(m_regs)); + memset(m_IE, 0, sizeof(m_IE)); + memset(m_irq_vector, 0, sizeof(m_irq_vector)); } @@ -116,6 +123,14 @@ void tmp68301_device::device_start() m_in_parallel_cb.resolve_safe(0); m_out_parallel_cb.resolve_safe(); + + save_item(NAME(m_regs)); + save_item(NAME(m_IE)); + save_item(NAME(m_irq_vector)); + save_item(NAME(m_imr)); + save_item(NAME(m_iisr)); + save_item(NAME(m_scr)); + save_item(NAME(m_pdir)); } //------------------------------------------------- diff --git a/src/emu/machine/tms6100.c b/src/emu/machine/tms6100.c index c261d1b949b..2df1cada967 100644 --- a/src/emu/machine/tms6100.c +++ b/src/emu/machine/tms6100.c @@ -28,6 +28,19 @@ VSS | 14 15 | NC +-----------------+ + TMS6125: + + +---------+ + DATA/ADD1 | 1 16 | NC + DATA/ADD2 | 2 15 | NC + DATA/ADD4 | 3 14 | NC + DATA/ADD8 | 4 13 | NC + CLK | 5 12 | VDD + NC | 6 11 | /CS + NC | 7 10 | M1 + M0 | 8 9 | VSS + +---------+ + M58819 (from radarscope schematics): +-----------------+ diff --git a/src/emu/machine/vrc4373.c b/src/emu/machine/vrc4373.c new file mode 100644 index 00000000000..b1e5c6e8928 --- /dev/null +++ b/src/emu/machine/vrc4373.c @@ -0,0 +1,344 @@ +#include "vrc4373.h" + +#define LOG_NILE (1) +#define LOG_NILE_MASTER (0) +#define LOG_NILE_TARGET (1) + +const device_type VRC4373 = &device_creator<vrc4373_device>; + +DEVICE_ADDRESS_MAP_START(config_map, 32, vrc4373_device) + AM_RANGE(0x40, 0x43) AM_READWRITE (pcictrl_r, pcictrl_w) + AM_INHERIT_FROM(pci_host_device::config_map) +ADDRESS_MAP_END + +// cpu i/f map +DEVICE_ADDRESS_MAP_START(cpu_map, 32, vrc4373_device) + AM_RANGE(0x00000000, 0x0000007b) AM_READWRITE( vrc4373_device::cpu_if_r, vrc4373_device::cpu_if_w) +ADDRESS_MAP_END + +// Target Window 1 map +DEVICE_ADDRESS_MAP_START(target1_map, 32, vrc4373_device) + AM_RANGE(0x00000000, 0xFFFFFFFF) AM_READWRITE( vrc4373_device::target1_r, vrc4373_device::target1_w) +ADDRESS_MAP_END + +// Target Window 2 map +DEVICE_ADDRESS_MAP_START(target2_map, 32, vrc4373_device) + AM_RANGE(0x00000000, 0xFFFFFFFF) AM_READWRITE( vrc4373_device::target2_r, vrc4373_device::target2_w) +ADDRESS_MAP_END + +vrc4373_device::vrc4373_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : pci_host_device(mconfig, VRC4373, "NEC VRC4373 System Controller", tag, owner, clock, "vrc4373", __FILE__), + m_mem_config("memory_space", ENDIANNESS_LITTLE, 32, 32), + m_io_config("io_space", ENDIANNESS_LITTLE, 32, 32) +{ +} + +const address_space_config *vrc4373_device::memory_space_config(address_spacenum spacenum) const +{ + return (spacenum == AS_PROGRAM) ? pci_bridge_device::memory_space_config(spacenum) : (spacenum == AS_DATA) ? &m_mem_config : (spacenum == AS_IO) ? &m_io_config : NULL; +} + +void vrc4373_device::device_start() +{ + pci_host_device::device_start(); + m_cpu = machine().device<cpu_device>(cpu_tag); + m_cpu_space = &m_cpu->space(AS_PROGRAM); + memory_space = &space(AS_DATA); + io_space = &space(AS_IO); + + memset(m_cpu_regs, 0, sizeof(m_cpu_regs)); + + memory_window_start = 0; + memory_window_end = 0xffffffff; + memory_offset = 0; + io_window_start = 0; + io_window_end = 0xffffffff; + io_offset = 0x00000000; + status = 0x0280; + m_ram_size = 1<<22; + m_ram_base = 0; + m_simm_size = 1<<21; + m_simm_base = 0; + regenerate_config_mapping(); +} + +void vrc4373_device::device_reset() +{ + pci_device::device_reset(); + memset(m_cpu_regs, 0, sizeof(m_cpu_regs)); + remap_cb(); +} + +void vrc4373_device::map_extra(UINT64 memory_window_start, UINT64 memory_window_end, UINT64 memory_offset, address_space *memory_space, + UINT64 io_window_start, UINT64 io_window_end, UINT64 io_offset, address_space *io_space) +{ + m_cpu_space->unmap_readwrite(0x00000000, 0xffffffff); + + m_cpu_space->install_rom (0x1fc00000, 0x1fcfffff, m_region->base()); + m_cpu_space->install_device(0x0f000000, 0x0f0000ff, *static_cast<vrc4373_device *>(this), &vrc4373_device::cpu_map); + // PCI Configuration also mapped at 0x0f000100 + m_cpu_space->install_device(0x0f000100, 0x0f0001ff, *static_cast<vrc4373_device *>(this), &vrc4373_device::config_map); + + UINT32 winStart, winEnd, winSize; + + if (m_cpu_regs[NREG_BMCR]&0x8) { + m_cpu_space->install_ram (m_ram_base, m_ram_base+m_ram_size-1, &m_ram[0]); + if (LOG_NILE) + logerror("%s: map_extra ram_size=%08X ram_base=%08X\n", tag(),m_ram_size,m_ram_base); + } + if (m_cpu_regs[NREG_SIMM1]&0x8) { + m_cpu_space->install_ram (m_simm_base, m_simm_base+m_simm_size-1, &m_simm[0]); + if (LOG_NILE) + logerror("%s: map_extra simm_size=%08X simm_base=%08X\n", tag(),m_simm_size,m_simm_base); + } + // PCI Master Window 1 + if (m_cpu_regs[NREG_PCIMW1]&0x1000) { + winStart = m_cpu_regs[NREG_PCIMW1]&0xff000000; + winEnd = winStart | (~(0x80000000 | (((m_cpu_regs[NREG_PCIMW1]>>13)&0x7f)<<24))); + winSize = winEnd - winStart + 1; + m_cpu_space->install_read_handler(winStart, winEnd, 0, 0, read32_delegate(FUNC(vrc4373_device::master1_r), this)); + m_cpu_space->install_write_handler(winStart, winEnd, 0, 0, write32_delegate(FUNC(vrc4373_device::master1_w), this)); + if (LOG_NILE) + logerror("%s: map_extra Master Window 1 start=%08X end=%08X size=%08X laddr=%08X\n", tag(), winStart, winEnd, winSize, m_pci1_laddr); + } + // PCI Master Window 2 + if (m_cpu_regs[NREG_PCIMW2]&0x1000) { + winStart = m_cpu_regs[NREG_PCIMW2]&0xff000000; + winEnd = winStart | (~(0x80000000 | (((m_cpu_regs[NREG_PCIMW2]>>13)&0x7f)<<24))); + winSize = winEnd - winStart + 1; + m_cpu_space->install_read_handler(winStart, winEnd, 0, 0, read32_delegate(FUNC(vrc4373_device::master2_r), this)); + m_cpu_space->install_write_handler(winStart, winEnd, 0, 0, write32_delegate(FUNC(vrc4373_device::master2_w), this)); + if (LOG_NILE) + logerror("%s: map_extra Master Window 2 start=%08X end=%08X size=%08X laddr=%08X\n", tag(), winStart, winEnd, winSize, m_pci2_laddr); + } + // PCI IO Window + if (m_cpu_regs[NREG_PCIMIOW]&0x1000) { + winStart = m_cpu_regs[NREG_PCIMIOW]&0xff000000; + winEnd = winStart | (~(0x80000000 | (((m_cpu_regs[NREG_PCIMIOW]>>13)&0x7f)<<24))); + winSize = winEnd - winStart + 1; + m_cpu_space->install_read_handler(winStart, winEnd, 0, 0, read32_delegate(FUNC(vrc4373_device::master_io_r), this)); + m_cpu_space->install_write_handler(winStart, winEnd, 0, 0, write32_delegate(FUNC(vrc4373_device::master_io_w), this)); + if (LOG_NILE) + logerror("%s: map_extra IO Window start=%08X end=%08X size=%08X laddr=%08X\n", tag(), winStart, winEnd, winSize, m_pci_io_laddr); + } + // PCI Target Window 1 + if (m_cpu_regs[NREG_PCITW1]&0x1000) { + winStart = m_cpu_regs[NREG_PCITW1]&0xffe00000; + winEnd = winStart | (~(0xf0000000 | (((m_cpu_regs[NREG_PCITW1]>>13)&0x7f)<<21))); + winSize = winEnd - winStart + 1; + memory_space->install_read_handler(winStart, winEnd, 0, 0, read32_delegate(FUNC(vrc4373_device::target1_r), this)); + memory_space->install_write_handler(winStart, winEnd, 0, 0, write32_delegate(FUNC(vrc4373_device::target1_w), this)); + if (LOG_NILE) + logerror("%s: map_extra Target Window 1 start=%08X end=%08X size=%08X laddr=%08X\n", tag(), winStart, winEnd, winSize, m_target1_laddr); + } + // PCI Target Window 2 + if (m_cpu_regs[NREG_PCITW2]&0x1000) { + winStart = m_cpu_regs[NREG_PCITW2]&0xffe00000; + winEnd = winStart | (~(0xf0000000 | (((m_cpu_regs[NREG_PCITW2]>>13)&0x7f)<<21))); + winSize = winEnd - winStart + 1; + memory_space->install_read_handler(winStart, winEnd, 0, 0, read32_delegate(FUNC(vrc4373_device::target2_r), this)); + memory_space->install_write_handler(winStart, winEnd, 0, 0, write32_delegate(FUNC(vrc4373_device::target2_w), this)); + if (LOG_NILE) + logerror("%s: map_extra Target Window 2 start=%08X end=%08X size=%08X laddr=%08X\n", tag(), winStart, winEnd, winSize, m_target2_laddr); + } +} + +void vrc4373_device::reset_all_mappings() +{ + pci_device::reset_all_mappings(); +} + +void vrc4373_device::set_cpu_tag(const char *_cpu_tag) +{ + if (LOG_NILE) + logerror("%s: set_cpu_tag\n", tag()); + cpu_tag = _cpu_tag; +} +// PCI bus control +READ32_MEMBER (vrc4373_device::pcictrl_r) +{ + UINT32 result = 0; + if (LOG_NILE) + logerror("%06X:nile pcictrl_r from offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, result, mem_mask); + return result; +} +WRITE32_MEMBER (vrc4373_device::pcictrl_w) +{ + if (LOG_NILE) + logerror("%06X:nile pcictrl_w to offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask); +} +// PCI Master Window 1 +READ32_MEMBER (vrc4373_device::master1_r) +{ + UINT32 result = this->space(AS_DATA).read_dword(m_pci1_laddr | (offset*4), mem_mask); + if (LOG_NILE_MASTER) + logerror("%06X:nile master1 read from offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, result, mem_mask); + return result; +} +WRITE32_MEMBER (vrc4373_device::master1_w) +{ + this->space(AS_DATA).write_dword(m_pci1_laddr | (offset*4), data, mem_mask); + if (LOG_NILE_MASTER) + logerror("%06X:nile master1 write to offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask); +} + +// PCI Master Window 2 +READ32_MEMBER (vrc4373_device::master2_r) +{ + UINT32 result = this->space(AS_DATA).read_dword(m_pci2_laddr | (offset*4), mem_mask); + if (LOG_NILE_MASTER) + logerror("%06X:nile master2 read from offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, result, mem_mask); + return result; +} +WRITE32_MEMBER (vrc4373_device::master2_w) +{ + this->space(AS_DATA).write_dword(m_pci2_laddr | (offset*4), data, mem_mask); + if (LOG_NILE_MASTER) + logerror("%06X:nile master2 write to offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask); +} + +// PCI Master IO Window +READ32_MEMBER (vrc4373_device::master_io_r) +{ + UINT32 result = this->space(AS_IO).read_dword(m_pci_io_laddr | (offset*4), mem_mask); + if (LOG_NILE_MASTER) + logerror("%06X:nile master io read from offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, result, mem_mask); + return result; +} +WRITE32_MEMBER (vrc4373_device::master_io_w) +{ + this->space(AS_IO).write_dword(m_pci_io_laddr | (offset*4), data, mem_mask); + if (LOG_NILE_MASTER) + logerror("%06X:nile master io write to offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask); +} + +// PCI Target Window 1 +READ32_MEMBER (vrc4373_device::target1_r) +{ + UINT32 result = m_cpu->space(AS_PROGRAM).read_dword(m_target1_laddr | (offset*4), mem_mask); + if (LOG_NILE_TARGET) + logerror("%06X:nile target1 read from offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, result, mem_mask); + return result; +} +WRITE32_MEMBER (vrc4373_device::target1_w) +{ + m_cpu->space(AS_PROGRAM).write_dword(m_target1_laddr | (offset*4), data, mem_mask); + if (LOG_NILE_TARGET) + logerror("%06X:nile target1 write to offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask); +} + +// PCI Target Window 2 +READ32_MEMBER (vrc4373_device::target2_r) +{ + UINT32 result = m_cpu->space(AS_PROGRAM).read_dword(m_target2_laddr | (offset*4), mem_mask); + if (LOG_NILE_TARGET) + logerror("%06X:nile target2 read from offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, result, mem_mask); + return result; +} +WRITE32_MEMBER (vrc4373_device::target2_w) +{ + m_cpu->space(AS_PROGRAM).write_dword(m_target2_laddr | (offset*4), data, mem_mask); + if (LOG_NILE_TARGET) + logerror("%06X:nile target2 write to offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask); +} + +// CPU I/F +READ32_MEMBER (vrc4373_device::cpu_if_r) +{ + UINT32 result = m_cpu_regs[offset]; + switch (offset) { + case NREG_PCICAR: + result = config_address_r(space, offset); + break; + case NREG_PCICDR: + result = config_data_r(space, offset); + break; + default: + break; + } + if (LOG_NILE) + logerror("%06X:nile read from offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, result, mem_mask); + return result; +} + +WRITE32_MEMBER(vrc4373_device::cpu_if_w) +{ + if (LOG_NILE) + logerror("%06X:nile write to offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask); + + UINT32 modData; + COMBINE_DATA(&m_cpu_regs[offset]); + switch (offset) { + case NREG_PCIMW1: + m_pci1_laddr = (data&0xff)<<24; + remap_cb(); + break; + case NREG_PCIMW2: + m_pci2_laddr = (data&0xff)<<24; + remap_cb(); + break; + case NREG_PCIMIOW: + m_pci_io_laddr = (data&0xff)<<24; + remap_cb(); + break; + case NREG_PCITW1: + m_target1_laddr = (data&0x7FF)<<21; + break; + case NREG_PCITW2: + m_target2_laddr = (data&0x7FF)<<21; + break; + case NREG_PCICAR: + // Bits in reserved area are used for device selection of type 0 config transactions + // Assuming 23:11 get mapped into device number for configuration + if ((data&0x3) == 0x0) { + // Type 0 transaction + modData = 0; + // Select the device based on one hot bit + for (int i=11; i<24; i++) { + if ((data>>i)&0x1) { + // One hot encoding, bit 11 will mean device 1 + modData = i-10; + break; + } + } + // Re-organize into Type 1 transaction for bus 0 (local bus) + modData = (modData<<11) | (data&0x7ff) | (0x80000000); + } else { + // Type 1 transaction, no modification needed + modData = data; + } + pci_host_device::config_address_w(space, offset, modData); + break; + case NREG_PCICDR: + pci_host_device::config_data_w(space, offset, data); + break; + case NREG_BMCR: + if ((data>>3)&0x1) { + m_ram_size = 1<<22; // 4MB + for (int i=14; i<=15; i++) { + if (!((data>>i)&0x1)) m_ram_size<<=1; + else break; + } + m_ram.resize(m_ram_size/4); + m_ram_base = (data & 0x0fc00000); + } + remap_cb(); + break; + case NREG_SIMM1: + if ((data>>3)&0x1) { + m_simm_size = 1<<21; // 2MB + for (int i=13; i<=17; i++) { + if (!((data>>i)&0x1)) m_simm_size<<=1; + else break; + } + m_simm.resize(m_simm_size/4); + m_simm_base = (data & 0x0fe00000); + } + remap_cb(); + break; + default: + break; + } + +} + diff --git a/src/emu/machine/vrc4373.h b/src/emu/machine/vrc4373.h new file mode 100644 index 00000000000..17fa5de7e9c --- /dev/null +++ b/src/emu/machine/vrc4373.h @@ -0,0 +1,116 @@ +// NEC VRC 4373 System Controller + +#ifndef VRC4373_H +#define VRC4373_H + +#include "pci.h" + +#define MCFG_VRC4373_ADD(_tag, _cpu_tag) \ + MCFG_PCI_HOST_ADD(_tag, VRC4373, 0x005B1033, 0x00, 0x00000000) \ + downcast<vrc4373_device *>(device)->set_cpu_tag(_cpu_tag); + +#define VRC4373_PAGESHIFT 12 + +/* NILE 3 registers 0x000-0x0ff */ +#define NREG_BMCR (0x000/4) +#define NREG_SIMM1 (0x004/4) +#define NREG_SIMM2 (0x008/4) +#define NREG_SIMM3 (0x00C/4) +#define NREG_SIMM4 (0x010/4) +#define NREG_PCIMW1 (0x014/4) +#define NREG_PCIMW2 (0x018/4) +#define NREG_PCITW1 (0x01C/4) +#define NREG_PCITW2 (0x020/4) +#define NREG_PCIMIOW (0x024/4) +#define NREG_PCICDR (0x028/4) +#define NREG_PCICAR (0x02C/4) +#define NREG_PCIMB1 (0x030/4) +#define NREG_PCIMB2 (0x034/4) +#define NREG_DMACR1 (0x038/4) +#define NREG_DMAMAR1 (0x03C/4) +#define NREG_DMAPCI1 (0x040/4) +#define NREG_DMACR2 (0x044/4) +#define NREG_DMAMAR2 (0x048/4) +#define NREG_DMAPCI2 (0x04C/4) + +#define NREG_BESR (0x050/4) +#define NREG_ICSR (0x054/4) +#define NREG_DRAMRCR (0x058/4) +#define NREG_BOOTWP (0x05C/4) +#define NREG_PCIEAR (0x060/4) +#define NREG_DMA_WR (0x064/4) +#define NREG_DMA_CMAR (0x068/4) +#define NREG_DMA_CPAR (0x06C/4) +#define NREG_PCIRC (0x070/4) +#define NREG_PCIEN (0x074/4) +#define NREG_PMIR (0x078/4) + +class vrc4373_device : public pci_host_device { +public: + vrc4373_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + virtual void reset_all_mappings(); + virtual void map_extra(UINT64 memory_window_start, UINT64 memory_window_end, UINT64 memory_offset, address_space *memory_space, + UINT64 io_window_start, UINT64 io_window_end, UINT64 io_offset, address_space *io_space); + + + void set_cpu_tag(const char *tag); + + virtual DECLARE_ADDRESS_MAP(config_map, 32); + + DECLARE_READ32_MEMBER( pcictrl_r); + DECLARE_WRITE32_MEMBER( pcictrl_w); + //cpu bus registers + DECLARE_READ32_MEMBER (cpu_if_r); + DECLARE_WRITE32_MEMBER(cpu_if_w); + + DECLARE_READ32_MEMBER (master1_r); + DECLARE_WRITE32_MEMBER(master1_w); + + DECLARE_READ32_MEMBER (master2_r); + DECLARE_WRITE32_MEMBER(master2_w); + + DECLARE_READ32_MEMBER (master_io_r); + DECLARE_WRITE32_MEMBER(master_io_w); + + virtual DECLARE_ADDRESS_MAP(target1_map, 32); + DECLARE_READ32_MEMBER (target1_r); + DECLARE_WRITE32_MEMBER(target1_w); + + virtual DECLARE_ADDRESS_MAP(target2_map, 32); + DECLARE_READ32_MEMBER (target2_r); + DECLARE_WRITE32_MEMBER(target2_w); + +protected: + address_space *m_cpu_space; + virtual const address_space_config *memory_space_config(address_spacenum spacenum) const; + virtual void device_start(); + virtual void device_reset(); + +private: + cpu_device *m_cpu; + const char *cpu_tag; + + address_space_config m_mem_config, m_io_config; + + DECLARE_ADDRESS_MAP(cpu_map, 32); + + UINT32 m_ram_size; + UINT32 m_ram_base; + dynamic_array<UINT32> m_ram; + + UINT32 m_simm_size; + UINT32 m_simm_base; + dynamic_array<UINT32> m_simm; + + + UINT32 m_cpu_regs[0x7c]; + + UINT32 m_pci1_laddr, m_pci2_laddr, m_pci_io_laddr; + UINT32 m_target1_laddr, m_target2_laddr; +}; + + +extern const device_type VRC4373; + +#endif diff --git a/src/emu/mame.c b/src/emu/mame.c index e6915e2cf48..3d8380d8666 100644 --- a/src/emu/mame.c +++ b/src/emu/mame.c @@ -286,6 +286,16 @@ void CLIB_DECL popmessage(const char *format, ...) // pop it in the UI machine_manager::instance()->machine()->ui().popup_time(temp.len() / 40 + 2, "%s", temp.cstr()); + + /* + // also write to error.log + logerror("popmessage: %s\n", temp.cstr()); + +#ifdef MAME_DEBUG + // and to command-line in a DEBUG build + osd_printf_info("popmessage: %s\n", temp.cstr()); +#endif + */ } } diff --git a/src/emu/netlist/plists.h b/src/emu/netlist/plists.h index c7eb594cdb2..e3d3a99d184 100644 --- a/src/emu/netlist/plists.h +++ b/src/emu/netlist/plists.h @@ -199,7 +199,7 @@ private: // pnamedlist_t: a simple list // ---------------------------------------------------------------------------------------- -#ifdef SDLMAME_SOLARIS +#if defined(SDLMAME_SOLARIS) || defined(__ANDROID__) #undef _C #endif diff --git a/src/emu/schedule.c b/src/emu/schedule.c index 74dfa661469..d0d28af80e4 100644 --- a/src/emu/schedule.c +++ b/src/emu/schedule.c @@ -451,9 +451,7 @@ void device_scheduler::timeslice() attoseconds_t delta = target.attoseconds - exec->m_localtime.attoseconds; if (delta < 0 && target.seconds > exec->m_localtime.seconds) delta += ATTOSECONDS_PER_SECOND; -#ifndef MAME_DEBUG_FAST assert(delta == (target - exec->m_localtime).as_attoseconds()); -#endif // if we have enough for at least 1 cycle, do the math if (delta >= exec->m_attoseconds_per_cycle) diff --git a/src/emu/sound/es1373.c b/src/emu/sound/es1373.c new file mode 100644 index 00000000000..aae26ba93f9 --- /dev/null +++ b/src/emu/sound/es1373.c @@ -0,0 +1,196 @@ +#include "es1373.h" + +#define LOG_ES (1) + +const device_type ES1373 = &device_creator<es1373_device>; + +DEVICE_ADDRESS_MAP_START(map, 32, es1373_device) + AM_RANGE(0x00, 0x3f) AM_READWRITE (reg_r, reg_w) +ADDRESS_MAP_END + +es1373_device::es1373_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : pci_device(mconfig, ES1373, "Creative Labs Ensoniq AudioPCI97 ES1373", tag, owner, clock, "es1373", __FILE__) +{ +} + +void es1373_device::device_start() +{ + pci_device::device_start(); + add_map(0x40, M_IO, FUNC(es1373_device::map)); +} + +void es1373_device::device_reset() +{ + pci_device::device_reset(); + memset(m_es_regs, 0, sizeof(m_es_regs)); + memset(m_ac97_regs, 0, sizeof(m_ac97_regs)); + m_ac97_regs[0] = 0x0800; +} + +READ32_MEMBER (es1373_device::reg_r) +{ + UINT32 result = m_es_regs[offset]; + switch (offset) { + case ES_CODEC: + break; + case ES_HOST_IF0: // 0x30 + switch (m_es_regs[ES_MEM_PAGE]&0xf) { + case 0xc: + result = m_dac1_fr.pci_addr; + break; + case 0xd: + result = m_adc_fr.pci_addr; + break; + case 0xe: + case 0xf: + logerror("%06X:ES1373 Read UART offset %02X & %08X\n", space.device().safe_pc(), offset*4, mem_mask); + default: + break; + } + break; + case ES_HOST_IF1: // 0x34 + switch (m_es_regs[ES_MEM_PAGE]&0xf) { + case 0xc: + result = (m_dac1_fr.curr_count<<16) | m_dac1_fr.buff_size; + break; + case 0xd: + result = (m_adc_fr.curr_count<<16) | m_adc_fr.buff_size; + break; + case 0xe: + case 0xf: + logerror("%06X:ES1373 write UART offset %02X & %08X\n", space.device().safe_pc(), offset*4, mem_mask); + default: + break; + } + break; + case ES_HOST_IF2: // 0x38 + switch (m_es_regs[ES_MEM_PAGE]&0xf) { + case 0xc: + result = m_dac2_fr.pci_addr; + break; + case 0xd: + logerror("%06X:ES1373 read Unknown place offset %02X & %08X\n", space.device().safe_pc(), offset*4, mem_mask); + break; + case 0xe: + case 0xf: + logerror("%06X:ES1373 read UART offset %02X & %08X\n", space.device().safe_pc(), offset*4, mem_mask); + default: + break; + } + break; + case ES_HOST_IF3: // 0x3C + switch (m_es_regs[ES_MEM_PAGE]&0xf) { + case 0xc: + result = (m_dac2_fr.curr_count<<16) | m_dac2_fr.buff_size; + break; + case 0xd: + logerror("%06X:ES1373 read Unknown place offset %02X & %08X\n", space.device().safe_pc(), offset*4, mem_mask); + break; + case 0xe: + case 0xf: + logerror("%06X:ES1373 read UART offset %02X & %08X\n", space.device().safe_pc(), offset*4, mem_mask); + default: + break; + } + break; + default: + break; + } + if (LOG_ES) + logerror("%06X:ES1373 read from offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, result, mem_mask); + return result; +} + +WRITE32_MEMBER(es1373_device::reg_w) +{ + COMBINE_DATA(&m_es_regs[offset]); + switch (offset) { + case ES_SRC_IF: + if (data&(1<<24)) { + // Write to Sample Rate Converter Ram + m_src_ram[(data>>25)&0x7F] = data&0xFFFF; + } else { + // Read From Sample Rate Converter Ram + m_es_regs[offset] = (data&0xFFFF0000) | m_src_ram[(data>>25)&0x7F]; + } + break; + case ES_CODEC: + if (data&(1<<23)) { + // Read from AC97 codec registers + m_es_regs[offset] = (data&0xFFFF0000) | m_ac97_regs[(data>>16)&0x7f] | 0x80000000; + } else { + // Write to AC97 codec registers + m_ac97_regs[(data>>16)&0x7f] = data&0xFFFF; + } + break; + case ES_HOST_IF0: // 0x30 + switch (m_es_regs[ES_MEM_PAGE]&0xf) { + case 0xc: + m_dac1_fr.pci_addr = data; + break; + case 0xd: + m_adc_fr.pci_addr = data; + break; + case 0xe: + case 0xf: + logerror("%06X:ES1373 write UART offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask); + default: + break; + } + break; + case ES_HOST_IF1: // 0x34 + switch (m_es_regs[ES_MEM_PAGE]&0xf) { + case 0xc: + m_dac1_fr.curr_count = (data>>16)&0xffff; + m_dac1_fr.buff_size = data&0xffff; + break; + case 0xd: + m_adc_fr.curr_count = (data>>16)&0xffff; + m_adc_fr.buff_size = data&0xffff; + break; + case 0xe: + case 0xf: + logerror("%06X:ES1373 write UART offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask); + default: + break; + } + break; + case ES_HOST_IF2: // 0x38 + switch (m_es_regs[ES_MEM_PAGE]&0xf) { + case 0xc: + m_dac2_fr.pci_addr = data; + break; + case 0xd: + logerror("%06X:ES1373 write Unknown place offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask); + break; + case 0xe: + case 0xf: + logerror("%06X:ES1373 write UART offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask); + default: + break; + } + break; + case ES_HOST_IF3: // 0x3C + switch (m_es_regs[ES_MEM_PAGE]&0xf) { + case 0xc: + m_dac2_fr.curr_count = (data>>16)&0xffff; + m_dac2_fr.buff_size = data&0xffff; + break; + case 0xd: + logerror("%06X:ES1373 write Unknown place offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask); + break; + case 0xe: + case 0xf: + logerror("%06X:ES1373 write UART offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask); + default: + break; + } + break; + default: + break; + } + + if (LOG_ES) + logerror("%06X:ES1373 write to offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask); + +} diff --git a/src/emu/sound/es1373.h b/src/emu/sound/es1373.h new file mode 100644 index 00000000000..b2ee13f1feb --- /dev/null +++ b/src/emu/sound/es1373.h @@ -0,0 +1,63 @@ +// Creative Labs Ensonic AudioPCI97 ES1373 + +#ifndef ES1373_H +#define ES1373_H + +#include "machine/pci.h" + +#define MCFG_ES1373_ADD(_tag) \ + MCFG_PCI_DEVICE_ADD(_tag, ES1373, 0x12741371, 0x04, 0x040100, 0x12741371) + +/* Ensonic ES1373 registers 0x00-0x3f */ +#define ES_INT_CS_CTRL (0x00/4) +#define ES_INT_CS_STATUS (0x04/4) +#define ES_UART_DATA (0x08/4) +#define ES_UART_STATUS (0x09/4) +#define ES_UART_CTRL (0x09/4) +#define ES_UART_RSVD (0x0A/4) +#define ES_MEM_PAGE (0x0C/4) +#define ES_SRC_IF (0x10/4) +#define ES_CODEC (0x14/4) +#define ES_LEGACY (0x18/4) +#define ES_CHAN_CTRL (0x1C/4) +#define ES_SERIAL_CTRL (0x20/4) +#define ES_DAC1_CNT (0x24/4) +#define ES_DAC2_CNT (0x28/4) +#define ES_ADC_CNT (0x2C/4) +#define ES_ADC_CNT (0x2C/4) +#define ES_HOST_IF0 (0x30/4) +#define ES_HOST_IF1 (0x34/4) +#define ES_HOST_IF2 (0x38/4) +#define ES_HOST_IF3 (0x3C/4) + +struct frame_reg { + UINT32 pci_addr; + UINT16 curr_count; + UINT16 buff_size; + frame_reg() : pci_addr(0), curr_count(0), buff_size(0) {} +}; + +class es1373_device : public pci_device { +public: + es1373_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + DECLARE_READ32_MEMBER (reg_r); + DECLARE_WRITE32_MEMBER(reg_w); + +protected: + virtual void device_start(); + virtual void device_reset(); + +private: + DECLARE_ADDRESS_MAP(map, 32); + UINT16 m_ac97_regs[0x80]; + UINT32 m_es_regs[0x10]; + UINT16 m_src_ram[0x80]; + frame_reg m_dac1_fr; + frame_reg m_dac2_fr; + frame_reg m_adc_fr; +}; + +extern const device_type ES1373; + +#endif diff --git a/src/emu/sound/okim9810.c b/src/emu/sound/okim9810.c index 9b041fda765..3370ee460e8 100644 --- a/src/emu/sound/okim9810.c +++ b/src/emu/sound/okim9810.c @@ -88,6 +88,14 @@ okim9810_device::okim9810_device(const machine_config &mconfig, const char *tag, { } +okim9810_device::okim_voice *okim9810_device::get_voice(int which) +{ + which &= 8; + if (which < OKIM9810_VOICES) + return &m_voice[which]; + + return NULL; +} //------------------------------------------------- // device_start - device-specific startup @@ -103,8 +111,35 @@ void okim9810_device::device_start() m_stream = machine().sound().stream_alloc(*this, 0, 2, clock()); // save state stuff - // m_TMP_register - // m_voice + save_item(NAME(m_TMP_register)); + save_item(NAME(m_global_volume)); + save_item(NAME(m_filter_type)); + save_item(NAME(m_output_level)); + + for (int i = 0; i < OKIM9810_VOICES; i++) + { + okim_voice *voice = get_voice(i); + + save_item(NAME(voice->m_adpcm.m_signal), i); + save_item(NAME(voice->m_adpcm.m_step), i); + save_item(NAME(voice->m_adpcm2.m_signal), i); + save_item(NAME(voice->m_adpcm2.m_step), i); + save_item(NAME(voice->m_playbackAlgo), i); + save_item(NAME(voice->m_looping), i); + save_item(NAME(voice->m_startFlags), i); + save_item(NAME(voice->m_endFlags), i); + save_item(NAME(voice->m_base_offset), i); + save_item(NAME(voice->m_count), i); + save_item(NAME(voice->m_samplingFreq), i); + save_item(NAME(voice->m_playing), i); + save_item(NAME(voice->m_sample), i); + save_item(NAME(voice->m_channel_volume), i); + save_item(NAME(voice->m_pan_volume_left), i); + save_item(NAME(voice->m_pan_volume_right), i); + save_item(NAME(voice->m_startSample), i); + save_item(NAME(voice->m_endSample), i); + save_item(NAME(voice->m_interpSampleNum), i); + } } diff --git a/src/emu/sound/okim9810.h b/src/emu/sound/okim9810.h index 75316b7cf96..823a8e25f59 100644 --- a/src/emu/sound/okim9810.h +++ b/src/emu/sound/okim9810.h @@ -134,7 +134,8 @@ protected: static const UINT8 s_volume_table[16]; }; - + okim_voice *get_voice(int which); + // internal state const address_space_config m_space_config; diff --git a/src/emu/sound/sound.mak b/src/emu/sound/sound.mak index de4f8024a5d..10367590e1b 100644 --- a/src/emu/sound/sound.mak +++ b/src/emu/sound/sound.mak @@ -161,6 +161,15 @@ ifneq ($(filter SB0400,$(SOUNDS)),) SOUNDOBJS += $(SOUNDOBJ)/sb0400.o endif +#------------------------------------------------- +# Creative Labs Ensonic AudioPCI97 ES1373 +#@src/emu/sound/es1373.h,SOUNDS += ES1373 +#------------------------------------------------- + +ifneq ($(filter ES1373,$(SOUNDS)),) +SOUNDOBJS += $(SOUNDOBJ)/es1373.o +endif + #------------------------------------------------- diff --git a/src/emu/sound/wavwrite.c b/src/emu/sound/wavwrite.c index 36cae72ded5..4e4a5677c51 100644 --- a/src/emu/sound/wavwrite.c +++ b/src/emu/sound/wavwrite.c @@ -1,4 +1,4 @@ -#include "coretmpl.h" +#include "emu.h" #include "sound/wavwrite.h" struct wav_file diff --git a/src/emu/ui/filemngr.c b/src/emu/ui/filemngr.c index 2c4097f96b9..9b4cc42c4f4 100644 --- a/src/emu/ui/filemngr.c +++ b/src/emu/ui/filemngr.c @@ -33,6 +33,8 @@ ui_menu_file_manager::ui_menu_file_manager(running_machine &machine, render_cont m_warnings.cpy(warnings); else m_warnings.reset(); + + m_curr_selected = FALSE; } @@ -165,12 +167,16 @@ void ui_menu_file_manager::handle() if (event != NULL && event->itemref != NULL && event->iptkey == IPT_UI_SELECT) { if ((FPTR)event->itemref == 1) - machine().schedule_hard_reset(); + { + if (m_curr_selected) + machine().schedule_hard_reset(); + } else { selected_device = (device_image_interface *) event->itemref; if (selected_device != NULL) { + m_curr_selected = TRUE; ui_menu::stack_push(selected_device->get_selection_menu(machine(), container)); // reset the existing menu diff --git a/src/emu/ui/filemngr.h b/src/emu/ui/filemngr.h index 3bcdb28679b..a2d7fbca74f 100644 --- a/src/emu/ui/filemngr.h +++ b/src/emu/ui/filemngr.h @@ -32,6 +32,7 @@ public: private: astring m_warnings; + bool m_curr_selected; }; #endif /* __UI_FILEMNGR_H__ */ diff --git a/src/emu/video.c b/src/emu/video.c index 2518bd101c0..7ec113b42d5 100644 --- a/src/emu/video.c +++ b/src/emu/video.c @@ -106,7 +106,8 @@ video_manager::video_manager(running_machine &machine) m_avi_file(NULL), m_avi_frame_period(attotime::zero), m_avi_next_frame_time(attotime::zero), - m_avi_frame(0) + m_avi_frame(0), + m_dummy_recording(false) { // request a callback upon exiting machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(video_manager::exit), this)); @@ -152,6 +153,8 @@ video_manager::video_manager(running_machine &machine) filename = machine.options().avi_write(); if (filename[0] != 0) begin_recording(filename, MF_AVI); + + m_dummy_recording = machine.options().dummy_write(); // if no screens, create a periodic timer to drive updates if (machine.first_screen() == NULL) @@ -1232,7 +1235,7 @@ file_error video_manager::open_next(emu_file &file, const char *extension) void video_manager::record_frame() { // ignore if nothing to do - if (m_mng_file == NULL && m_avi_file == NULL) + if (m_mng_file == NULL && m_avi_file == NULL && !m_dummy_recording) return; // start the profiler and get the current time diff --git a/src/emu/video.h b/src/emu/video.h index 5904b4c6c53..c5ca9c9e27b 100644 --- a/src/emu/video.h +++ b/src/emu/video.h @@ -176,6 +176,9 @@ private: attotime m_avi_frame_period; // period of a single movie frame attotime m_avi_next_frame_time; // time of next frame UINT32 m_avi_frame; // current movie frame number + + // movie recording - dummy + bool m_dummy_recording; // indicates if snapshot should be created of every frame static const UINT8 s_skiptable[FRAMESKIP_LEVELS][FRAMESKIP_LEVELS]; diff --git a/src/emu/video/video.mak b/src/emu/video/video.mak index 3ac034a254d..28aeacf9e07 100644 --- a/src/emu/video/video.mak +++ b/src/emu/video/video.mak @@ -600,6 +600,16 @@ endif #------------------------------------------------- # +#@src/emu/video/voodoo_pci.h,VIDEOS += VOODOO_PCI +#------------------------------------------------- + +ifneq ($(filter VOODOO_PCI,$(VIDEOS)),) +VIDEOOBJS+= $(VIDEOOBJ)/voodoo_pci.o +endif + + +#------------------------------------------------- +# #@src/emu/video/crtc_ega.h,VIDEOS += CRTC_EGA #------------------------------------------------- diff --git a/src/emu/video/voodoo_pci.c b/src/emu/video/voodoo_pci.c new file mode 100644 index 00000000000..2b7a6f07433 --- /dev/null +++ b/src/emu/video/voodoo_pci.c @@ -0,0 +1,81 @@ +#include "voodoo_pci.h" + +static MACHINE_CONFIG_FRAGMENT( voodoo_pci ) + MCFG_DEVICE_ADD("voodoo", VOODOO_BANSHEE, STD_VOODOO_BANSHEE_CLOCK) + MCFG_VOODOO_FBMEM(16) + MCFG_VOODOO_SCREEN_TAG("screen") + MCFG_VOODOO_CPU_TAG(":maincpu") +MACHINE_CONFIG_END + +machine_config_constructor voodoo_pci_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( voodoo_pci ); +} + +const device_type VOODOO_PCI = &device_creator<voodoo_pci_device>; + +DEVICE_ADDRESS_MAP_START(reg_map, 32, voodoo_pci_device) + AM_RANGE(0x0, 0x01ffffff) AM_DEVREADWRITE("voodoo", voodoo_banshee_device, banshee_r, banshee_w) +ADDRESS_MAP_END +DEVICE_ADDRESS_MAP_START(lfb_map, 32, voodoo_pci_device) + AM_RANGE(0x0, 0x00ffffff) AM_DEVREADWRITE("voodoo", voodoo_banshee_device, banshee_fb_r, banshee_fb_w) +ADDRESS_MAP_END +DEVICE_ADDRESS_MAP_START(io_map, 32, voodoo_pci_device) + AM_RANGE(0x000, 0x0ff) AM_DEVREADWRITE("voodoo", voodoo_banshee_device, banshee_io_r, banshee_io_w) +ADDRESS_MAP_END + +voodoo_pci_device::voodoo_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : pci_device(mconfig, VOODOO_PCI, "Voodoo PCI", tag, owner, clock, "voodoo_pci", __FILE__), + m_voodoo(*this, "voodoo") +{ +} + +void voodoo_pci_device::device_start() +{ + pci_device::device_start(); + add_map(32*1024*1024, M_MEM, FUNC(voodoo_pci_device::reg_map)); + add_map(16*1024*1024, M_MEM, FUNC(voodoo_pci_device::lfb_map)); + add_map(256, M_IO, FUNC(voodoo_pci_device::io_map)); +} + +void voodoo_pci_device::device_reset() +{ + pci_device::device_reset(); +} + +void voodoo_pci_device::map_extra(UINT64 memory_window_start, UINT64 memory_window_end, UINT64 memory_offset, address_space *memory_space, + UINT64 io_window_start, UINT64 io_window_end, UINT64 io_offset, address_space *io_space) +{ + logerror("%s: map_extra\n", tag()); + // Really awkward way of getting vga address space mapped + // Should really be dependent on voodoo VGAINIT0 bit 8 and IO base + 0xc3 bit 0 + if (1) { + // io map is on bank_infos[2] + bank_info &bi = bank_infos[2]; + if(bi.adr==-1) + return; + if(UINT32(bi.adr) == UINT32(~(bi.size - 1))) + return; + + UINT64 start; + address_space *space; + if(bi.flags & M_IO) { + space = io_space; + start = bi.adr + io_offset; + } else { + space = memory_space; + start = bi.adr + memory_offset; + } + // The mapping needs to only check high address bits + start = (start & 0xFFFF0000) + 0x300; + UINT64 end = (start & 0xFFFF0000) + 0x3ef; + space->install_device_delegate(start, end, *this, bi.map); + logerror("%s: map %s at %0*x-%0*x\n", tag(), bi.map.name(), bi.flags & M_IO ? 4 : 8, UINT32(start), bi.flags & M_IO ? 4 : 8, UINT32(end)); + } + +} + +UINT32 voodoo_pci_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + return voodoo_update(m_voodoo, bitmap, cliprect) ? 0 : UPDATE_HAS_NOT_CHANGED; +} diff --git a/src/emu/video/voodoo_pci.h b/src/emu/video/voodoo_pci.h new file mode 100644 index 00000000000..878c564e4b8 --- /dev/null +++ b/src/emu/video/voodoo_pci.h @@ -0,0 +1,35 @@ +// 3dfx Voodoo Graphics SST-1/2 emulator. + +#ifndef VOODOO_PCI_H +#define VOODOO_PCI_H + +#include "machine/pci.h" +#include "voodoo.h" + +#define MCFG_VOODOO_ADD(_tag) \ + MCFG_PCI_DEVICE_ADD(_tag, VOODOO_PCI, 0x121a0005, 0x02, 0x000003, 0x000000) + +class voodoo_pci_device : public pci_device { +public: + voodoo_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + virtual void map_extra(UINT64 memory_window_start, UINT64 memory_window_end, UINT64 memory_offset, address_space *memory_space, + UINT64 io_window_start, UINT64 io_window_end, UINT64 io_offset, address_space *io_space); + // optional information overrides + virtual machine_config_constructor device_mconfig_additions() const; + UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + +protected: + virtual void device_start(); + virtual void device_reset(); + +private: + required_device<voodoo_banshee_device> m_voodoo; + + DECLARE_ADDRESS_MAP(reg_map, 32); + DECLARE_ADDRESS_MAP(lfb_map, 32); + DECLARE_ADDRESS_MAP(io_map, 32); +}; + +extern const device_type VOODOO_PCI; + +#endif diff --git a/src/lib/formats/a26_cas.c b/src/lib/formats/a26_cas.c index 5d557626912..7ee425fd1af 100644 --- a/src/lib/formats/a26_cas.c +++ b/src/lib/formats/a26_cas.c @@ -4,6 +4,7 @@ Atari 2600 SuperCharger support */ +#include <assert.h> #include "formats/a26_cas.h" diff --git a/src/lib/formats/a5105_dsk.c b/src/lib/formats/a5105_dsk.c index 61586f93851..33d7f15e1fd 100644 --- a/src/lib/formats/a5105_dsk.c +++ b/src/lib/formats/a5105_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> + #include "formats/a5105_dsk.h" a5105_format::a5105_format() : upd765_format(formats) diff --git a/src/lib/formats/abc800_dsk.c b/src/lib/formats/abc800_dsk.c index b1d0db2c640..5686d502382 100644 --- a/src/lib/formats/abc800_dsk.c +++ b/src/lib/formats/abc800_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> + #include "formats/abc800_dsk.h" abc800_format::abc800_format() : wd177x_format(formats) diff --git a/src/lib/formats/ace_tap.c b/src/lib/formats/ace_tap.c index b57dcb03cd7..8d6d4694b05 100644 --- a/src/lib/formats/ace_tap.c +++ b/src/lib/formats/ace_tap.c @@ -7,6 +7,9 @@ For more information see: - http://www.jupiter-ace.co.uk/doc_AceTapeFormat.html ********************************************************************/ + +#include <assert.h> + #include "ace_tap.h" diff --git a/src/lib/formats/adam_cas.c b/src/lib/formats/adam_cas.c index 1e8e328b517..83f873c5f00 100644 --- a/src/lib/formats/adam_cas.c +++ b/src/lib/formats/adam_cas.c @@ -1,4 +1,6 @@ +#include <assert.h> + #include "cassimg.h" #include "adam_cas.h" diff --git a/src/lib/formats/adam_dsk.c b/src/lib/formats/adam_dsk.c index 1b966a3395b..e78e94a4763 100644 --- a/src/lib/formats/adam_dsk.c +++ b/src/lib/formats/adam_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> + #include "formats/adam_dsk.h" adam_format::adam_format() : wd177x_format(formats) diff --git a/src/lib/formats/ami_dsk.c b/src/lib/formats/ami_dsk.c index 230310c4995..a222208d46d 100644 --- a/src/lib/formats/ami_dsk.c +++ b/src/lib/formats/ami_dsk.c @@ -8,6 +8,8 @@ *********************************************************************/ +#include <assert.h> + #include "formats/ami_dsk.h" adf_format::adf_format() : floppy_image_format_t() diff --git a/src/lib/formats/ap_dsk35.c b/src/lib/formats/ap_dsk35.c index 8eee2ee0dab..f218c996abd 100644 --- a/src/lib/formats/ap_dsk35.c +++ b/src/lib/formats/ap_dsk35.c @@ -99,7 +99,7 @@ #include <stdio.h> #include <assert.h> -#include "emu.h" +#include "emu.h" // logerror #include "ap_dsk35.h" struct apple35_tag diff --git a/src/lib/formats/apf_apt.c b/src/lib/formats/apf_apt.c index 58582ef5dc8..b609a109ef6 100644 --- a/src/lib/formats/apf_apt.c +++ b/src/lib/formats/apf_apt.c @@ -34,6 +34,8 @@ e. A checksum byte (8-bit addition) ********************************************************************/ +#include <assert.h> + #include "formats/apf_apt.h" #define WAVEENTRY_LOW -32768 diff --git a/src/lib/formats/apollo_dsk.c b/src/lib/formats/apollo_dsk.c index eec6e24beb2..2770122a5c9 100644 --- a/src/lib/formats/apollo_dsk.c +++ b/src/lib/formats/apollo_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> + #include "formats/apollo_dsk.h" apollo_format::apollo_format() : upd765_format(formats) diff --git a/src/lib/formats/applix_dsk.c b/src/lib/formats/applix_dsk.c index c90b93a5203..726f11daed9 100644 --- a/src/lib/formats/applix_dsk.c +++ b/src/lib/formats/applix_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> + #include "formats/applix_dsk.h" applix_format::applix_format() : wd177x_format(formats) diff --git a/src/lib/formats/apridisk.c b/src/lib/formats/apridisk.c index 016d41e6210..0416add4405 100644 --- a/src/lib/formats/apridisk.c +++ b/src/lib/formats/apridisk.c @@ -4,7 +4,7 @@ ***************************************************************************/ -#include "emu.h" +#include "emu.h" // fatalerror #include "apridisk.h" #include "imageutl.h" #include "coretmpl.h" diff --git a/src/lib/formats/asst128_dsk.c b/src/lib/formats/asst128_dsk.c index feffad34c08..fe64cc725ee 100644 --- a/src/lib/formats/asst128_dsk.c +++ b/src/lib/formats/asst128_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> + #include "formats/asst128_dsk.h" asst128_format::asst128_format() : upd765_format(formats) diff --git a/src/lib/formats/atari_dsk.c b/src/lib/formats/atari_dsk.c index 3e721adc0ff..cbfbcc3d21f 100644 --- a/src/lib/formats/atari_dsk.c +++ b/src/lib/formats/atari_dsk.c @@ -6,6 +6,8 @@ *********************************************************************/ +#include <assert.h> + #include "formats/atari_dsk.h" static FLOPPY_IDENTIFY( atari_dsk_identify ) diff --git a/src/lib/formats/atarist_dsk.c b/src/lib/formats/atarist_dsk.c index 7901ba2a55d..aa0761465bf 100644 --- a/src/lib/formats/atarist_dsk.c +++ b/src/lib/formats/atarist_dsk.c @@ -6,6 +6,8 @@ *********************************************************************/ +#include <assert.h> + #include "formats/atarist_dsk.h" #include "formats/basicdsk.h" diff --git a/src/lib/formats/atom_tap.c b/src/lib/formats/atom_tap.c index a5a76a8733e..99335fa4230 100644 --- a/src/lib/formats/atom_tap.c +++ b/src/lib/formats/atom_tap.c @@ -38,6 +38,8 @@ */ +#include <assert.h> + #include "atom_tap.h" #include "uef_cas.h" /*************************************************************************** diff --git a/src/lib/formats/bw12_dsk.c b/src/lib/formats/bw12_dsk.c index e497225bc08..06c8be72347 100644 --- a/src/lib/formats/bw12_dsk.c +++ b/src/lib/formats/bw12_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> + #include "formats/bw12_dsk.h" bw12_format::bw12_format() : upd765_format(formats) diff --git a/src/lib/formats/bw2_dsk.c b/src/lib/formats/bw2_dsk.c index e5f66b5fe05..3dc46e9b225 100644 --- a/src/lib/formats/bw2_dsk.c +++ b/src/lib/formats/bw2_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> + #include "formats/bw2_dsk.h" bw2_format::bw2_format() : upd765_format(formats) diff --git a/src/lib/formats/cassimg.c b/src/lib/formats/cassimg.c index 20ccbc99407..7de195315ef 100644 --- a/src/lib/formats/cassimg.c +++ b/src/lib/formats/cassimg.c @@ -6,8 +6,8 @@ *********************************************************************/ -#include <assert.h> #include <string.h> +#include <assert.h> #include "imageutl.h" #include "cassimg.h" diff --git a/src/lib/formats/cbm_crt.c b/src/lib/formats/cbm_crt.c index 6ce4cc992d8..abfd85ed5c1 100644 --- a/src/lib/formats/cbm_crt.c +++ b/src/lib/formats/cbm_crt.c @@ -39,6 +39,9 @@ *********************************************************************/ +#include "emu.h" // fatalerror +#include "astring.h" +#include "corefile.h" #include "cbm_crt.h" @@ -202,8 +205,8 @@ bool cbm_crt_read_header(core_file* file, size_t *roml_size, size_t *romh_size, bool cbm_crt_read_data(core_file* file, UINT8 *roml, UINT8 *romh) { - offs_t roml_offset = 0; - offs_t romh_offset = 0; + UINT32 roml_offset = 0; + UINT32 romh_offset = 0; core_fseek(file, CRT_HEADER_LENGTH, SEEK_SET); diff --git a/src/lib/formats/cbm_crt.h b/src/lib/formats/cbm_crt.h index bfb8732442c..8049ddacff7 100644 --- a/src/lib/formats/cbm_crt.h +++ b/src/lib/formats/cbm_crt.h @@ -13,7 +13,6 @@ #ifndef __CBM_CRT__ #define __CBM_CRT__ -#include "emu.h" #include "formats/imageutl.h" diff --git a/src/lib/formats/cbm_tap.c b/src/lib/formats/cbm_tap.c index a78b03df117..f02b4ac1968 100644 --- a/src/lib/formats/cbm_tap.c +++ b/src/lib/formats/cbm_tap.c @@ -92,6 +92,8 @@ Unfortunately, I have no such a .tap file to test, so my implementation below could be not working. FP ] */ +#include <assert.h> + #include "cbm_tap.h" diff --git a/src/lib/formats/ccvf_dsk.c b/src/lib/formats/ccvf_dsk.c index d8dc0117bd3..dfb43565d88 100644 --- a/src/lib/formats/ccvf_dsk.c +++ b/src/lib/formats/ccvf_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include "emu.h" // BIT +#include "astring.h" #include "formats/ccvf_dsk.h" ccvf_format::ccvf_format() @@ -98,7 +99,7 @@ bool ccvf_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) int start = 0, end = 0; astring line; - offs_t byteoffs = 0; + UINT32 byteoffs = 0; char hex[3] = {0}; do { diff --git a/src/lib/formats/cgen_cas.c b/src/lib/formats/cgen_cas.c index 242e833ceb2..5d29f7e2b61 100644 --- a/src/lib/formats/cgen_cas.c +++ b/src/lib/formats/cgen_cas.c @@ -7,6 +7,8 @@ Current state: Not working. Only the sync signal and 0x66 byte get ********************************************************************/ +#include <assert.h> + #include "formats/cgen_cas.h" #define TAPE_HEADER "Colour Genie - Virtual Tape File" diff --git a/src/lib/formats/coco_cas.c b/src/lib/formats/coco_cas.c index 880549c96ce..efc660943e3 100644 --- a/src/lib/formats/coco_cas.c +++ b/src/lib/formats/coco_cas.c @@ -31,7 +31,7 @@ **************************************************************************/ -#include "emu.h" +#include "emu.h" // PAIR #include "coco_cas.h" #define COCO_WAVESAMPLES_HEADER (1.0) diff --git a/src/lib/formats/coco_dsk.c b/src/lib/formats/coco_dsk.c index b3f2b306c43..00b785d3e8b 100644 --- a/src/lib/formats/coco_dsk.c +++ b/src/lib/formats/coco_dsk.c @@ -7,8 +7,8 @@ *********************************************************************/ #include <string.h> -#include <assert.h> #include <time.h> +#include <assert.h> #include "formats/coco_dsk.h" #include "formats/basicdsk.h" diff --git a/src/lib/formats/comx35_dsk.c b/src/lib/formats/comx35_dsk.c index 860cc13b74d..aa8603f3c1c 100644 --- a/src/lib/formats/comx35_dsk.c +++ b/src/lib/formats/comx35_dsk.c @@ -36,7 +36,8 @@ */ -#include "emu.h" +#include <assert.h> + #include "formats/comx35_dsk.h" comx35_format::comx35_format() : wd177x_format(formats) diff --git a/src/lib/formats/concept_dsk.c b/src/lib/formats/concept_dsk.c index 3c742248043..c23a3c35675 100644 --- a/src/lib/formats/concept_dsk.c +++ b/src/lib/formats/concept_dsk.c @@ -10,7 +10,8 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> + #include "flopimg.h" #include "formats/concept_dsk.h" diff --git a/src/lib/formats/coupedsk.c b/src/lib/formats/coupedsk.c index 30ddcd394a8..e57d01abadf 100644 --- a/src/lib/formats/coupedsk.c +++ b/src/lib/formats/coupedsk.c @@ -6,7 +6,8 @@ **************************************************************************/ -#include "emu.h" +#include <assert.h> + #include "formats/coupedsk.h" #include "flopimg.h" diff --git a/src/lib/formats/cpis_dsk.c b/src/lib/formats/cpis_dsk.c index 9ad24d1d236..d5a763acfb6 100644 --- a/src/lib/formats/cpis_dsk.c +++ b/src/lib/formats/cpis_dsk.c @@ -7,8 +7,8 @@ *********************************************************************/ #include <string.h> +#include <assert.h> -#include "emu.h" #include "formats/cpis_dsk.h" #include "formats/basicdsk.h" @@ -106,7 +106,6 @@ LEGACY_FLOPPY_OPTIONS_END *********************************************************************/ -#include "emu.h" #include "formats/cpis_dsk.h" cpis_format::cpis_format() : upd765_format(formats) diff --git a/src/lib/formats/cqm_dsk.c b/src/lib/formats/cqm_dsk.c index ca8ae98039b..0061af8c869 100644 --- a/src/lib/formats/cqm_dsk.c +++ b/src/lib/formats/cqm_dsk.c @@ -7,6 +7,7 @@ *********************************************************************/ #include <string.h> +#include <assert.h> #include "flopimg.h" #define CQM_HEADER_SIZE 133 diff --git a/src/lib/formats/csw_cas.c b/src/lib/formats/csw_cas.c index 39ceb594e8f..e6b51b78c1e 100644 --- a/src/lib/formats/csw_cas.c +++ b/src/lib/formats/csw_cas.c @@ -23,6 +23,7 @@ Offset Value Type Description #include <string.h> #include <zlib.h> +#include <assert.h> #include "uef_cas.h" #include "csw_cas.h" diff --git a/src/lib/formats/d64_dsk.c b/src/lib/formats/d64_dsk.c index 9c0fa259363..172918a3051 100644 --- a/src/lib/formats/d64_dsk.c +++ b/src/lib/formats/d64_dsk.c @@ -10,7 +10,7 @@ *********************************************************************/ -#include "emu.h" +#include "emu.h" // emu_fatalerror, fatalerror #include "formats/d64_dsk.h" d64_format::d64_format() @@ -167,7 +167,7 @@ floppy_image_format_t::desc_e* d64_format::get_sector_desc(const format &f, int return desc; } -void d64_format::build_sector_description(const format &f, UINT8 *sectdata, offs_t sect_offs, offs_t error_offs, desc_s *sectors, int sector_count) const +void d64_format::build_sector_description(const format &f, UINT8 *sectdata, UINT32 sect_offs, UINT32 error_offs, desc_s *sectors, int sector_count) const { for (int i = 0; i < sector_count; i++) { sectors[i].data = sectdata + sect_offs; diff --git a/src/lib/formats/d64_dsk.h b/src/lib/formats/d64_dsk.h index 34be1d8fd16..af462753348 100644 --- a/src/lib/formats/d64_dsk.h +++ b/src/lib/formats/d64_dsk.h @@ -64,7 +64,7 @@ protected: virtual int get_disk_id_offset(const format &f); void get_disk_id(const format &f, io_generic *io, UINT8 &id1, UINT8 &id2); virtual floppy_image_format_t::desc_e* get_sector_desc(const format &f, int ¤t_size, int sector_count, UINT8 id1, UINT8 id2, int gap_2); - void build_sector_description(const format &f, UINT8 *sectdata, offs_t sect_offs, offs_t error_offs, desc_s *sectors, int sector_count) const; + void build_sector_description(const format &f, UINT8 *sectdata, UINT32 sect_offs, UINT32 error_offs, desc_s *sectors, int sector_count) const; static const format file_formats[]; diff --git a/src/lib/formats/d67_dsk.c b/src/lib/formats/d67_dsk.c index 39ce16131de..b512e55b694 100644 --- a/src/lib/formats/d67_dsk.c +++ b/src/lib/formats/d67_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> + #include "formats/d67_dsk.h" d67_format::d67_format() : d64_format(file_formats) diff --git a/src/lib/formats/d71_dsk.c b/src/lib/formats/d71_dsk.c index f7925526fda..af1186948c6 100644 --- a/src/lib/formats/d71_dsk.c +++ b/src/lib/formats/d71_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> + #include "formats/d71_dsk.h" d71_format::d71_format() : d64_format(formats) diff --git a/src/lib/formats/d80_dsk.c b/src/lib/formats/d80_dsk.c index 55a6f0d8ade..fbabbf1749e 100644 --- a/src/lib/formats/d80_dsk.c +++ b/src/lib/formats/d80_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> + #include "formats/d80_dsk.h" d80_format::d80_format() : d64_format(file_formats) diff --git a/src/lib/formats/d81_dsk.c b/src/lib/formats/d81_dsk.c index 4c04ef51293..714b9c3cd9e 100644 --- a/src/lib/formats/d81_dsk.c +++ b/src/lib/formats/d81_dsk.c @@ -73,7 +73,8 @@ PER SECTOR ORGANIZATION: */ -#include "emu.h" +#include <assert.h> + #include "formats/d81_dsk.h" d81_format::d81_format() : wd177x_format(formats) diff --git a/src/lib/formats/d82_dsk.c b/src/lib/formats/d82_dsk.c index 4d89f5e1313..dfcff3a1f27 100644 --- a/src/lib/formats/d82_dsk.c +++ b/src/lib/formats/d82_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> + #include "formats/d82_dsk.h" d82_format::d82_format() : d80_format(file_formats) diff --git a/src/lib/formats/d88_dsk.c b/src/lib/formats/d88_dsk.c index 0d41d49db5e..abb2eac3079 100644 --- a/src/lib/formats/d88_dsk.c +++ b/src/lib/formats/d88_dsk.c @@ -27,7 +27,8 @@ * */ -#include "emu.h" + #include <assert.h> + #include "flopimg.h" #include "imageutl.h" @@ -390,7 +391,6 @@ FLOPPY_CONSTRUCT(d88_dsk_construct) *********************************************************************/ -#include "emu.h" #include "d88_dsk.h" d88_format::d88_format() diff --git a/src/lib/formats/dcp_dsk.c b/src/lib/formats/dcp_dsk.c index bdcc2966036..dc05f4a4b44 100644 --- a/src/lib/formats/dcp_dsk.c +++ b/src/lib/formats/dcp_dsk.c @@ -20,7 +20,8 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> + #include "dcp_dsk.h" dcp_format::dcp_format() diff --git a/src/lib/formats/dfi_dsk.c b/src/lib/formats/dfi_dsk.c index 28a774c906e..16341f55b26 100644 --- a/src/lib/formats/dfi_dsk.c +++ b/src/lib/formats/dfi_dsk.c @@ -11,18 +11,18 @@ * Correctly note exact index timing. */ -#include "emu.h" +#include "emu.h" // fatalerror #include "dfi_dsk.h" #include <zlib.h> #define NUMBER_OF_MULTIREADS 3 // threshholds for brickwall windowing -//define MIN_CLOCKS 65 +//define DFI_MIN_CLOCKS 65 // number_please apple2 wants 40 min -#define MIN_CLOCKS 60 +#define DFI_MIN_CLOCKS 60 //define MAX_CLOCKS 260 -#define MAX_CLOCKS 270 -#define MIN_THRESH (MIN_CLOCKS*(clock_rate/25000000)) -#define MAX_THRESH (MAX_CLOCKS*(clock_rate/25000000)) +#define DFI_MAX_CLOCKS 270 +#define MIN_THRESH (DFI_MIN_CLOCKS*(clock_rate/25000000)) +#define MAX_THRESH (DFI_MAX_CLOCKS*(clock_rate/25000000)) // constants to help guess clockrate and rpm // constant is 25mhz / 6 revolutions per second (360rpm) = 4166667 +- 2.5% #define REV25_MIN 4062500 diff --git a/src/lib/formats/dim_dsk.c b/src/lib/formats/dim_dsk.c index 8287647483e..b78bec1ba31 100644 --- a/src/lib/formats/dim_dsk.c +++ b/src/lib/formats/dim_dsk.c @@ -7,8 +7,8 @@ *********************************************************************/ #include <string.h> +#include <assert.h> -#include "emu.h" #include "dim_dsk.h" #include "basicdsk.h" @@ -105,13 +105,12 @@ FLOPPY_CONSTRUCT(dim_dsk_construct) // copyright-holders:Olivier Galibert /********************************************************************* - formats/dim_dsk.h + formats/dim_dsk.c DIM disk images *********************************************************************/ -#include "emu.h" #include "dim_dsk.h" dim_format::dim_format() diff --git a/src/lib/formats/dip_dsk.c b/src/lib/formats/dip_dsk.c index 85f142df8fa..ae320e4cb7e 100644 --- a/src/lib/formats/dip_dsk.c +++ b/src/lib/formats/dip_dsk.c @@ -14,7 +14,8 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> + #include "dip_dsk.h" dip_format::dip_format() diff --git a/src/lib/formats/dmk_dsk.c b/src/lib/formats/dmk_dsk.c index 2af453d66fa..1c87d268b48 100644 --- a/src/lib/formats/dmk_dsk.c +++ b/src/lib/formats/dmk_dsk.c @@ -13,7 +13,8 @@ TODO: *********************************************************************/ -#include "emu.h" +#include <assert.h> + #include "dmk_dsk.h" diff --git a/src/lib/formats/dmv_dsk.c b/src/lib/formats/dmv_dsk.c index 2dabe9ff05e..02469ed74d4 100644 --- a/src/lib/formats/dmv_dsk.c +++ b/src/lib/formats/dmv_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> + #include "formats/dmv_dsk.h" dmv_format::dmv_format() : upd765_format(formats) diff --git a/src/lib/formats/dsk_dsk.c b/src/lib/formats/dsk_dsk.c index 93ae590e846..6129ff72b77 100644 --- a/src/lib/formats/dsk_dsk.c +++ b/src/lib/formats/dsk_dsk.c @@ -7,8 +7,8 @@ *********************************************************************/ #include <string.h> +#include <assert.h> -#include "emu.h" #include "imageutl.h" #include "flopimg.h" @@ -264,7 +264,6 @@ FLOPPY_CONSTRUCT( dsk_dsk_construct ) return FLOPPY_ERROR_SUCCESS; } -#include "emu.h" #include "dsk_dsk.h" #define DSK_FORMAT_HEADER "MV - CPC" diff --git a/src/lib/formats/ep64_dsk.c b/src/lib/formats/ep64_dsk.c index ee63ee20ab9..80981bf698e 100644 --- a/src/lib/formats/ep64_dsk.c +++ b/src/lib/formats/ep64_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> + #include "formats/ep64_dsk.h" ep64_format::ep64_format() : wd177x_format(formats) diff --git a/src/lib/formats/esq16_dsk.c b/src/lib/formats/esq16_dsk.c index 4b370cfe0bd..01b1120e677 100644 --- a/src/lib/formats/esq16_dsk.c +++ b/src/lib/formats/esq16_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> + #include "flopimg.h" #include "formats/esq16_dsk.h" diff --git a/src/lib/formats/esq8_dsk.c b/src/lib/formats/esq8_dsk.c index 8af0bc46a84..763c303d20a 100644 --- a/src/lib/formats/esq8_dsk.c +++ b/src/lib/formats/esq8_dsk.c @@ -10,7 +10,8 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> + #include "flopimg.h" #include "formats/esq8_dsk.h" diff --git a/src/lib/formats/excali64_dsk.c b/src/lib/formats/excali64_dsk.c index 5de86815099..cff39939171 100644 --- a/src/lib/formats/excali64_dsk.c +++ b/src/lib/formats/excali64_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> + #include "formats/excali64_dsk.h" excali64_format::excali64_format() : wd177x_format(formats) diff --git a/src/lib/formats/fc100_cas.c b/src/lib/formats/fc100_cas.c index 64deef962a0..415d3fb01db 100644 --- a/src/lib/formats/fc100_cas.c +++ b/src/lib/formats/fc100_cas.c @@ -10,6 +10,8 @@ it's all a guess. ********************************************************************/ +#include <assert.h> + #include "fc100_cas.h" #define WAVEENTRY_LOW -32768 diff --git a/src/lib/formats/fdd_dsk.c b/src/lib/formats/fdd_dsk.c index e9d76a99973..10d9958ca59 100644 --- a/src/lib/formats/fdd_dsk.c +++ b/src/lib/formats/fdd_dsk.c @@ -31,7 +31,8 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> + #include "fdd_dsk.h" fdd_format::fdd_format() diff --git a/src/lib/formats/fdi_dsk.c b/src/lib/formats/fdi_dsk.c index 9bf9019f5d3..9d556f66e9a 100644 --- a/src/lib/formats/fdi_dsk.c +++ b/src/lib/formats/fdi_dsk.c @@ -14,6 +14,7 @@ */ +#include <assert.h> #include "imageutl.h" #include "flopimg.h" diff --git a/src/lib/formats/flex_dsk.c b/src/lib/formats/flex_dsk.c index 975cf246ecf..34aa965643d 100644 --- a/src/lib/formats/flex_dsk.c +++ b/src/lib/formats/flex_dsk.c @@ -4,7 +4,7 @@ * Created on: 24/06/2014 */ -#include "emu.h" + #include "emu.h" // logerror #include "flex_dsk.h" flex_format::flex_format() diff --git a/src/lib/formats/flopimg.c b/src/lib/formats/flopimg.c index 2f3260366ce..5b9e5f7ee03 100644 --- a/src/lib/formats/flopimg.c +++ b/src/lib/formats/flopimg.c @@ -10,10 +10,10 @@ #include <string.h> #include <stdio.h> #include <ctype.h> -#include <assert.h> #include <limits.h> +#include <assert.h> -#include "emu.h" +#include "emu.h" // emu_fatalerror #include "osdcore.h" #include "ioprocs.h" #include "flopimg.h" diff --git a/src/lib/formats/fm7_cas.c b/src/lib/formats/fm7_cas.c index 32ec7390459..48b0239f738 100644 --- a/src/lib/formats/fm7_cas.c +++ b/src/lib/formats/fm7_cas.c @@ -2,6 +2,8 @@ * Fujitsu FM-7 series cassette handling */ +#include <assert.h> + #include "fm7_cas.h" #define WAVE_HIGH 0x5a9e diff --git a/src/lib/formats/fmsx_cas.c b/src/lib/formats/fmsx_cas.c index 082be3cda3f..54b64ae4d01 100644 --- a/src/lib/formats/fmsx_cas.c +++ b/src/lib/formats/fmsx_cas.c @@ -1,3 +1,5 @@ +#include <assert.h> + #include "formats/fmsx_cas.h" diff --git a/src/lib/formats/fmtowns_dsk.c b/src/lib/formats/fmtowns_dsk.c index 71db43650ba..83bfd2fbd51 100644 --- a/src/lib/formats/fmtowns_dsk.c +++ b/src/lib/formats/fmtowns_dsk.c @@ -6,7 +6,8 @@ * Created on: 23/03/2014 */ -#include "emu.h" + #include <assert.h> + #include "formats/fmtowns_dsk.h" fmtowns_format::fmtowns_format() : wd177x_format(formats) diff --git a/src/lib/formats/g64_dsk.c b/src/lib/formats/g64_dsk.c index 5beba1ca35f..a2500b473cd 100644 --- a/src/lib/formats/g64_dsk.c +++ b/src/lib/formats/g64_dsk.c @@ -10,7 +10,7 @@ *********************************************************************/ -#include "emu.h" +#include "emu.h" // emu_fatalerror #include "formats/g64_dsk.h" #define G64_FORMAT_HEADER "GCR-1541" @@ -53,7 +53,7 @@ bool g64_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) for (int track = 0; track < track_count; track++) { - offs_t track_offset = pick_integer_le(img, TRACK_OFFSET + (track * 4), 4); + UINT32 track_offset = pick_integer_le(img, TRACK_OFFSET + (track * 4), 4); if (!track_offset) continue; @@ -61,7 +61,7 @@ bool g64_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) if (track_offset > size) throw emu_fatalerror("g64_format: Track %u offset %06x out of bounds", track, track_offset); - offs_t speed_zone = pick_integer_le(img, SPEED_ZONE + (track * 4), 4); + UINT32 speed_zone = pick_integer_le(img, SPEED_ZONE + (track * 4), 4); if (speed_zone > 3) throw emu_fatalerror("g64_format: Unsupported variable speed zones on track %d", track); @@ -102,9 +102,9 @@ bool g64_format::save(io_generic *io, floppy_image *image) dynamic_buffer trackbuf(TRACK_LENGTH-2); for (int track = 0; track < 84; track++) { - offs_t tpos = TRACK_OFFSET + track * 4; - offs_t spos = SPEED_ZONE + track * 4; - offs_t dpos = TRACK_DATA + tracks_written * TRACK_LENGTH; + UINT32 tpos = TRACK_OFFSET + track * 4; + UINT32 spos = SPEED_ZONE + track * 4; + UINT32 dpos = TRACK_DATA + tracks_written * TRACK_LENGTH; io_generic_write_filler(io, 0x00, tpos, 4); io_generic_write_filler(io, 0x00, spos, 4); diff --git a/src/lib/formats/gtp_cas.c b/src/lib/formats/gtp_cas.c index 47baa0aba7e..0fe391e9767 100644 --- a/src/lib/formats/gtp_cas.c +++ b/src/lib/formats/gtp_cas.c @@ -4,6 +4,8 @@ Miodrag Milanovic */ +#include <assert.h> + #include "gtp_cas.h" diff --git a/src/lib/formats/hect_dsk.c b/src/lib/formats/hect_dsk.c index d3644afd536..50e112f0774 100644 --- a/src/lib/formats/hect_dsk.c +++ b/src/lib/formats/hect_dsk.c @@ -6,6 +6,8 @@ *********************************************************************/ +#include <assert.h> + #include "formats/hect_dsk.h" #include "formats/basicdsk.h" diff --git a/src/lib/formats/hect_tap.c b/src/lib/formats/hect_tap.c index ad67de93ecc..745cf2a0038 100644 --- a/src/lib/formats/hect_tap.c +++ b/src/lib/formats/hect_tap.c @@ -12,6 +12,8 @@ You can find some *.K7 file on serveral server in France Updated 3/1/10 : use real value for timing. ********************************************************************/ +#include <assert.h> + #include "hect_tap.h" diff --git a/src/lib/formats/hxcmfm_dsk.c b/src/lib/formats/hxcmfm_dsk.c index 967f05539a3..0203f8f7e26 100644 --- a/src/lib/formats/hxcmfm_dsk.c +++ b/src/lib/formats/hxcmfm_dsk.c @@ -1,6 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Olivier Galibert -#include "emu.h" + +#include <assert.h> #include "hxcmfm_dsk.h" diff --git a/src/lib/formats/imd_dsk.c b/src/lib/formats/imd_dsk.c index ef5478f638f..78f073fef1d 100644 --- a/src/lib/formats/imd_dsk.c +++ b/src/lib/formats/imd_dsk.c @@ -7,7 +7,7 @@ *********************************************************************/ #include <string.h> -#include "emu.h" +#include <assert.h> #include "flopimg.h" struct imddsk_tag @@ -279,13 +279,13 @@ FLOPPY_CONSTRUCT( imd_dsk_construct ) // copyright-holders:Olivier Galibert /********************************************************************* - formats/imd_dsk.h + formats/imd_dsk.c IMD disk images *********************************************************************/ -#include "emu.h" +#include "emu.h" // emu_fatalerror #include "imd_dsk.h" imd_format::imd_format() diff --git a/src/lib/formats/ioprocs.c b/src/lib/formats/ioprocs.c index 3c47414ae00..b1771bf3774 100644 --- a/src/lib/formats/ioprocs.c +++ b/src/lib/formats/ioprocs.c @@ -1,5 +1,6 @@ #include <stdio.h> #include <string.h> +#include <assert.h> #include "osdcore.h" #include "ioprocs.h" #include "corefile.h" diff --git a/src/lib/formats/ipf_dsk.c b/src/lib/formats/ipf_dsk.c index 7e1704f9b55..3cbd46dcb5a 100644 --- a/src/lib/formats/ipf_dsk.c +++ b/src/lib/formats/ipf_dsk.c @@ -1,4 +1,4 @@ -#include "emu.h" +#include <assert.h> #include "ipf_dsk.h" const floppy_format_type FLOPPY_IPF_FORMAT = &floppy_image_format_creator<ipf_format>; diff --git a/src/lib/formats/iq151_dsk.c b/src/lib/formats/iq151_dsk.c index f0df2c19555..dcffad85751 100644 --- a/src/lib/formats/iq151_dsk.c +++ b/src/lib/formats/iq151_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> + #include "formats/iq151_dsk.h" iq151_format::iq151_format() : upd765_format(formats) diff --git a/src/lib/formats/itt3030_dsk.c b/src/lib/formats/itt3030_dsk.c index 7e0a5709897..7fed1bf3505 100644 --- a/src/lib/formats/itt3030_dsk.c +++ b/src/lib/formats/itt3030_dsk.c @@ -10,7 +10,8 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> + #include "formats/itt3030_dsk.h" itt3030_format::itt3030_format() : wd177x_format(formats) diff --git a/src/lib/formats/kaypro_dsk.c b/src/lib/formats/kaypro_dsk.c index 3781bb3de0a..e9924ce11c9 100644 --- a/src/lib/formats/kaypro_dsk.c +++ b/src/lib/formats/kaypro_dsk.c @@ -16,7 +16,8 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> + #include "formats/kaypro_dsk.h" kayproii_format::kayproii_format() : upd765_format(formats) diff --git a/src/lib/formats/kc85_dsk.c b/src/lib/formats/kc85_dsk.c index 0787ef5e82e..84111ff1171 100644 --- a/src/lib/formats/kc85_dsk.c +++ b/src/lib/formats/kc85_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> + #include "formats/kc85_dsk.h" kc85_format::kc85_format() : upd765_format(formats) diff --git a/src/lib/formats/kc_cas.c b/src/lib/formats/kc_cas.c index 9198a98c4d5..7791afd2e7a 100644 --- a/src/lib/formats/kc_cas.c +++ b/src/lib/formats/kc_cas.c @@ -13,6 +13,8 @@ ********************************************************************/ +#include <assert.h> + #include "kc_cas.h" #define SMPLO -32768 diff --git a/src/lib/formats/kim1_cas.c b/src/lib/formats/kim1_cas.c index c3e048e6acc..b8433c0eea0 100644 --- a/src/lib/formats/kim1_cas.c +++ b/src/lib/formats/kim1_cas.c @@ -1,3 +1,5 @@ +#include <assert.h> + #include "kim1_cas.h" #define SMPLO -32768 diff --git a/src/lib/formats/lviv_lvt.c b/src/lib/formats/lviv_lvt.c index 62de1d63981..87a56a6e2c2 100644 --- a/src/lib/formats/lviv_lvt.c +++ b/src/lib/formats/lviv_lvt.c @@ -1,4 +1,6 @@ /* .LVT tape images */ +#include <assert.h> + #include "lviv_lvt.h" #define WAVEENTRY_LOW -32768 diff --git a/src/lib/formats/m20_dsk.c b/src/lib/formats/m20_dsk.c index 0371f595d63..abd2cf1b2cb 100644 --- a/src/lib/formats/m20_dsk.c +++ b/src/lib/formats/m20_dsk.c @@ -13,8 +13,8 @@ *********************************************************************/ #include <string.h> +#include <assert.h> -#include "emu.h" #include "m20_dsk.h" #include "basicdsk.h" @@ -180,7 +180,6 @@ LEGACY_FLOPPY_OPTIONS_END *********************************************************************/ -#include "emu.h" #include "formats/m20_dsk.h" m20_format::m20_format() diff --git a/src/lib/formats/m5_dsk.c b/src/lib/formats/m5_dsk.c index fc8f9f98d43..9652eedbb72 100644 --- a/src/lib/formats/m5_dsk.c +++ b/src/lib/formats/m5_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> + #include "formats/m5_dsk.h" m5_format::m5_format() : upd765_format(formats) diff --git a/src/lib/formats/mbee_cas.c b/src/lib/formats/mbee_cas.c index 592ae38e627..fe0a2ffbc24 100644 --- a/src/lib/formats/mbee_cas.c +++ b/src/lib/formats/mbee_cas.c @@ -56,6 +56,8 @@ TAP - has an ID header of TAP_DGOS_BEE or MBEE, null terminated. ********************************************************************/ +#include <assert.h> + #include "mbee_cas.h" #define WAVEENTRY_LOW -32768 diff --git a/src/lib/formats/mfi_dsk.c b/src/lib/formats/mfi_dsk.c index 13a23abe94b..2bd4b326501 100644 --- a/src/lib/formats/mfi_dsk.c +++ b/src/lib/formats/mfi_dsk.c @@ -1,6 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Olivier Galibert -#include "emu.h" +#include <assert.h> + #include "mfi_dsk.h" #include <zlib.h> diff --git a/src/lib/formats/mm_dsk.c b/src/lib/formats/mm_dsk.c index 53939295378..0634c0e3ede 100644 --- a/src/lib/formats/mm_dsk.c +++ b/src/lib/formats/mm_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> + #include "formats/mm_dsk.h" mm1_format::mm1_format() : upd765_format(formats) diff --git a/src/lib/formats/msx_dsk.c b/src/lib/formats/msx_dsk.c index df1a318ab6e..11817d8ab32 100644 --- a/src/lib/formats/msx_dsk.c +++ b/src/lib/formats/msx_dsk.c @@ -6,6 +6,8 @@ *********************************************************************/ +#include <assert.h> + #include "formats/msx_dsk.h" #include "formats/basicdsk.h" diff --git a/src/lib/formats/mz_cas.c b/src/lib/formats/mz_cas.c index d7897ddf56f..56662f6c760 100644 --- a/src/lib/formats/mz_cas.c +++ b/src/lib/formats/mz_cas.c @@ -1,4 +1,5 @@ #include <string.h> +#include <assert.h> #include "mz_cas.h" #ifndef VERBOSE diff --git a/src/lib/formats/nanos_dsk.c b/src/lib/formats/nanos_dsk.c index fd8478b5b45..1536d0677c8 100644 --- a/src/lib/formats/nanos_dsk.c +++ b/src/lib/formats/nanos_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> + #include "formats/nanos_dsk.h" nanos_format::nanos_format() : upd765_format(formats) diff --git a/src/lib/formats/naslite_dsk.c b/src/lib/formats/naslite_dsk.c index da043358b16..342407a7c95 100644 --- a/src/lib/formats/naslite_dsk.c +++ b/src/lib/formats/naslite_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> + #include "formats/naslite_dsk.h" naslite_format::naslite_format() : upd765_format(formats) diff --git a/src/lib/formats/nes_dsk.c b/src/lib/formats/nes_dsk.c index 99878833f27..ce62b4fba0e 100644 --- a/src/lib/formats/nes_dsk.c +++ b/src/lib/formats/nes_dsk.c @@ -8,6 +8,7 @@ #include <string.h> +#include <assert.h> #include "formats/nes_dsk.h" #include "formats/basicdsk.h" diff --git a/src/lib/formats/nfd_dsk.c b/src/lib/formats/nfd_dsk.c index ea886e9dd3a..083d59417b2 100644 --- a/src/lib/formats/nfd_dsk.c +++ b/src/lib/formats/nfd_dsk.c @@ -77,7 +77,8 @@ *********************************************************************/ -#include "emu.h" + #include <assert.h> + #include "nfd_dsk.h" nfd_format::nfd_format() diff --git a/src/lib/formats/orao_cas.c b/src/lib/formats/orao_cas.c index 78080b19f1b..c771b234dda 100644 --- a/src/lib/formats/orao_cas.c +++ b/src/lib/formats/orao_cas.c @@ -3,6 +3,8 @@ Tape support for Orao TAP format */ +#include <assert.h> + #include "orao_cas.h" diff --git a/src/lib/formats/oric_dsk.c b/src/lib/formats/oric_dsk.c index aaef1928f0a..340fb507c2d 100644 --- a/src/lib/formats/oric_dsk.c +++ b/src/lib/formats/oric_dsk.c @@ -8,7 +8,7 @@ *********************************************************************/ -#include "emu.h" +#include "emu.h" // logerror #include "formats/oric_dsk.h" oric_dsk_format::oric_dsk_format() diff --git a/src/lib/formats/oric_tap.c b/src/lib/formats/oric_tap.c index ac6e6c0f72a..123552eea7a 100644 --- a/src/lib/formats/oric_tap.c +++ b/src/lib/formats/oric_tap.c @@ -1,3 +1,5 @@ +#include <assert.h> + #include "oric_tap.h" #define ORIC_WAV_DEBUG 0 diff --git a/src/lib/formats/p6001_cas.c b/src/lib/formats/p6001_cas.c index 78e5e929963..debe3f3b261 100644 --- a/src/lib/formats/p6001_cas.c +++ b/src/lib/formats/p6001_cas.c @@ -2,6 +2,8 @@ * NEC PC-6001 cassette format handling */ +#include <assert.h> + #include "p6001_cas.h" #define WAVE_HIGH 0x5a9e diff --git a/src/lib/formats/pasti_dsk.c b/src/lib/formats/pasti_dsk.c index e78f816b8df..c39954490b8 100644 --- a/src/lib/formats/pasti_dsk.c +++ b/src/lib/formats/pasti_dsk.c @@ -1,4 +1,4 @@ -#include "emu.h" +#include "emu.h" // logerror #include "pasti_dsk.h" // Pasti format supported using the documentation at diff --git a/src/lib/formats/pc98_dsk.c b/src/lib/formats/pc98_dsk.c index df527f92cc4..6ef28d01eeb 100644 --- a/src/lib/formats/pc98_dsk.c +++ b/src/lib/formats/pc98_dsk.c @@ -7,6 +7,7 @@ *********************************************************************/ #include <string.h> +#include <assert.h> #include "formats/pc98_dsk.h" diff --git a/src/lib/formats/pc98fdi_dsk.c b/src/lib/formats/pc98fdi_dsk.c index 81aeaf7a42b..83433606400 100644 --- a/src/lib/formats/pc98fdi_dsk.c +++ b/src/lib/formats/pc98fdi_dsk.c @@ -8,7 +8,7 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> #include "pc98fdi_dsk.h" pc98fdi_format::pc98fdi_format() diff --git a/src/lib/formats/pc_dsk.c b/src/lib/formats/pc_dsk.c index 45a076cc91c..152dffed15a 100644 --- a/src/lib/formats/pc_dsk.c +++ b/src/lib/formats/pc_dsk.c @@ -7,6 +7,7 @@ *********************************************************************/ #include <string.h> +#include <assert.h> #include "formats/pc_dsk.h" #include "formats/basicdsk.h" diff --git a/src/lib/formats/phc25_cas.c b/src/lib/formats/phc25_cas.c index a0d807a335c..1253bd98a3a 100644 --- a/src/lib/formats/phc25_cas.c +++ b/src/lib/formats/phc25_cas.c @@ -29,6 +29,8 @@ enough to make it work. ********************************************************************/ +#include <assert.h> + #include "phc25_cas.h" #define WAVEENTRY_LOW -32768 diff --git a/src/lib/formats/pmd_cas.c b/src/lib/formats/pmd_cas.c index eefb8fc9622..ba5baee1a65 100644 --- a/src/lib/formats/pmd_cas.c +++ b/src/lib/formats/pmd_cas.c @@ -10,6 +10,8 @@ ********************************************************************/ +#include <assert.h> + #include "pmd_cas.h" #define WAVEENTRY_LOW -32768 diff --git a/src/lib/formats/primoptp.c b/src/lib/formats/primoptp.c index ad8606617d9..6373d43fd4f 100644 --- a/src/lib/formats/primoptp.c +++ b/src/lib/formats/primoptp.c @@ -1,6 +1,8 @@ /* .PTP Microkey Primo tape images */ +#include <assert.h> + #include "primoptp.h" diff --git a/src/lib/formats/pyldin_dsk.c b/src/lib/formats/pyldin_dsk.c index 07d75f58724..de43ab1947b 100644 --- a/src/lib/formats/pyldin_dsk.c +++ b/src/lib/formats/pyldin_dsk.c @@ -8,7 +8,7 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> #include "formats/pyldin_dsk.h" pyldin_format::pyldin_format() : upd765_format(formats) diff --git a/src/lib/formats/ql_dsk.c b/src/lib/formats/ql_dsk.c index 5351a92c83f..b3ceb233218 100644 --- a/src/lib/formats/ql_dsk.c +++ b/src/lib/formats/ql_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> + #include "formats/ql_dsk.h" ql_format::ql_format() : wd177x_format(formats) diff --git a/src/lib/formats/rk_cas.c b/src/lib/formats/rk_cas.c index 2a20a8499ab..150b17c8f3b 100644 --- a/src/lib/formats/rk_cas.c +++ b/src/lib/formats/rk_cas.c @@ -3,6 +3,8 @@ Tape support for RK format */ +#include <assert.h> + #include "rk_cas.h" diff --git a/src/lib/formats/rx50_dsk.c b/src/lib/formats/rx50_dsk.c index 4ece096fba6..429f22eafec 100644 --- a/src/lib/formats/rx50_dsk.c +++ b/src/lib/formats/rx50_dsk.c @@ -27,7 +27,8 @@ FORMAT A: /F:160 on DOS; turn MEDIACHK ON ************************************************************************/ -#include "emu.h" +#include <assert.h> + #include "flopimg.h" #include "formats/rx50_dsk.h" diff --git a/src/lib/formats/sc3000_bit.c b/src/lib/formats/sc3000_bit.c index 4afe91371f9..f38f5a8d8c6 100644 --- a/src/lib/formats/sc3000_bit.c +++ b/src/lib/formats/sc3000_bit.c @@ -6,6 +6,8 @@ *********************************************************************/ +#include <assert.h> + #include "sc3000_bit.h" /*************************************************************************** diff --git a/src/lib/formats/sf7000_dsk.c b/src/lib/formats/sf7000_dsk.c index e15a42e7b41..31d0c37ab15 100644 --- a/src/lib/formats/sf7000_dsk.c +++ b/src/lib/formats/sf7000_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> + #include "formats/sf7000_dsk.h" sf7000_format::sf7000_format() : upd765_format(formats) diff --git a/src/lib/formats/smx_dsk.c b/src/lib/formats/smx_dsk.c index 4729f65f8bb..9158a586c13 100644 --- a/src/lib/formats/smx_dsk.c +++ b/src/lib/formats/smx_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> + #include "formats/smx_dsk.h" smx_format::smx_format() : wd177x_format(formats) diff --git a/src/lib/formats/sol_cas.c b/src/lib/formats/sol_cas.c index e5dc79cd21a..26f1bdccf00 100644 --- a/src/lib/formats/sol_cas.c +++ b/src/lib/formats/sol_cas.c @@ -34,6 +34,8 @@ SVT - The full explanation may be found on the Solace web site, ********************************************************************/ +#include <assert.h> + #include "sol_cas.h" #define WAVEENTRY_LOW -32768 diff --git a/src/lib/formats/sorc_cas.c b/src/lib/formats/sorc_cas.c index 99e9d46f7d9..6983dd0ba74 100644 --- a/src/lib/formats/sorc_cas.c +++ b/src/lib/formats/sorc_cas.c @@ -25,6 +25,8 @@ header and leader bytes. ********************************************************************/ +#include <assert.h> + #include "sorc_cas.h" #define WAVEENTRY_LOW -32768 diff --git a/src/lib/formats/sorc_dsk.c b/src/lib/formats/sorc_dsk.c index e7939456139..3c7aee10c33 100644 --- a/src/lib/formats/sorc_dsk.c +++ b/src/lib/formats/sorc_dsk.c @@ -7,6 +7,7 @@ *********************************************************************/ #include <string.h> +#include <assert.h> #include "sorc_dsk.h" #include "basicdsk.h" diff --git a/src/lib/formats/sord_cas.c b/src/lib/formats/sord_cas.c index cab593d66e8..a2834931a2a 100644 --- a/src/lib/formats/sord_cas.c +++ b/src/lib/formats/sord_cas.c @@ -7,6 +7,7 @@ **************************************************************************/ #include <string.h> +#include <assert.h> #include "sord_cas.h" #define SORDM5_WAVESAMPLES_HEADER 1 diff --git a/src/lib/formats/spc1000_cas.c b/src/lib/formats/spc1000_cas.c index b02c287d02b..b05844b6ee7 100644 --- a/src/lib/formats/spc1000_cas.c +++ b/src/lib/formats/spc1000_cas.c @@ -21,6 +21,8 @@ IPL: This seems a quickload format containing RAM dump, not a real tape ********************************************************************/ +#include <assert.h> + #include "spc1000_cas.h" #define WAVEENTRY_LOW -32768 diff --git a/src/lib/formats/st_dsk.c b/src/lib/formats/st_dsk.c index 72787b58a19..a30165993ea 100644 --- a/src/lib/formats/st_dsk.c +++ b/src/lib/formats/st_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> + #include "formats/st_dsk.h" st_format::st_format() diff --git a/src/lib/formats/svi_cas.c b/src/lib/formats/svi_cas.c index edb015382ba..6b693b4d461 100644 --- a/src/lib/formats/svi_cas.c +++ b/src/lib/formats/svi_cas.c @@ -1,3 +1,5 @@ +#include <assert.h> + #include "svi_cas.h" #define CAS_PERIOD_0 (37) diff --git a/src/lib/formats/svi_dsk.c b/src/lib/formats/svi_dsk.c index e94b2e2f94d..23dbb9a17e2 100644 --- a/src/lib/formats/svi_dsk.c +++ b/src/lib/formats/svi_dsk.c @@ -7,6 +7,7 @@ *********************************************************************/ #include <string.h> +#include <assert.h> #include "svi_dsk.h" #include "basicdsk.h" diff --git a/src/lib/formats/tandy2k_dsk.c b/src/lib/formats/tandy2k_dsk.c index cc15e75b17b..e08865c9493 100644 --- a/src/lib/formats/tandy2k_dsk.c +++ b/src/lib/formats/tandy2k_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> + #include "formats/tandy2k_dsk.h" tandy2k_format::tandy2k_format() : upd765_format(formats) diff --git a/src/lib/formats/td0_dsk.c b/src/lib/formats/td0_dsk.c index cc5a72993a5..a9a7ed702a1 100644 --- a/src/lib/formats/td0_dsk.c +++ b/src/lib/formats/td0_dsk.c @@ -13,7 +13,7 @@ */ #include <string.h> -#include "emu.h" +#include <assert.h> #include "flopimg.h" #define BUFSZ 512 // new input buffer diff --git a/src/lib/formats/thom_cas.c b/src/lib/formats/thom_cas.c index e48f217ead6..36fb6e4de51 100644 --- a/src/lib/formats/thom_cas.c +++ b/src/lib/formats/thom_cas.c @@ -7,6 +7,7 @@ **********************************************************************/ #include <math.h> +#include <assert.h> #include "pool.h" #include "cassimg.h" diff --git a/src/lib/formats/thom_dsk.c b/src/lib/formats/thom_dsk.c index b3cf47234a2..4f7230f2421 100644 --- a/src/lib/formats/thom_dsk.c +++ b/src/lib/formats/thom_dsk.c @@ -9,6 +9,7 @@ *********************************************************************/ #include <string.h> +#include <assert.h> #include "thom_dsk.h" #include "basicdsk.h" diff --git a/src/lib/formats/ti99_dsk.c b/src/lib/formats/ti99_dsk.c index ab6c564fb79..d18ef3c4192 100644 --- a/src/lib/formats/ti99_dsk.c +++ b/src/lib/formats/ti99_dsk.c @@ -41,11 +41,11 @@ * ********************************************************************/ -#include "emu.h" #include <string.h> -#include <assert.h> #include <time.h> +#include <assert.h> +#include "emu.h" // logerror #include "imageutl.h" #include "ti99_dsk.h" @@ -835,6 +835,9 @@ void ti99_sdf_format::determine_sizes(io_generic *io, int& cell_size, int& secto have_vib = true; } + // Do we have a broken VIB? The Pascal disks are known to have such incomplete VIBs + if (heads == 0 || sector_count == 0) have_vib = false; + // We're also checking the size of the image int cell_size1 = 0; int sector_count1 = 0; diff --git a/src/lib/formats/tiki100_dsk.c b/src/lib/formats/tiki100_dsk.c index 4704f6e9911..1a05af7a5af 100644 --- a/src/lib/formats/tiki100_dsk.c +++ b/src/lib/formats/tiki100_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> + #include "formats/tiki100_dsk.h" tiki100_format::tiki100_format() : wd177x_format(formats) diff --git a/src/lib/formats/trd_dsk.c b/src/lib/formats/trd_dsk.c index 6ee08e6a2c0..7cacd98fb4a 100644 --- a/src/lib/formats/trd_dsk.c +++ b/src/lib/formats/trd_dsk.c @@ -6,7 +6,8 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> + #include "formats/trd_dsk.h" trd_format::trd_format() : wd177x_format(formats) diff --git a/src/lib/formats/trs_cas.c b/src/lib/formats/trs_cas.c index 6956e488d4c..6e143200bc9 100644 --- a/src/lib/formats/trs_cas.c +++ b/src/lib/formats/trs_cas.c @@ -4,6 +4,8 @@ Support for TRS80 .cas cassette images ********************************************************************/ +#include <assert.h> + #include "formats/trs_cas.h" #define SILENCE 0 diff --git a/src/lib/formats/trs_dsk.c b/src/lib/formats/trs_dsk.c index 36c5a271622..ebe6090bcdc 100644 --- a/src/lib/formats/trs_dsk.c +++ b/src/lib/formats/trs_dsk.c @@ -1,4 +1,5 @@ #include <string.h> +#include <assert.h> #include "trs_dsk.h" #include "basicdsk.h" #include "coco_dsk.h" diff --git a/src/lib/formats/tvc_cas.c b/src/lib/formats/tvc_cas.c index a24b1ed79b1..a33fba687b9 100644 --- a/src/lib/formats/tvc_cas.c +++ b/src/lib/formats/tvc_cas.c @@ -8,6 +8,8 @@ ********************************************************************/ +#include <assert.h> + #include "tvc_cas.h" #define TVC64_BIT0_FREQ 1812 diff --git a/src/lib/formats/tvc_dsk.c b/src/lib/formats/tvc_dsk.c index fdbe28365b5..8a2254cb7cc 100644 --- a/src/lib/formats/tvc_dsk.c +++ b/src/lib/formats/tvc_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> + #include "formats/tvc_dsk.h" tvc_format::tvc_format() : wd177x_format(formats) diff --git a/src/lib/formats/tzx_cas.c b/src/lib/formats/tzx_cas.c index c7950138a09..71ad4c747f5 100644 --- a/src/lib/formats/tzx_cas.c +++ b/src/lib/formats/tzx_cas.c @@ -38,6 +38,8 @@ We are currently using the numbers from the TZX specification... */ +#include <assert.h> + #include "tzx_cas.h" diff --git a/src/lib/formats/uef_cas.c b/src/lib/formats/uef_cas.c index 60a4ade6775..6a5c8668c8e 100644 --- a/src/lib/formats/uef_cas.c +++ b/src/lib/formats/uef_cas.c @@ -12,6 +12,7 @@ Not nice, but it works... #include <string.h> #include <math.h> +#include <assert.h> #include <zlib.h> #include "uef_cas.h" diff --git a/src/lib/formats/upd765_dsk.c b/src/lib/formats/upd765_dsk.c index 5966e1de1a3..b26da4c2d98 100644 --- a/src/lib/formats/upd765_dsk.c +++ b/src/lib/formats/upd765_dsk.c @@ -8,7 +8,7 @@ *********************************************************************/ -#include "emu.h" +#include "emu.h" // emu_fatalerror #include "formats/upd765_dsk.h" upd765_format::upd765_format(const format *_formats) diff --git a/src/lib/formats/vg5k_cas.c b/src/lib/formats/vg5k_cas.c index 78e63cabb0b..ef648707fd8 100644 --- a/src/lib/formats/vg5k_cas.c +++ b/src/lib/formats/vg5k_cas.c @@ -5,6 +5,8 @@ Support for VG-5000 .k7 cassette images ********************************************************************/ +#include <assert.h> + #include "vg5k_cas.h" diff --git a/src/lib/formats/victor9k_dsk.c b/src/lib/formats/victor9k_dsk.c index 694ac3dbf80..020c4af46b3 100644 --- a/src/lib/formats/victor9k_dsk.c +++ b/src/lib/formats/victor9k_dsk.c @@ -97,7 +97,7 @@ zone. */ -#include "emu.h" +#include "emu.h" // logerror, BIT, emu_fatalerror #include "formats/victor9k_dsk.h" victor9k_format::victor9k_format() @@ -237,7 +237,7 @@ floppy_image_format_t::desc_e* victor9k_format::get_sector_desc(const format &f, return desc; } -void victor9k_format::build_sector_description(const format &f, UINT8 *sectdata, offs_t sect_offs, desc_s *sectors, int sector_count) const +void victor9k_format::build_sector_description(const format &f, UINT8 *sectdata, UINT32 sect_offs, desc_s *sectors, int sector_count) const { for (int i = 0; i < sector_count; i++) { sectors[i].data = sectdata + sect_offs; diff --git a/src/lib/formats/victor9k_dsk.h b/src/lib/formats/victor9k_dsk.h index c1d00052a62..22f43fa7e3b 100644 --- a/src/lib/formats/victor9k_dsk.h +++ b/src/lib/formats/victor9k_dsk.h @@ -35,7 +35,7 @@ public: virtual int identify(io_generic *io, UINT32 form_factor); void log_boot_sector(UINT8 *data); floppy_image_format_t::desc_e* get_sector_desc(const format &f, int ¤t_size, int sector_count); - void build_sector_description(const format &f, UINT8 *sectdata, offs_t sect_offs, desc_s *sectors, int sector_count) const; + void build_sector_description(const format &f, UINT8 *sectdata, UINT32 sect_offs, desc_s *sectors, int sector_count) const; virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image); virtual bool supports_save() const; diff --git a/src/lib/formats/vt_cas.c b/src/lib/formats/vt_cas.c index 4040b00d7aa..734954a2ab6 100644 --- a/src/lib/formats/vt_cas.c +++ b/src/lib/formats/vt_cas.c @@ -1,3 +1,5 @@ +#include <assert.h> + #include "formats/vt_cas.h" /********************************************************************* diff --git a/src/lib/formats/vt_dsk.c b/src/lib/formats/vt_dsk.c index c4d1fdf91d8..0021b66eaa4 100644 --- a/src/lib/formats/vt_dsk.c +++ b/src/lib/formats/vt_dsk.c @@ -8,6 +8,7 @@ #include <stdio.h> #include <string.h> +#include <assert.h> #include "formats/vt_dsk.h" #include "formats/basicdsk.h" diff --git a/src/lib/formats/vtech1_dsk.c b/src/lib/formats/vtech1_dsk.c index 4ee02c89104..d7194224ebd 100644 --- a/src/lib/formats/vtech1_dsk.c +++ b/src/lib/formats/vtech1_dsk.c @@ -6,6 +6,8 @@ *********************************************************************/ +#include <assert.h> + #include "formats/vtech1_dsk.h" static FLOPPY_IDENTIFY( vtech1_dsk_identify ) diff --git a/src/lib/formats/wd177x_dsk.c b/src/lib/formats/wd177x_dsk.c index 57223fecc2f..8ced951fd51 100644 --- a/src/lib/formats/wd177x_dsk.c +++ b/src/lib/formats/wd177x_dsk.c @@ -8,7 +8,7 @@ *********************************************************************/ -#include "emu.h" +#include "emu.h" // emu_fatalerror #include "formats/wd177x_dsk.h" wd177x_format::wd177x_format(const format *_formats) diff --git a/src/lib/formats/x07_cas.c b/src/lib/formats/x07_cas.c index fb581f6a44c..54f46acd488 100644 --- a/src/lib/formats/x07_cas.c +++ b/src/lib/formats/x07_cas.c @@ -6,6 +6,8 @@ ********************************************************************/ +#include <assert.h> + #include "x07_cas.h" #define WAVEENTRY_LOW -32768 diff --git a/src/lib/formats/x1_tap.c b/src/lib/formats/x1_tap.c index 3d42c41dad4..880037c8f3a 100644 --- a/src/lib/formats/x1_tap.c +++ b/src/lib/formats/x1_tap.c @@ -19,6 +19,8 @@ * */ +#include <assert.h> + #include "x1_tap.h" #define WAVE_HIGH 0x5a9e diff --git a/src/lib/formats/xdf_dsk.c b/src/lib/formats/xdf_dsk.c index 6b81877b701..c77d685d9be 100644 --- a/src/lib/formats/xdf_dsk.c +++ b/src/lib/formats/xdf_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include <assert.h> + #include "formats/xdf_dsk.h" xdf_format::xdf_format() : upd765_format(formats) diff --git a/src/lib/formats/z80ne_dsk.c b/src/lib/formats/z80ne_dsk.c index 6394e177f4f..967fecd27f5 100644 --- a/src/lib/formats/z80ne_dsk.c +++ b/src/lib/formats/z80ne_dsk.c @@ -7,6 +7,7 @@ *********************************************************************/ #include <assert.h> + #include "z80ne_dsk.h" #include "basicdsk.h" #include "imageutl.h" diff --git a/src/lib/formats/zx81_p.c b/src/lib/formats/zx81_p.c index bfb871c3c51..e2e1e33f035 100644 --- a/src/lib/formats/zx81_p.c +++ b/src/lib/formats/zx81_p.c @@ -29,6 +29,8 @@ medium transfer rate is approx. 307 bps (38 bytes/sec) for files that contain *****************************************************************************/ +#include <assert.h> + #include "zx81_p.h" diff --git a/src/lib/util/avhuff.c b/src/lib/util/avhuff.c index d2642b99b35..6684c6d7ae9 100644 --- a/src/lib/util/avhuff.c +++ b/src/lib/util/avhuff.c @@ -58,6 +58,8 @@ ***************************************************************************/ +#include <assert.h> + #include "avhuff.h" #include "huffman.h" #include "chd.h" diff --git a/src/lib/util/aviio.c b/src/lib/util/aviio.c index 7dd2e3bb9c1..0d0403809f8 100644 --- a/src/lib/util/aviio.c +++ b/src/lib/util/aviio.c @@ -9,6 +9,7 @@ ***************************************************************************/ #include <stdlib.h> +#include <assert.h> #include "aviio.h" diff --git a/src/lib/util/bitmap.c b/src/lib/util/bitmap.c index 4d1f8502f50..a6e7b02f957 100644 --- a/src/lib/util/bitmap.c +++ b/src/lib/util/bitmap.c @@ -8,6 +8,8 @@ ***************************************************************************/ +#include <assert.h> + #include "bitmap.h" #include <new> diff --git a/src/lib/util/bitmap.h b/src/lib/util/bitmap.h index a82ec7eebfe..91d693124e1 100644 --- a/src/lib/util/bitmap.h +++ b/src/lib/util/bitmap.h @@ -15,7 +15,6 @@ #include "osdcore.h" #include "palette.h" -#include <assert.h> //************************************************************************** diff --git a/src/lib/util/cdrom.c b/src/lib/util/cdrom.c index 15c10a44452..90024420555 100644 --- a/src/lib/util/cdrom.c +++ b/src/lib/util/cdrom.c @@ -16,6 +16,8 @@ ***************************************************************************/ +#include <assert.h> + #include "cdrom.h" #include <stdlib.h> diff --git a/src/lib/util/chd.c b/src/lib/util/chd.c index 43539103d33..c00daf7b7cf 100644 --- a/src/lib/util/chd.c +++ b/src/lib/util/chd.c @@ -8,6 +8,8 @@ ***************************************************************************/ +#include <assert.h> + #include "chd.h" #include "avhuff.h" #include "hashing.h" diff --git a/src/lib/util/chdcd.c b/src/lib/util/chdcd.c index 8690cc65ffa..0e6077dd70f 100644 --- a/src/lib/util/chdcd.c +++ b/src/lib/util/chdcd.c @@ -10,6 +10,7 @@ #include <ctype.h> #include <stdlib.h> +#include <assert.h> #include "osdcore.h" #include "chd.h" #include "chdcd.h" diff --git a/src/lib/util/chdcodec.c b/src/lib/util/chdcodec.c index e1a001e2ebd..3bf1d6dfd63 100644 --- a/src/lib/util/chdcodec.c +++ b/src/lib/util/chdcodec.c @@ -8,6 +8,8 @@ ***************************************************************************/ +#include <assert.h> + #include "chd.h" #include "hashing.h" #include "avhuff.h" diff --git a/src/lib/util/corefile.c b/src/lib/util/corefile.c index 977024b5143..abba0a6b5b9 100644 --- a/src/lib/util/corefile.c +++ b/src/lib/util/corefile.c @@ -8,6 +8,8 @@ ***************************************************************************/ +#include <assert.h> + #include "corefile.h" #include "unicode.h" #include <zlib.h> diff --git a/src/lib/util/corestr.h b/src/lib/util/corestr.h index dad4880b268..e9750b5f85f 100644 --- a/src/lib/util/corestr.h +++ b/src/lib/util/corestr.h @@ -26,11 +26,11 @@ int core_stricmp(const char *s1, const char *s2); /* this macro prevents people from using stricmp directly */ #undef stricmp -#define stricmp !MUST_USE_CORE_STRICMP_INSTEAD! +#define stricmp MUST_USE_CORE_STRICMP_INSTEAD /* this macro prevents people from using strcasecmp directly */ #undef strcasecmp -#define strcasecmp !MUST_USE_CORE_STRICMP_INSTEAD! +#define strcasecmp MUST_USE_CORE_STRICMP_INSTEAD /* since strnicmp is not part of the standard, we use this instead */ @@ -38,11 +38,11 @@ int core_strnicmp(const char *s1, const char *s2, size_t n); /* this macro prevents people from using strnicmp directly */ #undef strnicmp -#define strnicmp !MUST_USE_CORE_STRNICMP_INSTEAD! +#define strnicmp MUST_USE_CORE_STRNICMP_INSTEAD /* this macro prevents people from using strncasecmp directly */ #undef strncasecmp -#define strncasecmp !MUST_USE_CORE_STRNICMP_INSTEAD! +#define strncasecmp MUST_USE_CORE_STRNICMP_INSTEAD /* since strdup is not part of the standard, we use this instead - free with osd_free() */ @@ -50,7 +50,7 @@ char *core_strdup(const char *str); /* this macro prevents people from using strdup directly */ #undef strdup -#define strdup !MUST_USE_CORE_STRDUP_INSTEAD! +#define strdup MUST_USE_CORE_STRDUP_INSTEAD /* additional string compare helper (up to 16 characters at the moment) */ diff --git a/src/lib/util/coretmpl.h b/src/lib/util/coretmpl.h index e1dd388511b..93c71f0c84b 100644 --- a/src/lib/util/coretmpl.h +++ b/src/lib/util/coretmpl.h @@ -13,7 +13,6 @@ #ifndef __CORETMPL_H__ #define __CORETMPL_H__ -#include <assert.h> #include "osdcore.h" #include "corealloc.h" diff --git a/src/lib/util/cstrpool.c b/src/lib/util/cstrpool.c index 874e5192ea0..ea5c637e4d4 100644 --- a/src/lib/util/cstrpool.c +++ b/src/lib/util/cstrpool.c @@ -6,6 +6,8 @@ ***************************************************************************/ +#include <assert.h> + #include "cstrpool.h" diff --git a/src/lib/util/delegate.c b/src/lib/util/delegate.c index ad66cc09168..6c688f72985 100644 --- a/src/lib/util/delegate.c +++ b/src/lib/util/delegate.c @@ -8,6 +8,8 @@ ***************************************************************************/ +#include <assert.h> + #include "osdcomm.h" #include "delegate.h" diff --git a/src/lib/util/delegate.h b/src/lib/util/delegate.h index 8cfd1c7485c..3b413456709 100644 --- a/src/lib/util/delegate.h +++ b/src/lib/util/delegate.h @@ -79,7 +79,6 @@ #define __DELEGATE_H__ // standard C++ includes -#include <assert.h> #include <exception> #include <typeinfo> diff --git a/src/lib/util/flac.c b/src/lib/util/flac.c index 09e396c944e..d2f576e637e 100644 --- a/src/lib/util/flac.c +++ b/src/lib/util/flac.c @@ -8,8 +8,9 @@ ***************************************************************************/ -#include "flac.h" #include <assert.h> + +#include "flac.h" #include <new> diff --git a/src/lib/util/harddisk.c b/src/lib/util/harddisk.c index 87967d41f1b..46d8f5bab9a 100644 --- a/src/lib/util/harddisk.c +++ b/src/lib/util/harddisk.c @@ -8,6 +8,8 @@ ***************************************************************************/ +#include <assert.h> + #include "harddisk.h" #include <stdlib.h> diff --git a/src/lib/util/huffman.c b/src/lib/util/huffman.c index eee176e13ba..2da37df8194 100644 --- a/src/lib/util/huffman.c +++ b/src/lib/util/huffman.c @@ -97,6 +97,7 @@ ***************************************************************************/ #include <stdlib.h> +#include <assert.h> #include "coretmpl.h" #include "huffman.h" diff --git a/src/lib/util/opresolv.c b/src/lib/util/opresolv.c index 4d093a955da..b7870842b08 100644 --- a/src/lib/util/opresolv.c +++ b/src/lib/util/opresolv.c @@ -6,10 +6,10 @@ ****************************************************************************/ -#include <assert.h> #include <ctype.h> #include <stdlib.h> #include <string.h> +#include <assert.h> #include "pool.h" #include "corestr.h" diff --git a/src/lib/util/options.c b/src/lib/util/options.c index 96315678471..ba580c9ee3a 100644 --- a/src/lib/util/options.c +++ b/src/lib/util/options.c @@ -11,6 +11,7 @@ #include <stdarg.h> #include <stdlib.h> #include <ctype.h> +#include <assert.h> #include "options.h" #include "astring.h" diff --git a/src/lib/util/palette.c b/src/lib/util/palette.c index 6b3847f61da..4be66ee9f7b 100644 --- a/src/lib/util/palette.c +++ b/src/lib/util/palette.c @@ -8,6 +8,8 @@ ******************************************************************************/ +#include <assert.h> + #include "palette.h" #include <stdlib.h> #include <math.h> diff --git a/src/lib/util/png.c b/src/lib/util/png.c index b88af8df44b..076b1b02965 100644 --- a/src/lib/util/png.c +++ b/src/lib/util/png.c @@ -10,6 +10,7 @@ #include <math.h> #include <stdlib.h> +#include <assert.h> #include <zlib.h> #include "png.h" diff --git a/src/lib/util/tagmap.c b/src/lib/util/tagmap.c index c3f1ad304db..c8247899dcc 100644 --- a/src/lib/util/tagmap.c +++ b/src/lib/util/tagmap.c @@ -8,6 +8,8 @@ ***************************************************************************/ +#include <assert.h> + #include "tagmap.h" #ifdef MAME_DEBUG diff --git a/src/lib/util/xmlfile.c b/src/lib/util/xmlfile.c index 2c8d78cdcdb..e03893134f9 100644 --- a/src/lib/util/xmlfile.c +++ b/src/lib/util/xmlfile.c @@ -8,6 +8,8 @@ ***************************************************************************/ +#include <assert.h> + #include "xmlfile.h" #include <ctype.h> #include <expat.h> diff --git a/src/lib/util/zippath.c b/src/lib/util/zippath.c index d0f5931658d..e5e563cdbde 100644 --- a/src/lib/util/zippath.c +++ b/src/lib/util/zippath.c @@ -9,6 +9,7 @@ #include <ctype.h> #include <stdlib.h> #include <new> +#include <assert.h> #include "zippath.h" #include "unzip.h" #include "corestr.h" diff --git a/src/mame/audio/hng64.c b/src/mame/audio/hng64.c index dbce6f5c885..2cc54a21ed2 100644 --- a/src/mame/audio/hng64.c +++ b/src/mame/audio/hng64.c @@ -21,11 +21,18 @@ data structures look very similar between all of them IRQ mask register on the internal interrupt controller is set to 0xd8 -so levels 0,1,2,5 are unmasked +so levels 0,1,2,5 are unmasked, vectors get set during the sound CPU init code. -returning random values / triggering random interrupts eventually results in a situation -where the CPU stops writing to the sound related addresses and starts reading / masking the -serial comms register. + level 0/1 irq (fatfurwa) starts at 0xd277 (both the same vector) + serial comms related, maybe to get commands from main CPU if not done with shared ram? + + level 2 irq (fatfurwa) 0xdd20 + simple routine increases counter in RAM, maybe hooked to one / all of the timer irqs + + level 5 irq: (fatfurwa) starts at 0xc1e1 + largest irq, does things with ports 100 / 102 / 104 / 106, 10a (not 108 directly tho) + + no other irqs (or the NMI) are valid. */ diff --git a/src/mame/audio/subs.c b/src/mame/audio/subs.c index 286ac5c5ded..b4511bc6430 100644 --- a/src/mame/audio/subs.c +++ b/src/mame/audio/subs.c @@ -12,27 +12,27 @@ sub sound functions ***************************************************************************/ -WRITE8_MEMBER(subs_state::subs_sonar1_w) +WRITE8_MEMBER(subs_state::sonar1_w) { m_discrete->write(space, SUBS_SONAR1_EN, offset & 0x01); } -WRITE8_MEMBER(subs_state::subs_sonar2_w) +WRITE8_MEMBER(subs_state::sonar2_w) { m_discrete->write(space, SUBS_SONAR2_EN, offset & 0x01); } -WRITE8_MEMBER(subs_state::subs_crash_w) +WRITE8_MEMBER(subs_state::crash_w) { m_discrete->write(space, SUBS_CRASH_EN, offset & 0x01); } -WRITE8_MEMBER(subs_state::subs_explode_w) +WRITE8_MEMBER(subs_state::explode_w) { m_discrete->write(space, SUBS_EXPLODE_EN, offset & 0x01); } -WRITE8_MEMBER(subs_state::subs_noise_reset_w) +WRITE8_MEMBER(subs_state::noise_reset_w) { /* Pulse noise reset */ m_discrete->write(space, SUBS_NOISE_RESET, 0); diff --git a/src/mame/drivers/astinvad.c b/src/mame/drivers/astinvad.c index cc1f21bd5f4..60f1528b176 100644 --- a/src/mame/drivers/astinvad.c +++ b/src/mame/drivers/astinvad.c @@ -817,7 +817,7 @@ DRIVER_INIT_MEMBER(astinvad_state,spcking2) GAME( 1979, kamikaze, 0, kamikaze, kamikaze, astinvad_state, kamikaze, ROT270, "Leijac Corporation", "Kamikaze", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) GAME( 1980, astinvad, kamikaze, kamikaze, astinvad, astinvad_state, kamikaze, ROT270, "Leijac Corporation (Stern Electronics license)", "Astro Invader", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) -GAME( 19??, kosmokil, kamikaze, kamikaze, kamikaze, astinvad_state, kamikaze, ROT270, "bootleg", "Kosmo Killer", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) // says >BEM< Mi Italy but it looks hacked in, dif revision of game tho. +GAME( 19??, kosmokil, kamikaze, kamikaze, kamikaze, astinvad_state, kamikaze, ROT270, "bootleg (BEM)", "Kosmo Killer", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) // says >BEM< Mi Italy but it looks hacked in, dif revision of game tho. GAME( 1979, spcking2, 0, spcking2, spcking2, astinvad_state, spcking2, ROT270, "Konami", "Space King 2", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) GAME( 1980, spaceint, 0, spaceint, spaceint, driver_device, 0, ROT90, "Shoei", "Space Intruder", GAME_IMPERFECT_SOUND | GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE ) GAME( 1980, spaceintj,spaceint, spaceint, spaceintj, driver_device, 0, ROT90, "Shoei", "Space Intruder (Japan)", GAME_IMPERFECT_SOUND | GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/astrcorp.c b/src/mame/drivers/astrcorp.c index 65aa35433c1..8ee006d0f17 100644 --- a/src/mame/drivers/astrcorp.c +++ b/src/mame/drivers/astrcorp.c @@ -67,6 +67,7 @@ public: DECLARE_READ16_MEMBER(astrocorp_unk_r); DECLARE_WRITE16_MEMBER(astrocorp_sound_bank_w); DECLARE_WRITE16_MEMBER(skilldrp_sound_bank_w); + DECLARE_DRIVER_INIT(astoneag); DECLARE_DRIVER_INIT(showhanc); DECLARE_DRIVER_INIT(showhand); DECLARE_VIDEO_START(astrocorp); @@ -1148,13 +1149,164 @@ DRIVER_INIT_MEMBER(astrocorp_state,showhanc) #endif } +DRIVER_INIT_MEMBER(astrocorp_state,astoneag) +{ +#if 0 + UINT16 *rom = (UINT16*)memregion("maincpu")->base(); + UINT16 x; + int i; + + for (i = 0x25100/2; i < 0x25200/2; i++) + { + x = 0x0000; + if ( (i & 0x0001) ) x |= 0x0200; + if ( (i & 0x0004) && !(i & 0x0001) ) x |= 0x0080; + if ( (i & 0x0040) || (i & 0x0001) ) x |= 0x0040; + if ( (i & 0x0010) && !(i & 0x0001) ) x |= 0x0020; + if ( !(i & 0x0020) || (i & 0x0001) ) x |= 0x0010; + if ( (i & 0x0002) || (i & 0x0001) ) x |= 0x0008; + if ( (i & 0x0008) && !(i & 0x0001) ) x |= 0x0004; + if ( !(i & 0x0040) && !(i & 0x0001) ) x |= 0x0002; + if ( (i & 0x0040) && !(i & 0x0001) ) x |= 0x0001; + rom[i] ^= x; + } + +/* + for (i = 0x25300/2; i < 0x25400/2; i++) + { + x = 0x1300; + rom[i] ^= x; + } +*/ + + for (i = 0x25400/2; i < 0x25500/2; i++) + { + x = 0x4200; + if ( (i & 0x0001) ) x |= 0x0400; + if ( (i & 0x0020) && !(i & 0x0001) ) x |= 0x0080; + if ( !(i & 0x0010) || (i & 0x0001) ) x |= 0x0040; + if ( (i & 0x0040) && !(i & 0x0001) ) x |= 0x0020; + if ( !(i & 0x0004) || (i & 0x0001) ) x |= 0x0010; + if ( !(i & 0x0040) && !(i & 0x0001) ) x |= 0x0004; + if ( (i & 0x0008) && !(i & 0x0001) ) x |= 0x0002; + if ( (i & 0x0002) || (i & 0x0001) ) x |= 0x0001; + rom[i] ^= x; + } + + for (i = 0x25500/2; i < 0x25600/2; i++) + { + x = 0x4200; + if ( (i & 0x0001) ) x |= 0x0400; + if ( (i & 0x0010) && !(i & 0x0001) ) x |= 0x0080; + if ( (i & 0x0040) && !(i & 0x0001) ) x |= 0x0040; + if ( !(i & 0x0002) && !(i & 0x0001) ) x |= 0x0020; + if ( !(i & 0x0040) && !(i & 0x0001) ) x |= 0x0010; + if ( (i & 0x0008) && !(i & 0x0001) ) x |= 0x0008; + if ( (i & 0x0020) && !(i & 0x0001) ) x |= 0x0004; + if ( (i & 0x0004) && !(i & 0x0001) ) x |= 0x0002; + if ( (i & 0x0001) ) x |= 0x0001; + rom[i] ^= x; + } + +/* + for (i = 0x25700/2; i < 0x25800/2; i++) + { + x = 0x6800; + if ( !(i & 0x0001) ) x |= 0x8000; + + if ( !(i & 0x0040) || ((i & 0x0001) || !(i & 0x0001)) ) x |= 0x0100; + + rom[i] ^= x; + } +*/ + + for (i = 0x25800/2; i < 0x25900/2; i++) + { + x = 0x8300; + if ( (i & 0x0040) || (i & 0x0001) ) x |= 0x2000; + if ( (i & 0x0002) || (i & 0x0001) ) x |= 0x0080; + if ( !(i & 0x0040) && !(i & 0x0001) ) x |= 0x0040; + if ( (i & 0x0020) && !(i & 0x0001) ) x |= 0x0020; + if ( !(i & 0x0004) || (i & 0x0001) ) x |= 0x0010; + if ( !(i & 0x0040) && !(i & 0x0001) ) x |= 0x0008; + if ( (i & 0x0010) && !(i & 0x0001) ) x |= 0x0004; + if ( (i & 0x0008) && !(i & 0x0001) ) x |= 0x0002; + if ( !(i & 0x0040) && !(i & 0x0001) ) x |= 0x0001; + rom[i] ^= x; + } + +// for (i = 0x25900/2; i < 0x25a00/2; i++) + + for (i = 0x25c00/2; i < 0x25d00/2; i++) + { + // changed from 25400 +// x = 0x4200; + x = 0x4000; +// if ( (i & 0x0001) ) x |= 0x0400; + if ( (i & 0x0020) && !(i & 0x0001) ) x |= 0x0080; + if ( !(i & 0x0010) || (i & 0x0001) ) x |= 0x0040; + if ( (i & 0x0040) && !(i & 0x0001) ) x |= 0x0020; + if ( !(i & 0x0004) || (i & 0x0001) ) x |= 0x0010; + if ( !(i & 0x0040) && !(i & 0x0001) ) x |= 0x0004; + if ( (i & 0x0008) && !(i & 0x0001) ) x |= 0x0002; + if ( (i & 0x0002) || (i & 0x0001) ) x |= 0x0001; + rom[i] ^= x; + } + +/* + for (i = 0x25d00/2; i < 0x25e00/2; i++) + { + x = 0x4000; + if ( !(i & 0x0040) ) x |= 0x0800; + + if ( !(i & 0x0040) && !(i & 0x0001) ) x |= 0x0100; // almost!! + + if ( ((i & 0x0040)&&((i & 0x0020)||(i & 0x0010))) || !(i & 0x0001) ) x |= 0x0200; // almost!! + if ( (!(i & 0x0040) || !(i & 0x0008)) && !(i & 0x0001) ) x |= 0x0008; + if ( (i & 0x0040) || !(i & 0x0020) || (i & 0x0001) ) x |= 0x0001; // almost!! + rom[i] ^= x; + } +*/ + +/* + for (i = 0x25e00/2; i < 0x25f00/2; i++) + { + x = 0xa600; + + if ( (i & 0x0040) && (i & 0x0001) ) x |= 0x4000; + if ( (i & 0x0040) && (i & 0x0001) ) x |= 0x0800; + if ( !(i & 0x0001) ) x |= 0x0100; + + if ( ( (i & 0x0040) && (i & 0x0008) && !(i & 0x0001)) || + ( !(i & 0x0040) && ((i & 0x0004) ^ (i & 0x0002)) && !(i & 0x0001) ) ) x |= 0x0002; // almost!! + + if ( !(i & 0x0040) || !(i & 0x0002) || (i & 0x0001) ) x |= 0x0001; + rom[i] ^= x; + } +*/ + + for (i = 0x26f00/2; i < 0x27000/2; i++) + { + x = 0xb94c; + rom[i] ^= x; + } + + for (i = 0x27000/2; i < 0x27100/2; i++) + { + x = 0x5f10; + rom[i] ^= x; + } + +#endif +} + GAME( 2000, showhand, 0, showhand, showhand, astrocorp_state, showhand, ROT0, "Astro Corp.", "Show Hand (Italy)", GAME_SUPPORTS_SAVE ) GAME( 2000, showhanc, showhand, showhanc, showhanc, astrocorp_state, showhanc, ROT0, "Astro Corp.", "Wang Pai Dui Jue (China)", GAME_SUPPORTS_SAVE ) GAME( 2002, skilldrp, 0, skilldrp, skilldrp, driver_device, 0, ROT0, "Astro Corp.", "Skill Drop Georgia (Ver. G1.0S)", GAME_SUPPORTS_SAVE ) GAME( 2003, speeddrp, 0, speeddrp, skilldrp, driver_device, 0, ROT0, "Astro Corp.", "Speed Drop (Ver. 1.06)", GAME_SUPPORTS_SAVE ) // Encrypted games (not working): -GAME( 2004?, astoneag, 0, skilldrp, skilldrp, driver_device, 0, ROT0, "Astro Corp.", "Stone Age (Astro, Ver. ENG.03.A)", GAME_NOT_WORKING ) +GAME( 2004?, astoneag, 0, skilldrp, skilldrp, astrocorp_state, astoneag, ROT0, "Astro Corp.", "Stone Age (Astro, Ver. ENG.03.A)", GAME_NOT_WORKING ) GAME( 2005?, winbingo, 0, skilldrp, skilldrp, driver_device, 0, ROT0, "Astro Corp.", "Win Win Bingo (set 1)", GAME_NOT_WORKING ) GAME( 2005?, winbingoa, winbingo, skilldrp, skilldrp, driver_device, 0, ROT0, "Astro Corp.", "Win Win Bingo (set 2)", GAME_NOT_WORKING ) GAME( 2005?, hacher, winbingo, skilldrp, skilldrp, driver_device, 0, ROT0, "bootleg (Gametron)", "Hacher (hack of Win Win Bingo)", GAME_NOT_WORKING ) diff --git a/src/mame/drivers/atlantis.c b/src/mame/drivers/atlantis.c index bf0971073aa..803270545b6 100644 --- a/src/mame/drivers/atlantis.c +++ b/src/mame/drivers/atlantis.c @@ -22,8 +22,6 @@ * Quantum Fireball CX 6.4GB IDE HDD (C/H/S 13328/15/63) TODO: - * Proper VR4373 implementation - * Proper PCI bus implementation * PCI peripherals NOTES: @@ -38,6 +36,8 @@ #include "machine/idectrl.h" #include "machine/midwayic.h" #include "audio/dcs.h" +#include "machine/pci.h" +#include "machine/vrc4373.h" class atlantis_state : public driver_device @@ -103,17 +103,6 @@ UINT32 atlantis_state::screen_update_mwskins(screen_device &screen, bitmap_ind16 * *************************************/ -static ADDRESS_MAP_START( main_map, AS_PROGRAM, 32, atlantis_state ) - ADDRESS_MAP_UNMAP_HIGH - AM_RANGE(0x00000000, 0x007fffff) AM_RAM // 8 MB main RAM - // 04000000 - PCI slot (ActionTec modem, ROM dump TBD) - // 08000000 - PLX9050 chip (Zeus interface?) - // 0F000000 - VR4373 ("Nile 3") registers - AM_RANGE(0x1fc00000, 0x1fc7ffff) AM_ROM AM_REGION("user1", 0) AM_SHARE("rombase") -ADDRESS_MAP_END - - - /************************************* * @@ -136,8 +125,9 @@ static MACHINE_CONFIG_START( mwskins, atlantis_state ) MCFG_CPU_ADD("maincpu", VR4310LE, 166666666) // clock is TRUSTED MCFG_MIPS3_ICACHE_SIZE(16384) MCFG_MIPS3_DCACHE_SIZE(16384) - MCFG_CPU_PROGRAM_MAP(main_map) + MCFG_PCI_ROOT_ADD( ":pci") + MCFG_VRC4373_ADD( ":pci:00.0", ":maincpu") MCFG_IDE_CONTROLLER_ADD("ide", ata_devices, "hdd", NULL, true) @@ -167,7 +157,7 @@ MACHINE_CONFIG_END *************************************/ ROM_START( mwskins ) - ROM_REGION32_LE( 0x80000, "user1", 0 ) /* 512k for R4310 code */ + ROM_REGION32_LE( 0x80000, ":pci:00.0", 0 ) /* 512k for R4310 code */ ROM_LOAD( "skins_game_u4_boot_1.00.u4", 0x000000, 0x080000, CRC(0fe87720) SHA1(4b24abbe662a2d7b61e6a3f079e28b73605ba19f) ) DISK_REGION( "ide:0:hdd:image" ) @@ -175,7 +165,7 @@ ROM_START( mwskins ) ROM_END ROM_START( mwskinsa ) - ROM_REGION32_LE( 0x80000, "user1", 0 ) /* 512k for R4310 code */ + ROM_REGION32_LE( 0x80000, ":pci:00.0", 0 ) /* 512k for R4310 code */ ROM_LOAD( "skins_game_u4_boot_1.00.u4", 0x000000, 0x080000, CRC(0fe87720) SHA1(4b24abbe662a2d7b61e6a3f079e28b73605ba19f) ) DISK_REGION( "ide:0:hdd:image" ) @@ -183,7 +173,7 @@ ROM_START( mwskinsa ) ROM_END ROM_START( mwskinso ) - ROM_REGION32_LE( 0x80000, "user1", 0 ) /* 512k for R4310 code */ + ROM_REGION32_LE( 0x80000, ":pci:00.0", 0 ) /* 512k for R4310 code */ ROM_LOAD( "skins_game_u4_boot_1.00.u4", 0x000000, 0x080000, CRC(0fe87720) SHA1(4b24abbe662a2d7b61e6a3f079e28b73605ba19f) ) DISK_REGION( "ide:0:hdd:image" ) diff --git a/src/mame/drivers/cocoloco.c b/src/mame/drivers/cocoloco.c index d47795cefb4..8932025cc9b 100644 --- a/src/mame/drivers/cocoloco.c +++ b/src/mame/drivers/cocoloco.c @@ -190,19 +190,24 @@ public: m_maincpu(*this, "maincpu"), m_palette(*this, "palette") { } + required_device<cpu_device> m_maincpu; + required_device<palette_device> m_palette; + UINT8 *m_videoram; UINT8 m_videobank; - DECLARE_READ8_MEMBER(cocoloco_vram_r); - DECLARE_WRITE8_MEMBER(cocoloco_vram_w); - DECLARE_WRITE8_MEMBER(cocoloco_vbank_w); - DECLARE_WRITE8_MEMBER(cocoloco_vram_clear_w); - DECLARE_WRITE8_MEMBER(cocoloco_coin_counter_w); + + DECLARE_READ8_MEMBER(vram_r); + DECLARE_WRITE8_MEMBER(vram_w); + DECLARE_WRITE8_MEMBER(vbank_w); + DECLARE_WRITE8_MEMBER(vram_clear_w); + DECLARE_WRITE8_MEMBER(coincounter_w); + DECLARE_INPUT_CHANGED_MEMBER(coin_inserted); + virtual void video_start(); DECLARE_PALETTE_INIT(cocoloco); - UINT32 screen_update_cocoloco(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - required_device<cpu_device> m_maincpu; - required_device<palette_device> m_palette; + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; /*********************************** @@ -284,9 +289,12 @@ PALETTE_INIT_MEMBER(cocoloco_state, cocoloco) void cocoloco_state::video_start() { m_videoram = auto_alloc_array(machine(), UINT8, 0x2000 * 8); + + save_pointer(NAME(m_videoram), 0x2000 * 8); + save_item(NAME(m_videobank)); } -UINT32 cocoloco_state::screen_update_cocoloco(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 cocoloco_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x, y, count, xi; @@ -318,12 +326,12 @@ UINT32 cocoloco_state::screen_update_cocoloco(screen_device &screen, bitmap_ind1 } -READ8_MEMBER( cocoloco_state::cocoloco_vram_r ) +READ8_MEMBER( cocoloco_state::vram_r ) { return m_videoram[offset|0x0000] | m_videoram[offset|0x2000] | m_videoram[offset|0x4000] | m_videoram[offset|0x6000]; } -WRITE8_MEMBER( cocoloco_state::cocoloco_vram_w ) +WRITE8_MEMBER( cocoloco_state::vram_w ) { m_videoram[offset|0x0000] = (m_videobank == 0) ? data : 0; m_videoram[offset|0x2000] = (m_videobank & 2) ? data : 0; @@ -331,12 +339,12 @@ WRITE8_MEMBER( cocoloco_state::cocoloco_vram_w ) m_videoram[offset|0x6000] = (m_videobank & 8) ? data : 0; } -WRITE8_MEMBER( cocoloco_state::cocoloco_vbank_w ) +WRITE8_MEMBER( cocoloco_state::vbank_w ) { m_videobank = data; } -WRITE8_MEMBER( cocoloco_state::cocoloco_vram_clear_w ) +WRITE8_MEMBER( cocoloco_state::vram_clear_w ) { /* ??? */ // for(int i=0;i<0x8000;i++) @@ -346,7 +354,7 @@ WRITE8_MEMBER( cocoloco_state::cocoloco_vram_clear_w ) } -WRITE8_MEMBER( cocoloco_state::cocoloco_coin_counter_w ) +WRITE8_MEMBER( cocoloco_state::coincounter_w ) { /* - bits - 7654 3210 @@ -367,14 +375,14 @@ WRITE8_MEMBER( cocoloco_state::cocoloco_coin_counter_w ) static ADDRESS_MAP_START( cocoloco_map, AS_PROGRAM, 8, cocoloco_state ) AM_RANGE(0x0000, 0x1fff) AM_RAM - AM_RANGE(0x2000, 0x3fff) AM_READWRITE(cocoloco_vram_r, cocoloco_vram_w) // 256 x 256 x 1 + AM_RANGE(0x2000, 0x3fff) AM_READWRITE(vram_r, vram_w) // 256 x 256 x 1 AM_RANGE(0x6001, 0x6001) AM_DEVREAD("ay8910", ay8910_device, data_r) AM_RANGE(0x6002, 0x6002) AM_DEVWRITE("ay8910", ay8910_device, data_w) AM_RANGE(0x6003, 0x6003) AM_DEVWRITE("ay8910", ay8910_device, address_w) - AM_RANGE(0x8003, 0x8003) AM_WRITE(cocoloco_vbank_w) - AM_RANGE(0x8005, 0x8005) AM_WRITE(cocoloco_coin_counter_w) + AM_RANGE(0x8003, 0x8003) AM_WRITE(vbank_w) + AM_RANGE(0x8005, 0x8005) AM_WRITE(coincounter_w) AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN0") - AM_RANGE(0xa005, 0xa005) AM_WRITE(cocoloco_vram_clear_w) + AM_RANGE(0xa005, 0xa005) AM_WRITE(vram_clear_w) AM_RANGE(0xd000, 0xffff) AM_ROM ADDRESS_MAP_END @@ -465,7 +473,7 @@ static MACHINE_CONFIG_START( cocoloco, cocoloco_state ) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_RAW_PARAMS(CPU_CLOCK * 4, 384, 0, 256, 262, 0, 256) /* TODO: not accurate, ~50 Hz */ - MCFG_SCREEN_UPDATE_DRIVER(cocoloco_state, screen_update_cocoloco) + MCFG_SCREEN_UPDATE_DRIVER(cocoloco_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_PALETTE_ADD("palette", 0x10) @@ -519,5 +527,5 @@ ROM_END * Game Drivers * ***********************************/ -/* YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS */ -GAME( 198?, cocoloco, 0, cocoloco, cocoloco, driver_device, 0, ROT90, "Petaco S.A.", "Coco Loco", 0 ) +/* YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS */ +GAME( 198?, cocoloco, 0, cocoloco, cocoloco, driver_device, 0, ROT90, "Petaco S.A.", "Coco Loco", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/cps1.c b/src/mame/drivers/cps1.c index 7aa5a3d18c5..32ffdd00d1c 100644 --- a/src/mame/drivers/cps1.c +++ b/src/mame/drivers/cps1.c @@ -224,7 +224,7 @@ Stephh's log (2006.09.20) : - Applied these changes to src/drivers/fcrash.c as well. - Added debug features in the following sets : * 'ghoulsu' - * 'willow', 'willowo' and 'willowj' + * 'willowu', 'willowou' and 'willowj' - Checked sets with no debug features : * 'forgottnua' and 'lostwrld' * 'ghouls' and 'daimakai' @@ -4226,6 +4226,49 @@ ROM_END /* B-Board 89624B-3 */ ROM_START( willow ) ROM_REGION( CODE_SIZE, "maincpu", 0 ) /* 68000 code */ + ROM_LOAD16_BYTE( "wle_30.11f", 0x00000, 0x20000, CRC(15372aa2) SHA1(ba8e1984180b0438255dfc68dc4eb560f3ecbe56) ) + ROM_LOAD16_BYTE( "wle_35.11h", 0x00001, 0x20000, CRC(2e64623b) SHA1(473f6fd10b2456553f1cbf92fd9a61ce94b1c59f) ) + ROM_LOAD16_BYTE( "wlu_31.12f", 0x40000, 0x20000, CRC(0eb48a83) SHA1(28c40c4b5d767f88922cd899e948abf11a85a864) ) + ROM_LOAD16_BYTE( "wlu_36.12h", 0x40001, 0x20000, CRC(36100209) SHA1(63c9338e71dba8b52daffba50b4bca31aaa10d9e) ) + ROM_LOAD16_WORD_SWAP( "wlm-32.8h", 0x80000, 0x80000, CRC(dfd9f643) SHA1(9c760c30af593a87e7fd39fb213a4c73c68ca440) ) + + ROM_REGION( 0x400000, "gfx", 0 ) + ROMX_LOAD( "wlm-7.7a", 0x000000, 0x80000, CRC(afa74b73) SHA1(09081926260c76986a13ac5351dddd2ea11d7a10) , ROM_GROUPWORD | ROM_SKIP(6) ) // in "5" socket + ROMX_LOAD( "wlm-5.9a", 0x000002, 0x80000, CRC(12a0dc0b) SHA1(fea235ce9489f04919daf52f4d3f3bac9b558316) , ROM_GROUPWORD | ROM_SKIP(6) ) // in "7" socket + ROMX_LOAD( "wlm-3.3a", 0x000004, 0x80000, CRC(c6f2abce) SHA1(ff5fcfe417c43b4747bbe12db6052fdb60f5f0e4) , ROM_GROUPWORD | ROM_SKIP(6) ) // in "1" socket + ROMX_LOAD( "wlm-1.5a", 0x000006, 0x80000, CRC(4aa4c6d3) SHA1(7dd6f18f6126c380821a2ca8955439fd6864f4c6) , ROM_GROUPWORD | ROM_SKIP(6) ) // in "3" socket + ROMX_LOAD( "wl_24.7d", 0x200000, 0x20000, CRC(6f0adee5) SHA1(07b18e51b376001f25173b78e0e816f252400210) , ROM_SKIP(7) ) + ROMX_LOAD( "wl_14.7c", 0x200001, 0x20000, CRC(9cf3027d) SHA1(1e8eb20d51a54f6f756c0ab9395ac38b96e67fb2) , ROM_SKIP(7) ) + ROMX_LOAD( "wl_26.9d", 0x200002, 0x20000, CRC(f09c8ecf) SHA1(b39f83e80af010d6481693d9ec8b1d7e258b531d) , ROM_SKIP(7) ) + ROMX_LOAD( "wl_16.9c", 0x200003, 0x20000, CRC(e35407aa) SHA1(7ddae9cef96839da72488c1fe73268c50e0262ff) , ROM_SKIP(7) ) + ROMX_LOAD( "wl_20.3d", 0x200004, 0x20000, CRC(84992350) SHA1(f0ebd810ce099337cda94222dccce8ab9b3c3281) , ROM_SKIP(7) ) + ROMX_LOAD( "wl_10.3c", 0x200005, 0x20000, CRC(b87b5a36) SHA1(25fb8f9698142473233ee509d4146089920e94e1) , ROM_SKIP(7) ) + ROMX_LOAD( "wl_22.5d", 0x200006, 0x20000, CRC(fd3f89f0) SHA1(51ff95cff56ac78682ea56401b35a0aa63cef8cb) , ROM_SKIP(7) ) + ROMX_LOAD( "wl_12.5c", 0x200007, 0x20000, CRC(7da49d69) SHA1(b0ae7ac4f858ee8d72e6877c4275da7a631e2e4c) , ROM_SKIP(7) ) + + ROM_REGION( 0x18000, "audiocpu", 0 ) /* 64k for the audio CPU (+banks) */ + ROM_LOAD( "wl_09.12b", 0x00000, 0x08000, CRC(f6b3d060) SHA1(0ed2e2f64ba53ba2c371b66ab1e52e40b16d8baf) ) + ROM_CONTINUE( 0x10000, 0x08000 ) + + ROM_REGION( 0x40000, "oki", 0 ) /* Samples */ + ROM_LOAD( "wl_18.11c", 0x00000, 0x20000, CRC(bde23d4d) SHA1(d1fee2f99c858dfb07edcd600da491c7b656afe0) ) + ROM_LOAD( "wl_19.12c", 0x20000, 0x20000, CRC(683898f5) SHA1(316a77b663d78c8b9ff6d85756cb05aaaeef4003) ) + + ROM_REGION( 0x0200, "aboardplds", 0 ) + ROM_LOAD( "buf1", 0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) ) + ROM_LOAD( "ioa1", 0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) ) + ROM_LOAD( "prg1", 0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) ) + ROM_LOAD( "rom1", 0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) ) + ROM_LOAD( "sou1", 0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) ) + + ROM_REGION( 0x0200, "bboardplds", 0 ) + ROM_LOAD( "wl24b.1a", 0x0000, 0x0117, CRC(7101cdf1) SHA1(c848f109d09641b3159dbbb2d2ee49cf30bc9e9c) ) + ROM_LOAD( "lwio.11e", 0x0000, 0x0117, CRC(ad52b90c) SHA1(f0fd6aeea515ee449320fe15684e6b3ab7f97bf4) ) +ROM_END + +/* B-Board 89624B-3 */ +ROM_START( willowu ) + ROM_REGION( CODE_SIZE, "maincpu", 0 ) /* 68000 code */ ROM_LOAD16_BYTE( "wlu_30.11f", 0x00000, 0x20000, CRC(d604dbb1) SHA1(b5d78871011ff11a67f1a0cad147cd4de8d67f35) ) ROM_LOAD16_BYTE( "35.11h", 0x00001, 0x20000, CRC(7a791e77) SHA1(fe1429588b7eceab1d369abe03f2cad8de727f71) ) ROM_LOAD16_BYTE( "wlu_31.12f", 0x40000, 0x20000, CRC(0eb48a83) SHA1(28c40c4b5d767f88922cd899e948abf11a85a864) ) @@ -4270,7 +4313,7 @@ ROM_END /* Note that this set comes from a pcb running on an original Capcom USA Willow arcade cabinet, so even if there is the Japan "warning" it's confirmed to be a genuine USA set and almost certainly the first USA release. Then Capcom removed the incorrect "warning" releasing a new proper set of Willow (USA), as documented above. */ -ROM_START( willowo ) +ROM_START( willowuo ) ROM_REGION( CODE_SIZE, "maincpu", 0 ) /* 68000 code */ ROM_LOAD16_BYTE( "wlu_30.11f", 0x00000, 0x20000, CRC(d604dbb1) SHA1(b5d78871011ff11a67f1a0cad147cd4de8d67f35) ) ROM_LOAD16_BYTE( "wlu_35.11h", 0x00001, 0x20000, CRC(daee72fe) SHA1(2ec62f44394fac2887821881f56b6f24d05234b3) ) @@ -9352,6 +9395,43 @@ ROM_START( cworld2ja ) ROM_LOAD( "ioc1.ic1", 0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) ) ROM_END +/* B-Board 91634B-2 - all roms have 91634B on the labels */ +ROM_START( cworld2jb ) + ROM_REGION( CODE_SIZE, "maincpu", 0 ) /* 68000 code */ + ROM_LOAD16_WORD_SWAP( "q5 - 23_91634b.8f", 0x00000, 0x80000, CRC(709f577f) SHA1(3e0615d01f22eb1bf75cbd26dc80ca5a6d08120e) ) + ROM_LOAD16_WORD_SWAP( "q5 - 22_91634b.7f", 0x80000, 0x80000, CRC(93248458) SHA1(9dcdc6838f52efc9a0a6333fd0d734946db12dbd) ) + + ROM_REGION( 0x200000, "gfx", 0 ) + ROMX_LOAD( "q5 - 01_91634b.3a", 0x000000, 0x80000, CRC(09d0e7ce) SHA1(ea502b975986222acce82ce8396348af72e1df72) , ROM_GROUPWORD | ROM_SKIP(6) ) + ROMX_LOAD( "q5 - 02_91634b.4a", 0x000002, 0x80000, CRC(22e4ce9a) SHA1(9e49aec8e1d6d15a68da63e69765b82fd53a9562) , ROM_GROUPWORD | ROM_SKIP(6) ) + ROMX_LOAD( "q5 - 03_91634b.5a", 0x000004, 0x80000, CRC(f7b3aed6) SHA1(bdfb4d5988307b07ad878ac9129954d14da8769b) , ROM_GROUPWORD | ROM_SKIP(6) ) + ROMX_LOAD( "q5 - 04_91634b.6a", 0x000006, 0x80000, CRC(520c6c88) SHA1(19ba8ca3d75aae71cdf471e6307e86a5df8a2851) , ROM_GROUPWORD | ROM_SKIP(6) ) + + ROM_REGION( 0x18000, "audiocpu", 0 ) /* 64k for the audio CPU (+banks) */ + ROM_LOAD( "q5 - 09_91634b.12a", 0x00000, 0x08000, CRC(e14dc524) SHA1(0020a9002572002458fbfe45e8a959cb90de3f03) ) + ROM_CONTINUE( 0x10000, 0x08000 ) + + ROM_REGION( 0x40000, "oki", 0 ) /* Samples */ + ROM_LOAD( "q5 - 18_91634b.11c", 0x00000, 0x20000, CRC(d10c1b68) SHA1(2423241f3340d8ab1b6bf9514ca8c3bba1273873) ) + ROM_LOAD( "q5 - 19_91634b.12c", 0x20000, 0x20000, CRC(7d17e496) SHA1(a274b94ec4f042dddc239ecb9ac2e1e2375f5eb2) ) + + ROM_REGION( 0x0200, "aboardplds", 0 ) + ROM_LOAD( "buf1", 0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) ) + ROM_LOAD( "ioa1", 0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) ) + ROM_LOAD( "prg1", 0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) ) + ROM_LOAD( "rom1", 0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) ) + ROM_LOAD( "sou1", 0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) ) + + ROM_REGION( 0x0200, "bboardplds", 0 ) + ROM_LOAD( "q563b.1a", 0x0000, 0x0117, NO_DUMP ) + ROM_LOAD( "iob1.12d", 0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) ) + ROM_LOAD( "bprg1.11d", 0x0000, 0x0117, CRC(31793da7) SHA1(400fa7ac517421c978c1ee7773c30b9ed0c5d3f3) ) + + ROM_REGION( 0x0200, "cboardplds", 0 ) // checkme + ROM_LOAD( "ioc1.ic7", 0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) ) + ROM_LOAD( "c632.ic1", 0x0000, 0x0117, CRC(0fbd9270) SHA1(d7e737b20c44d41e29ca94be56114b31934dde81) ) +ROM_END + /* B-Board 89624B-3 */ ROM_START( varth ) ROM_REGION( CODE_SIZE, "maincpu", 0 ) /* 68000 code */ @@ -11600,8 +11680,9 @@ GAME( 1989, dynwar, 0, cps1_10MHz, dynwar, cps_state, cps1, GAME( 1989, dynwara, dynwar, cps1_10MHz, dynwar, cps_state, cps1, ROT0, "Capcom", "Dynasty Wars (USA, B-Board 88622B-3)", GAME_SUPPORTS_SAVE ) // (c) Capcom U.S.A. GAME( 1989, dynwarj, dynwar, cps1_10MHz, dynwar, cps_state, cps1, ROT0, "Capcom", "Tenchi wo Kurau (Japan)", GAME_SUPPORTS_SAVE ) GAME( 1989, dynwarjr, dynwar, cps1_12MHz, dynwar, cps_state, cps1, ROT0, "Capcom", "Tenchi wo Kurau (Japan Resale Ver.)", GAME_SUPPORTS_SAVE ) // 12MHz verified -GAME( 1989, willow, 0, cps1_10MHz, willow, cps_state, cps1, ROT0, "Capcom", "Willow (USA)", GAME_SUPPORTS_SAVE ) -GAME( 1989, willowo, willow, cps1_10MHz, willow, cps_state, cps1, ROT0, "Capcom", "Willow (USA Old Ver.)", GAME_SUPPORTS_SAVE ) // Japan "warning" but (c) Capcom U.S.A. +GAME( 1989, willow, 0, cps1_10MHz, willow, cps_state, cps1, ROT0, "Capcom", "Willow (World)", GAME_SUPPORTS_SAVE ) // No "Warning" (c) Capcom U.S.A., genuine export ROM labels +GAME( 1989, willowu, willow, cps1_10MHz, willow, cps_state, cps1, ROT0, "Capcom", "Willow (USA)", GAME_SUPPORTS_SAVE ) +GAME( 1989, willowuo, willow, cps1_10MHz, willow, cps_state, cps1, ROT0, "Capcom", "Willow (USA Old Ver.)", GAME_SUPPORTS_SAVE ) // Japan "warning" but (c) Capcom U.S.A. GAME( 1989, willowj, willow, cps1_10MHz, willow, cps_state, cps1, ROT0, "Capcom", "Willow (Japan)", GAME_SUPPORTS_SAVE ) GAME( 1989, unsquad, 0, cps1_10MHz, unsquad, cps_state, cps1, ROT0, "Capcom / Daipro", "U.N. Squadron (USA)", GAME_SUPPORTS_SAVE ) GAME( 1989, area88, unsquad, cps1_10MHz, unsquad, cps_state, cps1, ROT0, "Capcom / Daipro", "Area 88 (Japan)", GAME_SUPPORTS_SAVE ) @@ -11718,6 +11799,7 @@ GAME( 1992, sf2koryu, sf2ce, cps1_12MHz, sf2hack, cps_state, sf2hack, GAME( 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 GAME( 1992, cworld2j, 0, cps1_12MHz, cworld2j, cps_state, cps1, ROT0, "Capcom", "Adventure Quiz Capcom World 2 (Japan 920611)", GAME_SUPPORTS_SAVE ) GAME( 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 ) +GAME( 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 ) GAME( 1992, varth, 0, cps1_12MHz, varth, cps_state, cps1, ROT270, "Capcom", "Varth: Operation Thunderstorm (World 920714)", GAME_SUPPORTS_SAVE ) // "ETC" // 12MHz verified GAME( 1992, varthr1, varth, cps1_12MHz, varth, cps_state, cps1, ROT270, "Capcom", "Varth: Operation Thunderstorm (World 920612)", GAME_SUPPORTS_SAVE ) // "ETC" GAME( 1992, varthu, varth, cps1_12MHz, varth, cps_state, cps1, ROT270, "Capcom (Romstar license)", "Varth: Operation Thunderstorm (USA 920612)", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/dynax.c b/src/mame/drivers/dynax.c index 4676ba1983a..7570f3ea052 100644 --- a/src/mame/drivers/dynax.c +++ b/src/mame/drivers/dynax.c @@ -5,7 +5,7 @@ Some Dynax games using the second version of their blitter driver by Luca Elia and Nicola Salmoria CPU: Z80 or TLCS90 -Sound: [AY] + [YM] + [YM] + [M5205] +Sound: [AY] + [YM] + [YM] + [M5205] / M6295 VDP: HD46505SP (6845) (CRT controller) Custom: TC17G032AP-0246 (blitter) @@ -37,8 +37,9 @@ Year + Game Main Board Sub Board CPU Sound 91 Mj Ougon No Pai D6209038L1-0 TLCS AY8910 YM2413 RAM Undumped TMP91P640 Code, Battery 92 Quiz TV Gassyuukoku D5512068L1-2 D6410288L-1 Z80 AY8912 YM2413 M5205 RAM 92 Hanafuda Hana Tengoku D6502208L1 D6107068L-1 Z80 AY8910 YM2413 M6242 RAM +94 Castle Of Dracula Z80 M6295 PROM Blitter is an FPGA 94 Mj Reach (bootleg) bootleg TLCS AY8910 YM2413 M6242 PROM Battery -94 Maya Z80 YM2203 PROM +94 Maya Z80 YM2203 PROM Blitter is an FPGA 96 Mj Raijinhai DX D10010318L1 D10502168 TLCS AY8910 M6242 PROM Undumped TMP91P640 Code, Battery 9? Inca Z80 YM2203 PROM --------------------------------------------------------------------------------------------------------------------- @@ -440,6 +441,11 @@ WRITE8_MEMBER(dynax_state::yarunara_layer_half2_w) hnoridur_layer_half2_w(space, 0, data >> 1); } +static ADDRESS_MAP_START( cdracula_mem_map, AS_PROGRAM, 8, dynax_state ) + AM_RANGE( 0x0000, 0xbfff ) AM_ROM + AM_RANGE( 0xc000, 0xffff ) AM_RAM +ADDRESS_MAP_END + static ADDRESS_MAP_START( sprtmtch_mem_map, AS_PROGRAM, 8, dynax_state ) AM_RANGE( 0x0000, 0x6fff ) AM_ROM AM_RANGE( 0x7000, 0x7fff ) AM_RAM AM_SHARE("nvram") @@ -1540,6 +1546,48 @@ ADDRESS_MAP_END /*************************************************************************** + Castle Of Dracula +***************************************************************************/ + +WRITE8_MEMBER(dynax_state::cdracula_sound_rombank_w) +{ +// logerror("%s: sound bank = %02x\n", machine().describe_context(), data); + + int num_banks = memregion("oki")->bytes() / 0x40000; + if (data < num_banks) + m_oki->set_bank_base(data * 0x40000); + else + logerror("%s: warning, invalid sound bank = %02x\n", machine().describe_context(), data); +} + +static ADDRESS_MAP_START( cdracula_io_map, AS_IO, 8, dynax_state ) + ADDRESS_MAP_GLOBAL_MASK(0xff) + AM_RANGE( 0x01, 0x07 ) AM_WRITE(cdracula_blitter_rev2_w) // Blitter + Destination Layers + AM_RANGE( 0x10, 0x10 ) AM_DEVREADWRITE("oki", okim6295_device, read, write) + AM_RANGE( 0x11, 0x11 ) AM_NOP // unpopulated oki +// AM_RANGE( 0x12, 0x12 ) AM_WRITENOP // CRT Controller +// AM_RANGE( 0x13, 0x13 ) AM_WRITENOP // CRT Controller + AM_RANGE( 0x20, 0x20 ) AM_READ_PORT("P1") // P1 + AM_RANGE( 0x21, 0x21 ) AM_READ_PORT("P2") // P2 + AM_RANGE( 0x22, 0x22 ) AM_READ_PORT("COINS") // Coins + AM_RANGE( 0x30, 0x30 ) AM_WRITE(dynax_layer_enable_w) // Layers Enable +// AM_RANGE( 0x31, 0x31 ) AM_WRITE(dynax_rombank_w) // BANK ROM Select + AM_RANGE( 0x32, 0x32 ) AM_WRITE(dynax_blit_pen_w) // Destination Pen + AM_RANGE( 0x33, 0x33 ) AM_WRITE(dynax_blit_flags_w) // Flags + Do Blit + AM_RANGE( 0x34, 0x34 ) AM_WRITE(dynax_blit_palette01_w) // Layers Palettes (Low Bits) + AM_RANGE( 0x35, 0x35 ) AM_WRITE(dynax_blit_palette23_w) // + AM_RANGE( 0x36, 0x36 ) AM_WRITE(dynax_blit_backpen_w) // Background Color + AM_RANGE( 0x37, 0x37 ) AM_WRITE(dynax_vblank_ack_w) // VBlank IRQ Ack + AM_RANGE( 0x41, 0x41 ) AM_WRITE(dynax_flipscreen_w) // Flip Screen + AM_RANGE( 0x44, 0x44 ) AM_WRITE(jantouki_blitter_ack_w) // Blitter IRQ Ack + AM_RANGE( 0x45, 0x45 ) AM_WRITE(dynax_blit_palbank_w) // Layers Palettes (High Bit) + AM_RANGE( 0x60, 0x60 ) AM_READ_PORT("DSW2") + AM_RANGE( 0x61, 0x61 ) AM_READ_PORT("DSW1") + AM_RANGE( 0x6b, 0x6b ) AM_WRITE(cdracula_sound_rombank_w) // OKI Bank +ADDRESS_MAP_END + + +/*************************************************************************** Input Ports @@ -1963,6 +2011,85 @@ static INPUT_PORTS_START( HANAFUDA_KEYS_BET_ALT ) INPUT_PORTS_END #endif +static INPUT_PORTS_START( cdracula ) + PORT_START("P1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) // erase on highscore entry + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) + + PORT_START("P2") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) // erase on highscore entry + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 ) + + PORT_START("COINS") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(10) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(10) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("DSW1") // port $61 -> c217 + PORT_DIPNAME( 0x03, 0x02, DEF_STR( Difficulty ) ) PORT_DIPLOCATION( "SW1:1,2" ) + PORT_DIPSETTING( 0x03, DEF_STR( Easy ) ) // 44 + PORT_DIPSETTING( 0x02, DEF_STR( Normal ) ) // 47 + PORT_DIPSETTING( 0x01, DEF_STR( Hard ) ) // 4a + PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) // 4d + PORT_DIPNAME( 0x0c, 0x08, "Time" ) PORT_DIPLOCATION( "SW1:3,4" ) + PORT_DIPSETTING( 0x0c, "120 sec" ) + PORT_DIPSETTING( 0x08, "90 sec" ) + PORT_DIPSETTING( 0x04, "60 sec" ) + PORT_DIPSETTING( 0x00, "60 sec (duplicate)" ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Lives ) ) PORT_DIPLOCATION( "SW1:5" ) + PORT_DIPSETTING( 0x10, "3" ) + PORT_DIPSETTING( 0x00, "5" ) + PORT_DIPNAME( 0x20, 0x20, "Max Lives" ) PORT_DIPLOCATION( "SW1:6" ) + PORT_DIPSETTING( 0x20, "5" ) + PORT_DIPSETTING( 0x00, "8" ) + PORT_DIPNAME( 0x40, 0x40, "Unknown 1-7" ) PORT_DIPLOCATION( "SW1:7" ) + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) PORT_DIPLOCATION( "SW1:8" ) + + PORT_START("DSW2") // port $60 -> c216 + PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) PORT_DIPLOCATION( "SW2:1,2" ) + PORT_DIPSETTING( 0x00, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) + PORT_DIPNAME( 0x04, 0x04, "Unknown 2-3" ) PORT_DIPLOCATION( "SW2:3" ) + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, "Reset Tiles After Miss" ) PORT_DIPLOCATION( "SW2:4" ) + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x10, "Unknown 2-5" ) PORT_DIPLOCATION( "SW2:5" ) + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION( "SW2:6" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x20, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, "Sound Test" ) PORT_DIPLOCATION( "SW2:7" ) + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, "Graphics Test" ) PORT_DIPLOCATION( "SW2:8" ) + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) +INPUT_PORTS_END + static INPUT_PORTS_START( hanamai ) PORT_START("DSW0") PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) @@ -4213,6 +4340,45 @@ MACHINE_START_MEMBER(dynax_state,hnoridur) } /*************************************************************************** + Castle Of Dracula +***************************************************************************/ + +static MACHINE_CONFIG_START( cdracula, dynax_state ) + + /* basic machine hardware */ + MCFG_CPU_ADD("maincpu", Z80, XTAL_21_4772MHz/4) /* 5.3693175MHz measured */ + MCFG_CPU_PROGRAM_MAP(cdracula_mem_map) + MCFG_CPU_IO_MAP(cdracula_io_map) + MCFG_CPU_VBLANK_INT_DRIVER("screen", dynax_state, sprtmtch_vblank_interrupt) /* IM 0 needs an opcode on the data bus */ + + MCFG_MACHINE_START_OVERRIDE(dynax_state,dynax) + MCFG_MACHINE_RESET_OVERRIDE(dynax_state,dynax) + +// MCFG_NVRAM_ADD_0FILL("nvram") // no battery + + /* video hardware */ + MCFG_SCREEN_ADD("screen", RASTER) + MCFG_SCREEN_REFRESH_RATE(58.56) + MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) + MCFG_SCREEN_SIZE(512, 256) + MCFG_SCREEN_VISIBLE_AREA(16, 512-16-1, 16, 256-1) + MCFG_SCREEN_UPDATE_DRIVER(dynax_state, screen_update_cdracula) + MCFG_SCREEN_PALETTE("palette") + + MCFG_PALETTE_ADD("palette", 512) + + MCFG_PALETTE_INIT_OWNER(dynax_state,sprtmtch) // static palette + MCFG_VIDEO_START_OVERRIDE(dynax_state,hanamai) + + /* sound hardware */ + MCFG_SPEAKER_STANDARD_MONO("mono") + + MCFG_OKIM6295_ADD("oki", XTAL_4MHz / 4, OKIM6295_PIN7_HIGH) /* 1MHz measured */ + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) +MACHINE_CONFIG_END + + +/*************************************************************************** Hana no Mai ***************************************************************************/ @@ -4864,6 +5030,52 @@ MACHINE_CONFIG_END /*************************************************************************** +Castle Of Dracula +1994 Y.S.E. + +Not a Dynax board: + +GoldStar Z8400A PS (40-pin plastic DIP) +GoldStar GM68B45S +TI TPC1020AFN-084C +OKI M6295 (second OKI spot is unpopulated) +2 x DSW8, 28-way connector +PAL16L8ACN +4 MHz & 21.47727 MHz XTALs + +Clocks: + Z80 - 5.359MHz measured (21.47727MHz/4) + M6295 - 1Mhz (4Mhz/4) + + V-SYNC - 58.560 Hz + H-SYNC - 15.41 KHz +***************************************************************************/ + +ROM_START( cdracula ) + ROM_REGION( 0x10000, "maincpu", 0 ) // Z80 Code + ROM_LOAD( "escape.u202", 0x000000, 0x10000, CRC(92ceb689) SHA1(1b5d6cd51fc961f1b9a7b99d9ba48da8ea2e503b) ) + + ROM_REGION( 0xc0000, "gfx1", 0 ) // blitter data + ROM_LOAD( "escape.u214", 0x00000, 0x40000, CRC(52c2f3bc) SHA1(764fb447d749c1b83d2bb6bcd517949a1cd76593) ) + ROM_LOAD( "escape.u212", 0x40000, 0x40000, CRC(df536e91) SHA1(2c988e7793b2665d8ebb12a8f80a9aefdd3ed1dd) ) + ROM_LOAD( "escape.u210", 0x80000, 0x40000, CRC(d3f5bac2) SHA1(d81ac3ca159985b0a79d02ebe707b46fdeaefe64) ) + + ROM_REGION( 0xc0000, "oki", 0 ) + ROM_LOAD( "escape.ua", 0x00000, 0x20000, CRC(2f25be27) SHA1(9b7653ae9ebfd4a301d786c5c731478774e5171d) ) + ROM_LOAD( "escape.ub", 0x20000, 0x20000, CRC(536a8dd0) SHA1(1ec226b0cd4d1320cdfce0a447ea0e481b85a802) ) + ROM_LOAD( "escape.uc", 0x40000, 0x20000, CRC(393fa285) SHA1(654ab2fb92efa28f65bcc7c70a9fae2e43657309) ) + ROM_LOAD( "escape.ud", 0x60000, 0x20000, CRC(eff474af) SHA1(7ab1f0079d051c9b0c4aa566a4d92032c7060d8e) ) + ROM_LOAD( "escape.ue", 0x80000, 0x20000, CRC(0f9dc93b) SHA1(a3b33795cf07882ecc80d9afa5174e771ee0df08) ) + ROM_FILL( 0xa0000, 0x20000, 0 ) + + ROM_REGION( 0x400, "proms", 0 ) // Color PROMs + ROM_LOAD( "82s147an.u26", 0x000, 0x200, CRC(1a3fe146) SHA1(7d1b4dd66fc95ea5ed584f0bb571cca09fe519b0) ) // FIXED BITS (00xxxxxx) + ROM_LOAD( "82s147an.u25", 0x200, 0x200, CRC(31791990) SHA1(526c0d516f290dc6cc2ec76d9bcec8c900e2ae10) ) +ROM_END + + +/*************************************************************************** + Hana no Mai (c)1988 Dynax @@ -7118,5 +7330,6 @@ GAME( 1991, tenkaie, tenkai, tenkai, tenkai, driver_device, 0, ROT GAME( 1991, ougonpai, 0, tenkai, tenkai, driver_device, 0, ROT0, "Dynax", "Mahjong Ougon No Pai", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) GAME( 1991, ougonpaib,ougonpai, tenkai, tenkai, driver_device, 0, ROT0, "bootleg", "Mahjong Ougon No Pai (bootleg)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) GAME( 1994, mjreach, 0, tenkai, mjreach, dynax_state, mjreach, ROT0, "bootleg / Dynax", "Mahjong Reach (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1994, cdracula, 0, cdracula, cdracula, driver_device, 0, ROT0, "Yun Sung (Escape license)","Castle Of Dracula", GAME_SUPPORTS_SAVE ) // not a dynax board GAME( 1995, shpeng, 0, sprtmtch, drgpunch, driver_device, 0, ROT0, "WSAC Systems?", "Sea Hunter Penguin", GAME_NO_COCKTAIL | GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE ) // not a dynax board. proms? GAME( 1996, majrjhdx, 0, majrjhdx, tenkai, driver_device, 0, ROT0, "Dynax", "Mahjong Raijinhai DX", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/galaxian.c b/src/mame/drivers/galaxian.c index f847b6cce86..da85af50ecb 100644 --- a/src/mame/drivers/galaxian.c +++ b/src/mame/drivers/galaxian.c @@ -10915,7 +10915,7 @@ GAME( 1981, scramble, 0, scramble, scramble, galaxian_state, scram GAME( 1981, scrambles, scramble, scramble, scramble, galaxian_state, scramble, ROT90, "Konami (Stern Electronics license)", "Scramble (Stern Electronics set 1)", GAME_SUPPORTS_SAVE ) GAME( 1981, scrambles2, scramble, scramble, scramble, galaxian_state, scramble, ROT90, "Konami (Stern Electronics license)", "Scramble (Stern Electronics set 2)", GAME_SUPPORTS_SAVE ) GAME( 1981, strfbomb, scramble, scramble, strfbomb, galaxian_state, scramble, ROT90, "bootleg (Omni)", "Strafe Bomb (bootleg of Scramble)", GAME_SUPPORTS_SAVE ) -GAME( 1981, explorer, scramble, explorer, explorer, galaxian_state, explorer, ROT90, "bootleg", "Explorer (bootleg of Scramble)", GAME_SUPPORTS_SAVE ) +GAME( 1981, explorer, scramble, explorer, explorer, galaxian_state, explorer, ROT90, "bootleg (Sidam)", "Explorer (bootleg of Scramble)", GAME_SUPPORTS_SAVE ) GAME( 1981, scramblebf, scramble, scramble, scramble, galaxian_state, scramble, ROT90, "bootleg (Karateko)", "Scramble (Karateko, French bootleg)", GAME_SUPPORTS_SAVE ) GAME( 1981, scrambp, scramble, scramble, scramble, galaxian_state, scramble, ROT90, "bootleg (Billport S.A.)", "Impacto (Billport S.A., Spanish bootleg of Scramble)", GAME_SUPPORTS_SAVE ) // similar to the Karateko set above GAME( 1981, scrampt, scramble, scramble, scramble, galaxian_state, scramble, ROT90, "bootleg (Petaco S.A.)", "Scramble (Petaco S.A., Spanish bootleg)", GAME_SUPPORTS_SAVE ) // ^^ diff --git a/src/mame/drivers/goldstar.c b/src/mame/drivers/goldstar.c index 96aae293067..f1868c108a5 100644 --- a/src/mame/drivers/goldstar.c +++ b/src/mame/drivers/goldstar.c @@ -117,9 +117,36 @@ Nominated for the *WORST* hacked gambling game EVER! + * unkch sets + + In unkch1/unkch2 the payout rate is set with a combination of DSW1-3 (Punti) + and DSW3-3 (Gettoni/Ticket). If Punti is set to Ticket, the payout rate is + the second number of the Gettoni/Ticket setting (100 or 200). If Punti is set + to Gettoni, the payout rate is the first number of the Gettoni/Ticket setting + (10 or 20). If your points/credits aren't a multiple of the payout rate, you + lose the remainder. If you hit Key Out when your points/credits are less than + 100, you get nothing at all. If Gettoni/Ticket is set to 20/200 and you hit + Key Out when credits/points are at least 100 but less than 200, tickets will + be dispensed continuously until you insert another coin - game bug or MAME + bug? + + Payout rate in unkch3 seems to be set with DSW1-3 (Punti) directly. This game + also seems to be able to easily get into a state where tickets are dispensed + continuously. Maybe there's something more complicated about the ticket + dispenser hookup that we're missing? + + In unkch4 the payout rate is set with DSW1-3 (Punti) - 100 for Ticket and 10 + for Gettoni. It's also nice enough to let you keep the remainder if you hit + Key Out when your credits/points aren't a multiple of 100. This is the only + set that doesn't have issues with dispensing tickets continuously + + unkch3 has a handy input test mode. To access it, first enable it with DSW4-5, + then hold the Settings button (9) during boot. + + * Crazy Bonus (crazybon): - Appears to be from a bootleg conversion set for Poker Master (pokrmast). There + Appears to be from a bootleg conversion set for Poker Master (pkrmast). There is another undumped bootleg conversion set advertised that displays Spirit or Dyna copyright depending on DIP settings and has both poker and slots games (the set in MAME displays "Crazy Co." copyright and only has a slots game). @@ -127,7 +154,7 @@ This is a stealth set that hides behind a fake Windows ME desktop if DSW2-6 is off. Push Start followed by Bet five time to access the game. It will return to the desktop after the game is over. Colours currently appear to be bad on - the desktop screen. + the desktop screen. DSW3-8 disables the button sequence for accessing the game. Judging from the contents of the graphics ROMs and the Stats screens, there's a poker game buried in there, but there's apparently no way to access it. @@ -172,6 +199,7 @@ #include "roypok96.lh" #include "skill98.lh" #include "tonypok.lh" +#include "unkch.lh" WRITE8_MEMBER(goldstar_state::protection_w) @@ -209,6 +237,7 @@ WRITE8_MEMBER(goldstar_state::p1_lamps_w) ---x ---- info info small small/end --x- ---- start start deal start start start -x-- ---- hold + x--- ---- all cm/cmaster use the same scheme tonypok uses lamps to indicate current button functions rather than active buttons @@ -933,14 +962,6 @@ static ADDRESS_MAP_START( wcat3_map, AS_PROGRAM, 8, goldstar_state ) ADDRESS_MAP_END -/* -READ8_MEMBER(unkch_state::unk_r) -{ - return 0xff; -} -*/ - - /* newer / more capable hw */ static ADDRESS_MAP_START( unkch_map, AS_PROGRAM, 8, unkch_state ) AM_RANGE(0x0000, 0x9fff) AM_ROM @@ -967,9 +988,55 @@ static ADDRESS_MAP_START( unkch_map, AS_PROGRAM, 8, unkch_state ) AM_RANGE(0xfe00, 0xffff) AM_RAM ADDRESS_MAP_END + +WRITE8_MEMBER(unkch_state::coincount_w) +{ +/* + 7654 3210 + ---- --x- Payout counter (rate set with DIP switches) + ---- -x-- Credit counter (1 pulse/10 credits) + ---- x--- Key In counter + --xx ---- used for something during ticket dispensing + x--- ---- Ticket Dispenser Motor + -x-- ---x unused/unknown + +*/ + + m_ticket_dispenser->write(space, offset, data & 0x80); + + coin_counter_w(machine(), 0, data & 0x04); /* Credit counter */ + coin_counter_w(machine(), 1, data & 0x08); /* Key In counter */ + coin_counter_w(machine(), 2, data & 0x02); /* payout counter */ + + //popmessage("coin counters: %02x", data); +} + WRITE8_MEMBER(unkch_state::unkcm_0x02_w) { +/* bits + 7654 3210 + ---- ---x button lamp: Bet-A / Stop 2 + ---- --x- button lamp: Start / Stop All + ---- -x-- button lamp: Info / Small / Stop 3 + ---- x--- button lamp: Big + ---x ---- button lamp: Bet-B / D-Up + --x- ---- button lamp: Take / Stop 1 + -x-- ---- unknown/unused + x--- ---- vblank IRQ enable + + these sets use crude PWM to dim lamp 2 which requires filament physics simulation to work properly +*/ + //popmessage("unkcm_0x02_w %02x", data); + + m_vblank_irq_enable = data & 0x80; + + output_set_lamp_value(0, (data >> 0) & 1); /* Bet-A / Stop 2 */ + output_set_lamp_value(1, (data >> 1) & 1); /* Start / Stop All */ + output_set_lamp_value(2, (data >> 2) & 1); /* Info / Small / Stop 3 */ + output_set_lamp_value(3, (data >> 3) & 1); /* Big */ + output_set_lamp_value(4, (data >> 4) & 1); /* Bet-B / D-Up */ + output_set_lamp_value(5, (data >> 5) & 1); /* Take / Stop 1 */ } WRITE8_MEMBER(unkch_state::unkcm_0x03_w) @@ -982,31 +1049,21 @@ WRITE8_MEMBER(unkch_state::unkcm_0x03_w) } -WRITE8_MEMBER(unkch_state::unkcm_0x11_w) -{ - //popmessage("unkcm_0x11_w %02x", data); -} - -WRITE8_MEMBER(unkch_state::unkcm_0x12_w) -{ -// popmessage("unkcm_0x12_w %02x", data); -} - - static ADDRESS_MAP_START( unkch_portmap, AS_IO, 8, unkch_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) + AM_RANGE(0x01, 0x01) AM_WRITE(coincount_w) AM_RANGE(0x02, 0x02) AM_WRITE(unkcm_0x02_w) AM_RANGE(0x03, 0x03) AM_WRITE(unkcm_0x03_w) - AM_RANGE(0x11, 0x11) AM_WRITE(unkcm_0x11_w) - AM_RANGE(0x12, 0x12) AM_WRITE(unkcm_0x12_w) AM_RANGE(0x08, 0x08) AM_READ_PORT("IN0") AM_RANGE(0x09, 0x09) AM_READ_PORT("IN1") AM_RANGE(0x0a, 0x0a) AM_READ_PORT("DSW4") AM_RANGE(0x0b, 0x0b) AM_READ_PORT("DSW3") - AM_RANGE(0x10, 0x10) AM_READ_PORT("DSW2") - /* Where is DSW1? It's possible the games are buggy and use the value read from DSW3 for DSW1 as well. */ + + AM_RANGE(0x10, 0x10) AM_DEVREAD("aysnd", ay8910_device, data_r) + AM_RANGE(0x11, 0x11) AM_DEVWRITE("aysnd", ay8910_device, data_w) + AM_RANGE(0x12, 0x12) AM_DEVWRITE("aysnd", ay8910_device, address_w) ADDRESS_MAP_END @@ -2012,8 +2069,8 @@ static INPUT_PORTS_START( chryangl ) PORT_DIPSETTING( 0x10, "C-Type" ) PORT_DIPSETTING( 0x00, "D-Type" ) PORT_DIPNAME( 0x20, 0x20, "Min. Bet For Bonus Play" ) PORT_DIPLOCATION("DSW4:6") - PORT_DIPSETTING( 0x20, "16 Bet" ) - PORT_DIPSETTING( 0x00, "8 Bet" ) + PORT_DIPSETTING( 0x00, "8" ) + PORT_DIPSETTING( 0x20, "16" ) PORT_DIPNAME( 0x40, 0x40, "Reel Speed" ) PORT_DIPLOCATION("DSW4:7") PORT_DIPSETTING( 0x40, DEF_STR( Low ) ) PORT_DIPSETTING( 0x00, DEF_STR( High ) ) @@ -4730,15 +4787,11 @@ static INPUT_PORTS_START( unkch_controls ) PORT_START("IN1") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) /* Trips "call attendant" state if activated while credited - something to do with hopper out? */ PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("tickets", ticket_dispenser_device, line_r) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) @@ -4750,47 +4803,73 @@ INPUT_PORTS_END static INPUT_PORTS_START( unkch ) PORT_INCLUDE( unkch_controls ) - /* Is there a DSW1? - Like many of the other games on this hardware, there is an + /* Like many of the other games on this hardware, there is an input & dip test screen that you can stumble in to. Also a picture viewer option. Can't figure out exactly how to make it repeatable... */ - PORT_START("DSW2") - PORT_DIPNAME( 0x03, 0x03, "Game Level" ) PORT_DIPLOCATION("DSW2:1,2") /* OK */ + PORT_START("DSW1") + PORT_DIPNAME( 0x03, 0x03, "Game Level" ) PORT_DIPLOCATION("DSW1:1,2") /* OK */ PORT_DIPSETTING( 0x03, "Easy" ) PORT_DIPSETTING( 0x02, "Mid 1" ) PORT_DIPSETTING( 0x01, "Mid 2" ) PORT_DIPSETTING( 0x00, "Hard" ) - PORT_DIPNAME( 0x04, 0x04, "Punti" ) PORT_DIPLOCATION("DSW2:3") /* OK */ + PORT_DIPNAME( 0x04, 0x04, "Punti" ) PORT_DIPLOCATION("DSW1:3") /* OK */ PORT_DIPSETTING( 0x04, "Ticket" ) PORT_DIPSETTING( 0x00, "Gettoni" ) - PORT_DIPNAME( 0x08, 0x08, "Main/Bonus Game Rate" ) PORT_DIPLOCATION("DSW2:4") /* OK */ - PORT_DIPSETTING( 0x08, "83% / 88%" ) - PORT_DIPSETTING( 0x00, "71% / 76%" ) PORT_CONDITION("DSW2",0x03,EQUALS,0x03) /* Easy */ - PORT_DIPSETTING( 0x00, "68% / 73%" ) PORT_CONDITION("DSW2",0x03,EQUALS,0x02) /* Mid 1 */ - PORT_DIPSETTING( 0x00, "65% / 70%" ) PORT_CONDITION("DSW2",0x03,EQUALS,0x01) /* Mid 2 */ - PORT_DIPSETTING( 0x00, "62% / 67%" ) PORT_CONDITION("DSW2",0x03,EQUALS,0x00) /* Hard */ - PORT_DIPNAME( 0x10, 0x10, "Reel Speed / Max Bet" ) PORT_DIPLOCATION("DSW2:5") /* OK */ - PORT_DIPSETTING( 0x10, "Low / 64" ) - PORT_DIPSETTING( 0x00, "High / 40 (20)" ) /* shows 20 in settings screen but limits to 40 in gameplay */ - PORT_DIPNAME( 0x60, 0x60, "Super Jackpot" ) PORT_DIPLOCATION("DSW2:6,7") /* OK */ + PORT_DIPNAME( 0x08, 0x08, "Ticket Dispenser" ) PORT_DIPLOCATION("DSW1:4") /* OK */ + PORT_DIPSETTING( 0x00, DEF_STR( No ) ) + PORT_DIPSETTING( 0x08, DEF_STR( Yes ) ) + PORT_DIPNAME( 0x10, 0x10, "Reel Speed" ) PORT_DIPLOCATION("DSW1:5") /* OK */ + PORT_DIPSETTING( 0x10, DEF_STR( Low ) ) + PORT_DIPSETTING( 0x00, DEF_STR( High ) ) + PORT_DIPNAME( 0x60, 0x60, "Super Jackpot" ) PORT_DIPLOCATION("DSW1:6,7") /* OK */ PORT_DIPSETTING( 0x60, DEF_STR( No ) ) PORT_DIPSETTING( 0x20, "5%" ) PORT_DIPSETTING( 0x00, "10%" ) PORT_DIPSETTING( 0x40, "20%" ) - PORT_DIPNAME( 0x80, 0x80, "Bet Step On 8" ) PORT_DIPLOCATION("DSW2:8") /* OK */ + PORT_DIPNAME( 0x80, 0x80, "Bet Step On 8" ) PORT_DIPLOCATION("DSW1:8") /* OK */ PORT_DIPSETTING( 0x80, DEF_STR( No ) ) PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) + PORT_START("DSW2") + PORT_DIPNAME( 0x0f, 0x0f, "Main/Bonus Game Rate" ) PORT_DIPLOCATION("DSW2:1,2,3,4") /* OK - all other values are 83% / 88% */ + PORT_DIPSETTING( 0x00, "50% / 55%" ) + PORT_DIPSETTING( 0x01, "53% / 58%" ) + PORT_DIPSETTING( 0x02, "56% / 61%" ) + PORT_DIPSETTING( 0x03, "59% / 64%" ) + PORT_DIPSETTING( 0x04, "62% / 67%" ) + PORT_DIPSETTING( 0x05, "65% / 70%" ) + PORT_DIPSETTING( 0x06, "68% / 73%" ) + PORT_DIPSETTING( 0x07, "71% / 76%" ) + PORT_DIPSETTING( 0x08, "74% / 79%" ) + PORT_DIPSETTING( 0x09, "77% / 82%" ) + PORT_DIPSETTING( 0x0a, "80% / 85%" ) + PORT_DIPSETTING( 0x0f, "83% / 88%" ) + PORT_DIPNAME( 0x30, 0x30, "Max Bet" ) PORT_DIPLOCATION("DSW2:5,6") /* OK */ + PORT_DIPSETTING( 0x00, "10 (5)" ) PORT_CONDITION("DSW3",0x80,EQUALS,0x80) /* shows 5 in settings screen but limits at 10 in gameplay */ + PORT_DIPSETTING( 0x10, "20 (10)" ) PORT_CONDITION("DSW3",0x80,EQUALS,0x80) /* shows 10 in settings screen but limits at 20 in gameplay */ + PORT_DIPSETTING( 0x20, "40 (20)" ) PORT_CONDITION("DSW3",0x80,EQUALS,0x80) /* shows 20 in settings screen but limits at 40 in gameplay */ + PORT_DIPSETTING( 0x00, "5" ) PORT_CONDITION("DSW3",0x80,EQUALS,0x00) + PORT_DIPSETTING( 0x10, "10" ) PORT_CONDITION("DSW3",0x80,EQUALS,0x00) + PORT_DIPSETTING( 0x20, "20" ) PORT_CONDITION("DSW3",0x80,EQUALS,0x00) + PORT_DIPSETTING( 0x30, "64" ) /* always individual irrespective of DSW3-8 */ + PORT_DIPNAME( 0x40, 0x40, "Min. Bet For Bonus Play" ) PORT_DIPLOCATION("DSW2:7") /* OK */ + PORT_DIPSETTING( 0x00, "8" ) + PORT_DIPSETTING( 0x40, "16" ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:8") + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_START("DSW3") - PORT_DIPNAME( 0x03, 0x03, "Coin A Rate" ) PORT_DIPLOCATION("DSW3:1,2") /* OK */ + PORT_DIPNAME( 0x03, 0x00, "Coin A Rate" ) PORT_DIPLOCATION("DSW3:1,2") /* OK */ PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_DIPSETTING( 0x01, "1 Coin/10 Credits" ) PORT_DIPSETTING( 0x02, "1 Coin/20 Credits" ) PORT_DIPSETTING( 0x03, "1 Coin/50 Credits" ) - PORT_DIPNAME( 0x04, 0x04, "Gettoni/Ticket" ) PORT_DIPLOCATION("DSW3:3") /* OK */ - PORT_DIPSETTING( 0x04, "20/200" ) + PORT_DIPNAME( 0x04, 0x00, "Gettoni/Ticket" ) PORT_DIPLOCATION("DSW3:3") /* OK */ PORT_DIPSETTING( 0x00, "10/100" ) - PORT_DIPNAME( 0x18, 0x18, "Key In Rate" ) PORT_DIPLOCATION("DSW3:4,5") /* OK */ + PORT_DIPSETTING( 0x04, "20/200" ) + PORT_DIPNAME( 0x18, 0x00, "Key In Rate" ) PORT_DIPLOCATION("DSW3:4,5") /* OK */ PORT_DIPSETTING( 0x00, "1 Coin/25 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x00) /* 5*5 */ PORT_DIPSETTING( 0x08, "1 Coin/50 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x00) /* 5*10 */ PORT_DIPSETTING( 0x10, "1 Coin/100 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x00) /* 5*20 */ @@ -4807,126 +4886,149 @@ static INPUT_PORTS_START( unkch ) PORT_DIPSETTING( 0x08, "1 Coin/500 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x03) /* 50*10 */ PORT_DIPSETTING( 0x10, "1 Coin/1,000 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x03) /* 50*20 */ PORT_DIPSETTING( 0x18, "1 Coin/2,500 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x03) /* 50*50 */ - PORT_DIPNAME( 0x20, 0x20, "Coin B Enable" ) PORT_DIPLOCATION("DSW3:6") /* OK */ + PORT_DIPNAME( 0x20, 0x00, "Coin B Enable" ) PORT_DIPLOCATION("DSW3:6") /* OK */ PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, "Coin B Rate" ) PORT_DIPLOCATION("DSW3:7") /* OK */ + PORT_DIPNAME( 0x40, 0x00, "Coin B Rate" ) PORT_DIPLOCATION("DSW3:7") /* OK */ PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:8") - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x00, "Max Bet Type" ) PORT_DIPLOCATION("DSW3:8") /* OK */ + PORT_DIPSETTING( 0x80, "Total" ) /* Max Bet applies to total of BET-A and BET-B unless set to 64 */ + PORT_DIPSETTING( 0x00, "Individual" ) /* Max Bet applies individually to each of BET-A and BET-B */ PORT_START("DSW4") - PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:1") + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:1") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:2") + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:2") PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:3") + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:3") PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, "Super Jackpot Half" ) PORT_DIPLOCATION("DSW4:4") /* OK */ + PORT_DIPNAME( 0x08, 0x08, "Super Jackpot Half" ) PORT_DIPLOCATION("DSW4:4") /* OK */ PORT_DIPSETTING( 0x08, DEF_STR( No ) ) PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:5") + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:5") PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x60, 0x60, "Red Game Credit" ) PORT_DIPLOCATION("DSW4:6,7") /* OK */ + PORT_DIPNAME( 0x60, 0x60, "Red Game Credit" ) PORT_DIPLOCATION("DSW4:6,7") /* OK */ PORT_DIPSETTING( 0x40, "0" ) PORT_DIPSETTING( 0x20, "1" ) PORT_DIPSETTING( 0x00, "10" ) PORT_DIPSETTING( 0x60, "20" ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:8") - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, "Cherry/Bell Bonus" ) PORT_DIPLOCATION("DSW4:8") /* OK */ + PORT_DIPSETTING( 0x80, "x6 / x3" ) + PORT_DIPSETTING( 0x00, "x9 / x5" ) INPUT_PORTS_END static INPUT_PORTS_START( unkch3 ) PORT_INCLUDE( unkch_controls ) - /* Is there a DSW1? - Like many of the other games on this hardware, there is an - input & dip test screen that you can stumble in to. Also a picture viewer option. Can't figure - out exactly how to make it repeatable... */ - - PORT_START("DSW2") - PORT_DIPNAME( 0x03, 0x03, "Game Level" ) PORT_DIPLOCATION("DSW2:1,2") /* OK */ + PORT_START("DSW1") + PORT_DIPNAME( 0x03, 0x03, "Game Level" ) PORT_DIPLOCATION("DSW1:1,2") /* OK */ PORT_DIPSETTING( 0x03, "Easy" ) PORT_DIPSETTING( 0x02, "Mid 1" ) PORT_DIPSETTING( 0x01, "Mid 2" ) PORT_DIPSETTING( 0x00, "Hard" ) - PORT_DIPNAME( 0x04, 0x04, "Punti Unit" ) PORT_DIPLOCATION("DSW2:3") /* OK */ + PORT_DIPNAME( 0x04, 0x04, "Punti Unit" ) PORT_DIPLOCATION("DSW1:3") /* OK */ PORT_DIPSETTING( 0x00, "500" ) PORT_DIPSETTING( 0x04, "1000" ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:4") + PORT_DIPNAME( 0x08, 0x08, "Ticket Dispenser" ) PORT_DIPLOCATION("DSW1:4") /* OK */ + PORT_DIPSETTING( 0x00, DEF_STR( No ) ) + PORT_DIPSETTING( 0x08, DEF_STR( Yes ) ) + PORT_DIPNAME( 0x10, 0x10, "Reel Speed" ) PORT_DIPLOCATION("DSW1:5") /* OK */ + PORT_DIPSETTING( 0x10, DEF_STR( Low ) ) + PORT_DIPSETTING( 0x00, DEF_STR( High ) ) + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:6") + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:7") + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:8") + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_START("DSW2") + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:1") + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:2") + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:3") + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:4") PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, "Reel Speed" ) PORT_DIPLOCATION("DSW2:5") /* OK */ - PORT_DIPSETTING( 0x10, DEF_STR( Low ) ) /* manual start at max bet */ - PORT_DIPSETTING( 0x00, DEF_STR( High ) ) /* auto start at max bet */ - PORT_DIPNAME( 0x20, 0x20, "Bet Maximum" ) PORT_DIPLOCATION("DSW2:6") /* OK */ - PORT_DIPSETTING( 0x00, "10" ) PORT_CONDITION("DSW2",0x10,EQUALS,0x10) - PORT_DIPSETTING( 0x20, "64" ) PORT_CONDITION("DSW2",0x10,EQUALS,0x10) - PORT_DIPSETTING( 0x00, "10 (5)" ) PORT_CONDITION("DSW2",0x10,EQUALS,0x00) /* shows 5 in settings screen but limits at 10 in gameplay */ - PORT_DIPSETTING( 0x20, "40 (20)" ) PORT_CONDITION("DSW2",0x10,EQUALS,0x00) /* shows 20 in settings screen but limits at 40 in gameplay */ - PORT_DIPNAME( 0x40, 0x40, "Bet Minimum" ) PORT_DIPLOCATION("DSW2:7") /* shows in settings screen but has no effect */ + PORT_DIPNAME( 0x30, 0x30, "Max Bet" ) PORT_DIPLOCATION("DSW2:5,6") /* OK */ + PORT_DIPSETTING( 0x00, "10 (5)" ) PORT_CONDITION("DSW3",0x80,EQUALS,0x80) /* shows 5 in settings screen but limits at 10 in gameplay */ + PORT_DIPSETTING( 0x10, "20 (10)" ) PORT_CONDITION("DSW3",0x80,EQUALS,0x80) /* shows 10 in settings screen but limits at 20 in gameplay */ + PORT_DIPSETTING( 0x20, "40 (20)" ) PORT_CONDITION("DSW3",0x80,EQUALS,0x80) /* shows 20 in settings screen but limits at 40 in gameplay */ + PORT_DIPSETTING( 0x00, "5" ) PORT_CONDITION("DSW3",0x80,EQUALS,0x00) + PORT_DIPSETTING( 0x10, "10" ) PORT_CONDITION("DSW3",0x80,EQUALS,0x00) + PORT_DIPSETTING( 0x20, "20" ) PORT_CONDITION("DSW3",0x80,EQUALS,0x00) + PORT_DIPSETTING( 0x30, "64" ) /* always individual irrespective of DSW3-8 */ + PORT_DIPNAME( 0x40, 0x40, "Min. Bet For Bonus Play" ) PORT_DIPLOCATION("DSW2:7") /* OK - called 'Bet Minimum' in settings screen */ PORT_DIPSETTING( 0x00, "8" ) PORT_DIPSETTING( 0x40, "16" ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown) ) PORT_DIPLOCATION("DSW2:8") + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown) ) PORT_DIPLOCATION("DSW2:8") PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_START("DSW3") - PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:1") + PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:1") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:2") + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:2") PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:3") + PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:3") PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:4") + PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:4") PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:5") + PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:5") PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, "Coin B Enable" ) PORT_DIPLOCATION("DSW3:6") /* OK */ + PORT_DIPNAME( 0x20, 0x00, "Coin B Enable" ) PORT_DIPLOCATION("DSW3:6") /* OK */ PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, "Coin B Rate" ) PORT_DIPLOCATION("DSW3:7") /* OK */ + PORT_DIPNAME( 0x40, 0x00, "Coin B Rate" ) PORT_DIPLOCATION("DSW3:7") /* OK */ PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:8") - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x00, "Max Bet Type" ) PORT_DIPLOCATION("DSW3:8") /* OK */ + PORT_DIPSETTING( 0x80, "Total" ) /* Max Bet applies to total of BET-A and BET-B unless set to 64 */ + PORT_DIPSETTING( 0x00, "Individual" ) /* Max Bet applies individually to each of BET-A and BET-B */ PORT_START("DSW4") - PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:1") + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:1") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:2") + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:2") PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:3") + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:3") PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:4") + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:4") PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:5") - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:6") + PORT_DIPNAME( 0x10, 0x10, "Test Mode" ) PORT_DIPLOCATION("DSW4:5") /* OK */ + PORT_DIPSETTING( 0x10, "Disable" ) + PORT_DIPSETTING( 0x00, "Enable" ) /* hold 'Settings' on reset to access */ + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:6") PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:7") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:7") PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:8") - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, "Cherry/Bell Bonus" ) PORT_DIPLOCATION("DSW4:8") /* OK */ + PORT_DIPSETTING( 0x80, "x6 / x3" ) + PORT_DIPSETTING( 0x00, "x9 / x5" ) INPUT_PORTS_END static INPUT_PORTS_START( unkch4 ) @@ -4935,110 +5037,124 @@ static INPUT_PORTS_START( unkch4 ) PORT_MODIFY("IN0") PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_IMPULSE(2) PORT_NAME("Coin C") - /* Is there a DSW1? - Like many of the other games on this hardware, there is an + /* Like many of the other games on this hardware, there is an input & dip test screen that you can stumble in to. Also a picture viewer option. Can't figure out exactly how to make it repeatable... */ - PORT_START("DSW2") - PORT_DIPNAME( 0x03, 0x03, "Game Level" ) PORT_DIPLOCATION("DSW2:1,2") /* OK */ + PORT_START("DSW1") + PORT_DIPNAME( 0x03, 0x03, "Game Level" ) PORT_DIPLOCATION("DSW1:1,2") /* OK */ PORT_DIPSETTING( 0x03, "Easy" ) PORT_DIPSETTING( 0x02, "Mid 1" ) PORT_DIPSETTING( 0x01, "Mid 2" ) PORT_DIPSETTING( 0x00, "Hard" ) - PORT_DIPNAME( 0x04, 0x04, "Punti" ) PORT_DIPLOCATION("DSW2:3") /* OK */ - PORT_DIPSETTING( 0x04, "Ticket" ) - PORT_DIPSETTING( 0x00, "Gettoni" ) - PORT_DIPNAME( 0x08, 0x08, "Main/Bonus Game Rate" ) PORT_DIPLOCATION("DSW2:4") /* OK */ - PORT_DIPSETTING( 0x08, "83% / 88%" ) - PORT_DIPSETTING( 0x00, "71% / 76%" ) PORT_CONDITION("DSW2",0x03,EQUALS,0x03) /* Easy */ - PORT_DIPSETTING( 0x00, "68% / 73%" ) PORT_CONDITION("DSW2",0x03,EQUALS,0x02) /* Mid 1 */ - PORT_DIPSETTING( 0x00, "65% / 70%" ) PORT_CONDITION("DSW2",0x03,EQUALS,0x01) /* Mid 2 */ - PORT_DIPSETTING( 0x00, "62% / 67%" ) PORT_CONDITION("DSW2",0x03,EQUALS,0x00) /* Hard */ - PORT_DIPNAME( 0x10, 0x10, "Reel Speed / Max Bet" ) PORT_DIPLOCATION("DSW2:5") /* OK */ - PORT_DIPSETTING( 0x10, "Low / 64" ) - PORT_DIPSETTING( 0x00, "High / 32" ) - PORT_DIPNAME( 0x60, 0x60, "Super Jackpot" ) PORT_DIPLOCATION("DSW2:6,7") /* OK */ + PORT_DIPNAME( 0x04, 0x04, "Punti" ) PORT_DIPLOCATION("DSW1:3") /* OK */ + PORT_DIPSETTING( 0x04, "Ticket" ) /* payout rate 100 */ + PORT_DIPSETTING( 0x00, "Gettoni" ) /* payout rate 10 */ + PORT_DIPNAME( 0x08, 0x08, "Ticket Dispenser" ) PORT_DIPLOCATION("DSW1:4") /* OK */ + PORT_DIPSETTING( 0x00, DEF_STR( No ) ) + PORT_DIPSETTING( 0x08, DEF_STR( Yes ) ) + PORT_DIPNAME( 0x10, 0x10, "Reel Speed" ) PORT_DIPLOCATION("DSW1:5") /* OK */ + PORT_DIPSETTING( 0x10, DEF_STR( Low ) ) + PORT_DIPSETTING( 0x00, DEF_STR( High ) ) + PORT_DIPNAME( 0x60, 0x60, "Super Jackpot" ) PORT_DIPLOCATION("DSW1:6,7") /* shows in test mode but always seems to be enabled in gameplay */ PORT_DIPSETTING( 0x60, DEF_STR( No ) ) PORT_DIPSETTING( 0x20, "5%" ) PORT_DIPSETTING( 0x00, "10%" ) PORT_DIPSETTING( 0x40, "20%" ) - PORT_DIPNAME( 0x80, 0x80, "Bet Step On 8" ) PORT_DIPLOCATION("DSW2:8") /* OK */ + PORT_DIPNAME( 0x80, 0x80, "Bet Step On 8" ) PORT_DIPLOCATION("DSW1:8") /* OK */ PORT_DIPSETTING( 0x80, DEF_STR( No ) ) PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) - PORT_START("DSW3") - PORT_DIPNAME( 0x03, 0x03, "Coin A Rate" ) PORT_DIPLOCATION("DSW3:1,2") /* OK */ - PORT_DIPSETTING( 0x00, DEF_STR( 1C_8C ) ) - PORT_DIPSETTING( 0x01, "1 Coin/10 Credits" ) - PORT_DIPSETTING( 0x02, "1 Coin/20 Credits" ) - PORT_DIPSETTING( 0x03, "1 Coin/50 Credits" ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:3") - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_START("DSW2") + PORT_DIPNAME( 0x0f, 0x0f, "Main/Bonus Game Rate" ) PORT_DIPLOCATION("DSW2:1,2,3,4") /* OK - all other values are 83% / 88% */ + PORT_DIPSETTING( 0x00, "50% / 55%" ) + PORT_DIPSETTING( 0x01, "53% / 58%" ) + PORT_DIPSETTING( 0x02, "56% / 61%" ) + PORT_DIPSETTING( 0x03, "59% / 64%" ) + PORT_DIPSETTING( 0x04, "62% / 67%" ) + PORT_DIPSETTING( 0x05, "65% / 70%" ) + PORT_DIPSETTING( 0x06, "68% / 73%" ) + PORT_DIPSETTING( 0x07, "71% / 76%" ) + PORT_DIPSETTING( 0x08, "74% / 79%" ) + PORT_DIPSETTING( 0x09, "77% / 82%" ) + PORT_DIPSETTING( 0x0a, "80% / 85%" ) + PORT_DIPSETTING( 0x0f, "83% / 88%" ) + PORT_DIPNAME( 0x30, 0x30, "Max Bet" ) PORT_DIPLOCATION("DSW2:5,6") /* OK */ + PORT_DIPSETTING( 0x00, "8" ) + PORT_DIPSETTING( 0x10, "16" ) + PORT_DIPSETTING( 0x20, "32" ) + PORT_DIPSETTING( 0x30, "64" ) + PORT_DIPNAME( 0x40, 0x40, "Min. Bet For Bonus Play" ) PORT_DIPLOCATION("DSW2:7") /* OK */ + PORT_DIPSETTING( 0x00, "8" ) + PORT_DIPSETTING( 0x40, "16" ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:8") + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x18, 0x18, "Key In Rate" ) PORT_DIPLOCATION("DSW3:4,5") /* OK */ - PORT_DIPSETTING( 0x00, "1 Coin/40 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x00) /* 8*5 */ - PORT_DIPSETTING( 0x08, "1 Coin/80 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x00) /* 8*10 */ - PORT_DIPSETTING( 0x10, "1 Coin/160 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x00) /* 8*20 */ - PORT_DIPSETTING( 0x18, "1 Coin/400 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x00) /* 8*50 */ - PORT_DIPSETTING( 0x00, "1 Coin/50 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x01) /* 10*5 */ - PORT_DIPSETTING( 0x08, "1 Coin/100 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x01) /* 10*10 */ - PORT_DIPSETTING( 0x10, "1 Coin/200 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x01) /* 10*20 */ - PORT_DIPSETTING( 0x18, "1 Coin/500 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x01) /* 10*50 */ - PORT_DIPSETTING( 0x00, "1 Coin/100 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x02) /* 20*5 */ - PORT_DIPSETTING( 0x08, "1 Coin/200 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x02) /* 20*10 */ - PORT_DIPSETTING( 0x10, "1 Coin/400 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x02) /* 20*20 */ - PORT_DIPSETTING( 0x18, "1 Coin/1,000 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x02) /* 20*50 */ - PORT_DIPSETTING( 0x00, "1 Coin/250 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x03) /* 50*5 */ - PORT_DIPSETTING( 0x08, "1 Coin/500 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x03) /* 50*10 */ - PORT_DIPSETTING( 0x10, "1 Coin/1,000 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x03) /* 50*20 */ - PORT_DIPSETTING( 0x18, "1 Coin/2,500 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x03) /* 50*50 */ - PORT_DIPNAME( 0x20, 0x20, "Coin C Rate" ) PORT_DIPLOCATION("DSW3:6") /* OK */ - PORT_DIPSETTING( 0x00, "1 Coin/40 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x00) /* 8*5 */ - PORT_DIPSETTING( 0x20, "1 Coin/80 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x00) /* 8*10 */ - PORT_DIPSETTING( 0x00, "1 Coin/50 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x01) /* 10*5 */ - PORT_DIPSETTING( 0x20, "1 Coin/100 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x01) /* 10*10 */ - PORT_DIPSETTING( 0x00, "1 Coin/100 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x02) /* 20*5 */ - PORT_DIPSETTING( 0x20, "1 Coin/200 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x02) /* 20*10 */ - PORT_DIPSETTING( 0x00, "1 Coin/250 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x03) /* 50*5 */ - PORT_DIPSETTING( 0x20, "1 Coin/500 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x03) /* 50*10 */ - PORT_DIPNAME( 0x40, 0x40, "Coin B Rate" ) PORT_DIPLOCATION("DSW3:7") /* OK */ - PORT_DIPSETTING( 0x00, "1 Coin/80 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x00) /* 8*10 */ - PORT_DIPSETTING( 0x40, "1 Coin/160 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x00) /* 8*20 */ - PORT_DIPSETTING( 0x00, "1 Coin/100 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x01) /* 10*10 */ - PORT_DIPSETTING( 0x40, "1 Coin/200 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x01) /* 10*20 */ - PORT_DIPSETTING( 0x00, "1 Coin/200 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x02) /* 20*10 */ - PORT_DIPSETTING( 0x40, "1 Coin/400 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x02) /* 20*20 */ - PORT_DIPSETTING( 0x00, "1 Coin/500 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x03) /* 50*10 */ - PORT_DIPSETTING( 0x40, "1 Coin/1,000 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x03) /* 50*20 */ - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:8") + + PORT_START("DSW3") + PORT_DIPNAME( 0x07, 0x00, "Coin A Rate" ) PORT_DIPLOCATION("DSW3:1,2,3") /* OK */ + PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x02, DEF_STR( 1C_4C ) ) + PORT_DIPSETTING( 0x03, DEF_STR( 1C_5C ) ) + PORT_DIPSETTING( 0x04, DEF_STR( 1C_8C ) ) + PORT_DIPSETTING( 0x05, "1 Coin/10 Credits" ) + PORT_DIPSETTING( 0x06, "1 Coin/20 Credits" ) + PORT_DIPSETTING( 0x07, "1 Coin/50 Credits" ) + PORT_DIPNAME( 0x18, 0x00, "Key In Rate" ) PORT_DIPLOCATION("DSW3:4,5") /* OK */ + PORT_DIPSETTING( 0x00, "5x Coin A" ) + PORT_DIPSETTING( 0x08, "10x Coin A" ) + PORT_DIPSETTING( 0x10, "20x Coin A" ) + PORT_DIPSETTING( 0x18, "50x Coin A" ) + PORT_DIPNAME( 0x20, 0x00, "Coin C Rate" ) PORT_DIPLOCATION("DSW3:6") /* OK */ + PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW3",0x07,EQUALS,0x00) /* 1*5 */ + PORT_DIPSETTING( 0x20, "1 Coin/10 Credits" ) PORT_CONDITION("DSW3",0x07,EQUALS,0x00) /* 1*10 */ + PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" ) PORT_CONDITION("DSW3",0x07,EQUALS,0x01) /* 2*5 */ + PORT_DIPSETTING( 0x20, "1 Coin/20 Credits" ) PORT_CONDITION("DSW3",0x07,EQUALS,0x01) /* 2*10 */ + PORT_DIPSETTING( 0x00, "1 Coin/20 Credits" ) PORT_CONDITION("DSW3",0x07,EQUALS,0x02) /* 4*5 */ + PORT_DIPSETTING( 0x20, "1 Coin/40 Credits" ) PORT_CONDITION("DSW3",0x07,EQUALS,0x02) /* 4*10 */ + PORT_DIPSETTING( 0x00, "1 Coin/25 Credits" ) PORT_CONDITION("DSW3",0x07,EQUALS,0x03) /* 5*5 */ + PORT_DIPSETTING( 0x20, "1 Coin/50 Credits" ) PORT_CONDITION("DSW3",0x07,EQUALS,0x03) /* 5*10 */ + PORT_DIPSETTING( 0x00, "1 Coin/40 Credits" ) PORT_CONDITION("DSW3",0x07,EQUALS,0x04) /* 8*5 */ + PORT_DIPSETTING( 0x20, "1 Coin/80 Credits" ) PORT_CONDITION("DSW3",0x07,EQUALS,0x04) /* 8*10 */ + PORT_DIPSETTING( 0x00, "1 Coin/50 Credits" ) PORT_CONDITION("DSW3",0x07,EQUALS,0x05) /* 10*5 */ + PORT_DIPSETTING( 0x20, "1 Coin/100 Credits" ) PORT_CONDITION("DSW3",0x07,EQUALS,0x05) /* 10*10 */ + PORT_DIPSETTING( 0x00, "1 Coin/100 Credits" ) PORT_CONDITION("DSW3",0x07,EQUALS,0x06) /* 20*5 */ + PORT_DIPSETTING( 0x20, "1 Coin/200 Credits" ) PORT_CONDITION("DSW3",0x07,EQUALS,0x06) /* 20*10 */ + PORT_DIPSETTING( 0x00, "1 Coin/250 Credits" ) PORT_CONDITION("DSW3",0x07,EQUALS,0x07) /* 50*5 */ + PORT_DIPSETTING( 0x20, "1 Coin/500 Credits" ) PORT_CONDITION("DSW3",0x07,EQUALS,0x07) /* 50*10 */ + PORT_DIPNAME( 0x40, 0x00, "Coin B Rate" ) PORT_DIPLOCATION("DSW3:7") /* OK */ + PORT_DIPSETTING( 0x00, "1x Coin C" ) + PORT_DIPSETTING( 0x40, "2x Coin C" ) + PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:8") PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_START("DSW4") - PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:1") + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:1") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:2") + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:2") PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:3") + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:3") PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:4") + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:4") PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:5") + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:5") PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:6") + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:6") PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:7") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:7") PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:8") - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, "Cherry/Bell Bonus" ) PORT_DIPLOCATION("DSW4:8") /* OK */ + PORT_DIPSETTING( 0x80, "x6 / x3" ) + PORT_DIPSETTING( 0x00, "x9 / x5" ) INPUT_PORTS_END @@ -5852,7 +5968,7 @@ static INPUT_PORTS_START( crazybon ) PORT_INCLUDE( cmv4_coins ) PORT_MODIFY("IN1") - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* Unused coin switch */ + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) /* Unused coin switch */ PORT_INCLUDE( cmv4_service ) @@ -5860,7 +5976,7 @@ static INPUT_PORTS_START( crazybon ) PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:1") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:2") + PORT_DIPNAME( 0x02, 0x00, "Hopper Out Switch" ) PORT_DIPLOCATION("DSW1:2") /* not checked */ PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x04, 0x00, "Coin Out Rate" ) PORT_DIPLOCATION("DSW1:3") /* OK */ @@ -5891,13 +6007,12 @@ static INPUT_PORTS_START( crazybon ) PORT_DIPSETTING( 0x05, "80%" ) PORT_DIPSETTING( 0x06, "85%" ) PORT_DIPSETTING( 0x07, "90%" ) - PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:4") - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:5") - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x00, "Mode" ) PORT_DIPLOCATION("DSW2:6") + PORT_DIPNAME( 0x18, 0x18, "Hopper Limit" ) PORT_DIPLOCATION("DSW2:4,5") /* not checked */ + PORT_DIPSETTING( 0x18, "300" ) + PORT_DIPSETTING( 0x08, "500" ) + PORT_DIPSETTING( 0x10, "1000" ) + PORT_DIPSETTING( 0x00, "Unlimited" ) + PORT_DIPNAME( 0x20, 0x00, "Mode" ) PORT_DIPLOCATION("DSW2:6") /* OK */ PORT_DIPSETTING( 0x00, "Game" ) PORT_DIPSETTING( 0x20, "Stealth" ) PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:7") @@ -5930,9 +6045,9 @@ static INPUT_PORTS_START( crazybon ) PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:7") PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:8") + PORT_DIPNAME( 0x08, 0x08, "Lock Into Stealth Mode" ) PORT_DIPLOCATION("DSW3:8") /* OK */ PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) /* prevents switching to game mode with start/bet buttons */ PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("DSW4") @@ -5954,10 +6069,10 @@ static INPUT_PORTS_START( crazybon ) PORT_DIPNAME( 0x20, 0x20, "Bonus Min Bet" ) PORT_DIPLOCATION("DSW4:6") /* OK */ PORT_DIPSETTING( 0x20, "16" ) PORT_DIPSETTING( 0x00, "32" ) - PORT_DIPNAME( 0x40, 0x40, "C.M. Reel Speed" ) PORT_DIPLOCATION("DSW4:7") /* OK */ + PORT_DIPNAME( 0x40, 0x40, "Reel Speed" ) PORT_DIPLOCATION("DSW4:7") /* OK */ PORT_DIPSETTING( 0x40, DEF_STR( Low ) ) PORT_DIPSETTING( 0x00, DEF_STR( High ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:8") + PORT_DIPNAME( 0x80, 0x80, "Hopper Out By Coin A" ) PORT_DIPLOCATION("DSW4:8") /* not working */ PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) @@ -5970,18 +6085,17 @@ static INPUT_PORTS_START( crazybon ) PORT_DIPSETTING( 0x04, "5,000" ) PORT_DIPSETTING( 0x02, "10,000" ) PORT_DIPSETTING( 0x00, "20,000" ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:4") - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:5") - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x18, 0x18, "Condition For 3 Fruit Bonus" ) PORT_DIPLOCATION("DSW5:4,5") /* OK */ + PORT_DIPSETTING( 0x18, "5-<-7" ) /* not sure about the "<" ??? */ + PORT_DIPSETTING( 0x10, "5-9-5" ) + PORT_DIPSETTING( 0x08, "5-6-3" ) + PORT_DIPSETTING( 0x00, "5-3-2" ) PORT_DIPNAME( 0x60, 0x60, "Game Min Bet" ) PORT_DIPLOCATION("DSW5:6,7") /* OK */ PORT_DIPSETTING( 0x60, "1" ) PORT_DIPSETTING( 0x40, "8" ) PORT_DIPSETTING( 0x20, "16" ) PORT_DIPSETTING( 0x00, "32" ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:8") + PORT_DIPNAME( 0x80, 0x80, "Card Shuffle Animation" ) PORT_DIPLOCATION("DSW5:8") /* OK */ PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) INPUT_PORTS_END @@ -7145,6 +7259,7 @@ static MACHINE_CONFIG_START( cmast91, goldstar_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) MACHINE_CONFIG_END + INTERRUPT_GEN_MEMBER(wingco_state::masked_irq) { if (m_nmi_enable) @@ -7587,14 +7702,22 @@ static MACHINE_CONFIG_DERIVED( nfm, amcoe2 ) MCFG_GFXDECODE_MODIFY("gfxdecode", nfm) MACHINE_CONFIG_END + +INTERRUPT_GEN_MEMBER(unkch_state::vblank_irq) +{ + if (m_vblank_irq_enable) + device.execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); +} + static MACHINE_CONFIG_START( unkch, unkch_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", Z80, CPU_CLOCK) MCFG_CPU_PROGRAM_MAP(unkch_map) MCFG_CPU_IO_MAP(unkch_portmap) - MCFG_CPU_VBLANK_INT_DRIVER("screen", goldstar_state, nmi_line_pulse) - //MCFG_CPU_VBLANK_INT_DRIVER("screen", goldstar_state, irq0_line_hold) + MCFG_CPU_VBLANK_INT_DRIVER("screen", unkch_state, vblank_irq) + + MCFG_NVRAM_ADD_1FILL("nvram") /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -7609,19 +7732,17 @@ static MACHINE_CONFIG_START( unkch, unkch_state ) MCFG_PALETTE_ADD("palette", 512) MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) - //MCFG_NVRAM_HANDLER(goldstar) - MCFG_VIDEO_START_OVERRIDE(unkch_state, unkch) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_SOUND_ADD("aysnd", AY8910, AY_CLOCK) + MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW1")) + MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW2")) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -// MCFG_SOUND_ADD("aysnd", AY8910, AY_CLOCK) -// -// -// MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW4")) -// MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW3")) -// MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + /* payout hardware */ + MCFG_TICKET_DISPENSER_ADD("tickets", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW) MACHINE_CONFIG_END @@ -12771,6 +12892,9 @@ DRIVER_INIT_MEMBER(cb3_state, cherrys) /* todo: remove these patches! */ DRIVER_INIT_MEMBER(unkch_state, unkch1) { + // game stores $02 at ($D75C) and expects it to change + // possibly expecting stack to grow to this point in NMI handler? + // it does this before enabling vblank irq, so if that's the case there's a missing nmi source UINT8 *ROM = memregion("maincpu")->base(); ROM[0x9d52] = 0x00; ROM[0x9d53] = 0x00; @@ -12778,6 +12902,9 @@ DRIVER_INIT_MEMBER(unkch_state, unkch1) DRIVER_INIT_MEMBER(unkch_state, unkch3) { + // game stores $04 at ($D77F) and expects it to change + // possibly expecting stack to grow to this point in NMI handler? + // it does this before enabling vblank irq, so if that's the case there's a missing nmi source UINT8 *ROM = memregion("maincpu")->base(); ROM[0x9b86] = 0x00; ROM[0x9b87] = 0x00; @@ -12785,6 +12912,9 @@ DRIVER_INIT_MEMBER(unkch_state, unkch3) DRIVER_INIT_MEMBER(unkch_state, unkch4) { + // game stores $02 at ($D75C) and expects it to change + // possibly expecting stack to grow to this point in NMI handler? + // it does this before enabling vblank irq, so if that's the case there's a missing nmi source UINT8 *ROM = memregion("maincpu")->base(); ROM[0x9a6e] = 0x00; ROM[0x9a6f] = 0x00; @@ -13008,10 +13138,10 @@ GAME( 2003, carb2003, nfb96, amcoe2, nfb96bl, driver_device, 0, GAME( 2003, nfm, 0, nfm, nfb96bl, driver_device, 0, ROT0, "Ming-Yang Electronic", "New Fruit Machine (Ming-Yang Electronic)", GAME_NOT_WORKING ) // vFB02-07A "Copyright By Ms. Liu Orchis 2003/03/06" // these have 'cherry 1994' in the program roms, but also "Super Cherry / New Cherry Gold '99" probably hacks of a 1994 version of Cherry Bonus / Cherry Master (Super Cherry Master?) -GAME( 1999, unkch1, 0, unkch, unkch, unkch_state, unkch1, ROT0, "bootleg", "New Cherry Gold '99 (bootleg of Super Cherry Master) (set 1)", GAME_NOT_WORKING|GAME_NO_SOUND ) -GAME( 1999, unkch2, unkch1, unkch, unkch, unkch_state, unkch1, ROT0, "bootleg", "Super Cherry Gold (bootleg of Super Cherry Master)", GAME_NOT_WORKING|GAME_NO_SOUND ) -GAME( 1999, unkch3, unkch1, unkch, unkch3, unkch_state, unkch3, ROT0, "bootleg", "New Cherry Gold '99 (bootleg of Super Cherry Master) (set 2)", GAME_NOT_WORKING|GAME_NO_SOUND ) // cards have been hacked to look like barrels, girl removed? -GAME( 1999, unkch4, unkch1, unkch, unkch4, unkch_state, unkch4, ROT0, "bootleg", "Grand Cherry Master (bootleg of Super Cherry Master)", GAME_NOT_WORKING|GAME_NO_SOUND ) // by 'Toy System' Hungary +GAMEL(1999, unkch1, 0, unkch, unkch, unkch_state, unkch1, ROT0, "bootleg", "New Cherry Gold '99 (bootleg of Super Cherry Master) (set 1)", 0, layout_unkch ) +GAMEL(1999, unkch2, unkch1, unkch, unkch, unkch_state, unkch1, ROT0, "bootleg", "Super Cherry Gold (bootleg of Super Cherry Master)", 0, layout_unkch ) +GAMEL(1999, unkch3, unkch1, unkch, unkch3, unkch_state, unkch3, ROT0, "bootleg", "New Cherry Gold '99 (bootleg of Super Cherry Master) (set 2)", 0, layout_unkch ) // cards have been hacked to look like barrels, girl removed? +GAMEL(1999, unkch4, unkch1, unkch, unkch4, unkch_state, unkch4, ROT0, "bootleg", "Grand Cherry Master (bootleg of Super Cherry Master)", 0, layout_unkch ) // by 'Toy System' Hungary /* Stealth sets. diff --git a/src/mame/drivers/iteagle.c b/src/mame/drivers/iteagle.c index 9cb6ff3e3bb..dfcf369441e 100644 --- a/src/mame/drivers/iteagle.c +++ b/src/mame/drivers/iteagle.c @@ -90,183 +90,180 @@ www.multitech.com #include "emu.h" #include "cpu/mips/mips3.h" -#include "machine/ataintf.h" -#include "video/voodoo.h" +#include "machine/pci.h" +#include "machine/vrc4373.h" +#include "video/voodoo_pci.h" +#include "sound/es1373.h" +#include "machine/iteagle_fpga.h" + +//************************************* +// Main iteagle driver +//************************************* class iteagle_state : public driver_device { public: iteagle_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_voodoo(*this, "voodoo") + m_maincpu(*this, "maincpu") {} - + required_device<mips3_device> m_maincpu; - required_device<device_t> m_voodoo; - DECLARE_DRIVER_INIT(iteagle); - DECLARE_WRITE_LINE_MEMBER(ide_interrupt); - DECLARE_WRITE_LINE_MEMBER(vblank_assert); - UINT32 screen_update_iteagle(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); virtual void machine_start(); + virtual void machine_reset(); }; - -/************************************* - * - * Machine start - * - *************************************/ - void iteagle_state::machine_start() { /* set the fastest DRC options */ m_maincpu->mips3drc_set_options(MIPS3DRC_FASTEST_OPTIONS); } +void iteagle_state::machine_reset() +{ +} +static MACHINE_CONFIG_START( gtfore, iteagle_state ) -/************************************* - * - * Video refresh - * - *************************************/ + /* basic machine hardware */ + MCFG_CPU_ADD("maincpu", VR4310LE, 166666666) + MCFG_MIPS3_ICACHE_SIZE(16384) + MCFG_MIPS3_DCACHE_SIZE(16384) + + MCFG_PCI_ROOT_ADD( ":pci") + MCFG_VRC4373_ADD( ":pci:00.0", ":maincpu") + MCFG_ITEAGLE_FPGA_ADD( ":pci:06.0") + MCFG_ITEAGLE_IDE_ADD( ":pci:06.1") + MCFG_ES1373_ADD( ":pci:07.0") + MCFG_VOODOO_ADD( ":pci:09.0") + MCFG_ITEAGLE_EEPROM_ADD( ":pci:0a.0") -UINT32 iteagle_state::screen_update_iteagle(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) -{ - return voodoo_update(m_voodoo, bitmap, cliprect) ? 0 : UPDATE_HAS_NOT_CHANGED; -} + MCFG_SCREEN_ADD("screen", RASTER) + MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK) + MCFG_SCREEN_REFRESH_RATE(56.644) + MCFG_SCREEN_SIZE(640, 350) + MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 349) + MCFG_SCREEN_UPDATE_DEVICE(":pci:09.0", voodoo_pci_device, screen_update) + +MACHINE_CONFIG_END /************************************* * - * Interrupt handling + * Port definitions * *************************************/ +static INPUT_PORTS_START( iteagle ) + + PORT_START("SW5") + PORT_DIPNAME( 0x3, 0x1, "Resolution" ) + PORT_DIPSETTING(0x1, "Medium" ) + PORT_DIPSETTING(0x0, "Low" ) + PORT_DIPSETTING(0x2, "Low_Alt" ) + PORT_DIPNAME( 0xC, 0x0, "Always" ) + + PORT_START("VERSION") + PORT_DIPNAME( 0x0F00, 0x0000, "GAME" ) + PORT_DIPNAME( 0x00F0, 0x0000, "MAJOR" ) + PORT_DIPNAME( 0x000F, 0x0000, "MINOR" ) + +INPUT_PORTS_END -WRITE_LINE_MEMBER(iteagle_state::ide_interrupt) -{ -} +static INPUT_PORTS_START( gtfore05 ) + PORT_INCLUDE(iteagle) -/************************************* - * - * Main CPU memory handlers - * - *************************************/ + PORT_MODIFY("VERSION") + PORT_DIPNAME( 0x0F00, 0x0400, "GAME" ) + PORT_DIPNAME( 0x00F0, 0x0050, "MAJOR" ) + PORT_DIPNAME( 0x000F, 0x0001, "MINOR" ) -static ADDRESS_MAP_START( main_map, AS_PROGRAM, 32, iteagle_state ) - ADDRESS_MAP_UNMAP_HIGH - AM_RANGE(0x00000000, 0x01ffffff) AM_RAM - // Nile 3 northbridge/PCI controller at 0f000000 - AM_RANGE(0x1fc00000, 0x1fcfffff) AM_ROM AM_REGION("maincpu", 0) AM_SHARE("rombase") -ADDRESS_MAP_END +INPUT_PORTS_END -WRITE_LINE_MEMBER(iteagle_state::vblank_assert) -{ -} +static INPUT_PORTS_START( gtfore04 ) + PORT_INCLUDE(iteagle) -/************************************* - * - * Port definitions - * - *************************************/ + PORT_MODIFY("VERSION") + PORT_DIPNAME( 0x0F00, 0x0400, "GAME" ) + PORT_DIPNAME( 0x00F0, 0x0040, "MAJOR" ) + PORT_DIPNAME( 0x000F, 0x0000, "MINOR" ) -static INPUT_PORTS_START( gtfore ) INPUT_PORTS_END -/************************************* - * - * Machine driver - * - *************************************/ +static INPUT_PORTS_START( gtfore02o ) + PORT_INCLUDE(iteagle) -static MACHINE_CONFIG_START( gtfore, iteagle_state ) + PORT_MODIFY("VERSION") + PORT_DIPNAME( 0x0F00, 0x0400, "GAME" ) + PORT_DIPNAME( 0x00F0, 0x0030, "MAJOR" ) + PORT_DIPNAME( 0x000F, 0x0000, "MINOR" ) - /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", VR4310LE, 166666666) - MCFG_MIPS3_ICACHE_SIZE(16384) - MCFG_MIPS3_DCACHE_SIZE(16384) - MCFG_CPU_PROGRAM_MAP(main_map) - - MCFG_ATA_INTERFACE_ADD("ata", ata_devices, "hdd", NULL, true) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(iteagle_state, ide_interrupt)) +INPUT_PORTS_END - /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) - MCFG_SCREEN_SIZE(320, 240) - MCFG_SCREEN_VISIBLE_AREA(0, 319, 0, 239) - MCFG_SCREEN_UPDATE_DRIVER(iteagle_state, screen_update_iteagle) - - MCFG_DEVICE_ADD("voodoo", VOODOO_BANSHEE, STD_VOODOO_BANSHEE_CLOCK) - MCFG_VOODOO_FBMEM(16) - MCFG_VOODOO_SCREEN_TAG("screen") - MCFG_VOODOO_CPU_TAG("maincpu") - MCFG_VOODOO_VBLANK_CB(WRITELINE(iteagle_state,vblank_assert)) -MACHINE_CONFIG_END +static INPUT_PORTS_START( gtfore02 ) + PORT_INCLUDE(iteagle) + PORT_MODIFY("VERSION") + PORT_DIPNAME( 0x0F00, 0x0400, "GAME" ) + PORT_DIPNAME( 0x00F0, 0x0060, "MAJOR" ) + PORT_DIPNAME( 0x000F, 0x0000, "MINOR" ) +INPUT_PORTS_END /************************************* * * ROM definition(s) * *************************************/ - #define EAGLE_BIOS \ - ROM_REGION( 0x100000, "maincpu", 0 ) /* MIPS code */ \ + ROM_REGION( 0x100000, ":pci:00.0", 0 ) /* MIPS code */ \ ROM_SYSTEM_BIOS( 0, "209", "bootrom 2.09" ) \ - ROM_LOAD( "eagle209.u15", 0x000000, 0x100000, CRC(e0fc1a16) SHA1(c9524f7ee6b95bd484a3b75bcbe2243cb273f84c) ) \ + ROMX_LOAD( "eagle209.u15", 0x000000, 0x100000, CRC(e0fc1a16) SHA1(c9524f7ee6b95bd484a3b75bcbe2243cb273f84c), ROM_BIOS(1) ) \ ROM_SYSTEM_BIOS( 1, "208", "bootrom 2.08" ) \ - ROM_LOAD( "eagle208.u15", 0x000000, 0x100000, CRC(772f2864) SHA1(085063a4e34f29ebe3814823cd2c6323a050da36) ) \ + ROMX_LOAD( "eagle208.u15", 0x000000, 0x100000, CRC(772f2864) SHA1(085063a4e34f29ebe3814823cd2c6323a050da36), ROM_BIOS(2) ) \ ROM_SYSTEM_BIOS( 2, "204", "bootrom 2.04" ) \ - ROM_LOAD( "eagle204.u15", 0x000000, 0x100000, CRC(f02e5523) SHA1(b979cf72a6992f1ecad9695a08c8d51e315ab537) ) \ + ROMX_LOAD( "eagle204.u15", 0x000000, 0x100000, CRC(f02e5523) SHA1(b979cf72a6992f1ecad9695a08c8d51e315ab537), ROM_BIOS(3) ) \ ROM_SYSTEM_BIOS( 3, "201", "bootrom 2.01" ) \ - ROM_LOAD( "eagle201.u15", 0x000000, 0x100000, CRC(e180442b) SHA1(4f50821fed5bcd786d989520aa2559d6c416fb1f) ) \ + ROMX_LOAD( "eagle201.u15", 0x000000, 0x100000, CRC(e180442b) SHA1(4f50821fed5bcd786d989520aa2559d6c416fb1f), ROM_BIOS(4) ) \ ROM_SYSTEM_BIOS( 4, "107", "bootrom 1.07" ) \ - ROM_LOAD( "eagle107.u15", 0x000000, 0x100000, CRC(97a01fc9) SHA1(a421dbf4d097b2f50cc005d3cd0d63e562e03df8) ) \ + ROMX_LOAD( "eagle107.u15", 0x000000, 0x100000, CRC(97a01fc9) SHA1(a421dbf4d097b2f50cc005d3cd0d63e562e03df8), ROM_BIOS(5) ) \ ROM_SYSTEM_BIOS( 5, "106a", "bootrom 1.06a" ) \ - ROM_LOAD( "eagle106a.u15", 0x000000, 0x100000, CRC(9c79b7ad) SHA1(ccf1c86e79d65bee30f399e0fa33a7839570d93b) ) \ + ROMX_LOAD( "eagle106a.u15", 0x000000, 0x100000, CRC(9c79b7ad) SHA1(ccf1c86e79d65bee30f399e0fa33a7839570d93b), ROM_BIOS(6) ) \ ROM_SYSTEM_BIOS( 6, "106", "bootrom 1.06" ) \ - ROM_LOAD( "eagle106.u15", 0x000000, 0x100000, CRC(56bc193d) SHA1(e531d208ef27f777d0784414885f390d1be654b9) ) \ + ROMX_LOAD( "eagle106.u15", 0x000000, 0x100000, CRC(56bc193d) SHA1(e531d208ef27f777d0784414885f390d1be654b9), ROM_BIOS(7) ) \ ROM_SYSTEM_BIOS( 7, "105", "bootrom 1.05" ) \ - ROM_LOAD( "eagle105.u15", 0x000000, 0x100000, CRC(3870dbe0) SHA1(09be2d86c7259cd81d945c757044b167a76f30db) ) \ + ROMX_LOAD( "eagle105.u15", 0x000000, 0x100000, CRC(3870dbe0) SHA1(09be2d86c7259cd81d945c757044b167a76f30db), ROM_BIOS(8) ) \ ROM_SYSTEM_BIOS( 8, "103", "bootrom 1.03" ) \ - ROM_LOAD( "eagle103.u15", 0x000000, 0x100000, CRC(c35f4cf2) SHA1(45301c18c7f8f78754c8ad60ea4d2da5a7dc55fb) ) \ + ROMX_LOAD( "eagle103.u15", 0x000000, 0x100000, CRC(c35f4cf2) SHA1(45301c18c7f8f78754c8ad60ea4d2da5a7dc55fb), ROM_BIOS(9) ) \ ROM_SYSTEM_BIOS( 9, "102", "bootrom 1.02" ) \ - ROM_LOAD( "eagle102.u15", 0x000000, 0x100000, CRC(1fd39e73) SHA1(d1ac758f94defc5c55c62594b3999a406dd9ef1f) ) \ + ROMX_LOAD( "eagle102.u15", 0x000000, 0x100000, CRC(1fd39e73) SHA1(d1ac758f94defc5c55c62594b3999a406dd9ef1f), ROM_BIOS(10) ) \ ROM_SYSTEM_BIOS( 10, "101", "bootrom 1.01" ) \ - ROM_LOAD( "eagle101.u15", 0x000000, 0x100000, CRC(2600bc2b) SHA1(c4b89e69c51e4a3bb1874407c4d30b6caed4f396) ) \ + ROMX_LOAD( "eagle101.u15", 0x000000, 0x100000, CRC(2600bc2b) SHA1(c4b89e69c51e4a3bb1874407c4d30b6caed4f396), ROM_BIOS(11) ) \ ROM_REGION( 0x30000, "fpga", 0 ) \ ROM_LOAD( "17s20lpc_sb4.u26", 0x000000, 0x008000, CRC(62c4af8a) SHA1(6eca277b9c66a401990599e98fdca64a9e38cc9a) ) \ ROM_LOAD( "17s20lpc_sb5.u26", 0x008000, 0x008000, CRC(c88b9d42) SHA1(b912d0fc50ecdc6a198c626f6e1644e8405fac6e) ) \ ROM_LOAD( "17s50a_red1.u26", 0x010000, 0x020000, CRC(f5cf3187) SHA1(83b4a14de9959e5a776d97d424945d43501bda7f) ) \ + ROM_REGION( 0x80, "eeprom", 0 ) \ + ROM_COPY( "fpga", 0x0, 0x0, 0x80 ) \ ROM_REGION( 0x2000, "pals", 0 ) \ ROM_LOAD( "e2-card1.u22.jed", 0x000000, 0x000bd1, CRC(9d1e1ace) SHA1(287d6a30e9f32137ef4eba54f0effa092c97a6eb) ) \ ROM_LOAD( "e2-res3.u117.jed", 0x001000, 0x000bd1, CRC(4f1ff45a) SHA1(213cbdd6cd37ad9b5bfc9545084892a68d29f5ff) ) -/* -17s20lpc_sb4.u26 & 17s20lpc_sb5.u26 are alternate versions of configuration data for GREEN boards only. -17s50a_red1.u26 is configuration data for RED boards only. -*/ - ROM_START( iteagle ) EAGLE_BIOS - DISK_REGION( "ata:0:hdd:image" ) + DISK_REGION( ":pci:06.1:ide:0:hdd:image" ) ROM_END - ROM_START( gtfore02 ) EAGLE_BIOS ROM_REGION( 0x0880, "atmel", 0 ) /* Atmel 90S2313 AVR internal CPU code */ ROM_LOAD( "g42-us-u.u53", 0x0000, 0x0880, CRC(06e0b452) SHA1(f6b865799cb94941e0e77453b9d556d5988b0194) ) - DISK_REGION( "ata:0:hdd:image" ) + DISK_REGION( ":pci:06.1:ide:0:hdd:image" ) DISK_IMAGE( "golf_fore_2002_v2.01.04_umv", 0, SHA1(e902b91bd739daee0b95b10e5cf33700dd63a76b) ) /* Labeled Golf Fore! V2.01.04 UMV */ + //DISK_REGION( "ide:1:cdrom" ) // program CD-ROM + ROM_END ROM_START( gtfore02o ) @@ -275,7 +272,7 @@ ROM_START( gtfore02o ) ROM_REGION( 0x0880, "atmel", 0 ) /* Atmel 90S2313 AVR internal CPU code */ ROM_LOAD( "g42-us-u.u53", 0x0000, 0x0880, CRC(06e0b452) SHA1(f6b865799cb94941e0e77453b9d556d5988b0194) ) - DISK_REGION( "ata:0:hdd:image" ) + DISK_REGION( ":pci:06.1:ide:0:hdd:image" ) DISK_IMAGE( "golf_fore_2002_v2.00.00", 0, SHA1(d789ef86837a5012beb224c487537dd563d93886) ) /* Labeled Golf Fore! 2002 V2.00.00 */ ROM_END @@ -285,7 +282,7 @@ ROM_START( carnking ) ROM_REGION( 0x0880, "atmel", 0 ) /* Atmel 90S2313 AVR internal CPU code */ ROM_LOAD( "ck1-us.u53", 0x0000, 0x0880, NO_DUMP ) - DISK_REGION( "ata:0:hdd:image" ) + DISK_REGION( ":pci:06.1:ide:0:hdd:image" ) DISK_IMAGE( "carnival_king_v_1.00.11", 0, SHA1(c819af66d36df173ab17bf42f4045c7cca3203d8) ) /* Labeled Carnival King V 1.00.11 */ ROM_END @@ -295,7 +292,7 @@ ROM_START( gtfore04 ) ROM_REGION( 0x0880, "atmel", 0 ) /* Atmel 90S2313 AVR internal CPU code */ ROM_LOAD( "g44-us-u.u53", 0x0000, 0x0880, NO_DUMP ) - DISK_REGION( "ata:0:hdd:image" ) + DISK_REGION( ":pci:06.1:ide:0:hdd:image" ) DISK_IMAGE( "gt2004", 0, SHA1(739a52d6ce13bb6ac7a543ee0e8086fb66be19b9) ) ROM_END @@ -305,23 +302,19 @@ ROM_START( gtfore05 ) ROM_REGION( 0x0880, "atmel", 0 ) /* Atmel 90S2313 AVR internal CPU code */ ROM_LOAD( "g45-us-u.u53", 0x0000, 0x0880, NO_DUMP ) - DISK_REGION( "ata:0:hdd:image" ) + DISK_REGION( ":pci:06.1:ide:0:hdd:image" ) DISK_IMAGE( "gt2005", 0, SHA1(d8de569d8cf97b5aaada10ce896eb3c75f1b37f1) ) ROM_END -DRIVER_INIT_MEMBER(iteagle_state, iteagle) -{ -} - /************************************* * * Game driver(s) * *************************************/ -GAME( 2000, iteagle, 0, gtfore, gtfore, iteagle_state, iteagle, ROT0, "Incredible Technologies", "Eagle BIOS", GAME_IS_BIOS_ROOT ) -GAME( 2001, gtfore02, iteagle, gtfore, gtfore, iteagle_state, iteagle, ROT0, "Incredible Technologies", "Golden Tee Fore! 2002 (v2.01.04 UMV)", GAME_NOT_WORKING | GAME_NO_SOUND ) -GAME( 2001, gtfore02o, gtfore02, gtfore, gtfore, iteagle_state, iteagle, ROT0, "Incredible Technologies", "Golden Tee Fore! 2002 (v2.00.00)", GAME_NOT_WORKING | GAME_NO_SOUND ) -GAME( 2002, carnking, iteagle, gtfore, gtfore, iteagle_state, iteagle, ROT0, "Incredible Technologies", "Carnival King (v1.00.11)", GAME_NOT_WORKING | GAME_NO_SOUND ) -GAME( 2003, gtfore04, iteagle, gtfore, gtfore, iteagle_state, iteagle, ROT0, "Incredible Technologies", "Golden Tee Fore! 2004", GAME_NOT_WORKING | GAME_NO_SOUND ) -GAME( 2004, gtfore05, iteagle, gtfore, gtfore, iteagle_state, iteagle, ROT0, "Incredible Technologies", "Golden Tee Fore! 2005", GAME_NOT_WORKING | GAME_NO_SOUND ) +GAME( 2000, iteagle, 0, gtfore, iteagle, driver_device, 0, ROT0, "Incredible Technologies", "Eagle BIOS", GAME_IS_BIOS_ROOT ) +GAME( 2001, gtfore02, iteagle, gtfore, gtfore02, driver_device, 0, ROT0, "Incredible Technologies", "Golden Tee Fore! 2002 (v2.01.04 UMV)", GAME_NOT_WORKING | GAME_NO_SOUND ) +GAME( 2001, gtfore02o, gtfore02, gtfore, gtfore02o, driver_device, 0, ROT0, "Incredible Technologies", "Golden Tee Fore! 2002 (v2.00.00)", GAME_NOT_WORKING | GAME_NO_SOUND ) +GAME( 2002, carnking, iteagle, gtfore, iteagle, driver_device, 0, ROT0, "Incredible Technologies", "Carnival King (v1.00.11)", GAME_NOT_WORKING | GAME_NO_SOUND ) +GAME( 2003, gtfore04, iteagle, gtfore, gtfore04, driver_device, 0, ROT0, "Incredible Technologies", "Golden Tee Fore! 2004", GAME_NOT_WORKING | GAME_NO_SOUND ) +GAME( 2004, gtfore05, iteagle, gtfore, gtfore05, driver_device, 0, ROT0, "Incredible Technologies", "Golden Tee Fore! 2005", GAME_NOT_WORKING | GAME_NO_SOUND ) diff --git a/src/mame/drivers/karnov.c b/src/mame/drivers/karnov.c index 391489ac700..6666d06eb5e 100644 --- a/src/mame/drivers/karnov.c +++ b/src/mame/drivers/karnov.c @@ -215,8 +215,13 @@ void karnov_state::chelnov_i8751_w( int data ) if (data == 0x100 && m_microcontroller_id == CHELNOVJ) /* Japan version */ m_i8751_return = 0x71a; - if (data >= 0x6000 && data < 0x8000) - m_i8751_return = 1; /* patched */ + if ((data & 0xe000) == 0x6000) { + if (data & 0x1000) { + m_i8751_return = ((data & 0x0f) + ((data >> 4) & 0x0f)) * ((data >> 8) & 0x0f); + } else { + m_i8751_return = (data & 0x0f) * (((data >> 8) & 0x0f) + ((data >> 4) & 0x0f)); + } + } if ((data & 0xf000) == 0x1000) m_i8751_level = 1; /* Level 1 */ if ((data & 0xf000) == 0x2000) m_i8751_level++; /* Level Increment */ @@ -1283,7 +1288,6 @@ DRIVER_INIT_MEMBER(karnov_state,chelnov) m_microcontroller_id = CHELNOV; m_coin_mask = 0xe0; - RAM[0x0a26/2] = 0x4e71; /* removes a protection lookup table */ RAM[0x062a/2] = 0x4e71; /* hangs waiting on i8751 int */ } @@ -1293,7 +1297,6 @@ DRIVER_INIT_MEMBER(karnov_state,chelnovu) m_microcontroller_id = CHELNOVU; m_coin_mask = 0xe0; - RAM[0x0a26/2] = 0x4e71; /* removes a protection lookup table */ RAM[0x062a/2] = 0x4e71; /* hangs waiting on i8751 int */ } @@ -1303,7 +1306,6 @@ DRIVER_INIT_MEMBER(karnov_state,chelnovj) m_microcontroller_id = CHELNOVJ; m_coin_mask = 0xe0; - RAM[0x0a2e/2] = 0x4e71; /* removes a protection lookup table */ RAM[0x062a/2] = 0x4e71; /* hangs waiting on i8751 int */ } diff --git a/src/mame/drivers/megaplay.c b/src/mame/drivers/megaplay.c index 86dae7f694d..cd4b74fc988 100644 --- a/src/mame/drivers/megaplay.c +++ b/src/mame/drivers/megaplay.c @@ -742,7 +742,7 @@ ROM_START( mp_col3 ) /* Columns 3 */ MEGAPLAY_BIOS ROM_END -ROM_START( mp_gaxe2 ) /* Golden Axe 2 */ +ROM_START( mp_gaxe2 ) /* Golden Axe 2, revision B */ ROM_REGION( 0x400000, "maincpu", 0 ) ROM_LOAD16_BYTE( "ep15179b.ic2", 0x000000, 0x040000, CRC(00d97b84) SHA1(914bbf566ddf940aab67b92af237d251650ddadf) ) ROM_LOAD16_BYTE( "ep15178b.ic1", 0x000001, 0x040000, CRC(2ea576db) SHA1(6d96b948243533de1f488b1f80e0d5431a4f1f53) ) @@ -755,6 +755,19 @@ ROM_START( mp_gaxe2 ) /* Golden Axe 2 */ MEGAPLAY_BIOS ROM_END +ROM_START( mp_gaxe2a ) /* Golden Axe 2 */ + ROM_REGION( 0x400000, "maincpu", 0 ) + ROM_LOAD16_BYTE( "epr-15179.ic2", 0x000000, 0x040000, CRC(d35f1a35) SHA1(3105cd3b55f65337863703db04527fe298fc04e0) ) + ROM_LOAD16_BYTE( "epr-15178.ic1", 0x000001, 0x040000, CRC(2c6b6b76) SHA1(25577f49ecad451c217da9cacbd78ffca9dca24e) ) + /* Game Instruction rom copied to 0x300000 - 0x310000 (odd / even bytes equal) */ + + ROM_REGION( 0x8000, "user1", 0 ) /* Game Instructions */ + ROM_LOAD( "epr-15175-02.ic3", 0x000000, 0x08000, CRC(cfc87f91) SHA1(110609094aa6d848bec613faa0558db7ad272b77) ) + + ROM_REGION( 0x20000, "mtbios", 0 ) /* Bios */ + MEGAPLAY_BIOS +ROM_END + ROM_START( mp_gslam ) /* Grand Slam */ ROM_REGION( 0x400000, "maincpu", 0 ) ROM_LOAD16_BYTE( "epr-15181.ic2", 0x000000, 0x040000, CRC(642437c1) SHA1(cbf88e196c04b6d886bf9642b69bf165045510fe) ) @@ -928,7 +941,8 @@ didn't have original Sega part numbers it's probably a converted TWC cart /* -- */ GAME( 1993, megaplay, 0, megaplay, megaplay, mplay_state, megaplay, ROT0, "Sega", "Mega Play BIOS", GAME_IS_BIOS_ROOT ) /* 01 */ GAME( 1993, mp_sonic, megaplay, megaplay, mp_sonic, mplay_state, megaplay, ROT0, "Sega", "Sonic The Hedgehog (Mega Play)" , 0 ) -/* 02 */ GAME( 1993, mp_gaxe2, megaplay, megaplay, mp_gaxe2, mplay_state, megaplay, ROT0, "Sega", "Golden Axe II (Mega Play)" , 0 ) +/* 02 */ GAME( 1993, mp_gaxe2, megaplay, megaplay, mp_gaxe2, mplay_state, megaplay, ROT0, "Sega", "Golden Axe II (Mega Play) (Rev B)" , 0 ) +/* 02 */ GAME( 1993, mp_gaxe2a,mp_gaxe2, megaplay, mp_gaxe2, mplay_state, megaplay, ROT0, "Sega", "Golden Axe II (Mega Play)" , 0 ) /* 03 */ GAME( 1993, mp_gslam, megaplay, megaplay, mp_gslam, mplay_state, megaplay, ROT0, "Sega", "Grand Slam (Mega Play)",0 ) /* 04 */ GAME( 1993, mp_twc, megaplay, megaplay, mp_twc, mplay_state, megaplay, ROT0, "Sega", "Tecmo World Cup (Mega Play)" , 0 ) /* 05 */ GAME( 1993, mp_sor2, megaplay, megaplay, mp_sor2, mplay_state, megaplay, ROT0, "Sega", "Streets of Rage II (Mega Play)" , 0 ) diff --git a/src/mame/drivers/megasys1.c b/src/mame/drivers/megasys1.c index c874925a887..f31aad63bc7 100644 --- a/src/mame/drivers/megasys1.c +++ b/src/mame/drivers/megasys1.c @@ -40,7 +40,7 @@ Year + Game System Protection Peek-a-Boo! D Inputs --------------------------------------------------------------------- -NOTE: Chimera Beast is the game game missing a dump of it's priority PROM +NOTE: Chimera Beast is the only game missing a dump of its priority PROM Hardware Main CPU Sound CPU Sound Chips @@ -92,8 +92,8 @@ RAM RW 0f0000-0f3fff 0e0000-0effff? < -------------- - There is a 512 byte PROM in the video section (differs by game) that - controls the priorities. This prom is currently missing for two games, - so we have to use fake data for those two (64th Street & Chimera Beast). + controls the priorities. This prom is currently missing for one game, + so we have to use fake data for it (Chimera Beast). - Making the M6295 status register return 0 fixes the music tempo in avspirit, 64street, astyanax etc. but makes most of the effects in @@ -107,6 +107,11 @@ RAM RW 0f0000-0f3fff 0e0000-0effff? < - 64street: player characters in attract mode doesn't move at all, protection? they move on the real PCB +- tshingen: unemulated mosaic effect when killing enemies with the flashing sword. + See https://youtu.be/m4ZH0v8UqWs + The effect can be tested in e.g. stdragon and p47 test mode: + See https://youtu.be/zo3FTCqkNBc and https://youtu.be/dEqH017YBzw + - Understand a handful of unknown bits in video regs @@ -393,7 +398,7 @@ READ8_MEMBER(megasys1_state::oki_status_2_r) if (m_ignore_oki_status == 1) return 0; else - return m_oki1->read_status(); + return m_oki2->read_status(); } /*************************************************************************** [ Sound CPU - System A ] @@ -4130,8 +4135,8 @@ GAME( 1988, p47, 0, system_A, p47, driver_device, 0, GAME( 1988, p47j, p47, system_A, p47, driver_device, 0, ROT0, "Jaleco", "P-47 - The Freedom Fighter (Japan)", 0 ) GAME( 1988, p47je, p47, system_A, p47, driver_device, 0, ROT0, "Jaleco", "P-47 - The Freedom Fighter (Japan, Export)", 0 ) GAME( 1988, kickoff, 0, system_A, kickoff, driver_device, 0, ROT0, "Jaleco", "Kick Off (Japan)", 0 ) -GAME( 1988, tshingen, 0, system_A, tshingen, megasys1_state, phantasm, ROT0, "Jaleco", "Shingen Samurai-Fighter (Japan, English)", 0 ) -GAME( 1988, tshingena,tshingen, system_A, tshingen, megasys1_state, phantasm, ROT0, "Jaleco", "Takeda Shingen (Japan, Japanese)", 0 ) +GAME( 1988, tshingen, 0, system_A, tshingen, megasys1_state, phantasm, ROT0, "Jaleco", "Shingen Samurai-Fighter (Japan, English)", GAME_IMPERFECT_GRAPHICS ) +GAME( 1988, tshingena,tshingen, system_A, tshingen, megasys1_state, phantasm, ROT0, "Jaleco", "Takeda Shingen (Japan, Japanese)", GAME_IMPERFECT_GRAPHICS ) GAME( 1988, kazan, 0, system_A, kazan, megasys1_state, iganinju, ROT0, "Jaleco", "Ninja Kazan (World)", 0 ) GAME( 1988, iganinju, kazan, system_A, kazan, megasys1_state, iganinju, ROT0, "Jaleco", "Iga Ninjyutsuden (Japan)", 0 ) GAME( 1989, astyanax, 0, system_A, astyanax, megasys1_state, astyanax, ROT0, "Jaleco", "The Astyanax", 0 ) diff --git a/src/mame/drivers/pinball2k.c b/src/mame/drivers/pinball2k.c index 71c16c3f2b1..e523a0fa44f 100644 --- a/src/mame/drivers/pinball2k.c +++ b/src/mame/drivers/pinball2k.c @@ -5,12 +5,11 @@ TODO: - Everything! - - BIOS hangs waiting for port 0400h to return 0x80. If you make that happy it jumps off into the weeds. - MediaGX features should be moved out to machine/ and shared with mediagx.c once we know what these games need Hardware: - - Cyrix MediaGX processor/VGA - - Cyrix CX5520 northbridge? + - Cyrix MediaGX processor/VGA (northbridge) + - Cyrix CX5520 (southbridge) - VS9824AG SuperI/O standard PC I/O chip - 1 ISA, 2 PCI slots, 2 IDE headers - "Prism" PCI card with PLX PCI9052 PCI-to-random stuff bridge @@ -83,6 +82,10 @@ public: DECLARE_WRITE32_MEMBER(ad1847_w); DECLARE_READ8_MEMBER(io20_r); DECLARE_WRITE8_MEMBER(io20_w); + DECLARE_READ32_MEMBER(port400_r); + DECLARE_WRITE32_MEMBER(port400_w); + DECLARE_READ32_MEMBER(port800_r); + DECLARE_WRITE32_MEMBER(port800_w); DECLARE_DRIVER_INIT(pinball2k); virtual void machine_start(); virtual void machine_reset(); @@ -415,6 +418,24 @@ WRITE8_MEMBER(pinball2k_state::io20_w) } } +READ32_MEMBER(pinball2k_state::port400_r) +{ + return 0x8000; +} + +WRITE32_MEMBER(pinball2k_state::port400_w) +{ +} + +READ32_MEMBER(pinball2k_state::port800_r) +{ + return 0x80; +} + +WRITE32_MEMBER(pinball2k_state::port800_w) +{ +} + READ32_MEMBER(pinball2k_state::parallel_port_r) { UINT32 r = 0; @@ -467,6 +488,8 @@ static ADDRESS_MAP_START(mediagx_io, AS_IO, 32, pinball2k_state ) AM_IMPORT_FROM(pcat32_io_common) AM_RANGE(0x00e8, 0x00eb) AM_NOP // I/O delay port AM_RANGE(0x0378, 0x037b) AM_READWRITE(parallel_port_r, parallel_port_w) + AM_RANGE(0x0400, 0x0403) AM_READWRITE(port400_r, port400_w) + AM_RANGE(0x0800, 0x0803) AM_READWRITE(port800_r, port800_w) AM_RANGE(0x0cf8, 0x0cff) AM_DEVREADWRITE("pcibus", pci_bus_legacy_device, read, write) ADDRESS_MAP_END diff --git a/src/mame/drivers/psikyo.c b/src/mame/drivers/psikyo.c index e94c6b2c122..a53c7788fdf 100644 --- a/src/mame/drivers/psikyo.c +++ b/src/mame/drivers/psikyo.c @@ -1406,6 +1406,40 @@ ROM_START( btlkroad ) ROM_END + +ROM_START( btlkroadk ) + + ROM_REGION( 0x100000, "maincpu", 0 ) /* Main CPU Code */ + ROM_LOAD32_WORD_SWAP( "4(dot).u46", 0x000000, 0x040000, CRC(e724d429) SHA1(8b5f80366fd22d6f7e7d8a9623de4fe231303267) ) // 1&0 + ROM_LOAD32_WORD_SWAP( "5(dot).u39", 0x000002, 0x040000, CRC(c0d65765) SHA1(a6a26e6b9693a2ef245e9aaa4c9daa888aebb360)) // 3&2 + + ROM_REGION( 0x020000, "audiocpu", 0 ) /* Sound CPU Code */ + ROM_LOAD( "3(k).u71", 0x00000, 0x20000, CRC(e0f0c597) SHA1(cc337633f1f579baf0f8ba1dd65c5d51122a7e97) ) + + ROM_REGION( 0x700000, "gfx1", 0 ) /* Sprites */ + ROM_LOAD( "u14.bin", 0x000000, 0x200000, CRC(282d89c3) SHA1(3b4b17f4a37efa2f7e232488aaba7c77d10c84d2) ) + ROM_LOAD( "u24.bin", 0x200000, 0x200000, CRC(bbe9d3d1) SHA1(9da0b0b993e8271a8119e9c2f602e52325983f79) ) + ROM_LOAD( "u15.bin", 0x400000, 0x200000, CRC(d4d1b07c) SHA1(232109db8f6e137fbc8826f38a96057067cb19dc) ) +// ROM_LOAD( "u25.bin", 0x600000, 0x100000 NOT PRESENT + + ROM_REGION( 0x200000, "gfx2", 0 ) /* Layers 0 + 1 */ + ROM_LOAD( "u33.bin", 0x000000, 0x200000, CRC(4c8577f1) SHA1(d27043514632954a06667ac63f4a4e4a31870511) ) + + ROM_REGION( 0x100000, "ymsnd", 0 ) /* ADPCM Samples */ + ROM_LOAD( "u56.bin", 0x000000, 0x100000, CRC(51d73682) SHA1(562038d08e9a4389ffa39f3a659b2a29b94dc156) ) + + ROM_REGION( 0x080000, "ymsnd.deltat", 0 ) /* DELTA-T Samples */ + ROM_LOAD( "u64.bin", 0x000000, 0x080000, CRC(0f33049f) SHA1(ca4fd5f3906685ace1af40b75f5678231d7324e8) ) + + ROM_REGION( 0x040000, "spritelut", 0 ) /* Sprites LUT */ + ROM_LOAD( "u3.bin", 0x000000, 0x040000, CRC(30d541ed) SHA1(6f7fb5f5ecbce7c086185392de164ebb6887e780) ) + + ROM_REGION( 0x0400, "plds", 0 ) + ROM_LOAD( "tibpal16l8.u69", 0x0000, 0x0104, NO_DUMP ) /* PAL is read protected */ + ROM_LOAD( "tibpal16l8.u19", 0x0200, 0x0104, NO_DUMP ) /* PAL is read protected */ + +ROM_END + /*************************************************************************** Strikers 1945 (Japan, unprotected) @@ -1956,18 +1990,22 @@ DRIVER_INIT_MEMBER(psikyo_state,s1945bl) ***************************************************************************/ -/* Working Games */ GAME( 1993, samuraia, 0, sngkace, samuraia, psikyo_state, sngkace, ROT270, "Psikyo", "Samurai Aces (World)", GAME_SUPPORTS_SAVE ) // Banpresto? GAME( 1993, sngkace, samuraia, sngkace, sngkace, psikyo_state, sngkace, ROT270, "Psikyo", "Sengoku Ace (Japan)", GAME_SUPPORTS_SAVE ) // Banpresto? + GAME( 1994, gunbird, 0, gunbird, gunbird, psikyo_state, gunbird, ROT270, "Psikyo", "Gunbird (World)", GAME_SUPPORTS_SAVE ) GAME( 1994, gunbirdk, gunbird, gunbird, gunbirdj, psikyo_state, gunbird, ROT270, "Psikyo", "Gunbird (Korea)", GAME_SUPPORTS_SAVE ) GAME( 1994, gunbirdj, gunbird, gunbird, gunbirdj, psikyo_state, gunbird, ROT270, "Psikyo", "Gunbird (Japan)", GAME_SUPPORTS_SAVE ) + GAME( 1994, btlkroad, 0, gunbird, btlkroad, psikyo_state, gunbird, ROT0, "Psikyo", "Battle K-Road", GAME_SUPPORTS_SAVE ) +GAME( 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 + GAME( 1995, s1945, 0, s1945, s1945, psikyo_state, s1945, ROT270, "Psikyo", "Strikers 1945 (World)", GAME_SUPPORTS_SAVE ) GAME( 1995, s1945a, s1945, s1945, s1945a, psikyo_state, s1945a, ROT270, "Psikyo", "Strikers 1945 (Japan / World)", GAME_SUPPORTS_SAVE ) // Region dip - 0x0f=Japan, anything else=World GAME( 1995, s1945j, s1945, s1945, s1945j, psikyo_state, s1945j, ROT270, "Psikyo", "Strikers 1945 (Japan)", GAME_SUPPORTS_SAVE ) GAME( 1995, s1945jn, s1945, gunbird, s1945j, psikyo_state, s1945jn, ROT270, "Psikyo", "Strikers 1945 (Japan, unprotected)", GAME_SUPPORTS_SAVE ) GAME( 1995, s1945k, s1945, s1945, s1945j, psikyo_state, s1945, ROT270, "Psikyo", "Strikers 1945 (Korea)", GAME_SUPPORTS_SAVE ) GAME( 1995, s1945bl, s1945, s1945bl, s1945bl, psikyo_state, s1945bl, ROT270, "bootleg","Strikers 1945 (Hong Kong, bootleg)", GAME_SUPPORTS_SAVE ) + GAME( 1996, tengai, 0, s1945, tengai, psikyo_state, tengai, ROT0, "Psikyo", "Tengai (World)", GAME_SUPPORTS_SAVE ) GAME( 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 diff --git a/src/mame/drivers/queen.c b/src/mame/drivers/queen.c index 25329d10b2a..2c723affe8d 100644 --- a/src/mame/drivers/queen.c +++ b/src/mame/drivers/queen.c @@ -151,9 +151,13 @@ static void intel82439tx_pci_w(device_t *busdevice, device_t *device, int functi static UINT8 piix4_config_r(device_t *busdevice, device_t *device, int function, int reg) { + if ((function >= 4) && (function <= 7)) + { + return 0; // BIOS performs a brute-force scan for devices + } + queen_state *state = busdevice->machine().driver_data<queen_state>(); // osd_printf_debug("PIIX4: read %d, %02X\n", function, reg); - assert(function >= 0 && function < ARRAY_LENGTH(state->m_piix4_config_reg)); return state->m_piix4_config_reg[function][reg]; } diff --git a/src/mame/drivers/re900.c b/src/mame/drivers/re900.c index 748c27d9c62..1c2cb63a56b 100644 --- a/src/mame/drivers/re900.c +++ b/src/mame/drivers/re900.c @@ -87,26 +87,33 @@ class re900_state : public driver_device public: re900_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_rom(*this, "rom"), - m_maincpu(*this, "maincpu") { } + m_maincpu(*this, "maincpu"), + m_rom(*this, "rom") { } + + required_device<cpu_device> m_maincpu; required_shared_ptr<UINT8> m_rom; + + // re900 specific UINT8 m_psg_pa; UINT8 m_psg_pb; UINT8 m_mux_data; UINT8 m_ledant; UINT8 m_player; UINT8 m_stat_a; + + // common DECLARE_READ8_MEMBER(rom_r); DECLARE_WRITE8_MEMBER(cpu_port_0_w); - DECLARE_WRITE8_MEMBER(re900_watchdog_reset_w); + DECLARE_WRITE8_MEMBER(watchdog_reset_w); + + // re900 specific DECLARE_READ8_MEMBER(re_psg_portA_r); DECLARE_READ8_MEMBER(re_psg_portB_r); DECLARE_WRITE8_MEMBER(re_mux_port_A_w); DECLARE_WRITE8_MEMBER(re_mux_port_B_w); - DECLARE_WRITE_LINE_MEMBER(vdp_interrupt); + DECLARE_DRIVER_INIT(re900); - required_device<cpu_device> m_maincpu; }; @@ -219,7 +226,7 @@ WRITE8_MEMBER(re900_state::cpu_port_0_w) // output_set_lamp_value(8,1 ^ ( (data >> 5) & 1)); /* Cont. Ent */ } -WRITE8_MEMBER(re900_state::re900_watchdog_reset_w) +WRITE8_MEMBER(re900_state::watchdog_reset_w) { //watchdog_reset_w(space,0,0); /* To do! */ } @@ -240,19 +247,13 @@ static ADDRESS_MAP_START( mem_io, AS_IO, 8, re900_state ) AM_RANGE(0xe001, 0xe001) AM_DEVWRITE("tms9128", tms9928a_device, register_write) AM_RANGE(0xe800, 0xe801) AM_DEVWRITE("ay_re900", ay8910_device, address_data_w) AM_RANGE(0xe802, 0xe802) AM_DEVREAD("ay_re900", ay8910_device, data_r) - AM_RANGE(0xe000, 0xefff) AM_WRITE(re900_watchdog_reset_w) + AM_RANGE(0xe000, 0xefff) AM_WRITE(watchdog_reset_w) AM_RANGE(MCS51_PORT_P0, MCS51_PORT_P0) AM_WRITE(cpu_port_0_w) AM_RANGE(MCS51_PORT_P2, MCS51_PORT_P2) AM_NOP AM_RANGE(MCS51_PORT_P3, MCS51_PORT_P3) AM_NOP ADDRESS_MAP_END -WRITE_LINE_MEMBER(re900_state::vdp_interrupt) -{ - m_maincpu->set_input_line(INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE ); -} - - /************************ * Input ports * ************************/ @@ -380,7 +381,7 @@ static MACHINE_CONFIG_START( re900, re900_state ) /* video hardware */ MCFG_DEVICE_ADD( "tms9128", TMS9128, XTAL_10_738635MHz / 2 ) /* TMS9128NL on the board */ MCFG_TMS9928A_VRAM_SIZE(0x4000) - MCFG_TMS9928A_OUT_INT_LINE_CB(WRITELINE(re900_state, vdp_interrupt)) + MCFG_TMS9928A_OUT_INT_LINE_CB(INPUTLINE("maincpu", INPUT_LINE_NMI)) MCFG_TMS9928A_SCREEN_ADD_NTSC( "screen" ) MCFG_SCREEN_UPDATE_DEVICE( "tms9128", tms9128_device, screen_update ) @@ -431,6 +432,13 @@ DRIVER_INIT_MEMBER(re900_state,re900) m_player = 1; m_stat_a = 1; m_psg_pa = m_psg_pb = m_mux_data = m_ledant = 0; + + save_item(NAME(m_psg_pa)); + save_item(NAME(m_psg_pb)); + save_item(NAME(m_mux_data)); + save_item(NAME(m_ledant)); + save_item(NAME(m_player)); + save_item(NAME(m_stat_a)); } @@ -439,5 +447,5 @@ DRIVER_INIT_MEMBER(re900_state,re900) *************************/ /* YEAR NAME PARENT MACHINE INPUT INIT ROT COMPANY FULLNAME FLAGS LAYOUT */ -GAMEL( 1993, re900, 0, re900, re900, re900_state, re900, ROT90, "Entretenimientos GEMINIS", "Ruleta RE-900", 0, layout_re900) -GAME ( 1994, bs94 , 0, bs94, bs94 , re900_state, re900, ROT0, "Entretenimientos GEMINIS", "Buena Suerte '94", 0) +GAMEL( 1993, re900, 0, re900, re900, re900_state, re900, ROT90, "Entretenimientos GEMINIS", "Ruleta RE-900", GAME_SUPPORTS_SAVE, layout_re900) +GAME ( 1994, bs94 , 0, bs94, bs94 , driver_device, 0, ROT0, "Entretenimientos GEMINIS", "Buena Suerte '94", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/realbrk.c b/src/mame/drivers/realbrk.c index 9c0ef1a393e..3b8a0eb77f0 100644 --- a/src/mame/drivers/realbrk.c +++ b/src/mame/drivers/realbrk.c @@ -36,7 +36,7 @@ To Do: - Priorities (e.g during the intro, there are two black bands in the backround that should obscure sprites). -- Sometimes sprites are shrinked to end up overlapping the background image +- Sometimes sprites are shrunk to end up overlapping the background image in the tilemaps, but they are a few pixels off ***************************************************************************/ @@ -155,10 +155,10 @@ static ADDRESS_MAP_START( base_mem, AS_PROGRAM, 16, realbrk_state ) AM_RANGE(0x000000, 0x0fffff) AM_ROM // ROM AM_RANGE(0x200000, 0x203fff) AM_RAM AM_SHARE("spriteram") // Sprites AM_RANGE(0x400000, 0x40ffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palette - AM_RANGE(0x600000, 0x601fff) AM_RAM_WRITE(realbrk_vram_0_w) AM_SHARE("vram_0") // Background (0) - AM_RANGE(0x602000, 0x603fff) AM_RAM_WRITE(realbrk_vram_1_w) AM_SHARE("vram_1") // Background (1) - AM_RANGE(0x604000, 0x604fff) AM_RAM_WRITE(realbrk_vram_2_w) AM_SHARE("vram_2") // Text (2) - AM_RANGE(0x606000, 0x60600f) AM_RAM_WRITE(realbrk_vregs_w) AM_SHARE("vregs") // Scroll + Video Regs + AM_RANGE(0x600000, 0x601fff) AM_RAM_WRITE(vram_0_w) AM_SHARE("vram_0") // Background (0) + AM_RANGE(0x602000, 0x603fff) AM_RAM_WRITE(vram_1_w) AM_SHARE("vram_1") // Background (1) + AM_RANGE(0x604000, 0x604fff) AM_RAM_WRITE(vram_2_w) AM_SHARE("vram_2") // Text (2) + AM_RANGE(0x606000, 0x60600f) AM_RAM_WRITE(vregs_w) AM_SHARE("vregs") // Scroll + Video Regs AM_RANGE(0x605000, 0x61ffff) AM_RAM // AM_RANGE(0x800000, 0x800003) AM_DEVREADWRITE8("ymz", ymz280b_device, read, write, 0xff00) // YMZ280 AM_RANGE(0xfe0000, 0xfeffff) AM_RAM // RAM @@ -744,7 +744,7 @@ GFXDECODE_END Billiard Academy Real Break ***************************************************************************/ -INTERRUPT_GEN_MEMBER(realbrk_state::realbrk_interrupt) +INTERRUPT_GEN_MEMBER(realbrk_state::interrupt) { /* VBlank is connected to INT1 (external interrupts pin 1) */ m_tmp68301->external_interrupt_1(); @@ -755,7 +755,7 @@ static MACHINE_CONFIG_START( realbrk, realbrk_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu",M68000, XTAL_32MHz / 2) /* !! TMP68301 !! */ MCFG_CPU_PROGRAM_MAP(realbrk_mem) - MCFG_CPU_VBLANK_INT_DRIVER("screen", realbrk_state, realbrk_interrupt) + MCFG_CPU_VBLANK_INT_DRIVER("screen", realbrk_state, interrupt) MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("tmp68301",tmp68301_device,irq_callback) MCFG_DEVICE_ADD("tmp68301", TMP68301, 0) @@ -767,7 +767,7 @@ static MACHINE_CONFIG_START( realbrk, realbrk_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(0x140, 0xe0) MCFG_SCREEN_VISIBLE_AREA(0, 0x140-1, 0, 0xe0-1) - MCFG_SCREEN_UPDATE_DRIVER(realbrk_state, screen_update_realbrk) + MCFG_SCREEN_UPDATE_DRIVER(realbrk_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", realbrk) @@ -1273,13 +1273,13 @@ ROM_START( dai2kaku_alt_rom_size ) ROM_END #endif -GAME( 1998, pkgnsh, 0, pkgnsh, pkgnsh, driver_device, 0, ROT0, "Nakanihon / Dynax", "Pachinko Gindama Shoubu (Japan)", GAME_IMPERFECT_GRAPHICS ) +GAME( 1998, pkgnsh, 0, pkgnsh, pkgnsh, driver_device, 0, ROT0, "Nakanihon / Dynax", "Pachinko Gindama Shoubu (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) -GAME( 1998, pkgnshdx, 0, pkgnshdx, pkgnshdx, driver_device, 0, ROT0, "Nakanihon / Dynax", "Pachinko Gindama Shoubu DX (Japan)", GAME_IMPERFECT_GRAPHICS ) +GAME( 1998, pkgnshdx, 0, pkgnshdx, pkgnshdx, driver_device, 0, ROT0, "Nakanihon / Dynax", "Pachinko Gindama Shoubu DX (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) -GAME( 1998, realbrk, 0, realbrk, realbrk, driver_device, 0, ROT0, "Nakanihon", "Billiard Academy Real Break (Europe)", GAME_IMPERFECT_GRAPHICS ) -GAME( 1998, realbrko, realbrk, realbrk, realbrk, driver_device, 0, ROT0, "Nakanihon", "Billiard Academy Real Break (Europe, older)", GAME_IMPERFECT_GRAPHICS ) -GAME( 1998, realbrkj, realbrk, realbrk, realbrk, driver_device, 0, ROT0, "Nakanihon", "Billiard Academy Real Break (Japan)", GAME_IMPERFECT_GRAPHICS ) -GAME( 1998, realbrkk, realbrk, realbrk, realbrk, driver_device, 0, ROT0, "Nakanihon", "Billiard Academy Real Break (Korea)", GAME_IMPERFECT_GRAPHICS ) +GAME( 1998, realbrk, 0, realbrk, realbrk, driver_device, 0, ROT0, "Nakanihon", "Billiard Academy Real Break (Europe)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) +GAME( 1998, realbrko, realbrk, realbrk, realbrk, driver_device, 0, ROT0, "Nakanihon", "Billiard Academy Real Break (Europe, older)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) +GAME( 1998, realbrkj, realbrk, realbrk, realbrk, driver_device, 0, ROT0, "Nakanihon", "Billiard Academy Real Break (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) +GAME( 1998, realbrkk, realbrk, realbrk, realbrk, driver_device, 0, ROT0, "Nakanihon", "Billiard Academy Real Break (Korea)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) -GAME( 2004, dai2kaku, 0, dai2kaku, dai2kaku, driver_device, 0, ROT0, "SystemBit", "Dai-Dai-Kakumei (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) +GAME( 2004, dai2kaku, 0, dai2kaku, dai2kaku, driver_device, 0, ROT0, "SystemBit", "Dai-Dai-Kakumei (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/rltennis.c b/src/mame/drivers/rltennis.c index 26019dce032..40f3558cddc 100644 --- a/src/mame/drivers/rltennis.c +++ b/src/mame/drivers/rltennis.c @@ -69,17 +69,17 @@ player - when there's nothing to play - first, empty 2k of ROMs are selected. #define RLT_TIMER_FREQ (RLT_REFRESH_RATE*256) #define RLT_XTAL XTAL_12MHz -READ16_MEMBER(rltennis_state::rlt_io_r) +READ16_MEMBER(rltennis_state::io_r) { return (ioport("P1" )->read()&0x1fff) | (m_unk_counter<<13); /* top 3 bits controls smaple address update */ } -WRITE16_MEMBER(rltennis_state::rlt_snd1_w) +WRITE16_MEMBER(rltennis_state::snd1_w) { COMBINE_DATA(&m_data760000); } -WRITE16_MEMBER(rltennis_state::rlt_snd2_w) +WRITE16_MEMBER(rltennis_state::snd2_w) { COMBINE_DATA(&m_data740000); } @@ -88,15 +88,15 @@ static ADDRESS_MAP_START( rltennis_main, AS_PROGRAM, 16, rltennis_state ) AM_RANGE(0x000000, 0x0fffff) AM_ROM AM_RANGE(0x100000, 0x10ffff) AM_RAM AM_SHARE("nvram") AM_RANGE(0x200000, 0x20ffff) AM_RAM - AM_RANGE(0x700000, 0x70000f) AM_WRITE(rlt_blitter_w) + AM_RANGE(0x700000, 0x70000f) AM_WRITE(blitter_w) AM_RANGE(0x720000, 0x720001) AM_DEVWRITE8("ramdac",ramdac_device,index_w,0x00ff) AM_RANGE(0x720002, 0x720003) AM_DEVREADWRITE8("ramdac",ramdac_device,pal_r,pal_w,0x00ff) AM_RANGE(0x720006, 0x720007) AM_DEVWRITE8("ramdac",ramdac_device,index_r_w,0x00ff) - AM_RANGE(0x740000, 0x740001) AM_WRITE(rlt_snd1_w) - AM_RANGE(0x760000, 0x760001) AM_WRITE(rlt_snd2_w) + AM_RANGE(0x740000, 0x740001) AM_WRITE(snd1_w) + AM_RANGE(0x760000, 0x760001) AM_WRITE(snd2_w) AM_RANGE(0x780000, 0x780001) AM_WRITENOP /* sound control, unknown, usually = 0x0044 */ AM_RANGE(0x7a0000, 0x7a0003) AM_READNOP /* unknown, read only at boot time*/ - AM_RANGE(0x7e0000, 0x7e0001) AM_READ(rlt_io_r) + AM_RANGE(0x7e0000, 0x7e0001) AM_READ(io_r) AM_RANGE(0x7e0002, 0x7e0003) AM_READ_PORT("P2") ADDRESS_MAP_END @@ -144,7 +144,7 @@ TIMER_CALLBACK_MEMBER(rltennis_state::sample_player) m_timer->adjust(attotime::from_hz( RLT_TIMER_FREQ )); } -INTERRUPT_GEN_MEMBER(rltennis_state::rltennis_interrupt) +INTERRUPT_GEN_MEMBER(rltennis_state::interrupt) { ++m_unk_counter; /* frame counter? verify */ device.execute().set_input_line(4, HOLD_LINE); @@ -157,6 +157,14 @@ void rltennis_state::machine_start() m_samples_2 = memregion("samples2")->base(); m_gfx = memregion("gfx1")->base(); m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(rltennis_state::sample_player),this)); + + save_item(NAME(m_data760000)); + save_item(NAME(m_data740000)); + save_item(NAME(m_dac_counter)); + save_item(NAME(m_sample_rom_offset_1)); + save_item(NAME(m_sample_rom_offset_2)); + save_item(NAME(m_offset_shift)); + save_item(NAME(m_unk_counter)); } void rltennis_state::machine_reset() @@ -172,13 +180,13 @@ static MACHINE_CONFIG_START( rltennis, rltennis_state ) MCFG_CPU_ADD("maincpu", M68000, RLT_XTAL/2) /* 68000P8 ??? */ MCFG_CPU_PROGRAM_MAP(rltennis_main) - MCFG_CPU_VBLANK_INT_DRIVER("screen", rltennis_state, rltennis_interrupt) + MCFG_CPU_VBLANK_INT_DRIVER("screen", rltennis_state, interrupt) MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE( RLT_REFRESH_RATE ) MCFG_SCREEN_SIZE(320, 240) MCFG_SCREEN_VISIBLE_AREA(0,319, 0, 239) - MCFG_SCREEN_UPDATE_DRIVER(rltennis_state, screen_update_rltennis) + MCFG_SCREEN_UPDATE_DRIVER(rltennis_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_PALETTE_ADD("palette", 256) @@ -221,4 +229,4 @@ ROM_START( rltennis ) ROM_LOAD( "tennis_3.u52", 0x00000, 0x80000, CRC(517dcd0e) SHA1(b2703e185ee8cf7e115ea07151e7bee8be34948b) ) ROM_END -GAME( 1993, rltennis, 0, rltennis, rltennis, driver_device, 0, ROT0, "TCH", "Reality Tennis", GAME_IMPERFECT_GRAPHICS) +GAME( 1993, rltennis, 0, rltennis, rltennis, driver_device, 0, ROT0, "TCH", "Reality Tennis", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/seta.c b/src/mame/drivers/seta.c index f3f81918fe4..3b2ba24c92d 100644 --- a/src/mame/drivers/seta.c +++ b/src/mame/drivers/seta.c @@ -7695,6 +7695,7 @@ static MACHINE_CONFIG_START( tndrcade, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -7749,6 +7750,7 @@ static MACHINE_CONFIG_START( twineagl, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -7793,7 +7795,8 @@ static MACHINE_CONFIG_START( downtown, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") - + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(57.42) /* verified on pcb */ @@ -7853,7 +7856,8 @@ static MACHINE_CONFIG_START( usclssic, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") - + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -7907,7 +7911,8 @@ static MACHINE_CONFIG_START( calibr50, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") - + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(57.42) /* verified on pcb */ @@ -7950,7 +7955,8 @@ static MACHINE_CONFIG_START( metafox, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") - + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -7988,6 +7994,7 @@ static MACHINE_CONFIG_START( atehate, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -8032,7 +8039,8 @@ static MACHINE_CONFIG_START( blandia, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") - + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -8069,7 +8077,8 @@ static MACHINE_CONFIG_START( blandiap, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") - + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -8111,6 +8120,7 @@ static MACHINE_CONFIG_START( blockcar, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -8185,7 +8195,8 @@ static MACHINE_CONFIG_START( daioh, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") - + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(57.42) /* verified on PCB */ @@ -8223,7 +8234,8 @@ static MACHINE_CONFIG_START( daiohp, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") - + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(57.42) /* verified on PCB */ @@ -8266,7 +8278,8 @@ static MACHINE_CONFIG_START( drgnunit, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") - + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -8303,7 +8316,8 @@ static MACHINE_CONFIG_START( qzkklgy2, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") - + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -8353,7 +8367,8 @@ static MACHINE_CONFIG_START( setaroul, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") - + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) + MCFG_NVRAM_ADD_RANDOM_FILL("nvram") /* video hardware */ @@ -8396,7 +8411,8 @@ static MACHINE_CONFIG_START( eightfrc, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") - + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -8439,7 +8455,8 @@ static MACHINE_CONFIG_START( extdwnhl, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") - + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -8504,7 +8521,8 @@ static MACHINE_CONFIG_START( gundhara, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") - + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -8549,7 +8567,8 @@ static MACHINE_CONFIG_START( jjsquawk, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") - + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -8585,7 +8604,8 @@ static MACHINE_CONFIG_START( jjsquawb, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") - + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -8630,7 +8650,8 @@ static MACHINE_CONFIG_START( kamenrid, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") - + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -8669,6 +8690,7 @@ static MACHINE_CONFIG_START( orbs, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -8711,6 +8733,7 @@ static MACHINE_CONFIG_START( keroppij, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -8752,6 +8775,7 @@ static MACHINE_CONFIG_START( krzybowl, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -8795,7 +8819,8 @@ static MACHINE_CONFIG_START( madshark, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") - + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -8840,7 +8865,8 @@ static MACHINE_CONFIG_START( magspeed, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") - + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -8888,7 +8914,8 @@ static MACHINE_CONFIG_START( msgundam, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") - + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(56.66) /* between 56 and 57 to match a real PCB's game speed */ @@ -8928,7 +8955,8 @@ static MACHINE_CONFIG_START( oisipuzl, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") - + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -8967,7 +8995,8 @@ static MACHINE_CONFIG_START( triplfun, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") - + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -9005,6 +9034,7 @@ static MACHINE_CONFIG_START( kiwame, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -9046,7 +9076,8 @@ static MACHINE_CONFIG_START( rezon, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") - + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -9087,6 +9118,7 @@ static MACHINE_CONFIG_START( thunderl, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -9160,6 +9192,7 @@ static MACHINE_CONFIG_START( wiggie, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -9197,6 +9230,7 @@ static MACHINE_CONFIG_START( wits, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -9235,6 +9269,7 @@ static MACHINE_CONFIG_START( umanclub, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -9277,7 +9312,8 @@ static MACHINE_CONFIG_START( utoukond, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") - + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -9328,7 +9364,8 @@ static MACHINE_CONFIG_START( wrofaero, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") - + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -9373,7 +9410,8 @@ static MACHINE_CONFIG_START( zingzip, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") - + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -9430,6 +9468,7 @@ static MACHINE_CONFIG_START( pairlove, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -9479,7 +9518,8 @@ static MACHINE_CONFIG_START( crazyfgt, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") - + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -9544,7 +9584,8 @@ static MACHINE_CONFIG_START( inttoote, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") - + MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) diff --git a/src/mame/drivers/seta2.c b/src/mame/drivers/seta2.c index d4193425e6f..93d469a6e2a 100644 --- a/src/mame/drivers/seta2.c +++ b/src/mame/drivers/seta2.c @@ -115,6 +115,7 @@ reelquak: #include "machine/ticket.h" #include "machine/mcf5206e.h" + /*************************************************************************** @@ -123,7 +124,7 @@ reelquak: ***************************************************************************/ -WRITE16_MEMBER(seta2_state::seta2_sound_bank_w) +WRITE16_MEMBER(seta2_state::sound_bank_w) { if (ACCESSING_BITS_0_7) { @@ -169,8 +170,8 @@ static ADDRESS_MAP_START( grdians_map, AS_PROGRAM, 16, seta2_state ) AM_RANGE(0xc00000, 0xc3ffff) AM_RAM AM_SHARE("spriteram") // Sprites AM_RANGE(0xc40000, 0xc4ffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palette AM_RANGE(0xc50000, 0xc5ffff) AM_RAM // cleared - AM_RANGE(0xc60000, 0xc6003f) AM_WRITE(seta2_vregs_w) AM_SHARE("vregs") // Video Registers - AM_RANGE(0xe00010, 0xe0001f) AM_WRITE(seta2_sound_bank_w) // Samples Banks + AM_RANGE(0xc60000, 0xc6003f) AM_WRITE(vregs_w) AM_SHARE("vregs") // Video Registers + AM_RANGE(0xe00010, 0xe0001f) AM_WRITE(sound_bank_w) // Samples Banks AM_RANGE(0xfffc00, 0xffffff) AM_DEVREADWRITE("tmp68301", tmp68301_device, regs_r, regs_w) // TMP68301 Registers ADDRESS_MAP_END @@ -207,8 +208,8 @@ static ADDRESS_MAP_START( gundamex_map, AS_PROGRAM, 16, seta2_state ) AM_RANGE(0xc00000, 0xc3ffff) AM_RAM AM_SHARE("spriteram") // Sprites AM_RANGE(0xc40000, 0xc4ffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palette AM_RANGE(0xc50000, 0xc5ffff) AM_RAM // cleared - AM_RANGE(0xc60000, 0xc6003f) AM_WRITE(seta2_vregs_w) AM_SHARE("vregs") // Video Registers - AM_RANGE(0xe00010, 0xe0001f) AM_WRITE(seta2_sound_bank_w) // Samples Banks + AM_RANGE(0xc60000, 0xc6003f) AM_WRITE(vregs_w) AM_SHARE("vregs") // Video Registers + AM_RANGE(0xe00010, 0xe0001f) AM_WRITE(sound_bank_w) // Samples Banks AM_RANGE(0xfffc00, 0xffffff) AM_DEVREADWRITE("tmp68301", tmp68301_device, regs_r, regs_w) // TMP68301 Registers ADDRESS_MAP_END @@ -217,6 +218,11 @@ ADDRESS_MAP_END Wakakusamonogatari Mahjong Yonshimai ***************************************************************************/ +MACHINE_START_MEMBER(seta2_state, mj4simai) +{ + save_item(NAME(m_keyboard_row)); +} + READ16_MEMBER(seta2_state::mj4simai_p1_r) { switch (m_keyboard_row) @@ -260,11 +266,11 @@ static ADDRESS_MAP_START( mj4simai_map, AS_PROGRAM, 16, seta2_state ) AM_RANGE(0x600200, 0x600201) AM_WRITENOP // Leds? Coins? AM_RANGE(0x600300, 0x600301) AM_READ_PORT("DSW1") // DSW 1 AM_RANGE(0x600302, 0x600303) AM_READ_PORT("DSW2") // DSW 2 - AM_RANGE(0x600300, 0x60030f) AM_WRITE(seta2_sound_bank_w) // Samples Banks + AM_RANGE(0x600300, 0x60030f) AM_WRITE(sound_bank_w) // Samples Banks AM_RANGE(0xb00000, 0xb03fff) AM_DEVREADWRITE("x1snd", x1_010_device, word_r, word_w) // Sound AM_RANGE(0xc00000, 0xc3ffff) AM_RAM AM_SHARE("spriteram") // Sprites AM_RANGE(0xc40000, 0xc4ffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palette - AM_RANGE(0xc60000, 0xc6003f) AM_WRITE(seta2_vregs_w) AM_SHARE("vregs") // Video Registers + AM_RANGE(0xc60000, 0xc6003f) AM_WRITE(vregs_w) AM_SHARE("vregs") // Video Registers AM_RANGE(0xfffc00, 0xffffff) AM_DEVREADWRITE("tmp68301", tmp68301_device, regs_r, regs_w) // TMP68301 Registers ADDRESS_MAP_END @@ -283,11 +289,11 @@ static ADDRESS_MAP_START( myangel_map, AS_PROGRAM, 16, seta2_state ) AM_RANGE(0x700200, 0x700201) AM_WRITENOP // Leds? Coins? AM_RANGE(0x700300, 0x700301) AM_READ_PORT("DSW1") // DSW 1 AM_RANGE(0x700302, 0x700303) AM_READ_PORT("DSW2") // DSW 2 - AM_RANGE(0x700310, 0x70031f) AM_WRITE(seta2_sound_bank_w) // Samples Banks + AM_RANGE(0x700310, 0x70031f) AM_WRITE(sound_bank_w) // Samples Banks AM_RANGE(0xb00000, 0xb03fff) AM_DEVREADWRITE("x1snd", x1_010_device, word_r, word_w) // Sound AM_RANGE(0xc00000, 0xc3ffff) AM_RAM AM_SHARE("spriteram") // Sprites AM_RANGE(0xc40000, 0xc4ffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palette - AM_RANGE(0xc60000, 0xc6003f) AM_WRITE(seta2_vregs_w) AM_SHARE("vregs") // Video Registers + AM_RANGE(0xc60000, 0xc6003f) AM_WRITE(vregs_w) AM_SHARE("vregs") // Video Registers AM_RANGE(0xfffc00, 0xffffff) AM_DEVREADWRITE("tmp68301", tmp68301_device, regs_r, regs_w) // TMP68301 Registers ADDRESS_MAP_END @@ -306,11 +312,11 @@ static ADDRESS_MAP_START( myangel2_map, AS_PROGRAM, 16, seta2_state ) AM_RANGE(0x600200, 0x600201) AM_WRITENOP // Leds? Coins? AM_RANGE(0x600300, 0x600301) AM_READ_PORT("DSW1") // DSW 1 AM_RANGE(0x600302, 0x600303) AM_READ_PORT("DSW2") // DSW 2 - AM_RANGE(0x600300, 0x60030f) AM_WRITE(seta2_sound_bank_w) // Samples Banks + AM_RANGE(0x600300, 0x60030f) AM_WRITE(sound_bank_w) // Samples Banks AM_RANGE(0xb00000, 0xb03fff) AM_DEVREADWRITE("x1snd", x1_010_device, word_r, word_w) // Sound AM_RANGE(0xd00000, 0xd3ffff) AM_RAM AM_SHARE("spriteram") // Sprites AM_RANGE(0xd40000, 0xd4ffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palette - AM_RANGE(0xd60000, 0xd6003f) AM_WRITE(seta2_vregs_w) AM_SHARE("vregs") // Video Registers + AM_RANGE(0xd60000, 0xd6003f) AM_WRITE(vregs_w) AM_SHARE("vregs") // Video Registers AM_RANGE(0xfffc00, 0xffffff) AM_DEVREADWRITE("tmp68301", tmp68301_device, regs_r, regs_w) // TMP68301 Registers ADDRESS_MAP_END @@ -346,7 +352,7 @@ static ADDRESS_MAP_START( pzlbowl_map, AS_PROGRAM, 16, seta2_state ) AM_RANGE(0x200000, 0x20ffff) AM_RAM // RAM AM_RANGE(0x400300, 0x400301) AM_READ_PORT("DSW1") // DSW 1 AM_RANGE(0x400302, 0x400303) AM_READ_PORT("DSW2") // DSW 2 - AM_RANGE(0x400300, 0x40030f) AM_WRITE(seta2_sound_bank_w) // Samples Banks + AM_RANGE(0x400300, 0x40030f) AM_WRITE(sound_bank_w) // Samples Banks AM_RANGE(0x500000, 0x500001) AM_READ_PORT("P1") // P1 AM_RANGE(0x500002, 0x500003) AM_READ_PORT("P2") // P2 AM_RANGE(0x500004, 0x500005) AM_READWRITE(pzlbowl_coins_r,pzlbowl_coin_counter_w) // Coins + Protection? @@ -354,7 +360,7 @@ static ADDRESS_MAP_START( pzlbowl_map, AS_PROGRAM, 16, seta2_state ) AM_RANGE(0x700000, 0x700001) AM_READ(pzlbowl_protection_r) // Protection AM_RANGE(0x800000, 0x83ffff) AM_RAM AM_SHARE("spriteram") // Sprites AM_RANGE(0x840000, 0x84ffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palette - AM_RANGE(0x860000, 0x86003f) AM_WRITE(seta2_vregs_w) AM_SHARE("vregs") // Video Registers + AM_RANGE(0x860000, 0x86003f) AM_WRITE(vregs_w) AM_SHARE("vregs") // Video Registers AM_RANGE(0x900000, 0x903fff) AM_DEVREADWRITE("x1snd", x1_010_device, word_r, word_w) // Sound AM_RANGE(0xfffc00, 0xffffff) AM_DEVREADWRITE("tmp68301", tmp68301_device, regs_r, regs_w) // TMP68301 Registers ADDRESS_MAP_END @@ -371,7 +377,7 @@ static ADDRESS_MAP_START( penbros_map, AS_PROGRAM, 16, seta2_state ) AM_RANGE(0x300000, 0x30ffff) AM_RAM // RAM AM_RANGE(0x500300, 0x500301) AM_READ_PORT("DSW1") // DSW 1 AM_RANGE(0x500302, 0x500303) AM_READ_PORT("DSW2") // DSW 2 - AM_RANGE(0x500300, 0x50030f) AM_WRITE(seta2_sound_bank_w) // Samples Banks + AM_RANGE(0x500300, 0x50030f) AM_WRITE(sound_bank_w) // Samples Banks AM_RANGE(0x600000, 0x600001) AM_READ_PORT("P1") // P1 AM_RANGE(0x600002, 0x600003) AM_READ_PORT("P2") // P2 AM_RANGE(0x600004, 0x600005) AM_READ_PORT("SYSTEM") // Coins @@ -380,7 +386,7 @@ static ADDRESS_MAP_START( penbros_map, AS_PROGRAM, 16, seta2_state ) //AM_RANGE(0x700000, 0x700001) AM_READ(pzlbowl_protection_r) // Protection AM_RANGE(0xb00000, 0xb3ffff) AM_RAM AM_SHARE("spriteram") // Sprites AM_RANGE(0xb40000, 0xb4ffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palette - AM_RANGE(0xb60000, 0xb6003f) AM_WRITE(seta2_vregs_w) AM_SHARE("vregs") + AM_RANGE(0xb60000, 0xb6003f) AM_WRITE(vregs_w) AM_SHARE("vregs") AM_RANGE(0xa00000, 0xa03fff) AM_DEVREADWRITE("x1snd", x1_010_device, word_r, word_w) // Sound AM_RANGE(0xfffc00, 0xffffff) AM_DEVREADWRITE("tmp68301", tmp68301_device, regs_r, regs_w) // TMP68301 Registers ADDRESS_MAP_END @@ -435,11 +441,11 @@ static ADDRESS_MAP_START( reelquak_map, AS_PROGRAM, 16, seta2_state ) AM_RANGE(0x400200, 0x400201) AM_WRITE(reelquak_coin_w) // Coin Counters / IRQ Ack AM_RANGE(0x400300, 0x400301) AM_READ_PORT("DSW1") // DSW 1 AM_RANGE(0x400302, 0x400303) AM_READ_PORT("DSW2") // DSW 2 - AM_RANGE(0x400300, 0x40030f) AM_WRITE(seta2_sound_bank_w) // Samples Banks + AM_RANGE(0x400300, 0x40030f) AM_WRITE(sound_bank_w) // Samples Banks AM_RANGE(0xb00000, 0xb03fff) AM_DEVREADWRITE("x1snd", x1_010_device, word_r, word_w) // Sound AM_RANGE(0xc00000, 0xc3ffff) AM_RAM AM_SHARE("spriteram") // Sprites AM_RANGE(0xc40000, 0xc4ffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palette - AM_RANGE(0xc60000, 0xc6003f) AM_WRITE(seta2_vregs_w) AM_SHARE("vregs") // Video Registers + AM_RANGE(0xc60000, 0xc6003f) AM_WRITE(vregs_w) AM_SHARE("vregs") // Video Registers AM_RANGE(0xfffc00, 0xffffff) AM_DEVREADWRITE("tmp68301", tmp68301_device, regs_r, regs_w) // TMP68301 Registers ADDRESS_MAP_END @@ -453,7 +459,7 @@ static ADDRESS_MAP_START( namcostr_map, AS_PROGRAM, 16, seta2_state ) AM_RANGE(0x000000, 0x07ffff) AM_ROM // ROM AM_RANGE(0x200000, 0x20ffff) AM_RAM // RAM AM_RANGE(0xc00000, 0xc3ffff) AM_RAM AM_SHARE("spriteram") // Sprites - AM_RANGE(0xc60000, 0xc6003f) AM_WRITE(seta2_vregs_w) AM_SHARE("vregs") // Video Registers + AM_RANGE(0xc60000, 0xc6003f) AM_WRITE(vregs_w) AM_SHARE("vregs") // Video Registers AM_RANGE(0xfffc00, 0xffffff) AM_DEVREADWRITE("tmp68301", tmp68301_device, regs_r, regs_w) // TMP68301 Registers ADDRESS_MAP_END @@ -483,7 +489,7 @@ static ADDRESS_MAP_START( samshoot_map, AS_PROGRAM, 16, seta2_state ) AM_RANGE( 0x400000, 0x400001 ) AM_READ_PORT("DSW1") // DSW 1 AM_RANGE( 0x400002, 0x400003 ) AM_READ_PORT("BUTTONS") // Buttons - AM_RANGE( 0x400300, 0x40030f ) AM_WRITE(seta2_sound_bank_w ) // Samples Banks + AM_RANGE( 0x400300, 0x40030f ) AM_WRITE(sound_bank_w ) // Samples Banks AM_RANGE( 0x500000, 0x500001 ) AM_READ_PORT("GUN1") // P1 AM_RANGE( 0x580000, 0x580001 ) AM_READ_PORT("GUN2") // P2 @@ -495,7 +501,7 @@ static ADDRESS_MAP_START( samshoot_map, AS_PROGRAM, 16, seta2_state ) AM_RANGE( 0x800000, 0x83ffff ) AM_RAM AM_SHARE("spriteram") // Sprites AM_RANGE( 0x840000, 0x84ffff ) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palette - AM_RANGE( 0x860000, 0x86003f ) AM_WRITE(seta2_vregs_w) AM_SHARE("vregs") // Video Registers + AM_RANGE( 0x860000, 0x86003f ) AM_WRITE(vregs_w) AM_SHARE("vregs") // Video Registers AM_RANGE( 0x900000, 0x903fff ) AM_DEVREADWRITE("x1snd", x1_010_device, word_r, word_w) // Sound @@ -579,6 +585,11 @@ void funcube_touchscreen_device::device_start() emu_timer *tm = timer_alloc(0); tm->adjust(attotime::from_ticks(1, clock()), 0, attotime::from_ticks(1, clock())); m_tx_cb.resolve_safe(); + + save_item(NAME(m_button_state)); + save_item(NAME(m_serial_pos)); + save_item(NAME(m_serial)); + device_serial_interface::register_save_state(machine().save(), this); } void funcube_touchscreen_device::device_reset() @@ -693,7 +704,7 @@ static ADDRESS_MAP_START( funcube_map, AS_PROGRAM, 32, seta2_state ) AM_RANGE( 0x00800000, 0x0083ffff ) AM_READWRITE16(spriteram16_word_r, spriteram16_word_w, 0xffffffff ) AM_SHARE("spriteram") AM_RANGE( 0x00840000, 0x0084ffff ) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palette - AM_RANGE( 0x00860000, 0x0086003f ) AM_WRITE16(seta2_vregs_w, 0xffffffff ) AM_SHARE("vregs") + AM_RANGE( 0x00860000, 0x0086003f ) AM_WRITE16(vregs_w, 0xffffffff ) AM_SHARE("vregs") AM_RANGE( 0x00c00000, 0x00c002ff ) AM_READWRITE(funcube_nvram_dword_r, funcube_nvram_dword_w ) @@ -712,7 +723,7 @@ static ADDRESS_MAP_START( funcube2_map, AS_PROGRAM, 32, seta2_state ) AM_RANGE( 0x00800000, 0x0083ffff ) AM_READWRITE16(spriteram16_word_r, spriteram16_word_w, 0xffffffff ) AM_SHARE("spriteram") AM_RANGE( 0x00840000, 0x0084ffff ) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") - AM_RANGE( 0x00860000, 0x0086003f ) AM_WRITE16(seta2_vregs_w, 0xffffffff ) AM_SHARE("vregs") + AM_RANGE( 0x00860000, 0x0086003f ) AM_WRITE16(vregs_w, 0xffffffff ) AM_SHARE("vregs") AM_RANGE( 0x00c00000, 0x00c002ff ) AM_READWRITE(funcube_nvram_dword_r, funcube_nvram_dword_w ) @@ -2101,16 +2112,14 @@ static MACHINE_CONFIG_START( seta2, seta2_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(0x200, 0x200) MCFG_SCREEN_VISIBLE_AREA(0x40, 0x1c0-1, 0x80, 0x170-1) - MCFG_SCREEN_UPDATE_DRIVER(seta2_state, screen_update_seta2) - MCFG_SCREEN_VBLANK_DRIVER(seta2_state, screen_eof_seta2) + MCFG_SCREEN_UPDATE_DRIVER(seta2_state, screen_update) + MCFG_SCREEN_VBLANK_DRIVER(seta2_state, screen_eof) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", seta2) MCFG_PALETTE_ADD("palette", 0x8000+0xf0) // extra 0xf0 because we might draw 256-color object with 16-color granularity MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB) - MCFG_VIDEO_START_OVERRIDE(seta2_state,seta2) - // sound hardware MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") @@ -2121,12 +2130,8 @@ MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( mj4simai, seta2 ) - MCFG_CPU_MODIFY("maincpu") - MCFG_CPU_PROGRAM_MAP(mj4simai_map) + MCFG_MACHINE_START_OVERRIDE(seta2_state, mj4simai) - // video hardware - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_VISIBLE_AREA(0x40, 0x1c0-1, 0x80, 0x170-1) MACHINE_CONFIG_END @@ -2164,7 +2169,7 @@ static MACHINE_CONFIG_DERIVED( myangel, seta2 ) MCFG_SCREEN_MODIFY("screen") MCFG_SCREEN_VISIBLE_AREA(0, 0x178-1, 0x00, 0xf0-1) - MCFG_VIDEO_START_OVERRIDE(seta2_state,seta2_yoffset) + MCFG_VIDEO_START_OVERRIDE(seta2_state,yoffset) MACHINE_CONFIG_END @@ -2176,7 +2181,7 @@ static MACHINE_CONFIG_DERIVED( myangel2, seta2 ) MCFG_SCREEN_MODIFY("screen") MCFG_SCREEN_VISIBLE_AREA(0, 0x178-1, 0x00, 0xf0-1) - MCFG_VIDEO_START_OVERRIDE(seta2_state,seta2_yoffset) + MCFG_VIDEO_START_OVERRIDE(seta2_state,yoffset) MACHINE_CONFIG_END @@ -2214,7 +2219,7 @@ static MACHINE_CONFIG_DERIVED( reelquak, seta2 ) MCFG_SCREEN_MODIFY("screen") MCFG_SCREEN_VISIBLE_AREA(0x40, 0x180-1, 0x80, 0x170-1) - MCFG_VIDEO_START_OVERRIDE(seta2_state,seta2_xoffset) + MCFG_VIDEO_START_OVERRIDE(seta2_state,xoffset) MACHINE_CONFIG_END @@ -2249,7 +2254,13 @@ TIMER_DEVICE_CALLBACK_MEMBER(seta2_state::funcube_interrupt) m_maincpu->set_input_line(2, HOLD_LINE); } -MACHINE_RESET_MEMBER(seta2_state,funcube) +MACHINE_START_MEMBER(seta2_state, funcube) +{ + save_item(NAME(m_funcube_coin_start_cycles)); + save_item(NAME(m_funcube_hopper_motor)); +} + +MACHINE_RESET_MEMBER(seta2_state, funcube) { m_funcube_coin_start_cycles = 0; m_funcube_hopper_motor = 0; @@ -2272,7 +2283,8 @@ static MACHINE_CONFIG_START( funcube, seta2_state ) MCFG_NVRAM_ADD_0FILL("nvram") - MCFG_MACHINE_RESET_OVERRIDE(seta2_state, funcube ) + MCFG_MACHINE_START_OVERRIDE(seta2_state, funcube) + MCFG_MACHINE_RESET_OVERRIDE(seta2_state, funcube) // video hardware MCFG_SCREEN_ADD("screen", RASTER) @@ -2280,16 +2292,14 @@ static MACHINE_CONFIG_START( funcube, seta2_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) // not accurate MCFG_SCREEN_SIZE(0x200, 0x200) MCFG_SCREEN_VISIBLE_AREA(0x0+1, 0x140-1+1, 0x80, 0x170-1) - MCFG_SCREEN_UPDATE_DRIVER(seta2_state, screen_update_seta2) - MCFG_SCREEN_VBLANK_DRIVER(seta2_state, screen_eof_seta2) + MCFG_SCREEN_UPDATE_DRIVER(seta2_state, screen_update) + MCFG_SCREEN_VBLANK_DRIVER(seta2_state, screen_eof) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", funcube) MCFG_PALETTE_ADD("palette", 0x8000+0xf0) // extra 0xf0 because we might draw 256-color object with 16-color granularity MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB) - MCFG_VIDEO_START_OVERRIDE(seta2_state,seta2) - // sound hardware MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") @@ -2333,16 +2343,14 @@ static MACHINE_CONFIG_START( namcostr, seta2_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(0x200, 0x200) MCFG_SCREEN_VISIBLE_AREA(0x40, 0x1c0-1, 0x80, 0x170-1) - MCFG_SCREEN_UPDATE_DRIVER(seta2_state, screen_update_seta2) - MCFG_SCREEN_VBLANK_DRIVER(seta2_state, screen_eof_seta2) + MCFG_SCREEN_UPDATE_DRIVER(seta2_state, screen_update) + MCFG_SCREEN_VBLANK_DRIVER(seta2_state, screen_eof) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", funcube) MCFG_PALETTE_ADD("palette", 0x8000+0xf0) // extra 0xf0 because we might draw 256-color object with 16-color granularity MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB) - MCFG_VIDEO_START_OVERRIDE(seta2_state,seta2) - // sound hardware MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") diff --git a/src/mame/drivers/srmp2.c b/src/mame/drivers/srmp2.c index 24b260e53a5..85b7be44059 100644 --- a/src/mame/drivers/srmp2.c +++ b/src/mame/drivers/srmp2.c @@ -69,48 +69,81 @@ Note: ***************************************************************************/ -MACHINE_START_MEMBER(srmp2_state,srmp2) +void srmp2_state::machine_start() { - iox_t &iox = m_iox; + save_item(NAME(m_adpcm_bank)); + save_item(NAME(m_adpcm_data)); + save_item(NAME(m_adpcm_sptr)); + save_item(NAME(m_adpcm_eptr)); + save_item(NAME(m_iox.mux)); + save_item(NAME(m_iox.ff)); + save_item(NAME(m_iox.data)); +} - iox.reset = 0x1f; - iox.ff_event = -1; - iox.ff_1 = 0x00; +MACHINE_START_MEMBER(srmp2_state,srmp2) +{ + machine_start(); + + m_iox.reset = 0x1f; + m_iox.ff_event = -1; + m_iox.ff_1 = 0x00; /* note: protection in srmp1/mjyuugi/ponchin is never checked, assume to be the same */ - iox.protcheck[0] = 0x60; iox.protlatch[0] = 0x2a; - iox.protcheck[1] = -1; iox.protlatch[1] = -1; - iox.protcheck[2] = -1; iox.protlatch[2] = -1; - iox.protcheck[3] = -1; iox.protlatch[3] = -1; + m_iox.protcheck[0] = 0x60; m_iox.protlatch[0] = 0x2a; + m_iox.protcheck[1] = -1; m_iox.protlatch[1] = -1; + m_iox.protcheck[2] = -1; m_iox.protlatch[2] = -1; + m_iox.protcheck[3] = -1; m_iox.protlatch[3] = -1; + + save_item(NAME(m_color_bank)); } MACHINE_START_MEMBER(srmp2_state,srmp3) { - iox_t &iox = m_iox; - - iox.reset = 0xc8; - iox.ff_event = 0xef; - iox.ff_1 = -1; - iox.protcheck[0] = 0x49; iox.protlatch[0] = 0xc9; - iox.protcheck[1] = 0x4c; iox.protlatch[1] = 0x00; - iox.protcheck[2] = 0x1c; iox.protlatch[2] = 0x04; - iox.protcheck[3] = 0x45; iox.protlatch[3] = 0x00; + machine_start(); + + m_iox.reset = 0xc8; + m_iox.ff_event = 0xef; + m_iox.ff_1 = -1; + m_iox.protcheck[0] = 0x49; m_iox.protlatch[0] = 0xc9; + m_iox.protcheck[1] = 0x4c; m_iox.protlatch[1] = 0x00; + m_iox.protcheck[2] = 0x1c; m_iox.protlatch[2] = 0x04; + m_iox.protcheck[3] = 0x45; m_iox.protlatch[3] = 0x00; membank("bank1")->configure_entries(0, 16, memregion("maincpu")->base(), 0x2000); + + save_item(NAME(m_gfx_bank)); } MACHINE_START_MEMBER(srmp2_state,rmgoldyh) { - iox_t &iox = m_iox; - - iox.reset = 0xc8; - iox.ff_event = 0xff; - iox.ff_1 = -1; - iox.protcheck[0] = 0x43; iox.protlatch[0] = 0x9a; - iox.protcheck[1] = 0x45; iox.protlatch[1] = 0x00; - iox.protcheck[2] = -1; iox.protlatch[2] = -1; - iox.protcheck[3] = -1; iox.protlatch[3] = -1; + machine_start(); + + m_iox.reset = 0xc8; + m_iox.ff_event = 0xff; + m_iox.ff_1 = -1; + m_iox.protcheck[0] = 0x43; m_iox.protlatch[0] = 0x9a; + m_iox.protcheck[1] = 0x45; m_iox.protlatch[1] = 0x00; + m_iox.protcheck[2] = -1; m_iox.protlatch[2] = -1; + m_iox.protcheck[3] = -1; m_iox.protlatch[3] = -1; membank("bank1")->configure_entries(0, 32, memregion("maincpu")->base(), 0x2000); + + save_item(NAME(m_gfx_bank)); +} + +MACHINE_START_MEMBER(srmp2_state,mjyuugi) +{ + machine_start(); + + m_iox.reset = 0x1f; + m_iox.ff_event = -1; + m_iox.ff_1 = 0x00; + /* note: protection in srmp1/mjyuugi/ponchin is never checked, assume to be the same */ + m_iox.protcheck[0] = 0x60; m_iox.protlatch[0] = 0x2a; + m_iox.protcheck[1] = -1; m_iox.protlatch[1] = -1; + m_iox.protcheck[2] = -1; m_iox.protlatch[2] = -1; + m_iox.protcheck[3] = -1; m_iox.protlatch[3] = -1; + + save_item(NAME(m_gfx_bank)); } /*************************************************************************** @@ -207,7 +240,7 @@ WRITE8_MEMBER(srmp2_state::srmp3_adpcm_code_w) } -WRITE_LINE_MEMBER(srmp2_state::srmp2_adpcm_int) +WRITE_LINE_MEMBER(srmp2_state::adpcm_int) { UINT8 *ROM = memregion("adpcm")->base(); @@ -270,32 +303,30 @@ UINT8 srmp2_state::iox_key_matrix_calc(UINT8 p_side) READ8_MEMBER(srmp2_state::iox_mux_r) { - iox_t &iox = m_iox; - /* first off check any pending protection value */ { int i; for(i=0;i<4;i++) { - if(iox.protcheck[i] == -1) + if(m_iox.protcheck[i] == -1) continue; //skip - if(iox.data == iox.protcheck[i]) + if(m_iox.data == m_iox.protcheck[i]) { - iox.data = 0; //clear write latch - return iox.protlatch[i]; + m_iox.data = 0; //clear write latch + return m_iox.protlatch[i]; } } } - if(iox.ff == 0) + if(m_iox.ff == 0) { - if(iox.mux != 1 && iox.mux != 2 && iox.mux != 4) + if(m_iox.mux != 1 && m_iox.mux != 2 && m_iox.mux != 4) return 0xff; //unknown command /* both side checks */ - if(iox.mux == 1) + if(m_iox.mux == 1) { UINT8 p1_side = iox_key_matrix_calc(0); UINT8 p2_side = iox_key_matrix_calc(4); @@ -307,7 +338,7 @@ READ8_MEMBER(srmp2_state::iox_mux_r) } /* check individual input side */ - return iox_key_matrix_calc((iox.mux == 2) ? 0 : 4); + return iox_key_matrix_calc((m_iox.mux == 2) ? 0 : 4); } return ioport("SERVICE")->read() & 0xff; @@ -320,7 +351,6 @@ READ8_MEMBER(srmp2_state::iox_status_r) WRITE8_MEMBER(srmp2_state::iox_command_w) { - iox_t &iox = m_iox; /* bit wise command port apparently 0x01: selects both sides @@ -328,23 +358,22 @@ WRITE8_MEMBER(srmp2_state::iox_command_w) 0x04: selects p2 side */ - iox.mux = data; - iox.ff = 0; // this also set flip flop back to 0 + m_iox.mux = data; + m_iox.ff = 0; // this also set flip flop back to 0 } WRITE8_MEMBER(srmp2_state::iox_data_w) { - iox_t &iox = m_iox; - iox.data = data; + m_iox.data = data; - if(data == iox.reset && iox.reset != -1) //resets device - iox.ff = 0; + if(data == m_iox.reset && m_iox.reset != -1) //resets device + m_iox.ff = 0; - if(data == iox.ff_event && iox.ff_event != -1) // flip flop event - iox.ff ^= 1; + if(data == m_iox.ff_event && m_iox.ff_event != -1) // flip flop event + m_iox.ff ^= 1; - if(data == iox.ff_1 && iox.ff_1 != -1) // set flip flop to 1 - iox.ff = 1; + if(data == m_iox.ff_1 && m_iox.ff_1 != -1) // set flip flop to 1 + m_iox.ff = 1; } WRITE8_MEMBER(srmp2_state::srmp3_rombank_w) @@ -1163,7 +1192,7 @@ static MACHINE_CONFIG_START( srmp2, srmp2_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) MCFG_SOUND_ADD("msm", MSM5205, 384000) - MCFG_MSM5205_VCLK_CB(WRITELINE(srmp2_state, srmp2_adpcm_int)) /* IRQ handler */ + MCFG_MSM5205_VCLK_CB(WRITELINE(srmp2_state, adpcm_int)) /* IRQ handler */ MCFG_MSM5205_PRESCALER_SELECTOR(MSM5205_S48_4B) /* 8 KHz, 4 Bits */ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.45) MACHINE_CONFIG_END @@ -1185,6 +1214,7 @@ static MACHINE_CONFIG_START( srmp3, srmp2_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") + MCFG_SETA001_SPRITE_GFXBANK_CB(srmp2_state, srmp3_gfxbank_callback) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -1210,7 +1240,7 @@ static MACHINE_CONFIG_START( srmp3, srmp2_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) MCFG_SOUND_ADD("msm", MSM5205, 384000) - MCFG_MSM5205_VCLK_CB(WRITELINE(srmp2_state, srmp2_adpcm_int)) /* IRQ handler */ + MCFG_MSM5205_VCLK_CB(WRITELINE(srmp2_state, adpcm_int)) /* IRQ handler */ MCFG_MSM5205_PRESCALER_SELECTOR(MSM5205_S48_4B) /* 8 KHz, 4 Bits */ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.45) MACHINE_CONFIG_END @@ -1232,13 +1262,14 @@ static MACHINE_CONFIG_START( mjyuugi, srmp2_state ) MCFG_CPU_VBLANK_INT_DRIVER("screen", srmp2_state, irq4_line_assert) MCFG_CPU_PERIODIC_INT_DRIVER(srmp2_state, irq2_line_assert, 15*60) /* Interrupt times is not understood */ - MCFG_MACHINE_START_OVERRIDE(srmp2_state,srmp2) + MCFG_MACHINE_START_OVERRIDE(srmp2_state,mjyuugi) MCFG_NVRAM_ADD_0FILL("nvram") MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") + MCFG_SETA001_SPRITE_GFXBANK_CB(srmp2_state, srmp3_gfxbank_callback) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -1262,7 +1293,7 @@ static MACHINE_CONFIG_START( mjyuugi, srmp2_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) MCFG_SOUND_ADD("msm", MSM5205, 384000) - MCFG_MSM5205_VCLK_CB(WRITELINE(srmp2_state, srmp2_adpcm_int)) /* IRQ handler */ + MCFG_MSM5205_VCLK_CB(WRITELINE(srmp2_state, adpcm_int)) /* IRQ handler */ MCFG_MSM5205_PRESCALER_SELECTOR(MSM5205_S48_4B) /* 8 KHz, 4 Bits */ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.45) MACHINE_CONFIG_END @@ -1537,11 +1568,11 @@ ROM_END -GAME( 1987, srmp1, 0, srmp2, srmp2, driver_device, 0, ROT0, "Seta", "Super Real Mahjong Part 1 (Japan)", 0 ) -GAME( 1987, srmp2, 0, srmp2, srmp2, driver_device, 0, ROT0, "Seta", "Super Real Mahjong Part 2 (Japan)", 0 ) -GAME( 1988, srmp3, 0, srmp3, srmp3, driver_device, 0, ROT0, "Seta", "Super Real Mahjong Part 3 (Japan)", 0 ) -GAME( 1988, rmgoldyh, srmp3, rmgoldyh, rmgoldyh, driver_device, 0, ROT0, "Seta (Alba license)", "Real Mahjong Gold Yumehai / Super Real Mahjong GOLD part.2 [BET] (Japan)", 0 ) -GAME( 1990, mjyuugi, 0, mjyuugi, mjyuugi, driver_device, 0, ROT0, "Visco", "Mahjong Yuugi (Japan set 1)", 0 ) -GAME( 1990, mjyuugia, mjyuugi, mjyuugi, mjyuugi, driver_device, 0, ROT0, "Visco", "Mahjong Yuugi (Japan set 2)", 0 ) -GAME( 1991, ponchin, 0, mjyuugi, ponchin, driver_device, 0, ROT0, "Visco", "Mahjong Pon Chin Kan (Japan set 1)", 0 ) -GAME( 1991, ponchina, ponchin, mjyuugi, ponchin, driver_device, 0, ROT0, "Visco", "Mahjong Pon Chin Kan (Japan set 2)", 0 ) +GAME( 1987, srmp1, 0, srmp2, srmp2, driver_device, 0, ROT0, "Seta", "Super Real Mahjong Part 1 (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1987, srmp2, 0, srmp2, srmp2, driver_device, 0, ROT0, "Seta", "Super Real Mahjong Part 2 (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1988, srmp3, 0, srmp3, srmp3, driver_device, 0, ROT0, "Seta", "Super Real Mahjong Part 3 (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1988, rmgoldyh, srmp3, rmgoldyh, rmgoldyh, driver_device, 0, ROT0, "Seta (Alba license)", "Real Mahjong Gold Yumehai / Super Real Mahjong GOLD part.2 [BET] (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1990, mjyuugi, 0, mjyuugi, mjyuugi, driver_device, 0, ROT0, "Visco", "Mahjong Yuugi (Japan set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1990, mjyuugia, mjyuugi, mjyuugi, mjyuugi, driver_device, 0, ROT0, "Visco", "Mahjong Yuugi (Japan set 2)", GAME_SUPPORTS_SAVE ) +GAME( 1991, ponchin, 0, mjyuugi, ponchin, driver_device, 0, ROT0, "Visco", "Mahjong Pon Chin Kan (Japan set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1991, ponchina, ponchin, mjyuugi, ponchin, driver_device, 0, ROT0, "Visco", "Mahjong Pon Chin Kan (Japan set 2)", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/ssrj.c b/src/mame/drivers/ssrj.c index 24c4a937063..b4282c1b9a2 100644 --- a/src/mame/drivers/ssrj.c +++ b/src/mame/drivers/ssrj.c @@ -21,8 +21,8 @@ HW info : f800 ?? Scroll RAM contains x and y offsets for each tileline, - as well as other data (priroities ? additional flags ?) - All moving obejcts (cars, etc) are displayed on tilemap 3. + as well as other data (priorities ? additional flags ?) + All moving objects (cars, etc) are displayed on tilemap 3. ------------------------------------ Cheat : $e210 - timer @@ -34,6 +34,11 @@ HW info : #include "sound/ay8910.h" #include "includes/ssrj.h" +void ssrj_state::machine_start() +{ + save_item(NAME(m_oldport)); +} + void ssrj_state::machine_reset() { UINT8 *rom = memregion("maincpu")->base(); @@ -42,7 +47,7 @@ void ssrj_state::machine_reset() m_oldport = 0x80; } -READ8_MEMBER(ssrj_state::ssrj_wheel_r) +READ8_MEMBER(ssrj_state::wheel_r) { int port = ioport("IN1")->read() - 0x80; int retval = port - m_oldport; @@ -53,14 +58,14 @@ READ8_MEMBER(ssrj_state::ssrj_wheel_r) static ADDRESS_MAP_START( ssrj_map, AS_PROGRAM, 8, ssrj_state ) AM_RANGE(0x0000, 0x7fff) AM_ROM - AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(ssrj_vram1_w) AM_SHARE("vram1") - AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(ssrj_vram2_w) AM_SHARE("vram2") + AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(vram1_w) AM_SHARE("vram1") + AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(vram2_w) AM_SHARE("vram2") AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_SHARE("vram3") - AM_RANGE(0xd800, 0xdfff) AM_RAM_WRITE(ssrj_vram4_w) AM_SHARE("vram4") + AM_RANGE(0xd800, 0xdfff) AM_RAM_WRITE(vram4_w) AM_SHARE("vram4") AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_RANGE(0xe800, 0xefff) AM_RAM AM_SHARE("scrollram") AM_RANGE(0xf000, 0xf000) AM_READ_PORT("IN0") - AM_RANGE(0xf001, 0xf001) AM_READ(ssrj_wheel_r) + AM_RANGE(0xf001, 0xf001) AM_READ(wheel_r) AM_RANGE(0xf002, 0xf002) AM_READ_PORT("IN2") AM_RANGE(0xf003, 0xf003) AM_WRITENOP /* unknown */ AM_RANGE(0xf401, 0xf401) AM_DEVREAD("aysnd", ay8910_device, data_r) @@ -141,8 +146,8 @@ static MACHINE_CONFIG_START( ssrj, ssrj_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(40*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 34*8-1, 1*8, 31*8-1) // unknown res - MCFG_SCREEN_UPDATE_DRIVER(ssrj_state, screen_update_ssrj) - MCFG_SCREEN_VBLANK_DRIVER(ssrj_state, screen_eof_ssrj) + MCFG_SCREEN_UPDATE_DRIVER(ssrj_state, screen_update) + MCFG_SCREEN_VBLANK_DRIVER(ssrj_state, screen_eof) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", ssrj) @@ -179,4 +184,4 @@ ROM_START( ssrj ) ROM_END -GAME( 1985, ssrj, 0, ssrj, ssrj, driver_device, 0, ROT90, "Taito Corporation", "Super Speed Race Junior (Japan)",GAME_WRONG_COLORS|GAME_IMPERFECT_GRAPHICS ) +GAME( 1985, ssrj, 0, ssrj, ssrj, driver_device, 0, ROT90, "Taito Corporation", "Super Speed Race Junior (Japan)", GAME_WRONG_COLORS | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/sstrangr.c b/src/mame/drivers/sstrangr.c index bd2158535c0..e30b534f7ad 100644 --- a/src/mame/drivers/sstrangr.c +++ b/src/mame/drivers/sstrangr.c @@ -18,16 +18,21 @@ class sstrangr_state : public driver_device public: sstrangr_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_ram(*this, "ram"), - m_maincpu(*this, "maincpu") { } + m_maincpu(*this, "maincpu"), + m_ram(*this, "ram") { } + + required_device<cpu_device> m_maincpu; required_shared_ptr<UINT8> m_ram; + UINT8 m_flip_screen; - UINT8 *m_proms; + DECLARE_WRITE8_MEMBER(port_w); + + virtual void video_start(); + UINT32 screen_update_sstrangr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); UINT32 screen_update_sstrngr2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - required_device<cpu_device> m_maincpu; }; @@ -38,6 +43,11 @@ public: * *************************************/ +void sstrangr_state::video_start() +{ + save_item(NAME(m_flip_screen)); +} + UINT32 sstrangr_state::screen_update_sstrangr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { offs_t offs; @@ -296,5 +306,5 @@ ROM_START( sstrangr2 ) ROM_END -GAMEL( 1978, sstrangr, 0, sstrangr, sstrangr, driver_device, 0, ROT270, "Yachiyo Electronics, Ltd.", "Space Stranger", GAME_NO_SOUND, layout_sstrangr ) -GAME( 1979, sstrangr2,sstrangr, sstrngr2, sstrngr2, driver_device, 0, ROT270, "Yachiyo Electronics, Ltd.", "Space Stranger 2", GAME_NO_SOUND ) +GAMEL( 1978, sstrangr, 0, sstrangr, sstrangr, driver_device, 0, ROT270, "Yachiyo Electronics, Ltd.", "Space Stranger", GAME_NO_SOUND | GAME_SUPPORTS_SAVE, layout_sstrangr ) +GAME( 1979, sstrangr2,sstrangr, sstrngr2, sstrngr2, driver_device, 0, ROT270, "Yachiyo Electronics, Ltd.", "Space Stranger 2", GAME_NO_SOUND | GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/sub.c b/src/mame/drivers/sub.c index d9b807cdc12..11a3100c313 100644 --- a/src/mame/drivers/sub.c +++ b/src/mame/drivers/sub.c @@ -119,39 +119,45 @@ class sub_state : public driver_device public: sub_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_soundcpu(*this, "soundcpu"), + m_gfxdecode(*this, "gfxdecode"), + m_palette(*this, "palette"), m_attr(*this, "attr"), m_vid(*this, "vid"), m_spriteram(*this, "spriteram"), m_spriteram2(*this, "spriteram2"), - m_scrolly(*this, "scrolly"), - m_maincpu(*this, "maincpu"), - m_soundcpu(*this, "soundcpu"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") { } + m_scrolly(*this, "scrolly") { } + + required_device<cpu_device> m_maincpu; + required_device<cpu_device> m_soundcpu; + required_device<gfxdecode_device> m_gfxdecode; + required_device<palette_device> m_palette; required_shared_ptr<UINT8> m_attr; required_shared_ptr<UINT8> m_vid; required_shared_ptr<UINT8> m_spriteram; required_shared_ptr<UINT8> m_spriteram2; required_shared_ptr<UINT8> m_scrolly; + UINT8 m_nmi_en; - DECLARE_WRITE8_MEMBER(subm_to_sound_w); + + DECLARE_WRITE8_MEMBER(to_sound_w); DECLARE_WRITE8_MEMBER(nmi_mask_w); - virtual void video_start(); + + virtual void machine_start(); DECLARE_PALETTE_INIT(sub); - UINT32 screen_update_sub(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - INTERRUPT_GEN_MEMBER(subm_sound_irq); - required_device<cpu_device> m_maincpu; - required_device<cpu_device> m_soundcpu; - required_device<gfxdecode_device> m_gfxdecode; - required_device<palette_device> m_palette; + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + INTERRUPT_GEN_MEMBER(sound_irq); }; -void sub_state::video_start() +void sub_state::machine_start() { + save_item(NAME(m_nmi_en)); } -UINT32 sub_state::screen_update_sub(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 sub_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { gfx_element *gfx = m_gfxdecode->gfx(0); gfx_element *gfx_1 = m_gfxdecode->gfx(1); @@ -255,7 +261,7 @@ static ADDRESS_MAP_START( subm_map, AS_PROGRAM, 8, sub_state ) AM_RANGE(0xf060, 0xf060) AM_READ_PORT("IN0") ADDRESS_MAP_END -WRITE8_MEMBER(sub_state::subm_to_sound_w) +WRITE8_MEMBER(sub_state::to_sound_w) { soundlatch_byte_w(space, 0, data & 0xff); m_soundcpu->set_input_line(0, HOLD_LINE); @@ -268,7 +274,7 @@ WRITE8_MEMBER(sub_state::nmi_mask_w) static ADDRESS_MAP_START( subm_io, AS_IO, 8, sub_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) - AM_RANGE(0x00, 0x00) AM_READ(soundlatch2_byte_r) AM_WRITE(subm_to_sound_w) // to/from sound CPU + AM_RANGE(0x00, 0x00) AM_READ(soundlatch2_byte_r) AM_WRITE(to_sound_w) // to/from sound CPU ADDRESS_MAP_END static ADDRESS_MAP_START( subm_sound_map, AS_PROGRAM, 8, sub_state ) @@ -425,7 +431,7 @@ PALETTE_INIT_MEMBER(sub_state, sub) } -INTERRUPT_GEN_MEMBER(sub_state::subm_sound_irq) +INTERRUPT_GEN_MEMBER(sub_state::sound_irq) { if(m_nmi_en) m_soundcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); @@ -442,7 +448,7 @@ static MACHINE_CONFIG_START( sub, sub_state ) MCFG_CPU_ADD("soundcpu", Z80,MASTER_CLOCK/6) /* ? MHz */ MCFG_CPU_PROGRAM_MAP(subm_sound_map) MCFG_CPU_IO_MAP(subm_sound_io) - MCFG_CPU_PERIODIC_INT_DRIVER(sub_state, subm_sound_irq, 120) //??? + MCFG_CPU_PERIODIC_INT_DRIVER(sub_state, sound_irq, 120) //??? /* video hardware */ @@ -451,7 +457,7 @@ static MACHINE_CONFIG_START( sub, sub_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(256, 256) MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 16, 256-16-1) - MCFG_SCREEN_UPDATE_DRIVER(sub_state, screen_update_sub) + MCFG_SCREEN_UPDATE_DRIVER(sub_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", sub) @@ -502,4 +508,4 @@ ROM_START( sub ) ROM_LOAD( "prom pos c8 n82s129", 0x0600, 0x100, CRC(351e1ef8) SHA1(530c9012ff5abda1c4ba9787ca999ca1ae1a893d) ) ROM_END -GAME( 1985, sub, 0, sub, sub, driver_device, 0, ROT270, "Sigma Enterprises Inc.", "Submarine (Sigma)", GAME_NO_COCKTAIL ) +GAME( 1985, sub, 0, sub, sub, driver_device, 0, ROT270, "Sigma Enterprises Inc.", "Submarine (Sigma)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/subs.c b/src/mame/drivers/subs.c index 4e45a78fdd5..327dfcdf941 100644 --- a/src/mame/drivers/subs.c +++ b/src/mame/drivers/subs.c @@ -47,21 +47,21 @@ PALETTE_INIT_MEMBER(subs_state, subs) static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, subs_state ) ADDRESS_MAP_GLOBAL_MASK(0x3fff) - AM_RANGE(0x0000, 0x0000) AM_WRITE(subs_noise_reset_w) - AM_RANGE(0x0000, 0x0007) AM_READ(subs_control_r) - AM_RANGE(0x0020, 0x0020) AM_WRITE(subs_steer_reset_w) - AM_RANGE(0x0020, 0x0027) AM_READ(subs_coin_r) -// AM_RANGE(0x0040, 0x0040) AM_WRITE(subs_timer_reset_w) - AM_RANGE(0x0060, 0x0063) AM_READ(subs_options_r) - AM_RANGE(0x0060, 0x0061) AM_WRITE(subs_lamp1_w) - AM_RANGE(0x0062, 0x0063) AM_WRITE(subs_lamp2_w) - AM_RANGE(0x0064, 0x0065) AM_WRITE(subs_sonar2_w) - AM_RANGE(0x0066, 0x0067) AM_WRITE(subs_sonar1_w) + AM_RANGE(0x0000, 0x0000) AM_WRITE(noise_reset_w) + AM_RANGE(0x0000, 0x0007) AM_READ(control_r) + AM_RANGE(0x0020, 0x0020) AM_WRITE(steer_reset_w) + AM_RANGE(0x0020, 0x0027) AM_READ(coin_r) +// AM_RANGE(0x0040, 0x0040) AM_WRITE(timer_reset_w) + AM_RANGE(0x0060, 0x0063) AM_READ(options_r) + AM_RANGE(0x0060, 0x0061) AM_WRITE(lamp1_w) + AM_RANGE(0x0062, 0x0063) AM_WRITE(lamp2_w) + AM_RANGE(0x0064, 0x0065) AM_WRITE(sonar2_w) + AM_RANGE(0x0066, 0x0067) AM_WRITE(sonar1_w) // Schematics show crash and explode reversed. But this is proper. - AM_RANGE(0x0068, 0x0069) AM_WRITE(subs_explode_w) - AM_RANGE(0x006a, 0x006b) AM_WRITE(subs_crash_w) - AM_RANGE(0x006c, 0x006d) AM_WRITE(subs_invert1_w) - AM_RANGE(0x006e, 0x006f) AM_WRITE(subs_invert2_w) + AM_RANGE(0x0068, 0x0069) AM_WRITE(explode_w) + AM_RANGE(0x006a, 0x006b) AM_WRITE(crash_w) + AM_RANGE(0x006c, 0x006d) AM_WRITE(invert1_w) + AM_RANGE(0x006e, 0x006f) AM_WRITE(invert2_w) AM_RANGE(0x0090, 0x009f) AM_SHARE("spriteram") AM_RANGE(0x0000, 0x01ff) AM_RAM AM_RANGE(0x0800, 0x0bff) AM_RAM AM_SHARE("videoram") @@ -179,7 +179,7 @@ static MACHINE_CONFIG_START( subs, subs_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M6502,12096000/16) /* clock input is the "4H" signal */ MCFG_CPU_PROGRAM_MAP(main_map) - MCFG_CPU_PERIODIC_INT_DRIVER(subs_state, subs_interrupt, 4*57) + MCFG_CPU_PERIODIC_INT_DRIVER(subs_state, interrupt, 4*57) /* video hardware */ @@ -195,7 +195,7 @@ static MACHINE_CONFIG_START( subs, subs_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) MCFG_SCREEN_SIZE(32*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 28*8-1) - MCFG_SCREEN_UPDATE_DRIVER(subs_state, screen_update_subs_left) + MCFG_SCREEN_UPDATE_DRIVER(subs_state, screen_update_left) MCFG_SCREEN_PALETTE("palette") MCFG_SCREEN_ADD("rscreen", RASTER) @@ -203,7 +203,7 @@ static MACHINE_CONFIG_START( subs, subs_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) MCFG_SCREEN_SIZE(32*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 28*8-1) - MCFG_SCREEN_UPDATE_DRIVER(subs_state, screen_update_subs_right) + MCFG_SCREEN_UPDATE_DRIVER(subs_state, screen_update_right) MCFG_SCREEN_PALETTE("palette") @@ -250,4 +250,4 @@ ROM_END * *************************************/ -GAME( 1977, subs, 0, subs, subs, driver_device, 0, ROT0, "Atari", "Subs", GAME_IMPERFECT_SOUND ) +GAME( 1977, subs, 0, subs, subs, driver_device, 0, ROT0, "Atari", "Subs", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/suna16.c b/src/mame/drivers/suna16.c index df926653c97..2677c793f41 100644 --- a/src/mame/drivers/suna16.c +++ b/src/mame/drivers/suna16.c @@ -25,7 +25,6 @@ Year + Game By Board Hardware #include "emu.h" #include "cpu/z80/z80.h" #include "cpu/m68000/m68000.h" -#include "sound/dac.h" #include "sound/2151intf.h" #include "sound/ay8910.h" #include "sound/3526intf.h" @@ -39,7 +38,7 @@ Year + Game By Board Hardware ***************************************************************************/ -WRITE16_MEMBER(suna16_state::suna16_soundlatch_w) +WRITE16_MEMBER(suna16_state::soundlatch_w) { if (ACCESSING_BITS_0_7) { @@ -92,11 +91,11 @@ WRITE16_MEMBER(suna16_state::bestbest_coin_w) static ADDRESS_MAP_START( bssoccer_map, AS_PROGRAM, 16, suna16_state ) AM_RANGE(0x000000, 0x1fffff) AM_ROM // ROM AM_RANGE(0x200000, 0x203fff) AM_RAM // RAM - AM_RANGE(0x400000, 0x4001ff) AM_READWRITE(suna16_paletteram16_r, suna16_paletteram16_w) // Banked Palette + AM_RANGE(0x400000, 0x4001ff) AM_READWRITE(paletteram_r, paletteram_w) // Banked Palette AM_RANGE(0x400200, 0x400fff) AM_RAM // AM_RANGE(0x600000, 0x61ffff) AM_RAM AM_SHARE("spriteram") // Sprites - AM_RANGE(0xa00000, 0xa00001) AM_READ_PORT("P1") AM_WRITE(suna16_soundlatch_w) // To Sound CPU - AM_RANGE(0xa00002, 0xa00003) AM_READ_PORT("P2") AM_WRITE(suna16_flipscreen_w) // Flip Screen + AM_RANGE(0xa00000, 0xa00001) AM_READ_PORT("P1") AM_WRITE(soundlatch_w) // To Sound CPU + AM_RANGE(0xa00002, 0xa00003) AM_READ_PORT("P2") AM_WRITE(flipscreen_w) // Flip Screen AM_RANGE(0xa00004, 0xa00005) AM_READ_PORT("P3") AM_WRITE(bssoccer_leds_w) // Leds AM_RANGE(0xa00006, 0xa00007) AM_READ_PORT("P4") AM_WRITENOP // ? IRQ 1 Ack AM_RANGE(0xa00008, 0xa00009) AM_READ_PORT("DSW1") AM_WRITENOP // ? IRQ 2 Ack @@ -148,12 +147,12 @@ WRITE8_MEMBER(suna16_state::uballoon_prot_w) static ADDRESS_MAP_START( uballoon_map, AS_PROGRAM, 16, suna16_state ) AM_RANGE(0x000000, 0x0fffff) AM_ROM // ROM AM_RANGE(0x800000, 0x803fff) AM_RAM // RAM - AM_RANGE(0x200000, 0x2001ff) AM_READWRITE(suna16_paletteram16_r, suna16_paletteram16_w) // Banked Palette + AM_RANGE(0x200000, 0x2001ff) AM_READWRITE(paletteram_r, paletteram_w) // Banked Palette AM_RANGE(0x200200, 0x200fff) AM_RAM // AM_RANGE(0x400000, 0x41ffff) AM_MIRROR(0x1e0000) AM_RAM AM_SHARE("spriteram") // Sprites - AM_RANGE(0x600000, 0x600001) AM_READ_PORT("P1") AM_WRITE(suna16_soundlatch_w) // To Sound CPU + AM_RANGE(0x600000, 0x600001) AM_READ_PORT("P1") AM_WRITE(soundlatch_w) // To Sound CPU AM_RANGE(0x600002, 0x600003) AM_READ_PORT("P2") - AM_RANGE(0x600004, 0x600005) AM_READ_PORT("DSW1") AM_WRITE(suna16_flipscreen_w) // Flip Screen + AM_RANGE(0x600004, 0x600005) AM_READ_PORT("DSW1") AM_WRITE(flipscreen_w) // Flip Screen AM_RANGE(0x600006, 0x600007) AM_READ_PORT("DSW2") AM_RANGE(0x600008, 0x600009) AM_WRITE(uballoon_leds_w) // Leds AM_RANGE(0x60000c, 0x60000d) AM_WRITENOP // ? IRQ 1 Ack @@ -168,11 +167,11 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( sunaq_map, AS_PROGRAM, 16, suna16_state ) AM_RANGE(0x000000, 0x0fffff) AM_ROM // ROM - AM_RANGE(0x500000, 0x500001) AM_READ_PORT("P1") AM_WRITE(suna16_soundlatch_w) // To Sound CPU - AM_RANGE(0x500002, 0x500003) AM_READ_PORT("P2") AM_WRITE(suna16_flipscreen_w) // Flip Screen + AM_RANGE(0x500000, 0x500001) AM_READ_PORT("P1") AM_WRITE(soundlatch_w) // To Sound CPU + AM_RANGE(0x500002, 0x500003) AM_READ_PORT("P2") AM_WRITE(flipscreen_w) // Flip Screen AM_RANGE(0x500004, 0x500005) AM_READ_PORT("DSW1") AM_RANGE(0x500006, 0x500007) AM_READ_PORT("DSW2") // (unused?) - AM_RANGE(0x540000, 0x5401ff) AM_READWRITE(suna16_paletteram16_r, suna16_paletteram16_w) + AM_RANGE(0x540000, 0x5401ff) AM_READWRITE(paletteram_r, paletteram_w) AM_RANGE(0x540200, 0x540fff) AM_RAM // RAM AM_RANGE(0x580000, 0x583fff) AM_RAM // RAM AM_RANGE(0x5c0000, 0x5dffff) AM_RAM AM_SHARE("spriteram") // Sprites @@ -202,18 +201,23 @@ WRITE8_MEMBER(suna16_state::bestbest_prot_w) static ADDRESS_MAP_START( bestbest_map, AS_PROGRAM, 16, suna16_state ) AM_RANGE( 0x000000, 0x03ffff ) AM_ROM AM_MIRROR(0xc0000) // ROM AM_RANGE( 0x200000, 0x2fffff ) AM_ROM AM_REGION("user1", 0) // ROM - AM_RANGE( 0x500000, 0x500001 ) AM_READ_PORT("P1") AM_WRITE(suna16_soundlatch_w) // To Sound CPU + AM_RANGE( 0x500000, 0x500001 ) AM_READ_PORT("P1") AM_WRITE(soundlatch_w) // To Sound CPU AM_RANGE( 0x500002, 0x500003 ) AM_READ_PORT("P2") AM_WRITE(bestbest_flipscreen_w) // P2 + Coins, Flip Screen AM_RANGE( 0x500004, 0x500005 ) AM_READ_PORT("DSW") AM_WRITE(bestbest_coin_w) // Coin Counter AM_RANGE( 0x500008, 0x500009 ) AM_WRITE8(bestbest_prot_w, 0x00ff) // Protection AM_RANGE( 0x500018, 0x500019 ) AM_READ8(bestbest_prot_r, 0x00ff) // " - AM_RANGE( 0x540000, 0x540fff ) AM_READWRITE(suna16_paletteram16_r, suna16_paletteram16_w ) // Banked(?) Palette + AM_RANGE( 0x540000, 0x540fff ) AM_READWRITE(paletteram_r, paletteram_w ) // Banked(?) Palette AM_RANGE( 0x541000, 0x54ffff ) AM_RAM // AM_RANGE( 0x580000, 0x58ffff ) AM_RAM // RAM AM_RANGE( 0x5c0000, 0x5dffff ) AM_RAM AM_SHARE("spriteram") // Sprites (Chip 1) AM_RANGE( 0x5e0000, 0x5fffff ) AM_RAM AM_SHARE("spriteram2") // Sprites (Chip 2) ADDRESS_MAP_END +MACHINE_START_MEMBER(suna16_state,bestbest) +{ + save_item(NAME(m_prot)); +} + /*************************************************************************** @@ -330,11 +334,11 @@ ADDRESS_MAP_END /* 2 DACs per CPU - 4 bits per sample */ -WRITE8_MEMBER(suna16_state::bssoccer_DAC1_w) +WRITE8_MEMBER(suna16_state::DAC1_w) { m_dac1->write_unsigned8( (data & 0xf) * 0x11 ); } -WRITE8_MEMBER(suna16_state::bssoccer_DAC2_w) +WRITE8_MEMBER(suna16_state::DAC2_w) { m_dac2->write_unsigned8( (data & 0xf) * 0x11 ); } @@ -350,8 +354,8 @@ WRITE8_MEMBER(suna16_state::bssoccer_DAC4_w) static ADDRESS_MAP_START( bssoccer_pcm_1_io_map, AS_IO, 8, suna16_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) AM_RANGE(0x00, 0x00) AM_READ(soundlatch2_byte_r) // From The Sound Z80 - AM_RANGE(0x00, 0x00) AM_WRITE(bssoccer_DAC1_w) // 2 x DAC - AM_RANGE(0x01, 0x01) AM_WRITE(bssoccer_DAC2_w) // 2 x DAC + AM_RANGE(0x00, 0x00) AM_WRITE(DAC1_w) // 2 x DAC + AM_RANGE(0x01, 0x01) AM_WRITE(DAC2_w) // 2 x DAC AM_RANGE(0x03, 0x03) AM_WRITE(bssoccer_pcm_1_bankswitch_w) // Rom Bank ADDRESS_MAP_END @@ -387,14 +391,16 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( uballoon_pcm_1_io_map, AS_IO, 8, suna16_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) AM_RANGE(0x00, 0x00) AM_READ(soundlatch2_byte_r) // From The Sound Z80 - AM_RANGE(0x00, 0x00) AM_WRITE(bssoccer_DAC1_w) // 2 x DAC - AM_RANGE(0x01, 0x01) AM_WRITE(bssoccer_DAC2_w) // 2 x DAC + AM_RANGE(0x00, 0x00) AM_WRITE(DAC1_w) // 2 x DAC + AM_RANGE(0x01, 0x01) AM_WRITE(DAC2_w) // 2 x DAC AM_RANGE(0x03, 0x03) AM_WRITE(uballoon_pcm_1_bankswitch_w) // Rom Bank ADDRESS_MAP_END MACHINE_START_MEMBER(suna16_state,uballoon) { membank("bank1")->configure_entries(0, 2, memregion("pcm1")->base() + 0x400, 0x10000); + + save_item(NAME(m_prot)); } MACHINE_RESET_MEMBER(suna16_state,uballoon) @@ -415,8 +421,8 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( bestbest_pcm_1_iomap, AS_IO, 8, suna16_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) AM_RANGE(0x00, 0x00) AM_READ (soundlatch2_byte_r ) // From The Sound Z80 - AM_RANGE(0x00, 0x00) AM_MIRROR(0x02) AM_WRITE(bssoccer_DAC1_w) // 2 x DAC - AM_RANGE(0x01, 0x01) AM_MIRROR(0x02) AM_WRITE(bssoccer_DAC2_w) // 2 x DAC + AM_RANGE(0x00, 0x00) AM_MIRROR(0x02) AM_WRITE(DAC1_w) // 2 x DAC + AM_RANGE(0x01, 0x01) AM_MIRROR(0x02) AM_WRITE(DAC2_w) // 2 x DAC ADDRESS_MAP_END /*************************************************************************** @@ -830,7 +836,7 @@ static MACHINE_CONFIG_START( bssoccer, suna16_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(256, 256) MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0+16, 256-16-1) - MCFG_SCREEN_UPDATE_DRIVER(suna16_state, screen_update_suna16) + MCFG_SCREEN_UPDATE_DRIVER(suna16_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", suna16) @@ -890,7 +896,7 @@ static MACHINE_CONFIG_START( uballoon, suna16_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(256, 256) MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0+16, 256-16-1) - MCFG_SCREEN_UPDATE_DRIVER(suna16_state, screen_update_suna16) + MCFG_SCREEN_UPDATE_DRIVER(suna16_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", suna16) @@ -939,7 +945,7 @@ static MACHINE_CONFIG_START( sunaq, suna16_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(256, 256) MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0+16, 256-16-1) - MCFG_SCREEN_UPDATE_DRIVER(suna16_state, screen_update_suna16) + MCFG_SCREEN_UPDATE_DRIVER(suna16_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", suna16) @@ -986,6 +992,8 @@ static MACHINE_CONFIG_START( bestbest, suna16_state ) /* 2nd PCM Z80 missing */ MCFG_QUANTUM_TIME(attotime::from_hz(6000)) + + MCFG_MACHINE_START_OVERRIDE(suna16_state, bestbest) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -1357,8 +1365,8 @@ ROM_END ***************************************************************************/ -GAME( 1994, bestbest, 0, bestbest, bestbest, driver_device, 0, ROT0, "SunA", "Best Of Best", 0 ) -GAME( 1994, sunaq, 0, sunaq, sunaq, driver_device, 0, ROT0, "SunA", "SunA Quiz 6000 Academy (940620-6)", 0 ) // Date/Version on-screen is 940620-6, but in the program rom it's 1994,6,30 K.H.T V6.00 -GAME( 1996, bssoccer, 0, bssoccer, bssoccer, driver_device, 0, ROT0, "SunA (Unico license)", "Back Street Soccer (KRB-0031 PCB)", 0 ) -GAME( 1996, bssoccera, bssoccer, bssoccer, bssoccer, driver_device, 0, ROT0, "SunA (Unico license)", "Back Street Soccer (KRB-0032A PCB)", 0 ) -GAME( 1996, uballoon, 0, uballoon, uballoon, driver_device, 0, ROT0, "SunA (Unico license)", "Ultra Balloon", 0 ) +GAME( 1994, bestbest, 0, bestbest, bestbest, driver_device, 0, ROT0, "SunA", "Best Of Best", GAME_SUPPORTS_SAVE ) +GAME( 1994, sunaq, 0, sunaq, sunaq, driver_device, 0, ROT0, "SunA", "SunA Quiz 6000 Academy (940620-6)", GAME_SUPPORTS_SAVE ) // Date/Version on-screen is 940620-6, but in the program rom it's 1994,6,30 K.H.T V6.00 +GAME( 1996, bssoccer, 0, bssoccer, bssoccer, driver_device, 0, ROT0, "SunA (Unico license)", "Back Street Soccer (KRB-0031 PCB)", GAME_SUPPORTS_SAVE ) +GAME( 1996, bssoccera, bssoccer, bssoccer, bssoccer, driver_device, 0, ROT0, "SunA (Unico license)", "Back Street Soccer (KRB-0032A PCB)", GAME_SUPPORTS_SAVE ) +GAME( 1996, uballoon, 0, uballoon, uballoon, driver_device, 0, ROT0, "SunA (Unico license)", "Ultra Balloon", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/supdrapo.c b/src/mame/drivers/supdrapo.c index 2166afa9c9d..84c58873ec1 100644 --- a/src/mame/drivers/supdrapo.c +++ b/src/mame/drivers/supdrapo.c @@ -27,11 +27,11 @@ - Reworked inputs to match the standard poker inputs names/layout. - Hooked the payout switch. - - Hooked a watchdog circuitery, that seems intended to reset + - Hooked a watchdog circuitry, that seems intended to reset the game and/or an external device. - Added machine start & reset. - All clocks pre defined. - - Added ay8910 interfase as a preliminary attempt to analyze the unknown + - Added ay8910 interface as a preliminary attempt to analyze the unknown port writes when these ports are set as input. - Figured out the following DIP switches: Auto Bet (No, Yes). @@ -72,18 +72,24 @@ class supdrapo_state : public driver_device public: supdrapo_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_col_line(*this, "col_line"), - m_videoram(*this, "videoram"), - m_char_bank(*this, "char_bank"), m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") { } + m_palette(*this, "palette"), + m_col_line(*this, "col_line"), + m_videoram(*this, "videoram"), + m_char_bank(*this, "char_bank") { } + required_device<cpu_device> m_maincpu; + required_device<gfxdecode_device> m_gfxdecode; + required_device<palette_device> m_palette; + required_shared_ptr<UINT8> m_col_line; required_shared_ptr<UINT8> m_videoram; required_shared_ptr<UINT8> m_char_bank; + UINT8 m_wdog; - DECLARE_READ8_MEMBER(sdpoker_rng_r); + + DECLARE_READ8_MEMBER(rng_r); DECLARE_WRITE8_MEMBER(wdog8000_w); DECLARE_WRITE8_MEMBER(debug8004_w); DECLARE_WRITE8_MEMBER(debug7c00_w); @@ -91,14 +97,13 @@ public: DECLARE_WRITE8_MEMBER(payout_w); DECLARE_WRITE8_MEMBER(ay8910_outputa_w); DECLARE_WRITE8_MEMBER(ay8910_outputb_w); + virtual void machine_start(); virtual void machine_reset(); virtual void video_start(); DECLARE_PALETTE_INIT(supdrapo); - UINT32 screen_update_supdrapo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - required_device<cpu_device> m_maincpu; - required_device<gfxdecode_device> m_gfxdecode; - required_device<palette_device> m_palette; + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; @@ -111,7 +116,7 @@ void supdrapo_state::video_start() } -UINT32 supdrapo_state::screen_update_supdrapo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 supdrapo_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x, y; int count; @@ -171,7 +176,7 @@ PALETTE_INIT_MEMBER(supdrapo_state, supdrapo) R/W Handlers **********************************************************************/ -READ8_MEMBER(supdrapo_state::sdpoker_rng_r) +READ8_MEMBER(supdrapo_state::rng_r) { return machine().rand(); } @@ -251,6 +256,7 @@ WRITE8_MEMBER(supdrapo_state::payout_w) void supdrapo_state::machine_start() { + save_item(NAME(m_wdog)); } @@ -282,7 +288,7 @@ static ADDRESS_MAP_START( sdpoker_mem, AS_PROGRAM, 8, supdrapo_state ) AM_RANGE(0x8005, 0x8005) AM_READ_PORT("SW1") AM_RANGE(0x8006, 0x8006) AM_READ_PORT("SW2") AM_RANGE(0x9000, 0x90ff) AM_RAM AM_SHARE("nvram") - AM_RANGE(0x9400, 0x9400) AM_READ(sdpoker_rng_r) + AM_RANGE(0x9400, 0x9400) AM_READ(rng_r) AM_RANGE(0x9800, 0x9801) AM_DEVWRITE("aysnd", ay8910_device, data_address_w) ADDRESS_MAP_END @@ -453,7 +459,7 @@ static MACHINE_CONFIG_START( supdrapo, supdrapo_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(256, 256) MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1) - MCFG_SCREEN_UPDATE_DRIVER(supdrapo_state, screen_update_supdrapo) + MCFG_SCREEN_UPDATE_DRIVER(supdrapo_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", supdrapo) @@ -600,6 +606,6 @@ ROM_END **********************************************************************/ /* YEAR NAME PARENT MACHINE INPUT INIT ROT COMPANY FULLNAME FLAGS... */ -GAME( 1983, supdrapo, 0, supdrapo, supdrapo, driver_device, 0, ROT90, "Valadon Automation (Stern Electronics license)", "Super Draw Poker (set 1)", 0 ) -GAME( 1983, supdrapoa, supdrapo, supdrapo, supdrapo, driver_device, 0, ROT90, "Valadon Automation / Jeutel", "Super Draw Poker (set 2)", 0 ) -GAME( 1983, supdrapob, supdrapo, supdrapo, supdrapo, driver_device, 0, ROT90, "bootleg", "Super Draw Poker (bootleg)", 0 ) +GAME( 1983, supdrapo, 0, supdrapo, supdrapo, driver_device, 0, ROT90, "Valadon Automation (Stern Electronics license)", "Super Draw Poker (set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1983, supdrapoa, supdrapo, supdrapo, supdrapo, driver_device, 0, ROT90, "Valadon Automation / Jeutel", "Super Draw Poker (set 2)", GAME_SUPPORTS_SAVE ) +GAME( 1983, supdrapob, supdrapo, supdrapo, supdrapo, driver_device, 0, ROT90, "bootleg", "Super Draw Poker (bootleg)", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/suprgolf.c b/src/mame/drivers/suprgolf.c index 614faaa8052..368fe3ded91 100644 --- a/src/mame/drivers/suprgolf.c +++ b/src/mame/drivers/suprgolf.c @@ -33,14 +33,20 @@ class suprgolf_state : public driver_device public: suprgolf_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_videoram(*this, "videoram"), m_maincpu(*this, "maincpu"), m_msm(*this, "msm"), m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") { } + m_palette(*this, "palette"), + m_videoram(*this, "videoram") { } + + required_device<cpu_device> m_maincpu; + required_device<msm5205_device> m_msm; + required_device<gfxdecode_device> m_gfxdecode; + required_device<palette_device> m_palette; - tilemap_t *m_tilemap; required_shared_ptr<UINT8> m_videoram; + + tilemap_t *m_tilemap; UINT8 *m_paletteram; UINT8 *m_bg_vram; UINT16 *m_bg_fb; @@ -54,34 +60,33 @@ public: UINT8 m_palette_switch; UINT8 m_bg_vreg_test; UINT8 m_toggle; - DECLARE_READ8_MEMBER(suprgolf_videoram_r); - DECLARE_WRITE8_MEMBER(suprgolf_videoram_w); - DECLARE_READ8_MEMBER(suprgolf_bg_vram_r); - DECLARE_WRITE8_MEMBER(suprgolf_bg_vram_w); - DECLARE_WRITE8_MEMBER(suprgolf_pen_w); + + DECLARE_READ8_MEMBER(videoram_r); + DECLARE_WRITE8_MEMBER(videoram_w); + DECLARE_READ8_MEMBER(bg_vram_r); + DECLARE_WRITE8_MEMBER(bg_vram_w); + DECLARE_WRITE8_MEMBER(pen_w); DECLARE_WRITE8_MEMBER(adpcm_data_w); DECLARE_WRITE8_MEMBER(rom2_bank_select_w); - DECLARE_READ8_MEMBER(suprgolf_vregs_r); - DECLARE_WRITE8_MEMBER(suprgolf_vregs_w); + DECLARE_READ8_MEMBER(vregs_r); + DECLARE_WRITE8_MEMBER(vregs_w); DECLARE_READ8_MEMBER(rom_bank_select_r); DECLARE_WRITE8_MEMBER(rom_bank_select_w); DECLARE_READ8_MEMBER(pedal_extra_bits_r); DECLARE_READ8_MEMBER(p1_r); DECLARE_READ8_MEMBER(p2_r); - DECLARE_WRITE8_MEMBER(suprgolf_writeA); - DECLARE_WRITE8_MEMBER(suprgolf_writeB); - DECLARE_DRIVER_INIT(suprgolf); + DECLARE_WRITE8_MEMBER(writeA); + DECLARE_WRITE8_MEMBER(writeB); + DECLARE_WRITE_LINE_MEMBER(adpcm_int); + TILE_GET_INFO_MEMBER(get_tile_info); + + DECLARE_DRIVER_INIT(suprgolf); virtual void machine_start(); virtual void machine_reset(); virtual void video_start(); - UINT32 screen_update_suprgolf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - DECLARE_WRITE_LINE_MEMBER(irqhandler); - DECLARE_WRITE_LINE_MEMBER(adpcm_int); - required_device<cpu_device> m_maincpu; - required_device<msm5205_device> m_msm; - required_device<gfxdecode_device> m_gfxdecode; - required_device<palette_device> m_palette; + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; TILE_GET_INFO_MEMBER(suprgolf_state::get_tile_info) @@ -104,9 +109,19 @@ void suprgolf_state::video_start() m_fg_fb = auto_alloc_array(machine(), UINT16, 0x2000*0x20); m_tilemap->set_transparent_pen(15); + + save_item(NAME(m_bg_bank)); + save_item(NAME(m_vreg_bank)); + save_item(NAME(m_vreg_pen)); + save_item(NAME(m_palette_switch)); + save_item(NAME(m_bg_vreg_test)); + save_pointer(NAME(m_paletteram), 0x1000); + save_pointer(NAME(m_bg_vram), 0x2000*0x20); + save_pointer(NAME(m_bg_fb), 0x2000*0x20); + save_pointer(NAME(m_fg_fb), 0x2000*0x20); } -UINT32 suprgolf_state::screen_update_suprgolf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 suprgolf_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y,count,color; bitmap.fill(m_palette->black_pen(), cliprect); @@ -150,7 +165,7 @@ UINT32 suprgolf_state::screen_update_suprgolf(screen_device &screen, bitmap_ind1 return 0; } -READ8_MEMBER(suprgolf_state::suprgolf_videoram_r) +READ8_MEMBER(suprgolf_state::videoram_r) { if (m_palette_switch) return m_paletteram[offset]; @@ -158,7 +173,7 @@ READ8_MEMBER(suprgolf_state::suprgolf_videoram_r) return m_videoram[offset]; } -WRITE8_MEMBER(suprgolf_state::suprgolf_videoram_w) +WRITE8_MEMBER(suprgolf_state::videoram_w) { if(m_palette_switch) { @@ -180,12 +195,12 @@ WRITE8_MEMBER(suprgolf_state::suprgolf_videoram_w) } } -READ8_MEMBER(suprgolf_state::suprgolf_vregs_r) +READ8_MEMBER(suprgolf_state::vregs_r) { return m_vreg_bank; } -WRITE8_MEMBER(suprgolf_state::suprgolf_vregs_w) +WRITE8_MEMBER(suprgolf_state::vregs_w) { //printf("%02x\n",data); @@ -200,12 +215,12 @@ WRITE8_MEMBER(suprgolf_state::suprgolf_vregs_w) // printf("Video regs with data %02x activated\n",data); } -READ8_MEMBER(suprgolf_state::suprgolf_bg_vram_r) +READ8_MEMBER(suprgolf_state::bg_vram_r) { return m_bg_vram[offset+m_bg_bank*0x2000]; } -WRITE8_MEMBER(suprgolf_state::suprgolf_bg_vram_w) +WRITE8_MEMBER(suprgolf_state::bg_vram_w) { UINT8 hi_nibble,lo_nibble; UINT8 hi_dirty_dot,lo_dirty_dot; // helpers @@ -254,9 +269,14 @@ void suprgolf_state::machine_start() { membank("bank1")->configure_entries(0, 16, memregion("user2")->base(), 0x4000); membank("bank2")->configure_entries(0, 64, memregion("user1")->base(), 0x4000); + + save_item(NAME(m_rom_bank)); + save_item(NAME(m_msm5205next)); + save_item(NAME(m_msm_nmi_mask)); + save_item(NAME(m_toggle)); } -WRITE8_MEMBER(suprgolf_state::suprgolf_pen_w) +WRITE8_MEMBER(suprgolf_state::pen_w) { m_vreg_pen = data; } @@ -317,9 +337,9 @@ static ADDRESS_MAP_START( suprgolf_map, AS_PROGRAM, 8, suprgolf_state ) AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1") AM_RANGE(0x4000, 0x4000) AM_WRITE(rom2_bank_select_w ) AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank2") - AM_RANGE(0xc000, 0xdfff) AM_READWRITE(suprgolf_bg_vram_r, suprgolf_bg_vram_w ) // banked background vram - AM_RANGE(0xe000, 0xefff) AM_READWRITE(suprgolf_videoram_r, suprgolf_videoram_w ) AM_SHARE("videoram") //foreground vram + paletteram - AM_RANGE(0xf000, 0xf000) AM_WRITE(suprgolf_pen_w ) + AM_RANGE(0xc000, 0xdfff) AM_READWRITE(bg_vram_r, bg_vram_w ) // banked background vram + AM_RANGE(0xe000, 0xefff) AM_READWRITE(videoram_r, videoram_w ) AM_SHARE("videoram") //foreground vram + paletteram + AM_RANGE(0xf000, 0xf000) AM_WRITE(pen_w ) AM_RANGE(0xf800, 0xffff) AM_RAM ADDRESS_MAP_END @@ -416,21 +436,16 @@ static INPUT_PORTS_START( suprgolf ) PORT_DIPUNUSED_DIPLOC( 0x80, 0x00, "SW2:8" ) INPUT_PORTS_END -WRITE8_MEMBER(suprgolf_state::suprgolf_writeA) +WRITE8_MEMBER(suprgolf_state::writeA) { osd_printf_debug("ymwA\n"); } -WRITE8_MEMBER(suprgolf_state::suprgolf_writeB) +WRITE8_MEMBER(suprgolf_state::writeB) { osd_printf_debug("ymwA\n"); } -WRITE_LINE_MEMBER(suprgolf_state::irqhandler) -{ - //m_maincpu->set_input_line(INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE); -} - WRITE_LINE_MEMBER(suprgolf_state::adpcm_int) { m_msm->reset_w(0); @@ -485,8 +500,8 @@ static MACHINE_CONFIG_START( suprgolf, suprgolf_state ) MCFG_I8255_IN_PORTA_CB(IOPORT("SYSTEM")) MCFG_I8255_IN_PORTB_CB(READ8(suprgolf_state, rom_bank_select_r)) MCFG_I8255_OUT_PORTB_CB(WRITE8(suprgolf_state, rom_bank_select_w)) - MCFG_I8255_IN_PORTC_CB(READ8(suprgolf_state, suprgolf_vregs_r)) - MCFG_I8255_OUT_PORTC_CB(WRITE8(suprgolf_state, suprgolf_vregs_w)) + MCFG_I8255_IN_PORTC_CB(READ8(suprgolf_state, vregs_r)) + MCFG_I8255_OUT_PORTC_CB(WRITE8(suprgolf_state, vregs_w)) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -494,7 +509,7 @@ static MACHINE_CONFIG_START( suprgolf, suprgolf_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) MCFG_SCREEN_SIZE(256, 256) MCFG_SCREEN_VISIBLE_AREA(0, 255, 0, 191) - MCFG_SCREEN_UPDATE_DRIVER(suprgolf_state, screen_update_suprgolf) + MCFG_SCREEN_UPDATE_DRIVER(suprgolf_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", suprgolf) @@ -504,11 +519,11 @@ static MACHINE_CONFIG_START( suprgolf, suprgolf_state ) MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("ymsnd", YM2203, MASTER_CLOCK/4) /* guess */ - MCFG_YM2203_IRQ_HANDLER(WRITELINE(suprgolf_state, irqhandler)) + //MCFG_YM2203_IRQ_HANDLER(INPUTLINE("maincpu", INPUT_LINE_NMI)) MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW0")) MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW1")) - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(suprgolf_state, suprgolf_writeA)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(suprgolf_state, suprgolf_writeB)) + MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(suprgolf_state, writeA)) + MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(suprgolf_state, writeB)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) MCFG_SOUND_ADD("msm", MSM5205, XTAL_384kHz) /* guess */ @@ -621,5 +636,5 @@ DRIVER_INIT_MEMBER(suprgolf_state,suprgolf) ROM[0x6d72+(0x4000*3)-0x4000] = 0x20; //patch ROM check } -GAME( 1989, suprgolf, 0, suprgolf, suprgolf, suprgolf_state, suprgolf, ROT0, "Nasco", "Super Crowns Golf (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL ) -GAME( 1989, albatross, suprgolf, suprgolf, suprgolf, driver_device, 0, ROT0, "Nasco", "Albatross (US Prototype?)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL ) +GAME( 1989, suprgolf, 0, suprgolf, suprgolf, suprgolf_state, suprgolf, ROT0, "Nasco", "Super Crowns Golf (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) +GAME( 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 ) diff --git a/src/mame/drivers/suprloco.c b/src/mame/drivers/suprloco.c index 3f532300d01..67da4f20978 100644 --- a/src/mame/drivers/suprloco.c +++ b/src/mame/drivers/suprloco.c @@ -5,7 +5,7 @@ Super Locomotive driver by Zsolt Vasvari TODO: -- Bit 5 in suprloco_control_w is pulsed when loco turns "super". This is supposed +- Bit 5 in control_w is pulsed when loco turns "super". This is supposed to make red parts of sprites blink to purple, it's not clear how this is implemented in hardware, there's a hack to support it. @@ -25,7 +25,7 @@ Sega PCB 834-5137 #include "sound/sn76496.h" #include "includes/suprloco.h" -WRITE8_MEMBER(suprloco_state::suprloco_soundport_w) +WRITE8_MEMBER(suprloco_state::soundport_w) { soundlatch_byte_w(space, 0, data); m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); @@ -42,11 +42,11 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, suprloco_state ) AM_RANGE(0xd800, 0xd800) AM_READ_PORT("P2") AM_RANGE(0xe000, 0xe000) AM_READ_PORT("DSW1") AM_RANGE(0xe001, 0xe001) AM_READ_PORT("DSW2") - AM_RANGE(0xe800, 0xe800) AM_WRITE(suprloco_soundport_w) - AM_RANGE(0xe801, 0xe801) AM_READWRITE(suprloco_control_r, suprloco_control_w) - AM_RANGE(0xf000, 0xf6ff) AM_RAM_WRITE(suprloco_videoram_w) AM_SHARE("videoram") + AM_RANGE(0xe800, 0xe800) AM_WRITE(soundport_w) + AM_RANGE(0xe801, 0xe801) AM_READWRITE(control_r, control_w) + AM_RANGE(0xf000, 0xf6ff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram") AM_RANGE(0xf700, 0xf7df) AM_RAM /* unused */ - AM_RANGE(0xf7e0, 0xf7ff) AM_RAM_WRITE(suprloco_scrollram_w) AM_SHARE("scrollram") + AM_RANGE(0xf7e0, 0xf7ff) AM_RAM_WRITE(scrollram_w) AM_SHARE("scrollram") AM_RANGE(0xf800, 0xffff) AM_RAM ADDRESS_MAP_END @@ -175,7 +175,7 @@ static MACHINE_CONFIG_START( suprloco, suprloco_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(5000)) MCFG_SCREEN_SIZE(32*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 0*8, 28*8-1) - MCFG_SCREEN_UPDATE_DRIVER(suprloco_state, screen_update_suprloco) + MCFG_SCREEN_UPDATE_DRIVER(suprloco_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", suprloco) @@ -297,5 +297,5 @@ DRIVER_INIT_MEMBER(suprloco_state,suprloco) -GAME( 1982, suprloco, 0, suprloco, suprloco, suprloco_state, suprloco, ROT0, "Sega", "Super Locomotive (Rev.A)", 0 ) -GAME( 1982, suprlocoo, suprloco, suprloco, suprloco, suprloco_state, suprloco, ROT0, "Sega", "Super Locomotive", 0 ) +GAME( 1982, suprloco, 0, suprloco, suprloco, suprloco_state, suprloco, ROT0, "Sega", "Super Locomotive (Rev.A)", GAME_SUPPORTS_SAVE ) +GAME( 1982, suprlocoo, suprloco, suprloco, suprloco, suprloco_state, suprloco, ROT0, "Sega", "Super Locomotive", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/suprridr.c b/src/mame/drivers/suprridr.c index 284d66c2970..98b114908b9 100644 --- a/src/mame/drivers/suprridr.c +++ b/src/mame/drivers/suprridr.c @@ -89,6 +89,12 @@ #include "sound/ay8910.h" +void suprridr_state::machine_start() +{ + save_item(NAME(m_nmi_enable)); + save_item(NAME(m_sound_data)); +} + /************************************* * * Interrupt generation @@ -164,8 +170,8 @@ WRITE8_MEMBER(suprridr_state::coin_lock_w) static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, suprridr_state ) AM_RANGE(0x0000, 0x7fff) AM_ROM AM_RANGE(0x8000, 0x87ff) AM_RAM - AM_RANGE(0x8800, 0x8bff) AM_RAM_WRITE(suprridr_bgram_w) AM_SHARE("bgram") - AM_RANGE(0x9000, 0x97ff) AM_RAM_WRITE(suprridr_fgram_w) AM_SHARE("fgram") + AM_RANGE(0x8800, 0x8bff) AM_RAM_WRITE(bgram_w) AM_SHARE("bgram") + AM_RANGE(0x9000, 0x97ff) AM_RAM_WRITE(fgram_w) AM_SHARE("fgram") AM_RANGE(0x9800, 0x983f) AM_RAM AM_RANGE(0x9840, 0x987f) AM_RAM AM_SHARE("spriteram") AM_RANGE(0x9880, 0x9bff) AM_RAM @@ -173,12 +179,12 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, suprridr_state ) AM_RANGE(0xa800, 0xa800) AM_READ_PORT("SYSTEM") AM_RANGE(0xb000, 0xb000) AM_READ_PORT("DSW") AM_WRITE(nmi_enable_w) AM_RANGE(0xb002, 0xb003) AM_WRITE(coin_lock_w) - AM_RANGE(0xb006, 0xb006) AM_WRITE(suprridr_flipx_w) - AM_RANGE(0xb007, 0xb007) AM_WRITE(suprridr_flipy_w) + AM_RANGE(0xb006, 0xb006) AM_WRITE(flipx_w) + AM_RANGE(0xb007, 0xb007) AM_WRITE(flipy_w) AM_RANGE(0xb800, 0xb800) AM_WRITE(sound_data_w) - AM_RANGE(0xc801, 0xc801) AM_WRITE(suprridr_fgdisable_w) - AM_RANGE(0xc802, 0xc802) AM_WRITE(suprridr_fgscrolly_w) - AM_RANGE(0xc804, 0xc804) AM_WRITE(suprridr_bgscrolly_w) + AM_RANGE(0xc801, 0xc801) AM_WRITE(fgdisable_w) + AM_RANGE(0xc802, 0xc802) AM_WRITE(fgscrolly_w) + AM_RANGE(0xc804, 0xc804) AM_WRITE(bgscrolly_w) AM_RANGE(0xc000, 0xefff) AM_ROM ADDRESS_MAP_END @@ -223,12 +229,12 @@ ADDRESS_MAP_END #define SUPRRIDR_P1_CONTROL_PORT_TAG ("CONTP1") #define SUPRRIDR_P2_CONTROL_PORT_TAG ("CONTP2") -CUSTOM_INPUT_MEMBER(suprridr_state::suprridr_control_r) +CUSTOM_INPUT_MEMBER(suprridr_state::control_r) { UINT32 ret; /* screen flip multiplexes controls */ - if (suprridr_is_screen_flipped()) + if (is_screen_flipped()) ret = ioport(SUPRRIDR_P2_CONTROL_PORT_TAG)->read(); else ret = ioport(SUPRRIDR_P1_CONTROL_PORT_TAG)->read(); @@ -239,7 +245,7 @@ CUSTOM_INPUT_MEMBER(suprridr_state::suprridr_control_r) static INPUT_PORTS_START( suprridr ) PORT_START("INPUTS") - PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, suprridr_state,suprridr_control_r, NULL) + PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, suprridr_state, control_r, NULL) PORT_START("SYSTEM") PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) @@ -353,7 +359,7 @@ static MACHINE_CONFIG_START( suprridr, suprridr_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(32*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) - MCFG_SCREEN_UPDATE_DRIVER(suprridr_state, screen_update_suprridr) + MCFG_SCREEN_UPDATE_DRIVER(suprridr_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", suprridr) @@ -423,4 +429,4 @@ ROM_END * *************************************/ -GAME( 1983, suprridr, 0, suprridr, suprridr, driver_device, 0, ROT90, "Taito Corporation (Venture Line license)", "Super Rider", GAME_IMPERFECT_SOUND ) +GAME( 1983, suprridr, 0, suprridr, suprridr, driver_device, 0, ROT90, "Taito Corporation (Venture Line license)", "Super Rider", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/thedeep.c b/src/mame/drivers/thedeep.c index cc3db30a16d..b28bb92237d 100644 --- a/src/mame/drivers/thedeep.c +++ b/src/mame/drivers/thedeep.c @@ -436,6 +436,11 @@ static MACHINE_CONFIG_START( thedeep, thedeep_state ) MCFG_PALETTE_ADD("palette", 512) MCFG_PALETTE_INIT_OWNER(thedeep_state, thedeep) + MCFG_DEVICE_ADD("spritegen", DECO_MXC06, 0) + deco_mxc06_device::set_gfx_region(*device, 0); + MCFG_DECO_MXC06_GFXDECODE("gfxdecode") + MCFG_DECO_MXC06_PALETTE("palette") + MCFG_DECO_MXC06_RAMSIZE(0x400) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/toaplan2.c b/src/mame/drivers/toaplan2.c index 67f321e0381..1bdc544e479 100644 --- a/src/mame/drivers/toaplan2.c +++ b/src/mame/drivers/toaplan2.c @@ -4876,7 +4876,32 @@ ROM_START( bgareggabl ) ROM_REGION( 0x010000, "text", 0 ) ROM_LOAD( "1#-256", 0x00000, 0x08000, CRC(760dcd14) SHA1(e151e5d7ca5557277f306b9484ec021f4edf1e07) ) - ROM_LOAD( "2#-256", 0x08000, 0x08000, CRC(456dd16e) SHA1(84779ee64d3ea33ba1ba4dee39b504a81c6811a1) ) + + ROM_REGION( 0x010000, "user1", 0 ) // not graphics + ROM_LOAD( "2#-256", 0x00000, 0x08000, CRC(456dd16e) SHA1(84779ee64d3ea33ba1ba4dee39b504a81c6811a1) ) + + ROM_REGION( 0x140000, "oki", 0 ) /* ADPCM Samples */ + ROM_LOAD( "rom5.bin", 0x040000, 0x100000, CRC(f6d49863) SHA1(3a3c354852adad06e8a051511abfab7606bce382) ) +ROM_END + +ROM_START( bgareggabla ) + ROM_REGION( 0x100000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_WORD_SWAP( "27c8100.mon-sys", 0x000000, 0x100000, CRC(d334e5aa) SHA1(41607b5630d7b92a96607ea95c5b55ad43745857) ) + + ROM_REGION( 0x20000, "audiocpu", 0 ) /* Sound Z80 code + bank */ + ROM_LOAD( "snd.bin", 0x00000, 0x20000, CRC(68632952) SHA1(fb834db83157948e2b420b6051102a9c6ac3969b) ) + + ROM_REGION( 0x800000, "gp9001", 0 ) + ROM_LOAD( "rom4.bin", 0x000000, 0x200000, CRC(b333d81f) SHA1(5481465f1304334fd55798be2f44324c57c2dbcb) ) + ROM_LOAD( "rom3.bin", 0x200000, 0x200000, CRC(51b9ebfb) SHA1(30e0c326f5175aa436df8dba08f6f4e08130b92f) ) + ROM_LOAD( "rom2.bin", 0x400000, 0x200000, CRC(b330e5e2) SHA1(5d48e9d56f99d093b6390e0af1609fd796df2d35) ) + ROM_LOAD( "rom1.bin", 0x600000, 0x200000, CRC(7eafdd70) SHA1(7c8da8e86c3f9491719b1d7d5d285568d7614f38) ) + + ROM_REGION( 0x010000, "text", 0 ) + ROM_LOAD( "text.u81", 0x00000, 0x08000, BAD_DUMP CRC(e67fd534) SHA1(987d0edffc2c243a13d4567319ea3d185eaadbf8) ) // should contain different title logo for this game + + ROM_REGION( 0x010000, "user1", 0 ) // not graphics + ROM_LOAD( "2#-256", 0x00000, 0x08000, CRC(456dd16e) SHA1(84779ee64d3ea33ba1ba4dee39b504a81c6811a1) ) ROM_REGION( 0x140000, "oki", 0 ) /* ADPCM Samples */ ROM_LOAD( "rom5.bin", 0x040000, 0x100000, CRC(f6d49863) SHA1(3a3c354852adad06e8a051511abfab7606bce382) ) @@ -5345,6 +5370,7 @@ GAME( 1996, bgaregganv, bgaregga, bgaregga, bgareggahk, toaplan2_state, bgaregga GAME( 1996, bgareggat2, bgaregga, bgaregga, bgaregga, toaplan2_state, bgaregga, ROT270, "Raizing / Eighting", "Battle Garegga - Type 2 (Europe / USA / Japan / Asia) (Sat Mar 2 1996)" , GAME_SUPPORTS_SAVE ) // displays Type 2 only when set to Europe GAME( 1996, bgareggacn, bgaregga, bgaregga, bgareggacn, toaplan2_state, bgaregga, ROT270, "Raizing / Eighting", "Battle Garegga - Type 2 (Denmark / China) (Tue Apr 2 1996)", GAME_SUPPORTS_SAVE ) // displays Type 2 only when set to Denmark GAME( 1996, bgareggabl, bgaregga, bgareggabl,bgareggacn, toaplan2_state,bgaregga, ROT270, "bootleg", "1945 Part-2 (Chinese hack of Battle Garegga)", GAME_SUPPORTS_SAVE ) +GAME( 1996, bgareggabla,bgaregga, bgareggabl,bgareggacn, toaplan2_state,bgaregga, ROT270, "bootleg", "Thunder Deity Biography (Chinese hack of Battle Garegga)", GAME_SUPPORTS_SAVE ) // these are all based on Version B, even if only the Japan version states 'version B' GAME( 1998, batrider, 0, batrider, batrider, toaplan2_state, batrider, ROT270, "Raizing / Eighting", "Armed Police Batrider (Europe) (Fri Feb 13 1998)", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/ttchamp.c b/src/mame/drivers/ttchamp.c index 849c8797da6..b93e5c0b4f2 100644 --- a/src/mame/drivers/ttchamp.c +++ b/src/mame/drivers/ttchamp.c @@ -1,8 +1,4 @@ -/* Peno Cup? - -no idea if this is the real title, I just see a large Peno Cup logo in the 2/3 roms - -looks like some kind of ping pong / tennis game? +/* Table Tennis Champions ? ___________________________________________________ | __ _________ __________ __________ | @@ -35,15 +31,38 @@ looks like some kind of ping pong / tennis game? The PCB is Spanish and manufacured by Gamart. ---- Need to work out how the program rom is banked ---- hw is similar to hotblock and twins +Table tennis Championships by Gamart 1995 + +This game come from Gamart,an obscure spanish software house. +Hardware info: +main cpu: V30 +sound chip: oki6295 +custom chip: tpc1020bfn x2 +osc: 16 mhz +Rom files definition: +ttennis2/3 main program +ttennis1 adpcm data +ttennis4/5 graphics +*there is a pic16c84 that i cannot dump because my programmer doesn't support it. + +Dumped by tirino73 >isolani (at) interfree.it< + + +- works in a very similar way to 'Spider' (twins.c) + including the blitter (seems to be doubled up hardware tho, twice as many layers?) +- need to work out how it selects between upper/lower + program roms as blitter source +- PIC is probably for sound +- more than one layer +- layer clearing + */ #include "emu.h" #include "cpu/nec/nec.h" - +#include "sound/okim6295.h" class ttchamp_state : public driver_device { @@ -53,36 +72,39 @@ public: m_maincpu(*this, "maincpu"), m_palette(*this, "palette") { } - UINT16* m_peno_vram; UINT16* m_peno_mainram; UINT16 m_paloff; DECLARE_WRITE16_MEMBER(paloff_w); DECLARE_WRITE16_MEMBER(pcup_prgbank_w); DECLARE_WRITE16_MEMBER(paldat_w); - DECLARE_READ16_MEMBER(peno_rand); - DECLARE_READ16_MEMBER(peno_rand2); + + DECLARE_WRITE16_MEMBER(port10_w); + UINT16 m_port10; + DECLARE_DRIVER_INIT(ttchamp); - DECLARE_WRITE16_MEMBER( penocup_vid_w ) - { - offset &=0x7fff; - COMBINE_DATA(&m_peno_vram[offset]); - } + DECLARE_READ16_MEMBER(ttchamp_blit_start_r); + + DECLARE_READ16_MEMBER(ttchamp_mem_r); + DECLARE_WRITE16_MEMBER(ttchamp_mem_w); + + UINT16 m_videoram0[0x10000 / 2]; + UINT16 m_videoram1[0x10000 / 2]; + UINT16 m_videoram2[0x10000 / 2]; - DECLARE_READ16_MEMBER( penocup_mainram_r ) - { - return m_peno_mainram[offset]; - } - DECLARE_WRITE16_MEMBER( penocup_mainram_w ) - { - offset &=0x7fff; - COMBINE_DATA(&m_peno_mainram[offset]); -// COMBINE_DATA(&m_peno_vram[offset]); - } + UINT16 m_mainram[0x10000 / 2]; + + int m_spritesinit; + int m_spriteswidth; + int m_spritesaddr; + + virtual void machine_start(); + UINT16* m_rom16; + UINT8* m_rom8; virtual void video_start(); UINT32 screen_update_ttchamp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -91,38 +113,28 @@ public: required_device<palette_device> m_palette; }; - +void ttchamp_state::machine_start() +{ + m_rom16 = (UINT16*)memregion("maincpu")->base(); + m_rom8 = memregion("maincpu")->base(); +} void ttchamp_state::video_start() { - m_peno_vram = (UINT16*)auto_alloc_array_clear(machine(), UINT16, 0x10000/2); - m_peno_mainram = (UINT16*)auto_alloc_array_clear(machine(), UINT16, 0x10000/2); - - } UINT32 ttchamp_state::screen_update_ttchamp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { + logerror("update\n"); int y,x,count; -// int i; + static const int xxx=320,yyy=204; bitmap.fill(m_palette->black_pen()); -// for (i=0;i<256;i++) -// { -// int dat,r,g,b; -// dat=(hotblock_pal[i*2+1]<<8)|hotblock_pal[i*2]; -// -// b = (dat>>10)&0x1f; -// g = (dat>>5)&0x1f; -// r = (dat>>0)&0x1f; -// m_palette->set_pen_color(i,pal5bit(r),pal5bit(g),pal5bit(b)); -// } - count=0; - UINT8 *videoram = (UINT8*)m_peno_vram; + UINT8 *videoram = (UINT8*)m_videoram0; for (y=0;y<yyy;y++) { for(x=0;x<xxx;x++) @@ -131,6 +143,41 @@ UINT32 ttchamp_state::screen_update_ttchamp(screen_device &screen, bitmap_ind16 count++; } } + + count=0; + videoram = (UINT8*)m_videoram1; + for (y=0;y<yyy;y++) + { + for(x=0;x<xxx;x++) + { + UINT8 pix = videoram[BYTE_XOR_LE(count)]; + if (pix) bitmap.pix16(y, x) = pix+0x200; + count++; + } + } + + count=0; + videoram = (UINT8*)m_videoram2; + for (y=0;y<yyy;y++) + { + for(x=0;x<xxx;x++) + { + UINT8 pix = videoram[BYTE_XOR_LE(count)]; + if (pix) bitmap.pix16(y, x) = pix+0x000; + count++; + } + } + + for (int i = 0; i < 0x8000; i++) + { + // how are layers cleared? + // I think it actually does more blit operations with + // different bits of m_port10 set to redraw the backgrounds using the video ram data as a source rather than ROM - notice the garbage you see behind 'sprites' right now + // this method also removes the text layer, which we don't want + m_videoram1[i] = 0x0000; + m_videoram2[i] = 0x0000; + } + return 0; } @@ -140,73 +187,173 @@ WRITE16_MEMBER(ttchamp_state::paloff_w) COMBINE_DATA(&m_paloff); } -#ifdef UNUSED_FUNCTION -WRITE16_MEMBER(ttchamp_state::pcup_prgbank_w) + +WRITE16_MEMBER(ttchamp_state::paldat_w) { - int bank; - UINT8 *ROM1 = memregion("user1")->base(); + m_palette->set_pen_color(m_paloff & 0x7fff,pal5bit(data>>0),pal5bit(data>>5),pal5bit(data>>10)); +} - if (ACCESSING_BITS_0_7) + +READ16_MEMBER(ttchamp_state::ttchamp_mem_r) +{ + // bits 0xf0 are used too, so this is likely wrong. + + UINT16* vram; + if ((m_port10&0xf) == 0x00) + vram = m_videoram0; + else if ((m_port10&0xf) == 0x01) + vram = m_videoram1; + else if ((m_port10&0xf) == 0x03) + vram = m_videoram2; + else { - bank = (data>>4) &0x07; - membank("bank2")->set_base(&ROM1[0x80000*(bank)]); + printf("unhandled video bank %02x\n", m_port10); + vram = m_videoram2; } -} -#endif -WRITE16_MEMBER(ttchamp_state::paldat_w) -{ - m_palette->set_pen_color(m_paloff & 0x7fff,pal5bit(data>>0),pal5bit(data>>5),pal5bit(data>>10)); + if (offset < 0x10000 / 2) + { + return m_mainram[offset&0x7fff]; + } + else if (offset < 0x20000 / 2) + { + return vram[offset&0x7fff]; + } + else + { + UINT16 *src = m_rom16 + (0x100000/2); // can the CPU ever see the lower bank? + return src[offset]; + } } -READ16_MEMBER(ttchamp_state::peno_rand) +WRITE16_MEMBER(ttchamp_state::ttchamp_mem_w) { - return 0xffff;// machine().rand(); + // this is very strange, we use the offset (address bits) not data bits to set values.. + // I get the impression this might actually overlay the entire address range, including RAM and regular VRAM? + + // bits 0xf0 are used too, so this is likely wrong. + + UINT16* vram; + if ((m_port10&0xf) == 0x00) + vram = m_videoram0; + else if ((m_port10&0xf) == 0x01) + vram = m_videoram1; + else if ((m_port10&0xf) == 0x03) + vram = m_videoram2; + else + { + printf("unhandled video bank %02x\n", m_port10); + vram = m_videoram2; + } + + + if (m_spritesinit == 1) + { + // printf("spider_blitter_w %08x %04x %04x (init?) (base?)\n", offset * 2, data, mem_mask); + + m_spritesinit = 2; + m_spritesaddr = offset; + } + else if (m_spritesinit == 2) + { + // printf("spider_blitter_w %08x %04x %04x (init2) (width?)\n", offset * 2, data, mem_mask); + m_spriteswidth = offset & 0xff; + if (m_spriteswidth == 0) + m_spriteswidth = 80; + + m_spritesinit = 0; + + } + else + { + if (offset < 0x10000 / 2) + { + COMBINE_DATA(&m_mainram[offset&0x7fff]); + } + else if (offset < 0x20000 / 2) + { + COMBINE_DATA(&vram[offset&0x7fff]); + } + else if (offset < 0x40000 / 2) + { + // 0x30000-0x3ffff and 0x40000-0x4ffff seem to be used here? + offset &= 0x7fff; + + UINT8 *src = m_rom8; + + if (m_port10 & 2) // NO, wrong for the portraits + src += 0x100000; + + // printf("spider_blitter_w %08x %04x %04x (previous data width %d address %08x)\n", offset * 2, data, mem_mask, m_spriteswidth, m_spritesaddr); + offset &= 0x7fff; + + for (int i = 0; i < m_spriteswidth; i++) + { + UINT8 data; + + data = (src[(m_spritesaddr * 2) + 1]); + + if (data) + vram[offset] = (vram[offset] & 0x00ff) | data << 8; + + + data = src[(m_spritesaddr*2)]; + + if (data) + vram[offset] = (vram[offset] & 0xff00) | data; + + + m_spritesaddr ++; + offset++; + + offset &= 0x7fff; + } + } + else + { + logerror("spider_blitter_w unhandled RAM access %08x %04x %04x\n", offset * 2, data, mem_mask); + } + } } -#ifdef UNUSED_FUNCTION -READ16_MEMBER(ttchamp_state::peno_rand2) +READ16_MEMBER(ttchamp_state::ttchamp_blit_start_r) { - return machine().rand(); + m_spritesinit = 1; + return 0xff; } -#endif static ADDRESS_MAP_START( ttchamp_map, AS_PROGRAM, 16, ttchamp_state ) - AM_RANGE(0x00000, 0x0ffff) AM_RAM AM_READWRITE(penocup_mainram_r, penocup_mainram_w) - - /* 0x10000 - 0x1ffff is where it writes most image stuff, but other address get written to 0 where the left edge of 'sprites' would be? why? bad code execution, or some kind of write address based blitter? - see for example the lines written down the side of where the (not displayed) CREDIT text would go, as well as beside the actual credit number.. also ingame if you can get it to start - */ + AM_RANGE(0x00000, 0xfffff) AM_READWRITE(ttchamp_mem_r, ttchamp_mem_w) +ADDRESS_MAP_END - AM_RANGE(0x10000, 0xfffff) AM_WRITE(penocup_vid_w) +WRITE16_MEMBER(ttchamp_state::port10_w) +{ + COMBINE_DATA(&m_port10); +} - // how are these banked? what are the bank sizes? data needed for startup is at 0x20000-0x2ffff (strings) and 0x30000-0x3ffff (code) the rest seems to be graphics.. - AM_RANGE(0x00000, 0x7ffff) AM_ROMBANK("bank1") // ? - AM_RANGE(0x80000, 0xfffff) AM_ROMBANK("bank2") // ? -ADDRESS_MAP_END static ADDRESS_MAP_START( ttchamp_io, AS_IO, 16, ttchamp_state ) - AM_RANGE(0x0000, 0x0001) AM_WRITENOP +// AM_RANGE(0x0000, 0x0001) AM_WRITENOP AM_RANGE(0x0002, 0x0003) AM_READ_PORT("SYSTEM") AM_RANGE(0x0004, 0x0005) AM_READ_PORT("P1_P2") -// AM_RANGE(0x0018, 0x0019) AM_READ(peno_rand2) -// AM_RANGE(0x001e, 0x001f) AM_READ(peno_rand2) + AM_RANGE(0x0006, 0x0007) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) + + AM_RANGE(0x0018, 0x0019) AM_READ(ttchamp_blit_start_r) + AM_RANGE(0x001e, 0x001f) AM_READNOP // read before each line is blit AM_RANGE(0x0008, 0x0009) AM_WRITE(paldat_w) AM_RANGE(0x000a, 0x000b) AM_WRITE(paloff_w) -// AM_RANGE(0x0010, 0x0010) AM_WRITE(pcup_prgbank_w) - AM_RANGE(0x0010, 0x0011) AM_WRITENOP + AM_RANGE(0x0010, 0x0011) AM_WRITE(port10_w) - AM_RANGE(0x0020, 0x0021) AM_WRITENOP +// AM_RANGE(0x0020, 0x0021) AM_WRITENOP - AM_RANGE(0x0034, 0x0035) AM_READ(peno_rand) AM_WRITENOP +// AM_RANGE(0x0034, 0x0035) AM_READ(peno_rand) AM_WRITENOP ADDRESS_MAP_END - static INPUT_PORTS_START(ttchamp) PORT_START("SYSTEM") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) @@ -296,91 +443,47 @@ static MACHINE_CONFIG_START( ttchamp, ttchamp_state ) MCFG_PALETTE_ADD("palette", 0x8000) -MACHINE_CONFIG_END + MCFG_SPEAKER_STANDARD_MONO("mono") -ROM_START( ttchamp ) + MCFG_OKIM6295_ADD("oki", 8000000/8, OKIM6295_PIN7_HIGH) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) - /* hopefully this is a good dump */ +MACHINE_CONFIG_END - ROM_REGION16_LE( 0x200000, "user1", 0 ) +ROM_START( ttchamp ) + ROM_REGION16_LE( 0x200000, "maincpu", 0 ) ROM_LOAD16_BYTE( "2.bin", 0x000000, 0x080000, CRC(6a6c6d75) SHA1(3742b82462176d77732a69e142db9e6f61f25dc5) ) ROM_LOAD16_BYTE( "3.bin", 0x000001, 0x080000, CRC(6062c0b2) SHA1(c5f0ac58c847ce2588c805f40180f2586a6477b7) ) ROM_LOAD16_BYTE( "4.bin", 0x100000, 0x080000, CRC(4388dead) SHA1(1965e4b84452b244e32c8d218aace8d287c67ec2) ) ROM_LOAD16_BYTE( "5.bin", 0x100001, 0x080000, CRC(fdbf9b28) SHA1(2d260555586097c8a396f65111f55ace801c7a5d) ) - /* dumps below are bad dumps */ - - /* dump a */ -// ROM_REGION( 0x200000, "user1", 0 ) -// ROM_LOAD16_BYTE( "27c040_dump_a.2", 0x000000, 0x080000, BAD_DUMP CRC(791d68c8) SHA1(641c989d50e95ac3ff7c87d148cfab44abbdc774) ) -// ROM_LOAD16_BYTE( "27c040_dump_a.3", 0x000001, 0x080000, BAD_DUMP CRC(00c81241) SHA1(899d4d1566f5f5d2967b6a8ec7dca60833846bbe) ) -// ROM_LOAD16_BYTE( "27c040_dump_a.4", 0x100000, 0x080000, BAD_DUMP CRC(11af50f6) SHA1(1e5b6cc5c5a6c1ec302b2de7ce40c9ebfb349b46) ) -// ROM_LOAD16_BYTE( "27c040_dump_a.5", 0x100001, 0x080000, BAD_DUMP CRC(f6b87231) SHA1(3db461c0858c207e8a3dfd822c99d28e3a26b4ee) ) - - /* dump b */ -// ROM_REGION( 0x200000, "user2", 0 ) -// ROM_LOAD16_BYTE( "27c040_dump_b.2", 0x000000, 0x080000, BAD_DUMP CRC(df1f2618) SHA1(7c6abb7a6ec55c49b95809f003d217f1ea758729) ) -// ROM_LOAD16_BYTE( "27c040_dump_b.3", 0x000001, 0x080000, BAD_DUMP CRC(0292ca69) SHA1(fe3b0e78d9e946d8f8a86e8246e5a94483f44ce1) ) -// ROM_LOAD16_BYTE( "27c040_dump_b.4", 0x100000, 0x080000, BAD_DUMP CRC(f6bcadc6) SHA1(d8c61c207175d67f4229103696dc2a4447af2ba4) ) -// ROM_LOAD16_BYTE( "27c040_dump_b.5", 0x100001, 0x080000, BAD_DUMP CRC(b872747c) SHA1(24d2aa2603a71cdfd3d45608177bb60ab7cfe8a2) ) - - /* dump c */ -// ROM_REGION( 0x200000, "user3", 0 ) -// ROM_LOAD16_BYTE( "27c040_dump_c.2", 0x000000, 0x080000, BAD_DUMP CRC(be70adc7) SHA1(fe439caa54856c75ef310e456a7e61b15321031d) ) -// ROM_LOAD16_BYTE( "27c040_dump_c.3", 0x000001, 0x080000, BAD_DUMP CRC(8e3b3396) SHA1(f47243041b9283712e34ea58fa2456c35785c5ee) ) -// ROM_LOAD16_BYTE( "27c040_dump_c.4", 0x100000, 0x080000, BAD_DUMP CRC(34ab75e9) SHA1(779f03139b336cdc46f4d00bf3fd9e6de79942e2) ) -// ROM_LOAD16_BYTE( "27c040_dump_c.5", 0x100001, 0x080000, BAD_DUMP CRC(3e7b3533) SHA1(433439c2b8a8e54bb20fc3c1690d3f183c6fa6f6) ) - - /* these were the same in each dump..*/ - ROM_REGION( 0x10000, "cpu1", 0 ) /* not verified if this is correct yet, seems very empty, maybe protected */ - ROM_LOAD( "pic16c84.rom", 0x000000, 0x4280, CRC(900f2ef8) SHA1(08f206fe52f413437436e4b0d2b4ec310767446c) ) - - ROM_REGION( 0x40000, "samples", 0 ) + ROM_REGION( 0x10000, "cpu1", 0 ) // read protected, only half the data is valid + ROM_LOAD( "pic16c84.rom", 0x000000, 0x4280, BAD_DUMP CRC(900f2ef8) SHA1(08f206fe52f413437436e4b0d2b4ec310767446c) ) + + ROM_REGION( 0x40000, "oki", 0 ) ROM_LOAD( "27c020.1", 0x000000, 0x040000, CRC(e2c4fe95) SHA1(da349035cc348db220a1e12b4c2a6021e2168425) ) ROM_END -/* - -Table tennis Championships by Gamart 1995 - -This game come from Gamart,an obscure spanish software house. -Hardware info: -main cpu: V30 -sound chip: oki6295 -custom chip: tpc1020bfn x2 -osc: 16 mhz -Rom files definition: -ttennis2/3 main program -ttennis1 adpcm data -ttennis4/5 graphics -*there is a pic16c84 that i cannot dump because my programmer doesn't support it. - -Dumped by tirino73 >isolani (at) interfree.it< - -*/ - ROM_START( ttchampa ) - /* this is from a different board */ - - ROM_REGION16_LE( 0x200000, "user1", 0 ) + ROM_REGION16_LE( 0x200000, "maincpu", 0 ) ROM_LOAD16_BYTE( "ttennis2.bin", 0x000000, 0x080000, CRC(b060e72c) SHA1(376e71bb4b1687fec4b719cbc5a7b25b64d159ac) ) ROM_LOAD16_BYTE( "ttennis3.bin", 0x000001, 0x080000, CRC(33e085a8) SHA1(ea6af05690b4b0803c303a3c858df10e4d907fb1) ) ROM_LOAD16_BYTE( "4.bin", 0x100000, 0x080000, CRC(4388dead) SHA1(1965e4b84452b244e32c8d218aace8d287c67ec2) ) ROM_LOAD16_BYTE( "5.bin", 0x100001, 0x080000, CRC(fdbf9b28) SHA1(2d260555586097c8a396f65111f55ace801c7a5d) ) - ROM_REGION( 0x10000, "cpu1", 0 ) /* not verified if this is correct yet, seems very empty, maybe protected */ - ROM_LOAD( "pic16c84.rom", 0x000000, 0x4280, CRC(900f2ef8) SHA1(08f206fe52f413437436e4b0d2b4ec310767446c) ) + ROM_REGION( 0x10000, "cpu1", 0 ) // read protected, only half the data is valid + ROM_LOAD( "pic16c84.rom", 0x000000, 0x4280, BAD_DUMP CRC(900f2ef8) SHA1(08f206fe52f413437436e4b0d2b4ec310767446c) ) - ROM_REGION( 0x40000, "samples", 0 ) + ROM_REGION( 0x40000, "oki", 0 ) ROM_LOAD( "27c020.1", 0x000000, 0x040000, CRC(e2c4fe95) SHA1(da349035cc348db220a1e12b4c2a6021e2168425) ) ROM_END DRIVER_INIT_MEMBER(ttchamp_state,ttchamp) { - UINT8 *ROM1 = memregion("user1")->base(); - membank("bank1")->set_base(&ROM1[0x100000]); - membank("bank2")->set_base(&ROM1[0x180000]); +// UINT8 *ROM1 = memregion("user1")->base(); +// membank("bank1")->set_base(&ROM1[0x100000]); +// membank("bank2")->set_base(&ROM1[0x180000]); } -GAME( 1995, ttchamp, 0, ttchamp, ttchamp, ttchamp_state, ttchamp, ROT0, "Gamart", "Table Tennis Champions (set 1)", GAME_NOT_WORKING|GAME_NO_SOUND ) -GAME( 1995, ttchampa,ttchamp, ttchamp, ttchamp, ttchamp_state, ttchamp, ROT0, "Gamart", "Table Tennis Champions (set 2)", GAME_NOT_WORKING|GAME_NO_SOUND ) +GAME( 1995, ttchamp, 0, ttchamp, ttchamp, ttchamp_state, ttchamp, ROT0, "Gamart", "Table Tennis Champions", GAME_NOT_WORKING ) // this has various advertising boards, including 'Electronic Devices' and 'Deniam' +GAME( 1995, ttchampa,ttchamp, ttchamp, ttchamp, ttchamp_state, ttchamp, ROT0, "Gamart (Palencia Elektronik license)", "Table Tennis Champions (Palencia Elektronik license)", GAME_NOT_WORKING ) // this only has Palencia Elektronik advertising boards diff --git a/src/mame/drivers/twins.c b/src/mame/drivers/twins.c index a80c9b1e685..6ee893004dc 100644 --- a/src/mame/drivers/twins.c +++ b/src/mame/drivers/twins.c @@ -28,7 +28,7 @@ Notes: -seems a similar board to hotblocks +seems a similar board to Hot Blocks same TPC1020 AFN-084C chip same 24c02 eeprom @@ -39,19 +39,27 @@ video is not banked in this case instead palette data is sent to the ports strange palette format. todo: -hook up eeprom -takes a long time to boot (eeprom?) - +hook up eeprom (doesn't seem to work when hooked up??) +Twins set 1 takes a long time to boot (eeprom?) +Improve blitter / clear logic for Spider. Electronic Devices was printed on rom labels 1994 date string is in ROM +Spider PCB appears almost identical but uses additional 'blitter' features. +It is possible the Twins PCB has them too and doesn't use them. + + +Twins (set 2) is significantly changed hardware, uses a regular RAMDAC hookup for plaette etc. + + */ #include "emu.h" #include "cpu/nec/nec.h" #include "sound/ay8910.h" - +#include "machine/i2cmem.h" +#include "video/ramdac.h" class twins_state : public driver_device { @@ -59,98 +67,263 @@ public: twins_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), - m_videoram(*this, "videoram"), m_paletteram(*this, "paletteram"), - m_palette(*this, "palette") { } + m_palette(*this, "palette"), + m_i2cmem(*this, "i2cmem"), + m_spritesinit(0), + m_videorambank(0) + { } required_device<cpu_device> m_maincpu; - required_shared_ptr<UINT16> m_videoram; - required_shared_ptr<UINT16> m_paletteram; + optional_shared_ptr<UINT16> m_paletteram; required_device<palette_device> m_palette; + optional_device<i2cmem_device> m_i2cmem; UINT16 m_paloff; DECLARE_READ16_MEMBER(twins_port4_r); DECLARE_WRITE16_MEMBER(twins_port4_w); - DECLARE_WRITE16_MEMBER(port6_pal0_w); + DECLARE_WRITE16_MEMBER(twins_pal_w); + DECLARE_WRITE16_MEMBER(spider_pal_w); DECLARE_WRITE16_MEMBER(porte_paloff0_w); - DECLARE_WRITE16_MEMBER(twinsa_port4_w); - DECLARE_READ16_MEMBER(twinsa_unk_r); + DECLARE_WRITE16_MEMBER(spider_paloff0_w); + DECLARE_WRITE16_MEMBER(spider_blitter_w); + DECLARE_READ16_MEMBER(spider_blitter_r); + + DECLARE_READ16_MEMBER(spider_port_18_r); + DECLARE_READ16_MEMBER(spider_port_1e_r); + DECLARE_WRITE16_MEMBER(spider_port_1a_w); + DECLARE_WRITE16_MEMBER(spider_port_1c_w); + int m_spritesinit; + int m_spriteswidth; + int m_spritesaddr; + + UINT16 m_mainram[0x10000 / 2]; + UINT16 m_videoram[0x10000 / 2]; + UINT16 m_videoram2[0x10000 / 2]; + UINT16 m_videorambank; + DECLARE_VIDEO_START(twins); DECLARE_VIDEO_START(twinsa); UINT32 screen_update_twins(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_twinsa(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + UINT32 screen_update_spider(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + virtual void machine_start(); + UINT16* m_rom16; + UINT8* m_rom8; + }; +void twins_state::machine_start() +{ + m_rom16 = (UINT16*)memregion("maincpu")->base(); + m_rom8 = memregion("maincpu")->base(); +} /* port 4 is eeprom */ READ16_MEMBER(twins_state::twins_port4_r) { - return 0xffff; +// doesn't work?? +// printf("%08x: twins_port4_r %04x\n", space.device().safe_pc(), mem_mask); +// return m_i2cmem->read_sda();// | 0xfffe; + + return 0x0001; } WRITE16_MEMBER(twins_state::twins_port4_w) { +// printf("%08x: twins_port4_w %04x %04x\n", space.device().safe_pc(), data, mem_mask); + int i2c_clk = BIT(data, 1); + int i2c_mem = BIT(data, 0); + m_i2cmem->write_scl(i2c_clk); + m_i2cmem->write_sda(i2c_mem); } -WRITE16_MEMBER(twins_state::port6_pal0_w) +WRITE16_MEMBER(twins_state::twins_pal_w) { COMBINE_DATA(&m_paletteram[m_paloff]); + + { + int dat,r,g,b; + dat = m_paletteram[m_paloff]; + + r = dat & 0x1f; + r = BITSWAP8(r,7,6,5,0,1,2,3,4); + + g = (dat>>5) & 0x1f; + g = BITSWAP8(g,7,6,5,0,1,2,3,4); + + b = (dat>>10) & 0x1f; + b = BITSWAP8(b,7,6,5,0,1,2,3,4); + + m_palette->set_pen_color(m_paloff, pal5bit(r),pal5bit(g),pal5bit(b)); + + } + m_paloff = (m_paloff + 1) & 0xff; } /* ??? weird ..*/ WRITE16_MEMBER(twins_state::porte_paloff0_w) { +// printf("porte_paloff0_w %04x\n", data); m_paloff = 0; } +READ16_MEMBER(twins_state::spider_blitter_r) +{ + UINT16* vram; + if (m_videorambank & 1) + vram = m_videoram2; + else + vram = m_videoram; + + if (offset < 0x10000 / 2) + { + return m_mainram[offset&0x7fff]; + } + else if (offset < 0x20000 / 2) + { + return vram[offset&0x7fff]; + } + else + { + UINT16 *src = m_rom16; + return src[offset]; + } +} + + +WRITE16_MEMBER(twins_state::spider_blitter_w) +{ + // this is very strange, we use the offset (address bits) not data bits to set values.. + // I get the impression this might actually overlay the entire address range, including RAM and regular VRAM? + UINT16* vram; + if (m_videorambank & 1) + vram = m_videoram2; + else + vram = m_videoram; + + if (m_spritesinit == 1) + { + // printf("spider_blitter_w %08x %04x %04x (init?) (base?)\n", offset * 2, data, mem_mask); + + m_spritesinit = 2; + m_spritesaddr = offset; + } + else if (m_spritesinit == 2) + { + // printf("spider_blitter_w %08x %04x %04x (init2) (width?)\n", offset * 2, data, mem_mask); + m_spriteswidth = offset & 0xff; + if (m_spriteswidth == 0) + m_spriteswidth = 80; + + m_spritesinit = 0; + + } + else + { + if (offset < 0x10000 / 2) + { + COMBINE_DATA(&m_mainram[offset&0x7fff]); + } + else if (offset < 0x20000 / 2) + { + COMBINE_DATA(&vram[offset&0x7fff]); + } + else if (offset < 0x30000 / 2) + { + UINT8 *src = m_rom8; + + // printf("spider_blitter_w %08x %04x %04x (previous data width %d address %08x)\n", offset * 2, data, mem_mask, m_spriteswidth, m_spritesaddr); + offset &= 0x7fff; + + for (int i = 0; i < m_spriteswidth; i++) + { + UINT8 data; + + data = (src[(m_spritesaddr * 2) + 1]); + + if (data) + vram[offset] = (vram[offset] & 0x00ff) | data << 8; + + + data = src[(m_spritesaddr*2)]; + + if (data) + vram[offset] = (vram[offset] & 0xff00) | data; + + + m_spritesaddr ++; + offset++; + + offset &= 0x7fff; + } + } + else + { + printf("spider_blitter_w unhandled RAM access %08x %04x %04x", offset * 2, data, mem_mask); + } + } +} + + static ADDRESS_MAP_START( twins_map, AS_PROGRAM, 16, twins_state ) - AM_RANGE(0x00000, 0x0ffff) AM_RAM - AM_RANGE(0x10000, 0x1ffff) AM_RAM AM_SHARE("videoram") - AM_RANGE(0x20000, 0xfffff) AM_ROM + AM_RANGE(0x00000, 0xfffff) AM_READWRITE(spider_blitter_r, spider_blitter_w) ADDRESS_MAP_END static ADDRESS_MAP_START( twins_io, AS_IO, 16, twins_state ) AM_RANGE(0x0000, 0x0003) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff) AM_RANGE(0x0002, 0x0003) AM_DEVREAD8("aysnd", ay8910_device, data_r, 0x00ff) AM_RANGE(0x0004, 0x0005) AM_READWRITE(twins_port4_r, twins_port4_w) - AM_RANGE(0x0006, 0x0007) AM_WRITE(port6_pal0_w) AM_SHARE("paletteram") + AM_RANGE(0x0006, 0x0007) AM_WRITE(twins_pal_w) AM_SHARE("paletteram") AM_RANGE(0x000e, 0x000f) AM_WRITE(porte_paloff0_w) ADDRESS_MAP_END VIDEO_START_MEMBER(twins_state,twins) { save_item(NAME(m_paloff)); - m_paloff = 0; + + save_item(NAME(m_spritesinit)); + save_item(NAME(m_spriteswidth)); + save_item(NAME(m_spritesaddr)); + save_item(NAME(m_mainram)); + save_item(NAME(m_videoram)); + save_item(NAME(m_videoram2)); + save_item(NAME(m_videorambank)); } + + + UINT32 twins_state::screen_update_twins(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int y,x,count; - int i; static const int xxx=320,yyy=204; bitmap.fill(m_palette->black_pen()); - for (i=0;i<0x100;i++) + count=0; + UINT8 *videoram = (UINT8*)m_videoram; + for (y=0;y<yyy;y++) { - int dat,r,g,b; - dat = m_paletteram[i]; - - r = dat & 0x1f; - r = BITSWAP8(r,7,6,5,0,1,2,3,4); - - g = (dat>>5) & 0x1f; - g = BITSWAP8(g,7,6,5,0,1,2,3,4); + for(x=0;x<xxx;x++) + { + bitmap.pix16(y, x) = videoram[BYTE_XOR_LE(count)]; + count++; + } + } + return 0; +} - b = (dat>>10) & 0x1f; - b = BITSWAP8(b,7,6,5,0,1,2,3,4); +UINT32 twins_state::screen_update_spider(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + int y,x,count; + static const int xxx=320,yyy=204; - m_palette->set_pen_color(i, pal5bit(r),pal5bit(g),pal5bit(b)); - } + bitmap.fill(m_palette->black_pen()); count=0; - UINT8 *videoram = reinterpret_cast<UINT8 *>(m_videoram.target()); + UINT8 *videoram = (UINT8*)m_videoram; for (y=0;y<yyy;y++) { for(x=0;x<xxx;x++) @@ -159,10 +332,22 @@ UINT32 twins_state::screen_update_twins(screen_device &screen, bitmap_ind16 &bit count++; } } + + count = 0; + videoram = (UINT8*)m_videoram2; + for (y=0;y<yyy;y++) + { + for(x=0;x<xxx;x++) + { + UINT8 pixel = videoram[BYTE_XOR_LE(count)]; + if (pixel) bitmap.pix16(y, x) = pixel; + count++; + } + } + return 0; } - static INPUT_PORTS_START(twins) PORT_START("P1") /* 8bit */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) @@ -201,6 +386,8 @@ static MACHINE_CONFIG_START( twins, twins_state ) MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 200-1) MCFG_SCREEN_UPDATE_DRIVER(twins_state, screen_update_twins) MCFG_SCREEN_PALETTE("palette") + + MCFG_24C02_ADD("i2cmem") MCFG_PALETTE_ADD("palette", 0x100) @@ -224,64 +411,156 @@ VIDEO_START_MEMBER(twins_state,twinsa) m_paloff = 0; } -UINT32 twins_state::screen_update_twinsa(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - int y,x,count; - int i; - static const int xxx=320,yyy=204; - bitmap.fill(m_palette->black_pen()); - for (i=0;i<0x1000-3;i+=3) +static ADDRESS_MAP_START( twinsa_io, AS_IO, 16, twins_state ) + AM_RANGE(0x0000, 0x0001) AM_DEVWRITE8("ramdac",ramdac_device,index_w,0x00ff) + AM_RANGE(0x0002, 0x0003) AM_DEVWRITE8("ramdac",ramdac_device,mask_w,0x00ff) + AM_RANGE(0x0004, 0x0005) AM_DEVREADWRITE8("ramdac",ramdac_device,pal_r,pal_w,0x00ff) + AM_RANGE(0x0008, 0x0009) AM_DEVWRITE8("aysnd", ay8910_device, address_w, 0x00ff) + AM_RANGE(0x0010, 0x0011) AM_DEVREADWRITE8("aysnd", ay8910_device, data_r, data_w, 0x00ff) + AM_RANGE(0x0018, 0x0019) AM_READ(twins_port4_r) AM_WRITE(twins_port4_w) +ADDRESS_MAP_END + + +static ADDRESS_MAP_START( ramdac_map, AS_0, 8, twins_state ) + AM_RANGE(0x000, 0x3ff) AM_DEVREADWRITE("ramdac",ramdac_device,ramdac_pal_r,ramdac_rgb666_w) +ADDRESS_MAP_END + + +static MACHINE_CONFIG_START( twinsa, twins_state ) + /* basic machine hardware */ + MCFG_CPU_ADD("maincpu", V30, XTAL_16MHz/2) /* verified on pcb */ + MCFG_CPU_PROGRAM_MAP(twins_map) + MCFG_CPU_IO_MAP(twinsa_io) + MCFG_CPU_VBLANK_INT_DRIVER("screen", twins_state, nmi_line_pulse) + + /* video hardware */ + MCFG_SCREEN_ADD("screen", RASTER) + MCFG_SCREEN_REFRESH_RATE(50) + MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) + MCFG_SCREEN_SIZE(320,256) + MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 200-1) + MCFG_SCREEN_UPDATE_DRIVER(twins_state, screen_update_twins) + MCFG_SCREEN_PALETTE("palette") + + MCFG_PALETTE_ADD("palette", 256) + MCFG_RAMDAC_ADD("ramdac", ramdac_map, "palette") + MCFG_RAMDAC_SPLIT_READ(0) + + MCFG_24C02_ADD("i2cmem") + + MCFG_VIDEO_START_OVERRIDE(twins_state,twinsa) + + /* sound hardware */ + MCFG_SPEAKER_STANDARD_MONO("mono") + + MCFG_SOUND_ADD("aysnd", AY8910, XTAL_16MHz/8) /* verified on pcb */ + MCFG_AY8910_PORT_A_READ_CB(IOPORT("P1")) + MCFG_AY8910_PORT_B_READ_CB(IOPORT("P2")) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) +MACHINE_CONFIG_END + +WRITE16_MEMBER(twins_state::spider_pal_w) +{ + // ths first write doesn't appear to be a palette value + if (m_paloff!=0) { - int r,g,b; - r = m_paletteram[i]; - g = m_paletteram[i+1]; - b = m_paletteram[i+2]; + COMBINE_DATA(&m_paletteram[m_paloff-1]); + int dat,r,g,b; + dat = m_paletteram[m_paloff-1]; - m_palette->set_pen_color(i/3, pal6bit(r), pal6bit(g), pal6bit(b)); + r = dat & 0x1f; + g = (dat>>5) & 0x1f; + b = (dat>>10) & 0x1f; + m_palette->set_pen_color(m_paloff-1, pal5bit(r),pal5bit(g),pal5bit(b)); } + else + { + // printf("first palette write %04x\n", data); + } + + m_paloff++; - count=0; - UINT8 *videoram = reinterpret_cast<UINT8 *>(m_videoram.target()); - for (y=0;y<yyy;y++) + if (m_paloff == 0x101) + m_paloff = 0; +} + + +WRITE16_MEMBER(twins_state::spider_paloff0_w) +{ + // this seems to be video ram banking + COMBINE_DATA(&m_videorambank); +} + +WRITE16_MEMBER(twins_state::spider_port_1a_w) +{ + // writes 1 +} + + +WRITE16_MEMBER(twins_state::spider_port_1c_w) +{ + // done before the 'sprite' read / writes + // might clear a buffer? + + // game is only animating sprites at 30fps, maybe there's some double buffering too? + + UINT16* vram; + if (m_videorambank & 1) + vram = m_videoram2; + else + vram = m_videoram; + + for (int i = 0; i < 0x8000; i++) { - for(x=0;x<xxx;x++) - { - bitmap.pix16(y, x) = videoram[BYTE_XOR_LE(count)]; - count++; - } + vram[i] = 0x0000; } - return 0; + } -WRITE16_MEMBER(twins_state::twinsa_port4_w) + +READ16_MEMBER(twins_state::spider_port_18_r) { - m_paletteram[m_paloff&0xfff] = data; - m_paloff++; -// printf("paloff %04x\n",m_paloff); + // read before each blitter command + // seems to put the bus in a state where the next 2 bus access offsets (anywhere) are the blitter params + m_spritesinit = 1; + + return 0xff; } -READ16_MEMBER(twins_state::twinsa_unk_r) +READ16_MEMBER(twins_state::spider_port_1e_r) { - return 0xffff; + // done before each sprite pixel 'write' + // the data read is the data written, but only reads one pixel?? + return 0xff; } -static ADDRESS_MAP_START( twinsa_io, AS_IO, 16, twins_state ) - AM_RANGE(0x0000, 0x0001) AM_READWRITE(twinsa_unk_r, porte_paloff0_w) - AM_RANGE(0x0002, 0x0003) AM_WRITE(porte_paloff0_w) - AM_RANGE(0x0004, 0x0005) AM_WRITE(twinsa_port4_w) AM_SHARE("paletteram") - AM_RANGE(0x0008, 0x0009) AM_DEVWRITE8("aysnd", ay8910_device, address_w, 0x00ff) - AM_RANGE(0x0010, 0x0011) AM_DEVREADWRITE8("aysnd", ay8910_device, data_r, data_w, 0x00ff) - AM_RANGE(0x0018, 0x0019) AM_READ(twins_port4_r) AM_WRITE(twins_port4_w) + +static ADDRESS_MAP_START( spider_io, AS_IO, 16, twins_state ) + AM_RANGE(0x0000, 0x0003) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff) + AM_RANGE(0x0002, 0x0003) AM_DEVREAD8("aysnd", ay8910_device, data_r, 0x00ff) + AM_RANGE(0x0004, 0x0005) AM_READWRITE(twins_port4_r, twins_port4_w) + AM_RANGE(0x0008, 0x0009) AM_WRITE(spider_pal_w) AM_SHARE("paletteram") + AM_RANGE(0x0010, 0x0011) AM_WRITE(spider_paloff0_w) + + AM_RANGE(0x0018, 0x0019) AM_READ(spider_port_18_r) + AM_RANGE(0x001a, 0x001b) AM_WRITE(spider_port_1a_w) + AM_RANGE(0x001c, 0x001d) AM_WRITE(spider_port_1c_w) + AM_RANGE(0x001e, 0x001f) AM_READ(spider_port_1e_r) + + ADDRESS_MAP_END -static MACHINE_CONFIG_START( twinsa, twins_state ) + + + +static MACHINE_CONFIG_START( spider, twins_state ) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", V30, XTAL_16MHz/2) /* verified on pcb */ + MCFG_CPU_ADD("maincpu", V30, 8000000) MCFG_CPU_PROGRAM_MAP(twins_map) - MCFG_CPU_IO_MAP(twinsa_io) + MCFG_CPU_IO_MAP(spider_io) MCFG_CPU_VBLANK_INT_DRIVER("screen", twins_state, nmi_line_pulse) /* video hardware */ @@ -290,19 +569,22 @@ static MACHINE_CONFIG_START( twinsa, twins_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(320,256) MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 200-1) - MCFG_SCREEN_UPDATE_DRIVER(twins_state, screen_update_twinsa) + MCFG_SCREEN_UPDATE_DRIVER(twins_state, screen_update_spider) MCFG_SCREEN_PALETTE("palette") - MCFG_PALETTE_ADD("palette", 0x1000) + MCFG_PALETTE_ADD("palette", 0x100) - MCFG_VIDEO_START_OVERRIDE(twins_state,twinsa) + MCFG_VIDEO_START_OVERRIDE(twins_state,twins) + + MCFG_24C02_ADD("i2cmem") /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_SOUND_ADD("aysnd", AY8910, XTAL_16MHz/8) /* verified on pcb */ + MCFG_SOUND_ADD("aysnd", AY8910, 2000000) MCFG_AY8910_PORT_A_READ_CB(IOPORT("P1")) MCFG_AY8910_PORT_B_READ_CB(IOPORT("P2")) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END @@ -337,5 +619,13 @@ ROM_START( twinsa ) ROM_LOAD16_BYTE( "hp.bin", 0x000001, 0x080000, CRC(aaf74b83) SHA1(09bd76b9fc5cb7ba6ffe1a2581ffd5633fe440b3) ) ROM_END +ROM_START( spider ) + ROM_REGION( 0x100000, "maincpu", 0 ) + ROM_LOAD16_BYTE( "20.bin", 0x000001, 0x080000, CRC(25e15f11) SHA1(b728f35c817f60a294e38d66559da8977b94a1f5) ) + ROM_LOAD16_BYTE( "21.bin", 0x000000, 0x080000, CRC(ff224206) SHA1(d8d45850983542e811facc917d016841fc56a97f) ) +ROM_END + GAME( 1994, twins, 0, twins, twins, driver_device, 0, ROT0, "Electronic Devices", "Twins (set 1)", GAME_SUPPORTS_SAVE ) GAME( 1994, twinsa, twins, twinsa, twins, driver_device, 0, ROT0, "Electronic Devices", "Twins (set 2)", GAME_SUPPORTS_SAVE ) + +GAME( 1994, spider, 0, spider, twins, driver_device, 0, ROT0, "Buena Vision", "Spider", GAME_IMPERFECT_GRAPHICS ) diff --git a/src/mame/includes/dynax.h b/src/mame/includes/dynax.h index 45b87468847..45c74dde3f0 100644 --- a/src/mame/includes/dynax.h +++ b/src/mame/includes/dynax.h @@ -125,6 +125,7 @@ public: DECLARE_WRITE8_MEMBER(hanamai_keyboard_w); DECLARE_WRITE8_MEMBER(dynax_rombank_w); DECLARE_WRITE8_MEMBER(jantouki_sound_rombank_w); + DECLARE_WRITE8_MEMBER(cdracula_sound_rombank_w); DECLARE_WRITE8_MEMBER(hnoridur_rombank_w); DECLARE_WRITE8_MEMBER(hnoridur_palbank_w); DECLARE_WRITE8_MEMBER(hnoridur_palette_w); @@ -188,6 +189,7 @@ public: DECLARE_WRITE8_MEMBER(tenkai_blit_dest_w); DECLARE_WRITE8_MEMBER(mjembase_blit_dest_w); DECLARE_WRITE8_MEMBER(dynax_blit_backpen_w); + DECLARE_WRITE8_MEMBER(dynax_blit_flags_w); DECLARE_WRITE8_MEMBER(dynax_blit_palette01_w); DECLARE_WRITE8_MEMBER(tenkai_blit_palette01_w); DECLARE_WRITE8_MEMBER(dynax_blit_palette45_w); @@ -211,6 +213,7 @@ public: DECLARE_WRITE8_MEMBER(dynax_blit2_scroll_w); DECLARE_WRITE8_MEMBER(dynax_blitter_rev2_w); DECLARE_WRITE8_MEMBER(tenkai_blitter_rev2_w); + DECLARE_WRITE8_MEMBER(cdracula_blitter_rev2_w); DECLARE_WRITE8_MEMBER(jantouki_blitter_rev2_w); DECLARE_WRITE8_MEMBER(jantouki_blitter2_rev2_w); DECLARE_WRITE8_MEMBER(hanamai_priority_w); @@ -229,6 +232,7 @@ public: UINT32 screen_update_mjdialq2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_jantouki_top(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_jantouki_bottom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + UINT32 screen_update_cdracula(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(sprtmtch_vblank_interrupt); INTERRUPT_GEN_MEMBER(jantouki_vblank_interrupt); diff --git a/src/mame/includes/goldstar.h b/src/mame/includes/goldstar.h index 80b806493d5..db8edbbb34e 100644 --- a/src/mame/includes/goldstar.h +++ b/src/mame/includes/goldstar.h @@ -1,3 +1,8 @@ +#include "emu.h" + +#include "machine/ticket.h" + + class goldstar_state : public driver_device { public: @@ -250,16 +255,14 @@ public: goldstar_state(mconfig, type, tag), m_reel1_attrram(*this, "reel1_attrram"), m_reel2_attrram(*this, "reel2_attrram"), - m_reel3_attrram(*this, "reel3_attrram") + m_reel3_attrram(*this, "reel3_attrram"), + m_ticket_dispenser(*this, "tickets") { } - DECLARE_READ8_MEMBER(unk_r); - + DECLARE_WRITE8_MEMBER(coincount_w); DECLARE_WRITE8_MEMBER(unkcm_0x02_w); DECLARE_WRITE8_MEMBER(unkcm_0x03_w); - DECLARE_WRITE8_MEMBER(unkcm_0x11_w); - DECLARE_WRITE8_MEMBER(unkcm_0x12_w); DECLARE_WRITE8_MEMBER(reel1_attrram_w); DECLARE_WRITE8_MEMBER(reel2_attrram_w); @@ -272,6 +275,8 @@ public: DECLARE_VIDEO_START(unkch); UINT32 screen_update_unkch(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + INTERRUPT_GEN_MEMBER(vblank_irq); + protected: TILE_GET_INFO_MEMBER(get_reel1_tile_info); TILE_GET_INFO_MEMBER(get_reel2_tile_info); @@ -282,5 +287,8 @@ private: required_shared_ptr<UINT8> m_reel2_attrram; required_shared_ptr<UINT8> m_reel3_attrram; + UINT8 m_vblank_irq_enable; UINT8 m_vidreg; + + optional_device<ticket_dispenser_device> m_ticket_dispenser; }; diff --git a/src/mame/includes/realbrk.h b/src/mame/includes/realbrk.h index 8b3ccec5cfd..4adbdbfe9d0 100644 --- a/src/mame/includes/realbrk.h +++ b/src/mame/includes/realbrk.h @@ -5,6 +5,11 @@ class realbrk_state : public driver_device public: realbrk_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_tmp68301(*this, "tmp68301"), + m_gfxdecode(*this, "gfxdecode"), + m_screen(*this, "screen"), + m_palette(*this, "palette"), m_spriteram(*this, "spriteram"), m_vram_0(*this, "vram_0"), m_vram_1(*this, "vram_1"), @@ -13,12 +18,13 @@ public: m_dsw_select(*this, "dsw_select"), m_backup_ram(*this, "backup_ram"), m_vram_0ras(*this, "vram_0ras"), - m_vram_1ras(*this, "vram_1ras"), - m_maincpu(*this, "maincpu"), - m_tmp68301(*this, "tmp68301"), - m_gfxdecode(*this, "gfxdecode"), - m_screen(*this, "screen"), - m_palette(*this, "palette") { } + m_vram_1ras(*this, "vram_1ras") { } + + required_device<cpu_device> m_maincpu; + required_device<tmp68301_device> m_tmp68301; + required_device<gfxdecode_device> m_gfxdecode; + required_device<screen_device> m_screen; + required_device<palette_device> m_palette; required_shared_ptr<UINT16> m_spriteram; required_shared_ptr<UINT16> m_vram_0; @@ -29,36 +35,42 @@ public: optional_shared_ptr<UINT16> m_backup_ram; optional_shared_ptr<UINT16> m_vram_0ras; optional_shared_ptr<UINT16> m_vram_1ras; + bitmap_ind16 *m_tmpbitmap0; bitmap_ind16 *m_tmpbitmap1; int m_disable_video; tilemap_t *m_tilemap_0; tilemap_t *m_tilemap_1; tilemap_t *m_tilemap_2; + + // common + DECLARE_WRITE16_MEMBER(vram_0_w); + DECLARE_WRITE16_MEMBER(vram_1_w); + DECLARE_WRITE16_MEMBER(vram_2_w); + DECLARE_WRITE16_MEMBER(vregs_w); + + // realbrk and/or dai2kaku DECLARE_READ16_MEMBER(realbrk_dsw_r); + DECLARE_WRITE16_MEMBER(realbrk_flipscreen_w); + DECLARE_WRITE16_MEMBER(dai2kaku_flipscreen_w); + + // pkgnsh and/or pkgnshdx DECLARE_READ16_MEMBER(pkgnsh_input_r); DECLARE_READ16_MEMBER(pkgnshdx_input_r); DECLARE_READ16_MEMBER(backup_ram_r); DECLARE_READ16_MEMBER(backup_ram_dx_r); DECLARE_WRITE16_MEMBER(backup_ram_w); - DECLARE_WRITE16_MEMBER(realbrk_flipscreen_w); - DECLARE_WRITE16_MEMBER(dai2kaku_flipscreen_w); - DECLARE_WRITE16_MEMBER(realbrk_vram_0_w); - DECLARE_WRITE16_MEMBER(realbrk_vram_1_w); - DECLARE_WRITE16_MEMBER(realbrk_vram_2_w); - DECLARE_WRITE16_MEMBER(realbrk_vregs_w); + TILE_GET_INFO_MEMBER(get_tile_info_0); TILE_GET_INFO_MEMBER(get_tile_info_1); TILE_GET_INFO_MEMBER(get_tile_info_2); + virtual void video_start(); - UINT32 screen_update_realbrk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_dai2kaku(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - INTERRUPT_GEN_MEMBER(realbrk_interrupt); void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); void dai2kaku_draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect, int layer); - required_device<cpu_device> m_maincpu; - required_device<tmp68301_device> m_tmp68301; - required_device<gfxdecode_device> m_gfxdecode; - required_device<screen_device> m_screen; - required_device<palette_device> m_palette; + + INTERRUPT_GEN_MEMBER(interrupt); }; diff --git a/src/mame/includes/rltennis.h b/src/mame/includes/rltennis.h index bfc60e1d400..fb02b1a41b5 100644 --- a/src/mame/includes/rltennis.h +++ b/src/mame/includes/rltennis.h @@ -10,45 +10,40 @@ public: rltennis_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), - m_data760000(0), m_data740000(0), m_dac_counter(0), m_sample_rom_offset_1(0), m_sample_rom_offset_2(0), - m_offset_shift(0), m_dac_1(*this, "dac1"), - m_dac_2(*this, "dac2") { } + m_dac_2(*this, "dac2"), + m_data760000(0), m_data740000(0), m_dac_counter(0), m_sample_rom_offset_1(0), m_sample_rom_offset_2(0), + m_offset_shift(0) { } required_device<cpu_device> m_maincpu; - + required_device<dac_device> m_dac_1; + required_device<dac_device> m_dac_2; + UINT16 m_blitter[RLT_NUM_BLITTER_REGS]; - INT32 m_data760000; INT32 m_data740000; INT32 m_dac_counter; INT32 m_sample_rom_offset_1; INT32 m_sample_rom_offset_2; - INT32 m_offset_shift; - INT32 m_unk_counter; - bitmap_ind16 *m_tmp_bitmap[RLT_NUM_BITMAPS]; - - required_device<dac_device> m_dac_1; - required_device<dac_device> m_dac_2; - UINT8 *m_samples_1; UINT8 *m_samples_2; - UINT8 *m_gfx; - emu_timer *m_timer; - DECLARE_READ16_MEMBER(rlt_io_r); - DECLARE_WRITE16_MEMBER(rlt_snd1_w); - DECLARE_WRITE16_MEMBER(rlt_snd2_w); - DECLARE_WRITE16_MEMBER(rlt_blitter_w); + DECLARE_READ16_MEMBER(io_r); + DECLARE_WRITE16_MEMBER(snd1_w); + DECLARE_WRITE16_MEMBER(snd2_w); + DECLARE_WRITE16_MEMBER(blitter_w); + virtual void machine_start(); virtual void machine_reset(); virtual void video_start(); - UINT32 screen_update_rltennis(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - INTERRUPT_GEN_MEMBER(rltennis_interrupt); + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + INTERRUPT_GEN_MEMBER(interrupt); TIMER_CALLBACK_MEMBER(sample_player); }; diff --git a/src/mame/includes/seta.h b/src/mame/includes/seta.h index 596b0f44e23..e8e2b7e821c 100644 --- a/src/mame/includes/seta.h +++ b/src/mame/includes/seta.h @@ -234,4 +234,5 @@ public: void uPD71054_timer_init( ); DECLARE_WRITE_LINE_MEMBER(pit_out0); DECLARE_WRITE_LINE_MEMBER(utoukond_ym3438_interrupt); + SETA001_SPRITE_GFXBANK_CB_MEMBER(setac_gfxbank_callback); }; diff --git a/src/mame/includes/seta2.h b/src/mame/includes/seta2.h index f17c3242b22..31c86630548 100644 --- a/src/mame/includes/seta2.h +++ b/src/mame/includes/seta2.h @@ -8,87 +8,91 @@ class seta2_state : public driver_device public: seta2_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_maincpu(*this,"maincpu"), - m_tmp68301(*this, "tmp68301"), - m_nvram(*this, "nvram") , - m_spriteram(*this, "spriteram", 0), - m_vregs(*this, "vregs", 0), - m_funcube_outputs(*this, "funcube_outputs"), - m_funcube_leds(*this, "funcube_leds"), - m_x1(*this, "x1snd"), + m_maincpu(*this,"maincpu"), + m_tmp68301(*this, "tmp68301"), m_oki(*this, "oki"), m_eeprom(*this, "eeprom"), m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), - m_palette(*this, "palette") { } + m_palette(*this, "palette"), + m_nvram(*this, "nvram"), + m_spriteram(*this, "spriteram", 0), + m_vregs(*this, "vregs", 0), + m_funcube_outputs(*this, "funcube_outputs"), + m_funcube_leds(*this, "funcube_leds") { } required_device<cpu_device> m_maincpu; optional_device<tmp68301_device> m_tmp68301; - optional_shared_ptr<UINT16> m_nvram; - - optional_shared_ptr<UINT16> m_spriteram; - optional_shared_ptr<UINT16> m_vregs; - - optional_shared_ptr<UINT16> m_funcube_outputs; - optional_shared_ptr<UINT16> m_funcube_leds; - - optional_device<x1_010_device> m_x1; optional_device<okim9810_device> m_oki; optional_device<eeprom_serial_93cxx_device> m_eeprom; required_device<gfxdecode_device> m_gfxdecode; required_device<screen_device> m_screen; required_device<palette_device> m_palette; + + optional_shared_ptr<UINT16> m_nvram; + optional_shared_ptr<UINT16> m_spriteram; + optional_shared_ptr<UINT16> m_vregs; + optional_shared_ptr<UINT16> m_funcube_outputs; + optional_shared_ptr<UINT16> m_funcube_leds; int m_xoffset; int m_yoffset; int m_keyboard_row; - UINT16 *m_buffered_spriteram; - + UINT64 m_funcube_coin_start_cycles; UINT8 m_funcube_hopper_motor; - DECLARE_WRITE16_MEMBER(seta2_vregs_w); - DECLARE_WRITE16_MEMBER(seta2_sound_bank_w); + DECLARE_WRITE16_MEMBER(vregs_w); + DECLARE_WRITE16_MEMBER(sound_bank_w); + DECLARE_WRITE16_MEMBER(grdians_lockout_w); + DECLARE_READ16_MEMBER(mj4simai_p1_r); DECLARE_READ16_MEMBER(mj4simai_p2_r); DECLARE_WRITE16_MEMBER(mj4simai_keyboard_w); + DECLARE_READ16_MEMBER(pzlbowl_protection_r); DECLARE_READ16_MEMBER(pzlbowl_coins_r); DECLARE_WRITE16_MEMBER(pzlbowl_coin_counter_w); + DECLARE_WRITE16_MEMBER(reelquak_leds_w); DECLARE_WRITE16_MEMBER(reelquak_coin_w); + DECLARE_WRITE16_MEMBER(samshoot_coin_w); + + DECLARE_READ16_MEMBER(gundamex_eeprom_r); + DECLARE_WRITE16_MEMBER(gundamex_eeprom_w); + DECLARE_READ32_MEMBER(funcube_nvram_dword_r); DECLARE_WRITE32_MEMBER(funcube_nvram_dword_w); DECLARE_WRITE16_MEMBER(spriteram16_word_w); DECLARE_READ16_MEMBER(spriteram16_word_r); - DECLARE_WRITE32_MEMBER(coldfire_regs_w); - DECLARE_READ32_MEMBER(coldfire_regs_r); DECLARE_READ32_MEMBER(funcube_debug_r); DECLARE_READ16_MEMBER(funcube_coins_r); DECLARE_WRITE16_MEMBER(funcube_leds_w); DECLARE_READ16_MEMBER(funcube_outputs_r); DECLARE_WRITE16_MEMBER(funcube_outputs_w); DECLARE_READ16_MEMBER(funcube_battery_r); - DECLARE_READ16_MEMBER(gundamex_eeprom_r); - DECLARE_WRITE16_MEMBER(gundamex_eeprom_w); DECLARE_READ32_MEMBER(oki_read); DECLARE_WRITE32_MEMBER(oki_write); + DECLARE_DRIVER_INIT(funcube3); DECLARE_DRIVER_INIT(funcube); DECLARE_DRIVER_INIT(funcube2); - DECLARE_VIDEO_START(seta2); + virtual void video_start(); + DECLARE_MACHINE_START(mj4simai); + DECLARE_MACHINE_START(funcube); DECLARE_MACHINE_RESET(funcube); - DECLARE_VIDEO_START(seta2_yoffset); - DECLARE_VIDEO_START(seta2_xoffset); - UINT32 screen_update_seta2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void screen_eof_seta2(screen_device &screen, bool state); + DECLARE_VIDEO_START(yoffset); + DECLARE_VIDEO_START(xoffset); + INTERRUPT_GEN_MEMBER(seta2_interrupt); INTERRUPT_GEN_MEMBER(samshoot_interrupt); - INTERRUPT_GEN_MEMBER(funcube_sub_timer_irq); TIMER_DEVICE_CALLBACK_MEMBER(funcube_interrupt); + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void screen_eof(screen_device &screen, bool state); void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); void funcube_debug_outputs(); }; diff --git a/src/mame/includes/srmp2.h b/src/mame/includes/srmp2.h index 04f9b3d63e7..3c440148725 100644 --- a/src/mame/includes/srmp2.h +++ b/src/mame/includes/srmp2.h @@ -13,51 +13,64 @@ class srmp2_state : public driver_device { public: srmp2_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag) , + : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_seta001(*this, "spritegen"), m_msm(*this, "msm") { } + required_device<cpu_device> m_maincpu; + required_device<seta001_device> m_seta001; + required_device<msm5205_device> m_msm; + int m_color_bank; int m_gfx_bank; - int m_adpcm_bank; int m_adpcm_data; UINT32 m_adpcm_sptr; UINT32 m_adpcm_eptr; - - int m_port_select; - iox_t m_iox; - DECLARE_WRITE16_MEMBER(srmp2_flags_w); - DECLARE_WRITE16_MEMBER(mjyuugi_flags_w); - DECLARE_WRITE16_MEMBER(mjyuugi_adpcm_bank_w); + + // common DECLARE_READ8_MEMBER(vox_status_r); DECLARE_READ8_MEMBER(iox_mux_r); DECLARE_READ8_MEMBER(iox_status_r); DECLARE_WRITE8_MEMBER(iox_command_w); DECLARE_WRITE8_MEMBER(iox_data_w); - DECLARE_WRITE8_MEMBER(srmp3_rombank_w); - DECLARE_WRITE8_MEMBER(srmp2_irq2_ack_w); - DECLARE_WRITE8_MEMBER(srmp2_irq4_ack_w); + DECLARE_WRITE_LINE_MEMBER(adpcm_int); + + // mjuugi + DECLARE_WRITE16_MEMBER(mjyuugi_flags_w); + DECLARE_WRITE16_MEMBER(mjyuugi_adpcm_bank_w); DECLARE_READ8_MEMBER(mjyuugi_irq2_ack_r); DECLARE_READ8_MEMBER(mjyuugi_irq4_ack_r); - DECLARE_WRITE8_MEMBER(srmp3_flags_w); - DECLARE_WRITE8_MEMBER(srmp3_irq_ack_w); + + // rmgoldyh DECLARE_WRITE8_MEMBER(rmgoldyh_rombank_w); + + // srmp2 + DECLARE_WRITE8_MEMBER(srmp2_irq2_ack_w); + DECLARE_WRITE8_MEMBER(srmp2_irq4_ack_w); + DECLARE_WRITE16_MEMBER(srmp2_flags_w); DECLARE_WRITE16_MEMBER(srmp2_adpcm_code_w); + + // srmp3 + DECLARE_WRITE8_MEMBER(srmp3_rombank_w); + DECLARE_WRITE8_MEMBER(srmp3_flags_w); + DECLARE_WRITE8_MEMBER(srmp3_irq_ack_w); DECLARE_WRITE8_MEMBER(srmp3_adpcm_code_w); + + virtual void machine_start(); DECLARE_MACHINE_START(srmp2); DECLARE_PALETTE_INIT(srmp2); DECLARE_MACHINE_START(srmp3); DECLARE_PALETTE_INIT(srmp3); DECLARE_MACHINE_START(rmgoldyh); + DECLARE_MACHINE_START(mjyuugi); + UINT32 screen_update_srmp2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_srmp3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_mjyuugi(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + SETA001_SPRITE_GFXBANK_CB_MEMBER(srmp3_gfxbank_callback); + UINT8 iox_key_matrix_calc(UINT8 p_side); - DECLARE_WRITE_LINE_MEMBER(srmp2_adpcm_int); - required_device<cpu_device> m_maincpu; - required_device<seta001_device> m_seta001; - required_device<msm5205_device> m_msm; }; diff --git a/src/mame/includes/ssrj.h b/src/mame/includes/ssrj.h index 724f5800477..b9175dcc172 100644 --- a/src/mame/includes/ssrj.h +++ b/src/mame/includes/ssrj.h @@ -3,39 +3,46 @@ class ssrj_state : public driver_device public: ssrj_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_gfxdecode(*this, "gfxdecode"), + m_palette(*this, "palette"), m_vram1(*this, "vram1"), m_vram2(*this, "vram2"), m_vram3(*this, "vram3"), m_vram4(*this, "vram4"), - m_scrollram(*this, "scrollram"), - m_maincpu(*this, "maincpu"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") { } + m_scrollram(*this, "scrollram") { } + + required_device<cpu_device> m_maincpu; + required_device<gfxdecode_device> m_gfxdecode; + required_device<palette_device> m_palette; - int m_oldport; - tilemap_t *m_tilemap1; - tilemap_t *m_tilemap2; - tilemap_t *m_tilemap4; required_shared_ptr<UINT8> m_vram1; required_shared_ptr<UINT8> m_vram2; required_shared_ptr<UINT8> m_vram3; required_shared_ptr<UINT8> m_vram4; required_shared_ptr<UINT8> m_scrollram; + + int m_oldport; + tilemap_t *m_tilemap1; + tilemap_t *m_tilemap2; + tilemap_t *m_tilemap4; UINT8 *m_buffer_spriteram; - DECLARE_READ8_MEMBER(ssrj_wheel_r); - DECLARE_WRITE8_MEMBER(ssrj_vram1_w); - DECLARE_WRITE8_MEMBER(ssrj_vram2_w); - DECLARE_WRITE8_MEMBER(ssrj_vram4_w); + + DECLARE_READ8_MEMBER(wheel_r); + DECLARE_WRITE8_MEMBER(vram1_w); + DECLARE_WRITE8_MEMBER(vram2_w); + DECLARE_WRITE8_MEMBER(vram4_w); + TILE_GET_INFO_MEMBER(get_tile_info1); TILE_GET_INFO_MEMBER(get_tile_info2); TILE_GET_INFO_MEMBER(get_tile_info4); + + virtual void machine_start(); virtual void machine_reset(); virtual void video_start(); DECLARE_PALETTE_INIT(ssrj); - UINT32 screen_update_ssrj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void screen_eof_ssrj(screen_device &screen, bool state); + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void screen_eof(screen_device &screen, bool state); void draw_objects(bitmap_ind16 &bitmap, const rectangle &cliprect ); - required_device<cpu_device> m_maincpu; - required_device<gfxdecode_device> m_gfxdecode; - required_device<palette_device> m_palette; }; diff --git a/src/mame/includes/subs.h b/src/mame/includes/subs.h index 72ca1adf0f1..1b9629a7b29 100644 --- a/src/mame/includes/subs.h +++ b/src/mame/includes/subs.h @@ -21,45 +21,53 @@ class subs_state : public driver_device public: subs_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_spriteram(*this, "spriteram"), - m_videoram(*this, "videoram"), - m_discrete(*this, "discrete"), m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") { } + m_palette(*this, "palette"), + m_discrete(*this, "discrete"), + m_spriteram(*this, "spriteram"), + m_videoram(*this, "videoram") { } + + required_device<cpu_device> m_maincpu; + required_device<gfxdecode_device> m_gfxdecode; + required_device<palette_device> m_palette; + required_device<discrete_device> m_discrete; required_shared_ptr<UINT8> m_spriteram; required_shared_ptr<UINT8> m_videoram; - required_device<discrete_device> m_discrete; + int m_steering_buf1; int m_steering_buf2; int m_steering_val1; int m_steering_val2; int m_last_val_1; int m_last_val_2; - DECLARE_WRITE8_MEMBER(subs_steer_reset_w); - DECLARE_READ8_MEMBER(subs_control_r); - DECLARE_READ8_MEMBER(subs_coin_r); - DECLARE_READ8_MEMBER(subs_options_r); - DECLARE_WRITE8_MEMBER(subs_lamp1_w); - DECLARE_WRITE8_MEMBER(subs_lamp2_w); - DECLARE_WRITE8_MEMBER(subs_invert1_w); - DECLARE_WRITE8_MEMBER(subs_invert2_w); + + DECLARE_WRITE8_MEMBER(steer_reset_w); + DECLARE_READ8_MEMBER(control_r); + DECLARE_READ8_MEMBER(coin_r); + DECLARE_READ8_MEMBER(options_r); + DECLARE_WRITE8_MEMBER(lamp1_w); + DECLARE_WRITE8_MEMBER(lamp2_w); + DECLARE_WRITE8_MEMBER(invert1_w); + DECLARE_WRITE8_MEMBER(invert2_w); + DECLARE_WRITE8_MEMBER(sonar1_w); + DECLARE_WRITE8_MEMBER(sonar2_w); + DECLARE_WRITE8_MEMBER(crash_w); + DECLARE_WRITE8_MEMBER(explode_w); + DECLARE_WRITE8_MEMBER(noise_reset_w); + + virtual void machine_start(); virtual void machine_reset(); DECLARE_PALETTE_INIT(subs); - UINT32 screen_update_subs_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_subs_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - INTERRUPT_GEN_MEMBER(subs_interrupt); - DECLARE_WRITE8_MEMBER(subs_sonar1_w); - DECLARE_WRITE8_MEMBER(subs_sonar2_w); - DECLARE_WRITE8_MEMBER(subs_crash_w); - DECLARE_WRITE8_MEMBER(subs_explode_w); - DECLARE_WRITE8_MEMBER(subs_noise_reset_w); - int subs_steering_1(); - int subs_steering_2(); - required_device<cpu_device> m_maincpu; - required_device<gfxdecode_device> m_gfxdecode; - required_device<palette_device> m_palette; + + UINT32 screen_update_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + UINT32 screen_update_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + INTERRUPT_GEN_MEMBER(interrupt); + + int steering_1(); + int steering_2(); }; /*----------- defined in audio/subs.c -----------*/ diff --git a/src/mame/includes/suna16.h b/src/mame/includes/suna16.h index b7136d46524..6ccfc4f4045 100644 --- a/src/mame/includes/suna16.h +++ b/src/mame/includes/suna16.h @@ -6,20 +6,18 @@ public: suna16_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this,"maincpu"), - m_spriteram(*this, "spriteram"), - m_spriteram2(*this, "spriteram2"), m_dac1(*this, "dac1"), m_dac2(*this, "dac2"), m_dac3(*this, "dac3"), m_dac4(*this, "dac4"), m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), - m_palette(*this, "palette") + m_palette(*this, "palette"), + m_spriteram(*this, "spriteram"), + m_spriteram2(*this, "spriteram2") { } required_device<cpu_device> m_maincpu; - required_shared_ptr<UINT16> m_spriteram; - optional_shared_ptr<UINT16> m_spriteram2; required_device<dac_device> m_dac1; required_device<dac_device> m_dac2; optional_device<dac_device> m_dac3; @@ -27,37 +25,52 @@ public: required_device<gfxdecode_device> m_gfxdecode; required_device<screen_device> m_screen; required_device<palette_device> m_palette; - UINT8 m_prot; + + required_shared_ptr<UINT16> m_spriteram; + optional_shared_ptr<UINT16> m_spriteram2; + UINT16 *m_paletteram; int m_color_bank; + UINT8 m_prot; - DECLARE_WRITE16_MEMBER(suna16_soundlatch_w); - DECLARE_WRITE16_MEMBER(bssoccer_leds_w); - DECLARE_WRITE16_MEMBER(uballoon_leds_w); - DECLARE_READ8_MEMBER(uballoon_prot_r); - DECLARE_WRITE8_MEMBER(uballoon_prot_w); + // common + DECLARE_WRITE16_MEMBER(soundlatch_w); + DECLARE_READ16_MEMBER(paletteram_r); + DECLARE_WRITE16_MEMBER(paletteram_w); + DECLARE_WRITE16_MEMBER(flipscreen_w); + DECLARE_WRITE8_MEMBER(DAC1_w); + DECLARE_WRITE8_MEMBER(DAC2_w); + + // bestbest specific + DECLARE_WRITE16_MEMBER(bestbest_flipscreen_w); DECLARE_WRITE16_MEMBER(bestbest_coin_w); DECLARE_READ8_MEMBER(bestbest_prot_r); DECLARE_WRITE8_MEMBER(bestbest_prot_w); + DECLARE_WRITE8_MEMBER(bestbest_ay8910_port_a_w); + + // bssoccer specific + DECLARE_WRITE16_MEMBER(bssoccer_leds_w); DECLARE_WRITE8_MEMBER(bssoccer_pcm_1_bankswitch_w); DECLARE_WRITE8_MEMBER(bssoccer_pcm_2_bankswitch_w); - DECLARE_WRITE8_MEMBER(uballoon_pcm_1_bankswitch_w); - DECLARE_WRITE16_MEMBER(suna16_flipscreen_w); - DECLARE_WRITE16_MEMBER(bestbest_flipscreen_w); - DECLARE_READ16_MEMBER(suna16_paletteram16_r); - DECLARE_WRITE16_MEMBER(suna16_paletteram16_w); - DECLARE_MACHINE_START(bssoccer); - DECLARE_WRITE8_MEMBER(bssoccer_DAC1_w); - DECLARE_WRITE8_MEMBER(bssoccer_DAC2_w); DECLARE_WRITE8_MEMBER(bssoccer_DAC3_w); DECLARE_WRITE8_MEMBER(bssoccer_DAC4_w); - DECLARE_WRITE8_MEMBER(bestbest_ay8910_port_a_w); + + // uballoon specific + DECLARE_WRITE16_MEMBER(uballoon_leds_w); + DECLARE_WRITE8_MEMBER(uballoon_pcm_1_bankswitch_w); + DECLARE_READ8_MEMBER(uballoon_prot_r); + DECLARE_WRITE8_MEMBER(uballoon_prot_w); + + TIMER_DEVICE_CALLBACK_MEMBER(bssoccer_interrupt); + DECLARE_DRIVER_INIT(uballoon); virtual void video_start(); - DECLARE_MACHINE_RESET(uballoon); + DECLARE_MACHINE_START(bestbest); + DECLARE_MACHINE_START(bssoccer); DECLARE_MACHINE_START(uballoon); - UINT32 screen_update_suna16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + DECLARE_MACHINE_RESET(uballoon); + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_bestbest(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - TIMER_DEVICE_CALLBACK_MEMBER(bssoccer_interrupt); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16 *sprites, int gfx); }; diff --git a/src/mame/includes/suprloco.h b/src/mame/includes/suprloco.h index 0d9963dbf92..a04d8166faa 100644 --- a/src/mame/includes/suprloco.h +++ b/src/mame/includes/suprloco.h @@ -3,33 +3,38 @@ class suprloco_state : public driver_device public: suprloco_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_spriteram(*this, "spriteram"), - m_videoram(*this, "videoram"), - m_scrollram(*this, "scrollram"), m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), - m_gfxdecode(*this, "gfxdecode") { } + m_gfxdecode(*this, "gfxdecode"), + m_spriteram(*this, "spriteram"), + m_videoram(*this, "videoram"), + m_scrollram(*this, "scrollram") { } + + required_device<cpu_device> m_maincpu; + required_device<cpu_device> m_audiocpu; + required_device<gfxdecode_device> m_gfxdecode; required_shared_ptr<UINT8> m_spriteram; required_shared_ptr<UINT8> m_videoram; required_shared_ptr<UINT8> m_scrollram; + tilemap_t *m_bg_tilemap; int m_control; - DECLARE_WRITE8_MEMBER(suprloco_soundport_w); - DECLARE_WRITE8_MEMBER(suprloco_videoram_w); - DECLARE_WRITE8_MEMBER(suprloco_scrollram_w); - DECLARE_WRITE8_MEMBER(suprloco_control_w); - DECLARE_READ8_MEMBER(suprloco_control_r); - DECLARE_DRIVER_INIT(suprloco); + DECLARE_WRITE8_MEMBER(soundport_w); + DECLARE_WRITE8_MEMBER(videoram_w); + DECLARE_WRITE8_MEMBER(scrollram_w); + DECLARE_WRITE8_MEMBER(control_w); + DECLARE_READ8_MEMBER(control_r); + TILE_GET_INFO_MEMBER(get_tile_info); + virtual void video_start(); DECLARE_PALETTE_INIT(suprloco); - UINT32 screen_update_suprloco(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + DECLARE_DRIVER_INIT(suprloco); + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); inline void draw_pixel(bitmap_ind16 &bitmap,const rectangle &cliprect,int x,int y,int color,int flip); void draw_sprite(bitmap_ind16 &bitmap,const rectangle &cliprect,int spr_number); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); - required_device<cpu_device> m_maincpu; - required_device<cpu_device> m_audiocpu; - required_device<gfxdecode_device> m_gfxdecode; }; diff --git a/src/mame/includes/suprridr.h b/src/mame/includes/suprridr.h index ac5ababb02a..fe39170bee4 100644 --- a/src/mame/includes/suprridr.h +++ b/src/mame/includes/suprridr.h @@ -11,47 +11,56 @@ class suprridr_state : public driver_device public: suprridr_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_fgram(*this, "fgram"), - m_bgram(*this, "bgram"), - m_spriteram(*this, "spriteram"), m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") { } + m_palette(*this, "palette"), + m_fgram(*this, "fgram"), + m_bgram(*this, "bgram"), + m_spriteram(*this, "spriteram") { } + + required_device<cpu_device> m_maincpu; + required_device<cpu_device> m_audiocpu; + required_device<gfxdecode_device> m_gfxdecode; + required_device<palette_device> m_palette; - UINT8 m_nmi_enable; - UINT8 m_sound_data; required_shared_ptr<UINT8> m_fgram; required_shared_ptr<UINT8> m_bgram; + required_shared_ptr<UINT8> m_spriteram; + + UINT8 m_nmi_enable; + UINT8 m_sound_data; tilemap_t *m_fg_tilemap; tilemap_t *m_bg_tilemap; tilemap_t *m_bg_tilemap_noscroll; UINT8 m_flipx; UINT8 m_flipy; - required_shared_ptr<UINT8> m_spriteram; + DECLARE_WRITE8_MEMBER(nmi_enable_w); DECLARE_WRITE8_MEMBER(sound_data_w); DECLARE_WRITE8_MEMBER(sound_irq_ack_w); DECLARE_WRITE8_MEMBER(coin_lock_w); - DECLARE_WRITE8_MEMBER(suprridr_flipx_w); - DECLARE_WRITE8_MEMBER(suprridr_flipy_w); - DECLARE_WRITE8_MEMBER(suprridr_fgdisable_w); - DECLARE_WRITE8_MEMBER(suprridr_fgscrolly_w); - DECLARE_WRITE8_MEMBER(suprridr_bgscrolly_w); - DECLARE_WRITE8_MEMBER(suprridr_bgram_w); - DECLARE_WRITE8_MEMBER(suprridr_fgram_w); - DECLARE_CUSTOM_INPUT_MEMBER(suprridr_control_r); + DECLARE_WRITE8_MEMBER(flipx_w); + DECLARE_WRITE8_MEMBER(flipy_w); + DECLARE_WRITE8_MEMBER(fgdisable_w); + DECLARE_WRITE8_MEMBER(fgscrolly_w); + DECLARE_WRITE8_MEMBER(bgscrolly_w); + DECLARE_WRITE8_MEMBER(bgram_w); + DECLARE_WRITE8_MEMBER(fgram_w); DECLARE_READ8_MEMBER(sound_data_r); + + DECLARE_CUSTOM_INPUT_MEMBER(control_r); + TILE_GET_INFO_MEMBER(get_tile_info); TILE_GET_INFO_MEMBER(get_tile_info2); - virtual void video_start(); - DECLARE_PALETTE_INIT(suprridr); - UINT32 screen_update_suprridr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + INTERRUPT_GEN_MEMBER(main_nmi_gen); TIMER_CALLBACK_MEMBER(delayed_sound_w); - int suprridr_is_screen_flipped(); - required_device<cpu_device> m_maincpu; - required_device<cpu_device> m_audiocpu; - required_device<gfxdecode_device> m_gfxdecode; - required_device<palette_device> m_palette; + + virtual void machine_start(); + virtual void video_start(); + DECLARE_PALETTE_INIT(suprridr); + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + int is_screen_flipped(); }; diff --git a/src/mame/includes/thedeep.h b/src/mame/includes/thedeep.h index 301bb0c8b0d..948f278ac60 100644 --- a/src/mame/includes/thedeep.h +++ b/src/mame/includes/thedeep.h @@ -1,3 +1,6 @@ +#include "video/decmxc06.h" + + class thedeep_state : public driver_device { public: @@ -12,7 +15,9 @@ public: m_vram_0(*this, "vram_0"), m_vram_1(*this, "vram_1"), m_scroll(*this, "scroll"), - m_scroll2(*this, "scroll2") { } + m_scroll2(*this, "scroll2"), + m_spritegen(*this, "spritegen") + { } required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; @@ -25,6 +30,7 @@ public: required_shared_ptr<UINT8> m_vram_1; required_shared_ptr<UINT8> m_scroll; required_shared_ptr<UINT8> m_scroll2; + required_device<deco_mxc06_device> m_spritegen; int m_nmi_enable; UINT8 m_protection_command; @@ -59,7 +65,6 @@ public: DECLARE_PALETTE_INIT(thedeep); UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(mcu_irq); TIMER_DEVICE_CALLBACK_MEMBER(interrupt); diff --git a/src/mame/layout/unkch.lay b/src/mame/layout/unkch.lay new file mode 100644 index 00000000000..600db78a390 --- /dev/null +++ b/src/mame/layout/unkch.lay @@ -0,0 +1,180 @@ +<?xml version="1.0"?> +<mamelayout version="2"> +<!-- + Cherry Gold control panel + May or may not match arrangement/colour of real control panel + Written by Vas Crabb. +--> + + <element name="start" defstate="0"> + <rect state="1"><color red="0.0" green="1.0" blue="0.0" /></rect> + <rect state="0"><color red="0.0" green="0.15" blue="0.0" /></rect> + <text string="START"> + <color red="0.0" green="0.0" blue="0.0" /> + <bounds x="0" y="0.1" width="1" height="0.4" /> + </text> + <text string="STOP ALL"> + <color red="0.0" green="0.0" blue="0.0" /> + <bounds x="0" y="0.5" width="1" height="0.4" /> + </text> + </element> + + <element name="stop1" defstate="0"> + <rect state="1"><color red="1.0" green="0.0" blue="0.0" /></rect> + <rect state="0"><color red="0.15" green="0.0" blue="0.0" /></rect> + <text string="TAKE"> + <color red="0.0" green="0.0" blue="0.0" /> + <bounds x="0" y="0.1" width="1" height="0.4" /> + </text> + <text string="STOP 1"> + <color red="0.0" green="0.0" blue="0.0" /> + <bounds x="0" y="0.5" width="1" height="0.4" /> + </text> + </element> + + <element name="stop2" defstate="0"> + <rect state="1"><color red="1.0" green="0.0" blue="0.0" /></rect> + <rect state="0"><color red="0.15" green="0.0" blue="0.0" /></rect> + <text string="BET-A"> + <color red="0.0" green="0.0" blue="0.0" /> + <bounds x="0" y="0.1" width="1" height="0.4" /> + </text> + <text string="STOP 2"> + <color red="0.0" green="0.0" blue="0.0" /> + <bounds x="0" y="0.5" width="1" height="0.4" /> + </text> + </element> + + <element name="stop3" defstate="0"> + <rect state="1"><color red="1.0" green="0.0" blue="0.0" /></rect> + <rect state="0"><color red="0.15" green="0.0" blue="0.0" /></rect> + <text string="SMALL/INFO"> + <color red="0.0" green="0.0" blue="0.0" /> + <bounds x="0" y="0.1" width="1" height="0.4" /> + </text> + <text string="STOP 3"> + <color red="0.0" green="0.0" blue="0.0" /> + <bounds x="0" y="0.5" width="1" height="0.4" /> + </text> + </element> + + <element name="big" defstate="0"> + <rect state="1"><color red="1.0" green="0.5" blue="0.0" /></rect> + <rect state="0"><color red="0.15" green="0.075" blue="0.0" /></rect> + <text string="BIG"> + <color red="0.0" green="0.0" blue="0.0" /> + <bounds x="0" y="0.3" width="1" height="0.4" /> + </text> + </element> + + <element name="dup" defstate="0"> + <rect state="1"><color red="1.0" green="0.0" blue="1.0" /></rect> + <rect state="0"><color red="0.15" green="0.0" blue="0.15" /></rect> + <text string="BET-B"> + <color red="0.0" green="0.0" blue="0.0" /> + <bounds x="0" y="0.1" width="1" height="0.4" /> + </text> + <text string="DOUBLE"> + <color red="0.0" green="0.0" blue="0.0" /> + <bounds x="0" y="0.5" width="1" height="0.4" /> + </text> + </element> + + + <element name="start_b" defstate="0"> + <rect state="1"><color red="0.0" green="0.7" blue="0.0" /></rect> + <rect state="0"><color red="0.0" green="0.1" blue="0.0" /></rect> + </element> + + <element name="stop_b" defstate="0"> + <rect state="1"><color red="0.7" green="0.0" blue="0.0" /></rect> + <rect state="0"><color red="0.1" green="0.0" blue="0.0" /></rect> + </element> + + <element name="big_b" defstate="0"> + <rect state="1"><color red="0.7" green="0.35" blue="0.0" /></rect> + <rect state="0"><color red="0.1" green="0.05" blue="0.0" /></rect> + </element> + + <element name="dup_b" defstate="0"> + <rect state="1"><color red="0.7" green="0.0" blue="0.7" /></rect> + <rect state="0"><color red="0.1" green="0.0" blue="0.1" /></rect> + </element> + + + <element name="cpanel"> + <rect><color red="0.0" green="0.0" blue="0.0" /></rect> + </element> + + <element name="cpanel1"> + <rect><color red="0.20" green="0.20" blue="0.20" /></rect> + </element> + + <element name="cpanel2"> + <rect><color red="0.15" green="0.15" blue="0.15" /></rect> + </element> + + <element name="cpanel3"> + <rect><color red="0.10" green="0.10" blue="0.10" /></rect> + </element> + + <element name="cpanel4"> + <rect><color red="0.05" green="0.05" blue="0.05" /></rect> + </element> + + + <view name="Button Lamps"> + <screen index="0"><bounds left="0" top="0" right="4" bottom="3" /></screen> + + <bezel element="cpanel"><bounds left="0" right="4" top="3" bottom="3.40" /></bezel> + <bezel element="cpanel1"><bounds left="0" right="4" top="3.01" bottom="3.39" /></bezel> + <bezel element="cpanel2"><bounds left="0" right="4" top="3.02" bottom="3.38" /></bezel> + <bezel element="cpanel3"><bounds left="0" right="4" top="3.03" bottom="3.37" /></bezel> + <bezel element="cpanel4"><bounds left="0" right="4" top="3.04" bottom="3.36" /></bezel> + <bezel element="cpanel"><bounds left="0" right="4" top="3.05" bottom="3.35" /></bezel> + + + <bezel name="lamp1" element="start_b" inputtag="IN1" inputmask="0x40"> + <bounds x="0.05" y="3.08" width="0.50" height="0.24" /> + </bezel> + <bezel name="lamp1" element="start" inputtag="IN1" inputmask="0x40"> + <bounds x="0.07" y="3.10" width="0.46" height="0.20" /> + </bezel> + + <bezel name="lamp5" element="stop_b" inputtag="IN0" inputmask="0x10"> + <bounds x="0.75" y="3.08" width="0.50" height="0.24" /> + </bezel> + <bezel name="lamp5" element="stop1" inputtag="IN0" inputmask="0x10"> + <bounds x="0.77" y="3.10" width="0.46" height="0.20" /> + </bezel> + + <bezel name="lamp0" element="stop_b" inputtag="IN0" inputmask="0x01"> + <bounds x="1.4" y="3.08" width="0.50" height="0.24" /> + </bezel> + <bezel name="lamp0" element="stop2" inputtag="IN0" inputmask="0x01"> + <bounds x="1.42" y="3.10" width="0.46" height="0.20" /> + </bezel> + + <bezel name="lamp2" element="stop_b" inputtag="IN0" inputmask="0x40"> + <bounds x="2.05" y="3.08" width="0.50" height="0.24" /> + </bezel> + <bezel name="lamp2" element="stop3" inputtag="IN0" inputmask="0x40"> + <bounds x="2.07" y="3.10" width="0.46" height="0.20" /> + </bezel> + + <bezel name="lamp3" element="big_b" inputtag="IN0" inputmask="0x80"> + <bounds x="2.75" y="3.08" width="0.50" height="0.24" /> + </bezel> + <bezel name="lamp3" element="big" inputtag="IN0" inputmask="0x80"> + <bounds x="2.77" y="3.10" width="0.46" height="0.20" /> + </bezel> + + <bezel name="lamp4" element="dup_b" inputtag="IN0" inputmask="0x20"> + <bounds x="3.45" y="3.08" width="0.50" height="0.24" /> + </bezel> + <bezel name="lamp4" element="dup" inputtag="IN0" inputmask="0x20"> + <bounds x="3.47" y="3.10" width="0.46" height="0.20" /> + </bezel> + </view> + +</mamelayout> diff --git a/src/mame/machine/iteagle_fpga.c b/src/mame/machine/iteagle_fpga.c new file mode 100644 index 00000000000..22f907ddcdd --- /dev/null +++ b/src/mame/machine/iteagle_fpga.c @@ -0,0 +1,364 @@ +#include "iteagle_fpga.h" +#include "coreutil.h" + +#define LOG_FPGA (1) +#define LOG_RTC (0) +#define LOG_EEPROM (1) +#define LOG_IDE (0) +#define LOG_IDE_CTRL (0) + + +const device_type ITEAGLE_FPGA = &device_creator<iteagle_fpga_device>; + +DEVICE_ADDRESS_MAP_START(ctrl_map, 32, iteagle_fpga_device) + AM_RANGE(0x000, 0x02f) AM_READWRITE(ctrl_r, ctrl_w) +ADDRESS_MAP_END + +DEVICE_ADDRESS_MAP_START(fpga_map, 32, iteagle_fpga_device) + AM_RANGE(0x000, 0x01f) AM_READWRITE(fpga_r, fpga_w) +ADDRESS_MAP_END + +DEVICE_ADDRESS_MAP_START(rtc_map, 32, iteagle_fpga_device) + AM_RANGE(0x000, 0x800) AM_READWRITE(rtc_r, rtc_w) +ADDRESS_MAP_END + +iteagle_fpga_device::iteagle_fpga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : pci_device(mconfig, ITEAGLE_FPGA, "ITEagle FPGA", tag, owner, clock, "iteagle_fpga", __FILE__) +{ +} + +void iteagle_fpga_device::device_start() +{ + pci_device::device_start(); + status = 0x5555; + command = 0x5555; + + add_map(sizeof(m_ctrl_regs), M_IO, FUNC(iteagle_fpga_device::ctrl_map)); + // ctrl defaults to base address 0x00000000 + bank_infos[0].adr = 0x00000000 & (~(bank_infos[0].size - 1)); + + add_map(sizeof(m_fpga_regs), M_IO, FUNC(iteagle_fpga_device::fpga_map)); + // fpga defaults to base address 0x00000300 + bank_infos[1].adr = 0x00000300 & (~(bank_infos[1].size - 1)); + + add_map(sizeof(m_rtc_regs), M_MEM, FUNC(iteagle_fpga_device::rtc_map)); + // RTC defaults to base address 0x000c0000 + bank_infos[2].adr = 0x000c0000 & (~(bank_infos[2].size - 1)); +} + +void iteagle_fpga_device::device_reset() +{ + pci_device::device_reset(); + memset(m_ctrl_regs, 0, sizeof(m_ctrl_regs)); + memset(m_fpga_regs, 0, sizeof(m_fpga_regs)); + memset(m_rtc_regs, 0, sizeof(m_rtc_regs)); + // 0x23 & 0x20 = IDE LED + m_ctrl_regs[0x10/4] = 0x00000000; // 0xFFFFFFFF causes a write of 0xFFFEFFFF then 0xFFFFFFFF // Not sure + // 0x00&0x2 == 1 for boot + m_fpga_regs[0x00/4] = 0xC0000002; // 0xCF000002;// byte 3 is voltage sensor? high = 0x40 good = 0xC0 0xF0 0xFF; //0x80 0x30 0x00FF = voltage low + //m_fpga_regs[0x308/4]=0x0000ffff; // Low 16 bits gets read alot? + m_fpga_regs[0x08/4]=0x00000000; // Low 16 bits gets read alot? + m_prev_reg = 0; +} + +READ32_MEMBER( iteagle_fpga_device::ctrl_r ) +{ + UINT32 result = m_fpga_regs[offset]; + switch (offset) { + case 0x0/4: + if (LOG_FPGA) + logerror("%s:fpga ctrl_r from offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, result, mem_mask); + break; + default: + if (LOG_FPGA) + logerror("%s:fpga ctrl_r from offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, result, mem_mask); + break; + } + return result; +} + +WRITE32_MEMBER( iteagle_fpga_device::ctrl_w ) +{ + COMBINE_DATA(&m_fpga_regs[offset]); + switch (offset) { + case 0x20/4: // IDE LED and ?? + if (ACCESSING_BITS_16_23) { + // Probably watchdog + } else if (ACCESSING_BITS_24_31) { + // Bit 1 is IDE LED + } else { + if (LOG_FPGA) + logerror("%s:fpga ctrl_w to offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, data, mem_mask); + } + break; + default: + if (LOG_FPGA) + logerror("%s:fpga ctrl_w to offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, data, mem_mask); + break; + } +} + +READ32_MEMBER( iteagle_fpga_device::fpga_r ) +{ + UINT32 result = m_fpga_regs[offset]; + switch (offset) { + case 0x00/4: + if (LOG_FPGA && (m_prev_reg != offset && m_prev_reg != (0x08/4))) + logerror("%s:fpga read from offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, result, mem_mask); + break; + case 0x04/4: + result = (result & 0xFF0FFFFF) | (machine().root_device().ioport("SW5")->read()<<20); // Resolution + if (LOG_FPGA) + logerror("%s:fpga read from offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, result, mem_mask); + break; + + case 0x08/4: + if (LOG_FPGA && (m_prev_reg != offset && m_prev_reg != (0x00/4))) + logerror("%s:fpga read from offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, result, mem_mask); + break; + default: + if (LOG_FPGA) + logerror("%s:fpga read from offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, result, mem_mask); + break; + } + m_prev_reg = offset; + return result; +} + +WRITE32_MEMBER( iteagle_fpga_device::fpga_w ) +{ + UINT8 byte; + + COMBINE_DATA(&m_fpga_regs[offset]); + switch (offset) { + case 0x04/4: + if (ACCESSING_BITS_0_7) { + // ATMEL Chip access. Returns version id's when bit 7 is set. + byte = data & 0xFF; + if (byte & 0x80) { + switch (byte&0x3) { + case 0: + m_fpga_regs[offset] = (m_fpga_regs[offset]&0xFFFFFF00) | ((machine().root_device().ioport("VERSION")->read()>>4)&0xF); + break; + case 1: + m_fpga_regs[offset] = (m_fpga_regs[offset]&0xFFFFFF00) | ((machine().root_device().ioport("VERSION")->read()>>8)&0xF); + break; + case 2: + m_fpga_regs[offset] = (m_fpga_regs[offset]&0xFFFFFF00) | ((machine().root_device().ioport("VERSION")->read()>>12)&0xF); + break; + case 3: + m_fpga_regs[offset] = (m_fpga_regs[offset]&0xFFFFFF00) | ((machine().root_device().ioport("VERSION")->read()>>0)&0xF); + break; + } + } // Else??? + } + if (LOG_FPGA) + logerror("%s:fpga write to offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, data, mem_mask); + break; + default: + if (LOG_FPGA) + logerror("%s:fpga write to offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, data, mem_mask); + break; + } +} +//************************************* +//* RTC M48T02 +//************************************* +READ32_MEMBER( iteagle_fpga_device::rtc_r ) +{ + UINT32 result = m_rtc_regs[offset]; + + switch (offset) { + default: + if (LOG_RTC) + logerror("%s:RTC read from offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, result, mem_mask); + break; + } + return result; +} +WRITE32_MEMBER( iteagle_fpga_device::rtc_w ) +{ + system_time systime; + int raw[8]; + + COMBINE_DATA(&m_rtc_regs[offset]); + switch (offset) { + case 0x7F8/4: // M48T02 time + if (data & mem_mask & 0x40) { + // get the current date/time from the core + machine().current_datetime(systime); + raw[0] = 0x40; + raw[1] = dec_2_bcd(systime.local_time.second); + raw[2] = dec_2_bcd(systime.local_time.minute); + raw[3] = dec_2_bcd(systime.local_time.hour); + + raw[4] = dec_2_bcd((systime.local_time.weekday != 0) ? systime.local_time.weekday : 7); + raw[5] = dec_2_bcd(systime.local_time.mday); + raw[6] = dec_2_bcd(systime.local_time.month + 1); + raw[7] = dec_2_bcd(systime.local_time.year - 1900); // Epoch is 1900 + m_rtc_regs[0x7F8/4] = (raw[3]<<24) | (raw[2]<<16) | (raw[1]<<8) | (raw[0] <<0); + //m_rtc_regs[0x7FC/4] = (raw[7]<<24) | (raw[6]<<16) | (raw[5]<<8) | (raw[4] <<0); + m_rtc_regs[0x7FC/4] = (0x95<<24) | (raw[6]<<16) | (raw[5]<<8) | (raw[4] <<0); + } + if (LOG_RTC) + logerror("%s:RTC write to offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, data, mem_mask); + + break; + default: + if (LOG_RTC) + logerror("%s:RTC write to offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, data, mem_mask); + break; + } + +} + +//************************************ +// Attached serial EEPROM +//************************************ + +const device_type ITEAGLE_EEPROM = &device_creator<iteagle_eeprom_device>; + +DEVICE_ADDRESS_MAP_START(eeprom_map, 32, iteagle_eeprom_device) + AM_RANGE(0x0000, 0x000F) AM_READWRITE(eeprom_r, eeprom_w) AM_SHARE("eeprom") +ADDRESS_MAP_END + +static MACHINE_CONFIG_FRAGMENT( iteagle_eeprom ) + MCFG_EEPROM_SERIAL_93C46_ADD("eeprom") +MACHINE_CONFIG_END + +machine_config_constructor iteagle_eeprom_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( iteagle_eeprom ); +} + +iteagle_eeprom_device::iteagle_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : pci_device(mconfig, ITEAGLE_EEPROM, "ITEagle EEPROM AT93C46", tag, owner, clock, "eeprom", __FILE__), + m_eeprom(*this, "eeprom") +{ +} + +void iteagle_eeprom_device::device_start() +{ + pci_device::device_start(); + skip_map_regs(1); + add_map(0x10, M_IO, FUNC(iteagle_eeprom_device::eeprom_map)); +} + +void iteagle_eeprom_device::device_reset() +{ + pci_device::device_reset(); +} + +READ32_MEMBER( iteagle_eeprom_device::eeprom_r ) +{ + UINT32 result = 0; + + switch (offset) { + case 0xC/4: // I2C Handler + if (ACCESSING_BITS_16_23) { + result = m_eeprom->do_read()<<(16+3); + } else { + if (LOG_EEPROM) + logerror("%s:eeprom read from offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, result, mem_mask); + } + break; + default: + if (LOG_EEPROM) + logerror("%s:eeprom read from offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, result, mem_mask); + break; + } + return result; +} + +WRITE32_MEMBER( iteagle_eeprom_device::eeprom_w ) +{ + switch (offset) { + case 0xC/4: // I2C Handler + if (ACCESSING_BITS_16_23) { + m_eeprom->di_write((data & 0x040000) >> (16+2)); + m_eeprom->cs_write((data & 0x020000) ? ASSERT_LINE : CLEAR_LINE); + m_eeprom->clk_write((data & 0x010000) ? ASSERT_LINE : CLEAR_LINE); + } else { + if (LOG_EEPROM) + logerror("%s:eeprom write to offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, data, mem_mask); + } + break; + default: + if (LOG_EEPROM) + logerror("%s:eeprom write to offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, data, mem_mask); + break; + } +} + +//************************************ +// Attached IDE Controller +//************************************ + +const device_type ITEAGLE_IDE = &device_creator<iteagle_ide_device>; + +DEVICE_ADDRESS_MAP_START(ide_map, 32, iteagle_ide_device) + AM_RANGE(0x0, 0xf) AM_READWRITE(ide_r, ide_w) +ADDRESS_MAP_END + +DEVICE_ADDRESS_MAP_START(ide_ctrl_map, 32, iteagle_ide_device) + AM_RANGE(0x0, 0x3) AM_READWRITE(ide_ctrl_r, ide_ctrl_w) +ADDRESS_MAP_END + + +static MACHINE_CONFIG_FRAGMENT( iteagle_ide ) + MCFG_BUS_MASTER_IDE_CONTROLLER_ADD("ide", ata_devices, "hdd", NULL, true) + MCFG_BUS_MASTER_IDE_CONTROLLER_SPACE(":maincpu", AS_PROGRAM) +MACHINE_CONFIG_END + +machine_config_constructor iteagle_ide_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( iteagle_ide ); +} +iteagle_ide_device::iteagle_ide_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : pci_device(mconfig, ITEAGLE_IDE, "ITEagle IDE Controller", tag, owner, clock, "ide", __FILE__), + m_ide(*this, "ide") +{ +} + +void iteagle_ide_device::device_start() +{ + pci_device::device_start(); + add_map(0x10, M_IO, FUNC(iteagle_ide_device::ide_map)); + bank_infos[0].adr = 0x1f0; + add_map(0x4, M_IO, FUNC(iteagle_ide_device::ide_ctrl_map)); + bank_infos[1].adr = 0x3f4; +} + +void iteagle_ide_device::device_reset() +{ + pci_device::device_reset(); +} +//************************************* +//* IDE +//************************************* +READ32_MEMBER( iteagle_ide_device::ide_r ) +{ + UINT32 result = m_ide->read_cs0(space, offset, mem_mask); + if (LOG_IDE) + logerror("%s:ide_r read from offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, result, mem_mask); + return result; +} +WRITE32_MEMBER( iteagle_ide_device::ide_w ) +{ + m_ide->write_cs0(space, offset, data, mem_mask); + if (LOG_IDE) + logerror("%s:ide_w write to offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, data, mem_mask); +} +READ32_MEMBER( iteagle_ide_device::ide_ctrl_r ) +{ + UINT32 result = m_ide->read_cs1(space, offset+1, mem_mask); + if (LOG_IDE_CTRL) + logerror("%s:ide_ctrl_r read from offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, result, mem_mask); + return result; +} +WRITE32_MEMBER( iteagle_ide_device::ide_ctrl_w ) +{ + m_ide->write_cs1(space, offset+1, data, mem_mask); + if (LOG_IDE_CTRL) + logerror("%s:ide_ctrl_w write to offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, data, mem_mask); +} diff --git a/src/mame/machine/iteagle_fpga.h b/src/mame/machine/iteagle_fpga.h new file mode 100644 index 00000000000..acc4bd85b00 --- /dev/null +++ b/src/mame/machine/iteagle_fpga.h @@ -0,0 +1,91 @@ +//************************************* +// iteagle fpga device +//************************************* +#ifndef ITEAGLE_FPGA_H +#define ITEAGLE_FPGA_H + +#include "machine/pci.h" +#include "machine/idectrl.h" +#include "machine/eepromser.h" + +#define MCFG_ITEAGLE_FPGA_ADD(_tag) \ + MCFG_PCI_DEVICE_ADD(_tag, ITEAGLE_FPGA, 0x55CC33AA, 0xAA, 0xAAAAAA, 0x00) + +#define MCFG_ITEAGLE_EEPROM_ADD(_tag) \ + MCFG_PCI_DEVICE_ADD(_tag, ITEAGLE_EEPROM, 0xAABBCCDD, 0x00, 0x088000, 0x00) + +#define MCFG_ITEAGLE_IDE_ADD(_tag) \ + MCFG_PCI_DEVICE_ADD(_tag, ITEAGLE_IDE, 0x11223344, 0x00, 0x010100, 0x00) + +class iteagle_fpga_device : public pci_device { +public: + iteagle_fpga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + +protected: + virtual void device_start(); + virtual void device_reset(); + +private: + + UINT32 m_ctrl_regs[0x30]; + UINT32 m_fpga_regs[0x20]; + UINT32 m_rtc_regs[0x800]; + UINT32 m_prev_reg; + + DECLARE_ADDRESS_MAP(rtc_map, 32); + DECLARE_ADDRESS_MAP(fpga_map, 32); + DECLARE_ADDRESS_MAP(ctrl_map, 32); + + DECLARE_READ32_MEMBER( ctrl_r ); + DECLARE_WRITE32_MEMBER( ctrl_w ); + DECLARE_READ32_MEMBER( fpga_r ); + DECLARE_WRITE32_MEMBER( fpga_w ); + DECLARE_READ32_MEMBER( rtc_r ); + DECLARE_WRITE32_MEMBER( rtc_w ); +}; + +class iteagle_eeprom_device : public pci_device { +public: + iteagle_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + // optional information overrides + virtual machine_config_constructor device_mconfig_additions() const; + + required_device<eeprom_serial_93cxx_device> m_eeprom; + +protected: + virtual void device_start(); + virtual void device_reset(); + +private: + DECLARE_ADDRESS_MAP(eeprom_map, 32); + DECLARE_READ32_MEMBER( eeprom_r ); + DECLARE_WRITE32_MEMBER( eeprom_w ); +}; + +class iteagle_ide_device : public pci_device { +public: + iteagle_ide_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + // optional information overrides + virtual machine_config_constructor device_mconfig_additions() const; + + required_device<bus_master_ide_controller_device> m_ide; + +protected: + virtual void device_start(); + virtual void device_reset(); + +private: + DECLARE_ADDRESS_MAP(ide_map, 32); + DECLARE_ADDRESS_MAP(ide_ctrl_map, 32); + + DECLARE_READ32_MEMBER( ide_r ); + DECLARE_WRITE32_MEMBER( ide_w ); + DECLARE_READ32_MEMBER( ide_ctrl_r ); + DECLARE_WRITE32_MEMBER( ide_ctrl_w ); +}; + +extern const device_type ITEAGLE_FPGA; +extern const device_type ITEAGLE_EEPROM; +extern const device_type ITEAGLE_IDE; + +#endif diff --git a/src/mame/machine/subs.c b/src/mame/machine/subs.c index 9947a95ac4b..b16c52671c7 100644 --- a/src/mame/machine/subs.c +++ b/src/mame/machine/subs.c @@ -9,8 +9,19 @@ /*************************************************************************** -subs_init_machine +machine initialization ***************************************************************************/ + +void subs_state::machine_start() +{ + save_item(NAME(m_steering_buf1)); + save_item(NAME(m_steering_buf2)); + save_item(NAME(m_steering_val1)); + save_item(NAME(m_steering_val2)); + save_item(NAME(m_last_val_1)); + save_item(NAME(m_last_val_2)); +} + void subs_state::machine_reset() { m_steering_buf1 = 0; @@ -20,9 +31,9 @@ void subs_state::machine_reset() } /*************************************************************************** -subs_interrupt +interrupt ***************************************************************************/ -INTERRUPT_GEN_MEMBER(subs_state::subs_interrupt) +INTERRUPT_GEN_MEMBER(subs_state::interrupt) { /* only do NMI interrupt if not in TEST mode */ if ((ioport("IN1")->read() & 0x40)==0x40) @@ -36,7 +47,7 @@ When D7 is high, the steering wheel has moved. If D6 is high, it moved left. If D6 is low, it moved right. Be sure to keep returning a direction until steer_reset is called. ***************************************************************************/ -int subs_state::subs_steering_1() +int subs_state::steering_1() { int this_val; int delta; @@ -64,7 +75,7 @@ int subs_state::subs_steering_1() return m_steering_val1; } -int subs_state::subs_steering_2() +int subs_state::steering_2() { int this_val; int delta; @@ -93,18 +104,18 @@ int subs_state::subs_steering_2() } /*************************************************************************** -subs_steer_reset +steer_reset ***************************************************************************/ -WRITE8_MEMBER(subs_state::subs_steer_reset_w) +WRITE8_MEMBER(subs_state::steer_reset_w) { m_steering_val1 = 0x00; m_steering_val2 = 0x00; } /*************************************************************************** -subs_control_r +control_r ***************************************************************************/ -READ8_MEMBER(subs_state::subs_control_r) +READ8_MEMBER(subs_state::control_r) { int inport = ioport("IN0")->read(); @@ -114,19 +125,19 @@ READ8_MEMBER(subs_state::subs_control_r) case 0x01: return ((inport & 0x02) << 6); /* diag hold */ case 0x02: return ((inport & 0x04) << 5); /* slam */ case 0x03: return ((inport & 0x08) << 4); /* spare */ - case 0x04: return ((subs_steering_1() & 0x40) << 1); /* steer dir 1 */ - case 0x05: return ((subs_steering_1() & 0x80) << 0); /* steer flag 1 */ - case 0x06: return ((subs_steering_2() & 0x40) << 1); /* steer dir 2 */ - case 0x07: return ((subs_steering_2() & 0x80) << 0); /* steer flag 2 */ + case 0x04: return ((steering_1() & 0x40) << 1); /* steer dir 1 */ + case 0x05: return ((steering_1() & 0x80) << 0); /* steer flag 1 */ + case 0x06: return ((steering_2() & 0x40) << 1); /* steer dir 2 */ + case 0x07: return ((steering_2() & 0x80) << 0); /* steer flag 2 */ } return 0; } /*************************************************************************** -subs_coin_r +coin_r ***************************************************************************/ -READ8_MEMBER(subs_state::subs_coin_r) +READ8_MEMBER(subs_state::coin_r) { int inport = ioport("IN1")->read(); @@ -146,9 +157,9 @@ READ8_MEMBER(subs_state::subs_coin_r) } /*************************************************************************** -subs_options_r +options_r ***************************************************************************/ -READ8_MEMBER(subs_state::subs_options_r) +READ8_MEMBER(subs_state::options_r) { int opts = ioport("DSW")->read(); @@ -164,17 +175,17 @@ READ8_MEMBER(subs_state::subs_options_r) } /*************************************************************************** -subs_lamp1_w +lamp1_w ***************************************************************************/ -WRITE8_MEMBER(subs_state::subs_lamp1_w) +WRITE8_MEMBER(subs_state::lamp1_w) { set_led_status(machine(), 0,~offset & 1); } /*************************************************************************** -subs_lamp2_w +lamp2_w ***************************************************************************/ -WRITE8_MEMBER(subs_state::subs_lamp2_w) +WRITE8_MEMBER(subs_state::lamp2_w) { set_led_status(machine(), 1,~offset & 1); } diff --git a/src/mame/mame.lst b/src/mame/mame.lst index ffff6c5ac71..cc31e505792 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -2757,6 +2757,7 @@ bgaregganv // (c) 1996 Raizing/8ing bgareggat2 // (c) 1996 Raizing/8ing bgareggacn // (c) 1996 Raizing/8ing bgareggabl // hack +bgareggabla // hack batrider // (c) 1998 Raizing/8ing batrideru // (c) 1998 Raizing/8ing batriderc // (c) 1998 Raizing/8ing @@ -3109,8 +3110,9 @@ dynwar // 4/1989 (c) 1989 (USA) dynwara // 4/1989 (c) 1989 (USA) dynwarj // 4/1989 (c) 1989 (Japan) dynwarjr // 4/1989 (c) 1989 (Japan) -willow // 6/1989 (c) 1989 (USA) -willowo // 6/1989 (c) 1989 (USA) +willow // 6/1989 (c) 1989 (World) +willowu // 6/1989 (c) 1989 (USA) +willowuo // 6/1989 (c) 1989 (USA) willowj // 6/1989 (c) 1989 (Japan) unsquad // 8/1989 (c) 1989 (USA) area88 // 8/1989 (c) 1989 (Japan) @@ -3237,6 +3239,7 @@ sf2mdtb // bootleg sf2b // bootleg cworld2j // 11/06/1992 (c) 1992 (Japan) cworld2ja // 11/06/1992 (c) 1992 (Japan) +cworld2jb // 11/06/1992 (c) 1992 (Japan) varth // 14/07/1992 (c) 1992 (World) varthr1 // 12/06/1992 (c) 1992 (World) varthu // 12/06/1992 (c) 1992 (USA) @@ -5282,6 +5285,7 @@ mt_soni2 // 62 megaplay mp_sonic // 01 mp_gaxe2 // 02 +mp_gaxe2a // 02 mp_gslam // 03 mp_twc // 04 mp_sor2 // 05 @@ -8773,6 +8777,7 @@ gunbird // (c) 1994 gunbirdk // (c) 1994 gunbirdj // (c) 1994 btlkroad // (c) 1994 +btlkroadk // (c) 1994 s1945 // (c) 1995 s1945a // (c) 1995 s1945j // (c) 1995 @@ -9616,6 +9621,7 @@ tenkaie // 1991 Dynax ougonpai // 1991 Dynax ougonpaib // bootleg htengoku // 1992 Dynax +cdracula // 1994 Y.S.E. mjreach // 1994 Dynax mjdialq2 // "52" (c) 1991 Dynax yarunara // "55" Mahjong Yarunara 1991 Dynax @@ -10105,6 +10111,7 @@ twinbrata // (c) 1995 ppmast93 // (c) 1993 Electronic Devices S.R.L. twins // (c) 1994 twinsa // (c) 1994 +spider mwarr pzletime diff --git a/src/mame/mame.mak b/src/mame/mame.mak index 79420ebb9da..edad5da86bd 100644 --- a/src/mame/mame.mak +++ b/src/mame/mame.mak @@ -278,6 +278,7 @@ SOUNDS += MOS7360 #SOUNDS += VRC6 SOUNDS += SB0400 SOUNDS += AC97 +SOUNDS += ES1373 #------------------------------------------------- # specify available video cores @@ -346,6 +347,7 @@ VIDEOS += TMS9928A VIDEOS += V9938 #VIDEOS += VIC4567 VIDEOS += VOODOO +VIDEOS += VOODOO_PCI #------------------------------------------------- # specify available machine cores @@ -1263,7 +1265,7 @@ $(MAMEOBJ)/itech.a: \ $(DRIVERS)/capbowl.o $(VIDEO)/capbowl.o \ $(DRIVERS)/itech8.o $(MACHINE)/slikshot.o $(VIDEO)/itech8.o \ $(DRIVERS)/itech32.o $(VIDEO)/itech32.o \ - $(DRIVERS)/iteagle.o \ + $(DRIVERS)/iteagle.o $(MACHINE)/iteagle_fpga.o \ $(MAMEOBJ)/jaleco.a: \ $(DRIVERS)/aeroboto.o $(VIDEO)/aeroboto.o \ @@ -2688,7 +2690,8 @@ $(DRIVERS)/goldstar.o: $(LAYOUT)/goldstar.lh \ $(LAYOUT)/pokonl97.lh \ $(LAYOUT)/roypok96.lh \ $(LAYOUT)/skill98.lh \ - $(LAYOUT)/tonypok.lh + $(LAYOUT)/tonypok.lh \ + $(LAYOUT)/unkch.lh $(DRIVERS)/grchamp.o: $(LAYOUT)/grchamp.lh diff --git a/src/mame/video/cps1.c b/src/mame/video/cps1.c index c79703f03bf..f50066f26ed 100644 --- a/src/mame/video/cps1.c +++ b/src/mame/video/cps1.c @@ -43,7 +43,8 @@ Dynasty Wars (USA, B-Board 89624B-?) 89624B-? TK Tenchi wo Kurau (Japan) 88622B-3 TK22B LWIO 88622-C-2 CPS-B-02 DL-0411-10002 None Tenchi wo Kurau (Japan Resale Ver.) 91634B-2 TK163B BPRG1 IOB1 92631C-6 CPS-B-21 DL-0921-10014 C632 IOC1 -Willow (USA Old Ver.) 1989 89624B-3 WL24B LWIO 88622-C-2 CPS-B-03 DL-0411-10003 None +Willow (World) 1989 89624B-3 WL24B LWIO 88622-C-4 CPS-B-03 DL-0411-10003 None +Willow (USA Old Ver.) 89624B-3 WL24B LWIO 88622-C-2 CPS-B-03 DL-0411-10003 None Willow (USA) 89624B-3 WL24B LWIO 88622-C-2/4 CPS-B-03 DL-0411-10003 None Willow (Japan) 88622B-3 WL22B LWIO 88622-C-2 CPS-B-03 DL-0411-10003 None @@ -141,6 +142,8 @@ Street Fighter II': Champion Edition (Japan 920513) 91634B-2 S9 Street Fighter II': Champion Edition (Japan 920803) 91634B-2 S9263B BPRG1 IOB1 92631C-6 CPS-B-21 DL-0921-10014 C632 IOC1 Adventure Quiz Capcom World 2* (Japan 920611) 1992 89625B-1 Q522B LWIO 92641C-1 CPS-B-21 DL-0921-10014 IOC1 +Adventure Quiz Capcom World 2* (Japan 920611) 91634B-2 Q563B BPRG1 IOB1 92641C-1 CPS-B-21 DL-0921-10014 IOC1 +Adventure Quiz Capcom World 2 (Japan 920611) 90629B-3 Q529B IOB1 92641C-1 CPS-B-21 DL-0921-10014 IOC1 Varth: Operation Thunderstorm (World 920612) 1992 89624B-? VA24B IOB1 ? CPS-B-04 DL-0411-10005 Varth: Operation Thunderstorm (World 920714) 89624B-3 VA24B IOB1 88622-C-5 CPS-B-04 DL-0411-10005 None @@ -1399,7 +1402,8 @@ static const struct CPS1config cps1_config_table[]= {"dynwarj", CPS_B_02, mapper_TK22B }, {"dynwarjr", CPS_B_21_DEF, mapper_TK22B }, // wrong, this set uses TK163B, still not dumped {"willow", CPS_B_03, mapper_WL24B }, - {"willowo", CPS_B_03, mapper_WL24B }, + {"willowu", CPS_B_03, mapper_WL24B }, + {"willowuo", CPS_B_03, mapper_WL24B }, {"willowj", CPS_B_03, mapper_WL24B }, // wrong, this set uses WL22B, still not dumped {"ffight", CPS_B_04, mapper_S224B }, {"ffighta", CPS_B_04, mapper_S224B }, @@ -1531,7 +1535,8 @@ static const struct CPS1config cps1_config_table[]= {"varthu", CPS_B_04, mapper_VA63B }, /* CPSB test has been patched out (60=0008) register is also written to, possibly leftover from development */ {"varthj", CPS_B_21_BT5, mapper_VA22B }, /* CPSB test has been patched out (72=0001) register is also written to, possibly leftover from development */ {"cworld2j", CPS_B_21_BT6, mapper_Q522B, 0x36, 0, 0x34 }, /* (ports 36, 34 probably leftover input code from another game) */ - {"cworld2ja", CPS_B_21_DEF, mapper_Q522B }, // patched set, no battery, could be desuicided + {"cworld2ja", CPS_B_21_DEF, mapper_Q522B }, // patched set, no battery, could be desuicided // wrong, this set uses Q529B, still not dumped + {"cworld2jb", CPS_B_21_BT6, mapper_Q522B, 0x36, 0, 0x34 }, // wrong, this set uses Q563B, still not dumped {"wof", CPS_B_21_QS1, mapper_TK263B }, {"wofr1", CPS_B_21_DEF, mapper_TK263B }, // patched set coming from a desuicided board? {"wofa", CPS_B_21_DEF, mapper_TK263B }, // patched set coming from a desuicided board? diff --git a/src/mame/video/decmxc06.c b/src/mame/video/decmxc06.c index 3b908b6df80..61cc9d03d93 100644 --- a/src/mame/video/decmxc06.c +++ b/src/mame/video/decmxc06.c @@ -51,6 +51,7 @@ deco_mxc06_device::deco_mxc06_device(const machine_config &mconfig, const char * : device_t(mconfig, DECO_MXC06, "DECO MXC06 Sprite", tag, owner, clock, "deco_mxc06", __FILE__), device_video_interface(mconfig, *this), m_gfxregion(0), + m_ramsize(0x800), m_gfxdecode(*this), m_palette(*this) { @@ -73,7 +74,7 @@ void deco_mxc06_device::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cli int offs; offs = 0; - while (offs < 0x800 / 2) + while (offs < m_ramsize / 2) { int sx, sy, code, color, w, h, flipx, flipy, incy, flash, mult, x, y; @@ -109,36 +110,44 @@ void deco_mxc06_device::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cli else mult = -16; + + // thedeep strongly suggests that this check goes here, otherwise the radar breaks + if (!(spriteram[offs] & 0x8000)) + { + offs += 4; + continue; + } + + for (x = 0; x < w; x++) { // maybe, birdie try appears to specify the base code for each part.. code = spriteram[offs + 1] & 0x1fff; - code &= ~(h-1); + code &= ~(h - 1); if (flipy) incy = -1; else { - code += h-1; + code += h - 1; incy = 1; } for (y = 0; y < h; y++) { - if (spriteram[offs] & 0x8000) { int draw = 0; if (!flash || (m_screen->frame_number() & 1)) { - if (m_priority_type==0) // most cases + if (m_priority_type == 0) // most cases { if ((color & pri_mask) == pri_val) { draw = 1; } } - else if (m_priority_type==1) // vaportra + else if (m_priority_type == 1) // vaportra { if (pri_mask && (color >= pri_val)) continue; @@ -152,18 +161,20 @@ void deco_mxc06_device::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cli if (draw) { - m_gfxdecode->gfx(m_gfxregion)->transpen(bitmap,cliprect, + m_gfxdecode->gfx(m_gfxregion)->transpen(bitmap, cliprect, code - y * incy, color & col_mask, - flipx,flipy, - sx + (mult * x),sy + (mult * y),0); + flipx, flipy, + sx + (mult * x), sy + (mult * y), 0); } } } offs += 4; - if (offs >= 0x800 / 2) - return; + if (offs >= m_ramsize / 2) + return; + + } } } @@ -175,7 +186,7 @@ void deco_mxc06_device::draw_sprites_bootleg( bitmap_ind16 &bitmap, const rectan int offs; offs = 0; - while (offs < 0x800 / 2) + while (offs < m_ramsize / 2) { int sx, sy, code, color, flipx, flipy; diff --git a/src/mame/video/decmxc06.h b/src/mame/video/decmxc06.h index e7d5013b03f..114ffd865d6 100644 --- a/src/mame/video/decmxc06.h +++ b/src/mame/video/decmxc06.h @@ -11,6 +11,12 @@ public: static void static_set_gfxdecode_tag(device_t &device, const char *tag); static void static_set_palette_tag(device_t &device, const char *tag); static void set_gfx_region(device_t &device, int region); + static void set_ram_size(device_t &device, int size) + { + deco_mxc06_device &dev = downcast<deco_mxc06_device &>(device); + dev.m_ramsize = size; + } + void set_gfxregion(int region) { m_gfxregion = region; }; void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16* spriteram16, int pri_mask, int pri_val, int col_mask ); @@ -23,6 +29,7 @@ protected: UINT8 m_gfxregion; int m_priority_type; // just so we can support the existing drivers without converting everything to pdrawgfx just yet + int m_ramsize; private: required_device<gfxdecode_device> m_gfxdecode; @@ -36,3 +43,6 @@ extern const device_type DECO_MXC06; #define MCFG_DECO_MXC06_PALETTE(_palette_tag) \ deco_mxc06_device::static_set_palette_tag(*device, "^" _palette_tag); + +#define MCFG_DECO_MXC06_RAMSIZE(_size) \ + deco_mxc06_device::set_ram_size(*device, _size); diff --git a/src/mame/video/dynax.c b/src/mame/video/dynax.c index 7f3f8d3d0b4..86994063971 100644 --- a/src/mame/video/dynax.c +++ b/src/mame/video/dynax.c @@ -214,7 +214,7 @@ WRITE8_MEMBER(dynax_state::dynax_blit2_palbank_w) } -/* Which half of the layers to write two (interleaved games only) */ +/* Which half of the layers to write to (interleaved games only) */ WRITE8_MEMBER(dynax_state::hanamai_layer_half_w) { m_hanamai_layer_half = (~data) & 1; @@ -380,7 +380,15 @@ void dynax_state::blitter_plot_pixel( int layer, int mask, int x, int y, int pen } } +/* + Flags: + 7654 ---- - + ---- 3--- Rotation = SWAPXY + FLIPY + ---- -2-- - + ---- --1- 0 = Ignore the pens specified in ROM, draw everything with the pen supplied as parameter + ---- ---0 Clear +*/ int dynax_state::blitter_drawgfx( int layer, int mask, const char *gfx, int src, int pen, int x, int y, int wrap, int flags ) { UINT8 cmd; @@ -702,6 +710,7 @@ WRITE8_MEMBER(dynax_state::tenkai_blitter_rev2_w) } +// two blitters/screens WRITE8_MEMBER(dynax_state::jantouki_blitter_rev2_w) { switch (offset) @@ -730,6 +739,44 @@ WRITE8_MEMBER(dynax_state::jantouki_blitter2_rev2_w) } } +// first register does not trigger a blit, it sets the destination +WRITE8_MEMBER(dynax_state::cdracula_blitter_rev2_w) +{ + switch (offset) + { + case 0: + LOG(("DD=%02X ", data)); + + if (data & 0xf0) + { + hanamai_layer_half_w(space, offset, 0, mem_mask); + dynax_blit_dest_w(space, offset, data >> 4, mem_mask); + } + if (data & 0x0f) + { + hanamai_layer_half_w(space, offset, 1, mem_mask); + dynax_blit_dest_w(space, offset, data & 0x0f, mem_mask); + } + break; + case 1: m_blit_x = data; break; + case 2: m_blit_y = data; break; + case 3: m_blit_src = (m_blit_src & 0xffff00) | (data << 0); break; + case 4: m_blit_src = (m_blit_src & 0xff00ff) | (data << 8); break; + case 5: m_blit_src = (m_blit_src & 0x00ffff) | (data << 16); break; + case 6: dynax_blit_scroll_w(space, 0, data); break; + } +} + +WRITE8_MEMBER(dynax_state::dynax_blit_flags_w) +{ + LOG(("FLG=%02X ", data)); + + int flags = (data & 0x08) ? 0x08 : 0x00; + flags |= (data & 0x10) ? 0x02 : 0x00; + flags |= (data & 0x80) ? 0x01 : 0x00; + + dynax_blitter_start(flags); +} /*************************************************************************** @@ -1402,3 +1449,24 @@ UINT32 dynax_state::screen_update_mjdialq2(screen_device &screen, bitmap_ind16 & if (BIT(layers_ctrl, 1)) mjdialq2_copylayer(bitmap, cliprect, 1); return 0; } + + +UINT32 dynax_state::screen_update_cdracula(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + int layers_ctrl = ~m_layer_enable; + + if (debug_viewer(bitmap,cliprect)) + return 0; + + layers_ctrl &= debug_mask(); + + bitmap.fill((m_blit_backpen & 0xff) + (m_blit_palbank & 1) * 256, cliprect); + + m_extra_scroll_y = -8; + + if (BIT(layers_ctrl, 3)) hanamai_copylayer(bitmap, cliprect, 3); + if (BIT(layers_ctrl, 1)) hanamai_copylayer(bitmap, cliprect, 1); + if (BIT(layers_ctrl, 2)) hanamai_copylayer(bitmap, cliprect, 2); + if (BIT(layers_ctrl, 0)) hanamai_copylayer(bitmap, cliprect, 0); + return 0; +} diff --git a/src/mame/video/realbrk.c b/src/mame/video/realbrk.c index 3c793ac1c6e..0e17ba65769 100644 --- a/src/mame/video/realbrk.c +++ b/src/mame/video/realbrk.c @@ -88,13 +88,13 @@ TILE_GET_INFO_MEMBER(realbrk_state::get_tile_info_1) TILE_FLIPYX( attr >> 14 )); } -WRITE16_MEMBER(realbrk_state::realbrk_vram_0_w) +WRITE16_MEMBER(realbrk_state::vram_0_w) { COMBINE_DATA(&m_vram_0[offset]); m_tilemap_0->mark_tile_dirty(offset/2); } -WRITE16_MEMBER(realbrk_state::realbrk_vram_1_w) +WRITE16_MEMBER(realbrk_state::vram_1_w) { COMBINE_DATA(&m_vram_1[offset]); m_tilemap_1->mark_tile_dirty(offset/2); @@ -123,7 +123,7 @@ TILE_GET_INFO_MEMBER(realbrk_state::get_tile_info_2) 0); } -WRITE16_MEMBER(realbrk_state::realbrk_vram_2_w) +WRITE16_MEMBER(realbrk_state::vram_2_w) { COMBINE_DATA(&m_vram_2[offset]); m_tilemap_2->mark_tile_dirty(offset); @@ -154,6 +154,8 @@ void realbrk_state::video_start() m_tmpbitmap0 = auto_bitmap_ind16_alloc(machine(),32,32); m_tmpbitmap1 = auto_bitmap_ind16_alloc(machine(),32,32); + + save_item(NAME(m_disable_video)); } /*************************************************************************** @@ -167,7 +169,7 @@ void realbrk_state::video_start() of a sprite to be drawn. 0x300 items of the list seem to be used. Each sprite is made of several 16x16 tiles (from 1 to 32x32) and - can be zoomed / shrinked in size. + can be zoomed / shrunk in size. There are two set of tiles: with 256 or 16 colors. @@ -203,7 +205,6 @@ void realbrk_state::video_start() void realbrk_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect) { - UINT16 *spriteram16 = m_spriteram; int offs; int max_x = m_screen->width(); @@ -220,9 +221,9 @@ void realbrk_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect) UINT16 *s; - if (spriteram16[offs] & 0x8000) continue; + if (m_spriteram[offs] & 0x8000) continue; - s = &spriteram16[(spriteram16[offs] & 0x3ff) * 16/2]; + s = &m_spriteram[(m_spriteram[offs] & 0x3ff) * 16/2]; sy = s[ 0 ]; sx = s[ 1 ]; @@ -365,7 +366,6 @@ void realbrk_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect) /* layer : 0== bghigh<spr 1== bglow<spr<bghigh 2==spr<bglow 3==boarder */ void realbrk_state::dai2kaku_draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect, int layer) { - UINT16 *spriteram16 = m_spriteram; int offs; int max_x = m_screen->width(); @@ -380,9 +380,9 @@ void realbrk_state::dai2kaku_draw_sprites(bitmap_ind16 &bitmap,const rectangle & UINT16 *s; - if (spriteram16[offs] & 0x8000) continue; + if (m_spriteram[offs] & 0x8000) continue; - s = &spriteram16[(spriteram16[offs] & 0x3ff) * 16/2]; + s = &m_spriteram[(m_spriteram[offs] & 0x3ff) * 16/2]; sy = s[ 0 ]; sx = s[ 1 ]; @@ -467,7 +467,7 @@ void realbrk_state::dai2kaku_draw_sprites(bitmap_ind16 &bitmap,const rectangle & ***************************************************************************/ -WRITE16_MEMBER(realbrk_state::realbrk_vregs_w) +WRITE16_MEMBER(realbrk_state::vregs_w) { UINT16 old_data = m_vregs[offset]; UINT16 new_data = COMBINE_DATA(&m_vregs[offset]); @@ -478,7 +478,7 @@ WRITE16_MEMBER(realbrk_state::realbrk_vregs_w) } } -UINT32 realbrk_state::screen_update_realbrk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 realbrk_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int layers_ctrl = -1; diff --git a/src/mame/video/rltennis.c b/src/mame/video/rltennis.c index 6ce70857c74..993e719d08a 100644 --- a/src/mame/video/rltennis.c +++ b/src/mame/video/rltennis.c @@ -110,7 +110,7 @@ enum #define SRC_SHIFT 8 -WRITE16_MEMBER(rltennis_state::rlt_blitter_w) +WRITE16_MEMBER(rltennis_state::blitter_w) { int old_data=m_blitter[offset]; COMBINE_DATA(&m_blitter[offset]); @@ -224,9 +224,11 @@ void rltennis_state::video_start() m_tmp_bitmap[BITMAP_FG_1] = auto_bitmap_ind16_alloc(machine(), 512, 256); m_tmp_bitmap[BITMAP_FG_2] = auto_bitmap_ind16_alloc(machine(), 512, 256); m_tmp_bitmap[BITMAP_FG_DISPLAY] = auto_bitmap_ind16_alloc(machine(), 512, 256); + + save_item(NAME(m_blitter)); } -UINT32 rltennis_state::screen_update_rltennis(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 rltennis_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { copybitmap(bitmap, *m_tmp_bitmap[BITMAP_BG], 0, 0, 0, 0, cliprect); copybitmap_trans(bitmap, *m_tmp_bitmap[BITMAP_FG_DISPLAY], 0, 0, 0, 0, cliprect, 0); diff --git a/src/mame/video/seta.c b/src/mame/video/seta.c index 74cc22b321a..ca5cfd8ea54 100644 --- a/src/mame/video/seta.c +++ b/src/mame/video/seta.c @@ -523,7 +523,7 @@ VIDEO_START_MEMBER(seta_state,twineagl_1_layer) m_tilemap_1->set_transparent_pen(0); } -int setac_gfxbank_callback( running_machine &machine, UINT16 code, UINT8 color ) +SETA001_SPRITE_GFXBANK_CB_MEMBER(seta_state::setac_gfxbank_callback) { int bank = (color & 0x06) >> 1; code = (code & 0x3fff) + (bank * 0x4000); @@ -549,10 +549,6 @@ VIDEO_START_MEMBER(seta_state,seta_no_layers) // position kludges m_seta001->set_fg_xoffsets(m_global_offsets->sprite_offs[1], m_global_offsets->sprite_offs[0]); m_seta001->set_fg_yoffsets( -0x0a, 0x0e ); - - // banking - m_seta001->set_gfxbank_callback( setac_gfxbank_callback ); - } diff --git a/src/mame/video/seta001.c b/src/mame/video/seta001.c index ed5d689ddd5..796efafbd4a 100644 --- a/src/mame/video/seta001.c +++ b/src/mame/video/seta001.c @@ -83,9 +83,9 @@ void seta001_device::device_start() m_colorbase = 0; m_spritelimit = 0x1ff; - m_bankcallback = NULL; - m_bgflag = 0x00; + + m_gfxbank_cb.bind_relative_to(*owner()); save_item(NAME(m_bgflag)); save_item(NAME(m_spritectrl)); @@ -237,7 +237,7 @@ void seta001_device::draw_background( bitmap_ind16 &bitmap, const rectangle &cli int max_y = 0xf0; // HACKS - // used in conjuntion with setac_type + // used in conjunction with setac_type int col0; /* Kludge, needed for krzybowl and kiwame */ switch (ctrl & 0x0f) { @@ -372,7 +372,7 @@ void seta001_device::draw_foreground( screen_device &screen, bitmap_ind16 &bitma flipx = ctrl_pointer[i] & 0x80; flipy = ctrl_pointer[i] & 0x40; - if (m_bankcallback) code = m_bankcallback(machine(), code, color_pointer[i]); + if (!m_gfxbank_cb.isnull()) code = m_gfxbank_cb(code, color_pointer[i]); color %= total_color_codes; diff --git a/src/mame/video/seta001.h b/src/mame/video/seta001.h index f5acc6c94d5..bd5de9d4c80 100644 --- a/src/mame/video/seta001.h +++ b/src/mame/video/seta001.h @@ -1,5 +1,10 @@ -typedef int (*seta001_gfxbank_callback_func)(running_machine &machine, UINT16 code, UINT8 color); +typedef device_delegate<int (UINT16 code, UINT8 color)> gfxbank_cb_delegate; + +#define SETA001_SPRITE_GFXBANK_CB_MEMBER(_name) int _name(UINT16 code, UINT8 color) + +#define MCFG_SETA001_SPRITE_GFXBANK_CB(_class, _method) \ + seta001_device::set_gfxbank_callback(*device, gfxbank_cb_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner))); class seta001_device : public device_t { @@ -9,6 +14,7 @@ public: // static configuration static void static_set_gfxdecode_tag(device_t &device, const char *tag); static void static_set_palette_tag(device_t &device, const char *tag); + static void set_gfxbank_callback(device_t &device, gfxbank_cb_delegate callback) { downcast<seta001_device &>(device).m_gfxbank_cb = callback; } DECLARE_WRITE8_MEMBER( spritebgflag_w8 ); @@ -46,8 +52,6 @@ public: int is_flipped() { return ((m_spritectrl[ 0 ] & 0x40) >> 6); }; - void set_gfxbank_callback(seta001_gfxbank_callback_func callback) { m_bankcallback = callback; }; - protected: virtual void device_start(); virtual void device_reset(); @@ -59,7 +63,7 @@ private: required_device<gfxdecode_device> m_gfxdecode; required_device<palette_device> m_palette; - seta001_gfxbank_callback_func m_bankcallback; + gfxbank_cb_delegate m_gfxbank_cb; // configuration int m_fg_flipxoffs, m_fg_noflipxoffs; diff --git a/src/mame/video/seta2.c b/src/mame/video/seta2.c index 229b01d81df..333bf9daa0d 100644 --- a/src/mame/video/seta2.c +++ b/src/mame/video/seta2.c @@ -108,7 +108,7 @@ ***************************************************************************/ -WRITE16_MEMBER(seta2_state::seta2_vregs_w) +WRITE16_MEMBER(seta2_state::vregs_w) { /* 02/04 = horizontal display start/end mj4simai = 0065/01E5 (0180 visible area) @@ -441,7 +441,7 @@ void seta2_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect) ***************************************************************************/ -VIDEO_START_MEMBER(seta2_state,seta2) +void seta2_state::video_start() { m_gfxdecode->gfx(2)->set_granularity(16); m_gfxdecode->gfx(3)->set_granularity(16); @@ -452,26 +452,23 @@ VIDEO_START_MEMBER(seta2_state,seta2) m_xoffset = 0; m_yoffset = 0; - - //TODO:FIX - //save_pointer(NAME(m_vregs), 0x40); } -VIDEO_START_MEMBER(seta2_state,seta2_xoffset) +VIDEO_START_MEMBER(seta2_state,xoffset) { - VIDEO_START_CALL_MEMBER(seta2); - + video_start(); + m_xoffset = 0x200; } -VIDEO_START_MEMBER(seta2_state,seta2_yoffset) +VIDEO_START_MEMBER(seta2_state,yoffset) { - VIDEO_START_CALL_MEMBER(seta2); - + video_start(); + m_yoffset = 0x10; } -UINT32 seta2_state::screen_update_seta2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 seta2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { // Black or pen 0? bitmap.fill(m_palette->pen(0), cliprect); @@ -482,7 +479,7 @@ UINT32 seta2_state::screen_update_seta2(screen_device &screen, bitmap_ind16 &bit return 0; } -void seta2_state::screen_eof_seta2(screen_device &screen, bool state) +void seta2_state::screen_eof(screen_device &screen, bool state) { // rising edge if (state) diff --git a/src/mame/video/srmp2.c b/src/mame/video/srmp2.c index bd059fea2a0..4c3fd389786 100644 --- a/src/mame/video/srmp2.c +++ b/src/mame/video/srmp2.c @@ -37,14 +37,12 @@ PALETTE_INIT_MEMBER(srmp2_state,srmp3) } } -int srmp3_gfxbank_callback( running_machine &machine, UINT16 code, UINT8 color ) +SETA001_SPRITE_GFXBANK_CB_MEMBER(srmp2_state::srmp3_gfxbank_callback) { - srmp2_state *state = machine.driver_data<srmp2_state>(); - if (code & 0x2000) { code = (code & 0x1fff); - code += ((state->m_gfx_bank + 1) * 0x2000); + code += ((m_gfx_bank + 1) * 0x2000); } return code; @@ -77,8 +75,6 @@ UINT32 srmp2_state::screen_update_srmp3(screen_device &screen, bitmap_ind16 &bit m_seta001->set_bg_xoffsets( -0x01, 0x10 ); m_seta001->set_bg_yoffsets( -0x06, 0x06 ); - m_seta001->set_gfxbank_callback( srmp3_gfxbank_callback ); - m_seta001->draw_sprites(screen,bitmap,cliprect,0x1000, 1); return 0; } @@ -93,8 +89,6 @@ UINT32 srmp2_state::screen_update_mjyuugi(screen_device &screen, bitmap_ind16 &b m_seta001->set_spritelimit( 0x1ff-6 ); - m_seta001->set_gfxbank_callback( srmp3_gfxbank_callback ); - m_seta001->draw_sprites(screen,bitmap,cliprect,0x1000, 1); return 0; } diff --git a/src/mame/video/ssrj.c b/src/mame/video/ssrj.c index 91443bc80c2..0a227f6ecd5 100644 --- a/src/mame/video/ssrj.c +++ b/src/mame/video/ssrj.c @@ -3,7 +3,7 @@ /* tilemap 1 */ -WRITE8_MEMBER(ssrj_state::ssrj_vram1_w) +WRITE8_MEMBER(ssrj_state::vram1_w) { m_vram1[offset] = data; m_tilemap1->mark_tile_dirty(offset>>1); @@ -21,7 +21,7 @@ TILE_GET_INFO_MEMBER(ssrj_state::get_tile_info1) /* tilemap 2 */ -WRITE8_MEMBER(ssrj_state::ssrj_vram2_w) +WRITE8_MEMBER(ssrj_state::vram2_w) { m_vram2[offset] = data; m_tilemap2->mark_tile_dirty(offset>>1); @@ -39,7 +39,7 @@ TILE_GET_INFO_MEMBER(ssrj_state::get_tile_info2) /* tilemap 4 */ -WRITE8_MEMBER(ssrj_state::ssrj_vram4_w) +WRITE8_MEMBER(ssrj_state::vram4_w) { m_vram4[offset] = data; m_tilemap4->mark_tile_dirty(offset>>1); @@ -60,7 +60,7 @@ TILE_GET_INFO_MEMBER(ssrj_state::get_tile_info4) TODO: This table is nowhere near as accurate. If you bother, here's how colors should be: -"START" sign is red with dark blue background. -Sidewalk is yellow-ish. --first opponents have swapped colors (blue/yellow ?nstead of yellow/blue) +-first opponents have swapped colors (blue/yellow instead of yellow/blue) -after the first stage, houses have red/white colors. */ @@ -270,7 +270,7 @@ PALETTE_INIT_MEMBER(ssrj_state, ssrj) palette.set_pen_color(i*8+j, fakecols[i][j][0], fakecols[i][j][1], fakecols[i][j][2]); } -UINT32 ssrj_state::screen_update_ssrj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 ssrj_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_tilemap1->set_scrollx(0, 0xff-m_scrollram[2] ); m_tilemap1->set_scrolly(0, m_scrollram[0] ); @@ -282,7 +282,7 @@ UINT32 ssrj_state::screen_update_ssrj(screen_device &screen, bitmap_ind16 &bitma return 0; } -void ssrj_state::screen_eof_ssrj(screen_device &screen, bool state) +void ssrj_state::screen_eof(screen_device &screen, bool state) { // rising edge if (state) diff --git a/src/mame/video/subs.c b/src/mame/video/subs.c index 52a3462a167..eca6b79a098 100644 --- a/src/mame/video/subs.c +++ b/src/mame/video/subs.c @@ -8,7 +8,7 @@ #include "includes/subs.h" #include "sound/discrete.h" -WRITE8_MEMBER(subs_state::subs_invert1_w) +WRITE8_MEMBER(subs_state::invert1_w) { if ((offset & 0x01) == 1) { @@ -22,7 +22,7 @@ WRITE8_MEMBER(subs_state::subs_invert1_w) } } -WRITE8_MEMBER(subs_state::subs_invert2_w) +WRITE8_MEMBER(subs_state::invert2_w) { if ((offset & 0x01) == 1) { @@ -37,15 +37,11 @@ WRITE8_MEMBER(subs_state::subs_invert2_w) } -UINT32 subs_state::screen_update_subs_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 subs_state::screen_update_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 *videoram = m_videoram; - UINT8 *spriteram = m_spriteram; - int offs; - /* for every character in the Video RAM, check if it has been modified */ /* since last time and update it accordingly. */ - for (offs = 0x400 - 1; offs >= 0; offs--) + for (int offs = 0x400 - 1; offs >= 0; offs--) { int charcode; int sx,sy; @@ -55,7 +51,7 @@ UINT32 subs_state::screen_update_subs_left(screen_device &screen, bitmap_ind16 & left_sonar_window = 0; right_sonar_window = 0; - charcode = videoram[offs]; + charcode = m_videoram[offs]; /* Which monitor is this for? */ // right_enable = charcode & 0x40; @@ -84,18 +80,18 @@ UINT32 subs_state::screen_update_subs_left(screen_device &screen, bitmap_ind16 & } /* draw the motion objects */ - for (offs = 0; offs < 4; offs++) + for (int offs = 0; offs < 4; offs++) { int sx,sy; int charcode; int prom_set; int sub_enable; - sx = spriteram[0x00 + (offs * 2)] - 16; - sy = spriteram[0x08 + (offs * 2)] - 16; - charcode = spriteram[0x09 + (offs * 2)]; + sx = m_spriteram[0x00 + (offs * 2)] - 16; + sy = m_spriteram[0x08 + (offs * 2)] - 16; + charcode = m_spriteram[0x09 + (offs * 2)]; if (offs < 2) - sub_enable = spriteram[0x01 + (offs * 2)] & 0x80; + sub_enable = m_spriteram[0x01 + (offs * 2)] & 0x80; else sub_enable = 1; @@ -112,20 +108,16 @@ UINT32 subs_state::screen_update_subs_left(screen_device &screen, bitmap_ind16 & /* Update sound */ address_space &space = machine().driver_data()->generic_space(); - m_discrete->write(space, SUBS_LAUNCH_DATA, spriteram[5] & 0x0f); // Launch data - m_discrete->write(space, SUBS_CRASH_DATA, spriteram[5] >> 4); // Crash/explode data + m_discrete->write(space, SUBS_LAUNCH_DATA, m_spriteram[5] & 0x0f); // Launch data + m_discrete->write(space, SUBS_CRASH_DATA, m_spriteram[5] >> 4); // Crash/explode data return 0; } -UINT32 subs_state::screen_update_subs_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 subs_state::screen_update_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 *videoram = m_videoram; - UINT8 *spriteram = m_spriteram; - int offs; - /* for every character in the Video RAM, check if it has been modified */ /* since last time and update it accordingly. */ - for (offs = 0x400 - 1; offs >= 0; offs--) + for (int offs = 0x400 - 1; offs >= 0; offs--) { int charcode; int sx,sy; @@ -135,7 +127,7 @@ UINT32 subs_state::screen_update_subs_right(screen_device &screen, bitmap_ind16 left_sonar_window = 0; right_sonar_window = 0; - charcode = videoram[offs]; + charcode = m_videoram[offs]; /* Which monitor is this for? */ right_enable = charcode & 0x40; @@ -164,18 +156,18 @@ UINT32 subs_state::screen_update_subs_right(screen_device &screen, bitmap_ind16 } /* draw the motion objects */ - for (offs = 0; offs < 4; offs++) + for (int offs = 0; offs < 4; offs++) { int sx,sy; int charcode; int prom_set; int sub_enable; - sx = spriteram[0x00 + (offs * 2)] - 16; - sy = spriteram[0x08 + (offs * 2)] - 16; - charcode = spriteram[0x09 + (offs * 2)]; + sx = m_spriteram[0x00 + (offs * 2)] - 16; + sy = m_spriteram[0x08 + (offs * 2)] - 16; + charcode = m_spriteram[0x09 + (offs * 2)]; if (offs < 2) - sub_enable = spriteram[0x01 + (offs * 2)] & 0x80; + sub_enable = m_spriteram[0x01 + (offs * 2)] & 0x80; else sub_enable = 1; diff --git a/src/mame/video/suna16.c b/src/mame/video/suna16.c index b9d36b13a94..e58ce304103 100644 --- a/src/mame/video/suna16.c +++ b/src/mame/video/suna16.c @@ -60,7 +60,7 @@ #include "emu.h" #include "includes/suna16.h" -WRITE16_MEMBER(suna16_state::suna16_flipscreen_w) +WRITE16_MEMBER(suna16_state::flipscreen_w) { if (ACCESSING_BITS_0_7) { @@ -92,14 +92,16 @@ WRITE16_MEMBER(suna16_state::bestbest_flipscreen_w) void suna16_state::video_start() { m_paletteram = auto_alloc_array(machine(), UINT16, m_palette->entries()); + + save_item(NAME(m_color_bank)); } -READ16_MEMBER(suna16_state::suna16_paletteram16_r) +READ16_MEMBER(suna16_state::paletteram_r) { return m_paletteram[offset + m_color_bank * 256]; } -WRITE16_MEMBER(suna16_state::suna16_paletteram16_w) +WRITE16_MEMBER(suna16_state::paletteram_w) { offset += m_color_bank * 256; data = COMBINE_DATA(&m_paletteram[offset]); @@ -117,11 +119,10 @@ WRITE16_MEMBER(suna16_state::suna16_paletteram16_w) void suna16_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16 *sprites, int gfx) { - int offs; int max_x = m_screen->width() - 8; int max_y = m_screen->height() - 8; - for ( offs = 0xfc00/2; offs < 0x10000/2 ; offs += 4/2 ) + for ( int offs = 0xfc00/2; offs < 0x10000/2 ; offs += 4/2 ) { int srcpg, srcx,srcy, dimx,dimy; int tile_x, tile_xinc, tile_xstart; @@ -213,7 +214,7 @@ void suna16_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, ***************************************************************************/ -UINT32 suna16_state::screen_update_suna16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 suna16_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { /* Suna Quiz indicates the background is the last pen */ bitmap.fill(0xff, cliprect); diff --git a/src/mame/video/suprloco.c b/src/mame/video/suprloco.c index 815a45b25a7..6021a01a2bc 100644 --- a/src/mame/video/suprloco.c +++ b/src/mame/video/suprloco.c @@ -1,6 +1,6 @@ /*************************************************************************** - video.c + suprloco.c Functions to emulate the video hardware of the machine. @@ -98,6 +98,8 @@ void suprloco_state::video_start() 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); m_bg_tilemap->set_scroll_rows(32); + + save_item(NAME(m_control)); } @@ -108,13 +110,13 @@ void suprloco_state::video_start() ***************************************************************************/ -WRITE8_MEMBER(suprloco_state::suprloco_videoram_w) +WRITE8_MEMBER(suprloco_state::videoram_w) { m_videoram[offset] = data; m_bg_tilemap->mark_tile_dirty(offset/2); } -WRITE8_MEMBER(suprloco_state::suprloco_scrollram_w) +WRITE8_MEMBER(suprloco_state::scrollram_w) { int adj = flip_screen() ? -8 : 8; @@ -122,7 +124,7 @@ WRITE8_MEMBER(suprloco_state::suprloco_scrollram_w) m_bg_tilemap->set_scrollx(offset, data - adj); } -WRITE8_MEMBER(suprloco_state::suprloco_control_w) +WRITE8_MEMBER(suprloco_state::control_w) { /* There is probably a palette select in here */ @@ -148,7 +150,7 @@ WRITE8_MEMBER(suprloco_state::suprloco_control_w) } -READ8_MEMBER(suprloco_state::suprloco_control_r) +READ8_MEMBER(suprloco_state::control_r) { return m_control; } @@ -256,7 +258,7 @@ void suprloco_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec } } -UINT32 suprloco_state::screen_update_suprloco(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 suprloco_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0,0); draw_sprites(bitmap,cliprect); diff --git a/src/mame/video/suprridr.c b/src/mame/video/suprridr.c index a3e981b6c24..adaa1f4673f 100644 --- a/src/mame/video/suprridr.c +++ b/src/mame/video/suprridr.c @@ -44,6 +44,9 @@ void suprridr_state::video_start() 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); m_fg_tilemap->set_transparent_pen(0); + + save_item(NAME(m_flipx)); + save_item(NAME(m_flipy)); } @@ -91,39 +94,39 @@ PALETTE_INIT_MEMBER(suprridr_state, suprridr) * *************************************/ -WRITE8_MEMBER(suprridr_state::suprridr_flipx_w) +WRITE8_MEMBER(suprridr_state::flipx_w) { m_flipx = data & 1; machine().tilemap().set_flip_all((m_flipx ? TILEMAP_FLIPX : 0) | (m_flipy ? TILEMAP_FLIPY : 0)); } -WRITE8_MEMBER(suprridr_state::suprridr_flipy_w) +WRITE8_MEMBER(suprridr_state::flipy_w) { m_flipy = data & 1; machine().tilemap().set_flip_all((m_flipx ? TILEMAP_FLIPX : 0) | (m_flipy ? TILEMAP_FLIPY : 0)); } -WRITE8_MEMBER(suprridr_state::suprridr_fgdisable_w) +WRITE8_MEMBER(suprridr_state::fgdisable_w) { m_fg_tilemap->enable(~data & 1); } -WRITE8_MEMBER(suprridr_state::suprridr_fgscrolly_w) +WRITE8_MEMBER(suprridr_state::fgscrolly_w) { m_fg_tilemap->set_scrolly(0, data); } -WRITE8_MEMBER(suprridr_state::suprridr_bgscrolly_w) +WRITE8_MEMBER(suprridr_state::bgscrolly_w) { m_bg_tilemap->set_scrolly(0, data); } -int suprridr_state::suprridr_is_screen_flipped() +int suprridr_state::is_screen_flipped() { return m_flipx; /* or is it flipy? */ } @@ -136,7 +139,7 @@ int suprridr_state::suprridr_is_screen_flipped() * *************************************/ -WRITE8_MEMBER(suprridr_state::suprridr_bgram_w) +WRITE8_MEMBER(suprridr_state::bgram_w) { m_bgram[offset] = data; m_bg_tilemap->mark_tile_dirty(offset); @@ -144,7 +147,7 @@ WRITE8_MEMBER(suprridr_state::suprridr_bgram_w) } -WRITE8_MEMBER(suprridr_state::suprridr_fgram_w) +WRITE8_MEMBER(suprridr_state::fgram_w) { m_fgram[offset] = data; m_fg_tilemap->mark_tile_dirty(offset); @@ -158,11 +161,9 @@ WRITE8_MEMBER(suprridr_state::suprridr_fgram_w) * *************************************/ -UINT32 suprridr_state::screen_update_suprridr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 suprridr_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 *spriteram = m_spriteram; rectangle subclip; - int i; const rectangle &visarea = screen.visible_area(); /* render left 4 columns with no scroll */ @@ -188,14 +189,14 @@ UINT32 suprridr_state::screen_update_suprridr(screen_device &screen, bitmap_ind1 m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); /* draw the sprites */ - for (i = 0; i < 48; i++) + for (int i = 0; i < 48; i++) { - int code = (spriteram[i*4+1] & 0x3f) | ((spriteram[i*4+2] >> 1) & 0x40); - int color = spriteram[i*4+2] & 0x7f; - int fx = spriteram[i*4+1] & 0x40; - int fy = spriteram[i*4+1] & 0x80; - int x = spriteram[i*4+3]; - int y = 240 - spriteram[i*4+0]; + int code = (m_spriteram[i*4+1] & 0x3f) | ((m_spriteram[i*4+2] >> 1) & 0x40); + int color = m_spriteram[i*4+2] & 0x7f; + int fx = m_spriteram[i*4+1] & 0x40; + int fy = m_spriteram[i*4+1] & 0x80; + int x = m_spriteram[i*4+3]; + int y = 240 - m_spriteram[i*4+0]; if (m_flipx) { diff --git a/src/mame/video/thedeep.c b/src/mame/video/thedeep.c index f810cb7da58..2c081a9a05b 100644 --- a/src/mame/video/thedeep.c +++ b/src/mame/video/thedeep.c @@ -109,95 +109,6 @@ void thedeep_state::video_start() /*************************************************************************** - Sprites Drawing - -Offset: Bits: Value: - - 0 Y (low bits, 0 is bottom) - - 1 7------- Enable - -6------ Flip Y - --5----- Flip X ? (unused) - ---43--- Height: 1,2,4 or 8 tiles - -----21- Width: 1,2,4 or 8 tiles* - -------0 Y (High bit) - - 2 Code (low bits) - - 3 Code (high bits) - - 4 X (low bits, 0 is right) - - 5 7654---- Color - ----321- - -------0 X (High bit) - - 6 Unused - - 7 Unused - -* a sprite of width N uses N consecutive sprites. The first one specifies - all the data, the following ones only the tile code and color. - -***************************************************************************/ - -void thedeep_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - UINT8 *s = m_spriteram, *end = s + m_spriteram.bytes(); - - while (s < end) - { - int code,color,sx,sy,flipx,flipy,nx,ny,x,y,attr; - - attr = s[1]; - if (!(attr & 0x80)) { s+=8; continue; } - - sx = s[4]; - sy = s[0]; - - color = s[5]; - - flipx = attr & 0x00; // ? - flipy = attr & 0x40; - - nx = 1 << ((attr & 0x06) >> 1); - ny = 1 << ((attr & 0x18) >> 3); - - if (color & 1) sx -= 256; - if (attr & 1) sy -= 256; - - if (flip_screen()) - { - flipx = !flipx; - flipy = !flipy; - sy = sy - 8; - } - else - { - sx = 240 - sx; - sy = 240 - sy - ny * 16 + 16; - } - - for (x = 0; (x < nx) && (s < end); x++,s+=8) - { - code = s[2] + (s[3] << 8); - color = s[5] >> 4; - - for (y = 0; y < ny; y++) - { - m_gfxdecode->gfx(0)->transpen(bitmap,cliprect, - code + (flipy ? (ny - y - 1) : y), - color, - flipx,flipy, - sx + x * (flipx ? 16 : -16), sy + y * 16,0 ); - } - } - } -} - - -/*************************************************************************** - Screen Drawing ***************************************************************************/ @@ -219,7 +130,8 @@ UINT32 thedeep_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, bitmap.fill(m_palette->black_pen(), cliprect); m_tilemap_0->draw(screen, bitmap, cliprect, 0,0); - draw_sprites(bitmap,cliprect); + m_spritegen->draw_sprites(bitmap, cliprect, reinterpret_cast<UINT16 *>(m_spriteram.target()), 0x00, 0x00, 0x0f); m_tilemap_1->draw(screen, bitmap, cliprect, 0,0); return 0; } + diff --git a/src/mess/audio/upd1771.c b/src/mess/audio/upd1771.c index 4db60193920..f6ec40d0143 100644 --- a/src/mess/audio/upd1771.c +++ b/src/mess/audio/upd1771.c @@ -91,7 +91,7 @@ uPD1776C: mentioned in the bristow book, implements VSRSSS speech concatenation (see US Patent 4577343 which is a patent on this VSRSSS implementation) uPD1771C-006: used in NEC APC for sound as the "MPU" - -011: used on Firefox F-4 handheld + -011: used on Firefox F-4/Astro Thunder handheld -015: unknown, known to exist from part scalper sites only. -017: used on Epoch Super Cassete Vision for sound; This audio driver HLEs that part only. @@ -108,30 +108,36 @@ 6Mhz XIN 9 20 D2 6Mhz XOUT 10 19 D1 AUDOUT 11 18 D0 - NC 12 17 GND + NC(recheck!)12 17 GND AUDOUT(inv) 13 16 VCC GND 14 15 ? tied to pin 16 (VCC) through a resistor (pullup?) Pinout based on guesses and information in "Electronic Speech Synthesis" by Geoff Bristow (ISBN 0-07-007912-9, pages 148-152), and the data on page 233 of the Nec APC technical manual at http://bitsavers.trailing-edge.com/pdf/nec/APC/819-000100-1003_APC_System_Reference_Guide_Apr83.pdf + I/O pin purpose based on testing by kevtris. [x] is unsure: - PB3 1 28 PB2 - PB4(/ALE) 2 27 PB1 - PB5(/RD) 3 26 PB0 - PB6(/WR) 4 25 D7(PA7) - PB7(/CS) 5 24 D6(PA6) - /RESET 6 23 D5(PA5) - [TEST?] 7 22 D4(PA4) - VCC 8 21 D3(PA3) - XI(CLK) 9 20 D2(PA2) - XO 10 19 D1(PA1) - D/A OUT + 11 18 D0(PA0) - [D/A VREF] 12 17 CH2 - D/A OUT - 13 16 /EXTINT - GND 14 15 CH1 tied to pin 16 (VCC) through a resistor, on APC to VCC thru a 12k resistor and thru a 10uf cap to gnd - - CH1 and CH2 are some sort of mode selects? + PB3 <> 1 28 <> PB2 + PB4(/ALE) <> 2 27 <> PB1 + PB5(/RD) <> 3 26 <> PB0 + PB6(/WR) <> 4 25 <> D7(PA7) + PB7(/CS) <> 5 24 <> D6(PA6) + /RESET -> 6 23 <> D5(PA5) + [/TSTOUT?] <- 7 22 <> D4(PA4) + VCC -- 8 21 <> D3(PA3) + XI(CLK) -> 9 20 <> D2(PA2) + XO <- 10 19 <> D1(PA1) + D/A OUT + <- 11 18 <> D0(PA0) + D/A POWER -- 12 17 <- CH2 + D/A OUT - <- 13 16 <> /EXTINT and [/TSTOUT2?] (test out is related to pin 15 state) + GND -- 14 15 <- CH1 tied to pin 16 (VCC) through a resistor, on APC to VCC thru a 12k resistor and thru a 10uf cap to gnd + + CH1 and CH2 are mode selects, purpose based on testing by kevtris: + CH1 CH2 + H L - 'master' mode, pb4-pb7 are i/o? /EXTINT is an input + L L - 'slave' mode where pb4-pb7 are /ale /rd /wr /cs? /EXTINT may be an output in this mode? + X H - test mode: the 512 byte 16-bit wide ROM is output sequentially on pins pa7-pa0 and pb7-pb0 for the high and low bytes of each word respectively + D/A POWER is the FET source for the D/A OUT+ and D/A OUT- push-pull dac drains; it should be tied to VCC or thereabouts In the SCV (info from plgDavid): pin 5 is tied to the !SCPU pin on the Epoch TV chip pin 29 (0x3600 writes) diff --git a/src/mess/drivers/a7800.c b/src/mess/drivers/a7800.c index 8352d1ab71f..cffcd9c747b 100644 --- a/src/mess/drivers/a7800.c +++ b/src/mess/drivers/a7800.c @@ -117,10 +117,10 @@ public: m_maria(*this, "maria"), m_io_joysticks(*this, "joysticks"), m_io_buttons(*this, "buttons"), - m_io_vblank(*this, "vblank"), m_io_console_buttons(*this, "console_buttons"), m_cart(*this, "cartslot"), - m_screen(*this, "screen") { } + m_screen(*this, "screen"), + m_bios(*this, "maincpu") { } int m_lines; int m_ispal; @@ -132,8 +132,6 @@ public: int m_p2_one_button; int m_bios_enabled; - UINT8 *m_bios; - DECLARE_READ8_MEMBER(bios_or_cart_r); DECLARE_WRITE8_MEMBER(ram0_w); DECLARE_READ8_MEMBER(tia_r); @@ -158,10 +156,10 @@ protected: required_device<atari_maria_device> m_maria; required_ioport m_io_joysticks; required_ioport m_io_buttons; - required_ioport m_io_vblank; required_ioport m_io_console_buttons; required_device<a78_cart_slot_device> m_cart; required_device<screen_device> m_screen; + required_region_ptr<UINT8> m_bios; }; @@ -282,18 +280,17 @@ READ8_MEMBER(a7800_state::bios_or_cart_r) static ADDRESS_MAP_START( a7800_mem, AS_PROGRAM, 8, a7800_state ) AM_RANGE(0x0000, 0x001f) AM_MIRROR(0x300) AM_READWRITE(tia_r, tia_w) AM_RANGE(0x0020, 0x003f) AM_MIRROR(0x300) AM_DEVREADWRITE("maria", atari_maria_device, read, write) - AM_RANGE(0x0040, 0x00ff) AM_RAMBANK("ram0") // RAM (6116 block 0) - AM_RANGE(0x0140, 0x01ff) AM_RAMBANK("ram1") // RAM (6116 block 1) + AM_RANGE(0x0040, 0x00ff) AM_RAMBANK("zpmirror") // mirror of 0x2040-0x20ff, for zero page + AM_RANGE(0x0140, 0x01ff) AM_RAMBANK("spmirror") // mirror of 0x2140-0x21ff, for stack page AM_RANGE(0x0280, 0x02ff) AM_DEVREADWRITE("riot", riot6532_device, read, write) - AM_RANGE(0x0480, 0x04ff) AM_MIRROR(0x100) AM_RAMBANK("riot_ram") - AM_RANGE(0x1800, 0x27ff) AM_RAMBANK("main_ram") - - AM_RANGE(0x2040, 0x20ff) AM_RAMBANK("ram0") // mirror (6116 block 0) - AM_RANGE(0x2140, 0x21ff) AM_RAMBANK("ram1") // mirror (6116 block 1) - - AM_RANGE(0x2800, 0x2fff) AM_RAMBANK("mirror") // these should mirror "main_ram" (according to docs) - AM_RANGE(0x3000, 0x37ff) AM_RAMBANK("mirror") // but system have issues in such case... - AM_RANGE(0x3800, 0x3fff) AM_RAMBANK("mirror") + AM_RANGE(0x0480, 0x04ff) AM_RAM AM_SHARE("riot_ram") AM_MIRROR(0x100) + AM_RANGE(0x1800, 0x1fff) AM_RAM AM_SHARE("6116_1") + AM_RANGE(0x2000, 0x27ff) AM_RAM AM_SHARE("6116_2") AM_MIRROR(0x0800) + // According to the official Software Guide, the RAM at 0x2000 is + // repeatedly mirrored up to 0x3fff, but this is evidently incorrect + // because the High Score Cartridge maps ROM at 0x3000-0x3fff + // Hardware tests show that only the mirror at 0x2800-0x2fff actually + // exists, and only on some hardware (MARIA? motherboard?) revisions AM_RANGE(0x4000, 0xffff) AM_DEVWRITE("cartslot", a78_cart_slot_device, write_40xx) AM_RANGE(0x4000, 0xbfff) AM_DEVREAD("cartslot", a78_cart_slot_device, read_40xx) AM_RANGE(0xc000, 0xffff) AM_READ(bios_or_cart_r) // here also the BIOS can be accessed @@ -322,10 +319,6 @@ static INPUT_PORTS_START( a7800 ) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_PLAYER(1) PORT_BIT(0xF0, IP_ACTIVE_LOW, IPT_UNUSED) - PORT_START("vblank") - PORT_BIT(0x7F, IP_ACTIVE_LOW, IPT_UNUSED) - PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_VBLANK("screen") - PORT_START("console_buttons") PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Reset") PORT_CODE(KEYCODE_R) PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Select") PORT_CODE(KEYCODE_S) @@ -1306,7 +1299,6 @@ PALETTE_INIT_MEMBER(a7800_state,a7800p) void a7800_state::machine_start() { - m_bios = machine().root_device().memregion("maincpu")->base() + 0xc000; save_item(NAME(m_p1_one_button)); save_item(NAME(m_p2_one_button)); save_item(NAME(m_bios_enabled)); @@ -1314,6 +1306,11 @@ void a7800_state::machine_start() save_item(NAME(m_ctrl_reg)); save_item(NAME(m_maria_flag)); + // set up RAM mirrors + UINT8 *ram = reinterpret_cast<UINT8 *>(memshare("6116_2")->ptr()); + membank("zpmirror")->set_base(ram + 0x0040); + membank("spmirror")->set_base(ram + 0x0140); + // install additional handlers, if needed if (m_cart->exists()) { @@ -1420,16 +1417,16 @@ MACHINE_CONFIG_END ***************************************************************************/ ROM_START( a7800 ) - ROM_REGION(0x10000, "maincpu", ROMREGION_ERASEFF) + ROM_REGION(0x4000, "maincpu", ROMREGION_ERASEFF) ROM_SYSTEM_BIOS( 0, "a7800", "Atari 7800" ) - ROMX_LOAD("7800.u7", 0xf000, 0x1000, CRC(5d13730c) SHA1(d9d134bb6b36907c615a594cc7688f7bfcef5b43), ROM_BIOS(1)) + ROMX_LOAD("7800.u7", 0x3000, 0x1000, CRC(5d13730c) SHA1(d9d134bb6b36907c615a594cc7688f7bfcef5b43), ROM_BIOS(1)) ROM_SYSTEM_BIOS( 1, "a7800pr", "Atari 7800 (prototype with Asteroids)" ) - ROMX_LOAD("c300558-001a.u7", 0xc000, 0x4000, CRC(a0e10edf) SHA1(14584b1eafe9721804782d4b1ac3a4a7313e455f), ROM_BIOS(2)) + ROMX_LOAD("c300558-001a.u7", 0x0000, 0x4000, CRC(a0e10edf) SHA1(14584b1eafe9721804782d4b1ac3a4a7313e455f), ROM_BIOS(2)) ROM_END ROM_START( a7800p ) - ROM_REGION(0x10000, "maincpu", ROMREGION_ERASEFF) - ROM_LOAD("7800pal.rom", 0xc000, 0x4000, CRC(d5b61170) SHA1(5a140136a16d1d83e4ff32a19409ca376a8df874)) + ROM_REGION(0x4000, "maincpu", ROMREGION_ERASEFF) + ROM_LOAD("7800pal.rom", 0x0000, 0x4000, CRC(d5b61170) SHA1(5a140136a16d1d83e4ff32a19409ca376a8df874)) ROM_END diff --git a/src/mess/drivers/elecbowl.c b/src/mess/drivers/elecbowl.c index 0ae06e2b3a8..c4be40e64e2 100644 --- a/src/mess/drivers/elecbowl.c +++ b/src/mess/drivers/elecbowl.c @@ -15,60 +15,32 @@ ***************************************************************************/ -#include "emu.h" -#include "cpu/tms0980/tms0980.h" -#include "sound/speaker.h" - -// internal artwork +#include "includes/hh_tms1k.h" #include "elecbowl.lh" -class elecbowl_state : public driver_device +class elecbowl_state : public hh_tms1k_state { public: elecbowl_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_inp_matrix(*this, "IN"), - m_speaker(*this, "speaker") + : hh_tms1k_state(mconfig, type, tag) { } - // devices - required_device<cpu_device> m_maincpu; - required_ioport_array<4> m_inp_matrix; - required_device<speaker_sound_device> m_speaker; - - UINT16 m_r; - UINT16 m_o; - UINT16 m_inp_mux; - - DECLARE_READ8_MEMBER(read_k); DECLARE_WRITE16_MEMBER(write_r); DECLARE_WRITE16_MEMBER(write_o); + DECLARE_READ8_MEMBER(read_k); +protected: virtual void machine_start(); }; - /*************************************************************************** I/O ***************************************************************************/ -READ8_MEMBER(elecbowl_state::read_k) -{ - UINT8 k = 0; - - // read selected input rows - for (int i = 0; i < 4; i++) - if (m_inp_mux >> i & 1) - k |= m_inp_matrix[i]->read(); - - return k; -} - WRITE16_MEMBER(elecbowl_state::write_r) { // R4-R7: input mux @@ -86,6 +58,11 @@ WRITE16_MEMBER(elecbowl_state::write_o) // ? } +READ8_MEMBER(elecbowl_state::read_k) +{ + return read_inputs(4); +} + /*************************************************************************** @@ -130,15 +107,7 @@ INPUT_PORTS_END void elecbowl_state::machine_start() { - // zerofill - m_o = 0; - m_r = 0; - m_inp_mux = 0; - - // register for savestates - save_item(NAME(m_o)); - save_item(NAME(m_r)); - save_item(NAME(m_inp_mux)); + hh_tms1k_state::machine_start(); } diff --git a/src/mess/drivers/hh_hmcs40.c b/src/mess/drivers/hh_hmcs40.c index 852da84948c..45bd3f76bc7 100644 --- a/src/mess/drivers/hh_hmcs40.c +++ b/src/mess/drivers/hh_hmcs40.c @@ -107,7 +107,7 @@ void hh_hmcs40_state::machine_start() { // zerofill memset(m_display_state, 0, sizeof(m_display_state)); - memset(m_display_cache, 0, sizeof(m_display_cache)); + memset(m_display_cache, ~0, sizeof(m_display_cache)); memset(m_display_decay, 0, sizeof(m_display_decay)); memset(m_display_segmask, 0, sizeof(m_display_segmask)); @@ -170,7 +170,15 @@ void hh_hmcs40_state::display_update() const int mul = (m_display_maxx <= 10) ? 10 : 100; for (int x = 0; x < m_display_maxx; x++) - output_set_lamp_value(y * mul + x, active_state[y] >> x & 1); + { + int state = active_state[y] >> x & 1; + output_set_lamp_value(y * mul + x, state); + + // bit coords for svg2lay + char buf[10]; + sprintf(buf, "%d.%d", y, x); + output_set_value(buf, state); + } } memcpy(m_display_cache, active_state, sizeof(m_display_cache)); @@ -610,20 +618,20 @@ READ8_MEMBER(hh_hmcs40_state::egalaxn2_input_r) static INPUT_PORTS_START( egalaxn2 ) PORT_START("IN.0") // D1 port R0x - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_16WAY // separate directional buttons, hence 16way + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_16WAY // separate directional buttons, hence 16way PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_16WAY // " + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_16WAY // " PORT_START("IN.1") // D2 port R0x - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_16WAY // separate directional buttons, hence 16way - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_16WAY // " - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_16WAY // " - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_16WAY // " + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_COCKTAIL PORT_16WAY // separate directional buttons, hence 16way + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL PORT_16WAY // " + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_COCKTAIL PORT_16WAY // " + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL PORT_16WAY // " PORT_START("IN.2") // D3 port R0x - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) @@ -633,7 +641,7 @@ static INPUT_PORTS_START( egalaxn2 ) PORT_CONFSETTING( 0x02, "1" ) PORT_CONFSETTING( 0x00, "2" ) PORT_CONFNAME( 0x0c, 0x00, "Players" ) - PORT_CONFSETTING( 0x08, "0 (Demo)" ) + PORT_CONFSETTING( 0x08, "0 (Demo)" ) // for Demo mode: need to hold down Fire button at power-on PORT_CONFSETTING( 0x00, "1" ) PORT_CONFSETTING( 0x04, "2" ) INPUT_PORTS_END @@ -688,26 +696,26 @@ static INPUT_PORTS_START( epacman2 ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_16WAY // " PORT_START("IN.1") // D2 port R0x - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_16WAY // separate directional buttons, hence 16way - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_16WAY // " - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_16WAY // " - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_16WAY // " + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_COCKTAIL PORT_16WAY // separate directional buttons, hence 16way + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL PORT_16WAY // " + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_COCKTAIL PORT_16WAY // " + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL PORT_16WAY // " PORT_START("IN.2") // D3 port R0x - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_NAME("Skill Control") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Demo Light Test") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START ) PORT_NAME("P1 Skill Control") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_NAME("Demo Light Test") PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_START("IN.3") // D4 port R0x PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONFNAME( 0x02, 0x02, "Skill" ) - PORT_CONFSETTING( 0x02, "1" ) - PORT_CONFSETTING( 0x00, "2" ) - PORT_CONFNAME( 0x0c, 0x00, "Players" ) - PORT_CONFSETTING( 0x08, "0 (Demo)" ) PORT_CONFSETTING( 0x00, "1" ) - PORT_CONFSETTING( 0x04, "2" ) + PORT_CONFSETTING( 0x02, "2" ) + PORT_CONFNAME( 0x0c, 0x04, "Players" ) + PORT_CONFSETTING( 0x08, "0 (Demo)" ) + PORT_CONFSETTING( 0x04, "1" ) + PORT_CONFSETTING( 0x00, "2" ) INPUT_PORTS_END @@ -953,15 +961,16 @@ CONS( 1979, bambball, 0, 0, bambball, bambball, driver_device, 0, "Bambi CONS( 1981, packmon, 0, 0, packmon, packmon, driver_device, 0, "Bandai", "Packri Monster", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK | GAME_NOT_WORKING ) CONS( 1983, zackman, 0, 0, zackman, zackman, driver_device, 0, "Bandai", "Zackman", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK | GAME_NOT_WORKING ) -CONS( 1981, alnattck, 0, 0, alnattck, alnattck, driver_device, 0, "Coleco", "Alien Attack", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK | GAME_NOT_WORKING ) +CONS( 1981, alnattck, 0, 0, alnattck, alnattck, driver_device, 0, "Coleco", "Alien Attack", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) CONS( 1982, cdkong, 0, 0, cdkong, cdkong, driver_device, 0, "Coleco", "Donkey Kong (Coleco)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK | GAME_NOT_WORKING ) CONS( 1982, cgalaxn, 0, 0, cgalaxn, cgalaxn, driver_device, 0, "Coleco", "Galaxian (Coleco)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK | GAME_NOT_WORKING ) CONS( 1981, cpacman, 0, 0, cpacman, cpacman, driver_device, 0, "Coleco", "Pac-Man (Coleco, Rev. 29)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK | GAME_NOT_WORKING ) CONS( 1981, cpacmanr1, cpacman, 0, cpacman, cpacman, driver_device, 0, "Coleco", "Pac-Man (Coleco, Rev. 28)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK | GAME_NOT_WORKING ) CONS( 1983, cmspacmn, 0, 0, cmspacmn, cmspacmn, driver_device, 0, "Coleco", "Ms. Pac-Man (Coleco)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK | GAME_NOT_WORKING ) -CONS( 1981, egalaxn2, 0, 0, egalaxn2, egalaxn2, driver_device, 0, "Entex", "Galaxian 2 (Entex)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK | GAME_NOT_WORKING ) -CONS( 1981, epacman2, 0, 0, epacman2, epacman2, driver_device, 0, "Entex", "Pac Man 2 (Entex)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK | GAME_NOT_WORKING ) +CONS( 1981, egalaxn2, 0, 0, egalaxn2, egalaxn2, driver_device, 0, "Entex", "Galaxian 2 (Entex)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) +CONS( 1981, epacman2, 0, 0, epacman2, epacman2, driver_device, 0, "Entex", "Pac Man 2 (Entex)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) + CONS( 1983, pbqbert, 0, 0, pbqbert, pbqbert, driver_device, 0, "Parker Brothers", "Q*Bert (Parker Brothers)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK | GAME_NOT_WORKING ) CONS( 1982, kingman, 0, 0, kingman, kingman, driver_device, 0, "Tomy", "Kingman", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK | GAME_NOT_WORKING ) diff --git a/src/mess/drivers/hh_pic16.c b/src/mess/drivers/hh_pic16.c index bdabf44dd43..b8281a737e0 100644 --- a/src/mess/drivers/hh_pic16.c +++ b/src/mess/drivers/hh_pic16.c @@ -76,7 +76,7 @@ void hh_pic16_state::machine_start() { // zerofill memset(m_display_state, 0, sizeof(m_display_state)); - memset(m_display_cache, 0, sizeof(m_display_cache)); + memset(m_display_cache, ~0, sizeof(m_display_cache)); memset(m_display_decay, 0, sizeof(m_display_decay)); memset(m_display_segmask, 0, sizeof(m_display_segmask)); @@ -137,7 +137,15 @@ void hh_pic16_state::display_update() const int mul = (m_display_maxx <= 10) ? 10 : 100; for (int x = 0; x < m_display_maxx; x++) - output_set_lamp_value(y * mul + x, active_state[y] >> x & 1); + { + int state = active_state[y] >> x & 1; + output_set_lamp_value(y * mul + x, state); + + // bit coords for svg2lay + char buf[10]; + sprintf(buf, "%d.%d", y, x); + output_set_value(buf, state); + } } memcpy(m_display_cache, active_state, sizeof(m_display_cache)); diff --git a/src/mess/drivers/hh_tms1k.c b/src/mess/drivers/hh_tms1k.c index 219a0311129..c58cd7a1def 100644 --- a/src/mess/drivers/hh_tms1k.c +++ b/src/mess/drivers/hh_tms1k.c @@ -15,14 +15,17 @@ @MP0905B TMS0970 1977, Parker Brothers Codename Sector *MP0168 TMS1000? 1979, Conic Basketball @MP0914 TMS1000 1979, Entex Baseball 1 + @MP0923 TMS1000 1979, Entex Baseball 2 @MP1030 TMS1100 1980, APF Mathemagician + *MP1133 TMS1470 1979, Kosmos Astro @MP1204 TMS1100 1980, Entex Baseball 3 *MP1221 TMS1100 1980, Entex Raise The Devil + *MP1312 TMS1100 198?, Tandy/RadioShack Science Fair Microcomputer Trainer *MP2139 ? 1982, Gakken Galaxy Invader 1000 *MP2788 ? 1980, Bandai Flight Time @MP3226 TMS1000 1978, Milton Bradley Simon *MP3320A TMS1000 1979, Coleco Head to Head Basketball - MP3403 TMS1100 1978, Marx Electronic Bowling + MP3403 TMS1100 1978, Marx Electronic Bowling -> elecbowl.c @MP3404 TMS1100 1978, Parker Brothers Merlin @MP3405 TMS1100 1979, Coleco Amaze-A-Tron @MP3438A TMS1100 1979, Kenner Star Wars Electronic Battle Command @@ -32,25 +35,25 @@ MP3457 TMS1100 1979, MicroVision cartridge: Mindbuster MP3474 TMS1100 1979, MicroVision cartridge: Vegas Slots MP3475 TMS1100 1979, MicroVision cartridge: Bowling + @MP3476 TMS1100 1979, Milton Bradley Super Simon MP3479 TMS1100 1980, MicroVision cartridge: Baseball MP3481 TMS1100 1979, MicroVision cartridge: Connect Four MP3496 TMS1100 1980, MicroVision cartridge: Sea Duel + M34009 TMS1100 1981, MicroVision cartridge: Alien Raiders (note: MP3498, MP3499, M34000, ..) + M34017 TMS1100 1981, MicroVision cartridge: Cosmic Hunter + M34047 TMS1100 1982, MicroVision cartridge: Super Blockbuster @MP6100A TMS0980 1979, Ideal Electronic Detective @MP6101B TMS0980 1979, Parker Brothers Stop Thief *MP6361 ? 1983, Defender Strikes *MP7303 TMS1400? 19??, Tiger 7-in-1 Sports Stadium @MP7313 TMS1400 1980, Parker Brothers Bank Shot @MP7314 TMS1400 1980, Parker Brothers Split Second - *MP7332 TMS1400 1981, Milton Bradley Dark Tower + MP7332 TMS1400 1981, Milton Bradley Dark Tower -> mbdtower.c @MP7334 TMS1400 1981, Coleco Total Control 4 inconsistent: - M34009 TMS1100 1981, MicroVision cartridge: Alien Raiders - M34017 TMS1100 1981, MicroVision cartridge: Cosmic Hunter - M34047 TMS1100 1982, MicroVision cartridge: Super Blockbuster - - @CD7282SL TMS1100 1981, Tandy-12 (serial is similar to TI Speak & Spell series?) + @CD7282SL TMS1100 1981, Tandy/RadioShack Tandy-12 (serial is similar to TI Speak & Spell series?) (* denotes not yet emulated by MESS, @ denotes it's in this driver) @@ -67,21 +70,21 @@ ***************************************************************************/ -#include "emu.h" -#include "cpu/tms0980/tms0980.h" -#include "sound/speaker.h" +#include "includes/hh_tms1k.h" // internal artwork #include "amaztron.lh" #include "bankshot.lh" #include "cnsector.lh" #include "ebball.lh" +#include "ebball2.lh" #include "ebball3.lh" #include "elecdet.lh" #include "comp4.lh" #include "mathmagi.lh" #include "merlin.lh" // clickable #include "simon.lh" // clickable +#include "ssimon.lh" #include "splitsec.lh" #include "starwbc.lh" #include "stopthie.lh" @@ -89,131 +92,13 @@ #include "tc4.lh" -class hh_tms1k_state : public driver_device -{ -public: - hh_tms1k_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_inp_matrix(*this, "IN"), - m_speaker(*this, "speaker"), - m_display_wait(33), - m_display_maxy(1), - m_display_maxx(0) - { } - - // devices - required_device<cpu_device> m_maincpu; - optional_ioport_array<7> m_inp_matrix; // max 7 - optional_device<speaker_sound_device> m_speaker; - - // misc common - UINT16 m_r; // MCU R-pins data - UINT16 m_o; // MCU O-pins data - UINT16 m_inp_mux; // multiplexed inputs mask - bool m_power_on; - - UINT8 read_inputs(int columns); - DECLARE_INPUT_CHANGED_MEMBER(power_button); - DECLARE_WRITE_LINE_MEMBER(auto_power_off); - - virtual void machine_start(); - virtual void machine_reset(); - - // display common - int m_display_wait; // led/lamp off-delay in microseconds (default 33ms) - int m_display_maxy; // display matrix number of rows - int m_display_maxx; // display matrix number of columns - - UINT32 m_display_state[0x20]; // display matrix rows data - UINT16 m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments - UINT32 m_display_cache[0x20]; // (internal use) - UINT8 m_display_decay[0x20][0x20]; // (internal use) - - TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick); - void display_update(); - void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety); - - // game-specific handlers - void mathmagi_display(); - DECLARE_WRITE16_MEMBER(mathmagi_write_r); - DECLARE_WRITE16_MEMBER(mathmagi_write_o); - DECLARE_READ8_MEMBER(mathmagi_read_k); - - void amaztron_display(); - DECLARE_WRITE16_MEMBER(amaztron_write_r); - DECLARE_WRITE16_MEMBER(amaztron_write_o); - DECLARE_READ8_MEMBER(amaztron_read_k); - - void tc4_display(); - DECLARE_WRITE16_MEMBER(tc4_write_r); - DECLARE_WRITE16_MEMBER(tc4_write_o); - DECLARE_READ8_MEMBER(tc4_read_k); - - void ebball_display(); - DECLARE_WRITE16_MEMBER(ebball_write_r); - DECLARE_WRITE16_MEMBER(ebball_write_o); - DECLARE_READ8_MEMBER(ebball_read_k); - - void ebball3_display(); - DECLARE_WRITE16_MEMBER(ebball3_write_r); - DECLARE_WRITE16_MEMBER(ebball3_write_o); - DECLARE_READ8_MEMBER(ebball3_read_k); - void ebball3_set_clock(); - DECLARE_INPUT_CHANGED_MEMBER(ebball3_difficulty_switch); - DECLARE_MACHINE_RESET(ebball3); - - DECLARE_WRITE16_MEMBER(elecdet_write_r); - DECLARE_WRITE16_MEMBER(elecdet_write_o); - DECLARE_READ8_MEMBER(elecdet_read_k); - - void starwbc_display(); - DECLARE_WRITE16_MEMBER(starwbc_write_r); - DECLARE_WRITE16_MEMBER(starwbc_write_o); - DECLARE_READ8_MEMBER(starwbc_read_k); - - DECLARE_WRITE16_MEMBER(comp4_write_r); - DECLARE_WRITE16_MEMBER(comp4_write_o); - DECLARE_READ8_MEMBER(comp4_read_k); - - DECLARE_WRITE16_MEMBER(simon_write_r); - DECLARE_WRITE16_MEMBER(simon_write_o); - DECLARE_READ8_MEMBER(simon_read_k); - - DECLARE_WRITE16_MEMBER(cnsector_write_r); - DECLARE_WRITE16_MEMBER(cnsector_write_o); - DECLARE_READ8_MEMBER(cnsector_read_k); - - DECLARE_WRITE16_MEMBER(merlin_write_r); - DECLARE_WRITE16_MEMBER(merlin_write_o); - DECLARE_READ8_MEMBER(merlin_read_k); - - DECLARE_WRITE16_MEMBER(stopthief_write_r); - DECLARE_WRITE16_MEMBER(stopthief_write_o); - DECLARE_READ8_MEMBER(stopthief_read_k); - - DECLARE_WRITE16_MEMBER(bankshot_write_r); - DECLARE_WRITE16_MEMBER(bankshot_write_o); - DECLARE_READ8_MEMBER(bankshot_read_k); - - DECLARE_WRITE16_MEMBER(splitsec_write_r); - DECLARE_WRITE16_MEMBER(splitsec_write_o); - DECLARE_READ8_MEMBER(splitsec_read_k); - - void tandy12_display(); - DECLARE_WRITE16_MEMBER(tandy12_write_r); - DECLARE_WRITE16_MEMBER(tandy12_write_o); - DECLARE_READ8_MEMBER(tandy12_read_k); -}; - - // machine_start/reset void hh_tms1k_state::machine_start() { // zerofill memset(m_display_state, 0, sizeof(m_display_state)); - memset(m_display_cache, 0, sizeof(m_display_cache)); + memset(m_display_cache, ~0, sizeof(m_display_cache)); memset(m_display_decay, 0, sizeof(m_display_decay)); memset(m_display_segmask, 0, sizeof(m_display_segmask)); @@ -251,19 +136,6 @@ void hh_tms1k_state::machine_reset() ***************************************************************************/ -// LED segments -enum -{ - lA = 0x01, - lB = 0x02, - lC = 0x04, - lD = 0x08, - lE = 0x10, - lF = 0x20, - lG = 0x40, - lDP = 0x80 -}; - // The device may strobe the outputs very fast, it is unnoticeable to the user. // To prevent flickering here, we need to simulate a decay. @@ -296,7 +168,15 @@ void hh_tms1k_state::display_update() const int mul = (m_display_maxx <= 10) ? 10 : 100; for (int x = 0; x < m_display_maxx; x++) - output_set_lamp_value(y * mul + x, active_state[y] >> x & 1); + { + int state = active_state[y] >> x & 1; + output_set_lamp_value(y * mul + x, state); + + // bit coords for svg2lay + char buf[10]; + sprintf(buf, "%d.%d", y, x); + output_set_value(buf, state); + } } memcpy(m_display_cache, active_state, sizeof(m_display_cache)); @@ -850,7 +730,7 @@ void hh_tms1k_state::ebball_display() // R8 is a 7seg m_display_segmask[8] = 0x7f; - display_matrix(7, 9, ~m_o, m_r); + display_matrix(7, 9, m_o, m_r); } WRITE16_MEMBER(hh_tms1k_state::ebball_write_r) @@ -870,7 +750,7 @@ WRITE16_MEMBER(hh_tms1k_state::ebball_write_o) { // O0-O6: led row // O7: N/C - m_o = data; + m_o = ~data; ebball_display(); } @@ -935,17 +815,125 @@ MACHINE_CONFIG_END +/*************************************************************************** + + Entex Electronic Baseball 2 + * boards are labeled: ZENY + * TMS1000 MCU, MP0923 (die labeled MP0923) + + The Japanese version was published by Gakken, black casing instead of white. + + The sequel to Entex Baseball, this version keeps up with score and innings. + As its predecessor, the pitcher controls are on a separate joypad. + + + lamp translation table: led zz from game PCB = MESS lampyx: + + 00 = - 10 = lamp94 20 = lamp74 30 = lamp50 + 01 = lamp53 11 = lamp93 21 = lamp75 31 = lamp51 + 02 = lamp7 12 = lamp92 22 = lamp80 32 = lamp52 + 03 = lamp17 13 = lamp62 23 = lamp81 33 = lamp40 + 04 = lamp27 14 = lamp70 24 = lamp82 34 = lamp41 + 05 = lamp97 15 = lamp71 25 = lamp83 35 = lamp31 + 06 = lamp90 16 = lamp61 26 = lamp84 36 = lamp30 + 07 = lamp95 17 = lamp72 27 = lamp85 37 = lamp33 + 08 = lamp63 18 = lamp73 28 = lamp42 38 = lamp32 + 09 = lamp91 19 = lamp60 29 = lamp43 + +***************************************************************************/ + +void hh_tms1k_state::ebball2_display() +{ + // the first 3 are 7segs + for (int y = 0; y < 3; y++) + m_display_segmask[y] = 0x7f; + + display_matrix(8, 10, m_o, m_r); +} + +WRITE16_MEMBER(hh_tms1k_state::ebball2_write_r) +{ + // R3-R6: input mux + m_inp_mux = data >> 3 & 0xf; + + // R10: speaker out + m_speaker->level_w(data >> 10 & 1); + + // R0-R9: led columns + m_r = data ^ 0x7f; + ebball2_display(); +} + +WRITE16_MEMBER(hh_tms1k_state::ebball2_write_o) +{ + // O0-O7: led row/segment + m_o = ~data; + ebball2_display(); +} + +READ8_MEMBER(hh_tms1k_state::ebball2_read_k) +{ + return read_inputs(4); +} + + +static INPUT_PORTS_START( ebball2 ) + PORT_START("IN.0") // R3 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_CONFNAME( 0x02, 0x02, "Pitcher" ) + PORT_CONFSETTING( 0x02, "Auto" ) + PORT_CONFSETTING( 0x00, "Manual" ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P2 Fast Ball") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P1 Batter") + + PORT_START("IN.1") // R4 + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P1 Steal") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("P2 Change Up") + PORT_BIT( 0x09, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("IN.2") // R5 + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_NAME("P2 Slider") + PORT_BIT( 0x0b, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("IN.3") // R6 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_PLAYER(2) PORT_NAME("P2 Knuckler") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_NAME("P2 Curve") + PORT_BIT( 0x0a, IP_ACTIVE_HIGH, IPT_UNUSED ) +INPUT_PORTS_END + + +static MACHINE_CONFIG_START( ebball2, hh_tms1k_state ) + + /* basic machine hardware */ + MCFG_CPU_ADD("maincpu", TMS1000, 350000) // RC osc. R=47K, C=47pf -> ~350kHz + MCFG_TMS1XXX_READ_K_CB(READ8(hh_tms1k_state, ebball2_read_k)) + MCFG_TMS1XXX_WRITE_R_CB(WRITE16(hh_tms1k_state, ebball2_write_r)) + MCFG_TMS1XXX_WRITE_O_CB(WRITE16(hh_tms1k_state, ebball2_write_o)) + + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1)) + MCFG_DEFAULT_LAYOUT(layout_ebball2) + + /* no video! */ + + /* sound hardware */ + MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) +MACHINE_CONFIG_END + + + + /*************************************************************************** Entex Electronic Baseball 3 - * boards are labeled: Zeny + * boards are labeled: ZENY * TMS1100NLL 6007 MP1204 (die labeled MP1204) * 2*SN75492N LED display driver This is another improvement over Entex Baseball, where gameplay is a bit more - varied, and it keeps up with score and innings. Like the others, the pitcher - controls are on a separate joypad. + varied. Like the others, the pitcher controls are on a separate joypad. lamp translation table: led zz from game PCB = MESS lampyx: @@ -1413,12 +1401,13 @@ MACHINE_CONFIG_END Milton Bradley Simon, created by Ralph Baer Revision A hardware: - * TMS1000 (die labeled MP3226), DS75494 lamp driver + * TMS1000 (die labeled MP3226) + * DS75494 lamp driver Newer revisions (also Pocket Simon) have a smaller 16-pin MB4850 chip instead of the TMS1000. This one has been decapped too, but we couldn't find an internal ROM. It is possibly a cost-reduced custom ASIC specifically - for Simon. The semi-sequel Super Simon uses a TMS1100. + for Simon. The semi-sequel Super Simon uses a TMS1100 (see next minidriver). ***************************************************************************/ @@ -1505,8 +1494,59 @@ MACHINE_CONFIG_END /*************************************************************************** + Milton Bradley Super Simon + * TMS1100 MP3476NLL (die labeled MP3476) + + x + +***************************************************************************/ + +WRITE16_MEMBER(hh_tms1k_state::ssimon_write_r) +{ +} + +WRITE16_MEMBER(hh_tms1k_state::ssimon_write_o) +{ + // N/C +} + +READ8_MEMBER(hh_tms1k_state::ssimon_read_k) +{ + return 0; +} + + +static INPUT_PORTS_START( ssimon ) +INPUT_PORTS_END + + +static MACHINE_CONFIG_START( ssimon, hh_tms1k_state ) + + /* basic machine hardware */ + MCFG_CPU_ADD("maincpu", TMS1000, 350000) // x + MCFG_TMS1XXX_READ_K_CB(READ8(hh_tms1k_state, ssimon_read_k)) + MCFG_TMS1XXX_WRITE_R_CB(WRITE16(hh_tms1k_state, ssimon_write_r)) + MCFG_TMS1XXX_WRITE_O_CB(WRITE16(hh_tms1k_state, ssimon_write_o)) + + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1)) + MCFG_DEFAULT_LAYOUT(layout_ssimon) + + /* no video! */ + + /* sound hardware */ + MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) +MACHINE_CONFIG_END + + + + + +/*************************************************************************** + Parker Brothers Code Name: Sector, by Bob Doyle - * MP0905BNL ZA0379 (die labeled 0970F-05B) + * TMS0970 MCU, MP0905BNL ZA0379 (die labeled 0970F-05B) This is a tabletop submarine pursuit game. A grid board and small toy boats are used to remember your locations (a Paint app should be ok too). @@ -1998,7 +2038,7 @@ MACHINE_CONFIG_END /*************************************************************************** Tandy Radio Shack Computerized Arcade (1981, 1982, 1995) - * TMS1100 CD7282SL + * TMS1100 MCU, labeled CD7282SL This handheld contains 12 minigames. It looks and plays like "Fabulous Fred" by the Japanese company Mego Corp. in 1980, which in turn is a mix of Merlin @@ -2187,6 +2227,17 @@ ROM_START( ebball ) ROM_END +ROM_START( ebball2 ) + ROM_REGION( 0x0400, "maincpu", 0 ) + ROM_LOAD( "mp0923", 0x0000, 0x0400, CRC(077acfe2) SHA1(a294ce7614b2cdb01c754a7a50d60d807e3f0939) ) + + ROM_REGION( 867, "maincpu:mpla", 0 ) + ROM_LOAD( "tms1000_ebball2_mpla.pla", 0, 867, CRC(d33da3cf) SHA1(13c4ebbca227818db75e6db0d45b66ba5e207776) ) + ROM_REGION( 365, "maincpu:opla", 0 ) + ROM_LOAD( "tms1000_ebball2_opla.pla", 0, 365, CRC(adcd73d1) SHA1(d69e590d288ef99293d86716498f3971528e30de) ) +ROM_END + + ROM_START( ebball3 ) ROM_REGION( 0x0800, "maincpu", 0 ) ROM_LOAD( "mp1204", 0x0000, 0x0800, CRC(987a29ba) SHA1(9481ae244152187d85349d1a08e439e798182938) ) @@ -2255,11 +2306,22 @@ ROM_START( simon ) ROM_REGION( 867, "maincpu:mpla", 0 ) ROM_LOAD( "tms1000_simon_mpla.pla", 0, 867, CRC(52f7c1f1) SHA1(dbc2634dcb98eac173ad0209df487cad413d08a5) ) - ROM_REGION( 365, "maincpu:opla", 0 ) + ROM_REGION( 365, "maincpu:opla", 0 ) // unused ROM_LOAD( "tms1000_simon_opla.pla", 0, 365, CRC(2943c71b) SHA1(bd5bb55c57e7ba27e49c645937ec1d4e67506601) ) ROM_END +ROM_START( ssimon ) + ROM_REGION( 0x800, "maincpu", 0 ) + ROM_LOAD( "mp3476", 0x0000, 0x800, CRC(98200571) SHA1(cbd0bcfc11a534aa0be5d011584cdcac58ff437a) ) + + ROM_REGION( 867, "maincpu:mpla", 0 ) + ROM_LOAD( "tms1100_default_mpla.pla", 0, 867, CRC(62445fc9) SHA1(d6297f2a4bc7a870b76cc498d19dbb0ce7d69fec) ) + ROM_REGION( 365, "maincpu:opla", 0 ) // unused + ROM_LOAD( "tms1100_ssimon_opla.pla", 0, 365, CRC(0fea09b0) SHA1(27a56fcf2b490e9a7dbbc6ad48cc8aaca4cada94) ) +ROM_END + + ROM_START( cnsector ) ROM_REGION( 0x0400, "maincpu", 0 ) ROM_LOAD( "mp0905bnl_za0379", 0x0000, 0x0400, CRC(201036e9) SHA1(b37fef86bb2bceaf0ac8bb3745b4702d17366914) ) @@ -2356,21 +2418,26 @@ CONS( 1979, amaztron, 0, 0, amaztron, amaztron, driver_device, 0, "Col CONS( 1981, tc4, 0, 0, tc4, tc4, driver_device, 0, "Coleco", "Total Control 4", GAME_SUPPORTS_SAVE ) CONS( 1979, ebball, 0, 0, ebball, ebball, driver_device, 0, "Entex", "Electronic Baseball (Entex)", GAME_SUPPORTS_SAVE ) +CONS( 1979, ebball2, 0, 0, ebball2, ebball2, driver_device, 0, "Entex", "Electronic Baseball 2 (Entex)", GAME_SUPPORTS_SAVE ) CONS( 1980, ebball3, 0, 0, ebball3, ebball3, driver_device, 0, "Entex", "Electronic Baseball 3 (Entex)", GAME_SUPPORTS_SAVE ) -CONS( 1979, elecdet, 0, 0, elecdet, elecdet, driver_device, 0, "Ideal", "Electronic Detective", GAME_SUPPORTS_SAVE ) // unplayable without game cards +CONS( 1979, elecdet, 0, 0, elecdet, elecdet, driver_device, 0, "Ideal", "Electronic Detective", GAME_SUPPORTS_SAVE ) // *** CONS( 1979, starwbc, 0, 0, starwbc, starwbc, driver_device, 0, "Kenner", "Star Wars - Electronic Battle Command", GAME_SUPPORTS_SAVE ) CONS( 1979, starwbcp, starwbc, 0, starwbc, starwbc, driver_device, 0, "Kenner", "Star Wars - Electronic Battle Command (prototype)", GAME_SUPPORTS_SAVE ) CONS( 1977, comp4, 0, 0, comp4, comp4, driver_device, 0, "Milton Bradley", "Comp IV", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW ) CONS( 1978, simon, 0, 0, simon, simon, driver_device, 0, "Milton Bradley", "Simon (Rev. A)", GAME_SUPPORTS_SAVE ) +CONS( 1979, ssimon, 0, 0, ssimon, ssimon, driver_device, 0, "Milton Bradley", "Super Simon", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING ) -CONS( 1977, cnsector, 0, 0, cnsector, cnsector, driver_device, 0, "Parker Brothers", "Code Name: Sector", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW ) // unplayable without writing board +CONS( 1977, cnsector, 0, 0, cnsector, cnsector, driver_device, 0, "Parker Brothers", "Code Name: Sector", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW ) // *** CONS( 1978, merlin, 0, 0, merlin, merlin, driver_device, 0, "Parker Brothers", "Merlin - The Electronic Wizard", GAME_SUPPORTS_SAVE ) -CONS( 1979, stopthie, 0, 0, stopthief, stopthief, driver_device, 0, "Parker Brothers", "Stop Thief (Electronic Crime Scanner)", GAME_SUPPORTS_SAVE ) // unplayable without game board +CONS( 1979, stopthie, 0, 0, stopthief, stopthief, driver_device, 0, "Parker Brothers", "Stop Thief (Electronic Crime Scanner)", GAME_SUPPORTS_SAVE ) // *** CONS( 1979, stopthiep, stopthie, 0, stopthief, stopthief, driver_device, 0, "Parker Brothers", "Stop Thief (Electronic Crime Scanner) (prototype)", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING ) CONS( 1980, bankshot, 0, 0, bankshot, bankshot, driver_device, 0, "Parker Brothers", "Bank Shot - Electronic Pool", GAME_SUPPORTS_SAVE ) CONS( 1980, splitsec, 0, 0, splitsec, splitsec, driver_device, 0, "Parker Brothers", "Split Second", GAME_SUPPORTS_SAVE ) -CONS( 1981, tandy12, 0, 0, tandy12, tandy12, driver_device, 0, "Tandy Radio Shack", "Tandy-12: Computerized Arcade", GAME_SUPPORTS_SAVE ) // partially unplayable without cards/dice/.. +CONS( 1981, tandy12, 0, 0, tandy12, tandy12, driver_device, 0, "Tandy Radio Shack", "Tandy-12: Computerized Arcade", GAME_SUPPORTS_SAVE ) // some of the minigames: *** + +// ***: As far as MESS is concerned, the game is emulated fine. But for it to be playable, it requires interaction +// with other, unemulatable, things eg. game board/pieces, playing cards, pen & paper, etc. diff --git a/src/mess/drivers/hh_ucom4.c b/src/mess/drivers/hh_ucom4.c index c52ffb8ed88..b258c942942 100644 --- a/src/mess/drivers/hh_ucom4.c +++ b/src/mess/drivers/hh_ucom4.c @@ -17,10 +17,11 @@ *102 uPD553C 1981, Bandai Block Out *127 uPD650C 198? Sony OA-S1100 Typecorder (subcpu, have dump) *128 uPD650C 1982, Roland TR-606 - 133 uPD650C 1982, Roland TB-303 + 133 uPD650C 1982, Roland TB-303 -> tb303.c @160 uPD553C 1982, Tomy Pac Man (TN-08) @202 uPD553C 1982, Epoch Astro Command @206 uPD553C 1982, Epoch Dracula + *209 uPD553C 1982, Tomy Caveman (TN-12) @258 uPD553C 1984, Tomy Alien Chase (TN-16) (* denotes not yet emulated by MESS, @ denotes it's in this driver) @@ -116,7 +117,7 @@ void hh_ucom4_state::machine_start() { // zerofill memset(m_display_state, 0, sizeof(m_display_state)); - memset(m_display_cache, 0, sizeof(m_display_cache)); + memset(m_display_cache, ~0, sizeof(m_display_cache)); memset(m_display_decay, 0, sizeof(m_display_decay)); memset(m_display_segmask, 0, sizeof(m_display_segmask)); @@ -181,7 +182,15 @@ void hh_ucom4_state::display_update() const int mul = (m_display_maxx <= 10) ? 10 : 100; for (int x = 0; x < m_display_maxx; x++) - output_set_lamp_value(y * mul + x, active_state[y] >> x & 1); + { + int state = active_state[y] >> x & 1; + output_set_lamp_value(y * mul + x, state); + + // bit coords for svg2lay + char buf[10]; + sprintf(buf, "%d.%d", y, x); + output_set_value(buf, state); + } } memcpy(m_display_cache, active_state, sizeof(m_display_cache)); @@ -350,7 +359,7 @@ MACHINE_CONFIG_END Bambino Space Laser Fight (manufactured in Japan) * PCB label Emix Corp. ET-12 * NEC uCOM-43 MCU, labeled D553C 055 - * blue VFD display Emix-104 (some versions had a green display) + * cyan VFD display Emix-104, with color overlay (blue or green overlay, depending on region) NOTE!: MESS external artwork is recommended diff --git a/src/mess/drivers/m24.c b/src/mess/drivers/m24.c index ff388e6a1b2..b29edcf54ae 100644 --- a/src/mess/drivers/m24.c +++ b/src/mess/drivers/m24.c @@ -4,7 +4,7 @@ #include "cpu/tms7000/tms7000.h" #include "bus/isa/isa.h" #include "bus/isa/isa_cards.h" -#include "machine/pckeybrd.h" +#include "machine/m24_kbd.h" #include "machine/mm58274c.h" #include "includes/genpc.h" @@ -15,11 +15,13 @@ public: driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_mb(*this, "mb"), - m_kbc(*this, "kbc") + m_kbc(*this, "kbc"), + m_keyboard(*this, "keyboard") { } required_device<cpu_device> m_maincpu; required_device<pc_noppi_mb_device> m_mb; required_device<cpu_device> m_kbc; + required_device<m24_keyboard_device> m_keyboard; DECLARE_READ8_MEMBER(keyboard_r); DECLARE_WRITE8_MEMBER(keyboard_w); @@ -27,19 +29,30 @@ public: DECLARE_WRITE8_MEMBER(pb_w); DECLARE_READ8_MEMBER(kbcdata_r); DECLARE_WRITE8_MEMBER(kbcdata_w); + DECLARE_WRITE_LINE_MEMBER(kbcin_w); - UINT8 m_sysctl, m_pa, m_kbcdata; - bool m_kbcibf; + void machine_reset(); + + UINT8 m_sysctl, m_pa, m_kbcin, m_kbcout; + bool m_kbcibf, m_kbdata; }; +void m24_state::machine_reset() +{ + m_sysctl = 0; + m_pa = 0x40; + m_kbcibf = false; + m_kbdata = true; +} + READ8_MEMBER(m24_state::keyboard_r) { switch(offset) { case 0: - m_pa &= ~0x40; + m_pa |= 0x40; m_mb->m_pic8259->ir1_w(0); - return m_kbcdata; + return m_kbcout; case 1: return m_sysctl; case 2: @@ -57,41 +70,49 @@ WRITE8_MEMBER(m24_state::keyboard_w) case 0: m_kbc->set_input_line(TMS7000_INT1_LINE, ASSERT_LINE); m_kbcibf = true; - m_kbcdata = data; + m_kbcin = data; break; case 1: m_sysctl = data; m_mb->m_pit8253->write_gate2(BIT(data, 0)); m_mb->pc_speaker_set_spkrdata(BIT(data, 1)); if(BIT(data, 6)) - m_pa |= 2; + m_pa |= 4; else - m_pa &= ~2; + m_pa &= ~4; break; } } READ8_MEMBER(m24_state::pa_r) { - return m_pa; + return m_pa & (m_kbdata ? 0xff : 0xfd); } WRITE8_MEMBER(m24_state::pb_w) { + m_keyboard->clock_w(!BIT(data, 0)); + m_keyboard->data_w(!BIT(data, 1)); + m_pa = (m_pa & ~3) | (~data & 3); } READ8_MEMBER(m24_state::kbcdata_r) { m_kbc->set_input_line(TMS7000_INT1_LINE, CLEAR_LINE); m_kbcibf = false; - return m_kbcdata; + return m_kbcin; } WRITE8_MEMBER(m24_state::kbcdata_w) { - m_pa |= 0x40; + m_pa &= ~0x40; m_mb->m_pic8259->ir1_w(1); - m_kbcdata = data; + m_kbcout = data; +} + +WRITE_LINE_MEMBER(m24_state::kbcin_w) +{ + m_kbdata = state; } static ADDRESS_MAP_START( m24_map, AS_PROGRAM, 16, m24_state ) @@ -159,8 +180,6 @@ static INPUT_PORTS_START( m24 ) PORT_DIPSETTING( 0x4000, "2" ) PORT_DIPSETTING( 0x8000, "3" ) PORT_DIPSETTING( 0xc000, "4" ) - - PORT_INCLUDE(pc_keyboard) INPUT_PORTS_END static MACHINE_CONFIG_START( olivetti, m24_state ) @@ -185,6 +204,9 @@ static MACHINE_CONFIG_START( olivetti, m24_state ) MCFG_CPU_PROGRAM_MAP(kbc_map) MCFG_CPU_IO_MAP(kbc_io) + MCFG_DEVICE_ADD("keyboard", M24_KEYBOARD, 0) + MCFG_M24_KEYBOARD_OUT_DATA_HANDLER(WRITELINE(m24_state, kbcin_w)) + MCFG_DEVICE_ADD("mm58174an", MM58274C, 0) MCFG_MM58274C_MODE24(1) // ? MCFG_MM58274C_DAY1(1) // ? @@ -199,7 +221,7 @@ ROM_START( m24 ) ROMX_LOAD("olivetti_m24_version_1.43_low.bin", 0x4000, 0x2000, CRC(ff7e0f10) SHA1(13423011a9bae3f3193e8c199f98a496cab48c0f), ROM_SKIP(1)) ROM_REGION(0x800, "kbc", 0) - ROM_LOAD("PDBD.tms2516.KeyboardMCUReplacementDaughterboard_10U", 0x000, 0x800, CRC(b8c4c18a) SHA1(25b4c24e19ff91924c53557c66513ab242d926c6)) + ROM_LOAD("pdbd.tms2516.keyboardmcureplacementdaughterboard_10u", 0x000, 0x800, CRC(b8c4c18a) SHA1(25b4c24e19ff91924c53557c66513ab242d926c6)) ROM_END ROM_START( m240 ) @@ -209,7 +231,7 @@ ROM_START( m240 ) // is this one the same? ROM_REGION(0x800, "kbc", 0) - ROM_LOAD("PDBD.tms2516.KeyboardMCUReplacementDaughterboard_10U", 0x000, 0x800, BAD_DUMP CRC(b8c4c18a) SHA1(25b4c24e19ff91924c53557c66513ab242d926c6)) + ROM_LOAD("pdbd.tms2516.keyboardmcureplacementdaughterboard_10u", 0x000, 0x800, BAD_DUMP CRC(b8c4c18a) SHA1(25b4c24e19ff91924c53557c66513ab242d926c6)) ROM_END COMP( 1983, m24, ibm5150, 0, olivetti, m24, driver_device, 0, "Olivetti", "M24", GAME_NOT_WORKING) diff --git a/src/mess/drivers/mbdtower.c b/src/mess/drivers/mbdtower.c new file mode 100644 index 00000000000..c7c35a4ab75 --- /dev/null +++ b/src/mess/drivers/mbdtower.c @@ -0,0 +1,190 @@ +// license:BSD-3-Clause +// copyright-holders:hap, Sean Riddle +/*************************************************************************** + + Milton Bradley Dark Tower + * TMS1400NLL MP7332-N1.U1(Rev. B) or MP7332-N2LL(Rev. C), die labeled MP7332 + * SN75494N MOS-to-LED digit driver + + x + +***************************************************************************/ + +#include "includes/hh_tms1k.h" +#include "mbdtower.lh" + + +class mbdtower_state : public hh_tms1k_state +{ +public: + mbdtower_state(const machine_config &mconfig, device_type type, const char *tag) + : hh_tms1k_state(mconfig, type, tag) + { } + + void mbdtower_display(); + DECLARE_WRITE16_MEMBER(write_r); + DECLARE_WRITE16_MEMBER(write_o); + DECLARE_READ8_MEMBER(read_k); + + bool m_motor_on; + bool m_sensor; + +protected: + virtual void machine_start(); +}; + + +/*************************************************************************** + + I/O + +***************************************************************************/ + +void mbdtower_state::mbdtower_display() +{ +} + +WRITE16_MEMBER(mbdtower_state::write_r) +{ + // R0-R2: input mux + m_inp_mux = data & 7; + + // R3: N/C + // R4: 75494 enable (speaker, lamps, digit select go through that IC) + // R5-R7: tower lamps + // R8: rotation sensor led + // R9: motor on + + // R10: speaker out + m_speaker->level_w(data >> 10 & 1); +} + +WRITE16_MEMBER(mbdtower_state::write_o) +{ + // O0-O6: led segments A-G + // O7: digit select + m_o = data; +} + + +READ8_MEMBER(mbdtower_state::read_k) +{ + // rotation sensor is on K8 + + return read_inputs(3); +} + + +/* tower motor simulation: + +*/ + + + +/*************************************************************************** + + Inputs + +***************************************************************************/ + +/* physical button layout and labels is like this: + + (green) (l.blue) (red) + [YES/ [REPEAT] [NO/ + BUY] END] + + (yellow) (blue) (white) + [HAGGLE] [BAZAAR] [CLEAR] + + (blue) (blue) (blue) + [TOMB/ [MOVE] [SANCTUARY/ + RUIN] CITADEL] + + (orange) (blue) (d.yellow) + [DARK [FRONTIER] [INVENTORY] + TOWER] +*/ + +static INPUT_PORTS_START( mbdtower ) + PORT_START("IN.0") // R0 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_C) PORT_NAME("Inventory") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_3) PORT_NAME("No/End") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_E) PORT_NAME("Clear") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_D) PORT_NAME("Sanctuary/Citadel") + + PORT_START("IN.1") // R1 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_X) PORT_NAME("Frontier") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_2) PORT_NAME("Repeat") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_W) PORT_NAME("Bazaar") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_S) PORT_NAME("Move") + + PORT_START("IN.2") // R2 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_Z) PORT_NAME("Dark Tower") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_NAME("Yes/Buy") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_Q) PORT_NAME("Haggle") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_A) PORT_NAME("Tomb/Ruin") +INPUT_PORTS_END + + + +/*************************************************************************** + + Machine Config + +***************************************************************************/ + +void mbdtower_state::machine_start() +{ + hh_tms1k_state::machine_start(); + + // zerofill/register for savestates + m_motor_on = false; + m_sensor = false; + + save_item(NAME(m_motor_on)); + save_item(NAME(m_sensor)); +} + + + +static MACHINE_CONFIG_START( mbdtower, mbdtower_state ) + + /* basic machine hardware */ + MCFG_CPU_ADD("maincpu", TMS1400, 400000) // approximation - RC osc. R=43K, C=56pf, but unknown RC curve + MCFG_TMS1XXX_READ_K_CB(READ8(mbdtower_state, read_k)) + MCFG_TMS1XXX_WRITE_R_CB(WRITE16(mbdtower_state, write_r)) + MCFG_TMS1XXX_WRITE_O_CB(WRITE16(mbdtower_state, write_o)) + + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1)) + MCFG_DEFAULT_LAYOUT(layout_mbdtower) + + /* no video! */ + + /* sound hardware */ + MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) +MACHINE_CONFIG_END + + + + +/*************************************************************************** + + Game driver(s) + +***************************************************************************/ + +ROM_START( mbdtower ) + ROM_REGION( 0x1000, "maincpu", 0 ) + ROM_LOAD( "mp7332", 0x0000, 0x1000, CRC(ebeab91a) SHA1(7edbff437da371390fa8f28b3d183f833eaa9be9) ) + + ROM_REGION( 867, "maincpu:mpla", 0 ) + ROM_LOAD( "tms1100_default_mpla.pla", 0, 867, CRC(62445fc9) SHA1(d6297f2a4bc7a870b76cc498d19dbb0ce7d69fec) ) + ROM_REGION( 557, "maincpu:opla", 0 ) + ROM_LOAD( "tms1400_mbdtower_opla.pla", 0, 557, CRC(64c84697) SHA1(72ce6d24cedf9c606f1742cd5620f75907246e87) ) +ROM_END + + +CONS( 1981, mbdtower, 0, 0, mbdtower, mbdtower, driver_device, 0, "Milton Bradley", "Dark Tower (Milton Bradley)", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING ) + diff --git a/src/mess/drivers/sms.c b/src/mess/drivers/sms.c index 4187054462c..a6c95158206 100644 --- a/src/mess/drivers/sms.c +++ b/src/mess/drivers/sms.c @@ -825,7 +825,7 @@ ROM_START(sms1) ROM_REGION(0x20000, "user1", 0) ROM_SYSTEM_BIOS( 0, "bios13", "US/European BIOS v1.3 (1986)" ) - ROMX_LOAD("bios13fx.rom", 0x0000, 0x2000, CRC(0072ed54) SHA1(c315672807d8ddb8d91443729405c766dd95cae7), ROM_BIOS(1)) + ROMX_LOAD("mpr-10052.rom", 0x0000, 0x2000, CRC(0072ed54) SHA1(c315672807d8ddb8d91443729405c766dd95cae7), ROM_BIOS(1)) ROM_SYSTEM_BIOS( 1, "hangonsh", "US/European BIOS v2.4 with Hang On and Safari Hunt (1988)" ) ROMX_LOAD("mpr-11459a.rom", 0x0000, 0x20000, CRC(91e93385) SHA1(9e179392cd416af14024d8f31c981d9ee9a64517), ROM_BIOS(2)) ROM_SYSTEM_BIOS( 2, "hangon", "US/European BIOS v3.4 with Hang On (1988)" ) @@ -864,13 +864,15 @@ ROM_START(sms1pal) ROM_REGION(0x20000, "user1", 0) ROM_SYSTEM_BIOS( 0, "bios13", "US/European BIOS v1.3 (1986)" ) - ROMX_LOAD("bios13fx.rom", 0x0000, 0x2000, CRC(0072ed54) SHA1(c315672807d8ddb8d91443729405c766dd95cae7), ROM_BIOS(1)) - ROM_SYSTEM_BIOS( 1, "hangonsh", "US/European BIOS v2.4 with Hang On and Safari Hunt (1988)" ) - ROMX_LOAD("mpr-11459a.rom", 0x0000, 0x20000, CRC(91e93385) SHA1(9e179392cd416af14024d8f31c981d9ee9a64517), ROM_BIOS(2)) - ROM_SYSTEM_BIOS( 2, "hangon", "Sega Master System - US/European BIOS v3.4 with Hang On (1988)" ) - ROMX_LOAD("mpr-11458.rom", 0x0000, 0x20000, CRC(8edf7ac6) SHA1(51fd6d7990f62cd9d18c9ecfc62ed7936169107e), ROM_BIOS(3)) - ROM_SYSTEM_BIOS( 3, "missiled", "US/European BIOS v4.4 with Missile Defense 3D (1988)" ) - ROMX_LOAD("missiled.rom", 0x0000, 0x20000, CRC(e79bb689) SHA1(aa92ae576ca670b00855e278378d89e9f85e0351), ROM_BIOS(4)) + ROMX_LOAD("mpr-10052.rom", 0x0000, 0x2000, CRC(0072ed54) SHA1(c315672807d8ddb8d91443729405c766dd95cae7), ROM_BIOS(1)) + ROM_SYSTEM_BIOS( 1, "bios20", "European BIOS v2.0 (198?)" ) + ROMX_LOAD("mpr-10883.rom", 0x0000, 0x2000, CRC(b3d854f8) SHA1(fc7eb9141f38c92bf98d9134816f64b45e811112), ROM_BIOS(2)) + ROM_SYSTEM_BIOS( 2, "hangonsh", "US/European BIOS v2.4 with Hang On and Safari Hunt (1988)" ) + ROMX_LOAD("mpr-11459a.rom", 0x0000, 0x20000, CRC(91e93385) SHA1(9e179392cd416af14024d8f31c981d9ee9a64517), ROM_BIOS(3)) + ROM_SYSTEM_BIOS( 3, "hangon", "Sega Master System - US/European BIOS v3.4 with Hang On (1988)" ) + ROMX_LOAD("mpr-11458.rom", 0x0000, 0x20000, CRC(8edf7ac6) SHA1(51fd6d7990f62cd9d18c9ecfc62ed7936169107e), ROM_BIOS(4)) + ROM_SYSTEM_BIOS( 4, "missiled", "US/European BIOS v4.4 with Missile Defense 3D (1988)" ) + ROMX_LOAD("missiled.rom", 0x0000, 0x20000, CRC(e79bb689) SHA1(aa92ae576ca670b00855e278378d89e9f85e0351), ROM_BIOS(5)) ROM_END ROM_START(smspal) diff --git a/src/mess/drivers/snes.c b/src/mess/drivers/snes.c index 8697bb35d85..aff5e20e5f0 100644 --- a/src/mess/drivers/snes.c +++ b/src/mess/drivers/snes.c @@ -1005,9 +1005,9 @@ WRITE8_MEMBER( snes_console_state::pfest94_lo_w ) *************************************/ static ADDRESS_MAP_START( snes_map, AS_PROGRAM, 8, snes_console_state ) - AM_RANGE(0x000000, 0x7dffff) AM_READWRITE(snes20_lo_r, snes20_lo_w) +// AM_RANGE(0x000000, 0x7dffff) AM_READWRITE(snes20_lo_r, snes20_lo_w) AM_RANGE(0x7e0000, 0x7fffff) AM_RAM /* 8KB Low RAM, 24KB High RAM, 96KB Expanded RAM */ - AM_RANGE(0x800000, 0xffffff) AM_READWRITE(snes20_hi_r, snes20_hi_w) +// AM_RANGE(0x800000, 0xffffff) AM_READWRITE(snes20_hi_r, snes20_hi_w) ADDRESS_MAP_END static ADDRESS_MAP_START( spc_map, AS_PROGRAM, 8, snes_console_state ) @@ -1191,123 +1191,128 @@ void snes_console_state::machine_start() { snes_state::machine_start(); - m_type = m_cartslot->get_type(); - - switch (m_type) + if (m_cartslot && m_cartslot->exists()) { - // LoROM & LoROM + addons - case SNES_MODE20: - case SNES_BSXLO: - case SNES_SUFAMITURBO: - case SNES_CX4: // this still uses the old simulation instead of emulating the CPU - case SNES_ST010: // this requires two diff kinds of chip access, so we handle it in snes20_lo/hi_r/w - case SNES_ST011: // this requires two diff kinds of chip access, so we handle it in snes20_lo/hi_r/w - case SNES_ST018: // still unemulated - break; - case SNES_Z80GB: // skeleton support - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::snessgb_lo_r),this), write8_delegate(FUNC(snes_console_state::snessgb_lo_w),this)); - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::snessgb_hi_r),this), write8_delegate(FUNC(snes_console_state::snessgb_hi_w),this)); - m_maincpu->set_5a22_map(); - break; - case SNES_SA1: // skeleton support - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::snessa1_lo_r),this), write8_delegate(FUNC(snes_console_state::snessa1_lo_w),this)); - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::snessa1_hi_r),this), write8_delegate(FUNC(snes_console_state::snessa1_hi_w),this)); - m_maincpu->set_5a22_map(); - break; - case SNES_DSP: - m_maincpu->space(AS_PROGRAM).install_read_handler(0x208000, 0x20ffff, 0, 0x9f0000, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); - m_maincpu->space(AS_PROGRAM).install_write_handler(0x208000, 0x20ffff, 0, 0x9f0000, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); - break; - case SNES_DSP_2MB: - m_maincpu->space(AS_PROGRAM).install_read_handler(0x600000, 0x607fff, 0, 0x8f0000, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); - m_maincpu->space(AS_PROGRAM).install_write_handler(0x600000, 0x607fff, 0, 0x8f0000, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); - break; - case SNES_DSP4: - m_maincpu->space(AS_PROGRAM).install_read_handler(0x308000, 0x30ffff, 0, 0x8f0000, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); - m_maincpu->space(AS_PROGRAM).install_write_handler(0x308000, 0x30ffff, 0, 0x8f0000, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); - break; - case SNES_OBC1: - m_maincpu->space(AS_PROGRAM).install_read_handler(0x006000, 0x007fff, 0, 0xbf0000, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); - m_maincpu->space(AS_PROGRAM).install_write_handler(0x006000, 0x007fff, 0, 0xbf0000, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); - break; - case SNES_SFX: - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::snessfx_lo_r),this), write8_delegate(FUNC(snes_console_state::snessfx_lo_w),this)); - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::snessfx_hi_r),this), write8_delegate(FUNC(snes_console_state::snessfx_hi_w),this)); - m_maincpu->set_5a22_map(); - break; - case SNES_SDD1: - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::snessdd1_lo_r),this), write8_delegate(FUNC(snes_console_state::snessdd1_lo_w),this)); - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::snessdd1_hi_r),this), write8_delegate(FUNC(snes_console_state::snessdd1_hi_w),this)); - m_maincpu->set_5a22_map(); - break; - case SNES_BSX: - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::snesbsx_lo_r),this), write8_delegate(FUNC(snes_console_state::snesbsx_lo_w),this)); - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::snesbsx_hi_r),this), write8_delegate(FUNC(snes_console_state::snesbsx_hi_w),this)); - m_maincpu->set_5a22_map(); - break; - // HiROM & HiROM + addons - case SNES_MODE21: - case SNES_BSXHI: - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::snes21_lo_r),this), write8_delegate(FUNC(snes_console_state::snes21_lo_w),this)); - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::snes21_hi_r),this), write8_delegate(FUNC(snes_console_state::snes21_hi_w),this)); - m_maincpu->set_5a22_map(); - break; - case SNES_DSP_MODE21: - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::snes21_lo_r),this), write8_delegate(FUNC(snes_console_state::snes21_lo_w),this)); - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::snes21_hi_r),this), write8_delegate(FUNC(snes_console_state::snes21_hi_w),this)); - m_maincpu->space(AS_PROGRAM).install_read_handler(0x006000, 0x007fff, 0, 0x9f0000, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); - m_maincpu->space(AS_PROGRAM).install_write_handler(0x006000, 0x007fff, 0, 0x9f0000, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); - m_maincpu->set_5a22_map(); - break; - case SNES_SRTC: - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::snes21_lo_r),this), write8_delegate(FUNC(snes_console_state::snes21_lo_w),this)); - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::snes21_hi_r),this), write8_delegate(FUNC(snes_console_state::snes21_hi_w),this)); - m_maincpu->space(AS_PROGRAM).install_read_handler(0x002800, 0x002800, 0, 0xbf0000, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); - m_maincpu->space(AS_PROGRAM).install_write_handler(0x002801, 0x002801, 0, 0xbf0000, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); - m_maincpu->set_5a22_map(); - break; - case SNES_SPC7110: - case SNES_SPC7110_RTC: - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::snes7110_lo_r),this), write8_delegate(FUNC(snes_console_state::snes7110_lo_w),this)); - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::snes7110_hi_r),this), write8_delegate(FUNC(snes_console_state::snes7110_hi_w),this)); - m_maincpu->set_5a22_map(); - break; - case SNES_PFEST94: - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::pfest94_lo_r),this), write8_delegate(FUNC(snes_console_state::pfest94_lo_w),this)); - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::pfest94_hi_r),this), write8_delegate(FUNC(snes_console_state::pfest94_hi_w),this)); - m_maincpu->set_5a22_map(); - break; - // pirate 'mappers' - case SNES_POKEMON: - m_maincpu->space(AS_PROGRAM).install_read_handler(0x800000, 0x80ffff, 0, 0x780000, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); - m_maincpu->space(AS_PROGRAM).install_write_handler(0x800000, 0x80ffff, 0, 0x780000, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); - break; - case SNES_TEKKEN2: - m_maincpu->space(AS_PROGRAM).install_read_handler(0x808000, 0x8087ff, 0, 0x3f0000, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); - m_maincpu->space(AS_PROGRAM).install_write_handler(0x808000, 0x8087ff, 0, 0x3f0000, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); - break; - case SNES_MCPIR1: - case SNES_MCPIR2: - m_maincpu->space(AS_PROGRAM).install_write_handler(0xffff00, 0xffffff, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); - break; - case SNES_20COL: - m_maincpu->space(AS_PROGRAM).install_write_handler(0x008000, 0x008fff, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); - break; - case SNES_SOULBLAD: - // reads from xxx0-xxx3in range [80-bf] return a fixed sequence of 4bits; reads in range [c0-ff] return open bus - m_maincpu->space(AS_PROGRAM).install_read_handler(0x808000, 0x808003, 0, 0x3f7ff0, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); - m_maincpu->space(AS_PROGRAM).install_read_handler(0xc00000, 0xffffff, read8_delegate(FUNC(snes_console_state::snes_open_bus_r),this)); - break; - case SNES_BUGS: - case SNES_BANANA: -// m_maincpu->space(AS_PROGRAM).install_read_handler(0x808000, 0x80ffff, 0, 0x780000, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); -// m_maincpu->space(AS_PROGRAM).install_write_handler(0x808000, 0x80ffff, 0, 0x780000, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); -// m_maincpu->set_5a22_map(); - break; - } + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::snes20_lo_r),this), write8_delegate(FUNC(snes_console_state::snes20_lo_w),this)); + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::snes20_hi_r),this), write8_delegate(FUNC(snes_console_state::snes20_hi_w),this)); + m_maincpu->set_5a22_map(); + + m_type = m_cartslot->get_type(); - if (m_cartslot) + switch (m_type) + { + // LoROM & LoROM + addons + case SNES_MODE20: + case SNES_BSXLO: + case SNES_SUFAMITURBO: + case SNES_CX4: // this still uses the old simulation instead of emulating the CPU + case SNES_ST010: // this requires two diff kinds of chip access, so we handle it in snes20_lo/hi_r/w + case SNES_ST011: // this requires two diff kinds of chip access, so we handle it in snes20_lo/hi_r/w + case SNES_ST018: // still unemulated + break; + case SNES_Z80GB: // skeleton support + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::snessgb_lo_r),this), write8_delegate(FUNC(snes_console_state::snessgb_lo_w),this)); + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::snessgb_hi_r),this), write8_delegate(FUNC(snes_console_state::snessgb_hi_w),this)); + m_maincpu->set_5a22_map(); + break; + case SNES_SA1: // skeleton support + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::snessa1_lo_r),this), write8_delegate(FUNC(snes_console_state::snessa1_lo_w),this)); + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::snessa1_hi_r),this), write8_delegate(FUNC(snes_console_state::snessa1_hi_w),this)); + m_maincpu->set_5a22_map(); + break; + case SNES_DSP: + m_maincpu->space(AS_PROGRAM).install_read_handler(0x208000, 0x20ffff, 0, 0x9f0000, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); + m_maincpu->space(AS_PROGRAM).install_write_handler(0x208000, 0x20ffff, 0, 0x9f0000, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); + break; + case SNES_DSP_2MB: + m_maincpu->space(AS_PROGRAM).install_read_handler(0x600000, 0x607fff, 0, 0x8f0000, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); + m_maincpu->space(AS_PROGRAM).install_write_handler(0x600000, 0x607fff, 0, 0x8f0000, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); + break; + case SNES_DSP4: + m_maincpu->space(AS_PROGRAM).install_read_handler(0x308000, 0x30ffff, 0, 0x8f0000, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); + m_maincpu->space(AS_PROGRAM).install_write_handler(0x308000, 0x30ffff, 0, 0x8f0000, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); + break; + case SNES_OBC1: + m_maincpu->space(AS_PROGRAM).install_read_handler(0x006000, 0x007fff, 0, 0xbf0000, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); + m_maincpu->space(AS_PROGRAM).install_write_handler(0x006000, 0x007fff, 0, 0xbf0000, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); + break; + case SNES_SFX: + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::snessfx_lo_r),this), write8_delegate(FUNC(snes_console_state::snessfx_lo_w),this)); + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::snessfx_hi_r),this), write8_delegate(FUNC(snes_console_state::snessfx_hi_w),this)); + m_maincpu->set_5a22_map(); + break; + case SNES_SDD1: + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::snessdd1_lo_r),this), write8_delegate(FUNC(snes_console_state::snessdd1_lo_w),this)); + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::snessdd1_hi_r),this), write8_delegate(FUNC(snes_console_state::snessdd1_hi_w),this)); + m_maincpu->set_5a22_map(); + break; + case SNES_BSX: + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::snesbsx_lo_r),this), write8_delegate(FUNC(snes_console_state::snesbsx_lo_w),this)); + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::snesbsx_hi_r),this), write8_delegate(FUNC(snes_console_state::snesbsx_hi_w),this)); + m_maincpu->set_5a22_map(); + break; + // HiROM & HiROM + addons + case SNES_MODE21: + case SNES_BSXHI: + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::snes21_lo_r),this), write8_delegate(FUNC(snes_console_state::snes21_lo_w),this)); + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::snes21_hi_r),this), write8_delegate(FUNC(snes_console_state::snes21_hi_w),this)); + m_maincpu->set_5a22_map(); + break; + case SNES_DSP_MODE21: + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::snes21_lo_r),this), write8_delegate(FUNC(snes_console_state::snes21_lo_w),this)); + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::snes21_hi_r),this), write8_delegate(FUNC(snes_console_state::snes21_hi_w),this)); + m_maincpu->space(AS_PROGRAM).install_read_handler(0x006000, 0x007fff, 0, 0x9f0000, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); + m_maincpu->space(AS_PROGRAM).install_write_handler(0x006000, 0x007fff, 0, 0x9f0000, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); + m_maincpu->set_5a22_map(); + break; + case SNES_SRTC: + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::snes21_lo_r),this), write8_delegate(FUNC(snes_console_state::snes21_lo_w),this)); + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::snes21_hi_r),this), write8_delegate(FUNC(snes_console_state::snes21_hi_w),this)); + m_maincpu->space(AS_PROGRAM).install_read_handler(0x002800, 0x002800, 0, 0xbf0000, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); + m_maincpu->space(AS_PROGRAM).install_write_handler(0x002801, 0x002801, 0, 0xbf0000, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); + m_maincpu->set_5a22_map(); + break; + case SNES_SPC7110: + case SNES_SPC7110_RTC: + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::snes7110_lo_r),this), write8_delegate(FUNC(snes_console_state::snes7110_lo_w),this)); + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::snes7110_hi_r),this), write8_delegate(FUNC(snes_console_state::snes7110_hi_w),this)); + m_maincpu->set_5a22_map(); + break; + case SNES_PFEST94: + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::pfest94_lo_r),this), write8_delegate(FUNC(snes_console_state::pfest94_lo_w),this)); + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::pfest94_hi_r),this), write8_delegate(FUNC(snes_console_state::pfest94_hi_w),this)); + m_maincpu->set_5a22_map(); + break; + // pirate 'mappers' + case SNES_POKEMON: + m_maincpu->space(AS_PROGRAM).install_read_handler(0x800000, 0x80ffff, 0, 0x780000, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); + m_maincpu->space(AS_PROGRAM).install_write_handler(0x800000, 0x80ffff, 0, 0x780000, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); + break; + case SNES_TEKKEN2: + m_maincpu->space(AS_PROGRAM).install_read_handler(0x808000, 0x8087ff, 0, 0x3f0000, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); + m_maincpu->space(AS_PROGRAM).install_write_handler(0x808000, 0x8087ff, 0, 0x3f0000, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); + break; + case SNES_MCPIR1: + case SNES_MCPIR2: + m_maincpu->space(AS_PROGRAM).install_write_handler(0xffff00, 0xffffff, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); + break; + case SNES_20COL: + m_maincpu->space(AS_PROGRAM).install_write_handler(0x008000, 0x008fff, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); + break; + case SNES_SOULBLAD: + // reads from xxx0-xxx3in range [80-bf] return a fixed sequence of 4bits; reads in range [c0-ff] return open bus + m_maincpu->space(AS_PROGRAM).install_read_handler(0x808000, 0x808003, 0, 0x3f7ff0, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); + m_maincpu->space(AS_PROGRAM).install_read_handler(0xc00000, 0xffffff, read8_delegate(FUNC(snes_console_state::snes_open_bus_r),this)); + break; + case SNES_BUGS: + case SNES_BANANA: +// m_maincpu->space(AS_PROGRAM).install_read_handler(0x808000, 0x80ffff, 0, 0x780000, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); +// m_maincpu->space(AS_PROGRAM).install_write_handler(0x808000, 0x80ffff, 0, 0x780000, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); +// m_maincpu->set_5a22_map(); + break; + } m_cartslot->save_ram(); + } } void snes_console_state::machine_reset() diff --git a/src/mess/drivers/ti99_4x.c b/src/mess/drivers/ti99_4x.c index fff2de23de1..ee661e7c471 100644 --- a/src/mess/drivers/ti99_4x.c +++ b/src/mess/drivers/ti99_4x.c @@ -351,6 +351,12 @@ static INPUT_PORTS_START(ti99_4a) PORT_START("ALPHA") /* one more port for Alpha line */ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Alpha Lock") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE + /* another version of Alpha Lock which is non-toggling; this is useful when we want to attach + a real TI keyboard for input. For home computers, the Alpha Lock / Shift Lock was a physically + locking key. */ + PORT_START("ALPHA1") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Alpha Lock non-toggle") PORT_CODE(KEYCODE_RWIN) + INPUT_PORTS_END @@ -462,7 +468,7 @@ READ8_MEMBER( ti99_4x_state::read_by_9901 ) // the line enough to make the TMS9901 sense the low level. // A reported, feasible fix was to cut the line and insert a diode // below the Alphalock key. - if ((ioport("ALPHABUG")!=0) && (m_model!=MODEL_4)) answer |= ioport("ALPHA")->read(); + if ((ioport("ALPHABUG")!=0) && (m_model!=MODEL_4)) answer |= (ioport("ALPHA")->read() | ioport("ALPHA1")->read()); } else { @@ -470,7 +476,7 @@ READ8_MEMBER( ti99_4x_state::read_by_9901 ) } if (m_check_alphalock) // never true for TI-99/4 { - answer &= ~(ioport("ALPHA")->read()); + answer &= ~(ioport("ALPHA")->read() | ioport("ALPHA1")->read()); } answer = (answer << 3); if (m_int1 == CLEAR_LINE) answer |= 0x02; diff --git a/src/mess/drivers/ticalc1x.c b/src/mess/drivers/ticalc1x.c index 076d49c7000..679d62d550e 100644 --- a/src/mess/drivers/ticalc1x.c +++ b/src/mess/drivers/ticalc1x.c @@ -99,7 +99,7 @@ void ticalc1x_state::machine_start() { // zerofill memset(m_display_state, 0, sizeof(m_display_state)); - memset(m_display_cache, 0, sizeof(m_display_cache)); + memset(m_display_cache, ~0, sizeof(m_display_cache)); memset(m_display_decay, 0, sizeof(m_display_decay)); memset(m_display_segmask, ~0, sizeof(m_display_segmask)); // ! @@ -169,7 +169,15 @@ void ticalc1x_state::display_update() const int mul = (m_display_maxx <= 10) ? 10 : 100; for (int x = 0; x < m_display_maxx; x++) - output_set_lamp_value(y * mul + x, active_state[y] >> x & 1); + { + int state = active_state[y] >> x & 1; + output_set_lamp_value(y * mul + x, state); + + // bit coords for svg2lay + char buf[10]; + sprintf(buf, "%d.%d", y, x); + output_set_value(buf, state); + } } memcpy(m_display_cache, active_state, sizeof(m_display_cache)); diff --git a/src/mess/drivers/tispeak.c b/src/mess/drivers/tispeak.c index df40fbf214f..8e84bf335dc 100644 --- a/src/mess/drivers/tispeak.c +++ b/src/mess/drivers/tispeak.c @@ -433,7 +433,15 @@ void tispeak_state::display_update() const int mul = (m_display_maxx <= 10) ? 10 : 100; for (int x = 0; x < m_display_maxx; x++) - output_set_lamp_value(y * mul + x, active_state[y] >> x & 1); + { + int state = active_state[y] >> x & 1; + output_set_lamp_value(y * mul + x, state); + + // bit coords for svg2lay + char buf[10]; + sprintf(buf, "%d.%d", y, x); + output_set_value(buf, state); + } } memcpy(m_display_cache, active_state, sizeof(m_display_cache)); @@ -731,7 +739,7 @@ void tispeak_state::machine_start() { // zerofill memset(m_display_state, 0, sizeof(m_display_state)); - memset(m_display_cache, 0, sizeof(m_display_cache)); + memset(m_display_cache, ~0, sizeof(m_display_cache)); memset(m_display_decay, 0, sizeof(m_display_decay)); memset(m_display_segmask, ~0, sizeof(m_display_segmask)); // ! diff --git a/src/mess/includes/hh_tms1k.h b/src/mess/includes/hh_tms1k.h new file mode 100644 index 00000000000..1e10012bce0 --- /dev/null +++ b/src/mess/includes/hh_tms1k.h @@ -0,0 +1,160 @@ +// license:BSD-3-Clause +// copyright-holders:hap, Sean Riddle, Kevin Horton +/* + + TMS1000 MCU series tabletops/handhelds or other simple devices. + +*/ + +#ifndef _HH_TMS1K_H_ +#define _HH_TMS1K_H_ + + +#include "emu.h" +#include "cpu/tms0980/tms0980.h" +#include "sound/speaker.h" + + +class hh_tms1k_state : public driver_device +{ +public: + hh_tms1k_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_inp_matrix(*this, "IN"), + m_speaker(*this, "speaker"), + m_display_wait(33), + m_display_maxy(1), + m_display_maxx(0) + { } + + // devices + required_device<cpu_device> m_maincpu; + optional_ioport_array<7> m_inp_matrix; // max 7 + optional_device<speaker_sound_device> m_speaker; + + // misc common + UINT16 m_r; // MCU R-pins data + UINT16 m_o; // MCU O-pins data + UINT16 m_inp_mux; // multiplexed inputs mask + bool m_power_on; + + UINT8 read_inputs(int columns); + DECLARE_INPUT_CHANGED_MEMBER(power_button); + DECLARE_WRITE_LINE_MEMBER(auto_power_off); + + // display common + int m_display_wait; // led/lamp off-delay in microseconds (default 33ms) + int m_display_maxy; // display matrix number of rows + int m_display_maxx; // display matrix number of columns + + UINT32 m_display_state[0x20]; // display matrix rows data + UINT16 m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments + UINT32 m_display_cache[0x20]; // (internal use) + UINT8 m_display_decay[0x20][0x20]; // (internal use) + + TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick); + void display_update(); + void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety); + + // game-specific handlers + void mathmagi_display(); + DECLARE_WRITE16_MEMBER(mathmagi_write_r); + DECLARE_WRITE16_MEMBER(mathmagi_write_o); + DECLARE_READ8_MEMBER(mathmagi_read_k); + + void amaztron_display(); + DECLARE_WRITE16_MEMBER(amaztron_write_r); + DECLARE_WRITE16_MEMBER(amaztron_write_o); + DECLARE_READ8_MEMBER(amaztron_read_k); + + void tc4_display(); + DECLARE_WRITE16_MEMBER(tc4_write_r); + DECLARE_WRITE16_MEMBER(tc4_write_o); + DECLARE_READ8_MEMBER(tc4_read_k); + + void ebball_display(); + DECLARE_WRITE16_MEMBER(ebball_write_r); + DECLARE_WRITE16_MEMBER(ebball_write_o); + DECLARE_READ8_MEMBER(ebball_read_k); + + void ebball2_display(); + DECLARE_WRITE16_MEMBER(ebball2_write_r); + DECLARE_WRITE16_MEMBER(ebball2_write_o); + DECLARE_READ8_MEMBER(ebball2_read_k); + + void ebball3_display(); + DECLARE_WRITE16_MEMBER(ebball3_write_r); + DECLARE_WRITE16_MEMBER(ebball3_write_o); + DECLARE_READ8_MEMBER(ebball3_read_k); + void ebball3_set_clock(); + DECLARE_INPUT_CHANGED_MEMBER(ebball3_difficulty_switch); + DECLARE_MACHINE_RESET(ebball3); + + DECLARE_WRITE16_MEMBER(elecdet_write_r); + DECLARE_WRITE16_MEMBER(elecdet_write_o); + DECLARE_READ8_MEMBER(elecdet_read_k); + + void starwbc_display(); + DECLARE_WRITE16_MEMBER(starwbc_write_r); + DECLARE_WRITE16_MEMBER(starwbc_write_o); + DECLARE_READ8_MEMBER(starwbc_read_k); + + DECLARE_WRITE16_MEMBER(comp4_write_r); + DECLARE_WRITE16_MEMBER(comp4_write_o); + DECLARE_READ8_MEMBER(comp4_read_k); + + DECLARE_WRITE16_MEMBER(simon_write_r); + DECLARE_WRITE16_MEMBER(simon_write_o); + DECLARE_READ8_MEMBER(simon_read_k); + + DECLARE_WRITE16_MEMBER(ssimon_write_r); + DECLARE_WRITE16_MEMBER(ssimon_write_o); + DECLARE_READ8_MEMBER(ssimon_read_k); + + DECLARE_WRITE16_MEMBER(cnsector_write_r); + DECLARE_WRITE16_MEMBER(cnsector_write_o); + DECLARE_READ8_MEMBER(cnsector_read_k); + + DECLARE_WRITE16_MEMBER(merlin_write_r); + DECLARE_WRITE16_MEMBER(merlin_write_o); + DECLARE_READ8_MEMBER(merlin_read_k); + + DECLARE_WRITE16_MEMBER(stopthief_write_r); + DECLARE_WRITE16_MEMBER(stopthief_write_o); + DECLARE_READ8_MEMBER(stopthief_read_k); + + DECLARE_WRITE16_MEMBER(bankshot_write_r); + DECLARE_WRITE16_MEMBER(bankshot_write_o); + DECLARE_READ8_MEMBER(bankshot_read_k); + + DECLARE_WRITE16_MEMBER(splitsec_write_r); + DECLARE_WRITE16_MEMBER(splitsec_write_o); + DECLARE_READ8_MEMBER(splitsec_read_k); + + void tandy12_display(); + DECLARE_WRITE16_MEMBER(tandy12_write_r); + DECLARE_WRITE16_MEMBER(tandy12_write_o); + DECLARE_READ8_MEMBER(tandy12_read_k); + +protected: + virtual void machine_start(); + virtual void machine_reset(); +}; + + +// LED segments +enum +{ + lA = 0x01, + lB = 0x02, + lC = 0x04, + lD = 0x08, + lE = 0x10, + lF = 0x20, + lG = 0x40, + lDP = 0x80 +}; + + +#endif /* _HH_TMS1K_H_ */ diff --git a/src/mess/layout/ebball2.lay b/src/mess/layout/ebball2.lay new file mode 100644 index 00000000000..91d3427f5e3 --- /dev/null +++ b/src/mess/layout/ebball2.lay @@ -0,0 +1,215 @@ +<?xml version="1.0"?> +<mamelayout version="2"> + +<!-- define elements --> + + <element name="static_black"><rect><color red="0.0" green="0.0" blue="0.0" /></rect></element> + <element name="disk_black"><disk><color red="0.0" green="0.0" blue="0.0" /></disk></element> + <element name="disk_green"><disk><color red="0.0" green="0.38" blue="0.15" /></disk></element> + <element name="static_white"><rect><color red="0.75" green="0.75" blue="0.75" /></rect></element> + <element name="static_white2"><rect><color red="0.85" green="0.85" blue="0.85" /></rect></element> + <element name="disk_white"><disk><color red="0.75" green="0.75" blue="0.75" /></disk></element> + <element name="disk_white2"><disk><color red="0.85" green="0.85" blue="0.85" /></disk></element> + +<!-- background is dark-red, to hide the leds --> + + <element name="static_bg"><rect><color red="0.2" green="0.04" blue="0.05" /></rect></element> + <element name="disk_bg"><disk><color red="0.2" green="0.04" blue="0.05" /></disk></element> + + + <element name="field_guy"> + <rect><color red="0.0" green="0.38" blue="0.15" /></rect> + <text string=":-)"><color red="0.85" green="0.85" blue="0.85" /></text> + </element> + <element name="base_guy"> + <rect><color red="0.2" green="0.04" blue="0.05" /></rect> + <text string=":-)"><color red="0.85" green="0.85" blue="0.85" /></text> + </element> + <element name="pitcher"> + <rect><color red="0.2" green="0.04" blue="0.05" /></rect> + <text string=":-P"><color red="0.85" green="0.85" blue="0.85" /></text> + </element> + + <element name="text_s"><text string="S" align="1"><color red="0.95" green="0.95" blue="0.95" /></text></element> + <element name="text_b"><text string="B" align="1"><color red="0.95" green="0.95" blue="0.95" /></text></element> + <element name="text_o"><text string="O" align="1"><color red="0.95" green="0.95" blue="0.95" /></text></element> + + <element name="text_s2"> + <rect><color red="0.2" green="0.04" blue="0.05" /></rect> + <text string="S"><color red="0.95" green="0.95" blue="0.95" /></text> + </element> + <element name="text_b2"><text string="B"><color red="0.95" green="0.95" blue="0.95" /></text></element> + + <element name="text_single"><text string="1B"><color red="0.95" green="0.95" blue="0.95" /></text></element> + <element name="text_double"><text string="2B"><color red="0.95" green="0.95" blue="0.95" /></text></element> + <element name="text_triple"><text string="3B"><color red="0.95" green="0.95" blue="0.95" /></text></element> + + <element name="text_home"><text string="HOME" align="2"><color red="0.95" green="0.95" blue="0.95" /></text></element> + <element name="text_run"><text string="RUN" align="1"><color red="0.95" green="0.95" blue="0.95" /></text></element> + + <element name="text_count"><text string="COUNT"><color red="0.95" green="0.95" blue="0.95" /></text></element> + <element name="text_inning"><text string="INNING"><color red="0.95" green="0.95" blue="0.95" /></text></element> + <element name="text_visitor"><text string="VISITOR"><color red="0.95" green="0.95" blue="0.95" /></text></element> + <element name="text_home2"><text string="HOME"><color red="0.95" green="0.95" blue="0.95" /></text></element> + + + <element name="digit" defstate="0"> + <led7seg><color red="1.0" green="0.20" blue="0.22" /></led7seg> + </element> + + <element name="led" defstate="0"> + <disk state="0"><color red="0.2" green="0.04" blue="0.05" /></disk> + <disk state="1"><color red="1.0" green="0.20" blue="0.22" /></disk> + </element> + + + +<!-- build screen --> + + <view name="Internal Layout"> + <bounds left="0" right="100" top="0" bottom="114" /> + <bezel element="static_black"> + <bounds left="0" right="100" top="0" bottom="114" /> + </bezel> + + <!-- outer bezel --> + + <bezel element="text_count"><bounds x="16" y="2" width="8" height="3" /></bezel> + + <bezel element="text_s"><bounds x="12.5" y="7.2" width="2" height="2.5" /></bezel> + <bezel name="lamp40" element="led"><bounds x="16" y="7" width="3" height="3" /></bezel> + <bezel name="lamp41" element="led"><bounds x="20" y="7" width="3" height="3" /></bezel> + + <bezel element="text_b"><bounds x="12.5" y="11.2" width="2" height="2.5" /></bezel> + <bezel name="lamp50" element="led"><bounds x="16" y="11" width="3" height="3" /></bezel> + <bezel name="lamp51" element="led"><bounds x="20" y="11" width="3" height="3" /></bezel> + <bezel name="lamp52" element="led"><bounds x="24" y="11" width="3" height="3" /></bezel> + + <bezel element="text_o"><bounds x="12.5" y="15.2" width="2" height="2.5" /></bezel> + <bezel name="lamp42" element="led"><bounds x="16" y="15" width="3" height="3" /></bezel> + <bezel name="lamp43" element="led"><bounds x="20" y="15" width="3" height="3" /></bezel> + + <bezel element="text_inning"><bounds x="52" y="2" width="12" height="3" /></bezel> + <bezel element="text_visitor"><bounds x="66" y="2" width="13" height="3" /></bezel> + <bezel element="text_home2"><bounds x="82" y="2" width="13" height="3" /></bezel> + + <bezel element="static_white2"><bounds x="79.5" y="2" width="0.5" height="16" /></bezel> + + <bezel name="digit0" element="digit"><bounds x="54" y="7" width="7.333" height="11" /></bezel> + <bezel name="digit1" element="digit"><bounds x="70" y="7" width="7.333" height="11" /></bezel> + <bezel name="digit2" element="digit"><bounds x="86" y="7" width="7.333" height="11" /></bezel> + + <bezel name="lamp33" element="led"><bounds x="66" y="7" width="3" height="3" /></bezel> + <bezel name="lamp32" element="led"><bounds x="82" y="7" width="3" height="3" /></bezel> + + <bezel name="lamp31" element="led"><bounds x="66" y="13" width="3" height="3" /></bezel> + <bezel name="lamp30" element="led"><bounds x="82" y="13" width="3" height="3" /></bezel> + + + <!-- board --> + + <bezel element="disk_green"><bounds x="-5" y="25" width="110" height="110" /></bezel> + <bezel element="static_black"><bounds x="-10" y="75" width="120" height="65" /></bezel> + <bezel element="disk_bg"><bounds x="15" y="45" width="70" height="70" /></bezel> + <bezel element="static_black"><bounds x="0" y="85" width="100" height="40" /></bezel> + <bezel element="static_bg"><bounds x="15" y="75" width="70" height="26" /></bezel> + <bezel element="disk_bg"><bounds x="40" y="91" width="20" height="20" /></bezel> + + <!-- top edge --> + + <bezel element="disk_black"><bounds x="-1.3" y="44.7" width="10" height="10" /></bezel> + <bezel element="disk_black"><bounds x="91.3" y="44.7" width="10" height="10" /></bezel> + <bezel name="lamp81" element="led"><bounds x="2.2" y="48.2" width="3" height="3" /></bezel> + <bezel name="lamp85" element="led"><bounds x="94.8" y="48.2" width="3" height="3" /></bezel> + <bezel element="text_single"><bounds x="2.2" y="44.5" width="3" height="2.5" /></bezel> + <bezel element="text_single"><bounds x="94.8" y="44.5" width="3" height="2.5" /></bezel> + + <bezel element="disk_black"><bounds x="18.5" y="26.5" width="10" height="10" /></bezel> + <bezel element="disk_black"><bounds x="71.5" y="26.5" width="10" height="10" /></bezel> + <bezel name="lamp82" element="led"><bounds x="22" y="30" width="3" height="3" /></bezel> + <bezel name="lamp84" element="led"><bounds x="75" y="30" width="3" height="3" /></bezel> + <bezel element="text_triple"><bounds x="22" y="26.3" width="3" height="2.5" /></bezel> + <bezel element="text_double"><bounds x="75" y="26.3" width="3" height="2.5" /></bezel> + + <bezel element="disk_white2"><bounds x="45" y="20" width="10" height="10" /></bezel> + <bezel element="disk_black"><bounds x="45.5" y="20.5" width="9" height="9" /></bezel> + <bezel name="lamp83" element="led"><bounds x="48.5" y="23.5" width="3" height="3" /></bezel> + <bezel element="text_home"><bounds x="36" y="21.5" width="8" height="2.5" /></bezel> + <bezel element="text_run"><bounds x="56.5" y="21.5" width="8" height="2.5" /></bezel> + + <!-- field --> + + <bezel element="field_guy"><bounds x="13" y="48.5" width="3" height="3" /></bezel> + <bezel element="disk_bg"><bounds x="12" y="52" width="5" height="5" /></bezel> + <bezel name="lamp74" element="led"><bounds x="13" y="53" width="3" height="3" /></bezel> + + <bezel element="field_guy"><bounds x="48.5" y="31.5" width="3" height="3" /></bezel> + <bezel element="disk_bg"><bounds x="47.5" y="35" width="5" height="5" /></bezel> + <bezel name="lamp75" element="led"><bounds x="48.5" y="36" width="3" height="3" /></bezel> + + <bezel element="field_guy"><bounds x="84" y="48.5" width="3" height="3" /></bezel> + <bezel element="disk_bg"><bounds x="83" y="52" width="5" height="5" /></bezel> + <bezel name="lamp80" element="led"><bounds x="84" y="53" width="3" height="3" /></bezel> + + <!-- pitcher --> + + <bezel element="pitcher"><bounds x="48.5" y="66.5" width="3" height="3" /></bezel> + <bezel element="static_white"><bounds x="46" y="71" width="0.5" height="18.5" /></bezel> + <bezel element="static_white"><bounds x="53.5" y="71" width="0.5" height="18.5" /></bezel> + + <bezel name="lamp53" element="led"><bounds x="48.5" y="70.5" width="3" height="3" /></bezel> + <bezel name="lamp7" element="led"><bounds x="48.5" y="76" width="3" height="3" /></bezel> + <bezel name="lamp17" element="led"><bounds x="48.5" y="81.5" width="3" height="3" /></bezel> + <bezel name="lamp27" element="led"><bounds x="48.5" y="87" width="3" height="3" /></bezel> + + <bezel name="lamp97" element="led"><bounds x="45" y="92.5" width="3" height="3" /></bezel> + <bezel name="lamp90" element="led"><bounds x="52" y="92.5" width="3" height="3" /></bezel> + + <!-- bases --> + + <bezel element="base_guy"><bounds x="70" y="58" width="3" height="3" /></bezel> + <bezel name="lamp73" element="led"><bounds x="70" y="62" width="3" height="3" /></bezel> + + <bezel element="base_guy"><bounds x="61" y="49" width="3" height="3" /></bezel> + <bezel name="lamp72" element="led"><bounds x="61" y="53" width="3" height="3" /></bezel> + + <bezel element="base_guy"><bounds x="36" y="49" width="3" height="3" /></bezel> + <bezel name="lamp71" element="led"><bounds x="36" y="53" width="3" height="3" /></bezel> + + <bezel element="base_guy"><bounds x="27" y="58" width="3" height="3" /></bezel> + <bezel name="lamp70" element="led"><bounds x="27" y="62" width="3" height="3" /></bezel> + + <bezel element="static_white"><bounds x="72" y="72" width="6" height="6" /></bezel> + <bezel element="static_bg"><bounds x="72.5" y="72.5" width="5" height="5" /></bezel> + <bezel name="lamp60" element="led"><bounds x="73.5" y="73.5" width="3" height="3" /></bezel> + + <bezel element="static_white"><bounds x="47" y="47" width="6" height="6" /></bezel> + <bezel element="static_bg"><bounds x="47.5" y="47.5" width="5" height="5" /></bezel> + <bezel name="lamp61" element="led"><bounds x="48.5" y="48.5" width="3" height="3" /></bezel> + + <bezel element="static_white"><bounds x="22" y="72" width="6" height="6" /></bezel> + <bezel element="static_bg"><bounds x="22.5" y="72.5" width="5" height="5" /></bezel> + <bezel name="lamp62" element="led"><bounds x="23.5" y="73.5" width="3" height="3" /></bezel> + + <!-- home --> + + <bezel element="static_white"><bounds x="47" y="97" width="6" height="3" /></bezel> + <bezel element="disk_white"><bounds x="47" y="97" width="6" height="6" /></bezel> + <bezel element="static_bg"><bounds x="47.5" y="97.5" width="5" height="2.51" /></bezel> + <bezel element="disk_bg"><bounds x="47.5" y="97.5" width="5" height="5" /></bezel> + + <bezel element="text_b2"><bounds x="42.5" y="108.3" width="3" height="2.5" /></bezel> + <bezel name="lamp95" element="led"><bounds x="42.5" y="98.5" width="3" height="3" /></bezel> + <bezel name="lamp94" element="led"><bounds x="42.5" y="104" width="3" height="3" /></bezel> + + <bezel element="text_s2"><bounds x="48.5" y="108.3" width="3" height="2.5" /></bezel> + <bezel name="lamp63" element="led"><bounds x="48.5" y="98.5" width="3" height="3" /></bezel> + <bezel name="lamp93" element="led"><bounds x="48.5" y="104" width="3" height="3" /></bezel> + + <bezel element="text_b2"><bounds x="54.5" y="108.3" width="3" height="2.5" /></bezel> + <bezel name="lamp91" element="led"><bounds x="54.5" y="98.5" width="3" height="3" /></bezel> + <bezel name="lamp92" element="led"><bounds x="54.5" y="104" width="3" height="3" /></bezel> + + + </view> +</mamelayout> diff --git a/src/mess/layout/ebball3.lay b/src/mess/layout/ebball3.lay index 7338a3cc1d6..3e6a5df9031 100644 --- a/src/mess/layout/ebball3.lay +++ b/src/mess/layout/ebball3.lay @@ -156,6 +156,8 @@ <bezel name="digit1" element="digit"><bounds x="90" y="1.5" width="6" height="9" /></bezel> <bezel element="text_v"><bounds x="85" y="7.3" width="3" height="3" /></bezel> + <bezel element="static_white2"><bounds x="82.5" y="1.5" width="0.5" height="9" /></bezel> + <!-- board --> diff --git a/src/mess/layout/mbdtower.lay b/src/mess/layout/mbdtower.lay new file mode 100644 index 00000000000..940ef1a955e --- /dev/null +++ b/src/mess/layout/mbdtower.lay @@ -0,0 +1,19 @@ +<?xml version="1.0"?> +<mamelayout version="2"> + +<!-- define elements --> + + <element name="static_black"><rect><color red="0.0" green="0.0" blue="0.0" /></rect></element> + + +<!-- build screen --> + + <view name="Internal Layout"> + <bounds left="0" right="64" top="0" bottom="64" /> + <bezel element="static_black"> + <bounds left="0" right="64" top="0" bottom="64" /> + </bezel> + + + </view> +</mamelayout> diff --git a/src/mess/layout/ssimon.lay b/src/mess/layout/ssimon.lay new file mode 100644 index 00000000000..940ef1a955e --- /dev/null +++ b/src/mess/layout/ssimon.lay @@ -0,0 +1,19 @@ +<?xml version="1.0"?> +<mamelayout version="2"> + +<!-- define elements --> + + <element name="static_black"><rect><color red="0.0" green="0.0" blue="0.0" /></rect></element> + + +<!-- build screen --> + + <view name="Internal Layout"> + <bounds left="0" right="64" top="0" bottom="64" /> + <bezel element="static_black"> + <bounds left="0" right="64" top="0" bottom="64" /> + </bezel> + + + </view> +</mamelayout> diff --git a/src/mess/machine/m24_kbd.c b/src/mess/machine/m24_kbd.c new file mode 100644 index 00000000000..5a60d22e555 --- /dev/null +++ b/src/mess/machine/m24_kbd.c @@ -0,0 +1,290 @@ +#include "m24_kbd.h" + +const device_type M24_KEYBOARD = &device_creator<m24_keyboard_device>; + +ROM_START( m24_keyboard ) + ROM_REGION(0x800, "mcu", 0) + ROM_LOAD("m24_8049_int.bin", 0x0000, 0x800, CRC(ef26ca15) SHA1(b5076d40c255e17dc93478e2254ea19aff4918b3)) +ROM_END + + +const rom_entry *m24_keyboard_device::device_rom_region() const +{ + return ROM_NAME( m24_keyboard ); +} + +static ADDRESS_MAP_START( m24_keyboard_io, AS_IO, 8, m24_keyboard_device ) + AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_WRITE(bus_w) + AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_READWRITE(p1_r, p1_w) + AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READ(p2_r) AM_WRITENOP + AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ(t0_r) + AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(t1_r) +ADDRESS_MAP_END + +static MACHINE_CONFIG_FRAGMENT( m24_keyboard ) + MCFG_CPU_ADD("mcu", I8049, XTAL_6MHz) + MCFG_CPU_IO_MAP(m24_keyboard_io) +MACHINE_CONFIG_END + +machine_config_constructor m24_keyboard_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( m24_keyboard ); +} + +INPUT_PORTS_START( m24_keyboard ) + PORT_START("ROW.0") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7_PAD) PORT_CHAR(UCHAR_MAMEKEY(7_PAD)) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F1) PORT_CHAR(UCHAR_MAMEKEY(F1)) + + PORT_START("ROW.1") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('@') + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8_PAD) PORT_CHAR(UCHAR_MAMEKEY(8_PAD)) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F2) PORT_CHAR(UCHAR_MAMEKEY(F2)) + + PORT_START("ROW.2") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C') + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9_PAD) PORT_CHAR(UCHAR_MAMEKEY(9_PAD)) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F3) PORT_CHAR(UCHAR_MAMEKEY(F3)) + + PORT_START("ROW.3") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4_PAD) PORT_CHAR(UCHAR_MAMEKEY(4_PAD)) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F4) PORT_CHAR(UCHAR_MAMEKEY(F4)) + + PORT_START("ROW.4") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G') + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B') + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5_PAD) PORT_CHAR(UCHAR_MAMEKEY(5_PAD)) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F5) PORT_CHAR(UCHAR_MAMEKEY(F5)) + + PORT_START("ROW.5") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('^') + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N') + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6_PAD) PORT_CHAR(UCHAR_MAMEKEY(6_PAD)) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F6) PORT_CHAR(UCHAR_MAMEKEY(F6)) + + PORT_START("ROW.6") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('&') + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1_PAD) PORT_CHAR(UCHAR_MAMEKEY(1_PAD)) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F7) PORT_CHAR(UCHAR_MAMEKEY(F7)) + + PORT_START("ROW.7") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*') + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2_PAD) PORT_CHAR(UCHAR_MAMEKEY(2_PAD)) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F8) PORT_CHAR(UCHAR_MAMEKEY(F8)) + + PORT_START("ROW.8") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR('(') + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3_PAD) PORT_CHAR(UCHAR_MAMEKEY(3_PAD)) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F9) PORT_CHAR(UCHAR_MAMEKEY(F9)) + + PORT_START("ROW.9") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')') + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR('+') + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('?') PORT_CHAR('/') + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_DEL_PAD) PORT_CHAR(UCHAR_MAMEKEY(DEL_PAD)) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F10) PORT_CHAR(UCHAR_MAMEKEY(F10)) + + PORT_START("ROW.10") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('_') + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{') + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') PORT_CHAR('"') + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CHAR('+') + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0_PAD) PORT_CHAR(UCHAR_MAMEKEY(0_PAD)) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("ROW.11") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}') + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('`') PORT_CHAR('~') + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ENTER) PORT_CHAR('\r') + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SCRLOCK) PORT_CHAR(UCHAR_MAMEKEY(SCRLOCK)) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("ROW.12") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_CHAR('|') + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(ESC)) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TAB) PORT_CHAR('\t') + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("ROW.13") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("ROW.14") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_CHAR(UCHAR_MAMEKEY(PLUS_PAD)) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS_PAD) PORT_CHAR(UCHAR_MAMEKEY(MINUS_PAD)) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ASTERISK) PORT_CHAR(UCHAR_MAMEKEY(ASTERISK)) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("ROW.15") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Unknown 0x2A") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_RSHIFT) PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CAPSLOCK) PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LALT) PORT_CODE(KEYCODE_RALT) PORT_CHAR(UCHAR_MAMEKEY(LALT)) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_NUMLOCK) PORT_CHAR(UCHAR_MAMEKEY(NUMLOCK)) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR(UCHAR_SHIFT_2) + + PORT_START("MOUSEBTN") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Left Btn") PORT_CODE(MOUSECODE_BUTTON1) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Middle Btn") PORT_CODE(MOUSECODE_BUTTON3) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Right Btn") PORT_CODE(MOUSECODE_BUTTON2) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) +INPUT_PORTS_END + + +ioport_constructor m24_keyboard_device::device_input_ports() const +{ + return INPUT_PORTS_NAME( m24_keyboard ); +} + +m24_keyboard_device::m24_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : device_t(mconfig, M24_KEYBOARD, "Olivetti M24 Keyboard", tag, owner, clock, "m24_kbd", __FILE__), + m_rows(*this, "ROW"), + m_mousebtn(*this, "MOUSEBTN"), + m_out_data(*this), + m_mcu(*this, "mcu") +{ +} + +void m24_keyboard_device::device_start() +{ + m_out_data.resolve_safe(); + m_out_data(1); + m_reset_timer = timer_alloc(); +} + +void m24_keyboard_device::device_reset() +{ + m_kbcdata = true; +} + +void m24_keyboard_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) +{ + m_mcu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); + m_out_data(1); +} + +READ8_MEMBER( m24_keyboard_device::p1_r ) +{ + return m_p1 | (m_kbcdata ? 0 : 2); +} + +WRITE8_MEMBER( m24_keyboard_device::p1_w ) +{ + // bit 3 and 4 are leds and bits 6 and 7 are jumpers to ground + m_p1 = data & ~0xc0; + if(m_p1 & 4) + m_p1 |= 2; + else + m_p1 &= ~2; + m_out_data(!BIT(data, 2)); +} + +READ8_MEMBER( m24_keyboard_device::p2_r ) +{ + return (m_keypress << 7) | m_mousebtn->read(); +} + +READ8_MEMBER( m24_keyboard_device::t0_r ) +{ + return 0; +} + +READ8_MEMBER( m24_keyboard_device::t1_r ) +{ + return 0; +} + +WRITE8_MEMBER( m24_keyboard_device::bus_w ) +{ + UINT8 col = m_rows[(data >> 3) & 0xf]->read(); + m_keypress = (col & (1 << (data & 7))) ? 1 : 0; +} + +WRITE_LINE_MEMBER( m24_keyboard_device::clock_w ) +{ + m_mcu->set_input_line(MCS48_INPUT_IRQ, !state); + if(!state) + m_reset_timer->adjust(attotime::from_msec(50)); + else + { + m_reset_timer->adjust(attotime::never); + m_mcu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE); + } +} + +WRITE_LINE_MEMBER( m24_keyboard_device::data_w ) +{ + m_kbcdata = state; +} diff --git a/src/mess/machine/m24_kbd.h b/src/mess/machine/m24_kbd.h new file mode 100644 index 00000000000..6a5dac2c6f7 --- /dev/null +++ b/src/mess/machine/m24_kbd.h @@ -0,0 +1,45 @@ +#ifndef M24KBD_H_ +#define M24KBD_H_ + +#include "emu.h" +#include "cpu/mcs48/mcs48.h" + +#define MCFG_M24_KEYBOARD_OUT_DATA_HANDLER(_devcb) \ + devcb = &m24_keyboard_device::set_out_data_handler(*device, DEVCB_##_devcb); + +class m24_keyboard_device : public device_t +{ +public: + m24_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + template<class _Object> static devcb_base &set_out_data_handler(device_t &device, _Object object) { return downcast<m24_keyboard_device &>(device).m_out_data.set_callback(object); } + + virtual const rom_entry *device_rom_region() const; + virtual machine_config_constructor device_mconfig_additions() const; + virtual ioport_constructor device_input_ports() const; + + void device_start(); + void device_reset(); + void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); + + DECLARE_WRITE8_MEMBER(bus_w); + DECLARE_READ8_MEMBER(p1_r); + DECLARE_WRITE8_MEMBER(p1_w); + DECLARE_READ8_MEMBER(p2_r); + DECLARE_READ8_MEMBER(t0_r); + DECLARE_READ8_MEMBER(t1_r); + DECLARE_WRITE_LINE_MEMBER(clock_w); + DECLARE_WRITE_LINE_MEMBER(data_w); +private: + required_ioport_array<16> m_rows; + required_ioport m_mousebtn; + UINT8 m_p1; + bool m_keypress, m_kbcdata; + devcb_write_line m_out_data; + required_device<cpu_device> m_mcu; + emu_timer *m_reset_timer; +}; + +extern const device_type M24_KEYBOARD; + +#endif /* M24KBD_H_ */ diff --git a/src/mess/mess.lst b/src/mess/mess.lst index 2ea9ed1c715..e1ee73cecc7 100644 --- a/src/mess/mess.lst +++ b/src/mess/mess.lst @@ -1656,13 +1656,14 @@ vt320 // 1987 Digital Equipment Corporation vt520 // 1994 Digital Equipment Corporation //vt525 vk100 // 1980 Digital Equipment Corporation -dectalk // 1982 Digital Equipment Corporation +dectalk // 1983 Digital Equipment Corporation //vt240 // 1983 Digital Equipment Corporation //vt241 mc7105 // Elektronika MC7105 rainbow100a // 1982 DEC Rainbow 100-A rainbow // 1983 DEC Rainbow 100-B rainbow190 // 1985 DEC Rainbow 190 +//dtc03 // 1985 Digital Equipment Corporation // Memotech mtx512 // 1983 Memotech MTX 512 @@ -2195,12 +2196,14 @@ mathmagi // APF amaztron // Coleco tc4 // Coleco ebball // Entex +ebball2 // Entex ebball3 // Entex elecdet // Ideal starwbc // Kenner starwbcp // Kenner (prototype) comp4 // Milton Bradley simon // Milton Bradley +ssimon // Milton Bradley cnsector // Parker Bros merlin // Parker Bros stopthie // Parker Bros @@ -2209,6 +2212,9 @@ bankshot // Parker Bros splitsec // Parker Bros tandy12 // Tandy Radio Shack +elecbowl // Marx +mbdtower // Milton Bradley + ssfball // Bambino splasfgt // Bambino astrocmd // Epoch @@ -2217,7 +2223,6 @@ tmpacman // Tomy tmtennis // Tomy alnchase // Tomy -elecbowl // Marx wildfire // Parker Bros diff --git a/src/mess/mess.mak b/src/mess/mess.mak index b26b547f594..10a8d65dc4e 100644 --- a/src/mess/mess.mak +++ b/src/mess/mess.mak @@ -1383,6 +1383,7 @@ $(MESSOBJ)/matsushi.a: \ $(MESS_DRIVERS)/myb3k.o \ $(MESSOBJ)/mb.a: \ + $(MESS_DRIVERS)/mbdtower.o \ $(MESS_DRIVERS)/microvsn.o \ $(MESSOBJ)/mchester.a: \ @@ -1477,6 +1478,7 @@ $(MESSOBJ)/novag.a: \ $(MESSOBJ)/olivetti.a: \ $(MESS_DRIVERS)/m20.o \ $(MESS_DRIVERS)/m24.o \ + $(MESS_MACHINE)/m24_kbd.o \ $(MESSOBJ)/omnibyte.a: \ $(MESS_DRIVERS)/msbc1.o \ @@ -2138,11 +2140,13 @@ $(MESS_DRIVERS)/hh_tms1k.o: $(MESS_LAYOUT)/amaztron.lh \ $(MESS_LAYOUT)/cnsector.lh \ $(MESS_LAYOUT)/comp4.lh \ $(MESS_LAYOUT)/ebball.lh \ + $(MESS_LAYOUT)/ebball2.lh \ $(MESS_LAYOUT)/ebball3.lh \ $(MESS_LAYOUT)/elecdet.lh \ $(MESS_LAYOUT)/mathmagi.lh \ $(MESS_LAYOUT)/merlin.lh \ $(MESS_LAYOUT)/simon.lh \ + $(MESS_LAYOUT)/ssimon.lh \ $(MESS_LAYOUT)/splitsec.lh \ $(MESS_LAYOUT)/starwbc.lh \ $(MESS_LAYOUT)/stopthie.lh \ @@ -2158,6 +2162,7 @@ $(MESS_DRIVERS)/lc80.o: $(MESS_LAYOUT)/lc80.lh $(MESS_DRIVERS)/llc.o: $(MESS_LAYOUT)/llc1.lh $(MESS_DRIVERS)/lynx.o: $(MESS_LAYOUT)/lynx.lh $(MESS_DRIVERS)/mac.o: $(MESS_LAYOUT)/mac.lh +$(MESS_DRIVERS)/mbdtower.o: $(MESS_LAYOUT)/mbdtower.lh $(MESS_MACHINE)/megacd.o: $(MESS_LAYOUT)/megacd.lh $(MESS_DRIVERS)/mekd2.o: $(MESS_LAYOUT)/mekd2.lh $(MESS_DRIVERS)/mephisto.o: $(MESS_LAYOUT)/mephisto.lh diff --git a/src/mess/tools/floptool/main.c b/src/mess/tools/floptool/main.c index 4575e1609cb..2cb36f3a873 100644 --- a/src/mess/tools/floptool/main.c +++ b/src/mess/tools/floptool/main.c @@ -15,8 +15,8 @@ #include <ctype.h> #include <stdlib.h> #include <time.h> -#include <assert.h> #include <stdarg.h> +#include <assert.h> #include "corestr.h" diff --git a/src/mess/tools/imgtool/iflopimg.c b/src/mess/tools/imgtool/iflopimg.c index 26a91ccf749..765245cb8ff 100644 --- a/src/mess/tools/imgtool/iflopimg.c +++ b/src/mess/tools/imgtool/iflopimg.c @@ -6,8 +6,8 @@ *********************************************************************/ -#include "formats/flopimg.h" #include "imgtool.h" +#include "formats/flopimg.h" #include "library.h" #include "iflopimg.h" diff --git a/src/mess/tools/imgtool/imgterrs.c b/src/mess/tools/imgtool/imgterrs.c index 58a2d944179..696aafdfa1a 100644 --- a/src/mess/tools/imgtool/imgterrs.c +++ b/src/mess/tools/imgtool/imgterrs.c @@ -6,7 +6,7 @@ ***************************************************************************/ -#include <assert.h> +#include "imgtool.h" #include "imgterrs.h" #include "osdcomm.h" diff --git a/src/mess/tools/imgtool/library.c b/src/mess/tools/imgtool/library.c index fd15243edfe..b17d837aa02 100644 --- a/src/mess/tools/imgtool/library.c +++ b/src/mess/tools/imgtool/library.c @@ -9,6 +9,7 @@ #include <string.h> +#include "imgtool.h" #include "library.h" #include "pool.h" diff --git a/src/mess/tools/imgtool/library.h b/src/mess/tools/imgtool/library.h index dde2d57ed18..ff9113c748d 100644 --- a/src/mess/tools/imgtool/library.h +++ b/src/mess/tools/imgtool/library.h @@ -16,7 +16,6 @@ #define LIBRARY_H #include <time.h> -#include <assert.h> #include "corestr.h" #include "opresolv.h" diff --git a/src/mess/tools/imgtool/modules.c b/src/mess/tools/imgtool/modules.c index 192a0176528..eec6c564025 100644 --- a/src/mess/tools/imgtool/modules.c +++ b/src/mess/tools/imgtool/modules.c @@ -6,6 +6,7 @@ ***************************************************************************/ +#include "imgtool.h" #include "modules.h" #ifndef MODULES_RECURSIVE diff --git a/src/osd/modules/debugger/debugwin.c b/src/osd/modules/debugger/debugwin.c index 1ae50bc3c8d..73bcd59c6e3 100644 --- a/src/osd/modules/debugger/debugwin.c +++ b/src/osd/modules/debugger/debugwin.c @@ -154,7 +154,7 @@ void debugger_windows::wait_for_debugger(device_t &device, bool firststop) void debugger_windows::debugger_update() { // if we're running live, do some checks - if (!winwindow_has_focus() && !debug_cpu_is_stopped(*m_machine) && (m_machine->phase() == MACHINE_PHASE_RUNNING)) + if (!winwindow_has_focus() && m_machine && !debug_cpu_is_stopped(*m_machine) && (m_machine->phase() == MACHINE_PHASE_RUNNING)) { // see if the interrupt key is pressed and break if it is if (seq_pressed()) diff --git a/src/osd/modules/font/font_windows.c b/src/osd/modules/font/font_windows.c index 458534f3a74..88606bde6e1 100644 --- a/src/osd/modules/font/font_windows.c +++ b/src/osd/modules/font/font_windows.c @@ -169,90 +169,95 @@ bool osd_font_windows::get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, INT // create a DIB to render to BYTE *bits; HBITMAP dib = CreateDIBSection(dummyDC, &info, DIB_RGB_COLORS, reinterpret_cast<VOID **>(&bits), NULL, 0); - HGDIOBJ oldbitmap = SelectObject(dummyDC, dib); - // clear the bitmap - int rowbytes = bmwidth / 8; - memset(bits, 0, rowbytes * bmheight); + if (dib) + { + HGDIOBJ oldbitmap = SelectObject(dummyDC, dib); - // now draw the character - WCHAR tempchar = chnum; - SetTextColor(dummyDC, RGB(0xff, 0xff, 0xff)); - SetBkColor(dummyDC, RGB(0x00, 0x00, 0x00)); - ExtTextOutW(dummyDC, 50 + abc.abcA, 50, ETO_OPAQUE, NULL, &tempchar, 1, NULL); + // clear the bitmap + int rowbytes = bmwidth / 8; + memset(bits, 0, rowbytes * bmheight); - // characters are expected to be full-height - rectangle actbounds; - actbounds.min_y = 50; - actbounds.max_y = 50 + metrics.tmHeight - 1; + // now draw the character + WCHAR tempchar = chnum; + SetTextColor(dummyDC, RGB(0xff, 0xff, 0xff)); + SetBkColor(dummyDC, RGB(0x00, 0x00, 0x00)); + ExtTextOutW(dummyDC, 50 + abc.abcA, 50, ETO_OPAQUE, NULL, &tempchar, 1, NULL); - // determine the actual left of the character - for (actbounds.min_x = 0; actbounds.min_x < rowbytes; actbounds.min_x++) - { - BYTE *offs = bits + actbounds.min_x; - UINT8 summary = 0; - for (int y = 0; y < bmheight; y++) - summary |= offs[y * rowbytes]; - if (summary != 0) + // characters are expected to be full-height + rectangle actbounds; + actbounds.min_y = 50; + actbounds.max_y = 50 + metrics.tmHeight - 1; + + // determine the actual left of the character + for (actbounds.min_x = 0; actbounds.min_x < rowbytes; actbounds.min_x++) { - actbounds.min_x *= 8; - if (!(summary & 0x80)) actbounds.min_x++; - if (!(summary & 0xc0)) actbounds.min_x++; - if (!(summary & 0xe0)) actbounds.min_x++; - if (!(summary & 0xf0)) actbounds.min_x++; - if (!(summary & 0xf8)) actbounds.min_x++; - if (!(summary & 0xfc)) actbounds.min_x++; - if (!(summary & 0xfe)) actbounds.min_x++; - break; + BYTE *offs = bits + actbounds.min_x; + UINT8 summary = 0; + for (int y = 0; y < bmheight; y++) + summary |= offs[y * rowbytes]; + if (summary != 0) + { + actbounds.min_x *= 8; + if (!(summary & 0x80)) actbounds.min_x++; + if (!(summary & 0xc0)) actbounds.min_x++; + if (!(summary & 0xe0)) actbounds.min_x++; + if (!(summary & 0xf0)) actbounds.min_x++; + if (!(summary & 0xf8)) actbounds.min_x++; + if (!(summary & 0xfc)) actbounds.min_x++; + if (!(summary & 0xfe)) actbounds.min_x++; + break; + } } - } - // determine the actual right of the character - for (actbounds.max_x = rowbytes - 1; actbounds.max_x >= 0; actbounds.max_x--) - { - BYTE *offs = bits + actbounds.max_x; - UINT8 summary = 0; - for (int y = 0; y < bmheight; y++) - summary |= offs[y * rowbytes]; - if (summary != 0) + // determine the actual right of the character + for (actbounds.max_x = rowbytes - 1; actbounds.max_x >= 0; actbounds.max_x--) { - actbounds.max_x *= 8; - if (summary & 0x7f) actbounds.max_x++; - if (summary & 0x3f) actbounds.max_x++; - if (summary & 0x1f) actbounds.max_x++; - if (summary & 0x0f) actbounds.max_x++; - if (summary & 0x07) actbounds.max_x++; - if (summary & 0x03) actbounds.max_x++; - if (summary & 0x01) actbounds.max_x++; - break; + BYTE *offs = bits + actbounds.max_x; + UINT8 summary = 0; + for (int y = 0; y < bmheight; y++) + summary |= offs[y * rowbytes]; + if (summary != 0) + { + actbounds.max_x *= 8; + if (summary & 0x7f) actbounds.max_x++; + if (summary & 0x3f) actbounds.max_x++; + if (summary & 0x1f) actbounds.max_x++; + if (summary & 0x0f) actbounds.max_x++; + if (summary & 0x07) actbounds.max_x++; + if (summary & 0x03) actbounds.max_x++; + if (summary & 0x01) actbounds.max_x++; + break; + } } - } - // allocate a new bitmap - if (actbounds.max_x >= actbounds.min_x && actbounds.max_y >= actbounds.min_y) - { - bitmap.allocate(actbounds.max_x + 1 - actbounds.min_x, actbounds.max_y + 1 - actbounds.min_y); - - // copy the bits into it - for (int y = 0; y < bitmap.height(); y++) + // allocate a new bitmap + if (actbounds.max_x >= actbounds.min_x && actbounds.max_y >= actbounds.min_y) { - UINT32 *dstrow = &bitmap.pix32(y); - UINT8 *srcrow = &bits[(y + actbounds.min_y) * rowbytes]; - for (int x = 0; x < bitmap.width(); x++) + bitmap.allocate(actbounds.max_x + 1 - actbounds.min_x, actbounds.max_y + 1 - actbounds.min_y); + + // copy the bits into it + for (int y = 0; y < bitmap.height(); y++) { - int effx = x + actbounds.min_x; - dstrow[x] = ((srcrow[effx / 8] << (effx % 8)) & 0x80) ? rgb_t(0xff, 0xff, 0xff, 0xff) : rgb_t(0x00, 0xff, 0xff, 0xff); + UINT32 *dstrow = &bitmap.pix32(y); + UINT8 *srcrow = &bits[(y + actbounds.min_y) * rowbytes]; + for (int x = 0; x < bitmap.width(); x++) + { + int effx = x + actbounds.min_x; + dstrow[x] = ((srcrow[effx / 8] << (effx % 8)) & 0x80) ? rgb_t(0xff, 0xff, 0xff, 0xff) : rgb_t(0x00, 0xff, 0xff, 0xff); + } } + + // set the final offset values + xoffs = actbounds.min_x - (50 + abc.abcA); + yoffs = actbounds.max_y - (50 + metrics.tmAscent); } - // set the final offset values - xoffs = actbounds.min_x - (50 + abc.abcA); - yoffs = actbounds.max_y - (50 + metrics.tmAscent); + // de-select the font and release the DC + SelectObject(dummyDC, oldbitmap); + DeleteObject(dib); } - // de-select the font and release the DC - SelectObject(dummyDC, oldbitmap); - DeleteObject(dib); SelectObject(dummyDC, oldfont); DeleteDC(dummyDC); return bitmap.valid(); diff --git a/src/osd/modules/lib/osdobj_common.c b/src/osd/modules/lib/osdobj_common.c index 222a7d0aca6..f9ce3321cbf 100644 --- a/src/osd/modules/lib/osdobj_common.c +++ b/src/osd/modules/lib/osdobj_common.c @@ -179,7 +179,9 @@ void osd_common_t::register_options() REGISTER_MODULE(m_mod_man, NETDEV_PCAP); REGISTER_MODULE(m_mod_man, NETDEV_NONE); +#ifndef NO_USE_MIDI REGISTER_MODULE(m_mod_man, MIDI_PM); +#endif REGISTER_MODULE(m_mod_man, MIDI_NONE); // after initialization we know which modules are supported diff --git a/src/osd/sdl/man/castool.1 b/src/osd/sdl/man/castool.1 index 09c56270c1b..56ef844e08f 100644 --- a/src/osd/sdl/man/castool.1 +++ b/src/osd/sdl/man/castool.1 @@ -6,7 +6,7 @@ .\" Cesare Falco <c.falco@ubuntu.com>, February 2011 .\" .\" -.TH CASTOOL 1 2015-01-18 0.158 "MESS Generic cassette manipulation tool" +.TH CASTOOL 1 2015-03-23 0.160 "MESS Generic cassette manipulation tool" .\" .\" .\" NAME chapter diff --git a/src/osd/sdl/man/chdman.1 b/src/osd/sdl/man/chdman.1 index d95e6e2ba24..dfa9440428d 100644 --- a/src/osd/sdl/man/chdman.1 +++ b/src/osd/sdl/man/chdman.1 @@ -6,7 +6,7 @@ .\" Ashley T. Howes <debiandev@ashleyhowes.com>, February 2005 .\" updated by Cesare Falco <c.falco@ubuntu.com>, February 2007 .\" -.TH CHDMAN 1 2015-01-18 0.158 "MAME Compressed Hunks of Data (CHD) manager" +.TH CHDMAN 1 2015-03-23 0.160 "MAME Compressed Hunks of Data (CHD) manager" .\" .\" NAME chapter .SH NAME diff --git a/src/osd/sdl/man/floptool.1 b/src/osd/sdl/man/floptool.1 index c3cb1b0fbef..338bf9b6b3b 100644 --- a/src/osd/sdl/man/floptool.1 +++ b/src/osd/sdl/man/floptool.1 @@ -6,7 +6,7 @@ .\" Cesare Falco <c.falco@ubuntu.com>, April 2014 .\" .\" -.TH FLOPTOOL 1 2015-01-18 0.158 "MESS Generic floppy manipulation tool" +.TH FLOPTOOL 1 2015-03-23 0.160 "MESS Generic floppy manipulation tool" .\" .\" .\" NAME chapter diff --git a/src/osd/sdl/man/imgtool.1 b/src/osd/sdl/man/imgtool.1 index 03be2b86515..392a767c166 100644 --- a/src/osd/sdl/man/imgtool.1 +++ b/src/osd/sdl/man/imgtool.1 @@ -6,7 +6,7 @@ .\" Cesare Falco <c.falco@ubuntu.com>, February 2011 .\" .\" -.TH IMGTOOL 1 2015-01-18 0.158 "MESS media image manipulation tool" +.TH IMGTOOL 1 2015-03-23 0.160 "MESS media image manipulation tool" .\" .\" .\" NAME chapter diff --git a/src/osd/sdl/man/jedutil.1 b/src/osd/sdl/man/jedutil.1 index 84ec4fc2efb..f85a5a3d620 100644 --- a/src/osd/sdl/man/jedutil.1 +++ b/src/osd/sdl/man/jedutil.1 @@ -8,7 +8,7 @@ .\" References .\" http://aarongiles.com/?p=159 .\" -.TH JEDUTIL 1 2015-01-18 0.158 "MAME JEDEC file utilities" +.TH JEDUTIL 1 2015-03-23 0.160 "MAME JEDEC file utilities" .\" .\" NAME chapter .SH NAME diff --git a/src/osd/sdl/man/ldresample.1 b/src/osd/sdl/man/ldresample.1 index d84f8c1d529..cf719c41ac9 100644 --- a/src/osd/sdl/man/ldresample.1 +++ b/src/osd/sdl/man/ldresample.1 @@ -3,7 +3,7 @@ .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .\" -.TH LDRESAMPLE 1 2015-01-18 0.158 "MAME laserdisc audio manipulation tool" +.TH LDRESAMPLE 1 2015-03-23 0.160 "MAME laserdisc audio manipulation tool" .\" .\" Please adjust this date whenever revising the manpage. .\" diff --git a/src/osd/sdl/man/ldverify.1 b/src/osd/sdl/man/ldverify.1 index 7dc1162d7ae..83b43efe118 100644 --- a/src/osd/sdl/man/ldverify.1 +++ b/src/osd/sdl/man/ldverify.1 @@ -5,7 +5,7 @@ .\" Man page created from source and usage information by .\" Cesare Falco <c.falco@ubuntu.com>, August 2008 .\" -.TH LDVERIFY 1 2015-01-18 0.158 "MAME laserdisc data checker" +.TH LDVERIFY 1 2015-03-23 0.160 "MAME laserdisc data checker" .\" .\" NAME chapter .SH NAME diff --git a/src/osd/sdl/man/mame.6 b/src/osd/sdl/man/mame.6 index b378266a421..20862922792 100644 --- a/src/osd/sdl/man/mame.6 +++ b/src/osd/sdl/man/mame.6 @@ -13,7 +13,7 @@ .\" and updated by Andrew Burton <burtona@gol.com>, July 2003 .\" .\" -.TH MAME 6 2015-01-18 0.158 "MAME \- The Multiple Arcade Machine Emulator" +.TH MAME 6 2015-03-23 0.160 "MAME \- The Multiple Arcade Machine Emulator" .\" .\" .\" NAME chapter @@ -448,6 +448,9 @@ The intention is that this PNG can be loaded via an artwork file with a low alpha (e.g, 0.1\-0.2 seems to work well) and blended over the entire screen. The PNG files are saved in the snap directory under the gamename\\burnin\-<screen.name>.png. The default is OFF (\-noburnin). +.TP +.B \-[no]dummywrite +Indicates whether a snapshot should be created with each frame. .\" .\" ******************************************************* .SS Performance options @@ -646,7 +649,7 @@ needs adjustment. This option requires a float argument in the range of .\" SDL specific .\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ .TP -.B \-video\fR [\fIsoft\fR|\fIopengl\fR|\fIopengl16\fR|\fInone\fR] +.B \-video\fR [\fIsoft\fR|\fIopengl\fR|\fInone\fR] Specifies which video subsystem to use for drawing: .br \fBsoft\fR uses software rendering, which is slower but more compatible. @@ -654,8 +657,6 @@ Specifies which video subsystem to use for drawing: \fBopengl\fR uses OpenGL and your graphics accelerator to speed up many aspects of drawing MAME including compositing artwork, overlays, and bezels, as well as stretching the image to fit your screen. -.br -\fBopengl16\fR uses alternate OpenGL code, which should provide faster output on some cards. .br \fBnone\fR does no drawing and is intended for CPU benchmarking. diff --git a/src/osd/sdl/man/mess.6 b/src/osd/sdl/man/mess.6 index 999494192df..d3fb2875db4 100644 --- a/src/osd/sdl/man/mess.6 +++ b/src/osd/sdl/man/mess.6 @@ -16,7 +16,7 @@ .\" http://www.mess.org/ .\" .\" -.TH MESS 6 2015-01-18 0.158 "The Multiple Emulator Super System (MESS)" +.TH MESS 6 2015-03-23 0.160 "The Multiple Emulator Super System (MESS)" .\" .\" .\" NAME chapter @@ -463,6 +463,9 @@ The intention is that this PNG can be loaded via an artwork file with a low alpha (e.g, 0.1\-0.2 seems to work well) and blended over the entire screen. The PNG files are saved in the snap directory under the system/burnin\-<screen.name>.png. The default is OFF (\-noburnin). +.TP +.B \-[no]dummywrite +Indicates whether a snapshot should be created with each frame. .\" .\" ******************************************************* .SS Performance options @@ -661,7 +664,7 @@ needs adjustment. This option requires a float argument in the range of .\" SDL specific .\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ .TP -.B \-video\fR [\fIsoft\fR|\fIopengl\fR|\fIopengl16\fR|\fInone\fR] +.B \-video\fR [\fIsoft\fR|\fIopengl\fR|\fInone\fR] Specifies which video subsystem to use for drawing: .br \fBsoft\fR uses software rendering, which is slower but more compatible. @@ -670,9 +673,6 @@ Specifies which video subsystem to use for drawing: aspects of drawing MESS including compositing artwork, overlays, and bezels, as well as stretching the image to fit your screen. .br -\fBopengl16\fR uses alternate OpenGL code, which should provide faster -output on some cards. -.br \fBnone\fR does no drawing and is intended for CPU benchmarking. .br Default is SOFT. diff --git a/src/osd/sdl/man/romcmp.1 b/src/osd/sdl/man/romcmp.1 index 766dac20a41..a52c2a1b472 100644 --- a/src/osd/sdl/man/romcmp.1 +++ b/src/osd/sdl/man/romcmp.1 @@ -9,7 +9,7 @@ .\" References .\" http://www.mame.net/mamefaq.html .\" -.TH ROMCMP 1 2015-01-18 0.158 "MAME romset checking tool" +.TH ROMCMP 1 2015-03-23 0.160 "MAME romset checking tool" .\" .\" NAME chapter .SH NAME diff --git a/src/osd/sdl/man/testkeys.1 b/src/osd/sdl/man/testkeys.1 index d253f3cbb2b..4ef207a35b6 100644 --- a/src/osd/sdl/man/testkeys.1 +++ b/src/osd/sdl/man/testkeys.1 @@ -5,7 +5,7 @@ .\" Man page created from source and usage information .\" Cesare Falco <c.falco@ubuntu.com>, February 2007 .\" -.TH TESTKEYS 1 2015-01-18 0.158 "MAME SDL keycode scanner" +.TH TESTKEYS 1 2015-03-23 0.160 "MAME SDL keycode scanner" .\" .\" NAME chapter .SH NAME diff --git a/src/osd/windows/windows.mak b/src/osd/windows/windows.mak index 197577e21e7..53d8be9518a 100644 --- a/src/osd/windows/windows.mak +++ b/src/osd/windows/windows.mak @@ -237,11 +237,9 @@ endif # explicitly set the entry point for UNICODE builds LDFLAGS += /ENTRY:wmainCRTStartup -ifdef MSVC_BUILD ifdef DEBUG LDFLAGS += /NODEFAULTLIB:LIBCMT endif -endif # add some VC++-specific defines DEFS += -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DXML_STATIC -DWIN32 @@ -254,7 +252,7 @@ msvcclean: $(RM) *.lib $(RM) *.exp -endif +endif # MSVC_BUILD #------------------------------------------------- diff --git a/src/osd/windows/winprefix.h b/src/osd/windows/winprefix.h index 53f03e46a1f..e506403e7b5 100644 --- a/src/osd/windows/winprefix.h +++ b/src/osd/windows/winprefix.h @@ -11,7 +11,6 @@ #endif #ifdef _MSC_VER -#include <assert.h> #include <malloc.h> #if _MSC_VER < 1900 // < VS2015 #define snprintf _snprintf diff --git a/src/tools/chdman.c b/src/tools/chdman.c index 9384566eb54..87e22bd2dbf 100644 --- a/src/tools/chdman.c +++ b/src/tools/chdman.c @@ -6,6 +6,8 @@ ****************************************************************************/ +#include <assert.h> + #include "osdcore.h" #include "corefile.h" #include "chdcd.h" diff --git a/src/tools/ldresample.c b/src/tools/ldresample.c index e027f88ec9a..7851814e0aa 100644 --- a/src/tools/ldresample.c +++ b/src/tools/ldresample.c @@ -13,6 +13,7 @@ #include <stdlib.h> #include <math.h> #include <new> +#include <assert.h> #include "bitmap.h" #include "chd.h" #include "avhuff.h" diff --git a/src/tools/ldverify.c b/src/tools/ldverify.c index b57f987e145..2d8ff1365d2 100644 --- a/src/tools/ldverify.c +++ b/src/tools/ldverify.c @@ -12,6 +12,7 @@ #include <stdlib.h> #include <ctype.h> #include <new> +#include <assert.h> #include "coretmpl.h" #include "aviio.h" #include "avhuff.h" diff --git a/src/tools/nltool.c b/src/tools/nltool.c index 22d4cf6bd8d..92b4960be4d 100644 --- a/src/tools/nltool.c +++ b/src/tools/nltool.c @@ -11,6 +11,7 @@ #include <string.h> #include <ctype.h> #include <sstream> +#include <assert.h> #include "astring.h" #include "corefile.h" #include "corestr.h" diff --git a/src/tools/pngcmp.c b/src/tools/pngcmp.c index f5f1da4a2c5..31753a49be1 100644 --- a/src/tools/pngcmp.c +++ b/src/tools/pngcmp.c @@ -12,6 +12,7 @@ #include <stdlib.h> #include <string.h> #include <ctype.h> +#include <assert.h> #include "osdcore.h" #include "png.h" diff --git a/src/tools/regrep.c b/src/tools/regrep.c index 114d5fa467b..c720ee1354e 100644 --- a/src/tools/regrep.c +++ b/src/tools/regrep.c @@ -11,6 +11,7 @@ #include <string.h> #include <ctype.h> #include <new> +#include <assert.h> #include "osdcore.h" #include "png.h" diff --git a/src/tools/split.c b/src/tools/split.c index 2144f11b9c2..02e546fce14 100644 --- a/src/tools/split.c +++ b/src/tools/split.c @@ -12,6 +12,7 @@ #include <stdlib.h> #include <string.h> #include <ctype.h> +#include <assert.h> #include "astring.h" #include "corefile.h" #include "corestr.h" diff --git a/src/tools/src2html.c b/src/tools/src2html.c index dbbc3512c9e..5ebe31ee71f 100644 --- a/src/tools/src2html.c +++ b/src/tools/src2html.c @@ -19,6 +19,7 @@ #include <stdlib.h> #include <string.h> #include <ctype.h> +#include <assert.h> #include "osdcore.h" #include "astring.h" #include "corefile.h" diff --git a/src/tools/tools.mak b/src/tools/tools.mak index 85a8fecc114..ada7c290a49 100644 --- a/src/tools/tools.mak +++ b/src/tools/tools.mak @@ -217,7 +217,8 @@ NLTOOLOBJS = \ $(TOOLSOBJ)/nltool.o \ $(NETLISTOBJS) \ -$(BIN)nltool$(EXE): $(NLTOOLOBJS) $(LIBUTIL) $(LIBOCORE) $(ZLIB) $(EXPAT) +# TODO: Visual Studio wants $(FLAC_LIB) and $(7Z_LIB) during linking... +$(BIN)nltool$(EXE): $(NLTOOLOBJS) $(LIBUTIL) $(LIBOCORE) $(ZLIB) $(EXPAT) $(FLAC_LIB) $(7Z_LIB) @echo Linking $@... $(LD) $(LDFLAGS) $^ $(BASELIBS) -o $@ |