rbmj/612-code — comment on commit 9cb5a4a7c37c39e431880990a86e68a10684300b
File: ports.cpp line 26
By rbmj:

Yes; look at the bottom of this file's commit - we declare the global update registry that is run in main.cpp.

But, there should be something like this in the joysmooth file:

```c++
#include "update.h"
//...
void update_joysmooth_reg(void * arg) {
((joysmooth*)arg)->update();
}
//...
joysmooth::joysmooth() { //ctor
//...
registry.register_func(update_joysmooth_reg, (void*)this);
//...
}

joysmooth::~joysmooth() { //dtor
//...
registry.unregister_func(update_joysmooth_reg, (void*)this);
//...
}
```

There can only be one instance of each function-argument pair in the registry.