Commit 44ba96f7 authored by Sergio Costas's avatar Sergio Costas

Now allows to choose whether to try change the screen resolution when...

Now allows to choose whether to try change the screen resolution when switching to fullscreen, or just scale the picture
parent 7344ca47
# VERSIONS #
* Version 4.0.0 (2018-08-11)
* Ported to SDL2
* Now fullscreen works fine with Wayland (ported to SDL2)
* Version 3.9.1 (2018-05-01)
* Removed unused printfs
* Version 3.9.0 (2018-05-01)
......
......@@ -30,6 +30,7 @@ CMDLine::CMDLine(int argc,char **argv) {
this->color = false;
this->ss = false;
this->jump = 0;
this->setres = false;
this->gamefile = "";
argumento = 0;
......@@ -69,6 +70,7 @@ CMDLine::CMDLine(int argc,char **argv) {
printf(" -bw: emulate black&white TV set\n");
printf(" -color: emulate a color TV set\n");
printf(" -jump N: show one TV refresh and jump over N refreshes (for slow systems)\n");
printf(" -setres: when setting fullscreen mode, try to change the screen resolution\n");
printf(" gamefile: an optional .Z80 snapshot or .TAP/.TZX tape file\n\n");
exit(0);
} else if(0==strcmp(argv[argumento],"-nosound")) {
......@@ -98,6 +100,9 @@ CMDLine::CMDLine(int argc,char **argv) {
} else if(0==strcmp(argv[argumento],"-fs")) {
this->fs = true;
argumento++;
} else if(0==strcmp(argv[argumento],"-setres")) {
this->setres = true;
argumento++;
} else if(0==strcmp(argv[argumento],"-hw")) {
this->hw = true;
argumento++;
......
......@@ -25,6 +25,7 @@ public:
bool bw;
bool color;
bool ss;
bool setres;
int jump;
string gamefile;
......
......@@ -300,7 +300,7 @@ void Z80free_Out (word Port, byte Value) {
// Microdrive access
register word maskport;
word maskport;
extra_contention();
if (ordenador->current_mode != MODE_P3) {
......
......@@ -381,10 +381,10 @@ int main(int argc,char *argv[]) {
osd = new OSD();
if ((!parse.mini) && (!parse.rotate)) {
llscreen = new LLScreen(640,480,0,0,parse.db,parse.hw);
llscreen = new LLScreen(640,480,0,0,parse.db,parse.hw, parse.setres);
llscreen->rotate = false;
} else {
llscreen = new LLScreen(480,640,0,0,parse.db,parse.hw);
llscreen = new LLScreen(480,640,0,0,parse.db,parse.hw, parse.setres);
llscreen->rotate = true;
}
......
......@@ -25,9 +25,10 @@
LLScreen *llscreen = NULL;
LLScreen::LLScreen(int16_t resx, int16_t resy, uint8_t depth, bool fullscreen, bool dblbuffer, bool hwsurface) {
LLScreen::LLScreen(int16_t resx, int16_t resy, uint8_t depth, bool fullscreen, bool dblbuffer, bool hwsurface, bool setres) {
int retorno, bucle, valores;
this->setres = setres;
this->fullscreen = fullscreen;
this->rotate = false;
this->cheight = (charset.max_top > charset.height_maxtop) ? charset.max_top : charset.height_maxtop;
......@@ -186,7 +187,11 @@ void LLScreen::fullscreen_switch() {
SDL_SetWindowFullscreen(this->sdlwindow, 0);
} else {
this->fullscreen = true;
SDL_SetWindowFullscreen(this->sdlwindow, SDL_WINDOW_FULLSCREEN_DESKTOP);
if (this->setres) {
SDL_SetWindowFullscreen(this->sdlwindow, SDL_WINDOW_FULLSCREEN);
} else {
SDL_SetWindowFullscreen(this->sdlwindow, SDL_WINDOW_FULLSCREEN_DESKTOP);
}
}
this->set_mouse();
}
......
......@@ -38,6 +38,7 @@ class LLScreen {
uint32_t height;
uint8_t ulaplus_palete[64]; // contains the current palete
uint32_t colors[80];
bool setres;
uint8_t printchar(uint8_t character, int16_t x, int16_t y, uint8_t color, uint8_t back);
......@@ -52,7 +53,7 @@ public:
uint32_t lines_in_screen;
bool fullscreen;
LLScreen(int16_t resx, int16_t resy, uint8_t depth, bool fullscreen, bool dblbuffer, bool hwsurface);
LLScreen(int16_t resx, int16_t resy, uint8_t depth, bool fullscreen, bool dblbuffer, bool hwsurface, bool setres);
~LLScreen();
ifstream *myfopen(string, ios_base::openmode);
void print_string(string message, int16_t x, float y, uint8_t ink, uint8_t paper);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment