I have tried to implement 8bit pixels into the drawing functions, but it doesn’t seem to be working. Initially I was trying to follow how the ‘print’ functions work, but there is an awful lot there to try to follow. I thought a simple addition
to the pixel functions would have fixed it, but I get nothing.
Also, is Pokitto::lcdRefreshMode13 the main bottleneck to the framerate, or are there other changes that can be made? If you set game.display.rotatePalette(10); instead of 1, you can clearly see the screen updating, I would have thought it should be faster than that…
I have just updated, I have the pixels working and as a result anything using drawpixel should work. I tested drawRect, drawCircle, drawLine and drawChar. Oddly, drawChar works but print doesn’t I was sure print used drawchar…
I was testing direct pixel routines, it seems I might be running too fast. Is there no way to wait for vblank/hblank? According to the screen documents there is at least an internal signal being used but didn’t see anything about that pin being connected externally.
I don’t think so, not in mode13 anyway, I’ve set it to 60.
Although setting the frameRate to 1 or 2 is making no difference to the running speed. That’s what I get for messing with the update routines.
Take a look at how mode2 refresh works. -
A. your code can be made 2x more efficient with a simple tweak: you are reading the same source pixel values twice in two separate for loops. Look at how I first create a scanline buffer and then blast it out twice
B. contrary to popular belief, for loops are not efficient. You have to “unroll” your loops. Write_data is a tiny bit of code. Instead of for looping through all pixels, you should write 10x pixels (at least) inside one loop and then loop 10x less. The difference is big.
Fps. Currently it is limited @20fps just because it was easier to get the simulator to somewhat match the speed of hardware that way. This limitation will be removed. Secondly, the timing mechanism is not accurate enoug to get a good fps reading. You have to average over a long time. This will also be fixed.