mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2025-02-22 12:29:06 +00:00
added volatile
This commit is contained in:
parent
49cc581b2b
commit
13ea4fc236
@ -29,9 +29,9 @@ byte __at (0x5080) xram[128];
|
|||||||
byte __at (0x6801) enable_irq;
|
byte __at (0x6801) enable_irq;
|
||||||
byte __at (0x6804) enable_stars;
|
byte __at (0x6804) enable_stars;
|
||||||
byte __at (0x7000) watchdog;
|
byte __at (0x7000) watchdog;
|
||||||
byte __at (0x8100) input0;
|
volatile byte __at (0x8100) input0;
|
||||||
byte __at (0x8101) input1;
|
volatile byte __at (0x8101) input1;
|
||||||
byte __at (0x8102) input2;
|
volatile byte __at (0x8102) input2;
|
||||||
|
|
||||||
void main();
|
void main();
|
||||||
|
|
||||||
|
@ -31,9 +31,9 @@ byte __at (0x6804) enable_stars;
|
|||||||
byte __at (0x6808) missile_width;
|
byte __at (0x6808) missile_width;
|
||||||
byte __at (0x6809) missile_offset;
|
byte __at (0x6809) missile_offset;
|
||||||
byte __at (0x7000) watchdog;
|
byte __at (0x7000) watchdog;
|
||||||
byte __at (0x8100) input0;
|
volatile byte __at (0x8100) input0;
|
||||||
byte __at (0x8101) input1;
|
volatile byte __at (0x8101) input1;
|
||||||
byte __at (0x8102) input2;
|
volatile byte __at (0x8102) input2;
|
||||||
|
|
||||||
#define LEFT1 !(input0 & 0x20)
|
#define LEFT1 !(input0 & 0x20)
|
||||||
#define RIGHT1 !(input0 & 0x10)
|
#define RIGHT1 !(input0 & 0x10)
|
||||||
@ -623,6 +623,7 @@ void new_player_ship() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void set_sounds() {
|
void set_sounds() {
|
||||||
|
byte i;
|
||||||
byte enable = 0;
|
byte enable = 0;
|
||||||
// missile fire sound
|
// missile fire sound
|
||||||
if (missiles[7].ypos) {
|
if (missiles[7].ypos) {
|
||||||
@ -642,7 +643,16 @@ void set_sounds() {
|
|||||||
enable |= 0x4 << 3;
|
enable |= 0x4 << 3;
|
||||||
}
|
}
|
||||||
set8910a(AY_ENABLE, ~enable);
|
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<<i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
set8910b(AY_ENABLE, ~enable);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wait_for_frame() {
|
void wait_for_frame() {
|
||||||
|
@ -4,13 +4,14 @@
|
|||||||
typedef unsigned char byte;
|
typedef unsigned char byte;
|
||||||
typedef unsigned char word;
|
typedef unsigned char word;
|
||||||
|
|
||||||
__sfr __at (0x0) input0;
|
volatile __sfr __at (0x0) input0;
|
||||||
__sfr __at (0x1) input1;
|
volatile __sfr __at (0x1) input1;
|
||||||
__sfr __at (0x2) input2;
|
volatile __sfr __at (0x2) input2;
|
||||||
__sfr __at (0x2) bitshift_offset;
|
__sfr __at (0x2) bitshift_offset;
|
||||||
__sfr __at (0x3) bitshift_read;
|
volatile __sfr __at (0x3) bitshift_read;
|
||||||
__sfr __at (0x4) bitshift_value;
|
__sfr __at (0x4) bitshift_value;
|
||||||
__sfr __at (0x6) watchdog_strobe;
|
__sfr __at (0x6) watchdog_strobe;
|
||||||
|
|
||||||
byte __at (0x2400) vidmem[224][32]; // 256x224x1 video memory
|
byte __at (0x2400) vidmem[224][32]; // 256x224x1 video memory
|
||||||
|
|
||||||
#define FIRE1 (input1 & 0x10)
|
#define FIRE1 (input1 & 0x10)
|
||||||
|
@ -5,7 +5,7 @@ typedef unsigned char byte;
|
|||||||
typedef unsigned char word;
|
typedef unsigned char word;
|
||||||
|
|
||||||
__sfr __at (0x2) bitshift_offset;
|
__sfr __at (0x2) bitshift_offset;
|
||||||
__sfr __at (0x3) bitshift_read;
|
volatile __sfr __at (0x3) bitshift_read;
|
||||||
__sfr __at (0x4) bitshift_value;
|
__sfr __at (0x4) bitshift_value;
|
||||||
__sfr __at (0x6) watchdog_strobe;
|
__sfr __at (0x6) watchdog_strobe;
|
||||||
|
|
||||||
|
@ -18,8 +18,8 @@ byte __at(0x810f) mathbox_go_mul;
|
|||||||
volatile byte __at (0x8000) input0;
|
volatile byte __at (0x8000) input0;
|
||||||
volatile byte __at (0x8001) input1;
|
volatile byte __at (0x8001) input1;
|
||||||
volatile byte __at (0x8002) input2;
|
volatile byte __at (0x8002) input2;
|
||||||
volatile byte __at (0x8980) watchdog;
|
|
||||||
volatile byte __at (0x800f) vidframe;
|
volatile byte __at (0x800f) vidframe;
|
||||||
|
byte __at (0x8980) watchdog;
|
||||||
|
|
||||||
#define LEFT1 !(input1 & 0x8)
|
#define LEFT1 !(input1 & 0x8)
|
||||||
#define RIGHT1 !(input1 & 0x4)
|
#define RIGHT1 !(input1 & 0x4)
|
||||||
|
@ -7,7 +7,7 @@ typedef unsigned short word;
|
|||||||
word __at(0xa000) dvgram[0x1000];
|
word __at(0xa000) dvgram[0x1000];
|
||||||
byte __at(0x8840) _dvgstart;
|
byte __at(0x8840) _dvgstart;
|
||||||
|
|
||||||
int __at(0x8100) mathbox_sum;
|
volatile int __at(0x8100) mathbox_sum;
|
||||||
sbyte __at(0x8102) mathbox_arg1;
|
sbyte __at(0x8102) mathbox_arg1;
|
||||||
sbyte __at(0x8103) mathbox_arg2;
|
sbyte __at(0x8103) mathbox_arg2;
|
||||||
byte __at(0x810f) mathbox_go_mul;
|
byte __at(0x810f) mathbox_go_mul;
|
||||||
|
@ -5,11 +5,11 @@ typedef unsigned char byte;
|
|||||||
typedef unsigned short word;
|
typedef unsigned short word;
|
||||||
|
|
||||||
byte __at (0xc000) palette[16];
|
byte __at (0xc000) palette[16];
|
||||||
byte __at (0xc800) input0;
|
volatile byte __at (0xc800) input0;
|
||||||
byte __at (0xc802) input1;
|
volatile byte __at (0xc802) input1;
|
||||||
byte __at (0xc804) input2;
|
volatile byte __at (0xc804) input2;
|
||||||
byte __at (0xc900) rom_select;
|
byte __at (0xc900) rom_select;
|
||||||
byte __at (0xcb00) video_counter;
|
volatile byte __at (0xcb00) video_counter;
|
||||||
byte __at (0xcbff) watchdog0x39;
|
byte __at (0xcbff) watchdog0x39;
|
||||||
byte __at (0xcc00) nvram[0x400];
|
byte __at (0xcc00) nvram[0x400];
|
||||||
|
|
||||||
|
@ -5,11 +5,11 @@ typedef unsigned char byte;
|
|||||||
typedef unsigned short word;
|
typedef unsigned short word;
|
||||||
|
|
||||||
byte __at (0xc000) palette[16];
|
byte __at (0xc000) palette[16];
|
||||||
byte __at (0xc800) input0;
|
volatile byte __at (0xc800) input0;
|
||||||
byte __at (0xc802) input1;
|
volatile byte __at (0xc802) input1;
|
||||||
byte __at (0xc804) input2;
|
volatile byte __at (0xc804) input2;
|
||||||
byte __at (0xc900) rom_select;
|
byte __at (0xc900) rom_select;
|
||||||
byte __at (0xcb00) video_counter;
|
volatile byte __at (0xcb00) video_counter;
|
||||||
byte __at (0xcbff) watchdog0x39;
|
byte __at (0xcbff) watchdog0x39;
|
||||||
byte __at (0xcc00) nvram[0x400];
|
byte __at (0xcc00) nvram[0x400];
|
||||||
|
|
||||||
|
@ -5,11 +5,11 @@ typedef unsigned char byte;
|
|||||||
typedef unsigned short word;
|
typedef unsigned short word;
|
||||||
|
|
||||||
byte __at (0xc000) palette[16];
|
byte __at (0xc000) palette[16];
|
||||||
byte __at (0xc800) input0;
|
volatile byte __at (0xc800) input0;
|
||||||
byte __at (0xc802) input1;
|
volatile byte __at (0xc802) input1;
|
||||||
byte __at (0xc804) input2;
|
volatile byte __at (0xc804) input2;
|
||||||
byte __at (0xc900) rom_select;
|
byte __at (0xc900) rom_select;
|
||||||
byte __at (0xcb00) video_counter;
|
volatile byte __at (0xcb00) video_counter;
|
||||||
byte __at (0xcbff) watchdog0x39;
|
byte __at (0xcbff) watchdog0x39;
|
||||||
byte __at (0xcc00) nvram[0x400];
|
byte __at (0xcc00) nvram[0x400];
|
||||||
|
|
||||||
|
@ -443,6 +443,7 @@ function setCompileOutput(data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
worker.onmessage = function(e) {
|
worker.onmessage = function(e) {
|
||||||
|
// TODO: this doesn't completely work yet
|
||||||
if (pendingWorkerMessages > 1) {
|
if (pendingWorkerMessages > 1) {
|
||||||
pendingWorkerMessages = 0;
|
pendingWorkerMessages = 0;
|
||||||
setCode(editor.getValue());
|
setCode(editor.getValue());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user