DotN64/DotN64.Desktop/Program.cs

42 lines
1.0 KiB
C#
Raw Normal View History

2017-08-28 08:53:48 +02:00
using System.IO;
2017-10-09 08:21:31 +02:00
namespace DotN64
2017-08-23 08:27:36 +02:00
{
2017-11-16 08:33:04 +01:00
using Diagnostics;
2017-08-23 08:27:36 +02:00
internal static class Program
{
private static void Main(string[] args)
{
2017-08-28 08:53:48 +02:00
var nintendo64 = new Nintendo64();
Huge changes (too lazy to separate). * VR4300.SystemControlUnit.StatusRegister.cs: Removed unneeded value. * VR4300.SystemControlUnit.cs: Renamed method. * VR4300.Instruction.cs: Refactored instruction contents. Now individual parts can be written to as well. It is also possible to strip an instruction to its bare opcode identifier, or even create one from a specified opcode, so this can be used as a key in a dictionary of operations. A basic ToString implementation displays the opcode of the instruction. * VR4300.OpCode.cs: * VR4300.RegImmOpCode.cs: * VR4300.SpecialOpCode.cs: Added opcodes. * VR4300.cs: Unified operations into a single dictionary thanks to the instruction refactoring. Added ops: JAL, SLTI, XORI, BLEZL, SB, LBU, SLT, BGEZL. * Debugger.Command.cs: Basic display of what the command is about. * Debugger.InstructionFormat.cs: First pass of the formatter. * Debugger.cs: Proper disassembly of instructions. Stepping also displays the contents of registers. ~Infinite~ count argument for stepping/disassembling. Refactored instruction fetch into using the CPU's SysAD bus (no need to manually access the N64's memory maps). * DotN64.csproj: * RealityCoprocessor.SignalProcessor.StatusRegister.cs: * RealityCoprocessor.DisplayProcessor.StatusRegister.cs: * RealityCoprocessor.RDRAMInterface.RDRAMConfigIndex.cs: * RealityCoprocessor.RDRAMInterface.RDRAMConfigRegister.cs: * MappingEntryExtensions.cs: Saves some typing. * BitHelper.cs: Reusable methods. * Nintendo64.cs: More memory maps. * Program.cs: Minor changes. * RealityCoprocessor.Interface.cs: * RealityCoprocessor.AudioInterface.cs: * RealityCoprocessor.VideoInterface.cs: * RealityCoprocessor.SerialInterface.cs: Simplified mapping accesses. * RealityCoprocessor.DisplayProcessor.cs: Added an actual register. Simplified mapping accesses. * RealityCoprocessor.MIPSInterface.cs: Added dummy version register read. Simplified mapping accesses. * RealityCoprocessor.PeripheralInterface.cs: Basic DMA. Simplified mapping accesses. * RealityCoprocessor.RDRAMInterface.cs: Removed constants that get set in the boot process. Added RDRAM registers. Simplified mapping accesses. * RealityCoprocessor.SignalProcessor.cs: Better types for existing registers and handle status writes. Simplified mapping accesses.
2017-12-11 15:04:53 +01:00
Debugger debugger = null;
2017-08-28 08:53:48 +02:00
for (int i = 0; i < args.Length; i++)
{
Huge changes (too lazy to separate). * VR4300.SystemControlUnit.StatusRegister.cs: Removed unneeded value. * VR4300.SystemControlUnit.cs: Renamed method. * VR4300.Instruction.cs: Refactored instruction contents. Now individual parts can be written to as well. It is also possible to strip an instruction to its bare opcode identifier, or even create one from a specified opcode, so this can be used as a key in a dictionary of operations. A basic ToString implementation displays the opcode of the instruction. * VR4300.OpCode.cs: * VR4300.RegImmOpCode.cs: * VR4300.SpecialOpCode.cs: Added opcodes. * VR4300.cs: Unified operations into a single dictionary thanks to the instruction refactoring. Added ops: JAL, SLTI, XORI, BLEZL, SB, LBU, SLT, BGEZL. * Debugger.Command.cs: Basic display of what the command is about. * Debugger.InstructionFormat.cs: First pass of the formatter. * Debugger.cs: Proper disassembly of instructions. Stepping also displays the contents of registers. ~Infinite~ count argument for stepping/disassembling. Refactored instruction fetch into using the CPU's SysAD bus (no need to manually access the N64's memory maps). * DotN64.csproj: * RealityCoprocessor.SignalProcessor.StatusRegister.cs: * RealityCoprocessor.DisplayProcessor.StatusRegister.cs: * RealityCoprocessor.RDRAMInterface.RDRAMConfigIndex.cs: * RealityCoprocessor.RDRAMInterface.RDRAMConfigRegister.cs: * MappingEntryExtensions.cs: Saves some typing. * BitHelper.cs: Reusable methods. * Nintendo64.cs: More memory maps. * Program.cs: Minor changes. * RealityCoprocessor.Interface.cs: * RealityCoprocessor.AudioInterface.cs: * RealityCoprocessor.VideoInterface.cs: * RealityCoprocessor.SerialInterface.cs: Simplified mapping accesses. * RealityCoprocessor.DisplayProcessor.cs: Added an actual register. Simplified mapping accesses. * RealityCoprocessor.MIPSInterface.cs: Added dummy version register read. Simplified mapping accesses. * RealityCoprocessor.PeripheralInterface.cs: Basic DMA. Simplified mapping accesses. * RealityCoprocessor.RDRAMInterface.cs: Removed constants that get set in the boot process. Added RDRAM registers. Simplified mapping accesses. * RealityCoprocessor.SignalProcessor.cs: Better types for existing registers and handle status writes. Simplified mapping accesses.
2017-12-11 15:04:53 +01:00
var arg = args[i];
2017-08-28 08:53:48 +02:00
switch (arg)
{
case "--pif-rom":
nintendo64.PIF.BootROM = File.ReadAllBytes(args[++i]);
break;
2017-11-16 08:33:04 +01:00
case "--debug":
case "-d":
debugger = new Debugger(nintendo64);
break;
2017-08-28 08:53:48 +02:00
default:
2017-09-03 10:33:00 +02:00
nintendo64.Cartridge = Cartridge.FromFile(new FileInfo(arg));
2017-08-28 08:53:48 +02:00
break;
}
}
2017-10-06 02:56:34 +02:00
nintendo64.PowerOn();
2017-11-16 08:33:04 +01:00
if (debugger == null)
nintendo64.Run();
else
debugger.Run(true);
2017-08-23 08:27:36 +02:00
}
}
}