wwarby/walker

Support this watch with forerunner 45??

Closed this issue · 6 comments

Hello!

Support with forerunner 45?

Hi @tripoflgb. I do plan to support the Forerunner 44 and 55 eventually. The problem with those models is they use an 8 colour palette, and Walker is designed to a 16 colour palette - and adding the branching logic to support multiple colour palettes pushes memory utilisation over the limit required to support the Forerunner 235 and some other old devices (I'm right up against that limit already). As such the only way I can make almost any change to Walker now is going to be to break the app into two versions - one for low memory devices and one for all other devices, which I plan to do, but it's not a quick job so I need to find a window of time to work on it.

Why do you need to do that in the MC code? You can have the different mc files in different source directories and do the rest in jungle

It comes down to maintainability. Walker uses code rather than layout files for presentation because layouts use too much memory, and the older Garmin watches have such a chronic shortage of memory that to squeeze the functionality I needed into the 16KB limit I had to forego all considerations of code separation, so effectively the program is one class file. All the colour references are embedded directly in that main program file.

As such, to support a watch model with an 8 colour palette I would need to create and modify a duplicate of the whole program, and from there onwards maintain two copies of the program, remembering to apply changes in both. I do intend to do that at some point anyway - to effectively freeze the functionality for older watches with 16KB memory and create a more maintainable branch of the code for the newer watches. It's a stupid problem to have in the first place - it's like trying to write code for a calculator made in 1976, which is why I'm dragging my feet on the changes I know I need to make. I'll get round to it at some point though :)

I don't know what's your problem. I think there are 2 things you will need to do. And I already did the 1st part of it :)

  1. Copy source-round-218x218-x to source-round-208x208-a and set up monkey.jungle. This took 10 minutes, but I admit that I haven't moved the coordinates yet (though it's not that bad even like that) I can even send it as a PR

  2. Take care of WalkerView.mc lines: 288-514. I agree this needs some refactoring, but it's not that horrible as you wrote:

2.1 Copy the current file to WalkerView16k so all those old watches continue to work with the current code that we know compiles. Adjust monkey.jungle. I think this should be another 10 minutes. From now on you probably won't touch this file, old watches are OK now, and they won't get new features. The only question is if later you manage to add FR45 then I guess it falls into this category as well.

3.1 Now you have 2 options: 1 that might work, and needs almost no refactoring since now this code will only be used on devices that have enough memory, you might be able to change back the numbers to the color constants (that fortunately is in your code already, so no need to look them up). My assumption is that in the 8 color devices these constants will have a different value, and as such will provide a pretty decent result.

3.2 The other option is to create another array, similar to Layout.mc, call it Colors.mc. Copy the currently used codes to the array. Add this Colors.mc to all the existing devices in monkey.jungle, and create sources-8-colors/Colors.mc for FR55, adjust the numbers, add it to monkey.jungle. Since you only have this code in the newer devices the increased code size (array lookup instead of the constants) should not be a problem.

If you don't have FR55 (as I don't have) then maybe it's worth to have a look around the internet to see if what we see in the simulator is correct.

Yeah that's probably the right way forward. I'll admit I didn't consider freezing the current version within the existing app for 16K devices - I had in mind that I'd create a whole new version for 16K users with a duplicate copy of the current codebase, which is a much more convoluted and less elegant solution than what you've proposed.

I need to look at the other bug you've raised, so I'll aim to take this on at the same time.

I've done this now. Took me a while, but I finally got around to it. Planning to release later today.