I found a few discrepancies between the simulator and the watch hardware. Workarounds are possible, but the first one is a big problem for doing animation. I'm developing on sim v1.1.2 in the provided Puppy/Ubuntu VM, VirtualBox v4.0.4 r70112, WinXP Pro 32-bit Intel Quad-Core host. Hopefully this will save the simmers some frustration, and give the devs some ideas on what to fix.
Memory Usage: The sim allocates impossibly large amounts of RAM during screen writes. It made no difference whether I used an image resource, or wrote raw pixels, but larger writes caused problems faster. The following code will consume about 50MB of ram after clicking the button rapidly for 30 seconds, bringing a 256MB VM to its knees. The hardware watch has no problem with this.
void main_app_handle_button_down() {
pulse_set_draw_window(16, 32, 64, 96);
for (int i = 0; i < 3072; i++) {
pulse_draw_point24(COLOR_WHITE24);
}
}
I was able to partially work around this in my app by writing single pixels and lines in my test code, and switching to the actual drawing code when deploying to the watch.
Timer Resolution: The following code will execute roughly every 250ms in the simulator, when it should execute roughly every 50ms. The timers on the hardware watch have much higher resolution, as does the VM itself (ping, etc..), so I'm not sure what's up with the sim.
uint32_t updateTimerID;
void Update(){
// do stuff
updateTimerID = pulse_register_timer(50, &Update,0); // once called, this should repeat every 50ms
}
Display Boundary Behavior: Setting a draw window outside the screen boundary yields confusing results. The following code works in the simulator, filling as much as it can, but the actual watch draws nothing at all. If the sim looks great, but the watch is missing stuff, make sure everything is within bounds.
uint32_t area = 16*(128);
uint32_t i;
pulse_set_draw_window(80, 0, 95,128); // one-off, 127 is the bottom of the screen
for(i=0;i<area;i++){
pulse_draw_point24(COLOR_BLACK24); // erase stuff
}
-Matt Jones
www.evilseed.net