-
Notifications
You must be signed in to change notification settings - Fork 31
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
MEGA65: Characters not drawn when started at negative GOTOX values #356
Comments
Errr, this seems to be a long-stalled issue here, trying to catch-up a "bit" ... Reading the issue again, at first glance it seems to me that Xemu handles position as an unsigned entity, $3f0 for Xemu is at right not at left. In any way, I think the problem indeed, that the value does not "overflow" to zero when going above $3ff. Or something like that. I'll have a look. EDIT: Maybe there will be a fundamental issue here which makes this really hard to emulate (at least within the current structure of the emulator), since xcounter in Xemu used for many structures and never can be negative ... And somehow it should be handled as negative still. But in that case almost all rendering codepath must be "decorated" by checks, significantly slowing down performance. The same problem with any render-overflow/render-underflow topic, like sprite at extreme right (and X-expanded) seen on the left: this is also impossible to do in Xemu currently at least not in a sane way ... Also, Xemu's approach of "direct rendering" into SDL texture makes it hard, as negative values would mean literally to overwrite the previous also rendered scanline. Unless, if "expensive" checks is made every single places into the rendering pipeline. |
I've tried to solve this issue several times (I always think, a "fresh start" / "fresh ideas" can help, from time to time) already but always failed. I can make the test program working as expected, but it has serious ill effects on every other things, even on the default READY. screen on BASIC65. This is very hard to handle, since in Xemu, there is no conception on negative values in this context, so the "negative" is seen as a large positive value instead and needs several hacks. Where one/some may fail to do what I thought. Probably this requires a bit deeper dive and modify how the position info is handled, everywhere in VIC-IV emulation ... |
Note to myself: new idea. Currently vic4.c uses two separated variables in rendering:
Also a bonus, that I don't need to maintain two variables which are about the same meaning and always managed together. This may also cure the problem mentioned here (mentioned by @bjotos (btoschi on MEGA65 Discord): https://discord.com/channels/719326990221574164/977076334297743360/1325574298903117824 Another thread mentioned in the above Discord message: https://discord.com/channels/719326990221574164/977076334297743360/1325569188265332777 However I should test, that my assumptions are right, and this can work as I imagine without breaking something in the emulator or compatibility with some MEGA65 software. This issue is extremely useful as it includes a dedicated test program written by @smnjameson (thanks) so I can test if a proposed fix really works. Also some TODOs:
|
I've just tried this approach locally (not committed). It's a quite big change, at the first glance the emulator seems to work normally still. However the problem hasn't been fixed at all. So I guess, it's not (or not only?) about the clamped RRB position to 10 bit problem, but some condition is wrong in the VIC4 emulation ... Probably some "if" condition when too big value if handled as "over" some limit already and not interpreted as "negative" (ie. thinking it's already done, not rendering anything, since So, it seems, this issue is still a tough one, it can't give itself up easily, even not after multiple different tries of mine to be solved. Anyway, I need further investigate for the mentioned rewrite if it has performance and/or other benefits (and if it fixes anything, even if not this issue) to worth to keep it regardless. |
OK. It seems the problem exists within the actual renderer functions which - for example in case of the mono char renderer - has a loop like this:
The problem here: if xcounter is outside of the border already, this loop never runs ( With the following ad-hoc modification only for the mono char renderer for now (what the test program uses):
We can see this: It's much better now, however that last column filed with Anyway, it seems, the drop of the Note: dropping the |
Please helpI'm looking for other software, test programs, which may not work currently in Xemu, so I can test with my tries here Also, any discussion is very much welcome here, including ideas what is that vertical line on the real hardware, or why does Of course any other idea, suggestion, comment is also welcome. Findings
|
Meanwhile: I've fixed the border painting algorithm. |
The work - so far - is in @RetroCogs test program (thanks!) seems to work nicely now: The test program: Before my modifications: After my modifications: |
FIXME: Known issue still (and who knows there is more): Shallan's VIC4tests in menu 'B' then 'E': for a while the "bar" disappears. It didn't happened with the old (but incorrect) code. |
When the VIC4 attempts to render a sequence of characters that sstarts offscreen to the left (eg gotox = $03f0), it fails to do so. It seems like if after a single char the x position is out of range it terminates rendering until another GOTOX or end of line
Xemu version : 20220831211537
Please see attached videos and test.prg
test.zip
Devkit Expected:
hardware.mp4
Xemu Actual:
xemu.mp4
The text was updated successfully, but these errors were encountered: