From b13b0d9311ab2c9dc54fd914de8ee69b023f6510 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 14 Apr 2020 23:51:45 -0400 Subject: [PATCH] Starts towards implementing some OPL test cases. --- Components/OPL2/OPL2.hpp | 7 ++--- .../Bridges/TestMachine6502.mm | 2 +- OSBindings/Mac/Clock SignalTests/OPLTests.mm | 26 +++++++++++++++++++ 3 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 OSBindings/Mac/Clock SignalTests/OPLTests.mm diff --git a/Components/OPL2/OPL2.hpp b/Components/OPL2/OPL2.hpp index ed631b262..647cc3ff5 100644 --- a/Components/OPL2/OPL2.hpp +++ b/Components/OPL2/OPL2.hpp @@ -334,9 +334,10 @@ struct OPLL: public OPLBase { int level = 0; }; void update_all_chanels() { - for(int c = 0; c < 6; ++ c) { // Don't do anything with channels that might be percussion for now. - channels_[c].level = (channels_[c].update() * total_volume_) >> 14; - } +// for(int c = 0; c < 6; ++ c) { // Don't do anything with channels that might be percussion for now. +// channels_[c].level = (channels_[c].update() * total_volume_) >> 14; +// } + channels_[0].level = (channels_[0].update() * total_volume_) >> 14; } Channel channels_[9]; diff --git a/OSBindings/Mac/Clock SignalTests/Bridges/TestMachine6502.mm b/OSBindings/Mac/Clock SignalTests/Bridges/TestMachine6502.mm index bc58b91c1..635005613 100644 --- a/OSBindings/Mac/Clock SignalTests/Bridges/TestMachine6502.mm +++ b/OSBindings/Mac/Clock SignalTests/Bridges/TestMachine6502.mm @@ -23,7 +23,7 @@ static CPU::MOS6502::Register registerForRegister(CSTestMachine6502Register reg) case CSTestMachine6502RegisterA: return CPU::MOS6502::Register::A; case CSTestMachine6502RegisterX: return CPU::MOS6502::Register::X; case CSTestMachine6502RegisterY: return CPU::MOS6502::Register::Y; - case CSTestMachine6502RegisterStackPointer: return CPU::MOS6502::Register::S; + case CSTestMachine6502RegisterStackPointer: return CPU::MOS6502::Register::StackPointer; } } diff --git a/OSBindings/Mac/Clock SignalTests/OPLTests.mm b/OSBindings/Mac/Clock SignalTests/OPLTests.mm new file mode 100644 index 000000000..aad765787 --- /dev/null +++ b/OSBindings/Mac/Clock SignalTests/OPLTests.mm @@ -0,0 +1,26 @@ +// +// OPLTests.m +// Clock SignalTests +// +// Created by Thomas Harte on 14/04/2020. +// Copyright © 2020 Thomas Harte. All rights reserved. +// + +#import + +#include "OPL2.hpp" + +@interface OPLTests: XCTestCase +@end + +@implementation OPLTests { +} + +- (void)testADSR { + Yamaha::OPL::Operator test_operator; + Yamaha::OPL::OperatorState test_state; + + +} + +@end