public OAMInfo(SNESGraphicsDecoder dec, ScreenInfo si, int num) { Index = num; int lowaddr = num * 4; X = dec.oam[lowaddr++]; Y = dec.oam[lowaddr++]; Name = dec.oam[lowaddr++]; Table = dec.oam[lowaddr] & 1; Palette = (dec.oam[lowaddr] >> 1) & 7; Priority = (dec.oam[lowaddr] >> 4) & 3; HFlip = ((dec.oam[lowaddr] >> 6) & 1) == 1; VFlip = ((dec.oam[lowaddr] >> 7) & 1) == 1; int highaddr = num / 4; int shift = (num % 4) * 2; int high = dec.oam[512 + highaddr]; high >>= shift; int x = high & 1; high >>= 1; Size = high & 1; X |= (x << 8); X = (X << 23) >> 23; Tile = Table * 256 + Name; Address = 32 * Tile; if (Tile < 256) { Address += si.OBJTable0Addr; } else { Address += si.OBJTable1Addr - (256 * 32); } Address &= 0xFFFF; }
public OAMInfo(SNESGraphicsDecoder dec, ScreenInfo si, int num) { Index = num; int lowaddr = num*4; X = dec.oam[lowaddr++]; Y = dec.oam[lowaddr++]; Name = dec.oam[lowaddr++]; Table = dec.oam[lowaddr] & 1; Palette = (dec.oam[lowaddr]>>1) & 7; Priority = (dec.oam[lowaddr] >> 4) & 3; HFlip = ((dec.oam[lowaddr] >> 6) & 1)==1; VFlip = ((dec.oam[lowaddr] >> 7) & 1) == 1; int highaddr = num / 4; int shift = (num % 4) * 2; int high = dec.oam[512+highaddr]; high >>= shift; int x = high & 1; high >>= 1; Size = high & 1; X |= (x << 8); X = (X << 23) >> 23; Tile = Table*256 + Name; Address = 32 * Tile; if (Tile < 256) Address += si.OBJTable0Addr; else Address += si.OBJTable1Addr - (256 * 32); Address &= 0xFFFF; }