Table of Contents

Optimizing programs

This page serves as a loose list of advice for getting the most out of the WonderSwan.

Optimizing C code

Optimizing for code speed

To optimize for speed, compile your code with -O2.

Optimizing for code size

To optimize for size, compile your code with -Os.

Optimizing for memory usage

Optimizing assembly code

Optimizing for speed

While the V30MZ is an 80186-compatible CPU, its instruction timings differ wildly from common expectations and are more reflective of its 1990s-era design:

You can study the instruction timings in detail on the WSdev wiki.

There are also some additional tricks you can take advantage of: