JHRobotics / patcher9x

Patch for Windows 9x to fix CPU issues
MIT License
773 stars 39 forks source link

Fix compile errors in cputest.c with gcc 11.3.0 #14

Closed delan closed 1 year ago

delan commented 1 year ago

This patch fixes some compile errors in cputest.c with gcc 11.3.0 (NixOS 22.11):

gcc -std=gnu99 -g -Wall -Wextra -Wno-unused-parameter -Wno-unused-function -I./mspack -I./system -I./pe -I./nocrt -DPATCHER9X_PATCH=50 -c -o cputest.g.o cputest.c
cputest.c: Assembler messages:
cputest.c:123: Error: symbol `loop_repeat' is already defined
cputest.c:123: Error: symbol `loop_repeat' is already defined
cputest.c:123: Error: symbol `loop_repeat' is already defined
cputest.c:123: Error: symbol `loop_repeat' is already defined
cputest.c:123: Error: symbol `loop_repeat' is already defined
cputest.c:123: Error: symbol `loop_repeat' is already defined
cputest.c:123: Error: symbol `loop_repeat' is already defined
cputest.c:123: Error: symbol `loop_repeat' is already defined
cputest.c:123: Error: symbol `loop_repeat' is already defined
cputest.c:123: Error: value of ffffffffffffff37 too large for field of 1 byte at 0000000000000103
cputest.c:123: Error: value of fffffffffffffedf too large for field of 1 byte at 000000000000015b
cputest.c:123: Error: value of fffffffffffffe83 too large for field of 1 byte at 00000000000001b7
cputest.c:123: Error: value of fffffffffffffe27 too large for field of 1 byte at 0000000000000213
cputest.c:123: Error: value of fffffffffffffdcb too large for field of 1 byte at 000000000000026f
make: *** [Makefile:107: cputest.g.o] Error 1
delan commented 1 year ago

Thanks for creating this tool by the way, I was worried win98 would be unusable on my 7950X!

Quick question, after compiling it my vmm_patch_me1.h changed as follows. Is this ok?

diff --git a/vmm_patch_me1.h b/vmm_patch_me1.h
index 7b39c4b..6d30f1e 100644
--- a/vmm_patch_me1.h
+++ b/vmm_patch_me1.h
@@ -43,7 +43,7 @@ const uint8_t vmm_patch_me1_orig_check[] = {
        0x9F, 0x0C, 0x3F, 0xE0, 0x7F, 0xFF, 0xFC, 0x37, 0xFC, 0x30, 0xFC, 0x3F, 0xFF, 0xC3, 0xFF, 0xFF, 
        0xFF, 0xFF, 0x0F, 0xFE, 0x1F, 0x0F, 0xFF, 0x0F, 0xFC, 0x3F, 0x87, 0xFF, 0xFF, 0x87, 0xFF, 0xE1, 
        0xE1, 0x87, 0xFF, 0xC3, 0x0D, 0xFF, 0xFC, 0xE1, 0xFF, 0x87, 0x86, 0x10, 0xC2, 0x1F, 0xFC, 0x30, 
-       0xE7, 0xF9, 0xFF, 0xFF, 0x0F, 0x84, 0x30, 0xFC, 0x30, 0xF8, 
+       0xE7, 0xF9, 0xFF, 0xFF, 0x0F, 0x84, 0x30, 0xFC, 0x30, 0xFF, 
 };

 /* new data to replace */
JHRobotics commented 1 year ago

Hello @delan!

Thanks for patch! Change in vmm_patch_me1.h is OK, because last 3 bits this bitfield are ignored (it is compared 461 bytes). But anyway, thank you for the notice, I’ll do some bit masking, so headers will by generated consistently.