mirror of
https://github.com/jeremysrand/apple2048.git
synced 2025-08-10 00:25:15 +00:00
Use the volatile keyword with all inline assembly to make sure the optimizer doesn't remove it.
This commit is contained in:
Binary file not shown.
@@ -70,7 +70,7 @@ SRCDIRS+=
|
||||
|
||||
# If you want to add arguments to the compile commandline, add them
|
||||
# to this variable:
|
||||
CFLAGS += -Oi
|
||||
CFLAGS += -O
|
||||
|
||||
# If you want to add arguments to the assembly commandline, add them
|
||||
# to this variable:
|
||||
|
Binary file not shown.
@@ -33,7 +33,7 @@ void playSound(int8_t freq, int16_t duration)
|
||||
return;
|
||||
|
||||
while (duration > 0) {
|
||||
asm ("STA %w", 0xc030);
|
||||
asm volatile ("STA %w", 0xc030);
|
||||
while (freq > 0) {
|
||||
freq--;
|
||||
}
|
||||
|
Reference in New Issue
Block a user