diff options
| author | 2008-07-17 08:09:52 +0000 | |
|---|---|---|
| committer | 2008-07-17 08:09:52 +0000 | |
| commit | 5244807bf307a2cd81a8f2f5e4f5feaa9d452280 (patch) | |
| tree | 87c7dd64a5ca6d40bef8697b990c7fcf3d757334 /src | |
| parent | b5f2aa1240d8f727bb2d376c08cb85ae4cd7d48a (diff) | |
Cleanups.
Diffstat (limited to 'src')
31 files changed, 699 insertions, 699 deletions
diff --git a/src/emu/cpu/sh2/sh2comn.c b/src/emu/cpu/sh2/sh2comn.c index b7671fd5fe2..56358fca720 100644 --- a/src/emu/cpu/sh2/sh2comn.c +++ b/src/emu/cpu/sh2/sh2comn.c @@ -265,14 +265,14 @@ WRITE32_HANDLER( sh2_internal_w ) offset &= 0x7f; #endif - old = sh2->m[offset]; + old = sh2->m[offset]; COMBINE_DATA(sh2->m+offset); // if(offset != 0x20) // logerror("sh2_internal_w: Write %08x (%x), %08x @ %08x\n", 0xfffffe00+offset*4, offset, data, mem_mask); -// if(offset != 0x20) -// printf("sh2_internal_w: Write %08x (%x), %08x @ %08x (PC %x)\n", 0xfffffe00+offset*4, offset, data, mem_mask, activecpu_get_pc()); +// if(offset != 0x20) +// printf("sh2_internal_w: Write %08x (%x), %08x @ %08x (PC %x)\n", 0xfffffe00+offset*4, offset, data, mem_mask, activecpu_get_pc()); switch( offset ) { @@ -280,7 +280,7 @@ WRITE32_HANDLER( sh2_internal_w ) case 0x04: // TIER, FTCSR, FRC if((mem_mask & 0x00ffffff) != 0) sh2_timer_resync(); -// printf("SH2.%d: TIER write %04x @ %04x\n", sh2->cpu_number, data >> 16, mem_mask>>16); +// printf("SH2.%d: TIER write %04x @ %04x\n", sh2->cpu_number, data >> 16, mem_mask>>16); sh2->m[4] = (sh2->m[4] & ~(ICF|OCFA|OCFB|OVF)) | (old & sh2->m[4] & (ICF|OCFA|OCFB|OVF)); COMBINE_DATA(&sh2->frc); if((mem_mask & 0x00ffffff) != 0) @@ -288,7 +288,7 @@ WRITE32_HANDLER( sh2_internal_w ) sh2_recalc_irq(); break; case 0x05: // OCRx, TCR, TOCR -// printf("SH2.%d: TCR write %08x @ %08x\n", sh2->cpu_number, data, mem_mask); +// printf("SH2.%d: TCR write %08x @ %08x\n", sh2->cpu_number, data, mem_mask); sh2_timer_resync(); if(sh2->m[5] & 0x10) sh2->ocrb = (sh2->ocrb & (~mem_mask >> 16)) | ((data & mem_mask) >> 16); @@ -651,7 +651,7 @@ void sh2_exception(const char *message, int irqline) else sh2->sr = (sh2->sr & ~I) | (irqline << 4); -// printf("sh2_exception [%s] irqline %x evec %x save SR %x new SR %x\n", message, irqline, sh2->evec, sh2->irqsr, sh2->sr); +// printf("sh2_exception [%s] irqline %x evec %x save SR %x new SR %x\n", message, irqline, sh2->evec, sh2->irqsr, sh2->sr); #else sh2->r[15] -= 4; WL( sh2->r[15], sh2->sr ); /* push SR onto stack */ diff --git a/src/emu/cpu/sh2/sh2drc.c b/src/emu/cpu/sh2/sh2drc.c index 1884c8a0816..37c121a11c4 100644 --- a/src/emu/cpu/sh2/sh2drc.c +++ b/src/emu/cpu/sh2/sh2drc.c @@ -1,6 +1,6 @@ /*************************************************************************** - sh2drc.c + sh2drc.c Universal machine language-based SH-2 emulator. By R. Belmont @@ -229,7 +229,7 @@ static void cfunc_printf_probe(void *param) (UINT32)sh2->macl, (UINT32)sh2->mach, (UINT32)sh2->gbr); - printf(" evec %x irqsr %x pc=%08x\n", + printf(" evec %x irqsr %x pc=%08x\n", (UINT32)sh2->evec, (UINT32)sh2->irqsr, (UINT32)sh2->pc); } @@ -1020,9 +1020,9 @@ static void static_generate_memory_accessor(drcuml_state *drcuml, int size, int UML_LABEL(block, label++); // label: - if (iswrite) - { - switch (size) + if (iswrite) + { + switch (size) { case 1: UML_WRITE(block, IREG(0), IREG(1), PROGRAM_BYTE); // write r0, r1, program_byte @@ -1380,7 +1380,7 @@ static void generate_sequence_instruction(drcuml_block *block, compiler_state *c UML_MOV(block, MEM(&sh2->pc), IMM(desc->pc)); // mov sh2->pc, desc->pc } else // check for driver-selected flushes - { + { if (sh2->maxpcfsel != -1) { int pcflush; @@ -1430,7 +1430,7 @@ static void generate_sequence_instruction(drcuml_block *block, compiler_state *c static void generate_delay_slot(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { compiler_state compiler_temp = *compiler; - + /* compile the delay slot using temporary compiler state */ assert(desc->delay != NULL); generate_sequence_instruction(block, &compiler_temp, desc->delay); // <next instruction> @@ -1454,8 +1454,8 @@ static int generate_opcode(drcuml_block *block, compiler_state *compiler, const switch (opswitch) { - case 0: - return generate_group_0(block, compiler, desc, opcode, in_delay_slot); + case 0: + return generate_group_0(block, compiler, desc, opcode, in_delay_slot); break; case 1: // MOVLS4 @@ -1470,14 +1470,14 @@ static int generate_opcode(drcuml_block *block, compiler_state *compiler, const return TRUE; break; - case 2: - return generate_group_2(block, compiler, desc, opcode, in_delay_slot); + case 2: + return generate_group_2(block, compiler, desc, opcode, in_delay_slot); break; - case 3: - return generate_group_3(block, compiler, desc, opcode); + case 3: + return generate_group_3(block, compiler, desc, opcode); break; - case 4: - return generate_group_4(block, compiler, desc, opcode, in_delay_slot); + case 4: + return generate_group_4(block, compiler, desc, opcode, in_delay_slot); break; case 5: // MOVLL4 @@ -1492,8 +1492,8 @@ static int generate_opcode(drcuml_block *block, compiler_state *compiler, const return TRUE; break; - case 6: - return generate_group_6(block, compiler, desc, opcode, in_delay_slot); + case 6: + return generate_group_6(block, compiler, desc, opcode, in_delay_slot); break; case 7: // ADDI @@ -1503,8 +1503,8 @@ static int generate_opcode(drcuml_block *block, compiler_state *compiler, const return TRUE; break; - case 8: - return generate_group_8(block, compiler, desc, opcode, in_delay_slot); + case 8: + return generate_group_8(block, compiler, desc, opcode, in_delay_slot); break; case 9: // MOVWI @@ -1520,7 +1520,7 @@ static int generate_opcode(drcuml_block *block, compiler_state *compiler, const break; case 10: // BRA - generate_delay_slot(block, compiler, desc); + generate_delay_slot(block, compiler, desc); disp = ((INT32)opcode << 20) >> 20; @@ -1532,7 +1532,7 @@ static int generate_opcode(drcuml_block *block, compiler_state *compiler, const break; case 11: // BSR - generate_delay_slot(block, compiler, desc); + generate_delay_slot(block, compiler, desc); disp = ((INT32)opcode << 20) >> 20; @@ -1544,8 +1544,8 @@ static int generate_opcode(drcuml_block *block, compiler_state *compiler, const return TRUE; break; - case 12: - return generate_group_12(block, compiler, desc, opcode, in_delay_slot); + case 12: + return generate_group_12(block, compiler, desc, opcode, in_delay_slot); break; case 13: // MOVLI @@ -1606,7 +1606,7 @@ static int generate_group_0(drcuml_block *block, compiler_state *compiler, const UML_ADD(block, MEM(&sh2->target), R32(Rn), IMM(4)); // add target, Rm, #4 UML_ADD(block, MEM(&sh2->target), MEM(&sh2->target), IMM(desc->pc)); // add target, target, pc - generate_delay_slot(block, compiler, desc); + generate_delay_slot(block, compiler, desc); UML_ADD(block, MEM(&sh2->pr), IMM(desc->pc), IMM(4)); // add sh2->pr, desc->pc, #4 (skip the current insn & delay slot) @@ -1656,20 +1656,20 @@ static int generate_group_0(drcuml_block *block, compiler_state *compiler, const return TRUE; break; - case 0x07: // MULL(Rm, Rn); + case 0x07: // MULL(Rm, Rn); case 0x17: // MULL(Rm, Rn); - case 0x27: // MULL(Rm, Rn); - case 0x37: // MULL(Rm, Rn); + case 0x27: // MULL(Rm, Rn); + case 0x37: // MULL(Rm, Rn); UML_MULU(block, MEM(&sh2->macl), MEM(&sh2->ea), R32(Rn), R32(Rm)); // mulu macl, ea, Rn, Rm return TRUE; break; - case 0x08: // CLRT(); + case 0x08: // CLRT(); UML_AND(block, MEM(&sh2->sr), MEM(&sh2->sr), IMM(~T)); // and r0, sr, ~T (clear the T bit) return TRUE; break; - case 0x0a: // STSMACH(Rn); + case 0x0a: // STSMACH(Rn); UML_MOV(block, R32(Rn), MEM(&sh2->mach)); // mov Rn, mach return TRUE; break; @@ -1677,7 +1677,7 @@ static int generate_group_0(drcuml_block *block, compiler_state *compiler, const case 0x0b: // RTS(); UML_MOV(block, MEM(&sh2->target), MEM(&sh2->pr)); // mov target, pr (in case of d-slot shenanigans) - generate_delay_slot(block, compiler, desc); + generate_delay_slot(block, compiler, desc); generate_update_cycles(block, compiler, MEM(&sh2->target), TRUE); // <subtract cycles> UML_HASHJMP(block, IMM(0), MEM(&sh2->target), sh2->nocode); @@ -1723,10 +1723,10 @@ static int generate_group_0(drcuml_block *block, compiler_state *compiler, const return TRUE; break; - case 0x0f: // MAC_L(Rm, Rn); - case 0x1f: // MAC_L(Rm, Rn); - case 0x2f: // MAC_L(Rm, Rn); - case 0x3f: // MAC_L(Rm, Rn); + case 0x0f: // MAC_L(Rm, Rn); + case 0x1f: // MAC_L(Rm, Rn); + case 0x2f: // MAC_L(Rm, Rn); + case 0x3f: // MAC_L(Rm, Rn); save_fast_iregs(block); UML_CALLC(block, cfunc_MAC_L, desc->opptr.w); load_fast_iregs(block); @@ -1796,16 +1796,16 @@ static int generate_group_0(drcuml_block *block, compiler_state *compiler, const return TRUE; break; - case 0x23: // BRAF(Rn); 0x40 + 9054 = 9098 + case 0x23: // BRAF(Rn); 0x40 + 9054 = 9098 UML_ADD(block, MEM(&sh2->target), R32(Rn), IMM(desc->pc+4)); // add target, Rn, pc+4 generate_delay_slot(block, compiler, desc); - + generate_update_cycles(block, compiler, MEM(&sh2->target), TRUE); // <subtract cycles> UML_HASHJMP(block, IMM(0), MEM(&sh2->target), sh2->nocode); // jmp target break; - case 0x28: // CLRMAC(); + case 0x28: // CLRMAC(); UML_MOV(block, MEM(&sh2->macl), IMM(0)); // mov macl, #0 UML_MOV(block, MEM(&sh2->mach), IMM(0)); // mov mach, #0 return TRUE; @@ -1828,7 +1828,7 @@ static int generate_group_0(drcuml_block *block, compiler_state *compiler, const UML_CALLH(block, sh2->read32); // call read32 UML_MOV(block, MEM(&sh2->pc), IREG(0)); // mov pc, r0 UML_ADD(block, R32(15), R32(15), IMM(4)); // add R15, R15, #4 - + UML_MOV(block, IREG(0), R32(15)); // mov r0, R15 UML_CALLH(block, sh2->read32); // call read32 UML_MOV(block, MEM(&sh2->sr), IREG(0)); // mov sr, r0 @@ -1850,7 +1850,7 @@ static int generate_group_2(drcuml_block *block, compiler_state *compiler, const { switch (opcode & 15) { - case 0: // MOVBS(Rm, Rn); + case 0: // MOVBS(Rm, Rn); UML_MOV(block, IREG(0), R32(Rn)); // mov r0, Rn UML_MOV(block, IREG(1), R32(Rm)); // mov r1, Rm UML_AND(block, IREG(1), IREG(1), IMM(0xff)); // and r1, r1, 0xff @@ -1861,7 +1861,7 @@ static int generate_group_2(drcuml_block *block, compiler_state *compiler, const return TRUE; break; - case 1: // MOVWS(Rm, Rn); + case 1: // MOVWS(Rm, Rn); UML_MOV(block, IREG(0), R32(Rn)); // mov r0, Rn UML_MOV(block, IREG(1), R32(Rm)); // mov r1, Rm UML_AND(block, IREG(1), IREG(1), IMM(0xffff)); // and r1, r1, 0xffff @@ -1872,7 +1872,7 @@ static int generate_group_2(drcuml_block *block, compiler_state *compiler, const return TRUE; break; - case 2: // MOVLS(Rm, Rn); + case 2: // MOVLS(Rm, Rn); UML_MOV(block, IREG(0), R32(Rn)); // mov r0, Rn UML_MOV(block, IREG(1), R32(Rm)); // mov r1, Rm UML_CALLH(block, sh2->write32); @@ -1882,11 +1882,11 @@ static int generate_group_2(drcuml_block *block, compiler_state *compiler, const return TRUE; break; - case 3: // NOP(); + case 3: // NOP(); return TRUE; break; - case 4: // MOVBM(Rm, Rn); + case 4: // MOVBM(Rm, Rn); UML_MOV(block, IREG(1), R32(Rm)); // mov r1, Rm UML_SUB(block, R32(Rn), R32(Rn), IMM(1)); // sub Rn, Rn, 1 UML_MOV(block, IREG(0), R32(Rn)); // mov r0, Rn @@ -1897,7 +1897,7 @@ static int generate_group_2(drcuml_block *block, compiler_state *compiler, const return TRUE; break; - case 5: // MOVWM(Rm, Rn); + case 5: // MOVWM(Rm, Rn); UML_MOV(block, IREG(1), R32(Rm)); // mov r1, Rm UML_SUB(block, R32(Rn), R32(Rn), IMM(2)); // sub Rn, Rn, 2 UML_MOV(block, IREG(0), R32(Rn)); // mov r0, Rn @@ -1908,7 +1908,7 @@ static int generate_group_2(drcuml_block *block, compiler_state *compiler, const return TRUE; break; - case 6: // MOVLM(Rm, Rn); + case 6: // MOVLM(Rm, Rn); UML_MOV(block, IREG(1), R32(Rm)); // mov r1, Rm UML_SUB(block, R32(Rn), R32(Rn), IMM(4)); // sub Rn, Rn, 4 UML_MOV(block, IREG(0), R32(Rn)); // mov r0, Rn @@ -1919,7 +1919,7 @@ static int generate_group_2(drcuml_block *block, compiler_state *compiler, const return TRUE; break; - case 13: // XTRCT(Rm, Rn); + case 13: // XTRCT(Rm, Rn); UML_SHL(block, IREG(0), R32(Rm), IMM(16)); // shl r0, Rm, #16 UML_AND(block, IREG(0), IREG(0), IMM(0xffff0000)); // and r0, r0, #0xffff0000 @@ -1930,7 +1930,7 @@ static int generate_group_2(drcuml_block *block, compiler_state *compiler, const return TRUE; break; - case 7: // DIV0S(Rm, Rn); + case 7: // DIV0S(Rm, Rn); UML_MOV(block, IREG(0), MEM(&sh2->sr)); // move r0, sr UML_AND(block, IREG(0), IREG(0), IMM(~(Q|M|T))); // and r0, r0, ~(Q|M|T) (clear the Q,M, and T bits) @@ -1938,7 +1938,7 @@ static int generate_group_2(drcuml_block *block, compiler_state *compiler, const UML_JMPc(block, IF_Z, compiler->labelnum); // jz labelnum UML_OR(block, IREG(0), IREG(0), IMM(Q)); // or r0, r0, Q - UML_LABEL(block, compiler->labelnum++); // labelnum: + UML_LABEL(block, compiler->labelnum++); // labelnum: UML_TEST(block, R32(Rm), IMM(0x80000000)); // test Rm, #0x80000000 UML_JMPc(block, IF_Z, compiler->labelnum); // jz labelnum @@ -1969,21 +1969,21 @@ static int generate_group_2(drcuml_block *block, compiler_state *compiler, const break; case 12: // CMPSTR(Rm, Rn); - UML_XOR(block, IREG(0), R32(Rn), R32(Rm)); // xor r0, Rn, Rm (temp) + UML_XOR(block, IREG(0), R32(Rn), R32(Rm)); // xor r0, Rn, Rm (temp) - UML_SHR(block, IREG(1), IREG(0), IMM(24)); // shr r1, r0, #24 (HH) + UML_SHR(block, IREG(1), IREG(0), IMM(24)); // shr r1, r0, #24 (HH) UML_AND(block, IREG(1), IREG(1), IMM(0xff)); // and r1, r1, #0xff - UML_SHR(block, IREG(2), IREG(0), IMM(16)); // shr r2, r0, #16 (HL) + UML_SHR(block, IREG(2), IREG(0), IMM(16)); // shr r2, r0, #16 (HL) UML_AND(block, IREG(2), IREG(2), IMM(0xff)); // and r2, r2, #0xff - UML_SHR(block, IREG(3), IREG(0), IMM(8)); // shr r3, r0, #8 (LH) + UML_SHR(block, IREG(3), IREG(0), IMM(8)); // shr r3, r0, #8 (LH) UML_AND(block, IREG(3), IREG(3), IMM(0xff)); // and r3, r3, #0xff - UML_AND(block, IREG(7), IREG(0), IMM(0xff)); // and r7, r0, #0xff (LL) + UML_AND(block, IREG(7), IREG(0), IMM(0xff)); // and r7, r0, #0xff (LL) UML_AND(block, MEM(&sh2->sr), MEM(&sh2->sr), IMM(~T)); // and sr, sr, ~T (clear the T bit) - + UML_CMP(block, IREG(1), IMM(0)); // cmp r1, #0 UML_JMPc(block, IF_Z, compiler->labelnum); // jnz labelnum UML_CMP(block, IREG(2), IMM(0)); // cmp r2, #0 @@ -2005,12 +2005,12 @@ static int generate_group_2(drcuml_block *block, compiler_state *compiler, const return TRUE; break; - case 10: // XOR(Rm, Rn); + case 10: // XOR(Rm, Rn); UML_XOR(block, R32(Rn), R32(Rn), R32(Rm)); // xor Rn, Rn, Rm return TRUE; break; - case 11: // OR(Rm, Rn); + case 11: // OR(Rm, Rn); UML_OR(block, R32(Rn), R32(Rn), R32(Rm)); // or Rn, Rn, Rm return TRUE; break; @@ -2022,7 +2022,7 @@ static int generate_group_2(drcuml_block *block, compiler_state *compiler, const return TRUE; break; - case 15: // MULS(Rm, Rn); + case 15: // MULS(Rm, Rn); UML_SEXT(block, IREG(0), R32(Rm), WORD); // sext r0, Rm UML_SEXT(block, IREG(1), R32(Rn), WORD); // sext r1, Rn UML_MULS(block, MEM(&sh2->macl), MEM(&sh2->ea), IREG(0), IREG(1)); // muls macl, ea, r0, r1 @@ -2072,12 +2072,12 @@ static int generate_group_3(drcuml_block *block, compiler_state *compiler, const return TRUE; break; - case 1: // NOP(); - case 9: // NOP(); + case 1: // NOP(); + case 9: // NOP(); return TRUE; break; - case 4: // DIV1(Rm, Rn); + case 4: // DIV1(Rm, Rn); save_fast_iregs(block); UML_CALLC(block, cfunc_DIV1, desc->opptr.w); load_fast_iregs(block); @@ -2094,17 +2094,17 @@ static int generate_group_3(drcuml_block *block, compiler_state *compiler, const return TRUE; break; - case 8: // SUB(Rm, Rn); + case 8: // SUB(Rm, Rn); UML_SUB(block, R32(Rn), R32(Rn), R32(Rm)); // sub Rn, Rn, Rm return TRUE; break; - case 12: // ADD(Rm, Rn); + case 12: // ADD(Rm, Rn); UML_ADD(block, R32(Rn), R32(Rn), R32(Rm)); // add Rn, Rn, Rm return TRUE; break; - case 10: // SUBC(Rm, Rn); + case 10: // SUBC(Rm, Rn); UML_MOV(block, IREG(0), MEM(&sh2->sr)); // mov r0, sr (save SR) UML_AND(block, MEM(&sh2->sr), MEM(&sh2->sr), IMM(~T)); // and sr, sr, ~T (clear the T bit) @@ -2120,10 +2120,10 @@ static int generate_group_3(drcuml_block *block, compiler_state *compiler, const return TRUE; break; - case 11: // SUBV(Rm, Rn); + case 11: // SUBV(Rm, Rn); break; - case 14: // ADDC(Rm, Rn); + case 14: // ADDC(Rm, Rn); UML_MOV(block, IREG(0), MEM(&sh2->sr)); // mov r0, sr (save SR) UML_AND(block, MEM(&sh2->sr), MEM(&sh2->sr), IMM(~T)); // and sr, sr, ~T (clear the T bit) UML_CARRY(block, IREG(0), IMM(0)); // carry = T (T is bit 0 of SR) @@ -2140,7 +2140,7 @@ static int generate_group_3(drcuml_block *block, compiler_state *compiler, const UML_AND(block, MEM(&sh2->sr), MEM(&sh2->sr), IMM(~T)); // and sr, sr, ~T (clear the T bit) UML_ADD(block, R32(Rn), R32(Rn), R32(Rm)); // add Rn, Rn, Rm UML_JMPc(block, IF_NV, compiler->labelnum); // jnc labelnum - + UML_OR(block, MEM(&sh2->sr), MEM(&sh2->sr), IMM(T)); // or sr, sr, T UML_LABEL(block, compiler->labelnum++); // labelnum: @@ -2163,7 +2163,7 @@ static int generate_group_4(drcuml_block *block, compiler_state *compiler, const return TRUE; break; - case 0x01: // SHLR(Rn); + case 0x01: // SHLR(Rn); UML_AND(block, IREG(0), MEM(&sh2->sr), IMM(~T)); // and r0, sr, ~T (clear the T bit) UML_AND(block, IREG(1), R32(Rn), IMM(T)); // and r1, Rn, T UML_OR(block, MEM(&sh2->sr), IREG(0), IREG(1)); // or sr, r0, r1 @@ -2223,7 +2223,7 @@ static int generate_group_4(drcuml_block *block, compiler_state *compiler, const return TRUE; break; - case 0x06: // LDSMMACH(Rn); + case 0x06: // LDSMMACH(Rn); UML_MOV(block, IREG(0), R32(Rn)); // mov r0, Rn SETEA(0); UML_CALLH(block, sh2->read32); // call read32 @@ -2248,12 +2248,12 @@ static int generate_group_4(drcuml_block *block, compiler_state *compiler, const return TRUE; break; - case 0x08: // SHLL2(Rn); + case 0x08: // SHLL2(Rn); UML_SHL(block, R32(Rn), R32(Rn), IMM(2)); return TRUE; break; - case 0x09: // SHLR2(Rn); + case 0x09: // SHLR2(Rn); UML_SHR(block, R32(Rn), R32(Rn), IMM(2)); return TRUE; break; @@ -2262,12 +2262,12 @@ static int generate_group_4(drcuml_block *block, compiler_state *compiler, const UML_SHL(block, R32(Rn), R32(Rn), IMM(8)); return TRUE; break; - + case 0x19: // SHLR8(Rn); UML_SHR(block, R32(Rn), R32(Rn), IMM(8)); return TRUE; break; - + case 0x28: // SHLL16(Rn); UML_SHL(block, R32(Rn), R32(Rn), IMM(16)); return TRUE; @@ -2278,7 +2278,7 @@ static int generate_group_4(drcuml_block *block, compiler_state *compiler, const return TRUE; break; - case 0x0a: // LDSMACH(Rn); + case 0x0a: // LDSMACH(Rn); UML_MOV(block, MEM(&sh2->mach), R32(Rn)); // mov mach, Rn return TRUE; break; @@ -2286,7 +2286,7 @@ static int generate_group_4(drcuml_block *block, compiler_state *compiler, const case 0x0b: // JSR(Rn); UML_MOV(block, MEM(&sh2->target), R32(Rn)); // mov target, Rn - generate_delay_slot(block, compiler, desc); + generate_delay_slot(block, compiler, desc); UML_ADD(block, MEM(&sh2->pr), IMM(desc->pc), IMM(4)); // add sh2->pr, desc->pc, #4 (skip the current insn & delay slot) @@ -2330,7 +2330,7 @@ static int generate_group_4(drcuml_block *block, compiler_state *compiler, const UML_AND(block, IREG(0), MEM(&sh2->sr), IMM(~T)); // and r0, sr, ~T (clear the T bit) UML_CMP(block, R32(Rn), IMM(0)); // cmp Rn, 0 - UML_JMPc(block, IF_S, compiler->labelnum); // js compiler->labelnum (if negative) + UML_JMPc(block, IF_S, compiler->labelnum); // js compiler->labelnum (if negative) UML_OR(block, IREG(0), IREG(0), IMM(T)); // or r0, r0, T UML_LABEL(block, compiler->labelnum++); // desc->pc: @@ -2344,8 +2344,8 @@ static int generate_group_4(drcuml_block *block, compiler_state *compiler, const UML_CMP(block, R32(Rn), IMM(0)); // cmp Rn, 0 - UML_JMPc(block, IF_S, compiler->labelnum); // js compiler->labelnum (if negative) - UML_JMPc(block, IF_Z, compiler->labelnum); // jz compiler->labelnum (if zero) + UML_JMPc(block, IF_S, compiler->labelnum); // js compiler->labelnum (if negative) + UML_JMPc(block, IF_Z, compiler->labelnum); // jz compiler->labelnum (if zero) UML_OR(block, IREG(0), IREG(0), IMM(T)); // or r0, r0, T @@ -2354,7 +2354,7 @@ static int generate_group_4(drcuml_block *block, compiler_state *compiler, const return TRUE; break; - case 0x12: // STSMMACL(Rn); + case 0x12: // STSMMACL(Rn); UML_SUB(block, R32(Rn), R32(Rn), IMM(4)); // sub Rn, Rn, #4 UML_MOV(block, IREG(0), R32(Rn)); // mov r0, Rn UML_MOV(block, IREG(1), MEM(&sh2->macl)); // mov r1, macl @@ -2402,7 +2402,7 @@ static int generate_group_4(drcuml_block *block, compiler_state *compiler, const return TRUE; break; - case 0x1a: // LDSMACL(Rn); + case 0x1a: // LDSMACL(Rn); UML_MOV(block, MEM(&sh2->macl), R32(Rn)); // mov macl, Rn return TRUE; break; @@ -2419,7 +2419,7 @@ static int generate_group_4(drcuml_block *block, compiler_state *compiler, const UML_OR(block, MEM(&sh2->sr), MEM(&sh2->sr), IMM(T)); // or sr, sr, T - UML_LABEL(block, compiler->labelnum++); // labelnum: + UML_LABEL(block, compiler->labelnum++); // labelnum: UML_OR(block, IREG(1), IREG(0), IMM(0x80)); // or r1, r0, #0x80 @@ -2431,12 +2431,12 @@ static int generate_group_4(drcuml_block *block, compiler_state *compiler, const return TRUE; break; - case 0x1e: // LDCGBR(Rn); + case 0x1e: // LDCGBR(Rn); UML_MOV(block, MEM(&sh2->gbr), R32(Rn)); // mov gbr, Rn return TRUE; break; - case 0x20: // SHAL(Rn); + case 0x20: // SHAL(Rn); UML_AND(block, MEM(&sh2->sr), MEM(&sh2->sr), IMM(~T)); // and sr, sr, ~T UML_SHR(block, IREG(0), R32(Rn), IMM(31)); // shr r0, Rn, 31 UML_AND(block, IREG(0), IREG(0), IMM(T)); // and r0, r0, T @@ -2445,7 +2445,7 @@ static int generate_group_4(drcuml_block *block, compiler_state *compiler, const return TRUE; break; - case 0x21: // SHAR(Rn); + case 0x21: // SHAR(Rn); UML_AND(block, MEM(&sh2->sr), MEM(&sh2->sr), IMM(~T)); // and sr, sr, ~T UML_AND(block, IREG(0), R32(Rn), IMM(T)); // and r0, Rn, T UML_OR(block, MEM(&sh2->sr), MEM(&sh2->sr), IREG(0)); // or sr, sr, r0 @@ -2453,7 +2453,7 @@ static int generate_group_4(drcuml_block *block, compiler_state *compiler, const return TRUE; break; - case 0x22: // STSMPR(Rn); + case 0x22: // STSMPR(Rn); UML_SUB(block, R32(Rn), R32(Rn), IMM(4)); // sub Rn, Rn, 4 UML_MOV(block, IREG(0), R32(Rn)); // mov r0, Rn SETEA(0); @@ -2492,7 +2492,7 @@ static int generate_group_4(drcuml_block *block, compiler_state *compiler, const break; case 0x25: // ROTCR(Rn); - UML_AND(block, IREG(0), MEM(&sh2->sr), IMM(T)); // and r0, sr, T + UML_AND(block, IREG(0), MEM(&sh2->sr), IMM(T)); // and r0, sr, T UML_SHL(block, IREG(0), IREG(0), IMM(31)); // shl r0, r0, #31 (r0 = temp) UML_AND(block, IREG(1), R32(Rn), IMM(T)); // and r1, Rn, T (r1 = Rn & T) @@ -2507,7 +2507,7 @@ static int generate_group_4(drcuml_block *block, compiler_state *compiler, const UML_LABEL(block, compiler->labelnum++); // labelnum: UML_SHR(block, R32(Rn), R32(Rn), IMM(1)); // shr Rn, Rn, #1 - UML_OR(block, R32(Rn), R32(Rn), IREG(0)); // or Rn, Rn, r0 + UML_OR(block, R32(Rn), R32(Rn), IREG(0)); // or Rn, Rn, r0 return TRUE; break; @@ -2523,7 +2523,7 @@ static int generate_group_4(drcuml_block *block, compiler_state *compiler, const return TRUE; break; - case 0x27: // LDCMVBR(Rn); + case 0x27: // LDCMVBR(Rn); UML_MOV(block, IREG(0), R32(Rn)); // mov r0, Rn SETEA(0); UML_CALLH(block, sh2->read32); // call read32 @@ -2544,7 +2544,7 @@ static int generate_group_4(drcuml_block *block, compiler_state *compiler, const UML_MOV(block, MEM(&sh2->target), R32(Rn)); // mov target, Rn generate_delay_slot(block, compiler, desc); - + generate_update_cycles(block, compiler, MEM(&sh2->target), TRUE); // <subtract cycles> UML_HASHJMP(block, IMM(0), MEM(&sh2->target), sh2->nocode); // jmp (target) return TRUE; @@ -2555,28 +2555,28 @@ static int generate_group_4(drcuml_block *block, compiler_state *compiler, const return TRUE; break; - case 0x0c: // NOP(); - case 0x0d: // NOP(); - case 0x14: // NOP(); - case 0x1c: // NOP(); - case 0x1d: // NOP(); - case 0x2c: // NOP(); - case 0x2d: // NOP(); - case 0x30: // NOP(); - case 0x31: // NOP(); - case 0x32: // NOP(); - case 0x33: // NOP(); - case 0x34: // NOP(); - case 0x35: // NOP(); - case 0x36: // NOP(); - case 0x37: // NOP(); - case 0x38: // NOP(); - case 0x39: // NOP(); - case 0x3a: // NOP(); - case 0x3b: // NOP(); - case 0x3c: // NOP(); - case 0x3d: // NOP(); - case 0x3e: // NOP(); + case 0x0c: // NOP(); + case 0x0d: // NOP(); + case 0x14: // NOP(); + case 0x1c: // NOP(); + case 0x1d: // NOP(); + case 0x2c: // NOP(); + case 0x2d: // NOP(); + case 0x30: // NOP(); + case 0x31: // NOP(); + case 0x32: // NOP(); + case 0x33: // NOP(); + case 0x34: // NOP(); + case 0x35: // NOP(); + case 0x36: // NOP(); + case 0x37: // NOP(); + case 0x38: // NOP(); + case 0x39: // NOP(); + case 0x3a: // NOP(); + case 0x3b: // NOP(); + case 0x3c: // NOP(); + case 0x3d: // NOP(); + case 0x3e: // NOP(); return TRUE; break; @@ -2720,11 +2720,11 @@ static int generate_group_6(drcuml_block *block, compiler_state *compiler, const UML_SHL(block, IREG(1), IREG(1), IMM(8)); // shl r1, r1, #8 UML_SHR(block, IREG(2), IREG(2), IMM(8)); // shr r2, r2, #8 UML_OR(block, IREG(0), IREG(0), IREG(1)); // or r0, r0, r1 - UML_OR(block, R32(Rn), IREG(0), IREG(2)); // or Rn, r0, r2 + UML_OR(block, R32(Rn), IREG(0), IREG(2)); // or Rn, r0, r2 return TRUE; break; - case 10: // NEGC(Rm, Rn); + case 10: // NEGC(Rm, Rn); UML_MOV(block, IREG(0), MEM(&sh2->sr)); // mov r0, sr (save SR) UML_AND(block, MEM(&sh2->sr), MEM(&sh2->sr), IMM(~T)); // and sr, sr, ~T (clear the T bit) UML_CARRY(block, IREG(0), IMM(0)); // carry = T (T is bit 0 of SR) @@ -2773,18 +2773,18 @@ static int generate_group_8(drcuml_block *block, compiler_state *compiler, const return TRUE; break; - case 2<< 8: // NOP(); - case 3<< 8: // NOP(); - case 6<< 8: // NOP(); - case 7<< 8: // NOP(); - case 10<< 8: // NOP(); - case 12<< 8: // NOP(); - case 14<< 8: // NOP(); + case 2<< 8: // NOP(); + case 3<< 8: // NOP(); + case 6<< 8: // NOP(); + case 7<< 8: // NOP(); + case 10<< 8: // NOP(); + case 12<< 8: // NOP(); + case 14<< 8: // NOP(); return TRUE; break; - case 4<< 8: // MOVBL4(Rm, opcode & 0x0f); - udisp = opcode & 0x0f; + case 4<< 8: // MOVBL4(Rm, opcode & 0x0f); + udisp = opcode & 0x0f; UML_ADD(block, IREG(0), R32(Rm), IMM(udisp)); // add r0, Rm, udisp SETEA(0); UML_CALLH(block, sh2->read8); // call read8 @@ -2795,8 +2795,8 @@ static int generate_group_8(drcuml_block *block, compiler_state *compiler, const return TRUE; break; - case 5<< 8: // MOVWL4(Rm, opcode & 0x0f); - udisp = (opcode & 0x0f)*2; + case 5<< 8: // MOVWL4(Rm, opcode & 0x0f); + udisp = (opcode & 0x0f)*2; UML_ADD(block, IREG(0), R32(Rm), IMM(udisp)); // add r0, Rm, udisp SETEA(0); UML_CALLH(block, sh2->read16); // call read16 @@ -2812,7 +2812,7 @@ static int generate_group_8(drcuml_block *block, compiler_state *compiler, const UML_SEXT(block, IREG(1), IMM(opcode&0xff), BYTE); // sext r1, opcode&0xff, BYTE UML_CMP(block, IREG(1), R32(0)); // cmp r1, R0 - UML_JMPc(block, IF_NZ, compiler->labelnum); // jnz compiler->labelnum (if negative) + UML_JMPc(block, IF_NZ, compiler->labelnum); // jnz compiler->labelnum (if negative) UML_OR(block, IREG(0), IREG(0), IMM(T)); // or r0, r0, T @@ -2821,7 +2821,7 @@ static int generate_group_8(drcuml_block *block, compiler_state *compiler, const return TRUE; break; - case 9<< 8: // BT(opcode & 0xff); + case 9<< 8: // BT(opcode & 0xff); UML_TEST(block, MEM(&sh2->sr), IMM(T)); // test sh2->sr, T UML_JMPc(block, IF_Z, compiler->labelnum); // jz compiler->labelnum @@ -2835,7 +2835,7 @@ static int generate_group_8(drcuml_block *block, compiler_state *compiler, const return TRUE; break; - case 11<< 8: // BF(opcode & 0xff); + case 11<< 8: // BF(opcode & 0xff); UML_TEST(block, MEM(&sh2->sr), IMM(T)); // test sh2->sr, T UML_JMPc(block, IF_NZ, compiler->labelnum); // jnz compiler->labelnum @@ -2855,7 +2855,7 @@ static int generate_group_8(drcuml_block *block, compiler_state *compiler, const templabel = compiler->labelnum; // save our label compiler->labelnum++; // make sure the delay slot doesn't use it - generate_delay_slot(block, compiler, desc); + generate_delay_slot(block, compiler, desc); disp = ((INT32)opcode << 24) >> 24; sh2->ea = (desc->pc + 2) + disp * 2 + 2; // sh2->ea = destination @@ -2896,7 +2896,7 @@ static int generate_group_12(drcuml_block *block, compiler_state *compiler, cons switch (opcode & (15<<8)) { case 0<<8: // MOVBSG(opcode & 0xff); - scratch = (opcode & 0xff); + scratch = (opcode & 0xff); UML_ADD(block, IREG(0), MEM(&sh2->gbr), IMM(scratch)); // add r0, gbr, scratch UML_AND(block, IREG(1), R32(0), IMM(0xff)); // and r1, R0, 0xff UML_CALLH(block, sh2->write8); // call write8 @@ -2907,7 +2907,7 @@ static int generate_group_12(drcuml_block *block, compiler_state *compiler, cons break; case 1<<8: // MOVWSG(opcode & 0xff); - scratch = (opcode & 0xff) * 2; + scratch = (opcode & 0xff) * 2; UML_ADD(block, IREG(0), MEM(&sh2->gbr), IMM(scratch)); // add r0, gbr, scratch UML_AND(block, IREG(1), R32(0), IMM(0xffff)); // and r1, R0, 0xffff UML_CALLH(block, sh2->write16); // call write16 @@ -2918,7 +2918,7 @@ static int generate_group_12(drcuml_block *block, compiler_state *compiler, cons break; case 2<<8: // MOVLSG(opcode & 0xff); - scratch = (opcode & 0xff) * 4; + scratch = (opcode & 0xff) * 4; UML_ADD(block, IREG(0), MEM(&sh2->gbr), IMM(scratch)); // add r0, gbr, scratch UML_MOV(block, IREG(1), R32(0)); // mov r1, R0 UML_CALLH(block, sh2->write32); // call write32 @@ -2982,10 +2982,10 @@ static int generate_group_12(drcuml_block *block, compiler_state *compiler, cons return TRUE; break; - case 7<<8: // MOVA(opcode & 0xff); + case 7<<8: // MOVA(opcode & 0xff); scratch = (opcode & 0xff) * 4; scratch += ((desc->pc + 4) & ~3); - + UML_MOV(block, R32(0), IMM(scratch)); // mov R0, scratch return TRUE; break; @@ -3004,24 +3004,24 @@ static int generate_group_12(drcuml_block *block, compiler_state *compiler, cons return TRUE; break; - case 9<<8: // ANDI(opcode & 0xff); + case 9<<8: // ANDI(opcode & 0xff); UML_AND(block, R32(0), R32(0), IMM(opcode & 0xff)); // and r0, r0, opcode & 0xff return TRUE; break; - case 10<<8: // XORI(opcode & 0xff); + case 10<<8: // XORI(opcode & 0xff); UML_XOR(block, R32(0), R32(0), IMM(opcode & 0xff)); // xor r0, r0, opcode & 0xff return TRUE; break; - case 11<<8: // ORI(opcode & 0xff); + case 11<<8: // ORI(opcode & 0xff); UML_OR(block, R32(0), R32(0), IMM(opcode & 0xff)); // or r0, r0, opcode & 0xff return TRUE; break; - case 12<<8: // TSTM(opcode & 0xff); - case 13<<8: // ANDM(opcode & 0xff); - case 14<<8: // XORM(opcode & 0xff); + case 12<<8: // TSTM(opcode & 0xff); + case 13<<8: // ANDM(opcode & 0xff); + case 14<<8: // XORM(opcode & 0xff); break; case 15<<8: // ORM(opcode & 0xff); diff --git a/src/emu/cpu/sh2/sh2fe.c b/src/emu/cpu/sh2/sh2fe.c index f7ec3be0c47..22fc9c2c47b 100644 --- a/src/emu/cpu/sh2/sh2fe.c +++ b/src/emu/cpu/sh2/sh2fe.c @@ -46,7 +46,7 @@ int sh2_describe(void *param, opcode_desc *desc, const opcode_desc *prev) switch (opcode>>12) { - case 0: + case 0: return describe_group_0(context, desc, prev, opcode); break; @@ -56,15 +56,15 @@ int sh2_describe(void *param, opcode_desc *desc, const opcode_desc *prev) return TRUE; break; - case 2: + case 2: return describe_group_2(context, desc, prev, opcode); break; - case 3: + case 3: return describe_group_3(context, desc, prev, opcode); break; - case 4: + case 4: return describe_group_4(context, desc, prev, opcode); break; @@ -75,7 +75,7 @@ int sh2_describe(void *param, opcode_desc *desc, const opcode_desc *prev) return TRUE; break; - case 6: + case 6: return describe_group_6(context, desc, prev, opcode); break; @@ -85,7 +85,7 @@ int sh2_describe(void *param, opcode_desc *desc, const opcode_desc *prev) return TRUE; break; - case 8: + case 8: return describe_group_8(context, desc, prev, opcode); break; @@ -110,7 +110,7 @@ int sh2_describe(void *param, opcode_desc *desc, const opcode_desc *prev) } break; - case 12: + case 12: return describe_group_12(context, desc, prev, opcode); break; @@ -161,9 +161,9 @@ static int describe_group_0(SH2 *context, opcode_desc *desc, const opcode_desc * return TRUE; break; - case 0x03: // BSRF(Rn); + case 0x03: // BSRF(Rn); desc->regout[1] |= REGFLAG_PR; - + desc->flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; desc->targetpc = BRANCH_TARGET_DYNAMIC; desc->delayslots = 1; @@ -188,30 +188,30 @@ static int describe_group_0(SH2 *context, opcode_desc *desc, const opcode_desc * return TRUE; break; - case 0x07: // MULL(Rm, Rn); + case 0x07: // MULL(Rm, Rn); case 0x17: // MULL(Rm, Rn); - case 0x27: // MULL(Rm, Rn); - case 0x37: // MULL(Rm, Rn); + case 0x27: // MULL(Rm, Rn); + case 0x37: // MULL(Rm, Rn); desc->regin[0] |= REGFLAG_R(Rn) | REGFLAG_R(Rm); desc->regout[1] |= REGFLAG_MACL; desc->cycles = 2; return TRUE; break; - case 0x08: // CLRT(); + case 0x08: // CLRT(); desc->regout[1] |= REGFLAG_SR; return TRUE; break; - case 0x0a: // STSMACH(Rn); + case 0x0a: // STSMACH(Rn); desc->regout[0] |= REGFLAG_R(Rn); desc->regout[1] |= REGFLAG_MACH; return TRUE; break; - case 0x0b: // RTS(); + case 0x0b: // RTS(); desc->regin[1] |= REGFLAG_PR; - + desc->flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; desc->targetpc = BRANCH_TARGET_DYNAMIC; desc->delayslots = 1; @@ -238,10 +238,10 @@ static int describe_group_0(SH2 *context, opcode_desc *desc, const opcode_desc * return TRUE; break; - case 0x0f: // MAC_L(Rm, Rn); - case 0x1f: // MAC_L(Rm, Rn); - case 0x2f: // MAC_L(Rm, Rn); - case 0x3f: // MAC_L(Rm, Rn); + case 0x0f: // MAC_L(Rm, Rn); + case 0x1f: // MAC_L(Rm, Rn); + case 0x2f: // MAC_L(Rm, Rn); + case 0x3f: // MAC_L(Rm, Rn); desc->regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); desc->regout[1] |= REGFLAG_MACL | REGFLAG_MACH; desc->cycles = 3; @@ -254,7 +254,7 @@ static int describe_group_0(SH2 *context, opcode_desc *desc, const opcode_desc * return TRUE; break; - case 0x18: // SETT(); + case 0x18: // SETT(); desc->regout[1] |= REGFLAG_SR; return TRUE; break; @@ -264,7 +264,7 @@ static int describe_group_0(SH2 *context, opcode_desc *desc, const opcode_desc * return TRUE; break; - case 0x1a: // STSMACL(Rn); + case 0x1a: // STSMACL(Rn); desc->regin[1] |= REGFLAG_MACL; desc->regout[0] |= REGFLAG_R(Rn); return TRUE; @@ -281,7 +281,7 @@ static int describe_group_0(SH2 *context, opcode_desc *desc, const opcode_desc * return TRUE; break; - case 0x23: // BRAF(Rn); + case 0x23: // BRAF(Rn); desc->regin[0] |= REGFLAG_R(Rm); desc->flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; desc->targetpc = BRANCH_TARGET_DYNAMIC; @@ -290,27 +290,27 @@ static int describe_group_0(SH2 *context, opcode_desc *desc, const opcode_desc * return TRUE; break; - case 0x28: // CLRMAC(); + case 0x28: // CLRMAC(); desc->regout[1] |= REGFLAG_MACL | REGFLAG_MACH; return TRUE; break; - case 0x29: // MOVT(Rn); + case 0x29: // MOVT(Rn); desc->regin[1] |= REGFLAG_SR; desc->regout[0] |= REGFLAG_R(Rn); return TRUE; break; - case 0x2a: // STSPR(Rn); + case 0x2a: // STSPR(Rn); desc->regin[1] |= REGFLAG_PR; desc->regout[0] |= REGFLAG_R(Rn); return TRUE; break; - case 0x2b: // RTE(); + case 0x2b: // RTE(); desc->regin[0] |= REGFLAG_R(15); desc->regout[0] |= REGFLAG_R(15); - + desc->flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE | OPFLAG_CAN_EXPOSE_EXTERNAL_INT; desc->targetpc = BRANCH_TARGET_DYNAMIC; desc->delayslots = 1; @@ -327,46 +327,46 @@ static int describe_group_2(SH2 *context, opcode_desc *desc, const opcode_desc * { switch (opcode & 15) { - case 0: // MOVBS(Rm, Rn); - case 1: // MOVWS(Rm, Rn); - case 2: // MOVLS(Rm, Rn); + case 0: // MOVBS(Rm, Rn); + case 1: // MOVWS(Rm, Rn); + case 2: // MOVLS(Rm, Rn); desc->regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); desc->flags |= OPFLAG_WRITES_MEMORY; return TRUE; break; - case 3: // NOP(); + case 3: // NOP(); return TRUE; break; - case 4: // MOVBM(Rm, Rn); - case 5: // MOVWM(Rm, Rn); - case 6: // MOVLM(Rm, Rn); - case 13: // XTRCT(Rm, Rn); + case 4: // MOVBM(Rm, Rn); + case 5: // MOVWM(Rm, Rn); + case 6: // MOVLM(Rm, Rn); + case 13: // XTRCT(Rm, Rn); desc->regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); desc->regout[0] |= REGFLAG_R(Rn); desc->flags |= OPFLAG_WRITES_MEMORY; return TRUE; break; - case 7: // DIV0S(Rm, Rn); - case 8: // TST(Rm, Rn); + case 7: // DIV0S(Rm, Rn); + case 8: // TST(Rm, Rn); case 12: // CMPSTR(Rm, Rn); desc->regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); desc->regout[1] |= REGFLAG_SR; return TRUE; break; - case 9: // AND(Rm, Rn); - case 10: // XOR(Rm, Rn); - case 11: // OR(Rm, Rn); + case 9: // AND(Rm, Rn); + case 10: // XOR(Rm, Rn); + case 11: // OR(Rm, Rn); desc->regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); desc->regout[0] |= REGFLAG_R(Rn); return TRUE; break; - case 14: // MULU(Rm, Rn); - case 15: // MULS(Rm, Rn); + case 14: // MULU(Rm, Rn); + case 15: // MULS(Rm, Rn); desc->regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); desc->regout[1] |= REGFLAG_MACL | REGFLAG_MACH; desc->cycles = 2; @@ -391,12 +391,12 @@ static int describe_group_3(SH2 *context, opcode_desc *desc, const opcode_desc * return TRUE; break; - case 1: // NOP(); - case 9: // NOP(); + case 1: // NOP(); + case 9: // NOP(); return TRUE; break; - case 4: // DIV1(Rm, Rn); + case 4: // DIV1(Rm, Rn); desc->regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); desc->regout[0] |= REGFLAG_R(Rn); desc->regout[1] |= REGFLAG_SR; @@ -411,17 +411,17 @@ static int describe_group_3(SH2 *context, opcode_desc *desc, const opcode_desc * return TRUE; break; - case 8: // SUB(Rm, Rn); - case 12: // ADD(Rm, Rn); + case 8: // SUB(Rm, Rn); + case 12: // ADD(Rm, Rn); desc->regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); desc->regout[0] |= REGFLAG_R(Rn); return TRUE; break; - case 10: // SUBC(Rm, Rn); - case 11: // SUBV(Rm, Rn); - case 14: // ADDC(Rm, Rn); - case 15: // ADDV(Rm, Rn); + case 10: // SUBC(Rm, Rn); + case 11: // SUBV(Rm, Rn); + case 14: // ADDC(Rm, Rn); + case 15: // ADDV(Rm, Rn); desc->regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); desc->regin[1] |= REGFLAG_SR; desc->regout[0] |= REGFLAG_R(Rn); @@ -437,16 +437,16 @@ static int describe_group_4(SH2 *context, opcode_desc *desc, const opcode_desc * switch (opcode & 0x3F) { case 0x00: // SHLL(Rn); - case 0x01: // SHLR(Rn); - case 0x04: // ROTL(Rn); - case 0x05: // ROTR(Rn); + case 0x01: // SHLR(Rn); + case 0x04: // ROTL(Rn); + case 0x05: // ROTR(Rn); desc->regin[0] |= REGFLAG_R(Rn); desc->regout[0] |= REGFLAG_R(Rn); desc->regout[1] |= REGFLAG_SR; return TRUE; break; - case 0x02: // STSMMACH(Rn); + case 0x02: // STSMMACH(Rn); desc->regin[0] |= REGFLAG_R(Rn); desc->regin[1] |= REGFLAG_MACH; desc->regout[0] |= REGFLAG_R(Rn); @@ -454,7 +454,7 @@ static int describe_group_4(SH2 *context, opcode_desc *desc, const opcode_desc * return TRUE; break; - case 0x03: // STCMSR(Rn); + case 0x03: // STCMSR(Rn); desc->regin[0] |= REGFLAG_R(Rn); desc->regout[0] |= REGFLAG_R(Rn); desc->cycles = 2; @@ -462,7 +462,7 @@ static int describe_group_4(SH2 *context, opcode_desc *desc, const opcode_desc * return TRUE; break; - case 0x06: // LDSMMACH(Rn); + case 0x06: // LDSMMACH(Rn); desc->regin[0] |= REGFLAG_R(Rn); desc->regout[0] |= REGFLAG_R(Rn); desc->regout[1] |= REGFLAG_MACH; @@ -470,7 +470,7 @@ static int describe_group_4(SH2 *context, opcode_desc *desc, const opcode_desc * return TRUE; break; - case 0x07: // LDCMSR(Rn); + case 0x07: // LDCMSR(Rn); desc->regin[0] |= REGFLAG_R(Rn); desc->regout[0] |= REGFLAG_R(Rn); desc->regout[1] |= REGFLAG_SR; @@ -479,24 +479,24 @@ static int describe_group_4(SH2 *context, opcode_desc *desc, const opcode_desc * return TRUE; break; - case 0x08: // SHLL2(Rn); - case 0x09: // SHLR2(Rn); - case 0x18: // SHLL8(Rn); - case 0x19: // SHLR8(Rn); - case 0x28: // SHLL16(Rn); - case 0x29: // SHLR16(Rn); + case 0x08: // SHLL2(Rn); + case 0x09: // SHLR2(Rn); + case 0x18: // SHLL8(Rn); + case 0x19: // SHLR8(Rn); + case 0x28: // SHLL16(Rn); + case 0x29: // SHLR16(Rn); desc->regin[0] |= REGFLAG_R(Rn); desc->regout[0] |= REGFLAG_R(Rn); return TRUE; break; - case 0x0a: // LDSMACH(Rn); + case 0x0a: // LDSMACH(Rn); desc->regin[0] |= REGFLAG_R(Rn); desc->regout[1] |= REGFLAG_MACH; return TRUE; break; - case 0x0b: // JSR(Rn); + case 0x0b: // JSR(Rn); desc->regin[0] |= REGFLAG_R(Rn); desc->regout[1] |= REGFLAG_PR; desc->flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; @@ -505,7 +505,7 @@ static int describe_group_4(SH2 *context, opcode_desc *desc, const opcode_desc * return TRUE; break; - case 0x0e: // LDCSR(Rn); + case 0x0e: // LDCSR(Rn); desc->regin[0] |= REGFLAG_R(Rn); desc->regout[1] |= REGFLAG_SR; desc->flags |= OPFLAG_CAN_EXPOSE_EXTERNAL_INT | OPFLAG_END_SEQUENCE; @@ -524,7 +524,7 @@ static int describe_group_4(SH2 *context, opcode_desc *desc, const opcode_desc * return TRUE; break; - case 0x10: // DT(Rn); + case 0x10: // DT(Rn); desc->regin[0] |= REGFLAG_R(Rn); desc->regin[1] |= REGFLAG_SR; desc->regout[0] |= REGFLAG_R(Rn); @@ -532,15 +532,15 @@ static int describe_group_4(SH2 *context, opcode_desc *desc, const opcode_desc * return TRUE; break; - case 0x11: // CMPPZ(Rn); - case 0x15: // CMPPL(Rn); + case 0x11: // CMPPZ(Rn); + case 0x15: // CMPPL(Rn); desc->regin[0] |= REGFLAG_R(Rn); desc->regin[1] |= REGFLAG_SR; desc->regout[1] |= REGFLAG_SR; return TRUE; break; - case 0x12: // STSMMACL(Rn); + case 0x12: // STSMMACL(Rn); desc->regin[0] |= REGFLAG_R(Rn); desc->regin[1] |= REGFLAG_MACL; desc->regout[0] |= REGFLAG_R(Rn); @@ -548,7 +548,7 @@ static int describe_group_4(SH2 *context, opcode_desc *desc, const opcode_desc * return TRUE; break; - case 0x13: // STCMGBR(Rn); + case 0x13: // STCMGBR(Rn); desc->regin[0] |= REGFLAG_R(Rn); desc->regin[1] |= REGFLAG_GBR; desc->regout[0] |= REGFLAG_R(Rn); @@ -556,7 +556,7 @@ static int describe_group_4(SH2 *context, opcode_desc *desc, const opcode_desc * return TRUE; break; - case 0x16: // LDSMMACL(Rn); + case 0x16: // LDSMMACL(Rn); desc->regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); desc->regout[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); desc->regout[1] |= REGFLAG_MACL; @@ -564,7 +564,7 @@ static int describe_group_4(SH2 *context, opcode_desc *desc, const opcode_desc * return TRUE; break; - case 0x17: // LDCMGBR(Rn); + case 0x17: // LDCMGBR(Rn); desc->regin[0] |= REGFLAG_R(Rn); desc->regout[0] |= REGFLAG_R(Rn); desc->regout[1] |= REGFLAG_GBR; @@ -572,13 +572,13 @@ static int describe_group_4(SH2 *context, opcode_desc *desc, const opcode_desc * return TRUE; break; - case 0x1a: // LDSMACL(Rn); + case 0x1a: // LDSMACL(Rn); desc->regin[0] |= REGFLAG_R(Rn); desc->regout[1] |= REGFLAG_MACL; return TRUE; break; - case 0x1b: // TAS(Rn); + case 0x1b: // TAS(Rn); desc->regin[0] |= REGFLAG_R(Rn); desc->regin[1] |= REGFLAG_SR; desc->regout[1] |= REGFLAG_SR; @@ -587,21 +587,21 @@ static int describe_group_4(SH2 *context, opcode_desc *desc, const opcode_desc * return TRUE; break; - case 0x1e: // LDCGBR(Rn); + case 0x1e: // LDCGBR(Rn); desc->regin[0] |= REGFLAG_R(Rn); desc->regout[1] |= REGFLAG_GBR; return TRUE; break; - case 0x20: // SHAL(Rn); - case 0x21: // SHAR(Rn); + case 0x20: // SHAL(Rn); + case 0x21: // SHAR(Rn); desc->regin[0] |= REGFLAG_R(Rn); desc->regout[0] |= REGFLAG_R(Rn); desc->regout[1] |= REGFLAG_SR; return TRUE; break; - case 0x22: // STSMPR(Rn); + case 0x22: // STSMPR(Rn); desc->regin[0] |= REGFLAG_R(Rn); desc->regin[1] |= REGFLAG_PR; desc->regout[0] |= REGFLAG_R(Rn); @@ -609,7 +609,7 @@ static int describe_group_4(SH2 *context, opcode_desc *desc, const opcode_desc * return TRUE; break; - case 0x23: // STCMVBR(Rn); + case 0x23: // STCMVBR(Rn); desc->regin[0] |= REGFLAG_R(Rn); desc->regin[1] |= REGFLAG_VBR; desc->regout[0] |= REGFLAG_R(Rn); @@ -617,8 +617,8 @@ static int describe_group_4(SH2 *context, opcode_desc *desc, const opcode_desc * return TRUE; break; - case 0x24: // ROTCL(Rn); - case 0x25: // ROTCR(Rn); + case 0x24: // ROTCL(Rn); + case 0x25: // ROTCR(Rn); desc->regin[0] |= REGFLAG_R(Rn); desc->regin[1] |= REGFLAG_SR; desc->regout[0] |= REGFLAG_R(Rn); @@ -626,7 +626,7 @@ static int describe_group_4(SH2 *context, opcode_desc *desc, const opcode_desc * return TRUE; break; - case 0x26: // LDSMPR(Rn); + case 0x26: // LDSMPR(Rn); desc->regin[0] |= REGFLAG_R(Rn); desc->regout[0] |= REGFLAG_R(Rn); desc->regout[1] |= REGFLAG_PR; @@ -634,7 +634,7 @@ static int describe_group_4(SH2 *context, opcode_desc *desc, const opcode_desc * return TRUE; break; - case 0x27: // LDCMVBR(Rn); + case 0x27: // LDCMVBR(Rn); desc->regin[0] |= REGFLAG_R(Rn); desc->regout[0] |= REGFLAG_R(Rn); desc->regout[1] |= REGFLAG_VBR; @@ -642,7 +642,7 @@ static int describe_group_4(SH2 *context, opcode_desc *desc, const opcode_desc * return TRUE; break; - case 0x2a: // LDSPR(Rn); + case 0x2a: // LDSPR(Rn); desc->regin[0] |= REGFLAG_R(Rn); desc->regout[1] |= REGFLAG_PR; return TRUE; @@ -656,34 +656,34 @@ static int describe_group_4(SH2 *context, opcode_desc *desc, const opcode_desc * return TRUE; break; - case 0x2e: // LDCVBR(Rn); + case 0x2e: // LDCVBR(Rn); desc->regin[0] |= REGFLAG_R(Rn); desc->regout[1] |= REGFLAG_VBR; return TRUE; break; - case 0x0c: // NOP(); - case 0x0d: // NOP(); - case 0x14: // NOP(); - case 0x1c: // NOP(); - case 0x1d: // NOP(); - case 0x2c: // NOP(); - case 0x2d: // NOP(); - case 0x30: // NOP(); - case 0x31: // NOP(); - case 0x32: // NOP(); - case 0x33: // NOP(); - case 0x34: // NOP(); - case 0x35: // NOP(); - case 0x36: // NOP(); - case 0x37: // NOP(); - case 0x38: // NOP(); - case 0x39: // NOP(); - case 0x3a: // NOP(); - case 0x3b: // NOP(); - case 0x3c: // NOP(); - case 0x3d: // NOP(); - case 0x3e: // NOP(); + case 0x0c: // NOP(); + case 0x0d: // NOP(); + case 0x14: // NOP(); + case 0x1c: // NOP(); + case 0x1d: // NOP(); + case 0x2c: // NOP(); + case 0x2d: // NOP(); + case 0x30: // NOP(); + case 0x31: // NOP(); + case 0x32: // NOP(); + case 0x33: // NOP(); + case 0x34: // NOP(); + case 0x35: // NOP(); + case 0x36: // NOP(); + case 0x37: // NOP(); + case 0x38: // NOP(); + case 0x39: // NOP(); + case 0x3a: // NOP(); + case 0x3b: // NOP(); + case 0x3c: // NOP(); + case 0x3d: // NOP(); + case 0x3e: // NOP(); return TRUE; break; @@ -699,10 +699,10 @@ static int describe_group_6(SH2 *context, opcode_desc *desc, const opcode_desc * case 0: // MOVBL(Rm, Rn); case 1: // MOVWL(Rm, Rn); case 2: // MOVLL(Rm, Rn); - case 3: // MOV(Rm, Rn); - case 7: // NOT(Rm, Rn); + case 3: // MOV(Rm, Rn); + case 7: // NOT(Rm, Rn); case 9: // SWAPW(Rm, Rn); - case 11: // NEG(Rm, Rn); + case 11: // NEG(Rm, Rn); case 12: // EXTUB(Rm, Rn); case 13: // EXTUW(Rm, Rn); case 14: // EXTSB(Rm, Rn); @@ -727,7 +727,7 @@ static int describe_group_6(SH2 *context, opcode_desc *desc, const opcode_desc * return TRUE; break; - case 10: // NEGC(Rm, Rn); + case 10: // NEGC(Rm, Rn); desc->regin[0] |= REGFLAG_R(Rm); desc->regout[0] |= REGFLAG_R(Rn); desc->regout[1] |= REGFLAG_SR; @@ -750,18 +750,18 @@ static int describe_group_8(SH2 *context, opcode_desc *desc, const opcode_desc * return TRUE; break; - case 2<< 8: // NOP(); - case 3<< 8: // NOP(); - case 6<< 8: // NOP(); - case 7<< 8: // NOP(); - case 10<< 8: // NOP(); - case 12<< 8: // NOP(); - case 14<< 8: // NOP(); + case 2<< 8: // NOP(); + case 3<< 8: // NOP(); + case 6<< 8: // NOP(); + case 7<< 8: // NOP(); + case 10<< 8: // NOP(); + case 12<< 8: // NOP(); + case 14<< 8: // NOP(); return TRUE; break; - case 4<< 8: // MOVBL4(Rm, opcode & 0x0f); - case 5<< 8: // MOVWL4(Rm, opcode & 0x0f); + case 4<< 8: // MOVBL4(Rm, opcode & 0x0f); + case 5<< 8: // MOVWL4(Rm, opcode & 0x0f); desc->regin[0] |= REGFLAG_R(Rm); desc->regout[0] |= REGFLAG_R(0); desc->flags |= OPFLAG_READS_MEMORY; @@ -775,8 +775,8 @@ static int describe_group_8(SH2 *context, opcode_desc *desc, const opcode_desc * return TRUE; break; - case 9<< 8: // BT(opcode & 0xff); - case 11<< 8: // BF(opcode & 0xff); + case 9<< 8: // BT(opcode & 0xff); + case 11<< 8: // BF(opcode & 0xff); desc->flags |= OPFLAG_IS_CONDITIONAL_BRANCH; desc->cycles = 3; disp = ((INT32)opcode << 24) >> 24; @@ -784,8 +784,8 @@ static int describe_group_8(SH2 *context, opcode_desc *desc, const opcode_desc * return TRUE; break; - case 13<< 8: // BTS(opcode & 0xff); - case 15<< 8: // BFS(opcode & 0xff); + case 13<< 8: // BTS(opcode & 0xff); + case 15<< 8: // BFS(opcode & 0xff); desc->flags |= OPFLAG_IS_CONDITIONAL_BRANCH; desc->cycles = 2; disp = ((INT32)opcode << 24) >> 24; @@ -810,7 +810,7 @@ static int describe_group_12(SH2 *context, opcode_desc *desc, const opcode_desc return TRUE; break; - case 3<<8: // TRAPA(opcode & 0xff); + case 3<<8: // TRAPA(opcode & 0xff); desc->regin[0] |= REGFLAG_R(15); desc->regin[1] |= REGFLAG_VBR; desc->regout[0] |= REGFLAG_R(15); @@ -823,31 +823,31 @@ static int describe_group_12(SH2 *context, opcode_desc *desc, const opcode_desc case 4<<8: // MOVBLG(opcode & 0xff); case 5<<8: // MOVWLG(opcode & 0xff); case 6<<8: // MOVLLG(opcode & 0xff); - case 7<<8: // MOVA(opcode & 0xff); + case 7<<8: // MOVA(opcode & 0xff); desc->regout[0] |= REGFLAG_R(0); desc->flags |= OPFLAG_READS_MEMORY; return TRUE; break; - case 8<<8: // TSTI(opcode & 0xff); + case 8<<8: // TSTI(opcode & 0xff); desc->regin[0] |= REGFLAG_R(0); desc->regin[1] |= REGFLAG_SR; desc->regout[1] |= REGFLAG_SR; return TRUE; break; - case 9<<8: // ANDI(opcode & 0xff); - case 10<<8: // XORI(opcode & 0xff); - case 11<<8: // ORI(opcode & 0xff); + case 9<<8: // ANDI(opcode & 0xff); + case 10<<8: // XORI(opcode & 0xff); + case 11<<8: // ORI(opcode & 0xff); desc->regin[0] |= REGFLAG_R(0); desc->regout[0] |= REGFLAG_R(0); return TRUE; break; - case 12<<8: // TSTM(opcode & 0xff); - case 13<<8: // ANDM(opcode & 0xff); - case 14<<8: // XORM(opcode & 0xff); - case 15<<8: // ORM(opcode & 0xff); + case 12<<8: // TSTM(opcode & 0xff); + case 13<<8: // ANDM(opcode & 0xff); + case 14<<8: // XORM(opcode & 0xff); + case 15<<8: // ORM(opcode & 0xff); desc->regin[0] |= REGFLAG_R(0); desc->regin[1] |= REGFLAG_SR | REGFLAG_GBR; desc->regout[1] |= REGFLAG_SR; diff --git a/src/emu/cpu/sh4/sh4.c b/src/emu/cpu/sh4/sh4.c index a9074d1e66c..7d2205a3c07 100644 --- a/src/emu/cpu/sh4/sh4.c +++ b/src/emu/cpu/sh4/sh4.c @@ -2058,7 +2058,7 @@ INLINE void TAS(UINT32 n) INLINE void TRAPA(UINT32 i) { UINT32 imm = i & 0xff; - + sh4.m[TRA] = imm; sh4.ssr = sh4.sr; sh4.spc = sh4.pc; diff --git a/src/emu/debug/debugcpu.c b/src/emu/debug/debugcpu.c index b91ddfa19af..016463c297b 100644 --- a/src/emu/debug/debugcpu.c +++ b/src/emu/debug/debugcpu.c @@ -2124,8 +2124,8 @@ UINT64 debug_read_opcode(offs_t address, int size, int arg) /*------------------------------------------------- - expression_read_memory - read 1,2,4 or 8 bytes - at the given offset in the given address + expression_read_memory - read 1,2,4 or 8 bytes + at the given offset in the given address space -------------------------------------------------*/ @@ -2141,15 +2141,15 @@ static UINT64 expression_read_memory(int space, int index, UINT32 address, int s cpuindex = (index == -1) ? cpu_getactivecpu() : index; space = ADDRESS_SPACE_PROGRAM + (space - EXPSPACE_PROGRAM); return expression_read_address_space(cpuindex, space, address, size); - + case EXPSPACE_OPCODE: case EXPSPACE_RAMWRITE: cpuindex = (index == -1) ? cpu_getactivecpu() : index; return expression_read_program_direct(cpuindex, (space == EXPSPACE_OPCODE), address, size); - + case EXPSPACE_EEPROM: return expression_read_eeprom(address, size); - + case EXPSPACE_CPU: case EXPSPACE_USER: case EXPSPACE_GFX: @@ -2178,7 +2178,7 @@ static UINT64 expression_read_address_space(int cpuindex, int space, offs_t addr { /* adjust the address into a byte address */ address = ADDR2BYTE(address, info, space); - + /* switch contexts and do the read */ cpuintrf_push_context(cpuindex); switch (size) @@ -2211,13 +2211,13 @@ static UINT64 expression_read_program_direct(int cpuindex, int opcode, offs_t ad /* adjust the address into a byte address, but not if being called recursively */ if ((opcode & 2) == 0) address = ADDR2BYTE(address, info, ADDRESS_SPACE_PROGRAM); - + /* call ourself recursively until we are byte-sized */ if (size > 1) - { + { int halfsize = size / 2; UINT64 r0, r1; - + /* read each half, from lower address to upper address */ r0 = expression_read_program_direct(cpuindex, opcode | 2, address + 0, halfsize); r1 = expression_read_program_direct(cpuindex, opcode | 2, address + halfsize, halfsize); @@ -2228,7 +2228,7 @@ static UINT64 expression_read_program_direct(int cpuindex, int opcode, offs_t ad else result = r1 | (r0 << (8 * halfsize)); } - + /* handle the byte-sized final requests */ else { @@ -2240,7 +2240,7 @@ static UINT64 expression_read_program_direct(int cpuindex, int opcode, offs_t ad base = memory_get_op_ptr(cpuindex, address & ~lowmask, FALSE); else base = memory_get_read_ptr(cpuindex, ADDRESS_SPACE_PROGRAM, address & ~lowmask); - + /* if we have a valid base, return the appropriate byte */ if (base != NULL) { @@ -2264,7 +2264,7 @@ static UINT64 expression_read_memory_region(int rgnindex, int rgntype, offs_t ad { UINT64 result = ~(UINT64)0 >> (64 - 8*size); int rgnnum = -1; - + /* convert to a region number */ switch (rgntype) { @@ -2273,24 +2273,24 @@ static UINT64 expression_read_memory_region(int rgnindex, int rgntype, offs_t ad case EXPSPACE_GFX: rgnnum = REGION_GFX1 + (rgnindex - 1); break; case EXPSPACE_SOUND: rgnnum = REGION_SOUND1 + (rgnindex - 1); break; } - + /* process if it exists */ if (rgnnum != -1) { UINT8 *base = memory_region(Machine, rgnnum); - + /* make sure we get a valid base before proceeding */ if (base != NULL) { UINT32 length = memory_region_length(Machine, rgnnum); UINT32 flags = memory_region_flags(Machine, rgnnum); - + /* call ourself recursively until we are byte-sized */ if (size > 1) { int halfsize = size / 2; UINT64 r0, r1; - + /* read each half, from lower address to upper address */ r0 = expression_read_memory_region(rgnindex, rgntype, address + 0, halfsize); r1 = expression_read_memory_region(rgnindex, rgntype, address + halfsize, halfsize); @@ -2301,7 +2301,7 @@ static UINT64 expression_read_memory_region(int rgnindex, int rgntype, offs_t ad else result = r1 | (r0 << (8 * halfsize)); } - + /* only process if we're within range */ else if (address < length) { @@ -2330,7 +2330,7 @@ static UINT64 expression_read_eeprom(offs_t address, int size) UINT64 result = ~(UINT64)0 >> (64 - 8*size); UINT32 eelength, eesize; void *base; - + /* make sure we get a valid base before proceeding */ base = eeprom_get_data_pointer(&eelength, &eesize); if (base != NULL && address < eelength) @@ -2347,8 +2347,8 @@ static UINT64 expression_read_eeprom(offs_t address, int size) /*------------------------------------------------- - expression_write_memory - write 1,2,4 or 8 - bytes at the given offset in the given address + expression_write_memory - write 1,2,4 or 8 + bytes at the given offset in the given address space -------------------------------------------------*/ @@ -2365,17 +2365,17 @@ static void expression_write_memory(int space, int index, UINT32 address, int si space = ADDRESS_SPACE_PROGRAM + (space - EXPSPACE_PROGRAM); expression_write_address_space(cpuindex, space, address, size, data); break; - + case EXPSPACE_OPCODE: case EXPSPACE_RAMWRITE: cpuindex = (index == -1) ? cpu_getactivecpu() : index; expression_write_program_direct(cpuindex, (space == EXPSPACE_OPCODE), address, size, data); break; - + case EXPSPACE_EEPROM: expression_write_eeprom(address, size, data); break; - + case EXPSPACE_CPU: case EXPSPACE_USER: case EXPSPACE_GFX: @@ -2397,13 +2397,13 @@ static void expression_write_memory(int space, int index, UINT32 address, int si static void expression_write_address_space(int cpuindex, int space, offs_t address, int size, UINT64 data) { const debug_cpu_info *info = &global.cpuinfo[cpuindex]; - + /* only process if in of range and we have a bus */ if (cpuindex < ARRAY_LENGTH(global.cpuinfo) && info->space[space].databytes != 0) { /* adjust the address into a byte address */ address = ADDR2BYTE(address, info, space); - + /* switch contexts and do the write */ cpuintrf_push_context(cpuindex); switch (size) @@ -2434,7 +2434,7 @@ static void expression_write_program_direct(int cpuindex, int opcode, offs_t add /* adjust the address into a byte address, but not if being called recursively */ if ((opcode & 2) == 0) address = ADDR2BYTE(address, info, ADDRESS_SPACE_PROGRAM); - + /* call ourself recursively until we are byte-sized */ if (size > 1) { @@ -2453,12 +2453,12 @@ static void expression_write_program_direct(int cpuindex, int opcode, offs_t add r0 = (data >> (8 * halfsize)) & halfmask; r1 = data & halfmask; } - + /* write each half, from lower address to upper address */ expression_write_program_direct(cpuindex, opcode | 2, address + 0, halfsize, r0); expression_write_program_direct(cpuindex, opcode | 2, address + halfsize, halfsize, r1); } - + /* handle the byte-sized final case */ else { @@ -2470,7 +2470,7 @@ static void expression_write_program_direct(int cpuindex, int opcode, offs_t add base = memory_get_op_ptr(cpuindex, address & ~lowmask, FALSE); else base = memory_get_read_ptr(cpuindex, ADDRESS_SPACE_PROGRAM, address & ~lowmask); - + /* if we have a valid base, write the appropriate byte */ if (base != NULL) { @@ -2493,7 +2493,7 @@ static void expression_write_program_direct(int cpuindex, int opcode, offs_t add static void expression_write_memory_region(int rgnindex, int rgntype, offs_t address, int size, UINT64 data) { int rgnnum = -1; - + /* convert to a region number */ switch (rgntype) { @@ -2502,12 +2502,12 @@ static void expression_write_memory_region(int rgnindex, int rgntype, offs_t add case EXPSPACE_GFX: rgnnum = REGION_GFX1 + (rgnindex - 1); break; case EXPSPACE_SOUND: rgnnum = REGION_SOUND1 + (rgnindex - 1); break; } - + /* process if it exists */ if (rgnnum != -1) { UINT8 *base = memory_region(Machine, rgnnum); - + /* make sure we get a valid base before proceeding */ if (base != NULL) { @@ -2519,7 +2519,7 @@ static void expression_write_memory_region(int rgnindex, int rgntype, offs_t add { int halfsize = size / 2; UINT64 r0, r1, halfmask; - + /* break apart based on the target endianness */ halfmask = ~(UINT64)0 >> (64 - 8 * halfsize); if ((flags & ROMREGION_ENDIANMASK) == ROMREGION_LE) @@ -2532,12 +2532,12 @@ static void expression_write_memory_region(int rgnindex, int rgntype, offs_t add r0 = (data >> (8 * halfsize)) & halfmask; r1 = data & halfmask; } - + /* write each half, from lower address to upper address */ expression_write_memory_region(rgnindex, rgntype, address + 0, halfsize, r0); expression_write_memory_region(rgnindex, rgntype, address + halfsize, halfsize, r1); } - + /* only process if we're within range */ else if (address < length) { @@ -2565,12 +2565,12 @@ static void expression_write_eeprom(offs_t address, int size, UINT64 data) { UINT32 eelength, eesize; void *vbase = eeprom_get_data_pointer(&eelength, &eesize); - + /* make sure we get a valid base before proceeding */ if (vbase != NULL && address < eelength) { UINT64 mask = ~(UINT64)0 >> (64 - 8*size); - + /* switch off the size */ switch (eesize) { @@ -2580,7 +2580,7 @@ static void expression_write_eeprom(offs_t address, int size, UINT64 data) *base = (*base & ~mask) | (data & mask); break; } - + case 2: { UINT16 *base = (UINT16 *)vbase + address; diff --git a/src/emu/debug/express.c b/src/emu/debug/express.c index 2a135b2fb7c..829ee1f3647 100644 --- a/src/emu/debug/express.c +++ b/src/emu/debug/express.c @@ -559,10 +559,10 @@ static int parse_memory_operator(const char *buffer, token_info *flags) case 'q': *flags |= TIN_MEMORY_QWORD; break; default: return 0; } - + /* add the index to flags */ *flags |= index << TIN_MEMORY_INDEX_SHIFT; - + return 1; } @@ -1675,7 +1675,7 @@ EXPRERR expression_parse(const char *expression, const symbol_table *table, cons { parsed_expression temp_expression; EXPRERR exprerr; - + /* first parse the tokens into the token array in order */ exprerr = parse_string_into_tokens(expression, &temp_expression, table); if (exprerr != EXPRERR_NONE) diff --git a/src/emu/inptport.c b/src/emu/inptport.c index d18711f19e8..ada4b219309 100644 --- a/src/emu/inptport.c +++ b/src/emu/inptport.c @@ -905,7 +905,7 @@ void input_field_set_user_settings(const input_field_config *field, const input_ /*------------------------------------------------- - input_field_setting_name - return the expanded + input_field_setting_name - return the expanded setting name for a field -------------------------------------------------*/ @@ -921,13 +921,13 @@ const char *input_field_setting_name(const input_field_config *field) if (input_condition_true(field->port->machine, &setting->condition)) if (setting->value == field->state->value) return setting->name; - + return "INVALID"; } /*------------------------------------------------- - input_field_has_previous_setting - return TRUE + input_field_has_previous_setting - return TRUE if the given field has a "previous" setting -------------------------------------------------*/ @@ -942,7 +942,7 @@ int input_field_has_previous_setting(const input_field_config *field) for (setting = field->settinglist; setting != NULL; setting = setting->next) if (input_condition_true(field->port->machine, &setting->condition)) return (setting->value != field->state->value); - + return FALSE; } @@ -990,7 +990,7 @@ void input_field_select_previous_setting(const input_field_config *field) /*------------------------------------------------- - input_field_has_next_setting - return TRUE + input_field_has_next_setting - return TRUE if the given field has a "next" setting -------------------------------------------------*/ @@ -1011,7 +1011,7 @@ int input_field_has_next_setting(const input_field_config *field) if (setting->value == field->state->value) found = TRUE; } - + return FALSE; } @@ -1994,7 +1994,7 @@ profiler_mark(PROFILER_INPUT); /* track the duration of the previous frame */ portdata->last_delta_nsec = attotime_to_attoseconds(attotime_sub(curtime, portdata->last_frame_time)) / ATTOSECONDS_PER_NANOSECOND; portdata->last_frame_time = curtime; - + /* update the digital joysticks */ frame_update_digital_joysticks(machine); diff --git a/src/emu/input.c b/src/emu/input.c index 7fa08beb597..6eaac6dab8d 100644 --- a/src/emu/input.c +++ b/src/emu/input.c @@ -938,7 +938,7 @@ int input_code_pressed_once(input_code code) /*------------------------------------------------- input_code_from_input_item_id - translates - an input_item_id to an input_code + an input_item_id to an input_code -------------------------------------------------*/ input_code input_code_from_input_item_id(input_item_id itemid) diff --git a/src/emu/machine/pit8253.c b/src/emu/machine/pit8253.c index c461f5aa0f0..d40e6056476 100644 --- a/src/emu/machine/pit8253.c +++ b/src/emu/machine/pit8253.c @@ -373,9 +373,9 @@ static void simulate2(const device_config *device, struct pit8253_timer *timer, phase|output|length |value|next|comment -----+------+--------+-----+----+---------------------------------- 0|high |infinity| |1 |waiting for count - 1|high |1 | |2 |internal delay to load counter + 1|high |1 | |2 |internal delay to load counter 2|high |n |n..2 |3 |counting down - 3|low |1 |1 |2 |reload counter + 3|low |1 |1 |2 |reload counter Counter rewrite has no effect until repeated @@ -440,26 +440,26 @@ static void simulate2(const device_config *device, struct pit8253_timer *timer, case 3: /* Mode 3: (Square Wave Generator) - ----------------+ +-----------+ +---- - | | | | - +-----------+ +-----------+ - <- (n+1)/2 -X- n/2 -> - ^ - +- counter load or trigger + ----------------+ +-----------+ +---- + | | | | + +-----------+ +-----------+ + <- (n+1)/2 -X- n/2 -> + ^ + +- counter load or trigger phase|output|length |value|next|comment - -----+------+--------+-----+----+---------------------------------- - 0|high |infinity| |1 |waiting for count - 1|high |1 | |2 |internal delay to load counter - 2|high |n/2(+1) |n..0 |3 |counting down double speed, reload counter - 3|low |n/2 |n..0 |2 |counting down double speed, reload counter + -----+------+--------+-----+----+---------------------------------- + 0|high |infinity| |1 |waiting for count + 1|high |1 | |2 |internal delay to load counter + 2|high |n/2(+1) |n..0 |3 |counting down double speed, reload counter + 3|low |n/2 |n..0 |2 |counting down double speed, reload counter - Counter rewrite has no effect until repeated (output falling or rising) + Counter rewrite has no effect until repeated (output falling or rising) - Gate rising-edge and level sensitive. - Gate low disables counting and sets output immediately high. - Rising-edge reloads count and initiates counting - Gate high enables counting. */ + Gate rising-edge and level sensitive. + Gate low disables counting and sets output immediately high. + Rising-edge reloads count and initiates counting + Gate high enables counting. */ if (timer->gate == 0 || timer->phase == 0) { @@ -518,28 +518,28 @@ static void simulate2(const device_config *device, struct pit8253_timer *timer, case 4: case 5: /* Mode 4: (Software Trigger Strobe) - Mode 5: (Hardware Trigger Strobe) - - --------------+ +-------------------- - | | - +-+ - <- n+1 -> - ^ <1> - +- counter load (mode 4) or trigger (mode 5) - - phase|output|length |value|next|comment - -----+------+--------+-----+----+---------------------------------- - 0|high |infinity|0..1 |0 |waiting for count/counting down - 1|high |1 | |2 |internal delay when counter loaded - 2|high |n |n..1 |3 |counting down - 3|low |1 |0 |0 |strobe - - Mode 4 only: counter rewrite loads new counter - Mode 5 only: count not reloaded immediately. - Mode control write doesn't stop count but sets output high - - Mode 4 only: Gate level sensitive only. Low disables counting, high enables it. - Mode 5 only: Gate rising-edge sensitive only. Rising edge initiates counting */ + Mode 5: (Hardware Trigger Strobe) + + --------------+ +-------------------- + | | + +-+ + <- n+1 -> + ^ <1> + +- counter load (mode 4) or trigger (mode 5) + + phase|output|length |value|next|comment + -----+------+--------+-----+----+---------------------------------- + 0|high |infinity|0..1 |0 |waiting for count/counting down + 1|high |1 | |2 |internal delay when counter loaded + 2|high |n |n..1 |3 |counting down + 3|low |1 |0 |0 |strobe + + Mode 4 only: counter rewrite loads new counter + Mode 5 only: count not reloaded immediately. + Mode control write doesn't stop count but sets output high + + Mode 4 only: Gate level sensitive only. Low disables counting, high enables it. + Mode 5 only: Gate rising-edge sensitive only. Rising edge initiates counting */ if (timer->gate == 0 && mode == 4) { diff --git a/src/emu/mame.c b/src/emu/mame.c index 43117582e11..18f10cb04a2 100644 --- a/src/emu/mame.c +++ b/src/emu/mame.c @@ -844,7 +844,7 @@ UINT8 *new_memory_region(running_machine *machine, int type, UINT32 length, UINT break; if (num < 0) fatalerror("Out of memory regions!"); - + /* allocate the region */ mame->mem_region[num].length = length; mame->mem_region[num].type = type; @@ -1616,8 +1616,8 @@ static void init_machine(running_machine *machine) /* initialize miscellaneous systems */ saveload_init(machine); -// if (options_get_bool(mame_options(), OPTION_CHEAT)) -// cheat_init(machine); +// if (options_get_bool(mame_options(), OPTION_CHEAT)) +// cheat_init(machine); } diff --git a/src/emu/render.c b/src/emu/render.c index 31b0b9eb7a3..bf99aef35cd 100644 --- a/src/emu/render.c +++ b/src/emu/render.c @@ -465,7 +465,7 @@ INLINE void free_render_ref(render_ref *ref) /*------------------------------------------------- - get_layer_and_blendmode - return the + get_layer_and_blendmode - return the appropriate layer index and blendmode -------------------------------------------------*/ @@ -473,7 +473,7 @@ INLINE int get_layer_and_blendmode(const layout_view *view, int index, int *blen { const int *layer_order = layer_order_standard; int layer; - + /* if we have multiple backdrop pieces and no overlays, render: backdrop (add) + screens (add) + bezels (alpha) @@ -482,10 +482,10 @@ INLINE int get_layer_and_blendmode(const layout_view *view, int index, int *blen */ if (view->itemlist[ITEM_LAYER_BACKDROP] != NULL && view->itemlist[ITEM_LAYER_BACKDROP]->next != NULL && view->itemlist[ITEM_LAYER_OVERLAY] == NULL) layer_order = layer_order_alternate; - + /* select the layer */ layer = layer_order[index]; - + /* if we want the blendmode as well, compute it */ if (blendmode != NULL) { @@ -753,7 +753,7 @@ static void render_load(running_machine *machine, int config_type, xml_data_node if (target == render_get_ui_target()) { render_container_user_settings settings; - + render_container_get_user_settings(ui_container, &settings); settings.orientation = orientation_add(orientation_reverse(tmpint), settings.orientation); render_container_set_user_settings(ui_container, &settings); @@ -768,7 +768,7 @@ static void render_load(running_machine *machine, int config_type, xml_data_node int index = xml_get_attribute_int(screennode, "index", -1); render_container *container = get_screen_container_by_index(index); render_container_user_settings settings; - + /* fetch current settings */ render_container_get_user_settings(container, &settings); @@ -782,7 +782,7 @@ static void render_load(running_machine *machine, int config_type, xml_data_node settings.xscale = xml_get_attribute_float(screennode, "hstretch", settings.xscale); settings.yoffset = xml_get_attribute_float(screennode, "voffset", settings.yoffset); settings.yscale = xml_get_attribute_float(screennode, "vstretch", settings.yscale); - + /* set the new values */ render_container_set_user_settings(container, &settings); } @@ -1670,7 +1670,7 @@ const render_primitive_list *render_target_get_primitives(render_target *target) /*------------------------------------------------- render_target_map_point_internal - internal - logic for mapping points + logic for mapping points -------------------------------------------------*/ static int render_target_map_point_internal(render_target *target, INT32 target_x, INT32 target_y, @@ -1746,8 +1746,8 @@ static int render_target_map_point_internal(render_target *target, INT32 target_ /*------------------------------------------------- render_target_map_point_container - attempts to - map a point on the specified render_target to - the specified container, if possible + map a point on the specified render_target to + the specified container, if possible -------------------------------------------------*/ int render_target_map_point_container(render_target *target, INT32 target_x, INT32 target_y, render_container *container, float *container_x, float *container_y) @@ -2709,7 +2709,7 @@ int render_container_is_empty(render_container *container) /*------------------------------------------------- - render_container_get_user_settings - get the + render_container_get_user_settings - get the current user settings for a container -------------------------------------------------*/ @@ -2727,7 +2727,7 @@ void render_container_get_user_settings(render_container *container, render_cont /*------------------------------------------------- - render_container_set_user_settings - set the + render_container_set_user_settings - set the current user settings for a container -------------------------------------------------*/ diff --git a/src/emu/render.h b/src/emu/render.h index e088e795e06..8164ea4e340 100644 --- a/src/emu/render.h +++ b/src/emu/render.h @@ -294,7 +294,7 @@ struct _render_primitive_list /*------------------------------------------------- - render_container_user_settings - an object + render_container_user_settings - an object containing user-controllable settings for a container -------------------------------------------------*/ diff --git a/src/emu/romload.c b/src/emu/romload.c index dead855a571..53016deacd4 100644 --- a/src/emu/romload.c +++ b/src/emu/romload.c @@ -1051,7 +1051,7 @@ static UINT32 normalize_flags_for_cpu(running_machine *machine, UINT32 startflag { int cputype = machine->config->cpu[cpunum].type; int buswidth; - + /* set the endianness */ startflags &= ~ROMREGION_ENDIANMASK; if (cputype_endianness(cputype) == CPU_IS_LE) @@ -1070,7 +1070,7 @@ static UINT32 normalize_flags_for_cpu(running_machine *machine, UINT32 startflag startflags |= ROMREGION_32BIT; else startflags |= ROMREGION_64BIT; - + return startflags; } diff --git a/src/emu/ui.c b/src/emu/ui.c index 2eed96c5333..4ad4b26d4a2 100644 --- a/src/emu/ui.c +++ b/src/emu/ui.c @@ -277,7 +277,7 @@ static void ui_exit(running_machine *machine) if (ui_font != NULL) render_font_free(ui_font); ui_font = NULL; - + /* free the messagebox string */ if (messagebox_text != NULL) astring_free(messagebox_text); @@ -965,7 +965,7 @@ static astring *warnings_string(running_machine *machine, astring *string) GAME_IMPERFECT_GRAPHICS | \ GAME_NO_COCKTAIL) int i; - + astring_reset(string); /* if no warnings, nothing to return */ @@ -1142,7 +1142,7 @@ astring *game_info_astring(running_machine *machine, astring *string) } } } - + return string; } @@ -1242,8 +1242,8 @@ static UINT32 handler_ingame(running_machine *machine, UINT32 state) ui_draw_text_full(profiler_get_text(), 0.0f, 0.0f, 1.0f, JUSTIFY_LEFT, WRAP_WORD, DRAW_OPAQUE, ARGB_WHITE, ARGB_BLACK, NULL, NULL); /* let the cheat engine display its stuff */ -// if (options_get_bool(mame_options(), OPTION_CHEAT)) -// cheat_display_watches(machine); +// if (options_get_bool(mame_options(), OPTION_CHEAT)) +// cheat_display_watches(machine); /* display any popup messages */ if (osd_ticks() < popup_text_end) @@ -1806,7 +1806,7 @@ static INT32 slider_brightness(running_machine *machine, INT32 newval, char *buf const device_config *screen = arg; render_container *container = render_container_get_screen(screen); render_container_user_settings settings; - + render_container_get_user_settings(container, &settings); if (buffer != NULL) { @@ -1828,7 +1828,7 @@ static INT32 slider_contrast(running_machine *machine, INT32 newval, char *buffe const device_config *screen = arg; render_container *container = render_container_get_screen(screen); render_container_user_settings settings; - + render_container_get_user_settings(container, &settings); if (buffer != NULL) { @@ -1849,7 +1849,7 @@ static INT32 slider_gamma(running_machine *machine, INT32 newval, char *buffer, const device_config *screen = arg; render_container *container = render_container_get_screen(screen); render_container_user_settings settings; - + render_container_get_user_settings(container, &settings); if (buffer != NULL) { @@ -1871,7 +1871,7 @@ static INT32 slider_xscale(running_machine *machine, INT32 newval, char *buffer, const device_config *screen = arg; render_container *container = render_container_get_screen(screen); render_container_user_settings settings; - + render_container_get_user_settings(container, &settings); if (buffer != NULL) { @@ -1893,7 +1893,7 @@ static INT32 slider_yscale(running_machine *machine, INT32 newval, char *buffer, const device_config *screen = arg; render_container *container = render_container_get_screen(screen); render_container_user_settings settings; - + render_container_get_user_settings(container, &settings); if (buffer != NULL) { @@ -1915,7 +1915,7 @@ static INT32 slider_xoffset(running_machine *machine, INT32 newval, char *buffer const device_config *screen = arg; render_container *container = render_container_get_screen(screen); render_container_user_settings settings; - + render_container_get_user_settings(container, &settings); if (buffer != NULL) { @@ -1937,7 +1937,7 @@ static INT32 slider_yoffset(running_machine *machine, INT32 newval, char *buffer const device_config *screen = arg; render_container *container = render_container_get_screen(screen); render_container_user_settings settings; - + render_container_get_user_settings(container, &settings); if (buffer != NULL) { diff --git a/src/emu/uiinput.c b/src/emu/uiinput.c index 0fd77e6d81a..232485584cc 100644 --- a/src/emu/uiinput.c +++ b/src/emu/uiinput.c @@ -70,7 +70,7 @@ static void ui_input_frame_update(running_machine *machine); /*------------------------------------------------- ui_input_init - initializes the UI input - system + system -------------------------------------------------*/ void ui_input_init(running_machine *machine) @@ -93,8 +93,8 @@ void ui_input_init(running_machine *machine) /*------------------------------------------------- ui_input_frame_update - looks through pressed - input as per events pushed our way and posts - corresponding IPT_UI_* events + input as per events pushed our way and posts + corresponding IPT_UI_* events -------------------------------------------------*/ static void ui_input_frame_update(running_machine *machine) @@ -114,7 +114,7 @@ static void ui_input_frame_update(running_machine *machine) /*------------------------------------------------- ui_input_push_event - pushes a single event - onto the queue + onto the queue -------------------------------------------------*/ int ui_input_push_event(running_machine *machine, ui_event evt) @@ -203,7 +203,7 @@ void ui_input_reset(running_machine *machine) /*------------------------------------------------- - ui_input_find_mouse - retrieves the current + ui_input_find_mouse - retrieves the current location of the mouse -------------------------------------------------*/ diff --git a/src/emu/uiinput.h b/src/emu/uiinput.h index 04a75e9ff0b..3be99db4762 100644 --- a/src/emu/uiinput.h +++ b/src/emu/uiinput.h @@ -93,7 +93,7 @@ int ui_input_pressed_repeat(running_machine *machine, int code, int speed); /*------------------------------------------------- ui_input_push_mouse_move_event - pushes a mouse - move event to the specified render_target + move event to the specified render_target -------------------------------------------------*/ INLINE void ui_input_push_mouse_move_event(running_machine *machine, render_target *target, INT32 x, INT32 y) @@ -109,7 +109,7 @@ INLINE void ui_input_push_mouse_move_event(running_machine *machine, render_targ /*------------------------------------------------- ui_input_push_mouse_leave_event - pushes a - mouse leave event to the specified render_target + mouse leave event to the specified render_target -------------------------------------------------*/ INLINE void ui_input_push_mouse_leave_event(running_machine *machine, render_target *target) @@ -123,7 +123,7 @@ INLINE void ui_input_push_mouse_leave_event(running_machine *machine, render_tar /*------------------------------------------------- ui_input_push_mouse_click_event - pushes a mouse - click event to the specified render_target + click event to the specified render_target -------------------------------------------------*/ INLINE void ui_input_push_mouse_click_event(running_machine *machine, render_target *target, INT32 x, INT32 y) @@ -138,8 +138,8 @@ INLINE void ui_input_push_mouse_click_event(running_machine *machine, render_tar /*------------------------------------------------- - ui_input_push_mouse_double_click_event - pushes - a mouse double-click event to the specified + ui_input_push_mouse_double_click_event - pushes + a mouse double-click event to the specified render_target -------------------------------------------------*/ @@ -156,7 +156,7 @@ INLINE void ui_input_push_mouse_double_click_event(running_machine *machine, ren /*------------------------------------------------- ui_input_push_char_event - pushes a char event - to the specified render_target + to the specified render_target -------------------------------------------------*/ INLINE void ui_input_push_char_event(running_machine *machine, render_target *target, unicode_char ch) diff --git a/src/emu/uimenu.c b/src/emu/uimenu.c index da3f074c142..65323dc9385 100644 --- a/src/emu/uimenu.c +++ b/src/emu/uimenu.c @@ -201,7 +201,7 @@ struct _select_game_state const game_driver * matchlist[VISIBLE_GAMES_IN_LIST]; const game_driver * driverlist[1]; }; - + /*************************************************************************** @@ -309,7 +309,7 @@ INLINE const input_seq *get_field_default_seq(const input_field_config *field, i /*------------------------------------------------- - toggle_none_default - toggle between "NONE" + toggle_none_default - toggle between "NONE" and the default item -------------------------------------------------*/ @@ -418,16 +418,16 @@ static void ui_menu_exit(running_machine *machine) ui_menu *ui_menu_alloc(running_machine *machine, ui_menu_handler_func handler, void *parameter) { ui_menu *menu; - + /* allocate and clear memory for the menu and the state */ menu = malloc_or_die(sizeof(*menu)); memset(menu, 0, sizeof(*menu)); - + /* initialize the state */ menu->machine = machine; menu->handler = handler; menu->parameter = parameter; - + /* reset the menu (adds a default entry) */ ui_menu_reset(menu, UI_MENU_RESET_SELECT_FIRST); return menu; @@ -447,22 +447,22 @@ void ui_menu_free(ui_menu *menu) menu->pool = pool->next; free(pool); } - + /* free the item array */ if (menu->item != NULL) free(menu->item); - + /* free the state */ if (menu->state != NULL) free(menu->state); - + /* free the menu */ free(menu); } /*------------------------------------------------- - ui_menu_reset - free all items in the menu, + ui_menu_reset - free all items in the menu, and all memory allocated from the memory pool -------------------------------------------------*/ @@ -496,7 +496,7 @@ void ui_menu_reset(ui_menu *menu, ui_menu_reset_options options) /*------------------------------------------------- - ui_menu_populated - returns TRUE if the menu + ui_menu_populated - returns TRUE if the menu has any non-default items in it -------------------------------------------------*/ @@ -507,7 +507,7 @@ int ui_menu_populated(ui_menu *menu) /*------------------------------------------------- - ui_menu_item_append - append a new item to the + ui_menu_item_append - append a new item to the end of the menu -------------------------------------------------*/ @@ -515,11 +515,11 @@ void ui_menu_item_append(ui_menu *menu, const char *text, const char *subtext, U { ui_menu_item *item; int index; - + /* only allow multiline as the first item */ if ((flags & MENU_FLAG_MULTILINE) != 0) assert(menu->numitems == 1); - + /* only allow a single multi-line item */ else if (menu->numitems >= 2) assert((menu->item[0].flags & MENU_FLAG_MULTILINE) == 0); @@ -531,7 +531,7 @@ void ui_menu_item_append(ui_menu *menu, const char *text, const char *subtext, U menu->item = realloc(menu->item, menu->allocitems * sizeof(*item)); } index = menu->numitems++; - + /* copy the previous last item to the next one */ if (index != 0) { @@ -545,7 +545,7 @@ void ui_menu_item_append(ui_menu *menu, const char *text, const char *subtext, U item->subtext = (subtext != NULL) ? ui_menu_pool_strdup(menu, subtext) : NULL; item->flags = flags; item->ref = ref; - + /* update the selection if we need to */ if (menu->resetpos == index || (menu->resetref != NULL && menu->resetref == ref)) menu->selected = index; @@ -553,7 +553,7 @@ void ui_menu_item_append(ui_menu *menu, const char *text, const char *subtext, U /*------------------------------------------------- - ui_menu_process - process a menu, drawing it + ui_menu_process - process a menu, drawing it and returning any interesting events -------------------------------------------------*/ @@ -564,7 +564,7 @@ const ui_menu_event *ui_menu_process(ui_menu *menu, UINT32 flags) /* first make sure our selection is valid */ ui_menu_validate_selection(menu, 1); - + /* draw the menu */ if (menu->numitems > 1 && (menu->item[0].flags & MENU_FLAG_MULTILINE) != 0) ui_menu_draw_text_box(menu); @@ -593,7 +593,7 @@ const ui_menu_event *ui_menu_process(ui_menu *menu, UINT32 flags) /*------------------------------------------------- - ui_menu_set_custom_render - configure the menu + ui_menu_set_custom_render - configure the menu for custom rendering -------------------------------------------------*/ @@ -606,7 +606,7 @@ void ui_menu_set_custom_render(ui_menu *menu, ui_menu_custom_func custom, float /*------------------------------------------------- - ui_menu_alloc_state - allocate permanent + ui_menu_alloc_state - allocate permanent memory to represent the menu's state -------------------------------------------------*/ @@ -616,20 +616,20 @@ void *ui_menu_alloc_state(ui_menu *menu, size_t size) free(menu->state); menu->state = malloc_or_die(size); memset(menu->state, 0, size); - + return menu->state; } /*------------------------------------------------- - ui_menu_pool_alloc - allocate temporary memory + ui_menu_pool_alloc - allocate temporary memory from the menu's memory pool -------------------------------------------------*/ void *ui_menu_pool_alloc(ui_menu *menu, size_t size) { ui_menu_pool *pool; - + assert(size < UI_MENU_POOL_SIZE); /* find a pool with enough room */ @@ -640,11 +640,11 @@ void *ui_menu_pool_alloc(ui_menu *menu, size_t size) pool->top += size; return result; } - + /* allocate a new pool */ pool = malloc_or_die(sizeof(*pool) + UI_MENU_POOL_SIZE); memset(pool, 0, sizeof(*pool)); - + /* wire it up */ pool->next = menu->pool; menu->pool = pool; @@ -655,7 +655,7 @@ void *ui_menu_pool_alloc(ui_menu *menu, size_t size) /*------------------------------------------------- - ui_menu_pool_strdup - make a temporary string + ui_menu_pool_strdup - make a temporary string copy in the menu's memory pool -------------------------------------------------*/ @@ -667,7 +667,7 @@ const char *ui_menu_pool_strdup(ui_menu *menu, const char *string) /*------------------------------------------------- ui_menu_get_selection - retrieves the index - of the currently selected menu item + of the currently selected menu item -------------------------------------------------*/ void *ui_menu_get_selection(ui_menu *menu) @@ -678,13 +678,13 @@ void *ui_menu_get_selection(ui_menu *menu) /*------------------------------------------------- ui_menu_set_selection - changes the index - of the currently selected menu item + of the currently selected menu item -------------------------------------------------*/ void ui_menu_set_selection(ui_menu *menu, void *selected_itemref) { int itemnum; - + menu->selected = -1; for (itemnum = 0; itemnum < menu->numitems; itemnum++) if (menu->item[itemnum].ref == selected_itemref) @@ -829,7 +829,7 @@ static void ui_menu_draw(ui_menu *menu) { fgcolor = mouseover_fgcolor; bgcolor = mouseover_bgcolor; - } + } /* if we have some background hilighting to do, add a quad behind everything else */ if (bgcolor != text_bgcolor) @@ -1023,7 +1023,7 @@ static void ui_menu_draw_text_box(ui_menu *menu) PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE)); ui_draw_text_full(backtext, target_x, target_y + target_height - line_height, target_width, JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NORMAL, sel_fgcolor, sel_bgcolor, NULL, NULL); - + /* artificially set the hover to the last item so a double-click exits */ menu->hover = menu->numitems - 1; } @@ -1059,7 +1059,7 @@ static void ui_menu_handle_events(ui_menu *menu) ui_menu_validate_selection(menu, 1); } break; - + /* if we are hovering over a valid item, fake a UI_SELECT with a double-click */ case UI_EVENT_MOUSE_DOUBLE_CLICK: if (menu->hover >= 0 && menu->hover < menu->numitems) @@ -1084,7 +1084,7 @@ static void ui_menu_handle_events(ui_menu *menu) menu->event.unichar = event.ch; stop = TRUE; break; - + /* ignore everything else */ default: break; @@ -1104,7 +1104,7 @@ static void ui_menu_handle_keys(ui_menu *menu, UINT32 flags) int ignoreright = FALSE; int ignoreleft = FALSE; int code; - + /* bail if no items */ if (menu->numitems == 0) return; @@ -1129,11 +1129,11 @@ static void ui_menu_handle_keys(ui_menu *menu, UINT32 flags) /* validate the current selection */ ui_menu_validate_selection(menu, 1); - + /* swallow left/right keys if they are not appropriate */ ignoreleft = ((menu->item[menu->selected].flags & MENU_FLAG_LEFT_ARROW) == 0); ignoreright = ((menu->item[menu->selected].flags & MENU_FLAG_RIGHT_ARROW) == 0); - + /* accept left/right keys as-is with repeat */ if (!ignoreleft && exclusive_input_pressed(menu, IPT_UI_LEFT, (flags & UI_MENU_PROCESS_LR_REPEAT) ? 6 : 0)) return; @@ -1181,7 +1181,7 @@ static void ui_menu_handle_keys(ui_menu *menu, UINT32 flags) menu->selected = menu->numitems - 1; ui_menu_validate_selection(menu, -1); } - + /* pause enables/disables pause */ if (!ignorepause && exclusive_input_pressed(menu, IPT_UI_PAUSE, 0)) mame_pause(menu->machine, !mame_is_paused(menu->machine)); @@ -1216,7 +1216,7 @@ static void ui_menu_validate_selection(ui_menu *menu, int scandir) while (!item_is_selectable(&menu->item[menu->selected])) menu->selected = (menu->selected + menu->numitems + scandir) % menu->numitems; } - + /*------------------------------------------------- @@ -1324,7 +1324,7 @@ UINT32 ui_menu_ui_handler(running_machine *machine, UINT32 state) void ui_menu_force_game_select(void) { char *gamename = (char *)options_get_string(mame_options(), OPTION_GAMENAME); - + /* reset the menu stack */ ui_menu_stack_reset(Machine); @@ -1349,11 +1349,11 @@ void ui_menu_force_game_select(void) int ui_menu_is_force_game_select(void) { ui_menu *menu; - + for (menu = menu_stack; menu != NULL; menu = menu->parent) if (menu->handler == menu_quit_game && menu->parent == NULL) return TRUE; - + return FALSE; } @@ -1370,7 +1370,7 @@ int ui_menu_is_force_game_select(void) static void menu_main(running_machine *machine, ui_menu *menu, void *parameter, void *state) { const ui_menu_event *event; - + /* if the menu isn't built, populate now */ if (!ui_menu_populated(menu)) menu_main_populate(machine, menu, state); @@ -1449,8 +1449,8 @@ static void menu_main_populate(running_machine *machine, ui_menu *menu, void *st ui_menu_item_append(menu, "Video Options", NULL, 0, (render_target_get_indexed(1) != NULL) ? menu_video_targets : menu_video_options); /* add cheat menu */ -// if (options_get_bool(mame_options(), OPTION_CHEAT)) -// ui_menu_item_append(menu, "Cheat", NULL, 0, menu_cheat); +// if (options_get_bool(mame_options(), OPTION_CHEAT)) +// ui_menu_item_append(menu, "Cheat", NULL, 0, menu_cheat); /* add memory card menu */ if (machine->config->memcard_handler != NULL) @@ -1469,7 +1469,7 @@ static void menu_main_populate(running_machine *machine, ui_menu *menu, void *st static void menu_input_groups(running_machine *machine, ui_menu *menu, void *parameter, void *state) { const ui_menu_event *event; - + /* if the menu isn't built, populate now */ if (!ui_menu_populated(menu)) menu_input_groups_populate(machine, menu, state); @@ -1482,7 +1482,7 @@ static void menu_input_groups(running_machine *machine, ui_menu *menu, void *par /*------------------------------------------------- - menu_input_groups_populate - populate the + menu_input_groups_populate - populate the input groups menu -------------------------------------------------*/ @@ -1539,7 +1539,7 @@ static void menu_input_general_populate(running_machine *machine, ui_menu *menu, if (typedesc->group == group && typedesc->name != NULL && typedesc->name[0] != 0) { input_seq_type seqtype; - + /* loop over all sequence types */ sortorder++; for (seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++) @@ -1556,13 +1556,13 @@ static void menu_input_general_populate(running_machine *machine, ui_menu *menu, item->name = typedesc->name; item->next = itemlist; itemlist = item; - + /* stop after one, unless we're analog */ if (item->type == INPUT_TYPE_DIGITAL) break; } } - + /* sort and populate the menu in a standard fashion */ menu_input_populate_and_sort(menu, itemlist, menustate); astring_free(tempstring); @@ -1592,7 +1592,7 @@ static void menu_input_specific_populate(running_machine *machine, ui_menu *menu const input_field_config *field; const input_port_config *port; int suborder[SEQ_TYPE_TOTAL]; - + /* create a mini lookup table for sort order based on sequence type */ suborder[SEQ_TYPE_STANDARD] = 0; suborder[SEQ_TYPE_DECREMENT] = 1; @@ -1619,7 +1619,7 @@ static void menu_input_specific_populate(running_machine *machine, ui_menu *menu sortorder = (field->type << 2) | (field->player << 12); else sortorder = field->type | 0xf000; - + /* loop over all sequence types */ for (seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++) { @@ -1635,14 +1635,14 @@ static void menu_input_specific_populate(running_machine *machine, ui_menu *menu item->name = name; item->next = itemlist; itemlist = item; - + /* stop after one, unless we're analog */ if (item->type == INPUT_TYPE_DIGITAL) break; } } } - + /* sort and populate the menu in a standard fashion */ menu_input_populate_and_sort(menu, itemlist, menustate); astring_free(tempstring); @@ -1659,7 +1659,7 @@ static void menu_input_common(running_machine *machine, ui_menu *menu, void *par input_menu_state *menustate; const ui_menu_event *event; int invalidate = FALSE; - + /* if no state, allocate now */ if (state == NULL) state = ui_menu_alloc_state(menu, sizeof(*menustate)); @@ -1673,10 +1673,10 @@ static void menu_input_common(running_machine *machine, ui_menu *menu, void *par else menu_input_specific_populate(machine, menu, menustate); } - + /* process the menu */ event = ui_menu_process(menu, (menustate->pollingitem != NULL) ? UI_MENU_PROCESS_NOKEYS : 0); - + /* if we are polling, handle as a special case */ if (menustate->pollingitem != NULL) { @@ -1701,7 +1701,7 @@ static void menu_input_common(running_machine *machine, ui_menu *menu, void *par seqchangeditem = item; } } - + /* otherwise, handle the events */ else if (event != NULL && event->itemref != NULL) { @@ -1716,7 +1716,7 @@ static void menu_input_common(running_machine *machine, ui_menu *menu, void *par input_seq_poll_start((item->type == INPUT_TYPE_ANALOG) ? ITEM_CLASS_ABSOLUTE : ITEM_CLASS_SWITCH, menustate->record_next ? &item->seq : NULL); invalidate = TRUE; break; - + /* if the clear key was pressed, reset the selected item */ case IPT_UI_CLEAR: toggle_none_default(&item->seq, &item->seq, item->defseq); @@ -1730,7 +1730,7 @@ static void menu_input_common(running_machine *machine, ui_menu *menu, void *par menustate->record_next = FALSE; menustate->lastref = item->ref; } - + /* if the sequence changed, update it */ if (seqchangeditem != NULL) { @@ -1750,11 +1750,11 @@ static void menu_input_common(running_machine *machine, ui_menu *menu, void *par settings.seq[seqchangeditem->seqtype] = seqchangeditem->seq; input_field_set_user_settings(seqchangeditem->ref, &settings); } - + /* invalidate the menu to force an update */ invalidate = TRUE; } - + /* if the menu is invalidated, clear it now */ if (invalidate) { @@ -1796,7 +1796,7 @@ static void menu_input_populate_and_sort(ui_menu *menu, input_item_data *itemlis astring *subtext = astring_alloc(); astring *text = astring_alloc(); int numitems = 0, curitem; - + /* create a mini lookup table for name format based on type */ nameformat[INPUT_TYPE_DIGITAL] = "%s"; nameformat[INPUT_TYPE_ANALOG] = "%s Analog"; @@ -1806,12 +1806,12 @@ static void menu_input_populate_and_sort(ui_menu *menu, input_item_data *itemlis /* first count the number of items */ for (item = itemlist; item != NULL; item = item->next) numitems++; - + /* now allocate an array of items and fill it up */ itemarray = ui_menu_pool_alloc(menu, sizeof(*itemarray) * numitems); for (item = itemlist, curitem = 0; item != NULL; item = item->next) itemarray[curitem++] = item; - + /* sort it */ qsort(itemarray, numitems, sizeof(*itemarray), menu_input_compare_items); @@ -1831,18 +1831,18 @@ static void menu_input_populate_and_sort(ui_menu *menu, input_item_data *itemlis astring_cpyc(subtext, " "); flags |= MENU_FLAG_LEFT_ARROW | MENU_FLAG_RIGHT_ARROW; } - + /* otherwise, generate the sequence name and invert it if different from the default */ else { input_seq_name(subtext, &item->seq); flags |= input_seq_cmp(&item->seq, item->defseq) ? MENU_FLAG_INVERT : 0; } - + /* add the item */ ui_menu_item_append(menu, astring_c(text), astring_c(subtext), flags, item); } - + /* free our temporary strings */ astring_free(subtext); astring_free(text); @@ -1872,7 +1872,7 @@ static void menu_settings_driver_config(running_machine *machine, ui_menu *menu, /*------------------------------------------------- - menu_settings_categories - handle the + menu_settings_categories - handle the categories menu -------------------------------------------------*/ @@ -1891,7 +1891,7 @@ static void menu_settings_common(running_machine *machine, ui_menu *menu, void * { settings_menu_state *menustate; const ui_menu_event *event; - + /* if no state, allocate now */ if (state == NULL) state = ui_menu_alloc_state(menu, sizeof(*menustate)); @@ -1900,10 +1900,10 @@ static void menu_settings_common(running_machine *machine, ui_menu *menu, void * /* if the menu isn't built, populate now */ if (!ui_menu_populated(menu)) menu_settings_populate(machine, menu, menustate, type); - + /* process the menu */ event = ui_menu_process(menu, 0); - + /* handle events */ if (event != NULL && event->itemref != NULL) { @@ -1920,20 +1920,20 @@ static void menu_settings_common(running_machine *machine, ui_menu *menu, void * input_field_set_user_settings(field, &settings); changed = TRUE; break; - + /* left goes to previous setting */ case IPT_UI_LEFT: input_field_select_previous_setting(field); changed = TRUE; break; - + /* right goes to next setting */ case IPT_UI_RIGHT: input_field_select_next_setting(field); changed = TRUE; break; } - + /* if anything changed, rebuild the menu, trying to stay on the same field */ if (changed) ui_menu_reset(menu, UI_MENU_RESET_REMEMBER_REF); @@ -1980,7 +1980,7 @@ static void menu_settings_populate(running_machine *machine, ui_menu *menu, sett input_field_user_settings settings; UINT32 accummask = field->mask; - /* get current settings */ + /* get current settings */ input_field_get_user_settings(field, &settings); /* iterate over each bit in the field */ @@ -1988,12 +1988,12 @@ static void menu_settings_populate(running_machine *machine, ui_menu *menu, sett { UINT32 mask = accummask & ~(accummask - 1); dip_descriptor *dip; - + /* find the matching switch name */ for (dip = menustate->diplist; dip != NULL; dip = dip->next) if (strcmp(dip->name, diploc->swname) == 0) break; - + /* allocate new if none */ if (dip == NULL) { @@ -2005,7 +2005,7 @@ static void menu_settings_populate(running_machine *machine, ui_menu *menu, sett diplist_tailptr = &dip->next; dipcount++; } - + /* apply the bits */ dip->mask |= 1 << (diploc->swnum - 1); if (((settings.value & mask) != 0 && !diploc->invert) || ((settings.value & mask) == 0 && diploc->invert)) @@ -2033,11 +2033,11 @@ static void menu_settings_custom_render(running_machine *machine, ui_menu *menu, const input_field_config *field = selectedref; settings_menu_state *menustate = state; dip_descriptor *dip; - + /* add borders */ y1 = y2 + UI_BOX_TB_BORDER; y2 = y1 + bottom; - + /* draw extra menu area */ ui_draw_outlined_box(x1, y1, x2, y2, UI_FILLCOLOR); y1 += (float)DIP_SWITCH_SPACING; @@ -2047,13 +2047,13 @@ static void menu_settings_custom_render(running_machine *machine, ui_menu *menu, { const input_field_diplocation *diploc; UINT32 selectedmask = 0; - + /* determine the mask of selected bits */ if (field != NULL) for (diploc = field->diploclist; diploc != NULL; diploc = diploc->next) if (strcmp(dip->name, diploc->swname) == 0) selectedmask |= 1 << (diploc->swnum - 1); - + /* draw one switch */ menu_settings_custom_render_one(x1, y1, x2, y1 + DIP_SWITCH_HEIGHT, dip, selectedmask); y1 += (float)(DIP_SWITCH_SPACING + DIP_SWITCH_HEIGHT); @@ -2062,7 +2062,7 @@ static void menu_settings_custom_render(running_machine *machine, ui_menu *menu, /*------------------------------------------------- - menu_settings_custom_render_one - draw a single + menu_settings_custom_render_one - draw a single DIP switch -------------------------------------------------*/ @@ -2117,11 +2117,11 @@ static void menu_settings_custom_render_one(float x1, float y1, float x2, float } else { - render_ui_add_rect(innerx1, y1_off, innerx1 + SINGLE_TOGGLE_SWITCH_WIDTH, y1_on + SINGLE_TOGGLE_SWITCH_HEIGHT, + render_ui_add_rect(innerx1, y1_off, innerx1 + SINGLE_TOGGLE_SWITCH_WIDTH, y1_on + SINGLE_TOGGLE_SWITCH_HEIGHT, MENU_UNAVAILABLECOLOR, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); } - + /* advance to the next switch */ x1 += SINGLE_TOGGLE_SWITCH_FIELD_WIDTH; } @@ -2135,32 +2135,32 @@ static void menu_settings_custom_render_one(float x1, float y1, float x2, float static void menu_analog(running_machine *machine, ui_menu *menu, void *parameter, void *state) { const ui_menu_event *event; - + /* if the menu isn't built, populate now */ if (!ui_menu_populated(menu)) menu_analog_populate(machine, menu); - + /* process the menu */ event = ui_menu_process(menu, UI_MENU_PROCESS_LR_REPEAT); - + /* handle events */ if (event != NULL && event->itemref != NULL) { analog_item_data *data = event->itemref; int newval = data->cur; - + switch (event->iptkey) { /* if selected, reset to default value */ case IPT_UI_SELECT: newval = data->field->defvalue; break; - + /* left decrements */ case IPT_UI_LEFT: newval -= input_code_pressed(KEYCODE_LSHIFT) ? 10 : 1; break; - + /* right increments */ case IPT_UI_RIGHT: newval += input_code_pressed(KEYCODE_LSHIFT) ? 10 : 1; @@ -2172,7 +2172,7 @@ static void menu_analog(running_machine *machine, ui_menu *menu, void *parameter newval = data->min; if (newval > data->max) newval = data->max; - + /* if things changed, update */ if (newval != data->cur) { @@ -2188,16 +2188,16 @@ static void menu_analog(running_machine *machine, ui_menu *menu, void *parameter case ANALOG_ITEM_SENSITIVITY: settings.sensitivity = newval; break; } input_field_set_user_settings(data->field, &settings); - + /* rebuild the menu */ ui_menu_reset(menu, UI_MENU_RESET_REMEMBER_POSITION); } } } - + /*------------------------------------------------- - menu_analog_populate - populate the analog + menu_analog_populate - populate the analog settings menu -------------------------------------------------*/ @@ -2236,7 +2236,7 @@ static void menu_analog_populate(running_machine *machine, ui_menu *menu) use_autocenter = TRUE; break; } - + /* get the user settings */ input_field_get_user_settings(field, &settings); @@ -2294,7 +2294,7 @@ static void menu_analog_populate(running_machine *machine, ui_menu *menu) flags |= MENU_FLAG_LEFT_ARROW; if (data->cur < data->max) flags |= MENU_FLAG_RIGHT_ARROW; - + /* append a menu item */ ui_menu_item_append(menu, astring_c(text), astring_c(subtext), flags, data); } @@ -2316,12 +2316,12 @@ static void menu_bookkeeping(running_machine *machine, ui_menu *menu, void *para { attotime *prevtime; attotime curtime; - + /* if no state, allocate some */ if (state == NULL) state = ui_menu_alloc_state(menu, sizeof(*prevtime)); prevtime = state; - + /* if the time has rolled over another second, regenerate */ curtime = timer_get_time(); if (prevtime->seconds != curtime.seconds) @@ -2412,7 +2412,7 @@ static void menu_memory_card(running_machine *machine, ui_menu *menu, void *para { const ui_menu_event *event; int *cardnum; - + /* if no state, allocate some */ if (state == NULL) state = ui_menu_alloc_state(menu, sizeof(*cardnum)); @@ -2424,12 +2424,12 @@ static void menu_memory_card(running_machine *machine, ui_menu *menu, void *para /* process the menu */ event = ui_menu_process(menu, UI_MENU_PROCESS_LR_REPEAT); - + /* if something was selected, act on it */ if (event != NULL && event->itemref != NULL) { FPTR item = (FPTR)event->itemref; - + /* select executes actions on some of the items */ if (event->iptkey == IPT_UI_SELECT) { @@ -2445,7 +2445,7 @@ static void menu_memory_card(running_machine *machine, ui_menu *menu, void *para else popmessage("Error loading memory card"); break; - + /* handle card ejecting */ case MEMCARD_ITEM_EJECT: memcard_eject(menu->machine); @@ -2461,7 +2461,7 @@ static void menu_memory_card(running_machine *machine, ui_menu *menu, void *para break; } } - + /* the select item has extra keys */ else if (item == MEMCARD_ITEM_SELECT) { @@ -2491,7 +2491,7 @@ static void menu_memory_card_populate(running_machine *machine, ui_menu *menu, i { char tempstring[20]; UINT32 flags = 0; - + /* add the card select menu */ sprintf(tempstring, "%d", cardnum); if (cardnum > 0) @@ -2499,7 +2499,7 @@ static void menu_memory_card_populate(running_machine *machine, ui_menu *menu, i if (cardnum < 1000) flags |= MENU_FLAG_RIGHT_ARROW; ui_menu_item_append(menu, "Card Number:", tempstring, flags, (void *)MEMCARD_ITEM_SELECT); - + /* add the remaining items */ ui_menu_item_append(menu, "Load Selected Card", NULL, 0, (void *)MEMCARD_ITEM_LOAD); if (memcard_present() != -1) @@ -2516,7 +2516,7 @@ static void menu_memory_card_populate(running_machine *machine, ui_menu *menu, i static void menu_video_targets(running_machine *machine, ui_menu *menu, void *parameter, void *state) { const ui_menu_event *event; - + /* if the menu isn't built, populate now */ if (!ui_menu_populated(menu)) menu_video_targets_populate(machine, menu); @@ -2529,20 +2529,20 @@ static void menu_video_targets(running_machine *machine, ui_menu *menu, void *pa /*------------------------------------------------- - menu_video_targets_populate - populate the + menu_video_targets_populate - populate the video targets menu -------------------------------------------------*/ static void menu_video_targets_populate(running_machine *machine, ui_menu *menu) { int targetnum; - + /* find the targets */ for (targetnum = 0; ; targetnum++) { render_target *target = render_target_get_indexed(targetnum); char buffer[40]; - + /* stop when we run out */ if (target == NULL) break; @@ -2564,7 +2564,7 @@ static void menu_video_options(running_machine *machine, ui_menu *menu, void *pa render_target *target = (parameter != NULL) ? parameter : render_target_get_indexed(0); const ui_menu_event *event; int changed = FALSE; - + /* if the menu isn't built, populate now */ if (!ui_menu_populated(menu)) menu_video_options_populate(machine, menu, target); @@ -2591,7 +2591,7 @@ static void menu_video_options(running_machine *machine, ui_menu *menu, void *pa changed = TRUE; } break; - + /* layer config bitmasks handle left/right keys the same (toggle) */ case LAYER_CONFIG_ENABLE_BACKDROP: case LAYER_CONFIG_ENABLE_OVERLAY: @@ -2603,7 +2603,7 @@ static void menu_video_options(running_machine *machine, ui_menu *menu, void *pa changed = TRUE; } break; - + /* anything else is a view item */ default: if (event->iptkey == IPT_UI_SELECT && (int)(FPTR)event->itemref >= VIDEO_ITEM_VIEW) @@ -2614,7 +2614,7 @@ static void menu_video_options(running_machine *machine, ui_menu *menu, void *pa break; } } - + /* if something changed, rebuild the menu */ if (changed) ui_menu_reset(menu, UI_MENU_RESET_REMEMBER_REF); @@ -2622,7 +2622,7 @@ static void menu_video_options(running_machine *machine, ui_menu *menu, void *pa /*------------------------------------------------- - menu_video_options_populate - populate the + menu_video_options_populate - populate the video options menu -------------------------------------------------*/ @@ -2633,7 +2633,7 @@ static void menu_video_options_populate(running_machine *machine, ui_menu *menu, const char *subtext = ""; int viewnum; int enabled; - + /* add items for each view */ for (viewnum = 0; ; viewnum++) { @@ -2645,10 +2645,10 @@ static void menu_video_options_populate(running_machine *machine, ui_menu *menu, astring_replacec(astring_cpyc(tempstring, name), 0, "_", " "); ui_menu_item_append(menu, astring_c(tempstring), NULL, 0, (void *)(FPTR)(VIDEO_ITEM_VIEW + viewnum)); } - + /* add a separator */ ui_menu_item_append(menu, MENU_SEPARATOR_ITEM, NULL, 0, NULL); - + /* add a rotate item */ switch (render_target_get_orientation(target)) { @@ -2658,7 +2658,7 @@ static void menu_video_options_populate(running_machine *machine, ui_menu *menu, case ROT270: subtext = "CCW 90" UTF8_DEGREES; break; } ui_menu_item_append(menu, "Rotate", subtext, MENU_FLAG_LEFT_ARROW | MENU_FLAG_RIGHT_ARROW, (void *)VIDEO_ITEM_ROTATE); - + /* backdrop item */ enabled = layermask & LAYER_CONFIG_ENABLE_BACKDROP; ui_menu_item_append(menu, "Backdrops", enabled ? "Enabled" : "Disabled", enabled ? MENU_FLAG_LEFT_ARROW : MENU_FLAG_RIGHT_ARROW, (void *)LAYER_CONFIG_ENABLE_BACKDROP); @@ -2733,11 +2733,11 @@ static void menu_select_game(running_machine *machine, ui_menu *menu, void *para else if (event->iptkey == IPT_UI_SELECT) { const game_driver *driver = (const game_driver *)event->itemref; - + /* special case for configure inputs */ if ((FPTR)driver == 1) ui_menu_stack_push(ui_menu_alloc(menu->machine, menu_input_groups, NULL)); - + /* anything else is a driver */ else { @@ -2766,14 +2766,14 @@ static void menu_select_game(running_machine *machine, ui_menu *menu, void *para } } } - + /* escape pressed with non-empty text clears the text */ else if (event->iptkey == IPT_UI_CANCEL && menustate->search[0] != 0) { /* since we have already been popped, we must recreate ourself from scratch */ ui_menu_stack_push(ui_menu_alloc(menu->machine, menu_select_game, NULL)); } - + /* typed characters append to the buffer */ else if (event->iptkey == IPT_SPECIAL) { @@ -2802,7 +2802,7 @@ static void menu_select_game(running_machine *machine, ui_menu *menu, void *para ui_draw_text_box("The selected game is missing one or more required ROM or CHD images. " "Please select a different game.\n\nPress any key to continue.", JUSTIFY_CENTER, 0.5f, 0.5f, UI_REDCOLOR); - + /* if we changed, force a redraw on the next go */ if (changed) ui_menu_reset(menu, UI_MENU_RESET_REMEMBER_REF); @@ -2810,7 +2810,7 @@ static void menu_select_game(running_machine *machine, ui_menu *menu, void *para /*------------------------------------------------- - menu_select_game_populate - populate the game + menu_select_game_populate - populate the game select menu -------------------------------------------------*/ @@ -2834,7 +2834,7 @@ static void menu_select_game_populate(running_machine *machine, ui_menu *menu, s "the docs directory for information on configuring MAME.", NULL, MENU_FLAG_MULTILINE | MENU_FLAG_REDTEXT, NULL); return; } - + /* otherwise, rebuild the match list */ if (menustate->search[0] != 0 || menustate->matchlist[0] == NULL || menustate->rerandomize) driver_list_get_approx_matches(menustate->driverlist, menustate->search, matchcount, menustate->matchlist); @@ -2850,7 +2850,7 @@ static void menu_select_game_populate(running_machine *machine, ui_menu *menu, s ui_menu_item_append(menu, driver->name, driver->description, (cloneof == NULL || (cloneof->flags & GAME_IS_BIOS_ROOT)) ? 0 : MENU_FLAG_INVERT, (void *)driver); } } - + /* if we're forced into this, allow general input configuration as well */ if (ui_menu_is_force_game_select()) { @@ -2882,7 +2882,7 @@ static int CLIB_DECL menu_select_game_driver_compare(const void *elem1, const vo /*------------------------------------------------- - menu_select_game_build_driver_list - build a + menu_select_game_build_driver_list - build a list of available drivers -------------------------------------------------*/ @@ -2948,7 +2948,7 @@ static void menu_select_game_build_driver_list(ui_menu *menu, select_game_state /*------------------------------------------------- - menu_select_game_custom_render - perform our + menu_select_game_custom_render - perform our special rendering -------------------------------------------------*/ diff --git a/src/lib/util/astring.c b/src/lib/util/astring.c index 5a86d611f89..df05efaafbe 100644 --- a/src/lib/util/astring.c +++ b/src/lib/util/astring.c @@ -354,7 +354,7 @@ int astring_vprintf(astring *dst, const char *format, va_list args) /*------------------------------------------------- - astring_catprintf - formatted printf to + astring_catprintf - formatted printf to the end of an astring -------------------------------------------------*/ @@ -376,7 +376,7 @@ int astring_catprintf(astring *dst, const char *format, ...) /*------------------------------------------------- - astring_catprintf - formatted vprintf to + astring_catprintf - formatted vprintf to the end of an astring -------------------------------------------------*/ diff --git a/src/lib/util/aviio.c b/src/lib/util/aviio.c index 557edddcc9a..8598f868ba4 100644 --- a/src/lib/util/aviio.c +++ b/src/lib/util/aviio.c @@ -2669,7 +2669,7 @@ static avi_error huffyuv_decompress_to_yuy16(avi_stream *stream, const UINT8 *da { UINT16 *prevrow = BITMAP_ADDR16(bitmap, y - prevlines, 0); UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0); - + /* handle the first four bytes independently */ x = 0; if (y == 0) diff --git a/src/lib/util/vbiparse.c b/src/lib/util/vbiparse.c index 4dca2ccb5a7..b11941cb71f 100644 --- a/src/lib/util/vbiparse.c +++ b/src/lib/util/vbiparse.c @@ -26,7 +26,7 @@ ***************************************************************************/ /*------------------------------------------------- - vbi_parse_manchester_code - parse a Manchester + vbi_parse_manchester_code - parse a Manchester code from a line of video data -------------------------------------------------*/ @@ -37,7 +37,7 @@ int vbi_parse_manchester_code(const UINT16 *source, int sourcewidth, int sources double clock, bestclock; int x, firstedge; int besterr; - + /* fail if the width is too large */ if (sourcewidth > MAX_SOURCE_WIDTH) return 0; @@ -55,12 +55,12 @@ int vbi_parse_manchester_code(const UINT16 *source, int sourcewidth, int sources /* bail if the line is all black or all white */ if (max < 0x80 || min > 0x80) return 0; - + /* determine the midpoint and then set the thresholds to be halfway */ mid = (min + max) / 2; min = mid - (mid - min) / 2; max = mid + (max - mid) / 2; - + /* convert the source into absolute high/low */ srcabsval = (source[0] > mid); for (x = 0; x < sourcewidth; x++) @@ -72,7 +72,7 @@ int vbi_parse_manchester_code(const UINT16 *source, int sourcewidth, int sources srcabsval = 0; srcabs[x] = srcabsval; } - + /* find the first transition; this is assumed to be the middle of the first bit */ for (x = 0; x < sourcewidth - 1; x++) if (srcabs[x] != srcabs[x + 1]) @@ -80,7 +80,7 @@ int vbi_parse_manchester_code(const UINT16 *source, int sourcewidth, int sources if (x == sourcewidth - 1) return 0; firstedge = x; - + /* now scan to find a clock that has a nearby transition on each beat */ bestclock = 0; besterr = 1000; @@ -92,11 +92,11 @@ int vbi_parse_manchester_code(const UINT16 *source, int sourcewidth, int sources for (x = 1; x < expectedbits; x++) { int curbit = firstedge + (double)x * clock; - + /* exact match? */ if (srcabs[curbit + 0] != srcabs[curbit + 1]) continue; - + /* off-by-one? */ if (srcabs[curbit + 1 + 0] != srcabs[curbit + 1 + 1] || srcabs[curbit - 1 + 0] != srcabs[curbit - 1 + 1]) { @@ -104,11 +104,11 @@ int vbi_parse_manchester_code(const UINT16 *source, int sourcewidth, int sources if (++error < besterr) continue; } - + /* anything else fails immediately */ break; } - + /* if we got to the end, this is the best candidate so far */ if (x == expectedbits) { @@ -116,19 +116,19 @@ int vbi_parse_manchester_code(const UINT16 *source, int sourcewidth, int sources bestclock = clock; } } - + /* if nobody matched, fail */ if (bestclock == 0) return 0; - /* now extract the bits */ + /* now extract the bits */ for (x = 0; x < expectedbits; x++) { int leftbit = firstedge + ((double)x - 0.25) * bestclock; int rightbit = firstedge + ((double)x + 0.25) * bestclock; int left = srcabs[leftbit]; int right = srcabs[rightbit]; - + /* all bits should be marked by transitions; fail if we don't get one */ if (left == right) return 0; @@ -139,7 +139,7 @@ int vbi_parse_manchester_code(const UINT16 *source, int sourcewidth, int sources /*------------------------------------------------- - vbi_parse_white_flag - compute the "white + vbi_parse_white_flag - compute the "white flag" from a line of video data -------------------------------------------------*/ diff --git a/src/mame/drivers/champbas.c b/src/mame/drivers/champbas.c index 149fd275043..44e2d6f05b8 100644 --- a/src/mame/drivers/champbas.c +++ b/src/mame/drivers/champbas.c @@ -277,10 +277,10 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( exctsccb_main_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x0000, 0x5fff) AM_ROM -// AM_RANGE(0x6000, 0x63ff) AM_RAM AM_SHARE(1) // MCU not used (though it's present on the board) +// AM_RANGE(0x6000, 0x63ff) AM_RAM AM_SHARE(1) // MCU not used (though it's present on the board) AM_RANGE(0x7000, 0x7000) AM_WRITE(AY8910_write_port_0_w) AM_RANGE(0x7001, 0x7001) AM_WRITE(AY8910_control_port_0_w) -// AM_RANGE(0x7800, 0x7fff) AM_ROM // champbb2 only +// AM_RANGE(0x7800, 0x7fff) AM_ROM // champbb2 only AM_RANGE(0x8000, 0x87ff) AM_RAM_WRITE(champbas_bg_videoram_w) AM_BASE(&champbas_bg_videoram) AM_RANGE(0x8800, 0x8fff) AM_RAM AM_BASE(&spriteram_2) /* ??? */ diff --git a/src/mame/drivers/cps3.c b/src/mame/drivers/cps3.c index 497ba64d648..679ac450692 100644 --- a/src/mame/drivers/cps3.c +++ b/src/mame/drivers/cps3.c @@ -3038,7 +3038,7 @@ static DRIVER_INIT( cps3_speedups ) //printf("speedup %08x %08x\n",cps3_speedup_ram_address,cps3_speedup_code_address); - if (cps3_speedup_code_address!=0) + if (cps3_speedup_code_address!=0) { cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, 0); cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, cps3_speedup_code_address); diff --git a/src/mame/drivers/fcrash.c b/src/mame/drivers/fcrash.c index 9d90d74e500..7d5b834e88e 100644 --- a/src/mame/drivers/fcrash.c +++ b/src/mame/drivers/fcrash.c @@ -127,8 +127,8 @@ static void fcrash_render_sprites(running_machine *machine, bitmap_t *bitmap,con // sprite base registers need hooking up properly.. on fcrash it is NOT cps1_cps_a_regs[0] // on kodb, it might still be, unless that's just a leftover and it writes somewhere else too -// if (cps1_cps_a_regs[0] & 0x00ff) base=0x10c8/2; -// printf("cps1_cps_a_regs %04x\n", cps1_cps_a_regs[0]); +// if (cps1_cps_a_regs[0] & 0x00ff) base=0x10c8/2; +// printf("cps1_cps_a_regs %04x\n", cps1_cps_a_regs[0]); for (pos=0x1ffc;pos>=0x0000;pos-=4) { @@ -384,8 +384,8 @@ static ADDRESS_MAP_START( kodb_map, ADDRESS_SPACE_PROGRAM, 16 ) /* Forgotten Worlds has dial controls on B-board mapped at 800040-80005f. See DRIVER_INIT */ AM_RANGE(0x800100, 0x80013f) AM_WRITE(cps1_cps_a_w) AM_BASE(&cps1_cps_a_regs) /* CPS-A custom */ AM_RANGE(0x800140, 0x80017f) AM_READWRITE(cps1_cps_b_r, cps1_cps_b_w) AM_BASE(&cps1_cps_b_regs) /* CPS-B custom */ -// AM_RANGE(0x800180, 0x800187) AM_WRITE(cps1_soundlatch_w) /* Sound command */ -// AM_RANGE(0x800188, 0x80018f) AM_WRITE(cps1_soundlatch2_w) /* Sound timer fade */ +// AM_RANGE(0x800180, 0x800187) AM_WRITE(cps1_soundlatch_w) /* Sound command */ +// AM_RANGE(0x800188, 0x80018f) AM_WRITE(cps1_soundlatch2_w) /* Sound timer fade */ AM_RANGE(0x8001c0, 0x8001ff) AM_READWRITE(cps1_cps_b_r, cps1_cps_b_w) /* mirror (SF2 revision "E" US 910228) */ AM_RANGE(0x900000, 0x92ffff) AM_RAM_WRITE(cps1_gfxram_w) AM_BASE(&cps1_gfxram) AM_SIZE(&cps1_gfxram_size) /* SF2CE executes code from here */ AM_RANGE(0xff0000, 0xffffff) AM_RAM @@ -715,9 +715,9 @@ static MACHINE_DRIVER_START( kodb ) MDRV_CPU_PROGRAM_MAP(kodb_map,0) MDRV_CPU_VBLANK_INT("main", cps1_interrupt) -// MDRV_CPU_ADD_TAG("sound", Z80, 3579545) +// MDRV_CPU_ADD_TAG("sound", Z80, 3579545) /* audio CPU */ -// MDRV_CPU_PROGRAM_MAP(sub_map,0) +// MDRV_CPU_PROGRAM_MAP(sub_map,0) /* video hardware */ MDRV_SCREEN_ADD("main", RASTER) @@ -735,16 +735,16 @@ static MACHINE_DRIVER_START( kodb ) MDRV_VIDEO_UPDATE(kodb) /* sound hardware */ -// MDRV_SPEAKER_STANDARD_MONO("mono") +// MDRV_SPEAKER_STANDARD_MONO("mono") -// MDRV_SOUND_ADD_TAG("2151", YM2151, 3579545) -// MDRV_SOUND_CONFIG(ym2151_interface) -// MDRV_SOUND_ROUTE(0, "mono", 0.35) -// MDRV_SOUND_ROUTE(1, "mono", 0.35) +// MDRV_SOUND_ADD_TAG("2151", YM2151, 3579545) +// MDRV_SOUND_CONFIG(ym2151_interface) +// MDRV_SOUND_ROUTE(0, "mono", 0.35) +// MDRV_SOUND_ROUTE(1, "mono", 0.35) -// MDRV_SOUND_ADD_TAG("okim", OKIM6295, 1000000) -// MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) // pin 7 can be changed by the game code, see f006 on z80 -// MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) +// MDRV_SOUND_ADD_TAG("okim", OKIM6295, 1000000) +// MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) // pin 7 can be changed by the game code, see f006 on z80 +// MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) MACHINE_DRIVER_END diff --git a/src/mame/drivers/slapfght.c b/src/mame/drivers/slapfght.c index bab502dc16b..ab19a3e5ed0 100644 --- a/src/mame/drivers/slapfght.c +++ b/src/mame/drivers/slapfght.c @@ -529,7 +529,7 @@ static INPUT_PORTS_START( slapfght_generic ) PORT_START_TAG("DSW1") PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:8,7,6") -// PORT_DIPSETTING( 0x01, DEF_STR( 3C_1C ) ) +// PORT_DIPSETTING( 0x01, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x04, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x07, DEF_STR( 1C_1C ) ) @@ -1167,7 +1167,7 @@ ROM_START( tigerhb1 ) ROM_REGION( 0x0800, REGION_CPU3, ROMREGION_ERASEFF ) // probably doesn't have an MCU /* is this the right mcu for this set? the mcu handling code in the roms seems patched and it doesn't work correctly */ -// ROM_LOAD( "a47_14.6a", 0x0000, 0x0800, CRC(4042489f) SHA1(b977e0821b6b1aa5a0a0f349cd78150af1a231df) ) +// ROM_LOAD( "a47_14.6a", 0x0000, 0x0800, CRC(4042489f) SHA1(b977e0821b6b1aa5a0a0f349cd78150af1a231df) ) ROM_REGION( 0x04000, REGION_GFX1, ROMREGION_DISPOSE ) ROM_LOAD( "a47_05.bin", 0x00000, 0x2000, CRC(c5325b49) SHA1(6df9051e7545dcac4995340f80957510457aaf64) ) /* Chars */ @@ -1598,48 +1598,48 @@ static DRIVER_INIT( tigerhb ) static READ8_HANDLER( gtstarb1_port_0_read ) { /* The bootleg has it's own 'protection' on startup ? - 6D1A: 06 04 ld b,$04 - 6D1C: DB 00 in a,($00) - 6D1E: E6 06 and $06 - 6D20: 20 FA jr nz,$6D1C - 6D22: DB 00 in a,($00) - 6D24: E6 06 and $06 - 6D26: FE 06 cp $06 - 6D28: 20 F8 jr nz,$6D22 - 6D2A: DB 00 in a,($00) - 6D2C: E6 06 and $06 - 6D2E: FE 02 cp $02 - 6D30: 20 F8 jr nz,$6D2A - 6D32: DB 00 in a,($00) - 6D34: E6 06 and $06 - 6D36: FE 04 cp $04 - 6D38: 20 F8 jr nz,$6D32 - 6D3A: 10 E0 djnz $6D1C - */ + 6D1A: 06 04 ld b,$04 + 6D1C: DB 00 in a,($00) + 6D1E: E6 06 and $06 + 6D20: 20 FA jr nz,$6D1C + 6D22: DB 00 in a,($00) + 6D24: E6 06 and $06 + 6D26: FE 06 cp $06 + 6D28: 20 F8 jr nz,$6D22 + 6D2A: DB 00 in a,($00) + 6D2C: E6 06 and $06 + 6D2E: FE 02 cp $02 + 6D30: 20 F8 jr nz,$6D2A + 6D32: DB 00 in a,($00) + 6D34: E6 06 and $06 + 6D36: FE 04 cp $04 + 6D38: 20 F8 jr nz,$6D32 + 6D3A: 10 E0 djnz $6D1C + */ if (activecpu_get_pc() == 0x6d1e) return 0; if (activecpu_get_pc() == 0x6d24) return 6; if (activecpu_get_pc() == 0x6d2c) return 2; if (activecpu_get_pc() == 0x6d34) return 4; /* The bootleg hangs in the "test mode" before diplaying (wrong) lives settings : - 6AD4: DB 00 in a,($00) - 6AD6: CB 4F bit 1,a - 6AD8: 28 FA jr z,$6AD4 - 6ADA: 3E 23 ld a,$23 - 6ADC: CD 52 11 call $1152 - 6ADF: 32 03 E8 ld ($E803),a - 6AE2: DB 00 in a,($00) - 6AE4: CB 4F bit 1,a - 6AE6: 28 FA jr z,$6AE2 - 6AE8: 3A 0A C8 ld a,($C80A) - 6AEB: E6 03 and $03 - 6AED: CD 52 11 call $1152 - 6AF0: 32 03 E8 ld ($E803),a - 6AF3: DB 00 in a,($00) - 6AF5: CB 57 bit 2,a - 6AF7: 20 FA jr nz,$6AF3 - This seems to be what used to be the MCU status. - */ + 6AD4: DB 00 in a,($00) + 6AD6: CB 4F bit 1,a + 6AD8: 28 FA jr z,$6AD4 + 6ADA: 3E 23 ld a,$23 + 6ADC: CD 52 11 call $1152 + 6ADF: 32 03 E8 ld ($E803),a + 6AE2: DB 00 in a,($00) + 6AE4: CB 4F bit 1,a + 6AE6: 28 FA jr z,$6AE2 + 6AE8: 3A 0A C8 ld a,($C80A) + 6AEB: E6 03 and $03 + 6AED: CD 52 11 call $1152 + 6AF0: 32 03 E8 ld ($E803),a + 6AF3: DB 00 in a,($00) + 6AF5: CB 57 bit 2,a + 6AF7: 20 FA jr nz,$6AF3 + This seems to be what used to be the MCU status. + */ if (activecpu_get_pc() == 0x6ad6) return 2; /* bit 1 must be ON */ if (activecpu_get_pc() == 0x6ae4) return 2; /* bit 1 must be ON */ if (activecpu_get_pc() == 0x6af5) return 0; /* bit 2 must be OFF */ diff --git a/src/mame/drivers/snk68.c b/src/mame/drivers/snk68.c index e985d1f5950..04bac0b596d 100644 --- a/src/mame/drivers/snk68.c +++ b/src/mame/drivers/snk68.c @@ -128,7 +128,7 @@ static ADDRESS_MAP_START( pow_map, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x0e8000, 0x0e8001) AM_READNOP /* Watchdog or IRQ ack */ AM_RANGE(0x0f0000, 0x0f0001) AM_READ_PORT("DSW1") AM_RANGE(0x0f0008, 0x0f0009) AM_READ_PORT("DSW2") -// AM_RANGE(0x0f0008, 0x0f0009) AM_WRITENOP /* ?? */ +// AM_RANGE(0x0f0008, 0x0f0009) AM_WRITENOP /* ?? */ AM_RANGE(0x100000, 0x100fff) AM_READWRITE(pow_fg_videoram_r, pow_fg_videoram_w) AM_MIRROR(0x1000) AM_BASE(&pow_fg_videoram) // 8-bit AM_RANGE(0x200000, 0x207fff) AM_READWRITE(pow_spriteram_r, pow_spriteram_w) AM_BASE(&spriteram16) // only partially populated AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(pow_paletteram16_word_w) AM_BASE(&paletteram16) @@ -146,7 +146,7 @@ static ADDRESS_MAP_START( searchar_map, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x0d0000, 0x0d0001) AM_READ(rotary_lsb_r) /* Extra rotary bits */ AM_RANGE(0x0e0000, 0x0e0001) AM_READNOP /* Watchdog or IRQ ack */ AM_RANGE(0x0e8000, 0x0e8001) AM_READNOP /* Watchdog or IRQ ack */ -// AM_RANGE(0x0f0000, 0x0f0001) AM_WRITENOP /* ?? */ +// AM_RANGE(0x0f0000, 0x0f0001) AM_WRITENOP /* ?? */ AM_RANGE(0x0f0000, 0x0f0001) AM_READ_PORT("DSW1") AM_RANGE(0x0f0008, 0x0f0009) AM_READ_PORT("DSW2") AM_RANGE(0x0f8000, 0x0f8001) AM_READ(sound_status_r) diff --git a/src/mame/drivers/stv.c b/src/mame/drivers/stv.c index 9d93284bb0d..eaefbabb318 100644 --- a/src/mame/drivers/stv.c +++ b/src/mame/drivers/stv.c @@ -2724,14 +2724,14 @@ stv110.bin - Debug STVB1.10D0950113 95/01/13 v1.10 stv1061.bin - ST-V Dev Bios (1.061) - Sega 1994, Noted "ST-V Ver 1.061 94/11/25" on EPROM sticker, Coming from a S-TV SG5001A dev board Regions found listed in the BIOS: - Japan - Taiwan and Philipines - USA and Canada - Brazil - Korea - Asia PAL area - Europe - Latin America + Japan + Taiwan and Philipines + USA and Canada + Brazil + Korea + Asia PAL area + Europe + Latin America ROM_SYSTEM_BIOS( x, "saturn", "Saturn bios" ) \ ROM_LOAD16_WORD_SWAP_BIOS( x, "saturn.bin", 0x000000, 0x080000, CRC(653ff2d8) SHA1(20994ae7ee177ddaf3a430b010c7620dca000fb4) ) - Saturn Eu Bios diff --git a/src/mame/machine/slapfght.c b/src/mame/machine/slapfght.c index f870dfcd4a6..b48b1a6525b 100644 --- a/src/mame/machine/slapfght.c +++ b/src/mame/machine/slapfght.c @@ -203,15 +203,15 @@ READ8_HANDLER( getstar_e803_r ) break; case GTSTARB2: /* - 056B: 21 03 E8 ld hl,$E803 - 056E: 7E ld a,(hl) - 056F: BE cp (hl) - 0570: 28 FD jr z,$056F - 0572: C6 05 add a,$05 - 0574: EE 56 xor $56 - 0576: BE cp (hl) - 0577: C2 6E 05 jp nz,$056E - */ + 056B: 21 03 E8 ld hl,$E803 + 056E: 7E ld a,(hl) + 056F: BE cp (hl) + 0570: 28 FD jr z,$056F + 0572: C6 05 add a,$05 + 0574: EE 56 xor $56 + 0576: BE cp (hl) + 0577: C2 6E 05 jp nz,$056E + */ if (activecpu_get_pc() == 0x056e) return (getstar_val); if (activecpu_get_pc() == 0x0570) return (getstar_val+1); if (activecpu_get_pc() == 0x0577) return ((getstar_val+0x05) ^ 0x56); @@ -599,30 +599,30 @@ WRITE8_HANDLER( getstar_e803_w ) break; case GTSTARB1: /* "Test mode" doesn't compute the lives value : - 6ADA: 3E 23 ld a,$23 - 6ADC: CD 52 11 call $1152 - 6ADF: 32 03 E8 ld ($E803),a - 6AE2: DB 00 in a,($00) - 6AE4: CB 4F bit 1,a - 6AE6: 28 FA jr z,$6AE2 - 6AE8: 3A 0A C8 ld a,($C80A) - 6AEB: E6 03 and $03 - 6AED: CD 52 11 call $1152 - 6AF0: 32 03 E8 ld ($E803),a - 6AF3: DB 00 in a,($00) - 6AF5: CB 57 bit 2,a - 6AF7: 20 FA jr nz,$6AF3 - 6AF9: 00 nop - 6AFA: 00 nop - 6AFB: 00 nop - 6AFC: 00 nop - 6AFD: 00 nop - 6AFE: 00 nop - 6AFF: 00 nop - 6B00: 00 nop - 6B01: 3A 03 E8 ld a,($E803) - We save the regs though to hack it in 'getstar_e803_r' read handler. - */ + 6ADA: 3E 23 ld a,$23 + 6ADC: CD 52 11 call $1152 + 6ADF: 32 03 E8 ld ($E803),a + 6AE2: DB 00 in a,($00) + 6AE4: CB 4F bit 1,a + 6AE6: 28 FA jr z,$6AE2 + 6AE8: 3A 0A C8 ld a,($C80A) + 6AEB: E6 03 and $03 + 6AED: CD 52 11 call $1152 + 6AF0: 32 03 E8 ld ($E803),a + 6AF3: DB 00 in a,($00) + 6AF5: CB 57 bit 2,a + 6AF7: 20 FA jr nz,$6AF3 + 6AF9: 00 nop + 6AFA: 00 nop + 6AFB: 00 nop + 6AFC: 00 nop + 6AFD: 00 nop + 6AFE: 00 nop + 6AFF: 00 nop + 6B00: 00 nop + 6B01: 3A 03 E8 ld a,($E803) + We save the regs though to hack it in 'getstar_e803_r' read handler. + */ if (activecpu_get_pc() == 0x6ae2) { getstar_cmd = 0x00; @@ -636,32 +636,32 @@ WRITE8_HANDLER( getstar_e803_w ) break; case GTSTARB2: /* "Test mode" doesn't compute the lives value : - 6ADA: 3E 23 ld a,$23 - 6ADC: CD 52 11 call $1152 - 6ADF: 32 03 E8 ld ($E803),a - 6AE2: DB 00 in a,($00) - 6AE4: CB 4F bit 1,a - 6AE6: 00 nop - 6AE7: 00 nop - 6AE8: 3A 0A C8 ld a,($C80A) - 6AEB: E6 03 and $03 - 6AED: CD 52 11 call $1152 - 6AF0: 32 03 E8 ld ($E803),a - 6AF3: DB 00 in a,($00) - 6AF5: CB 57 bit 2,a - 6AF7: 00 nop - 6AF8: 00 nop - 6AF9: 00 nop - 6AFA: 00 nop - 6AFB: 00 nop - 6AFC: 00 nop - 6AFD: 00 nop - 6AFE: 00 nop - 6AFF: 00 nop - 6B00: 00 nop - 6B01: 3A 03 E8 ld a,($E803) - We save the regs though to hack it in 'getstar_e803_r' read handler. - */ + 6ADA: 3E 23 ld a,$23 + 6ADC: CD 52 11 call $1152 + 6ADF: 32 03 E8 ld ($E803),a + 6AE2: DB 00 in a,($00) + 6AE4: CB 4F bit 1,a + 6AE6: 00 nop + 6AE7: 00 nop + 6AE8: 3A 0A C8 ld a,($C80A) + 6AEB: E6 03 and $03 + 6AED: CD 52 11 call $1152 + 6AF0: 32 03 E8 ld ($E803),a + 6AF3: DB 00 in a,($00) + 6AF5: CB 57 bit 2,a + 6AF7: 00 nop + 6AF8: 00 nop + 6AF9: 00 nop + 6AFA: 00 nop + 6AFB: 00 nop + 6AFC: 00 nop + 6AFD: 00 nop + 6AFE: 00 nop + 6AFF: 00 nop + 6B00: 00 nop + 6B01: 3A 03 E8 ld a,($E803) + We save the regs though to hack it in 'getstar_e803_r' read handler. + */ if (activecpu_get_pc() == 0x6ae2) { getstar_cmd = 0x00; diff --git a/src/mame/video/galaxian.c b/src/mame/video/galaxian.c index 4bb72b43d5b..faa4915baa7 100644 --- a/src/mame/video/galaxian.c +++ b/src/mame/video/galaxian.c @@ -597,7 +597,7 @@ static void sprites_draw(running_machine *machine, bitmap_t *bitmap, const recta rectangle clip = *cliprect; int sprnum; int clip_ofs = (flipscreen_x ? 16 : 0); - + /* 16 of the 256 pixels of the sprites are hard-clipped at the line buffer */ /* according to the schematics, it should be the first 16 pixels; however, */ /* some bootlegs demonstrate that this can be shifted to other positions. */ @@ -1024,7 +1024,7 @@ void frogger_draw_background(running_machine *machine, bitmap_t *bitmap, const r if (draw.min_x <= draw.max_x) fillbitmap(bitmap, RGB_BLACK, &draw); } - + } diff --git a/src/mame/video/snk68.c b/src/mame/video/snk68.c index 24944eb7201..61c8d3c4de0 100644 --- a/src/mame/video/snk68.c +++ b/src/mame/video/snk68.c @@ -94,19 +94,19 @@ READ16_HANDLER( pow_spriteram_r ) WRITE16_HANDLER( pow_spriteram_w ) { /* - This kludge fixes bug 00871: pow: At 3/4 of the 1st level, there is a large pillar, which pops up too late. - - The problem: the sprite list is built by the IRQ handler, however there is - code in the main loop that clears some portions of sprite RAM under certain - conditions. Usually, this isn't a problem, but in that specific point the - sprites added by the IRQ handler are erased before the screen is drawn. - - We could force a partial update every time the sprite RAM is modified, however - that would hardly be more accurate since the sprite hardware most likely draws - to a frame buffer one frame behind, so the exact timing is unknown. - Instead, we just force a partial update before changing the RAM location that - causes the problem. - */ + This kludge fixes bug 00871: pow: At 3/4 of the 1st level, there is a large pillar, which pops up too late. + + The problem: the sprite list is built by the IRQ handler, however there is + code in the main loop that clears some portions of sprite RAM under certain + conditions. Usually, this isn't a problem, but in that specific point the + sprites added by the IRQ handler are erased before the screen is drawn. + + We could force a partial update every time the sprite RAM is modified, however + that would hardly be more accurate since the sprite hardware most likely draws + to a frame buffer one frame behind, so the exact timing is unknown. + Instead, we just force a partial update before changing the RAM location that + causes the problem. + */ if (offset == 0x10c/2) video_screen_update_partial(machine->primary_screen, video_screen_get_vpos(machine->primary_screen)); diff --git a/src/osd/windows/window.c b/src/osd/windows/window.c index 843bd225a39..1fbff286742 100644 --- a/src/osd/windows/window.c +++ b/src/osd/windows/window.c @@ -1219,9 +1219,9 @@ LRESULT CALLBACK winwindow_video_window_proc(HWND wnd, UINT message, WPARAM wpar { DWORD ticks = GetTickCount(); ui_input_push_mouse_click_event(Machine, window->target, GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam)); - + // check for a double-click - if (ticks - window->lastclicktime < GetDoubleClickTime() && + if (ticks - window->lastclicktime < GetDoubleClickTime() && GET_X_LPARAM(lparam) >= window->lastclickx - 4 && GET_X_LPARAM(lparam) <= window->lastclickx + 4 && GET_Y_LPARAM(lparam) >= window->lastclicky - 4 && GET_Y_LPARAM(lparam) <= window->lastclicky + 4) { diff --git a/src/osd/windows/window.h b/src/osd/windows/window.h index 4e2b96df729..48f322a15f6 100644 --- a/src/osd/windows/window.h +++ b/src/osd/windows/window.h @@ -70,7 +70,7 @@ struct _win_window_info int targetorient; int targetlayerconfig; const render_primitive_list *primlist; - + // input info DWORD lastclicktime; int lastclickx; |
