don't play sound when debugging (vcs)

This commit is contained in:
Steven Hugg 2018-08-06 14:22:06 -04:00
parent 8693179821
commit 5477432a3e
4 changed files with 31 additions and 25 deletions

View File

@ -5,7 +5,6 @@ TODO:
- debugging of scan line overflow
- confuse code/data in listing
- show memory locations hovering over lines
- don't play sound when debugging
- don't check against ROM signatures
- better errors when ROM format wrong
- debugging inside of bank switching??? relocated segs?
@ -13,7 +12,6 @@ TODO:
- DASM: macro forward refs
- asm: support macro expansion
- support narrow screens
- show other TIA internal values
- case sensisitvity looking for mismatch variables
- remove pulldown when no preset?
- can't step after reset (or when funky frame; TIA frame is out of sync)

View File

@ -1,5 +1,7 @@

#include <string.h>
#include <conio.h>
#include <apple2.h>
typedef unsigned char byte;
typedef signed char sbyte;
@ -456,27 +458,29 @@ void move_player() {
if (attract) {
if (bullet_y == 0) fire_bullet();
} else {
char key = PEEK(0xc000);
if (key & 0x80) {
char key;
// handle keyboard
if (kbhit()) {
key = cgetc();
switch (key) {
case 0xc1:
player_dir = player_dir < 0 ? 0 : -2;
break;
case 0xda:
player_dir = player_dir > 0 ? 0 : 2;
break;
case 0xa0:
if (bullet_y == 0) {
fire_bullet();
}
break;
case 'A':
player_dir = player_dir < 0 ? 0 : -2;
break;
case 'Z':
player_dir = player_dir > 0 ? 0 : 2;
break;
case ' ':
if (bullet_y == 0) {
fire_bullet();
}
break;
}
STROBE(0xc010);
}
// move player
if (player_dir < 0 && player_x > 0)
player_x += player_dir;
player_x += player_dir;
else if (player_dir > 0 && player_x < VHEIGHT-28)
player_x += player_dir;
player_x += player_dir;
}
draw_sprite(player_bitmap, player_x, 1);
}

View File

@ -1,3 +1,4 @@
#include <stdlib.h>
#include <string.h>
#include <conio.h>
@ -120,10 +121,10 @@ void human_control(Player* p) {
if (!kbhit()) return;
key = cgetc();
switch (key) {
case 'i': dir = D_UP; break;
case 'j': dir = D_LEFT; break;
case 'k': dir = D_RIGHT; break;
case 'm': dir = D_DOWN; break;
case 'I': dir = D_UP; break;
case 'J': dir = D_LEFT; break;
case 'K': dir = D_RIGHT; break;
case 'M': dir = D_DOWN; break;
}
// don't let the player reverse
if (dir < 0x80 && dir != (p->dir ^ 2)) {

View File

@ -67,23 +67,26 @@ var VCSPlatform = function() {
}
this.isRunning = function() { return Javatari.room && Javatari.room.console.isRunning(); }
this.pause = function() { Javatari.room.console.pause(); }
this.resume = function() { Javatari.room.console.go(); }
this.pause = function() { Javatari.room.console.pause(); Javatari.room.speaker.mute(); }
this.resume = function() { Javatari.room.console.go(); Javatari.room.speaker.play(); }
this.step = function() { Javatari.room.console.debugSingleStepCPUClock(); }
this.stepBack = function() { Javatari.room.console.debugStepBackInstruction(); }
this.runEval = function(evalfunc) { Javatari.room.console.debugEval(evalfunc); }
this.setupDebug = function(callback) {
Javatari.room.console.onBreakpointHit = callback;
Javatari.room.speaker.mute();
}
this.clearDebug = function() {
Javatari.room.console.disableDebug();
Javatari.room.console.onBreakpointHit = null;
if (this.isRunning()) Javatari.room.speaker.play();
}
this.reset = function() {
Javatari.room.console.powerOff();
Javatari.room.console.resetDebug();
Javatari.room.console.powerOn();
Javatari.room.speaker.play();
}
this.getOriginPC = function() {
return (this.readAddress(0xfffc) | (this.readAddress(0xfffd) << 8)) & 0xffff;