Skip to content

Commit

Permalink
#2 Added VIC-II raster interrupt to C64
Browse files Browse the repository at this point in the history
  • Loading branch information
hagronnestad committed Oct 13, 2019
1 parent 73c6e53 commit 12d6a26
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ComputerSystems/Commodore64/C64.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,14 @@ public Task<bool> PowerOff() {
private void AddEventHandlers() {
Cia.ReadDataPortB += CiaReadDataPortB;
Cia.Interrupt += CiaInterrupt;
Vic.OnGenerateRasterLineInterrupt += Vic_OnGenerateRasterLineInterrupt;
}

private void RemoveEventHandlers() {
if (Cia != null) {
Cia.ReadDataPortB -= CiaReadDataPortB;
Cia.Interrupt -= CiaInterrupt;
Vic.OnGenerateRasterLineInterrupt -= Vic_OnGenerateRasterLineInterrupt;
}
}

Expand All @@ -109,6 +111,10 @@ private void CiaInterrupt(object sender, EventArgs e) {
Cpu.Interrupt();
}

private void Vic_OnGenerateRasterLineInterrupt(object sender, EventArgs e) {
Cpu.Interrupt();
}


public void ScanKeyboard() {
if (!KeyboardActivated) return;
Expand Down

0 comments on commit 12d6a26

Please sign in to comment.