New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rondo of blood missing flickering pixels in the water #165
Comments
I think I understand what that is. The Hu6260 Video Color Encoder chip has a video interface and a computer-side interface for reading-writing palette entries. But it is not exactly dual-ported memory. If the computer side accesses the VCE palette during active display, it receives priority; the display interface will display the last-successfully-fetched value, which is still held in a latch. This can create horizontal streaks, where the previous value appears to be extended beyond its normal boundary. This is basically comparable to "CRAM dots" on Sega hardware. It's a limitation of the original hardware, and is generally considered a bad side effect. I was not aware of an example that it was ever used intentionally. |
Using CRAM “intentionally”. If true, these artists really thought ahead! So it sounds like the TG16 core is optimally reading/writing compared to what original hardware did, which is why these “CRAM dots” are not appearing from the FPGA? Nevertheless, I believe the CoreGrafx2 had slight differences in hardware so I’m going to see if my DUO and white PCE exhibit the same thing. But it requires a trip back home to my parents house…. Stay tuned! |
I'm working with github.com/turboxray to see if we are able to make a test ROM to quantify this VCE/CPU conflict behavior. This may take some time. The other possibility - since your example seems to shift the whole scanline - is that there may be a raster interrupt, adjusting the X offset for one line only. This is difficult, because the next scanline is not affected, but RCR interrupts are usually a bit too slow to set up for consecutive scanlines. If this is the case, the x_offset is set immediately before being latched on that one scanline, and then reset soon afterward (to take effect on the next scanline). If this is the behaviour, then the x_offset latch point may need to be adjusted slightly. |
Glad I could contribute. Here is a video of my DUO-R showing the same behaviour. This time (not that it matters) on a consumer CRT. https://twitter.com/lnitial_d/status/1467236409513811971?s=21 |
it seems behavior on original hardware without the SSDS3 flash cart is even different from what you show in this video @TruREALigion here is my 100% save file for testing purposes, to be able to access the level directly from the title screen (Stage 5): |
It doesn't seem to be related to a raster interrupt. However, there are quite a few palette updates occurring between lines 0xE1 to 0xE3 (specific code is in bank $69, address $47E2 through $4814. This seems to be the area in question (initiated by raster counter interrupt). |
I made a change and submitted a PR. The flicker shows up in the correct position, but seems a little smaller on my PR than the real hardware; this may take some fine-tuning or better equipment for test. |
…active scan. (issue #165) (#167) When CPU accesses the palette memory during active display, the VCE is prevented from accessing the palette memory, and uses the last-latched color value. This pull request implements the behavioor, but timing may or may not be exactly like original hardware (this looks like slightly less conflict than real hardware). May need follow-up measurements and adjustment.
Reviewing against actual hardware, the effect is correct but roughly half as much as expected. I think either:
|
Here is a test build of the core, holding the latch one more cycle (at the output stage, by waiting 1 cycle after release of CE_N): |
I took videos of: The results are:
The original seems to be between 1 and 2 cycles more than the current CE hold - between c) and d) implementations - and the volatility probably results from a clock-domain-crossing effect between the 7.16MHz CPU and (what seems to be) a 5MHz video clock. I will check in the 1-additional cycle version as an improvement, but I think it can still be improved more (but may be beyond my current skill to implement). |
The version with the fix is now in the public release. In terms of how games operate (including simulating real hardware for games under development), I believe that this is now "close enough" that the core displays games as intended, and is a very good representation of real hardware (certainly better than any current software emulator). In terms of "nth-degree cycle-accuracy" on this issue, there may still be something to learn on this issue, but I would recommend closing this issue until such "nth degree accuracy" is noticeable or can be measured. |
This ticket can be closed since @dshadoff solved this. |
Interesting (minor) issue. The pirate ship stage 5 It doesn’t do the pixel flickering in the water. Videohere
The text was updated successfully, but these errors were encountered: