harbaum Posted June 17, 2014 Share Posted June 17, 2014 (edited) I have a weird symptom which i don't find any info on. It started with the fact that the color bar cart wouldn't run in the fpga. At one point i noticed that all images that don't work at all were 2k images while the working ones were 4k. So i simply thought i'd make a 4k image of them by appending the same 2k image two times. The result at least does something. For simplicity i thought i just use stella to make sure my new 4k image actually works. But to my surprise there's a difference. The 2k color bar cartridge from http://atariage.com/forums/topic/226582-color-bar-demo/ works perfectly in stella. But once i expand it to 4k by either copying the same image to times or by prepending 2k of 0xff the displayed color bars are different. This seems to be related to PAL/NTSC video. Why does a 2k cartridge expanded to 4k behave differently? The original 2k cart is auto detected as NTSC and displays the full NTSC color range. The 4k image when auto detected in stella displays the PAL palette. When forcing it to NTSC the full NTSC palette is being displayed but the whole display flickers. Odd ... Edited June 17, 2014 by harbaum Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted June 17, 2014 Share Posted June 17, 2014 Stella doesn't know your ROM so it tries to auto-detect the format and fails. In the game properties set to NTSC and then reload the cart (CTRL+R). That should help. Quote Link to comment Share on other sites More sharing options...
harbaum Posted June 17, 2014 Author Share Posted June 17, 2014 Yes, that's obvious that stella needs to guess something. The question is why the guessing leads to different results just because the cart size changes with identical code inside. And why even disabling the automatics leads to different results. Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted June 17, 2014 Share Posted June 17, 2014 Stella knows the original 2K ROM, so it only guesses for the 4K ROM. Quote Link to comment Share on other sites More sharing options...
harbaum Posted June 17, 2014 Author Share Posted June 17, 2014 Oh wow ... pretty unexpected. But yeah, that explains it. Such a simple little device and proper emulation needs so much magic ... Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted June 17, 2014 Share Posted June 17, 2014 (edited) But once i expand it to 4k by either copying the same image to times Don't know about this without being able to see your doubled up ROM, but by prepending 2k of 0xff the displayed color bars are different that will cause Stella to believe the ROM includes RAM. 2K cartridges only contain ROM while anything 4K or larger might contain RAM so Stella will analyze the ROM image for signs that it includes a space for RAM. The convention in ROM dumps is to fill RAM space with the same value - this bit of code from Stella is used to detect the presense of SuperChip RAM (an extra 128 bytes of RAM): // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool Cartridge::isProbablySC(const uInt8* image, uInt32 size) { // We assume a Superchip cart contains the same bytes for its entire // RAM area; obviously this test will fail if it doesn't // The RAM area will be the first 256 bytes of each 4K bank uInt32 banks = size / 4096; for(uInt32 i = 0; i < banks; ++i) { uInt8 first = image[i*4096]; for(uInt32 j = 0; j < 256; ++j) { if(image[i*4096+j] != first) return false; } } return true; }The reason that's looking at 256 bytes, and not 128, is the cartridge port does not contain a Read/Write line so extra RAM is often implemented by repurposing an address line as the Read/Write line. The repurposed address line means the RAM shows up twice, one range is used for reading while the other for writing. Edited June 17, 2014 by SpiceWare Quote Link to comment Share on other sites More sharing options...
+SvOlli Posted June 21, 2014 Share Posted June 21, 2014 The 2k cartridge is detected by Stella by it's md5sum and then started with a different settings for right difficulty switch, turning on NTSC instead of PAL mode. 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.