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

Fixed tests to take adcantadge of casting & int constant type elasticity.

This commit is contained in:
jespergravgaard 2017-12-02 17:17:19 +01:00
parent 9c39311d67
commit 0323fb0a0d
8 changed files with 1359 additions and 603 deletions

View File

@ -32,7 +32,7 @@ void main() {
*BGCOL = 0;
*FGCOL = 0;
*D011 = BMM|DEN|RSEL|3;
*D018 = $18; // Needs casting for *D018 = ((word)SCREEN/$40)|((word)BITMAP/$400);
*D018 = (byte)(((word)SCREEN/$40)|((word)BITMAP/$400));
init_screen();
init_plot_tables();
do {

View File

@ -22,7 +22,7 @@ void main() {
*BGCOL = 0;
*FGCOL = 0;
*D011 = BMM|DEN|RSEL|3;
*D018 = $18; // Needs casting for *D018 = ((word)SCREEN/$40)|((word)BITMAP/$400);
*D018 = (byte)(((word)SCREEN/$40)|((word)BITMAP/$400));
init_screen();
init_plot_tables();
do {
@ -76,7 +76,7 @@ void init_plot_tables() {
plot_ylo[y] = y&$7 | <yoffs;
plot_yhi[y] = >yoffs;
if((y&$7)==7) {
yoffs = yoffs + 320; // Needs better constant type inference for yoffs = yoffs + 40*8;
yoffs = yoffs + 40*8; // Needs better constant type inference for yoffs = yoffs + 40*8;
}
}
}

View File

@ -25,7 +25,7 @@ main: {
sta FGCOL
lda #BMM|DEN|RSEL|3
sta D011
lda #$18
lda #$ff & ($ffff & SCREEN/$40|$ffff & BITMAP/$400)
sta D018
jsr init_screen
jsr init_plot_tables

View File

@ -11,7 +11,7 @@ main: scope:[main] from @10
[4] *((const byte*) BGCOL#0) ← (byte/signed byte/word/signed word) 0 [ ] ( main:2 [ ] )
[5] *((const byte*) FGCOL#0) ← (byte/signed byte/word/signed word) 0 [ ] ( main:2 [ ] )
[6] *((const byte*) D011#0) ← (const byte) BMM#0|(const byte) DEN#0|(const byte) RSEL#0|(byte/signed byte/word/signed word) 3 [ ] ( main:2 [ ] )
[7] *((const byte*) D018#0) ← (byte/signed byte/word/signed word) 24 [ ] ( main:2 [ ] )
[7] *((const byte*) D018#0) ← ((byte))((word))(const byte*) SCREEN#0/(byte/signed byte/word/signed word) 64|((word))(const byte*) BITMAP#0/(word/signed word) 1024 [ ] ( main:2 [ ] )
[8] call init_screen param-assignment [ ] ( main:2 [ ] )
to:main::@3
main::@3: scope:[main] from main

View File

@ -26,7 +26,7 @@ main: {
sta FGCOL
lda #BMM|DEN|RSEL|3
sta D011
lda #$18
lda #$ff & ($ffff & SCREEN/$40|$ffff & BITMAP/$400)
sta D018
jsr init_screen
jsr init_plot_tables
@ -128,10 +128,10 @@ init_plot_tables: {
bne b4
lda yoffs
clc
adc #<$140
adc #<$28*8
sta yoffs
lda yoffs+1
adc #>$140
adc #>$28*8
sta yoffs+1
b4:
inx

View File

@ -11,7 +11,7 @@ main: scope:[main] from @5
[4] *((const byte*) BGCOL#0) ← (byte/signed byte/word/signed word) 0 [ ] ( main:2 [ ] )
[5] *((const byte*) FGCOL#0) ← (byte/signed byte/word/signed word) 0 [ ] ( main:2 [ ] )
[6] *((const byte*) D011#0) ← (const byte) BMM#0|(const byte) DEN#0|(const byte) RSEL#0|(byte/signed byte/word/signed word) 3 [ ] ( main:2 [ ] )
[7] *((const byte*) D018#0) ← (byte/signed byte/word/signed word) 24 [ ] ( main:2 [ ] )
[7] *((const byte*) D018#0) ← ((byte))((word))(const byte*) SCREEN#0/(byte/signed byte/word/signed word) 64|((word))(const byte*) BITMAP#0/(word/signed word) 1024 [ ] ( main:2 [ ] )
[8] call init_screen param-assignment [ ] ( main:2 [ ] )
to:main::@5
main::@5: scope:[main] from main
@ -98,7 +98,7 @@ init_plot_tables::@3: scope:[init_plot_tables] from init_plot_tables::@2 init_p
[59] if((byte~) init_plot_tables::$10!=(byte/signed byte/word/signed word) 7) goto init_plot_tables::@4 [ init_plot_tables::y#2 init_plot_tables::yoffs#2 ] ( main:2::init_plot_tables:10 [ init_plot_tables::y#2 init_plot_tables::yoffs#2 ] )
to:init_plot_tables::@7
init_plot_tables::@7: scope:[init_plot_tables] from init_plot_tables::@3
[60] (byte*) init_plot_tables::yoffs#1 ← (byte*) init_plot_tables::yoffs#2 + (word/signed word) 320 [ init_plot_tables::y#2 init_plot_tables::yoffs#1 ] ( main:2::init_plot_tables:10 [ init_plot_tables::y#2 init_plot_tables::yoffs#1 ] )
[60] (byte*) init_plot_tables::yoffs#1 ← (byte*) init_plot_tables::yoffs#2 + (byte/signed byte/word/signed word) 40*(byte/signed byte/word/signed word) 8 [ init_plot_tables::y#2 init_plot_tables::yoffs#1 ] ( main:2::init_plot_tables:10 [ init_plot_tables::y#2 init_plot_tables::yoffs#1 ] )
to:init_plot_tables::@4
init_plot_tables::@4: scope:[init_plot_tables] from init_plot_tables::@3 init_plot_tables::@7
[61] (byte*) init_plot_tables::yoffs#4 ← phi( init_plot_tables::@3/(byte*) init_plot_tables::yoffs#2 init_plot_tables::@7/(byte*) init_plot_tables::yoffs#1 ) [ init_plot_tables::y#2 init_plot_tables::yoffs#4 ] ( main:2::init_plot_tables:10 [ init_plot_tables::y#2 init_plot_tables::yoffs#4 ] )

File diff suppressed because it is too large Load Diff