This commit is contained in:
Flyinghead 2020-12-07 22:16:51 +01:00
parent d7c49c6522
commit a39199d379
4 changed files with 29 additions and 90 deletions

View File

@ -223,7 +223,7 @@ struct maple_sega_controller: maple_base
return 0x80; // unused
}
virtual MapleDeviceType get_device_type()
virtual MapleDeviceType get_device_type() override
{
return MDT_SegaController;
}
@ -238,7 +238,7 @@ struct maple_sega_controller: maple_base
return maple_sega_brand;
}
virtual u32 dma(u32 cmd)
virtual u32 dma(u32 cmd) override
{
//printf("maple_sega_controller::dma Called 0x%X;Command %d\n", bus_id, cmd);
switch (cmd)
@ -443,7 +443,7 @@ struct maple_sega_vmu: maple_base
u8 lcd_data[192];
u8 lcd_data_decoded[48*32];
virtual MapleDeviceType get_device_type()
virtual MapleDeviceType get_device_type() override
{
return MDT_SegaVMU;
}
@ -462,21 +462,21 @@ struct maple_sega_vmu: maple_base
return (rv == Z_OK && dec_sz == sizeof(flash_data));
}
virtual bool maple_serialize(void **data, unsigned int *total_size)
virtual bool maple_serialize(void **data, unsigned int *total_size) override
{
REICAST_SA(flash_data,128*1024);
REICAST_SA(lcd_data,192);
REICAST_SA(lcd_data_decoded,48*32);
return true ;
}
virtual bool maple_unserialize(void **data, unsigned int *total_size)
virtual bool maple_unserialize(void **data, unsigned int *total_size) override
{
REICAST_USA(flash_data,128*1024);
REICAST_USA(lcd_data,192);
REICAST_USA(lcd_data_decoded,48*32);
return true ;
}
virtual void OnSetup()
virtual void OnSetup() override
{
memset(flash_data, 0, sizeof(flash_data));
memset(lcd_data, 0, sizeof(lcd_data));
@ -534,7 +534,7 @@ struct maple_sega_vmu: maple_base
{
if (file) fclose(file);
}
virtual u32 dma(u32 cmd)
virtual u32 dma(u32 cmd) override
{
//printf("maple_sega_vmu::dma Called for port %d:%d, Command %d\n", bus_id, bus_port, cmd);
switch (cmd)
@ -1020,26 +1020,26 @@ struct maple_sega_purupuru : maple_base
u16 AST = 19, AST_ms = 5000;
u32 VIBSET;
virtual MapleDeviceType get_device_type()
virtual MapleDeviceType get_device_type() override
{
return MDT_PurupuruPack;
}
virtual bool maple_serialize(void **data, unsigned int *total_size)
virtual bool maple_serialize(void **data, unsigned int *total_size) override
{
REICAST_S(AST);
REICAST_S(AST_ms);
REICAST_S(VIBSET);
return true ;
}
virtual bool maple_unserialize(void **data, unsigned int *total_size)
virtual bool maple_unserialize(void **data, unsigned int *total_size) override
{
REICAST_US(AST);
REICAST_US(AST_ms);
REICAST_US(VIBSET);
return true ;
}
virtual u32 dma(u32 cmd)
virtual u32 dma(u32 cmd) override
{
switch (cmd)
{
@ -1162,12 +1162,12 @@ u8 kb_key[6]={0}; // normal keys pressed
struct maple_keyboard : maple_base
{
virtual MapleDeviceType get_device_type()
virtual MapleDeviceType get_device_type() override
{
return MDT_Keyboard;
}
virtual u32 dma(u32 cmd)
virtual u32 dma(u32 cmd) override
{
switch (cmd)
{
@ -1246,7 +1246,7 @@ s32 mo_y_abs;
struct maple_mouse : maple_base
{
virtual MapleDeviceType get_device_type()
virtual MapleDeviceType get_device_type() override
{
return MDT_Mouse;
}
@ -1262,7 +1262,7 @@ struct maple_mouse : maple_base
return (u16)lroundf(delta);
}
virtual u32 dma(u32 cmd)
virtual u32 dma(u32 cmd) override
{
switch (cmd)
{
@ -1344,12 +1344,12 @@ struct maple_lightgun : maple_base
return kcode | 0xFF01;
}
virtual MapleDeviceType get_device_type()
virtual MapleDeviceType get_device_type() override
{
return MDT_LightGun;
}
virtual u32 dma(u32 cmd)
virtual u32 dma(u32 cmd) override
{
switch (cmd)
{

View File

@ -431,18 +431,10 @@ void rend_start_render()
}
}
void rend_end_render()
{
#if 1 //also disabled the printf, it takes quite some time ...
#if !defined(_WIN32) && !(defined(__ANDROID__) || defined(TARGET_PANDORA))
//too much console spam.
//TODO: how about a counter?
//if (!re.state) printf("Render > Extended time slice ...\n");
#endif
#endif
if (pend_rend) {
if (pend_rend)
{
#if !defined(TARGET_NO_THREADS)
re.Wait();
#else

View File

@ -304,7 +304,6 @@ typedef void DYNACALL TaListVoidFP(void* data);
#define FPCB_SIZE (RAM_SIZE_MAX/2)
#define FPCB_MASK (FPCB_SIZE -1)
//#defeine FPCB_PAD 0x40000
#define FPCB_PAD 0x100000
#define FPCB_OFFSET (-(FPCB_SIZE*sizeof(void*) + FPCB_PAD))
struct Sh4RCB
@ -342,15 +341,6 @@ s32 rcb_noffs(T* ptr)
return rv;
}
template<typename T>
s32 rcb_poffs(T* ptr)
{
s32 rv= (u8*)ptr - (u8*)p_sh4rcb-sizeof(Sh4RCB);
verify(rv>=0);
return rv;
}
#define sh4rcb (*p_sh4rcb)
#define Sh4cntx (sh4rcb.cntx)

View File

@ -32,12 +32,6 @@
#include "joystick.h"
#endif
#ifdef TARGET_PANDORA
#include <signal.h>
#include <execinfo.h>
#include <sys/soundcard.h>
#endif
#if defined(USE_JOYSTICK)
/* legacy joystick input */
static int joystick_fd = -1; // Joystick file descriptor
@ -122,35 +116,6 @@ void os_CreateWindow()
void common_linux_setup();
void* rend_thread(void* p);
#ifdef TARGET_PANDORA
void clean_exit(int sig_num)
{
void* array[10];
size_t size;
if (joystick_fd >= 0) { close(joystick_fd); }
for (int port = 0; port < 4 ; port++)
{
if (evdev_controllers[port]->fd >= 0)
{
close(evdev_controllers[port]->fd);
}
}
x11_window_destroy();
// finish cleaning
if (sig_num!=0)
{
write(2, "\nSignal received\n", sizeof("\nSignal received\n"));
size = backtrace(array, 10);
backtrace_symbols_fd(array, size, STDERR_FILENO);
exit(1);
}
}
#endif
// Find the user config directory.
// The following folders are checked in this order:
// $HOME/.reicast
@ -380,10 +345,6 @@ std::vector<std::string> find_system_data_dirs()
int main(int argc, char* argv[])
{
LogManager::Init();
#ifdef TARGET_PANDORA
signal(SIGSEGV, clean_exit);
signal(SIGKILL, clean_exit);
#endif
// Set directories
set_user_config_dir(find_user_config_dir());
@ -395,13 +356,13 @@ int main(int argc, char* argv[])
INFO_LOG(BOOT, "Config dir is: %s", get_writable_config_path("").c_str());
INFO_LOG(BOOT, "Data dir is: %s", get_writable_data_path("").c_str());
#if defined(USE_SDL)
// init video now: on rpi3 it installs a sigsegv handler(?)
if (SDL_Init(SDL_INIT_VIDEO) != 0)
{
die("SDL: Initialization failed!");
}
#endif
#if defined(USE_SDL)
// init video now: on rpi3 it installs a sigsegv handler(?)
if (SDL_Init(SDL_INIT_VIDEO) != 0)
{
die("SDL: Initialization failed!");
}
#endif
common_linux_setup();
@ -412,15 +373,11 @@ int main(int argc, char* argv[])
rend_thread(NULL);
#ifdef TARGET_PANDORA
clean_exit(0);
#endif
dc_term();
#if defined(USE_EVDEV)
input_evdev_close();
#endif
#if defined(USE_EVDEV)
input_evdev_close();
#endif
#if defined(SUPPORT_X11)
x11_window_destroy();