Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Moderator Dave2001's Avatar
    Join Date
    Dec 2001
    Location
    USA
    Posts
    310

    VI_SCALE registers

    Gugaman and I have spent a long time trying to fix the remenants of our resolution problem.



    I understand that the VI_X_SCALE_REG and VI_Y_SCALE_REG are both 1/scale up factor as 2.10, but these values don't appear to be all there is to scaling...

    For example, the scaling values for mario are not 1.0, 1.0 as you would expect, but rather:
    x_scale: 2.000000, y_scale: 1.000000

    ALSO, the Capcom logo screen from Megaman 64 needs to be scaled by 0.5, 0.5. However, the scaling values for this are:
    x_scale: 1.000000, y_scale: 1.000000

    How can this be possible? The y scale value for both mario and megaman is the same for both, when one needs to be scaled and the other not?

    The only explanation for that I can find is that something else has an effect on scale that we haven't found yet... Anyone have experience with this?


    • Advertising

      advertising
      EmuTalk.net
      has no influence
      on the ads that
      are displayed
        
       

  2. #2
    Moderator Hacktarux's Avatar
    Join Date
    Nov 2001
    Location
    France
    Posts
    1,174
    Dunno if you have changed this since the 0.1 release but you have to use the VI_WIDTH_REG to know the actual resolution of the n64. (Can't understand what the SCALE_REGs do exactly)

  3. #3
    Moderator Dave2001's Avatar
    Join Date
    Dec 2001
    Location
    USA
    Posts
    310
    We have looked deeply into VI_WIDTH_REG also...

    If VI_WIDTH_REG is width, what is height? 3/4*VI_WIDTH_REG?

    Anyway, all of our tests with VI_WIDTH_REG weren't very successful either, so if it is important, how does it fit in with the scale values?

  4. #4
    Moderator Hacktarux's Avatar
    Join Date
    Nov 2001
    Location
    France
    Posts
    1,174
    On a NTSC rom height is 3/4*VI_WIDTH_REG
    and on a PAL rom height is 9/11*VI_WIDTH_REG (but it has to be scaled then to fit on a PC monitor)

    I will try to look at megaman 64 to see if i understand what is your problem....

  5. #5
    Moderator StrmnNrmn's Avatar
    Join Date
    Apr 2002
    Location
    UK
    Posts
    41
    Are you using the VI_H_START_REG and VI_V_START_REG registers? This is the current code from daedalus - it seems to work pretty well for all the roms I've tested - both pal and ntsc.

    Code:
    	u32 dwScaleX = *g_GraphicsInfo.xVI_X_SCALE_REG & 0xFFF;
    	u32 dwScaleY = *g_GraphicsInfo.xVI_Y_SCALE_REG & 0xFFF;
    
    	f32 fScaleX = (float)dwScaleX / (1<<10);
    	f32 fScaleY = (float)dwScaleY / (1<<10);
    
    	u32 dwHStartReg = *g_GraphicsInfo.xVI_H_START_REG;
    	u32 dwVStartReg = *g_GraphicsInfo.xVI_V_START_REG;
    
    	u32	hstart = dwHStartReg >> 16;
    	u32	hend = dwHStartReg & 0xffff;
    	//DBGConsole_Msg( 0, "h start/end %d %d", hstart, hend );		// 128 725 - 597
    
    	u32	vstart = dwVStartReg >> 16;
    	u32	vend = dwVStartReg & 0xffff;
    	//DBGConsole_Msg( 0, "v start/end %d %d", vstart, vend );		// 56 501 - 445
    
    	mViWidth  =  (hend-hstart)    * fScaleX;
    	mViHeight = ((vend-vstart)/2) * fScaleY;			// /2 is because vertical is measured in half-lines

  6. #6
    EmuTalk Member Gugaman's Avatar
    Join Date
    Nov 2001
    Location
    Joinville - SC - Brazil
    Posts
    38
    when should we refresh it?
    at VI_Status_Changed() ?
    seems not enough...

    and... seems to me i dont need vi_width_reg to calc the X scale, but i need it to the Y scale. i think there's something missing yet
    Last edited by Gugaman; July 1st, 2002 at 00:52.

  7. #7
    Moderator StrmnNrmn's Avatar
    Join Date
    Apr 2002
    Location
    UK
    Posts
    41
    I just check it at the start of each display list - that way you're sure the scaling is correct each time. It can't change during the course of the display list executing, so there aren't any problems doing it this was as far as I can see.

  8. #8
    EmuTalk Member Gugaman's Avatar
    Join Date
    Nov 2001
    Location
    Joinville - SC - Brazil
    Posts
    38
    yeah. i was going to post exactly this...

    still some games arent working like megaman capcom logo and duke nukem zero hour menu, but now dave woke up and we'll burn our brains again

  9. #9
    Moderator Dave2001's Avatar
    Join Date
    Dec 2001
    Location
    USA
    Posts
    310
    I have gotten the following values from games:

    // DN:ZH, y 2x (2 times too large)
    // size: 320x474, real: 320x240

    // Megaman, x 2x, y 2x
    // size: 640x237, real: 1280x960

    // Goldeneye, x somewhat large, y somewhat large
    // size: 440x325, real: 440x330

    // Lode-runner, y 2x
    // size: 320x474, real: 640x480

    The first value is the mViWidth x mViHeight, and the second is (*gfx.VI_WIDTH_REG) and 0.75 * (*gfx.VI_WIDTH_REG). All are (U) games.

    The problem is... there doesn't seem to be a final equation that fits everything and comes up with a good scale value...

  10. #10
    Moderator Dave2001's Avatar
    Join Date
    Dec 2001
    Location
    USA
    Posts
    310
    Another interesting thing... I've grouped all of the games by their problem, and all the ones except the 1280x960 ones seem to be able to be scaled by the first value! But why don't aren't 1280x960 ones the same? The y on this resolution seems to be divided by two.

    // Mario, perfect
    // size: 320x237, real: 320x240


    // x 1.sthx too large, y ok
    // Mortal Kombat 4: x too large
    // size: 400x237, real: 400,300


    // x ok, y 2x too large
    // Lode-runner, y 2x
    // size: 320x474, real: 640x480

    // DN:ZH, y 2x
    // size: 320x474, real: 320x240


    // x 1.sthx too large, x 1.sthx too large
    // Goldeneye, x somewhat large, y somewhat large
    // size: 440x325, real: 440x330


    // x 2x too large, y 2x too large
    // Megaman, x 2x, y 2x
    // size: 640x237, real: 1280x960

    // Donkey Kong 64: x 2x, y 2x
    // size: 640x237 real: 1280x960

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •