Ok, fixed some debug output, that wasn't sourcing destination register for data. Should show increasing counter now on $DFF006. Also see a flaw in the logger, that Reaper also has, where it prints the current task but likely that task wasn't it and it was inside an interrupt but it doesn't know the difference between task code and interrupt code. CIAgent also has that problem come to think of it. But it's worse when you are trying to debug an interrupt handler as the crash logger doesn't know what an interrupt is.
If it works, it can be useful to change code to use delta time, and calculate the clock ticks from there at get correct vertical timing, (the Horizontal is most likely ok, it never be precise anyway.)
(NutsAboutAmiga)
Basilisk II for AmigaOS4 AmigaInputAnywhere Excalibur and other tools and apps.
@All Build today from latest code what you have, and tried to use hippo with it : nallepuh runs fine, bring me a tasty window to choose mode/etc, in hippo have ahi setup too, but when i load an .xm to it, and hit play, it says "cannot allocate audio channels!".
I am doing something wrong or it expectd to be like this for now ?
This is how AHI works, you need configure the number of AHI mixing channels, if you have only one channel, you can not mix audio, you need 2 or more. (don’t go crazy, to many channels, and you can get glitches in the audio playback)
You might have problem configure your sound using audio/sound prefs from AEON/AmigaKIT, if so restore your old AHI prefs from a backup, or from the installation CD.
you will also not have issue if two programs use different AHI unit id’s.
(NutsAboutAmiga)
Basilisk II for AmigaOS4 AmigaInputAnywhere Excalibur and other tools and apps.
So the MED player reads $DFF007 as a byte which is funny since it's in a word. That's the horizontal counter. Not much can be optimised because it counts for it to change 80 times.
OTOH some PT routines read vertical from $DFF006 but using the same method. Counting off changes. So it looks like nothing much can be done to improve it apart from increasing both at once to compensate.
The audio.device allocation issue is likely because the audio.device defers to AHI so if NallePUH is active it takes the channels. But, PUH only allocates 4 channels, so unless the mode only had 4 channels there should be more left. The audio.device may be using exclusive mode then. Also, the AHI audio.device has a bug, as the lock command is broken if it matters.
A work around is using that mode that shares channels. Used to be on Unit 0 but I forget the details. It reduces quality though. Apart from simulating only 4 channels like Paula I never saw the point of exclusive mode. Just because you used the library interface which it bizarrely refers to as low level. Because it all gets converted to device calls anyway.
So the MED player reads $DFF007 as a byte which is funny since it's in a word
Should that result in a an expectation on the Amiga500, as it only really support EVEN addresses, not ODD must be something strange with the JIT compiler.
Edited by LiveForIt on 2022/11/17 14:05:05
(NutsAboutAmiga)
Basilisk II for AmigaOS4 AmigaInputAnywhere Excalibur and other tools and apps.
I guess position can be calculated from time from the top, to get best horizonal, vertical.
Time top Time now
DeltaTime = TimeNow - TimeTop v = DeltaTime / TimePerScanLine; h = DeltaTime % TimePerFetch;
The problem is, time between reads, and exception handler itself, might be highly inaccurate, if the calculation skips numbers, the wait time can be unpredictable. Yeh its unpredictable as it is, the fetch clock, if the time per scan line is 63 microseconds then 63 microseconds / 256 = fetch clock is 246 nanoseconds, I doubt exception handler is that fast.
And the TimeVal does not support nanoseconds, I'm not sure how to pull that off. This is why I don’t even try to keep time horizontal, only vertically.
Edited by LiveForIt on 2022/11/17 14:06:19 Edited by LiveForIt on 2022/11/17 14:07:36 Edited by LiveForIt on 2022/11/17 14:13:41 Edited by LiveForIt on 2022/11/19 14:20:35
(NutsAboutAmiga)
Basilisk II for AmigaOS4 AmigaInputAnywhere Excalibur and other tools and apps.
Should that result in a an expectation on the Amiga500, as it only really support EVEN addresses, not ODD must be something strange with the JIT compiler.
The MED code would have worked on an A500 and in that case it would have waited for less lines. The off byte is strange but on the real thing the bus could have read a word then then deposited a byte in the register. The JIT translation would be just be a byte read since I doubt it checks the address. The address would be unmapped in any case and any actual address on PPC should be byte readable.
Quote:
I guess position can be calculated from time from the top, to get best horizonal, vertical.
You could but if the interrupt is generated from vertical blank then a zero vertical position could be assumed.
Quote:
And the TimeVal does not support pico seconds, I'm not sure how to pull that off. This is why I don’t even try to keep time horizontal, only vertically.
I think any kind of accurate timing is too complicated. It's only used to delay code for DMA wait until the DMA sets in for Paula playback so it can set the sample loop. With AHI this isn't needed as it goes through the driver. Any loop can be set immediately after. PUH already checks for this. A length of 1 with DMA started is an implicit one shot, otherwise a loop.
It really just checks the screen counter and counts down when there is a change. On modern hardware it's redundant. There may be DMA wait code that checks actual position but in common MED and PT code it doesn't check and just looks for changes.
Another possibility I've considered is checking the name of the interrupt routine and substituting with a native AHI player. Since typical names for PT and MED can be used. Of course it needs to patch 68K AddIntServer(), with yet another patch, but would be more efficient than emulating 68K code setting off an MMU trap 80 times in a row.
Quote:
HippoPlayer can use the native medplayer.library / mem-handler found on OS4Depot.net
That's useful. Don't know why it needs mem-handler. Seems hacky to rely on that.
Quote:
it started, and can load images, (with a few glitches.)
Another possibility I've considered is checking the name of the interrupt routine and substituting with a native AHI player. Since typical names for PT and MED can be used. Of course it needs to patch 68K AddIntServer(), with yet another patch, but would be more efficient than emulating 68K code setting off an MMU trap 80 times in a row.
Yeh, true. but Hippo Player is open source, why write a patch when you can fix the player. or report a problem its under active development. (However, I’m not sure changes that might make work less good on a Classic Amiga will be accepted.)
Different timing implementation can be useful, one timing implementation might work on one 680x0 routine, but fail on another. The one I written work on lot Protracker modules, but does fail on some too.
Quote:
Does DPaint play sounds?
I guess it pecks and pokes for timing, and it does use blitter, don’t remember if it uses any sound.
Edited by LiveForIt on 2022/11/20 21:24:34
(NutsAboutAmiga)
Basilisk II for AmigaOS4 AmigaInputAnywhere Excalibur and other tools and apps.
Still experimenting a bit, trying now the new version 0.5 with HippoPlayer
- i opened NallePUH and set my audio mode - press Activate - then now opened HyppoPrefs and set the same audio mode - in HyppoPlayer trying launching a MP3 ---> "AHI device error" from HyppoPlayer
- Now press Disactivate in NallePUH, retry to launch the MP3 ---> now works... ?
Diactivate AHI in hippoplayer to use Paula players!
Quote:
then now opened HyppoPrefs and set the same audio mode
This is most likely why you get a conflict, plase use a different mode, thats more likely to work.
If you must use the same mode, then plase configure AHI prefs correct, first. as the error says you need more mixing channels.
Are you having problem configuring audio? That’s most likely due to Enhancer. When I say use AHI prefs I mean use AHI prefs, you find it on a Backup or the install cd.
(NutsAboutAmiga)
Basilisk II for AmigaOS4 AmigaInputAnywhere Excalibur and other tools and apps.