Tidy up EightBit.GameBoy namespace definition.

Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
Adrian Conlon 2019-07-28 11:50:25 +01:00
parent 0ada703504
commit 5a7a3b5019
16 changed files with 2759 additions and 2803 deletions

View File

@ -1,10 +1,8 @@
// <copyright file="AbstractColourPalette.cs" company="Adrian Conlon">
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
namespace EightBit
namespace EightBit.GameBoy
{
namespace GameBoy
{
public class AbstractColourPalette
{
private readonly uint[] colours = new uint[4];
@ -15,5 +13,4 @@ namespace EightBit
public uint Colour(int index) => this.colours[index];
}
}
}

View File

@ -1,13 +1,11 @@
// <copyright file="Bus.cs" company="Adrian Conlon">
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
namespace EightBit
namespace EightBit.GameBoy
{
using System;
using System.Collections.Generic;
namespace GameBoy
{
public abstract class Bus : EightBit.Bus
{
public const int CyclesPerSecond = 4 * 1024 * 1024;
@ -435,5 +433,4 @@ namespace EightBit
return count;
}
}
}
}

View File

@ -1,10 +1,8 @@
// <copyright file="CartridgeType.cs" company="Adrian Conlon">
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
namespace EightBit
namespace EightBit.GameBoy
{
namespace GameBoy
{
public enum CartridgeType
{
ROM = 0,
@ -12,5 +10,4 @@ namespace EightBit
ROM_MBC1_RAM = 2,
ROM_MBC1_RAM_BATTERY = 3,
}
}
}

View File

@ -1,10 +1,8 @@
// <copyright file="CharacterDefinition.cs" company="Adrian Conlon">
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
namespace EightBit
namespace EightBit.GameBoy
{
namespace GameBoy
{
public sealed class CharacterDefinition
{
private readonly Ram vram;
@ -38,5 +36,4 @@ namespace EightBit
return returned;
}
}
}
}

View File

@ -1,10 +1,8 @@
// <copyright file="ColourShades.cs" company="Adrian Conlon">
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
namespace EightBit
namespace EightBit.GameBoy
{
namespace GameBoy
{
public enum ColourShades
{
Off,
@ -12,5 +10,4 @@ namespace EightBit
Medium,
Dark,
}
}
}

View File

@ -2,10 +2,8 @@
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
namespace EightBit
namespace EightBit.GameBoy
{
namespace GameBoy
{
public enum IoRegister
{
Abbreviated, // FF00 + dd
@ -700,5 +698,4 @@ namespace EightBit
return output;
}
}
}
}

View File

@ -1,10 +1,8 @@
// <copyright file="Display.cs" company="Adrian Conlon">
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
namespace EightBit
namespace EightBit.GameBoy
{
namespace GameBoy
{
public sealed class Display
{
public static readonly int BufferWidth = 256;
@ -174,5 +172,4 @@ namespace EightBit
}
}
}
}
}

View File

@ -1,10 +1,8 @@
// <copyright file="Interrupts.cs" company="Adrian Conlon">
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
namespace EightBit
namespace EightBit.GameBoy
{
namespace GameBoy
{
// IF and IE flags
[System.Flags]
public enum Interrupts
@ -16,5 +14,4 @@ namespace EightBit
SerialTransfer = Bits.Bit3, // Serial Transfer
KeypadPressed = Bits.Bit4, // Hi-Lo transition of P10-P13
}
}
}

View File

@ -1,10 +1,8 @@
// <copyright file="IoRegisters.cs" company="Adrian Conlon">
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
namespace EightBit
namespace EightBit.GameBoy
{
namespace GameBoy
{
using System;
public sealed class IoRegisters : EightBit.Ram
@ -395,5 +393,4 @@ namespace EightBit
}
}
}
}
}

View File

@ -11,26 +11,27 @@ namespace LR35902.BlarggTest
var configuration = new Configuration();
#if DEBUG
configuration.DebugMode = true;
//configuration.DebugMode = true;
#endif
//configuration.DebugMode = true;
var computer = new Computer(configuration);
computer.Plug("blargg/cpu_instrs.gb"); // Passed
////computer.plug("blargg/01-special.gb"); // Passed
////computer.plug("blargg/02-interrupts.gb"); // Passed
////computer.plug("blargg/03-op sp,hl.gb"); // Passed
////computer.plug("blargg/04-op r,imm.gb"); // Passed
////computer.plug("blargg/05-op rp.gb"); // Passed
////computer.plug("blargg/06-ld r,r.gb"); // Passed
////computer.plug("blargg/07-jr,jp,call,ret,rst.gb"); // Passed
////computer.plug("blargg/08-misc instrs.gb"); // Passed
////computer.plug("blargg/09-op r,r.gb"); // Passed
////computer.plug("blargg/10-bit ops.gb"); // Passed
////computer.plug("blargg/11-op a,(hl).gb"); // Passed
////computer.Plug("blargg/01-special.gb"); // Passed
////computer.Plug("blargg/02-interrupts.gb"); // Passed
////computer.Plug("blargg/03-op sp,hl.gb"); // Passed
////computer.Plug("blargg/04-op r,imm.gb"); // Passed
////computer.Plug("blargg/05-op rp.gb"); // Passed
////computer.Plug("blargg/06-ld r,r.gb"); // Passed
////computer.Plug("blargg/07-jr,jp,call,ret,rst.gb"); // Passed
////computer.Plug("blargg/08-misc instrs.gb"); // Passed
////computer.Plug("blargg/09-op r,r.gb"); // Passed
////computer.Plug("blargg/10-bit ops.gb"); // Passed
////computer.Plug("blargg/11-op a,(hl).gb"); // Passed
////computer.plug("blargg/instr_timing.gb"); // Failed #255
////computer.plug("blargg/interrupt_time.gb"); // Failed
////computer.Plug("blargg/instr_timing.gb"); // Failed #255
////computer.Plug("blargg/interrupt_time.gb"); // Failed
computer.RaisePOWER();
computer.Run();

View File

@ -2,10 +2,8 @@
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
namespace EightBit
namespace EightBit.GameBoy
{
namespace GameBoy
{
using System;
public class LR35902 : IntelProcessor
@ -1134,5 +1132,4 @@ namespace EightBit
this.EI();
}
}
}
}

View File

@ -1,10 +1,8 @@
// <copyright file="LcdStatusMode.cs" company="Adrian Conlon">
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
namespace EightBit
namespace EightBit.GameBoy
{
namespace GameBoy
{
public enum LcdStatusMode
{
HBlank = 0b00,
@ -12,5 +10,4 @@ namespace EightBit
SearchingOamRam = 0b10,
TransferringDataToLcd = 0b11,
}
}
}

View File

@ -1,10 +1,8 @@
// <copyright file="LcdStatusModeEventArgs.cs" company="Adrian Conlon">
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
namespace EightBit
namespace EightBit.GameBoy
{
namespace GameBoy
{
using System;
public class LcdStatusModeEventArgs : EventArgs
@ -13,5 +11,4 @@ namespace EightBit
public LcdStatusMode LcdStatusMode { get; }
}
}
}

View File

@ -1,10 +1,8 @@
// <copyright file="LcdcControl.cs" company="Adrian Conlon">
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
namespace EightBit
namespace EightBit.GameBoy
{
namespace GameBoy
{
[System.Flags]
public enum LcdcControl
{
@ -18,5 +16,4 @@ namespace EightBit
WindowCodeAreaSelection = Bits.Bit6,
LcdEnable = Bits.Bit7,
}
}
}

View File

@ -1,10 +1,8 @@
// <copyright file="ObjectAttribute.cs" company="Adrian Conlon">
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
namespace EightBit
namespace EightBit.GameBoy
{
namespace GameBoy
{
public class ObjectAttribute
{
public ObjectAttribute()
@ -39,5 +37,4 @@ namespace EightBit
public int Palette => (this.Flags & (byte)Bits.Bit4) >> 3; // TODO: Check this!
}
}
}

View File

@ -1,10 +1,8 @@
// <copyright file="StatusBits.cs" company="Adrian Conlon">
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
namespace EightBit
namespace EightBit.GameBoy
{
namespace GameBoy
{
[System.Flags]
public enum StatusBits
{
@ -14,5 +12,4 @@ namespace EightBit
NF = Bits.Bit6,
ZF = Bits.Bit7,
}
}
}