public void CheckRegs(GBLib sys) { foreach (GBLocations reg in regs.Keys) { ushort inspected_value = (ushort)sys.Inspect((int)reg, 0); ushort expectation = (ushort)regs[reg]; Assert.AreEqual(expectation, inspected_value); } }
public static void Run(String filename) { fn = filename; sys = new GBLib(); //sys.onSerialDataReady += new OnSerialDataReady(CheckResult); sys.LoadRom(filename); sys.Start(); int test_status = sys.Inspect((int)GBLocations.MEM, (ushort)0xA000); int pc = sys.Inspect((int)GBLocations.PC, 0); //while (test_status == 0x80 || sys.Inspect((int)GBLocations.PC, 0) < 0x200) while(true) { //Debug.WriteLine("PC: {0}", sys.Inspect((int)GBLocations.PC, 0)); sys.Step(); test_status = sys.Inspect((int)GBLocations.MEM, (ushort)0xA000); pc = sys.Inspect((int)GBLocations.PC, 0); Debug.WriteLine("PC: 0x{0:X}", pc); Debug.WriteLine("Test Status: 0x{0:X}", test_status); } String result = ""; int character = '\0'; for(ushort start_addr = 0xA004; character != '\0'; ++start_addr) { result += (char)character; } result += '\0'; Debug.WriteLine(result); if (test_status != 0x00) { Debug.WriteLine("Test " + fn + " Failed:"); Assert.Fail(); } else { Debug.WriteLine("Test " + fn + " Passed:"); } }
public void CheckRam(GBLib sys) { foreach (ushort loc in ram.Keys) { byte inspected_value = (byte)sys.Inspect((int)GBLocations.MEM, loc); byte expectation = (byte)ram[loc]; Assert.AreEqual(expectation, inspected_value); } }