1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-06-12 18:42:14 +00:00

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 - debugging of scan line overflow
- confuse code/data in listing - confuse code/data in listing
- show memory locations hovering over lines - show memory locations hovering over lines
- don't play sound when debugging
- don't check against ROM signatures - don't check against ROM signatures
- better errors when ROM format wrong - better errors when ROM format wrong
- debugging inside of bank switching??? relocated segs? - debugging inside of bank switching??? relocated segs?
@ -13,7 +12,6 @@ TODO:
- DASM: macro forward refs - DASM: macro forward refs
- asm: support macro expansion - asm: support macro expansion
- support narrow screens - support narrow screens
- show other TIA internal values
- case sensisitvity looking for mismatch variables - case sensisitvity looking for mismatch variables
- remove pulldown when no preset? - remove pulldown when no preset?
- can't step after reset (or when funky frame; TIA frame is out of sync) - 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 <string.h>
#include <conio.h>
#include <apple2.h>
typedef unsigned char byte; typedef unsigned char byte;
typedef signed char sbyte; typedef signed char sbyte;
@ -456,27 +458,29 @@ void move_player() {
if (attract) { if (attract) {
if (bullet_y == 0) fire_bullet(); if (bullet_y == 0) fire_bullet();
} else { } else {
char key = PEEK(0xc000); char key;
if (key & 0x80) { // handle keyboard
if (kbhit()) {
key = cgetc();
switch (key) { switch (key) {
case 0xc1: case 'A':
player_dir = player_dir < 0 ? 0 : -2; player_dir = player_dir < 0 ? 0 : -2;
break; break;
case 0xda: case 'Z':
player_dir = player_dir > 0 ? 0 : 2; player_dir = player_dir > 0 ? 0 : 2;
break; break;
case 0xa0: case ' ':
if (bullet_y == 0) { if (bullet_y == 0) {
fire_bullet(); fire_bullet();
} }
break; break;
} }
STROBE(0xc010);
} }
// move player
if (player_dir < 0 && player_x > 0) if (player_dir < 0 && player_x > 0)
player_x += player_dir; player_x += player_dir;
else if (player_dir > 0 && player_x < VHEIGHT-28) else if (player_dir > 0 && player_x < VHEIGHT-28)
player_x += player_dir; player_x += player_dir;
} }
draw_sprite(player_bitmap, player_x, 1); draw_sprite(player_bitmap, player_x, 1);
} }

View File

@ -1,3 +1,4 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <conio.h> #include <conio.h>
@ -120,10 +121,10 @@ void human_control(Player* p) {
if (!kbhit()) return; if (!kbhit()) return;
key = cgetc(); key = cgetc();
switch (key) { switch (key) {
case 'i': dir = D_UP; break; case 'I': dir = D_UP; break;
case 'j': dir = D_LEFT; break; case 'J': dir = D_LEFT; break;
case 'k': dir = D_RIGHT; break; case 'K': dir = D_RIGHT; break;
case 'm': dir = D_DOWN; break; case 'M': dir = D_DOWN; break;
} }
// don't let the player reverse // don't let the player reverse
if (dir < 0x80 && dir != (p->dir ^ 2)) { 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.isRunning = function() { return Javatari.room && Javatari.room.console.isRunning(); }
this.pause = function() { Javatari.room.console.pause(); } this.pause = function() { Javatari.room.console.pause(); Javatari.room.speaker.mute(); }
this.resume = function() { Javatari.room.console.go(); } this.resume = function() { Javatari.room.console.go(); Javatari.room.speaker.play(); }
this.step = function() { Javatari.room.console.debugSingleStepCPUClock(); } this.step = function() { Javatari.room.console.debugSingleStepCPUClock(); }
this.stepBack = function() { Javatari.room.console.debugStepBackInstruction(); } this.stepBack = function() { Javatari.room.console.debugStepBackInstruction(); }
this.runEval = function(evalfunc) { Javatari.room.console.debugEval(evalfunc); } this.runEval = function(evalfunc) { Javatari.room.console.debugEval(evalfunc); }
this.setupDebug = function(callback) { this.setupDebug = function(callback) {
Javatari.room.console.onBreakpointHit = callback; Javatari.room.console.onBreakpointHit = callback;
Javatari.room.speaker.mute();
} }
this.clearDebug = function() { this.clearDebug = function() {
Javatari.room.console.disableDebug(); Javatari.room.console.disableDebug();
Javatari.room.console.onBreakpointHit = null; Javatari.room.console.onBreakpointHit = null;
if (this.isRunning()) Javatari.room.speaker.play();
} }
this.reset = function() { this.reset = function() {
Javatari.room.console.powerOff(); Javatari.room.console.powerOff();
Javatari.room.console.resetDebug(); Javatari.room.console.resetDebug();
Javatari.room.console.powerOn(); Javatari.room.console.powerOn();
Javatari.room.speaker.play();
} }
this.getOriginPC = function() { this.getOriginPC = function() {
return (this.readAddress(0xfffc) | (this.readAddress(0xfffd) << 8)) & 0xffff; return (this.readAddress(0xfffc) | (this.readAddress(0xfffd) << 8)) & 0xffff;