English Amiga Board


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 12 January 2019, 15:03   #1
rsn8887
Registered User
 
rsn8887's Avatar
 
Join Date: Oct 2006
Location: USA
Posts: 1,058
Question for Toni: game specific IK+ hack possible?

I know Toni mentioned in a different thread that there’s no real fix for sound fx in IK+ in non-cycle exact emulators like UAE4ALL2 Vita/Switch. I think the reason is that fixing it always breaks something else.

Theres just no way I can backport cycle-exactness into UAE4ALL2, but I really want to play IK+ with sound on it.

So I am wondering if could I put in an option “IK+ Hack: On Off”?

Then it is not so bad if the hack breaks something else, because it can be enabled only for IK+.

This reminds me of other old emulators that included game specific patches to hack games to make them work in flawed emulators.

However, Toni, do you remember an old change to UAE emulation code that would fix IK+ sound but broke other games? I remember in some old versions of Winuae IK+ sound worked even when cycle exact was off.

Another thought is if the game code on the adf file could actually be patched by somebody to make the sound fx work in less perfect emulation environments. However there’s no way I am capable of that, but maybe some Amiga asm guru like Galahad/Flt could try it?
rsn8887 is offline  
Old 12 January 2019, 15:17   #2
Galahad/FLT
Going nowhere
 
Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 8,986
Quote:
Originally Posted by rsn8887 View Post
I know Toni mentioned in a different thread that there’s no real fix for sound fx in IK+ in non-cycle exact emulators like UAE4ALL2 Vita/Switch. I think the reason is that fixing it always breaks something else.

Theres just no way I can backport cycle-exactness into UAE4ALL2, but I really want to play IK+ with sound on it.

So I am wondering if could I put in an option “IK+ Hack: On Off”?

Then it is not so bad if the hack breaks something else, because it can be enabled only for IK+.

This reminds me of other old emulators that included game specific patches to hack games to make them work in flawed emulators.

However, Toni, do you remember an old change to UAE emulation code that would fix IK+ sound but broke other games? I remember in some old versions of Winuae IK+ sound worked even when cycle exact was off.

Another thought is if the game code on the adf file could actually be patched by somebody to make the sound fx work in less perfect emulation environments. However there’s no way I am capable of that, but maybe some Amiga asm guru like Galahad/Flt could try it?
So, whats the issue with IK+?

EDIT: Is this where the samples don't play properly or not at all? Stingray fixed it for WHDLoad, DMA wait in the level 4 interrupt timed by cpu.
Galahad/FLT is offline  
Old 12 January 2019, 15:36   #3
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
I don't remember.. but it wasn't caused by CPU delay because it also happened in A500 mode. It was something to do with how audio DMA was enabled or similar.. Unfortunately "ik+" isn't working as search word..

Does Warhead sounds work normally? It was another game that did something stupid with audio hardware but it probably wasn't same problem.
Toni Wilen is offline  
Old 19 January 2019, 16:23   #4
rsn8887
Registered User
 
rsn8887's Avatar
 
Join Date: Oct 2006
Location: USA
Posts: 1,058
@Galahad: ik+ plays music but no sfx. I tested this is not fixed by latest WHDLoad patch.

@ToniWilen: the Warhead sfx play but they seem to sometimes repeat for a long time when I think they should only play once.
rsn8887 is offline  
Old 19 January 2019, 16:34   #5
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,161
WHDLoad slave has been fixed. Got to test this again. http://mantis.whdload.de/view.php?id=3644
jotd is online now  
Old 19 January 2019, 17:26   #6
rsn8887
Registered User
 
rsn8887's Avatar
 
Join Date: Oct 2006
Location: USA
Posts: 1,058
I tested the latest version WHDLoad slave version (v1.8) already.

I don't think there's any problems on real hardware, or on WinUAE. This is solely an UAE4All2 emulator problem,

Since Toni has some experience with the emulation problems regarding IK+ sfx, my goal is to see if maybe he remembers some emulation hack that he has tried before to make IK+ sfx play without cycle-exact. I remember in very old versions of WinUAE, the sfx would play in some versions. It worked in some versions, but not in others.

I just remembered another thing: In some old WinUAE version, IK+ sound only worked if the "more compatible" CPU option was NOT set... not sure if this is any useful info.

Last edited by rsn8887; 19 January 2019 at 17:40.
rsn8887 is offline  
Old 29 January 2019, 03:28   #7
rsn8887
Registered User
 
rsn8887's Avatar
 
Join Date: Oct 2006
Location: USA
Posts: 1,058
I found out something about UAE4All2 code:
If I make a change in audio.cpp and change MIN_ALLOWED_PERIOD, which is used in AUDxPER() here:
https://github.com/rsn8887/uae4all2/...audio.cpp#L672
from 16 to 4 (or 1), then the emulated Amiga resets as soon as IK+ tries to play the first in-game sound effect. Title screen and music work fine.

So I think IK+ sound fx have something to do with this.

I tested this, because I saw that in modern WinUAE, this parameter is set to 4, not 16, here:
https://github.com/tonioni/WinUAE/bl.../audio.cpp#L52
rsn8887 is offline  
Old 29 January 2019, 04:00   #8
rsn8887
Registered User
 
rsn8887's Avatar
 
Join Date: Oct 2006
Location: USA
Posts: 1,058
And if I enable the CPU speed hack "28 MHz" or "56 MHz" I sometimes hear the sound fx, but not all of them are playing. It seems like only about 1/4 of all fx are playing.

The CPU speed hack is just a simple cycle acceleration boost, e.g. for 28 MHz, emulate(cycles) advances the cycle counter by 4*cycles, and for 56 MHz it advances by 8*cycles.
rsn8887 is offline  
Old 29 January 2019, 04:05   #9
rsn8887
Registered User
 
rsn8887's Avatar
 
Join Date: Oct 2006
Location: USA
Posts: 1,058
But only in A500 mode.
rsn8887 is offline  
Old 29 January 2019, 04:15   #10
rsn8887
Registered User
 
rsn8887's Avatar
 
Join Date: Oct 2006
Location: USA
Posts: 1,058
And if I turn off music in the game via F3, the sound fx stop completely. It is as if the sound fx are somehow "triggered" by the music notes. Very strange.

All this happens only when using the floppy version in A500 mode.

When I use WHDLoad, all I ever get is some faint clicking noises instead of sound fx, regardless of cpu speed hack setting.
rsn8887 is offline  
Old 29 January 2019, 18:47   #11
rsn8887
Registered User
 
rsn8887's Avatar
 
Join Date: Oct 2006
Location: USA
Posts: 1,058
I found this comment in modern WinUAE audio.cpp
"// We are still in state=2/3 and program is going to re-enable
// DMA. Force state to zero to prevent CPU timed DMA wait
// routines in common tracker players to lose notes."

I think this should be related.

What does "usehacks()" mean?
rsn8887 is offline  
Old 30 January 2019, 23:27   #12
rsn8887
Registered User
 
rsn8887's Avatar
 
Join Date: Oct 2006
Location: USA
Posts: 1,058
I back ported the code from WinUAE where it said
"
// We are still in state=2/3 and program is going to re-enable
// DMA. Force state to zero to prevent CPU timed DMA wait
// routines in common tracker players to lose notes."
"

but it didn't make any difference to IK+ sfx. So it must be something else.
rsn8887 is offline  
Old 31 January 2019, 10:58   #13
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
That change is only needed in fastest possible CPU modes ("usehacks"). If program switches off audio DMA and then back on too quickly, previous sample keeps playing. Many programs use CPU delay here..

If it is interrupt related (There was some program that writes to AUDxDAT and assume interrupt isn't going to start immediately but only after following CPU instruction), try this:

Modify setirq() in audio.cpp to always use event2_newevent_xx(). You can also try increasing delay value (2* -> 4* for example)
Toni Wilen 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
Question for Toni: What was Marvin Marvellous interrupt fix? rsn8887 support.WinUAE 13 30 November 2018 21:17
Can anyone here hack a single load Amiga game to add a copper list please? ImmortalA1000 Amiga scene 10 19 January 2012 08:20
Fire Brigade II = game hack? andreas HOL data problems 7 19 November 2009 00:56
Giana Sisters - level 24 - very specific question Haakon support.Games 25 28 November 2006 19:59
Pairing music to a specific game. Raid27 Looking for a game name ? 12 17 January 2006 09:57

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 15:48.

Top

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