mirror of
https://github.com/jeremysrand/apple2048.git
synced 2025-04-09 21:37:18 +00:00
Use the volatile keyword with all inline assembly to make sure the optimizer doesn't remove it.
This commit is contained in:
parent
209b1ef23e
commit
74cf2775f1
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--;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user