From e3fd8698dfc8a912c46dc455b5f906d84c8cba7d Mon Sep 17 00:00:00 2001 From: SarahW Date: Tue, 14 Jul 2020 19:30:19 +0100 Subject: [PATCH] Remove faulty cyrix special register read access Patch from davefiddes. Original commit message : GCC 10.1 reports this line as being logically always false so will never run. On inspection it may be that this was intended to be: if ((cyrix_addr & 0xf0) == 0xc0) return 0xff; According to the IBM 6X86MX Microprocessor Databook (http://datasheets.chipdb.org/IBM/x86/6x86MX/mx_full.pdf) this would correspond to the Address Region 0 - 3 registers but omit Address Region 4 - 7 registers which doesn't seem to make a lot of sense. Delete the code as the default response from the function is to return 0xff and this is what its behviour up until now has been. --- src/cpu.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/cpu.c b/src/cpu.c index 7d6c1a2..d69df1f 100644 --- a/src/cpu.c +++ b/src/cpu.c @@ -1747,7 +1747,6 @@ uint8_t cyrix_read(uint16_t addr, void *priv) case 0xfe: return models[model].cpu[cpu_manufacturer].cpus[cpu].cyrix_id & 0xff; case 0xff: return models[model].cpu[cpu_manufacturer].cpus[cpu].cyrix_id >> 8; } - if ((cyrix_addr & ~0xf0) == 0xc0) return 0xff; if (cyrix_addr == 0x20 && models[model].cpu[cpu_manufacturer].cpus[cpu].cpu_type == CPU_Cx5x86) return 0xff; } return 0xff;