1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-12-29 08:31:03 +00:00

Fixed multiplexer tests.

This commit is contained in:
jespergravgaard 2020-11-08 08:36:09 +01:00
parent d905298115
commit 2a0efd5f5b
16 changed files with 3920 additions and 4210 deletions

View File

@ -31,16 +31,21 @@
.label SCREEN = $400
.label COS = SIN+$40
// The address of the sprite pointers on the current screen (screen+0x3f8).
.label PLEX_SCREEN_PTR = SCREEN+$3f8
.label PLEX_SCREEN_PTR = $11
// The index in the PLEX tables of the next sprite to show
.label plex_show_idx = $11
.label plex_show_idx = $13
// The index the next sprite to use for showing (sprites are used round-robin)
.label plex_sprite_idx = $12
.label plex_sprite_idx = $14
// The MSB bit of the next sprite to use for showing
.label plex_sprite_msb = $13
.label plex_sprite_msb = $15
// The index of the sprite that is free next. Since sprites are used round-robin this moves forward each time a sprite is shown.
.label plex_free_next = $14
.label plex_free_next = $16
__start: {
// PLEX_SCREEN_PTR = 0x400+0x3f8
lda #<$400+$3f8
sta.z PLEX_SCREEN_PTR
lda #>$400+$3f8
sta.z PLEX_SCREEN_PTR+1
// plex_show_idx=0
lda #0
sta.z plex_show_idx
@ -153,7 +158,7 @@ loop: {
.label i = 3
// Render Rotated BOBs
.label angle = 2
.label plexFreeNextYpos1_return = $15
.label plexFreeNextYpos1_return = $17
.label i1 = 4
lda #0
sta.z angle
@ -311,6 +316,11 @@ exit: {
}
// Initialize the multiplexer data structures
plexInit: {
// PLEX_SCREEN_PTR = screen+0x3f8
lda #<SCREEN+$3f8
sta.z PLEX_SCREEN_PTR
lda #>SCREEN+$3f8
sta.z PLEX_SCREEN_PTR+1
ldx #0
__b1:
// PLEX_SORTED_IDX[i] = i
@ -517,9 +527,9 @@ mulf8s: {
// elements before the marker are shifted right one at a time until encountering one smaller than the current one.
// It is then inserted at the spot. Now the marker can move forward.
plexSort: {
.label nxt_idx = $16
.label nxt_y = $17
.label m = $15
.label nxt_idx = $18
.label nxt_y = $19
.label m = $17
lda #0
sta.z m
__b1:
@ -587,7 +597,7 @@ plexSort: {
// Show the next sprite.
// plexSort() prepares showing the sprites
plexShowSprite: {
.label plex_sprite_idx2 = $17
.label plex_sprite_idx2 = $19
// plex_sprite_idx2 = plex_sprite_idx*2
lda.z plex_sprite_idx
asl
@ -616,8 +626,8 @@ plexShowSprite: {
// PLEX_SCREEN_PTR[plex_sprite_idx] = PLEX_PTR[PLEX_SORTED_IDX[plex_show_idx]]
ldy PLEX_SORTED_IDX,x
lda PLEX_PTR,y
ldx.z plex_sprite_idx
sta PLEX_SCREEN_PTR,x
ldy.z plex_sprite_idx
sta (PLEX_SCREEN_PTR),y
// xpos_idx = PLEX_SORTED_IDX[plex_show_idx]
ldy.z plex_show_idx
lda PLEX_SORTED_IDX,y
@ -700,11 +710,11 @@ mulf8u_prepare: {
}
// Calculate fast multiply with a prepared unsigned char to a unsigned int result
// The prepared number is set by calling mulf8s_prepare(char a)
// mulf8s_prepared(signed byte zp($16) b)
// mulf8s_prepared(signed byte zp($18) b)
mulf8s_prepared: {
.label memA = $fd
.label m = $f
.label b = $16
.label b = $18
// mulf8u_prepared((char) b)
lda.z b
jsr mulf8u_prepared

View File

@ -4,464 +4,465 @@ __start: scope:[__start] from
[0] phi()
to:__start::__init1
__start::__init1: scope:[__start] from __start
[1] plex_show_idx = 0
[2] plex_sprite_idx = 0
[3] plex_sprite_msb = 1
[4] plex_free_next = 0
[1] PLEX_SCREEN_PTR = (byte*)$400+$3f8
[2] plex_show_idx = 0
[3] plex_sprite_idx = 0
[4] plex_sprite_msb = 1
[5] plex_free_next = 0
to:__start::@1
__start::@1: scope:[__start] from __start::__init1
[5] phi()
[6] call main
[6] phi()
[7] call main
to:__start::@return
__start::@return: scope:[__start] from __start::@1
[7] return
[8] return
to:@return
void main()
main: scope:[main] from __start::@1
asm { sei }
[9] call init
[10] call init
to:main::@1
main::@1: scope:[main] from main
[10] phi()
[11] call loop
[11] phi()
[12] call loop
to:main::@2
main::@2: scope:[main] from main::@1
[12] phi()
[13] call exit
[13] phi()
[14] call exit
to:main::@3
main::@3: scope:[main] from main::@2
asm { cli }
to:main::@return
main::@return: scope:[main] from main::@3
[15] return
[16] return
to:@return
void init()
init: scope:[init] from main
[16] *D011 = VIC_DEN|VIC_RSEL|3
[17] call plexInit
[17] *D011 = VIC_DEN|VIC_RSEL|3
[18] call plexInit
to:init::@1
init::@1: scope:[init] from init init::@1
[18] init::i#2 = phi( init::@1/init::i#1, init/0 )
[19] PLEX_PTR[init::i#2] = (byte)SPRITE/$40
[20] init::$10 = init::i#2 << 2
[21] init::$3 = init::$10 + init::i#2
[22] init::$4 = $18 + init::$3
[23] init::$9 = init::i#2 << 1
[24] PLEX_XPOS[init::$9] = init::$4
[25] init::$5 = init::i#2 << 3
[26] init::$6 = $32 + init::$5
[27] PLEX_YPOS[init::i#2] = init::$6
[28] init::i#1 = ++ init::i#2
[29] if(init::i#1!=PLEX_COUNT-1+1) goto init::@1
[19] init::i#2 = phi( init::@1/init::i#1, init/0 )
[20] PLEX_PTR[init::i#2] = (byte)SPRITE/$40
[21] init::$10 = init::i#2 << 2
[22] init::$3 = init::$10 + init::i#2
[23] init::$4 = $18 + init::$3
[24] init::$9 = init::i#2 << 1
[25] PLEX_XPOS[init::$9] = init::$4
[26] init::$5 = init::i#2 << 3
[27] init::$6 = $32 + init::$5
[28] PLEX_YPOS[init::i#2] = init::$6
[29] init::i#1 = ++ init::i#2
[30] if(init::i#1!=PLEX_COUNT-1+1) goto init::@1
to:init::@2
init::@2: scope:[init] from init::@1
[30] *SPRITES_ENABLE = $ff
[31] *SPRITES_ENABLE = $ff
to:init::@3
init::@3: scope:[init] from init::@2 init::@3
[31] init::i1#2 = phi( init::@2/0, init::@3/init::i1#1 )
[32] SPRITES_COLOR[init::i1#2] = GREEN
[33] init::i1#1 = ++ init::i1#2
[34] if(init::i1#1!=8) goto init::@3
[32] init::i1#2 = phi( init::@2/0, init::@3/init::i1#1 )
[33] SPRITES_COLOR[init::i1#2] = GREEN
[34] init::i1#1 = ++ init::i1#2
[35] if(init::i1#1!=8) goto init::@3
to:init::@4
init::@4: scope:[init] from init::@3
[35] phi()
[36] call mulf_init
[36] phi()
[37] call mulf_init
to:init::@5
init::@5: scope:[init] from init::@4
[37] phi()
[38] call memset
[38] phi()
[39] call memset
to:init::@return
init::@return: scope:[init] from init::@5
[39] return
[40] return
to:@return
void loop()
loop: scope:[loop] from main::@1
[40] phi()
[41] phi()
to:loop::@1
loop::@1: scope:[loop] from loop loop::@15
[41] loop::angle#6 = phi( loop/0, loop::@15/loop::angle#1 )
[42] loop::angle#6 = phi( loop/0, loop::@15/loop::angle#1 )
to:loop::@2
loop::@2: scope:[loop] from loop::@1 loop::@2
[42] if(*RASTER<$d8) goto loop::@2
[43] if(*RASTER<$d8) goto loop::@2
to:loop::@3
loop::@3: scope:[loop] from loop::@2
[43] *BORDER_COLOR = $f
[44] loop::a#6 = loop::angle#6
[44] *BORDER_COLOR = $f
[45] loop::a#6 = loop::angle#6
to:loop::@4
loop::@4: scope:[loop] from loop::@12 loop::@3
[45] loop::i#2 = phi( loop::@12/loop::i#1, loop::@3/0 )
[45] loop::a#2 = phi( loop::@12/loop::a#1, loop::@3/loop::a#6 )
[45] loop::r#2 = phi( loop::@12/loop::r#1, loop::@3/$1e )
[46] *BORDER_COLOR = 6
[47] mulf8s::a#0 = loop::r#2
[48] mulf8s::b#0 = COS[loop::a#2]
[49] call mulf8s
[50] mulf8s::return#2 = mulf8s::return#0
[46] loop::i#2 = phi( loop::@12/loop::i#1, loop::@3/0 )
[46] loop::a#2 = phi( loop::@12/loop::a#1, loop::@3/loop::a#6 )
[46] loop::r#2 = phi( loop::@12/loop::r#1, loop::@3/$1e )
[47] *BORDER_COLOR = 6
[48] mulf8s::a#0 = loop::r#2
[49] mulf8s::b#0 = COS[loop::a#2]
[50] call mulf8s
[51] mulf8s::return#2 = mulf8s::return#0
to:loop::@11
loop::@11: scope:[loop] from loop::@4
[51] loop::$1 = mulf8s::return#2
[52] loop::$2 = loop::$1 << 1
[53] loop::x#0 = loop::$2 + (signed word)$7d*$100
[54] loop::$4 = > loop::x#0
[55] loop::$20 = loop::i#2 << 1
[56] PLEX_XPOS[loop::$20] = loop::$4
[57] mulf8s::a#1 = loop::r#2
[58] mulf8s::b#1 = SIN[loop::a#2]
[59] call mulf8s
[60] mulf8s::return#3 = mulf8s::return#0
[52] loop::$1 = mulf8s::return#2
[53] loop::$2 = loop::$1 << 1
[54] loop::x#0 = loop::$2 + (signed word)$7d*$100
[55] loop::$4 = > loop::x#0
[56] loop::$20 = loop::i#2 << 1
[57] PLEX_XPOS[loop::$20] = loop::$4
[58] mulf8s::a#1 = loop::r#2
[59] mulf8s::b#1 = SIN[loop::a#2]
[60] call mulf8s
[61] mulf8s::return#3 = mulf8s::return#0
to:loop::@12
loop::@12: scope:[loop] from loop::@11
[61] loop::$5 = mulf8s::return#3
[62] loop::$6 = loop::$5 << 1
[63] loop::y#0 = loop::$6 + (signed word)$7d*$100
[64] loop::$8 = > loop::y#0
[65] PLEX_YPOS[loop::i#2] = loop::$8
[66] loop::a#1 = loop::a#2 + $62
[67] loop::r#1 = loop::r#2 + 3
[68] loop::i#1 = ++ loop::i#2
[69] if(loop::i#1!=NUM_BOBS-1+1) goto loop::@4
[62] loop::$5 = mulf8s::return#3
[63] loop::$6 = loop::$5 << 1
[64] loop::y#0 = loop::$6 + (signed word)$7d*$100
[65] loop::$8 = > loop::y#0
[66] PLEX_YPOS[loop::i#2] = loop::$8
[67] loop::a#1 = loop::a#2 + $62
[68] loop::r#1 = loop::r#2 + 3
[69] loop::i#1 = ++ loop::i#2
[70] if(loop::i#1!=NUM_BOBS-1+1) goto loop::@4
to:loop::@5
loop::@5: scope:[loop] from loop::@12
[70] *BORDER_COLOR = 3
[71] call plexSort
[71] *BORDER_COLOR = 3
[72] call plexSort
to:loop::@13
loop::@13: scope:[loop] from loop::@5
[72] loop::angle#1 = loop::angle#6 + 3
[73] *BORDER_COLOR = BLACK
[73] loop::angle#1 = loop::angle#6 + 3
[74] *BORDER_COLOR = BLACK
to:loop::@6
loop::@6: scope:[loop] from loop::@13 loop::@6
[74] loop::$11 = *D011 & VIC_RST8
[75] if(loop::$11!=0) goto loop::@6
[75] loop::$11 = *D011 & VIC_RST8
[76] if(loop::$11!=0) goto loop::@6
to:loop::@7
loop::@7: scope:[loop] from loop::@14 loop::@6
[76] loop::i1#5 = phi( loop::@14/loop::i1#1, loop::@6/0 )
[77] *BORDER_COLOR = BLACK
[77] loop::i1#5 = phi( loop::@14/loop::i1#1, loop::@6/0 )
[78] *BORDER_COLOR = BLACK
to:loop::plexFreeNextYpos1
loop::plexFreeNextYpos1: scope:[loop] from loop::@7
[78] loop::plexFreeNextYpos1_return#0 = PLEX_FREE_YPOS[plex_free_next]
[79] loop::plexFreeNextYpos1_return#0 = PLEX_FREE_YPOS[plex_free_next]
to:loop::@8
loop::@8: scope:[loop] from loop::@8 loop::plexFreeNextYpos1
[79] if(*RASTER<loop::plexFreeNextYpos1_return#0) goto loop::@8
[80] if(*RASTER<loop::plexFreeNextYpos1_return#0) goto loop::@8
to:loop::@9
loop::@9: scope:[loop] from loop::@8
[80] *BORDER_COLOR = ++ *BORDER_COLOR
[81] call plexShowSprite
[81] *BORDER_COLOR = ++ *BORDER_COLOR
[82] call plexShowSprite
to:loop::@14
loop::@14: scope:[loop] from loop::@9
[82] loop::i1#1 = ++ loop::i1#5
[83] if(loop::i1#1!=PLEX_COUNT-1+1) goto loop::@7
[83] loop::i1#1 = ++ loop::i1#5
[84] if(loop::i1#1!=PLEX_COUNT-1+1) goto loop::@7
to:loop::@10
loop::@10: scope:[loop] from loop::@14
[84] *BORDER_COLOR = BLACK
[85] call keyboard_key_pressed
[86] keyboard_key_pressed::return#3 = keyboard_key_pressed::return#0
[85] *BORDER_COLOR = BLACK
[86] call keyboard_key_pressed
[87] keyboard_key_pressed::return#3 = keyboard_key_pressed::return#0
to:loop::@15
loop::@15: scope:[loop] from loop::@10
[87] loop::$18 = keyboard_key_pressed::return#3
[88] if(0!=loop::$18) goto loop::@return
[88] loop::$18 = keyboard_key_pressed::return#3
[89] if(0!=loop::$18) goto loop::@return
to:loop::@1
loop::@return: scope:[loop] from loop::@15
[89] return
[90] return
to:@return
void exit()
exit: scope:[exit] from main::@2
[90] phi()
[91] phi()
to:exit::@1
exit::@1: scope:[exit] from exit exit::@2
[91] phi()
[92] call keyboard_key_pressed
[93] keyboard_key_pressed::return#2 = keyboard_key_pressed::return#0
[92] phi()
[93] call keyboard_key_pressed
[94] keyboard_key_pressed::return#2 = keyboard_key_pressed::return#0
to:exit::@2
exit::@2: scope:[exit] from exit::@1
[94] exit::$0 = keyboard_key_pressed::return#2
[95] if(0!=exit::$0) goto exit::@1
[95] exit::$0 = keyboard_key_pressed::return#2
[96] if(0!=exit::$0) goto exit::@1
to:exit::@return
exit::@return: scope:[exit] from exit::@2
[96] return
[97] return
to:@return
void plexInit(byte* plexInit::screen)
plexInit: scope:[plexInit] from init
[97] phi()
[98] phi()
to:plexInit::plexSetScreen1
plexInit::plexSetScreen1: scope:[plexInit] from plexInit
[98] phi()
[99] PLEX_SCREEN_PTR = SCREEN+$3f8
to:plexInit::@1
plexInit::@1: scope:[plexInit] from plexInit::@1 plexInit::plexSetScreen1
[99] plexInit::i#2 = phi( plexInit::@1/plexInit::i#1, plexInit::plexSetScreen1/0 )
[100] PLEX_SORTED_IDX[plexInit::i#2] = plexInit::i#2
[101] plexInit::i#1 = ++ plexInit::i#2
[102] if(plexInit::i#1!=PLEX_COUNT-1+1) goto plexInit::@1
[100] plexInit::i#2 = phi( plexInit::@1/plexInit::i#1, plexInit::plexSetScreen1/0 )
[101] PLEX_SORTED_IDX[plexInit::i#2] = plexInit::i#2
[102] plexInit::i#1 = ++ plexInit::i#2
[103] if(plexInit::i#1!=PLEX_COUNT-1+1) goto plexInit::@1
to:plexInit::@return
plexInit::@return: scope:[plexInit] from plexInit::@1
[103] return
[104] return
to:@return
void mulf_init()
mulf_init: scope:[mulf_init] from init::@4
[104] phi()
[105] phi()
to:mulf_init::@1
mulf_init::@1: scope:[mulf_init] from mulf_init mulf_init::@3
[105] mulf_init::x_2#3 = phi( mulf_init/0, mulf_init::@3/mulf_init::x_2#2 )
[105] mulf_init::sqr1_hi#2 = phi( mulf_init/mulf_sqr1_hi+1, mulf_init::@3/mulf_init::sqr1_hi#1 )
[105] mulf_init::sqr#4 = phi( mulf_init/0, mulf_init::@3/mulf_init::sqr#1 )
[105] mulf_init::c#2 = phi( mulf_init/0, mulf_init::@3/mulf_init::c#1 )
[105] mulf_init::sqr1_lo#2 = phi( mulf_init/mulf_sqr1_lo+1, mulf_init::@3/mulf_init::sqr1_lo#1 )
[106] if(mulf_init::sqr1_lo#2!=mulf_sqr1_lo+$200) goto mulf_init::@2
[106] mulf_init::x_2#3 = phi( mulf_init/0, mulf_init::@3/mulf_init::x_2#2 )
[106] mulf_init::sqr1_hi#2 = phi( mulf_init/mulf_sqr1_hi+1, mulf_init::@3/mulf_init::sqr1_hi#1 )
[106] mulf_init::sqr#4 = phi( mulf_init/0, mulf_init::@3/mulf_init::sqr#1 )
[106] mulf_init::c#2 = phi( mulf_init/0, mulf_init::@3/mulf_init::c#1 )
[106] mulf_init::sqr1_lo#2 = phi( mulf_init/mulf_sqr1_lo+1, mulf_init::@3/mulf_init::sqr1_lo#1 )
[107] if(mulf_init::sqr1_lo#2!=mulf_sqr1_lo+$200) goto mulf_init::@2
to:mulf_init::@5
mulf_init::@5: scope:[mulf_init] from mulf_init::@1 mulf_init::@8
[107] mulf_init::dir#2 = phi( mulf_init::@1/$ff, mulf_init::@8/mulf_init::dir#4 )
[107] mulf_init::sqr2_hi#2 = phi( mulf_init::@1/mulf_sqr2_hi, mulf_init::@8/mulf_init::sqr2_hi#1 )
[107] mulf_init::x_255#2 = phi( mulf_init::@1/-1, mulf_init::@8/mulf_init::x_255#1 )
[107] mulf_init::sqr2_lo#2 = phi( mulf_init::@1/mulf_sqr2_lo, mulf_init::@8/mulf_init::sqr2_lo#1 )
[108] if(mulf_init::sqr2_lo#2!=mulf_sqr2_lo+$1ff) goto mulf_init::@6
[108] mulf_init::dir#2 = phi( mulf_init::@1/$ff, mulf_init::@8/mulf_init::dir#4 )
[108] mulf_init::sqr2_hi#2 = phi( mulf_init::@1/mulf_sqr2_hi, mulf_init::@8/mulf_init::sqr2_hi#1 )
[108] mulf_init::x_255#2 = phi( mulf_init::@1/-1, mulf_init::@8/mulf_init::x_255#1 )
[108] mulf_init::sqr2_lo#2 = phi( mulf_init::@1/mulf_sqr2_lo, mulf_init::@8/mulf_init::sqr2_lo#1 )
[109] if(mulf_init::sqr2_lo#2!=mulf_sqr2_lo+$1ff) goto mulf_init::@6
to:mulf_init::@7
mulf_init::@7: scope:[mulf_init] from mulf_init::@5
[109] *(mulf_sqr2_lo+$1ff) = *(mulf_sqr1_lo+$100)
[110] *(mulf_sqr2_hi+$1ff) = *(mulf_sqr1_hi+$100)
[110] *(mulf_sqr2_lo+$1ff) = *(mulf_sqr1_lo+$100)
[111] *(mulf_sqr2_hi+$1ff) = *(mulf_sqr1_hi+$100)
to:mulf_init::@return
mulf_init::@return: scope:[mulf_init] from mulf_init::@7
[111] return
[112] return
to:@return
mulf_init::@6: scope:[mulf_init] from mulf_init::@5
[112] *mulf_init::sqr2_lo#2 = mulf_sqr1_lo[mulf_init::x_255#2]
[113] *mulf_init::sqr2_hi#2 = mulf_sqr1_hi[mulf_init::x_255#2]
[114] mulf_init::sqr2_hi#1 = ++ mulf_init::sqr2_hi#2
[115] mulf_init::x_255#1 = mulf_init::x_255#2 + mulf_init::dir#2
[116] if(mulf_init::x_255#1!=0) goto mulf_init::@9
[113] *mulf_init::sqr2_lo#2 = mulf_sqr1_lo[mulf_init::x_255#2]
[114] *mulf_init::sqr2_hi#2 = mulf_sqr1_hi[mulf_init::x_255#2]
[115] mulf_init::sqr2_hi#1 = ++ mulf_init::sqr2_hi#2
[116] mulf_init::x_255#1 = mulf_init::x_255#2 + mulf_init::dir#2
[117] if(mulf_init::x_255#1!=0) goto mulf_init::@9
to:mulf_init::@8
mulf_init::@9: scope:[mulf_init] from mulf_init::@6
[117] phi()
[118] phi()
to:mulf_init::@8
mulf_init::@8: scope:[mulf_init] from mulf_init::@6 mulf_init::@9
[118] mulf_init::dir#4 = phi( mulf_init::@6/1, mulf_init::@9/mulf_init::dir#2 )
[119] mulf_init::sqr2_lo#1 = ++ mulf_init::sqr2_lo#2
[119] mulf_init::dir#4 = phi( mulf_init::@6/1, mulf_init::@9/mulf_init::dir#2 )
[120] mulf_init::sqr2_lo#1 = ++ mulf_init::sqr2_lo#2
to:mulf_init::@5
mulf_init::@2: scope:[mulf_init] from mulf_init::@1
[120] mulf_init::c#1 = ++ mulf_init::c#2
[121] mulf_init::$1 = mulf_init::c#1 & 1
[122] if(mulf_init::$1!=0) goto mulf_init::@3
[121] mulf_init::c#1 = ++ mulf_init::c#2
[122] mulf_init::$1 = mulf_init::c#1 & 1
[123] if(mulf_init::$1!=0) goto mulf_init::@3
to:mulf_init::@4
mulf_init::@4: scope:[mulf_init] from mulf_init::@2
[123] mulf_init::x_2#1 = ++ mulf_init::x_2#3
[124] mulf_init::sqr#2 = ++ mulf_init::sqr#4
[124] mulf_init::x_2#1 = ++ mulf_init::x_2#3
[125] mulf_init::sqr#2 = ++ mulf_init::sqr#4
to:mulf_init::@3
mulf_init::@3: scope:[mulf_init] from mulf_init::@2 mulf_init::@4
[125] mulf_init::x_2#2 = phi( mulf_init::@2/mulf_init::x_2#3, mulf_init::@4/mulf_init::x_2#1 )
[125] mulf_init::sqr#3 = phi( mulf_init::@2/mulf_init::sqr#4, mulf_init::@4/mulf_init::sqr#2 )
[126] mulf_init::$4 = < mulf_init::sqr#3
[127] *mulf_init::sqr1_lo#2 = mulf_init::$4
[128] mulf_init::$5 = > mulf_init::sqr#3
[129] *mulf_init::sqr1_hi#2 = mulf_init::$5
[130] mulf_init::sqr1_hi#1 = ++ mulf_init::sqr1_hi#2
[131] mulf_init::sqr#1 = mulf_init::sqr#3 + mulf_init::x_2#2
[132] mulf_init::sqr1_lo#1 = ++ mulf_init::sqr1_lo#2
[126] mulf_init::x_2#2 = phi( mulf_init::@2/mulf_init::x_2#3, mulf_init::@4/mulf_init::x_2#1 )
[126] mulf_init::sqr#3 = phi( mulf_init::@2/mulf_init::sqr#4, mulf_init::@4/mulf_init::sqr#2 )
[127] mulf_init::$4 = < mulf_init::sqr#3
[128] *mulf_init::sqr1_lo#2 = mulf_init::$4
[129] mulf_init::$5 = > mulf_init::sqr#3
[130] *mulf_init::sqr1_hi#2 = mulf_init::$5
[131] mulf_init::sqr1_hi#1 = ++ mulf_init::sqr1_hi#2
[132] mulf_init::sqr#1 = mulf_init::sqr#3 + mulf_init::x_2#2
[133] mulf_init::sqr1_lo#1 = ++ mulf_init::sqr1_lo#2
to:mulf_init::@1
void* memset(void* memset::str , byte memset::c , word memset::num)
memset: scope:[memset] from init::@5
[133] phi()
[134] phi()
to:memset::@1
memset::@1: scope:[memset] from memset memset::@2
[134] memset::dst#2 = phi( memset/(byte*)memset::str#0, memset::@2/memset::dst#1 )
[135] if(memset::dst#2!=memset::end#0) goto memset::@2
[135] memset::dst#2 = phi( memset/(byte*)memset::str#0, memset::@2/memset::dst#1 )
[136] if(memset::dst#2!=memset::end#0) goto memset::@2
to:memset::@return
memset::@return: scope:[memset] from memset::@1
[136] return
[137] return
to:@return
memset::@2: scope:[memset] from memset::@1
[137] *memset::dst#2 = memset::c#0
[138] memset::dst#1 = ++ memset::dst#2
[138] *memset::dst#2 = memset::c#0
[139] memset::dst#1 = ++ memset::dst#2
to:memset::@1
signed word mulf8s(signed byte mulf8s::a , signed byte mulf8s::b)
mulf8s: scope:[mulf8s] from loop::@11 loop::@4
[139] mulf8s::b#2 = phi( loop::@11/mulf8s::b#1, loop::@4/mulf8s::b#0 )
[139] mulf8s::mulf8s_prepare1_a#0 = phi( loop::@11/mulf8s::a#1, loop::@4/mulf8s::a#0 )
[140] mulf8s::b#2 = phi( loop::@11/mulf8s::b#1, loop::@4/mulf8s::b#0 )
[140] mulf8s::mulf8s_prepare1_a#0 = phi( loop::@11/mulf8s::a#1, loop::@4/mulf8s::a#0 )
to:mulf8s::mulf8s_prepare1
mulf8s::mulf8s_prepare1: scope:[mulf8s] from mulf8s
[140] mulf8u_prepare::a#0 = (byte)mulf8s::mulf8s_prepare1_a#0
[141] call mulf8u_prepare
[141] mulf8u_prepare::a#0 = (byte)mulf8s::mulf8s_prepare1_a#0
[142] call mulf8u_prepare
to:mulf8s::@1
mulf8s::@1: scope:[mulf8s] from mulf8s::mulf8s_prepare1
[142] mulf8s_prepared::b#0 = mulf8s::b#2
[143] call mulf8s_prepared
[143] mulf8s_prepared::b#0 = mulf8s::b#2
[144] call mulf8s_prepared
to:mulf8s::@2
mulf8s::@2: scope:[mulf8s] from mulf8s::@1
[144] mulf8s::return#0 = (signed word)mulf8s_prepared::m#4
[145] mulf8s::return#0 = (signed word)mulf8s_prepared::m#4
to:mulf8s::@return
mulf8s::@return: scope:[mulf8s] from mulf8s::@2
[145] return
[146] return
to:@return
void plexSort()
plexSort: scope:[plexSort] from loop::@5
[146] phi()
[147] phi()
to:plexSort::@1
plexSort::@1: scope:[plexSort] from plexSort plexSort::@2
[147] plexSort::m#2 = phi( plexSort/0, plexSort::@2/plexSort::m#1 )
[148] plexSort::nxt_idx#0 = (PLEX_SORTED_IDX+1)[plexSort::m#2]
[149] plexSort::nxt_y#0 = PLEX_YPOS[plexSort::nxt_idx#0]
[150] if(plexSort::nxt_y#0>=PLEX_YPOS[PLEX_SORTED_IDX[plexSort::m#2]]) goto plexSort::@2
[148] plexSort::m#2 = phi( plexSort/0, plexSort::@2/plexSort::m#1 )
[149] plexSort::nxt_idx#0 = (PLEX_SORTED_IDX+1)[plexSort::m#2]
[150] plexSort::nxt_y#0 = PLEX_YPOS[plexSort::nxt_idx#0]
[151] if(plexSort::nxt_y#0>=PLEX_YPOS[PLEX_SORTED_IDX[plexSort::m#2]]) goto plexSort::@2
to:plexSort::@5
plexSort::@5: scope:[plexSort] from plexSort::@1
[151] plexSort::s#6 = plexSort::m#2
[152] plexSort::s#6 = plexSort::m#2
to:plexSort::@3
plexSort::@3: scope:[plexSort] from plexSort::@5 plexSort::@7
[152] plexSort::s#3 = phi( plexSort::@7/plexSort::s#1, plexSort::@5/plexSort::s#6 )
[153] (PLEX_SORTED_IDX+1)[plexSort::s#3] = PLEX_SORTED_IDX[plexSort::s#3]
[154] plexSort::s#1 = -- plexSort::s#3
[155] if(plexSort::s#1==$ff) goto plexSort::@4
[153] plexSort::s#3 = phi( plexSort::@7/plexSort::s#1, plexSort::@5/plexSort::s#6 )
[154] (PLEX_SORTED_IDX+1)[plexSort::s#3] = PLEX_SORTED_IDX[plexSort::s#3]
[155] plexSort::s#1 = -- plexSort::s#3
[156] if(plexSort::s#1==$ff) goto plexSort::@4
to:plexSort::@7
plexSort::@7: scope:[plexSort] from plexSort::@3
[156] if(plexSort::nxt_y#0<PLEX_YPOS[PLEX_SORTED_IDX[plexSort::s#1]]) goto plexSort::@3
[157] if(plexSort::nxt_y#0<PLEX_YPOS[PLEX_SORTED_IDX[plexSort::s#1]]) goto plexSort::@3
to:plexSort::@4
plexSort::@4: scope:[plexSort] from plexSort::@3 plexSort::@7
[157] plexSort::s#2 = ++ plexSort::s#1
[158] PLEX_SORTED_IDX[plexSort::s#2] = plexSort::nxt_idx#0
[158] plexSort::s#2 = ++ plexSort::s#1
[159] PLEX_SORTED_IDX[plexSort::s#2] = plexSort::nxt_idx#0
to:plexSort::@2
plexSort::@2: scope:[plexSort] from plexSort::@1 plexSort::@4
[159] plexSort::m#1 = ++ plexSort::m#2
[160] if(plexSort::m#1!=PLEX_COUNT-2+1) goto plexSort::@1
[160] plexSort::m#1 = ++ plexSort::m#2
[161] if(plexSort::m#1!=PLEX_COUNT-2+1) goto plexSort::@1
to:plexSort::@6
plexSort::@6: scope:[plexSort] from plexSort::@2
[161] plex_show_idx = 0
[162] plex_sprite_idx = 0
[163] plex_sprite_msb = 1
[162] plex_show_idx = 0
[163] plex_sprite_idx = 0
[164] plex_sprite_msb = 1
to:plexSort::plexFreePrepare1
plexSort::plexFreePrepare1: scope:[plexSort] from plexSort::@6
[164] phi()
[165] phi()
to:plexSort::plexFreePrepare1_@1
plexSort::plexFreePrepare1_@1: scope:[plexSort] from plexSort::plexFreePrepare1 plexSort::plexFreePrepare1_@1
[165] plexSort::plexFreePrepare1_s#2 = phi( plexSort::plexFreePrepare1/0, plexSort::plexFreePrepare1_@1/plexSort::plexFreePrepare1_s#1 )
[166] PLEX_FREE_YPOS[plexSort::plexFreePrepare1_s#2] = 0
[167] plexSort::plexFreePrepare1_s#1 = ++ plexSort::plexFreePrepare1_s#2
[168] if(plexSort::plexFreePrepare1_s#1!=8) goto plexSort::plexFreePrepare1_@1
[166] plexSort::plexFreePrepare1_s#2 = phi( plexSort::plexFreePrepare1/0, plexSort::plexFreePrepare1_@1/plexSort::plexFreePrepare1_s#1 )
[167] PLEX_FREE_YPOS[plexSort::plexFreePrepare1_s#2] = 0
[168] plexSort::plexFreePrepare1_s#1 = ++ plexSort::plexFreePrepare1_s#2
[169] if(plexSort::plexFreePrepare1_s#1!=8) goto plexSort::plexFreePrepare1_@1
to:plexSort::plexFreePrepare1_@2
plexSort::plexFreePrepare1_@2: scope:[plexSort] from plexSort::plexFreePrepare1_@1
[169] plex_free_next = 0
[170] plex_free_next = 0
to:plexSort::@return
plexSort::@return: scope:[plexSort] from plexSort::plexFreePrepare1_@2
[170] return
[171] return
to:@return
void plexShowSprite()
plexShowSprite: scope:[plexShowSprite] from loop::@9
[171] plexShowSprite::plex_sprite_idx2#0 = plex_sprite_idx << 1
[172] plexShowSprite::plexFreeAdd1_ypos#0 = PLEX_YPOS[PLEX_SORTED_IDX[plex_show_idx]]
[173] SPRITES_YPOS[plexShowSprite::plex_sprite_idx2#0] = plexShowSprite::plexFreeAdd1_ypos#0
[172] plexShowSprite::plex_sprite_idx2#0 = plex_sprite_idx << 1
[173] plexShowSprite::plexFreeAdd1_ypos#0 = PLEX_YPOS[PLEX_SORTED_IDX[plex_show_idx]]
[174] SPRITES_YPOS[plexShowSprite::plex_sprite_idx2#0] = plexShowSprite::plexFreeAdd1_ypos#0
to:plexShowSprite::plexFreeAdd1
plexShowSprite::plexFreeAdd1: scope:[plexShowSprite] from plexShowSprite
[174] plexShowSprite::plexFreeAdd1_$0 = plexShowSprite::plexFreeAdd1_ypos#0 + $15
[175] PLEX_FREE_YPOS[plex_free_next] = plexShowSprite::plexFreeAdd1_$0
[176] plexShowSprite::plexFreeAdd1_$1 = plex_free_next + 1
[177] plexShowSprite::plexFreeAdd1_$2 = plexShowSprite::plexFreeAdd1_$1 & 7
[178] plex_free_next = plexShowSprite::plexFreeAdd1_$2
[175] plexShowSprite::plexFreeAdd1_$0 = plexShowSprite::plexFreeAdd1_ypos#0 + $15
[176] PLEX_FREE_YPOS[plex_free_next] = plexShowSprite::plexFreeAdd1_$0
[177] plexShowSprite::plexFreeAdd1_$1 = plex_free_next + 1
[178] plexShowSprite::plexFreeAdd1_$2 = plexShowSprite::plexFreeAdd1_$1 & 7
[179] plex_free_next = plexShowSprite::plexFreeAdd1_$2
to:plexShowSprite::@5
plexShowSprite::@5: scope:[plexShowSprite] from plexShowSprite::plexFreeAdd1
[179] PLEX_SCREEN_PTR#0[plex_sprite_idx] = PLEX_PTR[PLEX_SORTED_IDX[plex_show_idx]]
[180] plexShowSprite::xpos_idx#0 = PLEX_SORTED_IDX[plex_show_idx]
[181] plexShowSprite::$11 = plexShowSprite::xpos_idx#0 << 1
[182] plexShowSprite::$2 = < PLEX_XPOS[plexShowSprite::$11]
[183] SPRITES_XPOS[plexShowSprite::plex_sprite_idx2#0] = plexShowSprite::$2
[184] plexShowSprite::$3 = > PLEX_XPOS[plexShowSprite::$11]
[185] if(plexShowSprite::$3!=0) goto plexShowSprite::@1
[180] PLEX_SCREEN_PTR[plex_sprite_idx] = PLEX_PTR[PLEX_SORTED_IDX[plex_show_idx]]
[181] plexShowSprite::xpos_idx#0 = PLEX_SORTED_IDX[plex_show_idx]
[182] plexShowSprite::$11 = plexShowSprite::xpos_idx#0 << 1
[183] plexShowSprite::$2 = < PLEX_XPOS[plexShowSprite::$11]
[184] SPRITES_XPOS[plexShowSprite::plex_sprite_idx2#0] = plexShowSprite::$2
[185] plexShowSprite::$3 = > PLEX_XPOS[plexShowSprite::$11]
[186] if(plexShowSprite::$3!=0) goto plexShowSprite::@1
to:plexShowSprite::@3
plexShowSprite::@3: scope:[plexShowSprite] from plexShowSprite::@5
[186] plexShowSprite::$9 = $ff ^ plex_sprite_msb
[187] *SPRITES_XMSB = *SPRITES_XMSB & plexShowSprite::$9
[187] plexShowSprite::$9 = $ff ^ plex_sprite_msb
[188] *SPRITES_XMSB = *SPRITES_XMSB & plexShowSprite::$9
to:plexShowSprite::@2
plexShowSprite::@2: scope:[plexShowSprite] from plexShowSprite::@1 plexShowSprite::@3
[188] plexShowSprite::$5 = plex_sprite_idx + 1
[189] plexShowSprite::$6 = plexShowSprite::$5 & 7
[190] plex_sprite_idx = plexShowSprite::$6
[191] plex_show_idx = ++ plex_show_idx
[192] plex_sprite_msb = plex_sprite_msb << 1
[193] if(plex_sprite_msb!=0) goto plexShowSprite::@return
[189] plexShowSprite::$5 = plex_sprite_idx + 1
[190] plexShowSprite::$6 = plexShowSprite::$5 & 7
[191] plex_sprite_idx = plexShowSprite::$6
[192] plex_show_idx = ++ plex_show_idx
[193] plex_sprite_msb = plex_sprite_msb << 1
[194] if(plex_sprite_msb!=0) goto plexShowSprite::@return
to:plexShowSprite::@4
plexShowSprite::@4: scope:[plexShowSprite] from plexShowSprite::@2
[194] plex_sprite_msb = 1
[195] plex_sprite_msb = 1
to:plexShowSprite::@return
plexShowSprite::@return: scope:[plexShowSprite] from plexShowSprite::@2 plexShowSprite::@4
[195] return
[196] return
to:@return
plexShowSprite::@1: scope:[plexShowSprite] from plexShowSprite::@5
[196] *SPRITES_XMSB = *SPRITES_XMSB | plex_sprite_msb
[197] *SPRITES_XMSB = *SPRITES_XMSB | plex_sprite_msb
to:plexShowSprite::@2
byte keyboard_key_pressed(byte keyboard_key_pressed::key)
keyboard_key_pressed: scope:[keyboard_key_pressed] from exit::@1 loop::@10
[197] phi()
[198] call keyboard_matrix_read
[199] keyboard_matrix_read::return#2 = keyboard_matrix_read::return#0
[198] phi()
[199] call keyboard_matrix_read
[200] keyboard_matrix_read::return#2 = keyboard_matrix_read::return#0
to:keyboard_key_pressed::@1
keyboard_key_pressed::@1: scope:[keyboard_key_pressed] from keyboard_key_pressed
[200] keyboard_key_pressed::$2 = keyboard_matrix_read::return#2
[201] keyboard_key_pressed::return#0 = keyboard_key_pressed::$2 & *(keyboard_matrix_col_bitmask+keyboard_key_pressed::colidx#0)
[201] keyboard_key_pressed::$2 = keyboard_matrix_read::return#2
[202] keyboard_key_pressed::return#0 = keyboard_key_pressed::$2 & *(keyboard_matrix_col_bitmask+keyboard_key_pressed::colidx#0)
to:keyboard_key_pressed::@return
keyboard_key_pressed::@return: scope:[keyboard_key_pressed] from keyboard_key_pressed::@1
[202] return
[203] return
to:@return
void mulf8u_prepare(byte mulf8u_prepare::a)
mulf8u_prepare: scope:[mulf8u_prepare] from mulf8s::mulf8s_prepare1
[203] *mulf8u_prepare::memA = mulf8u_prepare::a#0
[204] *mulf8u_prepare::memA = mulf8u_prepare::a#0
asm { ldamemA stamulf8u_prepared.sm1+1 stamulf8u_prepared.sm3+1 eor#$ff stamulf8u_prepared.sm2+1 stamulf8u_prepared.sm4+1 }
to:mulf8u_prepare::@return
mulf8u_prepare::@return: scope:[mulf8u_prepare] from mulf8u_prepare
[205] return
[206] return
to:@return
signed word mulf8s_prepared(signed byte mulf8s_prepared::b)
mulf8s_prepared: scope:[mulf8s_prepared] from mulf8s::@1
[206] mulf8u_prepared::b#0 = (byte)mulf8s_prepared::b#0
[207] call mulf8u_prepared
[208] mulf8u_prepared::return#2 = mulf8u_prepared::return#0
[207] mulf8u_prepared::b#0 = (byte)mulf8s_prepared::b#0
[208] call mulf8u_prepared
[209] mulf8u_prepared::return#2 = mulf8u_prepared::return#0
to:mulf8s_prepared::@5
mulf8s_prepared::@5: scope:[mulf8s_prepared] from mulf8s_prepared
[209] mulf8s_prepared::m#0 = mulf8u_prepared::return#2
[210] if(*mulf8s_prepared::memA>=0) goto mulf8s_prepared::@1
[210] mulf8s_prepared::m#0 = mulf8u_prepared::return#2
[211] if(*mulf8s_prepared::memA>=0) goto mulf8s_prepared::@1
to:mulf8s_prepared::@3
mulf8s_prepared::@3: scope:[mulf8s_prepared] from mulf8s_prepared::@5
[211] mulf8s_prepared::$6 = > mulf8s_prepared::m#0
[212] mulf8s_prepared::$11 = mulf8s_prepared::$6 - (byte)mulf8s_prepared::b#0
[213] mulf8s_prepared::m#1 = mulf8s_prepared::m#0 hi= mulf8s_prepared::$11
[212] mulf8s_prepared::$6 = > mulf8s_prepared::m#0
[213] mulf8s_prepared::$11 = mulf8s_prepared::$6 - (byte)mulf8s_prepared::b#0
[214] mulf8s_prepared::m#1 = mulf8s_prepared::m#0 hi= mulf8s_prepared::$11
to:mulf8s_prepared::@1
mulf8s_prepared::@1: scope:[mulf8s_prepared] from mulf8s_prepared::@3 mulf8s_prepared::@5
[214] mulf8s_prepared::m#5 = phi( mulf8s_prepared::@3/mulf8s_prepared::m#1, mulf8s_prepared::@5/mulf8s_prepared::m#0 )
[215] if(mulf8s_prepared::b#0>=0) goto mulf8s_prepared::@2
[215] mulf8s_prepared::m#5 = phi( mulf8s_prepared::@3/mulf8s_prepared::m#1, mulf8s_prepared::@5/mulf8s_prepared::m#0 )
[216] if(mulf8s_prepared::b#0>=0) goto mulf8s_prepared::@2
to:mulf8s_prepared::@4
mulf8s_prepared::@4: scope:[mulf8s_prepared] from mulf8s_prepared::@1
[216] mulf8s_prepared::$9 = > mulf8s_prepared::m#5
[217] mulf8s_prepared::$12 = mulf8s_prepared::$9 - (byte)*mulf8s_prepared::memA
[218] mulf8s_prepared::m#2 = mulf8s_prepared::m#5 hi= mulf8s_prepared::$12
[217] mulf8s_prepared::$9 = > mulf8s_prepared::m#5
[218] mulf8s_prepared::$12 = mulf8s_prepared::$9 - (byte)*mulf8s_prepared::memA
[219] mulf8s_prepared::m#2 = mulf8s_prepared::m#5 hi= mulf8s_prepared::$12
to:mulf8s_prepared::@2
mulf8s_prepared::@2: scope:[mulf8s_prepared] from mulf8s_prepared::@1 mulf8s_prepared::@4
[219] mulf8s_prepared::m#4 = phi( mulf8s_prepared::@1/mulf8s_prepared::m#5, mulf8s_prepared::@4/mulf8s_prepared::m#2 )
[220] mulf8s_prepared::m#4 = phi( mulf8s_prepared::@1/mulf8s_prepared::m#5, mulf8s_prepared::@4/mulf8s_prepared::m#2 )
to:mulf8s_prepared::@return
mulf8s_prepared::@return: scope:[mulf8s_prepared] from mulf8s_prepared::@2
[220] return
[221] return
to:@return
byte keyboard_matrix_read(byte keyboard_matrix_read::rowid)
keyboard_matrix_read: scope:[keyboard_matrix_read] from keyboard_key_pressed
[221] *((byte*)CIA1) = *(keyboard_matrix_row_bitmask+keyboard_key_pressed::rowidx#0)
[222] keyboard_matrix_read::return#0 = ~ *((byte*)CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_B)
[222] *((byte*)CIA1) = *(keyboard_matrix_row_bitmask+keyboard_key_pressed::rowidx#0)
[223] keyboard_matrix_read::return#0 = ~ *((byte*)CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_B)
to:keyboard_matrix_read::@return
keyboard_matrix_read::@return: scope:[keyboard_matrix_read] from keyboard_matrix_read
[223] return
[224] return
to:@return
word mulf8u_prepared(byte mulf8u_prepared::b)
mulf8u_prepared: scope:[mulf8u_prepared] from mulf8s_prepared
[224] *mulf8u_prepared::memB = mulf8u_prepared::b#0
[225] *mulf8u_prepared::memB = mulf8u_prepared::b#0
asm { ldxmemB sec sm1: ldamulf_sqr1_lo,x sm2: sbcmulf_sqr2_lo,x staresL sm3: ldamulf_sqr1_hi,x sm4: sbcmulf_sqr2_hi,x stamemB }
[226] mulf8u_prepared::return#0 = *mulf8u_prepared::memB w= *mulf8u_prepared::resL
[227] mulf8u_prepared::return#0 = *mulf8u_prepared::memB w= *mulf8u_prepared::resL
to:mulf8u_prepared::@return
mulf8u_prepared::@return: scope:[mulf8u_prepared] from mulf8u_prepared
[227] return
[228] return
to:@return

File diff suppressed because it is too large Load Diff

View File

@ -10,8 +10,7 @@ const byte OFFSET_STRUCT_MOS6526_CIA_PORT_B = 1
const nomodify byte PLEX_COUNT = $20
const byte* PLEX_FREE_YPOS[8] = { fill( 8, 0) }
const byte* PLEX_PTR[PLEX_COUNT] = { fill( PLEX_COUNT, 0) }
byte* PLEX_SCREEN_PTR
const byte* PLEX_SCREEN_PTR#0 PLEX_SCREEN_PTR = SCREEN+$3f8
volatile byte* PLEX_SCREEN_PTR loadstore zp[2]:17 952.8679245283018
const byte* PLEX_SORTED_IDX[PLEX_COUNT] = { fill( PLEX_COUNT, 0) }
const word* PLEX_XPOS[PLEX_COUNT] = { fill( PLEX_COUNT, 0) }
const byte* PLEX_YPOS[PLEX_COUNT] = { fill( PLEX_COUNT, 0) }
@ -92,7 +91,7 @@ byte loop::i1
byte loop::i1#1 i1 zp[1]:4 15001.5
byte loop::i1#5 i1 zp[1]:4 3333.6666666666665
byte loop::plexFreeNextYpos1_return
byte loop::plexFreeNextYpos1_return#0 plexFreeNextYpos1_return zp[1]:21 55001.0
byte loop::plexFreeNextYpos1_return#0 plexFreeNextYpos1_return zp[1]:23 55001.0
signed byte loop::r
signed byte loop::r#1 r zp[1]:5 6667.333333333333
signed byte loop::r#2 r zp[1]:5 1818.3636363636363
@ -135,7 +134,7 @@ byte~ mulf8s_prepared::$12 reg byte a 2000002.0
byte~ mulf8s_prepared::$6 reg byte a 2000002.0
byte~ mulf8s_prepared::$9 reg byte a 2000002.0
signed byte mulf8s_prepared::b
signed byte mulf8s_prepared::b#0 b zp[1]:22 110000.20000000001
signed byte mulf8s_prepared::b#0 b zp[1]:24 110000.20000000001
word mulf8s_prepared::m
word mulf8s_prepared::m#0 m zp[2]:15 1000001.0
word mulf8s_prepared::m#1 m zp[2]:15 2000002.0
@ -213,18 +212,18 @@ byte~ plexShowSprite::plexFreeAdd1_$2 reg byte a 200002.0
byte plexShowSprite::plexFreeAdd1_ypos
byte plexShowSprite::plexFreeAdd1_ypos#0 reg byte a 150001.5
byte plexShowSprite::plex_sprite_idx2
byte plexShowSprite::plex_sprite_idx2#0 plex_sprite_idx2 zp[1]:23 25000.25
byte plexShowSprite::plex_sprite_idx2#0 plex_sprite_idx2 zp[1]:25 25000.25
byte plexShowSprite::xpos_idx
byte plexShowSprite::xpos_idx#0 reg byte a 200002.0
byte plexShowSprite::ypos
void plexSort()
byte plexSort::m
byte plexSort::m#1 m zp[1]:21 1500001.5
byte plexSort::m#2 m zp[1]:21 416667.0833333334
byte plexSort::m#1 m zp[1]:23 1500001.5
byte plexSort::m#2 m zp[1]:23 416667.0833333334
byte plexSort::nxt_idx
byte plexSort::nxt_idx#0 nxt_idx zp[1]:22 300000.30000000005
byte plexSort::nxt_idx#0 nxt_idx zp[1]:24 300000.30000000005
byte plexSort::nxt_y
byte plexSort::nxt_y#0 nxt_y zp[1]:23 1500000.375
byte plexSort::nxt_y#0 nxt_y zp[1]:25 1500000.375
byte plexSort::plexFreePrepare1_s
byte plexSort::plexFreePrepare1_s#1 reg byte x 1500001.5
byte plexSort::plexFreePrepare1_s#2 reg byte x 1500001.5
@ -233,10 +232,10 @@ byte plexSort::s#1 reg byte x 1.3666668333333332E7
byte plexSort::s#2 reg byte x 2000002.0
byte plexSort::s#3 reg byte x 2.05000025E7
byte plexSort::s#6 reg byte x 2000002.0
volatile byte plex_free_next loadstore zp[1]:20 8205.307692307691
volatile byte plex_show_idx loadstore zp[1]:17 10408.326530612245
volatile byte plex_sprite_idx loadstore zp[1]:18 8913.195652173914
volatile byte plex_sprite_msb loadstore zp[1]:19 12978.91489361702
volatile byte plex_free_next loadstore zp[1]:22 8205.307692307691
volatile byte plex_show_idx loadstore zp[1]:19 10408.326530612245
volatile byte plex_sprite_idx loadstore zp[1]:20 8913.195652173914
volatile byte plex_sprite_msb loadstore zp[1]:21 12978.91489361702
reg byte x [ init::i1#2 init::i1#1 ]
zp[1]:2 [ loop::angle#6 loop::angle#1 init::i#2 init::i#1 ]
@ -256,10 +255,11 @@ reg byte x [ mulf8s::b#2 mulf8s::b#1 mulf8s::b#0 ]
reg byte x [ plexSort::s#3 plexSort::s#1 plexSort::s#6 ]
reg byte x [ plexSort::plexFreePrepare1_s#2 plexSort::plexFreePrepare1_s#1 ]
zp[2]:15 [ mulf8s_prepared::m#4 mulf8s_prepared::m#5 mulf8s_prepared::m#1 mulf8s_prepared::m#0 mulf8s_prepared::m#2 mulf8s::return#0 mulf8u_prepared::return#2 mulf8s::return#2 loop::$1 mulf8s::return#3 loop::$5 mulf8u_prepared::return#0 loop::$2 loop::x#0 loop::$6 loop::y#0 mulf_init::sqr1_hi#2 mulf_init::sqr1_hi#1 ]
zp[1]:17 [ plex_show_idx ]
zp[1]:18 [ plex_sprite_idx ]
zp[1]:19 [ plex_sprite_msb ]
zp[1]:20 [ plex_free_next ]
zp[2]:17 [ PLEX_SCREEN_PTR ]
zp[1]:19 [ plex_show_idx ]
zp[1]:20 [ plex_sprite_idx ]
zp[1]:21 [ plex_sprite_msb ]
zp[1]:22 [ plex_free_next ]
reg byte a [ init::$10 ]
reg byte a [ init::$3 ]
reg byte x [ init::$4 ]
@ -270,7 +270,7 @@ reg byte x [ loop::$4 ]
reg byte a [ loop::$20 ]
reg byte a [ loop::$8 ]
reg byte a [ loop::$11 ]
zp[1]:21 [ loop::plexFreeNextYpos1_return#0 plexSort::m#2 plexSort::m#1 ]
zp[1]:23 [ loop::plexFreeNextYpos1_return#0 plexSort::m#2 plexSort::m#1 ]
reg byte a [ keyboard_key_pressed::return#3 ]
reg byte a [ loop::$18 ]
reg byte a [ keyboard_key_pressed::return#2 ]
@ -279,9 +279,9 @@ reg byte a [ mulf_init::$1 ]
reg byte a [ mulf_init::$4 ]
reg byte a [ mulf_init::$5 ]
reg byte a [ mulf8u_prepare::a#0 ]
zp[1]:22 [ plexSort::nxt_idx#0 mulf8s_prepared::b#0 ]
zp[1]:24 [ plexSort::nxt_idx#0 mulf8s_prepared::b#0 ]
reg byte x [ plexSort::s#2 ]
zp[1]:23 [ plexShowSprite::plex_sprite_idx2#0 plexSort::nxt_y#0 ]
zp[1]:25 [ plexShowSprite::plex_sprite_idx2#0 plexSort::nxt_y#0 ]
reg byte a [ plexShowSprite::plexFreeAdd1_ypos#0 ]
reg byte a [ plexShowSprite::plexFreeAdd1_$0 ]
reg byte a [ plexShowSprite::plexFreeAdd1_$1 ]

View File

@ -44,6 +44,8 @@
.label SCREEN = $400
// The high-value table
.label XMOVEMENT_HI = XMOVEMENT+$100
// The address of the sprite pointers on the current screen (screen+0x3f8).
.label PLEX_SCREEN_PTR = $f
// The index in the PLEX tables of the next sprite to show
.label plex_show_idx = $11
// The index the next sprite to use for showing (sprites are used round-robin)
@ -55,14 +57,17 @@
// Signal used between IRQ and main loop. Set to true when the IRQ is done showing the sprites.
.label frame_done = $15
// The next char to use from the scroll text
.label scroll_text_next = $e
.label scroll_text_next = $c
// Y-sine index
.label y_sin_idx = $b
.label y_sin_idx = 9
// X-movement index
.label x_movement_idx = $c
// The address of the sprite pointers on the current screen (screen+0x3f8).
.label PLEX_SCREEN_PTR = 2
.label x_movement_idx = $a
__start: {
// PLEX_SCREEN_PTR = 0x400+0x3f8
lda #<$400+$3f8
sta.z PLEX_SCREEN_PTR
lda #>$400+$3f8
sta.z PLEX_SCREEN_PTR+1
// plex_show_idx=0
lda #0
sta.z plex_show_idx
@ -132,7 +137,7 @@ plex_irq: {
}
main: {
.const toD0181_return = (>(SCREEN&$3fff)*4)|(>CHARSET_DEFAULT)/4&$f
.label s = 4
.label s = 2
.label __13 = $17
// asm
// Create 2x2 font from CHARGEN
@ -358,15 +363,15 @@ font_2x2: {
.label __5 = $17
.label __7 = $17
.label next_2x2_left = $1a
.label next_2x2_right = 9
.label glyph_bits = $d
.label next_2x2_right = 7
.label glyph_bits = $b
.label glyph_bits_2x2 = $17
.label l2 = $1c
.label l = $1d
.label next_2x2_left_1 = 7
.label next_2x2_left_1 = 5
.label next_2x2 = $1a
.label next_original = 5
.label c = $10
.label next_original = 3
.label c = $e
lda #0
sta.z c
lda #<CHARGEN
@ -522,12 +527,12 @@ font_2x2: {
font_2x2_to_sprites: {
.const num_chars = $40
.label __3 = $1c
.label char_right = 9
.label char_right = 7
.label sprite_idx = $1d
.label char_left = 7
.label char_left = 5
.label char_current = $1a
.label sprite = 5
.label c = $10
.label sprite = 3
.label c = $e
lda #<SPRITES
sta.z sprite
lda #>SPRITES
@ -644,6 +649,11 @@ font_2x2_to_sprites: {
}
// Initialize the multiplexer data structures
plexInit: {
// PLEX_SCREEN_PTR = screen+0x3f8
lda #<SCREEN+$3f8
sta.z PLEX_SCREEN_PTR
lda #>SCREEN+$3f8
sta.z PLEX_SCREEN_PTR+1
ldx #0
__b1:
// PLEX_SORTED_IDX[i] = i
@ -659,8 +669,8 @@ plexInit: {
// Move the plex sprites in an Y-sine and scroll them to the left.
plex_move: {
.label y_idx = $1c
.label x_idx = $10
.label s = $d
.label x_idx = $e
.label s = $b
.label __7 = $1a
// y_idx = y_sin_idx
lda.z y_sin_idx
@ -752,7 +762,7 @@ plex_move: {
plexSort: {
.label nxt_idx = $1c
.label nxt_y = $1d
.label m = $10
.label m = $e
lda #0
sta.z m
__b1:

View File

@ -4,28 +4,28 @@ __start: scope:[__start] from
[0] phi()
to:__start::__init1
__start::__init1: scope:[__start] from __start
[1] plex_show_idx = 0
[2] plex_sprite_idx = 0
[3] plex_sprite_msb = 1
[4] plex_free_next = 0
[1] PLEX_SCREEN_PTR = (byte*)$400+$3f8
[2] plex_show_idx = 0
[3] plex_sprite_idx = 0
[4] plex_sprite_msb = 1
[5] plex_free_next = 0
to:__start::__init1_toSpritePtr1
__start::__init1_toSpritePtr1: scope:[__start] from __start::__init1
[5] phi()
[6] phi()
to:__start::__init1_@1
__start::__init1_@1: scope:[__start] from __start::__init1_toSpritePtr1
[6] frame_done = false
[7] frame_done = false
to:__start::@1
__start::@1: scope:[__start] from __start::__init1_@1
[7] phi()
[8] call main
[8] phi()
[9] call main
to:__start::@return
__start::@return: scope:[__start] from __start::@1
[9] return
[10] return
to:@return
interrupt(KERNEL_MIN) void plex_irq()
plex_irq: scope:[plex_irq] from
[10] PLEX_SCREEN_PTR#31 = phi( )
asm { sei }
to:plex_irq::@3
plex_irq::@3: scope:[plex_irq] from plex_irq plex_irq::@7
@ -147,7 +147,7 @@ plexShowSprite::plexFreeAdd1: scope:[plexShowSprite] from plexShowSprite
[72] plex_free_next = plexShowSprite::plexFreeAdd1_$2
to:plexShowSprite::@5
plexShowSprite::@5: scope:[plexShowSprite] from plexShowSprite::plexFreeAdd1
[73] PLEX_SCREEN_PTR#31[plex_sprite_idx] = PLEX_PTR[PLEX_SORTED_IDX[plex_show_idx]]
[73] PLEX_SCREEN_PTR[plex_sprite_idx] = PLEX_PTR[PLEX_SORTED_IDX[plex_show_idx]]
[74] plexShowSprite::xpos_idx#0 = PLEX_SORTED_IDX[plex_show_idx]
[75] plexShowSprite::$11 = plexShowSprite::xpos_idx#0 << 1
[76] plexShowSprite::$2 = < PLEX_XPOS[plexShowSprite::$11]
@ -308,7 +308,7 @@ plexInit: scope:[plexInit] from main::@10
[156] phi()
to:plexInit::plexSetScreen1
plexInit::plexSetScreen1: scope:[plexInit] from plexInit
[157] phi()
[157] PLEX_SCREEN_PTR = SCREEN+$3f8
to:plexInit::@1
plexInit::@1: scope:[plexInit] from plexInit::@1 plexInit::plexSetScreen1
[158] plexInit::i#2 = phi( plexInit::@1/plexInit::i#1, plexInit::plexSetScreen1/0 )

File diff suppressed because it is too large Load Diff

View File

@ -12,8 +12,7 @@ const byte OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d
const nomodify byte PLEX_COUNT = $20
const byte* PLEX_FREE_YPOS[8] = { fill( 8, 0) }
const byte* PLEX_PTR[PLEX_COUNT] = { fill( PLEX_COUNT, 0) }
byte* PLEX_SCREEN_PTR
byte* PLEX_SCREEN_PTR#31 PLEX_SCREEN_PTR zp[2]:2 2.9705882352941178
volatile byte* PLEX_SCREEN_PTR loadstore zp[2]:15 6.181818181818182
const byte* PLEX_SORTED_IDX[PLEX_COUNT] = { fill( PLEX_COUNT, 0) }
const word* PLEX_XPOS[PLEX_COUNT] = { fill( PLEX_COUNT, 0) }
const byte* PLEX_YPOS[PLEX_COUNT] = { fill( PLEX_COUNT, 0) }
@ -58,16 +57,16 @@ byte font_2x2::b
byte font_2x2::b#1 reg byte y 150001.5
byte font_2x2::b#2 reg byte y 20000.2
byte font_2x2::c
byte font_2x2::c#1 c zp[1]:16 1501.5
byte font_2x2::c#11 c zp[1]:16 55.611111111111114
byte font_2x2::c#1 c zp[1]:14 1501.5
byte font_2x2::c#11 c zp[1]:14 55.611111111111114
byte* font_2x2::font_2x2
byte* font_2x2::font_original
byte font_2x2::glyph_bit
byte font_2x2::glyph_bit#0 reg byte x 50000.5
byte font_2x2::glyph_bits
byte font_2x2::glyph_bits#0 glyph_bits zp[1]:13 20002.0
byte font_2x2::glyph_bits#1 glyph_bits zp[1]:13 66667.33333333333
byte font_2x2::glyph_bits#2 glyph_bits zp[1]:13 34444.88888888889
byte font_2x2::glyph_bits#0 glyph_bits zp[1]:11 20002.0
byte font_2x2::glyph_bits#1 glyph_bits zp[1]:11 66667.33333333333
byte font_2x2::glyph_bits#2 glyph_bits zp[1]:11 34444.88888888889
word font_2x2::glyph_bits_2x2
word font_2x2::glyph_bits_2x2#1 glyph_bits_2x2 zp[2]:23 200002.0
word font_2x2::glyph_bits_2x2#2 glyph_bits_2x2 zp[2]:23 20000.500000000004
@ -83,36 +82,36 @@ byte* font_2x2::next_2x2
byte* font_2x2::next_2x2#1 next_2x2 zp[2]:26 500.5
byte* font_2x2::next_2x2_left
byte* font_2x2::next_2x2_left#0 next_2x2_left zp[2]:26 706.0588235294117
byte* font_2x2::next_2x2_left#1 next_2x2_left_1 zp[2]:7 10001.0
byte* font_2x2::next_2x2_left#10 next_2x2_left_1 zp[2]:7 2002.0
byte* font_2x2::next_2x2_left#7 next_2x2_left_1 zp[2]:7 1577.1153846153845
byte* font_2x2::next_2x2_left#8 next_2x2_left_1 zp[2]:7 10001.0
byte* font_2x2::next_2x2_left#1 next_2x2_left_1 zp[2]:5 10001.0
byte* font_2x2::next_2x2_left#10 next_2x2_left_1 zp[2]:5 2002.0
byte* font_2x2::next_2x2_left#7 next_2x2_left_1 zp[2]:5 1577.1153846153845
byte* font_2x2::next_2x2_left#8 next_2x2_left_1 zp[2]:5 10001.0
byte* font_2x2::next_2x2_right
byte* font_2x2::next_2x2_right#0 next_2x2_right zp[2]:9 1001.0
byte* font_2x2::next_2x2_right#1 next_2x2_right zp[2]:9 20002.0
byte* font_2x2::next_2x2_right#7 next_2x2_right zp[2]:9 1577.1153846153845
byte* font_2x2::next_2x2_right#8 next_2x2_right zp[2]:9 10001.0
byte* font_2x2::next_2x2_right#0 next_2x2_right zp[2]:7 1001.0
byte* font_2x2::next_2x2_right#1 next_2x2_right zp[2]:7 20002.0
byte* font_2x2::next_2x2_right#7 next_2x2_right zp[2]:7 1577.1153846153845
byte* font_2x2::next_2x2_right#8 next_2x2_right zp[2]:7 10001.0
byte* font_2x2::next_original
byte* font_2x2::next_original#1 next_original zp[2]:5 667.3333333333334
byte* font_2x2::next_original#4 next_original zp[2]:5 342.9428571428572
byte* font_2x2::next_original#1 next_original zp[2]:3 667.3333333333334
byte* font_2x2::next_original#4 next_original zp[2]:3 342.9428571428572
void font_2x2_to_sprites(byte* font_2x2_to_sprites::font_2x2 , byte* font_2x2_to_sprites::sprites , byte font_2x2_to_sprites::num_chars)
byte~ font_2x2_to_sprites::$3 zp[1]:28 10001.0
byte font_2x2_to_sprites::c
byte font_2x2_to_sprites::c#1 c zp[1]:16 2002.0
byte font_2x2_to_sprites::c#2 c zp[1]:16 136.5
byte font_2x2_to_sprites::c#1 c zp[1]:14 2002.0
byte font_2x2_to_sprites::c#2 c zp[1]:14 136.5
byte* font_2x2_to_sprites::char_current
byte* font_2x2_to_sprites::char_current#1 char_current zp[2]:26 667.3333333333334
byte* font_2x2_to_sprites::char_current#2 char_current zp[2]:26 1200.3
byte* font_2x2_to_sprites::char_left
byte* font_2x2_to_sprites::char_left#1 char_left zp[2]:7 10001.0
byte* font_2x2_to_sprites::char_left#3 char_left zp[2]:7 2818.5454545454545
byte* font_2x2_to_sprites::char_left#4 char_left zp[2]:7 10001.0
byte* font_2x2_to_sprites::char_left#6 char_left zp[2]:7 2002.0
byte* font_2x2_to_sprites::char_left#1 char_left zp[2]:5 10001.0
byte* font_2x2_to_sprites::char_left#3 char_left zp[2]:5 2818.5454545454545
byte* font_2x2_to_sprites::char_left#4 char_left zp[2]:5 10001.0
byte* font_2x2_to_sprites::char_left#6 char_left zp[2]:5 2002.0
byte* font_2x2_to_sprites::char_right
byte* font_2x2_to_sprites::char_right#0 char_right zp[2]:9 1001.0
byte* font_2x2_to_sprites::char_right#1 char_right zp[2]:9 20002.0
byte* font_2x2_to_sprites::char_right#3 char_right zp[2]:9 2818.5454545454545
byte* font_2x2_to_sprites::char_right#4 char_right zp[2]:9 10001.0
byte* font_2x2_to_sprites::char_right#0 char_right zp[2]:7 1001.0
byte* font_2x2_to_sprites::char_right#1 char_right zp[2]:7 20002.0
byte* font_2x2_to_sprites::char_right#3 char_right zp[2]:7 2818.5454545454545
byte* font_2x2_to_sprites::char_right#4 char_right zp[2]:7 10001.0
byte* font_2x2_to_sprites::font_2x2
byte font_2x2_to_sprites::i
byte font_2x2_to_sprites::i#1 reg byte x 15001.5
@ -120,8 +119,8 @@ byte font_2x2_to_sprites::i#2 reg byte x 3571.7857142857147
byte font_2x2_to_sprites::num_chars
const byte font_2x2_to_sprites::num_chars#0 num_chars = $40
byte* font_2x2_to_sprites::sprite
byte* font_2x2_to_sprites::sprite#1 sprite zp[2]:5 1001.0
byte* font_2x2_to_sprites::sprite#4 sprite zp[2]:5 1524.047619047619
byte* font_2x2_to_sprites::sprite#1 sprite zp[2]:3 1001.0
byte* font_2x2_to_sprites::sprite#4 sprite zp[2]:3 1524.047619047619
byte font_2x2_to_sprites::sprite_idx
byte font_2x2_to_sprites::sprite_idx#1 sprite_idx zp[1]:29 15001.5
byte font_2x2_to_sprites::sprite_idx#2 reg byte y 15001.5
@ -133,8 +132,8 @@ void main()
byte~ main::$12 reg byte y 101.0
word~ main::$13 zp[2]:23 202.0
byte main::s
byte main::s#1 s zp[1]:4 202.0
byte main::s#2 s zp[1]:4 72.14285714285714
byte main::s#1 s zp[1]:2 202.0
byte main::s#2 s zp[1]:2 72.14285714285714
byte main::s1
byte main::s1#1 reg byte x 151.5
byte main::s1#2 reg byte x 151.5
@ -170,8 +169,8 @@ byte plexShowSprite::xpos_idx#0 reg byte a 202.0
byte plexShowSprite::ypos
void plexSort()
byte plexSort::m
byte plexSort::m#1 m zp[1]:16 150001.5
byte plexSort::m#2 m zp[1]:16 41667.08333333333
byte plexSort::m#1 m zp[1]:14 150001.5
byte plexSort::m#2 m zp[1]:14 41667.08333333333
byte plexSort::nxt_idx
byte plexSort::nxt_idx#0 nxt_idx zp[1]:28 30000.300000000003
byte plexSort::nxt_y
@ -184,7 +183,7 @@ byte plexSort::s#1 reg byte x 1366668.3333333335
byte plexSort::s#2 reg byte x 200002.0
byte plexSort::s#3 reg byte x 2050002.5
byte plexSort::s#6 reg byte x 200002.0
volatile byte plex_free_next loadstore zp[1]:20 41.15625
volatile byte plex_free_next loadstore zp[1]:20 42.483870967741936
interrupt(KERNEL_MIN) void plex_irq()
byte~ plex_irq::$4 zp[1]:22 11.0
byte plex_irq::plexFreeNextYpos1_return
@ -195,50 +194,50 @@ byte~ plex_move::$4 reg byte a 200002.0
byte~ plex_move::$6 reg byte x 100001.0
word~ plex_move::$7 zp[2]:26 200002.0
byte plex_move::s
byte plex_move::s#1 s zp[1]:13 150001.5
byte plex_move::s#2 s zp[1]:13 33333.66666666667
byte plex_move::s#1 s zp[1]:11 150001.5
byte plex_move::s#2 s zp[1]:11 33333.66666666667
byte plex_move::x_idx
byte plex_move::x_idx#0 x_idx zp[1]:16 2002.0
byte plex_move::x_idx#1 x_idx zp[1]:16 66667.33333333333
byte plex_move::x_idx#2 x_idx zp[1]:16 35786.142857142855
byte plex_move::x_idx#0 x_idx zp[1]:14 2002.0
byte plex_move::x_idx#1 x_idx zp[1]:14 66667.33333333333
byte plex_move::x_idx#2 x_idx zp[1]:14 35786.142857142855
byte plex_move::y_idx
byte plex_move::y_idx#0 y_idx zp[1]:28 1001.0
byte plex_move::y_idx#1 y_idx zp[1]:28 13333.466666666667
byte plex_move::y_idx#2 y_idx zp[1]:28 150502.0
volatile byte plex_show_idx loadstore zp[1]:17 44.73529411764706
volatile byte plex_sprite_idx loadstore zp[1]:18 43.96875
volatile byte plex_sprite_msb loadstore zp[1]:19 47.32352941176471
volatile byte plex_show_idx loadstore zp[1]:17 46.09090909090909
volatile byte plex_sprite_idx loadstore zp[1]:18 45.38709677419355
volatile byte plex_sprite_msb loadstore zp[1]:19 48.75757575757575
byte* scroll_text_next
byte* scroll_text_next#12 scroll_text_next zp[2]:14 44556.11111111111
byte* scroll_text_next#13 scroll_text_next zp[2]:14 100001.0
byte* scroll_text_next#14 scroll_text_next zp[2]:14 13048.0
byte* scroll_text_next#27 scroll_text_next zp[2]:14 367.33333333333337
byte* scroll_text_next#3 scroll_text_next zp[2]:14 200002.0
byte* scroll_text_next#12 scroll_text_next zp[2]:12 44556.11111111111
byte* scroll_text_next#13 scroll_text_next zp[2]:12 100001.0
byte* scroll_text_next#14 scroll_text_next zp[2]:12 13048.0
byte* scroll_text_next#27 scroll_text_next zp[2]:12 367.33333333333337
byte* scroll_text_next#3 scroll_text_next zp[2]:12 200002.0
byte x_movement_idx
byte x_movement_idx#11 x_movement_idx zp[1]:12 100.14285714285714
byte x_movement_idx#13 x_movement_idx zp[1]:12 61.22222222222223
byte x_movement_idx#11 x_movement_idx zp[1]:10 100.14285714285714
byte x_movement_idx#13 x_movement_idx zp[1]:10 61.22222222222223
byte y_sin_idx
byte y_sin_idx#11 y_sin_idx zp[1]:11 105.14999999999999
byte y_sin_idx#13 y_sin_idx zp[1]:11 58.0
byte y_sin_idx#11 y_sin_idx zp[1]:9 105.14999999999999
byte y_sin_idx#13 y_sin_idx zp[1]:9 58.0
zp[2]:2 [ PLEX_SCREEN_PTR#31 ]
zp[1]:4 [ main::s#2 main::s#1 ]
zp[1]:2 [ main::s#2 main::s#1 ]
reg byte x [ main::x#2 main::x#1 ]
reg byte x [ main::s1#2 main::s1#1 ]
reg byte y [ font_2x2::b#2 font_2x2::b#1 ]
reg byte x [ font_2x2::glyph_bit#0 ]
zp[2]:5 [ font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::sprite#1 font_2x2::next_original#4 font_2x2::next_original#1 ]
zp[2]:3 [ font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::sprite#1 font_2x2::next_original#4 font_2x2::next_original#1 ]
reg byte x [ font_2x2_to_sprites::i#2 font_2x2_to_sprites::i#1 ]
zp[2]:7 [ font_2x2_to_sprites::char_left#3 font_2x2_to_sprites::char_left#6 font_2x2_to_sprites::char_left#4 font_2x2_to_sprites::char_left#1 font_2x2::next_2x2_left#7 font_2x2::next_2x2_left#10 font_2x2::next_2x2_left#8 font_2x2::next_2x2_left#1 ]
zp[2]:9 [ font_2x2_to_sprites::char_right#3 font_2x2_to_sprites::char_right#0 font_2x2_to_sprites::char_right#4 font_2x2_to_sprites::char_right#1 font_2x2::next_2x2_right#7 font_2x2::next_2x2_right#0 font_2x2::next_2x2_right#8 font_2x2::next_2x2_right#1 ]
zp[2]:5 [ font_2x2_to_sprites::char_left#3 font_2x2_to_sprites::char_left#6 font_2x2_to_sprites::char_left#4 font_2x2_to_sprites::char_left#1 font_2x2::next_2x2_left#7 font_2x2::next_2x2_left#10 font_2x2::next_2x2_left#8 font_2x2::next_2x2_left#1 ]
zp[2]:7 [ font_2x2_to_sprites::char_right#3 font_2x2_to_sprites::char_right#0 font_2x2_to_sprites::char_right#4 font_2x2_to_sprites::char_right#1 font_2x2::next_2x2_right#7 font_2x2::next_2x2_right#0 font_2x2::next_2x2_right#8 font_2x2::next_2x2_right#1 ]
reg byte x [ plexInit::i#2 plexInit::i#1 ]
zp[1]:11 [ y_sin_idx#11 y_sin_idx#13 ]
zp[1]:12 [ x_movement_idx#11 x_movement_idx#13 ]
zp[1]:13 [ plex_move::s#2 plex_move::s#1 font_2x2::glyph_bits#2 font_2x2::glyph_bits#0 font_2x2::glyph_bits#1 ]
zp[2]:14 [ scroll_text_next#13 scroll_text_next#12 scroll_text_next#27 scroll_text_next#14 scroll_text_next#3 ]
zp[1]:16 [ plexSort::m#2 plexSort::m#1 plex_move::x_idx#2 plex_move::x_idx#0 plex_move::x_idx#1 font_2x2_to_sprites::c#2 font_2x2_to_sprites::c#1 font_2x2::c#11 font_2x2::c#1 ]
zp[1]:9 [ y_sin_idx#11 y_sin_idx#13 ]
zp[1]:10 [ x_movement_idx#11 x_movement_idx#13 ]
zp[1]:11 [ plex_move::s#2 plex_move::s#1 font_2x2::glyph_bits#2 font_2x2::glyph_bits#0 font_2x2::glyph_bits#1 ]
zp[2]:12 [ scroll_text_next#13 scroll_text_next#12 scroll_text_next#27 scroll_text_next#14 scroll_text_next#3 ]
zp[1]:14 [ plexSort::m#2 plexSort::m#1 plex_move::x_idx#2 plex_move::x_idx#0 plex_move::x_idx#1 font_2x2_to_sprites::c#2 font_2x2_to_sprites::c#1 font_2x2::c#11 font_2x2::c#1 ]
reg byte x [ plexSort::s#3 plexSort::s#1 plexSort::s#6 ]
reg byte x [ plexSort::plexFreePrepare1_s#2 plexSort::plexFreePrepare1_s#1 ]
zp[2]:15 [ PLEX_SCREEN_PTR ]
zp[1]:17 [ plex_show_idx ]
zp[1]:18 [ plex_sprite_idx ]
zp[1]:19 [ plex_sprite_msb ]

View File

@ -26,16 +26,21 @@
// Location of screen & sprites
.label SCREEN = $400
// The address of the sprite pointers on the current screen (screen+0x3f8).
.label PLEX_SCREEN_PTR = SCREEN+$3f8
.label PLEX_SCREEN_PTR = 6
// The index in the PLEX tables of the next sprite to show
.label plex_show_idx = 6
.label plex_show_idx = 8
// The index the next sprite to use for showing (sprites are used round-robin)
.label plex_sprite_idx = 7
.label plex_sprite_idx = 9
// The MSB bit of the next sprite to use for showing
.label plex_sprite_msb = 8
.label plex_sprite_msb = $a
// The index of the sprite that is free next. Since sprites are used round-robin this moves forward each time a sprite is shown.
.label plex_free_next = 9
.label plex_free_next = $b
__start: {
// PLEX_SCREEN_PTR = 0x400+0x3f8
lda #<$400+$3f8
sta.z PLEX_SCREEN_PTR
lda #>$400+$3f8
sta.z PLEX_SCREEN_PTR+1
// plex_show_idx=0
lda #0
sta.z plex_show_idx
@ -119,7 +124,7 @@ init: {
loop: {
// The current index into the y-sinus
.label sin_idx = 4
.label plexFreeNextYpos1_return = $a
.label plexFreeNextYpos1_return = $c
.label ss = 5
lda #0
sta.z sin_idx
@ -191,6 +196,11 @@ loop: {
}
// Initialize the multiplexer data structures
plexInit: {
// PLEX_SCREEN_PTR = screen+0x3f8
lda #<SCREEN+$3f8
sta.z PLEX_SCREEN_PTR
lda #>SCREEN+$3f8
sta.z PLEX_SCREEN_PTR+1
ldx #0
__b1:
// PLEX_SORTED_IDX[i] = i
@ -213,9 +223,9 @@ plexInit: {
// elements before the marker are shifted right one at a time until encountering one smaller than the current one.
// It is then inserted at the spot. Now the marker can move forward.
plexSort: {
.label nxt_idx = $c
.label nxt_y = $b
.label m = $a
.label nxt_idx = $e
.label nxt_y = $d
.label m = $c
lda #0
sta.z m
__b1:
@ -283,7 +293,7 @@ plexSort: {
// Show the next sprite.
// plexSort() prepares showing the sprites
plexShowSprite: {
.label plex_sprite_idx2 = $c
.label plex_sprite_idx2 = $e
// plex_sprite_idx2 = plex_sprite_idx*2
lda.z plex_sprite_idx
asl
@ -313,8 +323,8 @@ plexShowSprite: {
ldx.z plex_show_idx
ldy PLEX_SORTED_IDX,x
lda PLEX_PTR,y
ldx.z plex_sprite_idx
sta PLEX_SCREEN_PTR,x
ldy.z plex_sprite_idx
sta (PLEX_SCREEN_PTR),y
// xpos_idx = PLEX_SORTED_IDX[plex_show_idx]
ldy.z plex_show_idx
lda PLEX_SORTED_IDX,y

View File

@ -4,224 +4,225 @@ __start: scope:[__start] from
[0] phi()
to:__start::__init1
__start::__init1: scope:[__start] from __start
[1] plex_show_idx = 0
[2] plex_sprite_idx = 0
[3] plex_sprite_msb = 1
[4] plex_free_next = 0
[1] PLEX_SCREEN_PTR = (byte*)$400+$3f8
[2] plex_show_idx = 0
[3] plex_sprite_idx = 0
[4] plex_sprite_msb = 1
[5] plex_free_next = 0
to:__start::@1
__start::@1: scope:[__start] from __start::__init1
[5] phi()
[6] call main
[6] phi()
[7] call main
to:__start::@return
__start::@return: scope:[__start] from __start::@1
[7] return
[8] return
to:@return
void main()
main: scope:[main] from __start::@1
asm { sei }
[9] call init
[10] call init
to:main::@1
main::@1: scope:[main] from main
[10] phi()
[11] call loop
[11] phi()
[12] call loop
to:main::@return
main::@return: scope:[main] from main::@1
[12] return
[13] return
to:@return
void init()
init: scope:[init] from main
[13] *D011 = VIC_DEN|VIC_RSEL|3
[14] call plexInit
[14] *D011 = VIC_DEN|VIC_RSEL|3
[15] call plexInit
to:init::@1
init::@1: scope:[init] from init init::@1
[15] init::xp#2 = phi( init::@1/init::xp#1, init/$20 )
[15] init::sx#2 = phi( init::@1/init::sx#1, init/0 )
[16] PLEX_PTR[init::sx#2] = (byte)SPRITE/$40
[17] init::$3 = init::sx#2 << 1
[18] PLEX_XPOS[init::$3] = init::xp#2
[19] init::xp#1 = init::xp#2 + 9
[20] init::sx#1 = ++ init::sx#2
[21] if(init::sx#1!=PLEX_COUNT-1+1) goto init::@1
[16] init::xp#2 = phi( init::@1/init::xp#1, init/$20 )
[16] init::sx#2 = phi( init::@1/init::sx#1, init/0 )
[17] PLEX_PTR[init::sx#2] = (byte)SPRITE/$40
[18] init::$3 = init::sx#2 << 1
[19] PLEX_XPOS[init::$3] = init::xp#2
[20] init::xp#1 = init::xp#2 + 9
[21] init::sx#1 = ++ init::sx#2
[22] if(init::sx#1!=PLEX_COUNT-1+1) goto init::@1
to:init::@2
init::@2: scope:[init] from init::@1
[22] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) = $ff
[23] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) = $ff
to:init::@3
init::@3: scope:[init] from init::@2 init::@3
[23] init::ss#2 = phi( init::@2/0, init::@3/init::ss#1 )
[24] SPRITES_COLOR[init::ss#2] = GREEN
[25] init::ss#1 = ++ init::ss#2
[26] if(init::ss#1!=8) goto init::@3
[24] init::ss#2 = phi( init::@2/0, init::@3/init::ss#1 )
[25] SPRITES_COLOR[init::ss#2] = GREEN
[26] init::ss#1 = ++ init::ss#2
[27] if(init::ss#1!=8) goto init::@3
to:init::@return
init::@return: scope:[init] from init::@3
[27] return
[28] return
to:@return
void loop()
loop: scope:[loop] from main::@1
[28] phi()
[29] phi()
to:loop::@1
loop::@1: scope:[loop] from loop loop::@10
[29] loop::sin_idx#6 = phi( loop/0, loop::@10/loop::sin_idx#1 )
[30] loop::sin_idx#6 = phi( loop/0, loop::@10/loop::sin_idx#1 )
to:loop::@2
loop::@2: scope:[loop] from loop::@1 loop::@2
[30] if(*((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)!=$ff) goto loop::@2
[31] if(*((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)!=$ff) goto loop::@2
to:loop::@3
loop::@3: scope:[loop] from loop::@2
[31] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) = ++ *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
[32] loop::y_idx#3 = loop::sin_idx#6
[32] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) = ++ *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
[33] loop::y_idx#3 = loop::sin_idx#6
to:loop::@4
loop::@4: scope:[loop] from loop::@3 loop::@4
[33] loop::sy#2 = phi( loop::@3/0, loop::@4/loop::sy#1 )
[33] loop::y_idx#2 = phi( loop::@3/loop::y_idx#3, loop::@4/loop::y_idx#1 )
[34] PLEX_YPOS[loop::sy#2] = YSIN[loop::y_idx#2]
[35] loop::y_idx#1 = loop::y_idx#2 + 8
[36] loop::sy#1 = ++ loop::sy#2
[37] if(loop::sy#1!=PLEX_COUNT-1+1) goto loop::@4
[34] loop::sy#2 = phi( loop::@3/0, loop::@4/loop::sy#1 )
[34] loop::y_idx#2 = phi( loop::@3/loop::y_idx#3, loop::@4/loop::y_idx#1 )
[35] PLEX_YPOS[loop::sy#2] = YSIN[loop::y_idx#2]
[36] loop::y_idx#1 = loop::y_idx#2 + 8
[37] loop::sy#1 = ++ loop::sy#2
[38] if(loop::sy#1!=PLEX_COUNT-1+1) goto loop::@4
to:loop::@5
loop::@5: scope:[loop] from loop::@4
[38] loop::sin_idx#1 = loop::sin_idx#6 + 1
[39] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) = ++ *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
[40] call plexSort
[39] loop::sin_idx#1 = loop::sin_idx#6 + 1
[40] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) = ++ *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
[41] call plexSort
to:loop::@11
loop::@11: scope:[loop] from loop::@5
[41] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) = BLACK
[42] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) = BLACK
to:loop::@6
loop::@6: scope:[loop] from loop::@11 loop::@6
[42] loop::$5 = *D011 & VIC_RST8
[43] if(loop::$5!=0) goto loop::@6
[43] loop::$5 = *D011 & VIC_RST8
[44] if(loop::$5!=0) goto loop::@6
to:loop::@7
loop::@7: scope:[loop] from loop::@12 loop::@6
[44] loop::ss#5 = phi( loop::@12/loop::ss#1, loop::@6/0 )
[45] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) = BLACK
[45] loop::ss#5 = phi( loop::@12/loop::ss#1, loop::@6/0 )
[46] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) = BLACK
to:loop::plexFreeNextYpos1
loop::plexFreeNextYpos1: scope:[loop] from loop::@7
[46] loop::plexFreeNextYpos1_return#0 = PLEX_FREE_YPOS[plex_free_next]
[47] loop::plexFreeNextYpos1_return#0 = PLEX_FREE_YPOS[plex_free_next]
to:loop::@8
loop::@8: scope:[loop] from loop::@8 loop::plexFreeNextYpos1
[47] if(*((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)<loop::plexFreeNextYpos1_return#0) goto loop::@8
[48] if(*((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)<loop::plexFreeNextYpos1_return#0) goto loop::@8
to:loop::@9
loop::@9: scope:[loop] from loop::@8
[48] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) = ++ *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
[49] call plexShowSprite
[49] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) = ++ *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
[50] call plexShowSprite
to:loop::@12
loop::@12: scope:[loop] from loop::@9
[50] loop::ss#1 = ++ loop::ss#5
[51] if(loop::ss#1!=PLEX_COUNT-1+1) goto loop::@7
[51] loop::ss#1 = ++ loop::ss#5
[52] if(loop::ss#1!=PLEX_COUNT-1+1) goto loop::@7
to:loop::@10
loop::@10: scope:[loop] from loop::@12
[52] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) = BLACK
[53] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) = BLACK
to:loop::@1
void plexInit(byte* plexInit::screen)
plexInit: scope:[plexInit] from init
[53] phi()
[54] phi()
to:plexInit::plexSetScreen1
plexInit::plexSetScreen1: scope:[plexInit] from plexInit
[54] phi()
[55] PLEX_SCREEN_PTR = SCREEN+$3f8
to:plexInit::@1
plexInit::@1: scope:[plexInit] from plexInit::@1 plexInit::plexSetScreen1
[55] plexInit::i#2 = phi( plexInit::@1/plexInit::i#1, plexInit::plexSetScreen1/0 )
[56] PLEX_SORTED_IDX[plexInit::i#2] = plexInit::i#2
[57] plexInit::i#1 = ++ plexInit::i#2
[58] if(plexInit::i#1!=PLEX_COUNT-1+1) goto plexInit::@1
[56] plexInit::i#2 = phi( plexInit::@1/plexInit::i#1, plexInit::plexSetScreen1/0 )
[57] PLEX_SORTED_IDX[plexInit::i#2] = plexInit::i#2
[58] plexInit::i#1 = ++ plexInit::i#2
[59] if(plexInit::i#1!=PLEX_COUNT-1+1) goto plexInit::@1
to:plexInit::@return
plexInit::@return: scope:[plexInit] from plexInit::@1
[59] return
[60] return
to:@return
void plexSort()
plexSort: scope:[plexSort] from loop::@5
[60] phi()
[61] phi()
to:plexSort::@1
plexSort::@1: scope:[plexSort] from plexSort plexSort::@2
[61] plexSort::m#2 = phi( plexSort/0, plexSort::@2/plexSort::m#1 )
[62] plexSort::nxt_idx#0 = (PLEX_SORTED_IDX+1)[plexSort::m#2]
[63] plexSort::nxt_y#0 = PLEX_YPOS[plexSort::nxt_idx#0]
[64] if(plexSort::nxt_y#0>=PLEX_YPOS[PLEX_SORTED_IDX[plexSort::m#2]]) goto plexSort::@2
[62] plexSort::m#2 = phi( plexSort/0, plexSort::@2/plexSort::m#1 )
[63] plexSort::nxt_idx#0 = (PLEX_SORTED_IDX+1)[plexSort::m#2]
[64] plexSort::nxt_y#0 = PLEX_YPOS[plexSort::nxt_idx#0]
[65] if(plexSort::nxt_y#0>=PLEX_YPOS[PLEX_SORTED_IDX[plexSort::m#2]]) goto plexSort::@2
to:plexSort::@5
plexSort::@5: scope:[plexSort] from plexSort::@1
[65] plexSort::s#6 = plexSort::m#2
[66] plexSort::s#6 = plexSort::m#2
to:plexSort::@3
plexSort::@3: scope:[plexSort] from plexSort::@5 plexSort::@7
[66] plexSort::s#3 = phi( plexSort::@7/plexSort::s#1, plexSort::@5/plexSort::s#6 )
[67] (PLEX_SORTED_IDX+1)[plexSort::s#3] = PLEX_SORTED_IDX[plexSort::s#3]
[68] plexSort::s#1 = -- plexSort::s#3
[69] if(plexSort::s#1==$ff) goto plexSort::@4
[67] plexSort::s#3 = phi( plexSort::@7/plexSort::s#1, plexSort::@5/plexSort::s#6 )
[68] (PLEX_SORTED_IDX+1)[plexSort::s#3] = PLEX_SORTED_IDX[plexSort::s#3]
[69] plexSort::s#1 = -- plexSort::s#3
[70] if(plexSort::s#1==$ff) goto plexSort::@4
to:plexSort::@7
plexSort::@7: scope:[plexSort] from plexSort::@3
[70] if(plexSort::nxt_y#0<PLEX_YPOS[PLEX_SORTED_IDX[plexSort::s#1]]) goto plexSort::@3
[71] if(plexSort::nxt_y#0<PLEX_YPOS[PLEX_SORTED_IDX[plexSort::s#1]]) goto plexSort::@3
to:plexSort::@4
plexSort::@4: scope:[plexSort] from plexSort::@3 plexSort::@7
[71] plexSort::s#2 = ++ plexSort::s#1
[72] PLEX_SORTED_IDX[plexSort::s#2] = plexSort::nxt_idx#0
[72] plexSort::s#2 = ++ plexSort::s#1
[73] PLEX_SORTED_IDX[plexSort::s#2] = plexSort::nxt_idx#0
to:plexSort::@2
plexSort::@2: scope:[plexSort] from plexSort::@1 plexSort::@4
[73] plexSort::m#1 = ++ plexSort::m#2
[74] if(plexSort::m#1!=PLEX_COUNT-2+1) goto plexSort::@1
[74] plexSort::m#1 = ++ plexSort::m#2
[75] if(plexSort::m#1!=PLEX_COUNT-2+1) goto plexSort::@1
to:plexSort::@6
plexSort::@6: scope:[plexSort] from plexSort::@2
[75] plex_show_idx = 0
[76] plex_sprite_idx = 0
[77] plex_sprite_msb = 1
[76] plex_show_idx = 0
[77] plex_sprite_idx = 0
[78] plex_sprite_msb = 1
to:plexSort::plexFreePrepare1
plexSort::plexFreePrepare1: scope:[plexSort] from plexSort::@6
[78] phi()
[79] phi()
to:plexSort::plexFreePrepare1_@1
plexSort::plexFreePrepare1_@1: scope:[plexSort] from plexSort::plexFreePrepare1 plexSort::plexFreePrepare1_@1
[79] plexSort::plexFreePrepare1_s#2 = phi( plexSort::plexFreePrepare1/0, plexSort::plexFreePrepare1_@1/plexSort::plexFreePrepare1_s#1 )
[80] PLEX_FREE_YPOS[plexSort::plexFreePrepare1_s#2] = 0
[81] plexSort::plexFreePrepare1_s#1 = ++ plexSort::plexFreePrepare1_s#2
[82] if(plexSort::plexFreePrepare1_s#1!=8) goto plexSort::plexFreePrepare1_@1
[80] plexSort::plexFreePrepare1_s#2 = phi( plexSort::plexFreePrepare1/0, plexSort::plexFreePrepare1_@1/plexSort::plexFreePrepare1_s#1 )
[81] PLEX_FREE_YPOS[plexSort::plexFreePrepare1_s#2] = 0
[82] plexSort::plexFreePrepare1_s#1 = ++ plexSort::plexFreePrepare1_s#2
[83] if(plexSort::plexFreePrepare1_s#1!=8) goto plexSort::plexFreePrepare1_@1
to:plexSort::plexFreePrepare1_@2
plexSort::plexFreePrepare1_@2: scope:[plexSort] from plexSort::plexFreePrepare1_@1
[83] plex_free_next = 0
[84] plex_free_next = 0
to:plexSort::@return
plexSort::@return: scope:[plexSort] from plexSort::plexFreePrepare1_@2
[84] return
[85] return
to:@return
void plexShowSprite()
plexShowSprite: scope:[plexShowSprite] from loop::@9
[85] plexShowSprite::plex_sprite_idx2#0 = plex_sprite_idx << 1
[86] plexShowSprite::plexFreeAdd1_ypos#0 = PLEX_YPOS[PLEX_SORTED_IDX[plex_show_idx]]
[87] SPRITES_YPOS[plexShowSprite::plex_sprite_idx2#0] = plexShowSprite::plexFreeAdd1_ypos#0
[86] plexShowSprite::plex_sprite_idx2#0 = plex_sprite_idx << 1
[87] plexShowSprite::plexFreeAdd1_ypos#0 = PLEX_YPOS[PLEX_SORTED_IDX[plex_show_idx]]
[88] SPRITES_YPOS[plexShowSprite::plex_sprite_idx2#0] = plexShowSprite::plexFreeAdd1_ypos#0
to:plexShowSprite::plexFreeAdd1
plexShowSprite::plexFreeAdd1: scope:[plexShowSprite] from plexShowSprite
[88] plexShowSprite::plexFreeAdd1_$0 = plexShowSprite::plexFreeAdd1_ypos#0 + $15
[89] PLEX_FREE_YPOS[plex_free_next] = plexShowSprite::plexFreeAdd1_$0
[90] plexShowSprite::plexFreeAdd1_$1 = plex_free_next + 1
[91] plexShowSprite::plexFreeAdd1_$2 = plexShowSprite::plexFreeAdd1_$1 & 7
[92] plex_free_next = plexShowSprite::plexFreeAdd1_$2
[89] plexShowSprite::plexFreeAdd1_$0 = plexShowSprite::plexFreeAdd1_ypos#0 + $15
[90] PLEX_FREE_YPOS[plex_free_next] = plexShowSprite::plexFreeAdd1_$0
[91] plexShowSprite::plexFreeAdd1_$1 = plex_free_next + 1
[92] plexShowSprite::plexFreeAdd1_$2 = plexShowSprite::plexFreeAdd1_$1 & 7
[93] plex_free_next = plexShowSprite::plexFreeAdd1_$2
to:plexShowSprite::@5
plexShowSprite::@5: scope:[plexShowSprite] from plexShowSprite::plexFreeAdd1
[93] PLEX_SCREEN_PTR#0[plex_sprite_idx] = PLEX_PTR[PLEX_SORTED_IDX[plex_show_idx]]
[94] plexShowSprite::xpos_idx#0 = PLEX_SORTED_IDX[plex_show_idx]
[95] plexShowSprite::$11 = plexShowSprite::xpos_idx#0 << 1
[96] plexShowSprite::$2 = < PLEX_XPOS[plexShowSprite::$11]
[97] SPRITES_XPOS[plexShowSprite::plex_sprite_idx2#0] = plexShowSprite::$2
[98] plexShowSprite::$3 = > PLEX_XPOS[plexShowSprite::$11]
[99] if(plexShowSprite::$3!=0) goto plexShowSprite::@1
[94] PLEX_SCREEN_PTR[plex_sprite_idx] = PLEX_PTR[PLEX_SORTED_IDX[plex_show_idx]]
[95] plexShowSprite::xpos_idx#0 = PLEX_SORTED_IDX[plex_show_idx]
[96] plexShowSprite::$11 = plexShowSprite::xpos_idx#0 << 1
[97] plexShowSprite::$2 = < PLEX_XPOS[plexShowSprite::$11]
[98] SPRITES_XPOS[plexShowSprite::plex_sprite_idx2#0] = plexShowSprite::$2
[99] plexShowSprite::$3 = > PLEX_XPOS[plexShowSprite::$11]
[100] if(plexShowSprite::$3!=0) goto plexShowSprite::@1
to:plexShowSprite::@3
plexShowSprite::@3: scope:[plexShowSprite] from plexShowSprite::@5
[100] plexShowSprite::$9 = $ff ^ plex_sprite_msb
[101] *SPRITES_XMSB = *SPRITES_XMSB & plexShowSprite::$9
[101] plexShowSprite::$9 = $ff ^ plex_sprite_msb
[102] *SPRITES_XMSB = *SPRITES_XMSB & plexShowSprite::$9
to:plexShowSprite::@2
plexShowSprite::@2: scope:[plexShowSprite] from plexShowSprite::@1 plexShowSprite::@3
[102] plexShowSprite::$5 = plex_sprite_idx + 1
[103] plexShowSprite::$6 = plexShowSprite::$5 & 7
[104] plex_sprite_idx = plexShowSprite::$6
[105] plex_show_idx = ++ plex_show_idx
[106] plex_sprite_msb = plex_sprite_msb << 1
[107] if(plex_sprite_msb!=0) goto plexShowSprite::@return
[103] plexShowSprite::$5 = plex_sprite_idx + 1
[104] plexShowSprite::$6 = plexShowSprite::$5 & 7
[105] plex_sprite_idx = plexShowSprite::$6
[106] plex_show_idx = ++ plex_show_idx
[107] plex_sprite_msb = plex_sprite_msb << 1
[108] if(plex_sprite_msb!=0) goto plexShowSprite::@return
to:plexShowSprite::@4
plexShowSprite::@4: scope:[plexShowSprite] from plexShowSprite::@2
[108] plex_sprite_msb = 1
[109] plex_sprite_msb = 1
to:plexShowSprite::@return
plexShowSprite::@return: scope:[plexShowSprite] from plexShowSprite::@2 plexShowSprite::@4
[109] return
[110] return
to:@return
plexShowSprite::@1: scope:[plexShowSprite] from plexShowSprite::@5
[110] *SPRITES_XMSB = *SPRITES_XMSB | plex_sprite_msb
[111] *SPRITES_XMSB = *SPRITES_XMSB | plex_sprite_msb
to:plexShowSprite::@2

File diff suppressed because it is too large Load Diff

View File

@ -7,8 +7,7 @@ const byte OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = $15
const nomodify byte PLEX_COUNT = $20
const byte* PLEX_FREE_YPOS[8] = { fill( 8, 0) }
const byte* PLEX_PTR[PLEX_COUNT] = { fill( PLEX_COUNT, 0) }
byte* PLEX_SCREEN_PTR
const byte* PLEX_SCREEN_PTR#0 PLEX_SCREEN_PTR = SCREEN+$3f8
volatile byte* PLEX_SCREEN_PTR loadstore zp[2]:6 1383.6164383561643
const byte* PLEX_SORTED_IDX[PLEX_COUNT] = { fill( PLEX_COUNT, 0) }
const word* PLEX_XPOS[PLEX_COUNT] = { fill( PLEX_COUNT, 0) }
const byte* PLEX_YPOS[PLEX_COUNT] = { fill( PLEX_COUNT, 0) }
@ -47,7 +46,7 @@ word init::xp#2 xp zp[2]:2 750.75
void loop()
byte~ loop::$5 reg byte a 20002.0
byte loop::plexFreeNextYpos1_return
byte loop::plexFreeNextYpos1_return#0 plexFreeNextYpos1_return zp[1]:10 55001.0
byte loop::plexFreeNextYpos1_return#0 plexFreeNextYpos1_return zp[1]:12 55001.0
byte loop::rasterY
byte loop::sin_idx
byte loop::sin_idx#1 sin_idx zp[1]:4 133.46666666666667
@ -82,18 +81,18 @@ byte~ plexShowSprite::plexFreeAdd1_$2 reg byte a 200002.0
byte plexShowSprite::plexFreeAdd1_ypos
byte plexShowSprite::plexFreeAdd1_ypos#0 reg byte a 150001.5
byte plexShowSprite::plex_sprite_idx2
byte plexShowSprite::plex_sprite_idx2#0 plex_sprite_idx2 zp[1]:12 25000.25
byte plexShowSprite::plex_sprite_idx2#0 plex_sprite_idx2 zp[1]:14 25000.25
byte plexShowSprite::xpos_idx
byte plexShowSprite::xpos_idx#0 reg byte a 200002.0
byte plexShowSprite::ypos
void plexSort()
byte plexSort::m
byte plexSort::m#1 m zp[1]:10 1500001.5
byte plexSort::m#2 m zp[1]:10 416667.0833333334
byte plexSort::m#1 m zp[1]:12 1500001.5
byte plexSort::m#2 m zp[1]:12 416667.0833333334
byte plexSort::nxt_idx
byte plexSort::nxt_idx#0 nxt_idx zp[1]:12 300000.30000000005
byte plexSort::nxt_idx#0 nxt_idx zp[1]:14 300000.30000000005
byte plexSort::nxt_y
byte plexSort::nxt_y#0 nxt_y zp[1]:11 1500000.375
byte plexSort::nxt_y#0 nxt_y zp[1]:13 1500000.375
byte plexSort::plexFreePrepare1_s
byte plexSort::plexFreePrepare1_s#1 reg byte x 1500001.5
byte plexSort::plexFreePrepare1_s#2 reg byte x 1500001.5
@ -102,10 +101,10 @@ byte plexSort::s#1 reg byte x 1.3666668333333332E7
byte plexSort::s#2 reg byte x 2000002.0
byte plexSort::s#3 reg byte x 2.05000025E7
byte plexSort::s#6 reg byte x 2000002.0
volatile byte plex_free_next loadstore zp[1]:9 8421.236842105263
volatile byte plex_show_idx loadstore zp[1]:6 10625.166666666664
volatile byte plex_sprite_idx loadstore zp[1]:7 9111.266666666666
volatile byte plex_sprite_msb loadstore zp[1]:8 13261.065217391306
volatile byte plex_free_next loadstore zp[1]:11 8421.236842105263
volatile byte plex_show_idx loadstore zp[1]:8 10625.166666666664
volatile byte plex_sprite_idx loadstore zp[1]:9 9111.266666666666
volatile byte plex_sprite_msb loadstore zp[1]:10 13261.065217391306
reg byte x [ init::sx#2 init::sx#1 ]
zp[2]:2 [ init::xp#2 init::xp#1 ]
@ -117,16 +116,17 @@ zp[1]:5 [ loop::ss#5 loop::ss#1 ]
reg byte x [ plexInit::i#2 plexInit::i#1 ]
reg byte x [ plexSort::s#3 plexSort::s#1 plexSort::s#6 ]
reg byte x [ plexSort::plexFreePrepare1_s#2 plexSort::plexFreePrepare1_s#1 ]
zp[1]:6 [ plex_show_idx ]
zp[1]:7 [ plex_sprite_idx ]
zp[1]:8 [ plex_sprite_msb ]
zp[1]:9 [ plex_free_next ]
zp[2]:6 [ PLEX_SCREEN_PTR ]
zp[1]:8 [ plex_show_idx ]
zp[1]:9 [ plex_sprite_idx ]
zp[1]:10 [ plex_sprite_msb ]
zp[1]:11 [ plex_free_next ]
reg byte a [ init::$3 ]
reg byte a [ loop::$5 ]
zp[1]:10 [ loop::plexFreeNextYpos1_return#0 plexSort::m#2 plexSort::m#1 ]
zp[1]:11 [ plexSort::nxt_y#0 ]
zp[1]:12 [ loop::plexFreeNextYpos1_return#0 plexSort::m#2 plexSort::m#1 ]
zp[1]:13 [ plexSort::nxt_y#0 ]
reg byte x [ plexSort::s#2 ]
zp[1]:12 [ plexShowSprite::plex_sprite_idx2#0 plexSort::nxt_idx#0 ]
zp[1]:14 [ plexShowSprite::plex_sprite_idx2#0 plexSort::nxt_idx#0 ]
reg byte a [ plexShowSprite::plexFreeAdd1_ypos#0 ]
reg byte a [ plexShowSprite::plexFreeAdd1_$0 ]
reg byte x [ plexShowSprite::plexFreeAdd1_$1 ]

View File

@ -34,6 +34,10 @@
.label CIA1 = $dc00
// The vector used when the KERNAL serves IRQ interrupts
.label KERNEL_IRQ = $314
// Location of screen & sprites
.label SCREEN = $400
// The address of the sprite pointers on the current screen (screen+0x3f8).
.label PLEX_SCREEN_PTR = 6
// The index in the PLEX tables of the next sprite to show
.label plex_show_idx = 8
// The index the next sprite to use for showing (sprites are used round-robin)
@ -43,9 +47,12 @@
// The index of the sprite that is free next. Since sprites are used round-robin this moves forward each time a sprite is shown.
.label plex_free_next = $b
.label framedone = $c
// The address of the sprite pointers on the current screen (screen+0x3f8).
.label PLEX_SCREEN_PTR = 2
__start: {
// PLEX_SCREEN_PTR = 0x400+0x3f8
lda #<$400+$3f8
sta.z PLEX_SCREEN_PTR
lda #>$400+$3f8
sta.z PLEX_SCREEN_PTR+1
// plex_show_idx=0
lda #0
sta.z plex_show_idx
@ -213,7 +220,7 @@ plexShowSprite: {
// Initialize the program
init: {
// Set the x-positions & pointers
.label xp = 4
.label xp = 2
// *D011 = VIC_DEN | VIC_RSEL | 3
lda #VIC_DEN|VIC_RSEL|3
sta D011
@ -293,7 +300,7 @@ init: {
// The raster loop
loop: {
// The current index into the y-sinus
.label sin_idx = 6
.label sin_idx = 4
lda #0
sta.z sin_idx
__b2:
@ -335,6 +342,11 @@ loop: {
}
// Initialize the multiplexer data structures
plexInit: {
// PLEX_SCREEN_PTR = screen+0x3f8
lda #<SCREEN+$3f8
sta.z PLEX_SCREEN_PTR
lda #>SCREEN+$3f8
sta.z PLEX_SCREEN_PTR+1
ldx #0
__b1:
// PLEX_SORTED_IDX[i] = i
@ -359,7 +371,7 @@ plexInit: {
plexSort: {
.label nxt_idx = $f
.label nxt_y = $10
.label m = 7
.label m = 5
lda #0
sta.z m
__b1:

View File

@ -4,23 +4,23 @@ __start: scope:[__start] from
[0] phi()
to:__start::__init1
__start::__init1: scope:[__start] from __start
[1] plex_show_idx = 0
[2] plex_sprite_idx = 0
[3] plex_sprite_msb = 1
[4] plex_free_next = 0
[5] framedone = true
[1] PLEX_SCREEN_PTR = (byte*)$400+$3f8
[2] plex_show_idx = 0
[3] plex_sprite_idx = 0
[4] plex_sprite_msb = 1
[5] plex_free_next = 0
[6] framedone = true
to:__start::@1
__start::@1: scope:[__start] from __start::__init1
[6] phi()
[7] call main
[7] phi()
[8] call main
to:__start::@return
__start::@return: scope:[__start] from __start::@1
[8] return
[9] return
to:@return
interrupt(KERNEL_MIN) void plex_irq()
plex_irq: scope:[plex_irq] from
[9] PLEX_SCREEN_PTR#30 = phi( )
asm { sei }
[11] *BORDER_COLOR = WHITE
to:plex_irq::@3
@ -84,7 +84,7 @@ plexShowSprite::plexFreeAdd1: scope:[plexShowSprite] from plexShowSprite
[38] plex_free_next = plexShowSprite::plexFreeAdd1_$2
to:plexShowSprite::@5
plexShowSprite::@5: scope:[plexShowSprite] from plexShowSprite::plexFreeAdd1
[39] PLEX_SCREEN_PTR#30[plex_sprite_idx] = PLEX_PTR[PLEX_SORTED_IDX[plex_show_idx]]
[39] PLEX_SCREEN_PTR[plex_sprite_idx] = PLEX_PTR[PLEX_SORTED_IDX[plex_show_idx]]
[40] plexShowSprite::xpos_idx#0 = PLEX_SORTED_IDX[plex_show_idx]
[41] plexShowSprite::$11 = plexShowSprite::xpos_idx#0 << 1
[42] plexShowSprite::$2 = < PLEX_XPOS[plexShowSprite::$11]
@ -189,7 +189,7 @@ plexInit: scope:[plexInit] from init
[95] phi()
to:plexInit::plexSetScreen1
plexInit::plexSetScreen1: scope:[plexInit] from plexInit
[96] phi()
[96] PLEX_SCREEN_PTR = SCREEN+$3f8
to:plexInit::@1
plexInit::@1: scope:[plexInit] from plexInit::@1 plexInit::plexSetScreen1
[97] plexInit::i#2 = phi( plexInit::@1/plexInit::i#1, plexInit::plexSetScreen1/0 )

File diff suppressed because it is too large Load Diff

View File

@ -11,13 +11,13 @@ const byte OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d
const nomodify byte PLEX_COUNT = $20
const byte* PLEX_FREE_YPOS[8] = { fill( 8, 0) }
const byte* PLEX_PTR[PLEX_COUNT] = { fill( PLEX_COUNT, 0) }
byte* PLEX_SCREEN_PTR
byte* PLEX_SCREEN_PTR#30 PLEX_SCREEN_PTR zp[2]:2 2.8857142857142857
volatile byte* PLEX_SCREEN_PTR loadstore zp[2]:6 32.470588235294116
const byte* PLEX_SORTED_IDX[PLEX_COUNT] = { fill( PLEX_COUNT, 0) }
const word* PLEX_XPOS[PLEX_COUNT] = { fill( PLEX_COUNT, 0) }
const byte* PLEX_YPOS[PLEX_COUNT] = { fill( PLEX_COUNT, 0) }
const nomodify byte* RASTER = (byte*) 53266
const nomodify byte RED = 2
const byte* SCREEN = (byte*) 1024
const byte* SPRITE[$40] = kickasm {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff))
.for (var y=0; y<21; y++)
.for (var x=0;x<3; x++)
@ -45,12 +45,12 @@ byte init::sx
byte init::sx#1 reg byte x 1501.5
byte init::sx#2 reg byte x 800.8
word init::xp
word init::xp#1 xp zp[2]:4 667.3333333333334
word init::xp#2 xp zp[2]:4 750.75
word init::xp#1 xp zp[2]:2 667.3333333333334
word init::xp#2 xp zp[2]:2 750.75
void loop()
byte loop::sin_idx
byte loop::sin_idx#1 sin_idx zp[1]:6 400.4
byte loop::sin_idx#6 sin_idx zp[1]:6 333.6666666666667
byte loop::sin_idx#1 sin_idx zp[1]:4 400.4
byte loop::sin_idx#6 sin_idx zp[1]:4 333.6666666666667
byte loop::sy
byte loop::sy#1 reg byte y 15001.5
byte loop::sy#2 reg byte y 10001.0
@ -84,8 +84,8 @@ byte plexShowSprite::xpos_idx#0 reg byte a 202.0
byte plexShowSprite::ypos
void plexSort()
byte plexSort::m
byte plexSort::m#1 m zp[1]:7 1500001.5
byte plexSort::m#2 m zp[1]:7 416667.0833333334
byte plexSort::m#1 m zp[1]:5 1500001.5
byte plexSort::m#2 m zp[1]:5 416667.0833333334
byte plexSort::nxt_idx
byte plexSort::nxt_idx#0 nxt_idx zp[1]:15 300000.30000000005
byte plexSort::nxt_y
@ -98,27 +98,27 @@ byte plexSort::s#1 reg byte x 1.3666668333333332E7
byte plexSort::s#2 reg byte x 2000002.0
byte plexSort::s#3 reg byte x 2.05000025E7
byte plexSort::s#6 reg byte x 2000002.0
volatile byte plex_free_next loadstore zp[1]:11 312.6363636363636
volatile byte plex_free_next loadstore zp[1]:11 322.40625
interrupt(KERNEL_MIN) void plex_irq()
byte~ plex_irq::$4 zp[1]:13 11.0
byte plex_irq::plexFreeNextYpos1_return
byte plex_irq::plexFreeNextYpos1_return#0 reg byte x 4.0
byte plex_irq::rasterY
volatile byte plex_show_idx loadstore zp[1]:8 292.25
volatile byte plex_sprite_idx loadstore zp[1]:9 315.3636363636364
volatile byte plex_sprite_msb loadstore zp[1]:10 303.1142857142857
volatile byte plex_show_idx loadstore zp[1]:8 300.59999999999997
volatile byte plex_sprite_idx loadstore zp[1]:9 325.21875
volatile byte plex_sprite_msb loadstore zp[1]:10 312.02941176470586
zp[2]:2 [ PLEX_SCREEN_PTR#30 ]
reg byte x [ init::sx#2 init::sx#1 ]
zp[2]:4 [ init::xp#2 init::xp#1 ]
zp[2]:2 [ init::xp#2 init::xp#1 ]
reg byte x [ init::ss#2 init::ss#1 ]
zp[1]:6 [ loop::sin_idx#6 loop::sin_idx#1 ]
zp[1]:4 [ loop::sin_idx#6 loop::sin_idx#1 ]
reg byte x [ loop::y_idx#2 loop::y_idx#3 loop::y_idx#1 ]
reg byte y [ loop::sy#2 loop::sy#1 ]
reg byte x [ plexInit::i#2 plexInit::i#1 ]
zp[1]:7 [ plexSort::m#2 plexSort::m#1 ]
zp[1]:5 [ plexSort::m#2 plexSort::m#1 ]
reg byte x [ plexSort::s#3 plexSort::s#1 plexSort::s#6 ]
reg byte x [ plexSort::plexFreePrepare1_s#2 plexSort::plexFreePrepare1_s#1 ]
zp[2]:6 [ PLEX_SCREEN_PTR ]
zp[1]:8 [ plex_show_idx ]
zp[1]:9 [ plex_sprite_idx ]
zp[1]:10 [ plex_sprite_msb ]