Skip to content

Commit

Permalink
#17 Added ICartridge to C64, attach cartridge to bus on boot if loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
hagronnestad committed Apr 15, 2020
1 parent ea1ab6f commit 7021d99
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ComputerSystems/Commodore64/C64.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using static Commodore64.Vic.VicIi;
using Commodore64.Vic;
using Commodore64.Cia;
using Commodore64.Cartridge;

namespace Commodore64 {
public class C64 {
Expand All @@ -30,6 +31,7 @@ public class C64 {
public VicIi Vic { get; private set; }
public C64Bus Memory { get; private set; }
public Cpu Cpu { get; private set; }
public ICartridge Cartridge { get; set; }

public bool KeyboardActivated { get; set; } = false;

Expand All @@ -48,6 +50,8 @@ public void Initialize() {
Memory = new C64Bus(Cia, Cia2, Vic);
Cpu = new Cpu(Memory);

if (Cartridge != null) Memory.InsertCartridge(Cartridge);

AddEventHandlers();
Cpu.Reset();
}
Expand Down

0 comments on commit 7021d99

Please sign in to comment.