-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathglobals.cpp
54 lines (46 loc) · 2.33 KB
/
globals.cpp
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
#include <PS2Keyboard.h>
#include <Arduino.h>
#include "boot_payloads.h"
#include "pins.h"
#include "globals.h"
// ------------------------------------------------------------------------------
//
// Constants
//
// ------------------------------------------------------------------------------
byte nvOffset = 0; // current offset from nvStorageAddr to read from or write to.
// ------------------------------------------------------------------------------
//
// Global variables
//
// ------------------------------------------------------------------------------
// General purpose variables
byte ioAddress; // I/O virtual address. Only two possible addresses are allowed (0 and 1)
byte ioData; // Data byte used for the I/O operation
byte ioOpcode = 0xFF; // I/O operation code (0xFF means "No Operation")
byte ioByteCnt; // Exchanged bytes counter during an I/O operation
byte tempByte;
byte moduleGPIO = 0; // Set to 1 if the module is found, 0 otherwise
byte bootMode = 0; // Set the payload array to boot
// (0: boot_A_[], 1: boot_C_[], 2: boot_B_[])
byte * BootImage; // Pointer to selected payload array (image) to boot
word BootImageSize; // Size of the selected payload array (image) to boot
word BootStrAddr; // Starting address of the selected payload array (image) to boot
byte Z80IntEnFlag = 0; // Z80 INT_ enable flag (0 = No INT_ used, 1 = INT_ used for I/O)
unsigned long timeStamp; // Timestamp for led blinking
char inChar; // Input char from serial
byte iCount; // Temporary variable
byte clockMode; // Z80 clock HI/LO speed selector (0 = 4MHz, 1 = 8MHz)
// CP/M support variables - NOT USED
byte autoexecFlag; // Set to 1 if AUTOEXEC must be executed at cold boot, 0 otherwise
// PS/2 keyboard interface
PS2Keyboard keyboard;
void blinkIOSled(unsigned long *timestamp)
// Blink led IOS using a timestamp
{
if ((millis() - *timestamp) > 200)
{
digitalWrite(LED_IOS,!digitalRead(LED_IOS));
*timestamp = millis();
}
}