It is currently Sat Nov 18, 2017 9:05 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 34 posts ]  Go to page Previous  1, 2, 3
Author Message
 Post subject:
PostPosted: Sat Sep 22, 2007 4:56 pm 
Offline
User avatar

Joined: Wed Nov 10, 2004 6:47 pm
Posts: 1845
NerveGas wrote:
- Rad Racer 2 has a completely mangled background


Rad Racer 2 uses 4-screen mirroring. But ROMs floating around don't mark that in the header.

Try flipping that bit in the header on and see if it works.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 22, 2007 5:01 pm 
Offline

Joined: Sun Sep 16, 2007 10:41 am
Posts: 29
nope something else is hosey.

mmc3 doesn't serve out of video ram right? that's just map 119?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 23, 2007 2:42 am 
Offline
User avatar

Joined: Thu Mar 24, 2005 3:17 pm
Posts: 355
NerveGas wrote:
nope something else is hosey.
Does Gauntlet (1) work then? If it doesn't, you've probably got a bug in your 4-screen-mirroring handling.

Quote:
mmc3 doesn't serve out of video ram right? that's just map 119?
some games, like Megaman 4.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 24, 2007 5:30 am 
Offline

Joined: Sun Sep 16, 2007 10:41 am
Posts: 29
I was wrong, it looks like four-screen mirroring was set, but the mirror "type" was set to vertical. When I force it to four-screen it works fine.

I'm very close to getting Rad Racer 2 working. There's one scanline in the middle of my screen that is orange (presumably the background) and I'm wondering where it's coming from. These are my increments below... is there anything I'm missing?


Top of scanline:

Code:
    if (S.PPU_R1 & R1_SHOW_SCR)
          S.vAddr = S.vAddr_Latch & 0x7FFF;


Between scanlines:

Code:
    /* Veritcal Increment */
    S.vAddr = (S.vAddr + 0x1000) & 0x7FFF;
    if ((S.vAddr & 0x7000) == 0)
    {
        S.vAddr = (S.vAddr & 0x7C1F) | ((S.vAddr + 0x20) & 0x3E0);
        if ((S.vAddr & 0x3E0) == 0x3C0)
            S.vAddr = ((S.vAddr & 0x7C1F) ^ 0x800);
    }

    /* Horizontal Reset: PPU 257 */
    S.vAddr = (S.vAddr & 0xFBE0) | (S.vAddr_Latch & 0x41F);


Registers:

Code:
        case 0x2006: /* VRAM Address Register */   
          if (S.PPU_Latch_Flag) {
             S.vAddr_Latch = (S.vAddr_Latch & 0xFF00) | bData;
             S.vAddr = S.vAddr_Latch;
          }       
          else { 
             S.vAddr_Latch = ((bData & 0x3F) << 8) | (S.vAddr_Latch & 0xFF);
          }   
          S.PPU_Latch_Flag ^= 1;                   
          break;     


        {
            case (0x2007): /* VRAM Read */
                if (S.vAddr <0x3F00) {
                    wScratch = S.vAddr;
                    wScratch &= 0x3FFF;
                    bScratch = S.PPU_R7;
                    S.PPU_R7 = W.PPUBANK[ wScratch >> 10 ][ wScratch & 0x3FF ];
                } else {
                    bScratch = W.PPUBANK[ wScratch >> 10 ] [ wScratch & 0x3FF ];
                }

                S.vAddr += (S.PPU_R0 & R0_INC_ADDR) ? 0x20 : 0x01;
                S.vAddr &= 0x3FFF;

                return bScratch;
                break;


        case 0x2000: /* PPU Control Register 1 Write */
          S.PPU_R0 = bData;
          S.PPU_SP_Height = (S.PPU_R0 & R0_SP_SIZE) ? 0x10 : 0x08;
          W.PPU_BG = (S.PPU_R0 & R0_BG_ADDR) ? S.ChrBuf + 0x4000 : S.ChrBuf;
          W.PPU_SP = (S.PPU_R0 & R0_SP_ADDR) ? S.ChrBuf + 0x4000 : S.ChrBuf;
          S.vAddr_Latch = (S.vAddr_Latch & 0xF3FF) | ((word) (bData & 3) << 10);
          break;


        case 0x2005: /* Scroll Register */
          lowerBits = (bData & 7);
          upperBits = (bData >> 3);

          if (S.PPU_Latch_Flag) {
             S.vAddr_Latch = (S.vAddr_Latch & 0x8C1F) | (upperBits << 5) |
                (lowerBits << 12);
          }
          else {
             S.vAddr_Latch = (S.vAddr_Latch & 0xFFE0) | upperBits;
             S.FineX = lowerBits;
          }

          S.PPU_Latch_Flag ^= 1;
          break;


        case 0x2007: /* VRAM Data */
        {
            wScratch = S.vAddr;
            wScratch &= 0x3FFF;

            S.vAddr += (S.PPU_R0 & R0_INC_ADDR) ? 0x20 : 0x01;
            if (S.vAddr > 0x3FFF)
                S.vAddr &= 0x3FFF;



[/code]


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 34 posts ]  Go to page Previous  1, 2, 3

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group