Exemplo n.º 1
0
 void Read_bgdata(ref BGDataRecord bgdata)
 {
     for (int i = 0; i < 8; i++)
     {
         Read_bgdata(i, ref bgdata);
     }
 }
Exemplo n.º 2
0
        void Read_bgdata(ref BGDataRecord bgdata)
        {
            for (int i = 0; i < 8; i++)
            {
                Read_bgdata(i, ref bgdata);
                runppu(1);

                if (PPUON && i == 6)
                {
                    ppu_was_on = true;
                }

                if (PPUON && i == 7)
                {
                    if (!race_2006)
                    {
                        ppur.increment_hsc();
                    }

                    if (ppur.status.cycle == 256 && !race_2006)
                    {
                        ppur.increment_vs();
                    }

                    ppu_was_on = false;
                }
            }
        }
Exemplo n.º 3
0
			void Read_bgdata(int cycle, ref BGDataRecord bgdata)
			{
				switch (cycle)
				{
					case 0:
						ppu_addr_temp = ppur.get_ntread();
						bgdata.nt = ppubus_read(ppu_addr_temp, true);
						runppu(1);
						break;
					case 1:
						runppu(1);
						break;
					case 2:
						{
							ppu_addr_temp = ppur.get_atread();
							byte at = ppubus_read(ppu_addr_temp, true);

							//modify at to get appropriate palette shift
							if ((ppur.vt & 2) != 0) at >>= 4;
							if ((ppur.ht & 2) != 0) at >>= 2;
							at &= 0x03;
							at <<= 2;
							bgdata.at = at;

							//horizontal scroll clocked at cycle 3 and then
							//vertical scroll at 251
							runppu(1);
							if (reg_2001.PPUON)
							{
								ppur.increment_hsc();
								if (ppur.status.cycle == 251)
									ppur.increment_vs();
							}
							break;
						}
					case 3:
						runppu(1);
						break;
					case 4:
						ppu_addr_temp = ppur.get_ptread(bgdata.nt);
						bgdata.pt_0 = ppubus_read(ppu_addr_temp, true);
						runppu(1);
						break;
					case 5:
						runppu(1);
						break;
					case 6:
						ppu_addr_temp |= 8;
						bgdata.pt_1 = ppubus_read(ppu_addr_temp, true);
						runppu(1);
						break;
					case 7:
						runppu(1);
						break;
				} //switch(cycle)
			}
Exemplo n.º 4
0
        void Read_bgdata(int cycle, ref BGDataRecord bgdata)
        {
            switch (cycle)
            {
            case 0:
                ppu_addr_temp = ppur.get_ntread();
                bgdata.nt     = ppubus_read(ppu_addr_temp, true, true);
                break;

            case 1:
                break;

            case 2:
            {
                ppu_addr_temp = ppur.get_atread();
                byte at = ppubus_read(ppu_addr_temp, true, true);

                //modify at to get appropriate palette shift
                if ((ppur.vt & 2) != 0)
                {
                    at >>= 4;
                }
                if ((ppur.ht & 2) != 0)
                {
                    at >>= 2;
                }
                at       &= 0x03;
                at      <<= 2;
                bgdata.at = at;
                break;
            }

            case 3:
                break;

            case 4:
                ppu_addr_temp = ppur.get_ptread(bgdata.nt);
                bgdata.pt_0   = ppubus_read(ppu_addr_temp, true, true);
                break;

            case 5:
                break;

            case 6:
                ppu_addr_temp |= 8;
                bgdata.pt_1    = ppubus_read(ppu_addr_temp, true, true);
                break;

            case 7:
                break;
            }             //switch(cycle)
        }
Exemplo n.º 5
0
        void Read_bgdata(int cycle, ref BGDataRecord bgdata)
        {
            switch (cycle)
            {
            case 0:
                ppu_addr_temp = ppur.get_ntread();
                bgdata.nt     = ppubus_read(ppu_addr_temp, true, true);
                runppu(1);
                break;

            case 1:
                runppu(1);
                break;

            case 2:
            {
                ppu_addr_temp = ppur.get_atread();
                byte at = ppubus_read(ppu_addr_temp, true, true);

                //modify at to get appropriate palette shift
                if ((ppur.vt & 2) != 0)
                {
                    at >>= 4;
                }
                if ((ppur.ht & 2) != 0)
                {
                    at >>= 2;
                }
                at       &= 0x03;
                at      <<= 2;
                bgdata.at = at;

                //horizontal scroll clocked at cycle 3 and then
                //vertical scroll at 251
                runppu(1);
                if (reg_2001.PPUON)
                {
                    ppur.increment_hsc();
                    if (ppur.status.cycle == 251)
                    {
                        ppur.increment_vs();
                    }
                }
                break;
            }

            case 3:
                runppu(1);
                break;

            case 4:
                ppu_addr_temp = ppur.get_ptread(bgdata.nt);
                bgdata.pt_0   = ppubus_read(ppu_addr_temp, true, true);
                runppu(1);
                break;

            case 5:
                runppu(1);
                break;

            case 6:
                ppu_addr_temp |= 8;
                bgdata.pt_1    = ppubus_read(ppu_addr_temp, true, true);
                runppu(1);
                break;

            case 7:
                runppu(1);
                break;
            }             //switch(cycle)
        }
Exemplo n.º 6
0
			void Read_bgdata(ref BGDataRecord bgdata)
			{
				for (int i = 0; i < 8; i++)
					Read_bgdata(i,ref bgdata);
			}