From 13ea4fc2368721d7ea228dec0288047c16df404e Mon Sep 17 00:00:00 2001 From: Steven Hugg Date: Sat, 1 Apr 2017 13:34:24 -0400 Subject: [PATCH] added volatile --- presets/galaxian-scramble/gfxtest.c | 6 +++--- presets/galaxian-scramble/shoot2.c | 18 ++++++++++++++---- presets/mw8080bw/game2.c | 9 +++++---- presets/mw8080bw/shifter.c | 2 +- presets/vector-z80color/game.c | 2 +- presets/vector-z80color/threed.c | 2 +- presets/williams-z80/bitmap_rle.c | 8 ++++---- presets/williams-z80/gfxtest.c | 8 ++++---- presets/williams-z80/sprites.c | 8 ++++---- src/ui.js | 1 + 10 files changed, 38 insertions(+), 26 deletions(-) diff --git a/presets/galaxian-scramble/gfxtest.c b/presets/galaxian-scramble/gfxtest.c index fc4554a4..e63b20d7 100644 --- a/presets/galaxian-scramble/gfxtest.c +++ b/presets/galaxian-scramble/gfxtest.c @@ -29,9 +29,9 @@ byte __at (0x5080) xram[128]; byte __at (0x6801) enable_irq; byte __at (0x6804) enable_stars; byte __at (0x7000) watchdog; -byte __at (0x8100) input0; -byte __at (0x8101) input1; -byte __at (0x8102) input2; +volatile byte __at (0x8100) input0; +volatile byte __at (0x8101) input1; +volatile byte __at (0x8102) input2; void main(); diff --git a/presets/galaxian-scramble/shoot2.c b/presets/galaxian-scramble/shoot2.c index 513eeb52..2876a1f7 100644 --- a/presets/galaxian-scramble/shoot2.c +++ b/presets/galaxian-scramble/shoot2.c @@ -31,9 +31,9 @@ byte __at (0x6804) enable_stars; byte __at (0x6808) missile_width; byte __at (0x6809) missile_offset; byte __at (0x7000) watchdog; -byte __at (0x8100) input0; -byte __at (0x8101) input1; -byte __at (0x8102) input2; +volatile byte __at (0x8100) input0; +volatile byte __at (0x8101) input1; +volatile byte __at (0x8102) input2; #define LEFT1 !(input0 & 0x20) #define RIGHT1 !(input0 & 0x10) @@ -623,6 +623,7 @@ void new_player_ship() { } void set_sounds() { + byte i; byte enable = 0; // missile fire sound if (missiles[7].ypos) { @@ -642,7 +643,16 @@ void set_sounds() { enable |= 0x4 << 3; } set8910a(AY_ENABLE, ~enable); - set8910b(AY_ENABLE, ~0); + // set diving sounds for spaceships + enable = 0; + for (i=0; i<3; i++) { + if (sprites[i].ypos >= 128) { + set8910b(AY_PITCH_A_LO+i, sprites[i].ypos); + set8910b(AY_ENV_VOL_A+i, 7); + enable |= 1< 1) { pendingWorkerMessages = 0; setCode(editor.getValue());