mirror of
https://github.com/TomHarte/CLK.git
synced 2024-09-28 09:54:49 +00:00
Ensure some basic traffic reaches the putative software scan target.
This commit is contained in:
parent
f4004baff8
commit
678e1a38fa
@ -82,19 +82,19 @@
|
||||
</CommandLineArgument>
|
||||
<CommandLineArgument
|
||||
argument = "--volume=0.001"
|
||||
isEnabled = "YES">
|
||||
isEnabled = "NO">
|
||||
</CommandLineArgument>
|
||||
<CommandLineArgument
|
||||
argument = "--new=enterprise"
|
||||
isEnabled = "YES">
|
||||
isEnabled = "NO">
|
||||
</CommandLineArgument>
|
||||
<CommandLineArgument
|
||||
argument = "--basic-version=any"
|
||||
isEnabled = "YES">
|
||||
isEnabled = "NO">
|
||||
</CommandLineArgument>
|
||||
<CommandLineArgument
|
||||
argument = ""/Users/thomasharte/Library/Mobile Documents/com~apple~CloudDocs/Desktop/Soft/ColecoVision/Galaxian (1983)(Atari).col""
|
||||
isEnabled = "NO">
|
||||
isEnabled = "YES">
|
||||
</CommandLineArgument>
|
||||
<CommandLineArgument
|
||||
argument = ""/Users/thomasharte/Library/Mobile Documents/com~apple~CloudDocs/Desktop/Soft/Master System/R-Type (NTSC).sms""
|
||||
|
@ -30,6 +30,9 @@
|
||||
#include "../../Machines/MachineTypes.hpp"
|
||||
|
||||
#include "../../Activity/Observer.hpp"
|
||||
|
||||
#include "../../Outputs/SoftwareRendering/ScanTarget.hpp"
|
||||
|
||||
#include "../../Outputs/OpenGL/Primitives/Rectangle.hpp"
|
||||
#include "../../Outputs/OpenGL/ScanTarget.hpp"
|
||||
#include "../../Outputs/OpenGL/Screenshot.hpp"
|
||||
@ -897,17 +900,18 @@ int main(int argc, char *argv[]) {
|
||||
glGetIntegerv(GL_FRAMEBUFFER_BINDING, &target_framebuffer);
|
||||
|
||||
// Setup output, assuming a CRT machine for now, and prepare a best-effort updater.
|
||||
Outputs::Display::OpenGL::ScanTarget scan_target(target_framebuffer);
|
||||
Outputs::Display::OpenGL::ScanTarget opengl_scan_target(target_framebuffer);
|
||||
Outputs::Display::Software::ScanTarget software_scan_target;
|
||||
std::unique_ptr<ActivityObserver> activity_observer;
|
||||
bool uses_mouse;
|
||||
std::vector<SDLJoystick> joysticks;
|
||||
|
||||
machine_runner.machine_mutex = &machine_mutex;
|
||||
const auto setup_machine_input_output = [&scan_target, &machine, &speaker_delegate, &activity_observer, &joysticks, &uses_mouse, &machine_runner] {
|
||||
const auto setup_machine_input_output = [&software_scan_target, &machine, &speaker_delegate, &activity_observer, &joysticks, &uses_mouse, &machine_runner] {
|
||||
// Wire up the best-effort updater, its delegate, and the speaker delegate.
|
||||
machine_runner.machine = machine.get();
|
||||
|
||||
machine->scan_producer()->set_scan_target(&scan_target);
|
||||
machine->scan_producer()->set_scan_target(&software_scan_target);
|
||||
|
||||
// For now, lie about audio output intentions.
|
||||
const auto audio_producer = machine->audio_producer();
|
||||
@ -986,8 +990,8 @@ int main(int argc, char *argv[]) {
|
||||
machine_runner.start();
|
||||
while(!should_quit) {
|
||||
// Draw a new frame, indicating completion of the draw to the machine runner.
|
||||
scan_target.update(int(window_width), int(window_height));
|
||||
scan_target.draw(int(window_width), int(window_height));
|
||||
// opengl_scan_target.update(int(window_width), int(window_height));
|
||||
// opengl_scan_target.draw(int(window_width), int(window_height));
|
||||
if(activity_observer) activity_observer->draw();
|
||||
machine_runner.signal_did_draw();
|
||||
|
||||
@ -1012,7 +1016,7 @@ int main(int argc, char *argv[]) {
|
||||
case SDL_WINDOWEVENT_RESIZED: {
|
||||
GLint target_framebuffer = 0;
|
||||
glGetIntegerv(GL_FRAMEBUFFER_BINDING, &target_framebuffer);
|
||||
scan_target.set_target_framebuffer(target_framebuffer);
|
||||
opengl_scan_target.set_target_framebuffer(target_framebuffer);
|
||||
SDL_GetWindowSize(window, &window_width, &window_height);
|
||||
if(activity_observer) activity_observer->set_aspect_ratio(float(window_width) / float(window_height));
|
||||
} break;
|
||||
@ -1039,7 +1043,7 @@ int main(int argc, char *argv[]) {
|
||||
if(error != Machine::Error::None) break;
|
||||
|
||||
machine = std::move(new_machine);
|
||||
static_cast<Outputs::Display::ScanTarget *>(&scan_target)->will_change_owner();
|
||||
static_cast<Outputs::Display::ScanTarget *>(&opengl_scan_target)->will_change_owner();
|
||||
setup_machine_input_output();
|
||||
window_titler.set_file_name(final_path_component(event.drop.file));
|
||||
} break;
|
||||
|
@ -6,4 +6,22 @@
|
||||
// Copyright © 2022 Thomas Harte. All rights reserved.
|
||||
//
|
||||
|
||||
#include "SoftwareScanTarget.hpp"
|
||||
#include "ScanTarget.hpp"
|
||||
|
||||
using namespace Outputs::Display::Software;
|
||||
|
||||
template <
|
||||
Outputs::Display::InputDataType input_type,
|
||||
Outputs::Display::DisplayType display_type,
|
||||
Outputs::Display::ColourSpace colour_space
|
||||
> void ScanTarget::process() {
|
||||
// TODO.
|
||||
}
|
||||
|
||||
void ScanTarget::set_modals(Modals m) {
|
||||
printf("");
|
||||
}
|
||||
|
||||
void ScanTarget::submit() {
|
||||
printf("");
|
||||
}
|
||||
|
@ -25,13 +25,14 @@ class ScanTarget: public Outputs::Display::ScanTarget {
|
||||
// The following are all overridden from Outputs::Display::ScanTarget;
|
||||
// some notes on their meaning to this specific scan target are given below.
|
||||
|
||||
void set_modals(Modals) override {}
|
||||
Scan *begin_scan() override { return *current_scan_; }
|
||||
void set_modals(Modals) override;
|
||||
Scan *begin_scan() override { return ¤t_scan_; }
|
||||
uint8_t *begin_data(size_t, size_t) override { return nullptr; }
|
||||
|
||||
//
|
||||
void submit() final;
|
||||
|
||||
template <InputDataType, DisplayType, ColourSpace> void process();
|
||||
|
||||
Scan current_scan_;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user