summaryrefslogtreecommitdiff
path: root/graphics.cpp
diff options
context:
space:
mode:
authorOxore <oxore@protonmail.com>2023-06-10 13:26:58 +0300
committerOxore <oxore@protonmail.com>2023-06-10 14:50:12 +0300
commitfccfe0e0b4848fa38403b515d77b6aba37570e54 (patch)
treef520df03c9d913ff9edfbd1ea626d9f93e92d625 /graphics.cpp
parenta8beae02428f4c7762c3621b4a6d23a498b7d394 (diff)
Impl IO class with tracing, add VDP addr regs tracing
Diffstat (limited to 'graphics.cpp')
-rw-r--r--graphics.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/graphics.cpp b/graphics.cpp
index 56d0532..d193b50 100644
--- a/graphics.cpp
+++ b/graphics.cpp
@@ -21,8 +21,8 @@ Graphics::Graphics()
_window = SDL_CreateWindow("Gut (SEGA MD/G emulator)",
SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED,
- VDP().kRenderWidth * kIntegerScaling,
- VDP().kRenderHeight * kIntegerScaling,
+ VDP(0).kRenderWidth * kIntegerScaling,
+ VDP(0).kRenderHeight * kIntegerScaling,
SDL_WINDOW_RESIZABLE);
if (!_window) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create window: %s\n", SDL_GetError());
@@ -39,8 +39,8 @@ Graphics::Graphics()
_renderer,
SDL_PIXELFORMAT_ARGB8888,
SDL_TEXTUREACCESS_STREAMING,
- VDP().kRenderWidth,
- VDP().kRenderHeight);
+ VDP(0).kRenderWidth,
+ VDP(0).kRenderHeight);
if (!_render_texture) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create texture: %s\n", SDL_GetError());
SDL_Quit();
@@ -85,9 +85,9 @@ void Graphics::Render(const VDP& vdp)
// TODO probably should return and propagate error
abort();
}
- assert(pitch == VDP().kRenderWidth * sizeof(*buffer));
+ assert(pitch == VDP(0).kRenderWidth * sizeof(*buffer));
(void) pitch;
- memcpy(pixels, buffer, VDP().kRenderWidth * VDP().kRenderHeight * sizeof(*buffer));
+ memcpy(pixels, buffer, VDP(0).kRenderWidth * VDP(0).kRenderHeight * sizeof(*buffer));
SDL_UnlockTexture(_render_texture);
SDL_RenderClear(_renderer);
SDL_RenderCopy(_renderer, _render_texture, NULL, NULL);