mirror of
https://github.com/MoleskiCoder/EightBitNet.git
synced 2024-06-02 16:41:33 +00:00
Tidy up EightBit.GameBoy namespace definition.
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
parent
0ada703504
commit
5a7a3b5019
|
@ -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];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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; }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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!
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user