TeamPuzel [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=92079 macOS icon fix guide + macOS 26 <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/92079/Screenshot 2025-06-16 at 10.52.36.png" alt="" /> <p>Hello :)</p> <p>I am really sad that after a year these simple things are still broken:</p> <ul> <li>The app icon does not fit in with the system, and breaks the user's ability to customize the app icon by overriding it at runtime with SDL_SetWindowIcon.</li> <li>This also breaks the macOS 26 Tahoe icon renderer preventing the system from theming it.</li> <li>The icon changes in the dock after you run the app, very unusual behavior.</li> <li>The viewport inside the window incorrectly calculates the resolution by using the resolution divided by 2, causing it to miss the possibility of a bigger window with sharp pixels.</li> </ul> <p>I hope Apple simply turns this API abuse into a no-op in a future update, but in the meantime I made a small patch you can use with your arm version of Picotron 0.2.0d. The patch changes the SDL_SetWindowIcon function to simply <code>ret</code> back to the caller, preventing the call to SDL.<br /> Because the patch is a radare2 script which finds the linked SDL symbol in the binary it should work for any version of Picotron, not just 0.2.0d. In fact, it should even work on PICO-8! :)</p> <p>You will need radare2 to apply the patch, you can install it with homebrew:</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>brew install radare2</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>In the future I will expand this bug fix patch in order to fix other problems that go unfixed such as the resolution being chosen incorrectly.</p> <p>It would be nice if Picotron was just fixed normally though. It's been a year and both issues are rather trivial, they're not technical issues but a misunderstanding of the macOS platform and SDL. Please just fix them (also in Pico-8) so I don't have to patch the binaries myself.</p> <ul> <li>Don't set the icon at runtime</li> <li>Don't confuse SDL_GetWindowSize and SDL_GetWindowSizeInPixels. The latter is what you want to be using to calculate your pixel size or you will always fail to calculate the best possible resolution.</li> </ul> <h1>Guide</h1> <p>First of all this is the entire patch for now:</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>s sym.imp.SDL_SetWindowIcon; wai ret;</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>it skips to the linked SDL function and places a return at the start turning it into a no-op regardless of how Picotron attempts to use it.</p> <p>Here's what you have to do to apply the fix:</p> <ul> <li>Create a copy of your Picotron.app in some other directory than /Applications (make sure it's not a location tracked by iCloud as that will prevent signing it)</li> <li>For convenience create a patch.r2 text file and paste the patch there</li> <li>Open that directory in the terminal</li> </ul> <p>Now you can use the following commands:</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre># apply the patch to the picotron binary r2 -wqi patch.r2 Picotron.app/Contents/MacOS/picotron # remove the now invalid signature or macOS will prevent it from running codesign --remove-signature --deep Picotron.app # it still won't run because it has no signature so sign it locally codesign --force --deep --sign - Picotron.app/Contents/MacOS/picotron # SDL confuses codesign so sign the binary itself again codesign --force --sign - Picotron.app/Contents/MacOS/picotron</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>After that you now have a fixed version of Picotron which doesn't override your custom icon if you have one and is properly themed on macOS Tahoe :)</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/92079/Screenshot 2025-06-16 at 10.55.52.png" alt="" /> <p>I will try to fix the window resolution bug later as well, which I've done in the past but that part of the code changed since then.</p> https://www.lexaloffle.com/bbs/?tid=149561 https://www.lexaloffle.com/bbs/?tid=149561 Mon, 16 Jun 2025 10:46:49 UTC Task Monitor 0.5 <p> <table><tr><td> <a href="/bbs/?pid=143328#p"> <img src="/bbs/thumbs/pico64_task_monitor-4.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=143328#p"> Task Monitor 0.5</a><br><br> by <a href="/bbs/?uid=92079"> TeamPuzel</a> <br><br><br> <a href="/bbs/?pid=143328#p"> [Click to Play]</a> </td></tr></table> </p> <p>A small program for displaying running processes, capable of killing them from the application menu or with a shortcut.</p> <p>I mainly made this simple project to figure out the picotron gui library for use in other programs I'm working on.</p> <p>UPDATE 0.3:</p> <ul> <li>The window now remembers its size and position when closed</li> </ul> <p>UPDATE 0.4:</p> <ul> <li>The app now only refreshes data every second instead of every frame, making rapidly changing numbers readable</li> </ul> <p>UPDATE 0.5:</p> <ul> <li>Window settings are now stored in a different file, among other internal changes</li> </ul> https://www.lexaloffle.com/bbs/?tid=140730 https://www.lexaloffle.com/bbs/?tid=140730 Sat, 16 Mar 2024 16:44:21 UTC Minesweeper :) <p> <table><tr><td> <a href="/bbs/?pid=143106#p"> <img src="/bbs/thumbs/pico64_picotron_minesweeper_8_2-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=143106#p"> Picotron Minesweeper 8.2</a><br><br> by <a href="/bbs/?uid=92079"> TeamPuzel</a> <br><br><br> <a href="/bbs/?pid=143106#p"> [Click to Play]</a> </td></tr></table> </p> <p>A port of my recent pico-8 minesweeper to Picotron. </p> <p>I want it to fully adjust to the system theme, for now it just uses it for the mine counter :)</p> <p>UPDATE 0.2:</p> <ul> <li>No longer crashes on continue</li> <li>The time is displayed correctly</li> </ul> <p>UPDATE 0.3:</p> <ul> <li>Beginner, intermediate and expert difficulty selection from the menu (but windows don't resize automatically yet)</li> <li>Lots of windows at once</li> <li>Game doesn't crash on victory</li> <li>Added missing sound effects</li> </ul> <p>UPDATE 0.4:</p> <ul> <li>Changed how the program creates new windows, now new instances use the correct about menu</li> </ul> <p>UPDATE 0.5:</p> <ul> <li>Windows now open in a cascade from the previous window (but difficulties beyond beginner don't yet open with the correct size)</li> <li>There is now a persistent scoreboard for the three standard difficulties (custom game and scoreboard coming soon)</li> </ul> <p>UPDATE 0.6:</p> <ul> <li>Windows now open at the correct size for their difficulty</li> </ul> <p>UPDATE 0.7:</p> <ul> <li>Fixed a sound bug that started happening after the Picotron &quot;c&quot; update</li> </ul> <p>UPDATE 0.8:</p> <ul> <li>Custom game! (number input is not too convenient due to picotron input limitations but it works &mdash; there's also no scrollbars for the board so don't make one too big yet)</li> </ul> <p>UPDATE 0.8.1:</p> <ul> <li>Shortened menu items in order to work around the latest picotron now cutting off keyboard shortcut labels</li> </ul> <p>(new) UPDATE 0.8.2:</p> <ul> <li>Fixed another sound bug</li> </ul> https://www.lexaloffle.com/bbs/?tid=140678 https://www.lexaloffle.com/bbs/?tid=140678 Fri, 15 Mar 2024 13:22:33 UTC Minesweeper <p> <table><tr><td> <a href="/bbs/?pid=142637#p"> <img src="/bbs/thumbs/pico8_puzelminesweeper-7.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=142637#p"> Minesweeper 2.1</a><br><br> by <a href="/bbs/?uid=92079"> TeamPuzel</a> <br><br><br> <a href="/bbs/?pid=142637#p"> [Click to Play]</a> </td></tr></table> </p> <p>This is the first pico-8 game I finished, and it's minesweeper. Sadly I couldn't recreate the original UI, as the 16x16 difficulty mode covers the entire screen &mdash; I had to use something more dynamic. I can't wait to port this to Picotron, since it will be able to display higher difficulties and the full interface :)</p> <p>update:<br /> Version 2.0 had most of the game logic rewritten, now supporting arbitrary size boards that scroll when needed (for now using the direction buttons). This means expert difficulty is now accessible, and custom difficulties will be possible in the future once I complete the custom game window.</p> https://www.lexaloffle.com/bbs/?tid=140563 https://www.lexaloffle.com/bbs/?tid=140563 Fri, 08 Mar 2024 20:57:27 UTC