Skip to main content


Finished optimizing the main drawing functions for uxn-playdate getting speedups ranging from 1.98x to 4.38x.

Only screen_fill missing and then it's time to do audio and filesystem stuff. At this point the playdate should be able to handle pretty much any rom you throw at it (within reason). I think there is full speed parity for Oquonie compared with uxnemu.

More testing is needed of course, and I could make things faster but not worth it until I can test on hardware. :uxn:

#uxn #playdate

in reply to Bad Diode

that's sick! I was looking at the uxn core, and I think it could be to run faster.

Many times you increment the stack pointer each push and pop, I was wondering if it'd be faster to move it once, and write the values with an offset, so something like PUSH(a) PUSH(b) wouldn't load the ptr twice, just once and write a at -1 and b at -2.

in reply to Devine Lu Linvega

@neauoire it's best not to do these optimizations manually, the compiler should be able to do this for you. There may be some operations where this could help, but if you decide you wanna give it a try let me know and I can A-B the changes 😀
in reply to Bad Diode

oki 😀 yeah I never know what turns into what, with one of the older cores, I noticed that in Compiler Explorer it would do an extra load between each.
Unknown parent

Devine Lu Linvega
@sigrid yeah, I don't really know how to look at generated arm code, I only have compiler explorer right now.
in reply to Devine Lu Linvega

@neauoire @sigrid you can do that on compiler explorer, just need to target the right CPU:

https://godbolt.org/z/8G35d8TKG

Or offline with:

arm-none-eabi-objdump -d build/pdex.elf

in reply to Sigrid Solveig Haflínudóttir

@sigrid aaah, that's cool I didn't know you could change target like that with godbolt.

Wouldn't that just give me x86 if I'm on the thinkpad?

Unknown parent

in reply to Bad Diode

Lol the screen filling function was very slow and Oquonie uses it a lot. Improved the performance 4.64x times over the already good performance. Yeah, @neauoire you are not going to have trouble running this lol.
in reply to Bad Diode

HOW?! what the hell, it was such a simple routine too?! The more time I spend inside computers the less I understand how they work
in reply to Devine Lu Linvega

@neauoire it was calling ppu_pixel on a double loop, now I write 1 tile at a time, handling the corner cases and such.

Anyway I'm done for now with the optimization work, time to do some more practical stuff, like audio and some extra menu goodies.

The worst (best?) thing is that all this work gave me even more ideas for optimizing uxngba video drawing... hmmmmm

in reply to Devine Lu Linvega

@neauoire in fairness I already did a lot of this optimization work when working on the gba routines, just had to port them over (which was a bit tricky at times). Still, I'm no expert, just trying to get a bit better everyday 😀

Lo, thar be cookies on this site to keep track of your login. By clicking 'okay', you are CONSENTING to this.