Commit 9e16e327 authored by Sergio Costas's avatar Sergio Costas

Changes to try to port to SDL2

parent 611a77af
CC=g++ -c -O2 -g
CPP=g++ -c -O2 -g
LN=g++ -O2 -g
CC=g++ -c -O2
CPP=g++ -c -O2
LN=g++ -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`
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
......@@ -15,22 +15,22 @@ Z80free.o: z80free/Z80free.c z80free/Z80free.h
Z80free_codes.o: z80free/Z80free_codes.c z80free/Z80free.h
$(CC) -o Z80free_codes.o z80free/Z80free_codes.c
Z80free_codesCB.o: z80free/Z80free_codesCB.c z80free/Z80free.h
$(CC) -o Z80free_codesCB.o z80free/Z80free_codesCB.c
Z80free_codesED.o: z80free/Z80free_codesED.c z80free/Z80free.h
$(CC) -o Z80free_codesED.o z80free/Z80free_codesED.c
Z80free_codesDD.o: z80free/Z80free_codesDD.c z80free/Z80free.h
$(CC) -o Z80free_codesDD.o z80free/Z80free_codesDD.c
Z80free_codesFD.o: z80free/Z80free_codesFD.c z80free/Z80free.h
$(CC) -o Z80free_codesFD.o z80free/Z80free_codesFD.c
Z80free_codesDDCB.o: z80free/Z80free_codesDDCB.c z80free/Z80free.h
$(CC) -o Z80free_codesDDCB.o z80free/Z80free_codesDDCB.c
Z80free_codesFDCB.o: z80free/Z80free_codesFDCB.c z80free/Z80free.h
$(CC) -o Z80free_codesFDCB.o z80free/Z80free_codesFDCB.c
......@@ -78,3 +78,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
......@@ -2,9 +2,9 @@ CC=g++ -c -O2
CPP=g++ -c -O2
LN=g++ -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`
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
......@@ -17,21 +17,21 @@ Z80free.o: z80free/Z80free.c z80free/Z80free.h
Z80free_codes.o: z80free/Z80free_codes.c z80free/Z80free.h
$(CC) -o Z80free_codes.o z80free/Z80free_codes.c
Z80free_codesCB.o: z80free/Z80free_codesCB.c z80free/Z80free.h
$(CC) -o Z80free_codesCB.o z80free/Z80free_codesCB.c
Z80free_codesED.o: z80free/Z80free_codesED.c z80free/Z80free.h
$(CC) -o Z80free_codesED.o z80free/Z80free_codesED.c
Z80free_codesDD.o: z80free/Z80free_codesDD.c z80free/Z80free.h
$(CC) -o Z80free_codesDD.o z80free/Z80free_codesDD.c
Z80free_codesFD.o: z80free/Z80free_codesFD.c z80free/Z80free.h
$(CC) -o Z80free_codesFD.o z80free/Z80free_codesFD.c
Z80free_codesDDCB.o: z80free/Z80free_codesDDCB.c z80free/Z80free.h
$(CC) -o Z80free_codesDDCB.o z80free/Z80free_codesDDCB.c
Z80free_codesFDCB.o: z80free/Z80free_codesFDCB.c z80free/Z80free.h
$(CC) -o Z80free_codesFDCB.o z80free/Z80free_codesFDCB.c
\ No newline at end of file
......@@ -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"
......
......@@ -446,7 +446,6 @@ int main(int argc,char *argv[]) {
llscreen->fullscreen_switch();
}
SDL_WM_SetCaption("FBZX","");
ordenador->interr=0;
// assign initial values for PATH variables
......
......@@ -385,10 +385,9 @@ void Keyboard::read_keyboard (SDL_Event *pevento2) {
break;
case SDLK_RALT:
case SDLK_RMETA:
case SDLK_LMETA:
case SDLK_RSUPER:
case SDLK_LSUPER:
case SDLK_RGUI:
case SDLK_LGUI:
case SDLK_OPER:
case SDLK_MENU:
switch (this->joystick) {
case 0: // cursor
......
......@@ -9,7 +9,7 @@
#define SRC_KEYBOARD_HH_
#include <inttypes.h>
#include <SDL/SDL.h>
#include <SDL2/SDL.h>
enum JOYSTICK_TYPE { JOYSTICK_CURSOR, JOYSTICK_KEMPSTON, JOYSTICK_SINCLAIR1, JOYSTICK_SINCLAIR2};
......
......@@ -56,22 +56,18 @@ LLScreen::LLScreen(int16_t resx,int16_t resy,uint8_t depth,bool fullscreen,bool
}
// screen initialization
valores=SDL_HWPALETTE|SDL_ANYFORMAT;
valores=0;
if (fullscreen) {
valores|=SDL_FULLSCREEN;
valores|=SDL_WINDOW_FULLSCREEN;
}
if (dblbuffer) {
valores|=SDL_DOUBLEBUF;
}
valores|=SDL_SWSURFACE;
if (hwsurface) {
valores|=SDL_HWSURFACE;
} else {
valores|=SDL_SWSURFACE;
}
this->llscreen=SDL_SetVideoMode(resx,resy,depth,valores);
this->sdlwindow=SDL_CreateWindow("FBZX",
SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED,resx,resy,valores);
this->llscreen = SDL_CreateRenderer(this->sdlwindow, -1, 0);
if(this->llscreen==NULL) {
printf("Can't assign SDL Surface. Exiting\n");
exit(1);
......
......@@ -24,8 +24,8 @@ using namespace std;
#include <inttypes.h>
#include <string>
#include <SDL/SDL.h>
#include <SDL/SDL_thread.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_thread.h>
#include <iostream>
#include <fstream>
......@@ -46,7 +46,8 @@ public:
bool mustlock;
bool rotate;
uint32_t bpp;
SDL_Surface *llscreen;
SDL_Window *sdlwindow;
SDL_Renderer *llscreen;
uint32_t cheight;
uint32_t lines_in_screen;
......
......@@ -20,7 +20,7 @@
#ifndef SOUND_H
#define SOUND_H
#include <inttypes.h>
#include <SDL/SDL.h>
#include <SDL2/SDL.h>
#if 0
#define D_SOUND_PULSE
......
......@@ -25,7 +25,7 @@
#include <dirent.h>
#include <string.h>
#include <iostream>
#include <SDL/SDL.h>
#include <SDL2/SDL.h>
#include "z80free/Z80free.h"
#include "cargador.hh"
......
......@@ -3,7 +3,7 @@
#include "z80free/Z80free.h"
#include <inttypes.h>
#include <SDL/SDL.h>
#include <SDL2/SDL.h>
class Mouse {
......
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