English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General > Coders. Releases

 
 
Thread Tools
Old 25 May 2023, 22:57   #2661
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,119
I have the additional motivation that I want to finish something I started in 1996/97 lol
Karlos is offline  
Old 28 May 2023, 16:08   #2662
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,119
On the subject of C/asm interoperability...

There are some functions ported from asm to C that, from the C side would benefit from being easily inlined. Short functions like Sys_MarkTime() that are just wrappers for a call to ReadEClock() for example. Inlining these in C is easy (just declare them in the headers as inline) but we'd need to absolutely ensure that a callable version is emitted to allow it to be called from the assembler side still.

Is there a way to guarantee that the compiler will generate an externally callable version of a function that is inlined everywhere else in the C code? The only solution that sprang to mind without going into compiler specifics would be to rename the inline version and have the assembler callable version use it, but that feels really clunky.

Alternatively, we could just have completely separate asm versions since the C version uses an underscore at the start of the symbol name anyway and just keep them separate. Inline C version and the assembler cod calls it's own (original) version. More stuff to maintain though.

Last edited by Karlos; 28 May 2023 at 16:21.
Karlos is offline  
Old 28 May 2023, 21:13   #2663
paraj
Registered User
 
paraj's Avatar
 
Join Date: Feb 2017
Location: Denmark
Posts: 1,098
You can use the esoteric "extern inline" feature (https://en.cppreference.com/w/c/language/inline), but probably nicer to just have few facade functions in C that ASM code can call to deal with register conventions as necessary. I.e.
Code:
// In a header
inline ULONG Sys_MarkTime(struct EClockVal* dest)
{
    return ReadEClock(dest);
}


// In A C file
ULONG Sys_MarkTime_ASM(REG(a0, struct EClockVal* dest))
{
    return Sys_MarkTime(dest);
}
A bit of extra work in this case, but keeps register stuff out of the C code, which will make your PPC port easier
paraj is offline  
Old 28 May 2023, 21:16   #2664
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,119
Quote:
Originally Posted by paraj View Post
You can use the esoteric "extern inline" feature (https://en.cppreference.com/w/c/language/inline), but probably nicer to just have few facade functions in C that ASM code can call to deal with register conventions as necessary. I.e.
Code:
// In a header
inline ULONG Sys_MarkTime(struct EClockVal* dest)
{
    return ReadEClock(dest);
}


// In A C file
ULONG Sys_MarkTime_ASM(REG(a0, struct EClockVal* dest))
{
    return Sys_MarkTime(dest);
}
A bit of extra work in this case, but keeps register stuff out of the C code, which will make your PPC port easier
Pfft. Don't get me started. There's no desire to port it to PowerPC here. I'm not opposed but a system friendly 68K binary that works with RTG/AHI and doesn't bang any hardware directly is already suited for OS4/MOS.
Karlos is offline  
Old 29 May 2023, 13:05   #2665
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,119
@pipper & @abu

Now that we have RTG and 50Hz can no longer be considered the standard for timing, I am thinking we should use a more consistent timing mechanism. For example, I stead of updating animations every game frame (or multiples thereof), we should probably define a standard animation rate that's independent of the frame rate.

I am thinking we can use the timer we added to measure the elapsed time between frames and use that to update a basic counter for the animation frame number when the elapsed time has exceeded a given interval. This way, when the frame rate is high, the animations will run at an approximately constant rate of our choosing (based on that interval) but on slower machines, the increment rate will approach once per frame, thus ensuring the animation doesn't become jerky.
Karlos is offline  
Old 29 May 2023, 16:36   #2666
samo79
Registered User
 
samo79's Avatar
 
Join Date: Nov 2018
Location: Italy
Posts: 158
@Karlos

In end it may be less work to get it working by compiling the game directly on PPC for OS4/MOS than to adapt the current 68k RTG version to fully work on NG systems :-)
samo79 is offline  
Old 29 May 2023, 16:55   #2667
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,119
Quote:
Originally Posted by samo79 View Post
@Karlos

In end it may be less work to get it working by compiling the game directly on PPC for OS4/MOS than to adapt the current 68k RTG version to fully work on NG systems :-)
How do you come to this conclusion?

System friendly 68K applications generally run fine directly on NG systems. That's one of, perhaps the the only true benefit of NG today. Absolutely every other semi modern thing they can do at all can be done more easily and for far less expenditure on any contemporary x64 or ARM hardware.

I'm not saying an NG port has no place but the target should be a migration to platform agnostic C, not to NG specifically.

For that goal, I'd say a clean room reimplementation of the engine is the correct approach. Otherwise you remain locked in by many of the limitations of the original that are difficult to unpick.
Karlos is offline  
Old 29 May 2023, 18:22   #2668
samo79
Registered User
 
samo79's Avatar
 
Join Date: Nov 2018
Location: Italy
Posts: 158
Well from direct experience I noticed that not always old games marked as 68k RTG will actually work well under OS4... maybe they work better on AmigaOS 4 for classic but not on every OS4 compatible machines.. atleast this was my experience by try certain games on my Sam440
Anyway we'll see, I'm available to try it and possibly report to you any eventual problems, you can count on me for betatest ... after all, the source is always available if someone in later future wants to port it directly to OS4 or MorphOS :-)
samo79 is offline  
Old 29 May 2023, 18:28   #2669
abu_the_monkey
Registered User
 
Join Date: Oct 2020
Location: Bicester
Posts: 1,938
Quote:
Originally Posted by Karlos View Post
@pipper & @abu

Now that we have RTG and 50Hz can no longer be considered the standard for timing, I am thinking we should use a more consistent timing mechanism. For example, I stead of updating animations every game frame (or multiples thereof), we should probably define a standard animation rate that's independent of the frame rate.

I am thinking we can use the timer we added to measure the elapsed time between frames and use that to update a basic counter for the animation frame number when the elapsed time has exceeded a given interval. This way, when the frame rate is high, the animations will run at an approximately constant rate of our choosing (based on that interval) but on slower machines, the increment rate will approach once per frame, thus ensuring the animation doesn't become jerky.
all for having better timing for animations, using elapsed time is far better than waiting on vbl and having a bunch of 'hacks' to try and achieve reasonable visuals (tried that already and it's not pretty).
abu_the_monkey is offline  
Old 29 May 2023, 18:53   #2670
pipper
Registered User
 
Join Date: Jul 2017
Location: San Jose
Posts: 652
Quote:
Originally Posted by Karlos View Post
@pipper & @abu

Now that we have RTG and 50Hz can no longer be considered the standard for timing, I am thinking we should use a more consistent timing mechanism. For example, I stead of updating animations every game frame (or multiples thereof), we should probably define a standard animation rate that's independent of the frame rate.

For now I papered over the timing issue by creating a 50Hz timer interrupt to drive the former VBlank stuff on RTG. Not ideal, but seems to work. I think once we have ported most of the game loop to C we can try rearranging things in a more framerate independent way. One thing I would like to keep is the mouse input responsiveness. I always liked how “low latency” the mouse input feels regardless how sluggish the game runs.
pipper is offline  
Old 29 May 2023, 18:55   #2671
abu_the_monkey
Registered User
 
Join Date: Oct 2020
Location: Bicester
Posts: 1,938
Quote:
I always liked how “low latency” the mouse input feels regardless how sluggish the game runs.
abu_the_monkey is offline  
Old 29 May 2023, 18:58   #2672
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,119
Quote:
Originally Posted by samo79 View Post
Well from direct experience I noticed that not always old games marked as 68k RTG will actually work well under OS4... maybe they work better on AmigaOS 4 for classic but not on every OS4 compatible machines.. atleast this was my experience by try certain games on my Sam440
Anyway we'll see, I'm available to try it and possibly report to you any eventual problems, you can count on me for betatest ... after all, the source is always available if someone in later future wants to port it directly to OS4 or MorphOS :-)
I think you are underestimating the difficulty of porting this to PPC. It's not portable code, until very recently it's 100% 68K assembler. Now it's about 2% C and that C replaces assembler code that was specifically refactored out as low hanging fruit for initialising the application and display.

In my opinion, at least, the effort involved in implementing a from scratch version in C or C++ is rather less than trying to convert from ASM to C and in doing so you can avoid lots of pitfalls and plan for new features better. When you write entire applications in assembler you generally don't need to care about things that lend themselves to maintenance and longevity. This gets reflected in the code that is written.
Karlos is offline  
Old 29 May 2023, 19:12   #2673
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,119
Quote:
Originally Posted by pipper View Post
For now I papered over the timing issue by creating a 50Hz timer interrupt to drive the former VBlank stuff on RTG. Not ideal, but seems to work. I think once we have ported most of the game loop to C we can try rearranging things in a more framerate independent way. One thing I would like to keep is the mouse input responsiveness. I always liked how “low latency” the mouse input feels regardless how sluggish the game runs.
You know, there's a lag on mouse rotation that makes the weapon move slightly after the turn that I've always found quite nice, it makes the weapon feel "weighty" like it's being hefted when you turn quickly. I suspect it's an unintended side effect of how the engine works as it's all but gone at 50fps. Assuming that it wasn't particularly intentional, I'd love to try and keep it. Also, some slight weapon movement when idle for a while would be nice, just a subtle movement like readjusting grip.
Karlos is offline  
Old 01 June 2023, 08:12   #2674
utri007
mä vaan
 
Join Date: Nov 2001
Location: Finland
Posts: 1,653
Is lattest executable available to download some where?
utri007 is offline  
Old 01 June 2023, 11:01   #2675
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,119
Quote:
Originally Posted by utri007 View Post
Is lattest executable available to download some where?
I think it's time we figured out a proper release cycle for it

In the meantime, I have attached the latest 4 executables:
  • hires - Pure 68K assembler build (AGA only, stripped)
  • hiresC - Pure 68K assembler build (AGA + RTG, stripped)
  • hires_dev - 68K assembler build with all the built-in dev stuff (AGA only, unstripped)
  • hiresC_dev - Mixed 68K assember/C build with all the built-in dev stuff (AGA + RTG, unstrippted)
Attached Files
File Type: lha ab3d2_2023-06-01.lha (1,003.7 KB, 174 views)

Last edited by Karlos; 04 June 2023 at 02:47.
Karlos is offline  
Old 01 June 2023, 11:46   #2676
StevenJGore
Amiga Fanatic
 
StevenJGore's Avatar
 
Join Date: Feb 2004
Location: North Yorkshire, UK
Age: 46
Posts: 726
Excellent, thanks for everybody's hard work on this so far!

Some early feedback running on my A1200 with Vampire V2 V1200:
- 'hires' runs fine on an AGA screen (no RTG requestor) at about 26-29FPS on the first level up to the large red door.
- 'hiresC' brings up an RTG screen requestor but then uses an AGA screen anyway. I can't get it to use an RTG screen.

Also, is there a way of cleanly quitting back to workbench, rather than having to reset every time?

And would adding the option to invert the mouse on its vertical axis be possible (if it isn't already)?

Thanks again!
StevenJGore is offline  
Old 01 June 2023, 12:13   #2677
tomcat666
Retro Freak
 
tomcat666's Avatar
 
Join Date: Nov 2001
Location: Slovenia
Age: 51
Posts: 1,647
Latest RTG (release, not dev) version running on A1200 with pistorm32 (1500 MIPS only this time, not 2400) and getting solid 52 FPS on all levels, even with the WASP (it goes to below 20 FPS on AGA version there) :

[ Show youtube player ]
tomcat666 is offline  
Old 01 June 2023, 12:46   #2678
Dunny
Registered User
 
Dunny's Avatar
 
Join Date: Aug 2006
Location: Scunthorpe/United Kingdom
Posts: 1,976
Quote:
Originally Posted by StevenJGore View Post
And would adding the option to invert the mouse on its vertical axis be possible (if it isn't already)?
Second this, for me it's unplayable without inverted mouse.
Dunny is offline  
Old 01 June 2023, 15:04   #2679
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,119
Quote:
Originally Posted by Dunny View Post
Second this, for me it's unplayable without inverted mouse.
So, the new year build that @abu_the_monkey made had this as an option, so it's definitely possible to add it back.
Karlos is offline  
Old 01 June 2023, 15:04   #2680
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,119
Quote:
Originally Posted by tomcat666 View Post
Latest RTG (release, not dev) version running on A1200 with pistorm32 (1500 MIPS only this time, not 2400) and getting solid 52 FPS on all levels, even with the WASP (it goes to below 20 FPS on AGA version there) :

[ Show youtube player ]
Only 1500MIPS? Pfft, how do you cope?
Karlos 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
Alien Breed 3D II The Killing Grounds RTG patch Angus Retrogaming General Discussion 63 14 December 2022 15:20
Alien Breed & Alien Breed '92: SE - delay when picking up items / opening doors Ian support.WinUAE 16 23 December 2016 15:50
Alien Breed 3D II : The Killing Grounds code booklet alexh support.Games 19 10 October 2012 22:17
Alien Breed 3D 2 - The Killing Grounds Ironclaw support.Games 12 13 September 2005 13:07
HD Version of Alien Breed I ? Kintaro request.Old Rare Games 20 31 July 2003 10:48

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 16:26.

Top

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