-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathKenbakuino.ino
54 lines (48 loc) · 1.87 KB
/
Kenbakuino.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// ==================================================================
// ==================================================================
// K E N B A K u i n o
// Mark Wilson 2011
// Software emulation of a KENBAK-1.
// Released under Creative Commons Attribution, CC BY
// (kiwimew at gmail dot com)
// Sep 2011: Initial version.
// Jan 2012: Changes to compile under v1.0 if the IDE (Arduino.h, changes to Wire)
// May 2014: Corrected control switch order in schematic,
// typos in documents (no code changes)
// Jun 2015: Changes to compile under v1.6.4 if the IDE, (#define for deprecated prog_uchar)
// Dec 2018: Corrected SDA/SCL pins, clarified that RTC is a DS1307 module/breakout (i.e. with XTAL)
// GitHub. Serial read/write memory
// May 2019: Added Auto-run program at start-up
// Added Clock consts for no RTC or RTC with no SRAM
// Jun 2019: Added system extensions to read/write EEPROM
// May 2021: Fixed right-shift sign extension and issues with multi-bit roll instructions (see CPU_LEGACY_SHIFT_ROLL)
// Sep 2022: Fixed program counter increment to happen after instruction executed (see CPU_LEGACY_PROGRAM_COUNTER)
// Nov 2024: Turn RUN LED off when HALT encountered or STOP pressed (see MCP_LEGACY_RUN_LED)
// ==================================================================
// WTF. We need to include these in the "main sketch" if we want to include them in "tabs"?
#include <Arduino.h>
#include <Wire.h>
#include "PINS.h"
#include "Config.h"
#include "Clock.h"
#include "LEDS.h"
#include "Buttons.h"
#include "CPU.h"
#include "MCP.h"
#include "Memory.h"
ExtendedCPU cpu = ExtendedCPU();
void setup()
{
Serial.begin(38400);
clock.Init();
buttons.Init();
config.Init();
leds.Init();
cpu.Init();
memory.Init();
mcp.Init();
}
void loop()
{
mcp.Loop();
}