Nop90 Posted October 4, 2019 Share Posted October 4, 2019 Compiling some code with cc65 always creates a rom that on boot (on emulators and on real HW) shows some garbage on the screen. This should be caused by the boot loader. I'm going to publish Xump on phisical carts for the end of the year, but the publisher is asking me to fix this small problem and make the rom behave like commercial roms (i.e. have a clean dark screen before the splash screen). This should involve modifying the bootloader (i think setting all the palette to black as first thing). With patience and hard work I should be able to do it myself, but since in this period of the year I don't have so much time, I need to ask other developers an help. Do someone already handled this small problem and has a modified version of the bootloader? If not, someone could help me making this mod? Quote Link to comment Share on other sites More sharing options...
+karri Posted October 4, 2019 Share Posted October 4, 2019 This might really be the desired behaviour even in the default cc65 bootloader. Quote Link to comment Share on other sites More sharing options...
enthusi Posted October 4, 2019 Share Posted October 4, 2019 We have a thread where I posted my own loader and we discuss things. It sets all colors to black right from the start. Quote Link to comment Share on other sites More sharing options...
+karri Posted October 4, 2019 Share Posted October 4, 2019 Here you go. The new cc65 loader newbootldr.s You just compile this asm file with your code and please remove the line below from your cart/lynx.cfg file. - __BOOTLDR__: type = import; PS: add the command tgi_clear() just after you run tgi_init() 1 Quote Link to comment Share on other sites More sharing options...
+karri Posted October 4, 2019 Share Posted October 4, 2019 I just pushed this bootloader to my cc65 repo. So it will become standard behaviour for my games as well. Thanks! 1 Quote Link to comment Share on other sites More sharing options...
Nop90 Posted October 4, 2019 Author Share Posted October 4, 2019 Thank you very much. This is really a great community. 58 minutes ago, karri said: add the command tgi_clear() just after you run tgi_init() I already do this, thanks. 1 Quote Link to comment Share on other sites More sharing options...
Nop90 Posted October 4, 2019 Author Share Posted October 4, 2019 Works great, but the compiler needs the extzp.inc file, that i copied in the same folder of the new loader to compile the rom. That file should not be already available in a cc65 included folder? Quote Link to comment Share on other sites More sharing options...
+karri Posted October 4, 2019 Share Posted October 4, 2019 You are correct. This file contains the global shadow registers and stuff related to the cart filesystem. .global __iodat: zp .global __iodir: zp .global __viddma: zp .global __sprsys: zp .global _abc_score_ptr0: zp .global _abc_score_ptr1: zp .global _abc_score_ptr2: zp .global _abc_score_ptr3: zp .global _FileEntry: zp .global _FileStartBlock: zp .global _FileBlockOffset: zp .global _FileExecFlag: zp .global _FileDestAddr: zp .global _FileFileLen: zp .global _FileCurrBlock: zp .global _FileBlockByte: zp .global _FileDestPtr: zp Hmm. For some reason my ABCmusic believes that it is warranted to have four score pointers in zp RAM. As all the libraries and the encrypted boot loader relies on these locations to be in fixed positions I won't remove the abc stuff. Perhaps these locations could be used for other sound engines if ABCmusic is not in use. Quote Link to comment Share on other sites More sharing options...
jum Posted November 4, 2019 Share Posted November 4, 2019 Should this "fix" not be add to the standard cc65 repository: https://github.com/cc65/cc65/blob/master/libsrc/lynx/bootldr.s ??? (Just asking because this is the version of cc65 that I use). Quote Link to comment Share on other sites More sharing options...
+karri Posted November 5, 2019 Share Posted November 5, 2019 8 hours ago, jum said: Should this "fix" not be add to the standard cc65 repository: https://github.com/cc65/cc65/blob/master/libsrc/lynx/bootldr.s ??? (Just asking because this is the version of cc65 that I use). Yes it should. I will make a mental note of it to my "things to do" list. 1 Quote Link to comment Share on other sites More sharing options...
8bit-Dude Posted November 29, 2020 Share Posted November 29, 2020 On 11/5/2019 at 1:45 PM, karri said: Yes it should. I will make a mental note of it to my "things to do" list. 1 year later... ? Quote Link to comment Share on other sites More sharing options...
+karri Posted November 29, 2020 Share Posted November 29, 2020 1 hour ago, 8bit-Dude said: 1 year later... ? Actually the cause was somewhere else. Blacking out the palette was not the solution. I had to change the way I initialize the TGI. Quote Link to comment Share on other sites More sharing options...
Nop90 Posted November 29, 2020 Author Share Posted November 29, 2020 the new bootloader with the tgi_clear() after tgi_init() works fine for me. 1 Quote Link to comment Share on other sites More sharing options...
8bit-Dude Posted November 29, 2020 Share Posted November 29, 2020 3 hours ago, karri said: Actually the cause was somewhere else. Blacking out the palette was not the solution. I had to change the way I initialize the TGI. Did you commit the changes to the official CC65 head? (The head version I am using still has the Green garbage screen, which I can get rid of by using newbootldr.s) Quote Link to comment Share on other sites More sharing options...
+karri Posted November 29, 2020 Share Posted November 29, 2020 5 minutes ago, 8bit-Dude said: Did you commit the changes to the official CC65 head? (The head version I am using still has the Green garbage screen, which I can get rid of by using newbootldr.s) Most of my changes are no longer compatible with the official cc65 head. So I have not had the energy to commit my stuff there in fear of breaking things. Quote Link to comment Share on other sites More sharing options...
Igor Posted November 22, 2022 Share Posted November 22, 2022 I just tried this and for me tai_clear() freezes, but I can do this to blank out the palette and it works great: memset((void *)0xFDA0, 0, 32); // blank out the palette Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.