You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use these options: -std=c99 -O2 -s -I./ -fno-builtin -fno-peephole2 -fno-function-cse
How to reproduce:
The bug is only visible when a double fire power-up is taken. In this case the right arrow is placed more to the right than it should be (see picture).
This bug disappears if a dummy print with the new_arrow_x variable is added. Maybe something must be polluting a register or a carry bit?
Using -O1 removes this bug but produces a worse one (level 1 cannot be completed).
There was an issue with byte subtraction whereby when subtracting a register from another value, the code was negating the register and then an add-byte. But negate is a 16-bit operation so depending on the contents of the lower byte, the result may or may not have been off by one. This has been fixed on the 1.32 branch.
Fabrizio-Caruso
changed the title
[bug] A variable is assigned a wrong value by 1 (only under some circumstances)
[bug][OK in branch 1.32] A variable is assigned a wrong value by 1 (only under some circumstances)
Oct 11, 2024
The new changes in this repo have fixed some bugs but also introduced several new bugs that affect all my games except the smallest two. Here I only discuss a bug present in the Horde game:
game source code: https://github.com/Fabrizio-Caruso/CROSS-LIB/tree/master/src/games/horde
game description: https://github.com/Fabrizio-Caruso/CROSS-LIB/blob/master/docs/GAMES.md#horde
In particular I suspect that the code around this line is miscompiled:
https://github.com/Fabrizio-Caruso/CROSS-LIB/blob/master/src/games/horde/main.c#L2001
I use these options:
-std=c99 -O2 -s -I./ -fno-builtin -fno-peephole2 -fno-function-cse
How to reproduce:
The bug is only visible when a double fire power-up is taken. In this case the right arrow is placed more to the right than it should be (see picture).
This bug disappears if a dummy print with the
new_arrow_x variable
is added. Maybe something must be polluting a register or a carry bit?Using
-O1
removes this bug but produces a worse one (level 1 cannot be completed).I have attached the binaries.
build.zip
The text was updated successfully, but these errors were encountered: