14 May 2016, 19:51 | #741 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
Does it lock up because of stuck interrupt? (both $b80004 and $b80008 has same bit set)
|
14 May 2016, 21:20 | #742 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,163
|
Interrupts are disabled it locks up because it tries to initialize cd drive again and again and fails.
Since psygore doesnt reply to my messages I will have to reverse engineer his cd code. Won t be the first time im doing that... Btw the version on the cd isnt functional. There is another bug also visible on winuae. But tests can be conducted with it. |
15 May 2016, 13:11 | #743 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
Can you check (with hrtmon) CD command circular buffer contents when it hangs? ($b80014 pointer, Burning Rubber uses address $130000)
130000 to 1300ff (receive) and 130200 to 1302ff (transmit) (130100 to 1301ff is subchannel which can be ignored). Make sure buffers don't contain any random garbage before cd32load runs, makes it easier to decode it. Check also all data buffers ($b80010 pointer), if they all are empty, it confirms it hangs before any data gets loaded (my guess is before or during TOC reading). Remember that Akiko always selects highest available buffer. (=$b80010 value + 15*4096) Include also Akiko register contents, matching them with emulation may help to find where exactly it hangs. |
15 May 2016, 16:31 | #744 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,163
|
Ok but that garbage thing gave me an idea.
The fact that cdbuffer is not at 1e0000 could be the clue thus explaining that aga games fail and ecs dont. Cdbuffer memory is NOT zeroed by cd32load and that could be the problem if cd routine is buggy and reads stuff before writing it. That would explain a lot. |
15 May 2016, 18:45 | #745 |
Registered User
Join Date: Jan 2010
Location: >
Posts: 2,882
|
Totally unrelated to anything you are currently talking about, but I'd thought I'd mention it because it may be related to 'something' and may help somewhere! Excuse if it doesn't.
Me and Statmat were trying to figure out why the whdload version of son son-shi worked (albeit with the odd flash loading) via the AMS compilation builder, and not via Statmats startup with AGS2, turns out the only difference was having 'doublespeed' in the startup helped it load up. Again it probably has zero todo with helping with cd32load, but I thought it strange just by the speed of the drive helped a game load and not at all on the other disc? |
15 May 2016, 18:59 | #746 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,163
|
Found what the problem was (I think): I zeroed the memory manually for Burning Rubber and it started!!
So Psygore's loader needs a zero-initialized buffer to start with. It must read some AKIKO registers values before they're set. If it's zero then no problem, if it's $CCCCCCCC or garbage then ouch!! The reason why it generally works, it's because ECS games (and Body Blows Galactic too!) use $1E0000 as buffer address, high enough to be zero. With specific AGA special buffer settings it locks up but depends on the startup. AGS has a different memory footprint compared to boot without startup... WinUAE is not affected by garbage in buffer. What's the interest in emulating this? none I think, but a million thanks Toni your talk about garbage value gave me that idea. Amigajay the doublespeed stuff is maybe related to how much time is needed by the drive to end the transfer DMA or something. Since WHDload does not handle that at all (only through the delay stuff), it can make a difference. |
15 May 2016, 21:12 | #747 | ||
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
Quote:
Quote:
|
||
15 May 2016, 21:29 | #748 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,163
|
Anyway, I'll try to burn a CD tonight to test AGA games. I'm really hopeful this time.
|
15 May 2016, 23:34 | #749 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,163
|
v0.26 final in the zone. Tested a few games, seems all right now even with AGA games.
- Burning Rubber AGA: works fine, loads fast - Chaos Engine 2 AGA locks up, I'll investigate - Jurassic Park AGA started but got "grinding", will retry - Second Samurai AGA: works fine!! |
16 May 2016, 03:32 | #750 | |
Registered User
Join Date: Aug 2012
Location: Australia
Posts: 651
|
Quote:
Awesome. |
|
16 May 2016, 14:14 | #751 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,163
|
Yes, I'm really happy about that. Chaos Engine AGA locks up even WinUAE (it used to work). So it will be easier to investigate. That's more and more the case now that all hardware differences have been workarounded.
|
16 May 2016, 16:31 | #752 |
Registered User
Join Date: May 2001
Location: ?
Posts: 19,645
|
Great work jotd and Toni!
I haven't kept up with the news, is the source of grinding detected? I wish Psygore would care a bit and give out the source/contribute to the conversation |
16 May 2016, 20:43 | #753 | |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
Quote:
I assume following code is your DMA off code? Try clearing also bit 26 (now it only clears 27). Clearing 26 aborts all pending CD transfers immediately and finally write zero to $b80020.w. (Clear possible pending CD block transfer complete interrupt). You can probably re-enable bit 26 immediately after zero write if you don't have any other way to re-set it before calling loader again. Only way to force clear $b80020.w (= abort all pending sector transfers), is to temporarily clear bit 26 of $b80024. I assume loader wanted to prefetch sectors and it returned before all transfers finished. (ROM loader does the same and it will break some games if CPU is too fast, game takes over the system, prefetch finishes, interrupt 2 triggers, game does not know what to do with it..) Code:
001F0D70 0293 f7ff ffff AND.L #$f7ffffff,(A3) |
|
17 May 2016, 23:15 | #754 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,163
|
Toni, it also fails with WinUAE I assume that's emulated then?
Edit: the code you're showing is not mine, must be RN or Psygore loader. I perform a (as you instructed) Code:
AKIKO_DMA = $B80024 AKIKO_DMA_STOP = $13ffffff ; clear bits 31, 30, 29, 27, 26 mask and.l #AKIKO_DMA_STOP,AKIKO_DMA And if a level 2 interrupts arrives because of AKIKO I test it: Code:
move.l AKIKO_INTENA,d0 and.l AKIKO_INTREQ,d0 beq.b .skipakiko ; avoid game from hanging by clearing AKIKO_INTENA if Akiko interrupt arrives move.l #0,AKIKO_INTENA @Akira: no way Psygore shares his code (whdload slaves or cdloader). I asked him several times. He only shared his NVM read/write code. I'm quite sure he successfully reverse engineered RN loader and built his on it (with some bugfixes on TOC fortunately, with partial file read, but also grinding !!!) grinding seems to happen when small files / small blocks of files are read. I have a case where it "grinds" everytime: Double Dragon 2. I'll have to be fast to dump akiko registers for Toni when it happens. So far this damn grinding bug is the last big difference between real HW and WinUAE on CD32load. Edit: I could run Double Dragon II for the first time on real HW today. Just added READDELAY=1000 (1000 beamdelays = 25/30ms), probably put space between 2 motor/lens commands (only guesswork here) and it worked without grinding!!! (maybe sheer luck, I'll run it with and without in a row to confirm) I'll add this value by default and will retest the other "grinding-prone" games (Cannon Fodder 2, Great Courts 2...) Last edited by jotd; 18 May 2016 at 08:01. |
18 May 2016, 08:46 | #755 | |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
I don't know if this is exact same but it does hang in winuae
Quote:
It is possible this actually depends on location of files on CD. If seek time is long enough, problem won't happen. |
|
18 May 2016, 11:28 | #756 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,163
|
I already perform the abort command, did not help grinding.
I don't load 2 files in a row on purpose, but the game can do that. Load file 1 and load file 2 right afterwards. Or read a small bit of the file1 and immediately read another bit (when FILECACHE is off) Small delay helps, as I guessed and as you half-confirm: it leaves time between CD accesses and fixes problems. Seek time could also explain why the grinding/lockup happened more with ISO created with mkisofs than with ISOCD (even with ROM routines, it happened that mkisofs-created CDs won't boot 2 times out of 3) Well, I'm hopeful about this. A 30ms delay won't be noticeable, specially if it prevents grinding bug / read errors (I still have "file errors" on some games which work perfectly on winuae, no grinding, just read error, I suspect/hope this is the same problem) 100% of OK games on real hardware is possible now Edit: Moktar which gave the "grinding" bug, now works (load is slow but still...) with a small delay. Good lead! Time to re-test all games where grinding occured and burn a new RUGCD for everyone. Last edited by jotd; 18 May 2016 at 19:57. |
18 May 2016, 23:24 | #757 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,163
|
Done some testing with READDELAY parameter set at 1000: no grinding in more than 1 hour testing a lot of games, a lot more games work flawlessly.
Just forgot to set READDELAY, and Super Off Road loaded and loaded and loaded... Put it back and got the title picture, then grinding F**K!! Edit: with 2000 it works! I'll stick to 2000. Check https://docs.google.com/spreadsheets...4LI/edit#gid=0 you'll see a lot of green there. most games working on WinUAE work on real HW. Some "interesting" exceptions remain, though. Last edited by jotd; 19 May 2016 at 21:42. |
19 May 2016, 09:01 | #758 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
Have you found some (almost) guaranteed "grinding" test case? I'd like to check what the laser mechanism does when it happens. My guess is that sound comes from constant seeks but I'd like to confirm it.
How to enter hrtmon? NMI only? |
19 May 2016, 14:45 | #759 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,163
|
Okay. Just run Double Dragon II with any of my RUGCD if you have downloaded one and wait till the story scrolls. 100% grinding if no READDELAY is set.
HRTMon works from "\" key. Prepare your "m $B80000" so you can recall it later. Howto: boot RUGCD with RMB down (not a good idea, I have changed to LMB now). After a while, black screen + drive on: you are in hrtmon: exit then enter DoubleDragon2 cd32load doubledragon2 data=data-pal readdelay=0 (0 is default ATM but that will work for future versions) When you get the grinding enter HRT with RMB or "\" key and recall the m $B80000 line to get akiko regs (the grinding continues during several seconds even when hrtmon is active) you can even record the grinding noise and emulate it with winuae |
20 May 2016, 17:05 | #760 | |
Registered User
Join Date: May 2001
Location: ?
Posts: 19,645
|
Quote:
Good job jotd! |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
|
|