koobo / HippoPlayer

HippoPlayer - a module player for the classic Amiga
MIT License
105 stars 18 forks source link

Merge old changes from khval #13

Open samo79 opened 2 years ago

samo79 commented 2 years ago

There were some old changes implemented by khval in late 2017, beside other things some may solve certain issue at exit when running HippoPlayer under AmigaOS4

https://github.com/khval/HippoPlayer

Would be nice if you can merge that code (or atleast a usefull part) into the latest uptodate repository

koobo commented 2 years ago

I think the exit problem was that DOS library was used after it was closed, this was fixed in the main repo some time ago.

koobo commented 2 years ago

Does it work on AOS4 nowadays?

khval commented 2 years ago

Yes, last time I tried with AHI player, it did but the scope did not work. One of the changed I did, was replace the blit code to blank the scope.

khval commented 2 years ago

Maybe using identify.libray can be a idea in order to disable players that’s requires hardware banging.

koobo commented 2 years ago

Originally the scope stuff was disabled when AHI is used.

khval commented 2 years ago

Yes, I was trying or hopping to understand normal Paula play routines, to the point I can convert this to AHI, but I did get that far. I really suck at 680x0 assembler.

khval commented 2 years ago

The only thing I was really happy about was changing the build system, so I did not need to use UAE :-)

khval commented 2 years ago

I also did a lot of translation of the comments, in order try to understand the code.

koobo commented 2 years ago

A good effort for sure, it is a difficult challenge! In the post-v2.45 sources the new changes have comments in English, also some of the old comments have been translated. Additionally there is tons of debug log available.

khval commented 2 years ago

Yes, last time I tried with AHI player, it did but the scope did not work.

ons. 15. jun. 2022 kl. 22:26 skrev Kari-Pekka Koljonen < @.***>:

Does it work on AOS4 nowadays?

— Reply to this email directly, view it on GitHub https://github.com/koobo/HippoPlayer/issues/13#issuecomment-1156897721, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIDFDLC4ALU5CGY7GAHRLTVPI4BFANCNFSM5V72AY6A . You are receiving this because you are subscribed to this thread.Message ID: @.***>

koobo commented 1 year ago

In v2.56 there is a limited AHI scope support as well now. Also the scopes are able to work without blitter (if the screen buffer is detected to be non-chip memory). No idea if this actually works on AOS :-)

khval commented 1 year ago

Thanks, yes the scopes now work in AHI mode, but non-chip memory detection does not work, OS4.1 does report chip memory (just to make programs happy), it will report 50mb or something, some Vampire system might also report more chip ram then normal but believe it’s a bit less 8mb or something, so system with more then 16mb, you can assume does not have a blitter.

khval commented 1 year ago

It’s clearing of the scope that is not working.

koobo commented 1 year ago

I think a fool proof way for detecting blitter would be good, or skip direct blitter access and use BltBitmap, which probably would probably work everywhere (but slower).

khval commented 1 year ago

Yes OS method will work, I have noticed the scopes will takes a bit of CPU power, it’s not a major problem, but I think it might be running on higher refresh rate then it should.

koobo commented 1 year ago

Random thought, does AOS4 and PPC-amigas have working VBlank, that is, does graphics.library/WaitTOF() actually wait a while or is it just a no-operation?

khval commented 1 year ago

Yes, of cause it does, but it does not care if its NTSC or PAL, It's 60 FPS VBL or the same as the P96 VBL (at least on AmigaONE's). DOS / Delay() is 1/50 sec, it has something do with amiga ticks I believe.

khval commented 1 year ago

If the scopes takes more than 20ms to render on a Classic Amiga (Amiga500/1200), you get 25fps, a more powerful computer it can complete in under 20ms, its able draw it every 50 fps. (16.6 ms per frame at 60 hz)

let’s say it completes it under 16.6ms (emulation overhead), with a 0.6ms wait, VBL (99% of the time is used for rendering)

vs lets say its completed it in 21ms on Classic Amiga, and you mis the first VBL, so wait every 2en VBL, then you have 40ms at 25fps, that means only ~50% of time is used for render.

koobo commented 1 year ago

All the original scopes were designed to run at 50 FPS on the A500 using WaitTOF() sync. The reason the VBlank thing came up was that the WInUAE based AmiKit Amiga desktop had problems as it had "Hardware VBlank emulation" turned off. This caused weird things happening, for example WaitTOF() did nothing. The scopes worked but basically ran at full speed, eating all CPU cycles.