-
Notifications
You must be signed in to change notification settings - Fork 55
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
Screen corruption on some AGA demos #11
Comments
for me this demo doesn't work. |
I've forgot about demo and let it stay running. The demo started to show after about of 30mins! |
I actually used an .adf, CPU 020, 2MB CHIP, 24MB FAST, TURBO BOTH, Floppy turbo ON. It works the best from the floppy. Another crazy bug happened when I copied it to HDD, running the demo from HDD caused it to play weird white noise at least with Kickstart 3.1.4. on Kickstart 3.1 it didn't even run for me from the HDD, but it booted ok from the floppy. |
can you give a link to floppy? pouet has only exe file. |
as for BFxxx commands: as far as i see it doesn't check the direction of shift (when offset is pointed by Dx). |
… On Tue, Jul 16, 2019, 07:55 sorgelig ***@***.***> wrote:
can you give a link to floppy? pouet has only exe file.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#11?email_source=notifications&email_token=AAH4UPUMK6OWCAFEEUK6D5LP7WZK3A5CNFSM4ID3RD62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2ATOCY#issuecomment-511784715>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAH4UPT7ST3RECUMC3SSZOLP7WZK3ANCNFSM4ID3RD6Q>
.
|
I did a quick test with 4 data registers. Negative offsets seem to work as expexted: I did some more tests and did not find a bug. Also |
Would larger values that exceed 0xff in d3 make things go weird?? |
what result will be with move.l #16,d2 ? |
btw, a800 is shifted 8 times, not 16 isn't? |
I still cannot run this demo! |
It is shifted 16 times to the left, which is what an offset of -16 should be doing. +16 should result in $00008a00 I guess. d3 is the width... so $ff would be an interesting value. I can try it later. My guess would be, that only the lowest 5 bit will be used. BTW. If an indirect memory address is used, (4,A0){-16:6} actually writes to the byte at (2,A0). |
AA -> AA00 is 8 times shifted. 16 would give AA0000. |
Can't test right now, but I think 0 times shifted would be $a8000000. Then 16 times rol produces $0000a800. (width is set to 6 not 8!). |
I can share my minimig.cfg if that could help any to get it running. |
yeah, share please |
width just cut off the least 2 bits. It doesn't affect amount of shift. 0 times shifted would be $a8000000? then i don't understand the logic... |
I guess they had memory access in mind. if shift is zero, and width is 8 it should just write a byte to the given address... which corresponds to the highest byte in the register. |
So, result equals to real HW/UAE? |
|
I've transcribed some of the code that uses BFINS, there's a few more places but this piece mostly shows up when I activate HRTMON
|
The same glitch was referenced in MIST repo rkrajnc/minimig-mist#67 . I've also found WF68k30L core for comparisent (at https://download.experiment-s.de/Configware/2K19A/rtl/vhdl.zip). |
OK... just checked... these easy cases produce the same results on real hardware (A1200 with DCE Typhoon 030@40MHz). Interestingly, with offset=0 and width=$ff, the result is $00000154. I have no idea why that is. I'll have both computers run through a couple of random numbers and compare the results. But I would guess it only fails in some special cases. |
it works, thanks! |
good luck in porting that to Minimig :) |
I got to figure out how to load frozen state under hrtmon, since I could load the demo on Mister and under FS-UAE and trace and compare. |
I didn't ask to port it, just to compare the implementation. //from WF68k30L core:
|
I just ran bfins 10000 times with random 32bit numbers on Mister and an A1200. At least when the destination is a register, the results always match. So it either only fails on rare cases or we've got a different problem. Or the problem arises only when the target is indexed indirect memory. OK, I can also check the latter. |
I don't see an easy reason for this to make a difference. Something to look into. |
As i see it only switches the access speed between ram (max) and chipset (7MHz). I also don't see a reason for such option. Probably it was a workaround against cache work as it didn't support the updates from chipset side. I would rather to make a general CPU speed option like 7MHz, 14MHz and max for better compatibility with some specific games/apps. |
I'm trying to use HRTMON to dump the memory (e.g. sa dh0:dump ) on Mister and try to load it on FS-UAE, but it looks like it just stays on the spinning galaxy screen on Mister without any fast mem. It runs just fine on FS-UAE without fast mem. The reason for trying to run without fast mem is that the hrtmon dump just dumps 2MB of chipmem; When I was loading after a reboot (e.g. la dh0:dump), it would load, but it wouldn't resume, as the PC would be in fastmem, and that part of fastmem would be zeroed out. In the meantime, I've noticed something weird in the disassembly:
Not sure what $EFE9 is, and BLE jumps into a middle of BFINS, which starts at $400C8C52. |
I was able to do 3 mem dumps (with 2MB chip mem only) on FS-UAE onto a .hdf, then I copied over the hdf to Mister SD card, and loaded the third one, that was taken when the Goraud Pulse was going on. After loading and running, the doughnut looked ok for a bit, and then it got the corrupted look. I'll try to step through and see where results change, but it might take a bit of time. |
I did notice a short flicker (like invalid sprite settings) shortly before the torus. This was absent on my A1200. Together with the fact, that the problem also exists on Vampire, I would guess, that it is unlikely to be a straight forward CPU Problem and more likely to be chipset related. And since the torus looks good when loaded differently, the problem looks more like some kind of side effect. |
I meant that the torus was already rendered on the screen when I dumped the memory, and after resuming the execution on MiSTer, it got corrupted as soon as it started moving. I'm also curious what might be causing the demo not to advance to the next parts. It was doing the same thing on Vampire (gold 3 alpha) unless I enabled the turtle mode. Though, when it runs on Vampire it shows even more glitches. |
so probably only some edge conditions cause the problem. |
I'm pretty confused now....It looks like just waiting for vertical-blank triggers the issue.
where A6 = $dff000, it breaks before the instruction, I type either "cop" or"p 2" to show the bitplaness, and all is good.... |
I'm guessing that it might be due to non-word aligned access to the custom regs... I found this in winuaechangelog.txt
It looks like the UAE peeps made an useful comment in their code. I ran that demo, and the screen looks super messy on Mister Edit: |
I've patched the Nexus7 demo to jump to a different location to wait for vertical blank, where I did word/long reads to a register and tested the bit. The same issue happened, so I'm thinking that this could be some timing glitch in the chipset or something weird is happening in vblank interrupt. |
I'm affraid i cannot help with this issue. |
Sounds good. It's a learning experience for me, since I just recently started poking around, and I can already build Minimig.rbf to test stuff. It will be plenty of fun. |
OK, looks like UAE reads both words from the custom registers when the CPU addresses an odd word. That should be doable in minimig as well. Maybe the odd word read behavior is documented in the 68020 manuals. |
it can be troublesome as reading the RAM in HDL is not like reading variable in C++ ;) P.S.: but if related only to registrers, then should be easier. |
As I mentioned earlier, I did rewwithe the loops with aligned read from $dff004 into a data register (d7), and I did btst.l d0, d7 (against the bit 8) and the screen corruption was occurring. Any idea if the $dff000 area is marked as non-cacheable? I saw that there was an alignment fix for movem, but I couldn't figure out how that is supposed to work. At some point I might try to go through the whole thing and add comments. |
The cache sits directly at the ram interface. By design, it can only cache ram access. So custom registers can't be cached. |
calling |
Sometime next week, I'll post the memory dump from HRTMon along with the instructions to reproduce the issue, so that more people would be able to test on their own either in UAE, real hardware, minimig cores or whatever that runs HRTMon. |
I've attached a mem dump from HRTmon. Initially I've made it in FS-UAE, then loaded it onto both FS-UAE and MiSTer, to compare execution. |
Fixes to the tg68k, fixes Issue #11. Goraud Pulse in Nexus7 fixed.
The #23 fixed Nexus7 and the other demo mentioned in this issue. I'm closing this. |
I was looking at Andromeda's Nexus7 AGA demo and the Goraud Pulse part has wrong colors, on MISTER, MIST, VAMPIRE (Gold3 Alpha release from lat year). On FS-UAE, it looks fine. YouTube link shows how it should look like... https://youtu.be/0Jdi3I3Ep6k?t=103
It looks like the code is using BFINS to render the doughnut. Looking at some UAE code for BFINS, I think that the BFINS implementation might be wrong in tg68.
Minimig-AGA_MiSTer/src/tg68k/TG68K_ALU.vhd
Line 500 in 64218ce
Since, I wasn't able to set up a dev env to test my theory, I was only able to corrupt the textures some more by replacing BFINS with BFCLR and switching the register for width in HRTMON.
The loop was using a couple of BFINS that are referencing data registers for offset and width
e.g.
BFINS D3,($7000,A1){D4:D2}
I'm just guessing that the line in question should be probably something along the lines of:
bf_set2 <= std_logic_vector(unsigned(bf_ext_in & OP2out) sll to_integer(unsigned(bf_loff_dir)));
The text was updated successfully, but these errors were encountered: