-
Notifications
You must be signed in to change notification settings - Fork 32
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
Bad polygon(s) on metal layer (#1) for Z80 sim #26
Comments
Thanks for noticing that and writing the issue. It's most likely a bug in the offline-triangulation script https://github.com/floooh/v6502r/blob/master/ext/visual6502/segdefs.py and only affects rendering, but not the actual emulator functionality. No promises yet when I get around fixing the issue. PS: thinking about it I wonder if it's a precision problem. The mesh vertex positions are stored as 16-bit integers: (https://raw.githubusercontent.com/floooh/v6502r/master/src/z80/segdefs.c) and for the more 'dense' Z80 some closeby vertex positions might be collapsed into the same 16-bit integer value... |
Thanks for your answer. I know it doesn't affect the simulation but it spoils the pretty look of your work :) |
By the way, if I compare your segdefs.c with the original Visual Z80 segdefs.js, it seems all the coordinates have been multiplied by 2
|
Yeah, I'm passing in a scale factor 2 here only for the Z80: v6502r/ext/visual6502/dump_z80.py Line 15 in 2c3dd08
Reason might be that the input data for the Z80 has x.5 values, see this comment (which is only about negative 0.5) though: v6502r/ext/visual6502/segdefs.py Lines 63 to 65 in 2c3dd08
...it looks more and more like a rounding/clamping issue though (or maybe even a 16-bit overflow issue). PS: yeah, when you look at the Z80 segdefs.js input file, there's a lot of https://raw.githubusercontent.com/floooh/v6502r/master/ext/visual6502/z80/segdefs.js ...that explains the multiplication by 2 at least. |
Thanks a lot for this investigation and detailed explanation @fghsgh! I'm not sure yet when I will return to the project and fix this issue, but a link to your Lua code would be appreciated (fwiw, I didn't spend a lot of time on the offline triangulation, it's all in a sloppily cobbled together python script (https://github.com/floooh/v6502r/blob/master/ext/visual6502/segdefs.py), so when I touch that area again I might as well rewrite the whole renderer and picking code anyway). |
There are some bad polygon points for metal layer (layer #1 in the sim) between #42 and ab0 pins (on the left) and one bad point is completely on the top left of the simulation (near the _busrq pin).
The layer is fine on the http://www.visual6502.org/JSSim/expert-z80.html page and in Z80 Explorer application.
The text was updated successfully, but these errors were encountered: