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,
|
2020-10-14 01:38:30 +00:00
|
|
|
CSTestMachine6502RegisterEmulationFlag,
|
|
|
|
CSTestMachine6502RegisterDataBank,
|
|
|
|
CSTestMachine6502RegisterProgramBank,
|
|
|
|
CSTestMachine6502RegisterDirect,
|
2017-05-15 12:18:57 +00:00
|
|
|
};
|
|
|
|
|
2020-09-27 02:31:50 +00:00
|
|
|
typedef NS_ENUM(NSInteger, CSTestMachine6502Processor) {
|
2023-09-21 13:47:29 +00:00
|
|
|
CSTestMachine6502ProcessorNES6502,
|
2020-09-27 02:31:50 +00:00
|
|
|
CSTestMachine6502Processor6502,
|
|
|
|
CSTestMachine6502Processor65C02,
|
|
|
|
CSTestMachine6502Processor65816
|
|
|
|
};
|
|
|
|
|
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;
|
|
|
|
|
2021-07-31 01:21:16 +00:00
|
|
|
- (nonnull instancetype)initWithProcessor:(CSTestMachine6502Processor)processor hasCIAs:(BOOL)hasCIAs;
|
2020-09-27 02:31:50 +00:00
|
|
|
- (nonnull instancetype)initWithProcessor:(CSTestMachine6502Processor)processor;
|
2018-08-07 01:48:43 +00:00
|
|
|
|
2020-10-14 01:38:30 +00:00
|
|
|
- (void)setData:(nonnull NSData *)data atAddress:(uint32_t)startAddress;
|
2023-09-21 14:00:26 +00:00
|
|
|
- (nonnull NSData *)dataAtAddress:(uint32_t)address length:(uint32_t)length;
|
2017-05-15 12:18:57 +00:00
|
|
|
- (void)runForNumberOfCycles:(int)cycles;
|
2020-11-03 02:09:32 +00:00
|
|
|
- (void)runForNumberOfInstructions:(int)instructions;
|
2017-05-15 12:18:57 +00:00
|
|
|
|
2020-10-14 01:38:30 +00:00
|
|
|
- (void)setValue:(uint8_t)value forAddress:(uint32_t)address;
|
|
|
|
- (uint8_t)valueForAddress:(uint32_t)address;
|
2017-05-15 12:18:57 +00:00
|
|
|
- (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
|