Skip to content

Commit

Permalink
Merge pull request #11 from ogamespec/master
Browse files Browse the repository at this point in the history
lcd_scale
  • Loading branch information
ogamespec authored Jul 15, 2024
2 parents c951ff4 + 0f884f3 commit dc8a81f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
49 changes: 25 additions & 24 deletions lcd.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// platform crap (win32) - DIB-sections
#include "pch.h"

int lcd_scale = 4;
int lcd_fpslimit = 1;
int lcd_effect = 1; // possible values: 0,1

Expand Down Expand Up @@ -110,8 +111,8 @@ void win32_win_init(int width, int height)

rect.left = 0;
rect.top = 0;
rect.right = width * SCALE;
rect.bottom = height * SCALE;
rect.right = width * lcd_scale;
rect.bottom = height * lcd_scale;

AdjustWindowRect(&rect, WIN_STYLE, 0);

Expand Down Expand Up @@ -225,28 +226,28 @@ void win32_dib_shutdown()

void win32_dib_blit()
{
#if (SCALE != 1)

StretchBlt(
main_hdc,
0, 0,
dib_width * SCALE, -dib_height * SCALE,
hdcc,
0, 0,
dib_width, -dib_height,
SRCCOPY);

#else

BitBlt(
main_hdc,
0, 0,
dib_width, -dib_height,
hdcc,
0, 0,
SRCCOPY);

#endif
if (lcd_scale != 1) {

StretchBlt(
main_hdc,
0, 0,
dib_width * lcd_scale, -dib_height * lcd_scale,
hdcc,
0, 0,
dib_width, -dib_height,
SRCCOPY);
}
else {

BitBlt(
main_hdc,
0, 0,
dib_width, -dib_height,
hdcc,
0, 0,
SRCCOPY);

}
}

void lcd_refresh(int line)
Expand Down
3 changes: 1 addition & 2 deletions lcd.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once

#define SCALE 2

extern int lcd_scale;
extern int lcd_fpslimit;

extern uint8_t linebuffer[192];
Expand Down

0 comments on commit dc8a81f

Please sign in to comment.