![]() |
![]() |
#2521 |
Alien Bleed
Join Date: Aug 2022
Location: UK
Posts: 4,516
|
|
![]() |
![]() |
#2522 | |
Registered User
Join Date: Oct 2020
Location: Bicester
Posts: 2,024
|
Quote:
|
|
![]() |
![]() |
#2523 |
Alien Bleed
Join Date: Aug 2022
Location: UK
Posts: 4,516
|
@pipper, @abu_the_monkey
I did a completely fresh checkout and rebuild of the toolchain, this time with NDK=3.2 but it seems like adtools isn't present - the build fails on finding SDI_compiler.h, which doesn't appear to be present anywhere. Did I miss a step? |
![]() |
![]() |
#2524 |
Registered User
Join Date: Jul 2017
Location: San Jose
Posts: 681
|
Did you also make the “all-sdk” target?
|
![]() |
![]() |
#2525 |
Registered User
Join Date: Oct 2020
Location: Bicester
Posts: 2,024
|
I just followed pippers instructions on page 6 or 7 of this thread, and all (bar me screwing up when installing Ubuntu and having to change permissions ,owner/user stuff) went ok.
|
![]() |
![]() |
#2526 |
Alien Bleed
Join Date: Aug 2022
Location: UK
Posts: 4,516
|
Damn. I bet I didn't.
-edit- Yep. That was it. So, the C build compiles now but I am getting a lot of warnings for the use of the __saveds__ attribute only being usable with fbaserel. Do you get the same warnings? Last edited by Karlos; 15 May 2023 at 17:34. |
![]() |
![]() |
#2527 |
Alien Bleed
Join Date: Aug 2022
Location: UK
Posts: 4,516
|
Now that this is done, I think a devmode with C target seems like a useful addition.
|
![]() |
![]() |
#2528 |
Registered User
Join Date: Jul 2017
Location: San Jose
Posts: 681
|
Yes, that’s normal. The current build is not an -fbaserel build, but it might in future. So I added __saveds where needed. This is what the compiler complains about. I could try suppressing the warning…
|
![]() |
![]() |
#2529 |
Alien Bleed
Join Date: Aug 2022
Location: UK
Posts: 4,516
|
|
![]() |
![]() |
#2530 |
Alien Bleed
Join Date: Aug 2022
Location: UK
Posts: 4,516
|
Just examined the output of the compiler for system.c and a few things caught my eye:
The code for clear keymap is basically the same loop unrolled 32-bit clr.l (a0)+ that was in the original assembler, which is reassuring to see the compiler understands this sort of code is unrollable. On the other hand, I think tuning for 030 introduces some stuff that may be bad for 060: In Sys_EvalFPS: Code:
Sys_FPSFracAvg_w = 1000 % (UWORD)avg; Sys_FPSIntAvg_w = 1000 / (UWORD)avg; Code:
move.l #1000,d2 divsl.l d0,d1:d2 move.w d1,_Sys_FPSFracAvg_w move.w d2,_Sys_FPSIntAvg_w |
![]() |
![]() |
#2531 |
Registered User
Join Date: Jul 2017
Location: San Jose
Posts: 681
|
Yeah, it’s a mixed bag. Sometimes it generates good code, sometimes you wonder why it replicates so much code to save a few jumps…
I mean, look at the code for mnu_pass1! But for the parts we replace, it should be good enough, though. Maintainability and extensibility imho outweighs the slightly larger code. You can try playing with the -m -mtune and -O settings… -Os could also be a good choice. -fomit-frame-pointer may also help a bit, freeing up a5. Maybe at some point having a dedicated 060 version makes sense. |
![]() |
![]() |
#2532 |
Alien Bleed
Join Date: Aug 2022
Location: UK
Posts: 4,516
|
Or just being wary that 32-bit int is the default and C will always widen to the largest type of an input to an operator. For example:
Code:
Sys_FPSFracAvg_w = (UWORD)1000 % (UWORD)avg; Sys_FPSIntAvg_w = (UWORD)1000 / (UWORD)avg; Code:
move.w #1000,d2 and.l #0xFFFF,d2 divu.w d0,d2 move.l d2,d1 swap d1 move.w d1,_Sys_FPSFracAvg_w move.w d2,_Sys_FPSIntAvg_w Incidentally, I always use -fomit-frame-pointer. I thought that was standard at -O3 ? Last edited by Karlos; 15 May 2023 at 18:37. |
![]() |
![]() |
#2533 |
Alien Bleed
Join Date: Aug 2022
Location: UK
Posts: 4,516
|
If you are looking for another relatively low hanging fruit to convert to C, I would suggest the whole IO subsystem for loading and saving would be good. It needs a bit of an overhaul if we want to be able to load additional custom stuff, which will be a lot easier in C.
|
![]() |
![]() |
#2534 |
J.M.D - Bedroom Musician
Join Date: Apr 2014
Location: los angeles,ca
Posts: 3,604
|
At this point given the differences are growing i think is good to give the refactor a new name, like, thinking at Doom, something like Chocolate Breed or similar?
|
![]() |
![]() |
#2535 |
Alien Bleed
Join Date: Aug 2022
Location: UK
Posts: 4,516
|
|
![]() |
![]() |
#2536 |
Registered User
Join Date: Oct 2020
Location: Bicester
Posts: 2,024
|
|
![]() |
![]() |
#2537 |
Registered User
Join Date: Oct 2020
Location: Bicester
Posts: 2,024
|
|
![]() |
![]() |
#2538 |
Alien Bleed
Join Date: Aug 2022
Location: UK
Posts: 4,516
|
I know it sounds like a lot has changed, but in reality it hasn't. The display handling is all peripheral, really. Figuratively and literally. The vast corpus of the code is the same
|
![]() |
![]() |
#2539 |
Alien Bleed
Join Date: Aug 2022
Location: UK
Posts: 4,516
|
|
![]() |
![]() |
#2540 | |
Registered User
Join Date: Oct 2020
Location: Bicester
Posts: 2,024
|
Quote:
to me its more finishing off things that weren't back in the day, so far ![]() |
|
![]() |
Currently Active Users Viewing This Thread: 4 (0 members and 4 guests) | |
Thread Tools | |
![]() |
||||
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 |
|
|