Welcome, Guest. Please login or register.

Author Topic: Any way to speed up OpenTTD on OS3.X?  (Read 3068 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline derringer3Topic starter

  • Sr. Member
  • ****
  • Join Date: Nov 2006
  • Posts: 368
    • Show only replies by derringer3
Any way to speed up OpenTTD on OS3.X?
« on: February 23, 2007, 11:42:40 PM »
I downloaded from aminet the recent version of openttd. (For os3.x) It seems it is an old (2004) archive, aminet just playing some retro cards. Anyway, one of my favourite game on pc was ttd, and running a patched ttd on amiga is a great fun! :-)
I'm running the warpos verion of the game, its speed almost acceptable, but if i switch a higher resolution than 640*480 the game will just became a slideshow. 10 years ago I ran the game on pc and a 486/66MHz was more than enough for it. What do i wrong?
Amiga 500: 68030@14MHz/68882@40MHz/ 5.5MB RAM/80MB HDD/Delfina FE Sound card/Kickstart 3.1/OS 3.1

Macmini 10,1 PPC 1.58GHz, 1GB Ram, 80GB HDD 5400rpm, Ati Radeon 9200/32MB, , MorphOs 3.1

PowerBook 15" PPC 1.67GHz, 2GB Ram, 250GB HDD, ATI 9700/128MB, MorphOS 3.1
 

Offline Stevo

  • Full Member
  • ***
  • Join Date: Jul 2005
  • Posts: 122
    • Show only replies by Stevo
Re: Any way to speed up OpenTTD on OS3.X?
« Reply #1 on: February 24, 2007, 01:20:04 AM »
must...resist...remark...bah, can't. Run WinUAE ;-)
\\"You proceed from a false assumption. I am a Vulcan, I have no ego to bruise\\"
 

Offline itix

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2380
    • Show only replies by itix
Re: Any way to speed up OpenTTD on OS3.X?
« Reply #2 on: February 24, 2007, 01:42:23 AM »
Make sure OpenTTD is running on 8bit screen. Other than that there is nothing to do about it.
My Amigas: A500, Mac Mini and PowerBook
 

Offline derringer3Topic starter

  • Sr. Member
  • ****
  • Join Date: Nov 2006
  • Posts: 368
    • Show only replies by derringer3
Re: Any way to speed up OpenTTD on OS3.X?
« Reply #3 on: February 24, 2007, 07:49:31 AM »
Is there a line in cfg for it?
Amiga 500: 68030@14MHz/68882@40MHz/ 5.5MB RAM/80MB HDD/Delfina FE Sound card/Kickstart 3.1/OS 3.1

Macmini 10,1 PPC 1.58GHz, 1GB Ram, 80GB HDD 5400rpm, Ati Radeon 9200/32MB, , MorphOs 3.1

PowerBook 15" PPC 1.67GHz, 2GB Ram, 250GB HDD, ATI 9700/128MB, MorphOS 3.1
 

Offline itix

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2380
    • Show only replies by itix
Re: Any way to speed up OpenTTD on OS3.X?
« Reply #4 on: February 24, 2007, 10:34:53 AM »
Nope. SDL should pick one for you when you enter fullscreen mode. Check with Scout it is really 8bit screen OpenTTD is using though 640x480 is already quite good for old Amigas.
My Amigas: A500, Mac Mini and PowerBook
 

Offline AmigaMance

  • Hero Member
  • *****
  • Join Date: Apr 2005
  • Posts: 1278
    • Show only replies by AmigaMance
Re: Any way to speed up OpenTTD on OS3.X?
« Reply #5 on: February 24, 2007, 11:15:39 AM »
SDL = Unbearably slow on classic Amigas. Even on a PPC equipped one...
A1200 PPC user.
 

Offline InTheSand

  • Hero Member
  • *****
  • Join Date: Nov 2004
  • Posts: 1766
    • Show only replies by InTheSand
    • http://www.ali.geek.nz
Re: Any way to speed up OpenTTD on OS3.X?
« Reply #6 on: February 24, 2007, 08:56:43 PM »
Heh! You should try running the 68K version!!!! It's unfortunately unplayable, even on an '060...

What we need is for someone to rewrite it in 68K assembler - after all, the original TTD and TTDx ran fine on a 486SX at 25MHz! Any volunteers?! Didn't think so!!!  :-)

OpenTTD's a great game though, can't wait until the map enhancements are made, and some of the new graphic sets that are works-in-progress for the "NewGFX" engine are looking good!

 - Ali
 

Offline derringer3Topic starter

  • Sr. Member
  • ****
  • Join Date: Nov 2006
  • Posts: 368
    • Show only replies by derringer3
Re: Any way to speed up OpenTTD on OS3.X?
« Reply #7 on: February 24, 2007, 09:18:14 PM »
I see that i must wait until os4 arrives at my miggy.
Amiga 500: 68030@14MHz/68882@40MHz/ 5.5MB RAM/80MB HDD/Delfina FE Sound card/Kickstart 3.1/OS 3.1

Macmini 10,1 PPC 1.58GHz, 1GB Ram, 80GB HDD 5400rpm, Ati Radeon 9200/32MB, , MorphOs 3.1

PowerBook 15" PPC 1.67GHz, 2GB Ram, 250GB HDD, ATI 9700/128MB, MorphOS 3.1
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: Any way to speed up OpenTTD on OS3.X?
« Reply #8 on: February 24, 2007, 09:23:35 PM »
One thing I always hated about SDL, the implementation quality varies so much.

I did some testing (admittedly some time ago now) with a WarpOS version and it causes a context switch orgy on basic things such as frame buffer flips and event handling.

There's no excuse for this, really. It's perfectly possible to code manual switches from PPC -> 68K and do all the basic OS calls 68K native (inclusive of gathering IDCMP event data into a small, shared bufffer for the PPC to act upon after returning) and then returning control to the PPC. I've written code that does this and you can get it down to one full context switch per frame and that's with PPC native event handling callbacks too.
int p; // A
 

Offline Stevo

  • Full Member
  • ***
  • Join Date: Jul 2005
  • Posts: 122
    • Show only replies by Stevo
Re: Any way to speed up OpenTTD on OS3.X?
« Reply #9 on: February 24, 2007, 09:38:46 PM »
In that case...deliver :-)
\\"You proceed from a false assumption. I am a Vulcan, I have no ego to bruise\\"
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: Any way to speed up OpenTTD on OS3.X?
« Reply #10 on: February 25, 2007, 11:07:23 AM »
If I still had a working PPC classic and a job that didn't consume all my time these days, I might look into it.

-edit-

That said, the strategy for solving problems like this is as I already said.

Never call multiple 68K native OS functions directly from the PPC in time critical sections. Always, and I mean always, write a 68K "entry" function that can then call your OS functions before returning and have the PPC call this.

The solution I used had a Context structure. This contained the Screen, ScreenBuffer and Window pointers, it also contained a small Event buffer (implemented as an array of Event structures). These Event structures contained a type field and a bunch of unions the meanings of which depended on the type. The Context structure also contains several function pointers that act as callback handlers for events.

A PPC native function "update(struct Context*)" would take a Context instance and then pass it to a 68K function via Warpos/Run68K().

This 68K function would then flip the ScreenBuffers and then process the IDCMP events from the Window's IDCMP port using a standard GetMsg() based loop. Processing these events simply involved decoding them and filling up values in the Context's Event array.

Unless you are really unlucky, you'd never fill this buffer between frames though it is an obvious design flaw that it couldn't really hold more than 64 events per frame. Any more than that would end up waiting to be processed in the next frame. However, in practise I rarely managed to get more than four of five between frames even when blitzing the mouse ;-)

Once this was completed, the 68K function would return back to the PPC.

Before completing, the PPC would then step through the events that were received, calling the Context's appropriate callback functions for each event.

The upshot of all this is that you basically got 1 full PPC->68K->PPC round switch when flipping the screen buffer and retrieving the input.
int p; // A
 

Offline itix

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2380
    • Show only replies by itix
Re: Any way to speed up OpenTTD on OS3.X?
« Reply #11 on: February 25, 2007, 05:24:54 PM »
@Karlos

Quote

Never call multiple 68K native OS functions directly from the PPC in time critical sections. Always, and I mean always, write a 68K "entry" function that can then call your OS functions before returning and have the PPC call this.


In context of SDL and SDL games it is not always easy. It is easier if you write your own stuff or doing custom port but SDL games are supposed to build out of the box...

And I think most of WarpUp porters do not understand context switching problem at all... many just recompiler 68k program for WUP and are wondering why it is slower than original...
My Amigas: A500, Mac Mini and PowerBook
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: Any way to speed up OpenTTD on OS3.X?
« Reply #12 on: February 25, 2007, 05:29:19 PM »
@Itix

Understood, but somewhere in the implementation of SDL you should be able to realise this particular type of switch-optimizing solution. The user of the SDL library doesn't necessarily need to be aware of any of this.
int p; // A