mirror of
https://github.com/Luigi30/FruitMachine-Swift.git
synced 2024-11-27 13:53:23 +00:00
34 lines
531 B
Swift
34 lines
531 B
Swift
//
|
|
// PIA.swift
|
|
// FruitMachine
|
|
//
|
|
// Created by Christopher Rohl on 7/28/17.
|
|
// Copyright © 2017 Christopher Rohl. All rights reserved.
|
|
//
|
|
|
|
import Cocoa
|
|
|
|
class PIA: NSObject {
|
|
enum PIAMode {
|
|
case DDR
|
|
case Output
|
|
}
|
|
|
|
var data: UInt8
|
|
var control: UInt8
|
|
|
|
override init() {
|
|
data = 0x00
|
|
control = 0x00
|
|
}
|
|
|
|
func getMode() -> PIAMode {
|
|
if((control & 0x04) == 0x04) {
|
|
return .Output
|
|
} else {
|
|
return .DDR
|
|
}
|
|
}
|
|
|
|
}
|