st3fan/ewm

Implement a software renderer

st3fan opened this issue · 5 comments

Implement a software renderer that blits/copies pixels into an SDL_Surface. This will allow the emulators to run on the Raspberry Pi Zero and other platforms without hardware accelerated OpenGL support.

Current performance on a Raspberry Pi Zero:

pi@raspberrypi:~/Projects/ewm/src $ ./scr_test
txt_full_refresh      green      95.103/refresh
txt_full_refresh      color      24.554/refresh
lgr_full_refresh      green      17.619/refresh
lgr_full_refresh      color      17.648/refresh
hgr_full_refresh      green      19.561/refresh
hgr_full_refresh      color      35.250/refresh

After changing the BlendMode to SDL_BLENDMODE_NONE in scr_render_character():

txt_full_refresh                         green      36.373/refresh

More refactorings:

txt_full_refresh                 green      36.192/refresh
txt_full_refresh                 color      23.082/refresh
lgr_full_refresh                 green      17.386/refresh
lgr_full_refresh                 color      17.327/refresh
hgr_full_refresh                 green      19.289/refresh
hgr_full_refresh                 color      20.671/refresh
txt_full_refresh                         green      36.007/refresh
txt_full_refresh                         color      22.986/refresh
lgr_full_refresh                         green      17.295/refresh
lgr_full_refresh                         color      17.265/refresh
hgr_full_refresh                         green      18.400/refresh
hgr_full_refresh                         color      19.863/refresh
txt_full_refresh                         green      22.094/refresh
txt_full_refresh                         color      22.218/refresh
lgr_full_refresh                         green      17.155/refresh
lgr_full_refresh                         color      17.127/refresh
hgr_full_refresh                         green      17.698/refresh
hgr_full_refresh                         color      19.170/refresh