2017-05-15 12:18:57 +00:00
|
|
|
//
|
|
|
|
// TestMachine6502.h
|
|
|
|
// CLK
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 29/06/2015.
|
2018-05-13 19:19:52 +00:00
|
|
|
// Copyright 2015 Thomas Harte. All rights reserved.
|
2017-05-15 12:18:57 +00:00
|
|
|
//
|
|
|
|
|
|
|
|
#import <Foundation/Foundation.h>
|
2017-06-04 01:22:16 +00:00
|
|
|
#import "TestMachine.h"
|
2017-05-15 12:18:57 +00:00
|
|
|
|
|
|
|
typedef NS_ENUM(NSInteger, CSTestMachine6502Register) {
|
|
|
|
CSTestMachine6502RegisterLastOperationAddress,
|
|
|
|
CSTestMachine6502RegisterProgramCounter,
|
|
|
|
CSTestMachine6502RegisterStackPointer,
|
|
|
|
CSTestMachine6502RegisterFlags,
|
|
|
|
CSTestMachine6502RegisterA,
|
|
|
|
CSTestMachine6502RegisterX,
|
|
|
|
CSTestMachine6502RegisterY,
|
|
|
|
};
|
|
|
|
|
2017-07-26 02:48:44 +00:00
|
|
|
extern const uint8_t CSTestMachine6502JamOpcode;
|
|
|
|
|
2017-06-04 01:22:16 +00:00
|
|
|
@interface CSTestMachine6502 : CSTestMachine
|
2017-05-15 12:18:57 +00:00
|
|
|
|
2018-08-07 01:48:43 +00:00
|
|
|
- (nonnull instancetype)init NS_UNAVAILABLE;
|
|
|
|
|
|
|
|
- (nonnull instancetype)initIs65C02:(BOOL)is65C02;
|
|
|
|
|
|
|
|
- (void)setData:(nonnull NSData *)data atAddress:(uint16_t)startAddress;
|
2017-05-15 12:18:57 +00:00
|
|
|
- (void)runForNumberOfCycles:(int)cycles;
|
|
|
|
|
|
|
|
- (void)setValue:(uint8_t)value forAddress:(uint16_t)address;
|
|
|
|
- (uint8_t)valueForAddress:(uint16_t)address;
|
|
|
|
- (void)setValue:(uint16_t)value forRegister:(CSTestMachine6502Register)reg;
|
|
|
|
- (uint16_t)valueForRegister:(CSTestMachine6502Register)reg;
|
|
|
|
|
|
|
|
@property (nonatomic, readonly) BOOL isJammed;
|
|
|
|
@property (nonatomic, readonly) uint32_t timestamp;
|
|
|
|
@property (nonatomic, assign) BOOL irqLine;
|
|
|
|
@property (nonatomic, assign) BOOL nmiLine;
|
|
|
|
|
|
|
|
@end
|