v60: Code cleanup

- Remove #ifdefs and use attributes instead
- Remove "never reached" return statements
This commit is contained in:
AJR 2021-12-01 17:46:55 -05:00
parent 1c8ba9d5c8
commit bbb9aba9a3
7 changed files with 36 additions and 75 deletions

View file

@ -1089,69 +1089,56 @@ uint32_t v60_device::am1ImmediateQuick()
uint32_t v60_device::am1Error1()
{
fatalerror("CPU - AM1 - 1 (PC=%06x)\n", PC);
return 0; /* never reached, fatalerror won't return */
}
uint32_t v60_device::bam1Error1()
{
fatalerror("CPU - BAM1 - 1 (PC=%06x)\n", PC);
return 0; /* never reached, fatalerror won't return */
}
uint32_t v60_device::am1Error2()
{
fatalerror("CPU - AM1 - 2 (PC=%06x)\n", PC);
return 0; /* never reached, fatalerror won't return */
}
uint32_t v60_device::bam1Error2()
{
fatalerror("CPU - BAM1 - 2 (PC=%06x)\n", PC);
return 0; /* never reached, fatalerror won't return */
}
#ifdef UNUSED_FUNCTION
uint32_t v60_device::am1Error3()
{
fatalerror("CPU - AM1 - 3 (PC=%06x)\n", PC);
return 0; /* never reached, fatalerror won't return */
}
uint32_t v60_device::bam1Error3()
{
fatalerror("CPU - BAM1 - 3 (PC=%06x)\n", PC);
return 0; /* never reached, fatalerror won't return */
}
#endif
uint32_t v60_device::am1Error4()
{
fatalerror("CPU - AM1 - 4 (PC=%06x)\n", PC);
return 0; /* never reached, fatalerror won't return */
}
uint32_t v60_device::bam1Error4()
{
fatalerror("CPU - BAM1 - 4 (PC=%06x)\n", PC);
return 0; /* never reached, fatalerror won't return */
}
uint32_t v60_device::am1Error5()
{
fatalerror("CPU - AM1 - 5 (PC=%06x)\n", PC);
return 0; /* never reached, fatalerror won't return */
}
uint32_t v60_device::bam1Error5()
{
fatalerror("CPU - BAM1 - 5 (PC=%06x)\n", PC);
return 0; /* never reached, fatalerror won't return */
}
uint32_t v60_device::bam1Error6()
{
fatalerror("CPU - BAM1 - 6 (PC=%06x)\n", PC);
return 0; /* never reached, fatalerror won't return */
}
const v60_device::am_func v60_device::s_AMTable1_G7a[16] =

View file

@ -965,65 +965,51 @@ uint32_t v60_device::am2Error1()
uint32_t v60_device::am2Error2()
{
fatalerror("CPU - AM2 - 2 (PC=%06x)\n", PC);
return 0; /* never reached, fatalerror won't return */
}
#ifdef UNUSED_FUNCTION
uint32_t v60_device::am2Error3()
{
fatalerror("CPU - AM2 - 3 (PC=%06x)\n", PC);
return 0; /* never reached, fatalerror won't return */
}
#endif
uint32_t v60_device::am2Error4()
{
fatalerror("CPU - AM2 - 4 (PC=%06x)\n", PC);
return 0; /* never reached, fatalerror won't return */
}
uint32_t v60_device::am2Error5()
{
fatalerror("CPU - AM2 - 5 (PC=%06x)\n", PC);
return 0; /* never reached, fatalerror won't return */
}
uint32_t v60_device::bam2Error1()
{
fatalerror("CPU - BAM2 - 1 (PC=%06x)\n", PC);
return 0; /* never reached, fatalerror won't return */
}
uint32_t v60_device::bam2Error2()
{
fatalerror("CPU - BAM2 - 2 (PC=%06x)\n", PC);
return 0; /* never reached, fatalerror won't return */
}
#ifdef UNUSED_FUNCTION
uint32_t v60_device::bam2Error3()
{
fatalerror("CPU - BAM2 - 3 (PC=%06x)\n", PC);
return 0; /* never reached, fatalerror won't return */
}
#endif
uint32_t v60_device::bam2Error4()
{
fatalerror("CPU - BAM2 - 4 (PC=%06x)\n", PC);
return 0; /* never reached, fatalerror won't return */
}
uint32_t v60_device::bam2Error5()
{
fatalerror("CPU - BAM2 - 5 (PC=%06x)\n", PC);
return 0; /* never reached, fatalerror won't return */
}
uint32_t v60_device::bam2Error6()
{
fatalerror("CPU - BAM2 - 6 (PC=%06x)\n", PC);
return 0; /* never reached, fatalerror won't return */
}

View file

@ -720,13 +720,11 @@ uint32_t v60_device::am3DirectAddressDeferredIndexed()
uint32_t v60_device::am3Immediate()
{
fatalerror("CPU - AM3 - IMM (PC=%06x)\n", PC);
return 0; /* never reached, fatalerror won't return */
}
uint32_t v60_device::am3ImmediateQuick()
{
fatalerror("CPU - AM3 - IMMQ (PC=%06x)\n", PC);
return 0; /* never reached, fatalerror won't return */
}
@ -737,33 +735,26 @@ uint32_t v60_device::am3ImmediateQuick()
uint32_t v60_device::am3Error1()
{
fatalerror("CPU - AM3 - 1 (PC=%06x)\n", PC);
return 0; /* never reached, fatalerror won't return */
}
uint32_t v60_device::am3Error2()
{
fatalerror("CPU - AM3 - 2 (PC=%06x)\n", PC);
return 0; /* never reached, fatalerror won't return */
}
#ifdef UNUSED_FUNCTION
uint32_t v60_device::am3Error3()
{
fatalerror("CPU - AM3 - 3 (PC=%06x)\n", PC);
return 0; /* never reached, fatalerror won't return */
}
#endif
uint32_t v60_device::am3Error4()
{
fatalerror("CPU - AM3 - 4 (PC=%06x)\n", PC);
return 0; /* never reached, fatalerror won't return */
}
uint32_t v60_device::am3Error5()
{
fatalerror("CPU - AM3 - 5 (PC=%06x)\n", PC);
return 0; /* never reached, fatalerror won't return */
}
const v60_device::am_func v60_device::s_AMTable3_G7a[16] =

View file

@ -257,13 +257,11 @@ uint32_t v60_device::opCMPF()
uint32_t v60_device::op5FUNHANDLED()
{
fatalerror("Unhandled 5F opcode at %08x\n", PC);
return 0; /* never reached, fatalerror won't return */
}
uint32_t v60_device::op5CUNHANDLED()
{
fatalerror("Unhandled 5C opcode at %08x\n", PC);
return 0; /* never reached, fatalerror won't return */
}
const v60_device::am_func v60_device::s_Op5FTable[32] =

View file

@ -967,31 +967,26 @@ uint32_t v60_device::opCVTDZP()
uint32_t v60_device::op58UNHANDLED()
{
fatalerror("Unhandled 58 opcode at PC: /%06x\n", PC);
return 0; /* never reached, fatalerror won't return */
}
uint32_t v60_device::op5AUNHANDLED()
{
fatalerror("Unhandled 5A opcode at PC: /%06x\n", PC);
return 0; /* never reached, fatalerror won't return */
}
uint32_t v60_device::op5BUNHANDLED()
{
fatalerror("Unhandled 5B opcode at PC: /%06x\n", PC);
return 0; /* never reached, fatalerror won't return */
}
uint32_t v60_device::op5DUNHANDLED()
{
fatalerror("Unhandled 5D opcode at PC: /%06x\n", PC);
return 0; /* never reached, fatalerror won't return */
}
uint32_t v60_device::op59UNHANDLED()
{
fatalerror("Unhandled 59 opcode at PC: /%06x\n", PC);
return 0; /* never reached, fatalerror won't return */
}
const v60_device::am_func v60_device::s_Op59Table[32] =

View file

@ -359,7 +359,6 @@ uint32_t v60_device::v60_update_psw_for_exception(int is_interrupt, int target_l
uint32_t v60_device::opUNHANDLED()
{
fatalerror("Unhandled OpCode found : %02x at %08x\n", OpRead16(PC), PC);
//return 0; /* never reached, fatalerror won't return */
}
// Opcode jump table

View file

@ -287,15 +287,17 @@ private:
uint32_t bam1DirectAddressDeferredIndexed();
uint32_t am1Immediate();
uint32_t am1ImmediateQuick();
uint32_t am1Error1();
uint32_t bam1Error1();
uint32_t am1Error2();
uint32_t bam1Error2();
uint32_t am1Error4();
uint32_t bam1Error4();
uint32_t am1Error5();
uint32_t bam1Error5();
uint32_t bam1Error6();
[[noreturn]] uint32_t am1Error1();
[[noreturn]] uint32_t bam1Error1();
[[noreturn]] uint32_t am1Error2();
[[noreturn]] uint32_t bam1Error2();
[[noreturn]] [[maybe_unused]] uint32_t am1Error3();
[[noreturn]] [[maybe_unused]] uint32_t bam1Error3();
[[noreturn]] uint32_t am1Error4();
[[noreturn]] uint32_t bam1Error4();
[[noreturn]] uint32_t am1Error5();
[[noreturn]] uint32_t bam1Error5();
[[noreturn]] uint32_t bam1Error6();
uint32_t am1Group7a();
uint32_t bam1Group7a();
uint32_t am1Group6();
@ -382,14 +384,16 @@ private:
uint32_t am2Immediate();
uint32_t am2ImmediateQuick();
uint32_t am2Error1();
uint32_t am2Error2();
uint32_t am2Error4();
uint32_t am2Error5();
uint32_t bam2Error1();
uint32_t bam2Error2();
uint32_t bam2Error4();
uint32_t bam2Error5();
uint32_t bam2Error6();
[[noreturn]] uint32_t am2Error2();
[[noreturn]] [[maybe_unused]] uint32_t am2Error3();
[[noreturn]] uint32_t am2Error4();
[[noreturn]] uint32_t am2Error5();
[[noreturn]] uint32_t bam2Error1();
[[noreturn]] uint32_t bam2Error2();
[[noreturn]] [[maybe_unused]] uint32_t bam2Error3();
[[noreturn]] uint32_t bam2Error4();
[[noreturn]] uint32_t bam2Error5();
[[noreturn]] uint32_t bam2Error6();
uint32_t am2Group7a();
uint32_t bam2Group7a();
uint32_t am2Group6();
@ -435,12 +439,13 @@ private:
uint32_t am3DirectAddressIndexed();
uint32_t am3DirectAddressDeferred();
uint32_t am3DirectAddressDeferredIndexed();
uint32_t am3Immediate();
uint32_t am3ImmediateQuick();
uint32_t am3Error1();
uint32_t am3Error2();
uint32_t am3Error4();
uint32_t am3Error5();
[[noreturn]] uint32_t am3Immediate();
[[noreturn]] uint32_t am3ImmediateQuick();
[[noreturn]] uint32_t am3Error1();
[[noreturn]] uint32_t am3Error2();
[[noreturn]] [[maybe_unused]] uint32_t am3Error3();
[[noreturn]] uint32_t am3Error4();
[[noreturn]] uint32_t am3Error5();
uint32_t am3Group7a();
uint32_t am3Group6();
uint32_t am3Group7();
@ -572,8 +577,8 @@ private:
uint32_t opDIVFS();
uint32_t opSCLFS();
uint32_t opCMPF();
uint32_t op5FUNHANDLED();
uint32_t op5CUNHANDLED();
[[noreturn]] uint32_t op5FUNHANDLED();
[[noreturn]] uint32_t op5CUNHANDLED();
uint32_t op5F();
uint32_t op5C();
uint32_t opINCB();
@ -759,17 +764,17 @@ private:
uint32_t opSUBRDC();
uint32_t opCVTDPZ();
uint32_t opCVTDZP();
uint32_t op58UNHANDLED();
uint32_t op5AUNHANDLED();
uint32_t op5BUNHANDLED();
uint32_t op5DUNHANDLED();
uint32_t op59UNHANDLED();
[[noreturn]] uint32_t op58UNHANDLED();
[[noreturn]] uint32_t op5AUNHANDLED();
[[noreturn]] uint32_t op5BUNHANDLED();
[[noreturn]] uint32_t op5DUNHANDLED();
[[noreturn]] uint32_t op59UNHANDLED();
uint32_t op58();
uint32_t op5A();
uint32_t op5B();
uint32_t op5D();
uint32_t op59();
uint32_t opUNHANDLED();
[[noreturn]] uint32_t opUNHANDLED();
void v60_do_irq(int vector);
void v60_try_irq();