public override PatternTable LoadBgPatternTable_ChrUsage(bool linear, int bankIndex) { var oBgPatterns = MMC3PatternOffsets.GetChrBank(bankIndex); PatternTable pt = new PatternTable(linear); try { pt.BeginWrite(); pt.LoadTiles(Level.Rom.data, oBgPatterns, 0, 0x100); return(pt); } finally { pt.EndWrite(); } }
public override PatternTable LoadSpritePatternsTable(bool linear) { var oSpritePatterns = EnhancedPatternOffsets.GetSprBank(Level.Index); PatternTable pt = new PatternTable(linear); try { pt.BeginWrite(); pt.LoadTiles(Level.Rom.data, oSpritePatterns, 0, 0x100); return(pt); } finally { pt.EndWrite(); } }
private PatternTable LoadBgPatternTable_ChrAnimation(bool linear, ChrAnimationTable anim) { //PatternTable pt = new PatternTable(linear); var frame = anim.Frames[0]; var bank0Offset = Level.Rom.Format.ChrRomOffset + Mmc3.ChrBankSize * frame.Bank0; var bank1Offset = Level.Rom.Format.ChrRomOffset + Mmc3.ChrBankSize * frame.Bank1; var bank2Offset = Level.Rom.Format.ChrRomOffset + Mmc3.ChrBankSize * frame.Bank2; var bank3Offset = Level.Rom.Format.ChrRomOffset + Mmc3.ChrBankSize * frame.Bank3; PatternTable pt = new PatternTable(linear); try { pt.BeginWrite(); pt.LoadTiles(Level.Rom.data, bank0Offset, 0x00, 0x40); pt.LoadTiles(Level.Rom.data, bank1Offset, 0x40, 0x40); pt.LoadTiles(Level.Rom.data, bank2Offset, 0x80, 0x40); pt.LoadTiles(Level.Rom.data, bank3Offset, 0xC0, 0x40); return(pt); } finally { pt.EndWrite(); } }