archanox / RGBDS2CIL

Conversion of RGBDS ASM to CIL/C#
MIT License
3 stars 1 forks source link

Stub out CPU bits #157

Open archanox opened 2 months ago

archanox commented 2 months ago
public class Cpu
{
    public byte A { get; set; }

    public void LoadA(byte value)
    {
        A = value;
    }
}

// Usage
Cpu cpu = new Cpu();
cpu.LoadA(0x01);
using System;

namespace Gameboy
{
    public static class Registers
    {
        public static Span<byte> AF { get; private set; } = new byte[2];
        public static Span<byte> BC { get; private set; } = new byte[2];
        public static Span<byte> DE { get; private set; } = new byte[2];
        public static Span<byte> HL { get; private set; } = new byte[2];
        public static byte A => AF[1];
        public static byte F => AF[0];
        public static byte B => BC[1];
        public static byte C => BC[0];
        public static byte D => DE[1];
        public static byte E => DE[0];
        public static byte H => HL[1];
        public static byte L => HL[0];
        public static ushort PC { get; set; }
        public static ushort SP { get; set; }
    }
}