mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2025-04-05 11:38:54 +00:00
ecs: critical code, sorta
This commit is contained in:
parent
b4dbcb83eb
commit
4749e18b35
@ -236,7 +236,7 @@ export class ECSCompiler extends Tokenizer {
|
||||
this.expectToken('do');
|
||||
// TODO: include modifiers in error msg
|
||||
const select = this.expectTokens(SELECT_TYPE).str as SelectType; // TODO: type check?
|
||||
const all_modifiers = ['cyclecritical','asc','desc']; // TODO
|
||||
const all_modifiers = ['critical','asc','desc']; // TODO
|
||||
const modifiers = this.parseModifiers(all_modifiers);
|
||||
let query = undefined;
|
||||
let join = undefined;
|
||||
@ -259,6 +259,7 @@ export class ECSCompiler extends Tokenizer {
|
||||
if (modifiers['asc']) direction = 'asc';
|
||||
else if (modifiers['desc']) direction = 'desc';
|
||||
let action = { text, event, query, join, select, direction };
|
||||
if (modifiers['critical']) (action as ActionWithJoin).critical = true;
|
||||
return action as ActionWithJoin;
|
||||
}
|
||||
|
||||
|
@ -124,6 +124,7 @@ export interface ActionBase extends SourceLocated {
|
||||
select: SelectType;
|
||||
event: string;
|
||||
text: string;
|
||||
critical?: boolean;
|
||||
}
|
||||
|
||||
export interface ActionOnce extends ActionBase {
|
||||
@ -315,9 +316,11 @@ export class Dialect_CA65 {
|
||||
return `.endscope\n${name}__Start = ${name}::__Start`
|
||||
// TODO: scope__start = scope::start
|
||||
}
|
||||
segment(seg: string, segtype: 'rodata' | 'bss' | 'code') {
|
||||
segment(segtype: 'rodata' | 'bss' | 'code') {
|
||||
if (segtype == 'bss') {
|
||||
return `.zeropage`; // TODO
|
||||
return `.zeropage`;
|
||||
} else if (segtype == 'rodata') {
|
||||
return '.rodata'; // TODO?
|
||||
} else {
|
||||
return `.code`;
|
||||
}
|
||||
@ -343,6 +346,12 @@ export class Dialect_CA65 {
|
||||
equate(symbol: string, value: string): string {
|
||||
return `${symbol} = ${value}`;
|
||||
}
|
||||
call(symbol: string) {
|
||||
return ` jsr ${symbol}`;
|
||||
}
|
||||
return() {
|
||||
return ' rts';
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: merge with Dialect?
|
||||
@ -580,6 +589,7 @@ class ActionEval {
|
||||
oldState : ActionCPUState;
|
||||
entities : Entity[];
|
||||
tmplabel = '';
|
||||
label : string;
|
||||
|
||||
constructor(
|
||||
readonly scope: EntityScope,
|
||||
@ -611,6 +621,7 @@ class ActionEval {
|
||||
//let query = (this.action as ActionWithQuery).query;
|
||||
//TODO? if (query && this.entities.length == 0)
|
||||
//throw new ECSError(`query doesn't match any entities`, query); // TODO
|
||||
this.label = `${this.instance.system.name}__${action.event}__${this.em.seq++}`;
|
||||
}
|
||||
begin() {
|
||||
let state = this.scope.state = Object.assign({}, this.scope.state);
|
||||
@ -659,17 +670,22 @@ class ActionEval {
|
||||
this.scope.state = this.oldState;
|
||||
}
|
||||
codeToString(): string {
|
||||
const tag_re = /\{\{(.+?)\}\}/g;
|
||||
const label_re = /@(\w+)\b/g;
|
||||
|
||||
const allowEmpty = ['if','foreach','join'];
|
||||
if (this.entities.length == 0 && allowEmpty.includes(this.action.select))
|
||||
return '';
|
||||
|
||||
let action = this.action;
|
||||
let sys = this.instance.system;
|
||||
let { code, props } = this.getCodeAndProps(action);
|
||||
// replace @labels
|
||||
code = this.replaceLabels(code, this.label);
|
||||
// replace {{...}} tags
|
||||
// TODO: use nodes instead
|
||||
code = this.replaceTags(code, action, props);
|
||||
return code;
|
||||
}
|
||||
private getCodeAndProps(action: Action) {
|
||||
let code = action.text;
|
||||
let label = `${sys.name}__${action.event}__${this.em.seq++}`; // TODO: better label that won't conflict (seq?)
|
||||
let props: { [name: string]: string } = {};
|
||||
if (action.select != 'once') {
|
||||
// TODO: detect cycles
|
||||
@ -677,8 +693,8 @@ class ActionEval {
|
||||
// TODO: what if only 1 item?
|
||||
// TODO: what if join is subset of items?
|
||||
if (action.select == 'join' && this.jr) {
|
||||
let jentities = this.jr.entities;
|
||||
if (jentities.length == 0) return '';
|
||||
//let jentities = this.jr.entities;
|
||||
// TODO? if (jentities.length == 0) return '';
|
||||
// TODO? throw new ECSError(`join query doesn't match any entities`, (action as ActionWithJoin).join); // TODO
|
||||
let joinfield = this.getJoinField(action, this.qr.atypes, this.jr.atypes);
|
||||
// TODO: what if only 1 item?
|
||||
@ -722,12 +738,14 @@ class ActionEval {
|
||||
props['%xofs'] = (this.scope.state.xreg?.offset() || 0).toString();
|
||||
props['%yofs'] = (this.scope.state.yreg?.offset() || 0).toString();
|
||||
}
|
||||
// replace @labels
|
||||
code = code.replace(label_re, (s: string, a: string) => `${label}__${a}`);
|
||||
// replace {{...}} tags
|
||||
return { code, props };
|
||||
}
|
||||
private replaceTags(code: string, action: Action, props: { [name: string]: string; }) {
|
||||
const tag_re = /\{\{(.+?)\}\}/g;
|
||||
code = code.replace(tag_re, (entire, group: string) => {
|
||||
let toks = group.split(/\s+/);
|
||||
if (toks.length == 0) throw new ECSError(`empty command`, action);
|
||||
if (toks.length == 0)
|
||||
throw new ECSError(`empty command`, action);
|
||||
let cmd = group.charAt(0);
|
||||
let arg0 = toks[0].substring(1).trim();
|
||||
let args = [arg0].concat(toks.slice(1));
|
||||
@ -740,14 +758,22 @@ class ActionEval {
|
||||
case '>': return this.__get([arg0, '8']);
|
||||
default:
|
||||
let value = props[toks[0]];
|
||||
if (value) return value;
|
||||
if (value)
|
||||
return value;
|
||||
let fn = (this as any)['__' + toks[0]];
|
||||
if (fn) return fn.bind(this)(toks.slice(1));
|
||||
if (fn)
|
||||
return fn.bind(this)(toks.slice(1));
|
||||
throw new ECSError(`unrecognized command {{${toks[0]}}}`, action);
|
||||
}
|
||||
});
|
||||
return code;
|
||||
}
|
||||
private replaceLabels(code: string, label: string) {
|
||||
const label_re = /@(\w+)\b/g;
|
||||
code = code.replace(label_re, (s: string, a: string) => `${label}__${a}`);
|
||||
return code;
|
||||
}
|
||||
|
||||
__get(args: string[]) {
|
||||
return this.getset(args, false);
|
||||
}
|
||||
@ -1245,7 +1271,7 @@ export class EntityScope implements SourceLocated {
|
||||
}
|
||||
this.eventSeq++;
|
||||
// generate code
|
||||
let s = this.dialect.code();
|
||||
let code = this.dialect.code();
|
||||
//s += `\n; event ${event}\n`;
|
||||
let eventCount = 0;
|
||||
let instances = this.instances.filter(inst => systems.includes(inst.system));
|
||||
@ -1258,9 +1284,25 @@ export class EntityScope implements SourceLocated {
|
||||
// TODO: keep event tree
|
||||
let codeeval = new ActionEval(this, inst, action, args || []);
|
||||
codeeval.begin();
|
||||
let s = '';
|
||||
s += this.dialect.comment(`start action ${sys.name} ${inst.id} ${event}`); // TODO
|
||||
s += codeeval.codeToString();
|
||||
if (action.critical) {
|
||||
// TODO: bin-packing, share identical code
|
||||
let sublabel = `${codeeval.label}__sub`;
|
||||
let lines = [
|
||||
this.dialect.segment('rodata'),
|
||||
this.dialect.label(sublabel),
|
||||
codeeval.codeToString(),
|
||||
this.dialect.return(),
|
||||
this.dialect.code(),
|
||||
this.dialect.call(sublabel)
|
||||
];
|
||||
s += lines.join('\n');
|
||||
} else {
|
||||
s += codeeval.codeToString();
|
||||
}
|
||||
s += this.dialect.comment(`end action ${sys.name} ${inst.id} ${event}`);
|
||||
code += s;
|
||||
// TODO: check that this happens once?
|
||||
codeeval.end();
|
||||
}
|
||||
@ -1269,7 +1311,7 @@ export class EntityScope implements SourceLocated {
|
||||
if (eventCount == 0) {
|
||||
console.log(`warning: event ${event} not handled`);
|
||||
}
|
||||
return s;
|
||||
return code;
|
||||
}
|
||||
getSystemStats(inst: SystemInstance) : SystemStats {
|
||||
let stats = this.sysstats.get(inst);
|
||||
@ -1356,9 +1398,9 @@ export class EntityScope implements SourceLocated {
|
||||
private dumpCodeTo(file: SourceFileExport) {
|
||||
let dialect = this.dialect;
|
||||
file.line(dialect.startScope(this.name));
|
||||
file.line(dialect.segment(`${this.name}_DATA`, 'bss'));
|
||||
file.line(dialect.segment('bss'));
|
||||
this.bss.dump(file, dialect);
|
||||
file.line(dialect.segment(`${this.name}_RODATA`, 'rodata'));
|
||||
file.line(dialect.segment('code')); // TODO: rodata for aligned?
|
||||
this.rodata.dump(file, dialect);
|
||||
//file.segment(`${this.name}_CODE`, 'code');
|
||||
file.line(dialect.label('__Start'));
|
||||
|
@ -482,7 +482,7 @@ export function getBasePlatform(platform : string) : string {
|
||||
}
|
||||
|
||||
// get platform ID without - specialization
|
||||
export function getRootPlatform(platform : string) : string {
|
||||
function getRootPlatform(platform : string) : string {
|
||||
return platform.split('-')[0];
|
||||
}
|
||||
|
||||
|
@ -150,7 +150,7 @@ describe('Box Packer', function() {
|
||||
]
|
||||
);
|
||||
});
|
||||
it('Should pack top-aligned boxes', function() {
|
||||
it('Should pack unaligned boxes', function() {
|
||||
testPack(
|
||||
[
|
||||
new Bin({ left:0, top:0, right:10, bottom:10 })
|
||||
@ -163,5 +163,20 @@ describe('Box Packer', function() {
|
||||
]
|
||||
);
|
||||
});
|
||||
it('Should pack multiple bins', function() {
|
||||
testPack(
|
||||
[
|
||||
new Bin({ left:0, top:0, right:10, bottom:10 }),
|
||||
new Bin({ left:0, top:0, right:10, bottom:10 })
|
||||
], [
|
||||
|
||||
{ width: 5, height: 10 },
|
||||
{ width: 5, height: 10 },
|
||||
{ width: 5, height: 5 },
|
||||
{ width: 5, height: 10 },
|
||||
{ width: 5, height: 5 },
|
||||
]
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -249,7 +249,7 @@ Kernel2Sprite__preframe__4____exit:
|
||||
;;; start action SetXPos 6 preframe
|
||||
|
||||
ldy #0
|
||||
SetXPos__preframe__8____each:
|
||||
SetXPos__preframe__9____each:
|
||||
ldx SpriteSlot_sprite_b0,y
|
||||
|
||||
lda HasXpos_xpos_b0,x
|
||||
@ -263,9 +263,9 @@ SetXPos__preframe__8____each:
|
||||
sta WSYNC ; start a new line
|
||||
sec ; set carry flag
|
||||
nop
|
||||
SetHorizPos__SetHorizPos__9__DivideLoop:
|
||||
SetHorizPos__SetHorizPos__10__DivideLoop:
|
||||
sbc #15 ; subtract 15
|
||||
bcs SetHorizPos__SetHorizPos__9__DivideLoop ; branch until negative
|
||||
bcs SetHorizPos__SetHorizPos__10__DivideLoop ; branch until negative
|
||||
eor #7 ; calculate fine offset
|
||||
asl
|
||||
asl
|
||||
@ -279,8 +279,8 @@ SetHorizPos__SetHorizPos__9__DivideLoop:
|
||||
|
||||
iny
|
||||
cpy #2
|
||||
jne SetXPos__preframe__8____each
|
||||
SetXPos__preframe__8____exit:
|
||||
jne SetXPos__preframe__9____each
|
||||
SetXPos__preframe__9____exit:
|
||||
|
||||
;;; end action SetXPos 6 preframe
|
||||
|
||||
@ -310,7 +310,7 @@ SetXPos__preframe__8____exit:
|
||||
;;; start action Kernel2Sprite 2 kernel
|
||||
|
||||
ldy #192
|
||||
Kernel2Sprite__kernel__12__LVScan:
|
||||
Kernel2Sprite__kernel__14__LVScan:
|
||||
.code
|
||||
|
||||
;;; start action Kernel2Sprite 2 scanline
|
||||
@ -318,10 +318,10 @@ Kernel2Sprite__kernel__12__LVScan:
|
||||
; draw player 0
|
||||
lda Kernel2Sprite__2__tmp+8 ; height
|
||||
dcp Kernel2Sprite__2__tmp+10 ; ypos
|
||||
bcs Kernel2Sprite__scanline__13__DoDraw1
|
||||
bcs Kernel2Sprite__scanline__15__DoDraw1
|
||||
lda #0
|
||||
.byte $2C
|
||||
Kernel2Sprite__scanline__13__DoDraw1:
|
||||
Kernel2Sprite__scanline__15__DoDraw1:
|
||||
lda (Kernel2Sprite__2__tmp+0),y
|
||||
.if 0 = 0
|
||||
sta WSYNC
|
||||
@ -332,10 +332,10 @@ Kernel2Sprite__scanline__13__DoDraw1:
|
||||
; draw player 1
|
||||
lda Kernel2Sprite__2__tmp+9 ; height
|
||||
dcp Kernel2Sprite__2__tmp+11 ; ypos
|
||||
bcs Kernel2Sprite__scanline__13__DoDraw2
|
||||
bcs Kernel2Sprite__scanline__15__DoDraw2
|
||||
lda #0
|
||||
.byte $2C
|
||||
Kernel2Sprite__scanline__13__DoDraw2:
|
||||
Kernel2Sprite__scanline__15__DoDraw2:
|
||||
lda (Kernel2Sprite__2__tmp+2),y
|
||||
sta GRP1
|
||||
lda (Kernel2Sprite__2__tmp+6),y
|
||||
@ -355,10 +355,10 @@ Kernel2Sprite__scanline__13__DoDraw2:
|
||||
; draw player 0
|
||||
lda Kernel2Sprite__2__tmp+8 ; height
|
||||
dcp Kernel2Sprite__2__tmp+10 ; ypos
|
||||
bcs Kernel2Sprite__scanline__14__DoDraw1
|
||||
bcs Kernel2Sprite__scanline__17__DoDraw1
|
||||
lda #0
|
||||
.byte $2C
|
||||
Kernel2Sprite__scanline__14__DoDraw1:
|
||||
Kernel2Sprite__scanline__17__DoDraw1:
|
||||
lda (Kernel2Sprite__2__tmp+0),y
|
||||
.if 1 = 0
|
||||
sta WSYNC
|
||||
@ -369,10 +369,10 @@ Kernel2Sprite__scanline__14__DoDraw1:
|
||||
; draw player 1
|
||||
lda Kernel2Sprite__2__tmp+9 ; height
|
||||
dcp Kernel2Sprite__2__tmp+11 ; ypos
|
||||
bcs Kernel2Sprite__scanline__14__DoDraw2
|
||||
bcs Kernel2Sprite__scanline__17__DoDraw2
|
||||
lda #0
|
||||
.byte $2C
|
||||
Kernel2Sprite__scanline__14__DoDraw2:
|
||||
Kernel2Sprite__scanline__17__DoDraw2:
|
||||
lda (Kernel2Sprite__2__tmp+2),y
|
||||
sta GRP1
|
||||
lda (Kernel2Sprite__2__tmp+6),y
|
||||
@ -385,7 +385,7 @@ Kernel2Sprite__scanline__14__DoDraw2:
|
||||
;;; end action Kernel2Sprite 2 scanline
|
||||
|
||||
dey ; next scanline
|
||||
bne Kernel2Sprite__kernel__12__LVScan ; repeat until out of lines
|
||||
bne Kernel2Sprite__kernel__14__LVScan ; repeat until out of lines
|
||||
|
||||
;;; end action Kernel2Sprite 2 kernel
|
||||
|
||||
@ -413,10 +413,10 @@ Kernel2Sprite__scanline__14__DoDraw2:
|
||||
;;; start action Joystick 3 postframe
|
||||
|
||||
ldx #0
|
||||
Joystick__postframe__17____each:
|
||||
Joystick__postframe__21____each:
|
||||
|
||||
asl Joystick__3__tmp+0
|
||||
bcs Joystick__postframe__17__SkipMoveRight
|
||||
bcs Joystick__postframe__21__SkipMoveRight
|
||||
.code
|
||||
|
||||
;;; start action MoveJoyX 4 joyright
|
||||
@ -425,15 +425,15 @@ Joystick__postframe__17____each:
|
||||
clc
|
||||
adc #1
|
||||
cmp #152
|
||||
bcs MoveJoyX__joyright__18__nomove
|
||||
bcs MoveJoyX__joyright__22__nomove
|
||||
sta HasXpos_xpos_b0,x
|
||||
MoveJoyX__joyright__18__nomove:
|
||||
MoveJoyX__joyright__22__nomove:
|
||||
|
||||
;;; end action MoveJoyX 4 joyright
|
||||
|
||||
Joystick__postframe__17__SkipMoveRight:
|
||||
Joystick__postframe__21__SkipMoveRight:
|
||||
asl Joystick__3__tmp+0
|
||||
bcs Joystick__postframe__17__SkipMoveLeft
|
||||
bcs Joystick__postframe__21__SkipMoveLeft
|
||||
.code
|
||||
|
||||
;;; start action MoveJoyX 4 joyleft
|
||||
@ -441,15 +441,15 @@ Joystick__postframe__17__SkipMoveRight:
|
||||
lda HasXpos_xpos_b0,x
|
||||
sec
|
||||
sbc #1
|
||||
bcc MoveJoyX__joyleft__19__nomove
|
||||
bcc MoveJoyX__joyleft__23__nomove
|
||||
sta HasXpos_xpos_b0,x
|
||||
MoveJoyX__joyleft__19__nomove:
|
||||
MoveJoyX__joyleft__23__nomove:
|
||||
|
||||
;;; end action MoveJoyX 4 joyleft
|
||||
|
||||
Joystick__postframe__17__SkipMoveLeft:
|
||||
Joystick__postframe__21__SkipMoveLeft:
|
||||
asl Joystick__3__tmp+0
|
||||
bcs Joystick__postframe__17__SkipMoveDown
|
||||
bcs Joystick__postframe__21__SkipMoveDown
|
||||
.code
|
||||
|
||||
;;; start action MoveJoyY 5 joydown
|
||||
@ -458,15 +458,15 @@ Joystick__postframe__17__SkipMoveLeft:
|
||||
clc
|
||||
adc #1
|
||||
cmp #220
|
||||
bcs MoveJoyY__joydown__20__nomove
|
||||
bcs MoveJoyY__joydown__24__nomove
|
||||
sta HasYpos_ypos_b0,x
|
||||
MoveJoyY__joydown__20__nomove:
|
||||
MoveJoyY__joydown__24__nomove:
|
||||
|
||||
;;; end action MoveJoyY 5 joydown
|
||||
|
||||
Joystick__postframe__17__SkipMoveDown:
|
||||
Joystick__postframe__21__SkipMoveDown:
|
||||
asl Joystick__3__tmp+0
|
||||
bcs Joystick__postframe__17__SkipMoveUp
|
||||
bcs Joystick__postframe__21__SkipMoveUp
|
||||
.code
|
||||
|
||||
;;; start action MoveJoyY 5 joyup
|
||||
@ -474,18 +474,18 @@ Joystick__postframe__17__SkipMoveDown:
|
||||
lda HasYpos_ypos_b0,x
|
||||
sec
|
||||
sbc #1
|
||||
bcc MoveJoyY__joyup__21__nomove
|
||||
bcc MoveJoyY__joyup__25__nomove
|
||||
sta HasYpos_ypos_b0,x
|
||||
MoveJoyY__joyup__21__nomove:
|
||||
MoveJoyY__joyup__25__nomove:
|
||||
|
||||
;;; end action MoveJoyY 5 joyup
|
||||
|
||||
Joystick__postframe__17__SkipMoveUp:
|
||||
Joystick__postframe__21__SkipMoveUp:
|
||||
|
||||
inx
|
||||
cpx #4
|
||||
jne Joystick__postframe__17____each
|
||||
Joystick__postframe__17____exit:
|
||||
jne Joystick__postframe__21____each
|
||||
Joystick__postframe__21____exit:
|
||||
|
||||
;;; end action Joystick 3 postframe
|
||||
|
||||
@ -498,12 +498,12 @@ Joystick__postframe__17____exit:
|
||||
sta SpriteShuffler__8__tmp+1
|
||||
; move two slots to the left
|
||||
ldx #0
|
||||
SpriteShuffler__postframe__22__loop:
|
||||
SpriteShuffler__postframe__26__loop:
|
||||
lda SpriteSlot_sprite_b0+2,x
|
||||
sta SpriteSlot_sprite_b0,x
|
||||
inx
|
||||
cpx #4-2
|
||||
bne SpriteShuffler__postframe__22__loop
|
||||
bne SpriteShuffler__postframe__26__loop
|
||||
; store two sprite slots at right side of array
|
||||
lda SpriteShuffler__8__tmp+0
|
||||
sta SpriteSlot_sprite_b0+4-2
|
||||
@ -522,12 +522,12 @@ SpriteShuffler__postframe__22__loop:
|
||||
;;; start action SpriteHider 9 postframe
|
||||
|
||||
ldy #0
|
||||
SpriteHider__postframe__24____each:
|
||||
SpriteHider__postframe__28____each:
|
||||
ldx SpriteSlot_sprite_b0,y
|
||||
|
||||
lda HasYpos_ypos_b0,x
|
||||
cmp #192
|
||||
bcc SpriteHider__postframe__24__skip
|
||||
bcc SpriteHider__postframe__28__skip
|
||||
; swap this sprite slot with slot at end of array
|
||||
lda SpriteSlot_sprite_b0,y
|
||||
pha
|
||||
@ -537,12 +537,12 @@ SpriteHider__postframe__24____each:
|
||||
pla
|
||||
sta SpriteSlot_sprite_b0,x
|
||||
dec SpriteHider__9__tmp+0
|
||||
SpriteHider__postframe__24__skip:
|
||||
SpriteHider__postframe__28__skip:
|
||||
|
||||
iny
|
||||
cpy #2
|
||||
jne SpriteHider__postframe__24____each
|
||||
SpriteHider__postframe__24____exit:
|
||||
jne SpriteHider__postframe__28____each
|
||||
SpriteHider__postframe__28____exit:
|
||||
|
||||
;;; end action SpriteHider 9 postframe
|
||||
|
||||
|
@ -234,7 +234,7 @@ Kernel2Sprite__preframe__4____exit:
|
||||
;;; start action SetXPos 6 preframe
|
||||
|
||||
ldy #0
|
||||
SetXPos__preframe__8____each:
|
||||
SetXPos__preframe__9____each:
|
||||
ldx SpriteSlot_sprite_b0,y
|
||||
|
||||
lda HasXpos_xpos_b0,x
|
||||
@ -248,9 +248,9 @@ SetXPos__preframe__8____each:
|
||||
sta WSYNC ; start a new line
|
||||
sec ; set carry flag
|
||||
nop
|
||||
SetHorizPos__SetHorizPos__9__DivideLoop:
|
||||
SetHorizPos__SetHorizPos__10__DivideLoop:
|
||||
sbc #15 ; subtract 15
|
||||
bcs SetHorizPos__SetHorizPos__9__DivideLoop ; branch until negative
|
||||
bcs SetHorizPos__SetHorizPos__10__DivideLoop ; branch until negative
|
||||
eor #7 ; calculate fine offset
|
||||
asl
|
||||
asl
|
||||
@ -264,8 +264,8 @@ SetHorizPos__SetHorizPos__9__DivideLoop:
|
||||
|
||||
iny
|
||||
cpy #2
|
||||
jne SetXPos__preframe__8____each
|
||||
SetXPos__preframe__8____exit:
|
||||
jne SetXPos__preframe__9____each
|
||||
SetXPos__preframe__9____exit:
|
||||
|
||||
;;; end action SetXPos 6 preframe
|
||||
|
||||
@ -295,7 +295,7 @@ SetXPos__preframe__8____exit:
|
||||
;;; start action Kernel2Sprite 2 kernel
|
||||
|
||||
; define macro for each line
|
||||
.macro Kernel2Sprite__kernel__12__DrawLine do_wsync
|
||||
.macro Kernel2Sprite__kernel__14__DrawLine do_wsync
|
||||
.local DoDraw1
|
||||
.local DoDraw2
|
||||
; draw player 0
|
||||
@ -326,20 +326,20 @@ DoDraw2:
|
||||
.endmacro
|
||||
|
||||
ldy #192
|
||||
Kernel2Sprite__kernel__12__LVScan:
|
||||
Kernel2Sprite__kernel__14__LVScan:
|
||||
.code
|
||||
|
||||
;;; start action Kernel2Sprite 2 scanline1
|
||||
|
||||
;;; end action Kernel2Sprite 2 scanline1
|
||||
|
||||
Kernel2Sprite__kernel__12__DrawLine 1 ; macro: draw scanline w/ WSYNC
|
||||
Kernel2Sprite__kernel__14__DrawLine 1 ; macro: draw scanline w/ WSYNC
|
||||
dey ; next scanline
|
||||
.code
|
||||
|
||||
Kernel2Sprite__kernel__12__DrawLine 0 ; macro: draw scanline no WSYNC
|
||||
Kernel2Sprite__kernel__14__DrawLine 0 ; macro: draw scanline no WSYNC
|
||||
dey ; next scanline
|
||||
bne Kernel2Sprite__kernel__12__LVScan ; repeat until out of lines
|
||||
bne Kernel2Sprite__kernel__14__LVScan ; repeat until out of lines
|
||||
|
||||
;;; end action Kernel2Sprite 2 kernel
|
||||
|
||||
@ -367,10 +367,10 @@ Kernel2Sprite__kernel__12__LVScan:
|
||||
;;; start action Joystick 3 postframe
|
||||
|
||||
ldx #0
|
||||
Joystick__postframe__15____each:
|
||||
Joystick__postframe__18____each:
|
||||
|
||||
asl Joystick__3__tmp+0
|
||||
bcs Joystick__postframe__15__SkipMoveRight
|
||||
bcs Joystick__postframe__18__SkipMoveRight
|
||||
.code
|
||||
|
||||
;;; start action MoveJoyX 4 joyright
|
||||
@ -379,15 +379,15 @@ Joystick__postframe__15____each:
|
||||
clc
|
||||
adc #1
|
||||
cmp #152
|
||||
bcs MoveJoyX__joyright__16__nomove
|
||||
bcs MoveJoyX__joyright__19__nomove
|
||||
sta HasXpos_xpos_b0,x
|
||||
MoveJoyX__joyright__16__nomove:
|
||||
MoveJoyX__joyright__19__nomove:
|
||||
|
||||
;;; end action MoveJoyX 4 joyright
|
||||
|
||||
Joystick__postframe__15__SkipMoveRight:
|
||||
Joystick__postframe__18__SkipMoveRight:
|
||||
asl Joystick__3__tmp+0
|
||||
bcs Joystick__postframe__15__SkipMoveLeft
|
||||
bcs Joystick__postframe__18__SkipMoveLeft
|
||||
.code
|
||||
|
||||
;;; start action MoveJoyX 4 joyleft
|
||||
@ -395,15 +395,15 @@ Joystick__postframe__15__SkipMoveRight:
|
||||
lda HasXpos_xpos_b0,x
|
||||
sec
|
||||
sbc #1
|
||||
bcc MoveJoyX__joyleft__17__nomove
|
||||
bcc MoveJoyX__joyleft__20__nomove
|
||||
sta HasXpos_xpos_b0,x
|
||||
MoveJoyX__joyleft__17__nomove:
|
||||
MoveJoyX__joyleft__20__nomove:
|
||||
|
||||
;;; end action MoveJoyX 4 joyleft
|
||||
|
||||
Joystick__postframe__15__SkipMoveLeft:
|
||||
Joystick__postframe__18__SkipMoveLeft:
|
||||
asl Joystick__3__tmp+0
|
||||
bcs Joystick__postframe__15__SkipMoveDown
|
||||
bcs Joystick__postframe__18__SkipMoveDown
|
||||
.code
|
||||
|
||||
;;; start action MoveJoyY 5 joydown
|
||||
@ -412,15 +412,15 @@ Joystick__postframe__15__SkipMoveLeft:
|
||||
clc
|
||||
adc #1
|
||||
cmp #220
|
||||
bcs MoveJoyY__joydown__18__nomove
|
||||
bcs MoveJoyY__joydown__21__nomove
|
||||
sta HasYpos_ypos_b0,x
|
||||
MoveJoyY__joydown__18__nomove:
|
||||
MoveJoyY__joydown__21__nomove:
|
||||
|
||||
;;; end action MoveJoyY 5 joydown
|
||||
|
||||
Joystick__postframe__15__SkipMoveDown:
|
||||
Joystick__postframe__18__SkipMoveDown:
|
||||
asl Joystick__3__tmp+0
|
||||
bcs Joystick__postframe__15__SkipMoveUp
|
||||
bcs Joystick__postframe__18__SkipMoveUp
|
||||
.code
|
||||
|
||||
;;; start action MoveJoyY 5 joyup
|
||||
@ -428,18 +428,18 @@ Joystick__postframe__15__SkipMoveDown:
|
||||
lda HasYpos_ypos_b0,x
|
||||
sec
|
||||
sbc #1
|
||||
bcc MoveJoyY__joyup__19__nomove
|
||||
bcc MoveJoyY__joyup__22__nomove
|
||||
sta HasYpos_ypos_b0,x
|
||||
MoveJoyY__joyup__19__nomove:
|
||||
MoveJoyY__joyup__22__nomove:
|
||||
|
||||
;;; end action MoveJoyY 5 joyup
|
||||
|
||||
Joystick__postframe__15__SkipMoveUp:
|
||||
Joystick__postframe__18__SkipMoveUp:
|
||||
|
||||
inx
|
||||
cpx #4
|
||||
jne Joystick__postframe__15____each
|
||||
Joystick__postframe__15____exit:
|
||||
jne Joystick__postframe__18____each
|
||||
Joystick__postframe__18____exit:
|
||||
|
||||
;;; end action Joystick 3 postframe
|
||||
|
||||
@ -452,12 +452,12 @@ Joystick__postframe__15____exit:
|
||||
sta SpriteShuffler__8__tmp+1
|
||||
; move two slots to the left
|
||||
ldx #0
|
||||
SpriteShuffler__postframe__20__loop:
|
||||
SpriteShuffler__postframe__23__loop:
|
||||
lda SpriteSlot_sprite_b0+2,x
|
||||
sta SpriteSlot_sprite_b0,x
|
||||
inx
|
||||
cpx #4-2
|
||||
bne SpriteShuffler__postframe__20__loop
|
||||
bne SpriteShuffler__postframe__23__loop
|
||||
; store two sprite slots at right side of array
|
||||
lda SpriteShuffler__8__tmp+0
|
||||
sta SpriteSlot_sprite_b0+4-2
|
||||
@ -476,12 +476,12 @@ SpriteShuffler__postframe__20__loop:
|
||||
;;; start action SpriteHider 9 postframe
|
||||
|
||||
ldy #0
|
||||
SpriteHider__postframe__22____each:
|
||||
SpriteHider__postframe__25____each:
|
||||
ldx SpriteSlot_sprite_b0,y
|
||||
|
||||
lda HasYpos_ypos_b0,x
|
||||
cmp #192
|
||||
bcc SpriteHider__postframe__22__skip
|
||||
bcc SpriteHider__postframe__25__skip
|
||||
; swap this sprite slot with slot at end of array
|
||||
lda SpriteSlot_sprite_b0,y
|
||||
pha
|
||||
@ -491,12 +491,12 @@ SpriteHider__postframe__22____each:
|
||||
pla
|
||||
sta SpriteSlot_sprite_b0,x
|
||||
dec SpriteHider__9__tmp+0
|
||||
SpriteHider__postframe__22__skip:
|
||||
SpriteHider__postframe__25__skip:
|
||||
|
||||
iny
|
||||
cpy #2
|
||||
jne SpriteHider__postframe__22____each
|
||||
SpriteHider__postframe__22____exit:
|
||||
jne SpriteHider__postframe__25____each
|
||||
SpriteHider__postframe__25____exit:
|
||||
|
||||
;;; end action SpriteHider 9 postframe
|
||||
|
||||
|
@ -761,7 +761,7 @@ Kernel2Sprite__preframe__4____exit:
|
||||
;;; start action SetXPos 8 preframe
|
||||
|
||||
ldy #0
|
||||
SetXPos__preframe__8____each:
|
||||
SetXPos__preframe__9____each:
|
||||
ldx SpriteSlot_sprite_b0,y
|
||||
|
||||
lda HasXpos_xpos_b0,x
|
||||
@ -775,9 +775,9 @@ SetXPos__preframe__8____each:
|
||||
sta WSYNC ; start a new line
|
||||
sec ; set carry flag
|
||||
nop
|
||||
SetHorizPos__SetHorizPos__9__DivideLoop:
|
||||
SetHorizPos__SetHorizPos__10__DivideLoop:
|
||||
sbc #15 ; subtract 15
|
||||
bcs SetHorizPos__SetHorizPos__9__DivideLoop ; branch until negative
|
||||
bcs SetHorizPos__SetHorizPos__10__DivideLoop ; branch until negative
|
||||
eor #7 ; calculate fine offset
|
||||
asl
|
||||
asl
|
||||
@ -791,8 +791,8 @@ SetHorizPos__SetHorizPos__9__DivideLoop:
|
||||
|
||||
iny
|
||||
cpy #2
|
||||
jne SetXPos__preframe__8____each
|
||||
SetXPos__preframe__8____exit:
|
||||
jne SetXPos__preframe__9____each
|
||||
SetXPos__preframe__9____exit:
|
||||
|
||||
;;; end action SetXPos 8 preframe
|
||||
|
||||
@ -834,7 +834,7 @@ SetXPos__preframe__8____exit:
|
||||
;;; start action Kernel2Sprite 2 kernel
|
||||
|
||||
ldy #192
|
||||
Kernel2Sprite__kernel__13__LVScan:
|
||||
Kernel2Sprite__kernel__15__LVScan:
|
||||
.code
|
||||
|
||||
;;; start action Kernel2Sprite 2 scanline
|
||||
@ -842,10 +842,10 @@ Kernel2Sprite__kernel__13__LVScan:
|
||||
; draw player 0
|
||||
lda Kernel2Sprite__2__tmp+8 ; height
|
||||
dcp Kernel2Sprite__2__tmp+10 ; ypos
|
||||
bcs Kernel2Sprite__scanline__14__DoDraw1
|
||||
bcs Kernel2Sprite__scanline__16__DoDraw1
|
||||
lda #0
|
||||
.byte $2C
|
||||
Kernel2Sprite__scanline__14__DoDraw1:
|
||||
Kernel2Sprite__scanline__16__DoDraw1:
|
||||
lda (Kernel2Sprite__2__tmp+0),y
|
||||
.if 0 = 0
|
||||
sta WSYNC
|
||||
@ -856,10 +856,10 @@ Kernel2Sprite__scanline__14__DoDraw1:
|
||||
; draw player 1
|
||||
lda Kernel2Sprite__2__tmp+9 ; height
|
||||
dcp Kernel2Sprite__2__tmp+11 ; ypos
|
||||
bcs Kernel2Sprite__scanline__14__DoDraw2
|
||||
bcs Kernel2Sprite__scanline__16__DoDraw2
|
||||
lda #0
|
||||
.byte $2C
|
||||
Kernel2Sprite__scanline__14__DoDraw2:
|
||||
Kernel2Sprite__scanline__16__DoDraw2:
|
||||
lda (Kernel2Sprite__2__tmp+2),y
|
||||
sta GRP1
|
||||
lda (Kernel2Sprite__2__tmp+6),y
|
||||
@ -897,10 +897,10 @@ Kernel2Sprite__scanline__14__DoDraw2:
|
||||
; draw player 0
|
||||
lda Kernel2Sprite__2__tmp+8 ; height
|
||||
dcp Kernel2Sprite__2__tmp+10 ; ypos
|
||||
bcs Kernel2Sprite__scanline__17__DoDraw1
|
||||
bcs Kernel2Sprite__scanline__20__DoDraw1
|
||||
lda #0
|
||||
.byte $2C
|
||||
Kernel2Sprite__scanline__17__DoDraw1:
|
||||
Kernel2Sprite__scanline__20__DoDraw1:
|
||||
lda (Kernel2Sprite__2__tmp+0),y
|
||||
.if 1 = 0
|
||||
sta WSYNC
|
||||
@ -911,10 +911,10 @@ Kernel2Sprite__scanline__17__DoDraw1:
|
||||
; draw player 1
|
||||
lda Kernel2Sprite__2__tmp+9 ; height
|
||||
dcp Kernel2Sprite__2__tmp+11 ; ypos
|
||||
bcs Kernel2Sprite__scanline__17__DoDraw2
|
||||
bcs Kernel2Sprite__scanline__20__DoDraw2
|
||||
lda #0
|
||||
.byte $2C
|
||||
Kernel2Sprite__scanline__17__DoDraw2:
|
||||
Kernel2Sprite__scanline__20__DoDraw2:
|
||||
lda (Kernel2Sprite__2__tmp+2),y
|
||||
sta GRP1
|
||||
lda (Kernel2Sprite__2__tmp+6),y
|
||||
@ -945,7 +945,7 @@ Kernel2Sprite__scanline__17__DoDraw2:
|
||||
;;; end action VersatilePlayfield 10 scanline
|
||||
|
||||
dey ; next scanline
|
||||
bne Kernel2Sprite__kernel__13__LVScan ; repeat until out of lines
|
||||
bne Kernel2Sprite__kernel__15__LVScan ; repeat until out of lines
|
||||
|
||||
;;; end action Kernel2Sprite 2 kernel
|
||||
|
||||
@ -973,7 +973,7 @@ Kernel2Sprite__scanline__17__DoDraw2:
|
||||
;;; start action Joystick 3 postframe
|
||||
|
||||
asl Joystick__3__tmp+0
|
||||
bcs Joystick__postframe__22__SkipMoveRight
|
||||
bcs Joystick__postframe__26__SkipMoveRight
|
||||
.code
|
||||
|
||||
;;; start action JoyFaceDirection 4 joyright
|
||||
@ -990,7 +990,7 @@ Kernel2Sprite__scanline__17__DoDraw2:
|
||||
clc
|
||||
adc #2
|
||||
cmp #142
|
||||
jcc SuperFly__joyright__24__nomove
|
||||
jcc SuperFly__joyright__28__nomove
|
||||
.code
|
||||
|
||||
;;; start action SuperFly 5 goeast
|
||||
@ -1002,14 +1002,14 @@ Kernel2Sprite__scanline__17__DoDraw2:
|
||||
;;; end action SuperFly 5 goeast
|
||||
|
||||
lda #2
|
||||
SuperFly__joyright__24__nomove:
|
||||
SuperFly__joyright__28__nomove:
|
||||
sta HasXpos_xpos_b0
|
||||
|
||||
;;; end action SuperFly 5 joyright
|
||||
|
||||
Joystick__postframe__22__SkipMoveRight:
|
||||
Joystick__postframe__26__SkipMoveRight:
|
||||
asl Joystick__3__tmp+0
|
||||
bcs Joystick__postframe__22__SkipMoveLeft
|
||||
bcs Joystick__postframe__26__SkipMoveLeft
|
||||
.code
|
||||
|
||||
;;; start action JoyFaceDirection 4 joyleft
|
||||
@ -1025,7 +1025,7 @@ Joystick__postframe__22__SkipMoveRight:
|
||||
lda HasXpos_xpos_b0
|
||||
sec
|
||||
sbc #2
|
||||
jcs SuperFly__joyleft__27__nomove
|
||||
jcs SuperFly__joyleft__31__nomove
|
||||
.code
|
||||
|
||||
;;; start action SuperFly 5 gowest
|
||||
@ -1037,14 +1037,14 @@ Joystick__postframe__22__SkipMoveRight:
|
||||
;;; end action SuperFly 5 gowest
|
||||
|
||||
lda #142
|
||||
SuperFly__joyleft__27__nomove:
|
||||
SuperFly__joyleft__31__nomove:
|
||||
sta HasXpos_xpos_b0
|
||||
|
||||
;;; end action SuperFly 5 joyleft
|
||||
|
||||
Joystick__postframe__22__SkipMoveLeft:
|
||||
Joystick__postframe__26__SkipMoveLeft:
|
||||
asl Joystick__3__tmp+0
|
||||
bcs Joystick__postframe__22__SkipMoveDown
|
||||
bcs Joystick__postframe__26__SkipMoveDown
|
||||
.code
|
||||
|
||||
;;; start action SuperFly 5 joydown
|
||||
@ -1053,7 +1053,7 @@ Joystick__postframe__22__SkipMoveLeft:
|
||||
clc
|
||||
adc #2
|
||||
cmp #220
|
||||
jcc SuperFly__joydown__29__nomove
|
||||
jcc SuperFly__joydown__33__nomove
|
||||
.code
|
||||
|
||||
;;; start action SuperFly 5 gosouth
|
||||
@ -1065,14 +1065,14 @@ Joystick__postframe__22__SkipMoveLeft:
|
||||
;;; end action SuperFly 5 gosouth
|
||||
|
||||
lda #2
|
||||
SuperFly__joydown__29__nomove:
|
||||
SuperFly__joydown__33__nomove:
|
||||
sta HasYpos_ypos_b0
|
||||
|
||||
;;; end action SuperFly 5 joydown
|
||||
|
||||
Joystick__postframe__22__SkipMoveDown:
|
||||
Joystick__postframe__26__SkipMoveDown:
|
||||
asl Joystick__3__tmp+0
|
||||
bcs Joystick__postframe__22__SkipMoveUp
|
||||
bcs Joystick__postframe__26__SkipMoveUp
|
||||
.code
|
||||
|
||||
;;; start action SuperFly 5 joyup
|
||||
@ -1080,7 +1080,7 @@ Joystick__postframe__22__SkipMoveDown:
|
||||
lda HasYpos_ypos_b0
|
||||
sec
|
||||
sbc #2
|
||||
jcs SuperFly__joyup__31__nomove
|
||||
jcs SuperFly__joyup__35__nomove
|
||||
.code
|
||||
|
||||
;;; start action SuperFly 5 gonorth
|
||||
@ -1092,19 +1092,19 @@ Joystick__postframe__22__SkipMoveDown:
|
||||
;;; end action SuperFly 5 gonorth
|
||||
|
||||
lda #200
|
||||
SuperFly__joyup__31__nomove:
|
||||
SuperFly__joyup__35__nomove:
|
||||
sta HasYpos_ypos_b0
|
||||
|
||||
;;; end action SuperFly 5 joyup
|
||||
|
||||
Joystick__postframe__22__SkipMoveUp:
|
||||
Joystick__postframe__26__SkipMoveUp:
|
||||
|
||||
;;; end action Joystick 3 postframe
|
||||
|
||||
;;; start action BadMove 6 postframe
|
||||
|
||||
ldx #0
|
||||
BadMove__postframe__33____each:
|
||||
BadMove__postframe__37____each:
|
||||
|
||||
.code
|
||||
|
||||
@ -1122,7 +1122,7 @@ BadMove__postframe__33____each:
|
||||
clc
|
||||
adc #1
|
||||
cmp #142
|
||||
jcc SuperFly__joyright__35__nomove
|
||||
jcc SuperFly__joyright__39__nomove
|
||||
.code
|
||||
|
||||
;;; start action SuperFly 5 goeast
|
||||
@ -1134,7 +1134,7 @@ BadMove__postframe__33____each:
|
||||
;;; end action SuperFly 5 goeast
|
||||
|
||||
lda #2
|
||||
SuperFly__joyright__35__nomove:
|
||||
SuperFly__joyright__39__nomove:
|
||||
sta HasXpos_xpos_b0+1,x
|
||||
|
||||
;;; end action SuperFly 5 joyright
|
||||
@ -1142,8 +1142,8 @@ SuperFly__joyright__35__nomove:
|
||||
|
||||
inx
|
||||
cpx #3
|
||||
jne BadMove__postframe__33____each
|
||||
BadMove__postframe__33____exit:
|
||||
jne BadMove__postframe__37____each
|
||||
BadMove__postframe__37____exit:
|
||||
|
||||
;;; end action BadMove 6 postframe
|
||||
|
||||
@ -1151,22 +1151,22 @@ BadMove__postframe__33____exit:
|
||||
|
||||
ldy 4
|
||||
ldx SpriteSlot_sprite_b0+1
|
||||
bmi RoomShuffle__postframe__37__empty ; empty slot, load 1st entry
|
||||
RoomShuffle__postframe__37__loop:
|
||||
bmi RoomShuffle__postframe__41__empty ; empty slot, load 1st entry
|
||||
RoomShuffle__postframe__41__loop:
|
||||
inx
|
||||
cpx 4
|
||||
bcc RoomShuffle__postframe__37__norecycle
|
||||
bcc RoomShuffle__postframe__41__norecycle
|
||||
; TODO: need to get index of specific entity
|
||||
RoomShuffle__postframe__37__empty:
|
||||
RoomShuffle__postframe__41__empty:
|
||||
ldx #1 ; skip null sprite and super dude?
|
||||
RoomShuffle__postframe__37__norecycle:
|
||||
RoomShuffle__postframe__41__norecycle:
|
||||
lda Location_room_b0,x
|
||||
cmp Location_room_b0
|
||||
beq RoomShuffle__postframe__37__exit
|
||||
beq RoomShuffle__postframe__41__exit
|
||||
dey
|
||||
bne RoomShuffle__postframe__37__loop
|
||||
bne RoomShuffle__postframe__41__loop
|
||||
ldx #$ff
|
||||
RoomShuffle__postframe__37__exit:
|
||||
RoomShuffle__postframe__41__exit:
|
||||
stx SpriteSlot_sprite_b0+1
|
||||
|
||||
;;; end action RoomShuffle 7 postframe
|
||||
|
@ -198,7 +198,7 @@ FrameLoop__start__2__NextFrame:
|
||||
;;; start action StaticKernel 3 kernel
|
||||
|
||||
ldx #0
|
||||
StaticKernel__kernel__5____each:
|
||||
StaticKernel__kernel__9____each:
|
||||
|
||||
sta WSYNC
|
||||
.code
|
||||
@ -206,10 +206,10 @@ StaticKernel__kernel__5____each:
|
||||
;;; start action Kernel48Pixel 2 kernelsetup
|
||||
|
||||
cpx #2+1
|
||||
jcs Kernel48Pixel__kernelsetup__6____skipxhi
|
||||
jcs Kernel48Pixel__kernelsetup__10____skipxhi
|
||||
|
||||
cpx #2
|
||||
jcc Kernel48Pixel__kernelsetup__6____skipxlo
|
||||
jcc Kernel48Pixel__kernelsetup__10____skipxlo
|
||||
|
||||
lda #14
|
||||
sta Kernel48Pixel__2__tmp+0 ; scanline counter
|
||||
@ -234,27 +234,27 @@ StaticKernel__kernel__5____each:
|
||||
sta VDELP0 ; we need the VDEL registers
|
||||
sta VDELP1 ; so we can do our 4-store trick
|
||||
|
||||
Kernel48Pixel__kernelsetup__6____skipxlo:
|
||||
Kernel48Pixel__kernelsetup__10____skipxlo:
|
||||
|
||||
Kernel48Pixel__kernelsetup__6____skipxhi:
|
||||
Kernel48Pixel__kernelsetup__10____skipxhi:
|
||||
|
||||
;;; end action Kernel48Pixel 2 kernelsetup
|
||||
|
||||
;;; start action Kernel48Pixel 2 kernelsetup
|
||||
|
||||
cpx #2+1
|
||||
jcs Kernel48Pixel__kernelsetup__7____skipxhi
|
||||
jcs Kernel48Pixel__kernelsetup__11____skipxhi
|
||||
|
||||
cpx #2
|
||||
jcc Kernel48Pixel__kernelsetup__7____skipxlo
|
||||
jcc Kernel48Pixel__kernelsetup__11____skipxlo
|
||||
|
||||
lda #252
|
||||
sta COLUP0
|
||||
sta COLUP1
|
||||
|
||||
Kernel48Pixel__kernelsetup__7____skipxlo:
|
||||
Kernel48Pixel__kernelsetup__11____skipxlo:
|
||||
|
||||
Kernel48Pixel__kernelsetup__7____skipxhi:
|
||||
Kernel48Pixel__kernelsetup__11____skipxhi:
|
||||
|
||||
;;; end action Kernel48Pixel 2 kernelsetup
|
||||
|
||||
@ -268,17 +268,17 @@ Kernel48Pixel__kernelsetup__7____skipxhi:
|
||||
;;; start action StaticKernel 3 kernelsetup
|
||||
|
||||
cpx #2+1
|
||||
jcs StaticKernel__kernelsetup__9____skipxhi
|
||||
jcs StaticKernel__kernelsetup__13____skipxhi
|
||||
|
||||
cpx #2
|
||||
jcc StaticKernel__kernelsetup__9____skipxlo
|
||||
jcc StaticKernel__kernelsetup__13____skipxlo
|
||||
|
||||
lda #252
|
||||
sta COLUPF
|
||||
|
||||
StaticKernel__kernelsetup__9____skipxlo:
|
||||
StaticKernel__kernelsetup__13____skipxlo:
|
||||
|
||||
StaticKernel__kernelsetup__9____skipxhi:
|
||||
StaticKernel__kernelsetup__13____skipxhi:
|
||||
|
||||
;;; end action StaticKernel 3 kernelsetup
|
||||
|
||||
@ -291,14 +291,14 @@ StaticKernel__kernelsetup__9____skipxhi:
|
||||
;;; start action Kernel48Pixel 2 kerneldraw
|
||||
|
||||
cpx #2+1
|
||||
jcs Kernel48Pixel__kerneldraw__10____skipxhi
|
||||
jcs Kernel48Pixel__kerneldraw__15____skipxhi
|
||||
|
||||
cpx #2
|
||||
jcc Kernel48Pixel__kerneldraw__10____skipxlo
|
||||
jcc Kernel48Pixel__kerneldraw__15____skipxlo
|
||||
|
||||
txa
|
||||
pha
|
||||
Kernel48Pixel__kerneldraw__10__Loop:
|
||||
Kernel48Pixel__kerneldraw__15__Loop:
|
||||
ldy Kernel48Pixel__2__tmp+0 ; counts backwards
|
||||
sta WSYNC ; sync to next scanline
|
||||
lda Bitmap48_bitmap0_e2_b0,y ; load B0 (1st sprite byte)
|
||||
@ -317,24 +317,24 @@ Kernel48Pixel__kerneldraw__10__Loop:
|
||||
sty GRP1 ; B5 -> [GRP1]; B4 -> GRP0
|
||||
sta GRP0 ; ?? -> [GRP0]; B5 -> GRP1
|
||||
dec Kernel48Pixel__2__tmp+0 ; go to next line
|
||||
bpl Kernel48Pixel__kerneldraw__10__Loop ; repeat until < 0
|
||||
bpl Kernel48Pixel__kerneldraw__15__Loop ; repeat until < 0
|
||||
pla
|
||||
tax
|
||||
|
||||
Kernel48Pixel__kerneldraw__10____skipxlo:
|
||||
Kernel48Pixel__kerneldraw__15____skipxlo:
|
||||
|
||||
Kernel48Pixel__kerneldraw__10____skipxhi:
|
||||
Kernel48Pixel__kerneldraw__15____skipxhi:
|
||||
|
||||
;;; end action Kernel48Pixel 2 kerneldraw
|
||||
|
||||
;;; start action StaticKernel 3 kerneldraw
|
||||
|
||||
ldy KernelSection_lines_b0,x
|
||||
StaticKernel__kerneldraw__11__loop:
|
||||
StaticKernel__kerneldraw__16__loop:
|
||||
sta WSYNC
|
||||
|
||||
dey
|
||||
bne StaticKernel__kerneldraw__11__loop
|
||||
bne StaticKernel__kerneldraw__16__loop
|
||||
|
||||
;;; end action StaticKernel 3 kerneldraw
|
||||
|
||||
@ -342,8 +342,8 @@ StaticKernel__kerneldraw__11__loop:
|
||||
|
||||
inx
|
||||
cpx #5
|
||||
jne StaticKernel__kernel__5____each
|
||||
StaticKernel__kernel__5____exit:
|
||||
jne StaticKernel__kernel__9____each
|
||||
StaticKernel__kernel__9____exit:
|
||||
|
||||
;;; end action StaticKernel 3 kernel
|
||||
|
||||
|
@ -97,7 +97,7 @@ FrameLoop__start__2__NextFrame:
|
||||
;;; start action StaticKernel 4 kernel
|
||||
|
||||
ldx #0
|
||||
StaticKernel__kernel__5____each:
|
||||
StaticKernel__kernel__7____each:
|
||||
|
||||
sta WSYNC
|
||||
.code
|
||||
@ -112,24 +112,24 @@ StaticKernel__kernel__5____each:
|
||||
;;; start action StaticKernel 4 kernelsetup
|
||||
|
||||
cpx #5+2
|
||||
jcs StaticKernel__kernelsetup__7____skipxhi
|
||||
jcs StaticKernel__kernelsetup__9____skipxhi
|
||||
|
||||
cpx #5
|
||||
jcc StaticKernel__kernelsetup__7____skipxlo
|
||||
jcc StaticKernel__kernelsetup__9____skipxlo
|
||||
|
||||
lda PFColor_pfcolor_b0-5,x
|
||||
sta COLUPF
|
||||
|
||||
StaticKernel__kernelsetup__7____skipxlo:
|
||||
StaticKernel__kernelsetup__9____skipxlo:
|
||||
|
||||
StaticKernel__kernelsetup__7____skipxhi:
|
||||
StaticKernel__kernelsetup__9____skipxhi:
|
||||
|
||||
;;; end action StaticKernel 4 kernelsetup
|
||||
|
||||
;;; start action StaticKernel 4 kernelsetup
|
||||
|
||||
cpx #4
|
||||
jcc StaticKernel__kernelsetup__8____skipxlo
|
||||
jcc StaticKernel__kernelsetup__10____skipxlo
|
||||
|
||||
lda Playfield_pf_b0-4,x
|
||||
sta PF0
|
||||
@ -138,22 +138,22 @@ StaticKernel__kernelsetup__7____skipxhi:
|
||||
lda Playfield_pf_b16-4,x
|
||||
sta PF2
|
||||
|
||||
StaticKernel__kernelsetup__8____skipxlo:
|
||||
StaticKernel__kernelsetup__10____skipxlo:
|
||||
|
||||
;;; end action StaticKernel 4 kernelsetup
|
||||
|
||||
ldy KernelSection_lines_b0,x
|
||||
StaticKernel__kernel__5__loop:
|
||||
StaticKernel__kernel__7__loop:
|
||||
sta WSYNC
|
||||
|
||||
dey
|
||||
bne StaticKernel__kernel__5__loop
|
||||
bne StaticKernel__kernel__7__loop
|
||||
|
||||
|
||||
inx
|
||||
cpx #8
|
||||
jne StaticKernel__kernel__5____each
|
||||
StaticKernel__kernel__5____exit:
|
||||
jne StaticKernel__kernel__7____each
|
||||
StaticKernel__kernel__7____exit:
|
||||
|
||||
;;; end action StaticKernel 4 kernel
|
||||
|
||||
@ -163,7 +163,7 @@ StaticKernel__kernel__5____exit:
|
||||
;;; start action JoyButton 5 postframe
|
||||
|
||||
lda INPT4 ;read button input
|
||||
bmi JoyButton__postframe__9__NotPressed
|
||||
bmi JoyButton__postframe__11__NotPressed
|
||||
.code
|
||||
|
||||
;;; start action Local 6 joybutton
|
||||
@ -173,7 +173,7 @@ StaticKernel__kernel__5____exit:
|
||||
|
||||
;;; end action Local 6 joybutton
|
||||
|
||||
JoyButton__postframe__9__NotPressed:
|
||||
JoyButton__postframe__11__NotPressed:
|
||||
|
||||
;;; end action JoyButton 5 postframe
|
||||
|
||||
@ -183,7 +183,7 @@ JoyButton__postframe__9__NotPressed:
|
||||
;;; start action ResetSwitch 2 nextframe
|
||||
|
||||
lsr SWCHB ; test Game Reset switch
|
||||
bcs ResetSwitch__nextframe__11__NoStart
|
||||
bcs ResetSwitch__nextframe__13__NoStart
|
||||
.code
|
||||
|
||||
;;; start action ResetConsole 3 resetswitch
|
||||
@ -192,7 +192,7 @@ JoyButton__postframe__9__NotPressed:
|
||||
|
||||
;;; end action ResetConsole 3 resetswitch
|
||||
|
||||
ResetSwitch__nextframe__11__NoStart:
|
||||
ResetSwitch__nextframe__13__NoStart:
|
||||
|
||||
;;; end action ResetSwitch 2 nextframe
|
||||
|
||||
|
@ -98,7 +98,7 @@ FrameLoop__start__2__NextFrame:
|
||||
;;; start action StaticKernel 4 kernel
|
||||
|
||||
ldx #0
|
||||
StaticKernel__kernel__5____each:
|
||||
StaticKernel__kernel__7____each:
|
||||
|
||||
sta WSYNC
|
||||
.code
|
||||
@ -113,24 +113,24 @@ StaticKernel__kernel__5____each:
|
||||
;;; start action StaticKernel 4 kernelsetup
|
||||
|
||||
cpx #5+2
|
||||
jcs StaticKernel__kernelsetup__7____skipxhi
|
||||
jcs StaticKernel__kernelsetup__9____skipxhi
|
||||
|
||||
cpx #5
|
||||
jcc StaticKernel__kernelsetup__7____skipxlo
|
||||
jcc StaticKernel__kernelsetup__9____skipxlo
|
||||
|
||||
lda PFColor_pfcolor_b0-5,x
|
||||
sta COLUPF
|
||||
|
||||
StaticKernel__kernelsetup__7____skipxlo:
|
||||
StaticKernel__kernelsetup__9____skipxlo:
|
||||
|
||||
StaticKernel__kernelsetup__7____skipxhi:
|
||||
StaticKernel__kernelsetup__9____skipxhi:
|
||||
|
||||
;;; end action StaticKernel 4 kernelsetup
|
||||
|
||||
;;; start action StaticKernel 4 kernelsetup
|
||||
|
||||
cpx #4
|
||||
jcc StaticKernel__kernelsetup__8____skipxlo
|
||||
jcc StaticKernel__kernelsetup__10____skipxlo
|
||||
|
||||
lda Playfield_pf_b0-4,x
|
||||
sta PF0
|
||||
@ -139,7 +139,7 @@ StaticKernel__kernelsetup__7____skipxhi:
|
||||
lda Playfield_pf_b16-4,x
|
||||
sta PF2
|
||||
|
||||
StaticKernel__kernelsetup__8____skipxlo:
|
||||
StaticKernel__kernelsetup__10____skipxlo:
|
||||
|
||||
;;; end action StaticKernel 4 kernelsetup
|
||||
|
||||
@ -148,11 +148,11 @@ StaticKernel__kernelsetup__8____skipxlo:
|
||||
;;; start action StaticKernel 4 kerneldraw
|
||||
|
||||
ldy KernelSection_lines_b0,x
|
||||
StaticKernel__kerneldraw__9__loop:
|
||||
StaticKernel__kerneldraw__11__loop:
|
||||
sta WSYNC
|
||||
|
||||
dey
|
||||
bne StaticKernel__kerneldraw__9__loop
|
||||
bne StaticKernel__kerneldraw__11__loop
|
||||
|
||||
;;; end action StaticKernel 4 kerneldraw
|
||||
|
||||
@ -160,8 +160,8 @@ StaticKernel__kerneldraw__9__loop:
|
||||
|
||||
inx
|
||||
cpx #8
|
||||
jne StaticKernel__kernel__5____each
|
||||
StaticKernel__kernel__5____exit:
|
||||
jne StaticKernel__kernel__7____each
|
||||
StaticKernel__kernel__7____exit:
|
||||
|
||||
;;; end action StaticKernel 4 kernel
|
||||
|
||||
@ -171,7 +171,7 @@ StaticKernel__kernel__5____exit:
|
||||
;;; start action JoyButton 5 postframe
|
||||
|
||||
lda INPT4 ;read button input
|
||||
bmi JoyButton__postframe__10__NotPressed
|
||||
bmi JoyButton__postframe__12__NotPressed
|
||||
.code
|
||||
|
||||
;;; start action Local 6 joybutton
|
||||
@ -181,7 +181,7 @@ StaticKernel__kernel__5____exit:
|
||||
|
||||
;;; end action Local 6 joybutton
|
||||
|
||||
JoyButton__postframe__10__NotPressed:
|
||||
JoyButton__postframe__12__NotPressed:
|
||||
|
||||
;;; end action JoyButton 5 postframe
|
||||
|
||||
@ -191,7 +191,7 @@ JoyButton__postframe__10__NotPressed:
|
||||
;;; start action ResetSwitch 2 nextframe
|
||||
|
||||
lsr SWCHB ; test Game Reset switch
|
||||
bcs ResetSwitch__nextframe__12__NoStart
|
||||
bcs ResetSwitch__nextframe__14__NoStart
|
||||
.code
|
||||
|
||||
;;; start action ResetConsole 3 resetswitch
|
||||
@ -200,7 +200,7 @@ JoyButton__postframe__10__NotPressed:
|
||||
|
||||
;;; end action ResetConsole 3 resetswitch
|
||||
|
||||
ResetSwitch__nextframe__12__NoStart:
|
||||
ResetSwitch__nextframe__14__NoStart:
|
||||
|
||||
;;; end action ResetSwitch 2 nextframe
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user