1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-11-24 12:31:25 +00:00

ecs: better subroutine finding

This commit is contained in:
Steven Hugg 2022-02-23 08:43:19 -06:00
parent f7099b8e8f
commit 5afd3cf498
9 changed files with 470 additions and 437 deletions

View File

@ -623,6 +623,7 @@ class ActionEval {
entities : Entity[];
tmplabel = '';
label : string;
seq : number;
//used = new Set<string>(); // TODO
constructor(
@ -655,7 +656,8 @@ 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++}`;
this.seq = this.em.seq++;
this.label = `${this.instance.system.name}__${action.event}__${this.seq}`;
}
begin() {
let state = this.scope.state = Object.assign(new ActionCPUState(), this.scope.state);
@ -1048,7 +1050,7 @@ class ActionEval {
isSubroutineSized(code: string) {
// TODO?
if (code.length > 20000) return false;
if (code.split('.dbg line').length >= 4) return true;
if (code.split('\n ').length >= 4) return true; // TODO: :^/
return false;
}
}
@ -1057,10 +1059,10 @@ class EventCodeStats {
constructor(
public readonly inst: SystemInstance,
public readonly action: Action,
public readonly code: string,
public readonly symbol: string,
public readonly eventcode: string
) { }
count = 0;
labels : string[] = [];
count : number = 0;
}
export class EntityScope implements SourceLocated {
@ -1080,7 +1082,7 @@ export class EntityScope implements SourceLocated {
filePath = '';
eventSeq : number;
eventStats : { [key:string] : EventCodeStats };
eventCodeStats : { [code:string] : EventCodeStats };
inCritical = 0;
constructor(
@ -1402,19 +1404,21 @@ export class EntityScope implements SourceLocated {
let eventcode = codeeval.codeToString();
if (action.critical) this.inCritical--;
if (!this.inCritical && codeeval.isSubroutineSized(eventcode)) {
let normcode = this.normalizeCode(eventcode, action);
// TODO: label rewriting messes this up
let estats = this.eventStats[eventcode];
let estats = this.eventCodeStats[normcode];
if (!estats) {
estats = this.eventStats[eventcode] = new EventCodeStats(
inst, action, eventcode, codeeval.label);
estats = this.eventCodeStats[normcode] = new EventCodeStats(
inst, action, eventcode);
}
estats.labels.push(codeeval.label);
estats.count++;
if (action.critical) estats.count++; // always make critical event subroutines
}
let s = '';
s += this.dialect.comment(`start action ${sys.name} ${inst.id} ${event}`); // TODO
s += this.dialect.comment(`start action ${codeeval.label}`);
s += eventcode;
s += this.dialect.comment(`end action ${sys.name} ${inst.id} ${event}`);
s += this.dialect.comment(`end action ${codeeval.label}`);
code += s;
// TODO: check that this happens once?
codeeval.end();
@ -1426,6 +1430,11 @@ export class EntityScope implements SourceLocated {
}
return code;
}
normalizeCode(code: string, action: Action) {
// TODO: use dialect to help with this
code = code.replace(/(\w+__\w+__)(\d+)(\w+)/g, (z,a,b,c) => a+c);
return code;
}
getSystemStats(inst: SystemInstance) : SystemStats {
let stats = this.sysstats.get(inst);
if (!stats) {
@ -1489,7 +1498,7 @@ export class EntityScope implements SourceLocated {
}
private generateCode() {
this.eventSeq = 0;
this.eventStats = {};
this.eventCodeStats = {};
let isMainScope = this.parent == null;
let start;
let initsys = this.em.getSystemByName('Init');
@ -1517,7 +1526,7 @@ export class EntityScope implements SourceLocated {
// TODO: doesn't work with nested subroutines?
// TODO: doesn't work between scopes
let allsubs : string[] = [];
for (let stats of Object.values(this.eventStats)) {
for (let stats of Object.values(this.eventCodeStats)) {
if (stats.count > 1) {
if (allsubs.length == 0) {
allsubs = [
@ -1527,12 +1536,22 @@ export class EntityScope implements SourceLocated {
} else if (stats.action.fitbytes) {
allsubs.push(this.dialect.alignIfLessThan(stats.action.fitbytes));
}
code = (code as any).replaceAll(stats.code, this.dialect.call(stats.symbol));
let substart = stats.symbol;
let subcall = this.dialect.call(stats.labels[0]);
for (let label of stats.labels) {
// TODO: use dialect
let startdelim = `;;; start action ${label}`
let enddelim = `;;; end action ${label}`
let istart = code.indexOf(startdelim);
let iend = code.indexOf(enddelim, istart);
if (istart >= 0 && iend > istart) {
code = code.substring(0, istart) + subcall + code.substring(iend + enddelim.length);
}
}
let substart = stats.labels[0];
let sublines = [
this.dialect.segment('rodata'),
this.dialect.label(substart),
stats.code,
stats.eventcode,
this.dialect.return(),
];
if (stats.action.critical) {

View File

@ -19,7 +19,7 @@ __Start:
dey
bne :-
;;; start action move 1 start
;;; start action move__start__1
ldx #0
move__start__1____each:
@ -31,7 +31,7 @@ move__start__1____each:
jne move__start__1____each
move__start__1____exit:
;;; end action move 1 start
;;; end action move__start__1
.endscope
Main__Start = Main::__Start

View File

@ -49,7 +49,7 @@ Main__INITDATA:
.byte 86
__Start:
;;; start action Init 9 main_init
;;; start action Init__main_init__1
.include "vcs-ca65.h"
.macpack longbranch
@ -65,12 +65,12 @@ __BRK:
dey
bne :-
;;; start action FrameLoop 1 start
;;; start action FrameLoop__start__2
FrameLoop__start__2__NextFrame:
FRAME_START
;;; start action Kernel6Digit 2 preframe
;;; start action Kernel6Digit__preframe__3
Digit0 = Kernel6Digit__2__tmp+0
Digit1 = Kernel6Digit__2__tmp+2
@ -118,11 +118,11 @@ Kernel6Digit__preframe__3__Loop:
dey ; next BCD value
bpl Kernel6Digit__preframe__3__Loop ; repeat until < 0
;;; end action Kernel6Digit 2 preframe
;;; end action Kernel6Digit__preframe__3
KERNEL_START
;;; start action Kernel6Digit 2 kernel
;;; start action Kernel6Digit__kernel__4
lda PFColor_pfcolor_b0
sta COLUP0
@ -146,9 +146,9 @@ Kernel6Digit__preframe__3__Loop:
sta VDELP0
sta VDELP1
;;; end action Kernel6Digit 2 kernel
;;; end action Kernel6Digit__kernel__4
;;; start action Kernel6Digit 2 kernel
;;; start action Kernel6Digit__kernel__5
; Display the resulting 48x8 bitmap
; using the Digit0-5 pointers.
@ -191,9 +191,9 @@ Kernel6Digit__kernel__5__BigLoop:
sta GRP1
sta COLUBK
;;; end action Kernel6Digit 2 kernel
;;; end action Kernel6Digit__kernel__5
;;; start action Kernel2Digit 4 kernel
;;; start action Kernel2Digit__kernel__6
lda #$02
sta CTRLPF
@ -204,9 +204,9 @@ Kernel6Digit__kernel__5__BigLoop:
lda PFColor_pfcolor_b0+1
sta COLUP1
;;; end action Kernel2Digit 4 kernel
;;; end action Kernel2Digit__kernel__6
;;; start action Kernel2Digit 4 kernel
;;; start action Kernel2Digit__kernel__7
lda #7
sta Kernel2Digit__4__tmp+0
@ -214,7 +214,7 @@ Kernel2Digit__kernel__7__Loop:
ldx #0
sta WSYNC
;;; start action Kernel2Digit 4 compute2digit
;;; start action Kernel2Digit__compute2digit__8
lda Kernel2Digit__4__tmp+1 ; load 1st pf
sta PF1 ; store 1st pf
@ -226,14 +226,14 @@ Kernel2Digit__kernel__7__Loop:
asl
asl
;;; start action Kernel2Digit 4 fetchdigit
;;; start action Kernel2Digit__fetchdigit__9
adc Kernel2Digit__4__tmp+0
tay
; TODO: select your own?
lda FontTablePF,y
;;; end action Kernel2Digit 4 fetchdigit
;;; end action Kernel2Digit__fetchdigit__9
and #$0f
ldy Kernel2Digit__4__tmp+2 ; load 2nd pf
@ -244,24 +244,24 @@ Kernel2Digit__kernel__7__Loop:
lsr
sty PF1 ; store 2nd pf
;;; start action Kernel2Digit 4 fetchdigit
;;; start action Kernel2Digit__fetchdigit__10
adc Kernel2Digit__4__tmp+0
tay
; TODO: select your own?
lda FontTablePF,y
;;; end action Kernel2Digit 4 fetchdigit
;;; end action Kernel2Digit__fetchdigit__10
and #$f0
ora Kernel2Digit__4__tmp+1 + 0
sta Kernel2Digit__4__tmp+1 + 0
;;; end action Kernel2Digit 4 compute2digit
;;; end action Kernel2Digit__compute2digit__8
inx
;;; start action Kernel2Digit 4 compute2digit
;;; start action Kernel2Digit__compute2digit__11
lda Kernel2Digit__4__tmp+1 ; load 1st pf
sta PF1 ; store 1st pf
@ -273,14 +273,14 @@ Kernel2Digit__kernel__7__Loop:
asl
asl
;;; start action Kernel2Digit 4 fetchdigit
;;; start action Kernel2Digit__fetchdigit__12
adc Kernel2Digit__4__tmp+0
tay
; TODO: select your own?
lda FontTablePF,y
;;; end action Kernel2Digit 4 fetchdigit
;;; end action Kernel2Digit__fetchdigit__12
and #$0f
ldy Kernel2Digit__4__tmp+2 ; load 2nd pf
@ -291,20 +291,20 @@ Kernel2Digit__kernel__7__Loop:
lsr
sty PF1 ; store 2nd pf
;;; start action Kernel2Digit 4 fetchdigit
;;; start action Kernel2Digit__fetchdigit__13
adc Kernel2Digit__4__tmp+0
tay
; TODO: select your own?
lda FontTablePF,y
;;; end action Kernel2Digit 4 fetchdigit
;;; end action Kernel2Digit__fetchdigit__13
and #$f0
ora Kernel2Digit__4__tmp+1 + 1
sta Kernel2Digit__4__tmp+1 + 1
;;; end action Kernel2Digit 4 compute2digit
;;; end action Kernel2Digit__compute2digit__11
; playfield
dec Kernel2Digit__4__tmp+0
@ -312,19 +312,19 @@ Kernel2Digit__kernel__7__Loop:
; dex
; stx PF1
;;; end action Kernel2Digit 4 kernel
;;; end action Kernel2Digit__kernel__7
KERNEL_END
;;; start action JoyButton 6 postframe
;;; start action JoyButton__postframe__14
lda INPT4 ;read button input
bmi JoyButton__postframe__14__NotPressed
;;; start action IncScore 8 joybutton
;;; start action IncScore__joybutton__15
;;; start action BCDMath 7 AddBCD4
;;; start action BCDMath__AddBCD4__16
.ifnblank $0210
lda #<$0210
@ -345,20 +345,20 @@ Kernel2Digit__kernel__7__Loop:
sta BCDScore6_digits_b16
cld ; exit BCD mode
;;; end action BCDMath 7 AddBCD4
;;; end action BCDMath__AddBCD4__16
;;; end action IncScore 8 joybutton
;;; end action IncScore__joybutton__15
JoyButton__postframe__14__NotPressed:
;;; end action JoyButton 6 postframe
;;; end action JoyButton__postframe__14
FRAME_END
jmp FrameLoop__start__2__NextFrame ; loop to next frame
;;; end action FrameLoop 1 start
;;; end action FrameLoop__start__2
; start main routine
.segment "VECTORS"
Return: .word $6060
@ -366,11 +366,11 @@ VecNMI:
VecReset: .word Main::__Reset
VecBRK: .word Main::__BRK
;;; end action Init 9 main_init
;;; end action Init__main_init__1
FontTable:
;;; start action FontTable 3 FontTable
;;; start action FontTable__FontTable__17
; Font table for digits 0-9 (8x8 pixels)
;;{w:8,h:8,count:10,brev:1,flip:1};;
@ -380,11 +380,11 @@ FontTable:
.byte $00,$3c,$66,$66,$7c,$60,$66,$3c,$00,$18,$18,$18,$18,$0c,$66,$7e
.byte $00,$3c,$66,$66,$3c,$66,$66,$3c,$00,$3c,$66,$06,$3e,$66,$66,$3c
;;; end action FontTable 3 FontTable
;;; end action FontTable__FontTable__17
FontTablePF:
;;; start action FontTablePF 5 FontTablePF
;;; start action FontTablePF__FontTablePF__18
; Font table for digits 0-9 (4x8 pixels)
;;{w:8,h:8,count:10,brev:1,flip:1};;
@ -400,7 +400,7 @@ FontTablePF:
.byte $00,$00,$EE,$22,$EE,$AA,$EE,$00
;;
;;; end action FontTablePF 5 FontTablePF
;;; end action FontTablePF__FontTablePF__18
.endscope
Main__Start = Main::__Start

View File

@ -116,7 +116,7 @@ Main__INITDATA:
.byte 3
__Start:
;;; start action Init 10 main_init
;;; start action Init__main_init__1
.include "vcs-ca65.h"
.macpack longbranch
@ -132,12 +132,12 @@ __BRK:
dey
bne :-
;;; start action FrameLoop 1 start
;;; start action FrameLoop__start__2
FrameLoop__start__2__NextFrame:
FRAME_START
;;; start action Kernel2Sprite 2 preframe
;;; start action Kernel2Sprite__preframe__3
.define KLINES #192
.define KPAD 32
@ -152,9 +152,9 @@ FrameLoop__start__2__NextFrame:
sta Kernel2Sprite__2__tmp+6
sta Kernel2Sprite__2__tmp+7
;;; end action Kernel2Sprite 2 preframe
;;; end action Kernel2Sprite__preframe__3
;;; start action Kernel2Sprite 2 preframe
;;; start action Kernel2Sprite__preframe__4
ldy #0
Kernel2Sprite__preframe__4____each:
@ -208,9 +208,9 @@ Kernel2Sprite__preframe__4__nosprite:
jne Kernel2Sprite__preframe__4____each
Kernel2Sprite__preframe__4____exit:
;;; end action Kernel2Sprite 2 preframe
;;; end action Kernel2Sprite__preframe__4
;;; start action Kernel2Sprite 2 preframe
;;; start action Kernel2Sprite__preframe__5
; shuffle pointers into (MSB, LSB) byte order
; L0 L1 H0 H1 -> L0 H0 L1 H1
@ -223,26 +223,26 @@ Kernel2Sprite__preframe__4____exit:
sty Kernel2Sprite__2__tmp+5
sta Kernel2Sprite__2__tmp+6
;;; end action Kernel2Sprite 2 preframe
;;; end action Kernel2Sprite__preframe__5
;;; start action Kernel2Sprite 2 preframe
;;; start action Kernel2Sprite__preframe__6
lda #162
sta COLUBK
;;; end action Kernel2Sprite 2 preframe
;;; end action Kernel2Sprite__preframe__6
;;; start action Kernel2Sprite 2 preframe
;;; start action Kernel2Sprite__preframe__7
;;; end action Kernel2Sprite 2 preframe
;;; end action Kernel2Sprite__preframe__7
;;; start action SetXPos 6 preframe
;;; start action SetXPos__preframe__8
sta HMCLR
;;; end action SetXPos 6 preframe
;;; end action SetXPos__preframe__8
;;; start action SetXPos 6 preframe
;;; start action SetXPos__preframe__9
ldy #0
SetXPos__preframe__9____each:
@ -250,7 +250,7 @@ SetXPos__preframe__9____each:
lda HasXpos_xpos_b0,x
;;; start action SetHorizPos 7 SetHorizPos
;;; start action SetHorizPos__SetHorizPos__10
; SetHorizPos routine
; A = X coordinate
@ -269,7 +269,7 @@ SetHorizPos__SetHorizPos__10__DivideLoop:
sta RESP0,y ; fix coarse position
sta HMP0,y ; set fine offset
;;; end action SetHorizPos 7 SetHorizPos
;;; end action SetHorizPos__SetHorizPos__10
iny
@ -277,36 +277,36 @@ SetHorizPos__SetHorizPos__10__DivideLoop:
jne SetXPos__preframe__9____each
SetXPos__preframe__9____exit:
;;; end action SetXPos 6 preframe
;;; end action SetXPos__preframe__9
;;; start action SetXPos 6 preframe
;;; start action SetXPos__preframe__11
;;; end action SetXPos 6 preframe
;;; end action SetXPos__preframe__11
;;; start action SetXPos 6 preframe
;;; start action SetXPos__preframe__12
sta WSYNC
sta HMOVE
;;; end action SetXPos 6 preframe
;;; end action SetXPos__preframe__12
KERNEL_START
;;; start action Kernel2Sprite 2 kernel
;;; start action Kernel2Sprite__kernel__13
ldy #0
sty VDELP0
iny
sta VDELP1
;;; end action Kernel2Sprite 2 kernel
;;; end action Kernel2Sprite__kernel__13
;;; start action Kernel2Sprite 2 kernel
;;; start action Kernel2Sprite__kernel__14
ldy #192
Kernel2Sprite__kernel__14__LVScan:
;;; start action Kernel2Sprite 2 scanline
;;; start action Kernel2Sprite__scanline__15
; draw player 0
lda Kernel2Sprite__2__tmp+8 ; height
@ -334,15 +334,15 @@ Kernel2Sprite__scanline__15__DoDraw2:
lda (Kernel2Sprite__2__tmp+6),y
sta COLUP1
;;; end action Kernel2Sprite 2 scanline
;;; end action Kernel2Sprite__scanline__15
;;; start action Kernel2Sprite 2 scanline
;;; start action Kernel2Sprite__scanline__16
;;; end action Kernel2Sprite 2 scanline
;;; end action Kernel2Sprite__scanline__16
dey ; next scanline
;;; start action Kernel2Sprite 2 scanline
;;; start action Kernel2Sprite__scanline__17
; draw player 0
lda Kernel2Sprite__2__tmp+8 ; height
@ -370,18 +370,18 @@ Kernel2Sprite__scanline__17__DoDraw2:
lda (Kernel2Sprite__2__tmp+6),y
sta COLUP1
;;; end action Kernel2Sprite 2 scanline
;;; end action Kernel2Sprite__scanline__17
;;; start action Kernel2Sprite 2 scanline
;;; start action Kernel2Sprite__scanline__18
;;; end action Kernel2Sprite 2 scanline
;;; end action Kernel2Sprite__scanline__18
dey ; next scanline
bne Kernel2Sprite__kernel__14__LVScan ; repeat until out of lines
;;; end action Kernel2Sprite 2 kernel
;;; end action Kernel2Sprite__kernel__14
;;; start action Kernel2Sprite 2 kernel
;;; start action Kernel2Sprite__kernel__19
lda #0
sta GRP0
@ -389,19 +389,19 @@ Kernel2Sprite__scanline__17__DoDraw2:
sta GRP0
sta GRP1
;;; end action Kernel2Sprite 2 kernel
;;; end action Kernel2Sprite__kernel__19
KERNEL_END
;;; start action Joystick 3 postframe
;;; start action Joystick__postframe__20
; 2 control inputs share a single byte, 4 bits each
lda SWCHA
sta Joystick__3__tmp+0
;;; end action Joystick 3 postframe
;;; end action Joystick__postframe__20
;;; start action Joystick 3 postframe
;;; start action Joystick__postframe__21
ldx #0
Joystick__postframe__21____each:
@ -409,7 +409,7 @@ Joystick__postframe__21____each:
asl Joystick__3__tmp+0
bcs Joystick__postframe__21__SkipMoveRight
;;; start action MoveJoyX 4 joyright
;;; start action MoveJoyX__joyright__22
lda HasXpos_xpos_b0,x
clc
@ -419,13 +419,13 @@ Joystick__postframe__21____each:
sta HasXpos_xpos_b0,x
MoveJoyX__joyright__22__nomove:
;;; end action MoveJoyX 4 joyright
;;; end action MoveJoyX__joyright__22
Joystick__postframe__21__SkipMoveRight:
asl Joystick__3__tmp+0
bcs Joystick__postframe__21__SkipMoveLeft
;;; start action MoveJoyX 4 joyleft
;;; start action MoveJoyX__joyleft__23
lda HasXpos_xpos_b0,x
sec
@ -434,13 +434,13 @@ Joystick__postframe__21__SkipMoveRight:
sta HasXpos_xpos_b0,x
MoveJoyX__joyleft__23__nomove:
;;; end action MoveJoyX 4 joyleft
;;; end action MoveJoyX__joyleft__23
Joystick__postframe__21__SkipMoveLeft:
asl Joystick__3__tmp+0
bcs Joystick__postframe__21__SkipMoveDown
;;; start action MoveJoyY 5 joydown
;;; start action MoveJoyY__joydown__24
lda HasYpos_ypos_b0,x
clc
@ -450,13 +450,13 @@ Joystick__postframe__21__SkipMoveLeft:
sta HasYpos_ypos_b0,x
MoveJoyY__joydown__24__nomove:
;;; end action MoveJoyY 5 joydown
;;; end action MoveJoyY__joydown__24
Joystick__postframe__21__SkipMoveDown:
asl Joystick__3__tmp+0
bcs Joystick__postframe__21__SkipMoveUp
;;; start action MoveJoyY 5 joyup
;;; start action MoveJoyY__joyup__25
lda HasYpos_ypos_b0,x
sec
@ -465,7 +465,7 @@ Joystick__postframe__21__SkipMoveDown:
sta HasYpos_ypos_b0,x
MoveJoyY__joyup__25__nomove:
;;; end action MoveJoyY 5 joyup
;;; end action MoveJoyY__joyup__25
Joystick__postframe__21__SkipMoveUp:
@ -474,9 +474,9 @@ Joystick__postframe__21__SkipMoveUp:
jne Joystick__postframe__21____each
Joystick__postframe__21____exit:
;;; end action Joystick 3 postframe
;;; end action Joystick__postframe__21
;;; start action SpriteShuffler 8 postframe
;;; start action SpriteShuffler__postframe__26
; load two sprite slots at left side of array
lda SpriteSlot_sprite_b0
@ -497,16 +497,16 @@ SpriteShuffler__postframe__26__loop:
lda SpriteShuffler__8__tmp+1
sta SpriteSlot_sprite_b0+4-1
;;; end action SpriteShuffler 8 postframe
;;; end action SpriteShuffler__postframe__26
;;; start action SpriteHider 9 postframe
;;; start action SpriteHider__postframe__27
lda #4-1
sta SpriteHider__9__tmp+0
;;; end action SpriteHider 9 postframe
;;; end action SpriteHider__postframe__27
;;; start action SpriteHider 9 postframe
;;; start action SpriteHider__postframe__28
ldy #0
SpriteHider__postframe__28____each:
@ -531,13 +531,13 @@ SpriteHider__postframe__28__skip:
jne SpriteHider__postframe__28____each
SpriteHider__postframe__28____exit:
;;; end action SpriteHider 9 postframe
;;; end action SpriteHider__postframe__28
FRAME_END
jmp FrameLoop__start__2__NextFrame ; loop to next frame
;;; end action FrameLoop 1 start
;;; end action FrameLoop__start__2
; start main routine
.segment "VECTORS"
Return: .word $6060
@ -545,7 +545,7 @@ VecNMI:
VecReset: .word Main::__Reset
VecBRK: .word Main::__BRK
;;; end action Init 10 main_init
;;; end action Init__main_init__1
.endscope
Main__Start = Main::__Start

View File

@ -116,7 +116,7 @@ Main__INITDATA:
.byte 0
__Start:
;;; start action Init 10 main_init
;;; start action Init__main_init__1
.include "vcs-ca65.h"
.macpack longbranch
@ -132,19 +132,19 @@ __BRK:
dey
bne :-
;;; start action FrameLoop 1 start
;;; start action FrameLoop__start__2
FrameLoop__start__2__NextFrame:
FRAME_START
;;; start action Kernel2Sprite 2 preframe
;;; start action Kernel2Sprite__preframe__3
.define KLINES #192
.define KPAD 32
;;; end action Kernel2Sprite 2 preframe
;;; end action Kernel2Sprite__preframe__3
;;; start action Kernel2Sprite 2 preframe
;;; start action Kernel2Sprite__preframe__4
ldy #0
Kernel2Sprite__preframe__4____each:
@ -194,9 +194,9 @@ Kernel2Sprite__preframe__4____each:
jne Kernel2Sprite__preframe__4____each
Kernel2Sprite__preframe__4____exit:
;;; end action Kernel2Sprite 2 preframe
;;; end action Kernel2Sprite__preframe__4
;;; start action Kernel2Sprite 2 preframe
;;; start action Kernel2Sprite__preframe__5
; L0 L1 H0 H1 -> L0 H0 L1 H1
lda Kernel2Sprite__2__tmp+1
@ -208,26 +208,26 @@ Kernel2Sprite__preframe__4____exit:
sty Kernel2Sprite__2__tmp+5
sta Kernel2Sprite__2__tmp+6
;;; end action Kernel2Sprite 2 preframe
;;; end action Kernel2Sprite__preframe__5
;;; start action Kernel2Sprite 2 preframe
;;; start action Kernel2Sprite__preframe__6
lda #162
sta COLUBK
;;; end action Kernel2Sprite 2 preframe
;;; end action Kernel2Sprite__preframe__6
;;; start action Kernel2Sprite 2 preframe
;;; start action Kernel2Sprite__preframe__7
;;; end action Kernel2Sprite 2 preframe
;;; end action Kernel2Sprite__preframe__7
;;; start action SetXPos 6 preframe
;;; start action SetXPos__preframe__8
sta HMCLR
;;; end action SetXPos 6 preframe
;;; end action SetXPos__preframe__8
;;; start action SetXPos 6 preframe
;;; start action SetXPos__preframe__9
ldy #0
SetXPos__preframe__9____each:
@ -235,7 +235,7 @@ SetXPos__preframe__9____each:
lda HasXpos_xpos_b0,x
;;; start action SetHorizPos 7 SetHorizPos
;;; start action SetHorizPos__SetHorizPos__10
; SetHorizPos routine
; A = X coordinate
@ -254,7 +254,7 @@ SetHorizPos__SetHorizPos__10__DivideLoop:
sta RESP0,y ; fix coarse position
sta HMP0,y ; set fine offset
;;; end action SetHorizPos 7 SetHorizPos
;;; end action SetHorizPos__SetHorizPos__10
iny
@ -262,31 +262,31 @@ SetHorizPos__SetHorizPos__10__DivideLoop:
jne SetXPos__preframe__9____each
SetXPos__preframe__9____exit:
;;; end action SetXPos 6 preframe
;;; end action SetXPos__preframe__9
;;; start action SetXPos 6 preframe
;;; start action SetXPos__preframe__11
;;; end action SetXPos 6 preframe
;;; end action SetXPos__preframe__11
;;; start action SetXPos 6 preframe
;;; start action SetXPos__preframe__12
sta WSYNC
sta HMOVE
;;; end action SetXPos 6 preframe
;;; end action SetXPos__preframe__12
KERNEL_START
;;; start action Kernel2Sprite 2 kernel
;;; start action Kernel2Sprite__kernel__13
ldy #0
sty VDELP0
iny
sta VDELP1
;;; end action Kernel2Sprite 2 kernel
;;; end action Kernel2Sprite__kernel__13
;;; start action Kernel2Sprite 2 kernel
;;; start action Kernel2Sprite__kernel__14
; define macro for each line
.macro Kernel2Sprite__kernel__14__DrawLine do_wsync
@ -322,9 +322,9 @@ DoDraw2:
ldy #192
Kernel2Sprite__kernel__14__LVScan:
;;; start action Kernel2Sprite 2 scanline1
;;; start action Kernel2Sprite__scanline1__15
;;; end action Kernel2Sprite 2 scanline1
;;; end action Kernel2Sprite__scanline1__15
Kernel2Sprite__kernel__14__DrawLine 1 ; macro: draw scanline w/ WSYNC
dey ; next scanline
@ -333,9 +333,9 @@ Kernel2Sprite__kernel__14__LVScan:
dey ; next scanline
bne Kernel2Sprite__kernel__14__LVScan ; repeat until out of lines
;;; end action Kernel2Sprite 2 kernel
;;; end action Kernel2Sprite__kernel__14
;;; start action Kernel2Sprite 2 kernel
;;; start action Kernel2Sprite__kernel__16
lda #0
sta GRP0
@ -343,19 +343,19 @@ Kernel2Sprite__kernel__14__LVScan:
sta GRP0
sta GRP1
;;; end action Kernel2Sprite 2 kernel
;;; end action Kernel2Sprite__kernel__16
KERNEL_END
;;; start action Joystick 3 postframe
;;; start action Joystick__postframe__17
; 2 control inputs share a single byte, 4 bits each
lda SWCHA
sta Joystick__3__tmp+0
;;; end action Joystick 3 postframe
;;; end action Joystick__postframe__17
;;; start action Joystick 3 postframe
;;; start action Joystick__postframe__18
ldx #0
Joystick__postframe__18____each:
@ -363,7 +363,7 @@ Joystick__postframe__18____each:
asl Joystick__3__tmp+0
bcs Joystick__postframe__18__SkipMoveRight
;;; start action MoveJoyX 4 joyright
;;; start action MoveJoyX__joyright__19
lda HasXpos_xpos_b0,x
clc
@ -373,13 +373,13 @@ Joystick__postframe__18____each:
sta HasXpos_xpos_b0,x
MoveJoyX__joyright__19__nomove:
;;; end action MoveJoyX 4 joyright
;;; end action MoveJoyX__joyright__19
Joystick__postframe__18__SkipMoveRight:
asl Joystick__3__tmp+0
bcs Joystick__postframe__18__SkipMoveLeft
;;; start action MoveJoyX 4 joyleft
;;; start action MoveJoyX__joyleft__20
lda HasXpos_xpos_b0,x
sec
@ -388,13 +388,13 @@ Joystick__postframe__18__SkipMoveRight:
sta HasXpos_xpos_b0,x
MoveJoyX__joyleft__20__nomove:
;;; end action MoveJoyX 4 joyleft
;;; end action MoveJoyX__joyleft__20
Joystick__postframe__18__SkipMoveLeft:
asl Joystick__3__tmp+0
bcs Joystick__postframe__18__SkipMoveDown
;;; start action MoveJoyY 5 joydown
;;; start action MoveJoyY__joydown__21
lda HasYpos_ypos_b0,x
clc
@ -404,13 +404,13 @@ Joystick__postframe__18__SkipMoveLeft:
sta HasYpos_ypos_b0,x
MoveJoyY__joydown__21__nomove:
;;; end action MoveJoyY 5 joydown
;;; end action MoveJoyY__joydown__21
Joystick__postframe__18__SkipMoveDown:
asl Joystick__3__tmp+0
bcs Joystick__postframe__18__SkipMoveUp
;;; start action MoveJoyY 5 joyup
;;; start action MoveJoyY__joyup__22
lda HasYpos_ypos_b0,x
sec
@ -419,7 +419,7 @@ Joystick__postframe__18__SkipMoveDown:
sta HasYpos_ypos_b0,x
MoveJoyY__joyup__22__nomove:
;;; end action MoveJoyY 5 joyup
;;; end action MoveJoyY__joyup__22
Joystick__postframe__18__SkipMoveUp:
@ -428,9 +428,9 @@ Joystick__postframe__18__SkipMoveUp:
jne Joystick__postframe__18____each
Joystick__postframe__18____exit:
;;; end action Joystick 3 postframe
;;; end action Joystick__postframe__18
;;; start action SpriteShuffler 8 postframe
;;; start action SpriteShuffler__postframe__23
; load two sprite slots at left side of array
lda SpriteSlot_sprite_b0
@ -451,16 +451,16 @@ SpriteShuffler__postframe__23__loop:
lda SpriteShuffler__8__tmp+1
sta SpriteSlot_sprite_b0+4-1
;;; end action SpriteShuffler 8 postframe
;;; end action SpriteShuffler__postframe__23
;;; start action SpriteHider 9 postframe
;;; start action SpriteHider__postframe__24
lda #4-1
sta SpriteHider__9__tmp+0
;;; end action SpriteHider 9 postframe
;;; end action SpriteHider__postframe__24
;;; start action SpriteHider 9 postframe
;;; start action SpriteHider__postframe__25
ldy #0
SpriteHider__postframe__25____each:
@ -485,13 +485,13 @@ SpriteHider__postframe__25__skip:
jne SpriteHider__postframe__25____each
SpriteHider__postframe__25____exit:
;;; end action SpriteHider 9 postframe
;;; end action SpriteHider__postframe__25
FRAME_END
jmp FrameLoop__start__2__NextFrame ; loop to next frame
;;; end action FrameLoop 1 start
;;; end action FrameLoop__start__2
; start main routine
.segment "VECTORS"
Return: .word $6060
@ -499,7 +499,7 @@ VecNMI:
VecReset: .word Main::__Reset
VecBRK: .word Main::__BRK
;;; end action Init 10 main_init
;;; end action Init__main_init__1
.endscope
Main__Start = Main::__Start

View File

@ -628,7 +628,7 @@ Main__INITDATA:
.byte 0
__Start:
;;; start action Init 11 main_init
;;; start action Init__main_init__1
.include "vcs-ca65.h"
.macpack longbranch
@ -644,12 +644,12 @@ __BRK:
dey
bne :-
;;; start action FrameLoop 1 start
;;; start action FrameLoop__start__2
FrameLoop__start__2__NextFrame:
FRAME_START
;;; start action Kernel2Sprite 2 preframe
;;; start action Kernel2Sprite__preframe__3
.define KLINES #192
.define KPAD 32
@ -664,9 +664,9 @@ FrameLoop__start__2__NextFrame:
sta Kernel2Sprite__2__tmp+6
sta Kernel2Sprite__2__tmp+7
;;; end action Kernel2Sprite 2 preframe
;;; end action Kernel2Sprite__preframe__3
;;; start action Kernel2Sprite 2 preframe
;;; start action Kernel2Sprite__preframe__4
ldy #0
Kernel2Sprite__preframe__4____each:
@ -720,9 +720,9 @@ Kernel2Sprite__preframe__4__nosprite:
jne Kernel2Sprite__preframe__4____each
Kernel2Sprite__preframe__4____exit:
;;; end action Kernel2Sprite 2 preframe
;;; end action Kernel2Sprite__preframe__4
;;; start action Kernel2Sprite 2 preframe
;;; start action Kernel2Sprite__preframe__5
; shuffle pointers into (MSB, LSB) byte order
; L0 L1 H0 H1 -> L0 H0 L1 H1
@ -735,26 +735,26 @@ Kernel2Sprite__preframe__4____exit:
sty Kernel2Sprite__2__tmp+5
sta Kernel2Sprite__2__tmp+6
;;; end action Kernel2Sprite 2 preframe
;;; end action Kernel2Sprite__preframe__5
;;; start action Kernel2Sprite 2 preframe
;;; start action Kernel2Sprite__preframe__6
lda #162
sta COLUBK
;;; end action Kernel2Sprite 2 preframe
;;; end action Kernel2Sprite__preframe__6
;;; start action Kernel2Sprite 2 preframe
;;; start action Kernel2Sprite__preframe__7
;;; end action Kernel2Sprite 2 preframe
;;; end action Kernel2Sprite__preframe__7
;;; start action SetXPos 8 preframe
;;; start action SetXPos__preframe__8
sta HMCLR
;;; end action SetXPos 8 preframe
;;; end action SetXPos__preframe__8
;;; start action SetXPos 8 preframe
;;; start action SetXPos__preframe__9
ldy #0
SetXPos__preframe__9____each:
@ -762,7 +762,7 @@ SetXPos__preframe__9____each:
lda HasXpos_xpos_b0,x
;;; start action SetHorizPos 9 SetHorizPos
;;; start action SetHorizPos__SetHorizPos__10
; SetHorizPos routine
; A = X coordinate
@ -781,7 +781,7 @@ SetHorizPos__SetHorizPos__10__DivideLoop:
sta RESP0,y ; fix coarse position
sta HMP0,y ; set fine offset
;;; end action SetHorizPos 9 SetHorizPos
;;; end action SetHorizPos__SetHorizPos__10
iny
@ -789,20 +789,20 @@ SetHorizPos__SetHorizPos__10__DivideLoop:
jne SetXPos__preframe__9____each
SetXPos__preframe__9____exit:
;;; end action SetXPos 8 preframe
;;; end action SetXPos__preframe__9
;;; start action SetXPos 8 preframe
;;; start action SetXPos__preframe__11
;;; end action SetXPos 8 preframe
;;; end action SetXPos__preframe__11
;;; start action SetXPos 8 preframe
;;; start action SetXPos__preframe__12
sta WSYNC
sta HMOVE
;;; end action SetXPos 8 preframe
;;; end action SetXPos__preframe__12
;;; start action VersatilePlayfield 10 preframe
;;; start action VersatilePlayfield__preframe__13
ldx Location_room_b0+0
@ -812,25 +812,25 @@ SetXPos__preframe__9____exit:
sta VersatilePlayfield__10__tmp+1
;;; end action VersatilePlayfield 10 preframe
;;; end action VersatilePlayfield__preframe__13
KERNEL_START
;;; start action Kernel2Sprite 2 kernel
;;; start action Kernel2Sprite__kernel__14
ldy #0
sty VDELP0
iny
sta VDELP1
;;; end action Kernel2Sprite 2 kernel
;;; end action Kernel2Sprite__kernel__14
;;; start action Kernel2Sprite 2 kernel
;;; start action Kernel2Sprite__kernel__15
ldy #192
Kernel2Sprite__kernel__15__LVScan:
;;; start action Kernel2Sprite 2 scanline
;;; start action Kernel2Sprite__scanline__16
; draw player 0
lda Kernel2Sprite__2__tmp+8 ; height
@ -858,33 +858,33 @@ Kernel2Sprite__scanline__16__DoDraw2:
lda (Kernel2Sprite__2__tmp+6),y
sta COLUP1
;;; end action Kernel2Sprite 2 scanline
;;; end action Kernel2Sprite__scanline__16
;;; start action Kernel2Sprite 2 scanline
;;; start action Kernel2Sprite__scanline__17
;;; end action Kernel2Sprite 2 scanline
;;; end action Kernel2Sprite__scanline__17
;;; start action VersatilePlayfield 10 scanline
;;; start action VersatilePlayfield__scanline__18
.if 0 = 0
lda (VersatilePlayfield__10__tmp+0),y
tax
.endif
;;; end action VersatilePlayfield 10 scanline
;;; end action VersatilePlayfield__scanline__18
;;; start action VersatilePlayfield 10 scanline
;;; start action VersatilePlayfield__scanline__19
.if 0 = 1
lda (VersatilePlayfield__10__tmp+0),y
sta $00,x
.endif
;;; end action VersatilePlayfield 10 scanline
;;; end action VersatilePlayfield__scanline__19
dey ; next scanline
;;; start action Kernel2Sprite 2 scanline
;;; start action Kernel2Sprite__scanline__20
; draw player 0
lda Kernel2Sprite__2__tmp+8 ; height
@ -912,36 +912,36 @@ Kernel2Sprite__scanline__20__DoDraw2:
lda (Kernel2Sprite__2__tmp+6),y
sta COLUP1
;;; end action Kernel2Sprite 2 scanline
;;; end action Kernel2Sprite__scanline__20
;;; start action Kernel2Sprite 2 scanline
;;; start action Kernel2Sprite__scanline__21
;;; end action Kernel2Sprite 2 scanline
;;; end action Kernel2Sprite__scanline__21
;;; start action VersatilePlayfield 10 scanline
;;; start action VersatilePlayfield__scanline__22
.if 1 = 0
lda (VersatilePlayfield__10__tmp+0),y
tax
.endif
;;; end action VersatilePlayfield 10 scanline
;;; end action VersatilePlayfield__scanline__22
;;; start action VersatilePlayfield 10 scanline
;;; start action VersatilePlayfield__scanline__23
.if 1 = 1
lda (VersatilePlayfield__10__tmp+0),y
sta $00,x
.endif
;;; end action VersatilePlayfield 10 scanline
;;; end action VersatilePlayfield__scanline__23
dey ; next scanline
bne Kernel2Sprite__kernel__15__LVScan ; repeat until out of lines
;;; end action Kernel2Sprite 2 kernel
;;; end action Kernel2Sprite__kernel__15
;;; start action Kernel2Sprite 2 kernel
;;; start action Kernel2Sprite__kernel__24
lda #0
sta GRP0
@ -949,32 +949,32 @@ Kernel2Sprite__scanline__20__DoDraw2:
sta GRP0
sta GRP1
;;; end action Kernel2Sprite 2 kernel
;;; end action Kernel2Sprite__kernel__24
KERNEL_END
;;; start action Joystick 3 postframe
;;; start action Joystick__postframe__25
; 2 control inputs share a single byte, 4 bits each
lda SWCHA
sta Joystick__3__tmp+0
;;; end action Joystick 3 postframe
;;; end action Joystick__postframe__25
;;; start action Joystick 3 postframe
;;; start action Joystick__postframe__26
asl Joystick__3__tmp+0
bcs Joystick__postframe__26__SkipMoveRight
;;; start action JoyFaceDirection 4 joyright
;;; start action JoyFaceDirection__joyright__27
lda Sprite_plyrflags_b0
and #$f7
sta Sprite_plyrflags_b0
;;; end action JoyFaceDirection 4 joyright
;;; end action JoyFaceDirection__joyright__27
;;; start action SuperFly 5 joyright
;;; start action SuperFly__joyright__28
lda HasXpos_xpos_b0
clc
@ -982,58 +982,58 @@ Kernel2Sprite__scanline__20__DoDraw2:
cmp #142
jcc SuperFly__joyright__28__nomove
;;; start action SuperFly 5 goeast
;;; start action SuperFly__goeast__29
ldy Location_room_b0
lda Room_east_b0,y
sta Location_room_b0
;;; end action SuperFly 5 goeast
;;; end action SuperFly__goeast__29
lda #2
SuperFly__joyright__28__nomove:
sta HasXpos_xpos_b0
;;; end action SuperFly 5 joyright
;;; end action SuperFly__joyright__28
Joystick__postframe__26__SkipMoveRight:
asl Joystick__3__tmp+0
bcs Joystick__postframe__26__SkipMoveLeft
;;; start action JoyFaceDirection 4 joyleft
;;; start action JoyFaceDirection__joyleft__30
lda Sprite_plyrflags_b0
ora #$08
sta Sprite_plyrflags_b0
;;; end action JoyFaceDirection 4 joyleft
;;; end action JoyFaceDirection__joyleft__30
;;; start action SuperFly 5 joyleft
;;; start action SuperFly__joyleft__31
lda HasXpos_xpos_b0
sec
sbc #2
jcs SuperFly__joyleft__31__nomove
;;; start action SuperFly 5 gowest
;;; start action SuperFly__gowest__32
ldy Location_room_b0
lda Room_west_b0,y
sta Location_room_b0
;;; end action SuperFly 5 gowest
;;; end action SuperFly__gowest__32
lda #142
SuperFly__joyleft__31__nomove:
sta HasXpos_xpos_b0
;;; end action SuperFly 5 joyleft
;;; end action SuperFly__joyleft__31
Joystick__postframe__26__SkipMoveLeft:
asl Joystick__3__tmp+0
bcs Joystick__postframe__26__SkipMoveDown
;;; start action SuperFly 5 joydown
;;; start action SuperFly__joydown__33
lda HasYpos_ypos_b0
clc
@ -1041,64 +1041,64 @@ Joystick__postframe__26__SkipMoveLeft:
cmp #220
jcc SuperFly__joydown__33__nomove
;;; start action SuperFly 5 gosouth
;;; start action SuperFly__gosouth__34
ldy Location_room_b0
lda Room_south_b0,y
sta Location_room_b0
;;; end action SuperFly 5 gosouth
;;; end action SuperFly__gosouth__34
lda #2
SuperFly__joydown__33__nomove:
sta HasYpos_ypos_b0
;;; end action SuperFly 5 joydown
;;; end action SuperFly__joydown__33
Joystick__postframe__26__SkipMoveDown:
asl Joystick__3__tmp+0
bcs Joystick__postframe__26__SkipMoveUp
;;; start action SuperFly 5 joyup
;;; start action SuperFly__joyup__35
lda HasYpos_ypos_b0
sec
sbc #2
jcs SuperFly__joyup__35__nomove
;;; start action SuperFly 5 gonorth
;;; start action SuperFly__gonorth__36
ldy Location_room_b0
lda Room_north_b0,y
sta Location_room_b0
;;; end action SuperFly 5 gonorth
;;; end action SuperFly__gonorth__36
lda #200
SuperFly__joyup__35__nomove:
sta HasYpos_ypos_b0
;;; end action SuperFly 5 joyup
;;; end action SuperFly__joyup__35
Joystick__postframe__26__SkipMoveUp:
;;; end action Joystick 3 postframe
;;; end action Joystick__postframe__26
;;; start action BadMove 6 postframe
;;; start action BadMove__postframe__37
ldx #0
BadMove__postframe__37____each:
;;; start action JoyFaceDirection 4 joyright
;;; start action JoyFaceDirection__joyright__38
lda Sprite_plyrflags_b0+1,x
and #$f7
sta Sprite_plyrflags_b0+1,x
;;; end action JoyFaceDirection 4 joyright
;;; end action JoyFaceDirection__joyright__38
;;; start action SuperFly 5 joyright
;;; start action SuperFly__joyright__39
lda HasXpos_xpos_b0+1,x
clc
@ -1106,19 +1106,19 @@ BadMove__postframe__37____each:
cmp #142
jcc SuperFly__joyright__39__nomove
;;; start action SuperFly 5 goeast
;;; start action SuperFly__goeast__40
ldy Location_room_b0+1,x
lda Room_east_b0,y
sta Location_room_b0+1,x
;;; end action SuperFly 5 goeast
;;; end action SuperFly__goeast__40
lda #2
SuperFly__joyright__39__nomove:
sta HasXpos_xpos_b0+1,x
;;; end action SuperFly 5 joyright
;;; end action SuperFly__joyright__39
inx
@ -1126,9 +1126,9 @@ SuperFly__joyright__39__nomove:
jne BadMove__postframe__37____each
BadMove__postframe__37____exit:
;;; end action BadMove 6 postframe
;;; end action BadMove__postframe__37
;;; start action RoomShuffle 7 postframe
;;; start action RoomShuffle__postframe__41
ldy 4
ldx SpriteSlot_sprite_b0+1
@ -1150,22 +1150,22 @@ RoomShuffle__postframe__41__norecycle:
RoomShuffle__postframe__41__exit:
stx SpriteSlot_sprite_b0+1
;;; end action RoomShuffle 7 postframe
;;; end action RoomShuffle__postframe__41
;;; start action VersatilePlayfield 10 postframe
;;; start action VersatilePlayfield__postframe__42
lda #0
sta PF0
sta PF1
sta PF2
;;; end action VersatilePlayfield 10 postframe
;;; end action VersatilePlayfield__postframe__42
FRAME_END
jmp FrameLoop__start__2__NextFrame ; loop to next frame
;;; end action FrameLoop 1 start
;;; end action FrameLoop__start__2
; start main routine
.segment "VECTORS"
Return: .word $6060
@ -1173,7 +1173,7 @@ VecNMI:
VecReset: .word Main::__Reset
VecBRK: .word Main::__BRK
;;; end action Init 11 main_init
;;; end action Init__main_init__1
.endscope
Main__Start = Main::__Start

View File

@ -3,7 +3,7 @@
.code
__Start:
;;; start action Init 2 main_init
;;; start action Init__main_init__1
.include "vcs-ca65.h"
.macpack longbranch
@ -13,11 +13,11 @@ __Reset:
__BRK:
CLEAN_START
;;; start action Demo 1 start
;;; start action Demo__start__2
jmp Title__Start
;;; end action Demo 1 start
;;; end action Demo__start__2
; start main routine
.segment "VECTORS"
Return: .word $6060
@ -25,7 +25,7 @@ VecNMI:
VecReset: .word Main::__Reset
VecBRK: .word Main::__BRK
;;; end action Init 2 main_init
;;; end action Init__main_init__1
.scope Title
.zeropage
@ -304,50 +304,50 @@ Bitmap48_height_b0:
.byte 36
__Start:
;;; start action FrameLoop 1 start
;;; start action FrameLoop__start__3
FrameLoop__start__3__NextFrame:
FRAME_START
;;; start action StaticKernel 3 preframe
;;; start action StaticKernel__preframe__4
;;; start action Kernel48Pixel 2 kernelsetup
;;; start action Kernel48Pixel__kernelsetup__5
;;; end action Kernel48Pixel 2 kernelsetup
;;; end action Kernel48Pixel__kernelsetup__5
;;; start action Kernel48Pixel 2 kernelsetup
;;; start action Kernel48Pixel__kernelsetup__6
;;; end action Kernel48Pixel 2 kernelsetup
;;; end action Kernel48Pixel__kernelsetup__6
;;; start action StaticKernel 3 kernelsetup
;;; start action StaticKernel__kernelsetup__7
lda #160
sta COLUBK
;;; end action StaticKernel 3 kernelsetup
;;; end action StaticKernel__kernelsetup__7
;;; start action StaticKernel 3 kernelsetup
;;; start action StaticKernel__kernelsetup__8
;;; end action StaticKernel 3 kernelsetup
;;; end action StaticKernel__kernelsetup__8
;;; start action StaticKernel 3 kernelsetup
;;; start action StaticKernel__kernelsetup__9
;;; end action StaticKernel 3 kernelsetup
;;; end action StaticKernel__kernelsetup__9
;;; end action StaticKernel 3 preframe
;;; end action StaticKernel__preframe__4
KERNEL_START
;;; start action StaticKernel 3 kernel
;;; start action StaticKernel__kernel__10
ldx #0
StaticKernel__kernel__10____each:
sta WSYNC
;;; start action Kernel48Pixel 2 kernelsetup
;;; start action Kernel48Pixel__kernelsetup__11
cpx #2+1
jcs Kernel48Pixel__kernelsetup__11____skipxhi
@ -382,9 +382,9 @@ Kernel48Pixel__kernelsetup__11____skipxlo:
Kernel48Pixel__kernelsetup__11____skipxhi:
;;; end action Kernel48Pixel 2 kernelsetup
;;; end action Kernel48Pixel__kernelsetup__11
;;; start action Kernel48Pixel 2 kernelsetup
;;; start action Kernel48Pixel__kernelsetup__12
cpx #2+1
jcs Kernel48Pixel__kernelsetup__12____skipxhi
@ -400,16 +400,16 @@ Kernel48Pixel__kernelsetup__12____skipxlo:
Kernel48Pixel__kernelsetup__12____skipxhi:
;;; end action Kernel48Pixel 2 kernelsetup
;;; end action Kernel48Pixel__kernelsetup__12
;;; start action StaticKernel 3 kernelsetup
;;; start action StaticKernel__kernelsetup__13
lda BGColor_bgcolor_b0,x
sta COLUBK
;;; end action StaticKernel 3 kernelsetup
;;; end action StaticKernel__kernelsetup__13
;;; start action StaticKernel 3 kernelsetup
;;; start action StaticKernel__kernelsetup__14
cpx #2+1
jcs StaticKernel__kernelsetup__14____skipxhi
@ -424,14 +424,61 @@ StaticKernel__kernelsetup__14____skipxlo:
StaticKernel__kernelsetup__14____skipxhi:
;;; end action StaticKernel 3 kernelsetup
;;; end action StaticKernel__kernelsetup__14
;;; start action StaticKernel 3 kernelsetup
;;; start action StaticKernel__kernelsetup__15
;;; end action StaticKernel 3 kernelsetup
;;; end action StaticKernel__kernelsetup__15
;;; start action Kernel48Pixel 2 kerneldraw
jsr Kernel48Pixel__kerneldraw__16
;;; start action StaticKernel__kerneldraw__17
ldy KernelSection_lines_b0,x
StaticKernel__kerneldraw__17__loop:
sta WSYNC
dey
bne StaticKernel__kerneldraw__17__loop
;;; end action StaticKernel__kerneldraw__17
inx
cpx #5
jne StaticKernel__kernel__10____each
StaticKernel__kernel__10____exit:
;;; end action StaticKernel__kernel__10
KERNEL_END
;;; start action JoyButton__postframe__18
lda INPT4 ;read button input
bmi JoyButton__postframe__18__NotPressed
;;; start action Advance__joybutton__19
jmp Title2__Start
;;; end action Advance__joybutton__19
JoyButton__postframe__18__NotPressed:
;;; end action JoyButton__postframe__18
FRAME_END
jmp FrameLoop__start__3__NextFrame ; loop to next frame
;;; end action FrameLoop__start__3
.rodata
__ALIGNORIGIN:
.rodata
Kernel48Pixel__kerneldraw__16:
cpx #2+1
jcs Kernel48Pixel__kerneldraw__16____skipxhi
@ -468,51 +515,11 @@ Kernel48Pixel__kerneldraw__16____skipxlo:
Kernel48Pixel__kerneldraw__16____skipxhi:
;;; end action Kernel48Pixel 2 kerneldraw
rts
;;; start action StaticKernel 3 kerneldraw
ldy KernelSection_lines_b0,x
StaticKernel__kerneldraw__17__loop:
sta WSYNC
dey
bne StaticKernel__kerneldraw__17__loop
;;; end action StaticKernel 3 kerneldraw
inx
cpx #5
jne StaticKernel__kernel__10____each
StaticKernel__kernel__10____exit:
;;; end action StaticKernel 3 kernel
KERNEL_END
;;; start action JoyButton 4 postframe
lda INPT4 ;read button input
bmi JoyButton__postframe__18__NotPressed
;;; start action Advance 5 joybutton
jmp Title2__Start
;;; end action Advance 5 joybutton
JoyButton__postframe__18__NotPressed:
;;; end action JoyButton 4 postframe
FRAME_END
jmp FrameLoop__start__3__NextFrame ; loop to next frame
;;; end action FrameLoop 1 start
.assert >(Kernel48Pixel__kerneldraw__16) = >(*), error, "Kernel48Pixel__kerneldraw__16 crosses a page boundary!"
.assert (* - Kernel48Pixel__kerneldraw__16) <= 63, error, .sprintf("Kernel48Pixel__kerneldraw__16 does not fit in 63 bytes, it took %d!", (* - Kernel48Pixel__kerneldraw__16))
.endscope
Title__Start = Title::__Start
.scope Title2
@ -847,50 +854,50 @@ __Start:
dey
bne :-
;;; start action FrameLoop 1 start
;;; start action FrameLoop__start__20
FrameLoop__start__20__NextFrame:
FRAME_START
;;; start action StaticKernel 3 preframe
;;; start action StaticKernel__preframe__21
;;; start action Kernel48Pixel 2 kernelsetup
;;; start action Kernel48Pixel__kernelsetup__22
;;; end action Kernel48Pixel 2 kernelsetup
;;; end action Kernel48Pixel__kernelsetup__22
;;; start action Kernel48Pixel 2 kernelsetup
;;; start action Kernel48Pixel__kernelsetup__23
;;; end action Kernel48Pixel 2 kernelsetup
;;; end action Kernel48Pixel__kernelsetup__23
;;; start action StaticKernel 3 kernelsetup
;;; start action StaticKernel__kernelsetup__24
lda BGColor_bgcolor_b0
sta COLUBK
;;; end action StaticKernel 3 kernelsetup
;;; end action StaticKernel__kernelsetup__24
;;; start action StaticKernel 3 kernelsetup
;;; start action StaticKernel__kernelsetup__25
;;; end action StaticKernel 3 kernelsetup
;;; end action StaticKernel__kernelsetup__25
;;; start action StaticKernel 3 kernelsetup
;;; start action StaticKernel__kernelsetup__26
;;; end action StaticKernel 3 kernelsetup
;;; end action StaticKernel__kernelsetup__26
;;; end action StaticKernel 3 preframe
;;; end action StaticKernel__preframe__21
KERNEL_START
;;; start action StaticKernel 3 kernel
;;; start action StaticKernel__kernel__27
ldx #0
StaticKernel__kernel__27____each:
sta WSYNC
;;; start action Kernel48Pixel 2 kernelsetup
;;; start action Kernel48Pixel__kernelsetup__28
cpx #2+1
jcs Kernel48Pixel__kernelsetup__28____skipxhi
@ -925,9 +932,9 @@ Kernel48Pixel__kernelsetup__28____skipxlo:
Kernel48Pixel__kernelsetup__28____skipxhi:
;;; end action Kernel48Pixel 2 kernelsetup
;;; end action Kernel48Pixel__kernelsetup__28
;;; start action Kernel48Pixel 2 kernelsetup
;;; start action Kernel48Pixel__kernelsetup__29
cpx #2+1
jcs Kernel48Pixel__kernelsetup__29____skipxhi
@ -943,16 +950,16 @@ Kernel48Pixel__kernelsetup__29____skipxlo:
Kernel48Pixel__kernelsetup__29____skipxhi:
;;; end action Kernel48Pixel 2 kernelsetup
;;; end action Kernel48Pixel__kernelsetup__29
;;; start action StaticKernel 3 kernelsetup
;;; start action StaticKernel__kernelsetup__30
lda BGColor_bgcolor_b0,x
sta COLUBK
;;; end action StaticKernel 3 kernelsetup
;;; end action StaticKernel__kernelsetup__30
;;; start action StaticKernel 3 kernelsetup
;;; start action StaticKernel__kernelsetup__31
cpx #2+1
jcs StaticKernel__kernelsetup__31____skipxhi
@ -967,14 +974,56 @@ StaticKernel__kernelsetup__31____skipxlo:
StaticKernel__kernelsetup__31____skipxhi:
;;; end action StaticKernel 3 kernelsetup
;;; end action StaticKernel__kernelsetup__31
;;; start action StaticKernel 3 kernelsetup
;;; start action StaticKernel__kernelsetup__32
;;; end action StaticKernel 3 kernelsetup
;;; end action StaticKernel__kernelsetup__32
;;; start action Kernel48Pixel 2 kerneldraw
jsr Kernel48Pixel__kerneldraw__33
;;; start action StaticKernel__kerneldraw__34
ldy KernelSection_lines_b0,x
StaticKernel__kerneldraw__34__loop:
sta WSYNC
dey
bne StaticKernel__kerneldraw__34__loop
;;; end action StaticKernel__kerneldraw__34
inx
cpx #5
jne StaticKernel__kernel__27____each
StaticKernel__kernel__27____exit:
;;; end action StaticKernel__kernel__27
KERNEL_END
;;; start action Colors__postframe__35
inc PFColor_pfcolor_b0
bne :+
inc BGColor_bgcolor_b0+2
inc BGColor_bgcolor_b0+2
:
;;; end action Colors__postframe__35
FRAME_END
jmp FrameLoop__start__20__NextFrame ; loop to next frame
;;; end action FrameLoop__start__20
.rodata
__ALIGNORIGIN:
.rodata
Kernel48Pixel__kerneldraw__33:
cpx #2+1
jcs Kernel48Pixel__kerneldraw__33____skipxhi
@ -1011,46 +1060,11 @@ Kernel48Pixel__kerneldraw__33____skipxlo:
Kernel48Pixel__kerneldraw__33____skipxhi:
;;; end action Kernel48Pixel 2 kerneldraw
rts
;;; start action StaticKernel 3 kerneldraw
ldy KernelSection_lines_b0,x
StaticKernel__kerneldraw__34__loop:
sta WSYNC
dey
bne StaticKernel__kerneldraw__34__loop
;;; end action StaticKernel 3 kerneldraw
inx
cpx #5
jne StaticKernel__kernel__27____each
StaticKernel__kernel__27____exit:
;;; end action StaticKernel 3 kernel
KERNEL_END
;;; start action Colors 4 postframe
inc PFColor_pfcolor_b0
bne :+
inc BGColor_bgcolor_b0+2
inc BGColor_bgcolor_b0+2
:
;;; end action Colors 4 postframe
FRAME_END
jmp FrameLoop__start__20__NextFrame ; loop to next frame
;;; end action FrameLoop 1 start
.assert >(Kernel48Pixel__kerneldraw__33) = >(*), error, "Kernel48Pixel__kerneldraw__33 crosses a page boundary!"
.assert (* - Kernel48Pixel__kerneldraw__33) <= 63, error, .sprintf("Kernel48Pixel__kerneldraw__33 does not fit in 63 bytes, it took %d!", (* - Kernel48Pixel__kerneldraw__33))
.endscope
Title2__Start = Title2::__Start
.endscope

View File

@ -45,7 +45,7 @@ Main__INITDATA:
.byte 0
__Start:
;;; start action Init 7 main_init
;;; start action Init__main_init__1
.include "vcs-ca65.h"
.define PAL 0
@ -60,49 +60,49 @@ __BRK:
dey
bne :-
;;; start action FrameLoop 1 start
;;; start action FrameLoop__start__2
FrameLoop__start__2__NextFrame:
FRAME_START
;;; start action StaticKernel 4 preframe
;;; start action StaticKernel__preframe__3
;;; start action StaticKernel 4 kernelsetup
;;; start action StaticKernel__kernelsetup__4
lda #24
sta COLUBK
;;; end action StaticKernel 4 kernelsetup
;;; end action StaticKernel__kernelsetup__4
;;; start action StaticKernel 4 kernelsetup
;;; start action StaticKernel__kernelsetup__5
;;; end action StaticKernel 4 kernelsetup
;;; end action StaticKernel__kernelsetup__5
;;; start action StaticKernel 4 kernelsetup
;;; start action StaticKernel__kernelsetup__6
;;; end action StaticKernel 4 kernelsetup
;;; end action StaticKernel__kernelsetup__6
;;; end action StaticKernel 4 preframe
;;; end action StaticKernel__preframe__3
KERNEL_START
;;; start action StaticKernel 4 kernel
;;; start action StaticKernel__kernel__7
ldx #0
StaticKernel__kernel__7____each:
sta WSYNC
;;; start action StaticKernel 4 kernelsetup
;;; start action StaticKernel__kernelsetup__8
lda BGColor_bgcolor_b0,x
sta COLUBK
;;; end action StaticKernel 4 kernelsetup
;;; end action StaticKernel__kernelsetup__8
;;; start action StaticKernel 4 kernelsetup
;;; start action StaticKernel__kernelsetup__9
cpx #5+2
jcs StaticKernel__kernelsetup__9____skipxhi
@ -117,9 +117,9 @@ StaticKernel__kernelsetup__9____skipxlo:
StaticKernel__kernelsetup__9____skipxhi:
;;; end action StaticKernel 4 kernelsetup
;;; end action StaticKernel__kernelsetup__9
;;; start action StaticKernel 4 kernelsetup
;;; start action StaticKernel__kernelsetup__10
cpx #4
jcc StaticKernel__kernelsetup__10____skipxlo
@ -133,7 +133,7 @@ StaticKernel__kernelsetup__9____skipxhi:
StaticKernel__kernelsetup__10____skipxlo:
;;; end action StaticKernel 4 kernelsetup
;;; end action StaticKernel__kernelsetup__10
ldy KernelSection_lines_b0,x
StaticKernel__kernel__7__loop:
@ -148,46 +148,46 @@ StaticKernel__kernel__7__loop:
jne StaticKernel__kernel__7____each
StaticKernel__kernel__7____exit:
;;; end action StaticKernel 4 kernel
;;; end action StaticKernel__kernel__7
KERNEL_END
;;; start action JoyButton 5 postframe
;;; start action JoyButton__postframe__11
lda INPT4 ;read button input
bmi JoyButton__postframe__11__NotPressed
;;; start action Local 6 joybutton
;;; start action Local__joybutton__12
inc Local__6__tmp+0
inc PFColor_pfcolor_b0
;;; end action Local 6 joybutton
;;; end action Local__joybutton__12
JoyButton__postframe__11__NotPressed:
;;; end action JoyButton 5 postframe
;;; end action JoyButton__postframe__11
FRAME_END
;;; start action ResetSwitch 2 nextframe
;;; start action ResetSwitch__nextframe__13
lsr SWCHB ; test Game Reset switch
bcs ResetSwitch__nextframe__13__NoStart
;;; start action ResetConsole 3 resetswitch
;;; start action ResetConsole__resetswitch__14
jmp Main::__Reset ; jump to Reset handler
;;; end action ResetConsole 3 resetswitch
;;; end action ResetConsole__resetswitch__14
ResetSwitch__nextframe__13__NoStart:
;;; end action ResetSwitch 2 nextframe
;;; end action ResetSwitch__nextframe__13
jmp FrameLoop__start__2__NextFrame ; loop to next frame
;;; end action FrameLoop 1 start
;;; end action FrameLoop__start__2
; start main routine
.segment "VECTORS"
Return: .word $6060
@ -195,7 +195,7 @@ VecNMI:
VecReset: .word Main::__Reset
VecBRK: .word Main::__BRK
;;; end action Init 7 main_init
;;; end action Init__main_init__1
.endscope
Main__Start = Main::__Start

View File

@ -45,7 +45,7 @@ Main__INITDATA:
.byte 0
__Start:
;;; start action Init 7 main_init
;;; start action Init__main_init__1
.include "vcs-ca65.h"
.macpack longbranch
@ -61,49 +61,49 @@ __BRK:
dey
bne :-
;;; start action FrameLoop 1 start
;;; start action FrameLoop__start__2
FrameLoop__start__2__NextFrame:
FRAME_START
;;; start action StaticKernel 4 preframe
;;; start action StaticKernel__preframe__3
;;; start action StaticKernel 4 kernelsetup
;;; start action StaticKernel__kernelsetup__4
lda #24
sta COLUBK
;;; end action StaticKernel 4 kernelsetup
;;; end action StaticKernel__kernelsetup__4
;;; start action StaticKernel 4 kernelsetup
;;; start action StaticKernel__kernelsetup__5
;;; end action StaticKernel 4 kernelsetup
;;; end action StaticKernel__kernelsetup__5
;;; start action StaticKernel 4 kernelsetup
;;; start action StaticKernel__kernelsetup__6
;;; end action StaticKernel 4 kernelsetup
;;; end action StaticKernel__kernelsetup__6
;;; end action StaticKernel 4 preframe
;;; end action StaticKernel__preframe__3
KERNEL_START
;;; start action StaticKernel 4 kernel
;;; start action StaticKernel__kernel__7
ldx #0
StaticKernel__kernel__7____each:
sta WSYNC
;;; start action StaticKernel 4 kernelsetup
;;; start action StaticKernel__kernelsetup__8
lda BGColor_bgcolor_b0,x
sta COLUBK
;;; end action StaticKernel 4 kernelsetup
;;; end action StaticKernel__kernelsetup__8
;;; start action StaticKernel 4 kernelsetup
;;; start action StaticKernel__kernelsetup__9
cpx #5+2
jcs StaticKernel__kernelsetup__9____skipxhi
@ -118,9 +118,9 @@ StaticKernel__kernelsetup__9____skipxlo:
StaticKernel__kernelsetup__9____skipxhi:
;;; end action StaticKernel 4 kernelsetup
;;; end action StaticKernel__kernelsetup__9
;;; start action StaticKernel 4 kernelsetup
;;; start action StaticKernel__kernelsetup__10
cpx #4
jcc StaticKernel__kernelsetup__10____skipxlo
@ -134,10 +134,10 @@ StaticKernel__kernelsetup__9____skipxhi:
StaticKernel__kernelsetup__10____skipxlo:
;;; end action StaticKernel 4 kernelsetup
;;; end action StaticKernel__kernelsetup__10
;;; start action StaticKernel 4 kerneldraw
;;; start action StaticKernel__kerneldraw__11
ldy KernelSection_lines_b0,x
StaticKernel__kerneldraw__11__loop:
@ -146,7 +146,7 @@ StaticKernel__kerneldraw__11__loop:
dey
bne StaticKernel__kerneldraw__11__loop
;;; end action StaticKernel 4 kerneldraw
;;; end action StaticKernel__kerneldraw__11
@ -155,46 +155,46 @@ StaticKernel__kerneldraw__11__loop:
jne StaticKernel__kernel__7____each
StaticKernel__kernel__7____exit:
;;; end action StaticKernel 4 kernel
;;; end action StaticKernel__kernel__7
KERNEL_END
;;; start action JoyButton 5 postframe
;;; start action JoyButton__postframe__12
lda INPT4 ;read button input
bmi JoyButton__postframe__12__NotPressed
;;; start action Local 6 joybutton
;;; start action Local__joybutton__13
inc Local__6__tmp+0
inc PFColor_pfcolor_b0
;;; end action Local 6 joybutton
;;; end action Local__joybutton__13
JoyButton__postframe__12__NotPressed:
;;; end action JoyButton 5 postframe
;;; end action JoyButton__postframe__12
FRAME_END
;;; start action ResetSwitch 2 nextframe
;;; start action ResetSwitch__nextframe__14
lsr SWCHB ; test Game Reset switch
bcs ResetSwitch__nextframe__14__NoStart
;;; start action ResetConsole 3 resetswitch
;;; start action ResetConsole__resetswitch__15
jmp Main::__Reset ; jump to Reset handler
;;; end action ResetConsole 3 resetswitch
;;; end action ResetConsole__resetswitch__15
ResetSwitch__nextframe__14__NoStart:
;;; end action ResetSwitch 2 nextframe
;;; end action ResetSwitch__nextframe__14
jmp FrameLoop__start__2__NextFrame ; loop to next frame
;;; end action FrameLoop 1 start
;;; end action FrameLoop__start__2
; start main routine
.segment "VECTORS"
Return: .word $6060
@ -202,7 +202,7 @@ VecNMI:
VecReset: .word Main::__Reset
VecBRK: .word Main::__BRK
;;; end action Init 7 main_init
;;; end action Init__main_init__1
.endscope
Main__Start = Main::__Start