Commit de4aa7fd authored by Sergio Costas's avatar Sergio Costas

Merge branch 'sdl2'

parents 52b99b08 33fb0536
# VERSIONS #
* Version 4.0.0 (2018-08-11)
* 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)
......
......@@ -25,23 +25,7 @@ architectures. Please, read the file PORTS to know more details about this.
FBZX is based in Z80FREE, which you can find into the folder z80free.
To work with FBZX you need:
* A FrameBuffer-capable graphic card (or compatible with X-windows)
* A Linux system with FrameBuffer configured (can use X too)
* Sound Card with ALSA or OSS drivers (optional)
In order to get the maximum performance, your FrameBuffer driver must allow to
change to 640x480 or 480x640 resolution in 8 bits. Only the old VESAFB driver can
have problems with this fact, so if you use this driver, be sure to boot your
Linux box in 640x480 in 8 bits. If you don't do this, SDL will emulate that
mode, resulting in a high performance penalty. If you use an specific Framebuffer
driver, or the VESAFB driver from kernels 2.6, just don't worry: FBZX will
automagically change the graphic mode when starts.
Of course, currently that is no problem thanks to the high speed of computers.
## WHAT CAPABILITIES HAVE FBZX?
## WHAT CAPABILITIES HAVE FBZX
FBZX can emulate the original 48K spectrum (issue 2 and issue 3), the original
128K, the Amstrad +2, the Amstrad +2A and the Spanish 128K.
......@@ -69,7 +53,7 @@ with the cursor keys (fire is emulated with the right ALT key, ALT-GR
key, WINDOWS MENU key or WINDOWS SYSTEM right key), or with a real
JoyStick.
## HOW DO I USE FBZX?
## HOW DO I USE FBZX
To run FBZX just type
......@@ -117,9 +101,17 @@ You can change the order with
That way it will try firts with OSS, then with ALSA.
FBZX works in X too, but it would run slower due to the penalty of the X
FBZX works in X and Wayland too, but it would run slower due to the penalty of the X
Window System. Fortunately this only applies to old systems. Current
computers can run FBZX under X without problem.
computers can run FBZX under X or Wayland without problem.
Anyway, there is a command line option to get the maximum performance. This
is -setres. Using it, when switching to fullscreen it will try to change the
screen resolution to the right one. But it only works in Xwindows; in
Wayland, or when not using that option, FBZX will keep the current resolution
and scale the picture. If you have a graphics driver with hardware acceleration,
you won't have performance problems anyway, so this mode is better than changing
the resolution.
The PC keyboard works exactly like the Spectrum keyboard (but only numbers and
letters). ENTER key is Return, CAPS SHIFT is in both Shift keys, and SYMBOL
......@@ -165,7 +157,7 @@ F12 is volume up.
If your system doesn't have function keys, you can use TAB plus keys 0 to 9
to emulate them (F11 is TAB and O, and F12 is TAB and P).
## HOW DO I CHOOSE A FILE WITH THE TAP/TZX OR Z80/SNA SELECTOR?
## HOW TO CHOOSE A FILE WITH THE TAP/TZX OR Z80/SNA SELECTOR
You can choose a file just by moving the white bar with the cursor keys. You
can use also the RePag and AvPag to jump over 12 positions.
......@@ -182,7 +174,7 @@ to save from programs that use them (it can save programs without header, too,
since the emulator intercepts the call to SA-BYTES). Each new block is added at
the end of the file, but only if the SAVE operation is enabled for this file.
## HOW DOES WORK THE FAST SPEED LOAD FOR TAP/TZX FILES?
## HOW DOES WORK THE FAST SPEED LOAD FOR TAP/TZX FILES
Just type LOAD "" in the emulator (or choose the TAPE LOADER option in the 128K
menu) and the tape will automagically load. This only works with programs that
......@@ -206,7 +198,7 @@ change the TURBO WHILE PLAYING mode to ENABLED, so the computer (and the tape)
will run faster when the tape is playing (F6 key), but will return to normal
speed when the tape is paused (F5 key or end-of-tape).
## HOW DOES WORK THE FAST SPEED SAVE FOR TAP/TZX FILES?
## HOW DOES WORK THE FAST SPEED SAVE FOR TAP/TZX FILES
If write is enabled, using the SAVE command will add blocks to the currently
selected tape file, no matter if FAST-LOAD is enabled or not. By default,
......@@ -215,7 +207,7 @@ new TAP/TZX file is created from scratch. This functionality works with any
program that uses the SA-BYTES ROM routine, no matter if enters at 04C2 (like
the classic spectrum 48K rom) or at 04C6 (like the Spectrum +3).
## HOW DOES WORK THE INTERFACE I AND MICRODRIVE EMULATION?
## HOW DOES WORK THE INTERFACE I AND MICRODRIVE EMULATION
FBZX can emulate an Interface I with one microdrive attached, but only when
working as Spectrum 48K, 128K or +2, never as +2A/+3 since it's incompatible.
......
CC=g++ -c -O2 -g
CPP=g++ -c -O2 -g
LN=g++ -O2 -g
FLAGS = -O2
CFLAGS += `pkg-config --cflags sdl libpulse-simple alsa` -D D_SOUND_PULSE -D D_SOUND_ALSA -D D_SOUND_OSS
CPPFLAGS += `pkg-config --cflags sdl libpulse-simple alsa` -D D_SOUND_PULSE -D D_SOUND_ALSA -D D_SOUND_OSS
LDFLAGS += `pkg-config --libs sdl libpulse-simple alsa`
CC=g++ -c $(FLAGS)
CPP=g++ -c $(FLAGS)
LN=g++
CFLAGS += `pkg-config --cflags sdl2 libpulse-simple alsa` -D D_SOUND_PULSE -D D_SOUND_ALSA -D D_SOUND_OSS
CPPFLAGS += `pkg-config --cflags sdl2 libpulse-simple alsa` -D D_SOUND_PULSE -D D_SOUND_ALSA -D D_SOUND_OSS
LDFLAGS += `pkg-config --libs sdl2 libpulse-simple alsa`
fbzx: cargador.o cmdline.o computer.o emulator.o keyboard.o llscreen.o llsound.o menus.o microdrive.o mouse.o osd.o screen.o signals.o spk_ay.o tape.o Z80free.o Z80free_codes.o Z80free_codesCB.o Z80free_codesED.o Z80free_codesDD.o Z80free_codesFD.o Z80free_codesDDCB.o Z80free_codesFDCB.o
......@@ -78,3 +80,4 @@ spk_ay.o: spk_ay.cpp spk_ay.hh llsound.hh computer.hh screen.hh signals.hh llscr
tape.o: tape.cpp z80free/Z80free.h tape.hh signals.hh emulator.hh screen.hh osd.hh computer.hh llscreen.hh
$(CPP) $(CPPFLAGS) -o tape.o tape.cpp
CC=g++ -c -O2
CPP=g++ -c -O2
LN=g++ -O2
FLAGS = -O2
CFLAGS += `pkg-config --cflags sdl libpulse-simple alsa` -D D_SOUND_PULSE -D D_SOUND_ALSA -D D_SOUND_OSS
CPPFLAGS += `pkg-config --cflags sdl libpulse-simple alsa` -D D_SOUND_PULSE -D D_SOUND_ALSA -D D_SOUND_OSS
LDFLAGS += `pkg-config --libs sdl libpulse-simple alsa`
CC=g++ -c $(FLAGS)
CPP=g++ -c $(FLAGS)
LN=g++
CFLAGS += `pkg-config --cflags sdl2 libpulse-simple alsa` -D D_SOUND_PULSE -D D_SOUND_ALSA -D D_SOUND_OSS
CPPFLAGS += `pkg-config --cflags sdl2 libpulse-simple alsa` -D D_SOUND_PULSE -D D_SOUND_ALSA -D D_SOUND_OSS
LDFLAGS += `pkg-config --libs sdl2 libpulse-simple alsa`
#basecmd $(CPP) $(CPPFLAGS)
#extra_obj Z80free.o Z80free_codes.o Z80free_codesCB.o Z80free_codesED.o Z80free_codesDD.o Z80free_codesFD.o Z80free_codesDDCB.o Z80free_codesFDCB.o
......
This diff is collapsed.
......@@ -22,10 +22,9 @@
#include "z80free/Z80free.h"
struct z80snapshot {
byte A,F,B,C,D,E,H,L,AA,FF,BB,CC,DD,EE,HH,LL,R,I,IFF1,IFF2,Imode;
byte A, F, B, C, D, E, H, L, AA, FF, BB, CC, DD, EE, HH, LL, R, I, IFF1, IFF2, Imode;
bool issue_3;
word PC,IX,IY,SP;
word PC, IX, IY, SP;
byte type; // bit 0/1: 48K/128K/+3
byte border; // border color
byte pager; // content of pagination register in 128K mode
......@@ -34,11 +33,10 @@ struct z80snapshot {
unsigned char ay_regs[16];
unsigned char ay_latch;
unsigned char joystick;
};
int save_z80(char *);
int load_z80(const char *);
int load_sna(const char *);
void load_snap(struct z80snapshot *);
void uncompress_z80(FILE *,int,unsigned char *);
void uncompress_z80(FILE *, int, unsigned char *);
......@@ -12,8 +12,7 @@ using namespace std;
#include <stdlib.h>
#include "cmdline.hh"
CMDLine::CMDLine(int argc,char **argv) {
CMDLine::CMDLine(int argc, char **argv) {
int argumento;
this->nosound = false;
......@@ -30,12 +29,13 @@ CMDLine::CMDLine(int argc,char **argv) {
this->color = false;
this->ss = false;
this->jump = 0;
this->setres = false;
this->gamefile = "";
argumento = 0;
while(argumento<argc) {
if ((0==strcmp(argv[argumento],"-h"))||(0==strcmp(argv[argumento],"--help"))) {
while (argumento < argc) {
if ((0 == strcmp(argv[argumento], "-h")) || (0 == strcmp(argv[argumento], "--help"))) {
printf("\nUsage: fbzx [-nosound] ");
#ifdef D_SOUND_ALSA
printf("[-alsa] ");
......@@ -69,64 +69,67 @@ 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")) {
} else if (0 == strcmp(argv[argumento], "-nosound")) {
this->nosound = true;
argumento++;
} else if(0==strcmp(argv[argumento],"-mini")) {
} else if (0 == strcmp(argv[argumento], "-mini")) {
this->mini = true;
argumento++;
#ifdef D_SOUND_PULSE
} else if(0==strcmp(argv[argumento],"-pulse")) {
} else if (0 == strcmp(argv[argumento], "-pulse")) {
this->pulse = true;
argumento++;
#endif
#ifdef D_SOUND_ALSA
} else if(0==strcmp(argv[argumento],"-alsa")) {
} else if (0 == strcmp(argv[argumento], "-alsa")) {
this->alsa = true;
argumento++;
#endif
#ifdef D_SOUND_OSS
} else if(0==strcmp(argv[argumento],"-oss")) {
} else if (0 == strcmp(argv[argumento], "-oss")) {
this->oss = true;
argumento++;
#endif
} else if(0==strcmp(argv[argumento],"-rotate")) {
} else if (0 == strcmp(argv[argumento], "-rotate")) {
this->rotate = true;
argumento++;
} else if(0==strcmp(argv[argumento],"-fs")) {
} else if (0 == strcmp(argv[argumento], "-fs")) {
this->fs = true;
argumento++;
} else if(0==strcmp(argv[argumento],"-hw")) {
} else if (0 == strcmp(argv[argumento], "-setres")) {
this->setres = true;
argumento++;
} else if (0 == strcmp(argv[argumento], "-hw")) {
this->hw = true;
argumento++;
} else if(0==strcmp(argv[argumento],"-db")) {
} else if (0 == strcmp(argv[argumento], "-db")) {
this->db = true;
argumento++;
} else if(0==strcmp(argv[argumento],"-ds")) {
} else if (0 == strcmp(argv[argumento], "-ds")) {
this->ds = true;
argumento++;
} else if(0==strcmp(argv[argumento],"-bw")) {
} else if (0 == strcmp(argv[argumento], "-bw")) {
this->bw = true;
argumento++;
} else if(0==strcmp(argv[argumento],"-color")) {
} else if (0 == strcmp(argv[argumento], "-color")) {
this->color = true;
argumento++;
} else if(0==strcmp(argv[argumento],"-ss")) {
} else if (0 == strcmp(argv[argumento], "-ss")) {
this->ss = true;
argumento++;
} else if(0==strncmp(argv[argumento],"-jump",5)) {
} else if (0 == strncmp(argv[argumento], "-jump", 5)) {
/*jump_frames=(int)(argv[argumento][5]);
jump_frames-=48;*/
this->jump = (int)(argv[argumento][5]);
* jump_frames-=48;*/
this->jump = (int) (argv[argumento][5]);
this->jump -= '0';
argumento++;
} else {
this->gamefile = argv[argumento];
//strcpy(this->gamefile,argv[argumento]);
// strcpy(this->gamefile,argv[argumento]);
argumento++;
}
}
}
......@@ -9,9 +9,7 @@
#define SRC_CMDLINE_HH_
class CMDLine {
public:
bool nosound;
bool mini;
bool pulse;
......@@ -25,14 +23,11 @@ public:
bool bw;
bool color;
bool ss;
bool setres;
int jump;
string gamefile;
CMDLine(int argc,char **argv);
CMDLine(int argc, char **argv);
};
#endif /* SRC_CMDLINE_HH_ */
This diff is collapsed.
......@@ -20,8 +20,8 @@
#ifndef computer_h
#define computer_h
#include <SDL/SDL.h>
#include <SDL/SDL_thread.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_thread.h>
#include "tape.hh"
#include "z80free/Z80free.h"
......@@ -40,12 +40,31 @@ extern char salir;
extern class computer *ordenador;
enum tapmodes {TAP_GUIDE, TAP_DATA, TAP_PAUSE, TAP_TRASH, TAP_STOP, TAP_PAUSE2, TZX_PURE_TONE,
TZX_SEQ_PULSES, TAP_FINAL_BIT, TAP_PAUSE3};
enum tapmodes {
TAP_GUIDE,
TAP_DATA,
TAP_PAUSE,
TAP_TRASH,
TAP_STOP,
TAP_PAUSE2,
TZX_PURE_TONE,
TZX_SEQ_PULSES,
TAP_FINAL_BIT,
TAP_PAUSE3
};
enum taptypes {TAP_TAP, TAP_TZX};
enum taptypes {
TAP_TAP,
TAP_TZX
};
enum CurrentMode {MODE_48K, MODE_128K, MODE_P2, MODE_P3, MODE_128K_SPA};
enum CurrentMode {
MODE_48K,
MODE_128K,
MODE_P2,
MODE_P3,
MODE_128K_SPA
};
class computer : public Signals {
public:
......@@ -61,7 +80,7 @@ public:
// Linux joystick private global variables
unsigned char updown,leftright;
unsigned char updown, leftright;
// Sound variables
unsigned char sound_bit;
......@@ -75,7 +94,6 @@ public:
enum CurrentMode current_mode;
unsigned char port254;
// tape global variables
string current_tap;
......@@ -84,9 +102,9 @@ public:
// pagination global variables
unsigned char mport1,mport2; // ports for memory management (128K and +3)
unsigned char mport1, mport2; // ports for memory management (128K and +3)
unsigned int video_offset; // 0 for page 5, and 32768 for page 7
unsigned char *block0,*block1,*block2,*block3; // pointers for memory access (one for each 16K block).
unsigned char *block0, *block1, *block2, *block3; // pointers for memory access (one for each 16K block).
unsigned char page48k; // 1 if the 48K ROM page is currently paged into
// public
......@@ -106,10 +124,10 @@ public:
void emulate(int);
void do_contention(bool io, word addr);
uint8_t read_memory(uint16_t Addr);
void write_memory (uint16_t Addr, uint8_t Value);
void write_memory(uint16_t Addr, uint8_t Value);
};
void fill_audio(void *udata,Uint8 *,int);
void fill_audio(void *udata, Uint8 *, int);
void ResetComputer();
#endif
This diff is collapsed.
This diff is collapsed.
......@@ -13,7 +13,6 @@
class Keyboard *keyboard;
Keyboard::Keyboard() {
this->s8 = this->s9 = this->s10 = this->s11 = this->s12 = this->s13 = this->s14 = this->s15 = 0xFF;
this->k8 = this->k9 = this->k10 = this->k11 = this->k12 = this->k13 = this->k14 = this->k15 = 0;
this->tab_extended = false;
......@@ -32,130 +31,134 @@ Keyboard::Keyboard() {
}
void Keyboard::reset() {
this->s8|=0x1F;
this->s9|=0x1F;
this->s10|=0x1F;
this->s11|=0x1F;
this->s12|=0x1F;
this->s13|=0x1F;
this->s14|=0x1F;
this->s15|=0x1F;
this->js=0;
this->s8 |= 0x1F;
this->s9 |= 0x1F;
this->s10 |= 0x1F;
this->s11 |= 0x1F;
this->s12 |= 0x1F;
this->s13 |= 0x1F;
this->s14 |= 0x1F;
this->s15 |= 0x1F;
this->js = 0;
}
// Read the keyboard and mouse, and stores the flags
void Keyboard::read_keyboard (SDL_Event *pevento2) {
void Keyboard::read_keyboard(SDL_Event *pevento2) {
unsigned int temporal_io;
SDL_Event evento,evento2,*pevento;
SDL_Event evento, evento2, *pevento;
Sint16 valor;
Uint8 eje;
if (pevento2==NULL) {
pevento=&evento;
if (!SDL_PollEvent (&evento))
if (pevento2 == NULL) {
pevento = &evento;
if (!SDL_PollEvent(&evento)) {
return;
}
} else {
pevento=pevento2;
pevento = pevento2;
}
if (pevento->type==SDL_QUIT) {
if (pevento->type == SDL_QUIT) {
salir = 0;
return;
}
if (pevento->type==SDL_MOUSEMOTION) {
if (pevento->type == SDL_MOUSEMOTION) {
this->mouse_x += pevento->motion.xrel;
this->mouse_y += pevento->motion.yrel;
return;
}
if (pevento->type==SDL_MOUSEBUTTONDOWN) {
if (pevento->type == SDL_MOUSEBUTTONDOWN) {
switch (pevento->button.button) {
case SDL_BUTTON_LEFT:
this->mouse_left = true;
break;
case SDL_BUTTON_MIDDLE:
this->mouse_center = true;
break;
case SDL_BUTTON_RIGHT:
this->mouse_right = true;
break;
}
}
if (pevento->type==SDL_MOUSEBUTTONUP) {
if (pevento->type == SDL_MOUSEBUTTONUP) {
switch (pevento->button.button) {
case SDL_BUTTON_LEFT:
this->mouse_left = false;
break;
case SDL_BUTTON_MIDDLE:
this->mouse_center = false;
break;
case SDL_BUTTON_RIGHT:
this->mouse_right = false;
break;
}
}
if (pevento->type==SDL_JOYBUTTONDOWN) {
pevento->type=SDL_KEYDOWN;
pevento->key.keysym.sym=SDLK_MENU; // emulate pressing the MENU key
if (pevento->type == SDL_JOYBUTTONDOWN) {
pevento->type = SDL_KEYDOWN;
pevento->key.keysym.sym = SDLK_MENU; // emulate pressing the MENU key
}
if (pevento->type==SDL_JOYBUTTONUP) {
pevento->type=SDL_KEYUP;
pevento->key.keysym.sym=SDLK_MENU; // emulate depressing the MENU key
if (pevento->type == SDL_JOYBUTTONUP) {
pevento->type = SDL_KEYUP;
pevento->key.keysym.sym = SDLK_MENU; // emulate depressing the MENU key
}
if (pevento->type==SDL_JOYAXISMOTION) {
eje=pevento->jaxis.axis;
valor=pevento->jaxis.value;
if (pevento->type == SDL_JOYAXISMOTION) {
eje = pevento->jaxis.axis;
valor = pevento->jaxis.value;
evento2.type=SDL_KEYUP;
if ((valor<16384)&&(valor>-16384)) { // JoyStick centered
pevento->type=SDL_KEYUP;
if (eje==1) {
evento2.key.keysym.sym=SDLK_DOWN;
pevento->key.keysym.sym=SDLK_UP; // pull up both keys
evento2.type = SDL_KEYUP;
if ((valor < 16384) && (valor > -16384)) { // JoyStick centered
pevento->type = SDL_KEYUP;
if (eje == 1) {
evento2.key.keysym.sym = SDLK_DOWN;
pevento->key.keysym.sym = SDLK_UP; // pull up both keys
read_keyboard(&evento2);
}
if (eje==0) {
evento2.key.keysym.sym=SDLK_LEFT;
pevento->key.keysym.sym=SDLK_RIGHT;
if (eje == 0) {
evento2.key.keysym.sym = SDLK_LEFT;
pevento->key.keysym.sym = SDLK_RIGHT;
read_keyboard(&evento2);
}
} else { // JoyStick moved
if (eje==0) {
if (valor>=0) {
evento2.key.keysym.sym=SDLK_LEFT; // pull up LEFT
if (eje == 0) {
if (valor >= 0) {
evento2.key.keysym.sym = SDLK_LEFT; // pull up LEFT
read_keyboard(&evento2);
pevento->key.keysym.sym=SDLK_RIGHT; // and press RIGHT
pevento->key.keysym.sym = SDLK_RIGHT; // and press RIGHT
} else {
evento2.key.keysym.sym=SDLK_RIGHT; // pull up RIGHT
evento2.key.keysym.sym = SDLK_RIGHT; // pull up RIGHT
read_keyboard(&evento2);
pevento->key.keysym.sym=SDLK_LEFT; // and press LEFT
pevento->key.keysym.sym = SDLK_LEFT; // and press LEFT
}
}
if (eje==1) {
if (valor<0) {
evento2.key.keysym.sym=SDLK_DOWN; // pull up DOWN
pevento->key.keysym.sym=SDLK_UP; // and press UP
if (eje == 1) {
if (valor < 0) {
evento2.key.keysym.sym = SDLK_DOWN; // pull up DOWN
pevento->key.keysym.sym = SDLK_UP; // and press UP
read_keyboard(&evento2);
} else {
evento2.key.keysym.sym=SDLK_UP; // pull up UP
pevento->key.keysym.sym=SDLK_DOWN; // and press DOWN
evento2.key.keysym.sym = SDLK_UP; // pull up UP
pevento->key.keysym.sym = SDLK_DOWN; // and press DOWN
read_keyboard(&evento2);
}
}
pevento->type=SDL_KEYDOWN;
pevento->type = SDL_KEYDOWN;
}
}
if ((pevento->type != SDL_KEYDOWN) && (pevento->type != SDL_KEYUP))
if ((pevento->type != SDL_KEYDOWN) && (pevento->type != SDL_KEYUP)) {
return;
}
this->k8 = this->k9 = this->k10 = this->k11 =
this->k12 = this->k13 = this->k14 =
......@@ -164,10 +167,10 @@ void Keyboard::read_keyboard (SDL_Event *pevento2) {
temporal_io = (unsigned int) pevento->key.keysym.sym;
if ((pevento->type==SDL_KEYUP)&&(temporal_io==SDLK_TAB)) {
if ((pevento->type == SDL_KEYUP) && (temporal_io == SDLK_TAB)) {
if (!this->tab_extended) {
this->tab_extended = true;
osd->set_message("Function Key mode on",2000);
osd->set_message("Function Key mode on", 2000);
return;
} else {
this->tab_extended = false;
......@@ -176,67 +179,81 @@ void Keyboard::read_keyboard (SDL_Event *pevento2) {
}
}
if ((pevento->type==SDL_KEYDOWN)&&(this->tab_extended))
if ((pevento->type == SDL_KEYDOWN) && (this->tab_extended)) {
return;
}
if ((pevento->type==SDL_KEYUP)&&(this->tab_extended)) {
if ((pevento->type == SDL_KEYUP) && (this->tab_extended)) {
this->tab_extended = false;
osd->clear_message();
switch(temporal_io) {
switch (temporal_io) {
case SDLK_1:
temporal_io=SDLK_F1;
temporal_io = SDLK_F1;
break;
case SDLK_2:
temporal_io=SDLK_F2;
temporal_io = SDLK_F2;
break;
case SDLK_3:
temporal_io=SDLK_F3;
temporal_io = SDLK_F3;
break;
case SDLK_4:
temporal_io=SDLK_F4;
temporal_io = SDLK_F4;
break;
case SDLK_5:
temporal_io=SDLK_F5;
temporal_io = SDLK_F5;
break;
case SDLK_6:
temporal_io=SDLK_F6;
temporal_io = SDLK_F6;
break;
case SDLK_7:
temporal_io=SDLK_F7;
temporal_io = SDLK_F7;
break;
case SDLK_8:
temporal_io=SDLK_F8;
temporal_io = SDLK_F8;
break;
case SDLK_9:
temporal_io=SDLK_F9;
temporal_io = SDLK_F9;
break;
case SDLK_0:
temporal_io=SDLK_F10;
temporal_io = SDLK_F10;
break;
case SDLK_o:
temporal_io=SDLK_F11;
temporal_io = SDLK_F11;
break;
case SDLK_p:
temporal_io=SDLK_F12;
temporal_io = SDLK_F12;
break;
}
}
if (pevento->type == SDL_KEYUP)
if (pevento->type == SDL_KEYUP) {
switch (temporal_io) {
case SDLK_ESCAPE: // to exit from the emulator
if (!this->esc_again) {
this->esc_again = true;
osd->set_message("ESC again to exit",2000);
} else
osd->set_message("ESC again to exit", 2000);
} else {
salir = 0;
}
return;
break;
case SDLK_F1:
help_menu (); // shows the help menu
help_menu(); // shows the help menu
break;
case SDLK_F2:
......@@ -266,7 +283,7 @@ void Keyboard::read_keyboard (SDL_Event *pevento2) {
break;
case SDLK_F10: // Reset emulator
ResetComputer ();
ResetComputer();
OOTape->set_pause(true);
OOTape->rewind();
break;
......@@ -279,27 +296,30 @@ void Keyboard::read_keyboard (SDL_Event *pevento2) {
llsound->increase_volume();
break;
}
}
// reorder joystick if screen is rotated
if(ordenador->zaurus_mini==2) {