1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-25 18:30:07 +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 <cstring>
using namespace MOS;
Speaker::Speaker() :

View File

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

View File

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

View File

@ -10,11 +10,65 @@ env.ParseConfig('sdl2-config --libs')
# gather a list of source files
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
env.Append(CCFLAGS = ['-g', '-Wall', '--std=c++11'])
env.Append(CCFLAGS = ['-g', '--std=c++11'])
# add additional libraries to link against
env.Append(LIBS = ['libz'])
env.Append(LIBS = ['libz', 'pthread', 'GL'])
# build target
# 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 "CRTOpenGL.hpp"
#include "Internals/CRTOpenGL.hpp"
#include <cstdarg>
#include <cmath>
#include <algorithm>
@ -343,37 +343,33 @@ void CRT::output_scan(const Scan *const scan) {
These all merely channel into advance_cycles, supplying appropriate arguments
*/
void CRT::output_sync(unsigned int number_of_cycles) {
Scan scan{
.type = Scan::Type::Sync,
.number_of_cycles = number_of_cycles
};
Scan scan;
scan.type = Scan::Type::Sync;
scan.number_of_cycles = number_of_cycles;
output_scan(&scan);
}
void CRT::output_blank(unsigned int number_of_cycles) {
Scan scan {
.type = Scan::Type::Blank,
.number_of_cycles = number_of_cycles
};
Scan scan;
scan.type = Scan::Type::Blank;
scan.number_of_cycles = number_of_cycles;
output_scan(&scan);
}
void CRT::output_level(unsigned int number_of_cycles) {
openGL_output_builder_.texture_builder.reduce_previous_allocation_to(1);
Scan scan {
.type = Scan::Type::Level,
.number_of_cycles = number_of_cycles,
};
Scan scan;
scan.type = Scan::Type::Level;
scan.number_of_cycles = number_of_cycles;
output_scan(&scan);
}
void CRT::output_colour_burst(unsigned int number_of_cycles, uint8_t phase, uint8_t amplitude) {
Scan scan {
.type = Scan::Type::ColourBurst,
.number_of_cycles = number_of_cycles,
.phase = phase,
.amplitude = amplitude
};
Scan scan;
scan.type = Scan::Type::ColourBurst;
scan.number_of_cycles = number_of_cycles;
scan.phase = phase;
scan.amplitude = amplitude;
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) {
openGL_output_builder_.texture_builder.reduce_previous_allocation_to(number_of_cycles / source_divider);
Scan scan {
.type = Scan::Type::Data,
.number_of_cycles = number_of_cycles,
};
Scan scan;
scan.type = Scan::Type::Data;
scan.number_of_cycles = number_of_cycles;
output_scan(&scan);
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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