Update the other ports as to make use of LOCKING.

Also move the older GCW0 port to its own separate folder for the GKD350H.
This commit is contained in:
gameblabla 2020-01-02 13:53:12 +01:00
parent 95e976719b
commit 43bcade785
No known key found for this signature in database
GPG Key ID: B24EFBB23B5F76CB
23 changed files with 1328 additions and 10 deletions

1190
source/ports/350h/smsplus.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,58 @@
#ifndef SMSPLUS_H
#define SMSPLUS_H
#include <SDL/SDL.h>
#define HOST_WIDTH_RESOLUTION 320
#define HOST_HEIGHT_RESOLUTION 240
#define VIDEO_WIDTH_SMS 256
#define VIDEO_HEIGHT_SMS 192
#define VIDEO_WIDTH_GG 160
#define VIDEO_HEIGHT_GG 144
/* Input defines for custom remapping */
#define CONFIG_BUTTON_UP 0
#define CONFIG_BUTTON_DOWN 1
#define CONFIG_BUTTON_LEFT 2
#define CONFIG_BUTTON_RIGHT 3
#define CONFIG_BUTTON_BUTTON1 4
#define CONFIG_BUTTON_BUTTON2 5
#define CONFIG_BUTTON_START 6
/* Colecovision specific */
#define CONFIG_BUTTON_DOLLARS 7
#define CONFIG_BUTTON_ASTERISK 8
#define CONFIG_BUTTON_ONE 10
#define CONFIG_BUTTON_TWO 11
#define CONFIG_BUTTON_THREE 12
#define CONFIG_BUTTON_FOUR 13
#define CONFIG_BUTTON_FIVE 14
#define CONFIG_BUTTON_SIX 15
#define CONFIG_BUTTON_SEVEN 16
#define CONFIG_BUTTON_EIGHT 17
#define CONFIG_BUTTON_NINE 18
/* End of Defines for input remapping */
extern SDL_Surface* sms_bitmap;
#define LOCK_VIDEO SDL_LockSurface(sms_bitmap);
#define UNLOCK_VIDEO SDL_UnlockSurface(sms_bitmap);
typedef struct {
char gamename[256];
char sramdir[256];
char sramfile[256];
char stdir[256];
char scrdir[256];
char biosdir[256];
} gamedata_t;
void smsp_state(uint8_t slot_number, uint8_t mode);
#define SOUND_FREQUENCY 44100
#define SOUND_SAMPLES_SIZE 1024
#endif

View File

@ -21,7 +21,8 @@ static gamedata_t gdata;
t_config option;
SDL_Surface* sdl_screen;
static SDL_Surface* img_background, *sms_bitmap;
SDL_Surface *sms_bitmap;
static SDL_Surface* img_background;
uint32_t countedFrames = 0;
uint32_t start;

View File

@ -1,11 +1,18 @@
#ifndef SMSPLUS_H
#define SMSPLUS_H
#include <SDL/SDL.h>
#define VIDEO_WIDTH_SMS 256
#define VIDEO_HEIGHT_SMS 192
#define VIDEO_WIDTH_GG 160
#define VIDEO_HEIGHT_GG 144
extern SDL_Surface* sms_bitmap;
#define LOCK_VIDEO SDL_LockSurface(sms_bitmap);
#define UNLOCK_VIDEO SDL_UnlockSurface(sms_bitmap);
typedef struct {
char gamename[256];
char sramdir[256];

View File

@ -21,7 +21,7 @@ t_config option;
static char home_path[256];
static SDL_Surface* sdl_screen, *scale2x_buf;
static SDL_Surface *sms_bitmap;
SDL_Surface *sms_bitmap;
static SDL_Surface *backbuffer;
extern SDL_Surface *font;
extern SDL_Surface *bigfontred;

View File

@ -1,6 +1,8 @@
#ifndef SMSPLUS_H
#define SMSPLUS_H
#include <SDL/SDL.h>
#define HOST_WIDTH_RESOLUTION 320
#define HOST_HEIGHT_RESOLUTION 240
@ -33,6 +35,11 @@
/* End of Defines for input remapping */
extern SDL_Surface* sms_bitmap;
#define LOCK_VIDEO SDL_LockSurface(sms_bitmap);
#define UNLOCK_VIDEO SDL_UnlockSurface(sms_bitmap);
typedef struct {
char gamename[256];

View File

@ -11,6 +11,9 @@
//#define NONBLOCKING_AUDIO 1
#define LOCK_VIDEO ()
#define UNLOCK_VIDEO ()
typedef struct {
char gamename[256];
char sramdir[256];

View File

@ -21,7 +21,7 @@ t_config option;
static char home_path[256];
static SDL_Surface* sdl_screen, *scale2x_buf;
static SDL_Surface *sms_bitmap;
SDL_Surface *sms_bitmap;
static SDL_Surface *backbuffer;
extern SDL_Surface *font;
extern SDL_Surface *bigfontred;

View File

@ -1,6 +1,8 @@
#ifndef SMSPLUS_H
#define SMSPLUS_H
#include <SDL/SDL.h>
#define HOST_WIDTH_RESOLUTION 480
#define HOST_HEIGHT_RESOLUTION 320
@ -9,6 +11,11 @@
#define VIDEO_WIDTH_GG 160
#define VIDEO_HEIGHT_GG 144
extern SDL_Surface* sms_bitmap;
#define LOCK_VIDEO SDL_LockSurface(sms_bitmap);
#define UNLOCK_VIDEO SDL_UnlockSurface(sms_bitmap);
typedef struct {
char gamename[256];
char sramdir[256];

View File

@ -20,8 +20,9 @@ static gamedata_t gdata;
t_config option;
SDL_Surface* sdl_screen;
static SDL_Surface *img_background, *scale2x_buf, *sms_bitmap;
static SDL_Surface *img_background, *scale2x_buf;
static char home_path[256];
SDL_Surface *sms_bitmap;
static SDL_Joystick* joystick[2];

View File

@ -1,11 +1,18 @@
#ifndef SMSPLUS_H
#define SMSPLUS_H
#include <SDL/SDL.h>
#define VIDEO_WIDTH_SMS 256
#define VIDEO_HEIGHT_SMS 192
#define VIDEO_WIDTH_GG 160
#define VIDEO_HEIGHT_GG 144
extern SDL_Surface* sms_bitmap;
#define LOCK_VIDEO SDL_LockSurface(sms_bitmap);
#define UNLOCK_VIDEO SDL_UnlockSurface(sms_bitmap);
typedef struct {
char gamename[256];
char sramdir[256];

View File

@ -22,7 +22,7 @@ static char home_path[256];
SDL_Surface* sdl_screen;
static SDL_Surface *scale2x_buf;
static SDL_Surface *sms_bitmap;
SDL_Surface *sms_bitmap;
static SDL_Surface *backbuffer;
extern SDL_Surface *font;
extern SDL_Surface *bigfontred;

View File

@ -4,6 +4,7 @@
#include <SDL/SDL.h>
extern SDL_Surface* sdl_screen;
extern SDL_Surface* sms_bitmap;
#define HOST_WIDTH_RESOLUTION 320
#define HOST_HEIGHT_RESOLUTION 240
@ -16,7 +17,6 @@ extern SDL_Surface* sdl_screen;
#define VIDEO_WIDTH_GG 160
#define VIDEO_HEIGHT_GG 144
/* Input defines for custom remapping */
#define CONFIG_BUTTON_UP 0
#define CONFIG_BUTTON_DOWN 1
@ -41,6 +41,9 @@ extern SDL_Surface* sdl_screen;
//#define VSYNC_SUPPORTED 1
#define LOCK_VIDEO SDL_LockSurface(sms_bitmap);
#define UNLOCK_VIDEO SDL_UnlockSurface(sms_bitmap);
typedef struct {
char gamename[256];
char sramdir[256];

View File

@ -17,7 +17,7 @@ static gamedata_t gdata;
t_config option;
static SDL_Surface* sdl_screen, *backbuffer;
static SDL_Surface *sms_bitmap;
SDL_Surface *sms_bitmap;
static char home_path[256];

View File

@ -1,6 +1,8 @@
#ifndef SMSPLUS_H
#define SMSPLUS_H
#include <SDL/SDL.h>
#define HOST_WIDTH_RESOLUTION 240
#define HOST_HEIGHT_RESOLUTION 160
@ -33,6 +35,11 @@
#define CONFIG_BUTTON_EIGHT 16
#define CONFIG_BUTTON_NINE 17
extern SDL_Surface* sms_bitmap;
#define LOCK_VIDEO SDL_LockSurface(sms_bitmap);
#define UNLOCK_VIDEO SDL_UnlockSurface(sms_bitmap);
typedef struct {
char gamename[256];
char sramdir[256];

View File

@ -21,7 +21,7 @@ t_config option;
static char home_path[256];
static SDL_Surface* sdl_screen, *scale2x_buf;
static SDL_Surface *sms_bitmap;
SDL_Surface *sms_bitmap;
static SDL_Surface *backbuffer;
extern SDL_Surface *font;
extern SDL_Surface *bigfontred;

View File

@ -1,6 +1,8 @@
#ifndef SMSPLUS_H
#define SMSPLUS_H
#include <SDL/SDL.h>
#define HOST_WIDTH_RESOLUTION 320
#define HOST_HEIGHT_RESOLUTION 240
@ -33,6 +35,10 @@
/* End of Defines for input remapping */
extern SDL_Surface* sms_bitmap;
#define LOCK_VIDEO SDL_LockSurface(sms_bitmap);
#define UNLOCK_VIDEO SDL_UnlockSurface(sms_bitmap);
typedef struct {
char gamename[256];

View File

@ -17,7 +17,7 @@ static gamedata_t gdata;
t_config option;
static SDL_Surface* sdl_screen;
static SDL_Surface *sms_bitmap;
SDL_Surface *sms_bitmap;
static char home_path[256];

View File

@ -1,6 +1,8 @@
#ifndef SMSPLUS_H
#define SMSPLUS_H
#include <SDL/SDL.h>
#define HOST_WIDTH_RESOLUTION 640
#define HOST_HEIGHT_RESOLUTION 480
@ -11,6 +13,11 @@
//#define VSYNC_SUPPORTED 1
extern SDL_Surface* sms_bitmap;
#define LOCK_VIDEO SDL_LockSurface(sms_bitmap);
#define UNLOCK_VIDEO SDL_UnlockSurface(sms_bitmap);
typedef struct {
char gamename[256];
char sramdir[256];

View File

@ -21,7 +21,7 @@ t_config option;
static char home_path[256];
static SDL_Surface* sdl_screen, *scale2x_buf;
static SDL_Surface *sms_bitmap;
SDL_Surface *sms_bitmap;
static SDL_Surface *backbuffer;
extern SDL_Surface *font;
extern SDL_Surface *bigfontred;

View File

@ -1,6 +1,8 @@
#ifndef SMSPLUS_H
#define SMSPLUS_H
#include <SDL/SDL.h>
#define HOST_WIDTH_RESOLUTION 320
#define HOST_HEIGHT_RESOLUTION 240
@ -9,6 +11,11 @@
#define VIDEO_WIDTH_GG 160
#define VIDEO_HEIGHT_GG 144
extern SDL_Surface* sms_bitmap;
#define LOCK_VIDEO SDL_LockSurface(sms_bitmap);
#define UNLOCK_VIDEO SDL_UnlockSurface(sms_bitmap);
typedef struct {
char gamename[256];
char sramdir[256];

View File

@ -832,9 +832,13 @@ static void remap_8_to_16(int32_t line)
int32_t i;
uint16_t *p = (uint16_t *)&bitmap.data[(line * bitmap.pitch)];
int32_t width = (bitmap.viewport.w)+2 * bitmap.viewport.x;
LOCK_VIDEO
for(i = 0; i < width; i++)
{
p[i] = pixel[ internal_buffer[i] & PIXEL_MASK ];
}
UNLOCK_VIDEO
}

View File

@ -49,6 +49,9 @@
#include "z80_wrap.h"
#include "sound_output.h"
/* For lock and unlocking screen surface */
#include "smsplus.h"
#ifndef NOZIP_SUPPORT
#include "miniz.h"
#include "fileio.h"