1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-08-15 14:27:29 +00:00

Further builds up SConstruct, correcting many missed imports and a couple of improper uses of C99 in C++ code.

This commit is contained in:
Thomas Harte
2017-11-09 22:04:49 -05:00
parent 62218e81bf
commit c0055a5a5f
21 changed files with 106 additions and 30 deletions

View File

@@ -8,6 +8,8 @@
#include "6560.hpp" #include "6560.hpp"
#include <cstring>
using namespace MOS; using namespace MOS;
Speaker::Speaker() : Speaker::Speaker() :

View File

@@ -9,6 +9,8 @@
#ifndef Atari2600_PIA_h #ifndef Atari2600_PIA_h
#define Atari2600_PIA_h #define Atari2600_PIA_h
#include <cstdint>
#include "../../Components/6532/6532.hpp" #include "../../Components/6532/6532.hpp"
namespace Atari2600 { namespace Atari2600 {

View File

@@ -9,6 +9,8 @@
#ifndef KeyboardMachine_h #ifndef KeyboardMachine_h
#define KeyboardMachine_h #define KeyboardMachine_h
#include <cstdint>
#include "../Inputs/Keyboard.hpp" #include "../Inputs/Keyboard.hpp"
namespace KeyboardMachine { namespace KeyboardMachine {

View File

@@ -10,11 +10,65 @@ env.ParseConfig('sdl2-config --libs')
# gather a list of source files # gather a list of source files
SOURCES = glob.glob('*.cpp') SOURCES = glob.glob('*.cpp')
SOURCES += glob.glob('../../Components/1770/*.cpp')
SOURCES += glob.glob('../../Components/6522/Implementation/*.cpp')
SOURCES += glob.glob('../../Components/6560/*.cpp')
SOURCES += glob.glob('../../Components/8272/*.cpp')
SOURCES += glob.glob('../../Components/AY38910/*.cpp')
SOURCES += glob.glob('../../Concurrency/*.cpp')
SOURCES += glob.glob('../../Inputs/*.cpp')
SOURCES += glob.glob('../../Machines/*.cpp')
SOURCES += glob.glob('../../Machines/AmstradCPC/*.cpp')
SOURCES += glob.glob('../../Machines/Atari2600/*.cpp')
SOURCES += glob.glob('../../Machines/Commodore/*.cpp')
SOURCES += glob.glob('../../Machines/Commodore/1540/*.cpp')
SOURCES += glob.glob('../../Machines/Commodore/Vic-20/*.cpp')
SOURCES += glob.glob('../../Machines/Electron/*.cpp')
SOURCES += glob.glob('../../Machines/Oric/*.cpp')
SOURCES += glob.glob('../../Machines/Utility/*.cpp')
SOURCES += glob.glob('../../Machines/ZX8081/*.cpp')
SOURCES += glob.glob('../../Outputs/CRT/*.cpp')
SOURCES += glob.glob('../../Outputs/CRT/Internals/*.cpp')
SOURCES += glob.glob('../../Outputs/CRT/Interals/Shaders/*.cpp')
SOURCES += glob.glob('../../Processors/6502/Implementation/*.cpp')
SOURCES += glob.glob('../../Processors/Z80/Implementation/*.cpp')
SOURCES += glob.glob('../../StaticAnalyser/*.cpp')
SOURCES += glob.glob('../../StaticAnalyser/Acorn/*.cpp')
SOURCES += glob.glob('../../StaticAnalyser/AmstradCPC/*.cpp')
SOURCES += glob.glob('../../StaticAnalyser/Atari/*.cpp')
SOURCES += glob.glob('../../StaticAnalyser/Commodore/*.cpp')
SOURCES += glob.glob('../../StaticAnalyser/Disassembler/*.cpp')
SOURCES += glob.glob('../../StaticAnalyser/Oric/*.cpp')
SOURCES += glob.glob('../../StaticAnalyser/ZX8081/*.cpp')
SOURCES += glob.glob('../../Storage/*.cpp')
SOURCES += glob.glob('../../Storage/Cartridge/*.cpp')
SOURCES += glob.glob('../../Storage/Encodings/*.cpp')
SOURCES += glob.glob('../../Storage/Formats/*.cpp')
SOURCES += glob.glob('../../Storage/Disk/*.cpp')
SOURCES += glob.glob('../../Storage/Disk/Controller/*.cpp')
SOURCES += glob.glob('../../Storage/Disk/DiskImage/Formats/*.cpp')
SOURCES += glob.glob('../../Storage/Disk/DPLL/*.cpp')
SOURCES += glob.glob('../../Storage/Disk/Encodings/*.cpp')
SOURCES += glob.glob('../../Storage/Disk/Encodings/MFM/*.cpp')
SOURCES += glob.glob('../../Storage/Disk/Parsers/*.cpp')
SOURCES += glob.glob('../../Storage/Disk/Track/*.cpp')
SOURCES += glob.glob('../../Storage/Disk/Data/*.cpp')
SOURCES += glob.glob('../../Storage/Disk/Tape/*.cpp')
SOURCES += glob.glob('../../Storage/Disk/Tape/Formats/*.cpp')
SOURCES += glob.glob('../../Storage/Disk/Tape/Parsers/*.cpp')
# add additional compiler flags # add additional compiler flags
env.Append(CCFLAGS = ['-g', '-Wall', '--std=c++11']) env.Append(CCFLAGS = ['-g', '--std=c++11'])
# add additional libraries to link against # add additional libraries to link against
env.Append(LIBS = ['libz']) env.Append(LIBS = ['libz', 'pthread', 'GL'])
# build target # build target
# output executable will be "game" # output executable will be "game"
env.Program(target = 'game', source = SOURCES) env.Program(target = 'clksignal', source = SOURCES)

View File

@@ -7,7 +7,7 @@
// //
#include "CRT.hpp" #include "CRT.hpp"
#include "CRTOpenGL.hpp" #include "Internals/CRTOpenGL.hpp"
#include <cstdarg> #include <cstdarg>
#include <cmath> #include <cmath>
#include <algorithm> #include <algorithm>
@@ -343,37 +343,33 @@ void CRT::output_scan(const Scan *const scan) {
These all merely channel into advance_cycles, supplying appropriate arguments These all merely channel into advance_cycles, supplying appropriate arguments
*/ */
void CRT::output_sync(unsigned int number_of_cycles) { void CRT::output_sync(unsigned int number_of_cycles) {
Scan scan{ Scan scan;
.type = Scan::Type::Sync, scan.type = Scan::Type::Sync;
.number_of_cycles = number_of_cycles scan.number_of_cycles = number_of_cycles;
};
output_scan(&scan); output_scan(&scan);
} }
void CRT::output_blank(unsigned int number_of_cycles) { void CRT::output_blank(unsigned int number_of_cycles) {
Scan scan { Scan scan;
.type = Scan::Type::Blank, scan.type = Scan::Type::Blank;
.number_of_cycles = number_of_cycles scan.number_of_cycles = number_of_cycles;
};
output_scan(&scan); output_scan(&scan);
} }
void CRT::output_level(unsigned int number_of_cycles) { void CRT::output_level(unsigned int number_of_cycles) {
openGL_output_builder_.texture_builder.reduce_previous_allocation_to(1); openGL_output_builder_.texture_builder.reduce_previous_allocation_to(1);
Scan scan { Scan scan;
.type = Scan::Type::Level, scan.type = Scan::Type::Level;
.number_of_cycles = number_of_cycles, scan.number_of_cycles = number_of_cycles;
};
output_scan(&scan); output_scan(&scan);
} }
void CRT::output_colour_burst(unsigned int number_of_cycles, uint8_t phase, uint8_t amplitude) { void CRT::output_colour_burst(unsigned int number_of_cycles, uint8_t phase, uint8_t amplitude) {
Scan scan { Scan scan;
.type = Scan::Type::ColourBurst, scan.type = Scan::Type::ColourBurst;
.number_of_cycles = number_of_cycles, scan.number_of_cycles = number_of_cycles;
.phase = phase, scan.phase = phase;
.amplitude = amplitude scan.amplitude = amplitude;
};
output_scan(&scan); output_scan(&scan);
} }
@@ -383,10 +379,9 @@ void CRT::output_default_colour_burst(unsigned int number_of_cycles) {
void CRT::output_data(unsigned int number_of_cycles, unsigned int source_divider) { void CRT::output_data(unsigned int number_of_cycles, unsigned int source_divider) {
openGL_output_builder_.texture_builder.reduce_previous_allocation_to(number_of_cycles / source_divider); openGL_output_builder_.texture_builder.reduce_previous_allocation_to(number_of_cycles / source_divider);
Scan scan { Scan scan;
.type = Scan::Type::Data, scan.type = Scan::Type::Data;
.number_of_cycles = number_of_cycles, scan.number_of_cycles = number_of_cycles;
};
output_scan(&scan); output_scan(&scan);
} }

View File

@@ -8,6 +8,8 @@
#include "ArrayBuilder.hpp" #include "ArrayBuilder.hpp"
#include <cstring>
using namespace Outputs::CRT; using namespace Outputs::CRT;
ArrayBuilder::ArrayBuilder(size_t input_size, size_t output_size) : ArrayBuilder::ArrayBuilder(size_t input_size, size_t output_size) :

View File

@@ -5,7 +5,7 @@
// Copyright © 2016 Thomas Harte. All rights reserved. // Copyright © 2016 Thomas Harte. All rights reserved.
// //
#include "CRT.hpp" #include "../CRT.hpp"
#include <cstdlib> #include <cstdlib>
#include <cmath> #include <cmath>

View File

@@ -18,6 +18,7 @@
#include <OpenGL/gl3ext.h> #include <OpenGL/gl3ext.h>
#endif #endif
#else #else
#define GL_GLEXT_PROTOTYPES
#include <GL/gl.h> #include <GL/gl.h>
#endif #endif

View File

@@ -9,8 +9,10 @@
#ifndef Speaker_hpp #ifndef Speaker_hpp
#define Speaker_hpp #define Speaker_hpp
#include <cmath>
#include <cstdint> #include <cstdint>
#include <cstdio> #include <cstdio>
#include <cstring>
#include <ctime> #include <ctime>
#include <memory> #include <memory>

View File

@@ -849,7 +849,6 @@ template < class T,
break; break;
case MicroOp::IndexedPlaceHolder: case MicroOp::IndexedPlaceHolder:
printf("Hit placeholder!!!\n");
return; return;
} }
#undef set_parity #undef set_parity

View File

@@ -7,6 +7,7 @@
// //
#include "../Z80.hpp" #include "../Z80.hpp"
#include <cstring>
using namespace CPU::Z80; using namespace CPU::Z80;

View File

@@ -8,13 +8,16 @@
#include "StaticAnalyser.hpp" #include "StaticAnalyser.hpp"
#include <algorithm>
#include <cstring>
#include "../../Storage/Disk/Parsers/CPM.hpp" #include "../../Storage/Disk/Parsers/CPM.hpp"
#include "../../Storage/Disk/Encodings/MFM/Parser.hpp" #include "../../Storage/Disk/Encodings/MFM/Parser.hpp"
static bool strcmp_insensitive(const char *a, const char *b) { static bool strcmp_insensitive(const char *a, const char *b) {
if(strlen(a) != strlen(b)) return false; if(strlen(a) != strlen(b)) return false;
while(*a) { while(*a) {
if(tolower(*a) != towlower(*b)) return false; if(tolower(*a) != tolower(*b)) return false;
a++; a++;
b++; b++;
} }

View File

@@ -9,6 +9,7 @@
#include "StaticAnalyser.hpp" #include "StaticAnalyser.hpp"
#include <cstdlib> #include <cstdlib>
#include <cstring>
// Analysers // Analysers
#include "Acorn/StaticAnalyser.hpp" #include "Acorn/StaticAnalyser.hpp"

View File

@@ -9,6 +9,7 @@
#include "D64.hpp" #include "D64.hpp"
#include <algorithm> #include <algorithm>
#include <cstring>
#include <sys/stat.h> #include <sys/stat.h>
#include "../../Track/PCMTrack.hpp" #include "../../Track/PCMTrack.hpp"

View File

@@ -8,7 +8,9 @@
#include "G64.hpp" #include "G64.hpp"
#include <cstring>
#include <vector> #include <vector>
#include "../../Track/PCMTrack.hpp" #include "../../Track/PCMTrack.hpp"
#include "../../Encodings/CommodoreGCR.hpp" #include "../../Encodings/CommodoreGCR.hpp"

View File

@@ -8,6 +8,8 @@
#include "SSD.hpp" #include "SSD.hpp"
#include <cstring>
#include "Utility/ImplicitSectors.hpp" #include "Utility/ImplicitSectors.hpp"
namespace { namespace {

View File

@@ -8,7 +8,7 @@
#include "Drive.hpp" #include "Drive.hpp"
#include "UnformattedTrack.hpp" #include "Track/UnformattedTrack.hpp"
#include <algorithm> #include <algorithm>
#include <cassert> #include <cassert>

View File

@@ -10,7 +10,9 @@
#define Storage_Disk_Encodings_MFM_hpp #define Storage_Disk_Encodings_MFM_hpp
#include <cstdint> #include <cstdint>
#include <memory>
#include <vector> #include <vector>
#include "Sector.hpp" #include "Sector.hpp"
#include "../../Track/Track.hpp" #include "../../Track/Track.hpp"
#include "../../../../NumberTheory/CRC.hpp" #include "../../../../NumberTheory/CRC.hpp"

View File

@@ -8,6 +8,9 @@
#include "CPM.hpp" #include "CPM.hpp"
#include <algorithm>
#include <cstring>
#include "../Encodings/MFM/Parser.hpp" #include "../Encodings/MFM/Parser.hpp"
using namespace Storage::Disk::CPM; using namespace Storage::Disk::CPM;

View File

@@ -10,6 +10,7 @@
#define PCMSegment_hpp #define PCMSegment_hpp
#include <cstdint> #include <cstdint>
#include <memory>
#include <vector> #include <vector>
#include "../../Storage.hpp" #include "../../Storage.hpp"

View File

@@ -8,6 +8,7 @@
#include "FileHolder.hpp" #include "FileHolder.hpp"
#include <algorithm>
#include <cstring> #include <cstring>
using namespace Storage; using namespace Storage;