public static void Main() { sid = new MOS6581(Pins.GPIO_PIN_D10, Pins.GPIO_PIN_D9); _usb = new UsbPort("COM4", 250000, _ProcessPacket); //Timer usbstatusreport = new Timer(new TimerCallback(_usb.SendPacket), null, 1000, 700); sid.reset(); sid.volume(15); // set volume to the maximum, 15. sid.setMode(0, SID_TRIANGLE); //set voice 0 to a ramp waveform sid.setADEnvelope(0, 0, 0); //Set voice 0's Attack and Decay envelope sid.setSREnvelope(0, 15, 0); //Set voice 0's Sustain and Release envelope sid.setFrequency(0, A[4]); sid.setVoice(0, true); //Set voice 0 to 'on'. // sid.setVoice(2, true); // sid.setVoice(3, true); while (true) { Thread.Sleep(900); _usb.SendPacket(); } }
public Motherboard(C64 c64, C64.VicType initRegion) { // note: roms need to be added on their own externally _c64 = c64; int clockNum, clockDen, mainsFrq; switch (initRegion) { case C64.VicType.PAL: clockNum = 17734475; clockDen = 18; mainsFrq = 50; break; case C64.VicType.NTSC: case C64.VicType.NTSC_OLD: clockNum = 11250000; clockDen = 11; mainsFrq = 60; break; case C64.VicType.DREAN: clockNum = 14328225; clockDen = 14; mainsFrq = 50; break; default: throw new System.Exception(); } cartPort = new CartridgePort(); cassPort = new CassettePortDevice(); cia0 = new MOS6526(clockNum, clockDen * mainsFrq); cia1 = new MOS6526(clockNum, clockDen * mainsFrq); colorRam = new Chip2114(); cpu = new MOS6510(); pla = new MOSPLA(); ram = new Chip4864(); serPort = new SerialPort(); sid = MOS6581.Create(44100, clockNum, clockDen); switch (initRegion) { case C64.VicType.NTSC: vic = MOS6567R8.Create(); break; case C64.VicType.PAL: vic = MOS6569.Create(); break; case C64.VicType.NTSC_OLD: vic = MOS6567R56A.Create(); break; case C64.VicType.DREAN: vic = MOS6572.Create(); break; } userPort = new UserPortDevice(); }
public Motherboard(C64 c64, Region initRegion) { // note: roms need to be added on their own externally _c64 = c64; cartPort = new CartridgePort(); cassPort = new CassettePort(); cia0 = new MOS6526(initRegion); cia1 = new MOS6526(initRegion); colorRam = new Chip2114(); cpu = new MOS6510(); pla = new MOSPLA(); ram = new Chip4864(); serPort = new SerialPort(); sid = MOS6581.Create(44100, initRegion); switch (initRegion) { case Region.NTSC: vic = MOS6567.Create(); break; case Region.PAL: vic = MOS6569.Create(); break; } userPort = new UserPort(); }