예제 #1
0
        public bool addExtraSid(c64sid s, int address)
        {
            // Check for valid address in the IO area range ($dxxx)
            if ((address & 0xf000) != 0xd000)
            {
                return(false);
            }

            int idx = (address >> 8) & 0xf;

            // Only allow second SID chip in SID area ($d400-$d7ff)
            // or IO Area ($de00-$dfff)
            if (idx < 0x4 || (idx > 0x7 && idx < 0xe))
            {
                return(false);
            }

            // Add new SID bank
            Tuple <int, Banks.ExtraSidBank> it = extraSidBanks[idx];

            if (idx != extraSidBanks.Count - 1)
            {
                Banks.ExtraSidBank extraSidBank = it.Item2;
                extraSidBank.addSID(s, address);
            }
            else
            {
                extraSidBanks.Add(new Tuple <int, Banks.ExtraSidBank>(idx, new Banks.ExtraSidBank()));
                Banks.ExtraSidBank extraSidBank = extraSidBanks[extraSidBanks.Count - 1].Item2;
                extraSidBank.resetSIDMapper(ioBank.getBank(idx));
                ioBank.setBank(idx, extraSidBank);
                extraSidBank.addSID(s, address);
            }

            return(true);
        }
예제 #2
0
 public void setBaseSid(c64sid s)
 {
     sidBank.setSID(s);
 }