1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-12-24 04:31:02 +00:00

Improved compiler error messages. Added bubbles64 example (not working yet). Added missing fragments.

This commit is contained in:
jespergravgaard 2020-09-28 23:45:41 +02:00
parent d64faa132d
commit 0a31136651
21 changed files with 10349 additions and 1563 deletions

View File

@ -1,4 +1,4 @@
//KICKC FRAGMENT CACHE 12fc0379b9 12fc039308
//KICKC FRAGMENT CACHE 12b00eb139 12b00ecab9
//FRAGMENT vbuz1=vbuc1
lda #{c1}
sta {z1}

View File

@ -1,4 +1,4 @@
//KICKC FRAGMENT CACHE 12fc0379b9 12fc039308
//KICKC FRAGMENT CACHE 12b00eb139 12b00ecab9
//FRAGMENT _deref_pbuc1=vbuc2
lda #{c2}
sta {c1}
@ -1177,6 +1177,58 @@ inc
stx {c1}
//FRAGMENT _deref_pbuc1=vbuzz
stz {c1}
//FRAGMENT vbuz1=_deref_pbuc1_plus_1
lda {c1}
inc
sta {z1}
//FRAGMENT vwuz1=_word_vbuz2
lda {z2}
sta {z1}
lda #0
sta {z1}+1
//FRAGMENT vwuz1=vwuz2_rol_2
lda {z2}
asl
sta {z1}
lda {z2}+1
rol
sta {z1}+1
asl {z1}
rol {z1}+1
//FRAGMENT vwuz1=vwuz2_plus_vwuz3
lda {z2}
clc
adc {z3}
sta {z1}
lda {z2}+1
adc {z3}+1
sta {z1}+1
//FRAGMENT vwuz1=vwuz2_rol_4
lda {z2}
asl
sta {z1}
lda {z2}+1
rol
sta {z1}+1
asl {z1}
rol {z1}+1
asl {z1}
rol {z1}+1
asl {z1}
rol {z1}+1
//FRAGMENT pbuz1=pbuc1_plus_vwuz2
lda {z2}
clc
adc #<{c1}
sta {z1}
lda {z2}+1
adc #>{c1}
sta {z1}+1
//FRAGMENT pbuz1=pbuz2
lda {z2}
sta {z1}
lda {z2}+1
sta {z1}+1
//FRAGMENT vbuc1_neq_vbuz1_then_la1
lda #{c1}
cmp {z1}
@ -1218,11 +1270,6 @@ sta {z1}
lda {z2}+1
adc #>{c1}
sta {z1}+1
//FRAGMENT pbuz1=pbuz2
lda {z2}
sta {z1}
lda {z2}+1
sta {z1}+1
//FRAGMENT pbuz1_neq_pbuz2_then_la1
lda {z1}+1
cmp {z2}+1
@ -1243,6 +1290,29 @@ sta {z1}
lda #0
adc {z2}+1
sta {z1}+1
//FRAGMENT vbuaa=_deref_pbuc1_plus_1
lda {c1}
inc
//FRAGMENT vbuxx=_deref_pbuc1_plus_1
ldx {c1}
inx
//FRAGMENT vbuz1=vbuxx
stx {z1}
//FRAGMENT vwuz1=_word_vbuxx
txa
sta {z1}
lda #0
sta {z1}+1
//FRAGMENT vwuz1=_word_vbuyy
tya
sta {z1}
lda #0
sta {z1}+1
//FRAGMENT vwuz1=_word_vbuzz
tza
sta {z1}
lda #0
sta {z1}+1
//FRAGMENT vbuc1_neq_vbuaa_then_la1
cmp #{c1}
bne {la1}
@ -1278,6 +1348,47 @@ cpz #{c1}
bne {la1}
//FRAGMENT vbuaa=vbuzz
tza
//FRAGMENT vbuz1=vbuyy
sty {z1}
//FRAGMENT vbuz1=vbuzz
tza
sta {z1}
//FRAGMENT vbuxx=vbuaa
tax
//FRAGMENT vbuyy=_deref_pbuc1_plus_1
ldy {c1}
iny
//FRAGMENT vbuxx=vbuyy
tya
tax
//FRAGMENT vbuzz=_deref_pbuc1_plus_1
lda {c1}
inc
taz
//FRAGMENT vbuxx=vbuzz
tza
tax
//FRAGMENT vwuz1=vwuz2_plus_vwuz1
lda {z1}
clc
adc {z2}
sta {z1}
lda {z1}+1
adc {z2}+1
sta {z1}+1
//FRAGMENT pbuz1=pbuc1_plus_vwuz1
clc
lda {z1}
adc #<{c1}
sta {z1}
lda {z1}+1
adc #>{c1}
sta {z1}+1
//FRAGMENT vwuz1=vwuz1_rol_4
asw {z1}
asw {z1}
asw {z1}
asw {z1}
//FRAGMENT _deref_pbuc1=_inc__deref_pbuc1
inc {c1}
//FRAGMENT vwuz1=vbuc1
@ -2211,15 +2322,6 @@ tza
tax
tya
sta {c1},x
//FRAGMENT vbuz1=vbuxx
stx {z1}
//FRAGMENT vbuz1=vbuyy
sty {z1}
//FRAGMENT vbuz1=vbuzz
tza
sta {z1}
//FRAGMENT vbuxx=vbuaa
tax
//FRAGMENT vbuyy=vbuaa
tay
//FRAGMENT vbuzz=vbuaa

View File

@ -1,4 +1,4 @@
//KICKC FRAGMENT CACHE 12fc0379b9 12fc039308
//KICKC FRAGMENT CACHE 12b00eb139 12b00ecab9
//FRAGMENT vbuz1=vbuc1
lda #{c1}
sta {z1}

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
//KICKC FRAGMENT CACHE 12fc0379b9 12fc039308
//KICKC FRAGMENT CACHE 12b00eb139 12b00ecab9
//FRAGMENT vbuz1=_deref_pbuc1
lda {c1}
sta {z1}

View File

@ -0,0 +1,16 @@
lda ({z1}),y
sta $fe
ora #$7f
bmi !+
lda #0
!:
sta $ff
ldy #{c1}
clc
lda ({z1}),y
adc $fe
sta ({z1}),y
iny
lda ({z1}),y
adc $fe
sta ({z1}),y

View File

@ -0,0 +1,9 @@
lda ({z1}),y
cmp #<{c1}
iny
lda ({z1}),y
sbc #>{c1}
bvc !+
eor #$80
!:
bpl {la1}

View File

@ -0,0 +1,10 @@
lda #<{c1}
cmp ({z1}),y
iny
lda #>{c1}
sbc ({z1}),y
bvc !+
eor #$80
!:
bmi {la1}
!e:

View File

@ -0,0 +1,15 @@
lda ({z2}),y
sta {m1}
iny
lda ({z2}),y
sta {m1}+1
cpx #0
beq !e+
!:
lda {m1}+1
cmp #$80
ror {m1}+1
ror {m1}
dex
bne !-
!e:

View File

@ -199,7 +199,7 @@ public class AsmFormat {
} else if(SymbolType.DWORD.equals(operandType) || SymbolType.SDWORD.equals(operandType)) {
return getAsmConstant(program, new ConstantBinary(operand, Operators.BOOL_AND, new ConstantInteger((long) 0xffff)), outerPrecedence, codeScope);
} else {
throw new CompileError("Unhandled type " + operand);
throw new CompileError("Operator _lo_ cannot handle " + operand.toString(program));
}
} else if(Operators.HIBYTE.equals(operator)) {
SymbolType operandType = SymbolTypeInference.inferType(program.getScope(), operand);
@ -210,7 +210,7 @@ public class AsmFormat {
} else if(SymbolType.DWORD.equals(operandType) || SymbolType.SDWORD.equals(operandType)) {
return getAsmConstant(program, new ConstantBinary(operand, Operators.SHIFT_RIGHT, new ConstantInteger((long) 16)), outerPrecedence, codeScope);
} else {
throw new CompileError("Unhandled type " + operand);
throw new CompileError("Operator _hi_ cannot handle " + operand.toString(program));
}
} else if(Operators.INCREMENT.equals(operator)) {
return getAsmConstant(program, new ConstantBinary(operand, Operators.PLUS, new ConstantInteger((long) 1)), outerPrecedence, codeScope);
@ -225,7 +225,7 @@ public class AsmFormat {
} else if(SymbolType.DWORD.equals(operandType) || SymbolType.SDWORD.equals(operandType)) {
return getAsmConstant(program, new ConstantBinary(operand, Operators.BOOL_XOR, new ConstantInteger((long) 0xffffffff)), outerPrecedence, codeScope);
} else {
throw new CompileError("Unhandled type " + operand);
throw new CompileError("Operator _bnot_ cannot handle " + operand.toString(program));
}
} else if(Operators.POS.equals(operator)) {
return getAsmConstant(program, operand, outerPrecedence, codeScope);

View File

@ -224,6 +224,11 @@ public class TestPrograms {
compileAndCompare("minus-precedence-problem.c");
}
@Test
public void testbubbles64() throws IOException, URISyntaxException {
compileAndCompare("complex/bubbles64/bubbles64.c");
}
@Test
public void testNesBalls() throws IOException, URISyntaxException {
compileAndCompare("complex/nes-balls/kickballs-2.c");

View File

@ -0,0 +1,172 @@
// bubbles64 - Q&D C64 port of the bubbles demo from vbcc6502's NES exmaples
// Coded by Lazycow
// Source https://www.lemon64.com/forum/viewtopic.php?t=75283&start=15
#include "lazyply.h"
#define scrPtr (( ubyte*)0xE000)
#define colPtr (( ubyte*)0xD800)
#define vicPtr (( ubyte*)0xD000)
#define chrPtr (( ubyte*)0xF800)
#define onePtr (( ubyte*)0x0001)
#define scr 0xE000
enum {
maxSprites=32,
maxSprImages=8,
maxC64Images=256,
sprOff=64
};
ubyte
lcSprMapTab[maxSprImages],
lcSprColTab[maxC64Images];
enum {
maxDrawObjects=24,
F=3
};
ubyte cmIT[maxSprites+1],
cmSI[maxSprites], cmRX[maxSprites], cmRY[maxSprites], cmRF[maxSprites];
typedef struct {
ubyte
s; // sprite image offset into bubbles[] table
sword
x, y; // coordinates (shifted)
sbyte
vx, vy, // velocity
ax, ay; // accelleration
} DrawObject;
DrawObject dTab[maxDrawObjects];
void Print00(char* p, ubyte v0) {
char c; ubyte v=v0;
c='0'; while (v>=10) { ++c; v-=10; }
*p++=c;
c='0'; while (v>=1) { ++c; v-=1; }
*p++=c;
}
// sprite support functions
//
ubyte GetSprite() { // get unused or dropped sprite
ubyte t0; for (t0=0;t0<maxSprites;++t0) if (cmRF[t0]>=rfDrop)
{ cmRF[t0]=0; return t0; }
return 255;
}
void AddSprite(ubyte sn) { // activate prepared sprite into the (i)ndex (t)able
ubyte t0; if (rfDrop==cmRF[sn]) cmRF[sn]=0; else for
(t0=0;t0<maxSprites;t0+=1) if (cmIT[t0]>=128)
{ cmRF[sn]=0; cmIT[t0]=sn; return; }
}
void DelSprite(ubyte sn) { // drop sprite, will be removed from IT in IRQ
cmRY[sn]=255; cmRF[sn]=rfDrop;
}
//
//
int main() {
register DrawObject* d;
ubyte
i,
type=0,
stopIt=0,
objects=0,
preset=0; // 1 == preallocate 20 sprites (only for better benchmarking)
// 0 == allocate sprites on the fly (prefered)
uword
oCount=0,
c=0;
// setup sprite images
lcSprMapTab[0]=sprOff+0; lcSprMapTab[1]=sprOff+1;
lcSprMapTab[2]=sprOff+2; lcSprMapTab[3]=sprOff+3;
lcSprMapTab[4]=sprOff+4; lcSprMapTab[5]=sprOff+5;
// setup sprite colors + flags
lcSprColTab[sprOff+0]=lcSprColTab[sprOff+1]=10|lfMC;
lcSprColTab[sprOff+2]=lcSprColTab[sprOff+3]=5|lfMC;
lcSprColTab[sprOff+4]=lcSprColTab[sprOff+5]=14|lfMC;
// setup C64 / lazyply
lcVIC17=vicPtr[17]; lcVIC22=vicPtr[22]; lcVIC24=vicPtr[24];
lcVIC33=6; lcVIC37=1; lcVIC38=11;
for (i=0;i<maxSprites+1;i+=1) cmIT[i]=255; // clear (i)ndex (t)able
for (i=0;i<maxSprites ;i+=1) cmRF[i]=255;
for (c=0;c<1000;c+=1) { scrPtr[c]=32; colPtr[c]=14; }
i=lcSync(0); // install IRQ
*onePtr=0x33; // now it's save to change "01"
for (c=0;c<2040;c+=1) chrPtr[c]=vicPtr[c];
*onePtr=0x35;
vicPtr[0xd02]|=3; vicPtr[0xd00]&=~3ub; lcVIC24=128+14;
// PAL or NTSC?
if (i&128) {
scrPtr[996]='N'-'A'+1; scrPtr[997]='T'-'A'+1; scrPtr[998]='S'-'A'+1;
scrPtr[999]='C'-'A'+1;
} else {
scrPtr[997]='P'-'A'+1; scrPtr[998]='A'-'A'+1; scrPtr[999]='L'-'A'+1;
}
scrPtr[975+0]='B'-'A'+1;
scrPtr[975+1]='U'-'A'+1;
scrPtr[975+2]='B'-'A'+1;
scrPtr[975+3]='B'-'A'+1;
scrPtr[975+4]='L'-'A'+1;
scrPtr[975+5]='E'-'A'+1;
scrPtr[975+6]='S'-'A'+1;
scrPtr[975+7]=':';
// setup bubbles
type=0;
for (i=0;i<maxDrawObjects;i+=1) {
DrawObject* d=&dTab[i];
d->s=type;
type+=1; if (type>=6) type=0;
d->x=112<<F; d->vx=(sbyte)i; d->ax=1;
d->y=24<<F; d->vy=1<<F; d->ay=1;
if (preset && i<20) {
if ((c=GetSprite())<128) {
AddSprite((ubyte)c);
cmSI[i]=cmRX[i]=cmRF[i]=0;
cmRY[i]=i<<4;
}
}
}
// main loop
c=0; for (;;) {
// move objects
for (i=0,d=dTab; i<objects ;i+=1,++d) {
d->vx+=d->ax;
if (d->vx<-32) d->ax=1; else if (d->vx>32) d->ax=-1;
if (d->y>248<<F) d->vy=-1<<F; else if (d->y<24<<F) d->vy=1<<F;
d->x+=d->vx; d->y+=d->vy;
if (cmRF[i]<128) { cmSI[i]=d->s; cmRX[i]=(ubyte)(d->x>>F); cmRY[i]=(ubyte)(d->y>>F); }
}
// activate new bubble?
c+=1; if (c>=14) {
c=0;
if (0==stopIt && objects<maxDrawObjects) {
objects+=1;
if (0==preset && (i=GetSprite())<128) {
AddSprite(i);
cmSI[i]=cmRX[i]=cmRF[i]=cmRY[i]=0;
}
}
}
i=lcSync(0)&31;
if (i>1) oCount+=2; else if (oCount>0) oCount-=1;
if (oCount>2 && objects>0) // stop adding objects?
{ objects-=1; DelSprite(objects); stopIt=1; oCount=0; }
Print00(scr+(char*)983,objects);
}
return 0;
}

View File

@ -0,0 +1,11 @@
#!/bin/sh
rm out.raw
rm out.prg
#cl65 -Oris -Cl -C c64o.cfg -t c64 bubbles64.c lazyply-ca65.s c64irq-ca65.s c64sprcore-ca65.s -o out.raw || exit
vc +c64 -+ -Dmain=__main -O3 bubbles64.c -llazyply -o out.raw || exit
exomizer sfx sys out.raw sprites.spr@0xD000 -q -p 1 -m 1 -o out.prg || exit
#x64 -pal out.prg

View File

@ -0,0 +1,78 @@
// lazyply - experimental C64 sprite multiplying code, 'Lazycow 2015 (prealpha)
typedef signed char sbyte;
typedef unsigned char ubyte;
typedef signed short sword;
typedef unsigned short uword;
//
// sprites
//
enum {
lfMC=16, // sprite is multicolor
lfOL=32 // sprite is build out of 2 overlayed sprites (hires over multicolor)
};
extern ubyte lcSprMapTab[];
extern ubyte lcSprColTab[];
enum { rfXMSB=16, rfDrop=254, rfNull=255 };
//enum {
//scNull=255, // unallocated (63)
//scDrop=254, // will be removed (62)
//scHide=253, // invisible (61)
//scVoid=128, // no collision detection
//scHold=64, // sprite holds on sprite cmSC[]&scMask, offset cmSU[]/cmSV[]
//scMask=63
//};
extern ubyte
cmIT[], // sprite index table (dim must be maxSprites+1!)
cmSI[], // sprite image
//cmSC[], // sprite control
cmRX[], // raw sprite x coordinates (bits 0..7)
cmRY[], // raw sprite y coordinates (bits 0..7)
cmRF[]; // raw sprite flags: 1 == bit 8 of raw x coordinate
//
// raster interrupt
//
ubyte lcVIC17, lcVIC22, lcVIC24, lcVIC33, lcVIC37, lcVIC38;
#if defined(__CC65__)
ubyte fastcall lcSync(ubyte flags);
ubyte fastcall lcGetPad(ubyte port);
enum { lfU=1, lfD=2, lfL=4, lfR=8, lfA=16, lfB=32 };
#elif defined(__VBCC__)
// flags: 0
// result: amount of frames since the last call [0..31], +128 on NTSC
//
ubyte lcSync(__reg("a") ubyte flags);
// port: 0==query both ports (other values not supported, yet)
// result: set of joypad flags
//
ubyte lcGetPad(__reg("a") ubyte port);
enum { lfU=1, lfD=2, lfL=4, lfR=8, lfA=16, lfB=32 };
#elif defined(__KICKC__)
// flags: 0
// result: amount of frames since the last call [0..31], +128 on NTSC
//
ubyte lcSync(ubyte flags) { return 0; }
// port: 0==query both ports (other values not supported, yet)
// result: set of joypad flags
//
ubyte lcGetPad(ubyte port) { return 0; }
enum { lfU=1, lfD=2, lfL=4, lfR=8, lfA=16, lfB=32 };
#endif

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 430 B

Binary file not shown.

View File

@ -0,0 +1,733 @@
// bubbles64 - Q&D C64 port of the bubbles demo from vbcc6502's NES exmaples
// Coded by Lazycow
// Source https://www.lemon64.com/forum/viewtopic.php?t=75283&start=15
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
.const lfMC = $10
.const rfDrop = $fe
.const maxSprites = $20
.const maxSprImages = 8
.const maxC64Images = $100
.const sprOff = $40
.const maxDrawObjects = $18
.const F = 3
//
//
main: {
.label __27 = $10
.label __28 = $12
// main loop
.label c = 2
// main loop
.label c_1 = 4
.label d1 = $14
// setup bubbles
.label type = 6
// main loop
.label c_2 = 7
.label d = $b
.label i = $a
.label objects = $d
// 1 == preallocate 20 sprites (only for better benchmarking)
// 0 == allocate sprites on the fly (prefered)
.label oCount = $e
.label stopIt = 9
.label __109 = $1a
.label __110 = $1c
.label __111 = $16
.label __112 = $18
// lcSprMapTab[0]=sprOff+0
// setup sprite images
lda #sprOff
sta lcSprMapTab
// lcSprMapTab[1]=sprOff+1
lda #sprOff+1
sta lcSprMapTab+1
// lcSprMapTab[2]=sprOff+2
lda #sprOff+2
sta lcSprMapTab+2
// lcSprMapTab[3]=sprOff+3
lda #sprOff+3
sta lcSprMapTab+3
// lcSprMapTab[4]=sprOff+4
lda #sprOff+4
sta lcSprMapTab+4
// lcSprMapTab[5]=sprOff+5
lda #sprOff+5
sta lcSprMapTab+5
// lcSprColTab[sprOff+1]=10|lfMC
lda #$a|lfMC
sta lcSprColTab+sprOff+1
// lcSprColTab[sprOff+0]=lcSprColTab[sprOff+1]=10|lfMC
// setup sprite colors + flags
sta lcSprColTab+sprOff
// lcSprColTab[sprOff+3]=5|lfMC
lda #5|lfMC
sta lcSprColTab+sprOff+3
// lcSprColTab[sprOff+2]=lcSprColTab[sprOff+3]=5|lfMC
sta lcSprColTab+sprOff+2
// lcSprColTab[sprOff+5]=14|lfMC
lda #$e|lfMC
sta lcSprColTab+sprOff+5
// lcSprColTab[sprOff+4]=lcSprColTab[sprOff+5]=14|lfMC
sta lcSprColTab+sprOff+4
ldx #0
__b2:
// for (i=0;i<maxSprites+1;i+=1)
cpx #maxSprites+1
bcs !__b3+
jmp __b3
!__b3:
ldx #0
// clear (i)ndex (t)able
__b4:
// for (i=0;i<maxSprites ;i+=1)
cpx #maxSprites
bcs !__b5+
jmp __b5
!__b5:
lda #<0
sta.z c
sta.z c+1
__b6:
// for (c=0;c<1000;c+=1)
lda.z c+1
cmp #>$3e8
bcs !__b7+
jmp __b7
!__b7:
bne !+
lda.z c
cmp #<$3e8
bcs !__b7+
jmp __b7
!__b7:
!:
// *onePtr=0x33
// install IRQ
lda #$33
sta 1
lda #<0
sta.z c_1
sta.z c_1+1
// now it's save to change "01"
__b8:
// for (c=0;c<2040;c+=1)
lda.z c_1+1
cmp #>$7f8
bcs !__b9+
jmp __b9
!__b9:
bne !+
lda.z c_1
cmp #<$7f8
bcs !__b9+
jmp __b9
!__b9:
!:
// *onePtr=0x35
lda #$35
sta 1
// vicPtr[0xd02]|=3
lda #3
ora $d000+$d02
sta $d000+$d02
// vicPtr[0xd00]&=~3ub
lda #3^$ff
and $d000+$d00
sta $d000+$d00
// scrPtr[997]='P'-'A'+1
lda #'P'-'A'+1
sta $e000+$3e5
// scrPtr[998]='A'-'A'+1
lda #1
sta $e000+$3e6
// scrPtr[999]='L'-'A'+1
lda #'L'-'A'+1
sta $e000+$3e7
// scrPtr[975+0]='B'-'A'+1
lda #'B'-'A'+1
sta $e000+$3cf
// scrPtr[975+1]='U'-'A'+1
lda #'U'-'A'+1
sta $e000+$3cf+1
// scrPtr[975+2]='B'-'A'+1
lda #'B'-'A'+1
sta $e000+$3cf+2
// scrPtr[975+3]='B'-'A'+1
sta $e000+$3cf+3
// scrPtr[975+4]='L'-'A'+1
lda #'L'-'A'+1
sta $e000+$3cf+4
// scrPtr[975+5]='E'-'A'+1
lda #'E'-'A'+1
sta $e000+$3cf+5
// scrPtr[975+6]='S'-'A'+1
lda #'S'-'A'+1
sta $e000+$3cf+6
// scrPtr[975+7]=':'
lda #':'
sta $e000+$3cf+7
lda #0
sta.z type
tax
__b12:
// for (i=0;i<maxDrawObjects;i+=1)
cpx #maxDrawObjects
bcs !__b13+
jmp __b13
!__b13:
lda #<0
sta.z oCount
sta.z oCount+1
sta.z stopIt
sta.z c_2
sta.z c_2+1
sta.z objects
__b16:
lda #<dTab
sta.z d
lda #>dTab
sta.z d+1
lda #0
sta.z i
// move objects
__b17:
// for (i=0,d=dTab; i<objects ;i+=1,++d)
lda.z i
cmp.z objects
bcs !__b18+
jmp __b18
!__b18:
// c+=1
// activate new bubble?
inc.z c_2
bne !+
inc.z c_2+1
!:
// if (c>=14)
lda.z c_2+1
cmp #>$e
bcc __b36
bne !+
lda.z c_2
cmp #<$e
bcc __b36
!:
// if (0==stopIt && objects<maxDrawObjects)
lda #0
cmp.z stopIt
bne __b11
lda.z objects
cmp #maxDrawObjects
bcc __b31
jmp __b36
__b11:
lda #<0
sta.z c_2
sta.z c_2+1
__b36:
// if (oCount>0)
lda.z oCount
bne !+
lda.z oCount+1
beq __b34
!:
// oCount-=1
lda.z oCount
sec
sbc #1
sta.z oCount
lda.z oCount+1
sbc #0
sta.z oCount+1
__b34:
// if (oCount>2 && objects>0)
lda.z oCount+1
cmp #>2+1
bcc __b35
bne !+
lda.z oCount
cmp #<2+1
bcc __b35
!:
lda.z objects
bne __b38
jmp __b35
__b38:
// objects-=1
dec.z objects
// DelSprite(objects)
ldx.z objects
jsr DelSprite
lda #<0
sta.z oCount
sta.z oCount+1
lda #1
sta.z stopIt
__b35:
// Print00(scr+(char*)983,objects)
ldx.z objects
jsr Print00
jmp __b16
__b31:
// objects+=1
inc.z objects
// GetSprite()
jsr GetSprite
// GetSprite()
// i=GetSprite()
// if (0==preset && (i=GetSprite())<128)
cpx #$80
bcc __b32
jmp __b36
__b32:
// AddSprite(i)
jsr AddSprite
// cmRY[i]=0
lda #0
sta cmRY,x
// cmRF[i]=cmRY[i]=0
lda cmRY,x
sta cmRF,x
// cmRX[i]=cmRF[i]=cmRY[i]=0
lda cmRF,x
sta cmRX,x
// cmSI[i]=cmRX[i]=cmRF[i]=cmRY[i]=0
lda cmRX,x
sta cmSI,x
jmp __b11
__b18:
// d->vx+=d->ax
ldy #7
lda (d),y
ldy #5
tax
lda (d),y
sty.z $ff
stx.z $ff
clc
adc.z $ff
ldy.z $ff
sta (d),y
// if (d->vx<-32)
ldy #5
lda (d),y
sec
sbc #-$20
bvc !+
eor #$80
!:
bpl !__b20+
jmp __b20
!__b20:
// if (d->vx>32)
ldy #5
lda (d),y
sec
sbc #$20+1
bvc !+
eor #$80
!:
bmi __b21
// d->ax=-1
lda #7
tay
lda #-1
sta (d),y
__b21:
// if (d->y>248<<F)
ldy #3
lda #<$f8<<F
cmp (d),y
iny
lda #>$f8<<F
sbc (d),y
bvc !+
eor #$80
!:
bpl !__b22+
jmp __b22
!__b22:
!e:
// if (d->y<24<<F)
ldy #3
lda (d),y
cmp #<$18<<F
iny
lda (d),y
sbc #>$18<<F
bvc !+
eor #$80
!:
bpl __b23
// d->vy=1<<F
lda #6
tay
lda #1<<F
sta (d),y
__b23:
// d->x+=d->vx
ldy #5
lda (d),y
sta.z $fe
ora #$7f
bmi !+
lda #0
!:
sta.z $ff
ldy #1
clc
lda (d),y
adc.z $fe
sta (d),y
iny
lda (d),y
adc.z $fe
sta (d),y
// d->y+=d->vy
ldy #6
lda (d),y
sta.z $fe
ora #$7f
bmi !+
lda #0
!:
sta.z $ff
ldy #3
clc
lda (d),y
adc.z $fe
sta (d),y
iny
lda (d),y
adc.z $fe
sta (d),y
// if (cmRF[i]<128)
ldy.z i
lda cmRF,y
cmp #$80
bcs __b24
// cmSI[i]=d->s
ldy #0
lda (d),y
ldy.z i
sta cmSI,y
// d->x>>F
ldx #F
ldy #1
lda (d),y
sta.z __27
iny
lda (d),y
sta.z __27+1
cpx #0
beq !e+
!:
lda.z __27+1
cmp #$80
ror.z __27+1
ror.z __27
dex
bne !-
!e:
// cmRX[i]=(ubyte)(d->x>>F)
ldy.z i
lda.z __27
sta cmRX,y
// d->y>>F
ldx #F
ldy #3
lda (d),y
sta.z __28
iny
lda (d),y
sta.z __28+1
cpx #0
beq !e+
!:
lda.z __28+1
cmp #$80
ror.z __28+1
ror.z __28
dex
bne !-
!e:
// cmRY[i]=(ubyte)(d->y>>F)
ldy.z i
lda.z __28
sta cmRY,y
__b24:
// for (i=0,d=dTab; i<objects ;i+=1,++d)
lda #9
clc
adc.z d
sta.z d
bcc !+
inc.z d+1
!:
// i+=1
inc.z i
jmp __b17
__b22:
// d->vy=-1<<F
lda #6
tay
lda #-1<<F
sta (d),y
jmp __b23
__b20:
// d->ax=1
lda #7
tay
lda #1
sta (d),y
jmp __b21
__b13:
// &dTab[i]
txa
asl
asl
asl
stx.z $ff
clc
adc.z $ff
// d=&dTab[i]
clc
adc #<dTab
sta.z d1
lda #>dTab
adc #0
sta.z d1+1
// d->s=type
lda.z type
ldy #0
sta (d1),y
// type+=1
inc.z type
// if (type>=6)
lda.z type
cmp #6
bcc __b14
tya
sta.z type
__b14:
// d->x=112<<F
ldy #1
lda #<$70<<F
sta (d1),y
iny
lda #>$70<<F
sta (d1),y
// d->vx=(sbyte)i
lda #5
tay
txa
sta (d1),y
// d->ax=1
lda #7
tay
lda #1
sta (d1),y
// d->y=24<<F
ldy #3
lda #<$18<<F
sta (d1),y
iny
lda #>$18<<F
sta (d1),y
// d->vy=1<<F
lda #6
tay
lda #1<<F
sta (d1),y
// d->ay=1
lda #8
tay
lda #1
sta (d1),y
// i+=1
inx
jmp __b12
__b9:
// chrPtr[c]=vicPtr[c]
lda.z c_1
clc
adc #<$d000
sta.z __111
lda.z c_1+1
adc #>$d000
sta.z __111+1
lda.z c_1
clc
adc #<$f800
sta.z __112
lda.z c_1+1
adc #>$f800
sta.z __112+1
ldy #0
lda (__111),y
sta (__112),y
// c+=1
inc.z c_1
bne !+
inc.z c_1+1
!:
jmp __b8
__b7:
// scrPtr[c]=32
lda.z c
clc
adc #<$e000
sta.z __109
lda.z c+1
adc #>$e000
sta.z __109+1
lda #$20
ldy #0
sta (__109),y
// colPtr[c]=14
lda.z c
clc
adc #<$d800
sta.z __110
lda.z c+1
adc #>$d800
sta.z __110+1
lda #$e
sta (__110),y
// c+=1
inc.z c
bne !+
inc.z c+1
!:
jmp __b6
__b5:
// cmRF[i]=255
lda #$ff
sta cmRF,x
// i+=1
inx
jmp __b4
__b3:
// cmIT[i]=255
lda #$ff
sta cmIT,x
// i+=1
inx
jmp __b2
}
// DelSprite(byte register(X) sn)
DelSprite: {
// cmRY[sn]=255
// drop sprite, will be removed from IT in IRQ
lda #$ff
sta cmRY,x
// cmRF[sn]=rfDrop
lda #rfDrop
sta cmRF,x
// }
rts
}
// Print00(byte register(X) v0)
Print00: {
ldy #'0'
__b1:
// while (v>=10)
cpx #$a
bcs __b2
// *p++=c
sty $e000+$3d7
ldy #'0'
__b4:
// while (v>=1)
cpx #1
bcs __b5
// *p++=c
sty $e000+$3d7+1
// }
rts
__b5:
// ++c;
iny
// v-=1
dex
jmp __b4
__b2:
// ++c;
iny
// v-=10
txa
axs #$a
jmp __b1
}
// sprite support functions
//
GetSprite: {
ldx #0
__b1:
// for (t0=0;t0<maxSprites;++t0)
cpx #maxSprites
bcc __b2
ldx #$ff
// }
rts
__b2:
// if (cmRF[t0]>=rfDrop)
lda cmRF,x
cmp #rfDrop
bcc __b3
// cmRF[t0]=0
lda #0
sta cmRF,x
rts
__b3:
// for (t0=0;t0<maxSprites;++t0)
inx
jmp __b1
}
// AddSprite(byte register(X) sn)
AddSprite: {
// if (rfDrop==cmRF[sn])
lda cmRF,x
cmp #rfDrop
beq __b1
ldy #0
__b2:
// for
// (t0=0;t0<maxSprites;t0+=1)
cpy #maxSprites
bcc __b3
// }
rts
__b3:
// if (cmIT[t0]>=128)
lda cmIT,y
cmp #$80
bcc __b4
// cmRF[sn]=0
lda #0
sta cmRF,x
// cmIT[t0]=sn
txa
sta cmIT,y
rts
__b4:
// t0+=1
iny
jmp __b2
__b1:
// cmRF[sn]=0
lda #0
sta cmRF,x
rts
}
lcSprMapTab: .fill maxSprImages, 0
lcSprColTab: .fill maxC64Images, 0
cmIT: .fill maxSprites+1, 0
cmSI: .fill maxSprites, 0
cmRX: .fill maxSprites, 0
cmRY: .fill maxSprites, 0
cmRF: .fill maxSprites, 0
dTab: .fill 9*maxDrawObjects, 0

View File

@ -0,0 +1,304 @@
(signed word()) main()
main: scope:[main] from
[0] *((const byte*) lcSprMapTab) ← (const byte) sprOff
[1] *((const byte*) lcSprMapTab+(byte) 1) ← (const byte) sprOff+(byte) 1
[2] *((const byte*) lcSprMapTab+(byte) 2) ← (const byte) sprOff+(byte) 2
[3] *((const byte*) lcSprMapTab+(byte) 3) ← (const byte) sprOff+(byte) 3
[4] *((const byte*) lcSprMapTab+(byte) 4) ← (const byte) sprOff+(byte) 4
[5] *((const byte*) lcSprMapTab+(byte) 5) ← (const byte) sprOff+(byte) 5
[6] *((const byte*) lcSprColTab+(const byte) sprOff+(byte) 1) ← (byte) $a|(const byte) lfMC
[7] *((const byte*) lcSprColTab+(const byte) sprOff) ← *((const byte*) lcSprColTab+(const byte) sprOff+(byte) 1)
[8] *((const byte*) lcSprColTab+(const byte) sprOff+(byte) 3) ← (byte) 5|(const byte) lfMC
[9] *((const byte*) lcSprColTab+(const byte) sprOff+(byte) 2) ← *((const byte*) lcSprColTab+(const byte) sprOff+(byte) 3)
[10] *((const byte*) lcSprColTab+(const byte) sprOff+(byte) 5) ← (byte) $e|(const byte) lfMC
[11] *((const byte*) lcSprColTab+(const byte) sprOff+(byte) 4) ← *((const byte*) lcSprColTab+(const byte) sprOff+(byte) 5)
to:main::@2
main::@2: scope:[main] from main main::@3
[12] (byte) main::i#12 ← phi( main/(byte) 0 main::@3/(byte) main::i#2 )
[13] if((byte) main::i#12<(const byte) maxSprites+(byte) 1) goto main::@3
to:main::@4
main::@4: scope:[main] from main::@2 main::@5
[14] (byte) main::i#14 ← phi( main::@2/(byte) 0 main::@5/(byte) main::i#4 )
[15] if((byte) main::i#14<(const byte) maxSprites) goto main::@5
to:main::@6
main::@6: scope:[main] from main::@4 main::@7
[16] (word) main::c#10 ← phi( main::@7/(word) main::c#2 main::@4/(byte) 0 )
[17] if((word) main::c#10<(word) $3e8) goto main::@7
to:main::@39
main::@39: scope:[main] from main::@6
[18] *((byte*) 1) ← (byte) $33
to:main::@8
main::@8: scope:[main] from main::@39 main::@9
[19] (word) main::c#11 ← phi( main::@9/(word) main::c#4 main::@39/(byte) 0 )
[20] if((word) main::c#11<(word) $7f8) goto main::@9
to:main::@10
main::@10: scope:[main] from main::@8
[21] *((byte*) 1) ← (byte) $35
[22] *((byte*) 53248+(word) $d02) ← *((byte*) 53248+(word) $d02) | (byte) 3
[23] *((byte*) 53248+(word) $d00) ← *((byte*) 53248+(word) $d00) & ~(byte) 3
to:main::@11
main::@11: scope:[main] from main::@10
[24] *((byte*) 57344+(word) $3e5) ← (byte) 'P'-(byte) 'A'+(byte) 1
[25] *((byte*) 57344+(word) $3e6) ← (byte) 1
[26] *((byte*) 57344+(word) $3e7) ← (byte) 'L'-(byte) 'A'+(byte) 1
to:main::@1
main::@1: scope:[main] from main::@11
[27] *((byte*) 57344+(word) $3cf) ← (byte) 'B'-(byte) 'A'+(byte) 1
[28] *((byte*) 57344+(word)(number) $3cf+(number) 1) ← (byte) 'U'-(byte) 'A'+(byte) 1
[29] *((byte*) 57344+(word)(number) $3cf+(number) 2) ← (byte) 'B'-(byte) 'A'+(byte) 1
[30] *((byte*) 57344+(word)(number) $3cf+(number) 3) ← (byte) 'B'-(byte) 'A'+(byte) 1
[31] *((byte*) 57344+(word)(number) $3cf+(number) 4) ← (byte) 'L'-(byte) 'A'+(byte) 1
[32] *((byte*) 57344+(word)(number) $3cf+(number) 5) ← (byte) 'E'-(byte) 'A'+(byte) 1
[33] *((byte*) 57344+(word)(number) $3cf+(number) 6) ← (byte) 'S'-(byte) 'A'+(byte) 1
[34] *((byte*) 57344+(word)(number) $3cf+(number) 7) ← (byte) ':'
to:main::@12
main::@12: scope:[main] from main::@1 main::@15
[35] (byte) main::type#4 ← phi( main::@1/(byte) 0 main::@15/(byte) main::type#10 )
[35] (byte) main::i#17 ← phi( main::@1/(byte) 0 main::@15/(byte) main::i#7 )
[36] if((byte) main::i#17<(const byte) maxDrawObjects) goto main::@13
to:main::@16
main::@16: scope:[main] from main::@12 main::@35
[37] (word) main::oCount#17 ← phi( main::@12/(word) 0 main::@35/(word) main::oCount#20 )
[37] (byte) main::stopIt#5 ← phi( main::@12/(byte) 0 main::@35/(byte) main::stopIt#15 )
[37] (word) main::c#16 ← phi( main::@12/(byte) 0 main::@35/(word) main::c#18 )
[37] (byte) main::objects#9 ← phi( main::@12/(byte) 0 main::@35/(byte) main::objects#17 )
to:main::@17
main::@17: scope:[main] from main::@16 main::@24
[38] (struct $5*) main::d#10 ← phi( main::@16/(const struct $5*) dTab main::@24/(struct $5*) main::d#2 )
[38] (byte) main::i#22 ← phi( main::@16/(byte) 0 main::@24/(byte) main::i#9 )
[39] if((byte) main::i#22<(byte) main::objects#9) goto main::@18
to:main::@19
main::@19: scope:[main] from main::@17
[40] (word) main::c#7 ← (word) main::c#16 + (byte) 1
[41] if((word) main::c#7<(byte) $e) goto main::@33
to:main::@30
main::@30: scope:[main] from main::@19
[42] if((byte) 0!=(byte) main::stopIt#5) goto main::@33
to:main::@42
main::@42: scope:[main] from main::@30
[43] if((byte) main::objects#9<(const byte) maxDrawObjects) goto main::@31
to:main::@33
main::@33: scope:[main] from main::@19 main::@30 main::@41 main::@42 main::@43
[44] (word) main::c#18 ← phi( main::@19/(word) main::c#7 main::@30/(byte) 0 main::@41/(byte) 0 )
[44] (byte) main::objects#12 ← phi( main::@19/(byte) main::objects#9 main::@30/(byte) main::objects#9 main::@41/(byte) main::objects#1 )
to:main::@36
main::@36: scope:[main] from main::@33
[45] if((word) main::oCount#17<=(byte) 0) goto main::@34
to:main::@37
main::@37: scope:[main] from main::@36
[46] (word) main::oCount#2 ← (word) main::oCount#17 - (byte) 1
to:main::@34
main::@34: scope:[main] from main::@36 main::@37
[47] (word) main::oCount#7 ← phi( main::@36/(word) main::oCount#17 main::@37/(word) main::oCount#2 )
[48] if((word) main::oCount#7<(byte) 2+(byte) 1) goto main::@35
to:main::@44
main::@44: scope:[main] from main::@34
[49] if((byte) main::objects#12>(byte) 0) goto main::@38
to:main::@35
main::@38: scope:[main] from main::@44
[50] (byte) main::objects#15 ← (byte) main::objects#12 - (byte) 1
[51] (byte) DelSprite::sn#0 ← (byte) main::objects#15
[52] call DelSprite
to:main::@35
main::@35: scope:[main] from main::@34 main::@38 main::@44
[53] (word) main::oCount#20 ← phi( main::@34/(word) main::oCount#7 main::@38/(byte) 0 )
[53] (byte) main::stopIt#15 ← phi( main::@34/(byte) main::stopIt#5 main::@38/(byte) 1 )
[53] (byte) main::objects#17 ← phi( main::@34/(byte) main::objects#12 main::@38/(byte) main::objects#15 )
[54] (byte) Print00::v0#0 ← (byte) main::objects#17
[55] call Print00
to:main::@16
main::@31: scope:[main] from main::@42
[56] (byte) main::objects#1 ← (byte) main::objects#9 + (byte) 1
[57] call GetSprite
[58] (byte) GetSprite::return#4 ← (byte) GetSprite::return#2
to:main::@40
main::@40: scope:[main] from main::@31
[59] (byte) main::i#11 ← (byte) GetSprite::return#4
to:main::@43
main::@43: scope:[main] from main::@40
[60] if((byte) main::i#11<(byte) $80) goto main::@32
to:main::@33
main::@32: scope:[main] from main::@43
[61] (byte) AddSprite::sn#1 ← (byte) main::i#11
[62] call AddSprite
to:main::@41
main::@41: scope:[main] from main::@32
[63] *((const byte*) cmRY + (byte) main::i#11) ← (byte) 0
[64] *((const byte*) cmRF + (byte) main::i#11) ← *((const byte*) cmRY + (byte) main::i#11)
[65] *((const byte*) cmRX + (byte) main::i#11) ← *((const byte*) cmRF + (byte) main::i#11)
[66] *((const byte*) cmSI + (byte) main::i#11) ← *((const byte*) cmRX + (byte) main::i#11)
to:main::@33
main::@18: scope:[main] from main::@17
[67] *((signed byte*)(struct $5*) main::d#10 + (byte) 5) ← *((signed byte*)(struct $5*) main::d#10 + (byte) 5) + *((signed byte*)(struct $5*) main::d#10 + (byte) 7)
[68] if(*((signed byte*)(struct $5*) main::d#10 + (byte) 5)<(signed byte) -$20) goto main::@20
to:main::@25
main::@25: scope:[main] from main::@18
[69] if(*((signed byte*)(struct $5*) main::d#10 + (byte) 5)<(signed byte) $20+(signed byte) 1) goto main::@21
to:main::@26
main::@26: scope:[main] from main::@25
[70] *((signed byte*)(struct $5*) main::d#10 + (byte) 7) ← (signed byte) -1
to:main::@21
main::@21: scope:[main] from main::@20 main::@25 main::@26
[71] if(*((signed word*)(struct $5*) main::d#10 + (byte) 3)>(signed word)(byte) $f8<<(const byte) F) goto main::@22
to:main::@27
main::@27: scope:[main] from main::@21
[72] if(*((signed word*)(struct $5*) main::d#10 + (byte) 3)>=(signed word)(byte) $18<<(const byte) F) goto main::@23
to:main::@28
main::@28: scope:[main] from main::@27
[73] *((signed byte*)(struct $5*) main::d#10 + (byte) 6) ← (signed byte)(byte) 1<<(const byte) F
to:main::@23
main::@23: scope:[main] from main::@22 main::@27 main::@28
[74] *((signed word*)(struct $5*) main::d#10 + (byte) 1) ← *((signed word*)(struct $5*) main::d#10 + (byte) 1) + *((signed byte*)(struct $5*) main::d#10 + (byte) 5)
[75] *((signed word*)(struct $5*) main::d#10 + (byte) 3) ← *((signed word*)(struct $5*) main::d#10 + (byte) 3) + *((signed byte*)(struct $5*) main::d#10 + (byte) 6)
[76] if(*((const byte*) cmRF + (byte) main::i#22)>=(byte) $80) goto main::@24
to:main::@29
main::@29: scope:[main] from main::@23
[77] *((const byte*) cmSI + (byte) main::i#22) ← *((byte*)(struct $5*) main::d#10)
[78] (signed word~) main::$27 ← *((signed word*)(struct $5*) main::d#10 + (byte) 1) >> (const byte) F
[79] *((const byte*) cmRX + (byte) main::i#22) ← (byte)(signed word~) main::$27
[80] (signed word~) main::$28 ← *((signed word*)(struct $5*) main::d#10 + (byte) 3) >> (const byte) F
[81] *((const byte*) cmRY + (byte) main::i#22) ← (byte)(signed word~) main::$28
to:main::@24
main::@24: scope:[main] from main::@23 main::@29
[82] (struct $5*) main::d#2 ← (struct $5*) main::d#10 + (byte) 9
[83] (byte) main::i#9 ← (byte) main::i#22 + (byte) 1
to:main::@17
main::@22: scope:[main] from main::@21
[84] *((signed byte*)(struct $5*) main::d#10 + (byte) 6) ← (signed byte)(byte) -1<<(const byte) F
to:main::@23
main::@20: scope:[main] from main::@18
[85] *((signed byte*)(struct $5*) main::d#10 + (byte) 7) ← (signed byte) 1
to:main::@21
main::@13: scope:[main] from main::@12
[86] (byte~) main::$132 ← (byte) main::i#17 << (byte) 3
[87] (byte~) main::$52 ← (byte~) main::$132 + (byte) main::i#17
[88] (struct $5*) main::d1#0 ← (const struct $5*) dTab + (byte~) main::$52
[89] *((byte*)(struct $5*) main::d1#0) ← (byte) main::type#4
[90] (byte) main::type#2 ← (byte) main::type#4 + (byte) 1
[91] if((byte) main::type#2<(byte) 6) goto main::@45
to:main::@14
main::@45: scope:[main] from main::@13
[92] phi()
to:main::@14
main::@14: scope:[main] from main::@13 main::@45
[93] (byte) main::type#10 ← phi( main::@45/(byte) main::type#2 main::@13/(byte) 0 )
[94] *((signed word*)(struct $5*) main::d1#0 + (byte) 1) ← (signed word)(byte) $70<<(const byte) F
[95] *((signed byte*)(struct $5*) main::d1#0 + (byte) 5) ← (signed byte)(byte) main::i#17
[96] *((signed byte*)(struct $5*) main::d1#0 + (byte) 7) ← (signed byte) 1
[97] *((signed word*)(struct $5*) main::d1#0 + (byte) 3) ← (signed word)(byte) $18<<(const byte) F
[98] *((signed byte*)(struct $5*) main::d1#0 + (byte) 6) ← (signed byte)(byte) 1<<(const byte) F
[99] *((signed byte*)(struct $5*) main::d1#0 + (byte) 8) ← (signed byte) 1
to:main::@15
main::@15: scope:[main] from main::@14
[100] (byte) main::i#7 ← (byte) main::i#17 + (byte) 1
to:main::@12
main::@9: scope:[main] from main::@8
[101] (byte*~) main::$111 ← (byte*) 53248 + (word) main::c#11
[102] (byte*~) main::$112 ← (byte*) 63488 + (word) main::c#11
[103] *((byte*~) main::$112) ← *((byte*~) main::$111)
[104] (word) main::c#4 ← (word) main::c#11 + (byte) 1
to:main::@8
main::@7: scope:[main] from main::@6
[105] (byte*~) main::$109 ← (byte*) 57344 + (word) main::c#10
[106] *((byte*~) main::$109) ← (byte) $20
[107] (byte*~) main::$110 ← (byte*) 55296 + (word) main::c#10
[108] *((byte*~) main::$110) ← (byte) $e
[109] (word) main::c#2 ← (word) main::c#10 + (byte) 1
to:main::@6
main::@5: scope:[main] from main::@4
[110] *((const byte*) cmRF + (byte) main::i#14) ← (byte) $ff
[111] (byte) main::i#4 ← (byte) main::i#14 + (byte) 1
to:main::@4
main::@3: scope:[main] from main::@2
[112] *((const byte*) cmIT + (byte) main::i#12) ← (byte) $ff
[113] (byte) main::i#2 ← (byte) main::i#12 + (byte) 1
to:main::@2
(void()) DelSprite((byte) DelSprite::sn)
DelSprite: scope:[DelSprite] from main::@38
[114] *((const byte*) cmRY + (byte) DelSprite::sn#0) ← (byte) $ff
[115] *((const byte*) cmRF + (byte) DelSprite::sn#0) ← (const byte) rfDrop
to:DelSprite::@return
DelSprite::@return: scope:[DelSprite] from DelSprite
[116] return
to:@return
(void()) Print00((byte*) Print00::p , (byte) Print00::v0)
Print00: scope:[Print00] from main::@35
[117] phi()
to:Print00::@1
Print00::@1: scope:[Print00] from Print00 Print00::@2
[118] (byte) Print00::c#5 ← phi( Print00/(byte) '0' Print00::@2/(byte) Print00::c#2 )
[118] (byte) Print00::v#3 ← phi( Print00/(byte) Print00::v0#0 Print00::@2/(byte) Print00::v#1 )
[119] if((byte) Print00::v#3>=(byte) $a) goto Print00::@2
to:Print00::@3
Print00::@3: scope:[Print00] from Print00::@1
[120] *((word) $e000+(byte*) 983) ← (byte) Print00::c#5
to:Print00::@4
Print00::@4: scope:[Print00] from Print00::@3 Print00::@5
[121] (byte) Print00::c#10 ← phi( Print00::@3/(byte) '0' Print00::@5/(byte) Print00::c#4 )
[121] (byte) Print00::v#5 ← phi( Print00::@3/(byte) Print00::v#3 Print00::@5/(byte) Print00::v#2 )
[122] if((byte) Print00::v#5>=(byte) 1) goto Print00::@5
to:Print00::@6
Print00::@6: scope:[Print00] from Print00::@4
[123] *((word) $e000+(byte*) 983+(byte) 1) ← (byte) Print00::c#10
to:Print00::@return
Print00::@return: scope:[Print00] from Print00::@6
[124] return
to:@return
Print00::@5: scope:[Print00] from Print00::@4
[125] (byte) Print00::c#4 ← ++ (byte) Print00::c#10
[126] (byte) Print00::v#2 ← (byte) Print00::v#5 - (byte) 1
to:Print00::@4
Print00::@2: scope:[Print00] from Print00::@1
[127] (byte) Print00::c#2 ← ++ (byte) Print00::c#5
[128] (byte) Print00::v#1 ← (byte) Print00::v#3 - (byte) $a
to:Print00::@1
(byte()) GetSprite()
GetSprite: scope:[GetSprite] from main::@31
[129] phi()
to:GetSprite::@1
GetSprite::@1: scope:[GetSprite] from GetSprite GetSprite::@3
[130] (byte) GetSprite::t0#3 ← phi( GetSprite/(byte) 0 GetSprite::@3/(byte) GetSprite::t0#2 )
[131] if((byte) GetSprite::t0#3<(const byte) maxSprites) goto GetSprite::@2
to:GetSprite::@return
GetSprite::@return: scope:[GetSprite] from GetSprite::@1 GetSprite::@4
[132] (byte) GetSprite::return#2 ← phi( GetSprite::@1/(byte) $ff GetSprite::@4/(byte) GetSprite::t0#3 )
[133] return
to:@return
GetSprite::@2: scope:[GetSprite] from GetSprite::@1
[134] if(*((const byte*) cmRF + (byte) GetSprite::t0#3)<(const byte) rfDrop) goto GetSprite::@3
to:GetSprite::@4
GetSprite::@4: scope:[GetSprite] from GetSprite::@2
[135] *((const byte*) cmRF + (byte) GetSprite::t0#3) ← (byte) 0
to:GetSprite::@return
GetSprite::@3: scope:[GetSprite] from GetSprite::@2
[136] (byte) GetSprite::t0#2 ← ++ (byte) GetSprite::t0#3
to:GetSprite::@1
(void()) AddSprite((byte) AddSprite::sn)
AddSprite: scope:[AddSprite] from main::@32
[137] if((const byte) rfDrop==*((const byte*) cmRF + (byte) AddSprite::sn#1)) goto AddSprite::@1
to:AddSprite::@2
AddSprite::@2: scope:[AddSprite] from AddSprite AddSprite::@4
[138] (byte) AddSprite::t0#3 ← phi( AddSprite/(byte) 0 AddSprite::@4/(byte) AddSprite::t0#2 )
[139] if((byte) AddSprite::t0#3<(const byte) maxSprites) goto AddSprite::@3
to:AddSprite::@return
AddSprite::@return: scope:[AddSprite] from AddSprite::@1 AddSprite::@2 AddSprite::@5
[140] return
to:@return
AddSprite::@3: scope:[AddSprite] from AddSprite::@2
[141] if(*((const byte*) cmIT + (byte) AddSprite::t0#3)<(byte) $80) goto AddSprite::@4
to:AddSprite::@5
AddSprite::@5: scope:[AddSprite] from AddSprite::@3
[142] *((const byte*) cmRF + (byte) AddSprite::sn#1) ← (byte) 0
[143] *((const byte*) cmIT + (byte) AddSprite::t0#3) ← (byte) AddSprite::sn#1
to:AddSprite::@return
AddSprite::@4: scope:[AddSprite] from AddSprite::@3
[144] (byte) AddSprite::t0#2 ← (byte) AddSprite::t0#3 + (byte) 1
to:AddSprite::@2
AddSprite::@1: scope:[AddSprite] from AddSprite
[145] *((const byte*) cmRF + (byte) AddSprite::sn#1) ← (byte) 0
to:AddSprite::@return

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,199 @@
(signed byte) $5::ax
(signed byte) $5::ay
(byte) $5::s
(signed byte) $5::vx
(signed byte) $5::vy
(signed word) $5::x
(signed word) $5::y
(void()) AddSprite((byte) AddSprite::sn)
(label) AddSprite::@1
(label) AddSprite::@2
(label) AddSprite::@3
(label) AddSprite::@4
(label) AddSprite::@5
(label) AddSprite::@return
(byte) AddSprite::sn
(byte) AddSprite::sn#1 reg byte x 59.28571428571429
(byte) AddSprite::t0
(byte) AddSprite::t0#2 reg byte y 20002.0
(byte) AddSprite::t0#3 reg byte y 10026.25
(void()) DelSprite((byte) DelSprite::sn)
(label) DelSprite::@return
(byte) DelSprite::sn
(byte) DelSprite::sn#0 reg byte x 106.5
(const byte) F = (number) 3
(byte()) GetSprite()
(label) GetSprite::@1
(label) GetSprite::@2
(label) GetSprite::@3
(label) GetSprite::@4
(label) GetSprite::@return
(byte) GetSprite::return
(byte) GetSprite::return#2 reg byte x 37.33333333333333
(byte) GetSprite::return#4 reg byte x 22.0
(byte) GetSprite::t0
(byte) GetSprite::t0#2 reg byte x 20002.0
(byte) GetSprite::t0#3 reg byte x 10051.5
(void()) Print00((byte*) Print00::p , (byte) Print00::v0)
(label) Print00::@1
(label) Print00::@2
(label) Print00::@3
(label) Print00::@4
(label) Print00::@5
(label) Print00::@6
(label) Print00::@return
(byte) Print00::c
(byte) Print00::c#10 reg byte y 10051.5
(byte) Print00::c#2 reg byte y 10001.0
(byte) Print00::c#4 reg byte y 10001.0
(byte) Print00::c#5 reg byte y 10051.5
(byte*) Print00::p
(byte) Print00::v
(byte) Print00::v#1 reg byte x 20002.0
(byte) Print00::v#2 reg byte x 20002.0
(byte) Print00::v#3 reg byte x 7551.25
(byte) Print00::v#5 reg byte x 10034.666666666666
(byte) Print00::v0
(byte) Print00::v0#0 reg byte x 56.0
(const byte*) cmIT[(const byte) maxSprites+(byte) 1] = { fill( maxSprites+1, 0) }
(const byte*) cmRF[(const byte) maxSprites] = { fill( maxSprites, 0) }
(const byte*) cmRX[(const byte) maxSprites] = { fill( maxSprites, 0) }
(const byte*) cmRY[(const byte) maxSprites] = { fill( maxSprites, 0) }
(const byte*) cmSI[(const byte) maxSprites] = { fill( maxSprites, 0) }
(const struct $5*) dTab[(const byte) maxDrawObjects] = { fill( maxDrawObjects, 0) }
(const byte*) lcSprColTab[(const byte) maxC64Images] = { fill( maxC64Images, 0) }
(const byte*) lcSprMapTab[(const byte) maxSprImages] = { fill( maxSprImages, 0) }
(const byte) lfMC = (number) $10
(signed word()) main()
(byte*~) main::$109 zp[2]:26 22.0
(byte*~) main::$110 zp[2]:28 22.0
(byte*~) main::$111 zp[2]:22 11.0
(byte*~) main::$112 zp[2]:24 22.0
(byte~) main::$132 reg byte a 22.0
(signed word~) main::$27 zp[2]:16 101.0
(signed word~) main::$28 zp[2]:18 101.0
(byte~) main::$52 reg byte a 22.0
(label) main::@1
(label) main::@10
(label) main::@11
(label) main::@12
(label) main::@13
(label) main::@14
(label) main::@15
(label) main::@16
(label) main::@17
(label) main::@18
(label) main::@19
(label) main::@2
(label) main::@20
(label) main::@21
(label) main::@22
(label) main::@23
(label) main::@24
(label) main::@25
(label) main::@26
(label) main::@27
(label) main::@28
(label) main::@29
(label) main::@3
(label) main::@30
(label) main::@31
(label) main::@32
(label) main::@33
(label) main::@34
(label) main::@35
(label) main::@36
(label) main::@37
(label) main::@38
(label) main::@39
(label) main::@4
(label) main::@40
(label) main::@41
(label) main::@42
(label) main::@43
(label) main::@44
(label) main::@45
(label) main::@5
(label) main::@6
(label) main::@7
(label) main::@8
(label) main::@9
(word) main::c
(word) main::c#10 c zp[2]:2 9.166666666666666
(word) main::c#11 c_1 zp[2]:4 11.0
(word) main::c#16 c_2 zp[2]:7 1.0
(word) main::c#18 c_2 zp[2]:7 1.8333333333333333
(word) main::c#2 c zp[2]:2 22.0
(word) main::c#4 c_1 zp[2]:4 22.0
(word) main::c#7 c_2 zp[2]:7 16.5
(struct $5*) main::d
(struct $5*) main::d#10 d zp[2]:11 10.631578947368421
(struct $5*) main::d#2 d zp[2]:11 101.0
(struct $5*) main::d1
(struct $5*) main::d1#0 d1 zp[2]:20 1.0
(byte) main::i
(byte) main::i#11 reg byte x 15.714285714285714
(byte) main::i#12 reg byte x 14.666666666666666
(byte) main::i#14 reg byte x 14.666666666666666
(byte) main::i#17 reg byte x 3.4375
(byte) main::i#2 reg byte x 22.0
(byte) main::i#22 i zp[1]:10 35.35
(byte) main::i#4 reg byte x 22.0
(byte) main::i#7 reg byte x 22.0
(byte) main::i#9 i zp[1]:10 202.0
(word) main::oCount
(word) main::oCount#17 oCount zp[2]:14 1.1282051282051282
(word) main::oCount#2 oCount zp[2]:14 22.0
(word) main::oCount#20 oCount zp[2]:14 7.333333333333333
(word) main::oCount#7 oCount zp[2]:14 22.0
(byte) main::objects
(byte) main::objects#1 objects zp[1]:13 2.0
(byte) main::objects#12 objects zp[1]:13 11.0
(byte) main::objects#15 objects zp[1]:13 11.0
(byte) main::objects#17 objects zp[1]:13 14.666666666666666
(byte) main::objects#9 objects zp[1]:13 6.000000000000001
(signed word) main::return
(byte) main::stopIt
(byte) main::stopIt#15 stopIt zp[1]:9 7.333333333333333
(byte) main::stopIt#5 stopIt zp[1]:9 0.7857142857142858
(byte) main::type
(byte) main::type#10 type zp[1]:6 2.75
(byte) main::type#2 type zp[1]:6 11.0
(byte) main::type#4 type zp[1]:6 5.5
(const byte) maxC64Images = (number) $100
(const byte) maxDrawObjects = (number) $18
(const byte) maxSprImages = (number) 8
(const byte) maxSprites = (number) $20
(const byte) rfDrop = (number) $fe
(const byte) sprOff = (number) $40
reg byte x [ main::i#12 main::i#2 ]
reg byte x [ main::i#14 main::i#4 ]
zp[2]:2 [ main::c#10 main::c#2 ]
zp[2]:4 [ main::c#11 main::c#4 ]
reg byte x [ main::i#17 main::i#7 ]
zp[1]:6 [ main::type#4 main::type#10 main::type#2 ]
zp[2]:7 [ main::c#16 main::c#18 main::c#7 ]
zp[1]:9 [ main::stopIt#5 main::stopIt#15 ]
zp[1]:10 [ main::i#22 main::i#9 ]
zp[2]:11 [ main::d#10 main::d#2 ]
zp[1]:13 [ main::objects#12 main::objects#9 main::objects#17 main::objects#1 main::objects#15 ]
zp[2]:14 [ main::oCount#7 main::oCount#17 main::oCount#20 main::oCount#2 ]
reg byte y [ Print00::c#5 Print00::c#2 ]
reg byte x [ Print00::v#5 Print00::v#3 Print00::v0#0 Print00::v#1 Print00::v#2 ]
reg byte y [ Print00::c#10 Print00::c#4 ]
reg byte x [ GetSprite::return#2 GetSprite::t0#3 GetSprite::t0#2 ]
reg byte y [ AddSprite::t0#3 AddSprite::t0#2 ]
reg byte x [ DelSprite::sn#0 ]
reg byte x [ GetSprite::return#4 ]
reg byte x [ main::i#11 ]
reg byte x [ AddSprite::sn#1 ]
zp[2]:16 [ main::$27 ]
zp[2]:18 [ main::$28 ]
reg byte a [ main::$132 ]
reg byte a [ main::$52 ]
zp[2]:20 [ main::d1#0 ]
zp[2]:22 [ main::$111 ]
zp[2]:24 [ main::$112 ]
zp[2]:26 [ main::$109 ]
zp[2]:28 [ main::$110 ]