diff options
author | 2016-11-16 13:20:35 +0100 | |
---|---|---|
committer | 2016-11-16 13:20:35 +0100 | |
commit | cbb08316df3170d1bcaefa1c26ecffeb473cdb8e (patch) | |
tree | 2fa6907c259105c66a40db8e60014dfc684686ac /src/devices/cpu/m68000 | |
parent | 619334986f3eb7b1b5267593579a4b6657472da2 (diff) |
Moved has_fpu to private: section and added methods to set and get it
Diffstat (limited to 'src/devices/cpu/m68000')
-rw-r--r-- | src/devices/cpu/m68000/m68000.h | 5 | ||||
-rw-r--r-- | src/devices/cpu/m68000/m68k_in.cpp | 8 | ||||
-rw-r--r-- | src/devices/cpu/m68000/m68kcpu.cpp | 10 |
3 files changed, 18 insertions, 5 deletions
diff --git a/src/devices/cpu/m68000/m68000.h b/src/devices/cpu/m68000/m68000.h index ac7c0021421..c4ce844867f 100644 --- a/src/devices/cpu/m68000/m68000.h +++ b/src/devices/cpu/m68000/m68000.h @@ -168,9 +168,13 @@ public: void set_tas_write_callback(write8_delegate callback); uint16_t get_fc(); void set_hmmu_enable(int enable); + void set_fpu_enable(int enable); + int get_fpu_enable(); void set_instruction_hook(read32_delegate ihook); void set_buserror_details(uint32_t fault_addr, uint8_t rw, uint8_t fc); +private: + int has_fpu; /* Indicates if a FPU is available (yes on 030, 040, may be on 020) */ public: @@ -211,7 +215,6 @@ public: int has_hmmu; /* Indicates if an Apple HMMU is available in place of the 68851 (020 only) */ int pmmu_enabled; /* Indicates if the PMMU is enabled */ int hmmu_enabled; /* Indicates if the HMMU is enabled */ - int has_fpu; /* Indicates if a FPU is available (yes on 030, 040, may be on 020) */ int fpu_just_reset; /* Indicates the FPU was just reset */ /* Clocks required for instructions / exceptions */ diff --git a/src/devices/cpu/m68000/m68k_in.cpp b/src/devices/cpu/m68000/m68k_in.cpp index 36800d226b3..835054753fa 100644 --- a/src/devices/cpu/m68000/m68k_in.cpp +++ b/src/devices/cpu/m68000/m68k_in.cpp @@ -902,7 +902,7 @@ M68KMAKE_OP(1111, 0, ., .) M68KMAKE_OP(040fpu0, 32, ., .) { - if((mc68kcpu)->has_fpu) + if((mc68kcpu)->get_fpu_enable()) { m68040_fpu_op0(mc68kcpu); return; @@ -913,7 +913,7 @@ M68KMAKE_OP(040fpu0, 32, ., .) M68KMAKE_OP(040fpu1, 32, ., .) { - if((mc68kcpu)->has_fpu) + if((mc68kcpu)->get_fpu_enable()) { m68040_fpu_op1(mc68kcpu); return; @@ -4437,7 +4437,7 @@ M68KMAKE_OP(cpdbcc, 32, ., .) M68KMAKE_OP(cpgen, 32, ., .) { - if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type) && (mc68kcpu->has_fpu || mc68kcpu->has_pmmu)) + if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type) && (mc68kcpu->get_fpu_enable() || mc68kcpu->has_pmmu)) { mc68kcpu->logerror("%s at %08x: called unimplemented instruction %04x (cpgen)\n", (mc68kcpu)->tag(), REG_PC(mc68kcpu) - 2, (mc68kcpu)->ir); @@ -4472,7 +4472,7 @@ M68KMAKE_OP(cptrapcc, 32, ., .) M68KMAKE_OP(ftrapcc, 32, ., .) { - if((mc68kcpu)->has_fpu) + if((mc68kcpu)->get_fpu_enable()) { m68881_ftrap(mc68kcpu); return; diff --git a/src/devices/cpu/m68000/m68kcpu.cpp b/src/devices/cpu/m68000/m68kcpu.cpp index 4af6e2c82ed..dd01540ae3e 100644 --- a/src/devices/cpu/m68000/m68kcpu.cpp +++ b/src/devices/cpu/m68000/m68kcpu.cpp @@ -1208,6 +1208,16 @@ void m68000_base_device::set_hmmu_enable(int enable) hmmu_enabled = enable; } +void m68000_base_device::set_fpu_enable(int enable) +{ + has_fpu = enable; +} + +int m68000_base_device::get_fpu_enable() +{ + return has_fpu; +} + void m68000_base_device::set_instruction_hook(read32_delegate ihook) { instruction_hook = ihook; |