emufreak / iAmiga

iAmiga sources
44 stars 17 forks source link

Setting for reducing battery drain #39

Closed mdbergmann closed 8 years ago

mdbergmann commented 8 years ago

Hi.

Can anyone recommend a compile time setting to reduce CPU load and battery drain as much as possible?

Manfred

mithrendal commented 8 years ago

Hi manfred, In order to save some execution time during emulation you could disable sprite collision. At the moment sprite collision is enabled by default. Some games who use BlitterObjects (BOBs) dont need proper collision deetction. You could invent a setting to toggle sprte collsion on/off.

mdbergmann commented 8 years ago

I found a function do_sprite_collision() in custom.cpp and commented it out. But I couldn't see that it reduces the CPU load very much. I guess there must be a lot of sprites to really reduce load.

mdbergmann commented 8 years ago

On average one core has a load of 45% on Workbench 1.3, using mouse, shell, etc. That is quite a lot. Although watching a youtube video might produce a similar load.

mithrendal commented 8 years ago

When you seeing 45% load, which device are you talking about ? I mean if it is a A4-Processor powered device, this would seem to be an completely welcome and acceptable value.

mdbergmann commented 8 years ago

It's an iPad mini 4. With a A8 CPU, 2 core, 1.5GHz. Some say it has more power per core than a PPC G4 that was built into PowerBooks, MacMini, etc. On my PowerBook G4, 1.6GHz e-uae on MorphOS is emulating an A500 cycle exact at ~30% CPU load.

Having said that, compiling iUAE with -O3 reduces the load to 24-27%. That's acceptable, also for longer play sessions on battery.

mithrendal commented 8 years ago

Wow, that sounds better. I also want this setting ;-) Someone should make a pull request and bring it into the master/dev branch, @emufreak or do you like to fix that quickly ?

mdbergmann commented 8 years ago

It depends a bit how you install iUAE on you device. If you install it by running the app in Xcode then the debug setting is effective here, which by default is -O0. And it must be -O0 if you want to debug the code. However you can set it temporarily to -O3 when installing the app to the device in case you don't want to debug. If you use Ad-hoc install the optimization setting is already at -Os which should give a similar speed improvement.

simontoens commented 8 years ago

Sounds like we can just document this - @mdbergmann do you want to update README.md with this information?

mdbergmann commented 8 years ago

Yeah, can do.

mdbergmann commented 8 years ago

Added pull request