12 January 2019, 15:03 | #1 |
Registered User
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? |
12 January 2019, 15:17 | #2 | |
Going nowhere
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 8,986
|
Quote:
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. |
|
12 January 2019, 15:36 | #3 |
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. |
19 January 2019, 16:23 | #4 |
Registered User
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. |
19 January 2019, 16:34 | #5 |
This cat is no more
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
|
19 January 2019, 17:26 | #6 |
Registered User
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. |
29 January 2019, 03:28 | #7 |
Registered User
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 |
29 January 2019, 04:00 | #8 |
Registered User
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. |
29 January 2019, 04:05 | #9 |
Registered User
Join Date: Oct 2006
Location: USA
Posts: 1,058
|
But only in A500 mode.
|
29 January 2019, 04:15 | #10 |
Registered User
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. |
29 January 2019, 18:47 | #11 |
Registered User
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? |
30 January 2019, 23:27 | #12 |
Registered User
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. |
31 January 2019, 10:58 | #13 |
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) |
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 |
|
|