diff --git a/Makefile.common b/Makefile.common index aa2d9ce8..39312673 100644 --- a/Makefile.common +++ b/Makefile.common @@ -172,6 +172,7 @@ CPUS+=TMS9995@ CPUS+=Z8000@ CPUS+=TMS32010@ CPUS+=TMS32025@ +CPUS+=NAMCOC71@ CPUS+=TMS32031@ CPUS+=I960@ CPUS+=MB86233@ @@ -1866,6 +1867,15 @@ else CPUDEFS += -DHAS_TMS32010=0 endif +CPU=$(strip $(findstring NAMCOC71@,$(CPUS))) +ifneq ($(CPU),) +OBJDIRS += $(CORE_DIR)/cpu/namcoc71 +CPUDEFS += -DHAS_NAMCOC71=1 +SOURCES_C += $(CORE_DIR)/cpu/namcoc71/c71.c +else +CPUDEFS += -DHAS_NAMCOC71=0 +endif + CPU=$(strip $(findstring TMS32025@,$(CPUS))) ifneq ($(CPU),) OBJDIRS += $(CORE_DIR)/cpu/tms32025 diff --git a/Makefile.split b/Makefile.split index 8ee24a3f..d8a23a9e 100644 --- a/Makefile.split +++ b/Makefile.split @@ -1821,6 +1821,15 @@ else CPUDEFS += -DHAS_TMS32010=0 endif +CPU=$(strip $(findstring NAMCOC71@,$(CPUS))) +ifneq ($(CPU),) +OBJDIRS += $(CORE_DIR)/cpu/namcoc71 +CPUDEFS += -DHAS_NAMCOC71=1 +SOURCES_C += $(CORE_DIR)/cpu/namcoc71/c71.c +else +CPUDEFS += -DHAS_NAMCOC71=0 +endif + CPU=$(strip $(findstring TMS32025@,$(CPUS))) ifneq ($(CPU),) OBJDIRS += $(CORE_DIR)/cpu/tms32025 diff --git a/src/cpu/m37710/m37710.c b/src/cpu/m37710/m37710.c index ca3092c7..7736c007 100644 --- a/src/cpu/m37710/m37710.c +++ b/src/cpu/m37710/m37710.c @@ -413,6 +413,9 @@ static void m37710_timer_b2_cb(int param) cpuintrf_pop_context(); } +/* timer A output pins (set by the driver just before it clocks the timer, not saved) */ +static int m37710_timer_out[5]; + static void m37710_external_tick(int timer, int state) { /* we only care if the state is "on" */ @@ -426,15 +429,22 @@ static void m37710_external_tick(int timer, int state) { if ((m37710i_cpu.m37710_regs[0x56+timer] & 0x3) == 1) { - if (m37710i_cpu.m37710_regs[0x46+(timer*2)] == 0xff) + /* the count direction, as current MAME: timer B counts down; timer A + follows its output pin (mode bit 4) or the up/down register */ + int upcount = 0; + UINT16 count = m37710i_cpu.m37710_regs[0x46+(timer*2)] | (m37710i_cpu.m37710_regs[0x46+(timer*2)+1] << 8); + + if (timer <= 4) { - m37710i_cpu.m37710_regs[0x46+(timer*2)] = 0; - m37710i_cpu.m37710_regs[0x46+(timer*2)+1]++; - } - else - { - m37710i_cpu.m37710_regs[0x46+(timer*2)]++; + if (m37710i_cpu.m37710_regs[0x56+timer] & 0x10) + upcount = m37710_timer_out[timer]; + else + upcount = (m37710i_cpu.m37710_regs[0x44] >> timer) & 1; } + + count = upcount ? count + 1 : count - 1; + m37710i_cpu.m37710_regs[0x46+(timer*2)] = count & 0xff; + m37710i_cpu.m37710_regs[0x46+(timer*2)+1] = count >> 8; } else { @@ -1086,6 +1096,11 @@ void m37710_set_irq_line(int line, int state) m37710_external_tick(line - M37710_LINE_TIMERA0TICK, state); return; } + if (line >= M37710_LINE_TIMERA0OUT && line <= M37710_LINE_TIMERA4OUT) + { + m37710_timer_out[line - M37710_LINE_TIMERA0OUT] = (state != CLEAR_LINE); + return; + } FTABLE_SET_LINE(line, state); } diff --git a/src/cpu/m37710/m37710.h b/src/cpu/m37710/m37710.h index 24b7f2db..1042c88e 100644 --- a/src/cpu/m37710/m37710.h +++ b/src/cpu/m37710/m37710.h @@ -63,6 +63,13 @@ enum M37710_LINE_TIMERB1TICK, M37710_LINE_TIMERB2TICK, + /* timer A output pins: the count direction of an event counter in up/down pin mode */ + M37710_LINE_TIMERA0OUT, + M37710_LINE_TIMERA1OUT, + M37710_LINE_TIMERA2OUT, + M37710_LINE_TIMERA3OUT, + M37710_LINE_TIMERA4OUT, + M37710_LINE_MAX }; diff --git a/src/cpu/namcoc71/c71.c b/src/cpu/namcoc71/c71.c new file mode 100644 index 00000000..e8e5835e --- /dev/null +++ b/src/cpu/namcoc71/c71.c @@ -0,0 +1,1650 @@ +/*************************************************************************** + + Namco C71 (TMS320C25 with Namco internal ROM) - fast DSP core + + The instructions, flags, repeat mode, interrupts and timer follow the + TMS320C2x core of current MAME (Tony La Porta, Quench and others, + BSD-3-Clause), cycle for cycle. What changes is how it is run: + + - the memory is a table of 256-word pages per space, set up by the + driver: RAM and ROM pages are read and written directly, only the + pages without a pointer go through a handler; + - the internal RAM blocks B0/B1/B2 and the memory mapped registers + live in the core, B0 moves between data and program space with + CNFD/CNFP by swapping two page pointers; + - I/O ports, BIO and the serial port are plain function pointers; + - one switch on the opcode, the operands decoded once. + + The HOLD pin is not wired on System 22 (MAME returns 0 for it), so + the hold logic is left out. + +***************************************************************************/ + +#include +#include +#include "driver.h" +#include "state.h" +#include "c71.h" + +#define CLK 4 /* 1 machine cycle equals 4 clock ticks: the icount is in clocks */ + +/* STR0 */ +#define ARP_REG 0xe000 +#define OV_FLAG 0x1000 +#define OVM_FLAG 0x0800 +#define INTM_FLAG 0x0200 +#define DP_REG 0x01ff +/* STR1 */ +#define ARB_REG 0xe000 +#define CNF0_REG 0x1000 +#define TC_FLAG 0x0800 +#define SXM_FLAG 0x0400 +#define C_FLAG 0x0200 +#define HM_FLAG 0x0040 +#define FSM_FLAG 0x0020 +#define XF_FLAG 0x0010 +#define FO_FLAG 0x0008 +#define TXM_FLAG 0x0004 +#define PM_REG 0x0003 + +#define FIXED_STR1 0x0180 /* TMS320C25 */ +#define STACK_LIMIT 7 /* 8 levels */ + +typedef struct +{ + /* page tables: base pointer of the page, or NULL */ + data16_t *drd[256], *dwr[256]; + data16_t *prd[256], *pwr[256]; + data16_t *prd_cnf0, *pwr_cnf0; /* program page 0xff when CNF0 = 0 */ + c71_read_fn dread; + c71_write_fn dwrite; + c71_read_fn ioread[16]; + c71_write_fn iowrite[16]; + int (*bio)(void); + data16_t (*dr_in)(void); + void (*dx_out)(data16_t); + UINT16 idle_start[4], idle_end[4]; + int idle_slots; + + /* on-chip memory */ + data16_t b0[256]; + data16_t b1[256]; + data16_t b2[32]; + data16_t irom[0x1000]; + int configured; +} c71_bus; + +typedef struct +{ + UINT16 PREVPC; + UINT16 PC; + UINT16 PFC; + UINT16 STR0, STR1; + UINT8 IFR; + UINT8 RPTC; + UINT32 ACC; + UINT32 Preg; + UINT16 Treg; + UINT16 AR[8]; + UINT16 STACK[8]; + UINT32 ALU; + UINT32 oldacc; + UINT16 opcode; + UINT16 drr, dxr, tim, prd, imr, greg; + INT32 timerover; + INT32 memaccess; + INT32 idle; + INT32 init_load_addr; + INT32 external_mem_access; + int (*irq_callback)(int irqline); + c71_bus *bus; +} c71_regs; + +static c71_regs R; +static c71_bus c71_buses[MAX_CPU]; +static int dec_cycles; + +int c71_icount; + +static UINT8 c71_reg_layout[] = { + C71_PC, C71_STR0, C71_STR1, C71_IFR, C71_RPTC, -1, + C71_ACC, C71_PREG, C71_TREG, C71_AR0, C71_AR1, -1, + C71_AR2, C71_AR3, C71_AR4, C71_AR5, C71_AR6, C71_AR7, -1, + C71_STK0, C71_STK1, C71_STK2, C71_STK3, C71_STK4, C71_STK5, C71_STK6, C71_STK7, -1, + C71_DRR, C71_DXR, C71_TIM, C71_PRD, C71_IMR, C71_GREG, 0 +}; + +static UINT8 c71_win_layout[] = { + 0, 0,80, 5, + 0, 6,29,15, + 30, 6,50, 1, + 30, 8,50,13, + 0,22,80, 1, +}; + + +/*************************************************************************** + Configuration (from the driver) +***************************************************************************/ + +static c71_bus *bus_for(int cpunum) +{ + c71_bus *b = &c71_buses[cpunum]; + if (!b->configured) + { + memset(b, 0, sizeof(*b)); + b->configured = 1; + /* internal ROM at 0x0000-0x0fff (microcomputer mode) */ + { + int p; + for (p = 0; p < 0x10; p++) + b->prd[p] = &b->irom[p << 8]; + } + /* B0 in data space, B1 at 0x300 */ + b->drd[2] = b->dwr[2] = b->b0; + b->drd[3] = b->dwr[3] = b->b1; + } + return b; +} + +void c71_set_internal_rom(int cpunum, const data16_t *rom) +{ + c71_bus *b = bus_for(cpunum); + memcpy(b->irom, rom, sizeof(b->irom)); +} + +void c71_map_data(int cpunum, offs_t start, offs_t end, data16_t *base, int writable) +{ + c71_bus *b = bus_for(cpunum); + offs_t p; + for (p = start >> 8; p <= (end >> 8); p++) + { + b->drd[p] = base ? base + ((p << 8) - start) : NULL; + b->dwr[p] = (base && writable) ? base + ((p << 8) - start) : NULL; + } +} + +void c71_map_program(int cpunum, offs_t start, offs_t end, data16_t *base, int writable) +{ + c71_bus *b = bus_for(cpunum); + offs_t p; + for (p = start >> 8; p <= (end >> 8); p++) + { + b->prd[p] = base ? base + ((p << 8) - start) : NULL; + b->pwr[p] = (base && writable) ? base + ((p << 8) - start) : NULL; + } +} + +void c71_set_data_handlers(int cpunum, c71_read_fn rd, c71_write_fn wr) +{ + c71_bus *b = bus_for(cpunum); + b->dread = rd; + b->dwrite = wr; +} + +void c71_set_io(int cpunum, int port, c71_read_fn rd, c71_write_fn wr) +{ + c71_bus *b = bus_for(cpunum); + b->ioread[port & 15] = rd; + b->iowrite[port & 15] = wr; +} + +void c71_set_bio(int cpunum, int (*bio)(void)) +{ + bus_for(cpunum)->bio = bio; +} + +void c71_set_serial(int cpunum, data16_t (*dr_in)(void), void (*dx_out)(data16_t)) +{ + c71_bus *b = bus_for(cpunum); + b->dr_in = dr_in; + b->dx_out = dx_out; +} + +void c71_set_idle_loop(int cpunum, int slot, UINT16 pc_start, UINT16 pc_end) +{ + c71_bus *b = bus_for(cpunum); + if (slot < 0 || slot >= 4) + return; + b->idle_start[slot] = pc_start; + b->idle_end[slot] = pc_end; + if (slot >= b->idle_slots) + b->idle_slots = slot + 1; +} + + +/*************************************************************************** + Memory access +***************************************************************************/ + +/* page 0: memory mapped registers and B2; everything else unmapped */ +static data16_t page0_r(offs_t a) +{ + switch (a) + { + case 0: return R.drr; + case 1: return R.dxr; + case 2: return R.tim; + case 3: return R.prd; + case 4: return R.imr; + case 5: return R.greg; + } + if (a >= 0x60 && a < 0x80) + return R.bus->b2[a - 0x60]; + return 0; +} + +static void page0_w(offs_t a, data16_t d) +{ + switch (a) + { + case 0: R.drr = d; return; + case 1: R.dxr = d; return; + case 2: R.tim = d; return; + case 3: R.prd = d; return; + case 4: R.imr = d; return; + case 5: R.greg = d; return; + } + if (a >= 0x60 && a < 0x80) + R.bus->b2[a - 0x60] = d; +} + +static data16_t dread_slow(offs_t a) +{ + if (a < 0x100) + return page0_r(a); + if (R.bus->dread) + return R.bus->dread(a); + return 0; +} + +static void dwrite_slow(offs_t a, data16_t d) +{ + if (a < 0x100) + page0_w(a, d); + else if (R.bus->dwrite) + R.bus->dwrite(a, d); +} + +#define DREAD(a) c71_dread((a) & 0xffff) +#define DWRITE(a,d) c71_dwrite((a) & 0xffff, (d)) + +static INLINE data16_t c71_dread(offs_t a) +{ + const data16_t *p = R.bus->drd[a >> 8]; + if (p) + return p[a & 0xff]; + return dread_slow(a); +} + +static INLINE void c71_dwrite(offs_t a, data16_t d) +{ + data16_t *p = R.bus->dwr[a >> 8]; + if (p) + p[a & 0xff] = d; + else + dwrite_slow(a, d); +} + +static INLINE data16_t PREAD(offs_t a) +{ + const data16_t *p; + a &= 0xffff; + p = R.bus->prd[a >> 8]; + return p ? p[a & 0xff] : 0; +} + +static INLINE void PWRITE(offs_t a, data16_t d) +{ + data16_t *p; + a &= 0xffff; + p = R.bus->pwr[a >> 8]; + if (p) + p[a & 0xff] = d; +} + +static INLINE data16_t IOREAD(int port) +{ + c71_read_fn f = R.bus->ioread[port]; + return f ? f(port) : 0; +} + +static INLINE void IOWRITE(int port, data16_t d) +{ + c71_write_fn f = R.bus->iowrite[port]; + if (f) + f(port, d); +} + + +/*************************************************************************** + Flags and helpers (as MAME tms320c2x.cpp) +***************************************************************************/ + +#define OP_L (R.opcode & 0xff) +#define OP_H (R.opcode >> 8) + +#define OV (R.STR0 & OV_FLAG) +#define OVM (R.STR0 & OVM_FLAG) +#define INTM (R.STR0 & INTM_FLAG) +#define ARP ((R.STR0 & ARP_REG) >> 13) +#define DP ((R.STR0 & DP_REG) << 7) +#define CNF0 (R.STR1 & CNF0_REG) +#define TC (R.STR1 & TC_FLAG) +#define SXM (R.STR1 & SXM_FLAG) +#define CARRY (R.STR1 & C_FLAG) +#define HM (R.STR1 & HM_FLAG) +#define PM (R.STR1 & PM_REG) + +#define DMA (DP | (OP_L & 0x7f)) +#define DMApg0 (OP_L & 0x7f) +#define IND R.AR[ARP] + +#define CLR0(flag) (R.STR0 = (R.STR0 & ~(flag)) | 0x0400) +#define SET0(flag) (R.STR0 |= (flag) | 0x0400) +#define CLR1(flag) (R.STR1 = (R.STR1 & ~(flag)) | FIXED_STR1) +#define SET1(flag) (R.STR1 |= (flag) | FIXED_STR1) + +#define ACC_H ((UINT16)(R.ACC >> 16)) +#define ACC_L ((UINT16)R.ACC) +#define SET_ACC_H(v) (R.ACC = (R.ACC & 0x0000ffff) | ((UINT32)(UINT16)(v) << 16)) +#define SET_ACC_L(v) (R.ACC = (R.ACC & 0xffff0000) | (UINT16)(v)) +#define ALU_L ((UINT16)R.ALU) +#define ALU_H ((UINT16)(R.ALU >> 16)) +#define OLD_H ((UINT16)(R.oldacc >> 16)) + +static INLINE void MODIFY_DP(int data) +{ + R.STR0 = (R.STR0 & ~DP_REG) | (data & DP_REG) | 0x0400; +} + +static INLINE void MODIFY_PM(int data) +{ + R.STR1 = (R.STR1 & ~PM_REG) | (data & PM_REG) | FIXED_STR1; +} + +static INLINE void MODIFY_ARP(int data) +{ + R.STR1 = (R.STR1 & ~ARB_REG) | (R.STR0 & ARP_REG) | FIXED_STR1; + R.STR0 = (R.STR0 & ~ARP_REG) | ((data << 13) & ARP_REG) | 0x0400; +} + +static UINT16 reverse_carry_add(UINT16 arg0, UINT16 arg1) +{ + UINT16 result = 0; + int carry = 0; + int count; + for (count = 0; count < 16; count++) + { + int sum = (arg0 >> 15) + (arg1 >> 15) + carry; + result = (result << 1) | (sum & 1); + carry = sum >> 1; + arg0 <<= 1; + arg1 <<= 1; + } + return result; +} + +static INLINE void MODIFY_AR_ARP_NOLOAD(void) +{ + UINT16 *ar = &R.AR[ARP]; + switch (OP_L & 0x70) + { + case 0x00: break; + case 0x10: (*ar)--; break; + case 0x20: (*ar)++; break; + case 0x30: break; + case 0x40: *ar = reverse_carry_add(*ar, (UINT16)(-R.AR[0])); break; + case 0x50: *ar -= R.AR[0]; break; + case 0x60: *ar += R.AR[0]; break; + case 0x70: *ar += reverse_carry_add(*ar, R.AR[0]); break; + } +} + +static INLINE void MODIFY_AR_ARP(void) +{ + MODIFY_AR_ARP_NOLOAD(); + if (OP_L & 8) + MODIFY_ARP(OP_L & 7); +} + +#define CALCULATE_ADD_CARRY() \ + do { if (R.oldacc > R.ACC) SET1(C_FLAG); else CLR1(C_FLAG); } while (0) + +#define CALCULATE_SUB_CARRY() \ + do { if (R.oldacc < R.ACC) CLR1(C_FLAG); else SET1(C_FLAG); } while (0) + +static INLINE void CALCULATE_ADD_OVERFLOW(INT32 addval) +{ + if ((INT32)((R.ACC ^ addval) & (R.oldacc ^ R.ACC)) < 0) + { + SET0(OV_FLAG); + if (OVM) + R.ACC = ((INT32)R.oldacc < 0) ? 0x80000000 : 0x7fffffff; + } +} + +static INLINE void CALCULATE_SUB_OVERFLOW(INT32 subval) +{ + if ((INT32)((R.oldacc ^ subval) & (R.oldacc ^ R.ACC)) < 0) + { + SET0(OV_FLAG); + if (OVM) + R.ACC = ((INT32)R.oldacc < 0) ? 0x80000000 : 0x7fffffff; + } +} + +static INLINE UINT16 POP_STACK(void) +{ + UINT16 data = R.STACK[STACK_LIMIT]; + int i; + for (i = STACK_LIMIT; i > 0; i--) + R.STACK[i] = R.STACK[i - 1]; + return data; +} + +static INLINE void PUSH_STACK(UINT16 data) +{ + int i; + for (i = 0; i < STACK_LIMIT; i++) + R.STACK[i] = R.STACK[i + 1]; + R.STACK[STACK_LIMIT] = data; +} + +static INLINE void SHIFT_Preg_TO_ALU(void) +{ + switch (PM) + { + case 0: R.ALU = R.Preg; break; + case 1: R.ALU = R.Preg << 1; break; + case 2: R.ALU = R.Preg << 4; break; + case 3: R.ALU = R.Preg >> 6; if (R.Preg & 0x80000000) R.ALU |= 0xfc000000; break; + } +} + +static INLINE void GETDATA(int shift, int signext) +{ + if (OP_L & 0x80) + R.memaccess = IND; + else + R.memaccess = DMA; + R.external_mem_access = (R.memaccess >= 0x800); + + R.ALU = DREAD(R.memaccess); + if (signext) + R.ALU = (UINT32)(INT32)(INT16)R.ALU; + R.ALU <<= shift; + + if (OP_L & 0x80) + MODIFY_AR_ARP(); +} + +/* LST/LST1: the ARP is not loaded by the indirect field */ +static INLINE void GETDATA_NOARP(void) +{ + if (OP_L & 0x80) + R.memaccess = IND; + else + R.memaccess = DMA; + R.external_mem_access = (R.memaccess >= 0x800); + + R.ALU = DREAD(R.memaccess); + + if (OP_L & 0x80) + MODIFY_AR_ARP_NOLOAD(); +} + +static INLINE void PUTDATA(UINT16 data) +{ + R.external_mem_access = (R.memaccess >= 0x800); + if (OP_L & 0x80) + { + DWRITE(IND, data); + MODIFY_AR_ARP(); + } + else + DWRITE(DMA, data); +} + +static INLINE void PUTDATA_SST(UINT16 data) +{ + if (OP_L & 0x80) + R.memaccess = IND; + else + R.memaccess = DMApg0; + R.external_mem_access = (R.memaccess >= 0x800); + + if (OP_L & 0x80) + { + R.opcode &= 0xfff7; /* stop ARP changes */ + MODIFY_AR_ARP(); + } + DWRITE(R.memaccess, data); +} + +/* CNFD / CNFP: B0 moves between data 0x200-0x2ff and program 0xff00-0xffff */ +static void set_cnf0(int on) +{ + c71_bus *b = R.bus; + if (on) + { + b->prd[0xff] = b->pwr[0xff] = b->b0; + b->drd[2] = b->dwr[2] = NULL; + } + else + { + b->prd[0xff] = b->pwr[0xff] = NULL; + b->drd[2] = b->dwr[2] = b->b0; + } +} + + +/*************************************************************************** + Instructions +***************************************************************************/ + +#define BRANCH_IF(cond) \ + do { if (cond) R.PC = PREAD(R.PC); else R.PC++; MODIFY_AR_ARP(); } while (0) + +static void op_ce(void) +{ + switch (OP_L) + { + case 0x00: CLR0(INTM_FLAG); break; /* EINT */ + case 0x01: SET0(INTM_FLAG); break; /* DINT */ + case 0x02: CLR0(OVM_FLAG); break; /* ROVM */ + case 0x03: SET0(OVM_FLAG); break; /* SOVM */ + case 0x04: /* CNFD */ + if (R.STR1 & CNF0_REG) { set_cnf0(0); CLR1(CNF0_REG); } + break; + case 0x05: /* CNFP */ + if (!(R.STR1 & CNF0_REG)) { set_cnf0(1); SET1(CNF0_REG); } + break; + case 0x06: CLR1(SXM_FLAG); break; /* RSXM */ + case 0x07: SET1(SXM_FLAG); break; /* SSXM */ + case 0x08: case 0x09: case 0x0a: case 0x0b: /* SPM */ + MODIFY_PM(OP_L & 3); + break; + case 0x0c: CLR1(XF_FLAG); break; /* RXF (XF pin not wired) */ + case 0x0d: SET1(XF_FLAG); break; /* SXF */ + case 0x0e: case 0x0f: /* FORT */ + if (OP_L & 1) SET1(FO_FLAG); else CLR1(FO_FLAG); + break; + case 0x14: SHIFT_Preg_TO_ALU(); R.ACC = R.ALU; break; /* PAC */ + case 0x15: /* APAC */ + R.oldacc = R.ACC; + SHIFT_Preg_TO_ALU(); + R.ACC += R.ALU; + CALCULATE_ADD_OVERFLOW(R.ALU); + CALCULATE_ADD_CARRY(); + break; + case 0x16: /* SPAC */ + R.oldacc = R.ACC; + SHIFT_Preg_TO_ALU(); + R.ACC -= R.ALU; + CALCULATE_SUB_OVERFLOW(R.ALU); + CALCULATE_SUB_CARRY(); + break; + case 0x18: /* SFL */ + R.ALU = R.ACC; + R.ACC <<= 1; + if (R.ALU & 0x80000000) SET1(C_FLAG); else CLR1(C_FLAG); + break; + case 0x19: /* SFR */ + R.ALU = R.ACC; + R.ACC >>= 1; + if (SXM && (R.ALU & 0x80000000)) R.ACC |= 0x80000000; + if (R.ALU & 1) SET1(C_FLAG); else CLR1(C_FLAG); + break; + case 0x1b: /* ABS */ + if ((INT32)R.ACC < 0) + { + R.ACC = -R.ACC; + if (R.ACC == 0x80000000) + { + SET0(OV_FLAG); + if (OVM) R.ACC--; + } + } + CLR1(C_FLAG); + break; + case 0x1c: PUSH_STACK(ACC_L); break; /* PUSH */ + case 0x1d: R.ACC = POP_STACK(); break; /* POP */ + case 0x1e: PUSH_STACK(R.PC); R.PC = 0x001e; break; /* TRAP */ + case 0x1f: CLR0(INTM_FLAG); R.idle = 1; break; /* IDLE */ + case 0x20: CLR1(TXM_FLAG); break; /* RTXM */ + case 0x21: SET1(TXM_FLAG); break; /* STXM */ + case 0x23: /* NEG */ + if (R.ACC == 0x80000000) + { + SET0(OV_FLAG); + if (OVM) R.ACC = 0x7fffffff; + } + else R.ACC = -R.ACC; + if (R.ACC) CLR1(C_FLAG); else SET1(C_FLAG); + break; + case 0x24: PUSH_STACK(R.PC); R.PC = ACC_L; break; /* CALA */ + case 0x25: R.PC = ACC_L; break; /* BACC */ + case 0x26: R.PC = POP_STACK(); break; /* RET */ + case 0x27: R.ACC = ~R.ACC; break; /* CMPL */ + case 0x30: CLR1(C_FLAG); break; /* RC */ + case 0x31: SET1(C_FLAG); break; /* SC */ + case 0x32: CLR1(TC_FLAG); break; /* RTC */ + case 0x33: SET1(TC_FLAG); break; /* STC */ + case 0x34: /* ROL */ + R.ALU = R.ACC; + R.ACC <<= 1; + if (CARRY) R.ACC |= 1; + if (R.ALU & 0x80000000) SET1(C_FLAG); else CLR1(C_FLAG); + break; + case 0x35: /* ROR */ + R.ALU = R.ACC; + R.ACC >>= 1; + if (CARRY) R.ACC |= 0x80000000; + if (R.ALU & 1) SET1(C_FLAG); else CLR1(C_FLAG); + break; + case 0x36: CLR1(FSM_FLAG); break; /* RFSM */ + case 0x37: SET1(FSM_FLAG); break; /* SFSM */ + case 0x38: CLR1(HM_FLAG); break; /* RHM */ + case 0x39: SET1(HM_FLAG); break; /* SHM */ + case 0x3c: case 0x3d: case 0x3e: case 0x3f: break; /* CONF: not on the C25 */ + case 0x50: case 0x51: case 0x52: case 0x53: /* CMPR */ + { + UINT16 a = R.AR[ARP], b = R.AR[0]; + int t = 0; + switch (OP_L & 3) + { + case 0: t = (a == b); break; + case 1: t = (a < b); break; + case 2: t = (a > b); break; + case 3: t = (a != b); break; + } + if (t) SET1(TC_FLAG); else CLR1(TC_FLAG); + break; + } + case 0x82: case 0x92: case 0xa2: case 0xb2: /* NORM */ + case 0xc2: case 0xd2: case 0xe2: case 0xf2: + if (R.ACC != 0 && (INT32)(R.ACC ^ (R.ACC << 1)) >= 0) + { + CLR1(TC_FLAG); + R.ACC <<= 1; + MODIFY_AR_ARP(); + } + else SET1(TC_FLAG); + break; + default: + logerror("C71: PC = %04x, Illegal opcode = %04x\n", (R.PC - 1) & 0xffff, R.opcode); + break; + } +} + +static const UINT8 ce_cycles[256] = +{ +/*00*/ 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, +/*10*/ 0,0,0,0,1,1,1,0, 1,1,0,1,1,1,2,3, +/*20*/ 1,1,0,1,2,2,2,1, 0,0,0,0,0,0,0,0, +/*30*/ 1,1,1,1,1,1,1,1, 1,1,0,0,1,1,1,1, +/*40*/ 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, +/*50*/ 1,1,1,1,0,0,0,0, 0,0,0,0,0,0,0,0, +/*60*/ 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, +/*70*/ 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, +/*80*/ 0,0,1,0,0,0,0,0, 0,0,0,0,0,0,0,0, +/*90*/ 0,0,1,0,0,0,0,0, 0,0,0,0,0,0,0,0, +/*a0*/ 0,0,1,0,0,0,0,0, 0,0,0,0,0,0,0,0, +/*b0*/ 0,0,1,0,0,0,0,0, 0,0,0,0,0,0,0,0, +/*c0*/ 0,0,1,0,0,0,0,0, 0,0,0,0,0,0,0,0, +/*d0*/ 0,0,1,0,0,0,0,0, 0,0,0,0,0,0,0,0, +/*e0*/ 0,0,1,0,0,0,0,0, 0,0,0,0,0,0,0,0, +/*f0*/ 0,0,1,0,0,0,0,0, 0,0,0,0,0,0,0,0 +}; + +/* main opcode cycles, by high byte (0xce and the Dx long immediates apart) */ +static const UINT8 main_cycles[256] = +{ +/*00*/ 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, +/*10*/ 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, +/*20*/ 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, +/*30*/ 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, +/*40*/ 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, +/*50*/ 1,1,1,1,1,1,1,1, 3,2,1,1,2,2,2,2, +/*60*/ 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, +/*70*/ 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, +/*80*/ 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, +/*90*/ 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, +/*a0*/ 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, +/*b0*/ 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, +/*c0*/ 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, +/*d0*/ 1,1,1,1,1,1,1,0, 1,1,1,1,1,1,1,1, +/*e0*/ 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, +/*f0*/ 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2 +}; + +/* Dx long immediates (opcode & 0xf0f8) == 0xd000 */ +static void op_dx(void) +{ + switch (OP_L) + { + case 0: /* LRLK */ + R.ALU = (UINT16)PREAD(R.PC); + R.PC++; + R.AR[OP_H & 7] = ALU_L; + break; + case 1: /* LALK */ + if (SXM) R.ALU = (UINT32)(INT32)(INT16)PREAD(R.PC); + else R.ALU = (UINT16)PREAD(R.PC); + R.PC++; + R.ALU <<= (OP_H & 0xf); + R.ACC = R.ALU; + break; + case 2: /* ADLK */ + R.oldacc = R.ACC; + if (SXM) R.ALU = (UINT32)(INT32)(INT16)PREAD(R.PC); + else R.ALU = (UINT16)PREAD(R.PC); + R.PC++; + R.ALU <<= (OP_H & 0xf); + R.ACC += R.ALU; + CALCULATE_ADD_OVERFLOW(R.ALU); + CALCULATE_ADD_CARRY(); + break; + case 3: /* SBLK */ + R.oldacc = R.ACC; + if (SXM) R.ALU = (UINT32)(INT32)(INT16)PREAD(R.PC); + else R.ALU = (UINT16)PREAD(R.PC); + R.PC++; + R.ALU <<= (OP_H & 0xf); + R.ACC -= R.ALU; + CALCULATE_SUB_OVERFLOW(R.ALU); + CALCULATE_SUB_CARRY(); + break; + case 4: /* ANDK */ + R.oldacc = R.ACC; + R.ALU = (UINT16)PREAD(R.PC); + R.PC++; + R.ALU <<= (OP_H & 0xf); + R.ACC &= R.ALU; + break; + case 5: /* ORK */ + R.ALU = (UINT16)PREAD(R.PC); + R.PC++; + R.ALU <<= (OP_H & 0xf); + R.ACC |= R.ALU; + break; + case 6: /* XORK */ + R.ALU = PREAD(R.PC); + R.PC++; + R.ALU <<= (OP_H & 0xf); + R.ACC ^= R.ALU; + break; + default: + logerror("C71: PC = %04x, Illegal opcode = %04x\n", (R.PC - 1) & 0xffff, R.opcode); + break; + } +} + +/* every opcode but 0xCExx and the Dx long immediates */ +static void op_main(void) +{ + switch (OP_H) + { + case 0x00: case 0x01: case 0x02: case 0x03: case 0x04: case 0x05: case 0x06: case 0x07: + case 0x08: case 0x09: case 0x0a: case 0x0b: case 0x0c: case 0x0d: case 0x0e: case 0x0f: /* ADD */ + R.oldacc = R.ACC; + GETDATA(OP_H & 0xf, SXM); + R.ACC += R.ALU; + CALCULATE_ADD_OVERFLOW(R.ALU); + CALCULATE_ADD_CARRY(); + break; + + case 0x10: case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17: + case 0x18: case 0x19: case 0x1a: case 0x1b: case 0x1c: case 0x1d: case 0x1e: case 0x1f: /* SUB */ + R.oldacc = R.ACC; + GETDATA(OP_H & 0xf, SXM); + R.ACC -= R.ALU; + CALCULATE_SUB_OVERFLOW(R.ALU); + CALCULATE_SUB_CARRY(); + break; + + case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: case 0x27: + case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: case 0x2f: /* LAC */ + GETDATA(OP_H & 0xf, SXM); + R.ACC = R.ALU; + break; + + case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: /* LAR */ + GETDATA(0, 0); + R.AR[OP_H & 7] = ALU_L; + break; + + case 0x38: /* MPY */ + GETDATA(0, 0); + R.Preg = (UINT32)((INT32)(INT16)ALU_L * (INT32)(INT16)R.Treg); + break; + case 0x39: /* SQRA */ + R.oldacc = R.ACC; + SHIFT_Preg_TO_ALU(); + R.ACC += R.ALU; + CALCULATE_ADD_OVERFLOW(R.ALU); + CALCULATE_ADD_CARRY(); + GETDATA(0, 0); + R.Treg = ALU_L; + R.Preg = (UINT32)((INT32)(INT16)ALU_L * (INT32)(INT16)ALU_L); + break; + case 0x3a: /* MPYA */ + R.oldacc = R.ACC; + SHIFT_Preg_TO_ALU(); + R.ACC += R.ALU; + CALCULATE_ADD_OVERFLOW(R.ALU); + CALCULATE_ADD_CARRY(); + GETDATA(0, 0); + R.Preg = (UINT32)((INT32)(INT16)ALU_L * (INT32)(INT16)R.Treg); + break; + case 0x3b: /* MPYS */ + R.oldacc = R.ACC; + SHIFT_Preg_TO_ALU(); + R.ACC -= R.ALU; + CALCULATE_SUB_OVERFLOW(R.ALU); + CALCULATE_SUB_CARRY(); + GETDATA(0, 0); + R.Preg = (UINT32)((INT32)(INT16)ALU_L * (INT32)(INT16)R.Treg); + break; + case 0x3c: /* LT */ + GETDATA(0, 0); + R.Treg = ALU_L; + break; + case 0x3d: /* LTA */ + R.oldacc = R.ACC; + GETDATA(0, 0); + R.Treg = ALU_L; + SHIFT_Preg_TO_ALU(); + R.ACC += R.ALU; + CALCULATE_ADD_OVERFLOW(R.ALU); + CALCULATE_ADD_CARRY(); + break; + case 0x3e: /* LTP */ + R.oldacc = R.ACC; + GETDATA(0, 0); + R.Treg = ALU_L; + SHIFT_Preg_TO_ALU(); + R.ACC = R.ALU; + break; + case 0x3f: /* LTD */ + R.oldacc = R.ACC; + GETDATA(0, 0); + R.Treg = ALU_L; + DWRITE(R.memaccess + 1, ALU_L); + SHIFT_Preg_TO_ALU(); + R.ACC += R.ALU; + CALCULATE_ADD_OVERFLOW(R.ALU); + CALCULATE_ADD_CARRY(); + break; + + case 0x40: /* ZALH */ + GETDATA(0, 0); + R.ACC = (UINT32)ALU_L << 16; + break; + case 0x41: /* ZALS */ + GETDATA(0, 0); + R.ACC = ALU_L; + break; + case 0x42: /* LACT */ + GETDATA(R.Treg & 0xf, SXM); + R.ACC = R.ALU; + break; + case 0x43: /* ADDC */ + R.oldacc = R.ACC; + GETDATA(0, 0); + if (CARRY) R.ACC++; + R.ACC += R.ALU; + CALCULATE_ADD_OVERFLOW(R.ALU); + if (R.ACC != R.oldacc) + CALCULATE_ADD_CARRY(); + break; + case 0x44: /* SUBH */ + { + UINT16 h; + R.oldacc = R.ACC; + GETDATA(0, 0); + h = (UINT16)(ACC_H - ALU_L); + SET_ACC_H(h); + if (OLD_H < h) + CLR1(C_FLAG); + if ((INT16)((OLD_H ^ ALU_L) & (OLD_H ^ h)) < 0) + { + SET0(OV_FLAG); + if (OVM) SET_ACC_H(((INT16)OLD_H < 0) ? 0x8000 : 0x7fff); + } + break; + } + case 0x45: /* SUBS */ + R.oldacc = R.ACC; + GETDATA(0, 0); + R.ACC -= ALU_L; + CALCULATE_SUB_OVERFLOW(R.ALU); + CALCULATE_SUB_CARRY(); + break; + case 0x46: /* SUBT */ + R.oldacc = R.ACC; + GETDATA(R.Treg & 0xf, SXM); + R.ACC -= R.ALU; + CALCULATE_SUB_OVERFLOW(R.ALU); + CALCULATE_SUB_CARRY(); + break; + case 0x47: /* SUBC */ + R.oldacc = R.ACC; + GETDATA(15, SXM); + R.ACC -= R.ALU; + if ((INT32)((R.oldacc ^ R.ALU) & (R.oldacc ^ R.ACC)) < 0) + SET0(OV_FLAG); + CALCULATE_SUB_CARRY(); + if (R.oldacc >= R.ALU) + { + R.ALU = R.ACC; + R.ACC = (R.ACC << 1) | 1; + } + else + { + R.ALU = R.ACC; + R.ACC = R.oldacc << 1; + } + break; + case 0x48: /* ADDH */ + { + UINT16 h; + R.oldacc = R.ACC; + GETDATA(0, 0); + h = (UINT16)(ACC_H + ALU_L); + SET_ACC_H(h); + if (OLD_H > h) + SET1(C_FLAG); + if ((INT16)((h ^ ALU_L) & (OLD_H ^ h)) < 0) + { + SET0(OV_FLAG); + if (OVM) SET_ACC_H(((INT16)OLD_H < 0) ? 0x8000 : 0x7fff); + } + break; + } + case 0x49: /* ADDS */ + R.oldacc = R.ACC; + GETDATA(0, 0); + R.ACC += R.ALU; + CALCULATE_ADD_OVERFLOW(R.ALU); + CALCULATE_ADD_CARRY(); + break; + case 0x4a: /* ADDT */ + R.oldacc = R.ACC; + GETDATA(R.Treg & 0xf, SXM); + R.ACC += R.ALU; + CALCULATE_ADD_OVERFLOW(R.ALU); + CALCULATE_ADD_CARRY(); + break; + case 0x4b: /* RPT */ + GETDATA(0, 0); + R.RPTC = (UINT8)R.ALU; + R.init_load_addr = 2; + break; + case 0x4c: /* XOR */ + GETDATA(0, 0); + SET_ACC_L(ACC_L ^ ALU_L); + break; + case 0x4d: /* OR */ + GETDATA(0, 0); + SET_ACC_L(ACC_L | ALU_L); + break; + case 0x4e: /* AND */ + GETDATA(0, 0); + R.ACC &= R.ALU; + break; + case 0x4f: /* SUBB */ + R.oldacc = R.ACC; + GETDATA(0, 0); + if (CARRY == 0) R.ACC--; + R.ACC -= R.ALU; + CALCULATE_SUB_OVERFLOW(R.ALU); + if (R.ACC != R.oldacc) + CALCULATE_SUB_CARRY(); + break; + + case 0x50: /* LST */ + GETDATA_NOARP(); + R.ALU = (R.ALU & 0xffff0000) | (ALU_L & ~INTM_FLAG); + R.STR0 &= INTM_FLAG; + R.STR0 |= ALU_L; + R.STR0 |= 0x0400; + break; + case 0x51: /* LST1 */ + GETDATA_NOARP(); + R.STR1 = ALU_L | FIXED_STR1; + R.STR0 &= ~ARP_REG; + R.STR0 |= (R.STR1 & ARB_REG); + break; + case 0x52: /* LDP */ + GETDATA(0, 0); + MODIFY_DP(R.ALU & 0x1ff); + break; + case 0x53: /* LPH */ + GETDATA(0, 0); + R.Preg = (R.Preg & 0x0000ffff) | ((UINT32)ALU_L << 16); + break; + case 0x54: /* PSHD */ + GETDATA(0, 0); + PUSH_STACK(ALU_L); + break; + case 0x55: /* MAR, LARP, NOP */ + if (OP_L & 0x80) MODIFY_AR_ARP(); + break; + case 0x56: /* DMOV */ + GETDATA(0, 0); + DWRITE(R.memaccess + 1, ALU_L); + break; + case 0x57: /* BITT */ + GETDATA(0, 0); + if (R.ALU & (0x8000 >> (R.Treg & 0xf))) SET1(TC_FLAG); else CLR1(TC_FLAG); + break; + case 0x58: /* TBLR */ + if (R.init_load_addr) + R.PFC = ACC_L; + R.ALU = (R.ALU & 0xffff0000) | PREAD(R.PFC); + if (!(CNF0 && R.PFC >= 0xff00)) + dec_cycles += (1*CLK); + PUTDATA(ALU_L); + R.PFC++; + break; + case 0x59: /* TBLW */ + if (R.init_load_addr) + R.PFC = ACC_L; + dec_cycles += (1*CLK); + GETDATA(0, 0); + if (R.external_mem_access) dec_cycles += (1*CLK); + PWRITE(R.PFC, ALU_L); + R.PFC++; + break; + case 0x5a: /* SQRS */ + R.oldacc = R.ACC; + SHIFT_Preg_TO_ALU(); + R.ACC -= R.ALU; + CALCULATE_SUB_OVERFLOW(R.ALU); + CALCULATE_SUB_CARRY(); + GETDATA(0, 0); + R.Treg = ALU_L; + R.Preg = (UINT32)((INT32)(INT16)ALU_L * (INT32)(INT16)ALU_L); + break; + case 0x5b: /* LTS */ + R.oldacc = R.ACC; + GETDATA(0, 0); + R.Treg = ALU_L; + SHIFT_Preg_TO_ALU(); + R.ACC -= R.ALU; + CALCULATE_SUB_OVERFLOW(R.ALU); + CALCULATE_SUB_CARRY(); + break; + case 0x5c: /* MACD */ + R.oldacc = R.ACC; + if (R.init_load_addr) + { + R.PFC = PREAD(R.PC); + R.PC++; + } + SHIFT_Preg_TO_ALU(); + R.ACC += R.ALU; + CALCULATE_ADD_OVERFLOW(R.ALU); + CALCULATE_ADD_CARRY(); + GETDATA(0, 0); + if ((OP_L & 0x80) || R.init_load_addr) + DWRITE(R.memaccess + 1, ALU_L); + R.Treg = ALU_L; + R.Preg = (UINT32)((INT32)(INT16)ALU_L * (INT32)(INT16)PREAD(R.PFC)); + R.PFC++; + dec_cycles += (2*CLK); + break; + case 0x5d: /* MAC */ + R.oldacc = R.ACC; + if (R.init_load_addr) + { + R.PFC = PREAD(R.PC); + R.PC++; + } + SHIFT_Preg_TO_ALU(); + R.ACC += R.ALU; + CALCULATE_ADD_OVERFLOW(R.ALU); + CALCULATE_ADD_CARRY(); + GETDATA(0, 0); + R.Treg = ALU_L; + R.Preg = (UINT32)((INT32)(INT16)ALU_L * (INT32)(INT16)PREAD(R.PFC)); + R.PFC++; + dec_cycles += (2*CLK); + break; + case 0x5e: BRANCH_IF(CARRY); break; /* BC */ + case 0x5f: BRANCH_IF(CARRY == 0); break; /* BNC */ + + case 0x60: case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: /* SACL */ + R.ALU = R.ACC << (OP_H & 7); + PUTDATA(ALU_L); + break; + case 0x68: case 0x69: case 0x6a: case 0x6b: case 0x6c: case 0x6d: case 0x6e: case 0x6f: /* SACH */ + R.ALU = R.ACC << (OP_H & 7); + PUTDATA(ALU_H); + break; + case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: /* SAR */ + PUTDATA(R.AR[OP_H & 7]); + break; + case 0x78: PUTDATA_SST(R.STR0); break; /* SST */ + case 0x79: PUTDATA_SST(R.STR1); break; /* SST1 */ + case 0x7a: /* POPD */ + R.ALU = (UINT16)POP_STACK(); + PUTDATA(ALU_L); + break; + case 0x7b: /* ZALR */ + GETDATA(0, 0); + R.ACC = ((UINT32)ALU_L << 16) | 0x8000; + break; + case 0x7c: /* SPL */ + SHIFT_Preg_TO_ALU(); + PUTDATA(ALU_L); + break; + case 0x7d: /* SPH */ + SHIFT_Preg_TO_ALU(); + PUTDATA(ALU_H); + break; + case 0x7e: R.AR[ARP] += OP_L; break; /* ADRK */ + case 0x7f: R.AR[ARP] -= OP_L; break; /* SBRK */ + + case 0x80: case 0x81: case 0x82: case 0x83: case 0x84: case 0x85: case 0x86: case 0x87: + case 0x88: case 0x89: case 0x8a: case 0x8b: case 0x8c: case 0x8d: case 0x8e: case 0x8f: /* IN */ + R.ALU = (R.ALU & 0xffff0000) | IOREAD(OP_H & 0xf); + PUTDATA(ALU_L); + break; + + case 0x90: case 0x91: case 0x92: case 0x93: case 0x94: case 0x95: case 0x96: case 0x97: + case 0x98: case 0x99: case 0x9a: case 0x9b: case 0x9c: case 0x9d: case 0x9e: case 0x9f: /* BIT */ + GETDATA(0, 0); + if (R.ALU & (0x8000 >> (OP_H & 0xf))) SET1(TC_FLAG); else CLR1(TC_FLAG); + break; + + case 0xa0: case 0xa1: case 0xa2: case 0xa3: case 0xa4: case 0xa5: case 0xa6: case 0xa7: + case 0xa8: case 0xa9: case 0xaa: case 0xab: case 0xac: case 0xad: case 0xae: case 0xaf: + case 0xb0: case 0xb1: case 0xb2: case 0xb3: case 0xb4: case 0xb5: case 0xb6: case 0xb7: + case 0xb8: case 0xb9: case 0xba: case 0xbb: case 0xbc: case 0xbd: case 0xbe: case 0xbf: /* MPYK */ + R.Preg = (UINT32)((INT32)(INT16)R.Treg * (INT32)((INT16)(R.opcode << 3) >> 3)); + break; + + case 0xc0: case 0xc1: case 0xc2: case 0xc3: case 0xc4: case 0xc5: case 0xc6: case 0xc7: /* LARK */ + R.AR[OP_H & 7] = OP_L; + break; + case 0xc8: case 0xc9: MODIFY_DP(R.opcode & 0x1ff); break; /* LDPK */ + case 0xca: R.ACC = OP_L; break; /* LACK, ZAC */ + case 0xcb: /* RPTK */ + R.RPTC = OP_L; + R.init_load_addr = 2; + break; + case 0xcc: /* ADDK */ + R.oldacc = R.ACC; + R.ALU = OP_L; + R.ACC += R.ALU; + CALCULATE_ADD_OVERFLOW(R.ALU); + CALCULATE_ADD_CARRY(); + break; + case 0xcd: /* SUBK */ + R.oldacc = R.ACC; + R.ALU = OP_L; + R.ACC -= (UINT8)R.ALU; + CALCULATE_SUB_OVERFLOW(R.ALU); + CALCULATE_SUB_CARRY(); + break; + case 0xce: op_ce(); break; + case 0xcf: /* MPYU */ + GETDATA(0, 0); + R.Preg = (UINT32)ALU_L * (UINT32)R.Treg; + break; + + case 0xe0: case 0xe1: case 0xe2: case 0xe3: case 0xe4: case 0xe5: case 0xe6: case 0xe7: + case 0xe8: case 0xe9: case 0xea: case 0xeb: case 0xec: case 0xed: case 0xee: case 0xef: /* OUT */ + GETDATA(0, 0); + IOWRITE(OP_H & 0xf, ALU_L); + break; + + case 0xf0: /* BV */ + if (OV) { R.PC = PREAD(R.PC); CLR0(OV_FLAG); } + else R.PC++; + MODIFY_AR_ARP(); + break; + case 0xf1: BRANCH_IF((INT32)R.ACC > 0); break; /* BGZ */ + case 0xf2: BRANCH_IF((INT32)R.ACC <= 0); break; /* BLEZ */ + case 0xf3: BRANCH_IF((INT32)R.ACC < 0); break; /* BLZ */ + case 0xf4: BRANCH_IF((INT32)R.ACC >= 0); break; /* BGEZ */ + case 0xf5: BRANCH_IF(R.ACC != 0); break; /* BNZ */ + case 0xf6: BRANCH_IF(R.ACC == 0); break; /* BZ */ + case 0xf7: /* BNV */ + if (OV == 0) R.PC = PREAD(R.PC); + else { R.PC++; CLR0(OV_FLAG); } + MODIFY_AR_ARP(); + break; + case 0xf8: BRANCH_IF(TC == 0); break; /* BBZ */ + case 0xf9: BRANCH_IF(TC); break; /* BBNZ */ + case 0xfa: BRANCH_IF(R.bus->bio ? R.bus->bio() : 1); /* unwired BIO reads high */ break; /* BIOZ */ + case 0xfb: BRANCH_IF(R.AR[ARP]); break; /* BANZ */ + case 0xfc: /* BLKP */ + if (R.init_load_addr) + { + R.PFC = PREAD(R.PC); + R.PC++; + } + R.ALU = PREAD(R.PFC); + PUTDATA(ALU_L); + R.PFC++; + dec_cycles += (2*CLK); + break; + case 0xfd: /* BLKD */ + if (R.init_load_addr) + { + R.PFC = PREAD(R.PC); + R.PC++; + } + R.ALU = DREAD(R.PFC); + PUTDATA(ALU_L); + R.PFC++; + dec_cycles += (1*CLK); + break; + case 0xfe: /* CALL */ + R.PC++; + PUSH_STACK(R.PC); + R.PC = PREAD(R.PC - 1); + MODIFY_AR_ARP(); + break; + case 0xff: /* B */ + R.PC = PREAD(R.PC); + MODIFY_AR_ARP(); + break; + + default: /* 0xd0-0xdf outside the long immediates */ + logerror("C71: PC = %04x, Illegal opcode = %04x\n", (R.PC - 1) & 0xffff, R.opcode); + break; + } +} + + +/*************************************************************************** + Interrupts, timer, execution +***************************************************************************/ + +static int process_IRQs(void) +{ + /* IFR: XINT RINT TINT INT2 INT1 INT0. Not taken if masked, or after EINT */ + if (INTM == 0 && R.opcode != 0xce00 && (R.IFR & R.imr)) + { + int pending = R.IFR & R.imr; + PUSH_STACK(R.PC); + R.idle = 0; + SET0(INTM_FLAG); + + if (pending & 0x01) { if (R.irq_callback) (*R.irq_callback)(0); R.PC = 0x0002; R.IFR &= ~0x01; } + else if (pending & 0x02) { if (R.irq_callback) (*R.irq_callback)(1); R.PC = 0x0004; R.IFR &= ~0x02; } + else if (pending & 0x04) { if (R.irq_callback) (*R.irq_callback)(2); R.PC = 0x0006; R.IFR &= ~0x04; } + else if (pending & 0x08) { R.PC = 0x0018; R.IFR &= ~0x08; } + else if (pending & 0x10) { R.drr = R.bus->dr_in ? R.bus->dr_in() : 0xffff; R.PC = 0x001a; R.IFR &= ~0x10; } + else { if (R.bus->dx_out) R.bus->dx_out(R.dxr); R.PC = 0x001c; R.IFR &= ~0x20; } + return 3*CLK; + } + return 0; +} + +static void process_timer(int clocks) +{ + for (;;) + { + int preclocks = CLK - R.timerover; + int ticks; + if (clocks < preclocks) + { + R.timerover += clocks; + c71_icount -= clocks; + return; + } + + ticks = 1 + (clocks - preclocks) / CLK; + if (ticks <= R.tim) + { + c71_icount -= clocks; + R.timerover = clocks - (ticks - 1) * CLK - preclocks; + R.tim -= ticks; + return; + } + + /* the timer underflows: TINT */ + c71_icount -= preclocks + CLK * R.tim; + R.timerover = 0; + R.tim = R.prd; + R.IFR |= 0x08; + clocks = process_IRQs(); + } +} + +/* one opcode in repeat mode: 0xCExx or the main table (as MAME) */ +static INLINE void exec_repeated(void) +{ + if (OP_H == 0xce) + op_ce(); + else + op_main(); +} + +static int in_idle_loop(UINT16 pc) +{ + const c71_bus *b = R.bus; + int i; + for (i = 0; i < b->idle_slots; i++) + if (pc >= b->idle_start[i] && pc <= b->idle_end[i]) + return 1; + return 0; +} + +int c71_execute(int cycles) +{ + c71_icount = cycles; + + if (R.idle && R.IFR && c71_icount > 0) + c71_icount -= process_IRQs(); + + while (R.idle && c71_icount > 0) + process_timer(c71_icount); + + while (c71_icount > 0) + { + dec_cycles = 0; + + if (R.IFR) + dec_cycles += process_IRQs(); + + R.PREVPC = R.PC; + + CALL_MAME_DEBUG; + + R.opcode = PREAD(R.PC); + R.PC++; + + if (OP_H == 0xce) + { + dec_cycles += ce_cycles[OP_L] * CLK; + op_ce(); + } + else if ((R.opcode & 0xf0f8) == 0xd000) + { + dec_cycles += (OP_L == 7) ? 0 : 2*CLK; + op_dx(); + } + else + { + dec_cycles += main_cycles[OP_H] * CLK; + op_main(); + } + + if (R.init_load_addr == 2) /* repeat the next instruction */ + { + R.PREVPC = R.PC; + R.opcode = PREAD(R.PC); + R.PC++; + dec_cycles += (1*CLK); + + do { + dec_cycles += (1*CLK); + exec_repeated(); + R.init_load_addr = 0; + R.RPTC--; + } while (R.RPTC != 0xff); + R.RPTC = 0; + R.PFC = R.PC; + R.init_load_addr = 1; + } + + process_timer(dec_cycles); + + while (R.idle && c71_icount > 0) + process_timer(c71_icount); + + /* a polling loop that only other CPUs can end: give up the timeslice */ + if (R.bus->idle_slots && R.PC <= R.PREVPC && in_idle_loop(R.PC) && c71_icount > 0) + process_timer(c71_icount); + } + + return cycles - c71_icount; +} + + +/*************************************************************************** + Interface +***************************************************************************/ + +void c71_init(void) +{ + int cpu = cpu_getactivecpu(); + c71_bus *b = bus_for(cpu); + + memset(&R, 0, sizeof(R)); + R.bus = b; + R.STR1 = FIXED_STR1; + + state_save_register_UINT16("c71", cpu, "PC", &R.PC, 1); + state_save_register_UINT16("c71", cpu, "PREVPC", &R.PREVPC, 1); + state_save_register_UINT16("c71", cpu, "PFC", &R.PFC, 1); + state_save_register_UINT16("c71", cpu, "STR0", &R.STR0, 1); + state_save_register_UINT16("c71", cpu, "STR1", &R.STR1, 1); + state_save_register_UINT8("c71", cpu, "IFR", &R.IFR, 1); + state_save_register_UINT8("c71", cpu, "RPTC", &R.RPTC, 1); + state_save_register_UINT32("c71", cpu, "ACC", &R.ACC, 1); + state_save_register_UINT32("c71", cpu, "Preg", &R.Preg, 1); + state_save_register_UINT16("c71", cpu, "Treg", &R.Treg, 1); + state_save_register_UINT16("c71", cpu, "AR", R.AR, 8); + state_save_register_UINT16("c71", cpu, "STACK", R.STACK, 8); + state_save_register_UINT32("c71", cpu, "ALU", &R.ALU, 1); + state_save_register_UINT32("c71", cpu, "oldacc", &R.oldacc, 1); + state_save_register_UINT16("c71", cpu, "opcode", &R.opcode, 1); + state_save_register_UINT16("c71", cpu, "drr", &R.drr, 1); + state_save_register_UINT16("c71", cpu, "dxr", &R.dxr, 1); + state_save_register_UINT16("c71", cpu, "tim", &R.tim, 1); + state_save_register_UINT16("c71", cpu, "prd", &R.prd, 1); + state_save_register_UINT16("c71", cpu, "imr", &R.imr, 1); + state_save_register_UINT16("c71", cpu, "greg", &R.greg, 1); + state_save_register_INT32("c71", cpu, "timerover", &R.timerover, 1); + state_save_register_INT32("c71", cpu, "memaccess", &R.memaccess, 1); + state_save_register_INT32("c71", cpu, "idle", &R.idle, 1); + state_save_register_INT32("c71", cpu, "init_load_addr", &R.init_load_addr, 1); + state_save_register_INT32("c71", cpu, "external_mem_access", &R.external_mem_access, 1); + state_save_register_UINT16("c71", cpu, "b0", b->b0, 256); + state_save_register_UINT16("c71", cpu, "b1", b->b1, 256); + state_save_register_UINT16("c71", cpu, "b2", b->b2, 32); +} + +void c71_reset(void *param) +{ + /* B0 back in data space */ + if (R.STR1 & CNF0_REG) + set_cnf0(0); + + R.PC = 0; + R.STR0 |= 0x0600; /* INTM and unused bit set to 1 */ + R.STR0 &= 0xefff; /* OV cleared */ + R.STR1 |= 0x0670 | FIXED_STR1; /* SXM, C, HM, FSM, XF set */ + R.STR1 &= 0xeff0; /* CNF, FO, TXM, PM cleared */ + R.RPTC = 0; + R.IFR = 0; + + R.greg = 0; + R.tim = 0xffff; + R.prd = 0xffff; + R.imr = 0xffc0; + + R.idle = 0; + R.init_load_addr = 1; +} + +void c71_exit(void) +{ +} + +unsigned c71_get_context(void *dst) +{ + if (dst) + *(c71_regs *)dst = R; + return sizeof(c71_regs); +} + +void c71_set_context(void *src) +{ + if (src) + { + R = *(c71_regs *)src; + /* the CNF0 page swap lives in the bus: keep it in step after a state load */ + if (((R.STR1 & CNF0_REG) != 0) != (R.bus->prd[0xff] == R.bus->b0)) + set_cnf0((R.STR1 & CNF0_REG) != 0); + } +} + +unsigned c71_get_reg(int regnum) +{ + switch (regnum) + { + case REG_PC: + case C71_PC: return R.PC; + case REG_SP: + case C71_STK7: return R.STACK[7]; + case C71_STK6: return R.STACK[6]; + case C71_STK5: return R.STACK[5]; + case C71_STK4: return R.STACK[4]; + case C71_STK3: return R.STACK[3]; + case C71_STK2: return R.STACK[2]; + case C71_STK1: return R.STACK[1]; + case C71_STK0: return R.STACK[0]; + case C71_PFC: return R.PFC; + case C71_STR0: return R.STR0; + case C71_STR1: return R.STR1; + case C71_IFR: return R.IFR; + case C71_RPTC: return R.RPTC; + case C71_ACC: return R.ACC; + case C71_PREG: return R.Preg; + case C71_TREG: return R.Treg; + case C71_AR0: case C71_AR1: case C71_AR2: case C71_AR3: + case C71_AR4: case C71_AR5: case C71_AR6: case C71_AR7: + return R.AR[regnum - C71_AR0]; + case C71_DRR: return R.drr; + case C71_DXR: return R.dxr; + case C71_TIM: return R.tim; + case C71_PRD: return R.prd; + case C71_IMR: return R.imr; + case C71_GREG: return R.greg; + case REG_PREVIOUSPC: return R.PREVPC; + } + return 0; +} + +void c71_set_reg(int regnum, unsigned val) +{ + switch (regnum) + { + case REG_PC: + case C71_PC: R.PC = val; break; + case REG_SP: + case C71_STK7: R.STACK[7] = val; break; + case C71_STK6: R.STACK[6] = val; break; + case C71_STK5: R.STACK[5] = val; break; + case C71_STK4: R.STACK[4] = val; break; + case C71_STK3: R.STACK[3] = val; break; + case C71_STK2: R.STACK[2] = val; break; + case C71_STK1: R.STACK[1] = val; break; + case C71_STK0: R.STACK[0] = val; break; + case C71_PFC: R.PFC = val; break; + case C71_STR0: R.STR0 = val; break; + case C71_STR1: R.STR1 = val; break; + case C71_IFR: R.IFR = val; break; + case C71_RPTC: R.RPTC = val; break; + case C71_ACC: R.ACC = val; break; + case C71_PREG: R.Preg = val; break; + case C71_TREG: R.Treg = val; break; + case C71_AR0: case C71_AR1: case C71_AR2: case C71_AR3: + case C71_AR4: case C71_AR5: case C71_AR6: case C71_AR7: + R.AR[regnum - C71_AR0] = val; break; + case C71_DRR: R.drr = val; break; + case C71_DXR: R.dxr = val; break; + case C71_TIM: R.tim = val; break; + case C71_PRD: R.prd = val; break; + case C71_IMR: R.imr = val; break; + case C71_GREG: R.greg = val; break; + } +} + +void c71_set_irq_line(int irqline, int state) +{ + /* pending interrupts cannot be cleared */ + if (state != CLEAR_LINE && irqline >= 0 && irqline < 6) + R.IFR |= (1 << irqline); +} + +void c71_set_irq_callback(int (*callback)(int irqline)) +{ + R.irq_callback = callback; +} + +const char *c71_info(void *context, int regnum) +{ + static char buffer[16][47+1]; + static int which = 0; + c71_regs *r = context; + + which = (which + 1) % 16; + buffer[which][0] = '\0'; + if (!context) + r = &R; + + switch (regnum) + { + case CPU_INFO_REG+C71_PC: sprintf(buffer[which], "PC:%04X", r->PC); break; + case CPU_INFO_REG+C71_STR0: sprintf(buffer[which], "STR0:%04X", r->STR0); break; + case CPU_INFO_REG+C71_STR1: sprintf(buffer[which], "STR1:%04X", r->STR1); break; + case CPU_INFO_REG+C71_IFR: sprintf(buffer[which], "IFR:%04X", r->IFR); break; + case CPU_INFO_REG+C71_RPTC: sprintf(buffer[which], "RPTC:%02X", r->RPTC); break; + case CPU_INFO_REG+C71_ACC: sprintf(buffer[which], "ACC:%08X", r->ACC); break; + case CPU_INFO_REG+C71_PREG: sprintf(buffer[which], "P:%08X", r->Preg); break; + case CPU_INFO_REG+C71_TREG: sprintf(buffer[which], "T:%04X", r->Treg); break; + case CPU_INFO_REG+C71_AR0: case CPU_INFO_REG+C71_AR1: case CPU_INFO_REG+C71_AR2: case CPU_INFO_REG+C71_AR3: + case CPU_INFO_REG+C71_AR4: case CPU_INFO_REG+C71_AR5: case CPU_INFO_REG+C71_AR6: case CPU_INFO_REG+C71_AR7: + sprintf(buffer[which], "AR%d:%04X", regnum - CPU_INFO_REG - C71_AR0, r->AR[regnum - CPU_INFO_REG - C71_AR0]); + break; + case CPU_INFO_REG+C71_STK0: case CPU_INFO_REG+C71_STK1: case CPU_INFO_REG+C71_STK2: case CPU_INFO_REG+C71_STK3: + case CPU_INFO_REG+C71_STK4: case CPU_INFO_REG+C71_STK5: case CPU_INFO_REG+C71_STK6: case CPU_INFO_REG+C71_STK7: + sprintf(buffer[which], "STK%d:%04X", regnum - CPU_INFO_REG - C71_STK0, r->STACK[regnum - CPU_INFO_REG - C71_STK0]); + break; + case CPU_INFO_REG+C71_DRR: sprintf(buffer[which], "DRR:%04X", r->drr); break; + case CPU_INFO_REG+C71_DXR: sprintf(buffer[which], "DXR:%04X", r->dxr); break; + case CPU_INFO_REG+C71_TIM: sprintf(buffer[which], "TIM:%04X", r->tim); break; + case CPU_INFO_REG+C71_PRD: sprintf(buffer[which], "PRD:%04X", r->prd); break; + case CPU_INFO_REG+C71_IMR: sprintf(buffer[which], "IMR:%04X", r->imr); break; + case CPU_INFO_REG+C71_GREG: sprintf(buffer[which], "GREG:%04X", r->greg); break; + case CPU_INFO_FLAGS: + sprintf(buffer[which], "arp%d%c%c%cdp%03x arb%d%c%c%c%cpm%d", + (r->STR0 & 0xe000) >> 13, + r->STR0 & 0x1000 ? 'O':'.', + r->STR0 & 0x0800 ? 'M':'.', + r->STR0 & 0x0200 ? 'I':'.', + (r->STR0 & 0x01ff), + (r->STR1 & 0xe000) >> 13, + r->STR1 & 0x1000 ? 'P':'D', + r->STR1 & 0x0800 ? 'T':'.', + r->STR1 & 0x0400 ? 'S':'.', + r->STR1 & 0x0200 ? 'C':'.', + (r->STR1 & 0x0003)); + break; + case CPU_INFO_NAME: return "C71"; + case CPU_INFO_FAMILY: return "Namco C71 (TMS320C25)"; + case CPU_INFO_VERSION: return "1.0"; + case CPU_INFO_FILE: return __FILE__; + case CPU_INFO_CREDITS: return "Based on the MAME TMS320C2x core (Tony La Porta, Quench and others)"; + case CPU_INFO_REG_LAYOUT: return (const char *)c71_reg_layout; + case CPU_INFO_WIN_LAYOUT: return (const char *)c71_win_layout; + default: return ""; + } + return buffer[which]; +} + +unsigned c71_dasm(char *buffer, unsigned pc) +{ + sprintf(buffer, "$%04X", PREAD(pc)); + return 1; +} diff --git a/src/cpu/namcoc71/c71.h b/src/cpu/namcoc71/c71.h new file mode 100644 index 00000000..42bfdc21 --- /dev/null +++ b/src/cpu/namcoc71/c71.h @@ -0,0 +1,75 @@ +/*************************************************************************** + + Namco C71 (TMS320C25 with Namco internal ROM) - fast DSP core + + Written for Namco System 22 / Super System 22. The instruction + semantics follow the TMS320C2x core of current MAME; the memory + system is a page table set up by the driver, so the core does not + go through the generic memory handlers. + + Word addresses everywhere: program, data and I/O are 16-bit word + spaces. + +***************************************************************************/ + +#ifndef C71_H +#define C71_H + +#include "osd_cpu.h" +#include "cpuintrf.h" +#include "memory.h" + +/* interrupt lines (IFR bits) */ +#define C71_INT0 0 +#define C71_INT1 1 +#define C71_INT2 2 +#define C71_TINT 3 +#define C71_RINT 4 +#define C71_XINT 5 + +enum +{ + C71_PC=1, + C71_PFC, C71_STR0, C71_STR1, C71_IFR, + C71_RPTC, C71_ACC, C71_PREG, C71_TREG, + C71_AR0, C71_AR1, C71_AR2, C71_AR3, + C71_AR4, C71_AR5, C71_AR6, C71_AR7, + C71_STK0, C71_STK1, C71_STK2, C71_STK3, + C71_STK4, C71_STK5, C71_STK6, C71_STK7, + C71_DRR, C71_DXR, C71_TIM, C71_PRD, + C71_IMR, C71_GREG +}; + +/* the generic memory interface is not used: give the CPU empty maps */ +#define NAMCOC71_PGM_OFFSET 0 + +typedef data16_t (*c71_read_fn)(offs_t offset); +typedef void (*c71_write_fn)(offs_t offset, data16_t data); + +/* driver configuration, by CPU number; call from DRIVER_INIT or MACHINE_INIT */ +void c71_set_internal_rom(int cpunum, const data16_t *rom); /* 0x1000 words, native order (a CPU region) */ +void c71_map_data(int cpunum, offs_t start, offs_t end, data16_t *base, int writable); +void c71_map_program(int cpunum, offs_t start, offs_t end, data16_t *base, int writable); +void c71_set_data_handlers(int cpunum, c71_read_fn rd, c71_write_fn wr); /* everything not mapped */ +void c71_set_io(int cpunum, int port, c71_read_fn rd, c71_write_fn wr); +void c71_set_bio(int cpunum, int (*bio)(void)); +void c71_set_serial(int cpunum, data16_t (*dr_in)(void), void (*dx_out)(data16_t)); +/* the DSP spins in [pc_start, pc_end] waiting for BIO or an interrupt: burn the timeslice there */ +void c71_set_idle_loop(int cpunum, int slot, UINT16 pc_start, UINT16 pc_end); + +extern int c71_icount; + +void c71_init(void); +void c71_reset(void *param); +void c71_exit(void); +int c71_execute(int cycles); +unsigned c71_get_context(void *dst); +void c71_set_context(void *src); +unsigned c71_get_reg(int regnum); +void c71_set_reg(int regnum, unsigned val); +void c71_set_irq_line(int irqline, int state); +void c71_set_irq_callback(int (*callback)(int irqline)); +const char *c71_info(void *context, int regnum); +unsigned c71_dasm(char *buffer, unsigned pc); + +#endif diff --git a/src/cpuintrf.c b/src/cpuintrf.c index 74e99524..201c50cf 100644 --- a/src/cpuintrf.c +++ b/src/cpuintrf.c @@ -124,6 +124,9 @@ #if (HAS_TMS32025) #include "cpu/tms32025/tms32025.h" #endif +#if (HAS_NAMCOC71) +#include "cpu/namcoc71/c71.h" +#endif #if (HAS_I960) #include "cpu/i960/i960.h" #endif @@ -573,6 +576,10 @@ const struct cpu_interface cpuintrf[] = #if (HAS_TMS32025) CPU3(TMS32025,tms32025, 3, 0,1.00,16,18bew, -1,18,BE,2, 4 ), #endif +#if (HAS_NAMCOC71) + #define c71_ICount c71_icount + CPU0(NAMCOC71, c71, 6, 0,1.00,16,16bew, -1,16,BE,2, 4 ), +#endif #if (HAS_TMS32031) #define tms32031_ICount tms32031_icount CPU0(TMS32031,tms32031, 4, 0,1.00,32,26ledw,-2,26,LE,4, 4 ), diff --git a/src/cpuintrf.h b/src/cpuintrf.h index 4ae71643..475aebc1 100644 --- a/src/cpuintrf.h +++ b/src/cpuintrf.h @@ -235,6 +235,9 @@ enum #if (HAS_TMS32025) CPU_TMS32025, #endif +#if (HAS_NAMCOC71) + CPU_NAMCOC71, +#endif #if (HAS_TMS32031) CPU_TMS32031, #endif diff --git a/src/driver.c b/src/driver.c index 2df4dc14..5128aae8 100644 --- a/src/driver.c +++ b/src/driver.c @@ -748,18 +748,49 @@ const struct GameDriver *test_drivers[] = DRIVER( cybsled ) /* (c) 1993 */ /* Namco System 22 games */ + DRIVER( namcoc74 ) /* C74 BIOS */ + DRIVER( ridgerac ) /* (c) 1993 */ + DRIVER( ridgeraca ) /* (c) 1993 */ + DRIVER( ridgeracb ) /* (c) 1993 */ + DRIVER( ridgeracc ) /* (c) 1993 */ + DRIVER( ridgeracj ) /* (c) 1993 */ + DRIVER( ridgera2 ) /* (c) 1994 */ + DRIVER( ridgera2j ) /* (c) 1994 */ + DRIVER( ridgera2ja ) /* (c) 1994 */ + DRIVER( ridgera28 ) /* (c) 1994 */ + DRIVER( cybrcomm ) /* (c) 1994 */ + DRIVER( raverace ) /* (c) 1995 */ + DRIVER( raveracej ) /* (c) 1995 */ + DRIVER( raveraceja ) /* (c) 1995 */ + DRIVER( acedrive ) /* (c) 1994 */ + DRIVER( victlap ) /* (c) 1996 */ + DRIVER( victlapa ) /* (c) 1996 */ + DRIVER( victlapj ) /* (c) 1996 */ + + /* Namco Super System 22 games */ DRIVER( alpinerd ) /* (c) 1994 */ DRIVER( alpinerc ) /* (c) 1994 */ - DRIVER( raveracw ) /* (c) 1995 */ - DRIVER( ridgeraj ) - DRIVER( ridger2j ) - DRIVER( acedrvrw ) - DRIVER( victlapw ) - DRIVER( cybrcomm ) - DRIVER( airco22b ) - DRIVER( cybrcycc ) - DRIVER( timecrsa ) + DRIVER( alpinerjc ) /* (c) 1994 */ + DRIVER( airco22b ) /* (c) 1995 */ + DRIVER( cybrcycc ) /* (c) 1995 */ + DRIVER( cybrcyccj ) /* (c) 1995 */ + DRIVER( dirtdash ) /* (c) 1995 */ + DRIVER( dirtdasha ) /* (c) 1995 */ + DRIVER( dirtdashb ) /* (c) 1995 */ + DRIVER( dirtdashj ) /* (c) 1995 */ + DRIVER( timecris ) /* (c) 1996 */ + DRIVER( timecrisa ) /* (c) 1996 */ + DRIVER( timecrisj ) /* (c) 1996 */ DRIVER( propcycl ) /* (c) 1996 */ + DRIVER( propcyclj ) /* (c) 1996 */ + DRIVER( alpines ) /* (c) 1996 */ + DRIVER( tokyowar ) /* (c) 1996 */ + DRIVER( tokyowarj ) /* (c) 1996 */ + DRIVER( aquajet ) /* (c) 1996 */ + DRIVER( alpinr2b ) /* (c) 1996 */ + DRIVER( alpinr2a ) /* (c) 1996 */ + DRIVER( adillor ) /* (c) 1997 */ + DRIVER( adillorj ) /* (c) 1997 */ /* Universal games */ diff --git a/src/drivers/namcos22.c b/src/drivers/namcos22.c index e1f9fd86..8f216d09 100644 --- a/src/drivers/namcos22.c +++ b/src/drivers/namcos22.c @@ -1,1283 +1,2401 @@ -/** - * driver\namcos22.c - * - * This driver describes Namco's System22 and Super System 22 hardware. - * Currently, only Prop Cycle is fully playable. - * - * feel free to contact pstroffo@yahoo.com (Phil Stroffolino) with any questions. - * - * - * Hardware Notes: - * - Serial controller is C139 SCI (same as System21). - * - S22 has two TI320C25 DSP (printed as C71). - * - Main DSP performs handling display list and matrix operation, and kicks hardware. - * - Sub DSP may calculates shadings and sub operations. - * - main CPU copies some DSP code to shared RAM on start - * - C74 is sound MCU, Mitsubishi M37702 MCU with mask ROM - * - some external subroutines for C74 is also embedded - * - Super System22 has a different memory map, sound system, and an additional 2d sprite layer. - * - ********************************************************************************************************** - * - * Known issues: - * - no emulation of the MCU. The MCU provides sound and input port handling. Proper emulation will - * obviate the need for a great many hacks in this driver. - * - * - no emulation of the DSP processors. The DSP processors are used as slaves to render 3d scenes. - * All current functionality is simulated based on a study of the raw scene description and known behaviors - * of the games running on real hardware. A proper emulation of the DSP processors will provide two things: - * 1. Eliminate guesswork and errors in our simulation. In particular, depth BIAS feature, used to - * manage draw order is fairly complex. - * 2. Allow any game-specific DSP code to function correctly. It seems that the DSP functionality varies - * very little from one game to the next. But each game includes one or more self tests that involve - * custom code. And an understanding of the DSP code might help to fix games like Alpine Ski or Air Combat22. - * - * - the intensity values used with gouraud shading aren't being interpretted quite right. - * Cap of vivanonno team suggests to interpret it in two ways: - * (a) 0x00 <= value <= 0x40 : simple scaling for source color. 0x40 means original color. - * (b) 0x40 < value <= 0xff : saturates to white color. (interpolation or add). - * The master contrast fader at 0x90020000 also can be fed such a strong power used for white-out. - * - * - our video driver does not yet handle orthogonal fader controls, or polygon-tilemap priority. - * On real hardware, it is possible to fade the polygon layer as a whole independently from the sprite layer - * or tilemap layer. - * And on real hardware, it is possible for a polygon to be marked so that it appears in front or behind - * the tilemap layer. - * - * Time Crisis notes: - * - some memory tests fail because of MCU/DSP hacks. These can be patched out or skipped using MAME's debugger, - * but even if they all pass, the game does not start up. It may be something simple - missing status bits or - * bad interrupt handling. - * - * Prop Cycle notes: - * - motor output: fan, blows air towards player when flying fast - * - lamp output: start button can light up - * - steering yoke should be analog - * - could use a new analog input port type for pedal speed - * - needs nvmem save - * - * The "dipswitch" settings are ignored - this isn't a bug. The Prop Cycle software - * explicitly clears the chunk of work RAM used to cache the 8 bit dipswitch value - * immediately after populating it. This is done to hide secret debug routines from - * release versions of the game. - * - * When the red namco logos slides in from top right and bottom left during splash screen, - * it is supposed to be translucent with respect to the polygon layer - * - * TBA: - * - fix Alpine Racer (Super System22) - encrypted point ROMs - * - * Special thanks to "team vivanonno" for System22 memory map, and insights on object list - * parsing. - * - ********************************************************************************************************** - * - * Detailed Hardware Notes: - * - * Following is a Memory Map for SYSTEM22 hardware courtesy of cap@vivanonno team (22/07/2003) - -0x00000000 - 0x001fffff Program ROM (2M bytes) - - Mounted position: - LLB: CPU 4D - LMB: CPU 2D - UMB: CPU 8D - UUB: CPU 6D - - Known ROM chip type: - TI TMS27C040-10 - ST M27C4001-10 - M27C4001-12Z - -0x10000000 - 0x1001ffff Main RAM (128K bytes) - - Mounted position: - CPU 3D, 5D, 7D, 9D - - Known DRAM chip type: - TC55328P-25 - N3441256P-15 - -0x18000000 - 0x1801ffff Main RAM (Mirror or Another Bank) - - Mounted position: - unknown - -0x20000000 - 0x2000000f KEYCUS - - Mounted position: - CPU 13R - Known chip type: - C370 (Ridge Racer, Ridge Racer 2) - C388 (Rave Racer) - C389? (Cyber Cycles) - C392? (Ace Driver Victory Lap) - - Notes (game-specific hacks): - Ridge Racer - 0x20000008 = 0x0172 (= 370) - Ridge Racer 2 - 0x20000000 = 0x0172 (= 370) - 0x20000008 = 0x0172 (= 370) - Rave Racer - hacked temporarily: - 0x00018200 = 0x60 (-> BRA instruction) (RV2-B) - Cyber Cycles - 0x20000002 = 0x0185 (= 389) - Ace Driver Victory Lap - 0x20000004 = 0x0188 (= 392) - -0x20010000 - 0x20013fff C139 SCI Buffer - - Mounted position: - CPU 4N - Known chip type: - M5M5179AP-25 (8k x 9bit SRAM) - Note: - Boot time check: - 20010000 - 20011fff / bits=0x000001ff - - 20010000 - 20011fff TX Buffer - 20012000 - 20013fff RX FIFO Buffer (also used for TX Buffer) - -0x20020000 - 0x2002000f C139 SCI Register - - Mounted position: - CPU 4R - - 20020000 2 R/W RX Status - 0x01 : Frame Error - 0x02 : Frame Received - 0x04 : ? - - 20020002 2 R/W Status/Control Flags - 0x01 : - 0x02 : RX flag? (cleared every vsync) - 0x04 : RX flag? (cleared every vsync) - 0x08 : - - 20020004 2 W FIFO Control Register - 0x01 : sync bit enable? - 0x02 : TX FIFO sync bit (bit-8) - - 20020006 2 W TX Control Register - 0x01 : TX start/stop - 0x02 : ? - 0x10 : ? - - 20020008 2 W - - 2002000a 2 W TX Frame Size - 2002000c 2 R/W RX FIFO Pointer (0x0000 - 0x0fff) - 2002000e 2 W TX FIFO Pointer (0x0000 - 0x1fff) - -0x40000000 - 0x4000001f System Controller - - Note: - Interrupt Control - Peripheral Control - - 40000000 IRQ (unknown) - 40000001 - 40000002 SCI IRQ level - 40000003 IRQ (unknown) - 40000004 VSYNC IRQ level - - 40000005 IRQ (unknown) acknowledge - 40000006 - 40000007 SCI IRQ acknowledge - 40000008 IRQ (unknown) acknowledge - 40000009 VSYNC IRQ acknowledge - - 4000000a - 4000000b ? - 4000000c ? - 4000000d - 4000000e ? - 4000000f - 40000010 ? - 40000011 ? - 40000012 ? - 40000013 ? - 40000014 ? - 40000015 ? (cyc1) - 40000016 Watchdog timer reset - 40000017 - 40000018 0 or 1 -> DSP control (reset?) - 40000019 sub cpu reset? - 4000001a 0 or 1 or 0xff -> DSP control - 4000001b ? - 4000001c - 4000001d - 4000001e - 4000001f - -0x48000000 - 0x4800003f unknown (option) - - Notes: - this device maybe optional. - zero means not-connected. - this may relate to device at 0x94000000 - -0x50000000 - 0x50000fff DIPSW etc. - - 0x50000000 DIPSW3 - 0x50000001 DIPSW2 - -0x58000000 - 0x58001fff EEPROM - - Mounted position: - CPU 9E - - Known chip type: - HN58C65P-25 (8k x 8bit EEPROM) - -0x60004000 - 0x6000bfff C74 (Mitsubishi M37702 MCU) Shared RAM - - Mounted position: - CPU 11L, 12L - - Known chip type: - TC55328P-25 - N341256P-15 - - DATA ROM for C74 (SEQ data and external code): - Known chip type: - NEC D27C4096D-12 - - Notes: - C74(CPU PCB) sends/receives I/O data from C74(I/O PCB) by SIO. - - 0x60004020 b4 = 1 : ??? - 0x60004022.w Volume(R) - 0x60004024.w Volume(L) - 0x60004026.w Volume(R) (maybe rear channels, not put on real PCB) - 0x60004028.w Volume(L) (maybe rear channels, not put on real PCB) - 0x60004030 b0 : system type 0 - 0x60004030 b1 = 0 : COIN2 - 0x60004030 b2 = 0 : TEST SW - 0x60004030 b3 = 0 : SERVICE SW - 0x60004030 b4 = 0 : COIN1 - 0x60004030 b5 : system type 1 - (system type on RR2 (00:50inch, 01:two in one, 20: standard, 21: -deluxe)) - 0x60004031 b0 = 0 : SWITCH1 (for manual transmission) - 0x60004031 b1 = 0 : SWITCH2 - 0x60004031 b2 = 0 : SWITCH3 - 0x60004031 b3 = 0 : SWITCH4 - 0x60004031 b4 = 0 : CLUTCH - 0x60004031 b6 = 0 : VIEW SW - 0x60004032.w Handle A/D (=steering wheel, default of center value is -different in each game) - 0x60004034.w Gas A/D - 0x60004036.w Brake A/D - 0x60004038.w A/D3 (reserved) - (some GOUT (general outputs for lamps, etc) is also mapped this -area) - 0x60004080 Data/Code for Sub-CPU - 0x60004200 Data/Code for Sub-CPU - - 0x60005000 - 0x6000bfff Sound Work - +0x0000 - 0x003f Song Request #00 to 31 - +0x0100 - 0x02ff Parameter RAM from Main MPU (for SEs) - +0x0300 - 0x03ff? Song Title (put messages here from Sound CPU) - -0x70000000 - 0x70020000 C71 (TI TMS320C25 DSP) Shared RAM - - Mounted position: - C71: CPU 15R, 21R - RAM: CPU 15K, 13E, 12E - Known chip type: - TC55328P-25 - N341256P-15 - - Notes: - connected bits = 0x00ffffff (24bit) - - 0x70000040.l Point RAM Write Enable (ff=enable) - 0x70000044.l Point RAM IDC (index count register) - 0x70000c00 - 0x7000ffff Point RAM Port - (Point RAM has 128K words, 512KB space (128K24bit)) - 0x70010000 - 0x700103ff Window Attribute Register #1 (0x808) - 0x70010400 - 0x70017fff Display List Buffer #1 - 0x70018000 - 0x700183ff Window Attribute Register #2 (0x808) - 0x70018400 - 0x7001ffff Display List Buffer #2 - -0x90000000 - 0x90000000 LED on PCB(?) - -0x90010000 - 0x90017fff Depth-cueing Look-up Table (fog density between -near -to far) - - Mounted position: - VIDEO 8P - Known chip type: - TC55328P-25 - -0x90020000 - 0x90027fff C305 (Display Controller) - - Mounted position: - VIDEO 7D (C305) - - +0x0002.w Fader Enable(?) (0: disabled) - +0x0011.w Display Fader (R) (0x0100 = 1.0) - +0x0013.w Display Fader (G) (0x0100 = 1.0) - +0x0015.w Display Fader (B) (0x0100 = 1.0) - +0x0100.b Fog1 Color (R) (world fogging) - +0x0101.b Fog2 Color (R) (used for heating of brake-disc on RV1) - +0x0180.b Fog1 Color (G) - +0x0181.b Fog2 Color (G) - +0x0200.b Fog1 Color (B) - +0x0201.b Fog2 Color (B) - (many unknown registers are here) - - Notes: - Boot time check: 0x90020100 - 0x9002027f - -0x90028000 - 0x9002ffff Palette (R) -0x90030000 - 0x90037fff Palette (G) -0x90038000 - 0x9003ffff Palette (B) - - Mounted position: - VIDEO 6B, 7B, 8B (near C305) - Note: - 0xff00-0xffff are for Tilemap (16 x 16) - -0x90040000 - 0x9005ffff unknown (option) - - Note: - This device maybe optional. - this may relate to device at 0x40000000 - -0x90080000 - 0x9009dfff Tilemap PCG Memory -0x9009e000 - 0x9009ffff Tilemap Memory (64 x 64) - - Mounted position: - VIDEO 2K - Known chip type: - HM511664 (64k x 16bit SRAM) - Note: - Self test: 90084000 - 9009ffff - -0x900a0000 - 0x900a000f Tilemap Register - - Mounted position: - unknown - - +0x0000 Position X - +0x0002 Position Y - - - -SYSTEM22 Known Custom Chips - -CPU PCB: - -C71 TI TMS320C25 DSP - C71 WEYW40116 (TMS320C25 Main/Sub DSP) - C71 D72260FN 980 FE-5CA891W - - M5M5178AP-25 (CPU 16R, 17R, 19R, 20R) DSP Work RAM (8K x 8bit x 2 x 2) - - Notes: - NOP opcode: 0x5500 - RET opcode: 0xce26 - -C74 Mitsubishi M37702 MCU - C74 159 408600 (OLD SUB) - C74 159 543100 (NEW SUB) - C74 159 414600 (OLD I/O) - C74 159 437600 (NEW I/O) - -C195 (Shared SRAM Controller) -C196 CPP x 6 -C199 (CPU 18K) x 1 -C317 IDC (CPU 15E) x 1 (S21B) -C337 PFP x 1 -C342 x 1 (S21B) -C352 (32ch PCM) -C353 x 1 - - -VIDEO PCB: - -C305 (Palette) -C335 - 9C, 10C - 12D, 12E - 14C -C300 - 18B, 18C, 20B, 20C, 22B, 22C -Cxxx - 34R, 35R - -TI TBP28L22N (256 x 8bit PROM) - VIDEO 2D, 3D, 4D (RGB Gamma LUT ROM) - - Notes: - RR1.GAM (for Ridge Raecr 1/2, Rave Racer) - -********************************************************************************************************** - -Alpine Racer (VER. D) -Namco, 1995 - - Player stands on steps, steering left/right. - Inner edge allows quick movement. - - The "viewpoint" button is used to select game mode - and to change camera placement during gameplay. - -1ST PCB -------- -PCB NO: SYSTEM SUPER22 CPU PCB 8646960102 (8646970102) -CPU : 68EC020FG25 -OSCs : 40.000MHz, 49.1520MHz -RAMs : IS61C256AH-20J (x2), CY7C182-25VC (x1) -DIPSW : 8 Position (x1), 4 Position (x1) -PALs : PALCE 22V10H-15JC/4 (x3, labelled SS22C1, SS22C2, SS22C4) -CUSTOM: C352 (100 PIN PQFP) - C405 (176 PIN PQFP) - C391 (KEYCUS) - 137 - 139 (64 PIN PQFP) - C383 (100 PIN PQFP) - M37710S4BFP (80 PIN PQFP) -OTHER : AT28C64 (EEPROM) -ROMs : AR1DATAB.8K (near C405, 27C4096) - AR1WAVEA.2L (near C352, 16M MASK) - - Tiny ROM PCB labelled AR2 VER. D - SYSTEM SUPER22 MPM(F) PCB 8646961600 (8646971600) - containing main program .... - ROM1.BIN (INTEL FLASH, TYPE E28F008SA, TSOP40) - ROM2.BIN " - ROM3.BIN " - ROM4.BIN " - - - -2ND PCB -------- -PCB NO: SYSTEM SUPER22 DSP PCB 8646960302 (8646970302) -OSC : 40.0000MHz -PALs : PALCE20V8H (Labelled SS22D1) - PALCE16V8 (x4, Labelled SS22D2, SS22D3, SS22D4, SS22D5) -RAMs : CY7C199-25VC (x9), M5M51008AFP-70L (x6) -CUSTOM: C396 (160 PIN PQFP) - C71 (x2, 68 PIN PLCC) - C199 (100 PIN PQFP) - C353 (120 PIN PQFP) - C402 (x2, 144 PIN PQFP) - C403 (136 PIN PQFP) - C300 (160 PIN PQFP) - C342 (160 PIN PQFP) - C405 (x2, 176 PIN PQFP) - C379 (64 PIN PQFP) - - - -3RD PCB -------- - -PCB No: SYSTEM SUPER22 MROM PCB 8646960400 (8646970400) -PALs : Labelled SS22M3, SS22M2, SS22M2 & SS22M1 -RAMs : TC551001BFL-70L (x3) -ROMs : GFX....MANY, MANY, MANY! All ROMs are surface mounted - - Type - ---------------------------------- - ar1ccrl.7b = ar1ccrl.3d 16M SOP44 - ar1ccrh.5b = ar1ccrh.1d 4M SOP32 - - ar1cg1.13b = ar1cg1.10d 16M SOP44 - ar1cg2.14b = ar1cg2.12d " - ar1cg3.16b = ar1cg3.13d " - ar1cg4.18b = ar1cg4.14d " - ar1cg5.19b = ar1cg5.16d " - ar1cg6.18a = ar1cg6.18d " - ar1cg7.15a = ar1cg7.19d " - - ar1scg0.12f= ar1scg0.12l 16M SOP44 (These have identical halves but) - ar1scg1.10f= ar1scg1.10l " ( they *are* 16M ROMs ) - - ar1ptr* 4M SOP32 - - - -4TH PCB -------- -PCB NO: SYSTEM SUPER22 VIDEO 8646960204 (8646970204) -OSC : 51.2000MHz (near PLCC84) -RAMs : KM424C257 (x22), IS61C256 (x7), LC321664 (x1) -CUSTOM: 304 (x4, 120 PIN PQFP) - 361 (120 PIN PQFP) - 374 (160 PIN PQFP) - 381 (x2, 144 PIN PQFP) - 395 (? - forgot to note leg count!) - 397 (160 PIN PQFP) - 399 (160 PIN PQFP) - 400 (x3, 100 PIN PQFP) - 401 (x5, 64 PIN PQFP) - 404 (208 PIN PQFP) - 406 (120 PIN PQFP) - SONY CXD1178Q (48 PIN PQFP) - ALTERA EPM7064LC84-15 (84 PIN PLCC) - - Notes on input ports: - - 0xe00098: dsw - 0xe0009c: up/down - - ---------------------------- - e000a8.l IO TR - - e000b6.l VR 0 - e000ba.l VR 1 - e000be.l VR 2 - e000c2.l VR 3 - - e000a4: ? - - e000a6.w // IO SW - bit 2: SERVICE SW - bit 3: TEST SW - bit 4: MID SW - bit 5: LEFT SW - bit 6: RIGHT SW - - e000b2.l EDGE VR - e000ae.l SWING VR -*/ - -#include "namcos22.h" - -enum namcos22_gametype namcos22_gametype; /* used for game-specific hacks */ - -/* memory region pointers */ -static data32_t *namcos22_shareram; -static data32_t *namcos22_C139_SCI; -static data32_t *namcos22_system_controller; - -/* Super System22 supports a sprite layer. - * Sprites are rendered as part of the polygon draw list, based on a per-sprite Z attribute. - * Each sprite has explicit placement/color/zoom controls. - */ -static struct GfxLayout sprite_layout = +/*************************************************************************** + + Namco System 22 / Super System 22 + + Backported from current MAME (driver by Phil Stroffolino, hap, + R. Belmont and others, BSD-3-Clause) to the mame2003-plus core, C89. + + Hardware + -------- + - main CPU: 68020 (System 22) / 68EC020 (Super), 24.576 MHz + - two Namco C71 DSPs (TMS320C25 with internal ROM), 40 MHz: + the master transforms the display list, the slave lights and + forwards it to the render device. As in MAME, the slave program + runs but its output is not used: the 3D scene is built from the + display list in polygon RAM (see the video file). + - sound/IO: M37710S4 (Super) / C74 (System 22) MCU with a C352 + - video: polygons, sprites (Super only) and a text layer + + MAME's notes on the hardware are kept where the code is. + +***************************************************************************/ + +#include +#include +#include "driver.h" +#include "state.h" +#include "cpu/namcoc71/c71.h" +#include "cpu/m37710/m37710.h" +#include "sound/c352.h" +#include "includes/namcos22.h" + +#define MCU_SPEEDUP 1 +#define C74_IDLE 0xc0dd /* C74 BIOS idle loop */ + + +/* screen: 25.6 MHz pixel clock, 814 x 525 total, 640 x 480 visible */ +#define S22_REFRESH (25600000.0 / (814.0 * 525.0)) +#define S22_VBLANK_USEC (45.0 / 525.0 / S22_REFRESH * 1000000.0) + +/* CPU numbers */ +#define CPU_MAIN 0 +#define CPU_MASTER 1 +#define CPU_SLAVE 2 +#define CPU_MCU 3 + +/* input port indices (Super System 22 games) */ +#define PORT_INPUTS 0 +#define PORT_DSW 1 +#define PORT_ADC0 2 /* 4 ports, or the light gun */ + +int namcos22_gametype; +int namcos22_is_ss22; + +data32_t *namcos22_polygonram; +data32_t *namcos22_spriteram; +data32_t *namcos22_vics_data; +data32_t *namcos22_vics_control; +data32_t *namcos22_mixer; +data32_t *namcos22_paletteram; +data32_t *namcos22_cgram; +data32_t *namcos22_czram; +data16_t *namcos22_shareram; +data8_t *namcos22_gamma_proms; + +int namcos22_pdp_render_done; +int namcos22_render_refresh; +int namcos22_slave_simulation_active; +UINT32 namcos22_pdp_frame; +UINT8 namcos22_syscontrol[0x20]; +int namcos22_irq_enabled, namcos22_irq_state; + +static data32_t *workram; +static data32_t *sci_buffer; +static data8_t *eeprom; +static data16_t *master_extram; /* 0x4000 words: data and program 0x4000-0x7fff */ +static data16_t *master_intram; /* 0x3000 words: data 0x1000-0x3fff */ +static data16_t *slave_extram; /* 0x2000 words: data and program 0x8000-0x9fff */ +static UINT32 *pointram; /* 0x20000 */ +static INT32 *pointrom; +static int pointrom_size; + +static int dsp_irq_enabled; +static UINT16 dsp_master_bioz; +static UINT32 point_address; +static UINT32 point_data; +static UINT16 serial_slave_to_master_next; +static UINT16 serial_slave_to_master_current; +static int renderbuf_size; +static UINT16 renderbuf_data[0x1c]; +static int dsp_upload_state; +static int upload_dest_idx; +static UINT16 dspram_bank; +static UINT16 dspram16_latch; +static UINT16 pdp_base; +static UINT16 keycus_rng; +static UINT8 mcu_iocontrol; +static UINT8 mcu_outdata; + +static mame_timer *mcu_irq2_timer; +static mame_timer *dsp_serial_timer; + +enum { DSP_UPLOAD_READY, DSP_UPLOAD_DEST, DSP_UPLOAD_DATA }; + +#define MAX_RENDER_CMD_SEQ 0x1c + + +/*************************************************************************** + Main CPU +***************************************************************************/ + +/* KEYCUS: protection and random numbers */ +static UINT16 keycus_word_r(int offset) { - 32,32, - RGN_FRAC(1,1), - 8, - { 0,1,2,3,4,5,6,7 }, - { - 0*8,1*8,2*8,3*8,4*8,5*8,6*8,7*8, - 8*8,9*8,10*8,11*8,12*8,13*8,14*8,15*8, - 16*8,17*8,18*8,19*8,20*8,21*8,22*8,23*8, - 24*8,25*8,26*8,27*8,28*8,29*8,30*8,31*8 }, - { - 0*32*8,1*32*8,2*32*8,3*32*8,4*32*8,5*32*8,6*32*8,7*32*8, - 8*32*8,9*32*8,10*32*8,11*32*8,12*32*8,13*32*8,14*32*8,15*32*8, - 16*32*8,17*32*8,18*32*8,19*32*8,20*32*8,21*32*8,22*32*8,23*32*8, - 24*32*8,25*32*8,26*32*8,27*32*8,28*32*8,29*32*8,30*32*8,31*32*8 }, - 32*32*8 -}; + UINT16 old_rng; -static struct GfxDecodeInfo gfxdecodeinfo[] = -{ - { REGION_GFX1, 0, &sprite_layout, 0, 0x80 }, - { -1 }, -}; - -/*********************************************************************************/ - -/* prelim! */ -static READ32_HANDLER( namcos22_C139_SCI_r ) -{ - switch( offset ) + switch (namcos22_gametype) { - case 0x0/4: return 0x0004<<16; - default: return 0; + case NAMCOS22_RIDGE_RACER2: if (offset == 0) return 0x0172; break; + case NAMCOS22_ACE_DRIVER: if (offset == 3) return 0x0173; break; + case NAMCOS22_CYBER_COMMANDO: if (offset == 1) return 0x0185; break; + case NAMCOS22_ALPINE_RACER: if (offset == 1) return 0x0187; break; + case NAMCOS22_CYBER_CYCLES: if (offset == 0xf) return 0x0387; break; + case NAMCOS22_VICTORY_LAP: if (offset == 2) return 0x0188; break; + case NAMCOS22_DIRT_DASH: if (offset == 0) return 0x01a2; break; + case NAMCOS22_ALPINE_SURFER: if (offset == 1) return 0x01a9; break; + case NAMCOS22_TOKYO_WARS: if (offset == 4) return 0x01a8; break; + case NAMCOS22_AIR_COMBAT22: return 0; + default: break; } + + /* pick a random number, but not the same twice in a row */ + old_rng = keycus_rng; + do + { + keycus_rng = mame_rand() & 0xffff; + } while (keycus_rng == old_rng); + return keycus_rng; } -static WRITE32_HANDLER( namcos22_C139_SCI_w ) -{ - COMBINE_DATA( &namcos22_C139_SCI[offset] ); - /* - 20020000 2 R/W RX Status - 0x01 : Frame Error - 0x02 : Frame Received - 0x04 : ? - - 20020002 2 R/W Status/Control Flags - 0x01 : - 0x02 : RX flag? (cleared every vsync) - 0x04 : RX flag? (cleared every vsync) - 0x08 : - - 20020004 2 W FIFO Control Register - 0x01 : sync bit enable? - 0x02 : TX FIFO sync bit (bit-8) - - 20020006 2 W TX Control Register - 0x01 : TX start/stop - 0x02 : ? - 0x10 : ? - - 20020008 2 W - - 2002000a 2 W TX Frame Size - 2002000c 2 R/W RX FIFO Pointer (0x0000 - 0x0fff) - 2002000e 2 W TX FIFO Pointer (0x0000 - 0x1fff) - */ -} - -/*********************************************************************************/ - -/** - * helper function used to read a byte from a chunk of 32 bit memory - */ -static data8_t -nthbyte( const data32_t *pSource, int offs ) -{ - pSource += offs/4; - return (pSource[0]<<((offs&3)*8))>>24; -} - -static READ32_HANDLER( namcos22_system_controller_r ) -{ - return namcos22_system_controller[offset]; -} - -static WRITE32_HANDLER( namcos22_system_controller_w ) -{ - COMBINE_DATA( &namcos22_system_controller[offset] ); - /* - 40000000 IRQ (unknown) - 40000001 - 40000002 SCI IRQ level - 40000003 IRQ (unknown) - 40000004 VSYNC IRQ level - - 40000005 IRQ (unknown) acknowledge - 40000006 - 40000007 SCI IRQ acknowledge - 40000008 IRQ (unknown) acknowledge - 40000009 VSYNC IRQ acknowledge - - 4000000a - 4000000b ? - 4000000c ? - 4000000d - 4000000e ? - 4000000f - 40000010 ? - 40000011 ? - 40000012 ? - 40000013 ? - 40000014 ? - 40000015 ? (cyc1) - 40000016 Watchdog timer reset - 40000017 - 40000018 0 or 1 -> DSP control (reset?) - 40000019 ? - 4000001a 0 or 1 or 0xff -> DSP control - 4000001b ? - 4000001c - 4000001d - 4000001e - 4000001f - */ -} - -/*********************************************************************************/ - static READ32_HANDLER( namcos22_keycus_r ) { - switch( namcos22_gametype ) + data32_t result = 0; + if (!(mem_mask & 0xffff0000)) result |= keycus_word_r(offset * 2) << 16; + if (!(mem_mask & 0x0000ffff)) result |= keycus_word_r(offset * 2 + 1); + return result; +} + +/* C139 SCI: preliminary, as in MAME */ +static READ32_HANDLER( namcos22_sci_r ) +{ + return (offset == 0) ? 0x00040000 : 0; +} + +/* developer pads: not connected (each read clocks a bit, lines active low) */ +static READ32_HANDLER( namcos22_devpad_r ) +{ + return 0x00010001; +} + +static READ32_HANDLER( namcos22s_dsw_r ) +{ + return 0xff00ffff | ((readinputport(PORT_DSW) & 0xff) << 16); +} + +/* 28C64 parallel EEPROM on the odd byte lanes */ +static READ32_HANDLER( namcos22s_eeprom_r ) +{ + return (eeprom[offset * 2] << 24) | (eeprom[offset * 2 + 1] << 8); +} + +static WRITE32_HANDLER( namcos22s_eeprom_w ) +{ + if (!(mem_mask & 0xff000000)) eeprom[offset * 2] = data >> 24; + if (!(mem_mask & 0x0000ff00)) eeprom[offset * 2 + 1] = data >> 8; +} + +static NVRAM_HANDLER( namcos22 ) +{ + if (read_or_write) + mame_fwrite(file, eeprom, 0x2000); + else if (file) + mame_fread(file, eeprom, 0x2000); + else if (memory_region(REGION_USER2)) + memcpy(eeprom, memory_region(REGION_USER2), 0x2000); /* default EEPROM */ + else + memset(eeprom, 0xff, 0x2000); +} + + +/* System controller (C383): interrupts, DSP and MCU control */ + +static void syscon_irqack(int line_index) +{ + int line = 1 << line_index; + int level = namcos22_syscontrol[line_index] & 7; + + namcos22_irq_state &= ~line; + if (level) + cpu_set_irq_line(CPU_MAIN, level, CLEAR_LINE); +} + +static void syscon_irqlevel(int line_index, UINT8 data) +{ + int line = 1 << line_index; + int oldlevel = namcos22_syscontrol[line_index] & 7; + int newlevel = data & 7; + + namcos22_irq_enabled &= ~line; + if (namcos22_is_ss22) + namcos22_irq_enabled |= (newlevel != 0) ? line : 0; + else + namcos22_irq_enabled |= (data & 0x10) ? line : 0; + + if (namcos22_irq_state & line) { - case NAMCOS22_CYBER_COMMANDO: - return 0x185; - - case NAMCOS22_RIDGE_RACER: - return 0x0172<<16; - - case NAMCOS22_CYBER_CYCLES: - return 0x387; - - case NAMCOS22_ALPINE_RACER: - return 0x0187; - - case NAMCOS22_VICTORY_LAP: - return 0x0188<<16; - - case NAMCOS22_ACE_DRIVER: - return 0x0173; - - default: - /* unknown/unused */ - return 0; - } -} - -/*********************************************************************************/ - -/** - * Some port values are read serially one bit at a time via word reads at - * 0x50000008 and 0x5000000a - * - * Writes to 0x50000008 and 0x5000000a reset the state of the input buffer. - * - * Note that only the values read at 0x50000008 seem to be used in-game. - * - * Some of these values are redundant with respects to the work-RAM supplied input port - * values supplied by the IO CPU. For example, the position of the stick shift is digital, - * and may be read through this mechanism or through shared IO RAM at 0x60004030. - * - * Other values seem to be digital versions of analog ports, for example "the gas pedal is - * pressed" as a boolean flag. IO RAM supplies it as an analog value. - */ -static data32_t mSys22PortBits; - -static READ32_HANDLER( namcos22_portbit_r ) -{ - data32_t data = mSys22PortBits; - mSys22PortBits>>=1; - return data&0x10001; -} -static WRITE32_HANDLER( namcos22_portbit_w ) -{ - unsigned dat50000008 = readinputport(4); - unsigned dat5000000a = 0xffff; - mSys22PortBits = (dat50000008<<16)|dat5000000a; -} - -static READ32_HANDLER( namcos22_dipswitch_r ) -{ - return readinputport(0)<<16; -} - -static READ32_HANDLER( namcos22_mcuram_r ) -{ - return namcos22_shareram[offset]; -} - -/*********************************************************************************/ - -/* I don't know what "SPOT RAM" is. It isn't directly memory mapped, - * but rather some ports are used to populate and poll it. - * - * See Time Crisis "SPOT RAM" self test for sample use. - */ -#define SPOTRAM_SIZE (320*4) - -static struct -{ - data16_t portR; /* next address for read */ - data16_t portW; /* next address for write */ - data16_t RAM[SPOTRAM_SIZE]; -} mSpotRAM; - -static READ32_HANDLER( spotram_r ) -{ - /* 0x860004: read */ - if( offset==1 ) - { - if( mSpotRAM.portR>=SPOTRAM_SIZE ) mSpotRAM.portR = 0; - return mSpotRAM.RAM[mSpotRAM.portR++]<<16; - } - return 0; -} - -static WRITE32_HANDLER( spotram_w ) -{ - /* 0x860002: write */ - if( offset==0 ) - { - if( mem_mask&0xffff0000 ) + if (!(namcos22_irq_enabled & line)) + syscon_irqack(line_index); + else if (oldlevel != newlevel) { - if( mSpotRAM.portW>=SPOTRAM_SIZE ) mSpotRAM.portW = 0; - mSpotRAM.RAM[mSpotRAM.portW++] = data; - } - else - { - mSpotRAM.portR = 0; - mSpotRAM.portW = 0; + if (oldlevel) cpu_set_irq_line(CPU_MAIN, oldlevel, CLEAR_LINE); + if (newlevel) cpu_set_irq_line(CPU_MAIN, newlevel, ASSERT_LINE); } } } -/*********************************************************************************/ - -/* Namco Super System 22 */ - -static MEMORY_READ32_START( namcos22s_readmem ) - { 0x000000, 0x3fffff, MRA32_ROM }, - { 0x400000, 0x40001f, namcos22_keycus_r }, - { 0x410000, 0x413fff, MRA32_RAM }, /* unused by Prop Cycle? */ - { 0x420000, 0x42000f, MRA32_RAM }, - { 0x430000, 0x430003, MRA32_RAM }, - { 0x440000, 0x440003, namcos22_dipswitch_r }, - { 0x450008, 0x45000b, namcos22_portbit_r }, - - { 0x460000, 0x463fff, MRA32_RAM }, /* unknown */ - /* possible nvmem? - */ - - { 0x700000, 0x70001f, namcos22_system_controller_r }, - - { 0x800000, 0x800003, MRA32_RAM }, /* 0x08380000 (always?) */ - { 0x810000, 0x81000f, MRA32_RAM }, /* 00000000 00000000 44440000 00000000 */ - - { 0x810200, 0x8103ff, MRA32_RAM }, /* CZ RAM: depth cueing; fog density, near to far */ - { 0x810400, 0x810403, MRA32_RAM }, /* ? air combat22 */ - { 0x820000, 0x8202ff, MRA32_RAM }, - - { 0x824000, 0x8243ff, namcos22_gamma_r }, /* GAMMA */ - { 0x828000, 0x83ffff, namcos22_paletteram_r }, /* PALETTE */ - { 0x860000, 0x860007, spotram_r }, - - { 0x880000, 0x89dfff, namcos22_cgram_r }, - { 0x89e000, 0x89ffff, namcos22_textram_r }, - { 0x8a0000, 0x8a000f, MRA32_RAM }, /* tilemap attributes */ - /* +0x0000 BG Position X - * +0x0002 BG Position Y - */ - { 0x900000, 0x90ffff, MRA32_RAM }, - { 0x940000, 0x94007f, MRA32_RAM }, - { 0x980000, 0x9affff, MRA32_RAM }, /* spriteram */ - { 0xa03ffc, 0xa03fff, MRA32_RAM }, - { 0xa04000, 0xa0bfff, namcos22_mcuram_r }, - { 0xc00000, 0xc3ffff, namcos22_dspram_r }, - { 0xe00000, 0xefffff, MRA32_RAM }, /* workram */ -MEMORY_END - -static MEMORY_WRITE32_START( namcos22s_writemem ) - { 0x000000, 0x3fffff, MWA32_ROM }, - { 0x400000, 0x40001f, MWA32_NOP }, /* cuskey? */ - { 0x410000, 0x413fff, MWA32_RAM }, - { 0x420000, 0x42000f, MWA32_RAM }, - { 0x430000, 0x430003, MWA32_RAM }, /* I/O related; bit select? */ - { 0x450008, 0x45000b, namcos22_portbit_w }, - { 0x460000, 0x463fff, MWA32_RAM }, - { 0x700000, 0x70001f, namcos22_system_controller_w, &namcos22_system_controller }, - { 0x800000, 0x800003, MWA32_RAM }, /* ? */ - /*0838*/ - { 0x810000, 0x81000f, MWA32_RAM }, /* ? */ - { 0x810200, 0x8103ff, MWA32_RAM }, /* depth cueing density */ - { 0x810400, 0x810403, MWA32_RAM }, /* ? air combat22 */ - { 0x820000, 0x8202ff, MWA32_RAM }, /* ? */ - { 0x824000, 0x8243ff, namcos22_gamma_w, &namcos22_gamma }, - { 0x828000, 0x83ffff, namcos22_paletteram_w, &paletteram32 }, - { 0x860000, 0x860007, spotram_w }, - { 0x880000, 0x89dfff, namcos22_cgram_w, &namcos22_cgram }, - { 0x89e000, 0x89ffff, namcos22_textram_w, &namcos22_textram }, - { 0x8a0000, 0x8a000f, MWA32_RAM }, /* tilemap attributes */ - /* 035c0000 006e0000 01ff0000 0000000 */ - { 0x900000, 0x90ffff, MWA32_RAM }, /* VICS(?) */ - { 0x940000, 0x94007f, MWA32_RAM }, - { 0x980000, 0x9affff, MWA32_RAM, &spriteram32 }, - { 0xa03ffc, 0xa03fff, MWA32_RAM }, - { 0xa04000, 0xa0bfff, MWA32_RAM, &namcos22_shareram }, /* MCU */ - /* 0xa0bd2f: 0x02 Prop Cycle: MOTOR ON */ - /* 0xa0bd2f: 0x04 Prop Cycle: LAMP ON */ - { 0xc00000, 0xc3ffff, namcos22_dspram_w, &namcos22_polygonram }, - { 0xe00000, 0xefffff, MWA32_RAM }, /* WORK */ - /* note that at least some of this is battery backed ADS RAM */ -MEMORY_END - -static void -SimulateAlpineRacerMCU( void ) +static void master_enable(int enable) { - /* ori.b #$80, $a0bd00.l: signal from main CPU - * $a0bd01: bit 7 indicates mcu is busy - * - * $a0bd02 (byte) - * $a0bd04 (byte) - * - * $a0bd0a: swing - * $a0bd0c: edge - * - * move.w #$0, $a0bd2e.l - * - * move.l #$410000, $e05950.l - * move.l #$414000, $e05954.l - * - * move.l #$a04000, $e05950.l - * move.l #$a0c000, $e05954.l - */ - if( namcos22_gametype == NAMCOS22_ALPINE_RACER ) + cpu_set_reset_line(CPU_MASTER, enable ? CLEAR_LINE : ASSERT_LINE); +} + +static void slave_enable(int enable) +{ + cpu_set_reset_line(CPU_SLAVE, enable ? CLEAR_LINE : ASSERT_LINE); + namcos22_slave_simulation_active = enable; +} + +static void syscon_dspcontrol(int index, UINT8 data) +{ + if (data == namcos22_syscontrol[index]) + return; + + if (data == 0) { - namcos22_shareram[0x0300/4] = 0x7551<<16; /* protection? */ - namcos22_shareram[0x7d00/4] = readinputport(1)<<8; - namcos22_shareram[(0xa0bd0a-0xa04000)/4] = (data16_t)(readinputport(2)-0x8000); /* swing */ - namcos22_shareram[(0xa0bd0c-0xa04000)/4] = ((data16_t)(readinputport(3)-0x8000))<<16; /* edge */ + master_enable(0); + slave_enable(0); + dsp_irq_enabled = 0; + } + else if (data == 1) + { + master_enable(1); + slave_enable(1); + dsp_irq_enabled = 1; + } + else if (data == 0xff) + { + /* upload game-specific code to the DSPs */ + master_enable(1); + dsp_irq_enabled = 0; } } -static void -SimulatePropCycleMCU( void ) +static void syscon_mcucontrol(UINT8 data) { - int dx,dy; - UINT16 data; - static data16_t pedal; - - namcos22_shareram[(0xa0bd00-0xa04000)/4] = readinputport(1)<<8; - - data = 0; - if( readinputport( 2 ) & 0x20 ) data |= 0x0100; - namcos22_shareram[(0xa0bd04-0xa04000)/4] = data<<16; /* start1*/ - - dx = 0; dy = 0; - if( readinputport( 2 ) & 0x04 ) dx++; - if( readinputport( 2 ) & 0x08 ) dx--; - if( readinputport( 2 ) & 0x01 ) dy--; - if( readinputport( 2 ) & 0x02 ) dy++; - - if( readinputport( 2 ) & 0x10 ) pedal+=0x10; - - namcos22_shareram[(0xa0bd08-0xa04000)/4] = (UINT16)(dx*0x7fff); - namcos22_shareram[(0xa0bd0c-0xa04000)/4] = (dy*0x7fff)<<16; - namcos22_shareram[(0xa0bd1c-0xa04000)/4] = pedal<<16; + cpu_set_reset_line(CPU_MCU, data ? CLEAR_LINE : ASSERT_LINE); } -static void -SimulateCyberCyclesMCU( void ) +static void ss22_syscon_byte_w(int offset, UINT8 data) { - data32_t data = 0; -return; - if( keyboard_pressed(KEYCODE_SPACE) ) data |= 0x01000; /* "view switch"*/ - namcos22_shareram[(0xa0bd00 - 0xa04000)/4] = data; - - data = 0; /* ? */ - namcos22_shareram[(0xa0bd2e - 0xa04000)/4] = data; + switch (offset) + { + case 0x00: case 0x01: case 0x02: case 0x03: /* irq levels: vblank, hblank, SCI, unknown */ + syscon_irqlevel(offset, data); + break; + case 0x04: case 0x05: case 0x06: case 0x07: /* irq acks */ + syscon_irqack(offset - 4); + break; + case 0x14: /* watchdog */ + break; + case 0x16: + syscon_mcucontrol(data); + break; + case 0x1c: + syscon_dspcontrol(offset, data); + break; + default: + break; + } + namcos22_syscontrol[offset] = data; } -static void -SimulateTimeCrisisMCU( void ) +static void s22_syscon_byte_w(int offset, UINT8 data) { - /* x------- -------- -------- -------- (w) - * -------- x------- -------- -------- (r) status - */ -/* namcos22_shareram[(0xa0b000 - 0xa04000)/4] ^= 0x00800000;*/ + switch (offset) + { + case 0x00: case 0x01: case 0x02: case 0x03: case 0x04: /* hblank, ?, SCI, unknown, vblank */ + syscon_irqlevel(offset, data); + break; + case 0x05: case 0x06: case 0x07: case 0x08: case 0x09: + syscon_irqack(offset - 5); + break; + case 0x16: /* watchdog */ + break; + case 0x18: + syscon_mcucontrol(data); + break; + case 0x1a: + syscon_dspcontrol(offset, data); + break; + default: + break; + } + namcos22_syscontrol[offset] = data; +} + +static READ32_HANDLER( namcos22_syscon_r ) +{ + const UINT8 *s = &namcos22_syscontrol[offset * 4]; + return (s[0] << 24) | (s[1] << 16) | (s[2] << 8) | s[3]; +} + +static WRITE32_HANDLER( namcos22s_syscon_w ) +{ + int i; + for (i = 0; i < 4; i++) + if (!(mem_mask & (0xff000000 >> (i * 8)))) + ss22_syscon_byte_w(offset * 4 + i, data >> (24 - i * 8)); +} + +static WRITE32_HANDLER( namcos22_syscon_w ) +{ + int i; + for (i = 0; i < 4; i++) + if (!(mem_mask & (0xff000000 >> (i * 8)))) + s22_syscon_byte_w(offset * 4 + i, data >> (24 - i * 8)); } static INTERRUPT_GEN( namcos22s_interrupt ) { - switch( namcos22_gametype ) + /* vblank irq */ + if (namcos22_irq_enabled & 1) { - case NAMCOS22_ALPINE_RACER: - SimulateAlpineRacerMCU(); - break; - - case NAMCOS22_PROP_CYCLE: - SimulatePropCycleMCU(); - break; - - case NAMCOS22_CYBER_CYCLES: - SimulateCyberCyclesMCU(); - break; - - case NAMCOS22_TIME_CRISIS: - SimulateTimeCrisisMCU(); - break; - - default: - break; - } - - switch( cpu_getiloops() ) - { - case 0: - cpu_set_irq_line(0, 4, HOLD_LINE); /* vblank */ - break; - case 1: - if( namcos22_gametype == NAMCOS22_CYBER_CYCLES ) - { - cpu_set_irq_line(0, 2, HOLD_LINE); /* vblank */ - } - else if( namcos22_gametype == NAMCOS22_AIR_COMBAT22 ) - { - cpu_set_irq_line(0, 6, HOLD_LINE); - } - break; + namcos22_irq_state |= 1; + if (namcos22_syscontrol[0] & 7) + cpu_set_irq_line(CPU_MAIN, namcos22_syscontrol[0] & 7, ASSERT_LINE); } } -static MACHINE_DRIVER_START( namcos22s ) - /* basic machine hardware */ - MDRV_CPU_ADD(M68EC020,25000000) /* 25 MHz? */ - MDRV_CPU_MEMORY(namcos22s_readmem,namcos22s_writemem) - MDRV_CPU_VBLANK_INT(namcos22s_interrupt,2) - MDRV_FRAMES_PER_SECOND(60) - MDRV_VBLANK_DURATION(DEFAULT_REAL_60HZ_VBLANK_DURATION) +/* COM RAM, shared with the MCU */ - /* video hardware */ - MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_NEEDS_6BITS_PER_GUN | VIDEO_RGB_DIRECT) - MDRV_SCREEN_SIZE(NAMCOS22_NUM_COLS*16,NAMCOS22_NUM_ROWS*16) - MDRV_VISIBLE_AREA(0,NAMCOS22_NUM_COLS*16-1,0,NAMCOS22_NUM_ROWS*16-1) - MDRV_PALETTE_LENGTH(NAMCOS22_PALETTE_SIZE) - MDRV_GFXDECODE(gfxdecodeinfo) +static READ32_HANDLER( namcos22_shared_r ) +{ + return (namcos22_shareram[offset * 2] << 16) | namcos22_shareram[offset * 2 + 1]; +} - MDRV_VIDEO_START(namcos22s) - MDRV_VIDEO_UPDATE(namcos22s) -MACHINE_DRIVER_END +static WRITE32_HANDLER( namcos22_shared_w ) +{ + if ((mem_mask & 0xffff0000) != 0xffff0000) + namcos22_shareram[offset * 2] = (namcos22_shareram[offset * 2] & (mem_mask >> 16)) | ((data >> 16) & ~(mem_mask >> 16)); + if ((mem_mask & 0x0000ffff) != 0x0000ffff) + namcos22_shareram[offset * 2 + 1] = (namcos22_shareram[offset * 2 + 1] & mem_mask) | (data & ~mem_mask & 0xffff); +} -/*********************************************************************************/ -/* Namco System 22 */ +/* polygon RAM ("DSP RAM"): only d0-23 are connected */ + +static READ32_HANDLER( namcos22_dspram_r ) +{ + return namcos22_polygonram[offset] | 0xff000000; +} + +static WRITE32_HANDLER( namcos22_dspram_w ) +{ + if (!(mem_mask & 0x00ff0000)) + { + mem_mask &= 0x00ffffff; + data = SIGNED24(data); + } + COMBINE_DATA(&namcos22_polygonram[offset]); +} + + +/*************************************************************************** + DSPs +***************************************************************************/ + +static data16_t namcos22_dspram16_r(offs_t offset) +{ + UINT32 value = namcos22_polygonram[offset & 0x7fff]; + + switch (dspram_bank & 3) + { + case 0: value &= 0xffff; break; + case 1: value >>= 16; break; + case 2: dspram16_latch = value >> 16; value &= 0xffff; break; + case 3: return 0; /* ready status? */ + } + return value; +} + +static void namcos22_dspram16_w(offs_t offset, data16_t data) +{ + UINT32 value = namcos22_polygonram[offset & 0x7fff]; + UINT16 lo = value & 0xffff; + UINT16 hi = value >> 16; + + switch (dspram_bank & 3) + { + case 0: lo = data; break; + case 1: hi = data; break; + case 2: lo = data; hi = dspram16_latch; break; + default: break; + } + namcos22_polygonram[offset & 0x7fff] = (hi << 16) | lo; +} + +/* master data space above the page table: 0x8000-0xffff (polygon RAM), the rest is open */ +static data16_t master_data_r(offs_t a) +{ + if (a >= 0x8000) + return namcos22_dspram16_r(a - 0x8000); + return 0; +} + +static void master_data_w(offs_t a, data16_t d) +{ + if (a >= 0x8000) + namcos22_dspram16_w(a - 0x8000, d); +} + + +/* point RAM / point ROM (3D model data, 24 bits) */ + +static void point_write(offs_t offs, UINT32 data) +{ + offs &= 0x00ffffff; + if (namcos22_is_ss22) + { + if (offs >= 0xf80000 && offs < 0xfa0000) + pointram[offs - 0xf80000] = data & 0x00ffffff; + } + else + { + if (offs >= 0xf00000 && offs < 0xf20000) + pointram[offs - 0xf00000] = data & 0x00ffffff; + } +} + +static INT32 pointram_read(offs_t offs) +{ + INT32 result = -1; + if (namcos22_is_ss22) + { + if (offs >= 0xf80000 && offs < 0xfa0000) + result = pointram[offs - 0xf80000]; + } + else + { + if (offs >= 0xf00000 && offs < 0xf20000) + result = pointram[offs - 0xf00000]; + } + return SIGNED24(result); +} + +INT32 namcos22_point_read(offs_t offs) +{ + offs &= 0x00ffffff; + return (offs < (offs_t)pointrom_size) ? pointrom[offs] : pointram_read(offs); +} + +#define PDP_RAM_R(offs) (namcos22_polygonram[(offs) & 0x7fff]) +#define PDP_RAM_W(offs,d) (namcos22_polygonram[(offs) & 0x7fff] = (d)) + +void namcos22_pdp_handle_commands(UINT16 offs) +{ + for (;;) + { + UINT16 start, cmd, numwords; + UINT32 src, dst, data; + + offs &= 0x7fff; + start = offs; + cmd = PDP_RAM_R(offs++); + + switch (cmd) + { + case 0xfff0: /* NOP? used in 'PDP LOOP TEST' */ + break; + + case 0xfff5: /* write to point RAM */ + dst = PDP_RAM_R(offs++); + data = PDP_RAM_R(offs++); + point_write(dst, data); + break; + + case 0xfff6: /* read word from point RAM */ + src = PDP_RAM_R(offs++); + dst = PDP_RAM_R(offs++); + data = namcos22_point_read(src); + PDP_RAM_W(dst, data); + break; + + case 0xfff7: /* block move (CommRAM to CommRAM) */ + src = PDP_RAM_R(offs++); + dst = PDP_RAM_R(offs++); + numwords = PDP_RAM_R(offs++); + while (numwords--) + { + data = PDP_RAM_R(src++); + PDP_RAM_W(dst++, data); + } + break; + + case 0xfff8: /* unknown */ + offs++; + break; + + case 0xfff9: /* unknown, modify point RAM somehow? */ + logerror("unknown PDP cmd=0x%04x, offs=0x%x\n", cmd, 4 * (offs - 1)); + return; + + case 0xfffa: /* read block from point RAM */ + src = PDP_RAM_R(offs++); + dst = PDP_RAM_R(offs++); + numwords = PDP_RAM_R(offs++); + while (numwords--) + { + data = namcos22_point_read(src++); + PDP_RAM_W(dst++, data); + } + break; + + case 0xfffb: /* write block to point RAM */ + dst = PDP_RAM_R(offs++); + numwords = PDP_RAM_R(offs++); + while (numwords--) + { + data = PDP_RAM_R(offs++); + point_write(dst++, data); + } + break; + + case 0xfffc: /* point RAM to point RAM */ + src = PDP_RAM_R(offs++); + dst = PDP_RAM_R(offs++); + numwords = PDP_RAM_R(offs++); + while (numwords--) + { + data = namcos22_point_read(src++); + point_write(dst++, data); + } + break; + + case 0xfffd: /* direct command to the render device */ + numwords = PDP_RAM_R(offs++); + offs += numwords; + break; + + case 0xfffe: /* unknown */ + offs++; + break; + + case 0xffff: /* goto */ + offs = PDP_RAM_R(offs) & 0x7fff; + if (offs == start) + return; /* goto self: the CPU rewrites it or retriggers the PDP */ + break; + + default: + logerror("unknown PDP cmd=0x%04x, offs=0x%x\n", cmd, 4 * (offs - 1)); + return; + } + } +} + + +/* master DSP I/O ports */ + +static data16_t point_loword_ir(offs_t port) +{ + point_data = namcos22_point_read(point_address); + point_address++; + return point_data & 0xffff; +} + +static void point_loword_iw(offs_t port, data16_t data) +{ + point_data = (point_data & ~0xffff) | data; + point_write(point_address++, point_data); +} + +static data16_t point_hiword_r(offs_t port) +{ + /* high bit is an unknown busy signal */ + return 0x8000 | ((point_data >> 16) & 0xff); +} + +static void point_hiword_w(offs_t port, data16_t data) +{ + point_data = (point_data & 0xffff) | (data << 16); +} + +static data16_t pdp_begin_r(offs_t port) +{ + /* kickstarts the PDP (polygon display processor): it parses the display list. + In MAME (and here) the drawing part is done in the slave simulation, the + commands that move data are done here */ + UINT16 offs; + + namcos22_pdp_frame = cpu_getcurrentframe(); + if (cpu_getvblank()) + namcos22_pdp_frame++; + namcos22_pdp_render_done = 1; + + dsp_master_bioz = 1; + offs = namcos22_is_ss22 ? (PDP_RAM_R(0x7fff) & 0xffff) : pdp_base; + + if (namcos22_is_ss22) + namcos22_pdp_handle_commands(offs); + return 0; +} + +static void dsp_unk2_w(offs_t port, data16_t data) +{ + /* Ridge Racer: base address of the post-processed display list */ + pdp_base = data; +} + +static data16_t dsp_unk_port3_r(offs_t port) +{ + dsp_master_bioz = 0; + dsp_upload_state = DSP_UPLOAD_READY; + return 0; +} + +static void point_address_w(offs_t port, data16_t data) +{ + point_address <<= 16; + point_address |= data; +} + +static void upload_code_to_slave_dsp_w(offs_t port, data16_t data) +{ + switch (dsp_upload_state) + { + case DSP_UPLOAD_READY: + switch (data) + { + case 0x00: slave_enable(0); break; + case 0x01: dsp_upload_state = DSP_UPLOAD_DEST; break; + case 0x02: break; /* custom IC poke */ + case 0x03: slave_enable(1); break; + case 0x04: break; + case 0x10: slave_enable(1); break; /* serial i/o related? */ + default: + logerror("master port#7: 0x%04x\n", data); + break; + } + break; + + case DSP_UPLOAD_DEST: + upload_dest_idx = data; + dsp_upload_state = DSP_UPLOAD_DATA; + break; + + case DSP_UPLOAD_DATA: + slave_extram[upload_dest_idx & 0x1fff] = data; + upload_dest_idx++; + break; + } +} + +static data16_t dsp_unk8_r(offs_t port) { return 0x0000; } /* bit 0 is busy */ +static data16_t custom_ic_status_r(offs_t port) { return 0x0063; } /* bit 0 signals completion */ +static data16_t dsp_upload_status_r(offs_t port) { return 0x0000; } + +static void dsp_unk8_w(offs_t port, data16_t data) +{ + renderbuf_size = 0; + namcos22_render_refresh = 1; +} + +static void master_render_device_w(offs_t port, data16_t data) +{ + if (renderbuf_size < MAX_RENDER_CMD_SEQ) + { + renderbuf_data[renderbuf_size++] = data; + if (renderbuf_size == MAX_RENDER_CMD_SEQ) + namcos22_draw_direct_poly(renderbuf_data); + } +} + +static void dspram16_bank_w(offs_t port, data16_t data) +{ + dspram_bank = data; +} + +static void dsp_nop_w(offs_t port, data16_t data) { } + +static int pdp_status_r(void) +{ + return dsp_master_bioz; +} + +static data16_t master_serial_io_r(void) +{ + return serial_slave_to_master_current; +} + +/* slave DSP */ + +static int dsp_slave_bioz_r(void) { return 1; } +static data16_t dsp_slave_port3_r(offs_t port) { return 0x0010; } +static data16_t dsp_slave_zero_r(offs_t port) { return 0; } + +static void slave_serial_io_w(data16_t data) +{ + serial_slave_to_master_next = data; +} + +static INTERRUPT_GEN( dsp_vblank_irq ) +{ + if (dsp_irq_enabled) + cpu_set_irq_line(CPU_MASTER, C71_INT0, PULSE_LINE); +} + +static void dsp_serial_pulse(int param) +{ + if (dsp_irq_enabled) + { + serial_slave_to_master_current = serial_slave_to_master_next; + + cpu_set_irq_line(CPU_MASTER, C71_RINT, PULSE_LINE); + cpu_set_irq_line(CPU_MASTER, C71_XINT, PULSE_LINE); + cpu_set_irq_line(CPU_SLAVE, C71_RINT, PULSE_LINE); + cpu_set_irq_line(CPU_SLAVE, C71_XINT, PULSE_LINE); + } +} + +static void setup_dsps(void) +{ + const data16_t *irom_master = (const data16_t *)memory_region(REGION_CPU2); + const data16_t *irom_slave = (const data16_t *)memory_region(REGION_CPU3); + + /* master */ + c71_set_internal_rom(CPU_MASTER, irom_master); + c71_map_data(CPU_MASTER, 0x1000, 0x3fff, master_intram, 1); + c71_map_data(CPU_MASTER, 0x4000, 0x7fff, master_extram, 1); + c71_map_program(CPU_MASTER, 0x4000, 0x7fff, master_extram, 0); + c71_set_data_handlers(CPU_MASTER, master_data_r, master_data_w); + c71_set_io(CPU_MASTER, 0x0, point_loword_ir, point_loword_iw); + c71_set_io(CPU_MASTER, 0x1, point_hiword_r, point_hiword_w); + c71_set_io(CPU_MASTER, 0x2, pdp_begin_r, dsp_unk2_w); + c71_set_io(CPU_MASTER, 0x3, dsp_unk_port3_r, point_address_w); + c71_set_io(CPU_MASTER, 0x4, NULL, dsp_nop_w); + c71_set_io(CPU_MASTER, 0x7, NULL, upload_code_to_slave_dsp_w); + c71_set_io(CPU_MASTER, 0x8, dsp_unk8_r, dsp_unk8_w); + c71_set_io(CPU_MASTER, 0x9, custom_ic_status_r, dsp_nop_w); + c71_set_io(CPU_MASTER, 0xa, NULL, dsp_nop_w); + c71_set_io(CPU_MASTER, 0xb, NULL, dsp_nop_w); + c71_set_io(CPU_MASTER, 0xc, NULL, master_render_device_w); + c71_set_io(CPU_MASTER, 0xd, NULL, dspram16_bank_w); + c71_set_io(CPU_MASTER, 0xe, NULL, dsp_nop_w); + c71_set_io(CPU_MASTER, 0xf, dsp_upload_status_r, dsp_nop_w); + c71_set_bio(CPU_MASTER, pdp_status_r); + c71_set_serial(CPU_MASTER, master_serial_io_r, NULL); + + /* slave */ + c71_set_internal_rom(CPU_SLAVE, irom_slave); + c71_map_data(CPU_SLAVE, 0x8000, 0x9fff, slave_extram, 1); + c71_map_program(CPU_SLAVE, 0x8000, 0x9fff, slave_extram, 0); + c71_set_io(CPU_SLAVE, 0x3, dsp_slave_port3_r, NULL); + c71_set_io(CPU_SLAVE, 0x4, dsp_slave_zero_r, NULL); + c71_set_io(CPU_SLAVE, 0x5, dsp_slave_zero_r, NULL); + c71_set_io(CPU_SLAVE, 0x6, dsp_slave_zero_r, dsp_nop_w); + c71_set_io(CPU_SLAVE, 0x8, dsp_slave_zero_r, dsp_nop_w); + c71_set_io(CPU_SLAVE, 0xb, dsp_slave_zero_r, dsp_nop_w); + c71_set_io(CPU_SLAVE, 0xc, NULL, dsp_nop_w); + c71_set_bio(CPU_SLAVE, dsp_slave_bioz_r); + c71_set_serial(CPU_SLAVE, NULL, slave_serial_io_w); +} + + +/*************************************************************************** + MCU (M37710S4 on Super System 22): C352, inputs, outputs +***************************************************************************/ + + +static READ16_HANDLER( mcu_shared_r ) +{ + return namcos22_shareram[offset]; +} + +static WRITE16_HANDLER( mcu_shared_w ) +{ + COMBINE_DATA(&namcos22_shareram[offset]); +} + +static READ16_HANDLER( mcu_rom_r ) +{ + return ((data16_t *)memory_region(REGION_CPU4))[offset & 0x3ffff]; +} + +static READ16_HANDLER( mcu_bios_r ) +{ + return ((data16_t *)memory_region(REGION_CPU4))[(0xc000 / 2 + offset) & 0x3ffff]; +} + +/* MB87078 electronic volume of the C352 outputs */ +static UINT8 mb87078_control; +static UINT8 mb87078_data; +static UINT16 mb87078_latch[4]; +static UINT8 mb87078_gain_index[4]; + +/* channel n sets the gain of C352 output n ^ 3 (MAME): 3, 2 the front, 1, 0 the rear */ +static void mb87078_apply(void) +{ + int ch; + for (ch = 0; ch < 4; ch++) + { + int i = mb87078_gain_index[ch]; + int gain = (i >= 65) ? 0 : (int)(256.0 * pow(10.0, (-0.5 * i) / 20.0) + 0.5); + c352_set_output_gain(ch ^ 3, gain); + } +} + +static void mb87078_gain_recalc(void) +{ + int i; + for (i = 0; i < 4; i++) + { + UINT16 l = mb87078_latch[i]; + if (~l & 0x40) + mb87078_gain_index[i] = 65; /* EN = 0: -infinity */ + else if (l & 0x100) + mb87078_gain_index[i] = 64; /* C32: -32dB */ + else if (l & 0x80) + mb87078_gain_index[i] = 0; /* C0: 0dB */ + else + mb87078_gain_index[i] = ~l & 0x3f; + } + mb87078_apply(); +} + +static WRITE16_HANDLER( mb87078_w ) +{ + if (!ACCESSING_LSB16) + return; + if (offset & 1) + mb87078_control = data & 0x1f; + else + { + mb87078_data = data & 0x3f; + mb87078_latch[mb87078_control & 3] = ((mb87078_control << 4) & 0x1c0) | mb87078_data; + mb87078_gain_recalc(); + } +} + +static void mb87078_reset(void) +{ + int i; + for (i = 0; i < 4; i++) + mb87078_latch[i] = 0x7f; /* all channels at 0dB */ + mb87078_gain_recalc(); +} + +static MEMORY_READ16_START( mcu_readmem ) + { 0x002000, 0x002fff, c352_0_r }, + { 0x004000, 0x00bfff, mcu_shared_r }, + { 0x00c000, 0x00ffff, mcu_bios_r }, + { 0x200000, 0x27ffff, mcu_rom_r }, + { 0x300000, 0x300001, MRA16_NOP }, +MEMORY_END + +static MEMORY_WRITE16_START( mcu_writemem ) + { 0x002000, 0x002fff, c352_0_w }, + { 0x004000, 0x00bfff, mcu_shared_w }, + { 0x301000, 0x301001, MWA16_NOP }, /* watchdog? LEDs? */ + { 0x308000, 0x308003, mb87078_w }, /* MB87078 volume control */ +MEMORY_END + +/* MCU ADC channels: base + port add - port sub (-1 = none) */ +static int adc_base[8], adc_add[8], adc_sub[8]; + +static void set_adc(int ch, int base, int add, int sub) +{ + adc_base[ch] = base; + adc_add[ch] = add; + adc_sub[ch] = sub; +} + +static void set_adc_ports(int p0, int p1, int p2, int p3) +{ + int i; + set_adc(0, 0, p0, -1); + set_adc(1, 0, p1, -1); + set_adc(2, 0, p2, -1); + set_adc(3, 0, p3, -1); + for (i = 4; i < 8; i++) + set_adc(i, 0, -1, -1); +} + +/* Alpine Racer / Alpine Surfer: the steplock motor locks or frees the steps, + its state is read back on input bits 7 (free) and 8 (locked) */ +static int alpine_motor; +static UINT8 alpine_motor_status; +static mame_timer *alpine_motor_timer; + +static void alpine_steplock(int param) +{ + alpine_motor_status = param; +} + +static void alpine_port4_w(data8_t data) +{ + if (~mcu_iocontrol & data & 0x20) + { + if ((mcu_outdata & 6) == 6) + { + if (alpine_motor_status == 2) + { + alpine_motor_status = 0; /* free the steps */ + timer_adjust(alpine_motor_timer, TIME_IN_MSEC(500), 1, 0); + } + } + else if (mcu_outdata & 4) + { + if (alpine_motor_status == 1) + { + alpine_motor_status = 0; /* lock the steps */ + timer_adjust(alpine_motor_timer, TIME_IN_MSEC(500), 2, 0); + } + } + } +} + +static data8_t mcu_io_r(int port) +{ + switch (port) + { + case M37710_PORT4: + return mcu_iocontrol; + + case M37710_PORT5: + { + UINT16 inputs = readinputport(PORT_INPUTS); + if (alpine_motor) + inputs = (inputs & ~0x180) | ((alpine_motor_status & 3) << 7); + return (mcu_iocontrol & 0x08) ? (inputs & 0xff) : (inputs >> 8); + } + + case M37710_PORT6: + return 0; + } + + if (port >= M37710_ADC0_L && port <= M37710_ADC7_H) + { + int ch = (port - M37710_ADC0_L) >> 1; + int value = adc_base[ch]; + if (adc_add[ch] >= 0) value += readinputport(adc_add[ch]); + if (adc_sub[ch] >= 0) value -= readinputport(adc_sub[ch]); + value &= 0xffff; + return ((port - M37710_ADC0_L) & 1) ? (value >> 8) : (value & 0xff); + } + return 0xff; +} + +static void mcu_io_w(int port, data8_t data) +{ + switch (port) + { + case M37710_PORT4: + /* d3: input select for port 5; d5,d6: output strobes for port 5 */ + if (alpine_motor) + alpine_port4_w(data); + if (~mcu_iocontrol & data & 0x20) + coin_counter_w(0, mcu_outdata & 1); + mcu_iocontrol = data; + break; + + case M37710_PORT5: + mcu_outdata = data; + break; + } +} + +static void mcu_irq2_callback(int param) +{ + cpu_set_irq_line(CPU_MCU, M37710_LINE_IRQ2, HOLD_LINE); +} + +static INTERRUPT_GEN( namcos22s_mcu_interrupt ) +{ + /* IRQ0 at the vblank (line 480), IRQ2 at line 240 */ + cpu_set_irq_line(CPU_MCU, M37710_LINE_IRQ0, HOLD_LINE); + timer_adjust(mcu_irq2_timer, cpu_getscanlinetime(240), 0, 0); +} + +static struct C352interface namcos22_c352_interface = +{ + 49152000 / 2, /* clock */ + 288, /* divider */ + REGION_SOUND1, + 100 +}; + + +/*************************************************************************** + Prop Cycle pedal +***************************************************************************/ + +/* The pedal has a 1-bit "light interrupted" sensor: the faster you pedal, the + faster it pulses. It clocks the MCU timer A3 (event counter), the program + counts the pulses in a frame. The timings (usec) are MAME's. */ +#define PORT_PEDAL (PORT_ADC0 + 2) +static mame_timer *pedal_update_timer; +static mame_timer *pedal_pulse_timer; + +static void pedal_pulse(int param) +{ + cpu_set_irq_line(CPU_MCU, M37710_LINE_TIMERA3OUT, param ? ASSERT_LINE : CLEAR_LINE); + cpu_set_irq_line(CPU_MCU, M37710_LINE_TIMERA3TICK, PULSE_LINE); +} + +static void pedal_update(int param) +{ + int pedal = readinputport(PORT_PEDAL) & 0x7f; + + if (pedal != 0) + { + double period = TIME_IN_USEC(750 + 100000.0 / abs(pedal)); + double left = timer_timeleft(pedal_pulse_timer); + timer_adjust(pedal_pulse_timer, (left < period) ? left : period, pedal < 0, period); + } + else + timer_adjust(pedal_pulse_timer, TIME_NEVER, 0, 0); +} + + +/*************************************************************************** + Armadillo Racing trackball +***************************************************************************/ + +/* The optical trackball clocks the MCU timers A2 (Y) and A3 (X): the speed + sets the frequency. The timings (Hz) are MAME's. */ +#define PORT_TRACKX (PORT_ADC0) +#define PORT_TRACKY (PORT_ADC0 + 1) +#define PORT_ADILLOR_DEV (PORT_ADC0 + 2) +static mame_timer *trackball_update_timer; +static mame_timer *trackball_pulse_timer[2]; +static UINT32 trackball_count[2]; +static INT32 trackball_residual[2]; + +static void trackball_pulse(int param) +{ + cpu_set_irq_line(CPU_MCU, (param & 1) ? M37710_LINE_TIMERA2OUT : M37710_LINE_TIMERA3OUT, (param & 2) ? ASSERT_LINE : CLEAR_LINE); + cpu_set_irq_line(CPU_MCU, (param & 1) ? M37710_LINE_TIMERA2TICK : M37710_LINE_TIMERA3TICK, PULSE_LINE); +} + +static void trackball_update(int param) +{ + UINT32 trackval[2]; + INT32 delta[2]; + int speed[2], params[2], axis; + double x, y, t[2]; + + trackval[0] = readinputport(PORT_TRACKX) & 0xffff; + trackval[1] = readinputport(PORT_TRACKY) & 0xffff; + for (axis = 0; axis < 2; axis++) + { + delta[axis] = (INT32)(trackval[axis] - trackball_count[axis]); + trackball_count[axis] = trackval[axis]; + if (delta[axis] > 0x8000) + delta[axis] -= 0x10000; + else if (delta[axis] < -0x8000) + delta[axis] += 0x10000; + trackball_residual[axis] += delta[axis]; + speed[axis] = trackball_residual[axis]; + if (speed[axis] > 0x7f) speed[axis] = 0x7f; + if (speed[axis] < -0x7f) speed[axis] = -0x7f; + trackball_residual[axis] -= speed[axis]; + } + + /* -1.0 .. 1.0 */ + x = speed[0] / 127.0; + y = speed[1] / 127.0; + + /* the trackball is rotated by 45 degrees: axes like (x), not (+) */ + if (readinputport(PORT_ADILLOR_DEV) & 2) + { + double ox = x, oy = y, scale = 1.0 / sqrt(2.0); + x = (ox - oy) * scale; + y = (oy + ox) * scale; + } + + t[0] = fabs(y); /* y -> A2 */ + t[1] = fabs(x); /* x -> A3 */ + params[0] = (y >= 0.0) ? 2 : 0; + params[1] = (x <= 0.0) ? 3 : 1; + + for (axis = 0; axis < 2; axis++) + { + if (t[axis] > (1.0 / 1250.0)) + { + double period = TIME_IN_HZ(20 + 1250 * t[axis]); + double left = timer_timeleft(trackball_pulse_timer[axis]); + timer_adjust(trackball_pulse_timer[axis], (left < period) ? left : period, params[axis], period); + } + else + timer_adjust(trackball_pulse_timer[axis], TIME_NEVER, axis, 0); + } +} + + +/*************************************************************************** + Time Crisis light gun +***************************************************************************/ + +/* MAME's light gun ranges (tuned for CRT): X 68-694, Y 43-284; the screen edges mean off-screen */ +static READ32_HANDLER( timecris_gun_r ) +{ + int gx = readinputport(PORT_ADC0) & 0xff; + int gy = readinputport(PORT_ADC0 + 1) & 0xff; + UINT16 xpos, ypos; + + if (gx == 0 || gx == 0xff || gy == 0 || gy == 0xff) + xpos = ypos = 0; + else + { + xpos = 68 + gx * 626 / 0xff; + ypos = 43 + gy * 241 / 0xff; + } + + switch (offset) + { + case 0: return xpos << 16; + case 1: + case 2: return ypos << 16; + } + return 0; +} + + +/*************************************************************************** + Alpine Surfer ROM banking +***************************************************************************/ + +/* 0x200000-0x3fffff is a window on the ROM at 0x200000 + bank * 0x200000 (data only). + A read handler: the RAM areas of this map take the dynamic memory banks. */ +static int alpines_bank; + +static READ32_HANDLER( alpines_bank_r ) +{ + return ((data32_t *)memory_region(REGION_CPU1))[((0x200000 + alpines_bank * 0x200000) >> 2) + offset]; +} + +static WRITE32_HANDLER( alpines_bank_w ) +{ + int bank = data & 3; + alpines_bank = (bank > 2) ? 2 : bank; +} + + +/*************************************************************************** + Memory maps +***************************************************************************/ + +static MEMORY_READ32_START( namcos22s_readmem ) + { 0x000000, 0x3fffff, MRA32_ROM }, + { 0x400000, 0x40001f, namcos22_keycus_r }, + { 0x410000, 0x413fff, MRA32_RAM }, + { 0x420000, 0x42000f, namcos22_sci_r }, + { 0x440000, 0x440003, namcos22s_dsw_r }, + { 0x450008, 0x45000b, namcos22_devpad_r }, + { 0x460000, 0x463fff, namcos22s_eeprom_r }, + { 0x700000, 0x70001f, namcos22_syscon_r }, + { 0x810000, 0x81000f, namcos22s_czattr_r }, + { 0x810200, 0x8103ff, namcos22s_czram_r }, + { 0x824000, 0x8243ff, MRA32_RAM }, + { 0x828000, 0x83ffff, MRA32_RAM }, + { 0x860000, 0x860007, namcos22s_spotram_r }, + { 0x880000, 0x89ffff, MRA32_RAM }, + { 0x8a0000, 0x8a000f, namcos22_tilemapattr_r }, + { 0x900000, 0x90ffff, MRA32_RAM }, + { 0x940000, 0x94007f, namcos22s_vics_control_r }, + { 0x980000, 0x9affff, MRA32_RAM }, + { 0xa04000, 0xa0bfff, namcos22_shared_r }, + { 0xc00000, 0xc1ffff, namcos22_dspram_r }, + { 0xe00000, 0xe3ffff, MRA32_RAM }, +MEMORY_END + +static MEMORY_WRITE32_START( namcos22s_writemem ) + { 0x000000, 0x3fffff, MWA32_ROM }, + { 0x400000, 0x40001f, MWA32_NOP }, + { 0x410000, 0x413fff, MWA32_RAM, &sci_buffer }, + { 0x420000, 0x42000f, MWA32_NOP }, + { 0x430000, 0x430003, MWA32_NOP }, /* CPU LEDs */ + { 0x450008, 0x45000b, MWA32_NOP }, /* dev pad strobe */ + { 0x460000, 0x463fff, namcos22s_eeprom_w }, + { 0x700000, 0x70001f, namcos22s_syscon_w }, + { 0x800000, 0x800003, namcos22s_chipselect_w }, + { 0x810000, 0x81000f, namcos22s_czattr_w }, + { 0x810200, 0x8103ff, namcos22s_czram_w }, + { 0x820000, 0x8202ff, MWA32_NOP }, + { 0x824000, 0x8243ff, MWA32_RAM, &namcos22_mixer }, + { 0x828000, 0x83ffff, namcos22_paletteram_w, &namcos22_paletteram }, + { 0x860000, 0x860007, namcos22s_spotram_w }, + { 0x880000, 0x89ffff, namcos22_cgram_w, &namcos22_cgram }, + { 0x8a0000, 0x8a000f, namcos22_tilemapattr_w }, + { 0x900000, 0x90ffff, MWA32_RAM, &namcos22_vics_data }, + { 0x940000, 0x94007f, namcos22s_vics_control_w, &namcos22_vics_control }, + { 0x980000, 0x9affff, MWA32_RAM, &namcos22_spriteram }, + { 0xa04000, 0xa0bfff, namcos22_shared_w }, + { 0xc00000, 0xc1ffff, namcos22_dspram_w }, + { 0xe00000, 0xe3ffff, MWA32_RAM, &workram }, +MEMORY_END + +/* the C71s go through the core's page tables: empty maps for the generic memory system */ +static MEMORY_READ16_START( c71_readmem ) + { 0x0000, 0x0001, MRA16_NOP }, +MEMORY_END + +static MEMORY_WRITE16_START( c71_writemem ) + { 0x0000, 0x0001, MWA16_NOP }, +MEMORY_END + + +/*************************************************************************** + System 22 +***************************************************************************/ + +/* input ports (System 22 driving games) */ +#define S22_PORT_INPUTS 0 +#define S22_PORT_SW2 1 +#define S22_PORT_SW3 2 +#define S22_PORT_ADC0 3 /* steering, gas, brake (and a 4th) */ + +static UINT32 credits1, credits2; +static int old_coin_state; + +static READ32_HANDLER( namcos22_dsw_r ) +{ + return ((readinputport(S22_PORT_SW3) & 0xff) << 24) | ((readinputport(S22_PORT_SW2) & 0xff) << 16) | 0xffff; +} + +/* HN58C65 EEPROM: a byte per address */ +static READ32_HANDLER( namcos22_eeprom_r ) +{ + const UINT8 *e = &eeprom[offset * 4]; + return (e[0] << 24) | (e[1] << 16) | (e[2] << 8) | e[3]; +} + +static WRITE32_HANDLER( namcos22_eeprom_w ) +{ + int i; + for (i = 0; i < 4; i++) + if (!(mem_mask & (0xff000000 >> (i * 8)))) + eeprom[offset * 4 + i] = data >> (24 - i * 8); +} + +/* main RAM mirror at 0x18000000 */ +static READ32_HANDLER( workram_mirror_r ) { return workram[offset]; } +static WRITE32_HANDLER( workram_mirror_w ) { COMBINE_DATA(&workram[offset]); } + +/* inputs, coins and the analog controls go through the I/O board MCU, not emulated (as MAME) */ +static void handle_coinage(UINT16 flags) +{ + int coin_state = ((flags & 0x1000) >> 12) | ((flags & 0x0200) >> 8); + + if (!(coin_state & 1) && (old_coin_state & 1)) + credits1++; + if (!(coin_state & 2) && (old_coin_state & 2)) + credits2++; + + old_coin_state = coin_state; + namcos22_shareram[0x3a / 2] = ((credits1 & 0xff) << 8) | (credits2 & 0xff); +} + +static void handle_driving_io(void) +{ + if (namcos22_syscontrol[0x18] != 0) + { + UINT16 flags = readinputport(S22_PORT_INPUTS); + UINT16 steer = readinputport(S22_PORT_ADC0 + 0); + UINT16 gas = readinputport(S22_PORT_ADC0 + 1); + UINT16 brake = readinputport(S22_PORT_ADC0 + 2); + + switch (namcos22_gametype) + { + case NAMCOS22_RIDGE_RACER: + case NAMCOS22_RIDGE_RACER2: + steer += 0x160; + gas += 884; + brake += 809; + break; + case NAMCOS22_RAVE_RACER: + steer += 32; + gas += 992; + brake += 3008; + break; + case NAMCOS22_ACE_DRIVER: + case NAMCOS22_VICTORY_LAP: + steer += 2048; + gas += 992; + brake += 3008; + break; + default: + break; + } + + namcos22_shareram[0x030 / 2] = flags; + namcos22_shareram[0x032 / 2] = steer; + namcos22_shareram[0x034 / 2] = gas; + namcos22_shareram[0x036 / 2] = brake; + handle_coinage(flags); + } +} + +static void handle_cybrcomm_io(void) +{ + if (namcos22_syscontrol[0x18] != 0) + { + UINT16 flags = readinputport(S22_PORT_INPUTS); + int i; + + namcos22_shareram[0x030 / 2] = flags; + for (i = 0; i < 4; i++) + namcos22_shareram[0x032 / 2 + i] = (readinputport(S22_PORT_ADC0 + i) & 0xff) * 0x10; + handle_coinage(flags); + } +} + +static INTERRUPT_GEN( namcos22_interrupt ) +{ + switch (namcos22_gametype) + { + case NAMCOS22_RIDGE_RACER: + case NAMCOS22_RIDGE_RACER2: + case NAMCOS22_RAVE_RACER: + case NAMCOS22_ACE_DRIVER: + case NAMCOS22_VICTORY_LAP: + handle_driving_io(); + break; + case NAMCOS22_CYBER_COMMANDO: + handle_cybrcomm_io(); + break; + } + + /* vblank irq */ + if (namcos22_irq_enabled & (1 << 4)) + { + namcos22_irq_state |= (1 << 4); + if (namcos22_syscontrol[4] & 7) + cpu_set_irq_line(CPU_MAIN, namcos22_syscontrol[4] & 7, ASSERT_LINE); + } +} static MEMORY_READ32_START( namcos22_readmem ) { 0x00000000, 0x001fffff, MRA32_ROM }, - { 0x10000000, 0x1001ffff, MRA32_RAM }, /* work RAM */ - { 0x18000000, 0x1801ffff, MRA32_RAM }, /* work RAM */ + { 0x10000000, 0x1001ffff, MRA32_RAM }, + { 0x18000000, 0x1801ffff, workram_mirror_r }, { 0x20000000, 0x2000000f, namcos22_keycus_r }, - { 0x20010000, 0x20013fff, MRA32_RAM }, /* C139 SCI: serial controller (TX/RX buffer) - same as System21 */ - { 0x20020000, 0x2002000f, namcos22_C139_SCI_r }, - { 0x40000000, 0x4000001f, namcos22_system_controller_r }, - { 0x48000000, 0x4800003f, MRA32_NOP }, /* unknown; possible for diagnostics */ - { 0x50000000, 0x50000003, namcos22_dipswitch_r }, /* DSW2,3 */ - { 0x50000008, 0x5000000b, namcos22_portbit_r }, - { 0x58000000, 0x58001fff, MRA32_RAM }, /* EPROM */ - { 0x60004000, 0x6000bfff, MRA32_RAM }, /* shareram */ + { 0x20010000, 0x20013fff, MRA32_RAM }, + { 0x20020000, 0x2002000f, namcos22_sci_r }, + { 0x40000000, 0x4000001f, namcos22_syscon_r }, + { 0x48000000, 0x4800003f, MRA32_NOP }, + { 0x50000000, 0x50000003, namcos22_dsw_r }, + { 0x50000008, 0x5000000b, namcos22_devpad_r }, + { 0x58000000, 0x58001fff, namcos22_eeprom_r }, + { 0x60004000, 0x6000bfff, namcos22_shared_r }, { 0x70000000, 0x7001ffff, namcos22_dspram_r }, - { 0x90010000, 0x90017fff, MRA32_RAM }, /* depth-cueing */ - { 0x90020000, 0x90027fff, MRA32_RAM }, /* C305 display controller */ - { 0x90028000, 0x9003ffff, MRA32_RAM }, /* palette */ - { 0x90040000, 0x9007ffff, MRA32_RAM }, /* diagnostic ROM? */ - { 0x90080000, 0x9009dfff, MRA32_RAM }, /* bg tiles */ - { 0x9009e000, 0x9009ffff, MRA32_RAM }, /* bg tilemap */ - { 0x900a0000, 0x900a000f, MRA32_RAM }, /* bg control register */ + { 0x90010000, 0x90017fff, MRA32_RAM }, + { 0x90020000, 0x90027fff, MRA32_RAM }, + { 0x90028000, 0x9003ffff, MRA32_RAM }, + { 0x90040000, 0x9007ffff, MRA32_NOP }, + { 0x90080000, 0x9009ffff, MRA32_RAM }, + { 0x900a0000, 0x900a000f, namcos22_tilemapattr_r }, MEMORY_END static MEMORY_WRITE32_START( namcos22_writemem ) { 0x00000000, 0x001fffff, MWA32_ROM }, - { 0x10000000, 0x1001ffff, MWA32_RAM }, /* work RAM */ - { 0x18000000, 0x1801ffff, MWA32_RAM }, /* work RAM */ - { 0x20000000, 0x2000000f, MWA32_NOP }, /* cuskey */ - { 0x20010000, 0x20013fff, MWA32_RAM }, /* C139 SCI: TX/RX buffer (same as System21) */ - { 0x20020000, 0x2002000f, MWA32_RAM }, /* serial controller (registers) */ - { 0x40000000, 0x4000001f, namcos22_system_controller_w, &namcos22_system_controller }, - { 0x48000000, 0x4800003f, MWA32_NOP }, /* unknown; possible for diagnostics */ - { 0x50000000, 0x50000007, MWA32_NOP }, - { 0x50000008, 0x5000000b, namcos22_portbit_w }, - { 0x58000000, 0x58001fff, MWA32_RAM }, /* EPROM */ + { 0x10000000, 0x1001ffff, MWA32_RAM, &workram }, + { 0x18000000, 0x1801ffff, workram_mirror_w }, + { 0x20000000, 0x2000000f, MWA32_NOP }, + { 0x20010000, 0x20013fff, MWA32_RAM, &sci_buffer }, + { 0x20020000, 0x2002000f, MWA32_NOP }, + { 0x40000000, 0x4000001f, namcos22_syscon_w }, + { 0x48000000, 0x4800003f, MWA32_NOP }, + { 0x50000000, 0x50000003, MWA32_NOP }, /* CPU LEDs */ + { 0x50000008, 0x5000000b, MWA32_NOP }, + { 0x58000000, 0x58001fff, namcos22_eeprom_w }, { 0x60000000, 0x60003fff, MWA32_NOP }, - { 0x60004000, 0x6000bfff, MWA32_RAM, &namcos22_shareram }, - { 0x70000000, 0x7001ffff, namcos22_dspram_w, &namcos22_polygonram }, - { 0x90000000, 0x90000003, MWA32_NOP }, /* LED on PCB(?) */ - { 0x90010000, 0x90017fff, MWA32_RAM }, /* depth-cueing */ - { 0x90020000, 0x90027fff, MWA32_RAM }, /* C305 display controller */ - { 0x90028000, 0x9003ffff, namcos22_paletteram_w, &paletteram32 }, - { 0x90040000, 0x9007ffff, MWA32_RAM }, /* victory lap */ - { 0x90080000, 0x9009dfff, namcos22_cgram_w, &namcos22_cgram }, - { 0x9009e000, 0x9009ffff, namcos22_textram_w, &namcos22_textram }, - { 0x900a0000, 0x900a000f, MWA32_RAM }, /* bg control register */ + { 0x60004000, 0x6000bfff, namcos22_shared_w }, + { 0x70000000, 0x7001ffff, namcos22_dspram_w }, + { 0x90000000, 0x90000003, MWA32_NOP }, + { 0x90010000, 0x90017fff, MWA32_RAM, &namcos22_czram }, + { 0x90020000, 0x90027fff, MWA32_RAM, &namcos22_mixer }, + { 0x90028000, 0x9003ffff, namcos22_paletteram_w, &namcos22_paletteram }, + { 0x90080000, 0x9009ffff, namcos22_cgram_w, &namcos22_cgram }, + { 0x900a0000, 0x900a000f, namcos22_tilemapattr_w }, MEMORY_END -static INTERRUPT_GEN( namcos22_interrupt ) +/* C74 (M37702 with internal BIOS) on the CPU board: sound */ +static MEMORY_READ16_START( mcu_s22_readmem ) + { 0x002000, 0x002fff, c352_0_r }, + { 0x004000, 0x00bfff, mcu_shared_r }, + { 0x200000, 0x27ffff, mcu_rom_r }, +MEMORY_END + +static MEMORY_WRITE16_START( mcu_s22_writemem ) + { 0x002000, 0x002fff, c352_0_w }, + { 0x004000, 0x00bfff, mcu_shared_w }, +MEMORY_END + +static data8_t mcu_s22_io_r(int port) { - int i; - for( i=0; i<5; i++ ) - { - int irqlevel = nthbyte(namcos22_system_controller,i); - if( (irqlevel&0xf8)==0x30 ) - { - if( i==4 || keyboard_pressed(KEYCODE_I) ) - { - cpu_set_irq_line(0,irqlevel&7,/*ASSERT_LINE*/HOLD_LINE); - } - } - } - - switch( namcos22_gametype ) - { - case NAMCOS22_VICTORY_LAP: - namcos22_shareram[0x00/4] = 0x10<<16; /* SUB CPU ready */ - namcos22_shareram[0x30/4] = (readinputport(4)<<16)|readinputport(3); - namcos22_shareram[0x34/4] = (readinputport(1)<<16)|readinputport(2); - break; - - case NAMCOS22_ACE_DRIVER: - namcos22_shareram[0x00/4] = 0x10<<16; /* SUB CPU ready */ - namcos22_shareram[0x30/4] = (readinputport(4)<<16)|readinputport(3); - namcos22_shareram[0x34/4] = (readinputport(1)<<16)|readinputport(2); - break; - - case NAMCOS22_CYBER_COMMANDO: - namcos22_shareram[0x30/4] = readinputport(0)<<16; - /** - * ---- -x-- ---- ---- test switch - */ - break; - - default: - break; - } - + /* port 4 0x10 selects the sound role of the C74 */ + if (port == M37710_PORT4) + return 0x10; + if (port >= M37710_ADC0_L && port <= M37710_ADC7_H) + return 0; + return 0xff; } -static MACHINE_DRIVER_START( namcos22 ) - /* basic machine hardware */ - MDRV_CPU_ADD(M68020,25000000) /* 25 MHz? */ - MDRV_CPU_MEMORY(namcos22_readmem,namcos22_writemem) - MDRV_CPU_VBLANK_INT(namcos22_interrupt,1) +static void mcu_s22_io_w(int port, data8_t data) +{ +} - MDRV_FRAMES_PER_SECOND(60) - MDRV_VBLANK_DURATION(DEFAULT_REAL_60HZ_VBLANK_DURATION) +/*************************************************************************** + Machine +***************************************************************************/ + +static MACHINE_INIT( namcos22 ) +{ + master_enable(0); + slave_enable(0); + dsp_irq_enabled = 0; + cpu_set_reset_line(CPU_MCU, ASSERT_LINE); + + dsp_upload_state = DSP_UPLOAD_READY; + namcos22_irq_enabled = 0; + namcos22_irq_state = 0; + + namcos22_video_reset(); + mb87078_reset(); +} + +static void namcos22_common_init(int gametype, int ss22) +{ + int i; + const UINT8 *rom; + + namcos22_gametype = gametype; + namcos22_is_ss22 = ss22; + + namcos22_polygonram = auto_malloc(0x20000); + namcos22_shareram = auto_malloc(0x8000); + eeprom = auto_malloc(0x2000); + master_extram = auto_malloc(0x4000 * 2); + master_intram = auto_malloc(0x3000 * 2); + slave_extram = auto_malloc(0x2000 * 2); + pointram = auto_malloc(0x20000 * 4); + + memset(namcos22_polygonram, 0xcc, 0x20000); + memset(namcos22_shareram, 0, 0x8000); + memset(eeprom, 0xff, 0x2000); + memset(master_extram, 0, 0x4000 * 2); + memset(master_intram, 0, 0x3000 * 2); + memset(slave_extram, 0, 0x2000 * 2); + memset(pointram, 0, 0x20000 * 4); + + /* point ROM: three byte planes, low/mid/high */ + pointrom_size = memory_region_length(REGION_USER1) / 3; + pointrom = auto_malloc(pointrom_size * sizeof(INT32)); + rom = memory_region(REGION_USER1); + for (i = 0; i < pointrom_size; i++) + pointrom[i] = SIGNED24((rom[i + 2 * pointrom_size] << 16) | (rom[i + pointrom_size] << 8) | rom[i]); + + setup_dsps(); + + mcu_irq2_timer = timer_alloc(mcu_irq2_callback); + dsp_serial_timer = timer_alloc(dsp_serial_pulse); + timer_adjust(dsp_serial_timer, TIME_IN_HZ(100), 0, TIME_IN_HZ(100)); + + m37710_set_io_handlers(mcu_io_r, mcu_io_w); + set_adc_ports(-1, -1, -1, -1); + alpine_motor = 0; + + state_save_register_UINT32("namcos22", 0, "polygonram", namcos22_polygonram, 0x8000); + state_save_register_UINT16("namcos22", 0, "shareram", namcos22_shareram, 0x4000); + state_save_register_UINT8("namcos22", 0, "eeprom", eeprom, 0x2000); + state_save_register_UINT16("namcos22", 0, "master_extram", master_extram, 0x4000); + state_save_register_UINT16("namcos22", 0, "master_intram", master_intram, 0x3000); + state_save_register_UINT16("namcos22", 0, "slave_extram", slave_extram, 0x2000); + state_save_register_UINT32("namcos22", 0, "pointram", pointram, 0x20000); + state_save_register_UINT8("namcos22", 0, "syscontrol", namcos22_syscontrol, 0x20); + state_save_register_int("namcos22", 0, "irq_enabled", &namcos22_irq_enabled); + state_save_register_int("namcos22", 0, "irq_state", &namcos22_irq_state); + state_save_register_int("namcos22", 0, "dsp_irq_enabled", &dsp_irq_enabled); + state_save_register_UINT16("namcos22", 0, "dsp_master_bioz", &dsp_master_bioz, 1); + state_save_register_UINT32("namcos22", 0, "point_address", &point_address, 1); + state_save_register_UINT32("namcos22", 0, "point_data", &point_data, 1); + state_save_register_UINT16("namcos22", 0, "serial_next", &serial_slave_to_master_next, 1); + state_save_register_UINT16("namcos22", 0, "serial_current", &serial_slave_to_master_current, 1); + state_save_register_int("namcos22", 0, "renderbuf_size", &renderbuf_size); + state_save_register_UINT16("namcos22", 0, "renderbuf_data", renderbuf_data, MAX_RENDER_CMD_SEQ); + state_save_register_int("namcos22", 0, "dsp_upload_state", &dsp_upload_state); + state_save_register_int("namcos22", 0, "upload_dest_idx", &upload_dest_idx); + state_save_register_UINT16("namcos22", 0, "dspram_bank", &dspram_bank, 1); + state_save_register_UINT16("namcos22", 0, "dspram16_latch", &dspram16_latch, 1); + state_save_register_UINT16("namcos22", 0, "pdp_base", &pdp_base, 1); + state_save_register_UINT16("namcos22", 0, "keycus_rng", &keycus_rng, 1); + state_save_register_UINT8("namcos22", 0, "mcu_iocontrol", &mcu_iocontrol, 1); + state_save_register_UINT8("namcos22", 0, "mcu_outdata", &mcu_outdata, 1); + state_save_register_int("namcos22", 0, "pdp_render_done", &namcos22_pdp_render_done); + state_save_register_int("namcos22", 0, "render_refresh", &namcos22_render_refresh); + state_save_register_int("namcos22", 0, "slave_sim_active", &namcos22_slave_simulation_active); + state_save_register_UINT32("namcos22", 0, "pdp_frame", &namcos22_pdp_frame, 1); + state_save_register_UINT8("namcos22", 0, "mb87078_control", &mb87078_control, 1); + state_save_register_UINT8("namcos22", 0, "mb87078_data", &mb87078_data, 1); + state_save_register_UINT16("namcos22", 0, "mb87078_latch", mb87078_latch, 4); + state_save_register_func_postload(mb87078_gain_recalc); +} + +static MACHINE_DRIVER_START( namcos22s ) + MDRV_CPU_ADD_TAG("main", M68EC020, 24576000) + MDRV_CPU_MEMORY(namcos22s_readmem, namcos22s_writemem) + MDRV_CPU_VBLANK_INT(namcos22s_interrupt, 1) + + MDRV_CPU_ADD(NAMCOC71, 40000000) /* master DSP */ + MDRV_CPU_MEMORY(c71_readmem, c71_writemem) + MDRV_CPU_VBLANK_INT(dsp_vblank_irq, 1) + + MDRV_CPU_ADD(NAMCOC71, 40000000) /* slave DSP */ + MDRV_CPU_MEMORY(c71_readmem, c71_writemem) + + /* one cycle per two XIN clocks (current MAME clocks_to_cycles) */ + MDRV_CPU_ADD_TAG("mcu", M37702, 16384000 / 2) + MDRV_CPU_MEMORY(mcu_readmem, mcu_writemem) + MDRV_CPU_VBLANK_INT(namcos22s_mcu_interrupt, 1) + + MDRV_FRAMES_PER_SECOND(S22_REFRESH) + MDRV_VBLANK_DURATION(S22_VBLANK_USEC) + MDRV_INTERLEAVE(668) /* 40 kHz, as MAME */ + + MDRV_MACHINE_INIT(namcos22) + MDRV_NVRAM_HANDLER(namcos22) - /* video hardware */ MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_NEEDS_6BITS_PER_GUN | VIDEO_RGB_DIRECT) - MDRV_SCREEN_SIZE(NAMCOS22_NUM_COLS*16,NAMCOS22_NUM_ROWS*16) - MDRV_VISIBLE_AREA(0,NAMCOS22_NUM_COLS*16-1,0,NAMCOS22_NUM_ROWS*16-1) - MDRV_PALETTE_LENGTH(NAMCOS22_PALETTE_SIZE) - MDRV_GFXDECODE(gfxdecodeinfo) + MDRV_SCREEN_SIZE(640, 480) + MDRV_VISIBLE_AREA(0, 639, 0, 479) + MDRV_PALETTE_LENGTH(0x8000) MDRV_VIDEO_START(namcos22s) + MDRV_VIDEO_UPDATE(namcos22s) + MDRV_VIDEO_STOP(namcos22) + + MDRV_SOUND_ATTRIBUTES(SOUND_SUPPORTS_STEREO) + MDRV_SOUND_ADD(C352, namcos22_c352_interface) +MACHINE_DRIVER_END + +static MACHINE_DRIVER_START( namcos22 ) + MDRV_IMPORT_FROM(namcos22s) + + MDRV_CPU_REPLACE("main", M68020, 24576000) + MDRV_CPU_MEMORY(namcos22_readmem, namcos22_writemem) + MDRV_CPU_VBLANK_INT(namcos22_interrupt, 1) + + /* the C74 has no periodic interrupts: it runs off its timer A0 */ + MDRV_CPU_MODIFY("mcu") + MDRV_CPU_MEMORY(mcu_s22_readmem, mcu_s22_writemem) + MDRV_CPU_VBLANK_INT(NULL, 0) + + MDRV_VIDEO_START(namcos22) MDRV_VIDEO_UPDATE(namcos22) MACHINE_DRIVER_END -/*********************************************************************************/ -ROM_START( airco22b ) - ROM_REGION( 0x400000, REGION_CPU1, 0 ) /* main program */ - ROM_LOAD32_BYTE( "acs1verb.1", 0x00003, 0x100000, CRC(062c4f61) SHA1(98e1c75dd0f493eb6ebb64b46543217c1d40116e) ) - ROM_LOAD32_BYTE( "acs1verb.2", 0x00002, 0x100000, CRC(8ae69711) SHA1(4c5323fa8f0419275e330fec66d1fb2b89bb3795) ) - ROM_LOAD32_BYTE( "acs1verb.3", 0x00001, 0x100000, CRC(71738e67) SHA1(eb8c66dedbeff911b6166ebbda466fb9656ef0fb) ) - ROM_LOAD32_BYTE( "acs1verb.4", 0x00000, 0x100000, CRC(3b193add) SHA1(5e3bca13905bfa3a2947f4f16ca01878b0a14a3a) ) +/*************************************************************************** + Input ports +***************************************************************************/ - ROM_REGION( 0x200000*2, REGION_GFX1, ROMREGION_DISPOSE ) /* 32x32x8bpp sprite tiles */ - ROM_LOAD( "acs1scg0.12l", 0x200000*0, 0x200000,CRC(e5235404) SHA1(3133b71d1bde3a9815cd02e97382b8078b62b0bb) ) - ROM_LOAD( "acs1scg1.10l", 0x200000*1, 0x200000,CRC(828e91e7) SHA1(8383b029cd29fbad107fd49e866defb50c11c99a) ) +/* port 0: MCU inputs (16 bits, read 8 at a time), port 1: DIP switches SW4 (active low) */ - ROM_REGION( 0x200000*8, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ - ROM_LOAD( "acs1cg0.8d", 0x200000*0x0, 0x200000,CRC(1f31343e) SHA1(25ba730cec74e0ed0b404f5c4430b7c3368c9b52) ) - ROM_LOAD( "acs1cg1.10d", 0x200000*0x1, 0x200000,CRC(ccd5481d) SHA1(050e6fc7d4e0591f8ffc9552d140b6bd4533c06d) ) - ROM_LOAD( "acs1cg2.12d", 0x200000*0x2, 0x200000,CRC(14e5d0d2) SHA1(3147ad11098030e9cfd93fbc0a1b3aafa8b8aba6) ) - ROM_LOAD( "acs1cg3.13d", 0x200000*0x3, 0x200000,CRC(1a7bcc16) SHA1(bbc4ca5b208bea8394d1679e4e2d17d22331e2c8) ) - ROM_LOAD( "acs1cg4.14d", 0x200000*0x4, 0x200000,CRC(1920b7fb) SHA1(56318f2a96c55998bb9a8d791d56be3dfb39867e) ) - ROM_LOAD( "acs1cg5.16d", 0x200000*0x5, 0x200000,CRC(3dd109b7) SHA1(a7f914b9b80f1bca1afb6144698578a29ca74676) ) - ROM_LOAD( "acs1cg6.18d", 0x200000*0x6, 0x200000,CRC(ec71c8a3) SHA1(86892a91883d483ca0d422b78fa36042e02f3ad3) ) - ROM_LOAD( "acs1cg7.19d", 0x200000*0x7, 0x200000,CRC(82271757) SHA1(023c935e78b14da310e4c29da8785b82aa3241ac) ) +#define NAMCOS22S_DSW_UNKNOWN \ + PORT_START \ + PORT_DIPNAME( 0x01, 0x01, "SW4:1" ) \ + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) \ + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) \ + PORT_DIPNAME( 0x02, 0x02, "SW4:2" ) \ + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) \ + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) \ + PORT_DIPNAME( 0x04, 0x04, "SW4:3" ) \ + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) \ + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) \ + PORT_DIPNAME( 0x08, 0x08, "SW4:4" ) \ + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) \ + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) \ + PORT_DIPNAME( 0x10, 0x10, "SW4:5" ) \ + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) \ + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) \ + PORT_DIPNAME( 0x20, 0x20, "SW4:6" ) \ + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) \ + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) \ + PORT_DIPNAME( 0x40, 0x40, "SW4:7" ) \ + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) \ + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ - ROM_LOAD( "acs1ccrl.3d", 0x000000, 0x200000,CRC(07088ba1) SHA1(a962c0821d5af28ed508cfdbd613675454e306e3) ) - ROM_LOAD( "acs1ccrh.1d", 0x200000, 0x080000,CRC(62936af6) SHA1(ca80b68415aa2cd2ce4e90404f10640d0ae38be9) ) +INPUT_PORTS_START( timecris ) + PORT_START /* INPUTS */ + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) + PORT_BITX(0x0008, IP_ACTIVE_LOW, IPT_SERVICE, DEF_STR( Service_Mode ), KEYCODE_F2, IP_JOY_NONE ) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) /* gun trigger */ + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) /* foot pedal */ + PORT_BIT( 0xffc0, IP_ACTIVE_LOW, IPT_UNKNOWN ) - ROM_REGION( 0x80000*12, REGION_GFX4, 0 ) /* 3d model data */ - ROM_LOAD( "acs1ptl0.18k", 0x80000*0x0, 0x80000,CRC(bd5896c7) SHA1(58ec7d0f1e0bfdbf4908e1d920bbd7f094993777) ) - ROM_LOAD( "acs1ptl1.16k", 0x80000*0x1, 0x80000,CRC(e583b975) SHA1(beb0cc2b44bc69af057c2bb744cd7e1b95de577a) ) - ROM_LOAD( "acs1ptl2.15k", 0x80000*0x2, 0x80000,CRC(802d737a) SHA1(3d99a369db70d13fb87c2ff26c82b4b39afe94d9) ) - ROM_LOAD( "acs1ptl3.14k", 0x80000*0x3, 0x80000,CRC(fe556ecb) SHA1(9d9dbbb4f1d3688fb763001834640d79d9987d47) ) + NAMCOS22S_DSW_UNKNOWN + PORT_DIPNAME( 0x80, 0x80, "Test Mode" ) + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - ROM_LOAD( "acs1ptm0.18j", 0x80000*0x4, 0x80000,CRC(949b6c58) SHA1(6ea016551b10f5d5764921dcc5a4b81d2b93d701) ) - ROM_LOAD( "acs1ptm1.16j", 0x80000*0x5, 0x80000,CRC(8b2b99d9) SHA1(89c3545c4035509307728a9577018c1100ce3a54) ) - ROM_LOAD( "acs1ptm2.15j", 0x80000*0x6, 0x80000,CRC(f1515080) SHA1(27a87217a140477a6840a610c95ae57abc0d01a6) ) - ROM_LOAD( "acs1ptm3.14j", 0x80000*0x7, 0x80000,CRC(e364f4aa) SHA1(3af6a864765871664cccad82c4795f677be68d51) ) + PORT_START /* gun X */ + PORT_ANALOG( 0xff, 0x80, IPT_LIGHTGUN_X | IPF_PLAYER1, 50, 15, 1, 0xfe ) + PORT_START /* gun Y */ + PORT_ANALOG( 0xff, 0x80, IPT_LIGHTGUN_Y | IPF_PLAYER1, 50, 15, 1, 0xfe ) +INPUT_PORTS_END - ROM_LOAD( "acs1ptu0.18f", 0x80000*0x8, 0x80000,CRC(746b3084) SHA1(73397d1f22300fb3a81a0a068da4d0a8cfdc0a36) ) - ROM_LOAD( "acs1ptu1.16f", 0x80000*0x9, 0x80000,CRC(b44f1d3b) SHA1(f3f1a85c082053653e4da7d7f01f1baef1a013c8) ) - ROM_LOAD( "acs1ptu2.15f", 0x80000*0xa, 0x80000,CRC(fdd2d778) SHA1(0269f971d778e908a1efb5a63b08fb3365d98c2a) ) - ROM_LOAD( "acs1ptu3.14f", 0x80000*0xb, 0x80000,CRC(38b425d4) SHA1(8ff6dd6775d42afdff4c9fb2232e4d72b38e515a) ) +INPUT_PORTS_START( propcycl ) + PORT_START /* INPUTS */ + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) + PORT_BITX(0x0008, IP_ACTIVE_LOW, IPT_SERVICE, DEF_STR( Service_Mode ), KEYCODE_F2, IP_JOY_NONE ) + PORT_BIT( 0x00f0, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0xfe00, IP_ACTIVE_LOW, IPT_UNKNOWN ) - ROM_REGION( 0x080000, REGION_CPU2, 0 ) /* S22-BIOS ver1.30 */ - ROM_LOAD( "acs1data.8k", 0, 0x080000, CRC(33824bc9) SHA1(80ec63883770e5eec1f5f1ddc16a85ef8f22a48b) ) - ROM_REGION( 0x800000, REGION_USER2, 0 ) /* sound samples */ - ROM_LOAD( "acs1wav0.1", 0x000000, 0x400000, CRC(52fb9762) SHA1(125c163e62d701c2e17ba0b572ed27c944ca0412) ) - ROM_LOAD( "acs1wav1.2", 0x400000, 0x400000, CRC(b568dca2) SHA1(503deb277691d801acac1380ded2868a5d5ac501) ) + NAMCOS22S_DSW_UNKNOWN + PORT_DIPNAME( 0x80, 0x80, "SW4:8" ) + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_START /* ADC.0: stick X */ + PORT_ANALOG( 0x3ff, 0x1ff, IPT_AD_STICK_X | IPF_REVERSE, 100, 40, 0x0bf, 0x33f ) + PORT_START /* ADC.1: stick Y */ + PORT_ANALOG( 0x3ff, 0x1ff, IPT_AD_STICK_Y, 100, 40, 0x0bf, 0x33f ) + PORT_START /* OPT.0: cycle pedal (forward speed; MAME's 0x80-0xff range) */ + PORT_ANALOG( 0xff, 0x00, IPT_PEDAL, 100, 10, 0x00, 0x7f ) +INPUT_PORTS_END + + +INPUT_PORTS_START( ridgera2 ) + PORT_START /* INPUTS */ + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) /* shift down */ + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) /* shift up */ + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) /* deluxe cabinet only */ + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON3 ) /* clutch pedal */ + PORT_BIT( 0x00e0, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_DIPNAME( 0x2100, 0x2000, DEF_STR( Cabinet ) ) + PORT_DIPSETTING( 0x0000, "50 Inch" ) + PORT_DIPSETTING( 0x0100, "Twin" ) + PORT_DIPSETTING( 0x2000, "Standard" ) + PORT_DIPSETTING( 0x2100, "Deluxe" ) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_COIN2 ) + PORT_BITX(0x0400, IP_ACTIVE_LOW, IPT_SERVICE, DEF_STR( Service_Mode ), KEYCODE_F2, IP_JOY_NONE ) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_SERVICE1 ) + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0xc000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START /* SW2 */ + PORT_DIPNAME( 0x01, 0x01, "Test Mode" ) + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START /* SW3 */ + PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_DIPNAME( 0x80, 0x80, "Test Mode 2" ) + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_START /* ADC.0: steering */ + PORT_ANALOG( 0xfff, 0x800, IPT_PADDLE, 100, 160, 0x280, 0xd80 ) + PORT_START /* ADC.1: gas */ + PORT_ANALOG( 0xfff, 0x000, IPT_PEDAL, 100, 160, 0x000, 0x610 ) + PORT_START /* ADC.2: brake */ + PORT_ANALOG( 0xfff, 0x000, IPT_PEDAL2, 100, 160, 0x000, 0x610 ) +INPUT_PORTS_END + + +#define S22_SW_UNUSED \ + PORT_START /* SW2 */ \ + PORT_DIPNAME( 0x01, 0x01, "Test Mode" ) \ + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) \ + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) \ + PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED ) \ + PORT_START /* SW3 */ \ + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) + +#define S22_DRIVING_ANALOG(steer_min, steer_max, steer_delta, gas_max, gas_delta, brake_max, brake_delta) \ + PORT_START /* ADC.0: steering */ \ + PORT_ANALOG( 0xfff, 0x800, IPT_PADDLE, 100, steer_delta, steer_min, steer_max ) \ + PORT_START /* ADC.1: gas */ \ + PORT_ANALOG( 0xfff, 0x000, IPT_PEDAL, 100, gas_delta, 0x000, gas_max ) \ + PORT_START /* ADC.2: brake */ \ + PORT_ANALOG( 0xfff, 0x000, IPT_PEDAL2, 100, brake_delta, 0x000, brake_max ) + +INPUT_PORTS_START( ridgera ) + PORT_START /* INPUTS */ + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) /* shift down */ + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) /* shift up */ + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) /* deluxe cabinet only */ + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON3 ) /* clutch pedal */ + PORT_BIT( 0x00e0, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Cabinet ) ) + PORT_DIPSETTING( 0x0000, "Standard" ) + PORT_DIPSETTING( 0x0100, "Deluxe" ) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_COIN2 ) + PORT_BITX(0x0400, IP_ACTIVE_LOW, IPT_SERVICE, DEF_STR( Service_Mode ), KEYCODE_F2, IP_JOY_NONE ) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_SERVICE1 ) + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0xe000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + S22_SW_UNUSED + S22_DRIVING_ANALOG(0x280, 0xd80, 160, 0x610, 160, 0x610, 160) +INPUT_PORTS_END + +INPUT_PORTS_START( raverace ) + PORT_START /* INPUTS */ + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) /* shift down */ + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) /* shift up */ + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) /* deluxe cabinet only */ + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON3 ) /* clutch pedal */ + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON4 ) /* view change */ + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_DIPNAME( 0x2100, 0x2000, DEF_STR( Cabinet ) ) + PORT_DIPSETTING( 0x0000, "50 Inch" ) + PORT_DIPSETTING( 0x0100, "Twin" ) + PORT_DIPSETTING( 0x2000, "Standard" ) + PORT_DIPSETTING( 0x2100, "Deluxe" ) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_COIN2 ) + PORT_BITX(0x0400, IP_ACTIVE_LOW, IPT_SERVICE, DEF_STR( Service_Mode ), KEYCODE_F2, IP_JOY_NONE ) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_SERVICE1 ) + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0xc000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + S22_SW_UNUSED + S22_DRIVING_ANALOG(0x280, 0xd80, 160, 0x610, 160, 0x610, 160) +INPUT_PORTS_END + +INPUT_PORTS_START( acedrive ) + PORT_START /* INPUTS */ + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) /* shift down */ + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) /* shift up */ + PORT_BIT( 0x003c, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) /* view change */ + PORT_BIT( 0x0180, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_COIN2 ) + PORT_BITX(0x0400, IP_ACTIVE_LOW, IPT_SERVICE, DEF_STR( Service_Mode ), KEYCODE_F2, IP_JOY_NONE ) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_SERVICE1 ) + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x6000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) /* motion stop */ + + PORT_START /* SW2 */ + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_START /* SW3: test mode is SW3:7 + SW3:8 */ + PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_DIPNAME( 0x40, 0x40, "Test Mode (SW3:7)" ) + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, "Test Mode (SW3:8)" ) + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + S22_DRIVING_ANALOG(0x200, 0xe00, 160, 0x480, 120, 0x240, 80) +INPUT_PORTS_END + +/* the test mode shows +-224: the EEPROM is calibrated for these ranges */ +INPUT_PORTS_START( cybrcomm ) + PORT_START /* INPUTS */ + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 ) /* gun trigger */ + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 ) /* missile button */ + PORT_BIT( 0x003c, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) /* view change */ + PORT_BIT( 0x0180, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_COIN2 ) + PORT_BITX(0x0400, IP_ACTIVE_LOW, IPT_SERVICE, DEF_STR( Service_Mode ), KEYCODE_F2, IP_JOY_NONE ) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_SERVICE1 ) + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0xe000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START /* SW2 */ + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_START /* SW3 */ + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START /* ADC.0: right joystick, vertical */ + PORT_ANALOG( 0xff, 0x7f, IPT_AD_STICK_Y | IPF_PLAYER2, 100, 10, 0x47, 0xb7 ) + PORT_START /* ADC.1: left joystick, vertical */ + PORT_ANALOG( 0xff, 0x7f, IPT_AD_STICK_Y | IPF_PLAYER1, 100, 10, 0x47, 0xb7 ) + PORT_START /* ADC.2: right joystick, horizontal */ + PORT_ANALOG( 0xff, 0x7f, IPT_AD_STICK_X | IPF_PLAYER2, 100, 10, 0x47, 0xb7 ) + PORT_START /* ADC.3: left joystick, horizontal */ + PORT_ANALOG( 0xff, 0x7f, IPT_AD_STICK_X | IPF_PLAYER1, 100, 10, 0x47, 0xb7 ) +INPUT_PORTS_END + +/* Super System 22 */ + +#define SS22_DSW_TEST \ + NAMCOS22S_DSW_UNKNOWN \ + PORT_DIPNAME( 0x80, 0x80, "SW4:8" ) \ + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) \ + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + +/* SW4:1 is the test mode */ +#define SS22_DSW_TEST1 \ + PORT_START \ + PORT_DIPNAME( 0x01, 0x01, "Test Mode" ) \ + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) \ + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) \ + PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED ) + +/* bits 7 and 8 are the steplock motor state, set by the driver */ +INPUT_PORTS_START( alpiner ) + PORT_START /* INPUTS */ + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) + PORT_BITX(0x0008, IP_ACTIVE_LOW, IPT_SERVICE, DEF_STR( Service_Mode ), KEYCODE_F2, IP_JOY_NONE ) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_START1 ) /* decision / view change */ + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_4WAY ) /* L selection */ + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY ) /* R selection */ + PORT_BIT( 0x0180, IP_ACTIVE_LOW, IPT_SPECIAL ) + PORT_BIT( 0xfe00, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + SS22_DSW_TEST + + PORT_START /* ADC.0: steps swing */ + PORT_ANALOG( 0x3ff, 0x200, IPT_AD_STICK_X, 100, 16, 0x080, 0x380 ) + PORT_START /* ADC.1: steps edge */ + PORT_ANALOG( 0x3ff, 0x200, IPT_AD_STICK_X | IPF_PLAYER2, 100, 16, 0x080, 0x380 ) +INPUT_PORTS_END + +INPUT_PORTS_START( alpines ) + PORT_START /* INPUTS */ + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) + PORT_BITX(0x0008, IP_ACTIVE_LOW, IPT_SERVICE, DEF_STR( Service_Mode ), KEYCODE_F2, IP_JOY_NONE ) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_START1 ) /* decision / view change */ + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_4WAY ) /* L selection */ + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY ) /* R selection */ + PORT_BIT( 0x0180, IP_ACTIVE_LOW, IPT_SPECIAL ) + PORT_BIT( 0xfe00, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + SS22_DSW_TEST + + PORT_START /* ADC.0: steps swing */ + PORT_ANALOG( 0x3ff, 0x200, IPT_AD_STICK_X | IPF_REVERSE, 100, 16, 0x080, 0x380 ) + PORT_START /* ADC.1: steps edge */ + PORT_ANALOG( 0x3ff, 0x200, IPT_AD_STICK_X | IPF_PLAYER2, 100, 16, 0x080, 0x380 ) +INPUT_PORTS_END + +INPUT_PORTS_START( airco22 ) + PORT_START /* INPUTS */ + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) + PORT_BITX(0x0008, IP_ACTIVE_LOW, IPT_SERVICE, DEF_STR( Service_Mode ), KEYCODE_F2, IP_JOY_NONE ) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) /* missile button */ + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON1 ) /* gun trigger */ + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_START1 ) /* also view change */ + PORT_BIT( 0xff80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + SS22_DSW_TEST + + PORT_START /* ADC.0: stick X */ + PORT_ANALOG( 0x3ff, 0x200, IPT_AD_STICK_X, 100, 12, 0x100, 0x300 ) + PORT_START /* ADC.1: stick Y */ + PORT_ANALOG( 0x3ff, 0x200, IPT_AD_STICK_Y, 100, 12, 0x100, 0x300 ) + PORT_START /* ADC.2 = 0x200 + this - next: throttle stick, auto-centering */ + PORT_ANALOG( 0x3ff, 0x000, IPT_PEDAL, 100, 12, 0x000, 0x100 ) + PORT_START + PORT_ANALOG( 0x3ff, 0x000, IPT_PEDAL2, 100, 12, 0x000, 0x100 ) +INPUT_PORTS_END + +INPUT_PORTS_START( cybrcycc ) + PORT_START /* INPUTS */ + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) + PORT_BITX(0x0008, IP_ACTIVE_LOW, IPT_SERVICE, DEF_STR( Service_Mode ), KEYCODE_F2, IP_JOY_NONE ) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_START1 ) /* also view change */ + PORT_BIT( 0xffe0, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + SS22_DSW_TEST1 + + PORT_START /* ADC.0: bike bank */ + PORT_ANALOG( 0x3ff, 0x200, IPT_PADDLE, 100, 40, 0x004, 0x3fc ) + PORT_START /* ADC.1: throttle grip */ + PORT_ANALOG( 0x3ff, 0x000, IPT_PEDAL, 100, 40, 0x000, 0x300 ) + PORT_START /* ADC.2: brake lever */ + PORT_ANALOG( 0x3ff, 0x000, IPT_PEDAL2, 100, 40, 0x000, 0x100 ) +INPUT_PORTS_END + +INPUT_PORTS_START( dirtdash ) + PORT_START /* INPUTS */ + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) + PORT_BITX(0x0008, IP_ACTIVE_LOW, IPT_SERVICE, DEF_STR( Service_Mode ), KEYCODE_F2, IP_JOY_NONE ) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON3 ) /* view change */ + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) /* shift up */ + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) /* shift down */ + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON4 ) /* motion stop */ + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Cabinet ) ) /* J4 pin 6 on the mother PCB */ + PORT_DIPSETTING( 0x0000, "Standard" ) + PORT_DIPSETTING( 0x0200, "Deluxe" ) /* motion cabinet */ + PORT_BIT( 0xfc00, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + SS22_DSW_TEST + + PORT_START /* ADC.0: steering */ + PORT_ANALOG( 0x3ff, 0x200, IPT_PADDLE, 100, 12, 0x001, 0x3ff ) + PORT_START /* ADC.1: gas */ + PORT_ANALOG( 0x3ff, 0x000, IPT_PEDAL, 100, 40, 0x000, 0x140 ) + PORT_START /* ADC.2: brake */ + PORT_ANALOG( 0x3ff, 0x000, IPT_PEDAL2, 100, 40, 0x000, 0x100 ) +INPUT_PORTS_END + +INPUT_PORTS_START( tokyowar ) + PORT_START /* INPUTS */ + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) + PORT_BITX(0x0008, IP_ACTIVE_LOW, IPT_SERVICE, DEF_STR( Service_Mode ), KEYCODE_F2, IP_JOY_NONE ) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_START1 ) /* also view change */ + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) /* right trigger */ + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) /* left trigger */ + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Cabinet ) ) + PORT_DIPSETTING( 0x0080, "Standard" ) + PORT_DIPSETTING( 0x0000, "Deluxe" ) /* cannon recoil motors */ + PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + SS22_DSW_TEST1 + + PORT_START /* ADC.0: steering */ + PORT_ANALOG( 0x3ff, 0x200, IPT_PADDLE, 100, 20, 0x100, 0x300 ) + PORT_START /* ADC.2: forward pedal */ + PORT_ANALOG( 0x3ff, 0x000, IPT_PEDAL, 100, 20, 0x000, 0x100 ) + PORT_START /* ADC.3: backward pedal */ + PORT_ANALOG( 0x3ff, 0x000, IPT_PEDAL2, 100, 20, 0x000, 0x100 ) +INPUT_PORTS_END + +INPUT_PORTS_START( aquajet ) + PORT_START /* INPUTS */ + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) + PORT_BITX(0x0008, IP_ACTIVE_LOW, IPT_SERVICE, DEF_STR( Service_Mode ), KEYCODE_F2, IP_JOY_NONE ) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0xffe0, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + SS22_DSW_TEST1 + + PORT_START /* ADC.0: handle bar */ + PORT_ANALOG( 0x3ff, 0x1fc, IPT_PADDLE | IPF_REVERSE, 100, 40, 0x000, 0x3f8 ) + PORT_START /* ADC.1 = 0x1fc - this: throttle */ + PORT_ANALOG( 0x3ff, 0x000, IPT_PEDAL, 100, 40, 0x000, 0x11c ) + PORT_START /* ADC.2: body lean */ + PORT_ANALOG( 0x3ff, 0x1fc, IPT_AD_STICK_Y | IPF_REVERSE, 100, 40, 0x000, 0x3f8 ) +INPUT_PORTS_END + +INPUT_PORTS_START( adillor ) + PORT_START /* INPUTS */ + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) + PORT_BITX(0x0008, IP_ACTIVE_LOW, IPT_SERVICE, DEF_STR( Service_Mode ), KEYCODE_F2, IP_JOY_NONE ) + PORT_BIT( 0x00f0, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0xfe00, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + SS22_DSW_TEST1 + + PORT_START /* OPT.0 */ + PORT_ANALOG( 0xffff, 0x0000, IPT_TRACKBALL_X, 100, 16, 0, 0 ) + PORT_START /* OPT.1 */ + PORT_ANALOG( 0xffff, 0x0000, IPT_TRACKBALL_Y | IPF_REVERSE, 100, 16, 0, 0 ) + PORT_START + PORT_DIPNAME( 0x02, 0x02, "Trackball Orientation" ) + PORT_DIPSETTING( 0x00, "Direct" ) + PORT_DIPSETTING( 0x02, "Natural" ) +INPUT_PORTS_END + + +/*************************************************************************** + ROMs +***************************************************************************/ + +#define C71_BIOS \ + ROM_REGION16_BE( 0x2000, REGION_CPU2, 0 ) /* master DSP internal ROM */ \ + ROM_LOAD( "c71.bin", 0, 0x2000, CRC(47c623ab) SHA1(e363ac50f5556f83308d4cc191b455e9b62bcfc8) ) \ + ROM_REGION16_BE( 0x2000, REGION_CPU3, 0 ) /* slave DSP internal ROM */ \ + ROM_LOAD( "c71.bin", 0, 0x2000, CRC(47c623ab) SHA1(e363ac50f5556f83308d4cc191b455e9b62bcfc8) ) + +#define TIMECRIS_DATA \ + ROM_REGION16_LE( 0x80000, REGION_CPU4, 0 ) /* MCU: S22-BIOS ver1.30 and data */ \ + ROM_LOAD( "ts1data.8k", 0, 0x080000, CRC(e68aa973) SHA1(663e80d249be5d5841139d98a9d72e2396851272) ) \ + C71_BIOS \ + ROM_REGION( 0x1000000, REGION_GFX1, ROMREGION_ERASEFF ) /* 32x32x8bpp sprite tiles */ \ + ROM_LOAD( "ts1scg0.12f", 0x000000, 0x200000, CRC(14a3674d) SHA1(c5792a385572452b43bbc7eb8428335b19daa3c0) ) \ + ROM_LOAD( "ts1scg1.10f", 0x200000, 0x200000, CRC(11791dbf) SHA1(3d75b468d69a8bf398d45f310cdb8bc88b63f25c) ) \ + ROM_LOAD( "ts1scg2.8f", 0x400000, 0x200000, CRC(d630fff9) SHA1(691394027b858702f06282f965f5b53e6fed496b) ) \ + ROM_LOAD( "ts1scg3.7f", 0x600000, 0x200000, CRC(1a62f015) SHA1(7d09ae480ae7813391616ae0090929ba845a345a) ) \ + ROM_LOAD( "ts1scg4.5f", 0x800000, 0x200000, CRC(511b8dd6) SHA1(936649c0a61d29f024a28e4ab64cce4b55d58f64) ) \ + ROM_LOAD( "ts1scg5.3f", 0xa00000, 0x200000, CRC(553bb246) SHA1(94659bee4fd0afe834a8bf3414d8825411cf9e86) ) \ + ROM_REGION( 0x1000000, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ \ + ROM_LOAD( "ts1cg0.8d", 0x000000, 0x200000, CRC(de07b22c) SHA1(f4d07b8840ec8be625eff634bce619e960c334a5) ) \ + ROM_LOAD( "ts1cg1.10d", 0x200000, 0x200000, CRC(992d26f6) SHA1(a0b9007312804b413d4c1748527378da4d8d53b3) ) \ + ROM_LOAD( "ts1cg2.12d", 0x400000, 0x200000, CRC(6273954f) SHA1(d73a43888b53e4c42fc33e8e1b38e60fd3329413) ) \ + ROM_LOAD( "ts1cg3.13d", 0x600000, 0x200000, CRC(38171f24) SHA1(d04caaa5b1b377ced38501b014e4cb7fc831c41d) ) \ + ROM_LOAD( "ts1cg4.14d", 0x800000, 0x200000, CRC(51f09856) SHA1(0eef421907ee813d5117e62cf0005bf00eb29c88) ) \ + ROM_LOAD( "ts1cg5.16d", 0xa00000, 0x200000, CRC(4cd9fd79) SHA1(0d2018ec914683a75bdec8655d678fd562eb6d15) ) \ + ROM_LOAD( "ts1cg6.18d", 0xc00000, 0x200000, CRC(f17f2ec9) SHA1(ed88ec524626e5bbe2e1ea6838412d3ac85671dd) ) \ + ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap: 16-bit little endian words, then packed attribute nibbles */ \ + ROM_LOAD( "ts1ccrl.3d", 0x000000, 0x200000, CRC(56cad2df) SHA1(49c0e57d5cf5d5fc4c75da6969bec01d6d443259) ) \ + ROM_LOAD( "ts1ccrh.1d", 0x200000, 0x080000, CRC(a1cc3741) SHA1(7fe57924c42e287b134e5d7ad00cffdff1f18084) ) \ + ROM_REGION( 0x480000, REGION_USER1, 0 ) /* 3D model data */ \ + ROM_LOAD( "ts1ptrl0.18k", 0x000000, 0x080000, CRC(e5f2d275) SHA1(2f5057e65ec8a3ec03f841f15f10769ae1f69139) ) \ + ROM_LOAD( "ts1ptrl1.16k", 0x080000, 0x080000, CRC(2bba3800) SHA1(1d9c944cb06417cb0ac47a58b922dddb83387586) ) \ + ROM_LOAD( "ts1ptrl2.15k", 0x100000, 0x080000, CRC(d4441c08) SHA1(6a6bb9cecbf35cb81b7681e220fc33df9a01d07f) ) \ + ROM_LOAD( "ts1ptrm0.18j", 0x180000, 0x080000, CRC(8aea02ba) SHA1(44ba85ba6d59758448d17ec39dfb628882ddc684) ) \ + ROM_LOAD( "ts1ptrm1.16j", 0x200000, 0x080000, CRC(bccf19bc) SHA1(4a6566948bdd2b0f82b7c30e57d3fe65005c26e3) ) \ + ROM_LOAD( "ts1ptrm2.15j", 0x280000, 0x080000, CRC(7280be31) SHA1(476b7171ae855d8bbd968ccbaa55b5100d274e3b) ) \ + ROM_LOAD( "ts1ptru0.18f", 0x300000, 0x080000, CRC(c30d6332) SHA1(a5c59d0abfe38de975fa0d606ed8500eb02008b7) ) \ + ROM_LOAD( "ts1ptru1.16f", 0x380000, 0x080000, CRC(993cde84) SHA1(c9cdcca1d60bcc41ad881c02dda9895563963ead) ) \ + ROM_LOAD( "ts1ptru2.15f", 0x400000, 0x080000, CRC(7cb25c73) SHA1(616eab3ac238864a584394f7ec8736ece227974a) ) \ + ROM_REGION( 0x1000000, REGION_SOUND1, 0 ) /* C352 samples */ \ + ROM_LOAD16_WORD_SWAP( "ts1wavea.2l", 0x000000, 0x400000, CRC(d1123301) SHA1(4bf1fd746fef4e6befa63c61a761971d729e1573) ) \ + ROM_LOAD( "ts1waveb.1l", 0x800000, 0x200000, CRC(bf4d7272) SHA1(c7c7b3620e7b3176644b6784ee36e679c9e31cc1) ) + +#define NAMCO_C74_BIOS \ + ROM_REGION( 0x4000, REGION_USER4, 0 ) /* C74 internal BIOS */ \ + ROM_LOAD( "c74.bin", 0x0000, 0x4000, CRC(a3dce360) SHA1(8f3248b1890abb2e649927240ae46f73bb171e3b) ) + +ROM_START( namcoc74 ) + NAMCO_C74_BIOS ROM_END -ROM_START( alpinerc ) - ROM_REGION( 0x400000, REGION_CPU1, 0 ) /* main program */ - ROM_LOAD32_BYTE( "ar2ver-c.1", 0x00003, 0x100000, CRC(61323842) SHA1(e3c33248340bee252f230124fa9b7fa935a60565) ) - ROM_LOAD32_BYTE( "ar2ver-c.2", 0x00002, 0x100000, CRC(43795b2d) SHA1(e060f3259661279a36300431c5ca7347bde8b6ec) ) - ROM_LOAD32_BYTE( "ar2ver-c.3", 0x00001, 0x100000, CRC(acb3003b) SHA1(ea0cbf3a1607b06b108df051f38fec1f214f42d2) ) - ROM_LOAD32_BYTE( "ar2ver-c.4", 0x00000, 0x100000, CRC(a57b4e60) SHA1(9dd8508f376711f55f8e7ae195de7d05367bcdee) ) +#define RIDGERA2_DATA \ + ROM_REGION16_LE( 0x80000, REGION_CPU4, 0 ) /* sound data */ \ + ROM_LOAD( "rrs1data.6r", 0, 0x080000, CRC(b7063aa8) SHA1(08ff689e8dd529b91eee423c93f084945c6de417) ) \ + C71_BIOS \ + NAMCO_C74_BIOS \ + ROM_REGION( 0x1000000, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ \ + ROM_LOAD( "rrs1cg0.1a", 0x800000, 0x200000, CRC(714c0091) SHA1(df29512bd6e64827660c40304051366d2c4d7977) ) \ + ROM_LOAD( "rrs1cg1.2a", 0xa00000, 0x200000, CRC(836545c1) SHA1(05e3346463d8d42b5d33216207e855033a65510d) ) \ + ROM_LOAD( "rrs1cg2.3a", 0xc00000, 0x200000, CRC(00e9799d) SHA1(280184451138420f64080efe13e5e2795f7b61d4) ) \ + ROM_LOAD( "rrs1cg3.5a", 0xe00000, 0x200000, CRC(3858983f) SHA1(feda270b71f1310ecf4c17823bc8827ca2951b40) ) \ + ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ \ + ROM_LOAD( "rrs1ccrl.5a", 0x000000, 0x200000, CRC(304a8b57) SHA1(f4f3e7c194697d754375f36a0e41d0941fa5d225) ) \ + ROM_LOAD( "rrs1ccrh.5c", 0x200000, 0x080000, CRC(bd3c86ab) SHA1(cd3a8774843c5864e651fa8989c80e2d975a13e8) ) \ + ROM_REGION( 0x300000, REGION_USER1, 0 ) /* 3D model data */ \ + ROM_LOAD( "rrs1pol0.5b", 0x000000, 0x080000, CRC(9376c384) SHA1(cde0e36db1beab1523607098a760d81fac2ea90e) ) \ + ROM_LOAD( "rrs1pol1.4b", 0x080000, 0x080000, CRC(094fa832) SHA1(cc59442540b1cdef068c4408b6e048c11042beb8) ) \ + ROM_LOAD( "rrs1pom0.5c", 0x100000, 0x080000, CRC(b47a7f8b) SHA1(0fa0456ad8b4864a7071b5b5ba1a78877c1ac0f0) ) \ + ROM_LOAD( "rrs1pom1.4c", 0x180000, 0x080000, CRC(27260361) SHA1(8775cc779eb8b6a0d79fa84d606c970ec2d6ea8d) ) \ + ROM_LOAD( "rrs1pou0.5d", 0x200000, 0x080000, CRC(74d6ec84) SHA1(63f5beee51443c98100330ec04291f71e10716c4) ) \ + ROM_LOAD( "rrs1pou1.4d", 0x280000, 0x080000, CRC(f527caaa) SHA1(f92bdd15323239d593ddac92a11d23a27e6635ed) ) \ + ROM_REGION( 0x1000000, REGION_SOUND1, 0 ) /* C352 samples */ \ + ROM_LOAD( "rrs1wav0.10r", 0x000000, 0x100000, CRC(99d11a2d) SHA1(1f3db98a99be0f07c03b0a7817561459a58f310e) ) \ + ROM_LOAD( "rrs1wav1.10p", 0x200000, 0x100000, CRC(ad28444a) SHA1(c31bbf3cae5015e5494fe4988b9b01d822224c69) ) \ + ROM_LOAD( "rrs1wav2.10n", 0x100000, 0x100000, CRC(6f0d4619) SHA1(cd3d57f2ea21497f388ffa29ec7d2665647a01c0) ) \ + ROM_LOAD( "rrs1wav3.10l", 0x300000, 0x100000, CRC(106e761f) SHA1(97f47b857bdcbc79b0aface53dd385e67fcc9108) ) \ + ROM_REGION( 0x300, REGION_PROMS, 0 ) /* gamma */ \ + ROM_LOAD( "rr1gam.2d", 0x0000, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) \ + ROM_LOAD( "rr1gam.3d", 0x0100, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) \ + ROM_LOAD( "rr1gam.4d", 0x0200, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) - ROM_REGION( 0x200000*2, REGION_GFX1, ROMREGION_DISPOSE ) /* 32x32x8bpp sprite tiles */ - ROM_LOAD( "ar1scg0.12f", 0x200000*0, 0x200000,CRC(e7be830a) SHA1(60e2162eecd7401a0c26c525de2715cbfb10c1c5) ) /* identical to "ar1scg0.12l" */ - ROM_LOAD( "ar1scg1.10f", 0x200000*1, 0x200000,CRC(8f15a686) SHA1(bce2d4380c6c39aa402566ddb0f62bbe6d7bfa1d) ) /* identical to "ar1scg1.10l" */ - - ROM_REGION( 0x200000*8, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ - ROM_LOAD( "ar1cg0.12b", 0x200000*0x0, 0x200000,CRC(93f3a9d9) SHA1(7e94c81ad5ace98a2f0d00d101d464883d38c197) ) /* identical to "ar1cg0.8d" */ - ROM_LOAD( "ar1cg1.10d", 0x200000*0x1, 0x200000,CRC(39828c8b) SHA1(424aa67eb0b898c9cab8a4749893a9c5696ac430) ) /* identical to "ar1cg1.13b" */ - ROM_LOAD( "ar1cg2.12d", 0x200000*0x2, 0x200000,CRC(f7b058d1) SHA1(fffd0f01724a26dd47b1ecceecf4a139d5746f81) ) /* identical to "ar1cg2.14b" */ - ROM_LOAD( "ar1cg3.13d", 0x200000*0x3, 0x200000,CRC(c28a3d2a) SHA1(cdc44fdbc99274e860c834e42b4cfafb478d4d26) ) /* identical to "ar1cg3.16b" */ - ROM_LOAD( "ar1cg4.14d", 0x200000*0x4, 0x200000,CRC(abdb161f) SHA1(260bff9b0e94c1b2ea4b9d7fa170fbca212e85ee) ) /* identical to "ar1cg4.18b" */ - ROM_LOAD( "ar1cg5.16d", 0x200000*0x5, 0x200000,CRC(2381cfea) SHA1(1de4c8b94df233fd74771fa47843290a3d8df0c8) ) /* identical to "ar1cg5.19b" */ - ROM_LOAD( "ar1cg6.18a", 0x200000*0x6, 0x200000,CRC(ca0b6d23) SHA1(df969e0eeec557a95584b06995b0d55f2c6ec70a) ) /* identical to "ar1cg6.18d" */ - ROM_LOAD( "ar1cg7.15a", 0x200000*0x7, 0x200000,CRC(ffb9f9f9) SHA1(2b8c75b580f77e887df7d50909a3a95cda570e20) ) /* identical to "ar1cg7.19d" */ - - ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ - ROM_LOAD( "ar1ccrl.3d", 0x000000, 0x200000,CRC(17387b2c) SHA1(dfd7cadaf97917347c0fa98f395364a543e49612) ) /* identical to "ar1ccrl.7b" */ - ROM_LOAD( "ar1ccrh.1d", 0x200000, 0x080000,CRC(ee7a4803) SHA1(8383c9a8ef5ed94df13446ca5cefa5f9e518f175) ) /* identical to "pr1ccrh.5b" */ - - ROM_REGION( 0x80000*12, REGION_GFX4, 0 ) /* 3d model data */ - ROM_LOAD( "ar1ptrl0.18k", 0x80000*0x0, 0x80000,CRC(82405108) SHA1(0a40882a9bc8621c620bede404c78f6b1333f223) ) - ROM_LOAD( "ar1ptrl1.16k", 0x80000*0x1, 0x80000,CRC(8739b09c) SHA1(cd603c4dc2f9ffc4185f891eb83e4c383c564294) ) - ROM_LOAD( "ar1ptrl2.15k", 0x80000*0x2, 0x80000,CRC(bda693a9) SHA1(fe71dd3c63198737aa2d39527f0004e977e3be20) ) - ROM_LOAD( "ar1ptrl3.14k", 0x80000*0x3, 0x80000,CRC(82797405) SHA1(2f205fee2d33e183c80a906fb38900167c011240) ) - - ROM_LOAD( "ar1ptrm0.18j", 0x80000*0x4, 0x80000,CRC(29d92097) SHA1(2c492747b295dd715d3a19c8a2cd919b97d095a0) ) - ROM_LOAD( "ar1ptrm1.16j", 0x80000*0x5, 0x80000,CRC(2232f0a5) SHA1(3fccf6d4a0c4100cc85e3051024d659c4a1c769e) ) - ROM_LOAD( "ar1ptrm2.15j", 0x80000*0x6, 0x80000,CRC(8ee14e6f) SHA1(f6f1cbb748b109b365255378c18e710ba6270c1c) ) - ROM_LOAD( "ar1ptrm3.14j", 0x80000*0x7, 0x80000,CRC(1094a970) SHA1(d41b10f48e1ef312bcaf09f27fabc7252c30e648) ) - - ROM_LOAD( "ar1ptru0.18f", 0x80000*0x8, 0x80000,CRC(26d88467) SHA1(d528f989fab4dd5ac1aec9b596a05fbadcc0587a) ) - ROM_LOAD( "ar1ptru1.16f", 0x80000*0x9, 0x80000,CRC(c5e2c208) SHA1(152fde0b95a5df8c781e4a83577cfbbc7672ae0d) ) - ROM_LOAD( "ar1ptru2.15f", 0x80000*0xa, 0x80000,CRC(1321ec59) SHA1(dbd3687a4c6b1aa0b18e336f99dabb9010d36639) ) - ROM_LOAD( "ar1ptru3.14f", 0x80000*0xb, 0x80000,CRC(139d7dc1) SHA1(6d25e6ad552a91a0c5fc03db7e1a801ccf9c9556) ) - - ROM_REGION( 0x080000, REGION_CPU2, 0 ) /* S22-BIOS ver1.30 */ - ROM_LOAD( "ar1datab.8k", 0, 0x080000, CRC(c26306f8) SHA1(6d8d993c076d5ced523143a86bd0938b3794478d) ) - ROM_REGION( 0x200000, REGION_USER2, 0 ) /* sound samples */ - ROM_LOAD( "ar1wavea.2l", 0, 0x200000, CRC(dbf64562) SHA1(454fd7d5b860f0e5557d8900393be95d6c992ad1) ) +ROM_START( ridgera2 ) + ROM_REGION( 0x200000, REGION_CPU1, 0 ) /* main program */ + ROM_LOAD32_BYTE( "rrs2_prgll.4d", 0x00003, 0x80000, CRC(88199c0f) SHA1(5cf5bb714c3d209943a8d815eaea60afd34641ff) ) + ROM_LOAD32_BYTE( "rrs2_prglm.2d", 0x00002, 0x80000, CRC(8e86f199) SHA1(7bd9ec9147ef0380864508f66203ef2c6ad1f7f6) ) + ROM_LOAD32_BYTE( "rrs2_prgum.8d", 0x00001, 0x80000, CRC(78c360b6) SHA1(8ee502291359cbc8aef39145c8fe7538311cc58f) ) + ROM_LOAD32_BYTE( "rrs2_prguu.6d", 0x00000, 0x80000, CRC(60d6d4a4) SHA1(759762a9b7d7aee7ee1b44b1721e5356898aa7ea) ) + RIDGERA2_DATA ROM_END -ROM_START( alpinerd ) +ROM_START( ridgera2j ) + ROM_REGION( 0x200000, REGION_CPU1, 0 ) /* main program */ + ROM_LOAD32_BYTE( "rrs1_prgllb.4d", 0x00003, 0x80000, CRC(22f069e5) SHA1(fcaec3aa83853c39d713ed01c511060663027ccd) ) + ROM_LOAD32_BYTE( "rrs1_prglmb.2d", 0x00002, 0x80000, CRC(8e86f199) SHA1(7bd9ec9147ef0380864508f66203ef2c6ad1f7f6) ) + ROM_LOAD32_BYTE( "rrs1_prgumb.8d", 0x00001, 0x80000, CRC(78c360b6) SHA1(8ee502291359cbc8aef39145c8fe7538311cc58f) ) + ROM_LOAD32_BYTE( "rrs1_prguub.6d", 0x00000, 0x80000, CRC(60d6d4a4) SHA1(759762a9b7d7aee7ee1b44b1721e5356898aa7ea) ) + RIDGERA2_DATA +ROM_END + +ROM_START( ridgera2ja ) + ROM_REGION( 0x200000, REGION_CPU1, 0 ) /* main program */ + ROM_LOAD32_BYTE( "rrs1_prgll.4d", 0x00003, 0x80000, CRC(fbf785a2) SHA1(b9333c7623f68f48aa6ae50913a22a527a19576a) ) + ROM_LOAD32_BYTE( "rrs1_prglm.2d", 0x00002, 0x80000, CRC(562f747a) SHA1(79d818b87c9a992fc9706fb39e6d560c2b0aa392) ) + ROM_LOAD32_BYTE( "rrs1_prgum.8d", 0x00001, 0x80000, CRC(93259fb0) SHA1(c29787e873797a003db27adbd20d7b852e26d8c6) ) + ROM_LOAD32_BYTE( "rrs1_prguu.6d", 0x00000, 0x80000, CRC(31cdefe8) SHA1(ae836d389bed43dd156eb4cf3e97b6f1ad68181e) ) + RIDGERA2_DATA +ROM_END + + +ROM_START( timecris ) ROM_REGION( 0x400000, REGION_CPU1, 0 ) /* main program */ - ROM_LOAD32_BYTE( "ar2ver-d.1", 0x00003, 0x100000, CRC(fa3380b9) SHA1(2a46988745bd2672f8082399a68ae0d0ab3d28f2) ) - ROM_LOAD32_BYTE( "ar2ver-d.2", 0x00002, 0x100000, CRC(76141352) SHA1(0f7230dd9cd6f1b83d499034affc7bc2c4385ab5) ) - ROM_LOAD32_BYTE( "ar2ver-d.3", 0x00001, 0x100000, CRC(9beffe6a) SHA1(d8efd1e3829d32bb06537d7cecb59f8df9b6d663) ) - ROM_LOAD32_BYTE( "ar2ver-d.4", 0x00000, 0x100000, CRC(1f3f1134) SHA1(0afa78444d1463d214f1afd7ec500af76d567489) ) + ROM_LOAD32_BYTE( "ts2ver-b.1", 0x00003, 0x100000, CRC(29b377f7) SHA1(21864ba964602115c1268fd5edd8006a13a86cfc) ) + ROM_LOAD32_BYTE( "ts2ver-b.2", 0x00002, 0x100000, CRC(79512e25) SHA1(137a215ec192e76e93511456ad504481a566c9c9) ) + ROM_LOAD32_BYTE( "ts2ver-b.3", 0x00001, 0x100000, CRC(9f4ced33) SHA1(32768b5ff263a9e3d11b7b36f6b2d7e951e07419) ) + ROM_LOAD32_BYTE( "ts2ver-b.4", 0x00000, 0x100000, CRC(3e0cfb38) SHA1(3c56342bd73b1617ea579a0d53e19d59bb04fd99) ) + TIMECRIS_DATA +ROM_END - ROM_REGION( 0x200000*2, REGION_GFX1, ROMREGION_DISPOSE ) /* 32x32x8bpp sprite tiles */ - ROM_LOAD( "ar1scg0.12f", 0x200000*0, 0x200000,CRC(e7be830a) SHA1(60e2162eecd7401a0c26c525de2715cbfb10c1c5) ) /* identical to "ar1scg0.12l" */ - ROM_LOAD( "ar1scg1.10f", 0x200000*1, 0x200000,CRC(8f15a686) SHA1(bce2d4380c6c39aa402566ddb0f62bbe6d7bfa1d) ) /* identical to "ar1scg1.10l" */ +ROM_START( timecrisa ) + ROM_REGION( 0x400000, REGION_CPU1, 0 ) /* main program */ + ROM_LOAD32_WORD_SWAP( "ts2ver-a.1", 0x00002, 0x200000, CRC(d57eb74b) SHA1(536dd9305d0ac44110c575776333310cc57b5242) ) + ROM_LOAD32_WORD_SWAP( "ts2ver-a.2", 0x00000, 0x200000, CRC(671588af) SHA1(63f992c6795521fd263a0ebf230f8dc88cbfc443) ) + TIMECRIS_DATA +ROM_END - ROM_REGION( 0x200000*8, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ - ROM_LOAD( "ar1cg0.12b", 0x200000*0x0, 0x200000,CRC(93f3a9d9) SHA1(7e94c81ad5ace98a2f0d00d101d464883d38c197) ) /* identical to "ar1cg0.8d" */ - ROM_LOAD( "ar1cg1.10d", 0x200000*0x1, 0x200000,CRC(39828c8b) SHA1(424aa67eb0b898c9cab8a4749893a9c5696ac430) ) /* identical to "ar1cg1.13b" */ - ROM_LOAD( "ar1cg2.12d", 0x200000*0x2, 0x200000,CRC(f7b058d1) SHA1(fffd0f01724a26dd47b1ecceecf4a139d5746f81) ) /* identical to "ar1cg2.14b" */ - ROM_LOAD( "ar1cg3.13d", 0x200000*0x3, 0x200000,CRC(c28a3d2a) SHA1(cdc44fdbc99274e860c834e42b4cfafb478d4d26) ) /* identical to "ar1cg3.16b" */ - ROM_LOAD( "ar1cg4.14d", 0x200000*0x4, 0x200000,CRC(abdb161f) SHA1(260bff9b0e94c1b2ea4b9d7fa170fbca212e85ee) ) /* identical to "ar1cg4.18b" */ - ROM_LOAD( "ar1cg5.16d", 0x200000*0x5, 0x200000,CRC(2381cfea) SHA1(1de4c8b94df233fd74771fa47843290a3d8df0c8) ) /* identical to "ar1cg5.19b" */ - ROM_LOAD( "ar1cg6.18a", 0x200000*0x6, 0x200000,CRC(ca0b6d23) SHA1(df969e0eeec557a95584b06995b0d55f2c6ec70a) ) /* identical to "ar1cg6.18d" */ - ROM_LOAD( "ar1cg7.15a", 0x200000*0x7, 0x200000,CRC(ffb9f9f9) SHA1(2b8c75b580f77e887df7d50909a3a95cda570e20) ) /* identical to "ar1cg7.19d" */ +#define PROPCYCL_DATA \ + ROM_REGION16_LE( 0x80000, REGION_CPU4, 0 ) /* MCU: SS22-BIOS ver1.41 and data */ \ + ROM_LOAD( "pr1data.8k", 0, 0x080000, CRC(2e5767a4) SHA1(390bf05c90044d841fe2dd4a427177fa1570b9a6) ) \ + C71_BIOS \ + ROM_REGION( 0x1000000, REGION_GFX1, ROMREGION_ERASEFF ) /* 32x32x8bpp sprite tiles */ \ + ROM_LOAD( "pr1scg0.12f", 0x000000, 0x200000, CRC(2d09a869) SHA1(ce8beabaac255e1de29d944c9866022bad713519) ) \ + ROM_LOAD( "pr1scg1.10f", 0x200000, 0x200000, CRC(7433c5bd) SHA1(a8fd4e73de66e3d443c0cb5b5beef8f467014815) ) \ + ROM_REGION( 0x1000000, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ \ + ROM_LOAD( "pr1cg0.12b", 0x000000, 0x200000, CRC(0a041238) SHA1(da5688970432f7fe39337ee9fb46ca25a53fdb11) ) \ + ROM_LOAD( "pr1cg1.10d", 0x200000, 0x200000, CRC(7d09e6a7) SHA1(892317ee0bd796fa5c70d64912ef2e696792a2d4) ) \ + ROM_LOAD( "pr1cg2.12d", 0x400000, 0x200000, CRC(659f006e) SHA1(23362a922cb1100950181fac4858b953d8fc0794) ) \ + ROM_LOAD( "pr1cg3.13d", 0x600000, 0x200000, CRC(d30bffa3) SHA1(2f05227d91d257db9fa8cae114974de602d98729) ) \ + ROM_LOAD( "pr1cg4.14d", 0x800000, 0x200000, CRC(f4636cc9) SHA1(4e01a476e418e5790878572e83a8a11536ce30ae) ) \ + ROM_LOAD( "pr1cg5.16d", 0xa00000, 0x200000, CRC(97d333de) SHA1(e8f8383f49aae834dd8b57231b25899703cef966) ) \ + ROM_LOAD( "pr1cg6.18a", 0xc00000, 0x200000, CRC(3e081c03) SHA1(6ccb162952f6076359b2785b5d800b39a9a3c5ce) ) \ + ROM_LOAD( "pr1cg7.15a", 0xe00000, 0x200000, CRC(ec9fc5c8) SHA1(16de614b26f06bbddae3ab56cebba45efd6fe81b) ) \ + ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ \ + ROM_LOAD( "pr1ccrl.3d", 0x000000, 0x200000, CRC(e01321fd) SHA1(5938c6eff8e1b3642728c3be733f567a97cb5aad) ) \ + ROM_LOAD( "pr1ccrh.1d", 0x200000, 0x080000, CRC(1d68bc31) SHA1(d534d0daebe7018e83b57cc7919c294ab89bddc8) ) \ + ROM_REGION( 0x480000, REGION_USER1, 0 ) /* 3D model data */ \ + ROM_LOAD( "pr1ptrl0.18k", 0x000000, 0x080000, CRC(fddb27a2) SHA1(6e837b45e3f9ed7ca3d1a457d0f0124de5618d1f) ) \ + ROM_LOAD( "pr1ptrl1.16k", 0x080000, 0x080000, CRC(6964dd06) SHA1(f38a550165504693d20892a7dcfaf01db19b04ef) ) \ + ROM_LOAD( "pr1ptrl2.15k", 0x100000, 0x080000, CRC(4d7ed1d4) SHA1(8f72864a06ff8962e640cb36d062bddf5d110308) ) \ + ROM_LOAD( "pr1ptrm0.18j", 0x180000, 0x080000, CRC(b6f204b7) SHA1(3b34f240b399b6406faaf338ae0ab536247e64a6) ) \ + ROM_LOAD( "pr1ptrm1.16j", 0x200000, 0x080000, CRC(949588b7) SHA1(fdaf50ff2496200b9c981efc18b035f3c0a96ace) ) \ + ROM_LOAD( "pr1ptrm2.15j", 0x280000, 0x080000, CRC(dc1cef0a) SHA1(8cbc02cf73fac3cc110b676d77602ae628385eae) ) \ + ROM_LOAD( "pr1ptru0.18f", 0x300000, 0x080000, CRC(5d66a7c4) SHA1(c9ed1c18724192d45c1f6b40096f15d02baf2401) ) \ + ROM_LOAD( "pr1ptru1.16f", 0x380000, 0x080000, CRC(e9a3f72b) SHA1(f967e1adf8eee4fffdf4288d36a93c5bb4f9a126) ) \ + ROM_LOAD( "pr1ptru2.15f", 0x400000, 0x080000, CRC(c346a842) SHA1(299bc0a30d0e74d8adfa3dc605aebf6439f5bc18) ) \ + ROM_REGION( 0x1000000, REGION_SOUND1, 0 ) /* C352 samples */ \ + ROM_LOAD( "pr1wavea.2l", 0x000000, 0x400000, CRC(320f3913) SHA1(3887b7334ca7762794c14198dd24bab47fcd9505) ) \ + ROM_LOAD( "pr1waveb.1l", 0x800000, 0x400000, CRC(d91acb26) SHA1(c2161e2d70e08aed15cbc875ffee685190611daf) ) +ROM_START( propcycl ) + ROM_REGION( 0x400000, REGION_CPU1, 0 ) /* main program */ + ROM_LOAD32_BYTE( "pr2ver-a.1", 0x00003, 0x100000, CRC(3f58594c) SHA1(5fdd8c61b47b51088a201799ce0c2f08c32ef852) ) + ROM_LOAD32_BYTE( "pr2ver-a.2", 0x00002, 0x100000, CRC(c0da354a) SHA1(f27a71a62385b842404fcd8ed6513158e3639b8f) ) + ROM_LOAD32_BYTE( "pr2ver-a.3", 0x00001, 0x100000, CRC(74bf4b74) SHA1(02713aa07238cc9e30163ae24d12c034aa972ff3) ) + ROM_LOAD32_BYTE( "pr2ver-a.4", 0x00000, 0x100000, CRC(cf4d5638) SHA1(2ddd00d6ec3b85c234820507650d201e176c94a2) ) + PROPCYCL_DATA +ROM_END + +ROM_START( propcyclj ) + ROM_REGION( 0x400000, REGION_CPU1, 0 ) /* main program */ + ROM_LOAD32_BYTE( "pr1ver-a.1", 0x00003, 0x100000, CRC(dfea7ff7) SHA1(9c81b145d0b6fbe14e1c5ce93ea67dacb2567220) ) + ROM_LOAD32_BYTE( "pr1ver-a.2", 0x00002, 0x100000, CRC(84a6f608) SHA1(c05ff3fce709bcdb7c30f019ae794979ba79970c) ) + ROM_LOAD32_BYTE( "pr1ver-a.3", 0x00001, 0x100000, CRC(77f957d2) SHA1(c8a62464f427cc858d9ea33446a8648e9171ead9) ) + ROM_LOAD32_BYTE( "pr1ver-a.4", 0x00000, 0x100000, CRC(7b6844e4) SHA1(1b1c03d258c4a6d95ae227de7741f29b7d9e28d8) ) + PROPCYCL_DATA +ROM_END + + +ROM_START( ridgerac ) + ROM_REGION( 0x200000, REGION_CPU1, 0 ) /* main program */ + ROM_LOAD32_BYTE( "rr2_prgllb.4d", 0x00003, 0x80000, CRC(d50d4fa0) SHA1(0fcd55e653d4f596b38b4e7b876ccd1f2a3836df) ) + ROM_LOAD32_BYTE( "rr2_prglmb.2d", 0x00002, 0x80000, CRC(6a266f42) SHA1(470613dbddd6b3050f666de9a2b222a4b7e1e809) ) + ROM_LOAD32_BYTE( "rr2_prgumb.8d", 0x00001, 0x80000, CRC(64c3aff1) SHA1(46b30ee0601a0a7887d29bc94d595f50a5a812d6) ) + ROM_LOAD32_BYTE( "rr2_prguub.6d", 0x00000, 0x80000, CRC(e6ff0b8d) SHA1(a02ffd2d3dc0a2c4a5665303c8021fd99a50eb8e) ) + ROM_REGION16_LE( 0x80000, REGION_CPU4, 0 ) /* MCU */ + ROM_LOAD( "rr1data.6r", 0, 0x080000, CRC(18f5f748) SHA1(e0d149a66de36156edd9b55f604c9a9801aaefa8) ) + C71_BIOS + NAMCO_C74_BIOS + ROM_REGION( 0x1000000, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ + ROM_LOAD( "rr1cg0.bin", 0x800000, 0x200000, CRC(b557a795) SHA1(f345486ffbe797246ad80a55d3c4a332ed6e2888) ) + ROM_LOAD( "rr1cg1.bin", 0xa00000, 0x200000, CRC(0fa212d9) SHA1(a1311de0a504e2d399044fa8ac32ec6c56ec965f) ) + ROM_LOAD( "rr1cg2.bin", 0xc00000, 0x200000, CRC(18e2d2bd) SHA1(69c2ea62eeb255f27d3c69373f6716b0a34683cc) ) + ROM_LOAD( "rr1cg3.bin", 0xe00000, 0x200000, CRC(9564488b) SHA1(6b27d1aea75d6be747c62e165cfa49ecc5d9e767) ) ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ - ROM_LOAD( "ar1ccrl.3d", 0x000000, 0x200000,CRC(17387b2c) SHA1(dfd7cadaf97917347c0fa98f395364a543e49612) ) /* identical to "ar1ccrl.7b" */ - ROM_LOAD( "ar1ccrh.1d", 0x200000, 0x080000,CRC(ee7a4803) SHA1(8383c9a8ef5ed94df13446ca5cefa5f9e518f175) ) /* identical to "pr1ccrh.5b" */ + ROM_LOAD( "rr1ccrl.bin", 0x000000, 0x200000, CRC(6092d181) SHA1(52c0e3ac20aa23059a87d1a985d24ae641577310) ) + ROM_LOAD( "rr1ccrh.bin", 0x200000, 0x080000, CRC(dd332fd5) SHA1(a7d9c1d6b5a8e3a937b525c1363880e404dcd147) ) + ROM_REGION( 0x300000, REGION_USER1, 0 ) /* 3D model data */ + ROM_LOAD( "rr1potl0.5b", 0x000000, 0x080000, CRC(3ac193e3) SHA1(ff213766f15e34dc1b25187b57d94e17930090a3) ) + ROM_LOAD( "rr1potl1.4b", 0x080000, 0x080000, CRC(ac3ffba5) SHA1(4eb4dda5faeff237e0d35725b56d309948fba900) ) + ROM_LOAD( "rr1potm0.5c", 0x100000, 0x080000, CRC(42a3fa08) SHA1(15db0ae7ccf7f5a77b9dd9a9d82a488b67f8aaff) ) + ROM_LOAD( "rr1potm1.4c", 0x180000, 0x080000, CRC(1bc1ea7b) SHA1(52c21eef4989c45acc5fa4deda2d0b63214731c8) ) + ROM_LOAD( "rr1potu0.5d", 0x200000, 0x080000, CRC(5e367f72) SHA1(5887f011379dce865fef238b402678a3d2033de9) ) + ROM_LOAD( "rr1potu1.4d", 0x280000, 0x080000, CRC(31d92475) SHA1(51d3c0baa223e1bc16ea2950f2e085597528f870) ) + ROM_REGION( 0x1000000, REGION_SOUND1, 0 ) /* C352 samples */ + ROM_LOAD( "rr1wav0.10r", 0x000000, 0x100000, CRC(a8e85bde) SHA1(b56677e9f6c98f7b600043f5dcfef3a482ca7455) ) + ROM_LOAD( "rr1wav1.10p", 0x200000, 0x100000, CRC(35f47c8e) SHA1(7c3f9e942f532af8008fbead2a96fee6084bcde6) ) + ROM_LOAD( "rr1wav2.10n", 0x100000, 0x100000, CRC(3244cb59) SHA1(b3283b30cfafbfdcbc6d482ecc4ed6a47a527ca4) ) + ROM_LOAD( "rr1wav3.10l", 0x300000, 0x100000, CRC(c4cda1a7) SHA1(60bc96880ec79efdff3cc70c09e848692a40bea4) ) + ROM_REGION( 0x300, REGION_PROMS, 0 ) /* gamma */ + ROM_LOAD( "rr1gam.2d", 0x0000, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) + ROM_LOAD( "rr1gam.3d", 0x0100, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) + ROM_LOAD( "rr1gam.4d", 0x0200, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) +ROM_END - ROM_REGION( 0x80000*12, REGION_GFX4, 0 ) /* 3d model data */ - ROM_LOAD( "ar1ptrl0.18k", 0x80000*0x0, 0x80000,CRC(82405108) SHA1(0a40882a9bc8621c620bede404c78f6b1333f223) ) - ROM_LOAD( "ar1ptrl1.16k", 0x80000*0x1, 0x80000,CRC(8739b09c) SHA1(cd603c4dc2f9ffc4185f891eb83e4c383c564294) ) - ROM_LOAD( "ar1ptrl2.15k", 0x80000*0x2, 0x80000,CRC(bda693a9) SHA1(fe71dd3c63198737aa2d39527f0004e977e3be20) ) - ROM_LOAD( "ar1ptrl3.14k", 0x80000*0x3, 0x80000,CRC(82797405) SHA1(2f205fee2d33e183c80a906fb38900167c011240) ) +ROM_START( ridgeraca ) + ROM_REGION( 0x200000, REGION_CPU1, 0 ) /* main program */ + ROM_LOAD32_BYTE( "rr2_prgll.4d", 0x00003, 0x80000, CRC(4bb7fc86) SHA1(8291375b8ec4d37e0d9e3bf38da2d5907b0f31bd) ) + ROM_LOAD32_BYTE( "rr2_prglm.2d", 0x00002, 0x80000, CRC(68e13830) SHA1(ddc447c7afbb5c4238969d7e78bfe9cf8fac6061) ) + ROM_LOAD32_BYTE( "rr2_prgum.8d", 0x00001, 0x80000, CRC(705ef78a) SHA1(881903413e66d6fd83d46eb18c4e1230531832ae) ) + ROM_LOAD32_BYTE( "rr2_prguu.6d", 0x00000, 0x80000, CRC(a79e456f) SHA1(049c596e01e53e3a401c5c4260517f170688d387) ) + ROM_REGION16_LE( 0x80000, REGION_CPU4, 0 ) /* MCU */ + ROM_LOAD( "rr1data.6r", 0, 0x080000, CRC(18f5f748) SHA1(e0d149a66de36156edd9b55f604c9a9801aaefa8) ) + C71_BIOS + NAMCO_C74_BIOS + ROM_REGION( 0x1000000, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ + ROM_LOAD( "rr1cg0.bin", 0x800000, 0x200000, CRC(b557a795) SHA1(f345486ffbe797246ad80a55d3c4a332ed6e2888) ) + ROM_LOAD( "rr1cg1.bin", 0xa00000, 0x200000, CRC(0fa212d9) SHA1(a1311de0a504e2d399044fa8ac32ec6c56ec965f) ) + ROM_LOAD( "rr1cg2.bin", 0xc00000, 0x200000, CRC(18e2d2bd) SHA1(69c2ea62eeb255f27d3c69373f6716b0a34683cc) ) + ROM_LOAD( "rr1cg3.bin", 0xe00000, 0x200000, CRC(9564488b) SHA1(6b27d1aea75d6be747c62e165cfa49ecc5d9e767) ) + ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ + ROM_LOAD( "rr1ccrl.bin", 0x000000, 0x200000, CRC(6092d181) SHA1(52c0e3ac20aa23059a87d1a985d24ae641577310) ) + ROM_LOAD( "rr1ccrh.bin", 0x200000, 0x080000, CRC(dd332fd5) SHA1(a7d9c1d6b5a8e3a937b525c1363880e404dcd147) ) + ROM_REGION( 0x300000, REGION_USER1, 0 ) /* 3D model data */ + ROM_LOAD( "rr1potl0.5b", 0x000000, 0x080000, CRC(3ac193e3) SHA1(ff213766f15e34dc1b25187b57d94e17930090a3) ) + ROM_LOAD( "rr1potl1.4b", 0x080000, 0x080000, CRC(ac3ffba5) SHA1(4eb4dda5faeff237e0d35725b56d309948fba900) ) + ROM_LOAD( "rr1potm0.5c", 0x100000, 0x080000, CRC(42a3fa08) SHA1(15db0ae7ccf7f5a77b9dd9a9d82a488b67f8aaff) ) + ROM_LOAD( "rr1potm1.4c", 0x180000, 0x080000, CRC(1bc1ea7b) SHA1(52c21eef4989c45acc5fa4deda2d0b63214731c8) ) + ROM_LOAD( "rr1potu0.5d", 0x200000, 0x080000, CRC(5e367f72) SHA1(5887f011379dce865fef238b402678a3d2033de9) ) + ROM_LOAD( "rr1potu1.4d", 0x280000, 0x080000, CRC(31d92475) SHA1(51d3c0baa223e1bc16ea2950f2e085597528f870) ) + ROM_REGION( 0x1000000, REGION_SOUND1, 0 ) /* C352 samples */ + ROM_LOAD( "rr1wav0.10r", 0x000000, 0x100000, CRC(a8e85bde) SHA1(b56677e9f6c98f7b600043f5dcfef3a482ca7455) ) + ROM_LOAD( "rr1wav1.10p", 0x200000, 0x100000, CRC(35f47c8e) SHA1(7c3f9e942f532af8008fbead2a96fee6084bcde6) ) + ROM_LOAD( "rr1wav2.10n", 0x100000, 0x100000, CRC(3244cb59) SHA1(b3283b30cfafbfdcbc6d482ecc4ed6a47a527ca4) ) + ROM_LOAD( "rr1wav3.10l", 0x300000, 0x100000, CRC(c4cda1a7) SHA1(60bc96880ec79efdff3cc70c09e848692a40bea4) ) + ROM_REGION( 0x300, REGION_PROMS, 0 ) /* gamma */ + ROM_LOAD( "rr1gam.2d", 0x0000, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) + ROM_LOAD( "rr1gam.3d", 0x0100, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) + ROM_LOAD( "rr1gam.4d", 0x0200, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) +ROM_END - ROM_LOAD( "ar1ptrm0.18j", 0x80000*0x4, 0x80000,CRC(29d92097) SHA1(2c492747b295dd715d3a19c8a2cd919b97d095a0) ) - ROM_LOAD( "ar1ptrm1.16j", 0x80000*0x5, 0x80000,CRC(2232f0a5) SHA1(3fccf6d4a0c4100cc85e3051024d659c4a1c769e) ) - ROM_LOAD( "ar1ptrm2.15j", 0x80000*0x6, 0x80000,CRC(8ee14e6f) SHA1(f6f1cbb748b109b365255378c18e710ba6270c1c) ) - ROM_LOAD( "ar1ptrm3.14j", 0x80000*0x7, 0x80000,CRC(1094a970) SHA1(d41b10f48e1ef312bcaf09f27fabc7252c30e648) ) +ROM_START( ridgeracb ) + ROM_REGION( 0x200000, REGION_CPU1, 0 ) /* main program */ + ROM_LOAD32_BYTE( "rr3_prgllb.4d", 0x00003, 0x80000, CRC(856fe5ec) SHA1(72d95b8bd5da551c3d358b8ab266373a89f8aa6a) ) + ROM_LOAD32_BYTE( "rr3_prglmb.2d", 0x00002, 0x80000, CRC(1e9ef0a9) SHA1(a4577bcdf13673568793d8a324945fca30b10f43) ) + ROM_LOAD32_BYTE( "rr3_prgumb.8d", 0x00001, 0x80000, CRC(e160f63f) SHA1(9b4b7a13eb4bc19fcb53daedb87e4945c20a1b8e) ) + ROM_LOAD32_BYTE( "rr3_prguub.6d", 0x00000, 0x80000, CRC(f07c78c0) SHA1(dbed76d868b761711faf5b6e11f2c9affb91db5d) ) + ROM_REGION16_LE( 0x80000, REGION_CPU4, 0 ) /* MCU */ + ROM_LOAD( "rr1data.6r", 0, 0x080000, CRC(18f5f748) SHA1(e0d149a66de36156edd9b55f604c9a9801aaefa8) ) + C71_BIOS + NAMCO_C74_BIOS + ROM_REGION( 0x1000000, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ + ROM_LOAD( "rr1cg0.bin", 0x800000, 0x200000, CRC(b557a795) SHA1(f345486ffbe797246ad80a55d3c4a332ed6e2888) ) + ROM_LOAD( "rr1cg1.bin", 0xa00000, 0x200000, CRC(0fa212d9) SHA1(a1311de0a504e2d399044fa8ac32ec6c56ec965f) ) + ROM_LOAD( "rr1cg2.bin", 0xc00000, 0x200000, CRC(18e2d2bd) SHA1(69c2ea62eeb255f27d3c69373f6716b0a34683cc) ) + ROM_LOAD( "rr1cg3.bin", 0xe00000, 0x200000, CRC(9564488b) SHA1(6b27d1aea75d6be747c62e165cfa49ecc5d9e767) ) + ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ + ROM_LOAD( "rr1ccrl.bin", 0x000000, 0x200000, CRC(6092d181) SHA1(52c0e3ac20aa23059a87d1a985d24ae641577310) ) + ROM_LOAD( "rr1ccrh.bin", 0x200000, 0x080000, CRC(dd332fd5) SHA1(a7d9c1d6b5a8e3a937b525c1363880e404dcd147) ) + ROM_REGION( 0x300000, REGION_USER1, 0 ) /* 3D model data */ + ROM_LOAD( "rr1potl0.5b", 0x000000, 0x080000, CRC(3ac193e3) SHA1(ff213766f15e34dc1b25187b57d94e17930090a3) ) + ROM_LOAD( "rr1potl1.4b", 0x080000, 0x080000, CRC(ac3ffba5) SHA1(4eb4dda5faeff237e0d35725b56d309948fba900) ) + ROM_LOAD( "rr1potm0.5c", 0x100000, 0x080000, CRC(42a3fa08) SHA1(15db0ae7ccf7f5a77b9dd9a9d82a488b67f8aaff) ) + ROM_LOAD( "rr1potm1.4c", 0x180000, 0x080000, CRC(1bc1ea7b) SHA1(52c21eef4989c45acc5fa4deda2d0b63214731c8) ) + ROM_LOAD( "rr1potu0.5d", 0x200000, 0x080000, CRC(5e367f72) SHA1(5887f011379dce865fef238b402678a3d2033de9) ) + ROM_LOAD( "rr1potu1.4d", 0x280000, 0x080000, CRC(31d92475) SHA1(51d3c0baa223e1bc16ea2950f2e085597528f870) ) + ROM_REGION( 0x1000000, REGION_SOUND1, 0 ) /* C352 samples */ + ROM_LOAD( "rr1wav0.10r", 0x000000, 0x100000, CRC(a8e85bde) SHA1(b56677e9f6c98f7b600043f5dcfef3a482ca7455) ) + ROM_LOAD( "rr1wav1.10p", 0x200000, 0x100000, CRC(35f47c8e) SHA1(7c3f9e942f532af8008fbead2a96fee6084bcde6) ) + ROM_LOAD( "rr1wav2.10n", 0x100000, 0x100000, CRC(3244cb59) SHA1(b3283b30cfafbfdcbc6d482ecc4ed6a47a527ca4) ) + ROM_LOAD( "rr1wav3.10l", 0x300000, 0x100000, CRC(c4cda1a7) SHA1(60bc96880ec79efdff3cc70c09e848692a40bea4) ) + ROM_REGION( 0x300, REGION_PROMS, 0 ) /* gamma */ + ROM_LOAD( "rr1gam.2d", 0x0000, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) + ROM_LOAD( "rr1gam.3d", 0x0100, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) + ROM_LOAD( "rr1gam.4d", 0x0200, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) +ROM_END - ROM_LOAD( "ar1ptru0.18f", 0x80000*0x8, 0x80000,CRC(26d88467) SHA1(d528f989fab4dd5ac1aec9b596a05fbadcc0587a) ) - ROM_LOAD( "ar1ptru1.16f", 0x80000*0x9, 0x80000,CRC(c5e2c208) SHA1(152fde0b95a5df8c781e4a83577cfbbc7672ae0d) ) - ROM_LOAD( "ar1ptru2.15f", 0x80000*0xa, 0x80000,CRC(1321ec59) SHA1(dbd3687a4c6b1aa0b18e336f99dabb9010d36639) ) - ROM_LOAD( "ar1ptru3.14f", 0x80000*0xb, 0x80000,CRC(139d7dc1) SHA1(6d25e6ad552a91a0c5fc03db7e1a801ccf9c9556) ) +ROM_START( ridgeracc ) + ROM_REGION( 0x200000, REGION_CPU1, 0 ) /* main program */ + ROM_LOAD32_BYTE( "rr3_prgll-3s.4d", 0x000003, 0x080000, CRC(2c3d8cb7) SHA1(46a7b62938fe3edde5c52ce3fdfe447000cd6af0) ) + ROM_LOAD32_BYTE( "rr3_prglm-3s.2d", 0x000002, 0x080000, CRC(b15343f2) SHA1(3056eb5a3036a74b2ac641a4c3221986c0be1e27) ) + ROM_LOAD32_BYTE( "rr3_prgum-3s.8d", 0x000001, 0x080000, CRC(8fda06ac) SHA1(7e9adba198eb0941100cda64ecedac504f6ac696) ) + ROM_LOAD32_BYTE( "rr3_prguu-3s.6d", 0x000000, 0x080000, CRC(868398df) SHA1(422e0f9884904b0df93fcacd1468b8da0458eb8e) ) + ROM_REGION16_LE( 0x80000, REGION_CPU4, 0 ) /* MCU */ + ROM_LOAD( "rr1data.6r", 0, 0x080000, CRC(18f5f748) SHA1(e0d149a66de36156edd9b55f604c9a9801aaefa8) ) + C71_BIOS + NAMCO_C74_BIOS + ROM_REGION( 0x1000000, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ + ROM_LOAD( "rr1cg0.bin", 0x800000, 0x200000, CRC(b557a795) SHA1(f345486ffbe797246ad80a55d3c4a332ed6e2888) ) + ROM_LOAD( "rr1cg1.bin", 0xa00000, 0x200000, CRC(0fa212d9) SHA1(a1311de0a504e2d399044fa8ac32ec6c56ec965f) ) + ROM_LOAD( "rr1cg2.bin", 0xc00000, 0x200000, CRC(18e2d2bd) SHA1(69c2ea62eeb255f27d3c69373f6716b0a34683cc) ) + ROM_LOAD( "rr1cg3.bin", 0xe00000, 0x200000, CRC(9564488b) SHA1(6b27d1aea75d6be747c62e165cfa49ecc5d9e767) ) + ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ + ROM_LOAD( "rr1ccrl.bin", 0x000000, 0x200000, CRC(6092d181) SHA1(52c0e3ac20aa23059a87d1a985d24ae641577310) ) + ROM_LOAD( "rr1ccrh.bin", 0x200000, 0x080000, CRC(dd332fd5) SHA1(a7d9c1d6b5a8e3a937b525c1363880e404dcd147) ) + ROM_REGION( 0x300000, REGION_USER1, 0 ) /* 3D model data */ + ROM_LOAD( "rr1potl0.5b", 0x000000, 0x080000, CRC(3ac193e3) SHA1(ff213766f15e34dc1b25187b57d94e17930090a3) ) + ROM_LOAD( "rr1potl1.4b", 0x080000, 0x080000, CRC(ac3ffba5) SHA1(4eb4dda5faeff237e0d35725b56d309948fba900) ) + ROM_LOAD( "rr1potm0.5c", 0x100000, 0x080000, CRC(42a3fa08) SHA1(15db0ae7ccf7f5a77b9dd9a9d82a488b67f8aaff) ) + ROM_LOAD( "rr1potm1.4c", 0x180000, 0x080000, CRC(1bc1ea7b) SHA1(52c21eef4989c45acc5fa4deda2d0b63214731c8) ) + ROM_LOAD( "rr1potu0.5d", 0x200000, 0x080000, CRC(5e367f72) SHA1(5887f011379dce865fef238b402678a3d2033de9) ) + ROM_LOAD( "rr1potu1.4d", 0x280000, 0x080000, CRC(31d92475) SHA1(51d3c0baa223e1bc16ea2950f2e085597528f870) ) + ROM_REGION( 0x1000000, REGION_SOUND1, 0 ) /* C352 samples */ + ROM_LOAD( "rr1wav0.10r", 0x000000, 0x100000, CRC(a8e85bde) SHA1(b56677e9f6c98f7b600043f5dcfef3a482ca7455) ) + ROM_LOAD( "rr1wav1.10p", 0x200000, 0x100000, CRC(35f47c8e) SHA1(7c3f9e942f532af8008fbead2a96fee6084bcde6) ) + ROM_LOAD( "rr1wav2.10n", 0x100000, 0x100000, CRC(3244cb59) SHA1(b3283b30cfafbfdcbc6d482ecc4ed6a47a527ca4) ) + ROM_LOAD( "rr1wav3.10l", 0x300000, 0x100000, CRC(c4cda1a7) SHA1(60bc96880ec79efdff3cc70c09e848692a40bea4) ) + ROM_REGION( 0x300, REGION_PROMS, 0 ) /* gamma */ + ROM_LOAD( "rr1gam.2d", 0x0000, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) + ROM_LOAD( "rr1gam.3d", 0x0100, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) + ROM_LOAD( "rr1gam.4d", 0x0200, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) +ROM_END - ROM_REGION( 0x080000, REGION_CPU2, 0 ) /* S22-BIOS ver1.30 */ - ROM_LOAD( "ar1datab.8k", 0, 0x080000, CRC(c26306f8) SHA1(6d8d993c076d5ced523143a86bd0938b3794478d) ) - ROM_REGION( 0x200000, REGION_USER2, 0 ) /* sound samples */ - ROM_LOAD( "ar1wavea.2l", 0, 0x200000, CRC(dbf64562) SHA1(454fd7d5b860f0e5557d8900393be95d6c992ad1) ) +ROM_START( ridgeracj ) + ROM_REGION( 0x200000, REGION_CPU1, 0 ) /* main program */ + ROM_LOAD32_BYTE( "rr1_prgll.4d", 0x00003, 0x80000, CRC(4bb7fc86) SHA1(8291375b8ec4d37e0d9e3bf38da2d5907b0f31bd) ) + ROM_LOAD32_BYTE( "rr1_prglm.2d", 0x00002, 0x80000, CRC(68e13830) SHA1(ddc447c7afbb5c4238969d7e78bfe9cf8fac6061) ) + ROM_LOAD32_BYTE( "rr1_prgum.8d", 0x00001, 0x80000, CRC(705ef78a) SHA1(881903413e66d6fd83d46eb18c4e1230531832ae) ) + ROM_LOAD32_BYTE( "rr1_prguu.6d", 0x00000, 0x80000, CRC(c1371f96) SHA1(a78e0bf6c147c034487a85efa0a8470f4e8f4bf0) ) + ROM_REGION16_LE( 0x80000, REGION_CPU4, 0 ) /* MCU */ + ROM_LOAD( "rr1data.6r", 0, 0x080000, CRC(18f5f748) SHA1(e0d149a66de36156edd9b55f604c9a9801aaefa8) ) + C71_BIOS + NAMCO_C74_BIOS + ROM_REGION( 0x1000000, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ + ROM_LOAD( "rr1cg0.bin", 0x800000, 0x200000, CRC(b557a795) SHA1(f345486ffbe797246ad80a55d3c4a332ed6e2888) ) + ROM_LOAD( "rr1cg1.bin", 0xa00000, 0x200000, CRC(0fa212d9) SHA1(a1311de0a504e2d399044fa8ac32ec6c56ec965f) ) + ROM_LOAD( "rr1cg2.bin", 0xc00000, 0x200000, CRC(18e2d2bd) SHA1(69c2ea62eeb255f27d3c69373f6716b0a34683cc) ) + ROM_LOAD( "rr1cg3.bin", 0xe00000, 0x200000, CRC(9564488b) SHA1(6b27d1aea75d6be747c62e165cfa49ecc5d9e767) ) + ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ + ROM_LOAD( "rr1ccrl.bin", 0x000000, 0x200000, CRC(6092d181) SHA1(52c0e3ac20aa23059a87d1a985d24ae641577310) ) + ROM_LOAD( "rr1ccrh.bin", 0x200000, 0x080000, CRC(dd332fd5) SHA1(a7d9c1d6b5a8e3a937b525c1363880e404dcd147) ) + ROM_REGION( 0x300000, REGION_USER1, 0 ) /* 3D model data */ + ROM_LOAD( "rr1potl0.5b", 0x000000, 0x080000, CRC(3ac193e3) SHA1(ff213766f15e34dc1b25187b57d94e17930090a3) ) + ROM_LOAD( "rr1potl1.4b", 0x080000, 0x080000, CRC(ac3ffba5) SHA1(4eb4dda5faeff237e0d35725b56d309948fba900) ) + ROM_LOAD( "rr1potm0.5c", 0x100000, 0x080000, CRC(42a3fa08) SHA1(15db0ae7ccf7f5a77b9dd9a9d82a488b67f8aaff) ) + ROM_LOAD( "rr1potm1.4c", 0x180000, 0x080000, CRC(1bc1ea7b) SHA1(52c21eef4989c45acc5fa4deda2d0b63214731c8) ) + ROM_LOAD( "rr1potu0.5d", 0x200000, 0x080000, CRC(5e367f72) SHA1(5887f011379dce865fef238b402678a3d2033de9) ) + ROM_LOAD( "rr1potu1.4d", 0x280000, 0x080000, CRC(31d92475) SHA1(51d3c0baa223e1bc16ea2950f2e085597528f870) ) + ROM_REGION( 0x1000000, REGION_SOUND1, 0 ) /* C352 samples */ + ROM_LOAD( "rr1wav0.10r", 0x000000, 0x100000, CRC(a8e85bde) SHA1(b56677e9f6c98f7b600043f5dcfef3a482ca7455) ) + ROM_LOAD( "rr1wav1.10p", 0x200000, 0x100000, CRC(35f47c8e) SHA1(7c3f9e942f532af8008fbead2a96fee6084bcde6) ) + ROM_LOAD( "rr1wav2.10n", 0x100000, 0x100000, CRC(3244cb59) SHA1(b3283b30cfafbfdcbc6d482ecc4ed6a47a527ca4) ) + ROM_LOAD( "rr1wav3.10l", 0x300000, 0x100000, CRC(c4cda1a7) SHA1(60bc96880ec79efdff3cc70c09e848692a40bea4) ) + ROM_REGION( 0x300, REGION_PROMS, 0 ) /* gamma */ + ROM_LOAD( "rr1gam.2d", 0x0000, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) + ROM_LOAD( "rr1gam.3d", 0x0100, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) + ROM_LOAD( "rr1gam.4d", 0x0200, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) +ROM_END + +ROM_START( ridgera28 ) + ROM_REGION( 0x200000, REGION_CPU1, 0 ) /* main program */ + ROM_LOAD32_BYTE( "rrs_8_prgll.4d", 0x00003, 0x80000, CRC(c8d2bc61) SHA1(9db734fc45f47e6742ef2a8ba2558efb881df94a) ) + ROM_LOAD32_BYTE( "rrs_8_prglm.2d", 0x00002, 0x80000, CRC(bb1d23c7) SHA1(feaa1387b7003794c192edef4478636d8b125fef) ) + ROM_LOAD32_BYTE( "rrs_8_prgum.8d", 0x00001, 0x80000, CRC(720c854d) SHA1(9c8e2868dd7ef425fdc6f701968b9713bb12b56c) ) + ROM_LOAD32_BYTE( "rrs_8_prguu.6d", 0x00000, 0x80000, CRC(fb4b7e8f) SHA1(1919803dbe35a88bbb6b608d0c3ab8daea31f580) ) + ROM_REGION16_LE( 0x80000, REGION_CPU4, 0 ) /* MCU */ + ROM_LOAD( "rrs_8_data.6r", 0, 0x080000, CRC(8bf75a96) SHA1(987d24f2195eb5a84c10c68584404556ef1dfe88) ) + C71_BIOS + NAMCO_C74_BIOS + ROM_REGION( 0x1000000, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ + ROM_LOAD( "rrs1cg0.1a", 0x800000, 0x200000, CRC(714c0091) SHA1(df29512bd6e64827660c40304051366d2c4d7977) ) + ROM_LOAD( "rrs1cg1.2a", 0xa00000, 0x200000, CRC(836545c1) SHA1(05e3346463d8d42b5d33216207e855033a65510d) ) + ROM_LOAD( "rrs1cg2.3a", 0xc00000, 0x200000, CRC(00e9799d) SHA1(280184451138420f64080efe13e5e2795f7b61d4) ) + ROM_LOAD( "rrs1cg3.5a", 0xe00000, 0x200000, CRC(3858983f) SHA1(feda270b71f1310ecf4c17823bc8827ca2951b40) ) + ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ + ROM_LOAD( "rrs1ccrl.5a", 0x000000, 0x200000, CRC(304a8b57) SHA1(f4f3e7c194697d754375f36a0e41d0941fa5d225) ) + ROM_LOAD( "rrs1ccrh.5c", 0x200000, 0x080000, CRC(bd3c86ab) SHA1(cd3a8774843c5864e651fa8989c80e2d975a13e8) ) + ROM_REGION( 0x300000, REGION_USER1, 0 ) /* 3D model data */ + ROM_LOAD( "rrs1pol0.5b", 0x000000, 0x080000, CRC(9376c384) SHA1(cde0e36db1beab1523607098a760d81fac2ea90e) ) + ROM_LOAD( "rrs1pol1.4b", 0x080000, 0x080000, CRC(094fa832) SHA1(cc59442540b1cdef068c4408b6e048c11042beb8) ) + ROM_LOAD( "rrs1pom0.5c", 0x100000, 0x080000, CRC(b47a7f8b) SHA1(0fa0456ad8b4864a7071b5b5ba1a78877c1ac0f0) ) + ROM_LOAD( "rrs1pom1.4c", 0x180000, 0x080000, CRC(27260361) SHA1(8775cc779eb8b6a0d79fa84d606c970ec2d6ea8d) ) + ROM_LOAD( "rrs1pou0.5d", 0x200000, 0x080000, CRC(74d6ec84) SHA1(63f5beee51443c98100330ec04291f71e10716c4) ) + ROM_LOAD( "rrs1pou1.4d", 0x280000, 0x080000, CRC(f527caaa) SHA1(f92bdd15323239d593ddac92a11d23a27e6635ed) ) + ROM_REGION( 0x1000000, REGION_SOUND1, 0 ) /* C352 samples */ + ROM_LOAD( "rrs1wav0.10r", 0x000000, 0x100000, CRC(99d11a2d) SHA1(1f3db98a99be0f07c03b0a7817561459a58f310e) ) + ROM_LOAD( "rrs1wav1.10p", 0x200000, 0x100000, CRC(ad28444a) SHA1(c31bbf3cae5015e5494fe4988b9b01d822224c69) ) + ROM_LOAD( "rrs1wav2.10n", 0x100000, 0x100000, CRC(6f0d4619) SHA1(cd3d57f2ea21497f388ffa29ec7d2665647a01c0) ) + ROM_LOAD( "rrs1wav3.10l", 0x300000, 0x100000, CRC(106e761f) SHA1(97f47b857bdcbc79b0aface53dd385e67fcc9108) ) + ROM_REGION( 0x300, REGION_PROMS, 0 ) /* gamma */ + ROM_LOAD( "rr1gam.2d", 0x0000, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) + ROM_LOAD( "rr1gam.3d", 0x0100, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) + ROM_LOAD( "rr1gam.4d", 0x0200, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) ROM_END ROM_START( cybrcomm ) @@ -1286,1248 +2404,1343 @@ ROM_START( cybrcomm ) ROM_LOAD32_BYTE( "cy1prglm.2d", 0x00002, 0x80000, CRC(884a5b0e) SHA1(0e27ae366b8a2695fe112b4740c8c9013bb97e26) ) ROM_LOAD32_BYTE( "cy1prgum.8d", 0x00001, 0x80000, CRC(c9c4a921) SHA1(76a52461165a8bd8d984a34063fbeb4cb73624af) ) ROM_LOAD32_BYTE( "cy1prguu.6d", 0x00000, 0x80000, CRC(5f22975b) SHA1(a1a5cb66358d64a3c564b912f2eeafa182786b1e) ) - - ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE ) - - ROM_REGION( 0x200000*8, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ - ROM_LOAD( "cyc1cg0.1a", 0x200000*0x0, 0x200000,CRC(e839b9bd) SHA1(fee43d37dcca7f1fb952a6bfb886b7ee30b7d75c) ) /* cyc1cg0.6a */ - ROM_LOAD( "cyc1cg1.2a", 0x200000*0x2, 0x200000,CRC(7d13993f) SHA1(96ac82bcc63afe395bae73f005eb66dad7742d48) ) /* cyc1cg1.7a */ - ROM_LOAD( "cyc1cg2.3a", 0x200000*0x4, 0x200000,CRC(7c464566) SHA1(69817ac3a7c6e43b960e8a904962b58b23417163) ) /* cyc1cg2.8a */ - ROM_LOAD( "cyc1cg3.5a", 0x200000*0x6, 0x200000,CRC(2222e16f) SHA1(562bcd4d43b1543303d8fd66d9f0d9a8e3702492) ) /* cyc1cg3.9a */ - + ROM_REGION16_LE( 0x80000, REGION_CPU4, 0 ) /* MCU */ + ROM_LOAD( "cy1data.6r", 0x00000, 0x20000, CRC(10d0005b) SHA1(10508eeaf74d24a611b44cd3bb12417ceb78904f) ) + ROM_RELOAD( 0x20000, 0x20000 ) + ROM_RELOAD( 0x40000, 0x20000 ) + ROM_RELOAD( 0x60000, 0x20000 ) + C71_BIOS + NAMCO_C74_BIOS + ROM_REGION( 0x1000000, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ + ROM_LOAD( "cyc1cg0.1a", 0x800000, 0x200000, CRC(e839b9bd) SHA1(fee43d37dcca7f1fb952a6bfb886b7ee30b7d75c) ) + ROM_LOAD( "cyc1cg1.2a", 0xa00000, 0x200000, CRC(7d13993f) SHA1(96ac82bcc63afe395bae73f005eb66dad7742d48) ) + ROM_LOAD( "cyc1cg2.3a", 0xc00000, 0x200000, CRC(7c464566) SHA1(69817ac3a7c6e43b960e8a904962b58b23417163) ) + ROM_LOAD( "cyc1cg3.5a", 0xe00000, 0x200000, CRC(2222e16f) SHA1(562bcd4d43b1543303d8fd66d9f0d9a8e3702492) ) ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ - ROM_LOAD( "cyc1ccrl.1c", 0x000000, 0x100000,CRC(1a0dc5f0) SHA1(bf0093d9cbdcb45a82705e966c48a1f408fa344e) ) /* cyc1ccrl.8c */ - ROM_LOAD( "cyc1ccrh.2c", 0x200000, 0x080000,CRC(8c4090b8) SHA1(456d548a48833e840c5d39d47b2dcca03f8d6321) ) /* cyc1ccrh.7c */ - - ROM_REGION( 0x80000*9, REGION_GFX4, 0 ) /* 3d model data */ - ROM_LOAD( "cyc1ptl0.5b", 0x80000*0x0, 0x80000,CRC(d91de03d) SHA1(05819d285f6111867c41337bda9c4b9ad5394b6b) ) - ROM_LOAD( "cyc1ptl1.4b", 0x80000*0x1, 0x80000,CRC(e5b98021) SHA1(7416cbf74da969f822e0363ced7a25b967277e28) ) - ROM_LOAD( "cyc1ptl2.3b", 0x80000*0x2, 0x80000,CRC(7ba786c6) SHA1(1a5319dec495453bab9d70ae773a807f0036b355) ) - ROM_LOAD( "cyc1ptm0.5c", 0x80000*0x3, 0x80000,CRC(d454b5c6) SHA1(95ae6f0455e9fd7dff066e74cd4343c94d1bc212) ) - ROM_LOAD( "cyc1ptm1.4c", 0x80000*0x4, 0x80000,CRC(74fdf8cc) SHA1(f2627f400e247b6d4c4157eaf0ec69d57212e566) ) - ROM_LOAD( "cyc1ptm2.3c", 0x80000*0x5, 0x80000,CRC(b9c99a45) SHA1(c86cf594b416776eaf9a32c3cb9d34acc79777e9) ) - ROM_LOAD( "cyc1ptu0.5d", 0x80000*0x6, 0x80000,CRC(4d40897f) SHA1(ffe2a0ab66443553c83512f9a1be94b2e385cf2f) ) - ROM_LOAD( "cyc1ptu1.4d", 0x80000*0x7, 0x80000,CRC(3bdaeeeb) SHA1(826f97e2165af8569cfec03874b16030a9486559) ) - ROM_LOAD( "cyc1ptu2.3d", 0x80000*0x8, 0x80000,CRC(a0e73674) SHA1(1e22142a564e664031c12b250664fc82e3b3d43b) ) - - ROM_REGION( 0x2100, REGION_USER1, 0 ) - ROM_LOAD( "cy1eeprm.9e", 0x0000, 0x2000, CRC(4e1d294b) SHA1(954ce04dcdba65214f5d0690ca59264f9090a1d6) ) /* EPROM */ - - ROM_REGION( 0x080000, REGION_CPU2, 0 ) /* MCU */ - ROM_LOAD( "cy1data.6r", 0, 0x020000, CRC(10d0005b) SHA1(10508eeaf74d24a611b44cd3bb12417ceb78904f) ) - ROM_REGION( 0x400000, REGION_USER2, 0 ) /* sound samples */ + ROM_LOAD( "cyc1ccrl.1c", 0x000000, 0x100000, CRC(1a0dc5f0) SHA1(bf0093d9cbdcb45a82705e966c48a1f408fa344e) ) + ROM_LOAD( "cyc1ccrh.2c", 0x200000, 0x080000, CRC(8c4090b8) SHA1(456d548a48833e840c5d39d47b2dcca03f8d6321) ) + ROM_REGION( 0x480000, REGION_USER1, 0 ) /* 3D model data */ + ROM_LOAD( "cyc1ptl0.5b", 0x000000, 0x080000, CRC(d91de03d) SHA1(05819d285f6111867c41337bda9c4b9ad5394b6b) ) + ROM_LOAD( "cyc1ptl1.4b", 0x080000, 0x080000, CRC(e5b98021) SHA1(7416cbf74da969f822e0363ced7a25b967277e28) ) + ROM_LOAD( "cyc1ptl2.3b", 0x100000, 0x080000, CRC(7ba786c6) SHA1(1a5319dec495453bab9d70ae773a807f0036b355) ) + ROM_LOAD( "cyc1ptm0.5c", 0x180000, 0x080000, CRC(d454b5c6) SHA1(95ae6f0455e9fd7dff066e74cd4343c94d1bc212) ) + ROM_LOAD( "cyc1ptm1.4c", 0x200000, 0x080000, CRC(74fdf8cc) SHA1(f2627f400e247b6d4c4157eaf0ec69d57212e566) ) + ROM_LOAD( "cyc1ptm2.3c", 0x280000, 0x080000, CRC(b9c99a45) SHA1(c86cf594b416776eaf9a32c3cb9d34acc79777e9) ) + ROM_LOAD( "cyc1ptu0.5d", 0x300000, 0x080000, CRC(4d40897f) SHA1(ffe2a0ab66443553c83512f9a1be94b2e385cf2f) ) + ROM_LOAD( "cyc1ptu1.4d", 0x380000, 0x080000, CRC(3bdaeeeb) SHA1(826f97e2165af8569cfec03874b16030a9486559) ) + ROM_LOAD( "cyc1ptu2.3d", 0x400000, 0x080000, CRC(a0e73674) SHA1(1e22142a564e664031c12b250664fc82e3b3d43b) ) + ROM_REGION( 0x1000000, REGION_SOUND1, 0 ) /* C352 samples */ ROM_LOAD( "cy1wav0.10r", 0x000000, 0x100000, CRC(c6f366a2) SHA1(795dbee09df159d3501c748fb3de16cca81742d6) ) - ROM_LOAD( "cy1wav1.10p", 0x100000, 0x100000, CRC(f30b5e37) SHA1(9f5a94d82741ef9688c6e415ebb9009c906737c9) ) - ROM_LOAD( "cy1wav2.10n", 0x200000, 0x100000, CRC(b98c1ca6) SHA1(4b66aa05f82be5ef3315acc30031872698ff4391) ) + ROM_LOAD( "cy1wav1.10p", 0x200000, 0x100000, CRC(f30b5e37) SHA1(9f5a94d82741ef9688c6e415ebb9009c906737c9) ) + ROM_LOAD( "cy1wav2.10n", 0x100000, 0x100000, CRC(b98c1ca6) SHA1(4b66aa05f82be5ef3315acc30031872698ff4391) ) ROM_LOAD( "cy1wav3.10l", 0x300000, 0x100000, CRC(43dbac19) SHA1(83fd4ae4e7ec264fc217ed18caf59bf438af0c3d) ) + ROM_REGION( 0x300, REGION_PROMS, 0 ) /* gamma */ + ROM_LOAD( "rr1gam.2d", 0x0000, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) + ROM_LOAD( "rr1gam.3d", 0x0100, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) + ROM_LOAD( "rr1gam.4d", 0x0200, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) + ROM_REGION( 0x2000, REGION_USER2, 0 ) /* default EEPROM */ + ROM_LOAD( "cy1eeprm.9e", 0x0000, 0x2000, CRC(8432c066) SHA1(99d4bfda3f8aec288dbeaf291bce85fe9009a1de) ) +ROM_END + +ROM_START( raverace ) + ROM_REGION( 0x200000, REGION_CPU1, 0 ) /* main program */ + ROM_LOAD32_BYTE( "rv2_prgllb.4d", 0x00003, 0x80000, CRC(3017cd1e) SHA1(ccd648b4a5dfc74fd141815af2969f423311042f) ) + ROM_LOAD32_BYTE( "rv2_prglmb.2d", 0x00002, 0x80000, CRC(894be0c3) SHA1(4dba93dc3ca1cf502c5f54018b64ad79bb2a632b) ) + ROM_LOAD32_BYTE( "rv2_prgumb.8d", 0x00001, 0x80000, CRC(6414a800) SHA1(c278ff644909d12a43ba6fc2bf8d2092e469c3e6) ) + ROM_LOAD32_BYTE( "rv2_prguub.6d", 0x00000, 0x80000, CRC(a9f18714) SHA1(8e7b17749d151f92020f68d1ac06003cf1f5c573) ) + ROM_REGION16_LE( 0x80000, REGION_CPU4, 0 ) /* MCU */ + ROM_LOAD( "rv1data.6r", 0, 0x080000, CRC(d358ec20) SHA1(140c513349240417bb546dd2d151f3666b818e91) ) + C71_BIOS + NAMCO_C74_BIOS + ROM_REGION( 0x1000000, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ + ROM_LOAD( "rv1cg0.1a", 0x000000, 0x200000, CRC(c518f06b) SHA1(4c01d453244192dd13087bdc72a7f7be80b47cbc) ) + ROM_LOAD( "rv1cg1.1c", 0x200000, 0x200000, CRC(6628f792) SHA1(7a5405c5fcb2f3f001ae17df393c31e61a834f2b) ) + ROM_LOAD( "rv1cg2.1d", 0x400000, 0x200000, CRC(0b707cc5) SHA1(38e1a554b278062edc369565353497ac4b016f78) ) + ROM_LOAD( "rv1cg3.1e", 0x600000, 0x200000, CRC(39b62921) SHA1(873287d81338baf10dd85214d82f6c38bfdf199e) ) + ROM_LOAD( "rv1cg4.1f", 0x800000, 0x200000, CRC(a9791ea2) SHA1(245b2ebbadd1fbca90dc241f88e9f6f341b2a01a) ) + ROM_LOAD( "rv1cg5.1j", 0xa00000, 0x200000, CRC(b2c79ec1) SHA1(6f669996863bdf1fe09b0c1a2a876625029d3d43) ) + ROM_LOAD( "rv1cg6.1k", 0xc00000, 0x200000, CRC(8cddedc2) SHA1(e3993f5505bc7e61bec7be5b48c873572e1220f7) ) + ROM_LOAD( "rv1cg7.1n", 0xe00000, 0x200000, CRC(b39147ca) SHA1(50ca6691fc809c95e6999dd52e39f2b8c2d22f3b) ) + ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ + ROM_LOAD( "rv1ccrl.5a", 0x000000, 0x200000, CRC(bc634f72) SHA1(b5c504ed92bca7682614fc4c51f38cff607e6f2a) ) + ROM_LOAD( "rv1ccrh.5c", 0x200000, 0x080000, CRC(a741b262) SHA1(363076220a0eacc67befda05f8253963e8ffbcaa) ) + ROM_REGION( 0x600000, REGION_USER1, 0 ) /* 3D model data */ + ROM_LOAD( "rv1potl0.5b", 0x000000, 0x080000, CRC(de2ce519) SHA1(2fe0dd000571f76d1a4df6a439d40119125170ef) ) + ROM_LOAD( "rv1potl1.4b", 0x080000, 0x080000, CRC(2215cb5a) SHA1(d48ee692ab3dbcffdc49d22f6f232ca9390da766) ) + ROM_LOAD( "rv1potl2.3b", 0x100000, 0x080000, CRC(ddb15bf7) SHA1(4c54ec98e0cba10841d43a4ce593cdacfd7f90f8) ) + ROM_LOAD( "rv1potl3.2b", 0x180000, 0x080000, CRC(fa9361ca) SHA1(35a5c2712bca9c62400b724754de3a931ad21561) ) + ROM_LOAD( "rv1potm0.5c", 0x200000, 0x080000, CRC(3c024f3a) SHA1(711f0442823797b2d410352796a5cca66af98dce) ) + ROM_LOAD( "rv1potm1.4c", 0x280000, 0x080000, CRC(b1a32a68) SHA1(e24abb3a7e35d098abae5420bf8ef5c975718987) ) + ROM_LOAD( "rv1potm2.3c", 0x300000, 0x080000, CRC(a414fe15) SHA1(eb27cdca045ab2ab27dec179043328847fb65e11) ) + ROM_LOAD( "rv1potm3.2c", 0x380000, 0x080000, CRC(2953bbb4) SHA1(aca1acd87f7130d2522d0c6f8e60beeb7ab7495a) ) + ROM_LOAD( "rv1potu0.5d", 0x400000, 0x080000, CRC(b9eaf3cc) SHA1(3b2a9041f1fa90706ecf7d4fbff918516f891a07) ) + ROM_LOAD( "rv1potu1.4d", 0x480000, 0x080000, CRC(a5c55258) SHA1(826d4dde761aec7d848456f7bc4ba6268fe99605) ) + ROM_LOAD( "rv1potu2.3d", 0x500000, 0x080000, CRC(c18fcb74) SHA1(a4009ae2b014dc89aed4741fd97f84350117c2f4) ) + ROM_LOAD( "rv1potu3.2d", 0x580000, 0x080000, CRC(79735aaa) SHA1(1cf14274669b916a7641f7a16785da1b72347485) ) + ROM_REGION( 0x1000000, REGION_SOUND1, 0 ) /* C352 samples */ + ROM_LOAD( "rv1wav0.10r", 0x000000, 0x100000, CRC(5aef8143) SHA1(a75d31298e3ff9b290f238976a11e8b85cfb72d3) ) + ROM_LOAD( "rv1wav1.10p", 0x200000, 0x100000, CRC(9ed9e6b3) SHA1(dd1da2b08d1b6aa0912daacc77744c9799aabb78) ) + ROM_LOAD( "rv1wav2.10n", 0x100000, 0x100000, CRC(5af9dc83) SHA1(9aeb7f8217b806a6f3ed93056513af9fbcb6b372) ) + ROM_LOAD( "rv1wav3.10l", 0x300000, 0x100000, CRC(ffb9ad75) SHA1(a9a61a597bd3bbe9732f92747d82264fe4d9af48) ) + ROM_REGION( 0x300, REGION_PROMS, 0 ) /* gamma */ + ROM_LOAD( "rr1gam.2d", 0x0000, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) + ROM_LOAD( "rr1gam.3d", 0x0100, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) + ROM_LOAD( "rr1gam.4d", 0x0200, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) + ROM_REGION( 0x2000, REGION_USER2, 0 ) /* default EEPROM */ + ROM_LOAD( "rv1eeprm.9e", 0x0000, 0x2000, CRC(e00dd412) SHA1(f594b31ace5e5e980e904faa8b83a450cc95db17) ) +ROM_END + +ROM_START( raveracej ) + ROM_REGION( 0x200000, REGION_CPU1, 0 ) /* main program */ + ROM_LOAD32_BYTE( "rv1_prgllb.4d", 0x00003, 0x80000, CRC(71da3eea) SHA1(8a641bb23e0ad89cae5ee1570f8a3627b2434d20) ) + ROM_LOAD32_BYTE( "rv1_prglmb.2d", 0x00002, 0x80000, CRC(6ab7e9ce) SHA1(0c6376ca5a63409aeea344bbc201af6c47afe9ab) ) + ROM_LOAD32_BYTE( "rv1_prgumb.8d", 0x00001, 0x80000, CRC(375fabcf) SHA1(448e3db3e3fab8c7c27e214ab5a5fa84e5f84366) ) + ROM_LOAD32_BYTE( "rv1_prguub.6d", 0x00000, 0x80000, CRC(92f834d6) SHA1(028368790f0293fcfea5c7b12f7f315e27a62f77) ) + ROM_REGION16_LE( 0x80000, REGION_CPU4, 0 ) /* MCU */ + ROM_LOAD( "rv1data.6r", 0, 0x080000, CRC(d358ec20) SHA1(140c513349240417bb546dd2d151f3666b818e91) ) + C71_BIOS + NAMCO_C74_BIOS + ROM_REGION( 0x1000000, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ + ROM_LOAD( "rv1cg0.1a", 0x000000, 0x200000, CRC(c518f06b) SHA1(4c01d453244192dd13087bdc72a7f7be80b47cbc) ) + ROM_LOAD( "rv1cg1.1c", 0x200000, 0x200000, CRC(6628f792) SHA1(7a5405c5fcb2f3f001ae17df393c31e61a834f2b) ) + ROM_LOAD( "rv1cg2.1d", 0x400000, 0x200000, CRC(0b707cc5) SHA1(38e1a554b278062edc369565353497ac4b016f78) ) + ROM_LOAD( "rv1cg3.1e", 0x600000, 0x200000, CRC(39b62921) SHA1(873287d81338baf10dd85214d82f6c38bfdf199e) ) + ROM_LOAD( "rv1cg4.1f", 0x800000, 0x200000, CRC(a9791ea2) SHA1(245b2ebbadd1fbca90dc241f88e9f6f341b2a01a) ) + ROM_LOAD( "rv1cg5.1j", 0xa00000, 0x200000, CRC(b2c79ec1) SHA1(6f669996863bdf1fe09b0c1a2a876625029d3d43) ) + ROM_LOAD( "rv1cg6.1k", 0xc00000, 0x200000, CRC(8cddedc2) SHA1(e3993f5505bc7e61bec7be5b48c873572e1220f7) ) + ROM_LOAD( "rv1cg7.1n", 0xe00000, 0x200000, CRC(b39147ca) SHA1(50ca6691fc809c95e6999dd52e39f2b8c2d22f3b) ) + ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ + ROM_LOAD( "rv1ccrl.5a", 0x000000, 0x200000, CRC(bc634f72) SHA1(b5c504ed92bca7682614fc4c51f38cff607e6f2a) ) + ROM_LOAD( "rv1ccrh.5c", 0x200000, 0x080000, CRC(a741b262) SHA1(363076220a0eacc67befda05f8253963e8ffbcaa) ) + ROM_REGION( 0x600000, REGION_USER1, 0 ) /* 3D model data */ + ROM_LOAD( "rv1potl0.5b", 0x000000, 0x080000, CRC(de2ce519) SHA1(2fe0dd000571f76d1a4df6a439d40119125170ef) ) + ROM_LOAD( "rv1potl1.4b", 0x080000, 0x080000, CRC(2215cb5a) SHA1(d48ee692ab3dbcffdc49d22f6f232ca9390da766) ) + ROM_LOAD( "rv1potl2.3b", 0x100000, 0x080000, CRC(ddb15bf7) SHA1(4c54ec98e0cba10841d43a4ce593cdacfd7f90f8) ) + ROM_LOAD( "rv1potl3.2b", 0x180000, 0x080000, CRC(fa9361ca) SHA1(35a5c2712bca9c62400b724754de3a931ad21561) ) + ROM_LOAD( "rv1potm0.5c", 0x200000, 0x080000, CRC(3c024f3a) SHA1(711f0442823797b2d410352796a5cca66af98dce) ) + ROM_LOAD( "rv1potm1.4c", 0x280000, 0x080000, CRC(b1a32a68) SHA1(e24abb3a7e35d098abae5420bf8ef5c975718987) ) + ROM_LOAD( "rv1potm2.3c", 0x300000, 0x080000, CRC(a414fe15) SHA1(eb27cdca045ab2ab27dec179043328847fb65e11) ) + ROM_LOAD( "rv1potm3.2c", 0x380000, 0x080000, CRC(2953bbb4) SHA1(aca1acd87f7130d2522d0c6f8e60beeb7ab7495a) ) + ROM_LOAD( "rv1potu0.5d", 0x400000, 0x080000, CRC(b9eaf3cc) SHA1(3b2a9041f1fa90706ecf7d4fbff918516f891a07) ) + ROM_LOAD( "rv1potu1.4d", 0x480000, 0x080000, CRC(a5c55258) SHA1(826d4dde761aec7d848456f7bc4ba6268fe99605) ) + ROM_LOAD( "rv1potu2.3d", 0x500000, 0x080000, CRC(c18fcb74) SHA1(a4009ae2b014dc89aed4741fd97f84350117c2f4) ) + ROM_LOAD( "rv1potu3.2d", 0x580000, 0x080000, CRC(79735aaa) SHA1(1cf14274669b916a7641f7a16785da1b72347485) ) + ROM_REGION( 0x1000000, REGION_SOUND1, 0 ) /* C352 samples */ + ROM_LOAD( "rv1wav0.10r", 0x000000, 0x100000, CRC(5aef8143) SHA1(a75d31298e3ff9b290f238976a11e8b85cfb72d3) ) + ROM_LOAD( "rv1wav1.10p", 0x200000, 0x100000, CRC(9ed9e6b3) SHA1(dd1da2b08d1b6aa0912daacc77744c9799aabb78) ) + ROM_LOAD( "rv1wav2.10n", 0x100000, 0x100000, CRC(5af9dc83) SHA1(9aeb7f8217b806a6f3ed93056513af9fbcb6b372) ) + ROM_LOAD( "rv1wav3.10l", 0x300000, 0x100000, CRC(ffb9ad75) SHA1(a9a61a597bd3bbe9732f92747d82264fe4d9af48) ) + ROM_REGION( 0x300, REGION_PROMS, 0 ) /* gamma */ + ROM_LOAD( "rr1gam.2d", 0x0000, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) + ROM_LOAD( "rr1gam.3d", 0x0100, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) + ROM_LOAD( "rr1gam.4d", 0x0200, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) + ROM_REGION( 0x2000, REGION_USER2, 0 ) /* default EEPROM */ + ROM_LOAD( "rv1eeprm.9e", 0x0000, 0x2000, CRC(e00dd412) SHA1(f594b31ace5e5e980e904faa8b83a450cc95db17) ) +ROM_END + +ROM_START( raveraceja ) + ROM_REGION( 0x200000, REGION_CPU1, 0 ) /* main program */ + ROM_LOAD32_BYTE( "rv1_prgll.4d", 0x00003, 0x80000, CRC(5dfce6cd) SHA1(1aeeca1e507ae4cbe3d39ca5efd1cc4fe1ab03a8) ) + ROM_LOAD32_BYTE( "rv1_prglm.2d", 0x00002, 0x80000, CRC(0d4d9f74) SHA1(f886b0629cbf5a369af1f44e53c6fd3f51b3fbc9) ) + ROM_LOAD32_BYTE( "rv1_prgum.8d", 0x00001, 0x80000, CRC(28e503e3) SHA1(a3071461f840f28c65c660de215c73f812f356b3) ) + ROM_LOAD32_BYTE( "rv1_prguu.6d", 0x00000, 0x80000, CRC(c47d9ff4) SHA1(4d7c4ac4151a3b306e7277937add8eee26e561a6) ) + ROM_REGION16_LE( 0x80000, REGION_CPU4, 0 ) /* MCU */ + ROM_LOAD( "rv1data.6r", 0, 0x080000, CRC(d358ec20) SHA1(140c513349240417bb546dd2d151f3666b818e91) ) + C71_BIOS + NAMCO_C74_BIOS + ROM_REGION( 0x1000000, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ + ROM_LOAD( "rv1cg0.1a", 0x000000, 0x200000, CRC(c518f06b) SHA1(4c01d453244192dd13087bdc72a7f7be80b47cbc) ) + ROM_LOAD( "rv1cg1.1c", 0x200000, 0x200000, CRC(6628f792) SHA1(7a5405c5fcb2f3f001ae17df393c31e61a834f2b) ) + ROM_LOAD( "rv1cg2.1d", 0x400000, 0x200000, CRC(0b707cc5) SHA1(38e1a554b278062edc369565353497ac4b016f78) ) + ROM_LOAD( "rv1cg3.1e", 0x600000, 0x200000, CRC(39b62921) SHA1(873287d81338baf10dd85214d82f6c38bfdf199e) ) + ROM_LOAD( "rv1cg4.1f", 0x800000, 0x200000, CRC(a9791ea2) SHA1(245b2ebbadd1fbca90dc241f88e9f6f341b2a01a) ) + ROM_LOAD( "rv1cg5.1j", 0xa00000, 0x200000, CRC(b2c79ec1) SHA1(6f669996863bdf1fe09b0c1a2a876625029d3d43) ) + ROM_LOAD( "rv1cg6.1k", 0xc00000, 0x200000, CRC(8cddedc2) SHA1(e3993f5505bc7e61bec7be5b48c873572e1220f7) ) + ROM_LOAD( "rv1cg7.1n", 0xe00000, 0x200000, CRC(b39147ca) SHA1(50ca6691fc809c95e6999dd52e39f2b8c2d22f3b) ) + ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ + ROM_LOAD( "rv1ccrl.5a", 0x000000, 0x200000, CRC(bc634f72) SHA1(b5c504ed92bca7682614fc4c51f38cff607e6f2a) ) + ROM_LOAD( "rv1ccrh.5c", 0x200000, 0x080000, CRC(a741b262) SHA1(363076220a0eacc67befda05f8253963e8ffbcaa) ) + ROM_REGION( 0x600000, REGION_USER1, 0 ) /* 3D model data */ + ROM_LOAD( "rv1potl0.5b", 0x000000, 0x080000, CRC(de2ce519) SHA1(2fe0dd000571f76d1a4df6a439d40119125170ef) ) + ROM_LOAD( "rv1potl1.4b", 0x080000, 0x080000, CRC(2215cb5a) SHA1(d48ee692ab3dbcffdc49d22f6f232ca9390da766) ) + ROM_LOAD( "rv1potl2.3b", 0x100000, 0x080000, CRC(ddb15bf7) SHA1(4c54ec98e0cba10841d43a4ce593cdacfd7f90f8) ) + ROM_LOAD( "rv1potl3.2b", 0x180000, 0x080000, CRC(fa9361ca) SHA1(35a5c2712bca9c62400b724754de3a931ad21561) ) + ROM_LOAD( "rv1potm0.5c", 0x200000, 0x080000, CRC(3c024f3a) SHA1(711f0442823797b2d410352796a5cca66af98dce) ) + ROM_LOAD( "rv1potm1.4c", 0x280000, 0x080000, CRC(b1a32a68) SHA1(e24abb3a7e35d098abae5420bf8ef5c975718987) ) + ROM_LOAD( "rv1potm2.3c", 0x300000, 0x080000, CRC(a414fe15) SHA1(eb27cdca045ab2ab27dec179043328847fb65e11) ) + ROM_LOAD( "rv1potm3.2c", 0x380000, 0x080000, CRC(2953bbb4) SHA1(aca1acd87f7130d2522d0c6f8e60beeb7ab7495a) ) + ROM_LOAD( "rv1potu0.5d", 0x400000, 0x080000, CRC(b9eaf3cc) SHA1(3b2a9041f1fa90706ecf7d4fbff918516f891a07) ) + ROM_LOAD( "rv1potu1.4d", 0x480000, 0x080000, CRC(a5c55258) SHA1(826d4dde761aec7d848456f7bc4ba6268fe99605) ) + ROM_LOAD( "rv1potu2.3d", 0x500000, 0x080000, CRC(c18fcb74) SHA1(a4009ae2b014dc89aed4741fd97f84350117c2f4) ) + ROM_LOAD( "rv1potu3.2d", 0x580000, 0x080000, CRC(79735aaa) SHA1(1cf14274669b916a7641f7a16785da1b72347485) ) + ROM_REGION( 0x1000000, REGION_SOUND1, 0 ) /* C352 samples */ + ROM_LOAD( "rv1wav0.10r", 0x000000, 0x100000, CRC(5aef8143) SHA1(a75d31298e3ff9b290f238976a11e8b85cfb72d3) ) + ROM_LOAD( "rv1wav1.10p", 0x200000, 0x100000, CRC(9ed9e6b3) SHA1(dd1da2b08d1b6aa0912daacc77744c9799aabb78) ) + ROM_LOAD( "rv1wav2.10n", 0x100000, 0x100000, CRC(5af9dc83) SHA1(9aeb7f8217b806a6f3ed93056513af9fbcb6b372) ) + ROM_LOAD( "rv1wav3.10l", 0x300000, 0x100000, CRC(ffb9ad75) SHA1(a9a61a597bd3bbe9732f92747d82264fe4d9af48) ) + ROM_REGION( 0x300, REGION_PROMS, 0 ) /* gamma */ + ROM_LOAD( "rr1gam.2d", 0x0000, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) + ROM_LOAD( "rr1gam.3d", 0x0100, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) + ROM_LOAD( "rr1gam.4d", 0x0200, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) + ROM_REGION( 0x2000, REGION_USER2, 0 ) /* default EEPROM */ + ROM_LOAD( "rv1eeprm.9e", 0x0000, 0x2000, CRC(e00dd412) SHA1(f594b31ace5e5e980e904faa8b83a450cc95db17) ) +ROM_END + +ROM_START( acedrive ) + ROM_REGION( 0x200000, REGION_CPU1, 0 ) /* main program */ + ROM_LOAD32_BYTE( "ad2_prgll.4d", 0x00003, 0x80000, CRC(808c5ff8) SHA1(119c90ecb5aa099a0e5d1d7944c004beacead367) ) + ROM_LOAD32_BYTE( "ad2_prglm.2d", 0x00002, 0x80000, CRC(5f726a10) SHA1(d077312c6a387fbdf906d278c73c6a3730687f32) ) + ROM_LOAD32_BYTE( "ad2_prgum.8d", 0x00001, 0x80000, CRC(d5042d6e) SHA1(9ae93e7ea7126302831a879ba0aadcb6e5b842f5) ) + ROM_LOAD32_BYTE( "ad2_prguu.6d", 0x00000, 0x80000, CRC(86d4661d) SHA1(2a1529a51ca5466994a2d0d84c7aab13cef95a11) ) + ROM_REGION16_LE( 0x80000, REGION_CPU4, 0 ) /* MCU */ + ROM_LOAD( "ad1data.6r", 0, 0x080000, CRC(82024f74) SHA1(711ab0c4f027716aeab18e3a5d3d06fa82af8007) ) + C71_BIOS + NAMCO_C74_BIOS + ROM_REGION( 0x1000000, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ + ROM_LOAD( "ad1cg0.1a", 0x800000, 0x200000, CRC(faaa1ee2) SHA1(878f2b74587ed4d06c5110a0eb0020c49ddc5dfa) ) + ROM_LOAD( "ad1cg1.2a", 0xa00000, 0x200000, CRC(1aab1eb7) SHA1(b8f9eeafec7e0de340cf48e38fa55dd14404c867) ) + ROM_LOAD( "ad1cg2.3a", 0xc00000, 0x200000, CRC(cdcd1874) SHA1(5a7a4a0d897cca4956b0a4f178f39f618c921861) ) + ROM_LOAD( "ad1cg3.5a", 0xe00000, 0x200000, CRC(effdd2cd) SHA1(9ff156e7e38c103b8fa6f3c29776dd38482d9cf2) ) + ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ + ROM_LOAD( "ad1ccrl.1c", 0x000000, 0x200000, CRC(bc3c9b12) SHA1(088e861e5c4b37c54b7f72963113a10870bf7927) ) + ROM_LOAD( "ad1ccrh.2c", 0x200000, 0x080000, CRC(71f44526) SHA1(bb4811fc5de626380ce6a17bee73e5e47926d850) ) + ROM_REGION( 0x300000, REGION_USER1, 0 ) /* 3D model data */ + ROM_LOAD( "ad1potl0.5b", 0x000000, 0x080000, CRC(dfc7e729) SHA1(5e3deef66d0a5dd2ff0584b8c8be4bf5e798e4d0) ) + ROM_LOAD( "ad1potl1.4b", 0x080000, 0x080000, CRC(5914ef8e) SHA1(f6db9c3061ceda76eef0a9538d9c048366b71124) ) + ROM_LOAD( "ad1potm0.5c", 0x100000, 0x080000, CRC(844bcd6b) SHA1(629b8dc0a7e94410c08c8874b69d9f4bc22f3e4f) ) + ROM_LOAD( "ad1potm1.4c", 0x180000, 0x080000, CRC(515cf541) SHA1(db1522813ea3e982d479cc1903d18799bf75aea9) ) + ROM_LOAD( "ad1potu0.5d", 0x200000, 0x080000, CRC(e0f44949) SHA1(ffdb64d600883974b05edaa9ed3071af355ee17f) ) + ROM_LOAD( "ad1potu1.4d", 0x280000, 0x080000, CRC(f2cd2cbb) SHA1(19fe6e3454a1e4353c7fe0a0d7a71742fea946de) ) + ROM_REGION( 0x1000000, REGION_SOUND1, 0 ) /* C352 samples */ + ROM_LOAD( "ad1wave0.10r", 0x000000, 0x100000, CRC(c7879a72) SHA1(ae04d664858b0944583590ed0003a9420032d5ca) ) + ROM_LOAD( "ad1wave1.10p", 0x200000, 0x100000, CRC(69c1d41e) SHA1(b5cdfe7b75075c585dfd842347f8e4e692bb2781) ) + ROM_LOAD( "ad1wave2.10n", 0x100000, 0x100000, CRC(365a6831) SHA1(ddaa44a4436d6de120b64a5d130b1ee18f872e19) ) + ROM_LOAD( "ad1wave3.10l", 0x300000, 0x100000, CRC(cd8ecb0b) SHA1(7950b5a3a81f5554f57accabc7a623b8265a21a1) ) + ROM_REGION( 0x300, REGION_PROMS, 0 ) /* gamma */ + ROM_LOAD( "rr1gam.2d", 0x0000, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) + ROM_LOAD( "rr1gam.3d", 0x0100, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) + ROM_LOAD( "rr1gam.4d", 0x0200, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) +ROM_END + +ROM_START( victlap ) + ROM_REGION( 0x200000, REGION_CPU1, 0 ) /* main program */ + ROM_LOAD32_BYTE( "adv2_prgllb.4d", 0x00003, 0x80000, CRC(03ba6e42) SHA1(0e8138214463a6db59a6f7cbea3f0b6ed1b82465) ) + ROM_LOAD32_BYTE( "adv2_prglmb.2d", 0x00002, 0x80000, CRC(9f4b49c0) SHA1(e8d5fc070f3855f11ef12b41bfd889f06acccd3d) ) + ROM_LOAD32_BYTE( "adv2_prgumb.8d", 0x00001, 0x80000, CRC(ccad3e90) SHA1(16ccddf5114f1847808b0c5655aadd8ac040ff4e) ) + ROM_LOAD32_BYTE( "adv2_prguub.6d", 0x00000, 0x80000, CRC(f3fffc41) SHA1(277cc5b24a094e4adff41d6d35ffc111bc8fef27) ) + ROM_REGION16_LE( 0x80000, REGION_CPU4, 0 ) /* MCU */ + ROM_LOAD( "adv1data.6r", 0, 0x080000, CRC(10eecdb4) SHA1(aaedeed166614e6670e765e0d7e4e9eb5f38ad10) ) + C71_BIOS + NAMCO_C74_BIOS + ROM_REGION( 0x1000000, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ + ROM_LOAD( "adv1cg0.2a", 0x000000, 0x200000, CRC(13353848) SHA1(c6c7693e3cb086919daf9fcaf6bf602142213073) ) + ROM_LOAD( "adv1cg1.1c", 0x200000, 0x200000, CRC(1542066c) SHA1(20a053e919b7a81da2a17d31dc7482832a4d4ffe) ) + ROM_LOAD( "adv1cg2.2d", 0x400000, 0x200000, CRC(111f371c) SHA1(29d8062daae51b3c1712bd30baa9813a2b5b374d) ) + ROM_LOAD( "adv1cg3.1e", 0x600000, 0x200000, CRC(a077831f) SHA1(71bb95199b368e48bc474123ca84d19213f73137) ) + ROM_LOAD( "adv1cg4.2f", 0x800000, 0x200000, CRC(71abdacf) SHA1(64409e6aa40dd9e5a6dd1dc306860fbbf6ee7c3e) ) + ROM_LOAD( "adv1cg5.1j", 0xa00000, 0x200000, CRC(cd6cd798) SHA1(51070997a457c0ace078174569cd548ac2226b2d) ) + ROM_LOAD( "adv1cg6.2k", 0xc00000, 0x200000, CRC(94bdafba) SHA1(41e64fa99b342edd8b0ed95ae9869c23e03399e6) ) + ROM_LOAD( "adv1cg7.1n", 0xe00000, 0x200000, CRC(18823475) SHA1(a3244d665b59c352593de21f5cb8d55ddf8cee5c) ) + ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ + ROM_LOAD( "adv1ccrl.5a", 0x000000, 0x200000, CRC(dd2b96ae) SHA1(6337ce17e617234c27ebad578ba82451649aad9c) ) + ROM_LOAD( "adv1ccrh.5c", 0x200000, 0x080000, CRC(5719844a) SHA1(a17d7bc239235e9f566931ba4fee1d6ad7964d83) ) + ROM_REGION( 0x480000, REGION_USER1, 0 ) /* 3D model data */ + ROM_LOAD( "adv1pot.l0", 0x000000, 0x080000, CRC(3b85b2a4) SHA1(84c92ed0105618d4aa5508af344b4b6cfa772567) ) + ROM_LOAD( "adv1pot.l1", 0x080000, 0x080000, CRC(601d6488) SHA1(c7932103ba6070e17deb3cc06060eed7789f938e) ) + ROM_LOAD( "adv1pot.l2", 0x100000, 0x080000, CRC(a0323a84) SHA1(deadf9a47461df7b137759d6886e676137b39fd2) ) + ROM_LOAD( "adv1pot.m0", 0x180000, 0x080000, CRC(20951aa2) SHA1(3de55bded443a5b78699cec4845470b53b22301a) ) + ROM_LOAD( "adv1pot.m1", 0x200000, 0x080000, CRC(5aed6fbf) SHA1(8cee781d8a12e00635b9a1e5cc8d82e64b17e8f1) ) + ROM_LOAD( "adv1pot.m2", 0x280000, 0x080000, CRC(00cbff92) SHA1(09a11ba064aafc921a7ca0add5898d91b773f10a) ) + ROM_LOAD( "adv1pot.u0", 0x300000, 0x080000, CRC(6b73dd2a) SHA1(e3654ab2b62e4f3314558209e37c5636f871a6c7) ) + ROM_LOAD( "adv1pot.u1", 0x380000, 0x080000, CRC(c8788f74) SHA1(606e10b05146e3db824aa608745de80584420d12) ) + ROM_LOAD( "adv1pot.u2", 0x400000, 0x080000, CRC(e67f29c5) SHA1(16222afb4f1f494711dd00ebb347c824db333bae) ) + ROM_REGION( 0x1000000, REGION_SOUND1, 0 ) /* C352 samples */ + ROM_LOAD( "adv1wav0.10r", 0x000000, 0x100000, CRC(f07b2d9d) SHA1(fd46c23b336d5e9a748f7f8d825c19737125d2fb) ) + ROM_LOAD( "adv1wav1.10p", 0x200000, 0x100000, CRC(737f3c7a) SHA1(4737994f146c0076e7270785f41f3a85c53c7c5f) ) + ROM_LOAD( "adv1wav2.10n", 0x100000, 0x100000, CRC(c1a5ca5e) SHA1(27e6f9256d5fe5966e91d6be1e6e80900a764af1) ) + ROM_LOAD( "adv1wav3.10l", 0x300000, 0x100000, CRC(fc6b8004) SHA1(5c9e0805895931ec2b6a43376059bdbf5777222f) ) + ROM_REGION( 0x300, REGION_PROMS, 0 ) /* gamma */ + ROM_LOAD( "rr1gam.2d", 0x0000, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) + ROM_LOAD( "rr1gam.3d", 0x0100, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) + ROM_LOAD( "rr1gam.4d", 0x0200, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) +ROM_END + +ROM_START( victlapa ) + ROM_REGION( 0x200000, REGION_CPU1, 0 ) /* main program */ + ROM_LOAD32_BYTE( "adv2_prgll.4d", 0x00003, 0x80000, CRC(4dc1b0ab) SHA1(b5913388d16f824af6dbb01b5b0350d510667a87) ) + ROM_LOAD32_BYTE( "adv2_prglm.2d", 0x00002, 0x80000, CRC(7b658bef) SHA1(cf982b49fde0c1897c4c16e77f9eb2a145d8cd42) ) + ROM_LOAD32_BYTE( "adv2_prgum.8d", 0x00001, 0x80000, CRC(af67f2fb) SHA1(f391843ee0d053e33660c60e3718871142d932f2) ) + ROM_LOAD32_BYTE( "adv2_prguu.6d", 0x00000, 0x80000, CRC(b60e5d2b) SHA1(f5740615c2864c5c6433275cf4388bda5122b7a7) ) + ROM_REGION16_LE( 0x80000, REGION_CPU4, 0 ) /* MCU */ + ROM_LOAD( "adv1data.6r", 0, 0x080000, CRC(10eecdb4) SHA1(aaedeed166614e6670e765e0d7e4e9eb5f38ad10) ) + C71_BIOS + NAMCO_C74_BIOS + ROM_REGION( 0x1000000, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ + ROM_LOAD( "adv1cg0.2a", 0x000000, 0x200000, CRC(13353848) SHA1(c6c7693e3cb086919daf9fcaf6bf602142213073) ) + ROM_LOAD( "adv1cg1.1c", 0x200000, 0x200000, CRC(1542066c) SHA1(20a053e919b7a81da2a17d31dc7482832a4d4ffe) ) + ROM_LOAD( "adv1cg2.2d", 0x400000, 0x200000, CRC(111f371c) SHA1(29d8062daae51b3c1712bd30baa9813a2b5b374d) ) + ROM_LOAD( "adv1cg3.1e", 0x600000, 0x200000, CRC(a077831f) SHA1(71bb95199b368e48bc474123ca84d19213f73137) ) + ROM_LOAD( "adv1cg4.2f", 0x800000, 0x200000, CRC(71abdacf) SHA1(64409e6aa40dd9e5a6dd1dc306860fbbf6ee7c3e) ) + ROM_LOAD( "adv1cg5.1j", 0xa00000, 0x200000, CRC(cd6cd798) SHA1(51070997a457c0ace078174569cd548ac2226b2d) ) + ROM_LOAD( "adv1cg6.2k", 0xc00000, 0x200000, CRC(94bdafba) SHA1(41e64fa99b342edd8b0ed95ae9869c23e03399e6) ) + ROM_LOAD( "adv1cg7.1n", 0xe00000, 0x200000, CRC(18823475) SHA1(a3244d665b59c352593de21f5cb8d55ddf8cee5c) ) + ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ + ROM_LOAD( "adv1ccrl.5a", 0x000000, 0x200000, CRC(dd2b96ae) SHA1(6337ce17e617234c27ebad578ba82451649aad9c) ) + ROM_LOAD( "adv1ccrh.5c", 0x200000, 0x080000, CRC(5719844a) SHA1(a17d7bc239235e9f566931ba4fee1d6ad7964d83) ) + ROM_REGION( 0x480000, REGION_USER1, 0 ) /* 3D model data */ + ROM_LOAD( "adv1pot.l0", 0x000000, 0x080000, CRC(3b85b2a4) SHA1(84c92ed0105618d4aa5508af344b4b6cfa772567) ) + ROM_LOAD( "adv1pot.l1", 0x080000, 0x080000, CRC(601d6488) SHA1(c7932103ba6070e17deb3cc06060eed7789f938e) ) + ROM_LOAD( "adv1pot.l2", 0x100000, 0x080000, CRC(a0323a84) SHA1(deadf9a47461df7b137759d6886e676137b39fd2) ) + ROM_LOAD( "adv1pot.m0", 0x180000, 0x080000, CRC(20951aa2) SHA1(3de55bded443a5b78699cec4845470b53b22301a) ) + ROM_LOAD( "adv1pot.m1", 0x200000, 0x080000, CRC(5aed6fbf) SHA1(8cee781d8a12e00635b9a1e5cc8d82e64b17e8f1) ) + ROM_LOAD( "adv1pot.m2", 0x280000, 0x080000, CRC(00cbff92) SHA1(09a11ba064aafc921a7ca0add5898d91b773f10a) ) + ROM_LOAD( "adv1pot.u0", 0x300000, 0x080000, CRC(6b73dd2a) SHA1(e3654ab2b62e4f3314558209e37c5636f871a6c7) ) + ROM_LOAD( "adv1pot.u1", 0x380000, 0x080000, CRC(c8788f74) SHA1(606e10b05146e3db824aa608745de80584420d12) ) + ROM_LOAD( "adv1pot.u2", 0x400000, 0x080000, CRC(e67f29c5) SHA1(16222afb4f1f494711dd00ebb347c824db333bae) ) + ROM_REGION( 0x1000000, REGION_SOUND1, 0 ) /* C352 samples */ + ROM_LOAD( "adv1wav0.10r", 0x000000, 0x100000, CRC(f07b2d9d) SHA1(fd46c23b336d5e9a748f7f8d825c19737125d2fb) ) + ROM_LOAD( "adv1wav1.10p", 0x200000, 0x100000, CRC(737f3c7a) SHA1(4737994f146c0076e7270785f41f3a85c53c7c5f) ) + ROM_LOAD( "adv1wav2.10n", 0x100000, 0x100000, CRC(c1a5ca5e) SHA1(27e6f9256d5fe5966e91d6be1e6e80900a764af1) ) + ROM_LOAD( "adv1wav3.10l", 0x300000, 0x100000, CRC(fc6b8004) SHA1(5c9e0805895931ec2b6a43376059bdbf5777222f) ) + ROM_REGION( 0x300, REGION_PROMS, 0 ) /* gamma */ + ROM_LOAD( "rr1gam.2d", 0x0000, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) + ROM_LOAD( "rr1gam.3d", 0x0100, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) + ROM_LOAD( "rr1gam.4d", 0x0200, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) +ROM_END + +ROM_START( victlapj ) + ROM_REGION( 0x200000, REGION_CPU1, 0 ) /* main program */ + ROM_LOAD32_BYTE( "adv1_prgllc.4d", 0x00003, 0x80000, CRC(1c630018) SHA1(c4cddeb18c6b81c768e25489f1d5af0e9c0bbfa5) ) + ROM_LOAD32_BYTE( "adv1_prglmc.2d", 0x00002, 0x80000, CRC(78413604) SHA1(08245cc1f8d97a166b6c0022fc03c423d92a3653) ) + ROM_LOAD32_BYTE( "adv1_prgumc.8d", 0x00001, 0x80000, CRC(464388d9) SHA1(afad780532aff175b0a547392e80c9f01efbf9d9) ) + ROM_LOAD32_BYTE( "adv1_prguuc.6d", 0x00000, 0x80000, CRC(ad3cb5f9) SHA1(9a62043f60de4d4c82c5bec169ec975add271367) ) + ROM_REGION16_LE( 0x80000, REGION_CPU4, 0 ) /* MCU */ + ROM_LOAD( "adv1data.6r", 0, 0x080000, CRC(10eecdb4) SHA1(aaedeed166614e6670e765e0d7e4e9eb5f38ad10) ) + C71_BIOS + NAMCO_C74_BIOS + ROM_REGION( 0x1000000, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ + ROM_LOAD( "adv1cg0.2a", 0x000000, 0x200000, CRC(13353848) SHA1(c6c7693e3cb086919daf9fcaf6bf602142213073) ) + ROM_LOAD( "adv1cg1.1c", 0x200000, 0x200000, CRC(1542066c) SHA1(20a053e919b7a81da2a17d31dc7482832a4d4ffe) ) + ROM_LOAD( "adv1cg2.2d", 0x400000, 0x200000, CRC(111f371c) SHA1(29d8062daae51b3c1712bd30baa9813a2b5b374d) ) + ROM_LOAD( "adv1cg3.1e", 0x600000, 0x200000, CRC(a077831f) SHA1(71bb95199b368e48bc474123ca84d19213f73137) ) + ROM_LOAD( "adv1cg4.2f", 0x800000, 0x200000, CRC(71abdacf) SHA1(64409e6aa40dd9e5a6dd1dc306860fbbf6ee7c3e) ) + ROM_LOAD( "adv1cg5.1j", 0xa00000, 0x200000, CRC(cd6cd798) SHA1(51070997a457c0ace078174569cd548ac2226b2d) ) + ROM_LOAD( "adv1cg6.2k", 0xc00000, 0x200000, CRC(94bdafba) SHA1(41e64fa99b342edd8b0ed95ae9869c23e03399e6) ) + ROM_LOAD( "adv1cg7.1n", 0xe00000, 0x200000, CRC(18823475) SHA1(a3244d665b59c352593de21f5cb8d55ddf8cee5c) ) + ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ + ROM_LOAD( "adv1ccrl.5a", 0x000000, 0x200000, CRC(dd2b96ae) SHA1(6337ce17e617234c27ebad578ba82451649aad9c) ) + ROM_LOAD( "adv1ccrh.5c", 0x200000, 0x080000, CRC(5719844a) SHA1(a17d7bc239235e9f566931ba4fee1d6ad7964d83) ) + ROM_REGION( 0x480000, REGION_USER1, 0 ) /* 3D model data */ + ROM_LOAD( "adv1pot.l0", 0x000000, 0x080000, CRC(3b85b2a4) SHA1(84c92ed0105618d4aa5508af344b4b6cfa772567) ) + ROM_LOAD( "adv1pot.l1", 0x080000, 0x080000, CRC(601d6488) SHA1(c7932103ba6070e17deb3cc06060eed7789f938e) ) + ROM_LOAD( "adv1pot.l2", 0x100000, 0x080000, CRC(a0323a84) SHA1(deadf9a47461df7b137759d6886e676137b39fd2) ) + ROM_LOAD( "adv1pot.m0", 0x180000, 0x080000, CRC(20951aa2) SHA1(3de55bded443a5b78699cec4845470b53b22301a) ) + ROM_LOAD( "adv1pot.m1", 0x200000, 0x080000, CRC(5aed6fbf) SHA1(8cee781d8a12e00635b9a1e5cc8d82e64b17e8f1) ) + ROM_LOAD( "adv1pot.m2", 0x280000, 0x080000, CRC(00cbff92) SHA1(09a11ba064aafc921a7ca0add5898d91b773f10a) ) + ROM_LOAD( "adv1pot.u0", 0x300000, 0x080000, CRC(6b73dd2a) SHA1(e3654ab2b62e4f3314558209e37c5636f871a6c7) ) + ROM_LOAD( "adv1pot.u1", 0x380000, 0x080000, CRC(c8788f74) SHA1(606e10b05146e3db824aa608745de80584420d12) ) + ROM_LOAD( "adv1pot.u2", 0x400000, 0x080000, CRC(e67f29c5) SHA1(16222afb4f1f494711dd00ebb347c824db333bae) ) + ROM_REGION( 0x1000000, REGION_SOUND1, 0 ) /* C352 samples */ + ROM_LOAD( "adv1wav0.10r", 0x000000, 0x100000, CRC(f07b2d9d) SHA1(fd46c23b336d5e9a748f7f8d825c19737125d2fb) ) + ROM_LOAD( "adv1wav1.10p", 0x200000, 0x100000, CRC(737f3c7a) SHA1(4737994f146c0076e7270785f41f3a85c53c7c5f) ) + ROM_LOAD( "adv1wav2.10n", 0x100000, 0x100000, CRC(c1a5ca5e) SHA1(27e6f9256d5fe5966e91d6be1e6e80900a764af1) ) + ROM_LOAD( "adv1wav3.10l", 0x300000, 0x100000, CRC(fc6b8004) SHA1(5c9e0805895931ec2b6a43376059bdbf5777222f) ) + ROM_REGION( 0x300, REGION_PROMS, 0 ) /* gamma */ + ROM_LOAD( "rr1gam.2d", 0x0000, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) + ROM_LOAD( "rr1gam.3d", 0x0100, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) + ROM_LOAD( "rr1gam.4d", 0x0200, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) +ROM_END + +ROM_START( alpinerd ) + ROM_REGION( 0x400000, REGION_CPU1, 0 ) /* main program */ + ROM_LOAD32_BYTE( "ar2verd.1", 0x00003, 0x100000, CRC(fa3380b9) SHA1(2a46988745bd2672f8082399a68ae0d0ab3d28f2) ) + ROM_LOAD32_BYTE( "ar2verd.2", 0x00002, 0x100000, CRC(76141352) SHA1(0f7230dd9cd6f1b83d499034affc7bc2c4385ab5) ) + ROM_LOAD32_BYTE( "ar2verd.3", 0x00001, 0x100000, CRC(9beffe6a) SHA1(d8efd1e3829d32bb06537d7cecb59f8df9b6d663) ) + ROM_LOAD32_BYTE( "ar2verd.4", 0x00000, 0x100000, CRC(1f3f1134) SHA1(0afa78444d1463d214f1afd7ec500af76d567489) ) + ROM_REGION16_LE( 0x080000, REGION_CPU4, 0 ) /* MCU */ + ROM_LOAD( "ar1datab.8k", 0, 0x080000, CRC(c26306f8) SHA1(6d8d993c076d5ced523143a86bd0938b3794478d) ) + C71_BIOS + ROM_REGION( 0x1000000, REGION_GFX1, ROMREGION_ERASEFF ) /* 32x32x8bpp sprite tiles */ + ROM_LOAD( "ar1scg0.12f", 0x000000, 0x200000, CRC(e7be830a) SHA1(60e2162eecd7401a0c26c525de2715cbfb10c1c5) ) + ROM_LOAD( "ar1scg1.10f", 0x200000, 0x200000, CRC(8f15a686) SHA1(bce2d4380c6c39aa402566ddb0f62bbe6d7bfa1d) ) + ROM_REGION( 0x1000000, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ + ROM_LOAD( "ar1cg0.8d", 0x000000, 0x200000, CRC(93f3a9d9) SHA1(7e94c81ad5ace98a2f0d00d101d464883d38c197) ) + ROM_LOAD( "ar1cg1.10d", 0x200000, 0x200000, CRC(39828c8b) SHA1(424aa67eb0b898c9cab8a4749893a9c5696ac430) ) + ROM_LOAD( "ar1cg2.12d", 0x400000, 0x200000, CRC(f7b058d1) SHA1(fffd0f01724a26dd47b1ecceecf4a139d5746f81) ) + ROM_LOAD( "ar1cg3.13d", 0x600000, 0x200000, CRC(c28a3d2a) SHA1(cdc44fdbc99274e860c834e42b4cfafb478d4d26) ) + ROM_LOAD( "ar1cg4.14d", 0x800000, 0x200000, CRC(abdb161f) SHA1(260bff9b0e94c1b2ea4b9d7fa170fbca212e85ee) ) + ROM_LOAD( "ar1cg5.16d", 0xa00000, 0x200000, CRC(2381cfea) SHA1(1de4c8b94df233fd74771fa47843290a3d8df0c8) ) + ROM_LOAD( "ar1cg6.18d", 0xc00000, 0x200000, CRC(ca0b6d23) SHA1(df969e0eeec557a95584b06995b0d55f2c6ec70a) ) + ROM_LOAD( "ar1cg7.19d", 0xe00000, 0x200000, CRC(ffb9f9f9) SHA1(2b8c75b580f77e887df7d50909a3a95cda570e20) ) + ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ + ROM_LOAD( "ar1ccrl.3d", 0x000000, 0x200000, CRC(17387b2c) SHA1(dfd7cadaf97917347c0fa98f395364a543e49612) ) + ROM_LOAD( "ar1ccrh.1d", 0x200000, 0x080000, CRC(ee7a4803) SHA1(8383c9a8ef5ed94df13446ca5cefa5f9e518f175) ) + ROM_REGION( 0x600000, REGION_USER1, 0 ) /* 3D model data */ + ROM_LOAD( "ar1ptrl0.18k", 0x000000, 0x080000, CRC(82405108) SHA1(0a40882a9bc8621c620bede404c78f6b1333f223) ) + ROM_LOAD( "ar1ptrl1.16k", 0x080000, 0x080000, CRC(8739b09c) SHA1(cd603c4dc2f9ffc4185f891eb83e4c383c564294) ) + ROM_LOAD( "ar1ptrl2.15k", 0x100000, 0x080000, CRC(bda693a9) SHA1(fe71dd3c63198737aa2d39527f0004e977e3be20) ) + ROM_LOAD( "ar1ptrl3.14k", 0x180000, 0x080000, CRC(82797405) SHA1(2f205fee2d33e183c80a906fb38900167c011240) ) + ROM_LOAD( "ar1ptrm0.18j", 0x200000, 0x080000, CRC(64bd6620) SHA1(2e33ff22208805ece304128be8887646fc890f6d) ) + ROM_LOAD( "ar1ptrm1.16j", 0x280000, 0x080000, CRC(2232f0a5) SHA1(3fccf6d4a0c4100cc85e3051024d659c4a1c769e) ) + ROM_LOAD( "ar1ptrm2.15j", 0x300000, 0x080000, CRC(8ee14e6f) SHA1(f6f1cbb748b109b365255378c18e710ba6270c1c) ) + ROM_LOAD( "ar1ptrm3.14j", 0x380000, 0x080000, CRC(1094a970) SHA1(d41b10f48e1ef312bcaf09f27fabc7252c30e648) ) + ROM_LOAD( "ar1ptru0.18f", 0x400000, 0x080000, CRC(26d88467) SHA1(d528f989fab4dd5ac1aec9b596a05fbadcc0587a) ) + ROM_LOAD( "ar1ptru1.16f", 0x480000, 0x080000, CRC(c5e2c208) SHA1(152fde0b95a5df8c781e4a83577cfbbc7672ae0d) ) + ROM_LOAD( "ar1ptru2.15f", 0x500000, 0x080000, CRC(1321ec59) SHA1(dbd3687a4c6b1aa0b18e336f99dabb9010d36639) ) + ROM_LOAD( "ar1ptru3.14f", 0x580000, 0x080000, CRC(139d7dc1) SHA1(6d25e6ad552a91a0c5fc03db7e1a801ccf9c9556) ) + ROM_REGION( 0x1000000, REGION_SOUND1, 0 ) /* C352 samples */ + ROM_LOAD( "ar1wavea.2l", 0, 0x200000, CRC(dbf64562) SHA1(454fd7d5b860f0e5557d8900393be95d6c992ad1) ) + ROM_REGION( 0x2000, REGION_USER2, 0 ) /* default EEPROM */ + ROM_LOAD( "alpiner_defaults.nv", 0x0000, 0x2000, CRC(efbef3d8) SHA1(459035600655cd83780db6c59aba044981cdcdc4) ) +ROM_END + +ROM_START( alpinerc ) + ROM_REGION( 0x400000, REGION_CPU1, 0 ) /* main program */ + ROM_LOAD32_BYTE( "ar2verc.1", 0x00003, 0x100000, CRC(61323842) SHA1(e3c33248340bee252f230124fa9b7fa935a60565) ) + ROM_LOAD32_BYTE( "ar2verc.2", 0x00002, 0x100000, CRC(43795b2d) SHA1(e060f3259661279a36300431c5ca7347bde8b6ec) ) + ROM_LOAD32_BYTE( "ar2verc.3", 0x00001, 0x100000, CRC(acb3003b) SHA1(ea0cbf3a1607b06b108df051f38fec1f214f42d2) ) + ROM_LOAD32_BYTE( "ar2verc.4", 0x00000, 0x100000, CRC(800acc21) SHA1(41d26766da2db46954a2351bbc50aea94bc1d564) ) + ROM_REGION16_LE( 0x080000, REGION_CPU4, 0 ) /* MCU */ + ROM_LOAD( "ar1datab.8k", 0, 0x080000, CRC(c26306f8) SHA1(6d8d993c076d5ced523143a86bd0938b3794478d) ) + C71_BIOS + ROM_REGION( 0x1000000, REGION_GFX1, ROMREGION_ERASEFF ) /* 32x32x8bpp sprite tiles */ + ROM_LOAD( "ar1scg0.12f", 0x000000, 0x200000, CRC(e7be830a) SHA1(60e2162eecd7401a0c26c525de2715cbfb10c1c5) ) + ROM_LOAD( "ar1scg1.10f", 0x200000, 0x200000, CRC(8f15a686) SHA1(bce2d4380c6c39aa402566ddb0f62bbe6d7bfa1d) ) + ROM_REGION( 0x1000000, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ + ROM_LOAD( "ar1cg0.8d", 0x000000, 0x200000, CRC(93f3a9d9) SHA1(7e94c81ad5ace98a2f0d00d101d464883d38c197) ) + ROM_LOAD( "ar1cg1.10d", 0x200000, 0x200000, CRC(39828c8b) SHA1(424aa67eb0b898c9cab8a4749893a9c5696ac430) ) + ROM_LOAD( "ar1cg2.12d", 0x400000, 0x200000, CRC(f7b058d1) SHA1(fffd0f01724a26dd47b1ecceecf4a139d5746f81) ) + ROM_LOAD( "ar1cg3.13d", 0x600000, 0x200000, CRC(c28a3d2a) SHA1(cdc44fdbc99274e860c834e42b4cfafb478d4d26) ) + ROM_LOAD( "ar1cg4.14d", 0x800000, 0x200000, CRC(abdb161f) SHA1(260bff9b0e94c1b2ea4b9d7fa170fbca212e85ee) ) + ROM_LOAD( "ar1cg5.16d", 0xa00000, 0x200000, CRC(2381cfea) SHA1(1de4c8b94df233fd74771fa47843290a3d8df0c8) ) + ROM_LOAD( "ar1cg6.18d", 0xc00000, 0x200000, CRC(ca0b6d23) SHA1(df969e0eeec557a95584b06995b0d55f2c6ec70a) ) + ROM_LOAD( "ar1cg7.19d", 0xe00000, 0x200000, CRC(ffb9f9f9) SHA1(2b8c75b580f77e887df7d50909a3a95cda570e20) ) + ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ + ROM_LOAD( "ar1ccrl.3d", 0x000000, 0x200000, CRC(17387b2c) SHA1(dfd7cadaf97917347c0fa98f395364a543e49612) ) + ROM_LOAD( "ar1ccrh.1d", 0x200000, 0x080000, CRC(ee7a4803) SHA1(8383c9a8ef5ed94df13446ca5cefa5f9e518f175) ) + ROM_REGION( 0x600000, REGION_USER1, 0 ) /* 3D model data */ + ROM_LOAD( "ar1ptrl0.18k", 0x000000, 0x080000, CRC(82405108) SHA1(0a40882a9bc8621c620bede404c78f6b1333f223) ) + ROM_LOAD( "ar1ptrl1.16k", 0x080000, 0x080000, CRC(8739b09c) SHA1(cd603c4dc2f9ffc4185f891eb83e4c383c564294) ) + ROM_LOAD( "ar1ptrl2.15k", 0x100000, 0x080000, CRC(bda693a9) SHA1(fe71dd3c63198737aa2d39527f0004e977e3be20) ) + ROM_LOAD( "ar1ptrl3.14k", 0x180000, 0x080000, CRC(82797405) SHA1(2f205fee2d33e183c80a906fb38900167c011240) ) + ROM_LOAD( "ar1ptrm0.18j", 0x200000, 0x080000, CRC(64bd6620) SHA1(2e33ff22208805ece304128be8887646fc890f6d) ) + ROM_LOAD( "ar1ptrm1.16j", 0x280000, 0x080000, CRC(2232f0a5) SHA1(3fccf6d4a0c4100cc85e3051024d659c4a1c769e) ) + ROM_LOAD( "ar1ptrm2.15j", 0x300000, 0x080000, CRC(8ee14e6f) SHA1(f6f1cbb748b109b365255378c18e710ba6270c1c) ) + ROM_LOAD( "ar1ptrm3.14j", 0x380000, 0x080000, CRC(1094a970) SHA1(d41b10f48e1ef312bcaf09f27fabc7252c30e648) ) + ROM_LOAD( "ar1ptru0.18f", 0x400000, 0x080000, CRC(26d88467) SHA1(d528f989fab4dd5ac1aec9b596a05fbadcc0587a) ) + ROM_LOAD( "ar1ptru1.16f", 0x480000, 0x080000, CRC(c5e2c208) SHA1(152fde0b95a5df8c781e4a83577cfbbc7672ae0d) ) + ROM_LOAD( "ar1ptru2.15f", 0x500000, 0x080000, CRC(1321ec59) SHA1(dbd3687a4c6b1aa0b18e336f99dabb9010d36639) ) + ROM_LOAD( "ar1ptru3.14f", 0x580000, 0x080000, CRC(139d7dc1) SHA1(6d25e6ad552a91a0c5fc03db7e1a801ccf9c9556) ) + ROM_REGION( 0x1000000, REGION_SOUND1, 0 ) /* C352 samples */ + ROM_LOAD( "ar1wavea.2l", 0, 0x200000, CRC(dbf64562) SHA1(454fd7d5b860f0e5557d8900393be95d6c992ad1) ) + ROM_REGION( 0x2000, REGION_USER2, 0 ) /* default EEPROM */ + ROM_LOAD( "alpiner_defaults.nv", 0x0000, 0x2000, CRC(efbef3d8) SHA1(459035600655cd83780db6c59aba044981cdcdc4) ) +ROM_END + +ROM_START( alpinerjc ) + ROM_REGION( 0x400000, REGION_CPU1, 0 ) /* main program */ + ROM_LOAD32_WORD_SWAP( "ar1verc.1", 0x00002, 0x200000, CRC(8a87dc27) SHA1(ea3675667dce4c184da61dbb204e39da7ae93e82) ) + ROM_LOAD32_WORD_SWAP( "ar1verc.2", 0x00000, 0x200000, CRC(5f4f5615) SHA1(ff8f818a4017ee8546037a10522f2cf1de6dc7cd) ) + ROM_REGION16_LE( 0x080000, REGION_CPU4, 0 ) /* MCU */ + ROM_LOAD( "ar1datab.8k", 0, 0x080000, CRC(c26306f8) SHA1(6d8d993c076d5ced523143a86bd0938b3794478d) ) + C71_BIOS + ROM_REGION( 0x1000000, REGION_GFX1, ROMREGION_ERASEFF ) /* 32x32x8bpp sprite tiles */ + ROM_LOAD( "ar1scg0.12f", 0x000000, 0x200000, CRC(e7be830a) SHA1(60e2162eecd7401a0c26c525de2715cbfb10c1c5) ) + ROM_LOAD( "ar1scg1.10f", 0x200000, 0x200000, CRC(8f15a686) SHA1(bce2d4380c6c39aa402566ddb0f62bbe6d7bfa1d) ) + ROM_REGION( 0x1000000, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ + ROM_LOAD( "ar1cg0.8d", 0x000000, 0x200000, CRC(93f3a9d9) SHA1(7e94c81ad5ace98a2f0d00d101d464883d38c197) ) + ROM_LOAD( "ar1cg1.10d", 0x200000, 0x200000, CRC(39828c8b) SHA1(424aa67eb0b898c9cab8a4749893a9c5696ac430) ) + ROM_LOAD( "ar1cg2.12d", 0x400000, 0x200000, CRC(f7b058d1) SHA1(fffd0f01724a26dd47b1ecceecf4a139d5746f81) ) + ROM_LOAD( "ar1cg3.13d", 0x600000, 0x200000, CRC(c28a3d2a) SHA1(cdc44fdbc99274e860c834e42b4cfafb478d4d26) ) + ROM_LOAD( "ar1cg4.14d", 0x800000, 0x200000, CRC(abdb161f) SHA1(260bff9b0e94c1b2ea4b9d7fa170fbca212e85ee) ) + ROM_LOAD( "ar1cg5.16d", 0xa00000, 0x200000, CRC(2381cfea) SHA1(1de4c8b94df233fd74771fa47843290a3d8df0c8) ) + ROM_LOAD( "ar1cg6.18d", 0xc00000, 0x200000, CRC(ca0b6d23) SHA1(df969e0eeec557a95584b06995b0d55f2c6ec70a) ) + ROM_LOAD( "ar1cg7.19d", 0xe00000, 0x200000, CRC(ffb9f9f9) SHA1(2b8c75b580f77e887df7d50909a3a95cda570e20) ) + ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ + ROM_LOAD( "ar1ccrl.3d", 0x000000, 0x200000, CRC(17387b2c) SHA1(dfd7cadaf97917347c0fa98f395364a543e49612) ) + ROM_LOAD( "ar1ccrh.1d", 0x200000, 0x080000, CRC(ee7a4803) SHA1(8383c9a8ef5ed94df13446ca5cefa5f9e518f175) ) + ROM_REGION( 0x600000, REGION_USER1, 0 ) /* 3D model data */ + ROM_LOAD( "ar1ptrl0.18k", 0x000000, 0x080000, CRC(82405108) SHA1(0a40882a9bc8621c620bede404c78f6b1333f223) ) + ROM_LOAD( "ar1ptrl1.16k", 0x080000, 0x080000, CRC(8739b09c) SHA1(cd603c4dc2f9ffc4185f891eb83e4c383c564294) ) + ROM_LOAD( "ar1ptrl2.15k", 0x100000, 0x080000, CRC(bda693a9) SHA1(fe71dd3c63198737aa2d39527f0004e977e3be20) ) + ROM_LOAD( "ar1ptrl3.14k", 0x180000, 0x080000, CRC(82797405) SHA1(2f205fee2d33e183c80a906fb38900167c011240) ) + ROM_LOAD( "ar1ptrm0.18j", 0x200000, 0x080000, CRC(64bd6620) SHA1(2e33ff22208805ece304128be8887646fc890f6d) ) + ROM_LOAD( "ar1ptrm1.16j", 0x280000, 0x080000, CRC(2232f0a5) SHA1(3fccf6d4a0c4100cc85e3051024d659c4a1c769e) ) + ROM_LOAD( "ar1ptrm2.15j", 0x300000, 0x080000, CRC(8ee14e6f) SHA1(f6f1cbb748b109b365255378c18e710ba6270c1c) ) + ROM_LOAD( "ar1ptrm3.14j", 0x380000, 0x080000, CRC(1094a970) SHA1(d41b10f48e1ef312bcaf09f27fabc7252c30e648) ) + ROM_LOAD( "ar1ptru0.18f", 0x400000, 0x080000, CRC(26d88467) SHA1(d528f989fab4dd5ac1aec9b596a05fbadcc0587a) ) + ROM_LOAD( "ar1ptru1.16f", 0x480000, 0x080000, CRC(c5e2c208) SHA1(152fde0b95a5df8c781e4a83577cfbbc7672ae0d) ) + ROM_LOAD( "ar1ptru2.15f", 0x500000, 0x080000, CRC(1321ec59) SHA1(dbd3687a4c6b1aa0b18e336f99dabb9010d36639) ) + ROM_LOAD( "ar1ptru3.14f", 0x580000, 0x080000, CRC(139d7dc1) SHA1(6d25e6ad552a91a0c5fc03db7e1a801ccf9c9556) ) + ROM_REGION( 0x1000000, REGION_SOUND1, 0 ) /* C352 samples */ + ROM_LOAD( "ar1wavea.2l", 0, 0x200000, CRC(dbf64562) SHA1(454fd7d5b860f0e5557d8900393be95d6c992ad1) ) + ROM_REGION( 0x2000, REGION_USER2, 0 ) /* default EEPROM */ + ROM_LOAD( "alpiner_defaults.nv", 0x0000, 0x2000, CRC(efbef3d8) SHA1(459035600655cd83780db6c59aba044981cdcdc4) ) +ROM_END + +ROM_START( airco22b ) + ROM_REGION( 0x400000, REGION_CPU1, 0 ) /* main program */ + ROM_LOAD32_BYTE( "acs1verb.1", 0x00003, 0x100000, CRC(062c4f61) SHA1(98e1c75dd0f493eb6ebb64b46543217c1d40116e) ) + ROM_LOAD32_BYTE( "acs1verb.2", 0x00002, 0x100000, CRC(8ae69711) SHA1(4c5323fa8f0419275e330fec66d1fb2b89bb3795) ) + ROM_LOAD32_BYTE( "acs1verb.3", 0x00001, 0x100000, CRC(71738e67) SHA1(eb8c66dedbeff911b6166ebbda466fb9656ef0fb) ) + ROM_LOAD32_BYTE( "acs1verb.4", 0x00000, 0x100000, CRC(3b193add) SHA1(5e3bca13905bfa3a2947f4f16ca01878b0a14a3a) ) + ROM_REGION16_LE( 0x080000, REGION_CPU4, 0 ) /* MCU */ + ROM_LOAD( "acs1data.8k", 0, 0x080000, CRC(33824bc9) SHA1(80ec63883770e5eec1f5f1ddc16a85ef8f22a48b) ) + C71_BIOS + ROM_REGION( 0x1000000, REGION_GFX1, ROMREGION_ERASEFF ) /* 32x32x8bpp sprite tiles */ + ROM_LOAD( "acs1scg0.12f", 0x000000, 0x200000, CRC(e5235404) SHA1(3133b71d1bde3a9815cd02e97382b8078b62b0bb) ) + ROM_LOAD( "acs1scg1.10f", 0x200000, 0x200000, CRC(828e91e7) SHA1(8383b029cd29fbad107fd49e866defb50c11c99a) ) + ROM_REGION( 0x1000000, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ + ROM_LOAD( "acs1cg0.8d", 0x000000, 0x200000, CRC(1f31343e) SHA1(25ba730cec74e0ed0b404f5c4430b7c3368c9b52) ) + ROM_LOAD( "acs1cg1.10d", 0x200000, 0x200000, CRC(ccd5481d) SHA1(050e6fc7d4e0591f8ffc9552d140b6bd4533c06d) ) + ROM_LOAD( "acs1cg2.12d", 0x400000, 0x200000, CRC(14e5d0d2) SHA1(3147ad11098030e9cfd93fbc0a1b3aafa8b8aba6) ) + ROM_LOAD( "acs1cg3.13d", 0x600000, 0x200000, CRC(1a7bcc16) SHA1(bbc4ca5b208bea8394d1679e4e2d17d22331e2c8) ) + ROM_LOAD( "acs1cg4.14d", 0x800000, 0x200000, CRC(1920b7fb) SHA1(56318f2a96c55998bb9a8d791d56be3dfb39867e) ) + ROM_LOAD( "acs1cg5.16d", 0xa00000, 0x200000, CRC(3dd109b7) SHA1(a7f914b9b80f1bca1afb6144698578a29ca74676) ) + ROM_LOAD( "acs1cg6.18d", 0xc00000, 0x200000, CRC(ec71c8a3) SHA1(86892a91883d483ca0d422b78fa36042e02f3ad3) ) + ROM_LOAD( "acs1cg7.19d", 0xe00000, 0x200000, CRC(82271757) SHA1(023c935e78b14da310e4c29da8785b82aa3241ac) ) + ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ + ROM_LOAD( "acs1ccrl.3d", 0x000000, 0x200000, CRC(07088ba1) SHA1(a962c0821d5af28ed508cfdbd613675454e306e3) ) + ROM_LOAD( "acs1ccrh.1d", 0x200000, 0x080000, CRC(62936af6) SHA1(ca80b68415aa2cd2ce4e90404f10640d0ae38be9) ) + ROM_REGION( 0x600000, REGION_USER1, 0 ) /* 3D model data */ + ROM_LOAD( "acs1ptl0.18k", 0x000000, 0x080000, CRC(bd5896c7) SHA1(58ec7d0f1e0bfdbf4908e1d920bbd7f094993777) ) + ROM_LOAD( "acs1ptl1.16k", 0x080000, 0x080000, CRC(e583b975) SHA1(beb0cc2b44bc69af057c2bb744cd7e1b95de577a) ) + ROM_LOAD( "acs1ptl2.15k", 0x100000, 0x080000, CRC(802d737a) SHA1(3d99a369db70d13fb87c2ff26c82b4b39afe94d9) ) + ROM_LOAD( "acs1ptl3.14k", 0x180000, 0x080000, CRC(fe556ecb) SHA1(9d9dbbb4f1d3688fb763001834640d79d9987d47) ) + ROM_LOAD( "acs1ptm0.18j", 0x200000, 0x080000, CRC(949b6c58) SHA1(6ea016551b10f5d5764921dcc5a4b81d2b93d701) ) + ROM_LOAD( "acs1ptm1.16j", 0x280000, 0x080000, CRC(8b2b99d9) SHA1(89c3545c4035509307728a9577018c1100ce3a54) ) + ROM_LOAD( "acs1ptm2.15j", 0x300000, 0x080000, CRC(f1515080) SHA1(27a87217a140477a6840a610c95ae57abc0d01a6) ) + ROM_LOAD( "acs1ptm3.14j", 0x380000, 0x080000, CRC(e364f4aa) SHA1(3af6a864765871664cccad82c4795f677be68d51) ) + ROM_LOAD( "acs1ptu0.18f", 0x400000, 0x080000, CRC(746b3084) SHA1(73397d1f22300fb3a81a0a068da4d0a8cfdc0a36) ) + ROM_LOAD( "acs1ptu1.16f", 0x480000, 0x080000, CRC(b44f1d3b) SHA1(f3f1a85c082053653e4da7d7f01f1baef1a013c8) ) + ROM_LOAD( "acs1ptu2.15f", 0x500000, 0x080000, CRC(fdd2d778) SHA1(0269f971d778e908a1efb5a63b08fb3365d98c2a) ) + ROM_LOAD( "acs1ptu3.14f", 0x580000, 0x080000, CRC(38b425d4) SHA1(8ff6dd6775d42afdff4c9fb2232e4d72b38e515a) ) + ROM_REGION( 0x1000000, REGION_SOUND1, 0 ) /* C352 samples */ + ROM_LOAD( "acs1wav0.1", 0x400000, 0x400000, CRC(52fb9762) SHA1(125c163e62d701c2e17ba0b572ed27c944ca0412) ) + ROM_LOAD( "acs1wav1.2", 0x800000, 0x400000, CRC(b568dca2) SHA1(503deb277691d801acac1380ded2868a5d5ac501) ) ROM_END ROM_START( cybrcycc ) ROM_REGION( 0x400000, REGION_CPU1, 0 ) /* main program */ - ROM_LOAD32_BYTE( "cb2ver-c.1", 0x00003, 0x100000, CRC(a8e07a14) SHA1(9bef7068c9bf792960df922ea79e4565d7680433) ) - ROM_LOAD32_BYTE( "cb2ver-c.2", 0x00002, 0x100000, CRC(054c504f) SHA1(9bde803ff09be0402f9b0388e55407362a2508e3) ) - ROM_LOAD32_BYTE( "cb2ver-c.3", 0x00001, 0x100000, CRC(47e6306c) SHA1(39d6fc2c3cb9b4c9d3569cedb79b916a90537115) ) - ROM_LOAD32_BYTE( "cb2ver-c.4", 0x00000, 0x100000, CRC(398426e4) SHA1(f20cd4892420e7b978baa51c9129b362422a3895) ) - - ROM_REGION( 0x200000, REGION_GFX1, ROMREGION_DISPOSE ) /* 32x32x8bpp sprite tiles */ - ROM_LOAD( "cb1scg0.12f", 0x200000*0, 0x200000,CRC(7aaca90d) SHA1(9808819db5d86d555a03bb20a2fbedf060d04f0e) ) /* identical to "cb1scg0.12l" */ - - ROM_REGION( 0x200000*7, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ - ROM_LOAD( "cb1cg0.12b", 0x200000*0x0, 0x200000,CRC(762a47a0) SHA1(8a49c700dca7afec5d8d6a38fedcd3ad4b0e6713) ) /* identical to "cb1cg0.8d" */ - ROM_LOAD( "cb1cg1.10d", 0x200000*0x1, 0x200000,CRC(df92c3e6) SHA1(302d7ee7e073a45e7baa948543bd30251f903a6d) ) /* identical to "cb1cg1.13b" */ - ROM_LOAD( "cb1cg2.12d", 0x200000*0x2, 0x200000,CRC(07bc508e) SHA1(7675694d10b50e57bb10b350559bd321df75d1ea) ) /* identical to "cb1cg2.14b" */ - ROM_LOAD( "cb1cg3.13d", 0x200000*0x3, 0x200000,CRC(50c86dea) SHA1(7837a1d2bd3ade470f7fbc732513dd598badd219) ) /* identical to "cb1cg3.16b" */ - ROM_LOAD( "cb1cg4.14d", 0x200000*0x4, 0x200000,CRC(e93b8894) SHA1(4d28b557b7ed2667e6af9f970f3e99cda785b940) ) /* identical to "cb1cg4.18b" */ - ROM_LOAD( "cb1cg5.16d", 0x200000*0x5, 0x200000,CRC(9ee610a1) SHA1(ebc7892b6a66461ca6b6b912a264da1594340b2d) ) /* identical to "cb1cg5.19b" */ - ROM_LOAD( "cb1cg6.18a", 0x200000*0x6, 0x200000,CRC(ddc3b5cc) SHA1(34edffee9eb6fbf4a00fce0da34d9354b1a1155f) ) /* identical to "cb1cg6.18d" */ - - ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ - ROM_LOAD( "cb1ccrl.3d", 0x000000, 0x200000,CRC(2f171c48) SHA1(52b76213e37379b4a5cea7de40cf5396dc2998d8) ) /* identical to "cb1ccrl.7b" */ - ROM_LOAD( "cb1ccrh.1d", 0x200000, 0x080000,CRC(86124b93) SHA1(f2cfd726313cbeff162d402a15de2360377630e7) ) /* identical to "cb1ccrh.5b" */ - - ROM_REGION( 0x80000*12, REGION_GFX4, 0 ) /* 3d model data */ - ROM_LOAD( "cb1ptrl0.18k", 0x80000*0x0, 0x80000,CRC(f1393a03) SHA1(c9e808601eef5839e6bff630e5f83380e073c5c0) ) - ROM_LOAD( "cb1ptrl1.16k", 0x80000*0x1, 0x80000,CRC(2ad51de7) SHA1(efd102b960ca10cda70da84661acf61e4bbb9f00) ) - ROM_LOAD( "cb1ptrl2.15k", 0x80000*0x2, 0x80000,CRC(78f77c0d) SHA1(5183a8909c2ac0a3d80e707393bcbb4441d79a3c) ) - ROM_LOAD( "cb1ptrl3.14k", 0x80000*0x3, 0x80000,CRC(804bfb4a) SHA1(74b3fc3931265398e23605d3da7ca84a002da632) ) - ROM_LOAD( "cb1ptrm0.18j", 0x80000*0x4, 0x80000,CRC(f4eece49) SHA1(3f34d1ae5986f0d340563ab0fb637bfdacb8712c) ) - ROM_LOAD( "cb1ptrm1.16j", 0x80000*0x5, 0x80000,CRC(5f3cbd7d) SHA1(d00d0a96b71d6a3b98907c4ba7c702e549dd0adb) ) - ROM_LOAD( "cb1ptrm2.15j", 0x80000*0x6, 0x80000,CRC(02c7e4af) SHA1(6a541a28163b1026a824f6f8aed05d0eb0c8ae93) ) - ROM_LOAD( "cb1ptrm3.14j", 0x80000*0x7, 0x80000,CRC(ace3123b) SHA1(2b590ed967572d77b3cc6b37e341a5bdc55c762f) ) - ROM_LOAD( "cb1ptru0.18f", 0x80000*0x8, 0x80000,CRC(58d35341) SHA1(a5fe00bdcf39521f0465743664ff0dd78be5d6e8) ) - ROM_LOAD( "cb1ptru1.16f", 0x80000*0x9, 0x80000,CRC(f4d005b0) SHA1(0862ed1dd0818bfb765d97f1f9d996c321b0ec83) ) - ROM_LOAD( "cb1ptru2.15f", 0x80000*0xa, 0x80000,CRC(68ffcd50) SHA1(5ca5f71b6b079fde14d76c869d211a815bffae68) ) - ROM_LOAD( "cb1ptru3.14f", 0x80000*0xb, 0x80000,CRC(d89c1c2b) SHA1(9c25df696b2d120ce33d7774381460297740007a) ) - - ROM_REGION( 0x080000, REGION_CPU2, 0 ) /* S22-BIOS ver1.30 */ + ROM_LOAD32_BYTE( "cb2verc.1", 0x00003, 0x100000, CRC(a8e07a14) SHA1(9bef7068c9bf792960df922ea79e4565d7680433) ) + ROM_LOAD32_BYTE( "cb2verc.2", 0x00002, 0x100000, CRC(054c504f) SHA1(9bde803ff09be0402f9b0388e55407362a2508e3) ) + ROM_LOAD32_BYTE( "cb2verc.3", 0x00001, 0x100000, CRC(47e6306c) SHA1(39d6fc2c3cb9b4c9d3569cedb79b916a90537115) ) + ROM_LOAD32_BYTE( "cb2verc.4", 0x00000, 0x100000, CRC(398426e4) SHA1(f20cd4892420e7b978baa51c9129b362422a3895) ) + ROM_REGION16_LE( 0x080000, REGION_CPU4, 0 ) /* MCU */ ROM_LOAD( "cb1datab.8k", 0, 0x080000, CRC(e2404221) SHA1(b88810dd45aee8a5475c30806cdfded25fa14e0e) ) - - ROM_REGION( 0x600000, REGION_USER2, 0 ) /* sound samples */ + C71_BIOS + ROM_REGION( 0x1000000, REGION_GFX1, ROMREGION_ERASEFF ) /* 32x32x8bpp sprite tiles */ + ROM_LOAD( "cb1scg0.12f", 0x000000, 0x200000, CRC(7aaca90d) SHA1(9808819db5d86d555a03bb20a2fbedf060d04f0e) ) + ROM_REGION( 0x1000000, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ + ROM_LOAD( "cb1cg0.8d", 0x000000, 0x200000, CRC(762a47a0) SHA1(8a49c700dca7afec5d8d6a38fedcd3ad4b0e6713) ) + ROM_LOAD( "cb1cg1.10d", 0x200000, 0x200000, CRC(df92c3e6) SHA1(302d7ee7e073a45e7baa948543bd30251f903a6d) ) + ROM_LOAD( "cb1cg2.12d", 0x400000, 0x200000, CRC(07bc508e) SHA1(7675694d10b50e57bb10b350559bd321df75d1ea) ) + ROM_LOAD( "cb1cg3.13d", 0x600000, 0x200000, CRC(50c86dea) SHA1(7837a1d2bd3ade470f7fbc732513dd598badd219) ) + ROM_LOAD( "cb1cg4.14d", 0x800000, 0x200000, CRC(e93b8894) SHA1(4d28b557b7ed2667e6af9f970f3e99cda785b940) ) + ROM_LOAD( "cb1cg5.16d", 0xa00000, 0x200000, CRC(9ee610a1) SHA1(ebc7892b6a66461ca6b6b912a264da1594340b2d) ) + ROM_LOAD( "cb1cg6.18d", 0xc00000, 0x200000, CRC(ddc3b5cc) SHA1(34edffee9eb6fbf4a00fce0da34d9354b1a1155f) ) + ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ + ROM_LOAD( "cb1ccrl.3d", 0x000000, 0x200000, CRC(2f171c48) SHA1(52b76213e37379b4a5cea7de40cf5396dc2998d8) ) + ROM_LOAD( "cb1ccrh.1d", 0x200000, 0x080000, CRC(86124b93) SHA1(f2cfd726313cbeff162d402a15de2360377630e7) ) + ROM_REGION( 0x600000, REGION_USER1, 0 ) /* 3D model data */ + ROM_LOAD( "cb1ptrl0.18k", 0x000000, 0x080000, CRC(f1393a03) SHA1(c9e808601eef5839e6bff630e5f83380e073c5c0) ) + ROM_LOAD( "cb1ptrl1.16k", 0x080000, 0x080000, CRC(2ad51de7) SHA1(efd102b960ca10cda70da84661acf61e4bbb9f00) ) + ROM_LOAD( "cb1ptrl2.15k", 0x100000, 0x080000, CRC(78f77c0d) SHA1(5183a8909c2ac0a3d80e707393bcbb4441d79a3c) ) + ROM_LOAD( "cb1ptrl3.14k", 0x180000, 0x080000, CRC(804bfb4a) SHA1(74b3fc3931265398e23605d3da7ca84a002da632) ) + ROM_LOAD( "cb1ptrm0.18j", 0x200000, 0x080000, CRC(f4eece49) SHA1(3f34d1ae5986f0d340563ab0fb637bfdacb8712c) ) + ROM_LOAD( "cb1ptrm1.16j", 0x280000, 0x080000, CRC(5f3cbd7d) SHA1(d00d0a96b71d6a3b98907c4ba7c702e549dd0adb) ) + ROM_LOAD( "cb1ptrm2.15j", 0x300000, 0x080000, CRC(02c7e4af) SHA1(6a541a28163b1026a824f6f8aed05d0eb0c8ae93) ) + ROM_LOAD( "cb1ptrm3.14j", 0x380000, 0x080000, CRC(ace3123b) SHA1(2b590ed967572d77b3cc6b37e341a5bdc55c762f) ) + ROM_LOAD( "cb1ptru0.18f", 0x400000, 0x080000, CRC(58d35341) SHA1(a5fe00bdcf39521f0465743664ff0dd78be5d6e8) ) + ROM_LOAD( "cb1ptru1.16f", 0x480000, 0x080000, CRC(f4d005b0) SHA1(0862ed1dd0818bfb765d97f1f9d996c321b0ec83) ) + ROM_LOAD( "cb1ptru2.15f", 0x500000, 0x080000, CRC(68ffcd50) SHA1(5ca5f71b6b079fde14d76c869d211a815bffae68) ) + ROM_LOAD( "cb1ptru3.14f", 0x580000, 0x080000, CRC(d89c1c2b) SHA1(9c25df696b2d120ce33d7774381460297740007a) ) + ROM_REGION( 0x1000000, REGION_SOUND1, 0 ) /* C352 samples */ ROM_LOAD( "cb1wavea.2l", 0x000000, 0x400000, CRC(b79a624d) SHA1(c0ee358a183ba6d0835731dbdd191b64718fde6e) ) - ROM_LOAD( "cb1waveb.1l", 0x400000, 0x200000, CRC(33bf08f6) SHA1(bf9d68b26a8158ea1abfe8428b7454cac25242c5) ) + ROM_LOAD( "cb1waveb.1l", 0x800000, 0x200000, CRC(33bf08f6) SHA1(bf9d68b26a8158ea1abfe8428b7454cac25242c5) ) + ROM_REGION( 0x2000, REGION_USER2, 0 ) /* default EEPROM */ + ROM_LOAD( "cybrcycc_defaults.nv", 0x0000, 0x2000, CRC(57fbd7d3) SHA1(c93e0d7875f5e66a661aed757fb4a314fe2025c2) ) ROM_END -ROM_START( propcycl ) +ROM_START( cybrcyccj ) ROM_REGION( 0x400000, REGION_CPU1, 0 ) /* main program */ - ROM_LOAD32_BYTE( "pr2ver-a.1", 0x00003, 0x100000, CRC(3f58594c) SHA1(5fdd8c61b47b51088a201799ce0c2f08c32ef852) ) - ROM_LOAD32_BYTE( "pr2ver-a.2", 0x00002, 0x100000, CRC(c0da354a) SHA1(f27a71a62385b842404fcd8ed6513158e3639b8f) ) - ROM_LOAD32_BYTE( "pr2ver-a.3", 0x00001, 0x100000, CRC(74bf4b74) SHA1(02713aa07238cc9e30163ae24d12c034aa972ff3) ) - ROM_LOAD32_BYTE( "pr2ver-a.4", 0x00000, 0x100000, CRC(cf4d5638) SHA1(2ddd00d6ec3b85c234820507650d201e176c94a2) ) - - ROM_REGION( 0x200000*2, REGION_GFX1, ROMREGION_DISPOSE ) /* 32x32x8bpp sprite tiles */ - ROM_LOAD( "pr1scg0.12f", 0x200000*0, 0x200000,CRC(2d09a869) SHA1(ce8beabaac255e1de29d944c9866022bad713519) ) /* identical to "pr1scg0.12l" */ - ROM_LOAD( "pr1scg1.10f", 0x200000*1, 0x200000,CRC(7433c5bd) SHA1(a8fd4e73de66e3d443c0cb5b5beef8f467014815) ) /* identical to "pr1scg1.10l" */ - - ROM_REGION( 0x200000*8, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ - ROM_LOAD( "pr1cg0.12b", 0x200000*0x0, 0x200000,CRC(0a041238) SHA1(da5688970432f7fe39337ee9fb46ca25a53fdb11) ) /* identical to "pr1cg0.8d" */ - ROM_LOAD( "pr1cg1.10d", 0x200000*0x1, 0x200000,CRC(7d09e6a7) SHA1(892317ee0bd796fa5c70d64912ef2e696792a2d4) ) /* identical to "pr1cg1.13b" */ - ROM_LOAD( "pr1cg2.12d", 0x200000*0x2, 0x200000,CRC(659f006e) SHA1(23362a922cb1100950181fac4858b953d8fc0794) ) /* identical to "pr1cg2.14b" */ - ROM_LOAD( "pr1cg3.13d", 0x200000*0x3, 0x200000,CRC(d30bffa3) SHA1(2f05227d91d257db9fa8cae114974de602d98729) ) /* identical to "pr1cg3.16b" */ - ROM_LOAD( "pr1cg4.14d", 0x200000*0x4, 0x200000,CRC(f4636cc9) SHA1(4e01a476e418e5790878572e83a8a11536ce30ae) ) /* identical to "pr1cg4.18b" */ - ROM_LOAD( "pr1cg5.16d", 0x200000*0x5, 0x200000,CRC(97d333de) SHA1(e8f8383f49aae834dd8b57231b25899703cef966) ) /* identical to "pr1cg5.19b" */ - ROM_LOAD( "pr1cg6.18a", 0x200000*0x6, 0x200000,CRC(3e081c03) SHA1(6ccb162952f6076359b2785b5d800b39a9a3c5ce) ) /* identical to "pr1cg6.18d" */ - ROM_LOAD( "pr1cg7.15a", 0x200000*0x7, 0x200000,CRC(ec9fc5c8) SHA1(16de614b26f06bbddae3ab56cebba45efd6fe81b) ) /* identical to "pr1cg7.19d" */ - + ROM_LOAD32_BYTE( "cb1verc.1", 0x00003, 0x100000, CRC(91166c69) SHA1(08e4d0d8226234b01b7d4fbc8ba2ade1ae409fe4) ) + ROM_LOAD32_BYTE( "cb1verc.2", 0x00002, 0x100000, CRC(b2e25e15) SHA1(095df28601dbc98b8974cd99b9329312980eacaf) ) + ROM_LOAD32_BYTE( "cb1verc.3", 0x00001, 0x100000, CRC(97fa2f39) SHA1(865e016553f733430aac70809b21a3b2914bb638) ) + ROM_LOAD32_BYTE( "cb1verc.4", 0x00000, 0x100000, CRC(529bd227) SHA1(6d7979643d015ae388a4a93b9dccc7f43f93baff) ) + ROM_REGION16_LE( 0x080000, REGION_CPU4, 0 ) /* MCU */ + ROM_LOAD( "cb1datab.8k", 0, 0x080000, CRC(e2404221) SHA1(b88810dd45aee8a5475c30806cdfded25fa14e0e) ) + C71_BIOS + ROM_REGION( 0x1000000, REGION_GFX1, ROMREGION_ERASEFF ) /* 32x32x8bpp sprite tiles */ + ROM_LOAD( "cb1scg0.12f", 0x000000, 0x200000, CRC(7aaca90d) SHA1(9808819db5d86d555a03bb20a2fbedf060d04f0e) ) + ROM_REGION( 0x1000000, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ + ROM_LOAD( "cb1cg0.8d", 0x000000, 0x200000, CRC(762a47a0) SHA1(8a49c700dca7afec5d8d6a38fedcd3ad4b0e6713) ) + ROM_LOAD( "cb1cg1.10d", 0x200000, 0x200000, CRC(df92c3e6) SHA1(302d7ee7e073a45e7baa948543bd30251f903a6d) ) + ROM_LOAD( "cb1cg2.12d", 0x400000, 0x200000, CRC(07bc508e) SHA1(7675694d10b50e57bb10b350559bd321df75d1ea) ) + ROM_LOAD( "cb1cg3.13d", 0x600000, 0x200000, CRC(50c86dea) SHA1(7837a1d2bd3ade470f7fbc732513dd598badd219) ) + ROM_LOAD( "cb1cg4.14d", 0x800000, 0x200000, CRC(e93b8894) SHA1(4d28b557b7ed2667e6af9f970f3e99cda785b940) ) + ROM_LOAD( "cb1cg5.16d", 0xa00000, 0x200000, CRC(9ee610a1) SHA1(ebc7892b6a66461ca6b6b912a264da1594340b2d) ) + ROM_LOAD( "cb1cg6.18d", 0xc00000, 0x200000, CRC(ddc3b5cc) SHA1(34edffee9eb6fbf4a00fce0da34d9354b1a1155f) ) ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ - ROM_LOAD( "pr1ccrl.3d", 0x000000, 0x200000,CRC(e01321fd) SHA1(5938c6eff8e1b3642728c3be733f567a97cb5aad) ) /* identical to "pr1ccrl.7b" */ - ROM_LOAD( "pr1ccrh.1d", 0x200000, 0x080000,CRC(1d68bc31) SHA1(d534d0daebe7018e83b57cc7919c294ab89bddc8) ) /* identical to "pr1ccrh.5b" */ - /* These two ROMs define a huge texture tilemap using the tiles from REGION_GFX2. - * The tilemap has 0x100 columns. - * - * pr1ccrl contains little endian 16 bit words. Each word references a 16x16 tile. - * - * pr1ccrh.1d contains packed nibbles. Each nibble encodes three tile attributes: - * 0x8 = swapxy - * 0x4 = flipx - * 0x2 = flipy - */ - - ROM_REGION( 0x80000*9, REGION_GFX4, 0 ) /* 3d model data */ - ROM_LOAD( "pr1ptrl0.18k", 0x80000*0, 0x80000,CRC(fddb27a2) SHA1(6e837b45e3f9ed7ca3d1a457d0f0124de5618d1f) ) - ROM_LOAD( "pr1ptrl1.16k", 0x80000*1, 0x80000,CRC(6964dd06) SHA1(f38a550165504693d20892a7dcfaf01db19b04ef) ) - ROM_LOAD( "pr1ptrl2.15k", 0x80000*2, 0x80000,CRC(4d7ed1d4) SHA1(8f72864a06ff8962e640cb36d062bddf5d110308) ) - ROM_LOAD( "pr1ptrm0.18j", 0x80000*3, 0x80000,CRC(b6f204b7) SHA1(3b34f240b399b6406faaf338ae0ab536247e64a6) ) - ROM_LOAD( "pr1ptrm1.16j", 0x80000*4, 0x80000,CRC(949588b7) SHA1(fdaf50ff2496200b9c981efc18b035f3c0a96ace) ) - ROM_LOAD( "pr1ptrm2.15j", 0x80000*5, 0x80000,CRC(dc1cef0a) SHA1(8cbc02cf73fac3cc110b676d77602ae628385eae) ) - ROM_LOAD( "pr1ptru0.18f", 0x80000*6, 0x80000,CRC(5d66a7c4) SHA1(c9ed1c18724192d45c1f6b40096f15d02baf2401) ) - ROM_LOAD( "pr1ptru1.16f", 0x80000*7, 0x80000,CRC(e9a3f72b) SHA1(f967e1adf8eee4fffdf4288d36a93c5bb4f9a126) ) - ROM_LOAD( "pr1ptru2.15f", 0x80000*8, 0x80000,CRC(c346a842) SHA1(299bc0a30d0e74d8adfa3dc605aebf6439f5bc18) ) - - ROM_REGION( 0x080000, REGION_CPU2, 0 ) /* SS22-BIOS ver1.41 */ - ROM_LOAD( "pr1data.8k", 0, 0x080000, CRC(2e5767a4) SHA1(390bf05c90044d841fe2dd4a427177fa1570b9a6) ) - ROM_REGION( 0x800000, REGION_USER2, 0 ) /* sound samples */ - ROM_LOAD( "pr1wavea.2l", 0x000000, 0x400000, CRC(320f3913) SHA1(3887b7334ca7762794c14198dd24bab47fcd9505) ) - ROM_LOAD( "pr1waveb.1l", 0x400000, 0x400000, CRC(d91acb26) SHA1(c2161e2d70e08aed15cbc875ffee685190611daf) ) + ROM_LOAD( "cb1ccrl.3d", 0x000000, 0x200000, CRC(2f171c48) SHA1(52b76213e37379b4a5cea7de40cf5396dc2998d8) ) + ROM_LOAD( "cb1ccrh.1d", 0x200000, 0x080000, CRC(86124b93) SHA1(f2cfd726313cbeff162d402a15de2360377630e7) ) + ROM_REGION( 0x600000, REGION_USER1, 0 ) /* 3D model data */ + ROM_LOAD( "cb1ptrl0.18k", 0x000000, 0x080000, CRC(f1393a03) SHA1(c9e808601eef5839e6bff630e5f83380e073c5c0) ) + ROM_LOAD( "cb1ptrl1.16k", 0x080000, 0x080000, CRC(2ad51de7) SHA1(efd102b960ca10cda70da84661acf61e4bbb9f00) ) + ROM_LOAD( "cb1ptrl2.15k", 0x100000, 0x080000, CRC(78f77c0d) SHA1(5183a8909c2ac0a3d80e707393bcbb4441d79a3c) ) + ROM_LOAD( "cb1ptrl3.14k", 0x180000, 0x080000, CRC(804bfb4a) SHA1(74b3fc3931265398e23605d3da7ca84a002da632) ) + ROM_LOAD( "cb1ptrm0.18j", 0x200000, 0x080000, CRC(f4eece49) SHA1(3f34d1ae5986f0d340563ab0fb637bfdacb8712c) ) + ROM_LOAD( "cb1ptrm1.16j", 0x280000, 0x080000, CRC(5f3cbd7d) SHA1(d00d0a96b71d6a3b98907c4ba7c702e549dd0adb) ) + ROM_LOAD( "cb1ptrm2.15j", 0x300000, 0x080000, CRC(02c7e4af) SHA1(6a541a28163b1026a824f6f8aed05d0eb0c8ae93) ) + ROM_LOAD( "cb1ptrm3.14j", 0x380000, 0x080000, CRC(ace3123b) SHA1(2b590ed967572d77b3cc6b37e341a5bdc55c762f) ) + ROM_LOAD( "cb1ptru0.18f", 0x400000, 0x080000, CRC(58d35341) SHA1(a5fe00bdcf39521f0465743664ff0dd78be5d6e8) ) + ROM_LOAD( "cb1ptru1.16f", 0x480000, 0x080000, CRC(f4d005b0) SHA1(0862ed1dd0818bfb765d97f1f9d996c321b0ec83) ) + ROM_LOAD( "cb1ptru2.15f", 0x500000, 0x080000, CRC(68ffcd50) SHA1(5ca5f71b6b079fde14d76c869d211a815bffae68) ) + ROM_LOAD( "cb1ptru3.14f", 0x580000, 0x080000, CRC(d89c1c2b) SHA1(9c25df696b2d120ce33d7774381460297740007a) ) + ROM_REGION( 0x1000000, REGION_SOUND1, 0 ) /* C352 samples */ + ROM_LOAD( "cb1wavea.2l", 0x000000, 0x400000, CRC(b79a624d) SHA1(c0ee358a183ba6d0835731dbdd191b64718fde6e) ) + ROM_LOAD( "cb1waveb.1l", 0x800000, 0x200000, CRC(33bf08f6) SHA1(bf9d68b26a8158ea1abfe8428b7454cac25242c5) ) + ROM_REGION( 0x2000, REGION_USER2, 0 ) /* default EEPROM */ + ROM_LOAD( "cybrcycc_defaults.nv", 0x0000, 0x2000, CRC(57fbd7d3) SHA1(c93e0d7875f5e66a661aed757fb4a314fe2025c2) ) ROM_END -ROM_START( acedrvrw ) - ROM_REGION( 0x200000, REGION_CPU1, 0 ) /* main program */ - ROM_LOAD32_BYTE( "ad2prgll.4d", 0x00003, 0x80000, CRC(808c5ff8) SHA1(119c90ecb5aa099a0e5d1d7944c004beacead367) ) - ROM_LOAD32_BYTE( "ad2prglm.2d", 0x00002, 0x80000, CRC(5f726a10) SHA1(d077312c6a387fbdf906d278c73c6a3730687f32) ) - ROM_LOAD32_BYTE( "ad2prgum.8d", 0x00001, 0x80000, CRC(d5042d6e) SHA1(9ae93e7ea7126302831a879ba0aadcb6e5b842f5) ) - ROM_LOAD32_BYTE( "ad2prguu.6d", 0x00000, 0x80000, CRC(86d4661d) SHA1(2a1529a51ca5466994a2d0d84c7aab13cef95a11) ) - - ROM_REGION( 0x400, REGION_GFX1, ROMREGION_DISPOSE ) - - ROM_REGION( 0x200000*8, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ - ROM_LOAD( "ad1cg0.1a", 0x200000*0x4, 0x200000,CRC(faaa1ee2) SHA1(878f2b74587ed4d06c5110a0eb0020c49ddc5dfa) ) - ROM_LOAD( "ad1cg1.2a", 0x200000*0x5, 0x200000,CRC(1aab1eb7) SHA1(b8f9eeafec7e0de340cf48e38fa55dd14404c867) ) - ROM_LOAD( "ad1cg2.3a", 0x200000*0x6, 0x200000,CRC(cdcd1874) SHA1(5a7a4a0d897cca4956b0a4f178f39f618c921861) ) - ROM_LOAD( "ad1cg3.5a", 0x200000*0x7, 0x200000,CRC(effdd2cd) SHA1(9ff156e7e38c103b8fa6f3c29776dd38482d9cf2) ) - - ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ - ROM_LOAD( "ad1ccrl.1c", 0x000000, 0x200000,CRC(bc3c9b12) SHA1(088e861e5c4b37c54b7f72963113a10870bf7927) ) - ROM_LOAD( "ad1ccrh.2c", 0x200000, 0x080000,CRC(71f44526) SHA1(bb4811fc5de626380ce6a17bee73e5e47926d850) ) - - ROM_REGION( 0x80000*6, REGION_GFX4, 0 ) /* 3d model data */ - ROM_LOAD( "ad1potl0.5b", 0x80000*0, 0x80000,CRC(dfc7e729) SHA1(5e3deef66d0a5dd2ff0584b8c8be4bf5e798e4d0) ) - ROM_LOAD( "ad1potl1.4b", 0x80000*1, 0x80000,CRC(5914ef8e) SHA1(f6db9c3061ceda76eef0a9538d9c048366b71124) ) - ROM_LOAD( "ad1potm0.5c", 0x80000*2, 0x80000,CRC(844bcd6b) SHA1(629b8dc0a7e94410c08c8874b69d9f4bc22f3e4f) ) - ROM_LOAD( "ad1potm1.4c", 0x80000*3, 0x80000,CRC(515cf541) SHA1(db1522813ea3e982d479cc1903d18799bf75aea9) ) - ROM_LOAD( "ad1potu0.5d", 0x80000*4, 0x80000,CRC(e0f44949) SHA1(ffdb64d600883974b05edaa9ed3071af355ee17f) ) - ROM_LOAD( "ad1potu1.4d", 0x80000*5, 0x80000,CRC(f2cd2cbb) SHA1(19fe6e3454a1e4353c7fe0a0d7a71742fea946de) ) - - ROM_REGION( 0x080000, REGION_CPU2, 0 ) /* BIOS */ - ROM_LOAD( "ad1data.6r", 0, 0x080000, CRC(82024f74) SHA1(711ab0c4f027716aeab18e3a5d3d06fa82af8007) ) - - ROM_REGION( 0x400000, REGION_USER2, 0 ) /* sound samples */ - ROM_LOAD( "ad1wave0.10r", 0x100000*0, 0x100000,CRC(c7879a72) SHA1(ae04d664858b0944583590ed0003a9420032d5ca) ) - ROM_LOAD( "ad1wave1.10p", 0x100000*1, 0x100000,CRC(69c1d41e) SHA1(b5cdfe7b75075c585dfd842347f8e4e692bb2781) ) - ROM_LOAD( "ad1wave2.10n", 0x100000*2, 0x100000,CRC(365a6831) SHA1(ddaa44a4436d6de120b64a5d130b1ee18f872e19) ) - ROM_LOAD( "ad1wave3.10l", 0x100000*3, 0x100000,CRC(cd8ecb0b) SHA1(7950b5a3a81f5554f57accabc7a623b8265a21a1) ) -ROM_END - -ROM_START( victlapw ) - ROM_REGION( 0x200000, REGION_CPU1, 0 ) /* main program */ - ROM_LOAD32_BYTE( "advprgll.4d", 0x00003, 0x80000, CRC(4dc1b0ab) SHA1(b5913388d16f824af6dbb01b5b0350d510667a87) ) - ROM_LOAD32_BYTE( "advprglm.2d", 0x00002, 0x80000, CRC(7b658bef) SHA1(cf982b49fde0c1897c4c16e77f9eb2a145d8cd42) ) - ROM_LOAD32_BYTE( "advprgum.8d", 0x00001, 0x80000, CRC(af67f2fb) SHA1(f391843ee0d053e33660c60e3718871142d932f2) ) - ROM_LOAD32_BYTE( "advprguu.6d", 0x00000, 0x80000, CRC(b60e5d2b) SHA1(f5740615c2864c5c6433275cf4388bda5122b7a7) ) - - ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE ) - - ROM_REGION( 0x200000*8, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ - ROM_LOAD( "adv1cg0.2a", 0x200000*0x0, 0x200000,CRC(13353848) SHA1(c6c7693e3cb086919daf9fcaf6bf602142213073) ) - ROM_LOAD( "adv1cg1.1c", 0x200000*0x1, 0x200000,CRC(1542066c) SHA1(20a053e919b7a81da2a17d31dc7482832a4d4ffe) ) - ROM_LOAD( "adv1cg2.2d", 0x200000*0x2, 0x200000,CRC(111f371c) SHA1(29d8062daae51b3c1712bd30baa9813a2b5b374d) ) - ROM_LOAD( "adv1cg3.1e", 0x200000*0x3, 0x200000,CRC(a077831f) SHA1(71bb95199b368e48bc474123ca84d19213f73137) ) - ROM_LOAD( "adv1cg4.2f", 0x200000*0x4, 0x200000,CRC(71abdacf) SHA1(64409e6aa40dd9e5a6dd1dc306860fbbf6ee7c3e) ) - ROM_LOAD( "adv1cg5.1j", 0x200000*0x5, 0x200000,CRC(cd6cd798) SHA1(51070997a457c0ace078174569cd548ac2226b2d) ) - ROM_LOAD( "adv1cg6.2k", 0x200000*0x6, 0x200000,CRC(94bdafba) SHA1(41e64fa99b342edd8b0ed95ae9869c23e03399e6) ) - ROM_LOAD( "adv1cg7.1n", 0x200000*0x7, 0x200000,CRC(18823475) SHA1(a3244d665b59c352593de21f5cb8d55ddf8cee5c) ) - - ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ - ROM_LOAD( "adv1ccrl.5a", 0x000000, 0x200000,CRC(dd2b96ae) SHA1(6337ce17e617234c27ebad578ba82451649aad9c) ) /* ident to adv1ccrl.5l */ - ROM_LOAD( "adv1ccrh.5c", 0x200000, 0x080000,CRC(5719844a) SHA1(a17d7bc239235e9f566931ba4fee1d6ad7964d83) ) /* ident to adv1ccrh.5j */ - - ROM_REGION( 0x80000*9, REGION_GFX4, 0 ) /* 3d model data */ - ROM_LOAD( "adv1pot.l0", 0x80000*0, 0x80000,CRC(3b85b2a4) SHA1(84c92ed0105618d4aa5508af344b4b6cfa772567) ) - ROM_LOAD( "adv1pot.l1", 0x80000*1, 0x80000,CRC(601d6488) SHA1(c7932103ba6070e17deb3cc06060eed7789f938e) ) - ROM_LOAD( "adv1pot.l2", 0x80000*2, 0x80000,CRC(a0323a84) SHA1(deadf9a47461df7b137759d6886e676137b39fd2) ) - ROM_LOAD( "adv1pot.m0", 0x80000*3, 0x80000,CRC(20951aa2) SHA1(3de55bded443a5b78699cec4845470b53b22301a) ) - ROM_LOAD( "adv1pot.m1", 0x80000*4, 0x80000,CRC(5aed6fbf) SHA1(8cee781d8a12e00635b9a1e5cc8d82e64b17e8f1) ) - ROM_LOAD( "adv1pot.m2", 0x80000*5, 0x80000,CRC(00cbff92) SHA1(09a11ba064aafc921a7ca0add5898d91b773f10a) ) - ROM_LOAD( "adv1pot.u0", 0x80000*6, 0x80000,CRC(6b73dd2a) SHA1(e3654ab2b62e4f3314558209e37c5636f871a6c7) ) - ROM_LOAD( "adv1pot.u1", 0x80000*7, 0x80000,CRC(c8788f74) SHA1(606e10b05146e3db824aa608745de80584420d12) ) - ROM_LOAD( "adv1pot.u2", 0x80000*8, 0x80000,CRC(e67f29c5) SHA1(16222afb4f1f494711dd00ebb347c824db333bae) ) - - ROM_REGION( 8*1024, REGION_USER1, 0 ) /* EPROM */ - ROM_LOAD( "eeprom.9e", 0, 8*1024, CRC(35fd9f7a) SHA1(7dc542795a6b0b9580c5fd1bf80e1e6f2c402078) ) - - ROM_REGION( 0x080000, REGION_CPU2, 0 ) /* MCU */ - ROM_LOAD( "adv1data.6r", 0, 0x080000, CRC(10eecdb4) SHA1(aaedeed166614e6670e765e0d7e4e9eb5f38ad10) ) - ROM_REGION( 0x400000, REGION_USER2, 0 ) /* sound samples */ - ROM_LOAD( "adv1wav0.10r", 0x000000, 0x100000, CRC(f07b2d9d) SHA1(fd46c23b336d5e9a748f7f8d825c19737125d2fb) ) - ROM_LOAD( "adv1wav1.10p", 0x100000, 0x100000, CRC(737f3c7a) SHA1(4737994f146c0076e7270785f41f3a85c53c7c5f) ) - ROM_LOAD( "adv1wav2.10n", 0x200000, 0x100000, CRC(c1a5ca5e) SHA1(27e6f9256d5fe5966e91d6be1e6e80900a764af1) ) - ROM_LOAD( "adv1wav3.10l", 0x300000, 0x100000, CRC(fc6b8004) SHA1(5c9e0805895931ec2b6a43376059bdbf5777222f) ) -ROM_END - -ROM_START( raveracw ) - ROM_REGION( 0x200000, REGION_CPU1, 0 ) /* main program */ - ROM_LOAD32_BYTE( "rv2prllb.4d", 0x00003, 0x80000, CRC(3017cd1e) SHA1(ccd648b4a5dfc74fd141815af2969f423311042f) ) - ROM_LOAD32_BYTE( "rv2prlmb.2d", 0x00002, 0x80000, CRC(894be0c3) SHA1(4dba93dc3ca1cf502c5f54018b64ad79bb2a632b) ) - ROM_LOAD32_BYTE( "rv2prumb.8d", 0x00001, 0x80000, CRC(6414a800) SHA1(c278ff644909d12a43ba6fc2bf8d2092e469c3e6) ) - ROM_LOAD32_BYTE( "rv2pruub.6d", 0x00000, 0x80000, CRC(a9f18714) SHA1(8e7b17749d151f92020f68d1ac06003cf1f5c573) ) - - ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE ) - - ROM_REGION( 0x200000*8, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ - ROM_LOAD( "rv1cg0.1a", 0x200000*0x0, 0x200000,CRC(c518f06b) SHA1(4c01d453244192dd13087bdc72a7f7be80b47cbc) ) /* rv1cg0.2a */ - ROM_LOAD( "rv1cg1.1c", 0x200000*0x1, 0x200000,CRC(6628f792) SHA1(7a5405c5fcb2f3f001ae17df393c31e61a834f2b) ) /* rv1cg1.2c */ - ROM_LOAD( "rv1cg2.1d", 0x200000*0x2, 0x200000,CRC(0b707cc5) SHA1(38e1a554b278062edc369565353497ac4b016f78) ) /* rv1cg2.2d */ - ROM_LOAD( "rv1cg3.1e", 0x200000*0x3, 0x200000,CRC(39b62921) SHA1(873287d81338baf10dd85214d82f6c38bfdf199e) ) /* rv1cg3.2e */ - ROM_LOAD( "rv1cg4.1f", 0x200000*0x4, 0x200000,CRC(a9791ea2) SHA1(245b2ebbadd1fbca90dc241f88e9f6f341b2a01a) ) /* rv1cg4.2f */ - ROM_LOAD( "rv1cg5.1j", 0x200000*0x5, 0x200000,CRC(b2c79ec1) SHA1(6f669996863bdf1fe09b0c1a2a876625029d3d43) ) /* rv1cg5.2j */ - ROM_LOAD( "rv1cg6.1k", 0x200000*0x6, 0x200000,CRC(8cddedc2) SHA1(e3993f5505bc7e61bec7be5b48c873572e1220f7) ) /* rv1cg6.2k */ - ROM_LOAD( "rv1cg7.1n", 0x200000*0x7, 0x200000,CRC(b39147ca) SHA1(50ca6691fc809c95e6999dd52e39f2b8c2d22f3b) ) /* rv1cg7.2n */ - - ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ - ROM_LOAD( "rv1ccrl.5a", 0x000000, 0x200000,CRC(bc634f72) SHA1(b5c504ed92bca7682614fc4c51f38cff607e6f2a) ) /* rv1ccrl.5l */ - ROM_LOAD( "rv1ccrh.5c", 0x200000, 0x080000,CRC(a741b262) SHA1(363076220a0eacc67befda05f8253963e8ffbcaa) ) /* rv1ccrh.5j */ - - ROM_REGION( 0x80000*12, REGION_GFX4, 0 ) /* 3d model data */ - ROM_LOAD( "rv1potl0.5b", 0x80000*0x0, 0x80000,CRC(de2ce519) SHA1(2fe0dd000571f76d1a4df6a439d40119125170ef) ) - ROM_LOAD( "rv1potl1.4b", 0x80000*0x1, 0x80000,CRC(2215cb5a) SHA1(d48ee692ab3dbcffdc49d22f6f232ca9390da766) ) - ROM_LOAD( "rv1potl2.3b", 0x80000*0x2, 0x80000,CRC(ddb15bf7) SHA1(4c54ec98e0cba10841d43a4ce593cdacfd7f90f8) ) - ROM_LOAD( "rv1potl3.2b", 0x80000*0x3, 0x80000,CRC(fa9361ca) SHA1(35a5c2712bca9c62400b724754de3a931ad21561) ) - ROM_LOAD( "rv1potm0.5c", 0x80000*0x4, 0x80000,CRC(3c024f3a) SHA1(711f0442823797b2d410352796a5cca66af98dce) ) - ROM_LOAD( "rv1potm1.4c", 0x80000*0x5, 0x80000,CRC(b1a32a68) SHA1(e24abb3a7e35d098abae5420bf8ef5c975718987) ) - ROM_LOAD( "rv1potm2.3c", 0x80000*0x6, 0x80000,CRC(a414fe15) SHA1(eb27cdca045ab2ab27dec179043328847fb65e11) ) - ROM_LOAD( "rv1potm3.2c", 0x80000*0x7, 0x80000,CRC(2953bbb4) SHA1(aca1acd87f7130d2522d0c6f8e60beeb7ab7495a) ) - ROM_LOAD( "rv1potu0.5d", 0x80000*0x8, 0x80000,CRC(b9eaf3cc) SHA1(3b2a9041f1fa90706ecf7d4fbff918516f891a07) ) - ROM_LOAD( "rv1potu1.4d", 0x80000*0x9, 0x80000,CRC(a5c55258) SHA1(826d4dde761aec7d848456f7bc4ba6268fe99605) ) - ROM_LOAD( "rv1potu2.3d", 0x80000*0xa, 0x80000,CRC(c18fcb74) SHA1(a4009ae2b014dc89aed4741fd97f84350117c2f4) ) - ROM_LOAD( "rv1potu3.2d", 0x80000*0xb, 0x80000,CRC(79735aaa) SHA1(1cf14274669b916a7641f7a16785da1b72347485) ) - - ROM_REGION( 0x2100, REGION_USER1, 0 ) - ROM_LOAD( "rv1eeprm.9e", 0x0000, 0x2000, CRC(801222e6) SHA1(a97ba76ad73f75fe7289e2c0d60b2dfdf2a99604) ) /* EPROM */ - ROM_LOAD( "rr1gam.2d", 0x2000, 0x0100, CRC(b2161bce) SHA1(d2681cc0cf8e68df0d942d392b4eb4458c4bb356) ) /* identical to rr1gam.3d,rr1gam.4d */ - - ROM_REGION( 0x080000, REGION_CPU2, 0 ) /* MCU */ - ROM_LOAD( "rv1data.6r", 0, 0x080000, CRC(d358ec20) SHA1(140c513349240417bb546dd2d151f3666b818e91) ) - ROM_REGION( 0x400000, REGION_USER2, 0 ) /* sound samples */ - ROM_LOAD( "rv1wav0.10r", 0x000000, 0x100000, CRC(5aef8143) SHA1(a75d31298e3ff9b290f238976a11e8b85cfb72d3) ) - ROM_LOAD( "rv1wav1.10p", 0x100000, 0x100000, CRC(9ed9e6b3) SHA1(dd1da2b08d1b6aa0912daacc77744c9799aabb78) ) - ROM_LOAD( "rv1wav2.10n", 0x200000, 0x100000, CRC(5af9dc83) SHA1(9aeb7f8217b806a6f3ed93056513af9fbcb6b372) ) - ROM_LOAD( "rv1wav3.10l", 0x300000, 0x100000, CRC(ffb9ad75) SHA1(a9a61a597bd3bbe9732f92747d82264fe4d9af48) ) -ROM_END - -ROM_START( ridger2j ) - ROM_REGION( 0x200000, REGION_CPU1, 0 ) /* main program */ - ROM_LOAD32_BYTE( "rrs1pr11.4d", 0x00003, 0x80000, CRC(fbf785a2) SHA1(b9333c7623f68f48aa6ae50913a22a527a19576a) ) - ROM_LOAD32_BYTE( "rrs1prlm.2d", 0x00002, 0x80000, CRC(562f747a) SHA1(79d818b87c9a992fc9706fb39e6d560c2b0aa392) ) - ROM_LOAD32_BYTE( "rrs1prum.8d", 0x00001, 0x80000, CRC(93259fb0) SHA1(c29787e873797a003db27adbd20d7b852e26d8c6) ) - ROM_LOAD32_BYTE( "rrs1pruu.6d", 0x00000, 0x80000, CRC(31cdefe8) SHA1(ae836d389bed43dd156eb4cf3e97b6f1ad68181e) ) - - ROM_REGION( 0x400, REGION_GFX1, ROMREGION_DISPOSE ) - - ROM_REGION( 0x200000*8, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ - ROM_LOAD( "rrs1cg0.1a", 0x200000*0x4, 0x200000,CRC(714c0091) SHA1(df29512bd6e64827660c40304051366d2c4d7977) ) - ROM_LOAD( "rrs1cg1.2a", 0x200000*0x5, 0x200000,CRC(836545c1) SHA1(05e3346463d8d42b5d33216207e855033a65510d) ) - ROM_LOAD( "rrs1cg2.3a", 0x200000*0x6, 0x200000,CRC(00e9799d) SHA1(280184451138420f64080efe13e5e2795f7b61d4) ) - ROM_LOAD( "rrs1cg3.5a", 0x200000*0x7, 0x200000,CRC(3858983f) SHA1(feda270b71f1310ecf4c17823bc8827ca2951b40) ) - - ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ - ROM_LOAD( "rrs1ccrl.5a", 0x000000, 0x200000,CRC(304a8b57) SHA1(f4f3e7c194697d754375f36a0e41d0941fa5d225) ) - ROM_LOAD( "rrs1ccrh.5c", 0x200000, 0x080000,CRC(bd3c86ab) SHA1(cd3a8774843c5864e651fa8989c80e2d975a13e8) ) - - ROM_REGION( 0x80000*6, REGION_GFX4, 0 ) /* 3d model data */ - ROM_LOAD( "rrs1pol0.5b", 0x80000*0, 0x80000,CRC(9376c384) SHA1(cde0e36db1beab1523607098a760d81fac2ea90e) ) - ROM_LOAD( "rrs1pol1.4b", 0x80000*1, 0x80000,CRC(094fa832) SHA1(cc59442540b1cdef068c4408b6e048c11042beb8) ) - ROM_LOAD( "rrs1pom0.5c", 0x80000*2, 0x80000,CRC(b47a7f8b) SHA1(0fa0456ad8b4864a7071b5b5ba1a78877c1ac0f0) ) - ROM_LOAD( "rrs1pom1.4c", 0x80000*3, 0x80000,CRC(27260361) SHA1(8775cc779eb8b6a0d79fa84d606c970ec2d6ea8d) ) - ROM_LOAD( "rrs1pou0.5d", 0x80000*4, 0x80000,CRC(74d6ec84) SHA1(63f5beee51443c98100330ec04291f71e10716c4) ) - ROM_LOAD( "rrs1pou1.4d", 0x80000*5, 0x80000,CRC(f527caaa) SHA1(f92bdd15323239d593ddac92a11d23a27e6635ed) ) - - ROM_REGION( 0x080000, REGION_CPU2, 0 ) /* BIOS/music data? */ - ROM_LOAD( "rrs1data.6r", 0, 0x080000, CRC(b7063aa8) SHA1(08ff689e8dd529b91eee423c93f084945c6de417) ) - /* 0x00000..0x001ff: data - * 0x10000..0x1fc7f: music data? - * 0x20000..0x2f57f: music data? - * 0x30000..0x334ff: code? contains english text - */ - ROM_REGION( 0x400000, REGION_USER2, 0 ) /* sound samples */ - ROM_LOAD( "rrs1wav0.10r", 0x100000*0, 0x100000,CRC(99d11a2d) SHA1(1f3db98a99be0f07c03b0a7817561459a58f310e) ) - ROM_LOAD( "rrs1wav1.10p", 0x100000*1, 0x100000,CRC(ad28444a) SHA1(c31bbf3cae5015e5494fe4988b9b01d822224c69) ) - ROM_LOAD( "rrs1wav2.10n", 0x100000*2, 0x100000,CRC(6f0d4619) SHA1(cd3d57f2ea21497f388ffa29ec7d2665647a01c0) ) - ROM_LOAD( "rrs1wav3.10l", 0x100000*3, 0x100000,CRC(106e761f) SHA1(97f47b857bdcbc79b0aface53dd385e67fcc9108) ) -ROM_END - -ROM_START( ridgeraj ) - ROM_REGION( 0x200000, REGION_CPU1, 0 ) /* main program */ - ROM_LOAD32_BYTE( "rr1prll.4d", 0x00003, 0x80000, CRC(4bb7fc86) SHA1(8291375b8ec4d37e0d9e3bf38da2d5907b0f31bd) ) - ROM_LOAD32_BYTE( "rr1prlm.2d", 0x00002, 0x80000, CRC(68e13830) SHA1(ddc447c7afbb5c4238969d7e78bfe9cf8fac6061) ) - ROM_LOAD32_BYTE( "rr1prum.8d", 0x00001, 0x80000, CRC(705ef78a) SHA1(881903413e66d6fd83d46eb18c4e1230531832ae) ) - ROM_LOAD32_BYTE( "rr1pruu.6d", 0x00000, 0x80000, CRC(c1371f96) SHA1(a78e0bf6c147c034487a85efa0a8470f4e8f4bf0) ) - - ROM_REGION( 0x400, REGION_GFX1, ROMREGION_DISPOSE ) - - ROM_REGION( 0x200000*8, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ - ROM_LOAD( "rr1cg0.1a", 0x200000*0x4, 0x200000,CRC(d1b0eec6) SHA1(f66922c324dfc3ff408db7556c587ef90ca64c3b) ) - ROM_LOAD( "rr1cg1.2a", 0x200000*0x5, 0x200000,CRC(bb695d89) SHA1(557bac9d2718519c1f69e374d0ef9a86a43fe86c) ) - ROM_LOAD( "rr1cg2.3a", 0x200000*0x6, 0x200000,CRC(8f374c0a) SHA1(94ff8581de11a03ef86525155f8433bf5858b980) ) - ROM_LOAD( "rr1cg3.5a", 0x200000*0x7, 0x200000,CRC(072a5c47) SHA1(86b8e973ae6b78197d685fe6d14722d8e2d0dfec) ) - - ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ - ROM_LOAD( "rr1ccrl.5a", 0x000000, 0x200000,CRC(c15cb257) SHA1(0cb8f231c62ea37955be5d452a436a6e815af8e8) ) - ROM_LOAD( "rr1ccrh.5c", 0x200000, 0x080000,CRC(dd332fd5) SHA1(a7d9c1d6b5a8e3a937b525c1363880e404dcd147) ) - - ROM_REGION( 0x80000*6, REGION_GFX4, 0 ) /* 3d model data */ - ROM_LOAD( "rr1potl0.5b", 0x80000*0, 0x80000,CRC(3ac193e3) SHA1(ff213766f15e34dc1b25187b57d94e17930090a3) ) - ROM_LOAD( "rr1potl1.4b", 0x80000*1, 0x80000,CRC(ac3ffba5) SHA1(4eb4dda5faeff237e0d35725b56d309948fba900) ) - ROM_LOAD( "rr1potm0.5c", 0x80000*2, 0x80000,CRC(42a3fa08) SHA1(15db0ae7ccf7f5a77b9dd9a9d82a488b67f8aaff) ) - ROM_LOAD( "rr1potm1.4c", 0x80000*3, 0x80000,CRC(1bc1ea7b) SHA1(52c21eef4989c45acc5fa4deda2d0b63214731c8) ) - ROM_LOAD( "rr1potu0.5d", 0x80000*4, 0x80000,CRC(5e367f72) SHA1(5887f011379dce865fef238b402678a3d2033de9) ) - ROM_LOAD( "rr1potu1.4d", 0x80000*5, 0x80000,CRC(31d92475) SHA1(51d3c0baa223e1bc16ea2950f2e085597528f870) ) - - ROM_REGION( 0x080000, REGION_CPU2, 0 ) /* BIOS */ - ROM_LOAD( "rr1data.6r", 0, 0x080000, CRC(18f5f748) SHA1(e0d149a66de36156edd9b55f604c9a9801aaefa8) ) - - ROM_REGION( 0x400000, REGION_USER2, 0 ) /* sound samples */ - ROM_LOAD( "rr1wav0.10r", 0x100000*0, 0x100000,CRC(a8e85bde) SHA1(b56677e9f6c98f7b600043f5dcfef3a482ca7455) ) - ROM_LOAD( "rr1wav1.10p", 0x100000*1, 0x100000,CRC(35f47c8e) SHA1(7c3f9e942f532af8008fbead2a96fee6084bcde6) ) - ROM_LOAD( "rr1wav2.10n", 0x100000*2, 0x100000,CRC(3244cb59) SHA1(b3283b30cfafbfdcbc6d482ecc4ed6a47a527ca4) ) - ROM_LOAD( "rr1wav3.10l", 0x100000*3, 0x100000,CRC(c4cda1a7) SHA1(60bc96880ec79efdff3cc70c09e848692a40bea4) ) -ROM_END - -ROM_START( timecrsa ) +ROM_START( dirtdash ) ROM_REGION( 0x400000, REGION_CPU1, 0 ) /* main program */ - ROM_LOAD32_WORD_SWAP( "ts2ver-a.1", 0x00002, 0x200000, CRC(d57eb74b) SHA1(536dd9305d0ac44110c575776333310cc57b5242) ) - ROM_LOAD32_WORD_SWAP( "ts2ver-a.2", 0x00000, 0x200000, CRC(671588af) SHA1(63f992c6795521fd263a0ebf230f8dc88cbfc443) ) - - ROM_REGION( 0x200000*6, REGION_GFX1, ROMREGION_DISPOSE ) /* 32x32x8bpp sprite tiles */ - ROM_LOAD( "ts1scg0.12f",0x200000*0, 0x200000,CRC(14a3674d) SHA1(c5792a385572452b43bbc7eb8428335b19daa3c0) ) - ROM_LOAD( "ts1scg1.10f",0x200000*1, 0x200000,CRC(11791dbf) SHA1(3d75b468d69a8bf398d45f310cdb8bc88b63f25c) ) - ROM_LOAD( "ts1scg2.8f", 0x200000*2, 0x200000,CRC(d630fff9) SHA1(691394027b858702f06282f965f5b53e6fed496b) ) - ROM_LOAD( "ts1scg3.7f", 0x200000*3, 0x200000,CRC(1a62f015) SHA1(7d09ae480ae7813391616ae0090929ba845a345a) ) - ROM_LOAD( "ts1scg4.5f", 0x200000*4, 0x200000,CRC(511b8dd6) SHA1(936649c0a61d29f024a28e4ab64cce4b55d58f64) ) - ROM_LOAD( "ts1scg5.3f", 0x200000*5, 0x200000,CRC(553bb246) SHA1(94659bee4fd0afe834a8bf3414d8825411cf9e86) ) - - ROM_REGION( 0x200000*8, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ - ROM_LOAD( "ts1cg0.8d", 0x200000*0x0, 0x200000,CRC(de07b22c) SHA1(f4d07b8840ec8be625eff634bce619e960c334a5) ) - ROM_LOAD( "ts1cg1.10d", 0x200000*0x1, 0x200000,CRC(992d26f6) SHA1(a0b9007312804b413d4c1748527378da4d8d53b3) ) - ROM_LOAD( "ts1cg2.12d", 0x200000*0x2, 0x200000,CRC(6273954f) SHA1(d73a43888b53e4c42fc33e8e1b38e60fd3329413) ) - ROM_LOAD( "ts1cg3.13d", 0x200000*0x3, 0x200000,CRC(38171f24) SHA1(d04caaa5b1b377ced38501b014e4cb7fc831c41d) ) - ROM_LOAD( "ts1cg4.14d", 0x200000*0x4, 0x200000,CRC(51f09856) SHA1(0eef421907ee813d5117e62cf0005bf00eb29c88) ) - ROM_LOAD( "ts1cg5.16d", 0x200000*0x5, 0x200000,CRC(4cd9fd79) SHA1(0d2018ec914683a75bdec8655d678fd562eb6d15) ) - ROM_LOAD( "ts1cg6.18d", 0x200000*0x6, 0x200000,CRC(f17f2ec9) SHA1(ed88ec524626e5bbe2e1ea6838412d3ac85671dd) ) - + ROM_LOAD32_BYTE( "dt2verc.rom1", 0x000003, 0x100000, CRC(b2d7916c) SHA1(4f4cb75ef12b57bdc12b6aba59678f09b22bcfce) ) + ROM_LOAD32_BYTE( "dt2verc.rom2", 0x000002, 0x100000, CRC(5dc040d1) SHA1(4b285d146adb0cff146b79d7471597148b3c4a97) ) + ROM_LOAD32_BYTE( "dt2verc.rom3", 0x000001, 0x100000, CRC(a55157e1) SHA1(ede052ad55430418905987b8bcba4aa229ac037c) ) + ROM_LOAD32_BYTE( "dt2verc.rom4", 0x000000, 0x100000, CRC(f3a9bedb) SHA1(71366108dec0803b585d409095f126cc55ec3e4d) ) + ROM_REGION16_LE( 0x080000, REGION_CPU4, 0 ) /* MCU */ + ROM_LOAD( "dt1dataa.8k", 0x000000, 0x080000, CRC(9bcdea21) SHA1(26ae025cf746d3a703a82495eb2bb515b828a650) ) + C71_BIOS + ROM_REGION( 0x1000000, REGION_GFX1, ROMREGION_ERASEFF ) /* 32x32x8bpp sprite tiles */ + ROM_LOAD( "dt1scg0.12f", 0x000000, 0x200000, CRC(a09b5760) SHA1(3dd54ebebf9da1de76874a1adf491ed15849e1b1) ) + ROM_LOAD( "dt1scg1.10f", 0x200000, 0x200000, CRC(f9ac8111) SHA1(814074ae8cc81c6c1201d764a84dd95fe914f19c) ) + ROM_REGION( 0x1000000, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ + ROM_LOAD( "dt1cg0.8d", 0x000000, 0x200000, CRC(10ab95e0) SHA1(ffde1f00ac3e82a36fbcfa060c6b97c92dfcfc8b) ) + ROM_LOAD( "dt1cg1.10d", 0x200000, 0x200000, CRC(d9f1ba53) SHA1(5a1095b726c55001cc1d4c695adc38097e6a0201) ) + ROM_LOAD( "dt1cg2.12d", 0x400000, 0x200000, CRC(bd8b1e0b) SHA1(fcd94e33a0cbd17c9308cb8952e3c618ab56f9fc) ) + ROM_LOAD( "dt1cg3.13d", 0x600000, 0x200000, CRC(ba960663) SHA1(e98149bc4652ea7933ac47d760a6f7e6489f15e2) ) + ROM_LOAD( "dt1cg4.14d", 0x800000, 0x200000, CRC(424b9652) SHA1(fa8865110db03559740c4e633e123d1a009782c4) ) + ROM_LOAD( "dt1cg5.16d", 0xa00000, 0x200000, CRC(29516626) SHA1(1f12c5dc3975b88dc60d87d0409bf311837e9fa4) ) + ROM_LOAD( "dt1cg6.18d", 0xc00000, 0x200000, CRC(e6fa7180) SHA1(85316cde282cff1f913cf9f155cfa36adcc1108e) ) + ROM_LOAD( "dt1cg7.19d", 0xe00000, 0x200000, CRC(2ca19153) SHA1(c82403c8b40bf85daedf610b1bc7bfea9dfc6206) ) ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ - ROM_LOAD( "ts1ccrl.3d", 0x000000, 0x200000,CRC(56cad2df) SHA1(49c0e57d5cf5d5fc4c75da6969bec01d6d443259) ) - ROM_LOAD( "ts1ccrh.1d", 0x200000, 0x080000,CRC(a1cc3741) SHA1(7fe57924c42e287b134e5d7ad00cffdff1f18084) ) + ROM_LOAD( "dt1ccrl.3d", 0x000000, 0x200000, CRC(e536b313) SHA1(7357da993d2bb3fcc8c1c2feb53689ad368cd80a) ) + ROM_LOAD( "dt1ccrh.1d", 0x200000, 0x080000, CRC(af257064) SHA1(0da561d9f8824618c00209ccef6146e9f3ad72bb) ) + ROM_REGION( 0x480000, REGION_USER1, 0 ) /* 3D model data */ + ROM_LOAD( "dt1ptrl0.18k", 0x000000, 0x080000, CRC(4e0cac3a) SHA1(c2778e9e93be2de729c6f118caf62ac9f48efbb0) ) + ROM_LOAD( "dt1ptrl1.16k", 0x080000, 0x080000, CRC(59ba9dba) SHA1(a2e9488cf0ff255284c06a1ef653ae86c0d98adc) ) + ROM_LOAD( "dt1ptrl2.15k", 0x100000, 0x080000, CRC(cfe80c67) SHA1(ba3bc48aa39712e63c915070a76974fbd560dee6) ) + ROM_LOAD( "dt1ptrm0.18j", 0x180000, 0x080000, CRC(41f34337) SHA1(7e624e7b6fdefe156168b1c9cc5e919db3b2fbaa) ) + ROM_LOAD( "dt1ptrm1.16j", 0x200000, 0x080000, CRC(f620fd41) SHA1(18cf6e11eb68da1b7f7fcc32562dc952c247de65) ) + ROM_LOAD( "dt1ptrm2.15j", 0x280000, 0x080000, CRC(71e6714d) SHA1(6aad6db3be5020213d7add61c7d927ae9c4fea4e) ) + ROM_LOAD( "dt1ptru0.18f", 0x300000, 0x080000, CRC(4909bd7d) SHA1(0e4ef3987c43ef0438331b82b50dcc97363a45d0) ) + ROM_LOAD( "dt1ptru1.16f", 0x380000, 0x080000, CRC(4a5097df) SHA1(a9c814b0ed4bd92accd0e57be8e3d887114b06a5) ) + ROM_LOAD( "dt1ptru2.15f", 0x400000, 0x080000, CRC(1171eaf5) SHA1(168365ea619386f218585c49025cdd7fd1224082) ) + ROM_REGION( 0x1000000, REGION_SOUND1, 0 ) /* C352 samples */ + ROM_LOAD( "dt1wavea.2l", 0x000000, 0x400000, CRC(cbd52e40) SHA1(dc995dd919548c96a90efb0375e5b5f1055e05cb) ) + ROM_LOAD( "dt1waveb.1l", 0x800000, 0x400000, CRC(6b736f94) SHA1(ac3715480aa9a9c2dec099607f89859bb3b73a6a) ) +ROM_END - ROM_REGION( 0x80000*9, REGION_GFX4, 0 ) /* 3d model data */ - ROM_LOAD( "ts1ptrl0.18k", 0x80000*0, 0x80000,CRC(e5f2d275) SHA1(2f5057e65ec8a3ec03f841f15f10769ae1f69139) ) - ROM_LOAD( "ts1ptrl1.16k", 0x80000*1, 0x80000,CRC(2bba3800) SHA1(1d9c944cb06417cb0ac47a58b922dddb83387586) ) - ROM_LOAD( "ts1ptrl2.15k", 0x80000*2, 0x80000,CRC(d4441c08) SHA1(6a6bb9cecbf35cb81b7681e220fc33df9a01d07f) ) - ROM_LOAD( "ts1ptrm0.18j", 0x80000*3, 0x80000,CRC(8aea02ba) SHA1(44ba85ba6d59758448d17ec39dfb628882ddc684) ) - ROM_LOAD( "ts1ptrm1.16j", 0x80000*4, 0x80000,CRC(bccf19bc) SHA1(4a6566948bdd2b0f82b7c30e57d3fe65005c26e3) ) - ROM_LOAD( "ts1ptrm2.15j", 0x80000*5, 0x80000,CRC(7280be31) SHA1(476b7171ae855d8bbd968ccbaa55b5100d274e3b) ) - ROM_LOAD( "ts1ptru0.18f", 0x80000*6, 0x80000,CRC(c30d6332) SHA1(a5c59d0abfe38de975fa0d606ed8500eb02008b7) ) - ROM_LOAD( "ts1ptru1.16f", 0x80000*7, 0x80000,CRC(993cde84) SHA1(c9cdcca1d60bcc41ad881c02dda9895563963ead) ) - ROM_LOAD( "ts1ptru2.15f", 0x80000*8, 0x80000,CRC(7cb25c73) SHA1(616eab3ac238864a584394f7ec8736ece227974a) ) +ROM_START( dirtdasha ) + ROM_REGION( 0x400000, REGION_CPU1, 0 ) /* main program */ + ROM_LOAD32_WORD_SWAP( "dt2vera.1", 0x000002, 0x200000, CRC(402a3d73) SHA1(009b57ed0ea228ccedb139d945b9eaf2a36e2502) ) + ROM_LOAD32_WORD_SWAP( "dt2vera.2", 0x000000, 0x200000, CRC(66ed140d) SHA1(a472fdc7b6aaeb4b3643ecdafd32fa665e7c7aa2) ) + ROM_REGION16_LE( 0x080000, REGION_CPU4, 0 ) /* MCU */ + ROM_LOAD( "dt1dataa.8k", 0x000000, 0x080000, CRC(9bcdea21) SHA1(26ae025cf746d3a703a82495eb2bb515b828a650) ) + C71_BIOS + ROM_REGION( 0x1000000, REGION_GFX1, ROMREGION_ERASEFF ) /* 32x32x8bpp sprite tiles */ + ROM_LOAD( "dt1scg0.12f", 0x000000, 0x200000, CRC(a09b5760) SHA1(3dd54ebebf9da1de76874a1adf491ed15849e1b1) ) + ROM_LOAD( "dt1scg1.10f", 0x200000, 0x200000, CRC(f9ac8111) SHA1(814074ae8cc81c6c1201d764a84dd95fe914f19c) ) + ROM_REGION( 0x1000000, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ + ROM_LOAD( "dt1cg0.8d", 0x000000, 0x200000, CRC(10ab95e0) SHA1(ffde1f00ac3e82a36fbcfa060c6b97c92dfcfc8b) ) + ROM_LOAD( "dt1cg1.10d", 0x200000, 0x200000, CRC(d9f1ba53) SHA1(5a1095b726c55001cc1d4c695adc38097e6a0201) ) + ROM_LOAD( "dt1cg2.12d", 0x400000, 0x200000, CRC(bd8b1e0b) SHA1(fcd94e33a0cbd17c9308cb8952e3c618ab56f9fc) ) + ROM_LOAD( "dt1cg3.13d", 0x600000, 0x200000, CRC(ba960663) SHA1(e98149bc4652ea7933ac47d760a6f7e6489f15e2) ) + ROM_LOAD( "dt1cg4.14d", 0x800000, 0x200000, CRC(424b9652) SHA1(fa8865110db03559740c4e633e123d1a009782c4) ) + ROM_LOAD( "dt1cg5.16d", 0xa00000, 0x200000, CRC(29516626) SHA1(1f12c5dc3975b88dc60d87d0409bf311837e9fa4) ) + ROM_LOAD( "dt1cg6.18d", 0xc00000, 0x200000, CRC(e6fa7180) SHA1(85316cde282cff1f913cf9f155cfa36adcc1108e) ) + ROM_LOAD( "dt1cg7.19d", 0xe00000, 0x200000, CRC(2ca19153) SHA1(c82403c8b40bf85daedf610b1bc7bfea9dfc6206) ) + ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ + ROM_LOAD( "dt1ccrl.3d", 0x000000, 0x200000, CRC(e536b313) SHA1(7357da993d2bb3fcc8c1c2feb53689ad368cd80a) ) + ROM_LOAD( "dt1ccrh.1d", 0x200000, 0x080000, CRC(af257064) SHA1(0da561d9f8824618c00209ccef6146e9f3ad72bb) ) + ROM_REGION( 0x480000, REGION_USER1, 0 ) /* 3D model data */ + ROM_LOAD( "dt1ptrl0.18k", 0x000000, 0x080000, CRC(4e0cac3a) SHA1(c2778e9e93be2de729c6f118caf62ac9f48efbb0) ) + ROM_LOAD( "dt1ptrl1.16k", 0x080000, 0x080000, CRC(59ba9dba) SHA1(a2e9488cf0ff255284c06a1ef653ae86c0d98adc) ) + ROM_LOAD( "dt1ptrl2.15k", 0x100000, 0x080000, CRC(cfe80c67) SHA1(ba3bc48aa39712e63c915070a76974fbd560dee6) ) + ROM_LOAD( "dt1ptrm0.18j", 0x180000, 0x080000, CRC(41f34337) SHA1(7e624e7b6fdefe156168b1c9cc5e919db3b2fbaa) ) + ROM_LOAD( "dt1ptrm1.16j", 0x200000, 0x080000, CRC(f620fd41) SHA1(18cf6e11eb68da1b7f7fcc32562dc952c247de65) ) + ROM_LOAD( "dt1ptrm2.15j", 0x280000, 0x080000, CRC(71e6714d) SHA1(6aad6db3be5020213d7add61c7d927ae9c4fea4e) ) + ROM_LOAD( "dt1ptru0.18f", 0x300000, 0x080000, CRC(4909bd7d) SHA1(0e4ef3987c43ef0438331b82b50dcc97363a45d0) ) + ROM_LOAD( "dt1ptru1.16f", 0x380000, 0x080000, CRC(4a5097df) SHA1(a9c814b0ed4bd92accd0e57be8e3d887114b06a5) ) + ROM_LOAD( "dt1ptru2.15f", 0x400000, 0x080000, CRC(1171eaf5) SHA1(168365ea619386f218585c49025cdd7fd1224082) ) + ROM_REGION( 0x1000000, REGION_SOUND1, 0 ) /* C352 samples */ + ROM_LOAD( "dt1wavea.2l", 0x000000, 0x400000, CRC(cbd52e40) SHA1(dc995dd919548c96a90efb0375e5b5f1055e05cb) ) + ROM_LOAD( "dt1waveb.1l", 0x800000, 0x400000, CRC(6b736f94) SHA1(ac3715480aa9a9c2dec099607f89859bb3b73a6a) ) +ROM_END - ROM_REGION( 0x080000, REGION_CPU2, 0 ) /* BIOS */ +ROM_START( dirtdashb ) + ROM_REGION( 0x400000, REGION_CPU1, ROMREGION_ERASE00 ) /* main program */ + ROM_LOAD32_BYTE( "dt2verb.rom1", 0x000003, 0x100000, CRC(d133c6d7) SHA1(6fbdb823771826ba8c62d8d85223eeda38c081e7) ) + ROM_LOAD32_BYTE( "dt2verb.rom2", 0x000002, 0x100000, CRC(ba4d7626) SHA1(c48b724a454b97c47122548c77793599e9d8f92c) ) + ROM_LOAD32_BYTE( "dt2verb.rom3", 0x000001, 0x100000, CRC(f0d9aff2) SHA1(2ebccbd9524d29c12e001d897fd81948fb6068fa) ) + ROM_LOAD32_BYTE( "dt2verb.rom4", 0x000000, 0x100000, CRC(9a80fc82) SHA1(81a14749a39d213db58527f7a98d48dbfca1c153) ) + ROM_REGION16_LE( 0x080000, REGION_CPU4, 0 ) /* MCU */ + ROM_LOAD( "dt1dataa.8k", 0x000000, 0x080000, CRC(9bcdea21) SHA1(26ae025cf746d3a703a82495eb2bb515b828a650) ) + C71_BIOS + ROM_REGION( 0x1000000, REGION_GFX1, ROMREGION_ERASEFF ) /* 32x32x8bpp sprite tiles */ + ROM_LOAD( "dt1scg0.12f", 0x000000, 0x200000, CRC(a09b5760) SHA1(3dd54ebebf9da1de76874a1adf491ed15849e1b1) ) + ROM_LOAD( "dt1scg1.10f", 0x200000, 0x200000, CRC(f9ac8111) SHA1(814074ae8cc81c6c1201d764a84dd95fe914f19c) ) + ROM_REGION( 0x1000000, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ + ROM_LOAD( "dt1cg0.8d", 0x000000, 0x200000, CRC(10ab95e0) SHA1(ffde1f00ac3e82a36fbcfa060c6b97c92dfcfc8b) ) + ROM_LOAD( "dt1cg1.10d", 0x200000, 0x200000, CRC(d9f1ba53) SHA1(5a1095b726c55001cc1d4c695adc38097e6a0201) ) + ROM_LOAD( "dt1cg2.12d", 0x400000, 0x200000, CRC(bd8b1e0b) SHA1(fcd94e33a0cbd17c9308cb8952e3c618ab56f9fc) ) + ROM_LOAD( "dt1cg3.13d", 0x600000, 0x200000, CRC(ba960663) SHA1(e98149bc4652ea7933ac47d760a6f7e6489f15e2) ) + ROM_LOAD( "dt1cg4.14d", 0x800000, 0x200000, CRC(424b9652) SHA1(fa8865110db03559740c4e633e123d1a009782c4) ) + ROM_LOAD( "dt1cg5.16d", 0xa00000, 0x200000, CRC(29516626) SHA1(1f12c5dc3975b88dc60d87d0409bf311837e9fa4) ) + ROM_LOAD( "dt1cg6.18d", 0xc00000, 0x200000, CRC(e6fa7180) SHA1(85316cde282cff1f913cf9f155cfa36adcc1108e) ) + ROM_LOAD( "dt1cg7.19d", 0xe00000, 0x200000, CRC(2ca19153) SHA1(c82403c8b40bf85daedf610b1bc7bfea9dfc6206) ) + ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ + ROM_LOAD( "dt1ccrl.3d", 0x000000, 0x200000, CRC(e536b313) SHA1(7357da993d2bb3fcc8c1c2feb53689ad368cd80a) ) + ROM_LOAD( "dt1ccrh.1d", 0x200000, 0x080000, CRC(af257064) SHA1(0da561d9f8824618c00209ccef6146e9f3ad72bb) ) + ROM_REGION( 0x480000, REGION_USER1, 0 ) /* 3D model data */ + ROM_LOAD( "dt1ptrl0.18k", 0x000000, 0x080000, CRC(4e0cac3a) SHA1(c2778e9e93be2de729c6f118caf62ac9f48efbb0) ) + ROM_LOAD( "dt1ptrl1.16k", 0x080000, 0x080000, CRC(59ba9dba) SHA1(a2e9488cf0ff255284c06a1ef653ae86c0d98adc) ) + ROM_LOAD( "dt1ptrl2.15k", 0x100000, 0x080000, CRC(cfe80c67) SHA1(ba3bc48aa39712e63c915070a76974fbd560dee6) ) + ROM_LOAD( "dt1ptrm0.18j", 0x180000, 0x080000, CRC(41f34337) SHA1(7e624e7b6fdefe156168b1c9cc5e919db3b2fbaa) ) + ROM_LOAD( "dt1ptrm1.16j", 0x200000, 0x080000, CRC(f620fd41) SHA1(18cf6e11eb68da1b7f7fcc32562dc952c247de65) ) + ROM_LOAD( "dt1ptrm2.15j", 0x280000, 0x080000, CRC(71e6714d) SHA1(6aad6db3be5020213d7add61c7d927ae9c4fea4e) ) + ROM_LOAD( "dt1ptru0.18f", 0x300000, 0x080000, CRC(4909bd7d) SHA1(0e4ef3987c43ef0438331b82b50dcc97363a45d0) ) + ROM_LOAD( "dt1ptru1.16f", 0x380000, 0x080000, CRC(4a5097df) SHA1(a9c814b0ed4bd92accd0e57be8e3d887114b06a5) ) + ROM_LOAD( "dt1ptru2.15f", 0x400000, 0x080000, CRC(1171eaf5) SHA1(168365ea619386f218585c49025cdd7fd1224082) ) + ROM_REGION( 0x1000000, REGION_SOUND1, 0 ) /* C352 samples */ + ROM_LOAD( "dt1wavea.2l", 0x000000, 0x400000, CRC(cbd52e40) SHA1(dc995dd919548c96a90efb0375e5b5f1055e05cb) ) + ROM_LOAD( "dt1waveb.1l", 0x800000, 0x400000, CRC(6b736f94) SHA1(ac3715480aa9a9c2dec099607f89859bb3b73a6a) ) +ROM_END + +ROM_START( dirtdashj ) + ROM_REGION( 0x400000, REGION_CPU1, 0 ) /* main program */ + ROM_LOAD32_WORD_SWAP( "dt1vera.1", 0x000002, 0x200000, CRC(057b280b) SHA1(e7f038c1b3c7520d32c9962cc00104bcf65d60f6) ) + ROM_LOAD32_WORD_SWAP( "dt1vera.2", 0x000000, 0x200000, CRC(82f822d2) SHA1(170cf326903fe7b4e203b181124de609826b8e1f) ) + ROM_REGION16_LE( 0x080000, REGION_CPU4, 0 ) /* MCU */ + ROM_LOAD( "dt1dataa.8k", 0x000000, 0x080000, CRC(9bcdea21) SHA1(26ae025cf746d3a703a82495eb2bb515b828a650) ) + C71_BIOS + ROM_REGION( 0x1000000, REGION_GFX1, ROMREGION_ERASEFF ) /* 32x32x8bpp sprite tiles */ + ROM_LOAD( "dt1scg0.12f", 0x000000, 0x200000, CRC(a09b5760) SHA1(3dd54ebebf9da1de76874a1adf491ed15849e1b1) ) + ROM_LOAD( "dt1scg1.10f", 0x200000, 0x200000, CRC(f9ac8111) SHA1(814074ae8cc81c6c1201d764a84dd95fe914f19c) ) + ROM_REGION( 0x1000000, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ + ROM_LOAD( "dt1cg0.8d", 0x000000, 0x200000, CRC(10ab95e0) SHA1(ffde1f00ac3e82a36fbcfa060c6b97c92dfcfc8b) ) + ROM_LOAD( "dt1cg1.10d", 0x200000, 0x200000, CRC(d9f1ba53) SHA1(5a1095b726c55001cc1d4c695adc38097e6a0201) ) + ROM_LOAD( "dt1cg2.12d", 0x400000, 0x200000, CRC(bd8b1e0b) SHA1(fcd94e33a0cbd17c9308cb8952e3c618ab56f9fc) ) + ROM_LOAD( "dt1cg3.13d", 0x600000, 0x200000, CRC(ba960663) SHA1(e98149bc4652ea7933ac47d760a6f7e6489f15e2) ) + ROM_LOAD( "dt1cg4.14d", 0x800000, 0x200000, CRC(424b9652) SHA1(fa8865110db03559740c4e633e123d1a009782c4) ) + ROM_LOAD( "dt1cg5.16d", 0xa00000, 0x200000, CRC(29516626) SHA1(1f12c5dc3975b88dc60d87d0409bf311837e9fa4) ) + ROM_LOAD( "dt1cg6.18d", 0xc00000, 0x200000, CRC(e6fa7180) SHA1(85316cde282cff1f913cf9f155cfa36adcc1108e) ) + ROM_LOAD( "dt1cg7.19d", 0xe00000, 0x200000, CRC(2ca19153) SHA1(c82403c8b40bf85daedf610b1bc7bfea9dfc6206) ) + ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ + ROM_LOAD( "dt1ccrl.3d", 0x000000, 0x200000, CRC(e536b313) SHA1(7357da993d2bb3fcc8c1c2feb53689ad368cd80a) ) + ROM_LOAD( "dt1ccrh.1d", 0x200000, 0x080000, CRC(af257064) SHA1(0da561d9f8824618c00209ccef6146e9f3ad72bb) ) + ROM_REGION( 0x480000, REGION_USER1, 0 ) /* 3D model data */ + ROM_LOAD( "dt1ptrl0.18k", 0x000000, 0x080000, CRC(4e0cac3a) SHA1(c2778e9e93be2de729c6f118caf62ac9f48efbb0) ) + ROM_LOAD( "dt1ptrl1.16k", 0x080000, 0x080000, CRC(59ba9dba) SHA1(a2e9488cf0ff255284c06a1ef653ae86c0d98adc) ) + ROM_LOAD( "dt1ptrl2.15k", 0x100000, 0x080000, CRC(cfe80c67) SHA1(ba3bc48aa39712e63c915070a76974fbd560dee6) ) + ROM_LOAD( "dt1ptrm0.18j", 0x180000, 0x080000, CRC(41f34337) SHA1(7e624e7b6fdefe156168b1c9cc5e919db3b2fbaa) ) + ROM_LOAD( "dt1ptrm1.16j", 0x200000, 0x080000, CRC(f620fd41) SHA1(18cf6e11eb68da1b7f7fcc32562dc952c247de65) ) + ROM_LOAD( "dt1ptrm2.15j", 0x280000, 0x080000, CRC(71e6714d) SHA1(6aad6db3be5020213d7add61c7d927ae9c4fea4e) ) + ROM_LOAD( "dt1ptru0.18f", 0x300000, 0x080000, CRC(4909bd7d) SHA1(0e4ef3987c43ef0438331b82b50dcc97363a45d0) ) + ROM_LOAD( "dt1ptru1.16f", 0x380000, 0x080000, CRC(4a5097df) SHA1(a9c814b0ed4bd92accd0e57be8e3d887114b06a5) ) + ROM_LOAD( "dt1ptru2.15f", 0x400000, 0x080000, CRC(1171eaf5) SHA1(168365ea619386f218585c49025cdd7fd1224082) ) + ROM_REGION( 0x1000000, REGION_SOUND1, 0 ) /* C352 samples */ + ROM_LOAD( "dt1wavea.2l", 0x000000, 0x400000, CRC(cbd52e40) SHA1(dc995dd919548c96a90efb0375e5b5f1055e05cb) ) + ROM_LOAD( "dt1waveb.1l", 0x800000, 0x400000, CRC(6b736f94) SHA1(ac3715480aa9a9c2dec099607f89859bb3b73a6a) ) +ROM_END + +ROM_START( timecrisj ) + ROM_REGION( 0x400000, REGION_CPU1, 0 ) /* main program */ + ROM_LOAD32_BYTE( "ts1verb.1", 0x00003, 0x100000, CRC(17c7ba64) SHA1(bb915000dba1a259953e0cd62143e95407f57499) ) + ROM_LOAD32_BYTE( "ts1verb.2", 0x00002, 0x100000, CRC(77bacf13) SHA1(8d0bab13858e8ea813daeb99f2a9bb6946ac5888) ) + ROM_LOAD32_BYTE( "ts1verb.3", 0x00001, 0x100000, CRC(b68e62f3) SHA1(5cd0543ceeaf4399994efbfc377ff65e4e7baca8) ) + ROM_LOAD32_BYTE( "ts1verb.4", 0x00000, 0x100000, CRC(8ea2331f) SHA1(36fc49b617775b7d8d2867d6ff215962d1b96571) ) + ROM_REGION16_LE( 0x080000, REGION_CPU4, 0 ) /* MCU */ ROM_LOAD( "ts1data.8k", 0, 0x080000, CRC(e68aa973) SHA1(663e80d249be5d5841139d98a9d72e2396851272) ) - ROM_REGION( 0x800000, REGION_USER2, 0 ) /* sound samples */ - ROM_LOAD( "ts1wavea.2l", 0x000000, 0x400000, CRC(d1123301) SHA1(4bf1fd746fef4e6befa63c61a761971d729e1573) ) - ROM_LOAD( "ts1waveb.1l", 0x400000, 0x200000, CRC(bf4d7272) SHA1(c7c7b3620e7b3176644b6784ee36e679c9e31cc1) ) + C71_BIOS + ROM_REGION( 0x1000000, REGION_GFX1, ROMREGION_ERASEFF ) /* 32x32x8bpp sprite tiles */ + ROM_LOAD( "ts1scg0.12f", 0x000000, 0x200000, CRC(14a3674d) SHA1(c5792a385572452b43bbc7eb8428335b19daa3c0) ) + ROM_LOAD( "ts1scg1.10f", 0x200000, 0x200000, CRC(11791dbf) SHA1(3d75b468d69a8bf398d45f310cdb8bc88b63f25c) ) + ROM_LOAD( "ts1scg2.8f", 0x400000, 0x200000, CRC(d630fff9) SHA1(691394027b858702f06282f965f5b53e6fed496b) ) + ROM_LOAD( "ts1scg3.7f", 0x600000, 0x200000, CRC(1a62f015) SHA1(7d09ae480ae7813391616ae0090929ba845a345a) ) + ROM_LOAD( "ts1scg4.5f", 0x800000, 0x200000, CRC(511b8dd6) SHA1(936649c0a61d29f024a28e4ab64cce4b55d58f64) ) + ROM_LOAD( "ts1scg5.3f", 0xa00000, 0x200000, CRC(553bb246) SHA1(94659bee4fd0afe834a8bf3414d8825411cf9e86) ) + ROM_REGION( 0x1000000, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ + ROM_LOAD( "ts1cg0.8d", 0x000000, 0x200000, CRC(de07b22c) SHA1(f4d07b8840ec8be625eff634bce619e960c334a5) ) + ROM_LOAD( "ts1cg1.10d", 0x200000, 0x200000, CRC(992d26f6) SHA1(a0b9007312804b413d4c1748527378da4d8d53b3) ) + ROM_LOAD( "ts1cg2.12d", 0x400000, 0x200000, CRC(6273954f) SHA1(d73a43888b53e4c42fc33e8e1b38e60fd3329413) ) + ROM_LOAD( "ts1cg3.13d", 0x600000, 0x200000, CRC(38171f24) SHA1(d04caaa5b1b377ced38501b014e4cb7fc831c41d) ) + ROM_LOAD( "ts1cg4.14d", 0x800000, 0x200000, CRC(51f09856) SHA1(0eef421907ee813d5117e62cf0005bf00eb29c88) ) + ROM_LOAD( "ts1cg5.16d", 0xa00000, 0x200000, CRC(4cd9fd79) SHA1(0d2018ec914683a75bdec8655d678fd562eb6d15) ) + ROM_LOAD( "ts1cg6.18d", 0xc00000, 0x200000, CRC(f17f2ec9) SHA1(ed88ec524626e5bbe2e1ea6838412d3ac85671dd) ) + ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ + ROM_LOAD( "ts1ccrl.3d", 0x000000, 0x200000, CRC(56cad2df) SHA1(49c0e57d5cf5d5fc4c75da6969bec01d6d443259) ) + ROM_LOAD( "ts1ccrh.1d", 0x200000, 0x080000, CRC(a1cc3741) SHA1(7fe57924c42e287b134e5d7ad00cffdff1f18084) ) + ROM_REGION( 0x480000, REGION_USER1, 0 ) /* 3D model data */ + ROM_LOAD( "ts1ptrl0.18k", 0x000000, 0x080000, CRC(e5f2d275) SHA1(2f5057e65ec8a3ec03f841f15f10769ae1f69139) ) + ROM_LOAD( "ts1ptrl1.16k", 0x080000, 0x080000, CRC(2bba3800) SHA1(1d9c944cb06417cb0ac47a58b922dddb83387586) ) + ROM_LOAD( "ts1ptrl2.15k", 0x100000, 0x080000, CRC(d4441c08) SHA1(6a6bb9cecbf35cb81b7681e220fc33df9a01d07f) ) + ROM_LOAD( "ts1ptrm0.18j", 0x180000, 0x080000, CRC(8aea02ba) SHA1(44ba85ba6d59758448d17ec39dfb628882ddc684) ) + ROM_LOAD( "ts1ptrm1.16j", 0x200000, 0x080000, CRC(bccf19bc) SHA1(4a6566948bdd2b0f82b7c30e57d3fe65005c26e3) ) + ROM_LOAD( "ts1ptrm2.15j", 0x280000, 0x080000, CRC(7280be31) SHA1(476b7171ae855d8bbd968ccbaa55b5100d274e3b) ) + ROM_LOAD( "ts1ptru0.18f", 0x300000, 0x080000, CRC(c30d6332) SHA1(a5c59d0abfe38de975fa0d606ed8500eb02008b7) ) + ROM_LOAD( "ts1ptru1.16f", 0x380000, 0x080000, CRC(993cde84) SHA1(c9cdcca1d60bcc41ad881c02dda9895563963ead) ) + ROM_LOAD( "ts1ptru2.15f", 0x400000, 0x080000, CRC(7cb25c73) SHA1(616eab3ac238864a584394f7ec8736ece227974a) ) + ROM_REGION( 0x1000000, REGION_SOUND1, 0 ) /* C352 samples */ + ROM_LOAD16_WORD_SWAP( "ts1wavea.2l", 0x000000, 0x400000, CRC(d1123301) SHA1(4bf1fd746fef4e6befa63c61a761971d729e1573) ) + ROM_LOAD( "ts1waveb.1l", 0x800000, 0x200000, CRC(bf4d7272) SHA1(c7c7b3620e7b3176644b6784ee36e679c9e31cc1) ) ROM_END -INPUT_PORTS_START( alpiner ) - PORT_START /* DIP4 */ - PORT_DIPNAME( 0x01, 0x00, "DIP1" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x01, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x00, "DIP2" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x02, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x00, "DIP3" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x04, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x00, "DIP4" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x08, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x00, "DIP5" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x10, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x00, "DIP6" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x20, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x00, "DIP7" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x40, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x00, "DIP8" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x80, DEF_STR( On ) ) +ROM_START( alpines ) + ROM_REGION( 0x800000, REGION_CPU1, 0 ) /* main program */ + ROM_LOAD32_BYTE( "af2ver-a_ll.ic2", 0x000003, 0x200000, CRC(e776159d) SHA1(5110364afb7ec606074d58a1d216d7d687b9df62) ) + ROM_LOAD32_BYTE( "af2ver-a_lm.ic3", 0x000002, 0x200000, CRC(c5333d38) SHA1(9486cead964f95f8e56dac2f88486f3b98561aa6) ) + ROM_LOAD32_BYTE( "af2ver-a_um.ic4", 0x000001, 0x200000, CRC(c9095af3) SHA1(4981c8c84057373ef678e51fe72ebac40d1a0cf4) ) + ROM_LOAD32_BYTE( "af2ver-a_uu.ic5", 0x000000, 0x200000, CRC(54ee33a1) SHA1(0eaa8707ab13a0a66551f61a08986c98f5c9e446) ) + ROM_REGION16_LE( 0x080000, REGION_CPU4, 0 ) /* MCU */ + ROM_LOAD( "af1data.8k", 0x000000, 0x080000, CRC(ef13ebe8) SHA1(5d3f697994d4b5b19ee7fea1e2aef8e39449b68e) ) + C71_BIOS + ROM_REGION( 0x1000000, REGION_GFX1, ROMREGION_ERASEFF ) /* 32x32x8bpp sprite tiles */ + ROM_LOAD( "af1scg0b.12f", 0x000000, 0x200000, CRC(46a6222a) SHA1(5322ef60690625b9b8dbe1cfe0c49dcd9c8b1a4c) ) + ROM_REGION( 0x1000000, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ + ROM_LOAD( "af1cg0.8d", 0x000000, 0x200000, CRC(7423f3ff) SHA1(6a2fd44823ef46111deb57d328b1b75cc355d413) ) + ROM_LOAD( "af1cg1.10d", 0x200000, 0x200000, CRC(ea76689a) SHA1(73dd3af737a3e9903abe5ed9c9ae7eded51d8350) ) + ROM_LOAD( "af1cg2.12d", 0x400000, 0x200000, CRC(2a38943a) SHA1(15d737996f49bf6374ef6191bbfbe0298d398378) ) + ROM_LOAD( "af1cg3.13d", 0x600000, 0x200000, CRC(7f5a3e0f) SHA1(241f9995323b28df23d20a75e1f43ce6e05434cd) ) + ROM_LOAD( "af1cg4.14d", 0x800000, 0x200000, CRC(a5ee13e2) SHA1(48fd3c912690f21cbbc2a39bed0a82be41a0d011) ) + ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ + ROM_LOAD( "af1ccrl.3d", 0x000000, 0x200000, CRC(6c054698) SHA1(8537607646b183883c5aa4060fb0af640da4af87) ) + ROM_LOAD( "af1ccrh.1d", 0x200000, 0x080000, CRC(95a02a27) SHA1(32ee87b76ae9fcec6d825e3cf4d5cbb97db39544) ) + ROM_REGION( 0x300000, REGION_USER1, 0 ) /* 3D model data */ + ROM_LOAD( "af1ptrl0.18k", 0x000000, 0x080000, CRC(31ce46d3) SHA1(568fb9ee9ac14e613a4fd7668cb38315c10be62b) ) + ROM_LOAD( "af1ptrl1.16k", 0x080000, 0x080000, CRC(e869bf00) SHA1(b3c3026891ae3958d1774c905e97c3b57a414ea7) ) + ROM_LOAD( "af1ptrm0.18j", 0x100000, 0x080000, CRC(ef7f4d8a) SHA1(02f77c68004b7dccc99b61126e7d07960eb15028) ) + ROM_LOAD( "af1ptrm1.16j", 0x180000, 0x080000, CRC(7dd01d52) SHA1(adc1087435d31ed6163ad046466955f01517450f) ) + ROM_LOAD( "af1ptru0.18f", 0x200000, 0x080000, CRC(177f1591) SHA1(3969e780e5603eca0a65f65c1ad14d1cef918b39) ) + ROM_LOAD( "af1ptru1.16f", 0x280000, 0x080000, CRC(7521d18e) SHA1(dc03ef369db16f59c138ff4e22260d1c04782d1f) ) + ROM_REGION( 0x1000000, REGION_SOUND1, 0 ) /* C352 samples */ + ROM_LOAD( "af1wavea.2l", 0x000000, 0x400000, CRC(28cca494) SHA1(4ff87ab85fd17bf8dbee5b03d99cc5c31dd6349a) ) +ROM_END - PORT_START - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) - PORT_BITX(0x08, IP_ACTIVE_HIGH, IPT_SERVICE|IPF_TOGGLE, DEF_STR( Service_Mode ), KEYCODE_F2, IP_JOY_NONE ) - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) /* DECISION */ - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) /* L SELECTION */ - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 ) /* R SELECTION */ - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) +ROM_START( tokyowar ) + ROM_REGION( 0x400000, REGION_CPU1, 0 ) /* main program */ + ROM_LOAD32_BYTE( "tw2vera.1", 0x000003, 0x100000, CRC(2b17ca92) SHA1(7bcb1658059c59fb1a0131a41ede7157855130a8) ) + ROM_LOAD32_BYTE( "tw2vera.2", 0x000002, 0x100000, CRC(12da84e3) SHA1(a9406d0b77f60ba930c30e60bf4b3656c8905585) ) + ROM_LOAD32_BYTE( "tw2vera.3", 0x000001, 0x100000, CRC(7d42c516) SHA1(28c1596dd55c15207bbb41a8b9a5abc97abc2bc8) ) + ROM_LOAD32_BYTE( "tw2vera.4", 0x000000, 0x100000, CRC(b904ed16) SHA1(773e11536e1b3fe4971608a63a8e6eca702f8667) ) + ROM_REGION16_LE( 0x080000, REGION_CPU4, 0 ) /* MCU */ + ROM_LOAD( "tw1data.8k", 0x000000, 0x080000, CRC(bd046e4b) SHA1(162bc4ab69959ccab49fd69de291d34d472fb1c8) ) + C71_BIOS + ROM_REGION( 0x1000000, REGION_GFX1, ROMREGION_ERASEFF ) /* 32x32x8bpp sprite tiles */ + ROM_LOAD( "tw1scg0.12f", 0x000000, 0x200000, CRC(e3ec4daa) SHA1(f3a71ae9820d62075b814ffa2fecf3343ae09ffe) ) + ROM_LOAD( "tw1scg1.10f", 0x200000, 0x200000, CRC(b18a06e9) SHA1(ecf6a1e11603b8ea5119a036a57595dea021d778) ) + ROM_LOAD( "tw1scg2.8f", 0x400000, 0x200000, CRC(36f8c3d8) SHA1(d5c965d5cdd258c77b9db3137ce33404a5a3641c) ) + ROM_LOAD( "tw1scg3.7f", 0x600000, 0x200000, CRC(8e14d013) SHA1(ca63105a5c07bb9653499eef7a757db52612b59b) ) + ROM_REGION( 0x1000000, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ + ROM_LOAD( "tw1cg0.8d", 0x000000, 0x200000, CRC(98b9b070) SHA1(cb920a34700dab330c967cc634717134c04b7e1d) ) + ROM_LOAD( "tw1cg1.10d", 0x200000, 0x200000, CRC(f96a723a) SHA1(5ba14963a4c51c875ac8d3b42049bc334de90038) ) + ROM_LOAD( "tw1cg2.12d", 0x400000, 0x200000, CRC(573e9ded) SHA1(815bda1ac000532c915c2d65ffdb04fee6fa8201) ) + ROM_LOAD( "tw1cg3.13d", 0x600000, 0x200000, CRC(302d5c74) SHA1(5a823f6842cf0f79eb93da47d5bf8c5f51e420db) ) + ROM_LOAD( "tw1cg4.14d", 0x800000, 0x200000, CRC(ab8aa1df) SHA1(355192d999f493e0761fbc822fa9b30c33d8e1c4) ) + ROM_LOAD( "tw1cg5.16d", 0xa00000, 0x200000, CRC(5063f3d0) SHA1(ad8dd2f4184373a3a3ca748b411a5eec1835dc97) ) + ROM_LOAD( "tw1cg6.18d", 0xc00000, 0x200000, CRC(d764027c) SHA1(5cbf93392683885c220628936ba50c09cb40fcfb) ) + ROM_LOAD( "tw1cg7.19d", 0xe00000, 0x200000, CRC(12da0a43) SHA1(99287348a5219146bcd3e61fde3f2bc26b0c5a25) ) + ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ + ROM_LOAD( "tw1ccrl.3d", 0x000000, 0x200000, CRC(d08f5794) SHA1(336a97a2b060505e259e3bcedb9eb8aa4ea8815e) ) + ROM_LOAD( "tw1ccrh.1d", 0x200000, 0x080000, CRC(ad17e693) SHA1(4f06dc82c03159894fb8e10383862920f94563b1) ) + ROM_REGION( 0x600000, REGION_USER1, 0 ) /* 3D model data */ + ROM_LOAD( "tw1ptrl0.18k", 0x000000, 0x080000, CRC(44ac5e86) SHA1(5e42db58f2e352c0fe5e49588a9283817dd15ab1) ) + ROM_LOAD( "tw1ptrl1.16k", 0x080000, 0x080000, CRC(3c769860) SHA1(19b32c3d262f2a9d07354fbd6ac6be97b05f176e) ) + ROM_LOAD( "tw1ptrl2.15k", 0x100000, 0x080000, CRC(6e94103c) SHA1(ee90b77939a9f5780ce271882133cdf977eb643e) ) + ROM_LOAD( "tw1ptrl3.14k", 0x180000, 0x080000, CRC(e3ce5eb2) SHA1(4e15a6f630be15eb017cd51c5e7901db3138a061) ) + ROM_LOAD( "tw1ptrm0.18j", 0x200000, 0x080000, CRC(e170cea2) SHA1(ca259508d76fdab97a9d0502f871f0e560e6c308) ) + ROM_LOAD( "tw1ptrm1.16j", 0x280000, 0x080000, CRC(36a32237) SHA1(f46851dc5c094810ddc42d56310a9f85908bf715) ) + ROM_LOAD( "tw1ptrm2.15j", 0x300000, 0x080000, CRC(c426c278) SHA1(64232ac3c1649e0d0adb4b03e58b8b5ea4013f83) ) + ROM_LOAD( "tw1ptrm3.14j", 0x380000, 0x080000, CRC(d9b9a651) SHA1(0c49a051526081149d894d629f19cb0f2b66a698) ) + ROM_LOAD( "tw1ptru0.18f", 0x400000, 0x080000, CRC(62a9e9fb) SHA1(24739adba029b0acf2d7078962c9d01098a29a6c) ) + ROM_LOAD( "tw1ptru1.16f", 0x480000, 0x080000, CRC(2fd36177) SHA1(368b915261d914be01ae9daeb52571bead52d14d) ) + ROM_LOAD( "tw1ptru2.15f", 0x500000, 0x080000, CRC(ceacb1c9) SHA1(b86cf576e16bbe26ad0d6d6df8bf28d0071c25e2) ) + ROM_LOAD( "tw1ptru3.14f", 0x580000, 0x080000, CRC(939044c2) SHA1(f4c1c0a1c2f07ca7f784d59ef4162a2a6a8bbc43) ) + ROM_REGION( 0x1000000, REGION_SOUND1, 0 ) /* C352 samples */ + ROM_LOAD( "tw1wavea.2l", 0x000000, 0x400000, CRC(ebce6366) SHA1(44ebe90ff3c7af5bebbf1baba3b7a2b1863daebb) ) + ROM_REGION( 0x2000, REGION_USER2, 0 ) /* default EEPROM */ + ROM_LOAD( "tokyowar_defaults.nv", 0x0000, 0x2000, CRC(e8bd7d09) SHA1(7e59017b9d5eb78984b4f177b50a4727ad72a623) ) +ROM_END - PORT_START /* SWING */ - PORT_ANALOG( 0xffff, 0x8000, IPT_AD_STICK_X|IPF_CENTER, 100, 4, 0x00, 0xffff ) +ROM_START( tokyowarj ) + ROM_REGION( 0x400000, REGION_CPU1, 0 ) /* main program */ + ROM_LOAD32_BYTE( "tw1vera.1", 0x000003, 0x100000, CRC(29b38f05) SHA1(d55a34dce5f61d72e3edc331d3a346397069a5fc) ) + ROM_LOAD32_BYTE( "tw1vera.2", 0x000002, 0x100000, CRC(5f8e2e9e) SHA1(14513480fed483e5381ac5bf4467a1c17b0d9e75) ) + ROM_LOAD32_BYTE( "tw1vera.3", 0x000001, 0x100000, CRC(17146e7f) SHA1(0fd270152eef1966e0960531554cbe115668205f) ) + ROM_LOAD32_BYTE( "tw1vera.4", 0x000000, 0x100000, CRC(12698e2a) SHA1(51761ea96cb458f56d832cd233afbc374ded7f20) ) + ROM_REGION16_LE( 0x080000, REGION_CPU4, 0 ) /* MCU */ + ROM_LOAD( "tw1data.8k", 0x000000, 0x080000, CRC(bd046e4b) SHA1(162bc4ab69959ccab49fd69de291d34d472fb1c8) ) + C71_BIOS + ROM_REGION( 0x1000000, REGION_GFX1, ROMREGION_ERASEFF ) /* 32x32x8bpp sprite tiles */ + ROM_LOAD( "tw1scg0.12f", 0x000000, 0x200000, CRC(e3ec4daa) SHA1(f3a71ae9820d62075b814ffa2fecf3343ae09ffe) ) + ROM_LOAD( "tw1scg1.10f", 0x200000, 0x200000, CRC(b18a06e9) SHA1(ecf6a1e11603b8ea5119a036a57595dea021d778) ) + ROM_LOAD( "tw1scg2.8f", 0x400000, 0x200000, CRC(36f8c3d8) SHA1(d5c965d5cdd258c77b9db3137ce33404a5a3641c) ) + ROM_LOAD( "tw1scg3.7f", 0x600000, 0x200000, CRC(8e14d013) SHA1(ca63105a5c07bb9653499eef7a757db52612b59b) ) + ROM_REGION( 0x1000000, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ + ROM_LOAD( "tw1cg0.8d", 0x000000, 0x200000, CRC(98b9b070) SHA1(cb920a34700dab330c967cc634717134c04b7e1d) ) + ROM_LOAD( "tw1cg1.10d", 0x200000, 0x200000, CRC(f96a723a) SHA1(5ba14963a4c51c875ac8d3b42049bc334de90038) ) + ROM_LOAD( "tw1cg2.12d", 0x400000, 0x200000, CRC(573e9ded) SHA1(815bda1ac000532c915c2d65ffdb04fee6fa8201) ) + ROM_LOAD( "tw1cg3.13d", 0x600000, 0x200000, CRC(302d5c74) SHA1(5a823f6842cf0f79eb93da47d5bf8c5f51e420db) ) + ROM_LOAD( "tw1cg4.14d", 0x800000, 0x200000, CRC(ab8aa1df) SHA1(355192d999f493e0761fbc822fa9b30c33d8e1c4) ) + ROM_LOAD( "tw1cg5.16d", 0xa00000, 0x200000, CRC(5063f3d0) SHA1(ad8dd2f4184373a3a3ca748b411a5eec1835dc97) ) + ROM_LOAD( "tw1cg6.18d", 0xc00000, 0x200000, CRC(d764027c) SHA1(5cbf93392683885c220628936ba50c09cb40fcfb) ) + ROM_LOAD( "tw1cg7.19d", 0xe00000, 0x200000, CRC(12da0a43) SHA1(99287348a5219146bcd3e61fde3f2bc26b0c5a25) ) + ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ + ROM_LOAD( "tw1ccrl.3d", 0x000000, 0x200000, CRC(d08f5794) SHA1(336a97a2b060505e259e3bcedb9eb8aa4ea8815e) ) + ROM_LOAD( "tw1ccrh.1d", 0x200000, 0x080000, CRC(ad17e693) SHA1(4f06dc82c03159894fb8e10383862920f94563b1) ) + ROM_REGION( 0x600000, REGION_USER1, 0 ) /* 3D model data */ + ROM_LOAD( "tw1ptrl0.18k", 0x000000, 0x080000, CRC(44ac5e86) SHA1(5e42db58f2e352c0fe5e49588a9283817dd15ab1) ) + ROM_LOAD( "tw1ptrl1.16k", 0x080000, 0x080000, CRC(3c769860) SHA1(19b32c3d262f2a9d07354fbd6ac6be97b05f176e) ) + ROM_LOAD( "tw1ptrl2.15k", 0x100000, 0x080000, CRC(6e94103c) SHA1(ee90b77939a9f5780ce271882133cdf977eb643e) ) + ROM_LOAD( "tw1ptrl3.14k", 0x180000, 0x080000, CRC(e3ce5eb2) SHA1(4e15a6f630be15eb017cd51c5e7901db3138a061) ) + ROM_LOAD( "tw1ptrm0.18j", 0x200000, 0x080000, CRC(e170cea2) SHA1(ca259508d76fdab97a9d0502f871f0e560e6c308) ) + ROM_LOAD( "tw1ptrm1.16j", 0x280000, 0x080000, CRC(36a32237) SHA1(f46851dc5c094810ddc42d56310a9f85908bf715) ) + ROM_LOAD( "tw1ptrm2.15j", 0x300000, 0x080000, CRC(c426c278) SHA1(64232ac3c1649e0d0adb4b03e58b8b5ea4013f83) ) + ROM_LOAD( "tw1ptrm3.14j", 0x380000, 0x080000, CRC(d9b9a651) SHA1(0c49a051526081149d894d629f19cb0f2b66a698) ) + ROM_LOAD( "tw1ptru0.18f", 0x400000, 0x080000, CRC(62a9e9fb) SHA1(24739adba029b0acf2d7078962c9d01098a29a6c) ) + ROM_LOAD( "tw1ptru1.16f", 0x480000, 0x080000, CRC(2fd36177) SHA1(368b915261d914be01ae9daeb52571bead52d14d) ) + ROM_LOAD( "tw1ptru2.15f", 0x500000, 0x080000, CRC(ceacb1c9) SHA1(b86cf576e16bbe26ad0d6d6df8bf28d0071c25e2) ) + ROM_LOAD( "tw1ptru3.14f", 0x580000, 0x080000, CRC(939044c2) SHA1(f4c1c0a1c2f07ca7f784d59ef4162a2a6a8bbc43) ) + ROM_REGION( 0x1000000, REGION_SOUND1, 0 ) /* C352 samples */ + ROM_LOAD( "tw1wavea.2l", 0x000000, 0x400000, CRC(ebce6366) SHA1(44ebe90ff3c7af5bebbf1baba3b7a2b1863daebb) ) + ROM_REGION( 0x2000, REGION_USER2, 0 ) /* default EEPROM */ + ROM_LOAD( "tokyowar_defaults.nv", 0x0000, 0x2000, CRC(e8bd7d09) SHA1(7e59017b9d5eb78984b4f177b50a4727ad72a623) ) +ROM_END - PORT_START /* EDGE */ - PORT_ANALOG( 0xffff, 0x8000, IPT_AD_STICK_Y|IPF_CENTER, 100, 4, 0x00, 0xffff ) -INPUT_PORTS_END +ROM_START( aquajet ) + ROM_REGION( 0x400000, REGION_CPU1, 0 ) /* main program */ + ROM_LOAD32_BYTE( "aj2verb.1", 0x000003, 0x100000, CRC(3a67b9f4) SHA1(8cd51f319e082297fdb99634486fe297a0ace654) ) + ROM_LOAD32_BYTE( "aj2verb.2", 0x000002, 0x100000, CRC(f5e8fc96) SHA1(e23fcf6f84724d1de15870ff578ff8a6b26e8f31) ) + ROM_LOAD32_BYTE( "aj2verb.3", 0x000001, 0x100000, CRC(ef6ebcf7) SHA1(358973b678b9a3065e945fb589af16e8102d437b) ) + ROM_LOAD32_BYTE( "aj2verb.4", 0x000000, 0x100000, CRC(7799b909) SHA1(e40005f96f51742b2778605926b8184c9b2c1ad2) ) + ROM_REGION16_LE( 0x080000, REGION_CPU4, 0 ) /* MCU */ + ROM_LOAD( "aj1data.8k", 0x000000, 0x080000, CRC(52bcc6d5) SHA1(25319ea6db35cc9bdcb39cc83d597a2a9f1690f3) ) + C71_BIOS + ROM_REGION( 0x1000000, REGION_GFX1, ROMREGION_ERASEFF ) /* 32x32x8bpp sprite tiles */ + ROM_LOAD( "aj1scg0.12f", 0x000000, 0x200000, CRC(13ea766c) SHA1(a1a259bd8f468b90cbc891f1c2875fe03bba9802) ) + ROM_LOAD( "aj1scg1.10f", 0x200000, 0x200000, CRC(cb3638de) SHA1(0af99aaf00782036d7f479b00b0c3d9d7ad4fc37) ) + ROM_LOAD( "aj1scg2.8f", 0x400000, 0x200000, CRC(1048a09b) SHA1(6859533e24db5ac54e28d480aaac7b411a648dfe) ) + ROM_REGION( 0x1000000, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ + ROM_LOAD( "aj1cg0.8d", 0x000000, 0x200000, CRC(b814e1eb) SHA1(1af29897dcfd0a58743b4fcdd5049d9e6e3d4cbd) ) + ROM_LOAD( "aj1cg1.10d", 0x200000, 0x200000, CRC(dc63d496) SHA1(d3c3eea6b134850004062dd513c0f26096101227) ) + ROM_LOAD( "aj1cg2.12d", 0x400000, 0x200000, CRC(71fbb571) SHA1(40f84ab5a4a7bb4438fb53751762609671d17800) ) + ROM_LOAD( "aj1cg3.13d", 0x600000, 0x200000, CRC(e28052e2) SHA1(3dbc446d7a13312ed4c1d20c2e1209947853f2c4) ) + ROM_LOAD( "aj1cg4.14d", 0x800000, 0x200000, CRC(c77ae1a0) SHA1(e15f2ccbadb8634f6e5cfd2cf48f428d68bd92e1) ) + ROM_LOAD( "aj1cg5.16d", 0xa00000, 0x200000, CRC(15be0080) SHA1(ca14dfd2a66996f0b32fa1155c04f21d300e8f30) ) + ROM_LOAD( "aj1cg6.18d", 0xc00000, 0x200000, CRC(1a4f733a) SHA1(60a991f06e73667fa2c9016189999c4301cba24f) ) + ROM_LOAD( "aj1cg7.19d", 0xe00000, 0x200000, CRC(ea118130) SHA1(24ef22e5c8c6f6e8a01c72466be1e7acbfba63bc) ) + ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ + ROM_LOAD( "aj1ccrl.3d", 0x000000, 0x200000, CRC(3cc7a247) SHA1(336e4dd506d932987e20a5890dd3b0db75c02ccf) ) + ROM_LOAD( "aj1ccrh.1d", 0x200000, 0x080000, CRC(9d936030) SHA1(a383bcca494a9f8d9a08fbe9940c8071d4525d65) ) + ROM_REGION( 0x600000, REGION_USER1, 0 ) /* 3D model data */ + ROM_LOAD( "aj1ptrl0.18k", 0x000000, 0x080000, CRC(16205d45) SHA1(7e9681af852e2e875f80cbbe350e4982eaf80884) ) + ROM_LOAD( "aj1ptrl1.16k", 0x080000, 0x080000, CRC(6f114da7) SHA1(a1e7349ef8eb0ef043fce06f88bfbb76c2967393) ) + ROM_LOAD( "aj1ptrl2.15k", 0x100000, 0x080000, CRC(719b73f0) SHA1(bf8530a706097ae663769090177f1f259c540aa6) ) + ROM_LOAD( "aj1ptrl3.14k", 0x180000, 0x080000, CRC(9555fe31) SHA1(03bdd0784817191b3600d643b775191181a21706) ) + ROM_LOAD( "aj1ptrm0.18j", 0x200000, 0x080000, CRC(89bee2e0) SHA1(d84b06ef1318814fcf4782fef09a85ae1a87beb8) ) + ROM_LOAD( "aj1ptrm1.16j", 0x280000, 0x080000, CRC(0ecf88c7) SHA1(20b7cb09a6a13599cac024ef19c73612ce2952f6) ) + ROM_LOAD( "aj1ptrm2.15j", 0x300000, 0x080000, CRC(829bc7ba) SHA1(7104d66a027911e38ecf521f01ff098ccb76d5fb) ) + ROM_LOAD( "aj1ptrm3.14j", 0x380000, 0x080000, CRC(7d0a222a) SHA1(e78c405d00429580015c6c7d1bcd35393317a769) ) + ROM_LOAD( "aj1ptru0.18f", 0x400000, 0x080000, CRC(90d4e36a) SHA1(bdc44aac6aef5266d289f03c816aa2abdb263e9b) ) + ROM_LOAD( "aj1ptru1.16f", 0x480000, 0x080000, CRC(bf0cf4bf) SHA1(bbf06c7605c083d2fb8c72528c5c9d3b8b067073) ) + ROM_LOAD( "aj1ptru2.15f", 0x500000, 0x080000, CRC(91ffbb77) SHA1(fbfe7d32ef22037f7190d1b8263b5e8c55f2d892) ) + ROM_LOAD( "aj1ptru3.14f", 0x580000, 0x080000, CRC(d83d8d42) SHA1(e1561ce4538b01db92b7e645ad008cd1a2ddaf8a) ) + ROM_REGION( 0x1000000, REGION_SOUND1, 0 ) /* C352 samples */ + ROM_LOAD( "aj1wavea.2l", 0x000000, 0x400000, CRC(8c72ea59) SHA1(3ae8dbd8baae08f1daab2b218932ba9d9451231d) ) + ROM_LOAD( "aj1waveb.1l", 0x800000, 0x400000, CRC(ab5a457f) SHA1(c34531fd574eb0c3e78fc31a9af8658df3446adc) ) + ROM_REGION( 0x2000, REGION_USER2, 0 ) /* default EEPROM */ + ROM_LOAD( "aquajet_defaults.nv", 0x0000, 0x2000, CRC(a00b3e44) SHA1(6bdbb46f4176314b61bd5063ecc968189212cb4c) ) +ROM_END -INPUT_PORTS_START( cybrcycc ) - PORT_START - PORT_DIPNAME( 0x0001, 0x0001, "DIP2-1 (test mode)" ) - PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0002, 0x0002, "DIP2-2" ) - PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0004, 0x0004, "DIP2-3" ) - PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0008, 0x0008, "DIP2-4" ) - PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0010, 0x0010, "DIP2-5" ) - PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0020, 0x0020, "DIP2-6" ) - PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0040, 0x0040, "DIP2-7" ) - PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0080, "DIP2-8" ) - PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0100, 0x0100, "DIP3-1" ) - PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0200, 0x0200, "DIP3-2" ) - PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0400, 0x0400, "DIP3-3" ) - PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0800, 0x0800, "DIP3-4" ) - PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x1000, 0x1000, "DIP3-5" ) - PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x2000, 0x2000, "DIP3-6" ) - PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x4000, 0x4000, "DIP3-7" ) - PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x8000, 0x8000, "DIP3-8 (test mode)" ) - PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) +ROM_START( alpinr2b ) + ROM_REGION( 0x800000, REGION_CPU1, 0 ) /* main program */ + ROM_LOAD32_BYTE( "ars2verb.2", 0x000003, 0x200000, CRC(ed977f83) SHA1(26c57cdfc15f799a999ee22f141e1c0cabfc91dc) ) + ROM_LOAD32_BYTE( "ars2verb.3", 0x000001, 0x200000, CRC(8e7a9983) SHA1(34c82e5f080efe04d6b77a77a8391cb48b69c1af) ) + ROM_LOAD32_BYTE( "ars2verb.4", 0x000002, 0x200000, CRC(610e49c2) SHA1(433c6d2216551bac31584306f748af1c912c3b07) ) + ROM_LOAD32_BYTE( "ars2verb.5", 0x000000, 0x200000, CRC(7f3517b0) SHA1(3e6ba1a51bf235f40f933aae1f00638b88bba522) ) + ROM_REGION16_LE( 0x080000, REGION_CPU4, 0 ) /* MCU */ + ROM_LOAD( "ars2data.8k", 0x000000, 0x080000, CRC(29b36dcb) SHA1(70fde130c11789c822829493a70ecefb077c0c15) ) + C71_BIOS + ROM_REGION( 0x1000000, REGION_GFX1, ROMREGION_ERASEFF ) /* 32x32x8bpp sprite tiles */ + ROM_LOAD( "ars1scg0.12f", 0x000000, 0x200000, CRC(bc49ed86) SHA1(289b39f2cb21c723dbe4ddd64ee4b2c5fa65c368) ) + ROM_REGION( 0x1000000, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ + ROM_LOAD( "ars1cg0.8d", 0x000000, 0x200000, CRC(74f4515c) SHA1(1e3a96281d543213d10c962b4d387c414d76e0c3) ) + ROM_LOAD( "ars1cg1.10d", 0x200000, 0x200000, CRC(329a95c1) SHA1(2cad7fd9e5ca7c64729ca2548ef4f873a0b8de64) ) + ROM_LOAD( "ars1cg2.12d", 0x400000, 0x200000, CRC(5648345a) SHA1(0dc7aedba65b7d97687a9e38a63597f16cee6179) ) + ROM_LOAD( "ars1cg3.13d", 0x600000, 0x200000, CRC(a752f205) SHA1(373b5a69e4488bc30763568ceae512ab7039f5f8) ) + ROM_LOAD( "ars1cg4.14d", 0x800000, 0x200000, CRC(54bf35b6) SHA1(aec43b66e7597ad7d113ae785417bf26164c1bca) ) + ROM_LOAD( "ars1cg5.16d", 0xa00000, 0x200000, CRC(e24a19a2) SHA1(34c1b51eea954ae3000602e550eb1cef0a10e651) ) + ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ + ROM_LOAD( "ars1ccrl.3d", 0x000000, 0x200000, CRC(fc8c9161) SHA1(ad0fcfae27e02d68a6f8d1d03c514dc2f12d9ee8) ) + ROM_LOAD( "ars1ccrh.1d", 0x200000, 0x080000, CRC(a17660bb) SHA1(bae2c3f20772c6cea99f271ee3f39b1f999038c6) ) + ROM_REGION( 0x600000, REGION_USER1, 0 ) /* 3D model data */ + ROM_LOAD( "ars1ptrl0.18k", 0x000000, 0x080000, CRC(f04e0e61) SHA1(d58a1d3ca1d0922e134db21a04feaee7dc97b020) ) + ROM_LOAD( "ars1ptrl1.16k", 0x080000, 0x080000, CRC(8bdb4970) SHA1(a504cd4beca4bedd1a7a228c83dd6b844ca3a1e0) ) + ROM_LOAD( "ars1ptrl2.15k", 0x100000, 0x080000, CRC(ec993a4f) SHA1(883f64e3e8d951415e9cef589c354eba9406c0aa) ) + ROM_LOAD( "ars1ptrl3.14k", 0x180000, 0x080000, CRC(4d453f3c) SHA1(7a82e5d8f974d9e56d0031b35e73647fe6aeec2e) ) + ROM_LOAD( "ars1ptrm0.18j", 0x200000, 0x080000, CRC(d1bdc524) SHA1(b898bb38de397551ada4da4677dd733bf8fa5010) ) + ROM_LOAD( "ars1ptrm1.16j", 0x280000, 0x080000, CRC(86b81c81) SHA1(45096abf46794f06a4b647f5e4222798d8467632) ) + ROM_LOAD( "ars1ptrm2.15j", 0x300000, 0x080000, CRC(24116b83) SHA1(41c6a880abce7b543c409fda767682b2537b0d99) ) + ROM_LOAD( "ars1ptrm3.14j", 0x380000, 0x080000, CRC(772bede3) SHA1(f9565b7a40f0bbf11081d619fe5a46feafce2e56) ) + ROM_LOAD( "ars1ptru0.18f", 0x400000, 0x080000, CRC(a4cf197a) SHA1(ee78cc259e87395df75179bbe5b6e521e762b582) ) + ROM_LOAD( "ars1ptru1.16f", 0x480000, 0x080000, CRC(1deb1fc0) SHA1(bfd1dfcaccf5a0f851b6757995fa7195452a3965) ) + ROM_LOAD( "ars1ptru2.15f", 0x500000, 0x080000, CRC(bcfad0ba) SHA1(bee7f2f9ecd2b289c6706e19fa86863913b286b5) ) + ROM_LOAD( "ars1ptru3.14f", 0x580000, 0x080000, CRC(73ce6958) SHA1(918b0fb0fca33dbe3be3ac679b8b28f58213f75b) ) + ROM_REGION( 0x1000000, REGION_SOUND1, 0 ) /* C352 samples */ + ROM_LOAD( "ars1wavea.2l", 0x000000, 0x400000, CRC(f8d107e9) SHA1(5c418691f0b35403553f21f5570eda8bbb66890f) ) + ROM_LOAD( "ars2waveb.1l", 0x800000, 0x400000, CRC(deab4ad1) SHA1(580ad88d516280baaf6cc92b2e07cdc0cfc486f3) ) + ROM_REGION( 0x2000, REGION_USER2, 0 ) /* default EEPROM */ + ROM_LOAD( "alpiner2_defaults.nv", 0x0000, 0x2000, CRC(1f21154e) SHA1(a141d7d235955d042c60d013a89619d35c02308f) ) +ROM_END - PORT_START /* 1:gas */ - PORT_ANALOG( 0xffff, 0x8000, IPT_AD_STICK_Y|IPF_CENTER|IPF_PLAYER1, 100, 4, 0x00, 0xffff ) +ROM_START( alpinr2a ) + ROM_REGION( 0x800000, REGION_CPU1, 0 ) /* main program */ + ROM_LOAD32_BYTE( "ars2vera.2", 0x000003, 0x200000, CRC(b07b15a4) SHA1(ea3b2d7b4ef4ccf3aafeef7e7eac92e8d446f4e7) ) + ROM_LOAD32_BYTE( "ars2vera.3", 0x000002, 0x200000, CRC(90a92e40) SHA1(bf8083256e56e7e33e61b4cdaf9fd03dabfb36ba) ) + ROM_LOAD32_BYTE( "ars2vera.4", 0x000001, 0x200000, CRC(9e9d771d) SHA1(6fb983e3f4f8233544667b1bbf87864e4fb8698c) ) + ROM_LOAD32_BYTE( "ars2vera.5", 0x000000, 0x200000, CRC(e93c7771) SHA1(305f35488a55be1b845702df972bba8334c0726c) ) + ROM_REGION16_LE( 0x080000, REGION_CPU4, 0 ) /* MCU */ + ROM_LOAD( "ars2data.8k", 0x000000, 0x080000, CRC(29b36dcb) SHA1(70fde130c11789c822829493a70ecefb077c0c15) ) + C71_BIOS + ROM_REGION( 0x1000000, REGION_GFX1, ROMREGION_ERASEFF ) /* 32x32x8bpp sprite tiles */ + ROM_LOAD( "ars1scg0.12f", 0x000000, 0x200000, CRC(bc49ed86) SHA1(289b39f2cb21c723dbe4ddd64ee4b2c5fa65c368) ) + ROM_REGION( 0x1000000, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ + ROM_LOAD( "ars1cg0.8d", 0x000000, 0x200000, CRC(74f4515c) SHA1(1e3a96281d543213d10c962b4d387c414d76e0c3) ) + ROM_LOAD( "ars1cg1.10d", 0x200000, 0x200000, CRC(329a95c1) SHA1(2cad7fd9e5ca7c64729ca2548ef4f873a0b8de64) ) + ROM_LOAD( "ars1cg2.12d", 0x400000, 0x200000, CRC(5648345a) SHA1(0dc7aedba65b7d97687a9e38a63597f16cee6179) ) + ROM_LOAD( "ars1cg3.13d", 0x600000, 0x200000, CRC(a752f205) SHA1(373b5a69e4488bc30763568ceae512ab7039f5f8) ) + ROM_LOAD( "ars1cg4.14d", 0x800000, 0x200000, CRC(54bf35b6) SHA1(aec43b66e7597ad7d113ae785417bf26164c1bca) ) + ROM_LOAD( "ars1cg5.16d", 0xa00000, 0x200000, CRC(e24a19a2) SHA1(34c1b51eea954ae3000602e550eb1cef0a10e651) ) + ROM_REGION( 0x280000, REGION_GFX3, 0 ) /* texture tilemap */ + ROM_LOAD( "ars1ccrl.3d", 0x000000, 0x200000, CRC(fc8c9161) SHA1(ad0fcfae27e02d68a6f8d1d03c514dc2f12d9ee8) ) + ROM_LOAD( "ars1ccrh.1d", 0x200000, 0x080000, CRC(a17660bb) SHA1(bae2c3f20772c6cea99f271ee3f39b1f999038c6) ) + ROM_REGION( 0x600000, REGION_USER1, 0 ) /* 3D model data */ + ROM_LOAD( "ars1ptrl0.18k", 0x000000, 0x080000, CRC(f04e0e61) SHA1(d58a1d3ca1d0922e134db21a04feaee7dc97b020) ) + ROM_LOAD( "ars1ptrl1.16k", 0x080000, 0x080000, CRC(8bdb4970) SHA1(a504cd4beca4bedd1a7a228c83dd6b844ca3a1e0) ) + ROM_LOAD( "ars1ptrl2.15k", 0x100000, 0x080000, CRC(ec993a4f) SHA1(883f64e3e8d951415e9cef589c354eba9406c0aa) ) + ROM_LOAD( "ars1ptrl3.14k", 0x180000, 0x080000, CRC(4d453f3c) SHA1(7a82e5d8f974d9e56d0031b35e73647fe6aeec2e) ) + ROM_LOAD( "ars1ptrm0.18j", 0x200000, 0x080000, CRC(d1bdc524) SHA1(b898bb38de397551ada4da4677dd733bf8fa5010) ) + ROM_LOAD( "ars1ptrm1.16j", 0x280000, 0x080000, CRC(86b81c81) SHA1(45096abf46794f06a4b647f5e4222798d8467632) ) + ROM_LOAD( "ars1ptrm2.15j", 0x300000, 0x080000, CRC(24116b83) SHA1(41c6a880abce7b543c409fda767682b2537b0d99) ) + ROM_LOAD( "ars1ptrm3.14j", 0x380000, 0x080000, CRC(772bede3) SHA1(f9565b7a40f0bbf11081d619fe5a46feafce2e56) ) + ROM_LOAD( "ars1ptru0.18f", 0x400000, 0x080000, CRC(a4cf197a) SHA1(ee78cc259e87395df75179bbe5b6e521e762b582) ) + ROM_LOAD( "ars1ptru1.16f", 0x480000, 0x080000, CRC(1deb1fc0) SHA1(bfd1dfcaccf5a0f851b6757995fa7195452a3965) ) + ROM_LOAD( "ars1ptru2.15f", 0x500000, 0x080000, CRC(bcfad0ba) SHA1(bee7f2f9ecd2b289c6706e19fa86863913b286b5) ) + ROM_LOAD( "ars1ptru3.14f", 0x580000, 0x080000, CRC(73ce6958) SHA1(918b0fb0fca33dbe3be3ac679b8b28f58213f75b) ) + ROM_REGION( 0x1000000, REGION_SOUND1, 0 ) /* C352 samples */ + ROM_LOAD( "ars1wavea.2l", 0x000000, 0x400000, CRC(f8d107e9) SHA1(5c418691f0b35403553f21f5570eda8bbb66890f) ) + ROM_LOAD( "ars2waveb.1l", 0x800000, 0x400000, CRC(deab4ad1) SHA1(580ad88d516280baaf6cc92b2e07cdc0cfc486f3) ) + ROM_REGION( 0x2000, REGION_USER2, 0 ) /* default EEPROM */ + ROM_LOAD( "alpiner2_defaults.nv", 0x0000, 0x2000, CRC(1f21154e) SHA1(a141d7d235955d042c60d013a89619d35c02308f) ) +ROM_END - PORT_START /* 2:brake */ - PORT_ANALOG( 0xffff, 0x8000, IPT_AD_STICK_Y|IPF_CENTER|IPF_PLAYER2, 100, 4, 0x00, 0xffff ) +ROM_START( adillor ) + ROM_REGION( 0x400000, REGION_CPU1, 0 ) /* main program */ + ROM_LOAD32_BYTE( "am2vera.rom1", 0x000003, 0x100000, CRC(b974e931) SHA1(db1c99ed56044f667a9a0a5801f62215004af847) ) + ROM_LOAD32_BYTE( "am2vera.rom2", 0x000002, 0x100000, CRC(c7cd78f1) SHA1(2f909be1c9a9acf42a8e446c83a06b3b36012196) ) + ROM_LOAD32_BYTE( "am2vera.rom3", 0x000001, 0x100000, CRC(80e9435a) SHA1(d92f6ec607e628270ceb3e09c1980d6e13bd88a7) ) + ROM_LOAD32_BYTE( "am2vera.rom4", 0x000000, 0x100000, CRC(1e3a6032) SHA1(f4c6539a78f94ae2c240aeb8f85712a612933e8c) ) + ROM_REGION16_LE( 0x080000, REGION_CPU4, 0 ) /* MCU */ + ROM_LOAD( "am1data.8k", 0x000000, 0x080000, CRC(3c176589) SHA1(fabf8debfa118893449f6086986fd1aa012daf27) ) + C71_BIOS + ROM_REGION( 0x1000000, REGION_GFX1, ROMREGION_ERASEFF ) /* 32x32x8bpp sprite tiles */ + ROM_LOAD( "am1scg0.12f", 0x000000, 0x200000, CRC(e576f993) SHA1(704645c2b2af4d3f6b77f2299cd7277837e204d2) ) + ROM_LOAD( "am1scg1.10f", 0x200000, 0x200000, CRC(d6d26cc1) SHA1(1da35ec2f89cfc5778d81b6a892fcf100d6e9933) ) + ROM_REGION( 0x1000000, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ + ROM_LOAD( "am1cg0.8d", 0x000000, 0x200000, CRC(b91e4259) SHA1(3de7fee2be9843ef6a8718f9dcbc3aeb1fb23b64) ) + ROM_LOAD( "am1cg1.10d", 0x200000, 0x200000, CRC(c1b82a26) SHA1(25dc3cdf5fe18de89e6d7304ff76b6157aba2cd6) ) + ROM_LOAD( "am1cg2.12d", 0x400000, 0x200000, CRC(36a7d3fd) SHA1(f07bb746f775d1eb70c4b6a65e6002d2136cfe4d) ) + ROM_LOAD( "am1cg3.13d", 0x600000, 0x200000, CRC(8b0857ef) SHA1(1c86db318d7bb7bc303ba65a9db493b033035d7b) ) + ROM_LOAD( "am1cg4.14d", 0x800000, 0x200000, CRC(ebc516fe) SHA1(585554f14cfdf69a89a6431867b7cfc1a9eae379) ) + ROM_LOAD( "am1cg5.16d", 0xa00000, 0x200000, CRC(30fad30d) SHA1(bb0d9e2b479d83cc38ffd76d0d55f06dca0f304a) ) + ROM_LOAD( "am1cg6.18d", 0xc00000, 0x200000, CRC(62eea883) SHA1(37e441bb1289e45ef3043f70f77646c15b6dff0e) ) + ROM_LOAD( "am1cg7.19d", 0xe00000, 0x200000, CRC(2d257f47) SHA1(6406556b4b142b6c596eb25f407275a63f6a44f1) ) + ROM_REGION( 0x300000, REGION_GFX3, 0 ) /* texture tilemap */ + ROM_LOAD( "am1ccrl.3d", 0x000000, 0x200000, CRC(76c6d5f3) SHA1(637efe30d004a9c42864b7536e02e9805ed9b6ef) ) + ROM_LOAD( "am1ccrh.1d", 0x200000, 0x080000, CRC(180c4a33) SHA1(5e0818ba8a135c51953bc3bc5c4a1475f7f93eff) ) + ROM_REGION( 0x600000, REGION_USER1, 0 ) /* 3D model data */ + ROM_LOAD( "am1ptrl0.18k", 0x000000, 0x080000, CRC(6fdb34f6) SHA1(5dc7359eef0dbe6d421808eefd3920159ce34944) ) + ROM_LOAD( "am1ptrl1.16k", 0x080000, 0x080000, CRC(32e40601) SHA1(161b148aae688e944cfe456d9bca1ca7139812e1) ) + ROM_LOAD( "am1ptrl2.15k", 0x100000, 0x080000, CRC(e27e29cc) SHA1(3a2b0d18d23b2ace6fe1c6c4dbcc73cb74acd189) ) + ROM_LOAD( "am1ptrl3.14k", 0x180000, 0x080000, CRC(0c638e3e) SHA1(2cd68e6aa04a9235f792fad0913314545ab70e71) ) + ROM_LOAD( "am1ptrm0.18j", 0x200000, 0x080000, CRC(e676cd98) SHA1(f7b31c848bc2afc31f3ad53d9eda7daae5f28865) ) + ROM_LOAD( "am1ptrm1.16j", 0x280000, 0x080000, CRC(eb115d9d) SHA1(165cb13a3d0f2982c35ae5e6e796de48cf2b5846) ) + ROM_LOAD( "am1ptrm2.15j", 0x300000, 0x080000, CRC(86b4ed0c) SHA1(d97f2b26cc3981b4b337029723c5ddec9316628f) ) + ROM_LOAD( "am1ptrm3.14j", 0x380000, 0x080000, CRC(97c1c6b0) SHA1(84e5f982f50560debd6f1f4d3d96f58888616529) ) + ROM_LOAD( "am1ptru0.18f", 0x400000, 0x080000, CRC(6a3fd855) SHA1(c6d2029e676426c4e71d9cfddbac7ecdec81c4da) ) + ROM_LOAD( "am1ptru1.16f", 0x480000, 0x080000, CRC(551bf714) SHA1(4af1e65ad1e42a95accafb57422fc276743f408a) ) + ROM_LOAD( "am1ptru2.15f", 0x500000, 0x080000, CRC(ce790635) SHA1(fb49646a9b35ee7cb3ace59a7f0932a08c393052) ) + ROM_LOAD( "am1ptru3.14f", 0x580000, 0x080000, CRC(5e4e6333) SHA1(5897251e4694c5c24f1810ff6f9177a0456baf2e) ) + ROM_REGION( 0x1000000, REGION_SOUND1, 0 ) /* C352 samples */ + ROM_LOAD16_WORD_SWAP( "am1wavea.2l", 0x000000, 0x400000, CRC(48f8c20c) SHA1(48b4fbcb7e9dbbb70a542ef7cb7ee0e46fad23fc) ) + ROM_LOAD16_WORD_SWAP( "am1waveb.1l", 0x800000, 0x400000, CRC(fd8e7384) SHA1(91e53ab0293f81f8357645fd319249abc128b78e) ) +ROM_END - PORT_START /* 3:steering */ - PORT_ANALOG( 0xffff, 0x8000, IPT_AD_STICK_X|IPF_CENTER, 100, 4, 0x00, 0xffff ) - - PORT_START /* 4 */ - PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 ) /* stick shift down */ - PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 ) /* stick shift up */ - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) /* view */ - PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_COIN2 ) /* (unused) */ - PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_SERVICE1 ) - PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_COIN1 ) - PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_TILT ) /* motion stop (unused) */ -INPUT_PORTS_END - -INPUT_PORTS_START( propcycl ) - PORT_START /* DIP4 */ - PORT_DIPNAME( 0x01, 0x01, "DIP1" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, "DIP2" ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, "DIP3" ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, "DIP4" ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, "DIP5" ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, "DIP6" ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, "DIP7" ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, "DIP8" ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) - PORT_BITX(0x08, IP_ACTIVE_HIGH, IPT_SERVICE|IPF_TOGGLE, DEF_STR( Service_Mode ), KEYCODE_F2, IP_JOY_NONE ) /* good */ - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - - PORT_START - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START1 ) - -/* PORT_START*/ -/* PORT_ANALOG( 0xffff, 0x8000, IPT_AD_STICK_X|IPF_CENTER, 100, 4, 0x00, 0xffff )*/ - -/* PORT_START*/ -/* PORT_ANALOG( 0xffff, 0x8000, IPT_AD_STICK_Y|IPF_CENTER, 100, 4, 0x00, 0xffff )*/ -INPUT_PORTS_END - -INPUT_PORTS_START( victlap ) - PORT_START /* 0: DIP2 and DIP3 */ - PORT_DIPNAME( 0x0001, 0x0001, "DIP2-1" ) - PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0002, 0x0002, "DIP2-2" ) - PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0004, 0x0004, "DIP2-3" ) - PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0008, 0x0008, "DIP2-4" ) - PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0010, 0x0010, "DIP2-5" ) - PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0020, 0x0020, "DIP2-6" ) - PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0040, 0x0040, "DIP2-7" ) - PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0080, "DIP2-8" ) - PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0100, 0x0100, "DIP3-1" ) - PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0200, 0x0200, "DIP3-2" ) - PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0400, 0x0400, "DIP3-3" ) - PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0800, 0x0800, "DIP3-4" ) - PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x1000, 0x1000, "DIP3-5" ) - PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x2000, 0x2000, "DIP3-6" ) - PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x4000, 0x4000, "DIP3-7 (TEST MODE)" ) - PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x8000, 0x8000, "DIP3-8" ) - PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - - PORT_START /* 1:gas */ - PORT_ANALOG( 0xffff, 0x8000, IPT_AD_STICK_Y|IPF_CENTER|IPF_PLAYER1, 100, 4, 0x00, 0xffff ) - - PORT_START /* 2:brake */ - PORT_ANALOG( 0xffff, 0x8000, IPT_AD_STICK_Y|IPF_CENTER|IPF_PLAYER2, 100, 4, 0x00, 0xffff ) - - PORT_START /* 3:steering */ - PORT_ANALOG( 0xffff, 0x8000, IPT_AD_STICK_X|IPF_CENTER, 100, 4, 0x00, 0xffff ) - - PORT_START /* 4 */ - PORT_DIPNAME( 0x0001, 0x0001, "DIP4-1 (Shift=Down)" ) - PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0002, 0x0002, "DIP4-2 (Shift=Up)" ) - PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0004, 0x0004, "DIP4-3 (unused)" ) - PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0008, 0x0008, "DIP4-4" ) - PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0010, 0x0010, "DIP4-5" ) - PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0020, 0x0020, "DIP4-6" ) - PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0040, 0x0040, "DIP4-7 (PREV) View" ) - PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0080, "DIP4-8 (NEXT)" ) - PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0100, 0x0100, "DIP4-9 (CHOOSE)" ) - PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0200, 0x0200, "DIP4-A (Coin2)" ) - PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0400, 0x0400, "DIP4-B" ) - PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0800, 0x0800, "DIP4-C (Service)" ) - PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x1000, 0x1000, "DIP4-D (Coin1)" ) - PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x2000, 0x2000, "DIP4-E" ) - PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x4000, 0x4000, "DIP4-F" ) - PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x8000, 0x8000, "DIP4-10 (Motion Stop)" ) - PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) -INPUT_PORTS_END +ROM_START( adillorj ) + ROM_REGION( 0x400000, REGION_CPU1, 0 ) /* main program */ + ROM_LOAD32_BYTE( "am1vera.rom1", 0x000003, 0x100000, CRC(e99157f9) SHA1(7a200f3b5890f5badbf529a8c8ac6a8548adb801) ) + ROM_LOAD32_BYTE( "am1vera.rom2", 0x000002, 0x100000, CRC(b63d79b0) SHA1(c83251727b2973f5b9dc2eea23b51b1275bd88ed) ) + ROM_LOAD32_BYTE( "am1vera.rom3", 0x000001, 0x100000, CRC(af0983bc) SHA1(136d2e14485864e20d7a6947d640577b8a85243c) ) + ROM_LOAD32_BYTE( "am1vera.rom4", 0x000000, 0x100000, CRC(4424047f) SHA1(d0ca736c085db58d33b603813b7a54c8ce995bac) ) + ROM_REGION16_LE( 0x080000, REGION_CPU4, 0 ) /* MCU */ + ROM_LOAD( "am1data.8k", 0x000000, 0x080000, CRC(3c176589) SHA1(fabf8debfa118893449f6086986fd1aa012daf27) ) + C71_BIOS + ROM_REGION( 0x1000000, REGION_GFX1, ROMREGION_ERASEFF ) /* 32x32x8bpp sprite tiles */ + ROM_LOAD( "am1scg0.12f", 0x000000, 0x200000, CRC(e576f993) SHA1(704645c2b2af4d3f6b77f2299cd7277837e204d2) ) + ROM_LOAD( "am1scg1.10f", 0x200000, 0x200000, CRC(d6d26cc1) SHA1(1da35ec2f89cfc5778d81b6a892fcf100d6e9933) ) + ROM_REGION( 0x1000000, REGION_GFX2, 0 ) /* 16x16x8bpp texture tiles */ + ROM_LOAD( "am1cg0.8d", 0x000000, 0x200000, CRC(b91e4259) SHA1(3de7fee2be9843ef6a8718f9dcbc3aeb1fb23b64) ) + ROM_LOAD( "am1cg1.10d", 0x200000, 0x200000, CRC(c1b82a26) SHA1(25dc3cdf5fe18de89e6d7304ff76b6157aba2cd6) ) + ROM_LOAD( "am1cg2.12d", 0x400000, 0x200000, CRC(36a7d3fd) SHA1(f07bb746f775d1eb70c4b6a65e6002d2136cfe4d) ) + ROM_LOAD( "am1cg3.13d", 0x600000, 0x200000, CRC(8b0857ef) SHA1(1c86db318d7bb7bc303ba65a9db493b033035d7b) ) + ROM_LOAD( "am1cg4.14d", 0x800000, 0x200000, CRC(ebc516fe) SHA1(585554f14cfdf69a89a6431867b7cfc1a9eae379) ) + ROM_LOAD( "am1cg5.16d", 0xa00000, 0x200000, CRC(30fad30d) SHA1(bb0d9e2b479d83cc38ffd76d0d55f06dca0f304a) ) + ROM_LOAD( "am1cg6.18d", 0xc00000, 0x200000, CRC(62eea883) SHA1(37e441bb1289e45ef3043f70f77646c15b6dff0e) ) + ROM_LOAD( "am1cg7.19d", 0xe00000, 0x200000, CRC(2d257f47) SHA1(6406556b4b142b6c596eb25f407275a63f6a44f1) ) + ROM_REGION( 0x300000, REGION_GFX3, 0 ) /* texture tilemap */ + ROM_LOAD( "am1ccrl.3d", 0x000000, 0x200000, CRC(76c6d5f3) SHA1(637efe30d004a9c42864b7536e02e9805ed9b6ef) ) + ROM_LOAD( "am1ccrh.1d", 0x200000, 0x080000, CRC(180c4a33) SHA1(5e0818ba8a135c51953bc3bc5c4a1475f7f93eff) ) + ROM_REGION( 0x600000, REGION_USER1, 0 ) /* 3D model data */ + ROM_LOAD( "am1ptrl0.18k", 0x000000, 0x080000, CRC(6fdb34f6) SHA1(5dc7359eef0dbe6d421808eefd3920159ce34944) ) + ROM_LOAD( "am1ptrl1.16k", 0x080000, 0x080000, CRC(32e40601) SHA1(161b148aae688e944cfe456d9bca1ca7139812e1) ) + ROM_LOAD( "am1ptrl2.15k", 0x100000, 0x080000, CRC(e27e29cc) SHA1(3a2b0d18d23b2ace6fe1c6c4dbcc73cb74acd189) ) + ROM_LOAD( "am1ptrl3.14k", 0x180000, 0x080000, CRC(0c638e3e) SHA1(2cd68e6aa04a9235f792fad0913314545ab70e71) ) + ROM_LOAD( "am1ptrm0.18j", 0x200000, 0x080000, CRC(e676cd98) SHA1(f7b31c848bc2afc31f3ad53d9eda7daae5f28865) ) + ROM_LOAD( "am1ptrm1.16j", 0x280000, 0x080000, CRC(eb115d9d) SHA1(165cb13a3d0f2982c35ae5e6e796de48cf2b5846) ) + ROM_LOAD( "am1ptrm2.15j", 0x300000, 0x080000, CRC(86b4ed0c) SHA1(d97f2b26cc3981b4b337029723c5ddec9316628f) ) + ROM_LOAD( "am1ptrm3.14j", 0x380000, 0x080000, CRC(97c1c6b0) SHA1(84e5f982f50560debd6f1f4d3d96f58888616529) ) + ROM_LOAD( "am1ptru0.18f", 0x400000, 0x080000, CRC(6a3fd855) SHA1(c6d2029e676426c4e71d9cfddbac7ecdec81c4da) ) + ROM_LOAD( "am1ptru1.16f", 0x480000, 0x080000, CRC(551bf714) SHA1(4af1e65ad1e42a95accafb57422fc276743f408a) ) + ROM_LOAD( "am1ptru2.15f", 0x500000, 0x080000, CRC(ce790635) SHA1(fb49646a9b35ee7cb3ace59a7f0932a08c393052) ) + ROM_LOAD( "am1ptru3.14f", 0x580000, 0x080000, CRC(5e4e6333) SHA1(5897251e4694c5c24f1810ff6f9177a0456baf2e) ) + ROM_REGION( 0x1000000, REGION_SOUND1, 0 ) /* C352 samples */ + ROM_LOAD16_WORD_SWAP( "am1wavea.2l", 0x000000, 0x400000, CRC(48f8c20c) SHA1(48b4fbcb7e9dbbb70a542ef7cb7ee0e46fad23fc) ) + ROM_LOAD16_WORD_SWAP( "am1waveb.1l", 0x800000, 0x400000, CRC(fd8e7384) SHA1(91e53ab0293f81f8357645fd319249abc128b78e) ) +ROM_END -INPUT_PORTS_START( ridgera ) - PORT_START /* 0: DIP2 and DIP3 */ - PORT_DIPNAME( 0x0001, 0x0001, "DIP2-1" ) - PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0002, 0x0002, "DIP2-2" ) - PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0004, 0x0004, "DIP2-3" ) - PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0008, 0x0008, "DIP2-4" ) - PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0010, 0x0010, "DIP2-5" ) - PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0020, 0x0020, "DIP2-6" ) - PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0040, 0x0040, "DIP2-7" ) - PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0080, "DIP2-8" ) - PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0100, 0x0100, "DIP3-1" ) - PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0200, 0x0200, "DIP3-2" ) - PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0400, 0x0400, "DIP3-3" ) - PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0800, 0x0800, "DIP3-4" ) - PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x1000, 0x1000, "DIP3-5" ) - PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x2000, 0x2000, "DIP3-6" ) - PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x4000, 0x4000, "DIP3-7 (TEST MODE)" ) - PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x8000, 0x8000, "DIP3-8" ) - PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) +/*************************************************************************** + Driver inits +***************************************************************************/ - PORT_START /* 1:gas */ - PORT_ANALOG( 0xffff, 0x8000, IPT_AD_STICK_Y|IPF_CENTER|IPF_PLAYER1, 100, 4, 0x00, 0xffff ) +/* C352 outputs to the stereo stream, as current MAME maps each game's + speakers: rear speakers to the near side, speakers in the middle of the + cabinet (tank, road, seat) to both sides, subwoofers and bass shakers + (LFE) nowhere. 0x100 = 1.0 */ +enum { C352_FRONT, C352_REAR, C352_OUT2_CENTER, C352_OUT3_CENTER_HALF, C352_OUT3_CENTER }; - PORT_START /* 2:brake */ - PORT_ANALOG( 0xffff, 0x8000, IPT_AD_STICK_Y|IPF_CENTER|IPF_PLAYER2, 100, 4, 0x00, 0xffff ) - - PORT_START /* 3:steering */ - PORT_ANALOG( 0xffff, 0x8000, IPT_AD_STICK_X|IPF_CENTER, 100, 4, 0x00, 0xffff ) - - PORT_START /* 4 */ - PORT_DIPNAME( 0x0001, 0x0001, "DIP4-1 (Shift=Down)" ) - PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0002, 0x0002, "DIP4-2 (Shift=Up)" ) - PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0004, 0x0004, "DIP4-3 (unused)" ) - PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0008, 0x0008, "DIP4-4" ) - PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0010, 0x0010, "DIP4-5" ) - PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0020, 0x0020, "DIP4-6" ) - PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0040, 0x0040, "DIP4-7 (PREV) View" ) - PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0080, "DIP4-8 (NEXT)" ) - PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0100, 0x0100, "DIP4-9 (CHOOSE)" ) - PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0200, 0x0200, "DIP4-A (Coin2)" ) - PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0400, 0x0400, "DIP4-B" ) - PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0800, 0x0800, "DIP4-C (Service)" ) - PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x1000, 0x1000, "DIP4-D (Coin1)" ) - PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x2000, 0x2000, "DIP4-E" ) - PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x4000, 0x4000, "DIP4-F" ) - PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x8000, 0x8000, "DIP4-10 (Motion Stop)" ) - PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) -INPUT_PORTS_END - -INPUT_PORTS_START( raveracw ) - PORT_START - PORT_DIPNAME( 0x0001, 0x0001, "DIP2-1" ) - PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0002, 0x0002, "DIP2-2" ) - PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0004, 0x0004, "DIP2-3" ) - PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0008, 0x0008, "DIP2-4" ) - PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0010, 0x0010, "DIP2-5" ) - PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0020, 0x0020, "DIP2-6" ) - PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0040, 0x0040, "DIP2-7" ) - PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0080, "DIP2-8" ) - PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0100, 0x0100, "DIP3-1 (dump memory)" ) - PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0200, 0x0200, "DIP3-2" ) - PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0400, 0x0400, "DIP3-3" ) - PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0800, 0x0800, "DIP3-4" ) /* screen flip? */ - PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x1000, 0x1000, "DIP3-5" ) - PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x2000, 0x2000, "DIP3-6" ) - PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x4000, 0x4000, "DIP3-7" ) - PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x8000, 0x8000, "DIP3-8 (test mode)" ) - PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - - PORT_START /* 1:gas */ - PORT_ANALOG( 0xffff, 0x8000, IPT_AD_STICK_Y|IPF_CENTER|IPF_PLAYER1, 100, 4, 0x00, 0xffff ) - - PORT_START /* 2:brake */ - PORT_ANALOG( 0xffff, 0x8000, IPT_AD_STICK_Y|IPF_CENTER|IPF_PLAYER2, 100, 4, 0x00, 0xffff ) - - PORT_START /* 3:steering */ - PORT_ANALOG( 0xffff, 0x8000, IPT_AD_STICK_X|IPF_CENTER, 100, 4, 0x00, 0xffff ) - - PORT_START /* 4 */ - PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 ) /* stick shift down */ - PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 ) /* stick shift up */ - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) /* view */ - PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_COIN2 ) /* (unused) */ - PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_SERVICE1 ) - PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_COIN1 ) - PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_TILT ) /* motion stop (unused) */ -INPUT_PORTS_END - -INPUT_PORTS_START( cybrcomm ) - PORT_START - PORT_DIPNAME( 0x0001, 0x0001, "DIP2-1" ) - PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0002, 0x0002, "DIP2-2" ) - PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0004, 0x0004, "DIP2-3" ) - PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0008, 0x0008, "DIP2-4" ) - PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0010, 0x0010, "DIP2-5" ) - PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0020, 0x0020, "DIP2-6" ) - PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0040, 0x0040, "DIP2-7" ) - PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0080, "DIP2-8" ) - PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0100, 0x0100, "DIP3-1" ) - PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0200, 0x0200, "DIP3-2" ) - PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0400, 0x0400, "DIP3-3 (TEST MODE)" ) - PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0800, 0x0800, "DIP3-4" ) - PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x1000, 0x1000, "DIP3-5" ) - PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x2000, 0x2000, "DIP3-6" ) - PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x4000, 0x4000, "DIP3-7" ) - PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x8000, 0x8000, "DIP3-8" ) - PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) -INPUT_PORTS_END - -INPUT_PORTS_START( timecris ) - PORT_START - PORT_DIPNAME( 0x0001, 0x0001, "DIP2-1" ) - PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0002, 0x0002, "DIP2-2" ) - PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0004, 0x0004, "DIP2-3" ) - PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0008, 0x0008, "DIP2-4" ) - PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0010, 0x0010, "DIP2-5" ) - PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0020, 0x0020, "DIP2-6" ) - PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0040, 0x0040, "DIP2-7" ) - PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0080, "DIP2-8" ) - PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0100, 0x0100, "DIP3-1 (dump memory)" ) - PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0200, 0x0200, "DIP3-2" ) - PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0400, 0x0400, "DIP3-3" ) - PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0800, 0x0800, "DIP3-4" ) /* screen flip? */ - PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x1000, 0x1000, "DIP3-5" ) - PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x2000, 0x2000, "DIP3-6" ) - PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x4000, 0x4000, "DIP3-7" ) - PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x8000, 0x8000, "DIP3-8 (test mode)" ) - PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - - PORT_START /* 1:gas */ - PORT_ANALOG( 0xffff, 0x8000, IPT_AD_STICK_Y|IPF_CENTER|IPF_PLAYER1, 100, 4, 0x00, 0xffff ) - - PORT_START /* 2:brake */ - PORT_ANALOG( 0xffff, 0x8000, IPT_AD_STICK_Y|IPF_CENTER|IPF_PLAYER2, 100, 4, 0x00, 0xffff ) - - PORT_START /* 3:steering */ - PORT_ANALOG( 0xffff, 0x8000, IPT_AD_STICK_X|IPF_CENTER, 100, 4, 0x00, 0xffff ) - - PORT_START /* 4 */ - PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 ) /* stick shift down */ - PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 ) /* stick shift up */ - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) /* view */ - PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_COIN2 ) /* (unused) */ - PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_SERVICE1 ) - PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_COIN1 ) - PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_TILT ) /* motion stop (unused) */ -INPUT_PORTS_END - -/*****************************************************************************************************/ - -/** - * helper function for FixQuads - */ -static unsigned -GetPolyData( unsigned addr ) +static void c352_routing(int mode) { - size_t ptRomSize = memory_region_length(REGION_GFX4)/3; - data8_t *pPolyL = memory_region(REGION_GFX4); - data8_t *pPolyM = pPolyL + ptRomSize; - data8_t *pPolyH = pPolyM + ptRomSize; - return (pPolyH[addr]*256+pPolyM[addr])*256+pPolyL[addr]; -} - -/** - * helper function for FixQuads - */ -static void PutPolyData( unsigned addr, unsigned data ) -{ - size_t ptRomSize = memory_region_length(REGION_GFX4)/3; - data8_t *pPolyL = memory_region(REGION_GFX4); - data8_t *pPolyM = pPolyL + ptRomSize; - data8_t *pPolyH = pPolyM + ptRomSize; - /* log_cb(RETRO_LOG_DEBUG, LOGPRE "%08x: %02x\n", addr, pPolyM[addr]^((data>>8)&0xff) ); */ - pPolyH[addr] = data>>16; - pPolyM[addr] = (data>>8)&0xff; - pPolyL[addr] = data&0xff; -} - -/** - * helper function called from DecryptPointROMs - * - * This routine walks a polygon definition, and applies a heuristic to the middle byte of each X/Y/Z coordinate. - * We look at the sign of the most significant byte. If it is negative, we fill the middle byte with 0xff. - * If it is positive, we fill the middle byte with 0x00. - * - * This is a crude "fix" at best. But it preserves the most significant and least significant bytes, - * and avoids absurdly-sized polygons which make scenes unrecognizable. - */ -static void -FixQuads( INT32 *pIndex ) -{ - int i; - INT32 addr = *pIndex; - INT32 size = GetPolyData(addr++); - - *pIndex = addr+(size&0xff); - - while( addr<*pIndex ) + int route[4][2]; + memset(route, 0, sizeof(route)); + route[0][0] = 0x100; + route[1][1] = 0x100; + switch (mode) { - size = GetPolyData(addr++); - size &= 0xff; - - switch( size ) - { - case 0x0d: - break; - - case 0x10: - break; - - case 0x17: - for( i=3+8; i<3+12+8; i++ ) - { - UINT32 data = GetPolyData(addr+i); - if( data&0x800000 ) data |= 0x00ff00; else data &= 0xff00ff; /* replace middle byte with -1 or 0 */ - PutPolyData( addr+i, data ); - } - break; - - case 0x18: - for( i=4+8; i<4+12+8; i++ ) - { - UINT32 data = GetPolyData(addr+i); - if( data&0x800000 ) data |= 0x00ff00; else data &= 0xff00ff; /* replace middle byte with -1 or 0 */ - PutPolyData( addr+i, data ); - } - break; - - default: - exit(1); - break; - } - addr += size; + case C352_REAR: route[2][0] = 0x100; route[3][1] = 0x100; break; + case C352_OUT2_CENTER: route[2][0] = route[2][1] = 0x100; break; + case C352_OUT3_CENTER_HALF: route[3][0] = route[3][1] = 0x80; break; + case C352_OUT3_CENTER: route[3][0] = route[3][1] = 0x100; break; } + c352_set_routing((const int (*)[2])route); } -/** - * Alpine Racer is working for the most part, except that the middle byte of each 24 bit value in - * Point ROMs is often scrambled. If you attempt to render scenes using the value "as-is" you get - * distorted polygons/textures or worse. - * - * The following routine walks through point ROM data, and applies several heuristics to help - * correct the data. It's far from perfect, but still 100% better than using the raw values. - * This stuff could probably be hand corrected, especially if a "polygon viewer" program were written - * for use on the main CPU, and someone were willing to collect a lot of screenshots. But it's - * a lot of trouble. - */ -static void -DecryptPointROMs( void ) +/* System 22: the C74 (internal BIOS) plays the sound, the I/O board is simulated */ +static void s22_init(int gametype) { - int i; - int prev = 0xe00; - /* walk the lookup tables in the Point ROM headers, and assume that it always increments. */ - for( i = 0x45; i<0xe2d; i++ ) + namcos22_common_init(gametype, 0); + c352_routing(gametype == NAMCOS22_CYBER_COMMANDO ? C352_REAR : C352_FRONT); + m37710_set_io_handlers(mcu_s22_io_r, mcu_s22_io_w); + m37710_set_internal_rom(memory_region(REGION_USER4)); + /* the C74 BIOS (NSTX7702 v1.00) waits for its timer in "lda $81 / beq" */ + if (MCU_SPEEDUP) m37710_set_idle_loop(C74_IDLE, 2); + state_save_register_UINT32("namcos22", 0, "credits1", &credits1, 1); + state_save_register_UINT32("namcos22", 0, "credits2", &credits2, 1); + state_save_register_int("namcos22", 0, "old_coin_state", &old_coin_state); +} + +/* Super System 22: the S22-BIOS ver1.20/1.30 and SS22-BIOS ver1.41 MCU + programs wait for their interrupts in "lda $83 / beq" */ +#define BIOS_130 0xc128 +#define BIOS_141 0xc12b + +static void ss22_init(int gametype, UINT32 idle_pc) +{ + namcos22_common_init(gametype, 1); + switch (gametype) { - int iNext = GetPolyData(i)&0xff; - if( (iNext&0xff)<=(prev&0xff) ) - { - prev += 0x100; - } - prev = (prev&0xffff00)|(iNext&0xff); - PutPolyData( i, prev ); + case NAMCOS22_CYBER_CYCLES: + case NAMCOS22_AQUA_JET: c352_routing(C352_OUT2_CENTER); break; /* "tank" speaker */ + case NAMCOS22_DIRT_DASH: c352_routing(C352_OUT3_CENTER_HALF); break; /* "road" speaker at 0.5 */ + case NAMCOS22_TOKYO_WARS: c352_routing(C352_OUT3_CENTER); break; /* seat speaker (the bass shaker is LFE) */ + default: c352_routing(C352_FRONT); break; /* airco22b: the subwoofer is LFE */ } + if (MCU_SPEEDUP) + m37710_set_idle_loop(idle_pc, 2); +} - /* process each polygon */ +static void alpine_init(int gametype, UINT32 idle_pc) +{ + ss22_init(gametype, idle_pc); + set_adc_ports(PORT_ADC0, PORT_ADC0 + 1, -1, -1); + alpine_motor = 1; + alpine_motor_status = 2; /* steps locked */ + alpine_motor_timer = timer_alloc(alpine_steplock); + state_save_register_UINT8("namcos22", 0, "alpine_motor", &alpine_motor_status, 1); +} + +static DRIVER_INIT( ridgerac ) { s22_init(NAMCOS22_RIDGE_RACER); } +static DRIVER_INIT( ridgera2 ) { s22_init(NAMCOS22_RIDGE_RACER2); } +static DRIVER_INIT( raverace ) { s22_init(NAMCOS22_RAVE_RACER); } +static DRIVER_INIT( acedrive ) { s22_init(NAMCOS22_ACE_DRIVER); } +static DRIVER_INIT( victlap ) { s22_init(NAMCOS22_VICTORY_LAP); } +static DRIVER_INIT( cybrcomm ) { s22_init(NAMCOS22_CYBER_COMMANDO); } + +static DRIVER_INIT( timecris ) +{ + ss22_init(NAMCOS22_TIME_CRISIS, BIOS_130); + install_mem_read32_handler(0, 0x430000, 0x43000f, timecris_gun_r); +} + +static void propcycl_common(void) +{ + ss22_init(NAMCOS22_PROP_CYCLE, BIOS_141); + set_adc_ports(PORT_ADC0, PORT_ADC0 + 1, -1, -1); + pedal_pulse_timer = timer_alloc(pedal_pulse); + pedal_update_timer = timer_alloc(pedal_update); + timer_adjust(pedal_update_timer, TIME_IN_MSEC(20), 0, TIME_IN_MSEC(20)); +} + +static DRIVER_INIT( propcycl ) +{ + propcycl_common(); + /* HACK (MAME): patch out a strange routine (uninitialized EEPROM related?) */ + ((data32_t *)memory_region(REGION_CPU1))[0x1992c / 4] = 0x4e754e75; +} + +static DRIVER_INIT( propcyclj ) +{ + propcycl_common(); + ((data32_t *)memory_region(REGION_CPU1))[0x1990a / 4] = 0x4e754e75; +} + +static DRIVER_INIT( alpiner ) { alpine_init(NAMCOS22_ALPINE_RACER, BIOS_130); } +static DRIVER_INIT( alpiner2 ) { alpine_init(NAMCOS22_ALPINE_RACER_2, BIOS_130); } + +static DRIVER_INIT( alpines ) +{ + alpine_init(NAMCOS22_ALPINE_SURFER, BIOS_141); + install_mem_read32_handler(0, 0x200000, 0x3fffff, alpines_bank_r); + install_mem_write32_handler(0, 0x300000, 0x300003, alpines_bank_w); + alpines_bank = 0; + state_save_register_int("namcos22", 0, "alpines_bank", &alpines_bank); +} + +static DRIVER_INIT( airco22 ) +{ + ss22_init(NAMCOS22_AIR_COMBAT22, BIOS_130); /* S22-BIOS ver1.20 */ + set_adc_ports(PORT_ADC0, PORT_ADC0 + 1, -1, -1); + /* the throttle stick centers at 0x200: one pedal pushes it, the other pulls it */ + set_adc(2, 0x200, PORT_ADC0 + 2, PORT_ADC0 + 3); +} + +static DRIVER_INIT( cybrcycc ) +{ + ss22_init(NAMCOS22_CYBER_CYCLES, BIOS_130); + set_adc_ports(PORT_ADC0, PORT_ADC0 + 1, PORT_ADC0 + 2, -1); +} + +static DRIVER_INIT( dirtdash ) +{ + ss22_init(NAMCOS22_DIRT_DASH, BIOS_141); + set_adc_ports(PORT_ADC0, PORT_ADC0 + 1, PORT_ADC0 + 2, -1); +} + +static DRIVER_INIT( tokyowar ) +{ + ss22_init(NAMCOS22_TOKYO_WARS, BIOS_141); + set_adc_ports(PORT_ADC0, -1, PORT_ADC0 + 1, PORT_ADC0 + 2); +} + +static DRIVER_INIT( aquajet ) +{ + ss22_init(NAMCOS22_AQUA_JET, BIOS_141); + set_adc_ports(PORT_ADC0, -1, PORT_ADC0 + 2, -1); + set_adc(1, 0x1fc, -1, PORT_ADC0 + 1); /* 0x1fc released, 0x0e0 full */ +} + +static DRIVER_INIT( adillor ) +{ + int axis; + ss22_init(NAMCOS22_ARMADILLO_RACING, BIOS_141); + for (axis = 0; axis < 2; axis++) { - INT32 iFinish = GetPolyData(3); - INT32 iDest = GetPolyData(0x45); - INT32 iIndex = GetPolyData(iDest); - INT32 iMaster = 0x45; - while( iIndex 0 ) - { - PutPolyData( iDest++, iIndex ); - FixQuads( &iIndex ); - if( iIndex>=iFinish ) break; - } - PutPolyData( iDest++, 0xffffff ); - iMaster++; - } + trackball_pulse_timer[axis] = timer_alloc(trackball_pulse); + trackball_count[axis] = 0; + trackball_residual[axis] = 0; } - - /* the following patch hand-corrects the polygon used for the title screen */ - PutPolyData( 0x0077d0+13, 0xfffd80 ); - PutPolyData( 0x0077d0+14, 0x0001e0 ); - PutPolyData( 0x0077d0+15, 0x000000 ); - - PutPolyData( 0x0077d0+16, 0x000280 ); - PutPolyData( 0x0077d0+17, 0x0001e0 ); - PutPolyData( 0x0077d0+18, 0x000000 ); - - PutPolyData( 0x0077d0+19, 0x000280 ); - PutPolyData( 0x0077d0+20, 0xfffe20 ); - PutPolyData( 0x0077d0+21, 0x000000 ); - - PutPolyData( 0x0077d0+22, 0xfffd80 ); - PutPolyData( 0x0077d0+23, 0xfffe20 ); - PutPolyData( 0x0077d0+24, 0x000000 ); + trackball_update_timer = timer_alloc(trackball_update); + timer_adjust(trackball_update_timer, TIME_IN_MSEC(20), 0, TIME_IN_MSEC(20)); + state_save_register_UINT32("namcos22", 0, "trackball_count", trackball_count, 2); + state_save_register_INT32("namcos22", 0, "trackball_residual", trackball_residual, 2); } -DRIVER_INIT( alpiner ) -{ - namcos22_gametype = NAMCOS22_ALPINE_RACER; - DecryptPointROMs(); -} -/*****************************************************************************************************/ +/*************************************************************************** + Game drivers +***************************************************************************/ -DRIVER_INIT( airco22 ) -{ /* patch DSP RAM test */ - data32_t *pROM = (data32_t *)memory_region(REGION_CPU1); - pROM[0x6d74/4] &= 0x0000ffff; - pROM[0x6d74/4] |= 0x4e710000; - - namcos22_gametype = NAMCOS22_AIR_COMBAT22; - /* int1 writes 0x700005 */ - /* int2 writes 0x700007 */ - /* int3 writes 0x700006 */ - /* int4 700004, 700014, proc */ - /* int5 rte */ - /* int6 700004, 700014, proc */ - /* int7 rte */ -} - -DRIVER_INIT( propcycl ) -{ - data32_t *pROM = (data32_t *)memory_region(REGION_CPU1); - - /* patch out protection */ - pROM[0x1992C/4] = 0x4E754E75; - - /** - * The dipswitch reading routine in Prop Cycle polls the - * dipswitch value, but promptly overwrites with zero, discarding - * it. - * - * By patching out this behavior, we expose an additional "secret" test. - * - * DIP5: real time display of "INST_CUNT, MODE_NUM, MODE_CUNT" - */ - pROM[0x22296/4] &= 0xffff0000; - pROM[0x22296/4] |= 0x00004e75; - - namcos22_gametype = NAMCOS22_PROP_CYCLE; -} - -DRIVER_INIT( ridgeraj ) -{ - namcos22_gametype = NAMCOS22_RIDGE_RACER; -} - -DRIVER_INIT( ridger2j ) -{ - namcos22_gametype = NAMCOS22_RIDGE_RACER; -} - -DRIVER_INIT( acedrvr ) -{ - namcos22_gametype = NAMCOS22_ACE_DRIVER; -} - -DRIVER_INIT( victlap ) -{ - namcos22_gametype = NAMCOS22_VICTORY_LAP; -} - -DRIVER_INIT( raveracw ) -{ - namcos22_gametype = NAMCOS22_RAVE_RACER; -} - -DRIVER_INIT( cybrcomm ) -{ - data32_t *pROM = (data32_t *)memory_region(REGION_CPU1); - pROM[0x18ade8/4] = 0x4e714e71; - pROM[0x18ae38/4] = 0x4e714e71; - pROM[0x18ae80/4] = 0x4e714e71; - pROM[0x18aec8/4] = 0x4e714e71; - pROM[0x18aefc/4] = 0x4e714e71; - - namcos22_gametype = NAMCOS22_CYBER_COMMANDO; -} - -DRIVER_INIT( cybrcyc ) -{ /* patch DSP RAM test */ - data32_t *pROM = (data32_t *)memory_region(REGION_CPU1); - pROM[0x355C/4] &= 0x0000ffff; - pROM[0x355C/4] |= 0x4e710000; - - namcos22_gametype = NAMCOS22_CYBER_CYCLES; -} - -DRIVER_INIT( timecris ) -{ - namcos22_gametype = NAMCOS22_TIME_CRISIS; -} - -/* YEAR, NAME, PARENT, MACHINE, INPUT, INIT, MNTR, COMPANY, FULLNAME, FLAGS */ -/* System22 games */ -GAMEX( 1995, cybrcomm, 0, namcos22, cybrcomm, cybrcomm, ROT0, "Namco", "Cyber Commando (Rev. CY1, Japan)" , GAME_NO_SOUND|GAME_NOT_WORKING ) /* almost */ -GAMEX( 1995, raveracw, 0, namcos22, raveracw, raveracw, ROT0, "Namco", "Rave Racer (Rev. RV2, World)" , GAME_NO_SOUND|GAME_NOT_WORKING ) /* almost */ -GAMEX( 1993, ridgeraj, 0, namcos22, ridgera, ridgeraj, ROT0, "Namco", "Ridge Racer (Rev. RR1, Japan)" , GAME_NO_SOUND|GAME_NOT_WORKING ) /* ? */ -GAMEX( 1994, ridger2j, 0, namcos22, ridgera, ridger2j, ROT0, "Namco", "Ridge Racer 2 (Rev. RRS1, Japan)" , GAME_NO_SOUND|GAME_NOT_WORKING ) /* ? */ -GAMEX( 1994, acedrvrw, 0, namcos22, victlap, acedrvr, ROT0, "Namco", "Ace Driver (Rev. AD2, World)" , GAME_NO_SOUND|GAME_NOT_WORKING ) /* almost */ -GAMEX( 1996, victlapw, 0, namcos22, victlap, victlap, ROT0, "Namco", "Ace Driver - Victory Lap (Rev. ADV2, World)", GAME_NO_SOUND|GAME_NOT_WORKING ) /* almost */ - -/* Super System22 games */ -GAMEX( 1995, airco22b, 0, namcos22s, victlap, airco22, ROT0, "Namco", "Air Combat 22 (Rev. ACS1 Ver.B)" , GAME_NO_SOUND|GAME_NOT_WORKING ) /* almost */ -GAMEX( 1995, alpinerd, 0, namcos22s, alpiner, alpiner, ROT0, "Namco", "Alpine Racer (Rev. AR2 Ver.D)" , GAME_NO_SOUND|GAME_NOT_WORKING ) /* encrypted gfx */ -GAMEX( 1995, alpinerc, alpinerd, namcos22s, alpiner, alpiner, ROT0, "Namco", "Alpine Racer (Rev. AR2 Ver.C)" , GAME_NO_SOUND|GAME_NOT_WORKING ) /* encrypted gfx */ -GAMEX( 1995, cybrcycc, 0, namcos22s, cybrcycc, cybrcyc, ROT0, "Namco", "Cyber Cycles (Rev. CB2 Ver.C)" , GAME_NO_SOUND|GAME_NOT_WORKING ) /* almost */ -/*GAMEX( 1995, dirtdshx, "Dirt Dash")*/ -GAMEX( 1995, timecrsa, 0, namcos22s, timecris, timecris, ROT0, "Namco", "Time Crisis (Rev. TS2 Ver.A)" , GAME_NO_SOUND|GAME_NOT_WORKING ) /* locks up */ -/*GAMEX( 1995, timecris, 0, namcos22s, timecris, timecris, ROT0, "Namco", "Time Crisis (Rev. TS2 Ver.B)" , GAME_NO_SOUND|GAME_NOT_WORKING )*/ -GAMEX( 1996, propcycl, 0, namcos22s, propcycl, propcycl, ROT0, "Namco", "Prop Cycle (Rev PR2 Ver.A)" , GAME_NO_SOUND|GAME_IMPERFECT_GRAPHICS ) -/*GAMEX( 1996, tokyowrx, "Tokyo Wars")*/ -/*GAMEX( 1996, alpinr2x, "Alpine Racer 2")*/ -/*GAMEX( 1996, alpinesx, "Alpine Surfer")*/ -/*GAMEX( 1996, aquajetx, "Aqua Jet")*/ -/*GAMEX( 1997, armdilox, "Armidillo Racing")*/ -/*GAMEX( 199?, downhbkx, "Downhill Bikers")*/ +/* YEAR, NAME, PARENT, MACHINE, INPUT, INIT, MONITOR, COMPANY, FULLNAME, FLAGS */ +GAMEX( 1994, namcoc74, 0, namcos22, ridgera2, 0, ROT0, "Namco", "Namco C74 BIOS", NOT_A_DRIVER ) +GAMEX( 1993, ridgerac, namcoc74, namcos22, ridgera, ridgerac, ROT0, "Namco", "Ridge Racer (World, RR2 Ver.B)", GAME_IMPERFECT_GRAPHICS ) +GAMEX( 1993, ridgeraca, ridgerac, namcos22, ridgera, ridgerac, ROT0, "Namco", "Ridge Racer (World, RR2)", GAME_IMPERFECT_GRAPHICS ) +GAMEX( 1993, ridgeracb, ridgerac, namcos22, ridgera, ridgerac, ROT0, "Namco", "Ridge Racer (US, RR3 Ver.B)", GAME_IMPERFECT_GRAPHICS ) +GAMEX( 1993, ridgeracc, ridgerac, namcos22, ridgera, ridgerac, ROT0, "Namco", "Ridge Racer (US, RR3)", GAME_IMPERFECT_GRAPHICS ) +GAMEX( 1993, ridgeracj, ridgerac, namcos22, ridgera, ridgerac, ROT0, "Namco", "Ridge Racer (Japan, RR1)", GAME_IMPERFECT_GRAPHICS ) +GAMEX( 1994, ridgera2, namcoc74, namcos22, ridgera2, ridgera2, ROT0, "Namco", "Ridge Racer 2 (World, RRS2)", GAME_IMPERFECT_GRAPHICS ) +GAMEX( 1994, ridgera2j, ridgera2, namcos22, ridgera2, ridgera2, ROT0, "Namco", "Ridge Racer 2 (Japan, RRS1 Ver.B)", GAME_IMPERFECT_GRAPHICS ) +GAMEX( 1994, ridgera2ja, ridgera2, namcos22, ridgera2, ridgera2, ROT0, "Namco", "Ridge Racer 2 (Japan, RRS1)", GAME_IMPERFECT_GRAPHICS ) +GAMEX( 1994, ridgera28, ridgera2, namcos22, ridgera2, ridgera2, ROT0, "Namco", "Ridge Racer 2 (World, RRS8)", GAME_IMPERFECT_GRAPHICS ) +GAMEX( 1994, cybrcomm, namcoc74, namcos22, cybrcomm, cybrcomm, ROT0, "Namco", "Cyber Commando (Japan, CY1)", GAME_IMPERFECT_GRAPHICS ) +GAMEX( 1995, raverace, namcoc74, namcos22, raverace, raverace, ROT0, "Namco", "Rave Racer (World, RV2 Ver.B)", GAME_IMPERFECT_GRAPHICS ) +GAMEX( 1995, raveracej, raverace, namcos22, raverace, raverace, ROT0, "Namco", "Rave Racer (Japan, RV1 Ver.B)", GAME_IMPERFECT_GRAPHICS ) +GAMEX( 1995, raveraceja, raverace, namcos22, raverace, raverace, ROT0, "Namco", "Rave Racer (Japan, RV1)", GAME_IMPERFECT_GRAPHICS ) +GAMEX( 1994, acedrive, namcoc74, namcos22, acedrive, acedrive, ROT0, "Namco", "Ace Driver (World, AD2)", GAME_IMPERFECT_GRAPHICS ) +GAMEX( 1996, victlap, namcoc74, namcos22, acedrive, victlap, ROT0, "Namco", "Ace Driver: Victory Lap (World, ADV2 Ver.B)", GAME_IMPERFECT_GRAPHICS ) +GAMEX( 1996, victlapa, victlap, namcos22, acedrive, victlap, ROT0, "Namco", "Ace Driver: Victory Lap (World, ADV2)", GAME_IMPERFECT_GRAPHICS ) +GAMEX( 1996, victlapj, victlap, namcos22, acedrive, victlap, ROT0, "Namco", "Ace Driver: Victory Lap (Japan, ADV1 Ver.C)", GAME_IMPERFECT_GRAPHICS ) +GAMEX( 1994, alpinerd, 0, namcos22s, alpiner, alpiner, ROT0, "Namco", "Alpine Racer (World, AR2 Ver.D)", GAME_IMPERFECT_GRAPHICS ) +GAMEX( 1994, alpinerc, alpinerd, namcos22s, alpiner, alpiner, ROT0, "Namco", "Alpine Racer (World, AR2 Ver.C)", GAME_IMPERFECT_GRAPHICS ) +GAMEX( 1994, alpinerjc, alpinerd, namcos22s, alpiner, alpiner, ROT0, "Namco", "Alpine Racer (Japan, AR1 Ver.C)", GAME_IMPERFECT_GRAPHICS ) +GAMEX( 1995, airco22b, 0, namcos22s, airco22, airco22, ROT0, "Namco", "Air Combat 22 (Japan, ACS1 Ver.B)", GAME_IMPERFECT_GRAPHICS ) +GAMEX( 1995, cybrcycc, 0, namcos22s, cybrcycc, cybrcycc, ROT0, "Namco", "Cyber Cycles (World, CB2 Ver.C)", GAME_IMPERFECT_GRAPHICS ) +GAMEX( 1995, cybrcyccj, cybrcycc, namcos22s, cybrcycc, cybrcycc, ROT0, "Namco", "Cyber Cycles (Japan, CB1 Ver.C)", GAME_IMPERFECT_GRAPHICS ) +GAMEX( 1995, dirtdash, 0, namcos22s, dirtdash, dirtdash, ROT0, "Namco", "Dirt Dash (World, DT2 Ver.C)", GAME_IMPERFECT_GRAPHICS ) +GAMEX( 1995, dirtdasha, dirtdash, namcos22s, dirtdash, dirtdash, ROT0, "Namco", "Dirt Dash (World, DT2 Ver.A)", GAME_IMPERFECT_GRAPHICS ) +GAMEX( 1995, dirtdashb, dirtdash, namcos22s, dirtdash, dirtdash, ROT0, "Namco", "Dirt Dash (World, DT2 Ver.B)", GAME_IMPERFECT_GRAPHICS ) +GAMEX( 1995, dirtdashj, dirtdash, namcos22s, dirtdash, dirtdash, ROT0, "Namco", "Dirt Dash (Japan, DT1 Ver.A)", GAME_IMPERFECT_GRAPHICS ) +GAMEX( 1996, timecris, 0, namcos22s, timecris, timecris, ROT0, "Namco", "Time Crisis (World, TS2 Ver.B)", GAME_IMPERFECT_GRAPHICS ) +GAMEX( 1996, timecrisa, timecris, namcos22s, timecris, timecris, ROT0, "Namco", "Time Crisis (World, TS2 Ver.A)", GAME_IMPERFECT_GRAPHICS ) +GAMEX( 1996, timecrisj, timecris, namcos22s, timecris, timecris, ROT0, "Namco", "Time Crisis (Japan, TS1 Ver.B)", GAME_IMPERFECT_GRAPHICS ) +GAMEX( 1996, propcycl, 0, namcos22s, propcycl, propcycl, ROT0, "Namco", "Prop Cycle (World, PR2 Ver.A)", GAME_IMPERFECT_GRAPHICS ) +GAMEX( 1996, propcyclj, propcycl, namcos22s, propcycl, propcyclj, ROT0, "Namco", "Prop Cycle (Japan, PR1 Ver.A)", GAME_IMPERFECT_GRAPHICS ) +GAMEX( 1996, alpines, 0, namcos22s, alpines, alpines, ROT0, "Namco", "Alpine Surfer (World, AF2 Ver.A)", GAME_IMPERFECT_GRAPHICS ) +GAMEX( 1996, tokyowar, 0, namcos22s, tokyowar, tokyowar, ROT0, "Namco", "Tokyo Wars (World, TW2 Ver.A)", GAME_IMPERFECT_GRAPHICS ) +GAMEX( 1996, tokyowarj, tokyowar, namcos22s, tokyowar, tokyowar, ROT0, "Namco", "Tokyo Wars (Japan, TW1 Ver.A)", GAME_IMPERFECT_GRAPHICS ) +GAMEX( 1996, aquajet, 0, namcos22s, aquajet, aquajet, ROT0, "Namco", "Aqua Jet (World, AJ2 Ver.B)", GAME_IMPERFECT_GRAPHICS ) +GAMEX( 1996, alpinr2b, 0, namcos22s, alpiner, alpiner2, ROT0, "Namco", "Alpine Racer 2 (World, ARS2 Ver.B)", GAME_IMPERFECT_GRAPHICS ) +GAMEX( 1996, alpinr2a, alpinr2b, namcos22s, alpiner, alpiner2, ROT0, "Namco", "Alpine Racer 2 (World, ARS2 Ver.A)", GAME_IMPERFECT_GRAPHICS ) +GAMEX( 1997, adillor, 0, namcos22s, adillor, adillor, ROT0, "Namco", "Armadillo Racing (World, AM2 Ver.A)", GAME_IMPERFECT_GRAPHICS ) +GAMEX( 1997, adillorj, adillor, namcos22s, adillor, adillor, ROT0, "Namco", "Armadillo Racing (Japan, AM1 Ver.A)", GAME_IMPERFECT_GRAPHICS ) diff --git a/src/includes/namcos22.h b/src/includes/namcos22.h index 375916d9..740b7a6b 100644 --- a/src/includes/namcos22.h +++ b/src/includes/namcos22.h @@ -1,7 +1,16 @@ -#include "driver.h" -#include "vidhrdw/generic.h" +/*************************************************************************** -extern enum namcos22_gametype + Namco System 22 / Super System 22 + + Backported from current MAME (Phil Stroffolino, hap, R. Belmont and + others, BSD-3-Clause). + +***************************************************************************/ + +#ifndef NAMCOS22_H +#define NAMCOS22_H + +enum { NAMCOS22_AIR_COMBAT22, NAMCOS22_ALPINE_RACER, @@ -10,38 +19,70 @@ extern enum namcos22_gametype NAMCOS22_PROP_CYCLE, NAMCOS22_RAVE_RACER, NAMCOS22_RIDGE_RACER, + NAMCOS22_RIDGE_RACER2, NAMCOS22_TIME_CRISIS, NAMCOS22_VICTORY_LAP, - NAMCOS22_ACE_DRIVER -} namcos22_gametype; + NAMCOS22_ACE_DRIVER, + NAMCOS22_ALPINE_RACER_2, + NAMCOS22_ALPINE_SURFER, + NAMCOS22_TOKYO_WARS, + NAMCOS22_AQUA_JET, + NAMCOS22_DIRT_DASH, + NAMCOS22_ARMADILLO_RACING +}; -#define NAMCOS22_NUM_ROWS 30 -#define NAMCOS22_NUM_COLS 40 -#define NAMCOS22_ALPHA_GFX 1 +/* big endian views of the 32-bit RAMs (stored as native data32_t) */ +#define NTHBYTE32(base, n) (((base)[(n) >> 2] >> (8 * (~(n) & 3))) & 0xff) +#define NTHWORD32(base, n) (((base)[(n) >> 1] >> (16 * (~(n) & 1))) & 0xffff) -#define NAMCOS22_PALETTE_SIZE 0x8000 +#define SIGNED12(v) ((INT32)((UINT32)(v) << 20) >> 20) +#define SIGNED18(v) ((INT32)((UINT32)(v) << 14) >> 14) +#define SIGNED24(v) ((INT32)((UINT32)(v) << 8) >> 8) -extern data32_t *namcos22_cgram; -extern data32_t *namcos22_textram; -extern data32_t *namcos22_polygonram; -extern data32_t *namcos22_gamma; - -READ32_HANDLER( namcos22_cgram_r ); -WRITE32_HANDLER( namcos22_cgram_w ); - -READ32_HANDLER( namcos22_paletteram_r ); -WRITE32_HANDLER( namcos22_paletteram_w ); - -READ32_HANDLER( namcos22_textram_r ); -WRITE32_HANDLER( namcos22_textram_w ); - -READ32_HANDLER( namcos22_gamma_r ); -WRITE32_HANDLER( namcos22_gamma_w ); - -READ32_HANDLER( namcos22_dspram_r ); -WRITE32_HANDLER( namcos22_dspram_w ); - -VIDEO_UPDATE( namcos22 ); +/* drivers/namcos22.c */ +extern int namcos22_gametype; +extern int namcos22_is_ss22; +extern data32_t *namcos22_polygonram; /* 0x8000 dwords, 24 bits connected */ +extern data32_t *namcos22_spriteram; +extern data32_t *namcos22_vics_data; +extern data32_t *namcos22_vics_control; +extern data32_t *namcos22_mixer; +extern data32_t *namcos22_paletteram; +extern data32_t *namcos22_cgram; /* text layer tiles; the tilemap is at 0x1e000 */ +extern data32_t *namcos22_czram; /* System 22 */ +extern data16_t *namcos22_shareram; +extern data8_t *namcos22_gamma_proms; /* System 22 */ +extern int namcos22_pdp_render_done; +extern int namcos22_render_refresh; +extern int namcos22_slave_simulation_active; +extern UINT32 namcos22_pdp_frame; +extern INT32 namcos22_point_read(offs_t offs); +extern void namcos22_pdp_handle_commands(UINT16 offs); +extern UINT8 namcos22_syscontrol[0x20]; +extern int namcos22_irq_enabled, namcos22_irq_state; +/* vidhrdw/namcos22_vidhrdw.c */ VIDEO_START( namcos22s ); +VIDEO_START( namcos22 ); VIDEO_UPDATE( namcos22s ); +VIDEO_UPDATE( namcos22 ); +VIDEO_STOP( namcos22 ); +int namcos22_video_threads_available(void); +void namcos22_video_reset(void); +void namcos22_draw_direct_poly(const UINT16 *src); + +WRITE32_HANDLER( namcos22_paletteram_w ); +WRITE32_HANDLER( namcos22_cgram_w ); +READ32_HANDLER( namcos22_tilemapattr_r ); +WRITE32_HANDLER( namcos22_tilemapattr_w ); +READ32_HANDLER( namcos22s_czattr_r ); +WRITE32_HANDLER( namcos22s_czattr_w ); +READ32_HANDLER( namcos22s_czram_r ); +WRITE32_HANDLER( namcos22s_czram_w ); +READ32_HANDLER( namcos22s_spotram_r ); +WRITE32_HANDLER( namcos22s_spotram_w ); +READ32_HANDLER( namcos22s_vics_control_r ); +WRITE32_HANDLER( namcos22s_vics_control_w ); +WRITE32_HANDLER( namcos22s_chipselect_w ); + +#endif diff --git a/src/mame.h b/src/mame.h index 21788cb1..77964531 100644 --- a/src/mame.h +++ b/src/mame.h @@ -229,7 +229,7 @@ struct GameOptions bool sh3_dynarec; /* 1 to let drivers enable the SH-3 recompiler */ int tx1_screens; /* TX-1 / Buggy Boy: 3 screens side by side, or 1 (the middle one) */ bool sh2_dynarec; /* 1 to let drivers enable the SH-2 recompiler */ - int stv_video_threads; /* ST-V: threads drawing the VDP2 screen in bands (0 or 1 = the main thread only) */ + int stv_video_threads; /* ST-V, Namco System 22: threads drawing the screen in bands (0 or 1 = the main thread only) */ bool use_alt_sound; /* 1 to enable alternate ost samples */ float brightness; /* brightness of the display */ diff --git a/src/mame2003/core_options.c b/src/mame2003/core_options.c index 8bb01bb6..7dce4eb0 100644 --- a/src/mame2003/core_options.c +++ b/src/mame2003/core_options.c @@ -817,9 +817,9 @@ static struct retro_core_option_v2_definition option_def_sh2_dynarec = { static struct retro_core_option_v2_definition option_def_stv_video_threads = { APPNAME"_stv_video_threads", - "ST-V Threaded Video", + "Threaded Video", NULL, - "Draw the ST-V screen in horizontal bands on several threads (same picture, faster on multi-core hosts).", + "ST-V and Namco System 22: draw the screen in horizontal bands on several threads (same picture, faster on multi-core hosts).", NULL, NULL, { @@ -1654,6 +1654,13 @@ void set_content_flags(void) options.content_flags[CONTENT_STV_VIDEO_THREADS] = true; } #endif +#if (HAS_NAMCOC71) + { + extern int namcos22_video_threads_available(void); + if (game_driver->source_file && strstr(game_driver->source_file, "namcos22.c") && namcos22_video_threads_available()) + options.content_flags[CONTENT_STV_VIDEO_THREADS] = true; + } +#endif /************ DRIVERS WITH MULTIPLE BIOS OPTIONS ************/ #ifndef SPLIT_CORE diff --git a/src/sound/c352.c b/src/sound/c352.c index 1ad93adf..95ceae2d 100644 --- a/src/sound/c352.c +++ b/src/sound/c352.c @@ -18,7 +18,8 @@ mame2003-plus: backported from current MAME (c352.cpp) to the 0.78 sound interface. Only the front (L/R) outputs are mixed, as on - System 12 where the second DAC is not populated. + System 12 where the second DAC is not populated, unless the driver + asks for a routing of the four outputs (c352_set_routing). */ #include @@ -177,12 +178,94 @@ static INLINE INT16 c352_clamp(int val) return val; } +/* optional four output routing (see c352.h); set before the sound starts */ +static int c352_route_pending[4][2]; +static int c352_routed; +static int c352_route[4][2]; +static int c352_gain[4]; + +void c352_set_routing(const int route[4][2]) +{ + memcpy(c352_route_pending, route, sizeof(c352_route_pending)); +} + +void c352_set_output_gain(int output, int gain) +{ + if (output < 0 || output > 3) + return; + if (c352.stream) + stream_update(c352.stream, 0); + c352_gain[output] = gain; +} + +static void c352_update_routed(INT16 **buffer, int length) +{ + INT16 *bufl = buffer[0]; + INT16 *bufr = buffer[1]; + int i, j, n; + + for (i = 0; i < length; i++) + { + int out[4] = { 0, 0, 0, 0 }; + int l = 0, r = 0; + + for (j = 0; j < 32; j++) + { + c352_voice_t *v = &c352.v[j]; + INT16 s = 0; + + if (V_FLAGS(v) & C352_FLG_BUSY) + { + INT32 next_counter = v->counter + V_FREQ(v); + + if (next_counter & 0x10000) + c352_fetch_sample(v); + + if ((next_counter ^ v->counter) & 0x18000) + { + c352_ramp_volume(v, 0, V_VOL_F(v) >> 8); + c352_ramp_volume(v, 1, V_VOL_F(v) & 0xff); + c352_ramp_volume(v, 2, V_VOL_R(v) >> 8); + c352_ramp_volume(v, 3, V_VOL_R(v) & 0xff); + } + + v->counter = next_counter & 0xffff; + + s = v->sample; + + if ((V_FLAGS(v) & C352_FLG_FILTER) == 0) + s = v->last_sample + (INT32)(((INT64)v->counter * (v->sample - v->last_sample)) >> 16); + } + + out[0] += (((V_FLAGS(v) & C352_FLG_PHASEFL) ? -s : s) * v->curr_vol[0]) >> 8; + out[2] += (((V_FLAGS(v) & C352_FLG_PHASERL) ? -s : s) * v->curr_vol[2]) >> 8; + out[1] += (((V_FLAGS(v) & C352_FLG_PHASEFR) ? -s : s) * v->curr_vol[1]) >> 8; + out[3] += (((V_FLAGS(v) & C352_FLG_PHASEFR) ? -s : s) * v->curr_vol[3]) >> 8; + } + + for (n = 0; n < 4; n++) + { + int o = (c352_clamp(out[n] >> 3) * c352_gain[n]) >> 8; + l += o * c352_route[n][0]; + r += o * c352_route[n][1]; + } + bufl[i] = c352_clamp(l >> 8); + bufr[i] = c352_clamp(r >> 8); + } +} + static void c352_update(int param, INT16 **buffer, int length) { INT16 *bufl = buffer[0]; INT16 *bufr = buffer[1]; int i, j; + if (c352_routed) + { + c352_update_routed(buffer, length); + return; + } + for (i = 0; i < length; i++) { int out[2] = { 0, 0 }; @@ -301,6 +384,17 @@ int C352_sh_start(const struct MachineSound *msound) memset(&c352, 0, sizeof(c352)); + /* the routing asked by this driver, if any; the next game starts without */ + memcpy(c352_route, c352_route_pending, sizeof(c352_route)); + memset(c352_route_pending, 0, sizeof(c352_route_pending)); + c352_routed = 0; + for (i = 0; i < 4; i++) + { + c352_gain[i] = 0x100; + if (c352_route[i][0] || c352_route[i][1]) + c352_routed = 1; + } + vol[0] = MIXER(intf->mixing_level, MIXER_PAN_LEFT); vol[1] = MIXER(intf->mixing_level, MIXER_PAN_RIGHT); diff --git a/src/sound/c352.h b/src/sound/c352.h index 3fd169e1..482cc980 100644 --- a/src/sound/c352.h +++ b/src/sound/c352.h @@ -15,6 +15,15 @@ struct C352interface int mixing_level; /* master volume */ }; +/* Optional mixing of the four outputs (front left, front right, rear left, + rear right) into the stereo stream, as current MAME maps a cabinet's extra + speakers to stereo. Call before the sound starts (DRIVER_INIT); without it + only the front outputs are used. route[n][0..1]: gain of output n into the + left and right stream, 0x100 = 1.0. */ +void c352_set_routing(const int route[4][2]); +/* per output gain, 0x100 = 1.0 (MB87078 volume on Super System 22); routing only */ +void c352_set_output_gain(int output, int gain); + int C352_sh_start(const struct MachineSound *msound); void C352_sh_stop(void); diff --git a/src/vidhrdw/namcos22_vidhrdw.c b/src/vidhrdw/namcos22_vidhrdw.c index d3f68c01..5942d1b1 100644 --- a/src/vidhrdw/namcos22_vidhrdw.c +++ b/src/vidhrdw/namcos22_vidhrdw.c @@ -1,1471 +1,2981 @@ -/** - * video hardware for Namco System22 - * - * TODO: - * - * Time Crisis: - * "SPOT RAM NG" - * "DSP RAM NG" - * "SUBCPU START WAIT" - * - * Cyber Cycles: - * - some objects are singled out and skipped; if rendered, they cover the entire screen - * - * Air Combat22: - * - missing title? - * - missing sprites? - * - some unusual matrix selection (0x7fff) - * - occasional garbage written to DSP RAM - * - background color is bright red (pen#0 is obviously incorrect) - * - some texture map glitches (tile flip/swap) - * - writes to ROM(?) - * - writes to DSP RAM > 0xc20000 - * - plater plane wings are missing - * - glitches if frameskip!=0 - * - * Prop Cycle bugs: - * - in Solitar stage, backdrop is not completely covered by polygons (probably should be solid blue) - * - part of starting platform is drawn behind player even when they are logically in front - * - some text layer rows are apparently misplaced, compared to real PCB - * - * Unsupported features (not used by Prop Cycle) - * - window clipping and axis reversal (used in car games for rear view mirror) - * - polygons can be flagged to appear in front or behind tilemap layer - * - * Desirable optimizations: - * - draw polygons from front to back to avoid expensive overdraw - * - * Missing special effects: - * - independent fader controls for sprite/polygon/text - * - lighting - * - depth cueing (fog) - * - translucency effects for text layer, sprites - */ -#include -#include "namcos22.h" -#include "namcos3d.h" -#include "matrix3d.h" +/*************************************************************************** + + Namco System 22 / Super System 22 video hardware + + Backported from current MAME (Phil Stroffolino, hap, R. Belmont and + others, BSD-3-Clause). The polygon rasterizer follows MAME's poly.h + (edges, pixel centers and rounding), single threaded. + +***************************************************************************/ + #include +#include "driver.h" +#include "state.h" +#include "includes/namcos22.h" -/*#define MAME_DEBUG*/ +typedef double poly3d_t; -static int mbDumpScene; /* used for debugging */ +#define SCREEN_W 640 +#define SCREEN_H 480 -static int mbSuperSystem22; /* used to conditionally support Super System22-specific features */ +/*************************************************************************** + State +***************************************************************************/ -/* mWindowPri and mMasterBias reflect modal polygon rendering parameters */ -static INT32 mWindowPri; -static INT32 mMasterBias; +static UINT32 *pens; /* 0x8000 xRGB */ +static UINT8 *dirtypal; /* 0x2000 */ +static UINT16 *mix_bitmap; /* 640x480 text layer pens */ +static UINT8 *primap; /* 640x480 */ +static UINT32 *frame; /* 640x480 render target */ -#define SPRITERAM_SIZE (0x9b0000-0x980000) +static UINT16 *texture_tilemap; /* 0x100000 */ +static UINT8 *texture_tileattr; /* 0x100000 */ +static UINT32 *texture_tile32; /* 0x100000: (tile << 12) | attr */ +static const UINT8 *texture_tiledata; +static UINT8 texture_ayx_to_pixel[16 * 16 * 16]; +static const UINT8 *sprite_data; +static int sprite_count; -#define CGRAM_SIZE 0x1e000 -#define NUM_CG_CHARS ((CGRAM_SIZE*8)/(64*16)) /* 0x3c0 */ +static int mixer_flags; +static int screen_fade_factor; +static int screen_fade_r, screen_fade_g, screen_fade_b; +static int poly_fade_enabled; +static int poly_fade_r, poly_fade_g, poly_fade_b; +static int poly_alpha_color, poly_alpha_pen, poly_alpha_factor; +static UINT32 fog_colormask; +static int fog_r, fog_g, fog_b; +static UINT8 *recalc_czram[4]; +static int fog_r_per_cztype[4], fog_g_per_cztype[4], fog_b_per_cztype[4]; +static UINT16 czattr[8]; +static UINT16 *banked_czram[4]; +static UINT32 cz_was_written[4]; +static UINT16 *spotram; +static UINT32 spotram_enable; +static UINT32 spotram_address; +static int chipselect; +static int spot_factor; +static int text_palbase; +static int bg_palbase; -/* while processing the display list, a store of matrices are manipulated */ -#define MAX_CAMERA 128 -static struct Matrix +static UINT8 text_row_used[SCREEN_H]; /* rows with opaque text pixels */ +static UINT32 gamma_lut[3][256]; /* gamma of the frame: R << 16, G << 8, B */ +static UINT16 tilemapattr[8]; +static UINT16 rowscroll[480]; +static UINT16 lastrow; +static UINT32 rs_frame; +static mame_timer *posirq_timer; + +/* slave DSP simulation */ +static int absolute_priority; +static int objectshift; +static int cz_adjust; +static int objectflags; +static float viewmatrix[4][4]; +static UINT8 reflection; +static int cullflip; +#define MAX_LIT_SURFACES 0x80 +static UINT8 lit_surface_info[MAX_LIT_SURFACES]; +static unsigned lit_surface_count; +static unsigned lit_surface_index; +static int lit_surface_width; +static int lit_surface_intensity; +static int lit_surface_gouraud; +static int lit_surface_triangles; +static int camera_vx, camera_vy, camera_vu, camera_vd, camera_vl, camera_vr; +static float camera_zoom; +static float camera_lx, camera_ly, camera_lz; +static int camera_ambient; +static int camera_power; + + +/*************************************************************************** + Scene graph (z sorted, radix tree as MAME) +***************************************************************************/ + +#define RADIX_BITS 4 +#define RADIX_BUCKETS (1 << RADIX_BITS) +#define RADIX_MASK (RADIX_BUCKETS - 1) + +enum { NODE_NONLEAF, NODE_QUAD, NODE_SPRITE }; + +typedef struct { - double M[4][4]; -} *mpMatrix; + float x, y, z; + int u, v; /* 0..0xfff */ + int bri; /* 0..0xff */ +} polyvertex; -static int mPtRomSize; -static const data8_t *mpPolyH; -static const data8_t *mpPolyM; -static const data8_t *mpPolyL; - -static INT32 -GetPolyData( INT32 addr ) +struct scenenode { - INT32 result; - if( addr<0 || addr>=mPtRomSize ) + int type; + struct scenenode *next; + union { - return -1; /* HACK */ - } - result = (mpPolyH[addr]<<16)|(mpPolyM[addr]<<8)|mpPolyL[addr]; - if( result&0x00800000 ) + struct + { + struct scenenode *next[RADIX_BUCKETS]; + } nonleaf; + struct + { + int vx, vy; + int vu, vd, vl, vr; + int texturebank; + int color; + int cmode; + int cz_value; + int cz_type; + int cz_adjust; + int objectflags; + int direct; + polyvertex v[4]; + } quad; + struct + { + int tile, color; + int prioverchar; + int fade_enabled; + int flipx, flipy; + int linktype; + int cols, rows; + int xpos, ypos; + int cx_min, cx_max; + int cy_min, cy_max; + int sizex, sizey; + int alpha; + int cz; + } sprite; + } data; +}; + +#define NODE_CHUNK 4096 +#define MAX_NODE_CHUNKS 256 +static struct scenenode *node_chunks[MAX_NODE_CHUNKS]; +static int node_chunk_count; +static int node_used; /* nodes taken, over all the chunks */ +static struct scenenode scenenode_root; + +static struct scenenode *alloc_scenenode(void) +{ + int chunk = node_used / NODE_CHUNK; + struct scenenode *node; + + if (chunk >= MAX_NODE_CHUNKS) + return NULL; + if (chunk >= node_chunk_count) { - result |= 0xff000000; /* sign extend */ - } - return result; -} /* GetPolyData */ - -/* text layer uses a set of 16x16x8bpp tiles defined in RAM */ -static struct GfxLayout cg_layout = -{ - 16,16, - NUM_CG_CHARS, - 4, - { 0,1,2,3 }, -#ifdef MSB_FIRST - { 4*0,4*1,4*2,4*3,4*4,4*5,4*6,4*7, - 4*8,4*9,4*10,4*11,4*12,4*13,4*14,4*15 }, -#else - { 4*6,4*7, 4*4,4*5, 4*2,4*3, 4*0,4*1, - 4*14,4*15, 4*12,4*13, 4*10,4*11, 4*8,4*9 }, -#endif - { 64*0,64*1,64*2,64*3,64*4,64*5,64*6,64*7,64*8,64*9,64*10,64*11,64*12,64*13,64*14,64*15 }, - 64*16 -}; /* cg_layout */ - -data32_t *namcos22_cgram; -data32_t *namcos22_textram; -data32_t *namcos22_polygonram; -data32_t *namcos22_gamma; - -static int cgsomethingisdirty; -static unsigned char *cgdirty; -static unsigned char *dirtypal; -static struct tilemap *tilemap; - -static data8_t -nthbyte( const data32_t *pSource, int offs ) -{ - pSource += offs/4; - return (pSource[0]<<((offs&3)*8))>>24; -} - -static data16_t -nthword( const data32_t *pSource, int offs ) -{ - pSource += offs/2; - return (pSource[0]<<((offs&1)*16))>>16; -} - -static void TextTilemapGetInfo( int tile_index ) -{ - data16_t data = nthword( namcos22_textram,tile_index ); - /** - * xxxx------------ palette select - * ----xx---------- flip - * ------xxxxxxxxxx code - */ - SET_TILE_INFO( NAMCOS22_ALPHA_GFX,data&0x3ff,data>>12,TILE_FLIPYX((data>>10)&3) ); -} - -/** - * mydrawgfxzoom is used to insert a zoomed 2d sprite into an already-rendered 3d scene. - */ -static void -mydrawgfxzoom( - struct mame_bitmap *dest_bmp,const struct GfxElement *gfx, - unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy, - const struct rectangle *clip,int transparency,int transparent_color, - int scalex, int scaley, INT32 zcoord ) -{ - struct rectangle myclip; - if (!scalex || !scaley) return; - if(clip) - { - myclip.min_x = clip->min_x; - myclip.max_x = clip->max_x; - myclip.min_y = clip->min_y; - myclip.max_y = clip->max_y; - - if (myclip.min_x < 0) myclip.min_x = 0; - if (myclip.max_x >= dest_bmp->width) myclip.max_x = dest_bmp->width-1; - if (myclip.min_y < 0) myclip.min_y = 0; - if (myclip.max_y >= dest_bmp->height) myclip.max_y = dest_bmp->height-1; - - clip=&myclip; - } - if( gfx && gfx->colortable ) - { - const pen_t *pal = &gfx->colortable[gfx->color_granularity * (color % gfx->total_colors)]; - UINT8 *source_base = gfx->gfxdata + (code % gfx->total_elements) * gfx->char_modulo; - int sprite_screen_height = (scaley*gfx->height+0x8000)>>16; - int sprite_screen_width = (scalex*gfx->width+0x8000)>>16; - if (sprite_screen_width && sprite_screen_height) - { - int dx = (gfx->width<<16)/sprite_screen_width; - int dy = (gfx->height<<16)/sprite_screen_height; - int ex = sx+sprite_screen_width; - int ey = sy+sprite_screen_height; - int x_index_base; - int y_index; - if( flipx ) - { - x_index_base = (sprite_screen_width-1)*dx; - dx = -dx; - } - else - { - x_index_base = 0; - } - if( flipy ) - { - y_index = (sprite_screen_height-1)*dy; - dy = -dy; - } - else - { - y_index = 0; - } - if( clip ) - { - if( sx < clip->min_x) - { /* clip left */ - int pixels = clip->min_x-sx; - sx += pixels; - x_index_base += pixels*dx; - } - if( sy < clip->min_y ) - { /* clip top */ - int pixels = clip->min_y-sy; - sy += pixels; - y_index += pixels*dy; - } - if( ex > clip->max_x+1 ) - { /* clip right */ - int pixels = ex-clip->max_x-1; - ex -= pixels; - } - if( ey > clip->max_y+1 ) - { /* clip bottom */ - int pixels = ey-clip->max_y-1; - ey -= pixels; - } - } - if( ex>sx ) - { /* skip if inner loop doesn't draw anything */ - int y; - for( y=sy; y>16) * gfx->line_modulo; - UINT32 *dest = (UINT32 *)dest_bmp->line[y]; - int x, x_index = x_index_base; - for( x=sx; x>16]; - if( c != transparent_color ) - { - dest[x] = pal[c]; - pZBuf[x] = zcoord; - } - } - x_index += dx; - } - y_index += dy; - } - } - } - } -} - -static void -DrawSprites( struct mame_bitmap *bitmap, const struct rectangle *cliprect ) -{ - /* - 0x980000: 00060000 00010000 02ff0000 000007ff - ^^^^ num sprites - - 0x980010: 00200020 000002ff 000007ff 00000000 - ^^^^ delta xpos - ^^^^ delta ypos - - 0x980200: 000007ff 000007ff delta xpos, delta ypos - 0x980208: 000007ff 000007ff - 0x980210: 000007ff 000007ff - 0x980218: 000007ff 000007ff - 0x980220: 000007ff 000007ff - 0x980228: 000007ff 000007ff - 0x980230: 000007ff 000007ff - 0x980238: 000007ff 000007ff - - 0x980400: ? - 0x980600: ? - 0000 0000.0000.0000.0000 - 8000 1000.0000.0000.0000 - 8080 1000.0000.1000.0000 - 8880 1000.1000.1000.0000 - 8888 1000.1000.1000.1000 - a888 1010.1000.1000.1000 - a8a8 1010.1000.1010.1000 - aaa8 1010.1010.1010.1000 - aaaa 1010.1010.1010.1010 - eaaa 1110.1010.1010.1010 - eaea 1110.1010.1110.1010 - eeea 1110.1110.1110.1010 - eeee 1110.1110.1110.1110 - feee 1111.1110.1110.1110 - fefe 1111.1110.1111.1110 - fffe 1111.1111.1111.1110 - ffff 1111.1111.1111.1111 - - 0x980800: 0000 0001 0002 0003 ... 03ff (probably indirection for sprite list) - - eight words per sprite: - 0x984000: 010f 007b xpos, ypos - 0x984004: 0020 0020 size x, size y - 0x984008: 00ff 0311 00ff, chr x;chr y;flip x;flip y - 0x98400c: 0001 0000 sprite code, ???? - ... - - additional sorting/color data for sprite: - 0x9a0000: C381 Z (sort) - 0x9a0004: palette, C381 ZC (depth cueing?) - ... - */ - int i; - int deltax, deltay; - int color,flipx,flipy; - data32_t xypos, size, attrs, code; - const data32_t *pSource, *pPal; - int numcols, numrows, row, col; - int xpos, ypos, tile; - int num_sprites; - int zoomx, zoomy; - int sizex, sizey; - - deltax = spriteram32[0x14/4]>>16; - deltay = spriteram32[0x18/4]>>16; - num_sprites = (spriteram32[0x04/4]>>16)&0x3ff; /* max 1024 sprites? */ - color = 0; - flipx = 0; - flipy = 0; - pSource = &spriteram32[0x4000/4]+num_sprites*4; - pPal = &spriteram32[0x20000/4]+num_sprites*2; - for( i=0; i>16; - /* pPal[1]&0xffff CZ (color z - for depth cueing) */ - - xypos = pSource[0]; - xpos = (xypos>>16)-deltax; - ypos = (xypos&0xffff)-deltay; - - size = pSource[1]; - - sizex = size>>16; - sizey = size&0xffff; - zoomx = (1<<16)*sizex/0x20; - zoomy = (1<<16)*sizey/0x20; - - attrs = pSource[2]; - flipy = attrs&0x8; - numrows = attrs&0x7; - if( numrows==0 ) numrows = 8; - if( flipy ) - { - ypos += sizey*(numrows-1); - sizey = -sizey; - } - - attrs>>=4; - - flipx = attrs&0x8; - numcols = attrs&0x7; - if( numcols==0 ) numcols = 8; - if( flipx ) - { - xpos += sizex*(numcols-1); - sizex = -sizex; - } - - code = pSource[3]; - tile = code>>16; - - for( row=0; rowgfx[0], - tile, - color, - flipx, flipy, - xpos+col*sizex/*-5*/, ypos+row*sizey/*+4*/, - cliprect, - TRANSPARENCY_PEN, 255, - zoomx, zoomy, - zcoord ); - tile++; - } - } - pSource -= 4; - pPal -= 2; - } -} /* DrawSprites */ - -static void -UpdatePaletteS( void ) /* for Super System22 - apply gamma correction and preliminary fader support */ -{ - int i,j; - - int red = nthbyte( namcos22_gamma, 0x16 ); - int green = nthbyte( namcos22_gamma, 0x17 ); - int blue = nthbyte( namcos22_gamma, 0x18 ); - int fade = nthbyte( namcos22_gamma, 0x19 ); -/* int flags = nthbyte( namcos22_gamma, 0x1a );*/ - - tilemap_set_palette_offset( tilemap, nthbyte(namcos22_gamma,0x1b)*256 ); - - for( i=0; i>16)&0x3ff] ) - { - tilemap_mark_tile_dirty( tilemap,i ); - } - if( cgdirty[data&0x3ff] ) - { - tilemap_mark_tile_dirty( tilemap,i+1 ); - } - } - for( i=0; igfx[NAMCOS22_ALPHA_GFX],i,(UINT8 *)namcos22_cgram,&cg_layout ); - cgdirty[i] = 0; - } - } - cgsomethingisdirty = 0; - } - tilemap_draw( bitmap, cliprect, tilemap, 0, 0 ); -} /* DrawTextLayer */ - -/*********************************************************************************************/ - -static void -ApplyRotation( const INT32 *pSource, double M[4][4] ) -{ - struct RotParam param; - param.thx_sin = ((INT16)pSource[0])/(double)0x7fff; - param.thx_cos = ((INT16)pSource[1])/(double)0x7fff; - param.thy_sin = ((INT16)pSource[2])/(double)0x7fff; - param.thy_cos = ((INT16)pSource[3])/(double)0x7fff; - param.thz_sin = ((INT16)pSource[4])/(double)0x7fff; - param.thz_cos = ((INT16)pSource[5])/(double)0x7fff; - param.rolt = (INT16)pSource[6]; - namcos3d_Rotate( M, ¶m ); -} /* ApplyRotation */ - -static const INT32 * -LoadMatrix( const INT32 *pSource, double M[4][4] ) -{ - double temp[4][4]; - int r,c; - - matrix3d_Identity( M ); - for(;;) - { - INT16 opcode = *pSource++; - switch( opcode ) - { - case 0x0000: /* translate */ - matrix3d_Translate( M, pSource[0], pSource[1], pSource[2] ); - pSource += 3; - break; - - case 0x0001: /* rotate */ - ApplyRotation( pSource, M ); - pSource += 7; - break; - - case 0x0003: /* unknown */ - pSource += 2; - break; - - case 0x0004: /* unknown */ - pSource += 6; - break; - - case 0x0006: /* custom */ - for( c=0; c<3; c++ ) - { - for( r=0; r<3; r++ ) - { - temp[r][c] = *pSource++ / (double)0x7fff; - } - temp[c][3] = temp[3][c] = 0; - } - temp[3][3] = 1; - matrix3d_Multiply( M, temp ); - break; - - case 0xffffffff: - return pSource; - - default: - log_cb(RETRO_LOG_DEBUG, LOGPRE "bad LoadMatrix(0x%08x)!!\n", opcode ); + node_chunks[chunk] = malloc(NODE_CHUNK * sizeof(struct scenenode)); + if (!node_chunks[chunk]) return NULL; - } + node_chunk_count = chunk + 1; } -} /* LoadMatrix */ - - - -/** - * +0x00 0 always 0xf? - * +0x04 1 sin(x) world-view matrix - * +0x08 2 cos(x) - * +0x0c 3 sin(y) - * +0x10 4 cos(y) - * +0x14 5 sin(z) - * +0x18 6 cos(z) - * +0x1c 7 ROLT? always 0x0002? - * +0x20 8 light power - * +0x24 9 light ambient - * +0x28 10 light vector(x) - * +0x2c 11 light vector(y) - * +0x30 12 light vector(z) - * +0x34 13 always 0x0002? - * +0x38 14 field of view angle (fovx) in degrees - * +0x3c 15 viewport width - * +0x40 16 viewport height - * +0x44 17 - * +0x48 18 - * +0x4c 19 - * +0x50 20 priority (top 7 > .. > 0 behind) - * +0x54 21 viewport center x - * +0x58 22 viewport center y - * +0x5c 23 sin(x) ? - * +0x60 24 cos(x) - * +0x64 25 sin(y) - * +0x68 26 cos(y) - * +0x6c 27 sin(z) - * +0x70 28 cos(z) - * +0x74 29 flags (axis flipping?) 0004, 0003 - * +0x78 30 6630, 0001 - * +0x7c 31 7f02 - */ -/*static double mWindowZoom;*/ -static namcos22_camera mCamera; -static struct Matrix mWindowTransform; - -static int mPrevWindow; - -static void -ResetWindow( void ) -{ - mPrevWindow = -1; + node = &node_chunks[chunk][node_used % NODE_CHUNK]; + node_used++; + memset(node, 0, sizeof(*node)); + return node; } -static void -SetupWindow( const INT32 *pWindow, int which ) +static struct scenenode *new_scenenode(UINT32 zsort, int type) { - if( which!=mPrevWindow ) - { /* only recompute if we're dealing with a new window */ - double vw,vh; - - mPrevWindow = which; - pWindow += which*0x80/4; - - vw = pWindow[0x3c/4]; - vh = pWindow[0x40/4]; - mCamera.cx = 320+pWindow[0x54/4]; - mCamera.cy = 240-pWindow[0x58/4]; - mCamera.clip.min_x = mCamera.cx - vw; - mCamera.clip.min_y = mCamera.cy - vh; - mCamera.clip.max_x = mCamera.cx + vw; - mCamera.clip.max_y = mCamera.cy + vh; - - if( mCamera.clip.min_x < 0 ) mCamera.clip.min_x = 0; - if( mCamera.clip.min_y < 0 ) mCamera.clip.min_y = 0; - if( mCamera.clip.max_x > 640 ) mCamera.clip.max_x = 640; - if( mCamera.clip.max_y < 320 ) mCamera.clip.max_y = 320; - - { -/* double pi = atan (1.0) * 4.0;*/ - double fov = pWindow[0x38/4]; - - if( namcos22_gametype == NAMCOS22_PROP_CYCLE ) - { - fov /= 32.0; - } - fov = fov*3.141592654/180.0; /* degrees to radians */ - mCamera.zoom = vw/tan(fov/2.0); - } - - mWindowPri = pWindow[0x50/4]&0x7; - - matrix3d_Identity( mWindowTransform.M ); - ApplyRotation( &pWindow[1], mWindowTransform.M ); - - mCamera.power = (INT16)(pWindow[0x20/4])/(double)0xff; - mCamera.ambient = (INT16)(pWindow[0x24/4])/(double)0xff; - mCamera.x = (INT16)(pWindow[0x28/4])/(double)0x7fff; - mCamera.y = (INT16)(pWindow[0x2c/4])/(double)0x7fff; - mCamera.z = (INT16)(pWindow[0x30/4])/(double)0x7fff; - } -} /* SetupWindow */ - -static void -BlitPolyDirect( struct mame_bitmap *pBitmap, const INT32 *pSource, double m[4][4] ) -{ - INT32 zcode; - unsigned color = (pSource[1]<<8)&0x7f00; - INT32 flags = pSource[3]; - int tpage = pSource[4]; - double zmin, zmax, zrep; - struct VerTex v[5]; + struct scenenode *node = &scenenode_root; + struct scenenode *prev = NULL; + struct scenenode *leaf; + int hash = 0; int i; - zmin = zmax = 0; - - for( i=0; i<4; i++ ) + for (i = 0; i < 24; i += RADIX_BITS) { - struct VerTex *pVerTex = &v[i]; - double lx = pSource[5+i*6+2]; - double ly = pSource[5+i*6+3]; - double lz = pSource[5+i*6+4]; - pVerTex->x = lx; - pVerTex->y = ly; - pVerTex->z = lz; - pVerTex->u = pSource[5+i*6+0]; - pVerTex->v = pSource[5+i*6+1]+(tpage<<12); - pVerTex->i = pSource[5+i*6+5]; - if( i==0 || pVerTex->z > zmax ) zmax = pVerTex->z; - if( i==0 || pVerTex->z < zmin ) zmin = pVerTex->z; - /** - * polygons expressed in this fashion don't use perspective projection - * (x,y) are already in screen window coordinates. - * for now, as a quick workaround, we assign an arbitrary z coordinate to all - * four vertexes, big enough to avoid near-plane clipping. - */ - pVerTex->z = 1000; + struct scenenode *next; + hash = (zsort >> (24 - RADIX_BITS)) & RADIX_MASK; + next = node->data.nonleaf.next[hash]; + if (!next) + { + next = alloc_scenenode(); + if (!next) + return NULL; + next->type = NODE_NONLEAF; + node->data.nonleaf.next[hash] = next; + } + prev = node; + node = next; + zsort <<= RADIX_BITS; } - zrep = (zmin+zmax)/2.0; - zcode = pSource[0]+(INT32)zrep; - mCamera.zoom = 1000; /* compensate for fake z coordinate */ - mCamera.cx = 640/2; - mCamera.cy = 480/2; - mCamera.clip.min_x = 0; - mCamera.clip.min_y = 0; - mCamera.clip.max_x = 640; - mCamera.clip.max_y = 320; + if (node->type == NODE_NONLEAF) + { + /* first leaf on this branch */ + node->type = type; + return node; + } - namcos22_BlitTri( pBitmap, &v[0], color, zcode, flags, &mCamera ); /* 0,1,2 */ - v[4] = v[0]; /* wrap */ - namcos22_BlitTri( pBitmap, &v[2], color, zcode, flags, &mCamera ); /* 2,3,0 */ + leaf = alloc_scenenode(); + if (!leaf) + return NULL; + leaf->type = type; + leaf->next = node; + prev->data.nonleaf.next[hash] = leaf; + return leaf; } -static void -BlitQuadHelper( - struct mame_bitmap *pBitmap, - unsigned color, - unsigned addr, - double m[4][4], - INT32 zcode, - INT32 flags ) + +/*************************************************************************** + Rasterizer (MAME poly.h, single threaded) +***************************************************************************/ + +typedef struct { - double zmin, zmax, zrep; - double kScale = 0.5; - struct VerTex v[5]; - int i; + poly3d_t x, y; + poly3d_t p[4]; +} vertex_t; - zmin = zmax = 0; - - color &= 0x7f00; - - for( i=0; i<4; i++ ) - { - struct VerTex *pVerTex = &v[i]; - double lx = kScale * GetPolyData( 8+i*3+addr ); - double ly = kScale * GetPolyData( 9+i*3+addr ); - double lz = kScale * GetPolyData( 10+i*3+addr ); - pVerTex->x = m[0][0]*lx + m[1][0]*ly + m[2][0]*lz + m[3][0]; - pVerTex->y = m[0][1]*lx + m[1][1]*ly + m[2][1]*lz + m[3][1]; - pVerTex->z = m[0][2]*lx + m[1][2]*ly + m[2][2]*lz + m[3][2]; - pVerTex->u = GetPolyData( 0+2*i+addr )&0x0fff; - pVerTex->v = GetPolyData( 1+2*i+addr )&0xffff; - pVerTex->i = (GetPolyData(i+addr)>>16)&0xff; - if( i==0 || pVerTex->z > zmax ) zmax = pVerTex->z; - if( i==0 || pVerTex->z < zmin ) zmin = pVerTex->z; - } - - /** - * The method for computing represenative z value may vary per polygon. - * Possible methods include: - * - minimum value: zmin - * - maximum value: zmax - * - average value: (zmin+zmax)/2 - * - average of all four z coordinates - */ - zrep = (zmin+zmax)/2.0; /* for now just always use the simpler average */ - - /** - * hardware supports two types priority modes: - * - * direct: use explicit zcode, ignoring the polygon's z coordinate - * ---xxxxx xxxxxxxx xxxxxxxx - * - * relative: representative z + shift values - * ---xxx-- -------- -------- shift absolute priority - * ------xx xxxxxxxx xxxxxxxx shift z-representative value - */ - - if( namcos22_gametype == NAMCOS22_PROP_CYCLE ) - { /* for now, assume all polygons use relative priority */ - INT32 dw = (zcode&0x1c0000)>>18; /* window (master)priority bias */ - INT32 dz = (zcode&0x03ffff); /* bias for representative z coordinate */ - - if( dw&4 ) - { - dw |= ~0x7; /* sign extend */ - } - dw += mWindowPri; - if( dw<0 ) dw = 0; else if( dw>7 ) dw = 7; /* cap it at min/max */ - dw <<= 21; - - if( dz&0x020000 ) - { - dz |= ~0x03ffff; /* sign extend */ - } - dz += (INT32)zrep; - dz += mMasterBias; - if( dz<0 ) dz = 0; else if( dz>0x1fffff ) dz = 0x1fffff; /* cap it at min/max */ - - /** - * xxx----- -------- -------- master-priority - * ---xxxxx xxxxxxxx xxxxxxxx sub-priority - */ - zcode = dw|dz; - } - else if( namcos22_gametype == NAMCOS22_RAVE_RACER || - namcos22_gametype == NAMCOS22_VICTORY_LAP ) - { - /** Rave Racer: - * 3b7740 - * --11.1011.0111.0111.0100.0000 - */ - INT32 dw = mWindowPri<<24; - INT32 dz = zcode; - dz += (INT32)zrep; - zcode = dw|dz; - } - else - { - zcode = 0x10000 + (INT32)zrep; - } - - namcos22_BlitTri( pBitmap, &v[0], color, zcode, flags, &mCamera ); /* 0,1,2 */ - v[4] = v[0]; /* wrap */ - namcos22_BlitTri( pBitmap, &v[2], color, zcode, flags, &mCamera ); /* 2,3,0 */ -} /* BlitQuadHelper */ - - -static void -BlitQuads( struct mame_bitmap *pBitmap, INT32 addr, double m[4][4], INT32 base ) +typedef struct { -/* INT32 start = addr;*/ - INT32 size = GetPolyData(addr++); - INT32 finish = addr + (size&0xff); - INT32 flags; - INT32 color; - INT32 bias; + poly3d_t start, dpdx; +} extent_param; - while( addrnbands == 1 || (((y) >> BAND_STRIP_SHIFT) % (rc)->nbands) == (rc)->band) + +/* is row y in this band: strips of 16 scanlines, y / 16 modulo the bands */ +#define ROW_OWNED(y, band, nbands) ((nbands) == 1 || (((y) >> BAND_STRIP_SHIFT) % (nbands)) == (band)) + +static INT32 round_coordinate(poly3d_t value) +{ + poly3d_t ipart, fpart; + if (value >= 2147483647.0) + return 2147483647; + ipart = floor(value); + if (ipart < -2147483648.0) + return (-2147483647 - 1); + fpart = value - ipart; + return (INT32)ipart + ((fpart > 0.5) ? 1 : 0); } -WRITE32_HANDLER( namcos22_dspram_w ) +static void render_triangle(const raster_clip *rc, scanline_func callback, const object_data *extra, int paramcount, + const vertex_t *v1, const vertex_t *v2, const vertex_t *v3) { - if( keyboard_pressed(KEYCODE_SPACE) ) + const vertex_t *t; + INT32 v1y, v3y, v1yclip, v3yclip, curscan; + poly3d_t dxdy_v1v2, dxdy_v1v3, dxdy_v2v3; + poly3d_t param_start[4], param_dpdx[4], param_dpdy[4]; + int paramnum; + + if (v2->y < v1->y) { t = v1; v1 = v2; v2 = t; } + if (v3->y < v2->y) { - log_cb(RETRO_LOG_DEBUG, LOGPRE "pointram_w(%08x,%08x)\n", offset*4, data ); - log_cb(RETRO_LOG_DEBUG, LOGPRE "%08x pointram_w(%08x,%08x)\n", activecpu_get_pc(), offset*4, data ); - } - COMBINE_DATA( &namcos22_polygonram[offset] ); -} - -/** - * c00000 - * c00004 set by main CPU; triggers DSP to start drawing scene. DSP stores zero when finished. - * c00008 - * c0000c - * c0002c busy status(?) - * c00010 display list bank select - * - * c00030 - * c00040 Point RAM Write Enable (ff=enable) - * c00044 Point RAM IDC (index count register) - * c00058 - * c0005c - * - * c00c00..c0ffff Point RAM Port (Point RAM has 128K words, 512KB space (128K 24bit) - * - * c10000..c1007f - * 0000000f (always?) - * - * 000019b1 00007d64 // rolx (master camera) - * 00005ece 000055fe // roly (master camera) - * 000001dd 00007ffc // rolz (master camera) - * 00000002 (rolt) - * - * 000000c8 // light power - * 00000014 // light ambient - * 00000000 00005a82 ffffa57e // light vector - * - * 00000002 (always?) - * - * 00000780 // field of view - * 00000140 000000f0 - * - * 00000000 00000000 00000000 - * - * 00000007 // priority - * 00000000 00000000 - * 00000000 00007fff // rolx? - * 00000000 00007fff // roly? - * 00000000 00007fff // rolz? - * 00010000 // flags? - * 00000000 00000000 // unknown - * - * c10080..c100ff - * c10100..c1017f - * c10180..c101ff - * c10200..c1027f - * c10280..c102ff - * c10300..c1037f - * c10380..c103ff - * - * c10400..c17fff: scene data - * - * c18000..c183ff: bank#2 window attr - * c18400..c1ffff: bank#2, scene data - */ -static void -DrawPolygons( struct mame_bitmap *bitmap ) -{ - static int iShowOnly; - int iObject = 0; - int bShowOnly = 0; - - double M[4][4]; - UINT16 code, mode; - UINT16 window = 0; - INT32 xpos,ypos,zpos; - int i, iSource0, iSource1, iTarget; - const INT32 *pSource, *pDebug; - const INT32 *pWindow; - - pSource=NULL; - pWindow=NULL; - - if( keyboard_pressed(KEYCODE_Z) ) return; - - namcos22_polygonram[0x4/4] = 0; /* clear busy flag */ - ResetWindow(); - - namcos22_polygonram[0x2c/4] = 0; /* see ridge racer */ - namcos22_polygonram[0x30/4] = 0; /* see ridge racer */ - - if( keyboard_pressed(KEYCODE_SPACE) ) - { - log_cb(RETRO_LOG_DEBUG, LOGPRE "DrawPolygons\n" ); + t = v2; v2 = v3; v3 = t; + if (v2->y < v1->y) { t = v1; v1 = v2; v2 = t; } } - /*************************************************************************/ - #ifdef MAME_DEBUG - mbDumpScene = keyboard_pressed( KEYCODE_U ); + v1y = round_coordinate(v1->y); + v3y = round_coordinate(v3->y); + v1yclip = (v1y > rc->miny) ? v1y : rc->miny; + v3yclip = (v3y < rc->maxy + 1) ? v3y : rc->maxy + 1; + if (v3yclip - v1yclip <= 0) + return; - bShowOnly = keyboard_pressed(KEYCODE_B); + dxdy_v1v2 = (v2->y == v1->y) ? 0.0 : (v2->x - v1->x) / (v2->y - v1->y); + dxdy_v1v3 = (v3->y == v1->y) ? 0.0 : (v3->x - v1->x) / (v3->y - v1->y); + dxdy_v2v3 = (v3->y == v2->y) ? 0.0 : (v3->x - v2->x) / (v3->y - v2->y); - if( bShowOnly ) { - drawgfx( bitmap, Machine->uifont, "0123456789abcdef"[(iShowOnly>>4)&0xf], - 0,0,0,0,0,NULL,TRANSPARENCY_NONE,0 ); - drawgfx( bitmap, Machine->uifont, "0123456789abcdef"[(iShowOnly>>0)&0xf], - 0,0,0,12,0,NULL,TRANSPARENCY_NONE,0 ); - } - if( keyboard_pressed( KEYCODE_M ) ) - { - while( keyboard_pressed( KEYCODE_M ) ){} - iShowOnly = (iShowOnly+1)&0xff; - } - if( keyboard_pressed( KEYCODE_N ) ) - { - while( keyboard_pressed( KEYCODE_N ) ){} - iShowOnly = (iShowOnly-1)&0xff; - } - #endif /* MAME_DEBUG */ - /*************************************************************************/ + poly3d_t a00 = v2->y - v3->y; + poly3d_t a01 = v3->x - v2->x; + poly3d_t a02 = v2->x*v3->y - v3->x*v2->y; + poly3d_t a10 = v3->y - v1->y; + poly3d_t a11 = v1->x - v3->x; + poly3d_t a12 = v3->x*v1->y - v1->x*v3->y; + poly3d_t a20 = v1->y - v2->y; + poly3d_t a21 = v2->x - v1->x; + poly3d_t a22 = v1->x*v2->y - v2->x*v1->y; + poly3d_t det = a02 + a12 + a22; - /** - * Ace Driver: - * namcos22_polygonram[0x10/4]: - * - points to end of display list - */ - switch( namcos22_polygonram[0x10/4]&1 ) - { - case 0: - pWindow = (INT32 *)&namcos22_polygonram[0x10000/4]; - pSource = (INT32 *)&namcos22_polygonram[0x10400/4]; - break; - - case 1: - pWindow = (INT32 *)&namcos22_polygonram[0x18000/4]; - pSource = (INT32 *)&namcos22_polygonram[0x18400/4]; - break; - - default: - break; - } - - if( !pSource[0] ) return; - - mode = 0x8000; - - if( mbDumpScene ) - { - for( i=0; i<8*32; i++ ) + if (fabs(det) < 0.00001) { - if( (i&0x1f)==0 ) + for (paramnum = 0; paramnum < paramcount; paramnum++) { - log_cb(RETRO_LOG_DEBUG, LOGPRE "\n%d:\t",i/32 ); + param_dpdx[paramnum] = 0.0; + param_dpdy[paramnum] = 0.0; + param_start[paramnum] = v1->p[paramnum]; } - log_cb(RETRO_LOG_DEBUG, LOGPRE " %08x", pWindow[i] ); - } - log_cb(RETRO_LOG_DEBUG, LOGPRE "\n" ); - } - pDebug = pSource; - for(;;) - { - if( mbDumpScene ) - { - log_cb(RETRO_LOG_DEBUG, LOGPRE "\n" ); - while( pDebug=MAX_CAMERA || iSource1>=MAX_CAMERA || iTarget>=MAX_CAMERA ) - { - log_cb(RETRO_LOG_DEBUG, LOGPRE "illegal compose\n"); - return; - } - assert( iSource0<0x80 && iSource1<0x80 && iTarget<0x80 ); - memcpy( M, mpMatrix[iSource0].M, sizeof(M) ); /* M := source0 */ - matrix3d_Multiply( M, mpMatrix[iSource1].M ); /* M *= source1 */ - memcpy( mpMatrix[iTarget].M, M, sizeof(M) ); /* target := M */ - break; - - case 0x800a: /* Prop Cycle: flying bicycle, birds */ - SetupWindow( pWindow,window ); - code = *pSource++; - i = *pSource++; i &= (MAX_CAMERA-1); - assert( i<0x80 ); - memcpy( M, &mpMatrix[i], sizeof(M) ); - xpos = *pSource++; - ypos = *pSource++; - zpos = *pSource++; - matrix3d_Translate( M, xpos,ypos,zpos ); - matrix3d_Multiply( M, mWindowTransform.M ); - if( iObject == iShowOnly || !bShowOnly ) - { - if( mbDumpScene ) - { - log_cb(RETRO_LOG_DEBUG, LOGPRE "\n#%03x: ", iObject ); - while( pDebugp[paramnum]*a00 + v2->p[paramnum]*a10 + v3->p[paramnum]*a20); + param_dpdy[paramnum] = idet * (v1->p[paramnum]*a01 + v2->p[paramnum]*a11 + v3->p[paramnum]*a21); + param_start[paramnum] = idet * (v1->p[paramnum]*a02 + v2->p[paramnum]*a12 + v3->p[paramnum]*a22); } } } -} /* DrawPolygons */ -/*********************************************************************************************/ + for (curscan = v1yclip; curscan < v3yclip; curscan++) + { + extent_t extent; + poly3d_t fully = (poly3d_t)curscan + 0.5; + poly3d_t startx = v1->x + (fully - v1->y) * dxdy_v1v3; + poly3d_t stopx, fullstartx; + INT32 istartx, istopx; -READ32_HANDLER( namcos22_cgram_r ) -{ - return namcos22_cgram[offset]; + if (!OWN_LINE(rc, curscan)) + continue; + + if (fully < v2->y) + stopx = v1->x + (fully - v1->y) * dxdy_v1v2; + else + stopx = v2->x + (fully - v2->y) * dxdy_v2v3; + + istartx = round_coordinate(startx); + istopx = round_coordinate(stopx); + if (istartx > istopx) { INT32 tmp = istartx; istartx = istopx; istopx = tmp; } + if (istartx < rc->minx) istartx = rc->minx; + if (istopx > rc->maxx + 1) istopx = rc->maxx + 1; + if (istartx >= istopx) + continue; + + extent.startx = istartx; + extent.stopx = istopx; + fullstartx = (poly3d_t)istartx + 0.5; + for (paramnum = 0; paramnum < paramcount; paramnum++) + { + extent.param[paramnum].start = param_start[paramnum] + fullstartx * param_dpdx[paramnum] + fully * param_dpdy[paramnum]; + extent.param[paramnum].dpdx = param_dpdx[paramnum]; + } + callback(curscan, &extent, extra); + } } -WRITE32_HANDLER( namcos22_cgram_w ) +typedef struct { - COMBINE_DATA( &namcos22_cgram[offset] ); - cgdirty[offset/32] = 1; - cgsomethingisdirty = 1; + const vertex_t *v1, *v2; + poly3d_t dxdy; + poly3d_t dpdy[4]; +} poly_edge; + +static void render_polygon(const raster_clip *rc, scanline_func callback, const object_data *extra, int paramcount, int numverts, const vertex_t *v) +{ + poly3d_t minx = v[0].x, maxx = v[0].x; + int minv = 0, maxv = 0; + int vertnum, curv, paramnum; + INT32 miny, maxy, minyclip, maxyclip, curscan; + poly_edge fedgelist[8], bedgelist[8]; + poly_edge *edgeptr; + const poly_edge *ledge, *redge; + + for (vertnum = 1; vertnum < numverts; vertnum++) + { + if (v[vertnum].y < v[minv].y) + minv = vertnum; + else if (v[vertnum].y > v[maxv].y) + maxv = vertnum; + if (v[vertnum].x < minx) minx = v[vertnum].x; + if (v[vertnum].x > maxx) maxx = v[vertnum].x; + } + + miny = round_coordinate(v[minv].y); + maxy = round_coordinate(v[maxv].y); + minyclip = (miny > rc->miny) ? miny : rc->miny; + maxyclip = (maxy < rc->maxy + 1) ? maxy : rc->maxy + 1; + if (maxyclip - minyclip <= 0) + return; + + /* forward edges */ + edgeptr = &fedgelist[0]; + for (curv = minv; curv != maxv; curv = (curv == numverts - 1) ? 0 : (curv + 1)) + { + poly3d_t ooy; + edgeptr->v1 = &v[curv]; + edgeptr->v2 = &v[(curv == numverts - 1) ? 0 : (curv + 1)]; + if (edgeptr->v1->y == edgeptr->v2->y) + continue; + ooy = 1.0 / (edgeptr->v2->y - edgeptr->v1->y); + edgeptr->dxdy = (edgeptr->v2->x - edgeptr->v1->x) * ooy; + for (paramnum = 0; paramnum < paramcount; paramnum++) + edgeptr->dpdy[paramnum] = (edgeptr->v2->p[paramnum] - edgeptr->v1->p[paramnum]) * ooy; + ++edgeptr; + } + + /* backward edges */ + edgeptr = &bedgelist[0]; + for (curv = minv; curv != maxv; curv = (curv == 0) ? (numverts - 1) : (curv - 1)) + { + poly3d_t ooy; + edgeptr->v1 = &v[curv]; + edgeptr->v2 = &v[(curv == 0) ? (numverts - 1) : (curv - 1)]; + if (edgeptr->v1->y == edgeptr->v2->y) + continue; + ooy = 1.0 / (edgeptr->v2->y - edgeptr->v1->y); + edgeptr->dxdy = (edgeptr->v2->x - edgeptr->v1->x) * ooy; + for (paramnum = 0; paramnum < paramcount; paramnum++) + edgeptr->dpdy[paramnum] = (edgeptr->v2->p[paramnum] - edgeptr->v1->p[paramnum]) * ooy; + ++edgeptr; + } + + if ((fedgelist[0].v1 == bedgelist[0].v1 && fedgelist[0].dxdy < bedgelist[0].dxdy) || + (fedgelist[0].v1 != bedgelist[0].v1 && fedgelist[0].v1->x < bedgelist[0].v1->x)) + { + ledge = fedgelist; + redge = bedgelist; + } + else + { + ledge = bedgelist; + redge = fedgelist; + } + + for (curscan = minyclip; curscan < maxyclip; curscan++) + { + extent_t extent; + poly3d_t fully = (poly3d_t)curscan + 0.5; + poly3d_t startx, stopx; + INT32 istartx, istopx; + + while (fully > ledge->v2->y && fully < v[maxv].y) + ++ledge; + while (fully > redge->v2->y && fully < v[maxv].y) + ++redge; + if (!OWN_LINE(rc, curscan)) + continue; + startx = ledge->v1->x + (fully - ledge->v1->y) * ledge->dxdy; + stopx = redge->v1->x + (fully - redge->v1->y) * redge->dxdy; + + istartx = round_coordinate(startx); + istopx = round_coordinate(stopx); + if (istartx > istopx) { INT32 tmp = istartx; istartx = istopx; istopx = tmp; } + if (istartx < rc->minx) istartx = rc->minx; + if (istopx > rc->maxx + 1) istopx = rc->maxx + 1; + + if (paramcount > 0) + { + poly3d_t ldy = fully - ledge->v1->y; + poly3d_t rdy = fully - redge->v1->y; + poly3d_t oox = 1.0 / (stopx - startx); + for (paramnum = 0; paramnum < paramcount; paramnum++) + { + poly3d_t lparam = ledge->v1->p[paramnum] + ldy * ledge->dpdy[paramnum]; + poly3d_t rparam = redge->v1->p[paramnum] + rdy * redge->dpdy[paramnum]; + poly3d_t dpdx = (rparam - lparam) * oox; + extent.param[paramnum].start = lparam + ((poly3d_t)istartx + 0.5 - startx) * dpdx; + extent.param[paramnum].dpdx = dpdx; + } + } + + if (istartx >= istopx) + continue; + extent.startx = istartx; + extent.stopx = istopx; + callback(curscan, &extent, extra); + } } -READ32_HANDLER( namcos22_gamma_r ) +static int zclip_if_less(int numverts, const vertex_t *v, vertex_t *outv, int paramcount, poly3d_t clipval) { - return namcos22_gamma[offset]; + int prevclipped = (v[numverts - 1].p[0] < clipval); + vertex_t *nextout = outv; + int vertnum, paramnum; + + for (vertnum = 0; vertnum < numverts; vertnum++) + { + int thisclipped = (v[vertnum].p[0] < clipval); + if (thisclipped != prevclipped) + { + const vertex_t *v1 = &v[(vertnum == 0) ? (numverts - 1) : (vertnum - 1)]; + const vertex_t *v2 = &v[vertnum]; + poly3d_t frac = (clipval - v1->p[0]) / (v2->p[0] - v1->p[0]); + nextout->x = v1->x + frac * (v2->x - v1->x); + nextout->y = v1->y + frac * (v2->y - v1->y); + for (paramnum = 0; paramnum < paramcount; paramnum++) + nextout->p[paramnum] = v1->p[paramnum] + frac * (v2->p[paramnum] - v1->p[paramnum]); + ++nextout; + } + if (!thisclipped) + *nextout++ = v[vertnum]; + prevclipped = thisclipped; + } + return nextout - outv; +} + + +/*************************************************************************** + Color helpers (rgbaint_t: blend, scale, clamp) +***************************************************************************/ + +#define RGB_R(c) (((c) >> 16) & 0xff) +#define RGB_G(c) (((c) >> 8) & 0xff) +#define RGB_B(c) ((c) & 0xff) + +static INLINE int clamp255(int v) +{ + return (v < 0) ? 0 : (v > 255) ? 255 : v; +} + +/* blend(other, factor): (c * factor + other * (256 - factor)) >> 8 */ +#define BLEND(cr,cg,cb, or_,og,ob, factor) \ + do { int s1_ = (factor), s2_ = 256 - s1_; \ + cr = ((cr * s1_) + ((or_) * s2_)) >> 8; \ + cg = ((cg * s1_) + ((og) * s2_)) >> 8; \ + cb = ((cb * s1_) + ((ob) * s2_)) >> 8; } while (0) + +#define SCALE_IMM_CLAMP(cr,cg,cb, s) \ + do { int s_ = (s); \ + cr = clamp255((cr * s_) >> 8); \ + cg = clamp255((cg * s_) >> 8); \ + cb = clamp255((cb * s_) >> 8); } while (0) + +#define SCALE_CLAMP(cr,cg,cb, sr,sg,sb) \ + do { cr = clamp255((cr * (sr)) >> 8); \ + cg = clamp255((cg * (sg)) >> 8); \ + cb = clamp255((cb * (sb)) >> 8); } while (0) + +#define TO_RGB(cr,cg,cb) ((((cr) & 0xff) << 16) | (((cg) & 0xff) << 8) | ((cb) & 0xff)) + + +/*************************************************************************** + Scanline callbacks +***************************************************************************/ + +static void setup_cmode(const object_data *extra, const UINT32 **pens_out, int *penmask, int *penshift) +{ + const UINT32 *p = extra->pens; + *penmask = 0xff; + *penshift = 0; + if (extra->cmode & 4) + { + p += 0xec + ((extra->cmode & 8) << 1); + *penmask = 0x03; + *penshift = 2 * (~extra->cmode & 3); + } + else if (extra->cmode & 2) + { + p += 0xe0 + ((extra->cmode & 8) << 1); + *penmask = 0x0f; + *penshift = 4 * (~extra->cmode & 1); + } + *pens_out = p; +} + +/* texel lookup: tile32[to] = (tile << 12) | attr */ +#define TEXEL(tu_, tv_) \ + { \ + int tx_ = (int)(tu_) & 0xfff; \ + int ty_ = ((int)(tv_) & 0xfff) | bn; \ + UINT32 e_ = tt[((ty_ << 4) & 0xfff00) | (tx_ >> 4)]; \ + pen = tdata[((e_ >> 4) & 0xffff00) | ayx[((e_ & 0xf) << 8) | ((ty_ << 4) & 0xf0) | (tx_ & 0xf)]]; \ + } + +/* Perspective correction: MAME divides by z at every pixel. Here 1/z is exact + at the ends of spans of SPAN pixels and u/z, v/z, i/z are interpolated + linearly in between (the texel error stays well under a texel at these + sizes). Everything the loops use is in locals: the stores to the frame + could alias the object data otherwise. */ +#define SPAN 8 +static const float span_inv[SPAN + 1] = { 0.0f, 1.0f, 1.0f/2, 1.0f/3, 1.0f/4, 1.0f/5, 1.0f/6, 1.0f/7, 1.0f/8 }; + +/* start a span at x: tu/tv/ti and their steps over the next n pixels */ +#define SPAN_SETUP() \ + { \ + const float ooz0 = 1.0f / (float)z; \ + float ooz1; \ + poly3d_t u1, v1, i1; \ + left = stopx - x; \ + if (left > SPAN) left = SPAN; \ + z += left * dz; u1 = u + left * du; v1 = v + left * dv; i1 = i + left * di; \ + ooz1 = 1.0f / (float)z; \ + tu = (float)(u * ooz0); tv = (float)(v * ooz0); ti = (float)(i * ooz0); \ + dtu = ((float)(u1 * ooz1) - tu) * span_inv[left]; \ + dtv = ((float)(v1 * ooz1) - tv) * span_inv[left]; \ + dti = ((float)(i1 * ooz1) - ti) * span_inv[left]; \ + u = u1; v = v1; i = i1; \ + } + +static void renderscanline_poly(int scanline, const extent_t *extent, const object_data *extra) +{ + poly3d_t z = extent->param[0].start; + poly3d_t u = extent->param[1].start; + poly3d_t v = extent->param[2].start; + poly3d_t i = extent->param[3].start; + const poly3d_t dz = extent->param[0].dpdx; + const poly3d_t du = extent->param[1].dpdx; + const poly3d_t dv = extent->param[2].dpdx; + const poly3d_t di = extent->param[3].dpdx; + const int bn = extra->bn * 0x1000; + const int fogfactor = 0xff - extra->fogfactor; + const int fog = (fogfactor != 0xff); + const int fg_r = extra->fog_r, fg_g = extra->fog_g, fg_b = extra->fog_b; + const int tex = extra->texture_enabled, shade_en = extra->shade_enabled; + const int prio = extra->prioverchar; + const UINT32 *tt = texture_tile32; + const UINT8 *tdata = texture_tiledata; + const UINT8 *ayx = texture_ayx_to_pixel; + int pen = 0, penmask, penshift, x, left = 0; + float tu = 0, tv = 0, ti = 0, dtu = 0, dtv = 0, dti = 0; + const int stopx = extent->stopx; + const UINT32 *ppens; + UINT32 *dest = frame + scanline * SCREEN_W; + UINT8 *pri = primap + scanline * SCREEN_W; + + setup_cmode(extra, &ppens, &penmask, &penshift); + + for (x = extent->startx; x < stopx; x++) + { + UINT32 c; + int r, g, b; + + if (left == 0) + SPAN_SETUP() + + if (tex) + TEXEL(tu, tv) + c = ppens[(pen >> penshift) & penmask]; + r = RGB_R(c); g = RGB_G(c); b = RGB_B(c); + + if (fog) + BLEND(r, g, b, fg_r, fg_g, fg_b, fogfactor); + + /* shading after fog */ + if (shade_en) + { + int shade = (int)ti; + SCALE_IMM_CLAMP(r, g, b, shade << 2); + } + + dest[x] = TO_RGB(r, g, b); + pri[x] = (pri[x] & ~1) | prio; + + tu += dtu; + tv += dtv; + ti += dti; + left--; + } +} + +static void renderscanline_poly_ss22(int scanline, const extent_t *extent, const object_data *extra) +{ + poly3d_t z = extent->param[0].start; + poly3d_t u = extent->param[1].start; + poly3d_t v = extent->param[2].start; + poly3d_t i = extent->param[3].start; + const poly3d_t dz = extent->param[0].dpdx; + const poly3d_t du = extent->param[1].dpdx; + const poly3d_t dv = extent->param[2].dpdx; + const poly3d_t di = extent->param[3].dpdx; + const int bn = extra->bn * 0x1000; + const int fogfactor = 0xff - extra->fogfactor; + const int fadefactor = 0xff - extra->fadefactor; + const int alphafactor = 0xff - extra->alpha; + const int fog = (fogfactor != 0xff); + const int fade = (fadefactor != 0xff); + const int alpha = (alphafactor != 0xff); + const int alpha_all = extra->alpha_enabled; + const int alpha_pen = poly_alpha_pen; + const int fg_r = extra->fog_r, fg_g = extra->fog_g, fg_b = extra->fog_b; + const int fade_r = extra->fade_r, fade_g = extra->fade_g, fade_b = extra->fade_b; + const int pfade = extra->pfade_enabled; + const int pc_r = extra->polycolor_r, pc_g = extra->polycolor_g, pc_b = extra->polycolor_b; + const int tex = extra->texture_enabled, shade_en = extra->shade_enabled; + const int prio = extra->prioverchar; + const UINT32 *tt = texture_tile32; + const UINT8 *tdata = texture_tiledata; + const UINT8 *ayx = texture_ayx_to_pixel; + int pen = 0, penmask, penshift, x, left = 0; + float tu = 0, tv = 0, ti = 0, dtu = 0, dtv = 0, dti = 0; + const int stopx = extent->stopx; + const UINT32 *ppens; + UINT32 *dest = frame + scanline * SCREEN_W; + UINT8 *pri = primap + scanline * SCREEN_W; + + setup_cmode(extra, &ppens, &penmask, &penshift); + + for (x = extent->startx; x < stopx; x++) + { + UINT32 c; + int r, g, b; + + if (left == 0) + SPAN_SETUP() + + if (tex) + TEXEL(tu, tv) + c = ppens[(pen >> penshift) & penmask]; + r = RGB_R(c); g = RGB_G(c); b = RGB_B(c); + + /* shading before fog */ + if (shade_en) + { + int shade = (int)ti; + SCALE_IMM_CLAMP(r, g, b, shade << 2); + } + + if (fog) + BLEND(r, g, b, fg_r, fg_g, fg_b, fogfactor); + + if (pfade) + SCALE_CLAMP(r, g, b, pc_r, pc_g, pc_b); + + if (fade) + BLEND(r, g, b, fade_r, fade_g, fade_b, fadefactor); + + if (alpha && (alpha_all || pen == alpha_pen)) + { + UINT32 d = dest[x]; + BLEND(r, g, b, (int)RGB_R(d), (int)RGB_G(d), (int)RGB_B(d), alphafactor); + } + + dest[x] = TO_RGB(r, g, b); + pri[x] = (pri[x] & ~1) | prio; + + tu += dtu; + tv += dtv; + ti += dti; + left--; + } +} + +/* the common case: textured and shaded, no poly fade, no global fade, no + alpha; with or without fog. Super System 22 shades before the fog, System 22 + after it. Same results as the generic loops. */ +#define SS22_FAST_BODY(FOG, SHADE_FIRST) \ + poly3d_t z = extent->param[0].start; \ + poly3d_t u = extent->param[1].start; \ + poly3d_t v = extent->param[2].start; \ + poly3d_t i = extent->param[3].start; \ + const poly3d_t dz = extent->param[0].dpdx; \ + const poly3d_t du = extent->param[1].dpdx; \ + const poly3d_t dv = extent->param[2].dpdx; \ + const poly3d_t di = extent->param[3].dpdx; \ + const int bn = extra->bn * 0x1000; \ + const int fogfactor = 0xff - extra->fogfactor; \ + const int fg_r = extra->fog_r, fg_g = extra->fog_g, fg_b = extra->fog_b; \ + const int prio = extra->prioverchar; \ + const UINT32 *tt = texture_tile32; \ + const UINT8 *tdata = texture_tiledata; \ + const UINT8 *ayx = texture_ayx_to_pixel; \ + int pen, penmask, penshift, x, left = 0, lastkey = -1; \ + const UINT8 *tile = tdata, *tileayx = ayx; \ + float tu = 0, tv = 0, ti = 0, dtu = 0, dtv = 0, dti = 0; \ + const int stopx = extent->stopx; \ + const UINT32 *ppens; \ + UINT32 *dest = frame + scanline * SCREEN_W; \ + UINT8 *pri = primap + scanline * SCREEN_W; \ + \ + setup_cmode(extra, &ppens, &penmask, &penshift); \ + \ + for (x = extent->startx; x < stopx; x++) \ + { \ + UINT32 c; \ + int r, g, b, s; \ + \ + if (left == 0) \ + SPAN_SETUP() \ + { \ + /* the tile only changes every few pixels */ \ + int tx_ = (int)tu & 0xfff; \ + int ty_ = ((int)tv & 0xfff) | bn; \ + int key_ = ((ty_ << 4) & 0xfff00) | (tx_ >> 4); \ + if (key_ != lastkey) \ + { \ + UINT32 e_ = tt[key_]; \ + tile = tdata + ((e_ >> 4) & 0xffff00); \ + tileayx = ayx + ((e_ & 0xf) << 8); \ + lastkey = key_; \ + } \ + pen = tile[tileayx[((ty_ << 4) & 0xf0) | (tx_ & 0xf)]]; \ + } \ + c = ppens[(pen >> penshift) & penmask]; \ + \ + r = RGB_R(c); g = RGB_G(c); b = RGB_B(c); \ + if (FOG && !SHADE_FIRST) \ + BLEND(r, g, b, fg_r, fg_g, fg_b, fogfactor); \ + \ + /* shading: a negative factor gives 0, like the clamp */ \ + s = (int)ti << 2; \ + if (s < 0) s = 0; \ + r = (r * s) >> 8; if (r > 255) r = 255; \ + g = (g * s) >> 8; if (g > 255) g = 255; \ + b = (b * s) >> 8; if (b > 255) b = 255; \ + \ + if (FOG && SHADE_FIRST) \ + BLEND(r, g, b, fg_r, fg_g, fg_b, fogfactor); \ + \ + dest[x] = (r << 16) | (g << 8) | b; \ + pri[x] = (pri[x] & ~1) | prio; \ + \ + tu += dtu; \ + tv += dtv; \ + ti += dti; \ + left--; \ + } + +static void renderscanline_poly_ss22_fast(int scanline, const extent_t *extent, const object_data *extra) +{ + SS22_FAST_BODY(0, 1) +} + +static void renderscanline_poly_ss22_fast_fog(int scanline, const extent_t *extent, const object_data *extra) +{ + SS22_FAST_BODY(1, 1) +} + +static void renderscanline_poly_fast(int scanline, const extent_t *extent, const object_data *extra) +{ + SS22_FAST_BODY(0, 0) +} + +static void renderscanline_poly_fast_fog(int scanline, const extent_t *extent, const object_data *extra) +{ + SS22_FAST_BODY(1, 0) +} + +static void renderscanline_sprite(int scanline, const extent_t *extent, const object_data *extra) +{ + int y_index = (int)(extent->param[1].start - extra->flipy); + float x_index = (float)(extent->param[0].start - extra->flipx); + float dx = (float)extent->param[0].dpdx; + const UINT32 *pal = extra->pens; + int prioverchar = extra->prioverchar; + int alphafactor = extra->alpha; + int alpha_pen = poly_alpha_pen; + int fogfactor = 0xff - extra->fogfactor; + int fadefactor = 0xff - extra->fadefactor; + const UINT8 *source = extra->source + y_index * extra->line_modulo; + UINT32 *dest = frame + scanline * SCREEN_W; + UINT8 *pri = primap + scanline * SCREEN_W; + int x; + + for (x = extent->startx; x < extent->stopx; x++) + { + int pen = source[(int)x_index]; + if (pen != 0xff) + { + UINT32 c = pal[pen]; + int r = RGB_R(c), g = RGB_G(c), b = RGB_B(c); + + if (fogfactor != 0xff) + BLEND(r, g, b, extra->fog_r, extra->fog_g, extra->fog_b, fogfactor); + + if (fadefactor != 0xff) + BLEND(r, g, b, extra->fade_r, extra->fade_g, extra->fade_b, fadefactor); + + if (alphafactor != 0xff && (extra->alpha_enabled || pen == alpha_pen)) + BLEND(r, g, b, (int)RGB_R(dest[x]), (int)RGB_G(dest[x]), (int)RGB_B(dest[x]), alphafactor); + + dest[x] = TO_RGB(r, g, b); + pri[x] = (pri[x] & ~1) | prioverchar; + } + x_index += dx; + } +} + +static void dispatch_scanline_poly(const raster_clip *rc, scanline_func callback, const object_data *extra, int clipverts, const vertex_t *clipv) +{ + switch (clipverts) + { + case 3: render_triangle(rc, callback, extra, 4, &clipv[0], &clipv[1], &clipv[2]); break; + case 4: case 5: case 6: render_polygon(rc, callback, extra, 4, clipverts, clipv); break; + } +} + +/* the clip rectangle of a primitive, on the screen; 0 if empty */ +static int make_clip(raster_clip *rc, const raster_clip *band, int minx, int maxx, int miny, int maxy) +{ + rc->minx = (minx > 0) ? minx : 0; + rc->maxx = (maxx < SCREEN_W - 1) ? maxx : SCREEN_W - 1; + rc->miny = (miny > 0) ? miny : 0; + rc->maxy = (maxy < SCREEN_H - 1) ? maxy : SCREEN_H - 1; + rc->band = band->band; + rc->nbands = band->nbands; + return rc->minx <= rc->maxx && rc->miny <= rc->maxy; +} + + +/*************************************************************************** + Quads and sprites +***************************************************************************/ + +static void poly3d_drawquad(const raster_clip *band, struct scenenode *node) +{ + vertex_t v[4]; + vertex_t clipv[6]; + int clipverts, vertnum; + int direct = node->data.quad.direct; + int cx = 320 + node->data.quad.vx; + int cy = 240 + node->data.quad.vy; + int color, cz_value, cz_type, cz_adj, objflags; + object_data extra; + raster_clip rc; + + /* scene clip */ + if (!make_clip(&rc, band, cx + node->data.quad.vl, cx - node->data.quad.vr - 1, cy + node->data.quad.vu, cy - node->data.quad.vd - 1)) + return; + + if (!direct) + { + /* project and z-clip */ + for (vertnum = 0; vertnum < 4; vertnum++) + { + v[vertnum].x = node->data.quad.v[vertnum].x; + v[vertnum].y = node->data.quad.v[vertnum].y; + v[vertnum].p[0] = node->data.quad.v[vertnum].z; + v[vertnum].p[1] = node->data.quad.v[vertnum].u; + v[vertnum].p[2] = node->data.quad.v[vertnum].v; + v[vertnum].p[3] = node->data.quad.v[vertnum].bri; + } + + clipverts = zclip_if_less(4, v, clipv, 4, 0.00001); + if (clipverts < 3) + return; + + for (vertnum = 0; vertnum < clipverts; vertnum++) + { + poly3d_t ooz = 1.0 / clipv[vertnum].p[0]; + clipv[vertnum].x = cx + clipv[vertnum].x * ooz; + clipv[vertnum].y = cy - clipv[vertnum].y * ooz; + clipv[vertnum].p[0] = ooz; + clipv[vertnum].p[1] = (clipv[vertnum].p[1] + 0.5) * ooz; + clipv[vertnum].p[2] = (clipv[vertnum].p[2] + 0.5) * ooz; + clipv[vertnum].p[3] = (clipv[vertnum].p[3] + 0.5) * ooz; + } + } + else + { + /* direct: no clipping, z is 1/z */ + clipverts = 4; + for (vertnum = 0; vertnum < 4; vertnum++) + { + poly3d_t ooz = node->data.quad.v[vertnum].z; + clipv[vertnum].x = cx + node->data.quad.v[vertnum].x; + clipv[vertnum].y = cy - node->data.quad.v[vertnum].y; + clipv[vertnum].p[0] = ooz; + clipv[vertnum].p[1] = (node->data.quad.v[vertnum].u + 0.5) * ooz; + clipv[vertnum].p[2] = (node->data.quad.v[vertnum].v + 0.5) * ooz; + clipv[vertnum].p[3] = (node->data.quad.v[vertnum].bri + 0.5) * ooz; + } + } + + color = node->data.quad.color; + cz_value = node->data.quad.cz_value; + cz_type = node->data.quad.cz_type; + cz_adj = node->data.quad.cz_adjust; + objflags = node->data.quad.objectflags; + + memset(&extra, 0, sizeof(extra)); + extra.pfade_enabled = 0; + extra.alpha_enabled = 0; + extra.shade_enabled = 1; + extra.texture_enabled = 1; + extra.fadefactor = 0; + extra.fogfactor = 0; + + extra.pens = &pens[(color & 0x7f) << 8]; + extra.bn = node->data.quad.texturebank; + extra.cmode = node->data.quad.cmode; + extra.prioverchar = ((node->data.quad.cmode & 7) == 1) ? 1 : 0; + extra.prioverchar |= namcos22_is_ss22 ? 2 : 0; + + if (namcos22_is_ss22) + { + /* global fade */ + if (mixer_flags & 1) + { + extra.fadefactor = screen_fade_factor; + extra.fade_r = screen_fade_r; extra.fade_g = screen_fade_g; extra.fade_b = screen_fade_b; + } + + /* poly fade */ + extra.pfade_enabled = poly_fade_enabled; + extra.polycolor_r = poly_fade_r; extra.polycolor_g = poly_fade_g; extra.polycolor_b = poly_fade_b; + + /* alpha */ + extra.alpha = poly_alpha_factor; + extra.alpha_enabled = (color & 0x7f) != poly_alpha_color; + + /* poly fog */ + if (~color & 0x80) + { + int bank = (czattr[6] >> (cz_type * 2)) & 3; + int bank_enabled = (czattr[4] >> (bank * 4)) & 4; + + if (bank_enabled) + { + INT16 delta = czattr[bank]; + int fogfactor; + + /* sign-extend */ + if (delta < 0) delta |= 0xff00; + else delta &= 0x00ff; + + extra.fog_r = fog_r; extra.fog_g = fog_g; extra.fog_b = fog_b; + + fogfactor = recalc_czram[bank][cz_value] + delta; + extra.fogfactor = (fogfactor < 0) ? 0 : (fogfactor > 0xff) ? 0xff : fogfactor; + } + } + } + else + { + /* poly fog */ + if (~color & 0x80) + { + int cz_color = cz_type & ((fog_colormask >> (8 * (3 - cz_type))) & 0xff); + extra.fog_r = fog_r_per_cztype[cz_color]; + extra.fog_g = fog_g_per_cztype[cz_color]; + extra.fog_b = fog_b_per_cztype[cz_color]; + extra.fogfactor = NTHBYTE32(namcos22_czram, (cz_type << 13) | cz_value); + } + } + + /* disable textures, shading (and maybe more) */ + if (objflags) + { + extra.texture_enabled = 0; + extra.cmode = 0; + + if (objflags & 6) + { + /* absolute pen from cz_adjust, no shading */ + extra.pens = &pens[cz_adj & 0x7fff]; + extra.shade_enabled = 0; + } + else + extra.pens += ((cz_adj >> 16) & 0x7f) & (color | 0x1f); + } + + /* disable poly fog */ + if (cz_adj & 0x800000) + extra.fogfactor = 0; + + if (namcos22_is_ss22) + { + if (extra.texture_enabled && extra.shade_enabled && !extra.pfade_enabled && extra.fadefactor == 0 && extra.alpha == 0) + dispatch_scanline_poly(&rc, extra.fogfactor ? renderscanline_poly_ss22_fast_fog : renderscanline_poly_ss22_fast, &extra, clipverts, clipv); + else + dispatch_scanline_poly(&rc, renderscanline_poly_ss22, &extra, clipverts, clipv); + } + else if (extra.texture_enabled && extra.shade_enabled) + dispatch_scanline_poly(&rc, extra.fogfactor ? renderscanline_poly_fast_fog : renderscanline_poly_fast, &extra, clipverts, clipv); + else + dispatch_scanline_poly(&rc, renderscanline_poly, &extra, clipverts, clipv); +} + +static void poly3d_drawsprite(const raster_clip *rc, UINT32 code, UINT32 color, int flipx, int flipy, int sx, int sy, + int scalex, int scaley, int cz_factor, int prioverchar, int fade_enabled, int alpha) +{ + int sprite_screen_height = (scaley * 32 + 0x8000) >> 16; + int sprite_screen_width = (scalex * 32 + 0x8000) >> 16; + + if (sprite_screen_width && sprite_screen_height) + { + poly3d_t fsx = sx, fsy = sy; + poly3d_t fsw = sprite_screen_width, fsh = sprite_screen_height; + object_data extra; + vertex_t vert[4]; + + memset(&extra, 0, sizeof(extra)); + extra.fadefactor = 0; + extra.fogfactor = 0; + extra.prioverchar = 2 | prioverchar; + extra.line_modulo = 32; + extra.flipx = flipx; + extra.flipy = flipy; + extra.pens = &pens[(color & 0x7f) << 8]; + extra.source = sprite_data + (code % sprite_count) * 32 * 32; + + vert[0].x = fsx; vert[0].y = fsy; vert[0].p[0] = 0; vert[0].p[1] = 0; + vert[1].x = fsx + fsw; vert[1].y = fsy; vert[1].p[0] = 32; vert[1].p[1] = 0; + vert[2].x = fsx + fsw; vert[2].y = fsy + fsh; vert[2].p[0] = 32; vert[2].p[1] = 32; + vert[3].x = fsx; vert[3].y = fsy + fsh; vert[3].p[0] = 0; vert[3].p[1] = 32; + + /* global fade */ + if ((mixer_flags & 2) || fade_enabled) + { + extra.fadefactor = screen_fade_factor; + extra.fade_r = screen_fade_r; extra.fade_g = screen_fade_g; extra.fade_b = screen_fade_b; + } + + /* sprite fog */ + if ((~color & 0x80) && cz_factor > 0) + { + extra.fogfactor = cz_factor; + extra.fog_r = fog_r; extra.fog_g = fog_g; extra.fog_b = fog_b; + } + + /* alpha */ + extra.alpha = alpha; + extra.alpha_enabled = (color & 0x7f) != poly_alpha_color; + + render_polygon(rc, renderscanline_sprite, &extra, 2, 4, vert); + } +} + +static void render_sprite(const raster_clip *band, struct scenenode *node) +{ + int offset = 0, row, col; + raster_clip rc; + + if (!make_clip(&rc, band, node->data.sprite.cx_min, node->data.sprite.cx_max, node->data.sprite.cy_min, node->data.sprite.cy_max)) + return; + + for (row = 0; row < node->data.sprite.rows; row++) + { + for (col = 0; col < node->data.sprite.cols; col++) + { + int code = node->data.sprite.tile; + if (node->data.sprite.linktype == 0xff) + code += offset; + else + code += NTHWORD32(&namcos22_spriteram[0x800 / 4], offset + node->data.sprite.linktype * 4); + + poly3d_drawsprite( + &rc, + code, + node->data.sprite.color, + node->data.sprite.flipx, + node->data.sprite.flipy, + node->data.sprite.xpos + col * node->data.sprite.sizex, + node->data.sprite.ypos + row * node->data.sprite.sizey, + (node->data.sprite.sizex << 16) / 32, + (node->data.sprite.sizey << 16) / 32, + node->data.sprite.cz, + node->data.sprite.prioverchar, + node->data.sprite.fade_enabled, + 0xff - node->data.sprite.alpha); + offset++; + } + } +} + +static void render_scene_nodes(const raster_clip *band, const struct scenenode *node) +{ + if (!node) + return; + + if (node->type == NODE_NONLEAF) + { + int i; + for (i = RADIX_BUCKETS - 1; i >= 0; i--) + render_scene_nodes(band, node->data.nonleaf.next[i]); + } + else + { + while (node) + { + if (node->type == NODE_QUAD) + poly3d_drawquad(band, (struct scenenode *)node); + else if (node->type == NODE_SPRITE) + render_sprite(band, (struct scenenode *)node); + node = node->next; + } + } +} + +/* the scene, by the scanlines of one band */ +static void render_scene_band(int bandnum, int nbands) +{ + raster_clip band; + int i; + + band.minx = 0; + band.maxx = SCREEN_W - 1; + band.miny = 0; + band.maxy = SCREEN_H - 1; + band.band = bandnum; + band.nbands = nbands; + for (i = RADIX_BUCKETS - 1; i >= 0; i--) + render_scene_nodes(&band, scenenode_root.data.nonleaf.next[i]); } /* - +0x0002.w Fader Enable(?) (0: disabled) - +0x0011.w Display Fader (R) (0x0100 = 1.0) - +0x0013.w Display Fader (G) (0x0100 = 1.0) - +0x0015.w Display Fader (B) (0x0100 = 1.0) - +0x0100.b Fog1 Color (R) (world fogging) - +0x0101.b Fog2 Color (R) (used for heating of brake-disc on RV1) - +0x0180.b Fog1 Color (G) - +0x0181.b Fog2 Color (G) - +0x0200.b Fog1 Color (B) - +0x0201.b Fog2 Color (B) + Threaded video: with the "Threaded Video" core option the scene is drawn + by several threads, each one on its strips of 16 scanlines (y / 16 modulo + the threads). The scene and the state it reads stay the same while they + draw, a pixel is written by one thread only and in the same order: the + picture is the same as with one thread. */ +#ifdef HAVE_THREADS +#include +#define S22_MAX_THREADS 4 -/** - * 0x800000: 08380000 - * - * 0x810000: 0004 0004 0004 0004 4444 - * ^^^^ ^^^^ ^^^^ ^^^^ fog thickness? 0 if disabled - * - * 0x810200..0x8103ff: 0x100 words (depth cueing table) - * 0000 0015 002a 003f 0054 0069 007e 0093 - * 00a8 00bd 00d2 00e7 00fc 0111 0126 013b - * - * 0x810400..0x810403: (air combat22?) - * 0x820000..0x8202ff: ? - * - * 0x824000..0x8243ff: gamma - * Prop Cycle: start of stage#2 - * ffffff00 00ffffff 0000007f 00000000 - * 0000ff00 0f00ffff ff00017f 00010007 - * 00000001 - * - * Prop Cycle: submerged in swamp - * ffffff00 0003ffae 0000007f 00000000 - * 0000ff00 0f00ffff ff00017f 00010007 - * 00000001 - * - * 0x860000..0x860007: ? - */ -WRITE32_HANDLER( namcos22_gamma_w ) +static struct { - data32_t old = namcos22_gamma[offset]; - COMBINE_DATA( &namcos22_gamma[offset] ); - if( old!=namcos22_gamma[offset] ) + sthread_t *thread[S22_MAX_THREADS]; + int index[S22_MAX_THREADS]; + slock_t *lock; + scond_t *start, *done; + int workers; + int gen; + int bands; + int pending; + int quit; + void (*job)(int band, int nbands); +} s22_mt; + +static void s22_band_worker(void *arg) +{ + const int i = *(const int *)arg; + int seen = 0; + + slock_lock(s22_mt.lock); + for (;;) { - memset( dirtypal, 1, NAMCOS22_PALETTE_SIZE/4 ); + while (s22_mt.gen == seen && !s22_mt.quit) + scond_wait(s22_mt.start, s22_mt.lock); + if (s22_mt.quit) + break; + seen = s22_mt.gen; + if (i < s22_mt.bands) + { + int bands = s22_mt.bands; + void (*job)(int, int) = s22_mt.job; + slock_unlock(s22_mt.lock); + job(i, bands); + slock_lock(s22_mt.lock); + if (--s22_mt.pending == 0) + scond_signal(s22_mt.done); + } } - /** - * 824000: ffffff00 00ffffff 0000007f 00000000 - * ^^^^^^ RGB(fog) - * - * 824010: 0000ff00 0f00RRGG BBII017f 00010007 - * ^^^^ ^^ RGB(fade) - * ^^ fade (zero for none, 0xff for max) - * ^^ flags; fader targer - * 1: affects polygon layer - * 2: affects text(?) - * 4: affects sprites(?) - * ^^ tilemap palette base - * - * 824020: 00000001 00000000 00000000 00000000 - * - * 824100: 00 05 0a 0f 13 17 1a 1e ... (red) - * 824200: 00 05 0a 0f 13 17 1a 1e ... (green) - * 824300: 00 05 0a 0f 13 17 1a 1e ... (blue) - */ + slock_unlock(s22_mt.lock); } -READ32_HANDLER( namcos22_paletteram_r ) +static void s22_threads_stop(void) { - return paletteram32[offset]; + int i; + if (!s22_mt.lock) + return; + slock_lock(s22_mt.lock); + s22_mt.quit = 1; + scond_broadcast(s22_mt.start); + slock_unlock(s22_mt.lock); + for (i = 1; i < s22_mt.workers + 1; i++) + sthread_join(s22_mt.thread[i]); + scond_free(s22_mt.start); + scond_free(s22_mt.done); + slock_free(s22_mt.lock); + memset(&s22_mt, 0, sizeof(s22_mt)); +} + +/* the frame in bands; 0 if there are no threads (the caller draws it alone) */ +static int render_frame_threaded(void (*job)(int band, int nbands)) +{ + int bands = options.stv_video_threads, i; + + if (bands > S22_MAX_THREADS) + bands = S22_MAX_THREADS; + if (bands < 2) + return 0; + if (!s22_mt.lock) + { + s22_mt.lock = slock_new(); + s22_mt.start = scond_new(); + s22_mt.done = scond_new(); + if (!s22_mt.lock || !s22_mt.start || !s22_mt.done) + return 0; + } + while (s22_mt.workers < bands - 1) + { + i = s22_mt.workers + 1; + s22_mt.index[i] = i; + s22_mt.thread[i] = sthread_create(s22_band_worker, &s22_mt.index[i]); + if (!s22_mt.thread[i]) + break; + s22_mt.workers++; + } + if (bands > s22_mt.workers + 1) + bands = s22_mt.workers + 1; + if (bands < 2) + return 0; + + slock_lock(s22_mt.lock); + s22_mt.job = job; + s22_mt.bands = bands; + s22_mt.pending = bands - 1; + s22_mt.gen++; + scond_broadcast(s22_mt.start); + slock_unlock(s22_mt.lock); + + job(0, bands); + + slock_lock(s22_mt.lock); + while (s22_mt.pending) + scond_wait(s22_mt.done, s22_mt.lock); + slock_unlock(s22_mt.lock); + return 1; +} +#endif + +static void render_frame(void (*job)(int band, int nbands)) +{ + int i; +#ifdef HAVE_THREADS + if (!render_frame_threaded(job)) +#endif + job(0, 1); + + for (i = 0; i < RADIX_BUCKETS; i++) + scenenode_root.data.nonleaf.next[i] = NULL; + node_used = 0; +} + +/* for the core options: is the "Threaded Video" option of any use here */ +int namcos22_video_threads_available(void) +{ +#ifdef HAVE_THREADS + return 1; +#else + return 0; +#endif +} + + +/*************************************************************************** + Slave DSP simulation: the display list in polygon RAM +***************************************************************************/ + +static float dspfixed_to_nativefloat(INT16 val) +{ + return val / (float)0x7fff; +} + +static float dspfloat_to_nativefloat(UINT32 val) +{ + INT16 mantissa = (INT16)val; + float result = (float)mantissa; + int exponent = (val >> 16) & 0x3f; + while (exponent < 0x2e) + { + result /= 2.0f; + exponent++; + } + return result; +} + +static void matrix3d_multiply(float a[4][4], float b[4][4]) +{ + float result[4][4]; + int row, col, i; + for (row = 0; row < 4; row++) + for (col = 0; col < 4; col++) + { + float sum = 0.0f; + for (i = 0; i < 4; i++) + sum += a[row][i] * b[i][col]; + result[row][col] = sum; + } + memcpy(a, result, sizeof(result)); +} + +static void matrix3d_identity(float m[4][4]) +{ + int row, col; + for (row = 0; row < 4; row++) + for (col = 0; col < 4; col++) + m[row][col] = (row == col) ? 1.0f : 0.0f; +} + +static void matrix3d_apply_reflection(float m[4][4]) +{ + float r[4][4]; + if (!reflection) + return; + matrix3d_identity(r); + if (reflection & 0x10) r[0][0] = -1.0f; + if (reflection & 0x20) r[1][1] = -1.0f; + matrix3d_multiply(m, r); +} + +static void transform_point(float *vx, float *vy, float *vz, float m[4][4]) +{ + float x = *vx, y = *vy, z = *vz; + *vx = m[0][0]*x + m[1][0]*y + m[2][0]*z + m[3][0]; + *vy = m[0][1]*x + m[1][1]*y + m[2][1]*z + m[3][1]; + *vz = m[0][2]*x + m[1][2]*y + m[2][2]*z + m[3][2]; +} + +static void transform_normal(float *nx, float *ny, float *nz, float m[4][4]) +{ + float x = *nx, y = *ny, z = *nz; + *nx = m[0][0]*x + m[1][0]*y + m[2][0]*z; + *ny = m[0][1]*x + m[1][1]*y + m[2][1]*z; + *nz = m[0][2]*x + m[1][2]*y + m[2][2]*z; +} + +static void register_normals(int addr, float m[4][4]) +{ + int i; + for (i = 0; i < 4; i++) + { + float nx = dspfixed_to_nativefloat(namcos22_point_read(addr + i * 3 + 0)); + float ny = dspfixed_to_nativefloat(namcos22_point_read(addr + i * 3 + 1)); + float nz = dspfixed_to_nativefloat(namcos22_point_read(addr + i * 3 + 2)); + float cxl = camera_lx, cyl = camera_ly, czl = camera_lz; + float dotproduct; + + transform_normal(&nx, &ny, &nz, m); + transform_normal(&cxl, &cyl, &czl, viewmatrix); + + dotproduct = nx*cxl + ny*cyl + nz*czl; + if (dotproduct < 0.0f) + dotproduct = 0.0f; + + if (lit_surface_count < MAX_LIT_SURFACES) + lit_surface_info[lit_surface_count++] = (UINT8)(int)(camera_ambient + lit_surface_intensity * dotproduct); + } +} + +void namcos22_draw_direct_poly(const UINT16 *src) +{ + /* the master DSP can write directly to the render device (port 0xc) */ + struct scenenode *node; + UINT32 zsort; + int i; + + if (namcos22_is_ss22 && !(NTHBYTE32(namcos22_mixer, 0x1f) & 1)) + return; + + zsort = ((src[1] & 0xfff) << 12) | (src[0] & 0xfff); + node = new_scenenode(zsort, NODE_QUAD); + if (!node) + return; + + if (namcos22_is_ss22) + { + node->data.quad.cmode = (src[2] & 0x00f0) >> 4; + node->data.quad.texturebank = (src[2] & 0x000f); + } + else + { + node->data.quad.cmode = (src[0 + 4] & 0xf000) >> 12; + node->data.quad.texturebank = (src[1 + 4] & 0xf000) >> 12; + } + node->data.quad.color = (src[2] & 0xff00) >> 8; + node->data.quad.cz_value = (src[3] >> 2) & 0x1fff; + node->data.quad.cz_type = src[3] & 3; + node->data.quad.cz_adjust = 0; + node->data.quad.objectflags = 0; + src += 4; + + for (i = 0; i < 4; i++) + { + polyvertex *p = &node->data.quad.v[i]; + int mantissa, exponent; + + if (namcos22_is_ss22) + { + p->u = src[0] >> 4; + p->v = src[1] >> 4; + } + else + { + p->u = src[0] & 0x0fff; + p->v = src[1] & 0x0fff; + } + + mantissa = src[5]; + exponent = src[4] & 0x3f; + if (mantissa) + { + p->z = mantissa; + while (exponent < 0x2e) + { + p->z /= 2.00f; + exponent++; + } + } + else + p->z = (float)0x10000; + + p->x = (INT16)src[2]; + p->y = -(INT16)src[3]; + p->bri = src[4] >> 8; + src += 6; + } + + node->data.quad.direct = 1; + node->data.quad.vx = 0; + node->data.quad.vy = 0; + node->data.quad.vu = -240; + node->data.quad.vd = -240; + node->data.quad.vl = -320; + node->data.quad.vr = -320; +} + +static void blit_single_quad(UINT32 color, UINT32 addr, float m[4][4], int polyshift, int flags, int packetformat) +{ + polyvertex v[4]; + float zmin = 0.0f, zmax = 0.0f; + int zsort = 0, abs_priority, cz_value, i; + struct scenenode *node; + + for (i = 0; i < 4; i++) + { + polyvertex *pv = &v[i]; + pv->x = namcos22_point_read(0x8 + i * 3 + addr); + pv->y = namcos22_point_read(0x9 + i * 3 + addr); + pv->z = namcos22_point_read(0xa + i * 3 + addr); + transform_point(&pv->x, &pv->y, &pv->z, m); + } + + for (i = 0; i < 4; i++) + { + if (i == 0 || v[i].z > zmax) zmax = v[i].z; + if (i == 0 || v[i].z < zmin) zmin = v[i].z; + } + + /* fully behind camera */ + if (zmax < 0.0f) + return; + + /* backface cull one-sided polygons */ + if (flags & 0x20) + { + float c1 = + (v[2].x*((v[0].z*v[1].y)-(v[0].y*v[1].z)))+ + (v[2].y*((v[0].x*v[1].z)-(v[0].z*v[1].x)))+ + (v[2].z*((v[0].y*v[1].x)-(v[0].x*v[1].y))); + float c2 = + (v[0].x*((v[2].z*v[3].y)-(v[2].y*v[3].z)))+ + (v[0].y*((v[2].x*v[3].z)-(v[2].z*v[3].x)))+ + (v[0].z*((v[2].y*v[3].x)-(v[2].x*v[3].y))); + + if ((cullflip && c1 <= 0.0f && c2 <= 0.0f) || (!cullflip && c1 >= 0.0f && c2 >= 0.0f)) + return; + } + + if (zmin < 0.0f) zmin = 0.0f; + + switch (flags & 0x300) + { + case 0x000: zsort = (int)(zmin + 0.5f); break; + case 0x100: zsort = (int)(zmax + 0.5f); break; + default: zsort = (int)((zmin + zmax) / 2.0f + 0.5f); break; + } + + if (zsort > 0x1fffff) zsort = 0x1fffff; + abs_priority = absolute_priority & 7; + + /* relative: representative z + shift values */ + if (polyshift & 0x200000) + zsort = polyshift & 0x1fffff; + else + { + zsort += SIGNED18(polyshift); + abs_priority += (polyshift & 0x1c0000) >> 18; + } + + if (objectshift & 0x200000) + zsort = objectshift & 0x1fffff; + else + { + zsort += SIGNED18(objectshift); + abs_priority += (objectshift & 0x1c0000) >> 18; + } + + if (zsort < 0) zsort = 0; + if (zsort > 0x1fffff) zsort = 0x1fffff; + abs_priority &= 7; + zsort |= (abs_priority << 21); + + if (zmax < 0.0f) zmax = 0.0f; + if (zmax > (float)0x1fffff) zmax = (float)0x1fffff; + cz_value = (int)(zmax + 0.5f); + + /* u, v */ + for (i = 0; i < 4; i++) + { + v[i].u = namcos22_point_read(0 + i * 2 + addr); + v[i].v = namcos22_point_read(1 + i * 2 + addr); + } + + /* bri */ + if (lit_surface_count > 0) + { + if (lit_surface_gouraud) + { + int index = lit_surface_triangles ? (lit_surface_index >> 1) : lit_surface_index; + int normal_index[4]; + normal_index[0] = 0; + normal_index[1] = lit_surface_width; + normal_index[2] = lit_surface_width + 1; + normal_index[3] = 1; + index = index / (lit_surface_width - 1) + index; + + for (i = 0; i < 4; i++) + v[i].bri = lit_surface_info[(index + normal_index[i]) & (MAX_LIT_SURFACES - 1)]; + + if (lit_surface_triangles) + { + if (lit_surface_index & 1) + v[0].bri = v[1].bri; + else + v[2].bri = v[3].bri; + } + } + else + { + for (i = 0; i < 4; i++) + v[i].bri = lit_surface_info[lit_surface_index & (MAX_LIT_SURFACES - 1)]; + } + } + else if (packetformat & 0x40) + { + for (i = 0; i < 4; i++) + v[i].bri = (namcos22_point_read(i + addr) >> 16) & 0xff; + } + else + { + for (i = 0; i < 4; i++) + v[i].bri = (color >> 16) & 0xff; + } + + node = new_scenenode(zsort, NODE_QUAD); + if (!node) + return; + node->data.quad.cmode = (v[0].u >> 12) & 0xf; + node->data.quad.texturebank = (v[0].v >> 12) & 0xf; + node->data.quad.color = (color >> 8) & 0xff; + node->data.quad.cz_value = cz_value >> 8; + node->data.quad.cz_type = (flags >> 10) & 3; + node->data.quad.cz_adjust = cz_adjust; + node->data.quad.objectflags = objectflags; + + for (i = 0; i < 4; i++) + { + polyvertex *p = &node->data.quad.v[i]; + p->x = v[i].x * camera_zoom; + p->y = v[i].y * camera_zoom; + p->z = v[i].z; + p->u = v[i].u & 0xfff; + p->v = v[i].v & 0xfff; + p->bri = v[i].bri; + } + + node->data.quad.direct = 0; + node->data.quad.vx = camera_vx; + node->data.quad.vy = camera_vy; + node->data.quad.vu = camera_vu; + node->data.quad.vd = camera_vd; + node->data.quad.vl = camera_vl; + node->data.quad.vr = camera_vr; +} + +static void blit_quads(int addr, int len, float m[4][4]) +{ + int finish = addr + len; + + while (addr < finish) + { + int packetlength = namcos22_point_read(addr++); + int packetformat = namcos22_point_read(addr + 0); + int flags, color, bias; + + switch (packetlength) + { + case 0x17: + flags = namcos22_point_read(addr + 1); + color = namcos22_point_read(addr + 2); + bias = 0; + blit_single_quad(color, addr + 3, m, bias, flags, packetformat); + lit_surface_index++; + break; + + case 0x18: + flags = namcos22_point_read(addr + 1); + color = namcos22_point_read(addr + 2); + bias = namcos22_point_read(addr + 3); + blit_single_quad(color, addr + 4, m, bias, flags, packetformat); + lit_surface_index++; + break; + + case 0x10: /* vertex lighting */ + lit_surface_count = 0; + lit_surface_index = 0; + lit_surface_gouraud = (namcos22_point_read(addr + 1) & 3) > 0; + lit_surface_width = ((namcos22_point_read(addr + 1) >> 16) & 0xf) + 1; + lit_surface_triangles = ((namcos22_point_read(addr + 1) >> 20) & 1) > 0; + lit_surface_intensity = ((namcos22_point_read(addr + 3) & 0xffff) * camera_power) >> 15; + register_normals(addr + 4, m); + break; + + case 0x0d: /* additional normals */ + register_normals(addr + 1, m); + break; + + default: + logerror("blit_quads unknown packet length: addr=0x%06x len=0x%x format=0x%x\n", addr - 1, packetlength, packetformat); + return; + } + addr += packetlength; + + if ((packetformat & 0x800000) && addr != finish) + { + logerror("blit_quads unexpected end: addr=0x%06x\n", addr); + return; + } + } +} + +static void blit_polyobject(int code, float m[4][4]) +{ + int list_addr = namcos22_point_read(code); + + lit_surface_count = 0; + lit_surface_index = 0; + + for (;;) + { + int object_addr = namcos22_point_read(list_addr++); + UINT32 chunklength; + + if (object_addr < 0) + { + if (object_addr == -1) + break; /* end of list */ + object_addr &= 0x00ffffff; + } + + chunklength = namcos22_point_read(object_addr++); + if (chunklength > 0x100) + { + logerror("blit_polyobject bad chunk length: addr=0x%06x len=0x%x\n", object_addr - 1, chunklength); + break; + } + + blit_quads(object_addr, chunklength, m); + } + + /* the flag applies to a single object (timecris stage 1-3 car bonnet) */ + objectflags &= ~2; +} + +static void slavesim_handle_bb0003(const INT32 *src) +{ + camera_ambient = (src[0x1] >> 16) & 0xffff; + camera_power = src[0x1] & 0xffff; + + camera_lx = dspfixed_to_nativefloat(src[0x2]); + camera_ly = dspfixed_to_nativefloat(src[0x3]); + camera_lz = dspfixed_to_nativefloat(src[0x4]); + + absolute_priority = (src[0x3] >> 16) & 0xffff; + camera_vx = SIGNED12(src[0x5] >> 16); + camera_vy = SIGNED12(src[0x5] & 0xffff); + camera_zoom = dspfloat_to_nativefloat(src[0x6]); + camera_vr = (int)(dspfloat_to_nativefloat(src[0x7]) * camera_zoom - 0.5f); + camera_vl = (int)(dspfloat_to_nativefloat(src[0x8]) * camera_zoom - 0.5f); + camera_vu = (int)(dspfloat_to_nativefloat(src[0x9]) * camera_zoom - 0.5f); + camera_vd = (int)(dspfloat_to_nativefloat(src[0xa]) * camera_zoom - 0.5f); + + reflection = (src[0x2] >> 16) & 0x30; + cullflip = (reflection == 0x10 || reflection == 0x20); + + if (reflection & 0x10) + { + int vl = camera_vl; + camera_vl = camera_vr; + camera_vr = vl; + } + if (reflection & 0x20) + { + int vu = camera_vu; + camera_vu = camera_vd; + camera_vd = vu; + } + + viewmatrix[0][0] = dspfixed_to_nativefloat(src[0x0c]); + viewmatrix[1][0] = dspfixed_to_nativefloat(src[0x0d]); + viewmatrix[2][0] = dspfixed_to_nativefloat(src[0x0e]); + viewmatrix[0][1] = dspfixed_to_nativefloat(src[0x0f]); + viewmatrix[1][1] = dspfixed_to_nativefloat(src[0x10]); + viewmatrix[2][1] = dspfixed_to_nativefloat(src[0x11]); + viewmatrix[0][2] = dspfixed_to_nativefloat(src[0x12]); + viewmatrix[1][2] = dspfixed_to_nativefloat(src[0x13]); + viewmatrix[2][2] = dspfixed_to_nativefloat(src[0x14]); + + matrix3d_apply_reflection(viewmatrix); + + /* clear model rendering options */ + cz_adjust = 0; + objectshift = 0; + objectflags = 0; +} + +static void slavesim_handle_200002(const INT32 *src, int code) +{ + if (code == 0x5 || code >= 0x45) + { + float m[4][4]; /* row major */ + + matrix3d_identity(m); + + m[0][0] = dspfixed_to_nativefloat(src[0x1]); + m[1][0] = dspfixed_to_nativefloat(src[0x2]); + m[2][0] = dspfixed_to_nativefloat(src[0x3]); + m[0][1] = dspfixed_to_nativefloat(src[0x4]); + m[1][1] = dspfixed_to_nativefloat(src[0x5]); + m[2][1] = dspfixed_to_nativefloat(src[0x6]); + m[0][2] = dspfixed_to_nativefloat(src[0x7]); + m[1][2] = dspfixed_to_nativefloat(src[0x8]); + m[2][2] = dspfixed_to_nativefloat(src[0x9]); + + m[3][0] = SIGNED24(src[0xa]); /* xpos */ + m[3][1] = SIGNED24(src[0xb]); /* ypos */ + m[3][2] = SIGNED24(src[0xc]); /* zpos */ + + matrix3d_multiply(m, viewmatrix); + blit_polyobject(code, m); + } + else if (code != 0 && code != 2) + logerror("slavesim_handle_200002:unknown code=0x%x\n", code); +} + +static void slavesim_handle_300000(const INT32 *src) +{ + viewmatrix[0][0] = dspfixed_to_nativefloat(src[1]); + viewmatrix[1][0] = dspfixed_to_nativefloat(src[2]); + viewmatrix[2][0] = dspfixed_to_nativefloat(src[3]); + viewmatrix[0][1] = dspfixed_to_nativefloat(src[4]); + viewmatrix[1][1] = dspfixed_to_nativefloat(src[5]); + viewmatrix[2][1] = dspfixed_to_nativefloat(src[6]); + viewmatrix[0][2] = dspfixed_to_nativefloat(src[7]); + viewmatrix[1][2] = dspfixed_to_nativefloat(src[8]); + viewmatrix[2][2] = dspfixed_to_nativefloat(src[9]); + + matrix3d_apply_reflection(viewmatrix); +} + +static void slavesim_handle_233002(const INT32 *src) +{ + cz_adjust = src[1] & 0xffffff; + objectshift = src[2] & 0xffffff; + objectflags = (src[3] >> 21) & 7; +} + +static void simulate_slavedsp(void) +{ + const INT32 *base = (const INT32 *)namcos22_polygonram; + const INT32 *src = base + 0x300; + + if (namcos22_is_ss22) + src += 4; /* FFFE 0400 */ + else + src--; + + for (;;) + { + UINT16 code, len, next; + INT32 index; + + code = *src++; + len = *src++; + index = src - base; + + /* alpinr2b titlescreen includes commands to modify pointram on the fly */ + if (namcos22_gametype == NAMCOS22_ALPINE_RACER_2 && code == 0xfff8) + { + namcos22_pdp_handle_commands(index - 2); + src += 0x56; + continue; + } + else if ((index + len) >= 0x7fff) + { + logerror("simulate_slavedsp buffer overflow: len=0x%x code=0x%x addr=0x%x\n", len, code, index); + return; + } + + switch (len) + { + case 0x15: slavesim_handle_bb0003(src); break; /* define viewport */ + case 0x10: slavesim_handle_233002(src); break; /* model rendering options */ + case 0x0a: slavesim_handle_300000(src); break; /* modify view transform */ + case 0x0d: slavesim_handle_200002(src, code); break; /* render primitive */ + default: + logerror("simulate_slavedsp unknown 3d data: len=0x%x code=0x%x addr=0x%x\n", len, code, index); + return; + } + + src += len; + src++; /* should be 0xffff (GOTO command) */ + next = *src++ & 0x7fff; /* link to next command */ + if (next != (index + len + 1 + 1)) + { + /* end of list, normally with a "goto self" */ + if (next != (index + len)) + logerror("simulate_slavedsp unexpected end: addr=0x%x, next=0x%x\n", index + len, next); + return; + } + else if (next == 0x7fff) + { + logerror("simulate_slavedsp buffer overflow: next=0x7fff\n"); + return; + } + } +} + +static void draw_polygons(void) +{ + if (namcos22_pdp_render_done && namcos22_slave_simulation_active) + simulate_slavedsp(); +} + +static void render_frame_active(void) +{ + /* the PDP and simulate_slavedsp are the same thing: when the PDP is inactive the + parser is too (propcycl attract mode expects the previous scene) */ + if (cpu_getcurrentframe() > namcos22_pdp_frame && namcos22_render_refresh) + namcos22_pdp_render_done = 0; + + namcos22_render_refresh = 0; +} + + +/*************************************************************************** + Sprites (Super System 22) +***************************************************************************/ + +static void draw_sprite_group(const UINT32 *src, const UINT32 *attr, int num_sprites, int deltax, int deltay, int y_lowres) +{ + int i; + for (i = 0; i < num_sprites; i++) + { + int xpos = (src[0] >> 16) - deltax; + int ypos = (src[0] & 0xffff) - deltay; + int sizex = src[1] >> 16; + int sizey = src[1] & 0xffff; + int flipy = (src[2] >> 3) & 1; + int rows = src[2] & 0x7; + int linktype = (src[2] >> 16) & 0xff; + int flipx = (src[2] >> 7) & 1; + int cols = (src[2] >> 4) & 0x7; + UINT32 code = src[3]; + int tile = code >> 16; + int alpha = (code >> 8) & 0xff; + + UINT32 zcoord = attr[0] & 0x00ffffff; + int color = (attr[1] >> 16) & 0xff; + int cz = attr[1] & 0xff; + int fade_enabled = (attr[1] >> 15) & 1; + int prioverchar = (cz == 0xfe) ? 1 : 0; + + /* window clipping */ + int clip = (src[2] >> 23) & 0xe; + int cx_min = -deltax + (INT16)(namcos22_spriteram[0x80 | clip] >> 16); + int cx_max = -deltax + (INT16)(namcos22_spriteram[0x80 | clip] & 0xffff); + int cy_min = -deltay + (INT16)(namcos22_spriteram[0x81 | clip] >> 16); + int cy_max = -deltay + (INT16)(namcos22_spriteram[0x81 | clip] & 0xffff); + + if (rows == 0) rows = 8; + if (cols == 0) cols = 8; + + if (src[2] & 0x200) /* right justify */ + xpos -= sizex * cols - 1; + if (src[2] & 0x100) /* bottom justify */ + ypos -= sizey * rows - 1; + + if (flipy) + { + ypos += sizey * rows - 1; + sizey = -sizey; + } + if (flipx) + { + xpos += sizex * cols - 1; + sizex = -sizex; + } + + if (y_lowres) + { + sizey *= 2; + ypos *= 2; + } + + if (sizex && sizey) + { + struct scenenode *node = new_scenenode(zcoord, NODE_SPRITE); + if (node) + { + node->data.sprite.tile = tile; + node->data.sprite.flipx = flipx; + node->data.sprite.flipy = flipy; + node->data.sprite.cols = cols; + node->data.sprite.rows = rows; + node->data.sprite.linktype = linktype; + node->data.sprite.xpos = xpos; + node->data.sprite.ypos = ypos; + node->data.sprite.cx_min = cx_min; + node->data.sprite.cx_max = cx_max; + node->data.sprite.cy_min = cy_min; + node->data.sprite.cy_max = cy_max; + node->data.sprite.sizex = sizex; + node->data.sprite.sizey = sizey; + node->data.sprite.alpha = alpha; + node->data.sprite.color = color; + node->data.sprite.cz = cz; + node->data.sprite.prioverchar = prioverchar; + node->data.sprite.fade_enabled = fade_enabled; + } + } + + src += 4; + attr += 2; + } +} + +static void draw_sprites(void) +{ + const UINT32 *spr = namcos22_spriteram; + const UINT32 *vc = namcos22_vics_control; + int sprites_on = (~spr[0] >> 16) & 1; + int y_lowres = (~spr[0] >> 18) & 1; + int deltax = (spr[1] & 0xffff) + (spr[2] & 0xffff) + 0x2d; + int deltay = (spr[3] >> 16) + (0x2a >> (y_lowres ? 1 : 0)); + int base = spr[0] & 0xffff; + int num_sprites = ((spr[1] >> 16) - base) + 1; + + if (namcos22_gametype == NAMCOS22_AIR_COMBAT22) + num_sprites = 0; + + if (sprites_on && num_sprites > 0 && num_sprites < 0x400) + draw_sprite_group(&spr[0x04000 / 4 + base * 4], &spr[0x20000 / 4 + base * 2], num_sprites, deltax, deltay, y_lowres); + + /* VICS RAM: two more banks */ + sprites_on = (~vc[0x30 / 4] >> 24) & 1; + y_lowres = (~vc[0x30 / 4] >> 26) & 1; + + num_sprites = (vc[0x40 / 4] >> 4) & 0x1ff; + if (namcos22_gametype == NAMCOS22_DIRT_DASH) + num_sprites = (namcos22_vics_data[(vc[0x48 / 4] & 0x4000) / 4] & 0xff) + 1; + + if (sprites_on && num_sprites > 0) + draw_sprite_group(&namcos22_vics_data[(vc[0x48 / 4] & 0xffff) / 4], &namcos22_vics_data[(vc[0x58 / 4] & 0xffff) / 4], num_sprites, deltax, deltay, y_lowres); + + num_sprites = (vc[0x60 / 4] >> 4) & 0x1ff; + if (namcos22_gametype == NAMCOS22_AIR_COMBAT22) + { + sprites_on = (~namcos22_vics_data[(vc[0x48 / 4] & 0xffff) / 4] >> 16) & 1; + num_sprites = (namcos22_vics_data[(vc[0x48 / 4] & 0xffff) / 4 + 1] >> 16) + 1; + } + + if (sprites_on && num_sprites > 0) + draw_sprite_group(&namcos22_vics_data[(vc[0x68 / 4] & 0xffff) / 4], &namcos22_vics_data[(vc[0x78 / 4] & 0xffff) / 4], num_sprites, deltax, deltay, y_lowres); +} + +READ32_HANDLER( namcos22s_vics_control_r ) +{ + data32_t ret = namcos22_vics_control[offset]; + switch (offset * 4) + { + case 0x00: /* status register? */ + ret = 0; + break; + case 0x40: case 0x50: case 0x60: case 0x70: /* high bit is busy/ready? */ + ret &= 0x7fffffff; + break; + } + return ret; +} + +WRITE32_HANDLER( namcos22s_vics_control_w ) +{ + COMBINE_DATA(&namcos22_vics_control[offset]); +} + + +/*************************************************************************** + Text layer +***************************************************************************/ + +WRITE32_HANDLER( namcos22_cgram_w ) +{ + COMBINE_DATA(&namcos22_cgram[offset]); +} + +static void posirq_update(void) +{ + int scanline = 2 * tilemapattr[4]; + + if (scanline < 525) + { + scanline = (scanline + 480) % 525; /* 0 = vblank start */ + timer_adjust(posirq_timer, cpu_getscanlinetime(scanline), 0, 0); + } + else + timer_adjust(posirq_timer, TIME_NEVER, 0, 0); +} + +static void posirq_callback(int param) +{ + /* hblank irq line differs between s22/ss22 (see syscon) */ + int line = namcos22_is_ss22 ? 1 : 0; + + if (namcos22_irq_enabled & (1 << line)) + { + namcos22_irq_state |= (1 << line); + if (namcos22_syscontrol[line] & 7) + cpu_set_irq_line(0, namcos22_syscontrol[line] & 7, ASSERT_LINE); + } + posirq_update(); +} + +static void update_text_rowscroll(void) +{ + UINT32 fr = cpu_getcurrentframe(); + int scroll_x, y, i; + + if (fr != rs_frame) + { + rs_frame = fr; + lastrow = 0; + } + + scroll_x = (tilemapattr[0] - 0x35c) & 0x3ff; + y = cpu_getscanline(); + if (y > 480) y = 480; + + for (i = lastrow; i < y; i++) + rowscroll[i] = scroll_x; + lastrow = y; +} + +static void tilemapattr_word_w(int offset, UINT16 data, UINT16 keep) +{ + /* 0: x offset, 1: y offset, 4: posirq scanline */ + if (offset == 0) + update_text_rowscroll(); /* alpines changes x scroll mid-screen */ + + tilemapattr[offset] = (tilemapattr[offset] & keep) | (data & ~keep); + + if (offset == 4) + posirq_update(); +} + +static UINT16 tilemapattr_word_r(int offset) +{ + switch (offset) + { + case 5: return 0x8000; /* dirtdash slows down if clear */ + case 7: return 0; /* timecris reads it when the gun triggers */ + } + return tilemapattr[offset]; +} + +READ32_HANDLER( namcos22_tilemapattr_r ) +{ + return (tilemapattr_word_r(offset * 2) << 16) | tilemapattr_word_r(offset * 2 + 1); +} + +WRITE32_HANDLER( namcos22_tilemapattr_w ) +{ + if ((mem_mask & 0xffff0000) != 0xffff0000) + tilemapattr_word_w(offset * 2, data >> 16, mem_mask >> 16); + if ((mem_mask & 0x0000ffff) != 0x0000ffff) + tilemapattr_word_w(offset * 2 + 1, data & 0xffff, mem_mask & 0xffff); +} + +/* the text layer scroll of this frame (main thread, before the bands) */ +static int text_scroll_y; +static int text_rowx[1024]; + +static void prepare_text_tilemap(void) +{ + int i; + + update_text_rowscroll(); + text_scroll_y = tilemapattr[1] & 0x3ff; + for (i = 0; i < 1024; i++) + text_rowx[i] = rowscroll[0]; + for (i = 0; i < 480; i++) + text_rowx[(i + text_scroll_y + 4) & 0x3ff] = rowscroll[i]; +} + +/* render the 64x64 tilemap of 16x16x4 RAM tiles into mix_bitmap (pens) and primap, rows of a band */ +static void draw_text_tilemap(int band, int nbands, int prio, int primask) +{ + const int scroll_y = text_scroll_y; + const UINT32 *textram = &namcos22_cgram[0x1e000 / 4]; + int y; + + for (y = 0; y < SCREEN_H; y++) + { + int ty = (y + scroll_y) & 0x3ff; + int sx = text_rowx[ty]; + UINT16 *dst = mix_bitmap + y * SCREEN_W; + UINT8 *pri = primap + y * SCREEN_W; + int x = 0; + + if (!ROW_OWNED(y, band, nbands)) + continue; + text_row_used[y] = 0; + + while (x < SCREEN_W) + { + int tx = (x + sx) & 0x3ff; + int tile_index = (ty >> 4) * 64 + (tx >> 4); + UINT16 data = NTHWORD32(textram, tile_index); + int code = data & 0x3ff; + int color = data >> 12; + int flipx = (data >> 10) & 1; + int flipy = (data >> 11) & 1; + int row = flipy ? 15 - (ty & 15) : (ty & 15); + const UINT32 *rowdata = &namcos22_cgram[code * 32 + row * 2]; + int pal = text_palbase + color * 16; + int px = tx & 15; + int n = 16 - px; + + if (n > SCREEN_W - x) + n = SCREEN_W - x; + if ((rowdata[0] & rowdata[1]) == 0xffffffff) + { + x += n; /* all pens 0xf: transparent */ + continue; + } + text_row_used[y] = 1; + for (; n > 0; n--, px++, x++) + { + int cx = flipx ? 15 - px : px; + int pix = (rowdata[cx >> 3] >> (28 - 4 * (cx & 7))) & 0xf; + if (pix != 0xf) + { + dst[x] = pal + pix; + pri[x] = (pri[x] & primask) | prio; + } + } + } + } +} + + +/*************************************************************************** + Spot RAM, CZ RAM, palette, mixer +***************************************************************************/ + +READ32_HANDLER( namcos22s_spotram_r ) +{ + /* 0x860004: read data */ + if (offset == 1 && !(mem_mask & 0xffff0000)) + { + UINT16 ret = spotram[(spotram_address >> 1) & 0x7ff]; + spotram_address += 2; + return ret << 16; + } + return 0; +} + +WRITE32_HANDLER( namcos22s_spotram_w ) +{ + int word; + for (word = 0; word < 2; word++) + { + UINT16 keep = (word == 0) ? (mem_mask >> 16) : (mem_mask & 0xffff); + UINT16 d = (word == 0) ? (data >> 16) : (data & 0xffff); + if (keep == 0xffff) + continue; + switch (offset * 2 + word) + { + case 0: /* set address */ + spotram_address = (spotram_address & keep) | (d & ~keep); + break; + case 1: /* write */ + spotram[(spotram_address >> 1) & 0x7ff] = (spotram[(spotram_address >> 1) & 0x7ff] & keep) | (d & ~keep); + spotram_address += 2; + break; + case 3: /* enable */ + spotram_enable = (spotram_enable & keep) | (d & ~keep); + break; + } + } +} + +WRITE32_HANDLER( namcos22s_chipselect_w ) +{ + if (!(mem_mask & 0x00ff0000)) + chipselect = data >> 16; + else if (!(mem_mask & 0xff000000)) + chipselect = data >> 24; } WRITE32_HANDLER( namcos22_paletteram_w ) { - COMBINE_DATA( &paletteram32[offset] ); - dirtypal[offset&(0x7fff/4)] = 1; + data32_t prev = namcos22_paletteram[offset]; + COMBINE_DATA(&namcos22_paletteram[offset]); + if (prev != namcos22_paletteram[offset]) + dirtypal[offset & (0x7fff / 4)] = 1; } -READ32_HANDLER( namcos22_textram_r ) +static void update_palette(void) { - return namcos22_textram[offset]; + int i, j; + for (i = 0; i < 0x8000 / 4; i++) + { + if (dirtypal[i]) + { + for (j = 0; j < 4; j++) + { + int which = i * 4 + j; + int r = NTHBYTE32(namcos22_paletteram, which + 0x00000); + int g = NTHBYTE32(namcos22_paletteram, which + 0x08000); + int b = NTHBYTE32(namcos22_paletteram, which + 0x10000); + pens[which] = (r << 16) | (g << 8) | b; + } + dirtypal[i] = 0; + } + } } -WRITE32_HANDLER( namcos22_textram_w ) +static void czattr_word_w(int offset, UINT16 data, UINT16 keep) { - COMBINE_DATA( &namcos22_textram[offset] ); - tilemap_mark_tile_dirty( tilemap, offset*2 ); - tilemap_mark_tile_dirty( tilemap, offset*2+1 ); + UINT16 prev = czattr[offset]; + czattr[offset] = (czattr[offset] & keep) | (data & ~keep); + + if (offset == 4) + { + /* invalidate if the compare function changed */ + UINT16 changed = prev ^ czattr[offset]; + int bank; + for (bank = 0; bank < 4; bank++) + cz_was_written[bank] |= (changed >> (bank * 4)) & 2; + } } +READ32_HANDLER( namcos22s_czattr_r ) +{ + return (czattr[offset * 2] << 16) | czattr[offset * 2 + 1]; +} + +WRITE32_HANDLER( namcos22s_czattr_w ) +{ + if ((mem_mask & 0xffff0000) != 0xffff0000) + czattr_word_w(offset * 2, data >> 16, mem_mask >> 16); + if ((mem_mask & 0x0000ffff) != 0x0000ffff) + czattr_word_w(offset * 2 + 1, data & 0xffff, mem_mask & 0xffff); +} + +WRITE32_HANDLER( namcos22s_czram_w ) +{ + int bank; + for (bank = 0; bank < 4; bank++) + { + /* write enable bit */ + if (~czattr[4] >> (bank * 4) & 1) + { + UINT32 prev = (banked_czram[bank][offset * 2] << 16) | banked_czram[bank][offset * 2 + 1]; + UINT32 temp = prev; + COMBINE_DATA(&temp); + banked_czram[bank][offset * 2] = temp >> 16; + banked_czram[bank][offset * 2 + 1] = temp & 0xffff; + cz_was_written[bank] |= (prev ^ temp); + } + } +} + +READ32_HANDLER( namcos22s_czram_r ) +{ + int bank = czattr[5] & 3; + return (banked_czram[bank][offset * 2] << 16) | banked_czram[bank][offset * 2 + 1]; +} + +static void recalc_czram_tables(void) +{ + int bank; + for (bank = 0; bank < 4; bank++) + { + /* the SS22 czram is a big compare table: make it a lookup table */ + if (cz_was_written[bank]) + { + int reverse = (czattr[4] >> (bank * 4) & 2) ? 0xff : 0; + int small_val = 0x2000; + int small_offset = reverse; + int large_val = 0; + int large_offset = reverse ^ 0xff; + int prev = 0; + int i, j; + + for (i = 0; i < 0x100; i++) + { + int factor = i ^ reverse; + int val = banked_czram[bank][factor]; + int start = prev; + int end; + if (val > 0x2000) val = 0x2000; + end = val; + + if (i > 0) + { + /* discard if the compare function doesn't match */ + if (start >= end) + continue; + for (j = start; j < end; j++) + recalc_czram[bank][j] = factor; + } + + if (val < small_val) + { + small_val = val; + small_offset = factor; + } + if (val > large_val) + { + large_val = val; + large_offset = factor; + } + prev = val; + } + + for (j = 0; j < small_val; j++) + recalc_czram[bank][j] = small_offset; + for (j = large_val; j < 0x2000; j++) + recalc_czram[bank][j] = large_offset; + + cz_was_written[bank] = 0; + } + } +} + +static void update_mixer(void) +{ + const UINT32 *m = namcos22_mixer; + + if (namcos22_is_ss22) + { + poly_fade_r = NTHBYTE32(m, 0x00); + poly_fade_g = NTHBYTE32(m, 0x01); + poly_fade_b = NTHBYTE32(m, 0x02); + fog_r = NTHBYTE32(m, 0x05); + fog_g = NTHBYTE32(m, 0x06); + fog_b = NTHBYTE32(m, 0x07); + spot_factor = (NTHBYTE32(m, 0x0e) << 8) | NTHBYTE32(m, 0x0d); + poly_alpha_color = NTHBYTE32(m, 0x0f); + poly_alpha_pen = NTHBYTE32(m, 0x10); + poly_alpha_factor = NTHBYTE32(m, 0x11); + screen_fade_r = NTHBYTE32(m, 0x16); + screen_fade_g = NTHBYTE32(m, 0x17); + screen_fade_b = NTHBYTE32(m, 0x18); + screen_fade_factor = NTHBYTE32(m, 0x19); + mixer_flags = NTHBYTE32(m, 0x1a); + text_palbase = (NTHBYTE32(m, 0x1b) << 8) & 0x7f00; + + poly_fade_enabled = (m[0] & 0xffffff00) != 0xffffff00; + } + else + { + int i; + mixer_flags = (NTHBYTE32(m, 0x00) << 8) | NTHBYTE32(m, 0x01); + bg_palbase = (NTHBYTE32(m, 0x04) << 8) & 0x7f00; + text_palbase = (NTHBYTE32(m, 0x07) << 8) & 0x7f00; + screen_fade_r = (NTHBYTE32(m, 0x11) << 8) | NTHBYTE32(m, 0x12); + screen_fade_g = (NTHBYTE32(m, 0x13) << 8) | NTHBYTE32(m, 0x14); + screen_fade_b = (NTHBYTE32(m, 0x15) << 8) | NTHBYTE32(m, 0x16); + fog_colormask = m[0x84 / 4]; + for (i = 0; i < 4; i++) + { + fog_r_per_cztype[i] = NTHBYTE32(m, 0x0100 + i); + fog_g_per_cztype[i] = NTHBYTE32(m, 0x0180 + i); + fog_b_per_cztype[i] = NTHBYTE32(m, 0x0200 + i); + } + } +} + +static void namcos22s_mix_text_layer(int band, int nbands, int prival) +{ + int alpha_check12 = NTHBYTE32(namcos22_mixer, 0x12); + int alpha_check13 = NTHBYTE32(namcos22_mixer, 0x13); + int alpha_mask = NTHBYTE32(namcos22_mixer, 0x14) & 0xf; + int alpha_factor = NTHBYTE32(namcos22_mixer, 0x15); + int spot_enabled = (spotram_enable & 1) && (chipselect & 0xc000); + int spot_fac = (spot_factor < 0x100) ? 0 : spot_factor & 0xff; + int spot_palbase = (text_palbase >> 8) & 3; + int fade_enabled = (mixer_flags & 2) && screen_fade_factor; + int fade_factor = 0xff - screen_fade_factor; + int x, y; + + for (y = 0; y < SCREEN_H; y++) + { + const UINT16 *src = mix_bitmap + y * SCREEN_W; + UINT32 *dest = frame + y * SCREEN_W; + const UINT8 *pri = primap + y * SCREEN_W; + if (!text_row_used[y] || !ROW_OWNED(y, band, nbands)) + continue; + for (x = 0; x < SCREEN_W; x++) + { + int pen = 0, r, g, b; + UINT32 c; + + if (pri[x] != prival) + continue; + + if (spot_enabled) + { + pen = spotram[((src[x] << 2) | spot_palbase) & 0x3ff] & 0xff; + if (pen < 0x80) + c = pens[pen | text_palbase]; + else if (prival != 6) + continue; + else + c = 0; + } + else + { + c = pens[src[x]]; + pen = src[x] & 0xff; + } + r = RGB_R(c); g = RGB_G(c); b = RGB_B(c); + + if (spot_enabled && pen >= 0x80) + { + /* spot pen becomes brightness factor */ + int factor = (spot_fac * (pen & 0x7f)) >> 7; + r = RGB_R(dest[x]); g = RGB_G(dest[x]); b = RGB_B(dest[x]); + SCALE_IMM_CLAMP(r, g, b, 0x100 - factor); + } + else + { + if (fade_enabled) + BLEND(r, g, b, screen_fade_r, screen_fade_g, screen_fade_b, fade_factor); + + if (alpha_factor && ((pen & 0xf) == alpha_mask || (pen >= alpha_check12 && pen <= alpha_check13))) + BLEND(r, g, b, (int)RGB_R(dest[x]), (int)RGB_G(dest[x]), (int)RGB_B(dest[x]), 0xff - alpha_factor); + } + + dest[x] = TO_RGB(r, g, b); + } + } +} + + +/* System 22: text layer over the scene, shadow pens, global fade and the gamma PROMs */ +static void namcos22_mix_text_layer(int band, int nbands, struct mame_bitmap *bitmap, const struct rectangle *cliprect) +{ + int fade_enabled = (screen_fade_r != 0x100 || screen_fade_g != 0x100 || screen_fade_b != 0x100); + UINT32 fade_r_add = (screen_fade_r > 0x100) ? (1 << 16) : 0; + UINT32 fade_g_add = (screen_fade_g > 0x100) ? (1 << 8) : 0; + UINT32 fade_b_add = (screen_fade_b > 0x100) ? 1 : 0; + int fade_white = fade_r_add || fade_g_add || fade_b_add; + int shadow_enabled = (mixer_flags >> 8) & 1; /* ridgerac is the only game not using shadow */ + int mix_r[3], mix_g[3], mix_b[3]; + UINT32 *rl = gamma_lut[0], *gl = gamma_lut[1], *bl = gamma_lut[2]; + int i, x, y; + + for (i = 0; i < 3; i++) + { + mix_r[i] = NTHBYTE32(namcos22_mixer, 0x08 + i * 3); + mix_g[i] = NTHBYTE32(namcos22_mixer, 0x09 + i * 3); + mix_b[i] = NTHBYTE32(namcos22_mixer, 0x0a + i * 3); + } + + for (y = cliprect->min_y; y <= cliprect->max_y; y++) + { + const UINT16 *src = mix_bitmap + y * SCREEN_W; + const UINT8 *pri = primap + y * SCREEN_W; + const UINT32 *fr = frame + y * SCREEN_W; + UINT32 *dest = (UINT32 *)bitmap->line[y]; + + if (!ROW_OWNED(y, band, nbands)) + continue; + + if (!fade_enabled && !text_row_used[y]) + { + /* no text on this row: gamma only */ + const UINT32 *rp = rl, *gp = gl, *bp = bl; + const UINT32 *s_ = fr + cliprect->min_x; + UINT32 *d_ = dest + cliprect->min_x; + int n; + for (n = cliprect->max_x - cliprect->min_x + 1; n > 0; n--) + { + UINT32 rgb = *s_++; + *d_++ = rp[(rgb >> 16) & 0xff] | gp[(rgb >> 8) & 0xff] | bp[rgb & 0xff]; + } + continue; + } + + for (x = cliprect->min_x; x <= cliprect->max_x; x++) + { + UINT32 pixel = fr[x]; + + /* skip if transparent or under poly */ + if (pri[x] == 2) + { + int pen = src[x] & 0xff; + if (shadow_enabled && pen >= 0xfc && pen <= 0xfe) + { + int r = RGB_R(pixel), g = RGB_G(pixel), b = RGB_B(pixel); + SCALE_CLAMP(r, g, b, mix_r[pen - 0xfc], mix_g[pen - 0xfc], mix_b[pen - 0xfc]); + pixel = TO_RGB(r, g, b); + } + else + pixel = pens[src[x]]; + } + + /* global fade */ + if (fade_enabled) + { + int r, g, b; + if (fade_white) + { + /* blacks must be able to scale up */ + if (!(pixel & 0xff0000)) pixel += fade_r_add; + if (!(pixel & 0x00ff00)) pixel += fade_g_add; + if (!(pixel & 0x0000ff)) pixel += fade_b_add; + } + r = RGB_R(pixel); g = RGB_G(pixel); b = RGB_B(pixel); + SCALE_CLAMP(r, g, b, screen_fade_r, screen_fade_g, screen_fade_b); + pixel = TO_RGB(r, g, b); + } + + /* gamma */ + dest[x] = rl[(pixel >> 16) & 0xff] | gl[(pixel >> 8) & 0xff] | bl[pixel & 0xff]; + } + } +} + +/*************************************************************************** + Video start / update +***************************************************************************/ + +void namcos22_video_reset(void) +{ + node_used = 0; + memset(&scenenode_root, 0, sizeof(scenenode_root)); + posirq_update(); +} + +static int namcos22_common_video_start(void) +{ + const UINT8 *tmap = memory_region(REGION_GFX3); + const UINT8 *packed; + int i, attr, y, x; + + pens = auto_malloc(0x8000 * sizeof(UINT32)); + dirtypal = auto_malloc(0x8000 / 4); + mix_bitmap = auto_malloc(SCREEN_W * SCREEN_H * sizeof(UINT16)); + primap = auto_malloc(SCREEN_W * SCREEN_H); + frame = auto_malloc(SCREEN_W * SCREEN_H * sizeof(UINT32)); + if (!pens || !dirtypal || !mix_bitmap || !primap || !frame) + return 1; + + memset(pens, 0, 0x8000 * sizeof(UINT32)); + memset(dirtypal, 1, 0x8000 / 4); + memset(mix_bitmap, 0, SCREEN_W * SCREEN_H * sizeof(UINT16)); + + matrix3d_identity(viewmatrix); + + /* textures: the tilemap is little endian words, then packed attribute nibbles */ + texture_tilemap = auto_malloc(0x100000 * sizeof(UINT16)); + texture_tileattr = auto_malloc(0x100000); + if (!texture_tilemap || !texture_tileattr) + return 1; + for (i = 0; i < 0x100000; i++) + texture_tilemap[i] = tmap[i * 2] | (tmap[i * 2 + 1] << 8); + packed = tmap + 0x200000; + for (i = 0; i < 0x80000; i++) + { + texture_tileattr[i * 2] = packed[i] >> 4; + texture_tileattr[i * 2 + 1] = packed[i] & 0xf; + } + texture_tiledata = memory_region(REGION_GFX2); + + for (attr = 0; attr < 16; attr++) + for (y = 0; y < 16; y++) + for (x = 0; x < 16; x++) + { + int ix = x, iy = y; + if (attr & 4) ix = 15 - ix; + if (attr & 2) iy = 15 - iy; + if (attr & 8) { int temp = ix; ix = iy; iy = temp; } + texture_ayx_to_pixel[(attr << 8) | (y << 4) | x] = (iy << 4) | ix; + } + + /* System 22 specific */ + switch (namcos22_gametype) + { + case NAMCOS22_RIDGE_RACER: + case NAMCOS22_RIDGE_RACER2: + case NAMCOS22_ACE_DRIVER: + case NAMCOS22_CYBER_COMMANDO: + for (i = 0; i < 0x100000; i++) + { + int tile = texture_tilemap[i]; + if (~texture_tileattr[i] & 1) + texture_tilemap[i] = (tile & 0x3fff) | 0x8000; + } + break; + } + + texture_tile32 = auto_malloc(0x100000 * sizeof(UINT32)); + if (!texture_tile32) + return 1; + for (i = 0; i < 0x100000; i++) + texture_tile32[i] = ((UINT32)texture_tilemap[i] << 12) | texture_tileattr[i]; + + posirq_timer = timer_alloc(posirq_callback); + + state_save_register_UINT8("namcos22v", 0, "dirtypal", dirtypal, 0x8000 / 4); + state_save_register_UINT16("namcos22v", 0, "tilemapattr", tilemapattr, 8); + state_save_register_UINT16("namcos22v", 0, "rowscroll", rowscroll, 480); + state_save_register_UINT16("namcos22v", 0, "lastrow", &lastrow, 1); + state_save_register_UINT32("namcos22v", 0, "rs_frame", &rs_frame, 1); + state_save_register_int("namcos22v", 0, "absolute_priority", &absolute_priority); + state_save_register_int("namcos22v", 0, "objectshift", &objectshift); + state_save_register_int("namcos22v", 0, "cz_adjust", &cz_adjust); + state_save_register_int("namcos22v", 0, "objectflags", &objectflags); + state_save_register_float("namcos22v", 0, "viewmatrix", &viewmatrix[0][0], 16); + state_save_register_UINT8("namcos22v", 0, "reflection", &reflection, 1); + state_save_register_int("namcos22v", 0, "cullflip", &cullflip); + state_save_register_int("namcos22v", 0, "camera_vx", &camera_vx); + state_save_register_int("namcos22v", 0, "camera_vy", &camera_vy); + state_save_register_int("namcos22v", 0, "camera_vu", &camera_vu); + state_save_register_int("namcos22v", 0, "camera_vd", &camera_vd); + state_save_register_int("namcos22v", 0, "camera_vl", &camera_vl); + state_save_register_int("namcos22v", 0, "camera_vr", &camera_vr); + state_save_register_float("namcos22v", 0, "camera_zoom", &camera_zoom, 1); + state_save_register_float("namcos22v", 0, "camera_lx", &camera_lx, 1); + state_save_register_float("namcos22v", 0, "camera_ly", &camera_ly, 1); + state_save_register_float("namcos22v", 0, "camera_lz", &camera_lz, 1); + state_save_register_int("namcos22v", 0, "camera_ambient", &camera_ambient); + state_save_register_int("namcos22v", 0, "camera_power", &camera_power); + return 0; +} VIDEO_START( namcos22s ) { - mpMatrix = auto_malloc(sizeof(struct Matrix)*MAX_CAMERA); - if( mpMatrix ) + int bank; + + if (namcos22_common_video_start()) + return 1; + + sprite_data = memory_region(REGION_GFX1); + sprite_count = memory_region_length(REGION_GFX1) / (32 * 32); + + spotram = auto_malloc(0x800 * sizeof(UINT16)); + if (!spotram) + return 1; + memset(spotram, 0, 0x800 * sizeof(UINT16)); + + for (bank = 0; bank < 4; bank++) { - if( namcos3d_Init( - NAMCOS22_SCREEN_WIDTH, - NAMCOS22_SCREEN_HEIGHT, - memory_region(REGION_GFX3), /* tilemap */ - memory_region(REGION_GFX2) /* texture */ - ) == 0 ) + banked_czram[bank] = auto_malloc(0x100 * sizeof(UINT16)); + recalc_czram[bank] = auto_malloc(0x2000); + if (!banked_czram[bank] || !recalc_czram[bank]) + return 1; + memset(banked_czram[bank], 0, 0x100 * sizeof(UINT16)); + memset(recalc_czram[bank], 0, 0x2000); + cz_was_written[bank] = 1; + state_save_register_UINT16("namcos22v", bank, "banked_czram", banked_czram[bank], 0x100); + } + + state_save_register_UINT16("namcos22v", 0, "spotram", spotram, 0x800); + state_save_register_UINT32("namcos22v", 0, "spotram_enable", &spotram_enable, 1); + state_save_register_UINT32("namcos22v", 0, "spotram_address", &spotram_address, 1); + state_save_register_int("namcos22v", 0, "chipselect", &chipselect); + state_save_register_UINT16("namcos22v", 0, "czattr", czattr, 8); + state_save_register_UINT32("namcos22v", 0, "cz_was_written", cz_was_written, 4); + return 0; +} + +/* the frame, row by row: the main thread prepares it, then each band (one + thread, or several with the "Threaded Video" option) draws its rows from + the background to the screen bitmap */ +static struct +{ + struct mame_bitmap *bitmap; + const struct rectangle *cliprect; + UINT32 bg; + int layer; + int gamma_identity; +} fj; + +static void ss22_frame_rows(int band, int nbands) +{ + int x, y; + + for (y = 0; y < SCREEN_H; y++) + if (ROW_OWNED(y, band, nbands)) { - struct GfxElement *pGfx = decodegfx( (UINT8 *)namcos22_cgram,&cg_layout ); - if( pGfx ) - { - Machine->gfx[NAMCOS22_ALPHA_GFX] = pGfx; - pGfx->colortable = Machine->remapped_colortable; - pGfx->total_colors = NAMCOS22_PALETTE_SIZE/16; - tilemap = tilemap_create( TextTilemapGetInfo,tilemap_scan_rows,TILEMAP_TRANSPARENT,16,16,64,64 ); - if( tilemap ) + UINT32 *f = frame + y * SCREEN_W; + for (x = 0; x < SCREEN_W; x++) + f[x] = fj.bg; + memset(primap + y * SCREEN_W, 0, SCREEN_W); + } + + if (fj.layer & 4) + { + draw_text_tilemap(band, nbands, 4, 4); + namcos22s_mix_text_layer(band, nbands, 4); + } + render_scene_band(band, nbands); + if (fj.layer & 4) + namcos22s_mix_text_layer(band, nbands, 6); + + /* gamma, to the screen */ + { + const struct rectangle *cliprect = fj.cliprect; + const int minx = cliprect->min_x, w = cliprect->max_x - cliprect->min_x + 1; + const UINT32 *rp = gamma_lut[0], *gp = gamma_lut[1], *bp = gamma_lut[2]; + + for (y = cliprect->min_y; y <= cliprect->max_y; y++) + { + const UINT32 *src = frame + y * SCREEN_W + minx; + UINT32 *dst = (UINT32 *)fj.bitmap->line[y] + minx; + int n; + + if (!ROW_OWNED(y, band, nbands)) + continue; + if (fj.gamma_identity) + memcpy(dst, src, w * sizeof(UINT32)); + else + for (n = w; n > 0; n--) { - tilemap_set_transparent_pen( tilemap, 0xf ); - dirtypal = auto_malloc(NAMCOS22_PALETTE_SIZE/4); - if( dirtypal ) - { - cgdirty = auto_malloc( 0x400 ); - if( cgdirty ) - { - int i; - mPtRomSize = memory_region_length(REGION_GFX4)/3; - mpPolyL = memory_region(REGION_GFX4); - mpPolyM = mpPolyL + mPtRomSize; - mpPolyH = mpPolyM + mPtRomSize; - for( i=0; i<0x4000/*mPtRomSize*/; i++ ) - { - if( (i&0x7)==0 ) log_cb(RETRO_LOG_DEBUG, LOGPRE "\n%06x:", i ); - log_cb(RETRO_LOG_DEBUG, LOGPRE " %06x", GetPolyData(i)&0xffffff ); - } - return 0; /* no error */ - } - } + UINT32 rgb = *src++; + *dst++ = rp[(rgb >> 16) & 0xff] | gp[(rgb >> 8) & 0xff] | bp[rgb & 0xff]; } - } } } - return -1; /* error */ +} + +static void s22_frame_rows(int band, int nbands) +{ + int x, y; + + for (y = 0; y < SCREEN_H; y++) + if (ROW_OWNED(y, band, nbands)) + { + UINT32 *f = frame + y * SCREEN_W; + for (x = 0; x < SCREEN_W; x++) + f[x] = fj.bg; + memset(primap + y * SCREEN_W, 0, SCREEN_W); + } + + /* polygons, then the text layer and the final mix */ + render_scene_band(band, nbands); + draw_text_tilemap(band, nbands, 2, 3); + namcos22_mix_text_layer(band, nbands, fj.bitmap, fj.cliprect); } VIDEO_UPDATE( namcos22s ) { - mbSuperSystem22 = 1; - UpdatePaletteS(); - fillbitmap( bitmap, get_black_pen(), cliprect ); - namcos3d_Start( bitmap ); - DrawPolygons( bitmap ); - DrawSprites( bitmap, cliprect ); - DrawTextLayer( bitmap, cliprect ); + int bg_r, bg_g, bg_b, x; + const UINT32 *m = namcos22_mixer; + + render_frame_active(); + update_mixer(); + update_palette(); + recalc_czram_tables(); + + /* background color */ + bg_r = NTHBYTE32(m, 0x08); + bg_g = NTHBYTE32(m, 0x09); + bg_b = NTHBYTE32(m, 0x0a); + if ((mixer_flags & 1) && screen_fade_factor) + BLEND(bg_r, bg_g, bg_b, screen_fade_r, screen_fade_g, screen_fade_b, 0xff - screen_fade_factor); + fj.bg = TO_RGB(bg_r, bg_g, bg_b); + + /* gamma */ + fj.gamma_identity = 1; + for (x = 0; x < 256; x++) + { + gamma_lut[0][x] = NTHBYTE32(m, 0x100 + x) << 16; + gamma_lut[1][x] = NTHBYTE32(m, 0x200 + x) << 8; + gamma_lut[2][x] = NTHBYTE32(m, 0x300 + x); + if (gamma_lut[0][x] != (UINT32)(x << 16) || gamma_lut[1][x] != (UINT32)(x << 8) || gamma_lut[2][x] != (UINT32)x) + fj.gamma_identity = 0; + } + + /* the scene, then the rows */ + fj.layer = NTHBYTE32(m, 0x1f); + fj.bitmap = bitmap; + fj.cliprect = cliprect; + if (fj.layer & 4) + prepare_text_tilemap(); + if (fj.layer & 2) draw_sprites(); + if (fj.layer & 1) draw_polygons(); + render_frame(ss22_frame_rows); +} + +VIDEO_START( namcos22 ) +{ + if (namcos22_common_video_start()) + return 1; + namcos22_gamma_proms = memory_region(REGION_PROMS); + sprite_data = NULL; + sprite_count = 1; + return 0; } VIDEO_UPDATE( namcos22 ) { - mbSuperSystem22 = 0; - UpdatePalette(); - fillbitmap( bitmap, get_black_pen(), cliprect ); - namcos3d_Start( bitmap ); - DrawPolygons( bitmap ); - DrawTextLayer( bitmap, cliprect ); + int i; + + render_frame_active(); + update_mixer(); + update_palette(); + + fj.bg = pens[bg_palbase | 0xff]; + for (i = 0; i < 256; i++) + { + gamma_lut[0][i] = namcos22_gamma_proms[0x000 + i] << 16; + gamma_lut[1][i] = namcos22_gamma_proms[0x100 + i] << 8; + gamma_lut[2][i] = namcos22_gamma_proms[0x200 + i]; + } + fj.bitmap = bitmap; + fj.cliprect = cliprect; + + draw_polygons(); + prepare_text_tilemap(); + render_frame(s22_frame_rows); +} + +VIDEO_STOP( namcos22 ) +{ +#ifdef HAVE_THREADS + s22_threads_stop(); +#endif + { + int i; + for (i = 0; i < node_chunk_count; i++) + { + free(node_chunks[i]); + node_chunks[i] = NULL; + } + node_chunk_count = 0; + node_used = 0; + } }