22 November 2018, 02:00 | #1 |
Registered User
Join Date: Oct 2006
Location: USA
Posts: 1,058
|
Question for Toni: What was Marvin Marvellous interrupt fix? (solved)
Hello Toni,
I am trying to back port a fix you made over 15 years ago (!) to fix Marvin's Marvelous Adventure. This would allow me to make the game work on UAE4All2 Vita/Switch. You mentioned the fix here: http://eab.abime.net/showthread.php?t=4589 You mentioned an interrupt for the music routine was ignored, and that you fixed that. I tried the GitHub repo, but it doesn't go back quite far enough for me to do a diff. Any chance you remember what you fixed in the code? Last edited by rsn8887; 02 December 2018 at 17:15. |
22 November 2018, 10:25 | #2 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,516
|
I think it was intlev() (custom.cpp) related, check that level 6 interrupt mask uses both 0x4000 and 0x2000.
Last edited by Toni Wilen; 22 November 2018 at 17:39. |
22 November 2018, 18:26 | #3 |
Registered User
Join Date: Oct 2006
Location: USA
Posts: 1,058
|
Awesome, thanks for the hint I will check this out and see if I can back port this fix.
|
22 November 2018, 20:01 | #4 |
Registered User
Join Date: Oct 2006
Location: USA
Posts: 1,058
|
Spot on, interrupt 6 mask was using “0x2000” instead of “0x6000”. This single number change fixed it! Amazing, thanks!
Are you on Twitter so I might put a shout out to thank for your help in the next uae4all2 release tweet? While I have your attention, any chance you remember how you fixed IK+ sound fx? I think I remember the sound fix worked at some point in WinUAE even without cycle exact... |
22 November 2018, 20:19 | #5 | ||
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,516
|
Quote:
Quote:
|
||
22 November 2018, 20:39 | #6 |
Registered User
Join Date: Oct 2006
Location: USA
Posts: 1,058
|
Thanks that makes sense. I remembered that CE fixed it for good, but I thought there was some earlier fix. I don’t think I can back port CE mode into UAE4ALL2. It requires too many changes.
Do you maybe remember a fix for Celtic Legends? I get no keyboard response during initial language select screen :/ not sure it might be one of those games that require CE, too. Last edited by rsn8887; 22 November 2018 at 20:45. |
24 November 2018, 21:24 | #7 | |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,516
|
Quote:
It reads keycode, sets keyboard handshake, then polls CIAICR for another keyboard interrupt (!?), then does handshake wait (vpos check), disables handshake and exits. My guess is that it hangs in interrupt poll loop. Check if it keeps reading CIAICR in tight loop with CPU PC around $5148. (hundreds of CIAICR reads per frame) ReadCIAA() case 13. |
|
25 November 2018, 21:38 | #8 |
Registered User
Join Date: Oct 2006
Location: USA
Posts: 1,058
|
Awesome, thanks! I will look into that ASAP.
|
26 November 2018, 01:07 | #9 |
Banned
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
|
I don't blame anyone for not being on social media, I'm only "slightly" on Facebook. The whole thing will be blown to pieces by Article 13 when it's passed, anyway. Say goodbye to YouTube et al!
|
26 November 2018, 15:03 | #10 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,516
|
If it gets stuck there, it most likely is CIA related update. There shouldn't be any major updates and most changes should be relatively easy to merge.
|
28 November 2018, 00:58 | #11 |
Registered User
Join Date: Oct 2006
Location: USA
Posts: 1,058
|
Hello Toni, my method of testing is very crude: make change to source, compile, run on Switch, see if it hangs or not. Repeat.
I did a bunch of this type of debugging, focussing on READCIAA case 13 and related code. I also compared code to newer UAE versions and tried a bunch of changes, but to no avail. The code in Uae4All2 is here, note it is code from a very old UAE version (0.8.22): https://github.com/rsn8887/uae4all2/...c/cia.cpp#L487 Note the RethinkICRA() during case 13 does nothing, since ciaaicr is set to zero just before it is called. But that is similar to what happens in more modern UAE. I tried all kinds of changes there, no success. One place an interrupt on keypress is set is during a certain keyboard hack routine. It is some kind of delay with a state machine. Supposedly it was implemented to allow the user to type ahead many characters without losing any keypresses: https://github.com/rsn8887/uae4all2/...c/cia.cpp#L348 This keyboard hack is not present in more modern UAE. It was my immediate suspect. It should be noted it seems to work with all other games. As far as I understand, RethinkICRA() called during this hack should cause the interrupt 2, but only every once in a while. I have now tried to extensively debug this function, but with no success for Celtic Legends. Another funny observation: The WHDLoad quit key still works during the language select screen. Last edited by rsn8887; 28 November 2018 at 01:07. |
28 November 2018, 13:44 | #12 | |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,516
|
Quote:
EDIT: Actually, I think it may be related to resync, keyboard starts sending resync bits after longish delay if it does not get handshake quickly enough and this may be what the weird keyboard code in game is waiting. It probably isn't designed to work that way, someone probably got confused with keyboard operation.. Check and implement kblostsynccnt |
|
30 November 2018, 20:21 | #13 |
Registered User
Join Date: Oct 2006
Location: USA
Posts: 1,058
|
Thanks for the hint!
I found out something very interesting: UAE4All2 is based on (Win?)UAE 0.8.22. But in WinUAE 0.8.22, the keyboard works just fine with Celtic Legends. So it looks like the problem is one of the changes that was made by the Pandora/Android developers later. I found the Winuae 0.8.22 source code on sourceforge (thank god for that). So now I can simply compare the two sources, and hopefully find the bug!!! |
30 November 2018, 21:17 | #14 |
Registered User
Join Date: Oct 2006
Location: USA
Posts: 1,058
|
OK I fixed it! The ciaasdr_cnt handling was commented out in places and missing in others.
A src comparison with 0.8.22 R9 showed the problem clearly. Here's my commit that fixes Celtic Legends: https://github.com/rsn8887/uae4all2/...2665d6396987ad I hope it doesn't break anything else. I will test it and include the fix in a new release of UAE4All2 Vita/Switch. Thanks, Toni! Last edited by rsn8887; 01 December 2018 at 04:03. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Marvin's Marvellous Adventure | Amiga1992 | request.Music | 2 | 26 September 2013 14:53 |
Marvin's Marvellous Adventure problems | hexaae | support.WinUAE | 5 | 27 March 2008 21:59 |
Marvin's marvellous adventure AGA - which config | rsn8887 | support.Games | 9 | 25 November 2006 18:56 |
Marvin's Marvellous Adventure: Hey, now look at that! :) | andreas | Nostalgia & memories | 8 | 03 January 2003 19:56 |
Marvin's Marvellous Adventure AGA | Walker | support.Games | 13 | 17 May 2002 18:51 |
|
|