TROGDOR Posted September 4, 2004 Share Posted September 4, 2004 Hi All, I'm a long time reader, first time poster. I'm near completion of a 4K Atari 2600 game for the Minigame Competition. The game uses a split screen, with a star system display on the top half, and a text display on the bottom half. I'm seeing a problem while initalizing the text display, caused by the following simple code: sta WSYNC;Reset sync to posistion text sprites. lda #$00;Turn off the sprites so they don't display during sta GRP0;text initialization. sta GRP1 This code is meant to keep the 2 character sprites blank for the 6 scanlines I need to prepare the text section. My main development emulator is PCAE 2.6 for Winders. The text has always displayed fine on this emultator. However, when I run on any Stella-based emulator, the GRP settings are ignored until the text is displayed, causing GRP artifacts to display during the 6 initilization scan lines, as seen in the screenshot below. Normally, alien artifacts would be a good thing in a space game, but... I have tried several things to prevent the artifacts. The first thing I did was burn an extra scan line, with the sole intent of turing off the GRP sprites. This didn't help. I also tried moving the GRP reset to various horizontal positions during the scanline, using a series of NOPs. This also didn't help. I was able to fix the problem with an ugly hack. If I repeat the above code twice, the artifacts are removed. i.e., I WSYNC, then reset the GRPs, then WSYNC again, and again reset the GRPs. This wastes a scanline, and wastes 8 bytes of ROM. There are no HMOVES or other strange code anywhere near the execution of this reset code. All that happens before it is the looped display of the last star and cursor graphics in GRP0 and GRP1. I've checked for possible dumbness on my part, such as changing the the GRP values after this reset, but this isn't the cause, as evidenced by the fact that display looks fine in the PCAE emulator, and is fixed in Stella by the 2 pass GRP reset. I noted that the artifacts only appear on GRP1, not on GRP0. Otherwise, I'd see gray artifacts from the GRP0 star display, along with the red artifacts of the cursor display in GRP1. I also see these artifacts running Pocket VCS 1.0 under PocketPC 2003 on a Dell Axim PDA. My brother sees the artifacts running another Stella based emulator under Linux. And they appear in Z26 version 2.13 for DOS. The two screenshots below are from the same bin file, compiled from the same code. So my questions are: Is this a bug in the Stella source? Has anyone ran into this before? If yes, can you suggest a cleaner way around this issue? Are there any restrictions on when you can change the GRP contents? I didn't see anything in the documentation. I have one more unrelated question. As you've probably guessed from the screenshot, this game uses dual frame 12 character text display, similar to the text in the game Stellar Track. Is there a simple way to get a 2 frame screenshot from an emulator without having to Photoshop morph 2 images together? If anyone is curious about the game, it's a real-time space strategy simulation. I'll be posting a demo soon for feedback, prior to submitting it to the Minigame Comp. Thanks in advance for any help on this, TROGDOR "But Basketball is a peaceful planet!" Quote Link to comment Share on other sites More sharing options...
Cybergoth Posted September 4, 2004 Share Posted September 4, 2004 Hi there! Keep in mind that the text engine your are using is enabling VDEL. You should disable it after the text is drawn. Consider subscribing to [stella] to learn more... Greetings, Manuel Quote Link to comment Share on other sites More sharing options...
TROGDOR Posted September 5, 2004 Author Share Posted September 5, 2004 Thanks Cybergoth. A rookie mistake on my part. With VDEL enabled, my GRP resets are getting buffered, and the buffer passes through with the second WSYNC. I'm just surprised it didn't completely hose my star display, which is not expecting VDEL to be enabled. So the artifacts are actually the correct display, and it's PCAE that is technically displaying the image wrong by not showing the artifacts. TROGDOR Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted September 5, 2004 Share Posted September 5, 2004 So the artifacts are actually the correct display, and it's PCAE that is technically displaying the image wrong by not showing the artifacts. Never rely on PCAE when developing. It is very outdated and the emulations still has a lot of flaws. IMO z26 is still the best emulator with Stella catching up now. The emulation of PCAE is far behind those two. BTW: Are you on [stella]? Quote Link to comment Share on other sites More sharing options...
TROGDOR Posted September 5, 2004 Author Share Posted September 5, 2004 Never rely on PCAE when developing. It is very outdated and the emulations still has a lot of flaws. IMO z26 is still the best emulator with Stella catching up now. The emulation of PCAE is far behind those two. Hi Thomas, I find myself addicted to PCAE's interface. The debugger has been very helpful for catching many mistakes. Do any of the other emulators have a built in debug tool? As a noob to this forum, I'm not going to question your advice. But, until I find a comparable debug tool, I have to stick with PCAE. I haven't run into any other discrepancies so far. My goal is to have identical game play on all common emulators, with the 2600 hardware and an unmodified StarPath as the gold standard. I haven't tried the code on my Atari box yet. With VDEL enabled, my GRP resets are getting buffered, and the buffer passes through with the second WSYNC. I'm just surprised it didn't completely hose my star display, which is not expecting VDEL to be enabled. So the artifacts are actually the correct display, and it's PCAE that is technically displaying the image wrong by not showing the artifacts. I was premature with my diagnosis. It turns out that I was disabling both VDELs at the start of the display kernal. ;Set up graphics for single sprite display, instead of text display. lda #0 sta COLUBK;set background to black sta NUSIZ0;single copy sprites, thin graphics. sta VDELP0;Turn off vertical delay. sta VDELP1 So I'm still not sure why 2 WSYNCs are needed. BTW: Are you on [stella]? I just subscribed to the SourceForge stella-main list. TROGDOR Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted September 5, 2004 Share Posted September 5, 2004 You should post your code or at least the kernel code to [stella] then. Commented and timed kernel code will make it easier to help. IIRC VDELPx will switch the displayed copy of GRPx. So if the delayed copy is not set to zero before disabling VDELPx, you will see artefacts. So I suggest clearing GRPx after disabling VDELPx. Though I could be wrong here. BTW: The game looks really interesting so far. Quote Link to comment Share on other sites More sharing options...
Cybergoth Posted September 5, 2004 Share Posted September 5, 2004 Hi there! I just subscribed to the SourceForge stella-main list. Ah, almost. That was the mailing list for the Stella emulator. For the 2600 programmers mailing list [stella], please register here: http://stella.biglist.com/sub Greetings, Manuel Quote Link to comment Share on other sites More sharing options...
Bruce Tomlin Posted September 5, 2004 Share Posted September 5, 2004 http://www.biglist.com/lists/stella/archives/ Is there any reason why the Archives stop in June? Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted September 5, 2004 Share Posted September 5, 2004 Is there any reason why the Archives stop in June? I wish I would know... 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.