1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-09-08 17:54:40 +00:00

Added a few missing fragments.

This commit is contained in:
Jesper Gravgaard 2019-07-14 20:40:44 +02:00
parent 9264967b3f
commit d1333cdbe4
6 changed files with 47 additions and 37 deletions

View File

@ -0,0 +1,9 @@
txa
cpx #0
beq !e+
!l:
cmp #$80
ror
dex
bne !l-
!e:

View File

@ -0,0 +1,9 @@
tya
cpy #0
beq !e+
!l:
cmp #$80
ror
dey
bne !l-
!e:

View File

@ -89,7 +89,7 @@ void plexSort() {
// Show the next sprite.
// plexSort() prepares showing the sprites
void plexShowSprite() {
byte plex_sprite_idx2 = plex_sprite_idx<<1;
byte plex_sprite_idx2 = plex_sprite_idx*2;
byte ypos = PLEX_YPOS[PLEX_SORTED_IDX[plex_show_idx]];
SPRITES_YPOS[plex_sprite_idx2] = ypos;
plexFreeAdd(ypos);
@ -103,7 +103,7 @@ void plexShowSprite() {
}
plex_sprite_idx = (plex_sprite_idx+1)&7;
plex_show_idx++;
plex_sprite_msb <<=1;
plex_sprite_msb *=2;
if(plex_sprite_msb==0) {
plex_sprite_msb = 1;
}

View File

@ -38,11 +38,11 @@ const byte NUM_PROCESSING = 8;
// Struct holding char being processed
struct ProcessingChar {
// x-position (0-39)
byte x;
char x;
// y-position (0-24)
byte y;
char y;
// squared distance to center (0-569)
byte dist;
char dist;
};
// Distance value meaning not found
@ -51,27 +51,25 @@ const byte NOT_FOUND = 0xff;
// Struct holding sprite being processed
struct ProcessingSprite {
// sprite x-position. Fixed point [12.4]. Values (24-336)
word x;
unsigned int x;
// sprite y-position. Fixed point [12.4]. Values (30-228)
word y;
unsigned int y;
// sprite x velocity. Fixed point [12.4]
word vx;
unsigned int vx;
// sprite y velocity. Fixed point [12.4]
word vy;
unsigned int vy;
// sprite ID (0-7)
byte id;
char id;
// sprite pointer (0-255)
byte ptr;
char ptr;
// sprite color
byte col;
char col;
// status of the processing
enum { STATUS_FREE, STATUS_NEW, STATUS_PROCESSING } status;
// Pointer to screen char being processed (used for deletion)
byte* screenPtr;
char* screenPtr;
};
// Values for ProcessingSprite.status
// Sprites currently being processed in the interrupt
struct ProcessingSprite[NUM_PROCESSING] PROCESSING;

View File

@ -2117,17 +2117,7 @@ Removing always clobbered register reg byte a as potential for zp ZP_BYTE:9 [ at
Statement [31] (byte) atan2_8::angle#1 ← (byte) atan2_8::angle#6 >> (byte) 1 [ atan2_8::x#0 atan2_8::y#0 atan2_8::angle#1 ] ( main:2::atan2_8:12 [ main::y#4 main::x#2 main::screen#2 atan2_8::x#0 atan2_8::y#0 atan2_8::angle#1 ] ) always clobbers reg byte a
Statement [33] (byte) atan2_8::angle#4 ← (byte) $80 - (byte) atan2_8::angle#1 [ atan2_8::y#0 atan2_8::angle#4 ] ( main:2::atan2_8:12 [ main::y#4 main::x#2 main::screen#2 atan2_8::y#0 atan2_8::angle#4 ] ) always clobbers reg byte a
Statement [36] (byte) atan2_8::angle#5 ← - (byte) atan2_8::angle#11 [ atan2_8::angle#5 ] ( main:2::atan2_8:12 [ main::y#4 main::x#2 main::screen#2 atan2_8::angle#5 ] ) always clobbers reg byte a
Potential register analysis [39] atan2_8::xd#0 ← atan2_8::xi#3 >> atan2_8::i#2 missing fragment Fragment not found vbsaa=vbsxx_ror_vbuxx. Attempted variations vbsaa=vbsxx_ror_vbuxx allocation: reg byte a [ atan2_8::xd#0 ] reg byte x [ atan2_8::xi#3 atan2_8::xi#7 atan2_8::xi#0 atan2_8::xi#8 atan2_8::$7 atan2_8::xi#1 atan2_8::xi#2 ] reg byte x [ atan2_8::i#2 atan2_8::i#1 ]
Potential register analysis [39] atan2_8::xd#0 ← atan2_8::xi#3 >> atan2_8::i#2 missing fragment Fragment not found vbsaa=vbsyy_ror_vbuyy. Attempted variations vbsaa=vbsyy_ror_vbuyy allocation: reg byte a [ atan2_8::xd#0 ] reg byte y [ atan2_8::xi#3 atan2_8::xi#7 atan2_8::xi#0 atan2_8::xi#8 atan2_8::$7 atan2_8::xi#1 atan2_8::xi#2 ] reg byte y [ atan2_8::i#2 atan2_8::i#1 ]
MISSING FRAGMENTS
Fragment not found vbsaa=vbsxx_ror_vbuxx. Attempted variations vbsaa=vbsxx_ror_vbuxx
Fragment not found vbsaa=vbsyy_ror_vbuyy. Attempted variations vbsaa=vbsyy_ror_vbuyy
Statement [39] (signed byte) atan2_8::xd#0 ← (signed byte) atan2_8::xi#3 >> (byte) atan2_8::i#2 [ atan2_8::x#0 atan2_8::y#0 atan2_8::yi#3 atan2_8::xi#3 atan2_8::i#2 atan2_8::angle#12 atan2_8::xd#0 ] ( main:2::atan2_8:12 [ main::y#4 main::x#2 main::screen#2 atan2_8::x#0 atan2_8::y#0 atan2_8::yi#3 atan2_8::xi#3 atan2_8::i#2 atan2_8::angle#12 atan2_8::xd#0 ] ) always clobbers reg byte a
Potential register analysis [40] atan2_8::yd#0 ← atan2_8::yi#3 >> atan2_8::i#2 missing fragment Fragment not found vbsaa=vbsxx_ror_vbuxx. Attempted variations vbsaa=vbsxx_ror_vbuxx allocation: reg byte a [ atan2_8::yd#0 ] reg byte x [ atan2_8::yi#3 atan2_8::yi#7 atan2_8::yi#0 atan2_8::yi#11 atan2_8::$2 atan2_8::yi#1 atan2_8::yi#2 ] reg byte x [ atan2_8::i#2 atan2_8::i#1 ]
Potential register analysis [40] atan2_8::yd#0 ← atan2_8::yi#3 >> atan2_8::i#2 missing fragment Fragment not found vbsaa=vbsyy_ror_vbuyy. Attempted variations vbsaa=vbsyy_ror_vbuyy allocation: reg byte a [ atan2_8::yd#0 ] reg byte y [ atan2_8::yi#3 atan2_8::yi#7 atan2_8::yi#0 atan2_8::yi#11 atan2_8::$2 atan2_8::yi#1 atan2_8::yi#2 ] reg byte y [ atan2_8::i#2 atan2_8::i#1 ]
MISSING FRAGMENTS
Fragment not found vbsaa=vbsxx_ror_vbuxx. Attempted variations vbsaa=vbsxx_ror_vbuxx
Fragment not found vbsaa=vbsyy_ror_vbuyy. Attempted variations vbsaa=vbsyy_ror_vbuyy
Statement [40] (signed byte) atan2_8::yd#0 ← (signed byte) atan2_8::yi#3 >> (byte) atan2_8::i#2 [ atan2_8::x#0 atan2_8::y#0 atan2_8::yi#3 atan2_8::xi#3 atan2_8::i#2 atan2_8::angle#12 atan2_8::xd#0 atan2_8::yd#0 ] ( main:2::atan2_8:12 [ main::y#4 main::x#2 main::screen#2 atan2_8::x#0 atan2_8::y#0 atan2_8::yi#3 atan2_8::xi#3 atan2_8::i#2 atan2_8::angle#12 atan2_8::xd#0 atan2_8::yd#0 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:25 [ atan2_8::xd#0 ]
Statement [41] if((signed byte) atan2_8::yi#3>(signed byte) 0) goto atan2_8::@13 [ atan2_8::x#0 atan2_8::y#0 atan2_8::yi#3 atan2_8::xi#3 atan2_8::i#2 atan2_8::angle#12 atan2_8::xd#0 atan2_8::yd#0 ] ( main:2::atan2_8:12 [ main::y#4 main::x#2 main::screen#2 atan2_8::x#0 atan2_8::y#0 atan2_8::yi#3 atan2_8::xi#3 atan2_8::i#2 atan2_8::angle#12 atan2_8::xd#0 atan2_8::yd#0 ] ) always clobbers reg byte a

View File

@ -189,8 +189,8 @@ plexShowSprite: scope:[plexShowSprite] from loop::@21
(byte) plex_free_next#21 ← phi( loop::@21/(byte) plex_free_next#27 )
(byte) plex_show_idx#12 ← phi( loop::@21/(byte) plex_show_idx#23 )
(byte) plex_sprite_idx#12 ← phi( loop::@21/(byte) plex_sprite_idx#23 )
(byte~) plexShowSprite::$0 ← (byte) plex_sprite_idx#12 << (number) 1
(byte) plexShowSprite::plex_sprite_idx2#0 ← (byte~) plexShowSprite::$0
(number~) plexShowSprite::$0 ← (byte) plex_sprite_idx#12 * (number) 2
(byte) plexShowSprite::plex_sprite_idx2#0 ← (number~) plexShowSprite::$0
(byte) plexShowSprite::ypos#0 ← *((byte[PLEX_COUNT#0]) PLEX_YPOS#0 + *((byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plex_show_idx#12))
*((byte*) SPRITES_YPOS#0 + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte) plexShowSprite::ypos#0
(byte) plexShowSprite::plexFreeAdd1_ypos#0 ← (byte) plexShowSprite::ypos#0
@ -250,7 +250,7 @@ plexShowSprite::@2: scope:[plexShowSprite] from plexShowSprite::@1 plexShowSpri
(number~) plexShowSprite::$6 ← (number~) plexShowSprite::$5 & (number) 7
(byte) plex_sprite_idx#3 ← (number~) plexShowSprite::$6
(byte) plex_show_idx#3 ← ++ (byte) plex_show_idx#14
(byte) plex_sprite_msb#3 ← (byte) plex_sprite_msb#15 << (number) 1
(byte) plex_sprite_msb#3 ← (byte) plex_sprite_msb#15 * (number) 2
(bool~) plexShowSprite::$7 ← (byte) plex_sprite_msb#3 == (number) 0
(bool~) plexShowSprite::$8 ← ! (bool~) plexShowSprite::$7
if((bool~) plexShowSprite::$8) goto plexShowSprite::@return
@ -833,7 +833,7 @@ SYMBOL TABLE SSA
(byte*) plexInit::screen#0
(byte*) plexInit::screen#1
(void()) plexShowSprite()
(byte~) plexShowSprite::$0
(number~) plexShowSprite::$0
(byte~) plexShowSprite::$10
(byte~) plexShowSprite::$11
(byte~) plexShowSprite::$2
@ -1138,7 +1138,8 @@ Adding number conversion cast (unumber) 0 in (byte) plex_sprite_idx#1 ← (numbe
Adding number conversion cast (unumber) 1 in (byte) plex_sprite_msb#1 ← (number) 1
Adding number conversion cast (unumber) 0 in *((byte[8]) PLEX_FREE_YPOS#0 + (byte) plexSort::plexFreePrepare1_s#2) ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) plex_free_next#0 ← (number) 0
Adding number conversion cast (unumber) 1 in (byte~) plexShowSprite::$0 ← (byte) plex_sprite_idx#12 << (number) 1
Adding number conversion cast (unumber) 2 in (number~) plexShowSprite::$0 ← (byte) plex_sprite_idx#12 * (number) 2
Adding number conversion cast (unumber) plexShowSprite::$0 in (number~) plexShowSprite::$0 ← (byte) plex_sprite_idx#12 * (unumber)(number) 2
Adding number conversion cast (unumber) $15 in (number~) plexShowSprite::plexFreeAdd1_$0#0 ← (byte) plexShowSprite::plexFreeAdd1_ypos#1 + (number) $15
Adding number conversion cast (unumber) plexShowSprite::plexFreeAdd1_$0#0 in (number~) plexShowSprite::plexFreeAdd1_$0#0 ← (byte) plexShowSprite::plexFreeAdd1_ypos#1 + (unumber)(number) $15
Adding number conversion cast (unumber) 1 in (number~) plexShowSprite::plexFreeAdd1_$1#0 ← (byte) plex_free_next#12 + (number) 1
@ -1152,7 +1153,7 @@ Adding number conversion cast (unumber) 1 in (number~) plexShowSprite::$5 ← (b
Adding number conversion cast (unumber) plexShowSprite::$5 in (number~) plexShowSprite::$5 ← (byte) plex_sprite_idx#14 + (unumber)(number) 1
Adding number conversion cast (unumber) 7 in (number~) plexShowSprite::$6 ← (unumber~) plexShowSprite::$5 & (number) 7
Adding number conversion cast (unumber) plexShowSprite::$6 in (number~) plexShowSprite::$6 ← (unumber~) plexShowSprite::$5 & (unumber)(number) 7
Adding number conversion cast (unumber) 1 in (byte) plex_sprite_msb#3 ← (byte) plex_sprite_msb#15 << (number) 1
Adding number conversion cast (unumber) 2 in (byte) plex_sprite_msb#3 ← (byte) plex_sprite_msb#15 * (number) 2
Adding number conversion cast (unumber) 0 in (bool~) plexShowSprite::$7 ← (byte) plex_sprite_msb#3 == (number) 0
Adding number conversion cast (unumber) 1 in (byte) plex_sprite_msb#4 ← (number) 1
Adding number conversion cast (unumber) 0 in (byte) plex_free_next#4 ← (number) 0
@ -1234,7 +1235,7 @@ Simplifying constant integer cast 0
Simplifying constant integer cast 1
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 1
Simplifying constant integer cast 2
Simplifying constant integer cast $15
Simplifying constant integer cast 1
Simplifying constant integer cast 7
@ -1242,7 +1243,7 @@ Simplifying constant integer cast 0
Simplifying constant integer cast $ff
Simplifying constant integer cast 1
Simplifying constant integer cast 7
Simplifying constant integer cast 1
Simplifying constant integer cast 2
Simplifying constant integer cast 0
Simplifying constant integer cast 1
Simplifying constant integer cast 0
@ -1282,7 +1283,7 @@ Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) $15
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 7
@ -1290,7 +1291,7 @@ Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) $ff
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 7
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 0
@ -1312,6 +1313,7 @@ Inferred type updated to byte in (unumber~) plexInit::$1 ← (byte) PLEX_COUNT#0
Inferred type updated to byte in (unumber~) plexSort::$1 ← (byte) PLEX_COUNT#0 - (byte) 2
Inferred type updated to byte in (unumber~) plexSort::$2 ← (byte) plexSort::m#2 + (byte) 1
Inferred type updated to byte in (unumber~) plexSort::$5 ← (byte) plexSort::s#3 + (byte) 1
Inferred type updated to byte in (unumber~) plexShowSprite::$0 ← (byte) plex_sprite_idx#12 * (byte) 2
Inferred type updated to byte in (unumber~) plexShowSprite::plexFreeAdd1_$0#0 ← (byte) plexShowSprite::plexFreeAdd1_ypos#1 + (byte) $15
Inferred type updated to byte in (unumber~) plexShowSprite::plexFreeAdd1_$1#0 ← (byte) plex_free_next#12 + (byte) 1
Inferred type updated to byte in (unumber~) plexShowSprite::plexFreeAdd1_$2#0 ← (byte~) plexShowSprite::plexFreeAdd1_$1#0 & (byte) 7
@ -1725,7 +1727,9 @@ Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) init::$1 = init::$0|3
Constant (const byte) init::$5 = (byte)init::$4
Successful SSA optimization Pass2ConstantIdentification
Rewriting multiplication to use shift [24] (byte) plexShowSprite::plex_sprite_idx2#0 ← (byte) plex_sprite_idx#42 * (byte) 2
Rewriting multiplication to use shift [33] (byte~) plexShowSprite::$11 ← (byte) plexShowSprite::xpos_idx#0 * (const byte) SIZEOF_WORD
Rewriting multiplication to use shift [44] (byte) plex_sprite_msb#3 ← (byte) plex_sprite_msb#42 * (byte) 2
Rewriting multiplication to use shift [57] (byte~) init::$8 ← (byte) init::sx#2 * (const byte) SIZEOF_WORD
Successful SSA optimization Pass2MultiplyToShiftRewriting
Inlining constant with var siblings (const byte) plexInit::i#0
@ -4270,7 +4274,7 @@ loop: {
// plexSort() prepares showing the sprites
plexShowSprite: {
.label plex_sprite_idx2 = $c
// plex_sprite_idx2 = plex_sprite_idx<<1
// plex_sprite_idx2 = plex_sprite_idx*2
// [35] (byte) plexShowSprite::plex_sprite_idx2#0 ← (byte) plex_sprite_idx#42 << (byte) 1 -- vbuz1=vbuz2_rol_1
lda plex_sprite_idx
asl
@ -4352,7 +4356,7 @@ plexShowSprite: {
// plex_show_idx++;
// [53] (byte) plex_show_idx#15 ← ++ (byte) plex_show_idx#42 -- vbuz1=_inc_vbuz1
inc plex_show_idx
// plex_sprite_msb <<=1
// plex_sprite_msb *=2
// [54] (byte) plex_sprite_msb#3 ← (byte) plex_sprite_msb#42 << (byte) 1 -- vbuz1=vbuz1_rol_1
asl plex_sprite_msb
// if(plex_sprite_msb==0)