diff --git a/platform/platform.cwa b/platform/platform.cwa index 0614eaa..c00828f 100644 --- a/platform/platform.cwa +++ b/platform/platform.cwa @@ -34,18 +34,18 @@ export fn cls(col: i32) { col = (col & 255) * 0x1010101; loop pixels { i!120 = col; - branch_if (i := i + 4) < 320*256: pixels; + branch_if (i := i + 4) < 320*240: pixels; } } export fn setPixel(x: i32, y: i32, col: i32) { - if x #< 320 & y #< 256 { + if x #< 320 & y #< 240 { (x + y * 320)?120 = col } } export fn getPixel(x: i32, y: i32) -> i32 { - if x #< 320 & y #< 256 { + if x #< 320 & y #< 240 { (x + y * 320)?120 } else { 0 @@ -59,7 +59,7 @@ fn clamp(v: i32, min: i32, max: i32) -> i32 { export fn hline(x1: i32, x2: i32, y: i32, col: i32) { x1 = clamp(x1, 0, 320); x2 = clamp(x2, 0, 320); - if x1 < x2 & y #< 256 { + if x1 < x2 & y #< 240 { let ptr = y * 320 + x1; let end = ptr + x2 - x1; loop pixels { @@ -72,13 +72,13 @@ export fn hline(x1: i32, x2: i32, y: i32, col: i32) { export fn rectangle(x: f32, y: f32, w: f32, h: f32, col: i32) { if abs(w) == w & abs(h) == h { let x1 = nearest(x) as i32; - let y1 = clamp(nearest(y) as i32, 0, 256); + let y1 = clamp(nearest(y) as i32, 0, 240); let x2 = nearest(x + w) as i32; - let y2 = clamp(nearest(y + h) as i32, 0, 256); + let y2 = clamp(nearest(y + h) as i32, 0, 240); block done { loop lines { branch_if y1 >= y2: done; - hline(x1, y1, x2, col); + hline(x1, x2, y1, col); y1 = y1 + 1; branch lines; } @@ -87,8 +87,8 @@ export fn rectangle(x: f32, y: f32, w: f32, h: f32, col: i32) { } export fn circle(cx: f32, cy: f32, radius: f32, col: i32) { - let y = clamp(nearest(cy - radius) as i32, 0, 256); - let maxY = clamp(nearest(cy + radius) as i32, 0, 256); + let y = clamp(nearest(cy - radius) as i32, 0, 240); + let maxY = clamp(nearest(cy + radius) as i32, 0, 240); block done { loop lines { @@ -110,7 +110,7 @@ export fn circle(cx: f32, cy: f32, radius: f32, col: i32) { start fn setup() { let i: i32; loop colors { - (i*4)!(120+320*256) = i * 0x10101; + (i*4)!(120+320*240) = i * 0x10101; branch_if (i := i + 1) < 256: colors } randomSeed(random()); diff --git a/site/content/_index.md b/site/content/_index.md index 5a6a696..f509610 100644 --- a/site/content/_index.md +++ b/site/content/_index.md @@ -83,6 +83,6 @@ possible but no examples are provided, yet. ## Examples -* [Technotunnel](v0.1pre2#AQrDAQHAAQIBfwp9A0AgAUEAsiABQcACb7JDmhkgQ5MiBCAEIASUIAFBwAJtQYABa7IiBSAFlJKRIgaVIgcgByAAskHQD7KVIgIQAEPNzEw/lCIDlCAHIAeUIAOUIAOUQQGykiADIAOUk5GSIgiUIAOTQQqylCACkiIJqCAFIAaVIAiUQQqylCACkiIKqHMgCEEyspQgBpUiCyACkkEUspSocUEFcbJBArIgC5OUQRaylJeoOgB4IAFBAWoiAUGAgAVIDQALCw==) (199 bytes): A port of my [entry](https://tic80.com/play?cart=1873) in the Outline'21 bytebattle quater final -* [XorScroll](v0.1pre2#AQovAS0BAX8DQCABIAFBwAJvIABBCm1qIAFBwAJtczoAeCABQQFqIgFBgIAFSA0ACws=) (50 bytes): A simple scrolling XOR pattern. Fun fact: This is the pre-loaded effect when entering a bytebattle. -* [CircleWorm](v0.1pre2#AQp7AXkCAX8CfUEgEA0DQCABskEEspUiAkECspUgALJBiCeylSIDQQWylJIQAEEBspJBoAGylCACQQOylSADQQSylJIQAEEBspJBgAGylCADQRGylCACQQKylJIQAEECspJBELKUIAFBAmxBP2oQEiABQQFqIgFBP0gNAAsL) (126 bytes): Just a test for the circle fill function. \ No newline at end of file +* [Technotunnel](v0.1pre2#AQrDAQHAAQIBfwp9A0AgAUEAsiABQcACb7JDmhkgQ5MiBCAEIASUIAFBwAJtQfgAa7IiBSAFlJKRIgaVIgcgByAAskHQD7KVIgIQAEPNzEw/lCIDlCAHIAeUIAOUIAOUQQGykiADIAOUk5GSIgiUIAOTQQqylCACkiIJqCAFIAaVIAiUQQqylCACkiIKqHMgCEEyspQgBpUiCyACkkEUspSocUEFcbJBArIgC5OUQRaylJeoOgB4IAFBAWoiAUGA2ARIDQALCw==) (199 bytes): A port of my [entry](https://tic80.com/play?cart=1873) in the Outline'21 bytebattle quater final +* [XorScroll](v0.1pre2#AQovAS0BAX8DQCABIAFBwAJvIABBCm1qIAFBwAJtczoAeCABQQFqIgFBgNgESA0ACws=) (50 bytes): A simple scrolling XOR pattern. Fun fact: This is the pre-loaded effect when entering a bytebattle. +* [CircleWorm](v0.1pre2#AQp7AXkCAX8CfUEgEA0DQCABskEEspUiAkECspUgALJBiCeylSIDQQWylJIQAEEBspJBoAGylCACQQOylSADQQSylJIQAEEBspJB+ACylCADQRGylCACQQKylJIQAEECspJBELKUIAFBAmxBP2oQEiABQQFqIgFBP0gNAAsL) (126 bytes): Just a test for the circle fill function. \ No newline at end of file diff --git a/site/static/v0.1pre2/index.html b/site/static/v0.1pre2/index.html index 5f8faf5..75f5447 100644 --- a/site/static/v0.1pre2/index.html +++ b/site/static/v0.1pre2/index.html @@ -1 +1 @@ -