mirror of
https://github.com/TomHarte/CLK.git
synced 2025-04-06 10:38:16 +00:00
This now goes just far enough to create an instance of Atari2600::Machine and push a ROM to it. Next jobs are to get a basic CRT emulation wired up, outputting to the window.
This commit is contained in:
parent
24c0579b94
commit
3e0679235a
@ -9,7 +9,7 @@
|
||||
#ifndef Atari2600_cpp
|
||||
#define Atari2600_cpp
|
||||
|
||||
#include "CPU6502.hpp"
|
||||
#include "../Processors/6502/CPU6502.hpp"
|
||||
|
||||
namespace Atari2600 {
|
||||
|
||||
|
@ -7,9 +7,11 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
4B6D7F941B58822000787C9A /* Atari2600.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B6D7F921B58822000787C9A /* Atari2600.cpp */; };
|
||||
4B6D7F991B58822E00787C9A /* CPU6502.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B6D7F951B58822E00787C9A /* CPU6502.cpp */; };
|
||||
4B6D7F9A1B58822E00787C9A /* CPU6502AllRAM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B6D7F971B58822E00787C9A /* CPU6502AllRAM.cpp */; };
|
||||
4B14144E1B5883E500E04248 /* Atari2600.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4B14144B1B5883E500E04248 /* Atari2600.mm */; };
|
||||
4B14144F1B5883E500E04248 /* OpenGLView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B14144D1B5883E500E04248 /* OpenGLView.m */; };
|
||||
4B1414511B5885DF00E04248 /* Atari2600.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B6D7F921B58822000787C9A /* Atari2600.cpp */; };
|
||||
4B1414531B5885E800E04248 /* CPU6502.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B6D7F951B58822E00787C9A /* CPU6502.cpp */; };
|
||||
4B1414541B58860100E04248 /* CPU6502AllRAM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B6D7F971B58822E00787C9A /* CPU6502AllRAM.cpp */; };
|
||||
4BB298EE1B587D8400A49093 /* 6502_functional_test.bin in Resources */ = {isa = PBXBuildFile; fileRef = 4BB297E01B587D8300A49093 /* 6502_functional_test.bin */; };
|
||||
4BB298EF1B587D8400A49093 /* AllSuiteA.bin in Resources */ = {isa = PBXBuildFile; fileRef = 4BB297E11B587D8300A49093 /* AllSuiteA.bin */; };
|
||||
4BB298F01B587D8400A49093 /* TestMachine.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4BB297E31B587D8300A49093 /* TestMachine.mm */; };
|
||||
@ -305,10 +307,15 @@
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
4B14144A1B5883E500E04248 /* Atari2600.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Atari2600.h; sourceTree = "<group>"; };
|
||||
4B14144B1B5883E500E04248 /* Atari2600.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Atari2600.mm; sourceTree = "<group>"; };
|
||||
4B14144C1B5883E500E04248 /* OpenGLView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OpenGLView.h; sourceTree = "<group>"; };
|
||||
4B14144D1B5883E500E04248 /* OpenGLView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OpenGLView.m; sourceTree = "<group>"; };
|
||||
4B1414501B58848C00E04248 /* ClockSignal-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ClockSignal-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||
4B6D7F921B58822000787C9A /* Atari2600.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Atari2600.cpp; sourceTree = "<group>"; };
|
||||
4B6D7F931B58822000787C9A /* Atari2600.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Atari2600.hpp; sourceTree = "<group>"; };
|
||||
4B6D7F951B58822E00787C9A /* CPU6502.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CPU6502.cpp; path = ../../Processors/6502/CPU6502.cpp; sourceTree = "<group>"; };
|
||||
4B6D7F961B58822E00787C9A /* Atari2600.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Atari2600.hpp; path = ../../Machines/Atari2600.hpp; sourceTree = "<group>"; };
|
||||
4B6D7F961B58822E00787C9A /* CPU6502.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = CPU6502.hpp; path = ../../Processors/6502/CPU6502.hpp; sourceTree = "<group>"; };
|
||||
4B6D7F971B58822E00787C9A /* CPU6502AllRAM.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CPU6502AllRAM.cpp; path = ../../Processors/6502/CPU6502AllRAM.cpp; sourceTree = "<group>"; };
|
||||
4B6D7F981B58822E00787C9A /* CPU6502AllRAM.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = CPU6502AllRAM.hpp; path = ../../Processors/6502/CPU6502AllRAM.hpp; sourceTree = "<group>"; };
|
||||
4BB297DF1B587D8200A49093 /* Clock SignalTests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Clock SignalTests-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||
@ -919,6 +926,11 @@
|
||||
4BB73EA01B587A5100552FC2 /* Clock Signal */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
4B1414501B58848C00E04248 /* ClockSignal-Bridging-Header.h */,
|
||||
4B14144A1B5883E500E04248 /* Atari2600.h */,
|
||||
4B14144B1B5883E500E04248 /* Atari2600.mm */,
|
||||
4B14144C1B5883E500E04248 /* OpenGLView.h */,
|
||||
4B14144D1B5883E500E04248 /* OpenGLView.m */,
|
||||
4BB73ECF1B587A6700552FC2 /* Clock Signal.entitlements */,
|
||||
4BB73EA11B587A5100552FC2 /* AppDelegate.swift */,
|
||||
4BB73EA31B587A5100552FC2 /* Atari2600Document.swift */,
|
||||
@ -977,7 +989,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
4B6D7F951B58822E00787C9A /* CPU6502.cpp */,
|
||||
4B6D7F961B58822E00787C9A /* Atari2600.hpp */,
|
||||
4B6D7F961B58822E00787C9A /* CPU6502.hpp */,
|
||||
4B6D7F971B58822E00787C9A /* CPU6502AllRAM.cpp */,
|
||||
4B6D7F981B58822E00787C9A /* CPU6502AllRAM.hpp */,
|
||||
);
|
||||
@ -1388,11 +1400,11 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
4B1414511B5885DF00E04248 /* Atari2600.cpp in Sources */,
|
||||
4BB73EA41B587A5100552FC2 /* Atari2600Document.swift in Sources */,
|
||||
4B6D7F991B58822E00787C9A /* CPU6502.cpp in Sources */,
|
||||
4B6D7F9A1B58822E00787C9A /* CPU6502AllRAM.cpp in Sources */,
|
||||
4B14144E1B5883E500E04248 /* Atari2600.mm in Sources */,
|
||||
4BB73EA21B587A5100552FC2 /* AppDelegate.swift in Sources */,
|
||||
4B6D7F941B58822000787C9A /* Atari2600.cpp in Sources */,
|
||||
4B14144F1B5883E500E04248 /* OpenGLView.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@ -1400,6 +1412,8 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
4B1414541B58860100E04248 /* CPU6502AllRAM.cpp in Sources */,
|
||||
4B1414531B5885E800E04248 /* CPU6502.cpp in Sources */,
|
||||
4BB73EB71B587A5100552FC2 /* Clock_SignalTests.swift in Sources */,
|
||||
4BB298F01B587D8400A49093 /* TestMachine.mm in Sources */,
|
||||
);
|
||||
@ -1539,6 +1553,7 @@
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "TH.Clock-Signal";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Clock Signal/ClockSignal-Bridging-Header.h";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
};
|
||||
name = Debug;
|
||||
@ -1554,6 +1569,7 @@
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "TH.Clock-Signal";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Clock Signal/ClockSignal-Bridging-Header.h";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
|
16
OSBindings/Mac/Clock Signal/Atari2600.h
Normal file
16
OSBindings/Mac/Clock Signal/Atari2600.h
Normal file
@ -0,0 +1,16 @@
|
||||
//
|
||||
// Atari2600.h
|
||||
// Clock Signal
|
||||
//
|
||||
// Created by Thomas Harte on 14/07/2015.
|
||||
// Copyright © 2015 Thomas Harte. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface CSAtari2600 : NSObject
|
||||
|
||||
- (void)runForNumberOfCycles:(int)cycles;
|
||||
- (void)setROM:(NSData *)rom;
|
||||
|
||||
@end
|
24
OSBindings/Mac/Clock Signal/Atari2600.mm
Normal file
24
OSBindings/Mac/Clock Signal/Atari2600.mm
Normal file
@ -0,0 +1,24 @@
|
||||
//
|
||||
// Atari2600.m
|
||||
// ElectrEm
|
||||
//
|
||||
// Created by Thomas Harte on 14/07/2015.
|
||||
// Copyright © 2015 Thomas Harte. All rights reserved.
|
||||
//
|
||||
|
||||
#import "Atari2600.h"
|
||||
#import "Atari2600.hpp"
|
||||
|
||||
@implementation CSAtari2600 {
|
||||
Atari2600::Machine _atari2600;
|
||||
}
|
||||
|
||||
- (void)runForNumberOfCycles:(int)cycles {
|
||||
_atari2600.run_for_cycles(cycles);
|
||||
}
|
||||
|
||||
- (void)setROM:(NSData *)rom {
|
||||
_atari2600.set_rom(rom.length, (const uint8_t *)rom.bytes);
|
||||
}
|
||||
|
||||
@end
|
@ -1,5 +1,5 @@
|
||||
//
|
||||
// Document.swift
|
||||
// Atari2600Document.swift
|
||||
// Clock Signal
|
||||
//
|
||||
// Created by Thomas Harte on 16/07/2015.
|
||||
@ -30,6 +30,7 @@ class Atari2600Document: NSDocument {
|
||||
return "Atari2600Document"
|
||||
}
|
||||
|
||||
private var atari2600: CSAtari2600? = nil
|
||||
override func dataOfType(typeName: String) throws -> NSData {
|
||||
// Insert code here to write your document to data of the specified type. If outError != nil, ensure that you create and set an appropriate error when returning nil.
|
||||
// You can also choose to override fileWrapperOfType:error:, writeToURL:ofType:error:, or writeToURL:ofType:forSaveOperation:originalContentsURL:error: instead.
|
||||
@ -40,7 +41,8 @@ class Atari2600Document: NSDocument {
|
||||
// Insert code here to read your document from the given data of the specified type. If outError != nil, ensure that you create and set an appropriate error when returning false.
|
||||
// You can also choose to override readFromFileWrapper:ofType:error: or readFromURL:ofType:error: instead.
|
||||
// If you override either of these, you should also override -isEntireFileLoaded to return false if the contents are lazily loaded.
|
||||
throw NSError(domain: NSOSStatusErrorDomain, code: unimpErr, userInfo: nil)
|
||||
atari2600 = CSAtari2600()
|
||||
atari2600?.setROM(data)
|
||||
}
|
||||
|
||||
|
||||
|
@ -0,0 +1,5 @@
|
||||
//
|
||||
// Use this file to import your target's public headers that you would like to expose to Swift.
|
||||
//
|
||||
|
||||
#import "Atari2600.h"
|
14
OSBindings/Mac/Clock Signal/OpenGLView.h
Normal file
14
OSBindings/Mac/Clock Signal/OpenGLView.h
Normal file
@ -0,0 +1,14 @@
|
||||
//
|
||||
// OpenGLView.h
|
||||
// Clock Signal
|
||||
//
|
||||
// Created by Thomas Harte on 16/07/2015.
|
||||
// Copyright © 2015 Thomas Harte. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
@import AppKit;
|
||||
|
||||
@interface CSOpenGLView : NSOpenGLView
|
||||
|
||||
@end
|
27
OSBindings/Mac/Clock Signal/OpenGLView.m
Normal file
27
OSBindings/Mac/Clock Signal/OpenGLView.m
Normal file
@ -0,0 +1,27 @@
|
||||
//
|
||||
// OpenGLView.m
|
||||
// ElectrEm
|
||||
//
|
||||
// Created by Thomas Harte on 16/07/2015.
|
||||
// Copyright © 2015 Thomas Harte. All rights reserved.
|
||||
//
|
||||
|
||||
#import "OpenGLView.h"
|
||||
@import CoreVideo;
|
||||
|
||||
@implementation CSOpenGLView {
|
||||
CVDisplayLinkRef displayLink;
|
||||
}
|
||||
|
||||
- (instancetype)initWithCoder:(nonnull NSCoder *)coder
|
||||
{
|
||||
self = [super initWithCoder:coder];
|
||||
|
||||
if(self)
|
||||
{
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
Loading…
x
Reference in New Issue
Block a user