1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-11-14 23:04:57 +00:00

Moved sprite IRQ's to separate file.

This commit is contained in:
jespergravgaard 2018-12-26 00:39:38 +01:00
parent d9d28f4018
commit 53a161d52f
14 changed files with 822 additions and 782 deletions

View File

@ -100,14 +100,12 @@ public class TestPrograms {
compileAndCompare("tetris-npe");
}
//@Test
//public void testUnrollCall() throws IOException, URISyntaxException {
// compileAndCompare("unroll-call");
//}
@Test
public void testUnrollCall() throws IOException, URISyntaxException {
compileAndCompare("unroll-call");
}
*/
*/
@Test
public void testFastMultiply8() throws IOException, URISyntaxException {
compileAndCompare("examples/fastmultiply/fastmultiply8.kc");

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 334 B

View File

@ -0,0 +1,123 @@
// A sprite multiplexer covering the playfield with a black layer to give the pixel perfect 3-single-color NES playfield
import "c64"
// Address of the sprites covering the playfield
const byte* PLAYFIELD_SPRITES = $2000;
// Address for the charset
const byte* PLAYFIELD_CHARSET = $1000;
// Address of the screen
const byte* PLAYFIELD_SCREEN = $0400;
// Screen Sprite pointers
const byte* PLAYFIELD_SPRITE_PTRS = (PLAYFIELD_SCREEN+SPRITE_PTRS);
// Setup the sprites
void init_sprites() {
vicSelectGfxBank(PLAYFIELD_SCREEN);
*D018 = toD018(PLAYFIELD_SCREEN, PLAYFIELD_CHARSET);
*SPRITES_ENABLE = %00001111;
*SPRITES_EXPAND_X = *SPRITES_EXPAND_Y = *SPRITES_MC = 0;
byte xpos = 24+14*8;
for(byte s:0..3) {
byte s2 = s<<1;
SPRITES_XPOS[s2] = xpos;
SPRITES_COLS[s] = BLACK;
xpos = xpos+24;
}
}
// The line of the first IRQ - 48 is 2 lines before the start of the screen
const byte IRQ_RASTER_FIRST = 49;
// The raster line of the next IRQ
volatile byte irq_raster_next = IRQ_RASTER_FIRST;
// Y-pos of the sprites on the next IRQ
volatile byte irq_sprite_ypos = 50;
// Index of the sprites to show on the next IRQ
volatile byte irq_sprite_ptr = toSpritePtr(PLAYFIELD_SPRITES);
// Counting the 10 IRQs
volatile byte irq_cnt = 0;
// Setup the IRQ
void init_irq() {
asm { sei }
// Acknowledge any IRQ and setup the next one
*IRQ_STATUS = IRQ_RASTER;
asm { lda CIA1_INTERRUPT }
// Disable kernal & basic
*PROCPORT_DDR = PROCPORT_DDR_MEMORY_MASK;
*PROCPORT = PROCPORT_RAM_IO;
// Disable CIA 1 Timer IRQ
*CIA1_INTERRUPT = CIA_INTERRUPT_CLEAR;
// Set raster line
*VIC_CONTROL &=$7f;
*RASTER = IRQ_RASTER_FIRST;
// Enable Raster Interrupt
*IRQ_ENABLE = IRQ_RASTER;
// Set the IRQ routine
*HARDWARE_IRQ = &irq;
asm { cli }
}
// Raster Interrupt Routine - sets up the sprites covering the playfield
// Repeats 10 timers every 21 lines from line IRQ_RASTER_FIRST
interrupt(hardware_clobber) void irq() {
*BORDERCOL = DARK_GREY;
// Place the sprites
byte ypos = irq_sprite_ypos;
SPRITES_YPOS[0] = ypos;
SPRITES_YPOS[2] = ypos;
SPRITES_YPOS[4] = ypos;
SPRITES_YPOS[6] = ypos;
// Wait for the y-position before changing sprite pointers
do {
} while(*RASTER!=irq_sprite_ypos);
byte ptr = irq_sprite_ptr;
PLAYFIELD_SPRITE_PTRS[0] = ptr++;
PLAYFIELD_SPRITE_PTRS[1] = ptr;
PLAYFIELD_SPRITE_PTRS[2] = ptr++;
PLAYFIELD_SPRITE_PTRS[3] = ptr;
// Find next raster line / sprite positions
if(++irq_cnt==10) {
irq_cnt = 0;
irq_raster_next = IRQ_RASTER_FIRST;
irq_sprite_ypos = 50;
irq_sprite_ptr = toSpritePtr(PLAYFIELD_SPRITES);
} else {
irq_raster_next += 21;
irq_sprite_ypos += 21;
irq_sprite_ptr += 3;
}
// Setup next interrupt - start 1 line earlier when overlapping a badline
byte raster_next = irq_raster_next;
if((raster_next&7)==3) {
raster_next -=1;
}
*RASTER = raster_next;
// Acknowledge the IRQ and setup the next one
*IRQ_STATUS = IRQ_RASTER;
*BORDERCOL = BLACK;
}
kickasm(pc PLAYFIELD_SPRITES, resource "nes-playfield.png") {{
.var sprites = LoadPicture("nes-playfield.png", List().add($010101, $000000))
.for(var sy=0;sy<10;sy++) {
.for(var sx=0;sx<3;sx++) {
.for (var y=0;y<21; y++) {
.for (var c=0; c<3; c++) {
.byte sprites.getSinglecolorByte(sx*3+c,sy*21+y)
}
}
.byte 0
}
}
}}

View File

@ -1,14 +1,4 @@
import "c64"
// Address of the sprites covering the playfield
const byte* PLAYFIELD_SPRITES = $2000;
// Address for the charset
const byte* PLAYFIELD_CHARSET = $1000;
// Address of the screen
const byte* PLAYFIELD_SCREEN = $0400;
// Screen Sprite pointers
const byte* PLAYFIELD_SPRITE_PTRS = (PLAYFIELD_SCREEN+SPRITE_PTRS);
import "playfield-sprites"
void main() {
init_sprites();
@ -17,113 +7,3 @@ void main() {
(*PLAYFIELD_SCREEN)++;
}
}
// Setup the sprites
void init_sprites() {
vicSelectGfxBank(PLAYFIELD_SCREEN);
*D018 = toD018(PLAYFIELD_SCREEN, PLAYFIELD_CHARSET);
*SPRITES_ENABLE = %00001111;
*SPRITES_EXPAND_X = *SPRITES_EXPAND_Y = *SPRITES_MC = 0;
byte xpos = 24+14*8;
for(byte s:0..3) {
byte s2 = s<<1;
SPRITES_XPOS[s2] = xpos;
SPRITES_COLS[s] = BLACK;
xpos = xpos+24;
}
}
// The line of the first IRQ - 48 is 2 lines before the start of the screen
const byte IRQ_RASTER_FIRST = 49;
// The raster line of the next IRQ
volatile byte irq_raster_next = IRQ_RASTER_FIRST;
// Y-pos of the sprites on the next IRQ
volatile byte irq_sprite_ypos = 50;
// Index of the sprites to show on the next IRQ
volatile byte irq_sprite_ptr = toSpritePtr(PLAYFIELD_SPRITES);
// Counting the 10 IRQs
volatile byte irq_cnt = 0;
// Setup the IRQ
void init_irq() {
asm { sei }
// Acknowledge any IRQ and setup the next one
*IRQ_STATUS = IRQ_RASTER;
asm { lda CIA1_INTERRUPT }
// Disable kernal & basic
*PROCPORT_DDR = PROCPORT_DDR_MEMORY_MASK;
*PROCPORT = PROCPORT_RAM_IO;
// Disable CIA 1 Timer IRQ
*CIA1_INTERRUPT = CIA_INTERRUPT_CLEAR;
// Set raster line
*VIC_CONTROL &=$7f;
*RASTER = IRQ_RASTER_FIRST;
// Enable Raster Interrupt
*IRQ_ENABLE = IRQ_RASTER;
// Set the IRQ routine
*HARDWARE_IRQ = &irq;
asm { cli }
}
// Raster Interrupt Routine - sets up the sprites covering the playfield
// Repeats 10 timers every 21 lines from line IRQ_RASTER_FIRST
interrupt(hardware_clobber) void irq() {
*BORDERCOL = DARK_GREY;
// Place the sprites
byte ypos = irq_sprite_ypos;
SPRITES_YPOS[0] = ypos;
SPRITES_YPOS[2] = ypos;
SPRITES_YPOS[4] = ypos;
SPRITES_YPOS[6] = ypos;
// Wait for the y-position before changing sprite pointers
do {
} while(*RASTER!=irq_sprite_ypos);
byte ptr = irq_sprite_ptr;
PLAYFIELD_SPRITE_PTRS[0] = ptr++;
PLAYFIELD_SPRITE_PTRS[1] = ptr;
PLAYFIELD_SPRITE_PTRS[2] = ptr++;
PLAYFIELD_SPRITE_PTRS[3] = ptr;
// Find next raster line / sprite positions
if(++irq_cnt==10) {
irq_cnt = 0;
irq_raster_next = IRQ_RASTER_FIRST;
irq_sprite_ypos = 50;
irq_sprite_ptr = toSpritePtr(PLAYFIELD_SPRITES);
} else {
irq_raster_next += 21;
irq_sprite_ypos += 21;
irq_sprite_ptr += 3;
}
// Setup next interrupt - start 1 line earlier when overlapping a badline
byte raster_next = irq_raster_next;
if((raster_next&7)==3) {
raster_next -=1;
}
*RASTER = raster_next;
// Acknowledge the IRQ and setup the next one
*IRQ_STATUS = IRQ_RASTER;
*BORDERCOL = BLACK;
}
kickasm(pc PLAYFIELD_SPRITES, resource "nes-playfield.png") {{
.var sprites = LoadPicture("nes-playfield.png", List().add($010101, $000000))
.for(var sy=0;sy<10;sy++) {
.for(var sx=0;sx<3;sx++) {
.for (var y=0;y<21; y++) {
.for (var c=0; c<3; c++) {
.byte sprites.getSinglecolorByte(sx*3+c,sy*21+y)
}
}
.byte 0
}
}
}}

View File

@ -3,7 +3,7 @@ import "c64"
import "memory"
import "keyboard"
import "sid"
import "pieces"
import "tetris-pieces"
// The size of the playfield
const byte PLAYFIELD_LINES = 22;
@ -50,6 +50,7 @@ void main() {
asm { sei }
render_init();
tables_init();
spawn_current();
render_playfield();
render_current();
@ -277,7 +278,7 @@ void tables_init() {
byte* SCREEN = $400;
// The charset
byte* CHARSET = $2000;
byte* CHARSET = $2800;
kickasm(pc CHARSET, resource "charset.png") {{
.var charset = LoadPicture("charset.png", List().add($000000, $ffffff, $523fa0, $77c1c9))
.for (var c=0; c<16; c++)

View File

@ -188,7 +188,7 @@ irq: {
.for(var sy=0;sy<10;sy++) {
.for(var sx=0;sx<3;sx++) {
.for (var y=0;y<21; y++) {
.for (var c=0; c<3; c++) {
.for (var c=0; c<3; c++) {
.byte sprites.getSinglecolorByte(sx*3+c,sy*21+y)
}
}

View File

@ -1,23 +1,23 @@
@begin: scope:[] from
[0] phi()
to:@6
@6: scope:[] from @begin
to:@5
@5: scope:[] from @begin
[1] (byte) irq_raster_next#0 ← (const byte) IRQ_RASTER_FIRST#0
[2] (byte) irq_sprite_ypos#0 ← (byte/signed byte/word/signed word/dword/signed dword) 50
to:toSpritePtr1
toSpritePtr1: scope:[] from @6
toSpritePtr1: scope:[] from @5
[3] phi()
to:@9
@9: scope:[] from toSpritePtr1
[4] (byte) irq_sprite_ptr#0 ← (const byte) toSpritePtr1_return#0
[5] (byte) irq_cnt#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
to:@8
@8: scope:[] from @9
to:@7
@7: scope:[] from @9
kickasm(location (const byte*) PLAYFIELD_SPRITES#0) {{ .var sprites = LoadPicture("nes-playfield.png", List().add($010101, $000000))
.for(var sy=0;sy<10;sy++) {
.for(var sx=0;sx<3;sx++) {
.for (var y=0;y<21; y++) {
.for (var c=0; c<3; c++) {
.for (var c=0; c<3; c++) {
.byte sprites.getSinglecolorByte(sx*3+c,sy*21+y)
}
}
@ -25,125 +25,128 @@ toSpritePtr1: scope:[] from @6
}
}
}}
[7] call main
to:@8
@8: scope:[] from @7
[7] phi()
[8] call main
to:@end
@end: scope:[] from @8
[8] phi()
main: scope:[main] from @8
[9] phi()
[10] call init_sprites
main: scope:[main] from @8
[10] phi()
[11] call init_sprites
to:main::@7
main::@7: scope:[main] from main
[11] phi()
[12] call init_irq
[12] phi()
[13] call init_irq
to:main::@2
main::@2: scope:[main] from main::@2 main::@7
[13] *((const byte*) PLAYFIELD_SCREEN#0) ← ++ *((const byte*) PLAYFIELD_SCREEN#0)
[14] *((const byte*) PLAYFIELD_SCREEN#0) ← ++ *((const byte*) PLAYFIELD_SCREEN#0)
to:main::@2
init_irq: scope:[init_irq] from main::@7
asm { sei }
[15] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0
[16] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0
asm { ldaCIA1_INTERRUPT }
[17] *((const byte*) PROCPORT_DDR#0) ← (const byte) PROCPORT_DDR_MEMORY_MASK#0
[18] *((const byte*) PROCPORT#0) ← (const byte) PROCPORT_RAM_IO#0
[19] *((const byte*) CIA1_INTERRUPT#0) ← (const byte) CIA_INTERRUPT_CLEAR#0
[20] *((const byte*) VIC_CONTROL#0) ← *((const byte*) VIC_CONTROL#0) & (byte/signed byte/word/signed word/dword/signed dword) 127
[21] *((const byte*) RASTER#0) ← (const byte) IRQ_RASTER_FIRST#0
[22] *((const byte*) IRQ_ENABLE#0) ← (const byte) IRQ_RASTER#0
[23] *((const void()**) HARDWARE_IRQ#0) ← &interrupt(HARDWARE_CLOBBER)(void()) irq()
[18] *((const byte*) PROCPORT_DDR#0) ← (const byte) PROCPORT_DDR_MEMORY_MASK#0
[19] *((const byte*) PROCPORT#0) ← (const byte) PROCPORT_RAM_IO#0
[20] *((const byte*) CIA1_INTERRUPT#0) ← (const byte) CIA_INTERRUPT_CLEAR#0
[21] *((const byte*) VIC_CONTROL#0) ← *((const byte*) VIC_CONTROL#0) & (byte/signed byte/word/signed word/dword/signed dword) 127
[22] *((const byte*) RASTER#0) ← (const byte) IRQ_RASTER_FIRST#0
[23] *((const byte*) IRQ_ENABLE#0) ← (const byte) IRQ_RASTER#0
[24] *((const void()**) HARDWARE_IRQ#0) ← &interrupt(HARDWARE_CLOBBER)(void()) irq()
asm { cli }
to:init_irq::@return
init_irq::@return: scope:[init_irq] from init_irq
[25] return
[26] return
to:@return
init_sprites: scope:[init_sprites] from main
[26] phi()
[27] phi()
to:init_sprites::vicSelectGfxBank1
init_sprites::vicSelectGfxBank1: scope:[init_sprites] from init_sprites
[27] *((const byte*) CIA2_PORT_A_DDR#0) ← (byte/signed byte/word/signed word/dword/signed dword) 3
[28] *((const byte*) CIA2_PORT_A_DDR#0) ← (byte/signed byte/word/signed word/dword/signed dword) 3
to:init_sprites::vicSelectGfxBank1_toDd001
init_sprites::vicSelectGfxBank1_toDd001: scope:[init_sprites] from init_sprites::vicSelectGfxBank1
[28] phi()
[29] phi()
to:init_sprites::vicSelectGfxBank1_@1
init_sprites::vicSelectGfxBank1_@1: scope:[init_sprites] from init_sprites::vicSelectGfxBank1_toDd001
[29] *((const byte*) CIA2_PORT_A#0) ← (const byte) init_sprites::vicSelectGfxBank1_toDd001_return#0
[30] *((const byte*) CIA2_PORT_A#0) ← (const byte) init_sprites::vicSelectGfxBank1_toDd001_return#0
to:init_sprites::toD0181
init_sprites::toD0181: scope:[init_sprites] from init_sprites::vicSelectGfxBank1_@1
[30] phi()
[31] phi()
to:init_sprites::@4
init_sprites::@4: scope:[init_sprites] from init_sprites::toD0181
[31] *((const byte*) D018#0) ← (const byte) init_sprites::toD0181_return#0
[32] *((const byte*) SPRITES_ENABLE#0) ← (byte/signed byte/word/signed word/dword/signed dword) 15
[33] *((const byte*) SPRITES_MC#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
[34] *((const byte*) SPRITES_EXPAND_Y#0) ← *((const byte*) SPRITES_MC#0)
[35] *((const byte*) SPRITES_EXPAND_X#0) ← *((const byte*) SPRITES_EXPAND_Y#0)
[32] *((const byte*) D018#0) ← (const byte) init_sprites::toD0181_return#0
[33] *((const byte*) SPRITES_ENABLE#0) ← (byte/signed byte/word/signed word/dword/signed dword) 15
[34] *((const byte*) SPRITES_MC#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
[35] *((const byte*) SPRITES_EXPAND_Y#0) ← *((const byte*) SPRITES_MC#0)
[36] *((const byte*) SPRITES_EXPAND_X#0) ← *((const byte*) SPRITES_EXPAND_Y#0)
to:init_sprites::@1
init_sprites::@1: scope:[init_sprites] from init_sprites::@1 init_sprites::@4
[36] (byte) init_sprites::xpos#2 ← phi( init_sprites::@1/(byte) init_sprites::xpos#1 init_sprites::@4/(byte/signed byte/word/signed word/dword/signed dword) 24+(byte/signed byte/word/signed word/dword/signed dword) 14*(byte/signed byte/word/signed word/dword/signed dword) 8 )
[36] (byte) init_sprites::s#2 ← phi( init_sprites::@1/(byte) init_sprites::s#1 init_sprites::@4/(byte/signed byte/word/signed word/dword/signed dword) 0 )
[37] (byte) init_sprites::s2#0 ← (byte) init_sprites::s#2 << (byte/signed byte/word/signed word/dword/signed dword) 1
[38] *((const byte*) SPRITES_XPOS#0 + (byte) init_sprites::s2#0) ← (byte) init_sprites::xpos#2
[39] *((const byte*) SPRITES_COLS#0 + (byte) init_sprites::s#2) ← (const byte) BLACK#0
[40] (byte) init_sprites::xpos#1 ← (byte) init_sprites::xpos#2 + (byte/signed byte/word/signed word/dword/signed dword) 24
[41] (byte) init_sprites::s#1 ← ++ (byte) init_sprites::s#2
[42] if((byte) init_sprites::s#1!=(byte/signed byte/word/signed word/dword/signed dword) 4) goto init_sprites::@1
[37] (byte) init_sprites::xpos#2 ← phi( init_sprites::@1/(byte) init_sprites::xpos#1 init_sprites::@4/(byte/signed byte/word/signed word/dword/signed dword) 24+(byte/signed byte/word/signed word/dword/signed dword) 14*(byte/signed byte/word/signed word/dword/signed dword) 8 )
[37] (byte) init_sprites::s#2 ← phi( init_sprites::@1/(byte) init_sprites::s#1 init_sprites::@4/(byte/signed byte/word/signed word/dword/signed dword) 0 )
[38] (byte) init_sprites::s2#0 ← (byte) init_sprites::s#2 << (byte/signed byte/word/signed word/dword/signed dword) 1
[39] *((const byte*) SPRITES_XPOS#0 + (byte) init_sprites::s2#0) ← (byte) init_sprites::xpos#2
[40] *((const byte*) SPRITES_COLS#0 + (byte) init_sprites::s#2) ← (const byte) BLACK#0
[41] (byte) init_sprites::xpos#1 ← (byte) init_sprites::xpos#2 + (byte/signed byte/word/signed word/dword/signed dword) 24
[42] (byte) init_sprites::s#1 ← ++ (byte) init_sprites::s#2
[43] if((byte) init_sprites::s#1!=(byte/signed byte/word/signed word/dword/signed dword) 4) goto init_sprites::@1
to:init_sprites::@return
init_sprites::@return: scope:[init_sprites] from init_sprites::@1
[43] return
[44] return
to:@return
irq: scope:[irq] from
[44] *((const byte*) BORDERCOL#0) ← (const byte) DARK_GREY#0
[45] (byte) irq::ypos#0 ← (byte) irq_sprite_ypos#0
[46] *((const byte*) SPRITES_YPOS#0) ← (byte) irq::ypos#0
[47] *((const byte*) SPRITES_YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte) irq::ypos#0
[48] *((const byte*) SPRITES_YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte) irq::ypos#0
[49] *((const byte*) SPRITES_YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 6) ← (byte) irq::ypos#0
[45] *((const byte*) BORDERCOL#0) ← (const byte) DARK_GREY#0
[46] (byte) irq::ypos#0 ← (byte) irq_sprite_ypos#0
[47] *((const byte*) SPRITES_YPOS#0) ← (byte) irq::ypos#0
[48] *((const byte*) SPRITES_YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte) irq::ypos#0
[49] *((const byte*) SPRITES_YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte) irq::ypos#0
[50] *((const byte*) SPRITES_YPOS#0+(byte/signed byte/word/signed word/dword/signed dword) 6) ← (byte) irq::ypos#0
to:irq::@1
irq::@1: scope:[irq] from irq irq::@1
[50] if(*((const byte*) RASTER#0)!=(byte) irq_sprite_ypos#0) goto irq::@1
[51] if(*((const byte*) RASTER#0)!=(byte) irq_sprite_ypos#0) goto irq::@1
to:irq::@5
irq::@5: scope:[irq] from irq::@1
[51] (byte) irq::ptr#0 ← (byte) irq_sprite_ptr#0
[52] *((const byte*) PLAYFIELD_SPRITE_PTRS#0) ← (byte) irq::ptr#0
[53] (byte) irq::ptr#1 ← ++ (byte) irq::ptr#0
[54] *((const byte*) PLAYFIELD_SPRITE_PTRS#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) irq::ptr#1
[55] *((const byte*) PLAYFIELD_SPRITE_PTRS#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte) irq::ptr#1
[56] (byte) irq::ptr#2 ← ++ (byte) irq::ptr#1
[57] *((const byte*) PLAYFIELD_SPRITE_PTRS#0+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte) irq::ptr#2
[58] (byte) irq_cnt#1 ← ++ (byte) irq_cnt#0
[59] if((byte) irq_cnt#1==(byte/signed byte/word/signed word/dword/signed dword) 10) goto irq::@2
[52] (byte) irq::ptr#0 ← (byte) irq_sprite_ptr#0
[53] *((const byte*) PLAYFIELD_SPRITE_PTRS#0) ← (byte) irq::ptr#0
[54] (byte) irq::ptr#1 ← ++ (byte) irq::ptr#0
[55] *((const byte*) PLAYFIELD_SPRITE_PTRS#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) irq::ptr#1
[56] *((const byte*) PLAYFIELD_SPRITE_PTRS#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte) irq::ptr#1
[57] (byte) irq::ptr#2 ← ++ (byte) irq::ptr#1
[58] *((const byte*) PLAYFIELD_SPRITE_PTRS#0+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte) irq::ptr#2
[59] (byte) irq_cnt#1 ← ++ (byte) irq_cnt#0
[60] if((byte) irq_cnt#1==(byte/signed byte/word/signed word/dword/signed dword) 10) goto irq::@2
to:irq::@6
irq::@6: scope:[irq] from irq::@5
[60] (byte) irq_raster_next#2 ← (byte) irq_raster_next#0 + (byte/signed byte/word/signed word/dword/signed dword) 21
[61] (byte) irq_sprite_ypos#2 ← (byte) irq_sprite_ypos#0 + (byte/signed byte/word/signed word/dword/signed dword) 21
[62] (byte) irq_sprite_ptr#2 ← (byte) irq_sprite_ptr#0 + (byte/signed byte/word/signed word/dword/signed dword) 3
[61] (byte) irq_raster_next#2 ← (byte) irq_raster_next#0 + (byte/signed byte/word/signed word/dword/signed dword) 21
[62] (byte) irq_sprite_ypos#2 ← (byte) irq_sprite_ypos#0 + (byte/signed byte/word/signed word/dword/signed dword) 21
[63] (byte) irq_sprite_ptr#2 ← (byte) irq_sprite_ptr#0 + (byte/signed byte/word/signed word/dword/signed dword) 3
to:irq::@3
irq::@3: scope:[irq] from irq::@6 irq::@9
[63] (byte) irq_raster_next#12 ← phi( irq::@6/(byte) irq_raster_next#2 irq::@9/(byte) irq_raster_next#1 )
[64] (byte) irq::raster_next#0 ← (byte) irq_raster_next#12
[65] (byte~) irq::$3 ← (byte) irq::raster_next#0 & (byte/signed byte/word/signed word/dword/signed dword) 7
[66] if((byte~) irq::$3!=(byte/signed byte/word/signed word/dword/signed dword) 3) goto irq::@4
[64] (byte) irq_raster_next#12 ← phi( irq::@6/(byte) irq_raster_next#2 irq::@9/(byte) irq_raster_next#1 )
[65] (byte) irq::raster_next#0 ← (byte) irq_raster_next#12
[66] (byte~) irq::$3 ← (byte) irq::raster_next#0 & (byte/signed byte/word/signed word/dword/signed dword) 7
[67] if((byte~) irq::$3!=(byte/signed byte/word/signed word/dword/signed dword) 3) goto irq::@4
to:irq::@8
irq::@8: scope:[irq] from irq::@3
[67] (byte) irq::raster_next#1 ← (byte) irq::raster_next#0 - (byte/signed byte/word/signed word/dword/signed dword) 1
[68] (byte) irq::raster_next#1 ← (byte) irq::raster_next#0 - (byte/signed byte/word/signed word/dword/signed dword) 1
to:irq::@4
irq::@4: scope:[irq] from irq::@3 irq::@8
[68] (byte) irq::raster_next#2 ← phi( irq::@3/(byte) irq::raster_next#0 irq::@8/(byte) irq::raster_next#1 )
[69] *((const byte*) RASTER#0) ← (byte) irq::raster_next#2
[70] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0
[71] *((const byte*) BORDERCOL#0) ← (const byte) BLACK#0
[69] (byte) irq::raster_next#2 ← phi( irq::@3/(byte) irq::raster_next#0 irq::@8/(byte) irq::raster_next#1 )
[70] *((const byte*) RASTER#0) ← (byte) irq::raster_next#2
[71] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0
[72] *((const byte*) BORDERCOL#0) ← (const byte) BLACK#0
to:irq::@return
irq::@return: scope:[irq] from irq::@4
[72] return
[73] return
to:@return
irq::@2: scope:[irq] from irq::@5
[73] (byte) irq_cnt#13 ← (byte/signed byte/word/signed word/dword/signed dword) 0
[74] (byte) irq_raster_next#1 ← (const byte) IRQ_RASTER_FIRST#0
[75] (byte) irq_sprite_ypos#1 ← (byte/signed byte/word/signed word/dword/signed dword) 50
[74] (byte) irq_cnt#13 ← (byte/signed byte/word/signed word/dword/signed dword) 0
[75] (byte) irq_raster_next#1 ← (const byte) IRQ_RASTER_FIRST#0
[76] (byte) irq_sprite_ypos#1 ← (byte/signed byte/word/signed word/dword/signed dword) 50
to:irq::toSpritePtr2
irq::toSpritePtr2: scope:[irq] from irq::@2
[76] phi()
[77] phi()
to:irq::@9
irq::@9: scope:[irq] from irq::toSpritePtr2
[77] (byte) irq_sprite_ptr#1 ← (const byte) irq::toSpritePtr2_return#0
[78] (byte) irq_sprite_ptr#1 ← (const byte) irq::toSpritePtr2_return#0
to:irq::@3

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,5 @@
(label) @6
(label) @5
(label) @7
(label) @8
(label) @9
(label) @begin

View File

@ -39,7 +39,7 @@
.const COLLISION_LEFT = 4
.const COLLISION_RIGHT = 8
.label SCREEN = $400
.label CHARSET = $2000
.label CHARSET = $2800
.label keyboard_events_size = $13
.label current_ypos = 2
.label current_xpos = $11

View File

@ -1709,7 +1709,7 @@ tables_init::@return: scope:[tables_init] from tables_init::@2
(byte) current_orientation#50 ← phi( @18/(byte) current_orientation#61 )
(byte*) current_piece#41 ← phi( @18/(byte*) current_piece#53 )
(byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) 1024
(byte*) CHARSET#0 ← ((byte*)) (word/signed word/dword/signed dword) 8192
(byte*) CHARSET#0 ← ((byte*)) (word/signed word/dword/signed dword) 10240
kickasm(location (byte*) CHARSET#0) {{ .var charset = LoadPicture("charset.png", List().add($000000, $ffffff, $523fa0, $77c1c9))
.for (var c=0; c<16; c++)
.for (var y=0;y<8; y++)
@ -4703,7 +4703,7 @@ Constant (const byte) remove_lines::full#1 = 0
Constant (const byte) tables_init::idx#0 = 0
Constant (const byte) tables_init::j#0 = 0
Constant (const byte*) SCREEN#0 = ((byte*))1024
Constant (const byte*) CHARSET#0 = ((byte*))8192
Constant (const byte*) CHARSET#0 = ((byte*))10240
Constant (const word) fill::size#0 = 1000
Constant (const byte) fill::val#0 = 208
Constant (const word) fill::size#1 = 1000
@ -7042,7 +7042,7 @@ INITIAL ASM
.const COLLISION_LEFT = 4
.const COLLISION_RIGHT = 8
.label SCREEN = $400
.label CHARSET = $2000
.label CHARSET = $2800
.label keyboard_events_size = $3b
.label keyboard_modifiers = $38
.label keyboard_modifiers_5 = $85
@ -9881,7 +9881,7 @@ ASSEMBLER BEFORE OPTIMIZATION
.const COLLISION_LEFT = 4
.const COLLISION_RIGHT = 8
.label SCREEN = $400
.label CHARSET = $2000
.label CHARSET = $2800
.label keyboard_events_size = $13
.label current_ypos = 2
.label current_xpos = $11
@ -12302,7 +12302,7 @@ FINAL SYMBOL TABLE
(byte) BROWN
(byte*) CHARGEN
(byte*) CHARSET
(const byte*) CHARSET#0 CHARSET = ((byte*))(word/signed word/dword/signed dword) 8192
(const byte*) CHARSET#0 CHARSET = ((byte*))(word/signed word/dword/signed dword) 10240
(byte*) CIA1_INTERRUPT
(byte*) CIA1_PORT_A
(const byte*) CIA1_PORT_A#0 CIA1_PORT_A = ((byte*))(word/dword/signed dword) 56320
@ -13164,7 +13164,7 @@ Score: 416960
.const COLLISION_LEFT = 4
.const COLLISION_RIGHT = 8
.label SCREEN = $400
.label CHARSET = $2000
.label CHARSET = $2800
.label keyboard_events_size = $13
.label current_ypos = 2
.label current_xpos = $11

View File

@ -16,7 +16,7 @@
(byte) BROWN
(byte*) CHARGEN
(byte*) CHARSET
(const byte*) CHARSET#0 CHARSET = ((byte*))(word/signed word/dword/signed dword) 8192
(const byte*) CHARSET#0 CHARSET = ((byte*))(word/signed word/dword/signed dword) 10240
(byte*) CIA1_INTERRUPT
(byte*) CIA1_PORT_A
(const byte*) CIA1_PORT_A#0 CIA1_PORT_A = ((byte*))(word/dword/signed dword) 56320