vcs: 24-cycle sleep after HMOVE in examples, nes/c64: fixed climber struct order

This commit is contained in:
Steven Hugg 2020-06-06 09:37:59 -05:00
parent 58b6f0f922
commit e8faee01f3
9 changed files with 23 additions and 12 deletions

View File

@ -150,7 +150,6 @@ TODO:
- upload multiple files/zip file to subdirectory - upload multiple files/zip file to subdirectory
- allow "include graphics.asm" instead of "include project/graphics.asm" - allow "include graphics.asm" instead of "include project/graphics.asm"
- convert more stuff to Promises - convert more stuff to Promises
- target ES6
- don't have to include firebase always? - don't have to include firebase always?
- squelch error msgs? - squelch error msgs?
- test offline? (if window.firebase) - test offline? (if window.firebase)
@ -199,6 +198,12 @@ TODO:
- https://github.com/cc65/cc65/issues/946 - https://github.com/cc65/cc65/issues/946
- sample buffer skips - sample buffer skips
- upgrade to ES2020?
- https://github.com/microsoft/TypeScript/issues/16577
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
- need Edge 79+
- no import in workers
WEB WORKER FORMAT WEB WORKER FORMAT

View File

@ -410,15 +410,14 @@ typedef enum ActorState {
typedef struct Actor { typedef struct Actor {
word yy; word yy;
byte x; byte x;
byte name; byte level;
sbyte yvel;
sbyte xvel;
unsigned int color1:4; unsigned int color1:4;
unsigned int color2:4; unsigned int color2:4;
byte level;
unsigned int state:4; unsigned int state:4;
unsigned int dir:1; unsigned int dir:1;
unsigned int onscreen:1; unsigned int onscreen:1;
sbyte yvel;
sbyte xvel;
} Actor; } Actor;
Actor actors[MAX_ACTORS]; Actor actors[MAX_ACTORS];
@ -431,7 +430,6 @@ void create_actors_on_floor(byte level_index) {
a->state = WALKING; a->state = WALKING;
a->color1 = level->ladder1 ^ level->ladder2; a->color1 = level->ladder1 ^ level->ladder2;
a->color2 = level->ladder2; a->color2 = level->ladder2;
a->name = 0;
a->x = level->ladder1 ^ (level->ladder2<<3) ^ (level->gap<<6); a->x = level->ladder1 ^ (level->ladder2<<3) ^ (level->gap<<6);
a->yy = get_floor_yy(level_index); a->yy = get_floor_yy(level_index);
a->level = level_index; a->level = level_index;
@ -713,7 +711,6 @@ void play_scene() {
actors[0].state = WALKING; actors[0].state = WALKING;
actors[0].color1 = 0x1; actors[0].color1 = 0x1;
actors[0].color2 = 0xb; actors[0].color2 = 0xb;
actors[0].name = 0;
actors[0].x = 64; actors[0].x = 64;
actors[0].yy = get_floor_yy(0); actors[0].yy = get_floor_yy(0);
actors[0].level = 0; actors[0].level = 0;

View File

@ -388,12 +388,12 @@ typedef struct Actor {
byte x; // X position in pixels (8 bit) byte x; // X position in pixels (8 bit)
byte floor; // floor index byte floor; // floor index
byte state; // ActorState byte state; // ActorState
sbyte yvel; // Y velocity (when jumping)
sbyte xvel; // X velocity (when jumping)
int name:2; // ActorType (2 bits) int name:2; // ActorType (2 bits)
int pal:2; // palette color (2 bits) int pal:2; // palette color (2 bits)
int dir:1; // direction (0=right, 1=left) int dir:1; // direction (0=right, 1=left)
int onscreen:1; // is actor onscreen? int onscreen:1; // is actor onscreen?
sbyte yvel; // Y velocity (when jumping)
sbyte xvel; // X velocity (when jumping)
} Actor; } Actor;
Actor actors[MAX_ACTORS]; // all actors Actor actors[MAX_ACTORS]; // all actors

View File

@ -53,7 +53,8 @@ NextFrame
sta HMP1 ; 1 pixel to the left sta HMP1 ; 1 pixel to the left
sta WSYNC sta WSYNC
sta HMOVE ; apply HMOVE sta HMOVE ; apply HMOVE
sta HMCLR SLEEP 24 ; sleep 24 cycles
sta HMCLR ; clear HMOVE registers
lda #1 lda #1
sta VDELP0 ; we need the VDEL registers sta VDELP0 ; we need the VDEL registers
sta VDELP1 ; so we can do our 4-store trick sta VDELP1 ; so we can do our 4-store trick

View File

@ -58,6 +58,7 @@ NextFrame
sta HMP1 sta HMP1
sta WSYNC sta WSYNC
sta HMOVE sta HMOVE
SLEEP 24 ; wait 24 cycles between write to HMOVE and HMxxx
sta HMCLR sta HMCLR
lda #1 lda #1
sta VDELP0 sta VDELP0

View File

@ -49,6 +49,7 @@ NextFrame
sta HMP1 sta HMP1
sta WSYNC sta WSYNC
sta HMOVE sta HMOVE
SLEEP 24
sta HMCLR sta HMCLR
lda #1 lda #1
sta VDELP0 sta VDELP0

View File

@ -389,6 +389,12 @@ export class SourceEditor implements ProjectView {
toggleBreakpoint(lineno: number) { toggleBreakpoint(lineno: number) {
if (this.sourcefile != null) { if (this.sourcefile != null) {
var targetPC = this.sourcefile.line2offset[lineno+1]; var targetPC = this.sourcefile.line2offset[lineno+1];
/* TODO: breakpoints
var bpid = "pc" + targetPC;
platform.setBreakpoint(bpid, () => {
return platform.getPC() == targetPC;
});
*/
runToPC(targetPC); runToPC(targetPC);
} }
} }

View File

@ -17,7 +17,7 @@ export var ColecoVision_PRESETS = [
{ id: 'multicolor.c', name: 'Multicolor Mode' }, { id: 'multicolor.c', name: 'Multicolor Mode' },
{ id: 'siegegame.c', name: 'Siege Game' }, { id: 'siegegame.c', name: 'Siege Game' },
{ id: 'shoot.c', name: 'Solarian Game' }, { id: 'shoot.c', name: 'Solarian Game' },
{ id: 'climber.c', name: 'Platform Game' }, { id: 'climber.c', name: 'Climber Game' },
]; ];
class ColecoVisionPlatform extends BaseZ80MachinePlatform<ColecoVision> implements Platform { class ColecoVisionPlatform extends BaseZ80MachinePlatform<ColecoVision> implements Platform {

View File

@ -33,7 +33,7 @@ var LIBCV_PRESETS = [
{ id: 'multicolor.c', name: 'Multicolor Mode' }, { id: 'multicolor.c', name: 'Multicolor Mode' },
{ id: 'siegegame.c', name: 'Siege Game' }, { id: 'siegegame.c', name: 'Siege Game' },
{ id: 'shoot.c', name: 'Solarian Game' }, { id: 'shoot.c', name: 'Solarian Game' },
{ id: 'climber.c', name: 'Platform Game' }, { id: 'climber.c', name: 'Climber Game' },
]; ];
class MSXPlatform extends BaseZ80MachinePlatform<MSX1> implements Platform { class MSXPlatform extends BaseZ80MachinePlatform<MSX1> implements Platform {