English Amiga Board


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 22 November 2018, 02:00   #1
rsn8887
Registered User
 
rsn8887's Avatar
 
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.
rsn8887 is offline  
Old 22 November 2018, 10:25   #2
Toni Wilen
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.
Toni Wilen is online now  
Old 22 November 2018, 18:26   #3
rsn8887
Registered User
 
rsn8887's Avatar
 
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.
rsn8887 is offline  
Old 22 November 2018, 20:01   #4
rsn8887
Registered User
 
rsn8887's Avatar
 
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...
rsn8887 is offline  
Old 22 November 2018, 20:19   #5
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,516
Quote:
Originally Posted by rsn8887 View Post
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?
I still don't do social media..

Quote:
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...
It wasn't a fix. It is either IK+ or some other game breaking unless in CE mode. (I think Warhead was one). Audio interrupt must not come too late or too early..
Toni Wilen is online now  
Old 22 November 2018, 20:39   #6
rsn8887
Registered User
 
rsn8887's Avatar
 
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.
rsn8887 is offline  
Old 24 November 2018, 21:24   #7
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,516
Quote:
Originally Posted by rsn8887 View Post
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.
Keyboard interrupt is weird but I can't see anything that would require CE.

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.
Toni Wilen is online now  
Old 25 November 2018, 21:38   #8
rsn8887
Registered User
 
rsn8887's Avatar
 
Join Date: Oct 2006
Location: USA
Posts: 1,058
Awesome, thanks! I will look into that ASAP.
rsn8887 is offline  
Old 26 November 2018, 01:07   #9
Foebane
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!
Foebane is offline  
Old 26 November 2018, 15:03   #10
Toni Wilen
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.
Toni Wilen is online now  
Old 28 November 2018, 00:58   #11
rsn8887
Registered User
 
rsn8887's Avatar
 
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.
rsn8887 is offline  
Old 28 November 2018, 13:44   #12
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,516
Quote:
Originally Posted by rsn8887 View Post
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
It still does the same but now it works like real hardware, wait for handshake pulse before sending next (buffered) character. Originally (I don't know why) it didn't bother with keyboard handshake and sent the next key code after it was read.

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
Toni Wilen is online now  
Old 30 November 2018, 20:21   #13
rsn8887
Registered User
 
rsn8887's Avatar
 
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!!!
rsn8887 is offline  
Old 30 November 2018, 21:17   #14
rsn8887
Registered User
 
rsn8887's Avatar
 
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.
rsn8887 is offline  
 


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 21:43.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.10434 seconds with 13 queries