patois / RETracker

Reverse Engineering Framework for the Polyend Tracker
103 stars 21 forks source link

custom theme/colors #5

Closed ninteundo closed 2 years ago

ninteundo commented 2 years ago

would it be possible to provide a example code, that changes the colors of the default theme? as polyend hasnt implemented this very easy feature me and others have been asking for almost 2 years, sadly my coding isn't too great :(

patois commented 2 years ago

I am afraid there is no easy solution. If reverse engineering the Tracker firmware is not an option (which is what RETracker has been built for), your best bet would be finding the source code of the "Mother Tracker" firmware on the web (it used to be available on github). The latter is written in C/C++ and its implementation seems suspiciously similar to that of the Tracker's firmware. Identifying relevant routines and hard-coded RGB color values within the source code may make it easier to find those byte sequences in the Tracker's firmware file as well. Changing them appropriately will probably lead to alternative color schemes but I haven't tried that myself. Use the unpack and repack options of RETracker before and after patching respectively.

Disclaimer: RETracker has not been made with any help of the github project "Mother Tracker" but by reverse engineering official Polyend Tracker firmware binaries solely.

ninteundo commented 2 years ago

I see, yes i have downloaded that mothertracker sourcecode it is still up there on github. As i am a total coding noob that might be too much for me, but i was thinking since firmware 1.6 they added a new monochrome theme it might be possible to unpack the 1.6 patch and find the part where it adds the monochrome theme rgb color values! that way u actually can switch between default and a custom one.

On Thu, Sep 8, 2022 at 8:00 AM pat0is @.***> wrote:

I am afraid there is no easy solution. If reverse engineering the Tracker firmware is not an option (which is what RETracker has been built for), your best bet would be finding the source code of the "Mother Tracker" firmware on the web (it used to be available on github). The latter is written in C/C++ and its implementation seems suspiciously similar to that of the Tracker's firmware. Identifying relevant routines and hard-coded RGB color values within the source code may make it easier to find those byte sequences in the Tracker's firmware file as well. Changing them appropriately will probably lead to alternative color schemes but I haven't tried that myself. Use the unpack and repack options of RETracker before and after patching respectively.

Disclaimer: RETracker has not been made with any help of the github project "Mother Tracker" but by reverse engineering official Polyend Tracker firmware binaries solely.

— Reply to this email directly, view it on GitHub https://github.com/patois/RETracker/issues/5#issuecomment-1240257195, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAE7BAUW6KLQX74AUGJ6OOTV5F6G5ANCNFSM576LFSLQ . You are receiving this because you authored the thread.Message ID: @.***>

dustboxednorth commented 2 years ago

yes i have downloaded that mothertracker sourcecode it is still up there on github.

could you direct me to this? I can't find a lick of info on this anywhere

ninteundo commented 2 years ago

sure no problem, https://github.com/patois/RETracker/blob/2c544b796ce65487c7cc2e5fe985a561fe17ee35/PolyendTrackerSourceCodeV1.zip

On Sat, Sep 10, 2022 at 3:35 PM dubby j. nelson @.***> wrote:

yes i have downloaded that mothertracker sourcecode it is still up there on github.

could you direct me to this? I can't find a lick of info on this anywhere

— Reply to this email directly, view it on GitHub https://github.com/patois/RETracker/issues/5#issuecomment-1242730418, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAE7BAVRLCXBSRBCKSLEJELV5SFA5ANCNFSM576LFSLQ . You are receiving this because you authored the thread.Message ID: @.***>

ninteundo commented 2 years ago

it seems to be made in Eclipse IDE

On Sat, Sep 10, 2022 at 6:58 PM stekker @.***> wrote:

sure no problem, https://github.com/patois/RETracker/blob/2c544b796ce65487c7cc2e5fe985a561fe17ee35/PolyendTrackerSourceCodeV1.zip

On Sat, Sep 10, 2022 at 3:35 PM dubby j. nelson @.***> wrote:

yes i have downloaded that mothertracker sourcecode it is still up there on github.

could you direct me to this? I can't find a lick of info on this anywhere

— Reply to this email directly, view it on GitHub https://github.com/patois/RETracker/issues/5#issuecomment-1242730418, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAE7BAVRLCXBSRBCKSLEJELV5SFA5ANCNFSM576LFSLQ . You are receiving this because you authored the thread.Message ID: @.***>

PRAYTHEPO commented 2 years ago

@ninteundo

would it be possible to provide a example code, that changes the colors of the default theme? as polyend hasnt implemented this very easy feature me and others have been asking for almost 2 years, sadly my coding isn't too great :(

The stupidest search for "color" shows this results: изображение

As I can see, there is values for all elements of interface

dustboxednorth commented 2 years ago

sure no problem, https://github.com/patois/RETracker/blob/2c544b796ce65487c7cc2e5fe985a561fe17ee35/PolyendTrackerSourceCodeV1.zip On Sat, Sep 10, 2022 at 3:35 PM dubby j. nelson @.***> wrote: yes i have downloaded that mothertracker sourcecode it is still up there on github. could you direct me to this? I can't find a lick of info on this anywhere

I've spent about an hour or so sifting through this and this is just... genuinely jaw dropping. afaict, this is literally just the Tracker's whole codebase. I'm no genius, I'll admit (I don't even know how I'd go about compiling this for the Tracker), but there are entire strings of text in here that can be found in the Tracker's official firmware (note commands, FX descriptions, etc.) word-for-word, character-for-character. It doesn't take a genius to connect the dots here.

Where the hell did you find this?

EDIT: a user by the name of egoshiner seems to be responsible for this, and their commit is described as "Compressed version of launch firmware's source code." So, if anything, I should be asking them where they found this.

ninteundo commented 2 years ago

It does indeed seem to be the actual sourcecode, i think its missing some stuff because i couldnt get it to compile, but as far as reverse engineering the hex it would be amazing as a resource ! That psychotic rambling guy on reddit in your post replies leaked it onto github thats how i found it haha. It seems he either by hack or just dumb luck found polyends respitory before they released the tracker during beta times?

Op wo 21 sep. 2022 om 01:22 schreef dubby j. nelson < @.***>

sure no problem, https://github.com/patois/RETracker/blob/2c544b796ce65487c7cc2e5fe985a561fe17ee35/PolyendTrackerSourceCodeV1.zip … <#m-7526945568941957344> On Sat, Sep 10, 2022 at 3:35 PM dubby j. nelson @.> wrote: yes i have downloaded that mothertracker sourcecode it is still up there on github. could you direct me to this? I can't find a lick of info on this anywhere — Reply to this email directly, view it on GitHub <#5 (comment) https://github.com/patois/RETracker/issues/5#issuecomment-1242730418>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAE7BAVRLCXBSRBCKSLEJELV5SFA5ANCNFSM576LFSLQ https://github.com/notifications/unsubscribe-auth/AAE7BAVRLCXBSRBCKSLEJELV5SFA5ANCNFSM576LFSLQ . You are receiving this because you authored the thread.Message ID: @.>

I've spent about an hour or so sifting through this and this is just... genuinely jaw dropping. afaict, this is literally just the Tracker's whole codebase. I'm no genius, I'll admit (I don't even know how I'd go about compiling this for the Tracker), but there are entire strings of text in here that can be found in the Tracker's official firmware (note commands, FX descriptions, etc.) word-for-word, character-for-character. It doesn't take a genius to connect the dots here.

Where the hell did you find this?

— Reply to this email directly, view it on GitHub https://github.com/patois/RETracker/issues/5#issuecomment-1253012469, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAE7BATDN2ZO5T2GJHWAQYDV7JBMBANCNFSM576LFSLQ . You are receiving this because you were mentioned.Message ID: @.***>

patois commented 2 years ago

Here's an example of how the color of a "note" in pattern view can be changed to red:

>python retracker.py -w 20005490 "00 00 ff 00"
Connected to Polyend Tracker
Detected fw patch v0.3.3 on Tracker firmware v1.5.0

Writing data to address 20005490
Writing to memory successful

This works because address 0x20005490 holds the RGB color value of a note in pattern view. If instead we wanted to set its color to blue, the following would work:

>python retracker.py -w 20005490 "ff 00 00 00"

Say if we wanted to find out about the memory addresses holding RGB color values of other elements, we could disassemble the firmware's routine that initializes the color palette. For firmware version 1.5, it is located at address 0x0001F370. Because its code is in thumb mode, the following will correctly disassemble the function.

python retracker.py -d 0001F371 206

Hope that helps!

ninteundo commented 2 years ago

nice thanks so much :) will try to mess around with this later today!

Cheers

On Wed, Sep 28, 2022 at 9:29 AM pat0is @.***> wrote:

Here's an example of how the color of a "note" in pattern view can be changed to red:

python retracker.py -w 20005490 "00 00 ff 00" Connected to Polyend Tracker Detected fw patch v0.3.3 on Tracker firmware v1.5.0

Writing data to address 20005490 Writing to memory successful

This works because address 0x20005490 holds the RGB color value of a note in pattern view. If instead we wanted to set its color to blue, the following would work:

python retracker.py -w 20005490 "ff 00 00 00"

Say if we wanted to find out about the memory addresses holding RGB color values of other elements, we could disassemble the firmware's routine that initializes the color palette. For firmware version 1.5, it is located at address 0x0001F370. Because its code is in thumb mode, the following will correctly disassemble the function.

python retracker.py -d 0001F371 206

Hope that helps!

— Reply to this email directly, view it on GitHub https://github.com/patois/RETracker/issues/5#issuecomment-1260499803, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAE7BATT5Z755IXTQTN5GW3WAPXUZANCNFSM576LFSLQ . You are receiving this because you were mentioned.Message ID: @.***>