50hz / 60hz

Post Reply
Xeron
Posts: 3
Joined: Sat Mar 06, 2010 8:11 pm

50hz / 60hz

Post by Xeron » Sat Mar 06, 2010 8:13 pm

Hi,

I'm writing a Wii emulator for Oric computers, using libogc and GX. The Oric lets you set 50hz or 60hz mode, and so does the Wii.

Is it possible to use the users preferred screen mode, but switch between 50 and 60hz?

Xeron
Posts: 3
Joined: Sat Mar 06, 2010 8:11 pm

Re: 50hz / 60hz

Post by Xeron » Sat Mar 06, 2010 8:48 pm

Hmm.. scratch that. If they have 480p set, there is no 50Hz 480p mode.

Also, they might have NTSC set, and not have a TV that can display PAL, for example.

So now i'm just leaving it on the preferred mode and doing this:

Code: Select all

      if( ( oric->disp.is50hz ) && ( !oric->ula.vid_is50hz ) )
      {
        // Wii video is 50hz, Oric video is 60hz
        // Emulate 6 oric frames for every 5 wii frames
        oric->disp.framecount = (oric->disp.framecount+1)%5;
        if( oric->disp.framecount == 0 ) emulate_frame( oric );
        emulate_frame( oric );
        render( oric );
      } else if( ( !oric->disp.is50hz ) && ( oric->ula.vid_is50hz ) ) {
        // Wii video is 60hz, Oric video is 50hz
        // Emulate 5 oric frames in every 6 wii frames
        oric->disp.framecount = (oric->disp.framecount+1)%6;
        if( oric->disp.framecount != 5 ) emulate_frame( oric );
        render( oric );
      } else {
        // Wii video and Oric video match
        emulate_frame( oric );
        render( oric );
      }

DRS
Posts: 11
Joined: Fri Nov 06, 2009 1:50 pm

Re: 50hz / 60hz

Post by DRS » Sat Mar 13, 2010 2:00 pm

Nice to see people answering their own questions:)

Do you also emulate a 60/50Hz display interrupt? In the days computers didn't have high precision timers yet programs could use display interupts for timing. But I'm sure you are aware of that.

Xeron
Posts: 3
Joined: Sat Mar 06, 2010 8:11 pm

Re: 50hz / 60hz

Post by Xeron » Sun Mar 14, 2010 10:21 am

Heh. Normally that would be the case, but the Oric systems rather crazily had absolutely no way to detect vsync, and it is therefore quite a challenge to do animation on it.

There is a hack that involves running a wire from the RGB video port to the tape input to allow vsync detection, which my emulator supports, but as far as i'm aware, only one piece of software was ever written that uses it (so far :).

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests