2017-05-17 02:05:42 +00:00
|
|
|
//
|
|
|
|
// TestMachineZ80.h
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 16/05/2017.
|
2018-05-13 19:19:52 +00:00
|
|
|
// Copyright 2017 Thomas Harte. All rights reserved.
|
2017-05-17 02:05:42 +00:00
|
|
|
//
|
|
|
|
|
|
|
|
#import <Foundation/Foundation.h>
|
2017-05-22 23:49:38 +00:00
|
|
|
#import <stdint.h>
|
2017-06-04 01:22:16 +00:00
|
|
|
#import "TestMachine.h"
|
2017-05-22 23:49:38 +00:00
|
|
|
|
|
|
|
@class CSTestMachineZ80;
|
|
|
|
|
|
|
|
typedef NS_ENUM(NSInteger, CSTestMachineZ80BusOperationCaptureOperation) {
|
2017-06-16 00:59:59 +00:00
|
|
|
CSTestMachineZ80BusOperationCaptureOperationReadOpcode,
|
2017-05-22 23:49:38 +00:00
|
|
|
CSTestMachineZ80BusOperationCaptureOperationRead,
|
2017-05-29 19:57:27 +00:00
|
|
|
CSTestMachineZ80BusOperationCaptureOperationWrite,
|
|
|
|
CSTestMachineZ80BusOperationCaptureOperationPortRead,
|
|
|
|
CSTestMachineZ80BusOperationCaptureOperationPortWrite,
|
2017-06-16 00:59:59 +00:00
|
|
|
CSTestMachineZ80BusOperationCaptureOperationInternalOperation,
|
2017-05-22 23:49:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
@interface CSTestMachineZ80BusOperationCapture: NSObject
|
2017-05-29 19:57:27 +00:00
|
|
|
@property(nonatomic, readonly) CSTestMachineZ80BusOperationCaptureOperation operation;
|
|
|
|
@property(nonatomic, readonly) uint16_t address;
|
|
|
|
@property(nonatomic, readonly) uint8_t value;
|
|
|
|
@property(nonatomic, readonly) int timeStamp;
|
2017-05-22 23:49:38 +00:00
|
|
|
@end
|
2017-05-17 02:05:42 +00:00
|
|
|
|
|
|
|
typedef NS_ENUM(NSInteger, CSTestMachineZ80Register) {
|
|
|
|
CSTestMachineZ80RegisterProgramCounter,
|
|
|
|
CSTestMachineZ80RegisterStackPointer,
|
2017-05-20 01:53:39 +00:00
|
|
|
|
2017-05-22 23:14:46 +00:00
|
|
|
CSTestMachineZ80RegisterA, CSTestMachineZ80RegisterF, CSTestMachineZ80RegisterAF,
|
|
|
|
CSTestMachineZ80RegisterB, CSTestMachineZ80RegisterC, CSTestMachineZ80RegisterBC,
|
|
|
|
CSTestMachineZ80RegisterD, CSTestMachineZ80RegisterE, CSTestMachineZ80RegisterDE,
|
|
|
|
CSTestMachineZ80RegisterH, CSTestMachineZ80RegisterL, CSTestMachineZ80RegisterHL,
|
|
|
|
CSTestMachineZ80RegisterAFDash,
|
|
|
|
CSTestMachineZ80RegisterBCDash,
|
|
|
|
CSTestMachineZ80RegisterDEDash,
|
|
|
|
CSTestMachineZ80RegisterHLDash,
|
|
|
|
CSTestMachineZ80RegisterIX, CSTestMachineZ80RegisterIY,
|
|
|
|
CSTestMachineZ80RegisterI, CSTestMachineZ80RegisterR,
|
2017-07-22 02:52:25 +00:00
|
|
|
CSTestMachineZ80RegisterIFF1, CSTestMachineZ80RegisterIFF2, CSTestMachineZ80RegisterIM,
|
|
|
|
CSTestMachineZ80RegisterMemPtr
|
2017-05-17 02:05:42 +00:00
|
|
|
};
|
|
|
|
|
2020-02-23 21:12:28 +00:00
|
|
|
typedef NS_ENUM(NSInteger, CSTestMachinePortLogic) {
|
|
|
|
CSTestMachinePortLogicReturnUpperByte,
|
|
|
|
CSTestMachinePortLogicReturn191
|
|
|
|
};
|
|
|
|
|
2017-06-04 01:22:16 +00:00
|
|
|
@interface CSTestMachineZ80 : CSTestMachine
|
2017-05-17 02:05:42 +00:00
|
|
|
|
2017-05-29 19:57:27 +00:00
|
|
|
- (void)setData:(nonnull NSData *)data atAddress:(uint16_t)startAddress;
|
2017-05-20 01:53:39 +00:00
|
|
|
- (void)setValue:(uint8_t)value atAddress:(uint16_t)address;
|
|
|
|
- (uint8_t)valueAtAddress:(uint16_t)address;
|
2017-05-22 23:49:38 +00:00
|
|
|
|
2017-05-17 02:05:42 +00:00
|
|
|
- (void)runForNumberOfCycles:(int)cycles;
|
2020-02-25 04:31:42 +00:00
|
|
|
- (void)runForInstruction;
|
2017-05-17 02:05:42 +00:00
|
|
|
|
|
|
|
- (void)setValue:(uint16_t)value forRegister:(CSTestMachineZ80Register)reg;
|
|
|
|
- (uint16_t)valueForRegister:(CSTestMachineZ80Register)reg;
|
|
|
|
|
2017-05-22 23:49:38 +00:00
|
|
|
@property(nonatomic, assign) BOOL captureBusActivity;
|
2017-05-29 19:57:27 +00:00
|
|
|
@property(nonatomic, readonly, nonnull) NSArray<CSTestMachineZ80BusOperationCapture *> *busOperationCaptures;
|
2017-05-22 23:49:38 +00:00
|
|
|
|
2017-05-29 15:54:27 +00:00
|
|
|
@property(nonatomic, readonly) BOOL isHalted;
|
2017-07-28 00:17:13 +00:00
|
|
|
@property(nonatomic, readonly) int completedHalfCycles;
|
2017-05-29 15:54:27 +00:00
|
|
|
|
2017-06-03 21:41:45 +00:00
|
|
|
@property(nonatomic) BOOL nmiLine;
|
|
|
|
@property(nonatomic) BOOL irqLine;
|
2017-06-23 01:09:26 +00:00
|
|
|
@property(nonatomic) BOOL waitLine;
|
2017-06-03 21:41:45 +00:00
|
|
|
|
2020-02-23 21:12:28 +00:00
|
|
|
@property(nonatomic) CSTestMachinePortLogic portLogic;
|
|
|
|
|
2017-05-17 02:05:42 +00:00
|
|
|
@end
|