Release Cannonball - The Enhanced C++ Outrun Engine


@Linux-SWAT - thanks :)

so I did create the right folder, but I've probably got a different rom set - at least I know now - I probably have all of the above files but they are named slightly differently (no extension).  I'll rename them to the above and try again
 
But... but... where's the blonde chick ? and the Ferrari...
The best things happen, sadly, only on videogames..
Like chicks that stand up and go on after you crashed the cool car in full speed against some tree or rock?

OnTopic: I always sucked at this game (had the C64 version of it back then), but it's fun anyway.
 
Last edited by a moderator:
OnTopic: I always sucked at this game (had the C64 version of it back then), but it's fun anyway.
I suck too... I finish without problems all the tracks in the MegaDrive version, but in this I still have to win even one race...
 
I'll try the MegaDrive version then. :D

The Pandora version looks and feels great though in widescreen and with analog control.
 
Last edited by a moderator:
Hello, ptitSeb et all!

I'm desperately trying to optimize Cannonball for the Raspberry Pi, in order to get fullspeed at 60FPS mode like you archieved on the Pandora. I believe it should be possible.

Like you, I also disabled internal engine scaling and I'm doing hardware scaling via my own dispmanx (native API) backend for SDL (wich is available here: https://github.com/vanfanel/SDL12-kms-dispmanx).

I've came to the conclussión (Chris White, the original CannonBall author, seems to agree) that it's the sprite scaling part what's taking most of the CPU time after disabling different things in the code and measuring CPU usage. 

So, it seems you did some additional optimizations to the sprite scaling functions: what optimizations are these? What files did you specifically change? Could I have your latest sources, please?

Thanks
 
Hello, ptitSeb et all!

I'm desperately trying to optimize Cannonball for the Raspberry Pi, in order to get fullspeed at 60FPS mode like you archieved on the Pandora. I believe it should be possible.

Like you, I also disabled internal engine scaling and I'm doing hardware scaling via my own dispmanx (native API) backend for SDL (wich is available here: https://github.com/vanfanel/SDL12-kms-dispmanx).

I've came to the conclussión (Chris White, the original CannonBall author, seems to agree) that it's the sprite scaling part what's taking most of the CPU time after disabling different things in the code and measuring CPU usage. 

So, it seems you did some additional optimizations to the sprite scaling functions: what optimizations are these? What files did you specifically change? Could I have your latest sources, please?

Thanks
Hi,

Yes Sprite scaling is the time cosuming part. I did a few optimizations (on the road too), and I didn't use (yet?) any neon or dsp code, so it should be portable do R-PI. Here is the diff of the parts that should interest you, but I don't know if that will be effective for you. Also, I used GCC 4.7.3 (and that 4.8.1) with "-Ofast" to let the compiler do most of the optimizing job.

Code:
diff --git a/src/main/hwvideo/hwroad.cpp b/src/main/hwvideo/hwroad.cpp
old mode 100644
new mode 100755
index 8b34ec4..3e2d475
--- a/src/main/hwvideo/hwroad.cpp
+++ b/src/main/hwvideo/hwroad.cpp
@@ -189,6 +189,7 @@ void HWRoad::decode_road(const uint8_t* src_road)
 }
 
 // Writes go to RAM, but we read from the RAM Buffer.
+/* defined Inline...
 void HWRoad::write16(uint32_t adr, const uint16_t data)
 {
     ram[(adr >> 1) & 0x7FF] = data;
@@ -208,6 +209,7 @@ void HWRoad::write32(uint32_t* adr, const uint32_t data)
     ram[((a >> 1) + 1) & 0x7FF] = data & 0xFFFF;
     *adr += 4;
 }
+*/
 
 uint16_t HWRoad::read_road_control()
 {
@@ -225,10 +227,12 @@ uint16_t HWRoad::read_road_control()
     return 0xffff;
 }
 
+/* Inlined... see .hpp
 void HWRoad::write_road_control(const uint8_t road_control)
 {
     this->road_control = road_control;
 }
+*/
 
 // ------------------------------------------------------------------------------------------------
 // Road Rendering: Lores Version
@@ -283,6 +287,7 @@ void HWRoad::render_background_lores(uint32_t* pixels)
             
             for (x = 0; x < config.s16_width; x++)
                 *(pPixel)++ = color;
+     
         }
     }
 }
@@ -355,8 +360,9 @@ void HWRoad::render_foreground_lores(uint32_t* pixels)
                 hpos0 = (hpos0 - (s16_x + x_offset)) & 0xfff;
                 for (x = 0; x < config.s16_width; x++) 
                 {
-                    int pix0 = (hpos0 < 0x200) ? src0[hpos0] : 3;
-                    pPixel[x] = color_table[0x00 + pix0];
+                    /*int pix0 = (hpos0 < 0x200) ? src0[hpos0] : 3;
+                    *(pPixel++) = color_table[0x00 + pix0];*/
+     *(pPixel++) = color_table[0x00 + (hpos0 < 0x200) ? src0[hpos0] : 3];
                     hpos0 = (hpos0 + 1) & 0xfff;
                 }
                 break;
@@ -369,9 +375,9 @@ void HWRoad::render_foreground_lores(uint32_t* pixels)
                     int pix0 = (hpos0 < 0x200) ? src0[hpos0] : 3;
                     int pix1 = (hpos1 < 0x200) ? src1[hpos1] : 3;
                     if (((priority_map[0][pix0] >> pix1) & 1) != 0)
-                        pPixel[x] = color_table[0x10 + pix1];
+                        *(pPixel++) = color_table[0x10 + pix1];
                     else
-                        pPixel[x] = color_table[0x00 + pix0];
+                        *(pPixel++) = color_table[0x00 + pix0];
 
                     hpos0 = (hpos0 + 1) & 0xfff;
                     hpos1 = (hpos1 + 1) & 0xfff;
@@ -386,9 +392,9 @@ void HWRoad::render_foreground_lores(uint32_t* pixels)
                     int pix0 = (hpos0 < 0x200) ? src0[hpos0] : 3;
                     int pix1 = (hpos1 < 0x200) ? src1[hpos1] : 3;
                     if (((priority_map[1][pix0] >> pix1) & 1) != 0)
-                        pPixel[x] = color_table[0x10 + pix1];
+                        *(pPixel++) = color_table[0x10 + pix1];
                     else
-                        pPixel[x] = color_table[0x00 + pix0];
+                        *(pPixel++) = color_table[0x00 + pix0];
 
                     hpos0 = (hpos0 + 1) & 0xfff;
                     hpos1 = (hpos1 + 1) & 0xfff;
@@ -401,8 +407,9 @@ void HWRoad::render_foreground_lores(uint32_t* pixels)
                 hpos1 = (hpos1 - (s16_x + x_offset)) & 0xfff;
                 for (x = 0; x < config.s16_width; x++) 
                 {
-                    int pix1 = (hpos1 < 0x200) ? src1[hpos1] : 3;
-                    pPixel[x] = color_table[0x10 + pix1];
+                    /*int pix1 = (hpos1 < 0x200) ? src1[hpos1] : 3;
+                    *(pPixel++) = color_table[0x10 + pix1];*/
+     *(pPixel++) = color_table[0x10 + (hpos1 < 0x200) ? src1[hpos1] : 3];
                     hpos1 = (hpos1 + 1) & 0xfff;
                 }
                 break;
@@ -571,7 +578,7 @@ void HWRoad::render_foreground_hires(uint32_t* pixels)
 
         // Shift road dependent on whether we are in widescreen mode or not
         uint16_t s16_x = 0x5f8 + config.s16_x_off;
-        uint32_t* const pPixel = pixels + (y * config.s16_width);
+        uint32_t* pPixel = pixels + (y * config.s16_width);
 
         // draw the road
         switch (road_control & 3)
@@ -580,11 +587,12 @@ void HWRoad::render_foreground_hires(uint32_t* pixels)
                 if (data0 & 0x800)
                     continue;
                 hpos0 = (hpos0 - (s16_x + x_offset)) & 0xfff;
-                for (x = 0; x < config.s16_width; x++) 
+                for (x = 0; x < config.s16_width; x+=2) 
                 {
                     int pix0 = (hpos0 < 0x200) ? src0[hpos0] : 3;
-                    pPixel[x] = color_table[0x00 + pix0];
-                    if (x & 1)
+                    *(pPixel++) = color_table[0x00 + pix0];
+                    *(pPixel++) = color_table[0x00 + pix0];
+//                    if (x & 1)
                         hpos0 = (hpos0 + 1) & 0xfff;
                 }
                 break;
@@ -592,40 +600,46 @@ void HWRoad::render_foreground_hires(uint32_t* pixels)
             case 1:
                 hpos0 = (hpos0 - (s16_x + x_offset)) & 0xfff;
                 hpos1 = (hpos1 - (s16_x + x_offset)) & 0xfff;
-                for (x = 0; x < config.s16_width; x++) 
+                for (x = 0; x < config.s16_width; x+=2) 
                 {
                     int pix0 = (hpos0 < 0x200) ? src0[hpos0] : 3;
                     int pix1 = (hpos1 < 0x200) ? src1[hpos1] : 3;
-                    if (((priority_map[0][pix0] >> pix1) & 1) != 0)
-                        pPixel[x] = color_table[0x10 + pix1];
-                    else
-                        pPixel[x] = color_table[0x00 + pix0];
-
-                    if (x & 1)
-                    {
+                    if (((priority_map[0][pix0] >> pix1) & 1) != 0) {
+                        *(pPixel++) = color_table[0x10 + pix1];
+                        *(pPixel++) = color_table[0x10 + pix1];
+                    } else {
+                        *(pPixel++) = color_table[0x10 + pix0];
+                        *(pPixel++) = color_table[0x10 + pix0];
+ }
+
+                    /*if (x & 1)
+                    {*/
                         hpos0 = (hpos0 + 1) & 0xfff;
                         hpos1 = (hpos1 + 1) & 0xfff;
-                    }
+                    /*}*/
                 }
                 break;
 
             case 2:
                 hpos0 = (hpos0 - (s16_x + x_offset)) & 0xfff;
                 hpos1 = (hpos1 - (s16_x + x_offset)) & 0xfff;
-                for (x = 0; x < config.s16_width; x++) 
+                for (x = 0; x < config.s16_width; x+=2) 
                 {
                     int pix0 = (hpos0 < 0x200) ? src0[hpos0] : 3;
                     int pix1 = (hpos1 < 0x200) ? src1[hpos1] : 3;
-                    if (((priority_map[1][pix0] >> pix1) & 1) != 0)
-                        pPixel[x] = color_table[0x10 + pix1];
-                    else
-                        pPixel[x] = color_table[0x00 + pix0];
+                    if (((priority_map[1][pix0] >> pix1) & 1) != 0) {
+                        *(pPixel++) = color_table[0x10 + pix1];
+                        *(pPixel++) = color_table[0x10 + pix1];
+                    } else {
+                        *(pPixel++) = color_table[0x00 + pix0];
+                        *(pPixel++) = color_table[0x00 + pix0];
+ }
                       
-                    if (x & 1)
-                    {
+                    /*if (x & 1)
+                    {*/
                         hpos0 = (hpos0 + 1) & 0xfff;
                         hpos1 = (hpos1 + 1) & 0xfff;
-                    }
+                    /*}*/
                 }
                 break;
 
@@ -633,11 +647,12 @@ void HWRoad::render_foreground_hires(uint32_t* pixels)
                 if (data1 & 0x800)
                     continue;
                 hpos1 = (hpos1 - (s16_x + x_offset)) & 0xfff;
-                for (x = 0; x < config.s16_width; x++) 
+                for (x = 0; x < config.s16_width; x+=2) 
                 {
                     int pix1 = (hpos1 < 0x200) ? src1[hpos1] : 3;
-                    pPixel[x] = color_table[0x10 + pix1];                   
-                    if (x & 1)
+                    *(pPixel++) = color_table[0x10 + pix1];                   
+                    *(pPixel++) = color_table[0x10 + pix1];                   
+                    /*if (x & 1)*/
                         hpos1 = (hpos1 + 1) & 0xfff;
                 }
                 break;
diff --git a/src/main/hwvideo/hwroad.hpp b/src/main/hwvideo/hwroad.hpp
old mode 100644
new mode 100755
index 115bee1..85e778d
--- a/src/main/hwvideo/hwroad.hpp
+++ b/src/main/hwvideo/hwroad.hpp
@@ -9,11 +9,23 @@ public:
     ~HWRoad();
 
     void init(const uint8_t*, const bool hires);
-    void write16(uint32_t adr, const uint16_t data);
-    void write16(uint32_t* adr, const uint16_t data);
-    void write32(uint32_t* adr, const uint32_t data);
+    inline void write16(uint32_t adr, const uint16_t data) 
+ {
+ ram[(adr >> 1) & 0x7FF] = data;
+ }
+    inline void write16(uint32_t* adr, const uint16_t data)
+ {
+ ram[((*adr) >> 1) & 0x7FF] = data; *adr+=2;
+ }
+    inline void write32(uint32_t* adr, const uint32_t data)
+ {
+ ram[((*adr) >> 1) & 0x7FF] = data >> 16; ram[(((*adr) >> 1) + 1) & 0x7FF] = data & 0xFFFF;*adr += 4;
+ }
     uint16_t read_road_control();
-    void write_road_control(const uint8_t);
+    inline void write_road_control(const uint8_t rc) 
+ {
+ this->road_control = rc;
+ }
     void (HWRoad::*render_background)(uint32_t*);
     void (HWRoad::*render_foreground)(uint32_t*);
   
diff --git a/src/main/hwvideo/hwsprites.cpp b/src/main/hwvideo/hwsprites.cpp
index 233ecd3..7879363 100644
--- a/src/main/hwvideo/hwsprites.cpp
+++ b/src/main/hwvideo/hwsprites.cpp
@@ -225,15 +225,25 @@ void hwsprites::render(const uint8_t priority)
                         uint32_t pixels = sprites[spritedata + ++ramBuff[data+7]]; // Add to base sprite data the vzoom value
 
                         // draw four pixels
-                        pix = (pixels >> 28) & 0xf; while (xacc < 0x200) { draw_pixel(x, pix, color, shadow, pPixel+x); x += xdelta; xacc += hzoom; } xacc -= 0x200;
-                        pix = (pixels >> 24) & 0xf; while (xacc < 0x200) { draw_pixel(x, pix, color, shadow, pPixel+x); x += xdelta; xacc += hzoom; } xacc -= 0x200;
-                        pix = (pixels >> 20) & 0xf; while (xacc < 0x200) { draw_pixel(x, pix, color, shadow, pPixel+x); x += xdelta; xacc += hzoom; } xacc -= 0x200;
-                        pix = (pixels >> 16) & 0xf; while (xacc < 0x200) { draw_pixel(x, pix, color, shadow, pPixel+x); x += xdelta; xacc += hzoom; } xacc -= 0x200;
-                        pix = (pixels >> 12) & 0xf; while (xacc < 0x200) { draw_pixel(x, pix, color, shadow, pPixel+x); x += xdelta; xacc += hzoom; } xacc -= 0x200;
-                        pix = (pixels >>  8) & 0xf; while (xacc < 0x200) { draw_pixel(x, pix, color, shadow, pPixel+x); x += xdelta; xacc += hzoom; } xacc -= 0x200;
-                        pix = (pixels >>  4) & 0xf; while (xacc < 0x200) { draw_pixel(x, pix, color, shadow, pPixel+x); x += xdelta; xacc += hzoom; } xacc -= 0x200;
-                        pix = (pixels >>  0) & 0xf; while (xacc < 0x200) { draw_pixel(x, pix, color, shadow, pPixel+x); x += xdelta; xacc += hzoom; } xacc -= 0x200;
-
+ if (shadow) {
+                            pix = (pixels >> 28) & 0xf; while (xacc < 0x200) { draw_pixel(x, pix, color, shadow, pPixel+x); x += xdelta; xacc += hzoom; } xacc -= 0x200;
+                            pix = (pixels >> 24) & 0xf; while (xacc < 0x200) { draw_pixel(x, pix, color, shadow, pPixel+x); x += xdelta; xacc += hzoom; } xacc -= 0x200;
+                            pix = (pixels >> 20) & 0xf; while (xacc < 0x200) { draw_pixel(x, pix, color, shadow, pPixel+x); x += xdelta; xacc += hzoom; } xacc -= 0x200;
+                            pix = (pixels >> 16) & 0xf; while (xacc < 0x200) { draw_pixel(x, pix, color, shadow, pPixel+x); x += xdelta; xacc += hzoom; } xacc -= 0x200;
+                            pix = (pixels >> 12) & 0xf; while (xacc < 0x200) { draw_pixel(x, pix, color, shadow, pPixel+x); x += xdelta; xacc += hzoom; } xacc -= 0x200;
+                            pix = (pixels >>  8) & 0xf; while (xacc < 0x200) { draw_pixel(x, pix, color, shadow, pPixel+x); x += xdelta; xacc += hzoom; } xacc -= 0x200;
+                            pix = (pixels >>  4) & 0xf; while (xacc < 0x200) { draw_pixel(x, pix, color, shadow, pPixel+x); x += xdelta; xacc += hzoom; } xacc -= 0x200;
+                            pix = (pixels >>  0) & 0xf; while (xacc < 0x200) { draw_pixel(x, pix, color, shadow, pPixel+x); x += xdelta; xacc += hzoom; } xacc -= 0x200;
+ } else {
+                            pix = (pixels >> 28) & 0xf; while (xacc < 0x200) { if (x >= x1 && x < x2 && pix != 0 && pix != 15) *(pPixel+x) = (pix | color | COLOR_BASE) & 0xfff; x += xdelta; xacc += hzoom; } xacc -= 0x200;
+                            pix = (pixels >> 24) & 0xf; while (xacc < 0x200) { if (x >= x1 && x < x2 && pix != 0 && pix != 15) *(pPixel+x) = (pix | color | COLOR_BASE) & 0xfff;  x += xdelta; xacc += hzoom; } xacc -= 0x200;
+                            pix = (pixels >> 20) & 0xf; while (xacc < 0x200) { if (x >= x1 && x < x2 && pix != 0 && pix != 15) *(pPixel+x) = (pix | color | COLOR_BASE) & 0xfff;  x += xdelta; xacc += hzoom; } xacc -= 0x200;
+                            pix = (pixels >> 16) & 0xf; while (xacc < 0x200) { if (x >= x1 && x < x2 && pix != 0 && pix != 15) *(pPixel+x) = (pix | color | COLOR_BASE) & 0xfff;  x += xdelta; xacc += hzoom; } xacc -= 0x200;
+                            pix = (pixels >> 12) & 0xf; while (xacc < 0x200) { if (x >= x1 && x < x2 && pix != 0 && pix != 15) *(pPixel+x) = (pix | color | COLOR_BASE) & 0xfff;  x += xdelta; xacc += hzoom; } xacc -= 0x200;
+                            pix = (pixels >>  8) & 0xf; while (xacc < 0x200) { if (x >= x1 && x < x2 && pix != 0 && pix != 15) *(pPixel+x) = (pix | color | COLOR_BASE) & 0xfff;  x += xdelta; xacc += hzoom; } xacc -= 0x200;
+                            pix = (pixels >>  4) & 0xf; while (xacc < 0x200) { if (x >= x1 && x < x2 && pix != 0 && pix != 15) *(pPixel+x) = (pix | color | COLOR_BASE) & 0xfff;  x += xdelta; xacc += hzoom; } xacc -= 0x200;
+                            pix = (pixels >>  0) & 0xf; while (xacc < 0x200) { if (x >= x1 && x < x2 && pix != 0 && pix != 15) *(pPixel+x) = (pix | color | COLOR_BASE) & 0xfff;  x += xdelta; xacc += hzoom; } xacc -= 0x200;
+ }
                         // stop if the second-to-last pixel in the group was 0xf
                         if ((pixels & 0x000000f0) == 0x000000f0)
                             break;
@@ -250,15 +260,25 @@ void hwsprites::render(const uint8_t priority)
                         uint32_t pixels = sprites[spritedata + --ramBuff[data+7]];
 
                         // draw four pixels
-                        pix = (pixels >>  0) & 0xf; while (xacc < 0x200) { draw_pixel(x, pix, color, shadow, pPixel+x); x += xdelta; xacc += hzoom; } xacc -= 0x200;
-                        pix = (pixels >>  4) & 0xf; while (xacc < 0x200) { draw_pixel(x, pix, color, shadow, pPixel+x); x += xdelta; xacc += hzoom; } xacc -= 0x200;
-                        pix = (pixels >>  8) & 0xf; while (xacc < 0x200) { draw_pixel(x, pix, color, shadow, pPixel+x); x += xdelta; xacc += hzoom; } xacc -= 0x200;
-                        pix = (pixels >> 12) & 0xf; while (xacc < 0x200) { draw_pixel(x, pix, color, shadow, pPixel+x); x += xdelta; xacc += hzoom; } xacc -= 0x200;
-                        pix = (pixels >> 16) & 0xf; while (xacc < 0x200) { draw_pixel(x, pix, color, shadow, pPixel+x); x += xdelta; xacc += hzoom; } xacc -= 0x200;
-                        pix = (pixels >> 20) & 0xf; while (xacc < 0x200) { draw_pixel(x, pix, color, shadow, pPixel+x); x += xdelta; xacc += hzoom; } xacc -= 0x200;
-                        pix = (pixels >> 24) & 0xf; while (xacc < 0x200) { draw_pixel(x, pix, color, shadow, pPixel+x); x += xdelta; xacc += hzoom; } xacc -= 0x200;
-                        pix = (pixels >> 28) & 0xf; while (xacc < 0x200) { draw_pixel(x, pix, color, shadow, pPixel+x); x += xdelta; xacc += hzoom; } xacc -= 0x200;
-
+ if (shadow) {
+                            pix = (pixels >>  0) & 0xf; while (xacc < 0x200) { draw_pixel(x, pix, color, shadow, pPixel+x); x += xdelta; xacc += hzoom; } xacc -= 0x200;
+                            pix = (pixels >>  4) & 0xf; while (xacc < 0x200) { draw_pixel(x, pix, color, shadow, pPixel+x); x += xdelta; xacc += hzoom; } xacc -= 0x200;
+                            pix = (pixels >>  8) & 0xf; while (xacc < 0x200) { draw_pixel(x, pix, color, shadow, pPixel+x); x += xdelta; xacc += hzoom; } xacc -= 0x200;
+                            pix = (pixels >> 12) & 0xf; while (xacc < 0x200) { draw_pixel(x, pix, color, shadow, pPixel+x); x += xdelta; xacc += hzoom; } xacc -= 0x200;
+                            pix = (pixels >> 16) & 0xf; while (xacc < 0x200) { draw_pixel(x, pix, color, shadow, pPixel+x); x += xdelta; xacc += hzoom; } xacc -= 0x200;
+                            pix = (pixels >> 20) & 0xf; while (xacc < 0x200) { draw_pixel(x, pix, color, shadow, pPixel+x); x += xdelta; xacc += hzoom; } xacc -= 0x200;
+                            pix = (pixels >> 24) & 0xf; while (xacc < 0x200) { draw_pixel(x, pix, color, shadow, pPixel+x); x += xdelta; xacc += hzoom; } xacc -= 0x200;
+                            pix = (pixels >> 28) & 0xf; while (xacc < 0x200) { draw_pixel(x, pix, color, shadow, pPixel+x); x += xdelta; xacc += hzoom; } xacc -= 0x200;
+ } else {
+                            pix = (pixels >>  0) & 0xf; while (xacc < 0x200) { if (x >= x1 && x < x2 && pix != 0 && pix != 15) *(pPixel+x) = (pix | color | COLOR_BASE) & 0xfff; x += xdelta; xacc += hzoom; } xacc -= 0x200;
+                            pix = (pixels >>  4) & 0xf; while (xacc < 0x200) { if (x >= x1 && x < x2 && pix != 0 && pix != 15) *(pPixel+x) = (pix | color | COLOR_BASE) & 0xfff; x += xdelta; xacc += hzoom; } xacc -= 0x200;
+                            pix = (pixels >>  8) & 0xf; while (xacc < 0x200) { if (x >= x1 && x < x2 && pix != 0 && pix != 15) *(pPixel+x) = (pix | color | COLOR_BASE) & 0xfff; x += xdelta; xacc += hzoom; } xacc -= 0x200;
+                            pix = (pixels >> 12) & 0xf; while (xacc < 0x200) { if (x >= x1 && x < x2 && pix != 0 && pix != 15) *(pPixel+x) = (pix | color | COLOR_BASE) & 0xfff; x += xdelta; xacc += hzoom; } xacc -= 0x200;
+                            pix = (pixels >> 16) & 0xf; while (xacc < 0x200) { if (x >= x1 && x < x2 && pix != 0 && pix != 15) *(pPixel+x) = (pix | color | COLOR_BASE) & 0xfff; x += xdelta; xacc += hzoom; } xacc -= 0x200;
+                            pix = (pixels >> 20) & 0xf; while (xacc < 0x200) { if (x >= x1 && x < x2 && pix != 0 && pix != 15) *(pPixel+x) = (pix | color | COLOR_BASE) & 0xfff; x += xdelta; xacc += hzoom; } xacc -= 0x200;
+                            pix = (pixels >> 24) & 0xf; while (xacc < 0x200) { if (x >= x1 && x < x2 && pix != 0 && pix != 15) *(pPixel+x) = (pix | color | COLOR_BASE) & 0xfff;x += xdelta; xacc += hzoom; } xacc -= 0x200;
+                            pix = (pixels >> 28) & 0xf; while (xacc < 0x200) { if (x >= x1 && x < x2 && pix != 0 && pix != 15) *(pPixel+x) = (pix | color | COLOR_BASE) & 0xfff; x += xdelta; xacc += hzoom; } xacc -= 0x200;
+ }
                         // stop if the second-to-last pixel in the group was 0xf
                         if ((pixels & 0x0f000000) == 0x0f000000)
                             break;
 
Last edited by a moderator:
Thanks for the response and help, ptitSeb!

I've applied those changes to the road and sprite scaling methods, but I still don't get steady 60FPS mode on the Rpi, even if it's overclocked at 950MHz.

The main slowdown point is at the starting line, with the public and the man waving the flag: the game totally CRAWLS there.

How does the engine behave on the Pandora at ~900MHz speeds? Do you get full, rock-solid 60FPS on the starting line? 

I haven't read the whole thread, but I understand people is using the 30FPS mode on the Pandora, right?

Maybe Rpi's CPU just isn't enough. I also tried the -Ofast flag, but I saw no improvement from -O3. I'm on gcc 4.6.3.
 
Tiny updates seems to have been made in CannonBall, and also the track editor LayOut has been released.

Any plans about this ?
 
I does compile, after a few adjustement...

LayOut.png

The Window is of course too big for the Pandora, but I'm not sure there is something I can do about that :(

It seems to work well (the preview window is awesome, using a mouse with whell works very well). I still have to compile the latest Cannonball, and package all that, and do some zenity also for the custom tracks.. Don't expect a new release too soon, i'll need a few day I think...
 
So, after some work on the QT ui, I finally manage to fit everything on the screen! I switch to fullscreen also to get a few pixel more...

Here is a collection of screenshot (yes, it's small, but it seems fully usable).

I still have to compile latest version of Cannonball, make C4A turn off when using custom track, put LayOut (and a big bunch of lib) inside cannonball PND, and put some new menu entry...

LayOut2.png

LayOut3.png

LayOut4.png

LayOut5.png

LayOut6.png
 
Back
Top