1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-03 08:51:40 +00:00

Corrected test.

This commit is contained in:
Thomas Harte 2017-07-24 22:33:49 -04:00
parent 9435c1e12a
commit df4732be2e

View File

@ -18,69 +18,56 @@ class VanillaVIA: public MOS::MOS6522<VanillaVIA> {
uint8_t port_a_value;
uint8_t port_b_value;
void set_interrupt_status(bool new_status)
{
void set_interrupt_status(bool new_status) {
irq_line = new_status;
}
uint8_t get_port_input(Port port)
{
uint8_t get_port_input(Port port) {
return port ? port_b_value : port_a_value;
}
};
@implementation MOS6522Bridge
{
@implementation MOS6522Bridge {
VanillaVIA _via;
}
- (instancetype)init
{
- (instancetype)init {
self = [super init];
if(self)
{
if(self) {
_via.bridge = self;
}
return self;
}
- (void)setValue:(uint8_t)value forRegister:(NSUInteger)registerNumber
{
- (void)setValue:(uint8_t)value forRegister:(NSUInteger)registerNumber {
_via.set_register((int)registerNumber, value);
}
- (uint8_t)valueForRegister:(NSUInteger)registerNumber
{
- (uint8_t)valueForRegister:(NSUInteger)registerNumber {
return _via.get_register((int)registerNumber);
}
- (void)runForHalfCycles:(NSUInteger)numberOfHalfCycles
{
_via.run_for_half_cycles((int)numberOfHalfCycles);
- (void)runForHalfCycles:(NSUInteger)numberOfHalfCycles {
_via.run_for(HalfCycles((int)numberOfHalfCycles));
}
- (BOOL)irqLine
{
- (BOOL)irqLine {
return _via.irq_line;
}
- (void)setPortAInput:(uint8_t)portAInput
{
- (void)setPortAInput:(uint8_t)portAInput {
_via.port_a_value = portAInput;
}
- (uint8_t)portAInput
{
- (uint8_t)portAInput {
return _via.port_a_value;
}
- (void)setPortBInput:(uint8_t)portBInput
{
- (void)setPortBInput:(uint8_t)portBInput {
_via.port_b_value = portBInput;
}
- (uint8_t)portBInput
{
- (uint8_t)portBInput {
return _via.port_b_value;
}