mirror of
https://github.com/digarok/gsplus.git
synced 2024-11-28 04:49:18 +00:00
scanline simulator is back. yay.
This commit is contained in:
parent
9906f0187e
commit
0ff8dc524c
@ -51,6 +51,7 @@ int g_win_status_debug_request = 0; // Desired visibility of status lines.
|
|||||||
int g_screen_mdepth = 0;
|
int g_screen_mdepth = 0;
|
||||||
int kb_shift_control_state = 0;
|
int kb_shift_control_state = 0;
|
||||||
|
|
||||||
|
|
||||||
void x_take_screenshot(); // screenshot stuff
|
void x_take_screenshot(); // screenshot stuff
|
||||||
int g_screenshot_requested = 0; // DB to know if we want to save a screenshot
|
int g_screenshot_requested = 0; // DB to know if we want to save a screenshot
|
||||||
extern char g_config_gsplus_name[];
|
extern char g_config_gsplus_name[];
|
||||||
@ -58,6 +59,7 @@ extern char g_config_gsplus_screenshot_dir[];
|
|||||||
int screenshot_index = 0; // allows us to save time by not scanning from 0 each time
|
int screenshot_index = 0; // allows us to save time by not scanning from 0 each time
|
||||||
char screenshot_filename[256];
|
char screenshot_filename[256];
|
||||||
|
|
||||||
|
extern int g_scanline_simulator;
|
||||||
extern int g_screen_depth;
|
extern int g_screen_depth;
|
||||||
extern int g_quit_sim_now;
|
extern int g_quit_sim_now;
|
||||||
extern int g_border_sides_refresh_needed;
|
extern int g_border_sides_refresh_needed;
|
||||||
@ -77,6 +79,11 @@ extern const char g_gsplus_version_str[]; // version string for title bar
|
|||||||
SDL_Window *window; // Declare a pointer
|
SDL_Window *window; // Declare a pointer
|
||||||
SDL_Renderer *renderer;
|
SDL_Renderer *renderer;
|
||||||
SDL_Texture *texture;
|
SDL_Texture *texture;
|
||||||
|
SDL_Texture *overlay_texture; // This is used for scanline simulation. Could be more in future (HUD).
|
||||||
|
Uint32 *overlay_pixels;
|
||||||
|
|
||||||
|
static char *g_clipboard = NULL; // clipboard variables
|
||||||
|
static size_t g_clipboard_pos = 0;
|
||||||
|
|
||||||
void dev_video_init_sdl();
|
void dev_video_init_sdl();
|
||||||
void handle_sdl_key_event(SDL_Event event);
|
void handle_sdl_key_event(SDL_Event event);
|
||||||
@ -117,7 +124,7 @@ int a2_key_to_sdlkeycode[][3] = {
|
|||||||
{ 0x18, '=', '+' },
|
{ 0x18, '=', '+' },
|
||||||
{ 0x33, SDLK_BACKSPACE, 0 },
|
{ 0x33, SDLK_BACKSPACE, 0 },
|
||||||
{ 0x72, SDLK_INSERT, 0 }, /* Help? XK_Help */
|
{ 0x72, SDLK_INSERT, 0 }, /* Help? XK_Help */
|
||||||
/* { 0x73, XK_Home, 0 }, alias XK_Home to be XK_KP_Equal! */
|
/* { 0x73, XK_Home, 0 }, alias XK_Home to be XK_KP_Equal! */
|
||||||
{ 0x74, SDLK_PAGEUP, 0 },
|
{ 0x74, SDLK_PAGEUP, 0 },
|
||||||
{ 0x47, SDLK_NUMLOCKCLEAR, 0 }, /* Clear, XK_Clear */
|
{ 0x47, SDLK_NUMLOCKCLEAR, 0 }, /* Clear, XK_Clear */
|
||||||
{ 0x51, SDLK_KP_EQUALS, 0 }, /* Note XK_Home alias! XK_Home */
|
{ 0x51, SDLK_KP_EQUALS, 0 }, /* Note XK_Home alias! XK_Home */
|
||||||
@ -190,14 +197,15 @@ int a2_key_to_sdlkeycode[][3] = {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
int
|
|
||||||
main(int argc, char **argv)
|
|
||||||
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
return gsplusmain(argc, argv);
|
return gsplusmain(argc, argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *byte_to_binary(int x)
|
|
||||||
{
|
const char *byte_to_binary(int x) {
|
||||||
static char b[9];
|
static char b[9];
|
||||||
b[0] = '\0';
|
b[0] = '\0';
|
||||||
|
|
||||||
@ -210,21 +218,20 @@ const char *byte_to_binary(int x)
|
|||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Queries the Screen to see if it's set to Fullscreen or Not
|
|
||||||
/// @return SDL_FALSE if windowed, SDL_TRUE if fullscreen
|
// Queries the Screen to see if set to Fullscreen or Not
|
||||||
SDL_bool IsFullScreen(SDL_Window *win)
|
// @return SDL_FALSE when windowed, SDL_TRUE when fullscreen
|
||||||
{
|
SDL_bool IsFullScreen(SDL_Window *win) {
|
||||||
Uint32 flags = SDL_GetWindowFlags(win);
|
Uint32 flags = SDL_GetWindowFlags(win);
|
||||||
if (flags & SDL_WINDOW_FULLSCREEN) return SDL_TRUE; // return SDL_TRUE if fullscreen
|
if (flags & SDL_WINDOW_FULLSCREEN) {
|
||||||
|
return SDL_TRUE; // return SDL_TRUE if fullscreen
|
||||||
|
}
|
||||||
return SDL_FALSE; // Return SDL_FALSE if windowed
|
return SDL_FALSE; // Return SDL_FALSE if windowed
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void dev_video_init() {
|
||||||
void
|
|
||||||
dev_video_init()
|
|
||||||
{
|
|
||||||
word32 lores_col;
|
word32 lores_col;
|
||||||
|
|
||||||
// build keycode map ??
|
// build keycode map ??
|
||||||
@ -262,9 +269,8 @@ dev_video_init()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void do_icon() {
|
void do_icon() {
|
||||||
#ifdef HAVE_ICON
|
#ifdef HAVE_ICON
|
||||||
//surface = SDL_CreateRGBSurfaceFrom(pixels,w,h,depth,pitch,rmask,gmask,bmask,amask);
|
//surface = SDL_CreateRGBSurfaceFrom(pixels,w,h,depth,pitch,rmask,gmask,bmask,amask);
|
||||||
int size = 256; // icon size
|
int size = 256; // icon size
|
||||||
SDL_Surface *surface; // declare an SDL_Surface to be filled in with pixel data from an image file
|
SDL_Surface *surface; // declare an SDL_Surface to be filled in with pixel data from an image file
|
||||||
@ -274,19 +280,16 @@ void do_icon() {
|
|||||||
SDL_SetWindowIcon(window, surface);
|
SDL_SetWindowIcon(window, surface);
|
||||||
// ...and the surface containing the icon pixel data is no longer required.
|
// ...and the surface containing the icon pixel data is no longer required.
|
||||||
SDL_FreeSurface(surface);
|
SDL_FreeSurface(surface);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Initialize our SDL window and texture
|
// Initialize our SDL window and texture
|
||||||
void
|
void dev_video_init_sdl() {
|
||||||
dev_video_init_sdl()
|
|
||||||
{
|
|
||||||
|
|
||||||
SDL_Init(SDL_INIT_VIDEO); // Initialize SDL2
|
SDL_Init(SDL_INIT_VIDEO); // Initialize SDL2
|
||||||
|
|
||||||
// Create an application window with the following settings:
|
// Create an application window with the following settings:
|
||||||
char window_title[50]; // @todo - unsafe assumption?
|
char window_title[32];
|
||||||
sprintf(window_title, "GSplus v%-6s", g_gsplus_version_str),
|
sprintf(window_title, "GSplus v%-6s", g_gsplus_version_str),
|
||||||
window = SDL_CreateWindow(
|
window = SDL_CreateWindow(
|
||||||
window_title, // window title (GSport vX.X)
|
window_title, // window title (GSport vX.X)
|
||||||
@ -320,19 +323,47 @@ dev_video_init_sdl()
|
|||||||
SDL_TEXTUREACCESS_STREAMING,
|
SDL_TEXTUREACCESS_STREAMING,
|
||||||
BASE_WINDOW_WIDTH, X_A2_WINDOW_HEIGHT);
|
BASE_WINDOW_WIDTH, X_A2_WINDOW_HEIGHT);
|
||||||
// The window is open: could enter program loop here (see SDL_PollEvent())
|
// The window is open: could enter program loop here (see SDL_PollEvent())
|
||||||
|
//overlay test
|
||||||
|
overlay_texture = SDL_CreateTexture(renderer,
|
||||||
|
SDL_PIXELFORMAT_ARGB8888,
|
||||||
|
SDL_TEXTUREACCESS_STREAMING,
|
||||||
|
BASE_WINDOW_WIDTH,
|
||||||
|
X_A2_WINDOW_HEIGHT);
|
||||||
|
|
||||||
|
SDL_SetTextureBlendMode(overlay_texture, SDL_BLENDMODE_BLEND);
|
||||||
|
overlay_pixels = malloc(BASE_WINDOW_WIDTH*X_A2_WINDOW_HEIGHT*sizeof(Uint32));
|
||||||
|
if (overlay_pixels) {
|
||||||
|
|
||||||
|
for (int y=0; y<X_A2_WINDOW_HEIGHT; y++) {
|
||||||
|
for (int x=0; x<BASE_WINDOW_WIDTH; x++) {
|
||||||
|
|
||||||
|
if (y%2 == 1) {
|
||||||
|
overlay_pixels[(y*BASE_WINDOW_WIDTH)+x] = 0x30000000;
|
||||||
|
printf("%d\n",(y*BASE_WINDOW_WIDTH)+x);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SDL_Rect dstrect;
|
||||||
|
dstrect.x = 0;
|
||||||
|
dstrect.y = 0;
|
||||||
|
dstrect.w = BASE_WINDOW_WIDTH;
|
||||||
|
dstrect.h = X_A2_WINDOW_HEIGHT;
|
||||||
|
int pitch = BASE_WINDOW_WIDTH;
|
||||||
|
|
||||||
|
// UPDATE A RECT OF THE APPLE II SCREEN TEXTURE
|
||||||
|
SDL_UpdateTexture(overlay_texture, &dstrect, overlay_pixels, pitch*sizeof(Uint32) );
|
||||||
|
|
||||||
SDL_ShowCursor(SDL_DISABLE);
|
SDL_ShowCursor(SDL_DISABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Copy a rect to our SDL window
|
// Copy a rect to our SDL window
|
||||||
void sdl_push_kimage(Kimage *kimage_ptr,
|
void sdl_push_kimage(Kimage *kimage_ptr, int destx, int desty, int srcx, int srcy, int width, int height) {
|
||||||
int destx, int desty, int srcx, int srcy, int width, int height)
|
|
||||||
{
|
|
||||||
byte *src_ptr;
|
byte *src_ptr;
|
||||||
int pixel_size = 4;
|
int pixel_size = 4;
|
||||||
src_ptr = kimage_ptr->data_ptr + (srcy * kimage_ptr->width_act + srcx) * pixel_size;
|
src_ptr = kimage_ptr->data_ptr + (srcy * kimage_ptr->width_act + srcx) * pixel_size;
|
||||||
//src_ptr = kimage_ptr->data_ptr;
|
|
||||||
|
|
||||||
SDL_Rect dstrect;
|
SDL_Rect dstrect;
|
||||||
dstrect.x = destx;
|
dstrect.x = destx;
|
||||||
@ -342,22 +373,21 @@ void sdl_push_kimage(Kimage *kimage_ptr,
|
|||||||
int pitch = 640;
|
int pitch = 640;
|
||||||
if (width < 560) {
|
if (width < 560) {
|
||||||
pitch = EFF_BORDER_WIDTH;
|
pitch = EFF_BORDER_WIDTH;
|
||||||
// This is another bad hack. Possibly not cross platform.
|
// seems to be the correct value, but would like clarification
|
||||||
pitch = BORDER_WIDTH+72;
|
pitch = BORDER_WIDTH+72;
|
||||||
//printf("EFF_BORDER_WIDTH : %d" ,EFF_BORDER_WIDTH);
|
|
||||||
}
|
}
|
||||||
//SDL_UpdateTexture(texture, NULL, src_ptr, 640 * sizeof (Uint32));
|
|
||||||
SDL_UpdateTexture(texture, &dstrect, src_ptr, pitch*4 );
|
SDL_UpdateTexture(texture, &dstrect, src_ptr, pitch*4 );
|
||||||
SDL_RenderClear(renderer);
|
SDL_RenderClear(renderer);
|
||||||
SDL_RenderCopy(renderer, texture, NULL, NULL);
|
SDL_RenderCopy(renderer, texture, NULL, NULL);
|
||||||
|
if (g_scanline_simulator) {
|
||||||
|
SDL_RenderCopy(renderer, overlay_texture, NULL, NULL);
|
||||||
|
}
|
||||||
SDL_RenderPresent(renderer);
|
SDL_RenderPresent(renderer);
|
||||||
|
|
||||||
if (g_screenshot_requested) {
|
if (g_screenshot_requested) {
|
||||||
x_take_screenshot();
|
x_take_screenshot();
|
||||||
g_screenshot_requested = 0;
|
g_screenshot_requested = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -371,8 +401,7 @@ void set_refresh_needed() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void x_get_kimage(Kimage *kimage_ptr) {
|
||||||
x_get_kimage(Kimage *kimage_ptr) {
|
|
||||||
byte *data;
|
byte *data;
|
||||||
int width;
|
int width;
|
||||||
int height;
|
int height;
|
||||||
@ -387,16 +416,12 @@ x_get_kimage(Kimage *kimage_ptr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void check_input_events() {
|
||||||
check_input_events()
|
|
||||||
{
|
|
||||||
check_input_events_sdl();
|
check_input_events_sdl();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void check_input_events_sdl() {
|
||||||
check_input_events_sdl()
|
|
||||||
{
|
|
||||||
int motion = 0;
|
int motion = 0;
|
||||||
SDL_Event event;
|
SDL_Event event;
|
||||||
|
|
||||||
@ -430,7 +455,6 @@ check_input_events_sdl()
|
|||||||
SDL_free(file);
|
SDL_free(file);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -438,9 +462,7 @@ check_input_events_sdl()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int sdl_keysym_to_a2code(int keysym, int is_up) {
|
||||||
sdl_keysym_to_a2code(int keysym, int is_up)
|
|
||||||
{
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if(keysym == 0) {
|
if(keysym == 0) {
|
||||||
@ -481,10 +503,7 @@ sdl_keysym_to_a2code(int keysym, int is_up)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void handle_sdl_key_event(SDL_Event event) {
|
||||||
handle_sdl_key_event(SDL_Event event)
|
|
||||||
{
|
|
||||||
|
|
||||||
int state_xor;
|
int state_xor;
|
||||||
int state = 0;
|
int state = 0;
|
||||||
int is_up;
|
int is_up;
|
||||||
@ -532,15 +551,29 @@ handle_sdl_key_event(SDL_Event event)
|
|||||||
}
|
}
|
||||||
switch( event.key.keysym.sym ){
|
switch( event.key.keysym.sym ){
|
||||||
case SDLK_F11:
|
case SDLK_F11:
|
||||||
printf("Toggle Fullscreen");
|
if (kb_shift_control_state & ShiftMask) { // SHIFT+F11
|
||||||
|
if (!is_up) {
|
||||||
|
if (g_scanline_simulator) {
|
||||||
|
glog("Enable scanline simulator");
|
||||||
|
g_scanline_simulator = 0;
|
||||||
|
} else {
|
||||||
|
glog("Disable scanline simulator");
|
||||||
|
g_scanline_simulator = 1;
|
||||||
|
}
|
||||||
|
set_refresh_needed(); // make sure user sees it right away
|
||||||
|
}
|
||||||
|
} else {
|
||||||
if (!is_up) {
|
if (!is_up) {
|
||||||
if (!IsFullScreen(window)) {
|
if (!IsFullScreen(window)) {
|
||||||
|
glog("Enable fullscreen");
|
||||||
SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP);
|
SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP);
|
||||||
} else {
|
} else {
|
||||||
|
glog("Disable fullscreen");
|
||||||
SDL_SetWindowFullscreen(window, 0);
|
SDL_SetWindowFullscreen(window, 0);
|
||||||
SDL_SetWindowSize(window, BASE_WINDOW_WIDTH, X_A2_WINDOW_HEIGHT);
|
SDL_SetWindowSize(window, BASE_WINDOW_WIDTH, X_A2_WINDOW_HEIGHT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
a2code = sdl_keysym_to_a2code(event.key.keysym.sym, is_up);
|
a2code = sdl_keysym_to_a2code(event.key.keysym.sym, is_up);
|
||||||
@ -552,11 +585,9 @@ handle_sdl_key_event(SDL_Event event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int handle_sdl_mouse_motion_event(SDL_Event event) {
|
||||||
handle_sdl_mouse_motion_event(SDL_Event event) {
|
|
||||||
int x, y;
|
int x, y;
|
||||||
// @todo: FIX MOUSE BUTTON MAPPING, AT LEAST CLEAN UP AND DOCUMENT BEHAVIOR
|
// @todo: FIX MOUSE BUTTON MAPPING, AT LEAST CLEAN UP AND DOCUMENT BEHAVIOR
|
||||||
//printf (" %04x\t", event.motion.state &7);
|
|
||||||
x = event.motion.x - BASE_MARGIN_LEFT;
|
x = event.motion.x - BASE_MARGIN_LEFT;
|
||||||
y = event.motion.y - BASE_MARGIN_TOP;
|
y = event.motion.y - BASE_MARGIN_TOP;
|
||||||
if (event.type == SDL_MOUSEBUTTONUP) {
|
if (event.type == SDL_MOUSEBUTTONUP) {
|
||||||
@ -567,21 +598,18 @@ handle_sdl_mouse_motion_event(SDL_Event event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void x_push_kimage(Kimage *kimage_ptr, int destx, int desty, int srcx, int srcy, int width, int height) {
|
||||||
x_push_kimage(Kimage *kimage_ptr, int destx, int desty, int srcx, int srcy, int width, int height)
|
|
||||||
{
|
|
||||||
sdl_push_kimage(kimage_ptr, destx, desty, srcx, srcy, width, height);
|
sdl_push_kimage(kimage_ptr, destx, desty, srcx, srcy, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// called by src/sim65816.c
|
// called by src/sim65816.c
|
||||||
void
|
void x_dialog_create_gsport_conf(const char *str) {
|
||||||
x_dialog_create_gsport_conf(const char *str)
|
|
||||||
{
|
|
||||||
// Just write the config file already...
|
// Just write the config file already...
|
||||||
config_write_config_gsplus_file();
|
config_write_config_gsplus_file();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void x_full_screen(int do_full) {
|
void x_full_screen(int do_full) {
|
||||||
if (do_full) {
|
if (do_full) {
|
||||||
SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP);
|
SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP);
|
||||||
@ -591,18 +619,19 @@ void x_full_screen(int do_full) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int file_exists(char *fname){
|
|
||||||
|
int file_exists(char *fname) {
|
||||||
if( access( fname, F_OK ) != -1 ) {
|
if( access( fname, F_OK ) != -1 ) {
|
||||||
return 1; // file exists
|
return 1; // file exists
|
||||||
} else {
|
} else {
|
||||||
return 0; // file doesn't exist
|
return 0; // file does not exist
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// This tries to determine the next screenshot name.
|
// This tries to determine the next screenshot name.
|
||||||
// It uses the config name as the basename.
|
// It uses the config name as the basename.
|
||||||
void make_next_screenshot_filename()
|
void make_next_screenshot_filename() {
|
||||||
{
|
|
||||||
char filepart[256];
|
char filepart[256];
|
||||||
char filename[256];
|
char filename[256];
|
||||||
|
|
||||||
@ -629,6 +658,8 @@ void make_next_screenshot_filename()
|
|||||||
strcpy(screenshot_filename, filename);
|
strcpy(screenshot_filename, filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// @todo: some error with writing data direct to png. output is empty/transparent?
|
// @todo: some error with writing data direct to png. output is empty/transparent?
|
||||||
// workaround is this horrible hack of saving the bmp -> load bmp -> save png
|
// workaround is this horrible hack of saving the bmp -> load bmp -> save png
|
||||||
void x_take_screenshot() {
|
void x_take_screenshot() {
|
||||||
@ -644,38 +675,16 @@ void x_take_screenshot() {
|
|||||||
SDL_UnlockSurface(sshot);
|
SDL_UnlockSurface(sshot);
|
||||||
SDL_FreeSurface(sshot);
|
SDL_FreeSurface(sshot);
|
||||||
|
|
||||||
SDL_Surface *s = SDL_CreateRGBSurface(0, BASE_WINDOW_WIDTH, X_A2_WINDOW_HEIGHT,
|
SDL_Surface *s = SDL_CreateRGBSurface(0, BASE_WINDOW_WIDTH, X_A2_WINDOW_HEIGHT, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000);
|
||||||
32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000);
|
|
||||||
if (s) {
|
if (s) {
|
||||||
SDL_Surface * image = SDL_LoadBMP("screenshot.bmp");
|
SDL_Surface * image = SDL_LoadBMP("screenshot.bmp");
|
||||||
IMG_SavePNG(image, screenshot_filename);
|
IMG_SavePNG(image, screenshot_filename);
|
||||||
SDL_FreeSurface(image);
|
SDL_FreeSurface(image);
|
||||||
|
|
||||||
}
|
}
|
||||||
SDL_FreeSurface(s);
|
SDL_FreeSurface(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Old driver cruft
|
|
||||||
|
|
||||||
// called by src/sim65816.c
|
|
||||||
int x_show_alert(int is_fatal, const char *str) { return 0; }
|
|
||||||
void get_ximage(Kimage *kimage_ptr) { }
|
|
||||||
void x_toggle_status_lines() { }
|
|
||||||
void x_redraw_status_lines() { }
|
|
||||||
void x_hide_pointer(int do_hide) { }
|
|
||||||
void x_auto_repeat_on(int must) { }
|
|
||||||
void x_auto_repeat_off(int must) { }
|
|
||||||
// OG Adding release
|
|
||||||
void x_release_kimage(Kimage* kimage_ptr) { }
|
|
||||||
// OG Addding ratio
|
|
||||||
int x_calc_ratio(float x,float y) { return 1; }
|
|
||||||
|
|
||||||
|
|
||||||
static char *g_clipboard = NULL;
|
|
||||||
static size_t g_clipboard_pos = 0;
|
|
||||||
|
|
||||||
void clipboard_paste(void) {
|
void clipboard_paste(void) {
|
||||||
|
|
||||||
char *cp;
|
char *cp;
|
||||||
@ -695,6 +704,7 @@ void clipboard_paste(void) {
|
|||||||
SDL_free(cp);
|
SDL_free(cp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int clipboard_get_char(void) {
|
int clipboard_get_char(void) {
|
||||||
char c;
|
char c;
|
||||||
|
|
||||||
@ -723,6 +733,24 @@ int clipboard_get_char(void) {
|
|||||||
return c | 0x80;
|
return c | 0x80;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// BELOW ARE FUNCTIONS THAT ARE EITHER UNIMPLEMENTED, OR AR NOT RELEVANT TO
|
||||||
|
// THIS DRIVER.
|
||||||
|
|
||||||
|
// called by src/sim65816.c
|
||||||
|
int x_show_alert(int is_fatal, const char *str) { return 0; }
|
||||||
|
void get_ximage(Kimage *kimage_ptr) { }
|
||||||
|
void x_toggle_status_lines() { }
|
||||||
|
void x_redraw_status_lines() { }
|
||||||
|
void x_hide_pointer(int do_hide) { }
|
||||||
|
void x_auto_repeat_on(int must) { }
|
||||||
|
void x_auto_repeat_off(int must) { }
|
||||||
|
// OG Adding release
|
||||||
|
void x_release_kimage(Kimage* kimage_ptr) { }
|
||||||
|
// OG Addding ratio
|
||||||
|
int x_calc_ratio(float x,float y) { return 1; }
|
||||||
void x_set_mask_and_shift(word32 x_mask, word32 *mask_ptr, int *shift_left_ptr, int *shift_right_ptr) { return; }
|
void x_set_mask_and_shift(word32 x_mask, word32 *mask_ptr, int *shift_left_ptr, int *shift_right_ptr) { return; }
|
||||||
void x_update_color(int col_num, int red, int green, int blue, word32 rgb) { }
|
void x_update_color(int col_num, int red, int green, int blue, word32 rgb) { }
|
||||||
void x_update_physical_colormap() { }
|
void x_update_physical_colormap() { }
|
||||||
|
@ -915,12 +915,14 @@ extern int g_use_shmem;
|
|||||||
extern int g_use_dhr140;
|
extern int g_use_dhr140;
|
||||||
extern int g_use_bw_hires;
|
extern int g_use_bw_hires;
|
||||||
|
|
||||||
|
|
||||||
|
/* display parameters */
|
||||||
char g_display_env[512];
|
char g_display_env[512];
|
||||||
int g_force_depth = -1;
|
int g_force_depth = -1;
|
||||||
int g_screen_depth = 8;
|
int g_screen_depth = 8;
|
||||||
|
int g_scanline_simulator = 0;
|
||||||
|
|
||||||
void banner() {
|
void banner() {
|
||||||
|
|
||||||
printf("\x1b[32m _______ _______ _ \x1b[0m \n");
|
printf("\x1b[32m _______ _______ _ \x1b[0m \n");
|
||||||
printf("\x1b[32m | ____|| _____| _| |_ \x1b[0m \n");
|
printf("\x1b[32m | ____|| _____| _| |_ \x1b[0m \n");
|
||||||
printf("\x1b[33m | | __ | |_____ |_ _| \x1b[0m \n");
|
printf("\x1b[33m | | __ | |_____ |_ _| \x1b[0m \n");
|
||||||
@ -1042,6 +1044,10 @@ gsplusmain(int argc, char **argv)
|
|||||||
printf("Forcing black-and-white hires modes\n");
|
printf("Forcing black-and-white hires modes\n");
|
||||||
g_cur_a2_stat |= ALL_STAT_COLOR_C021;
|
g_cur_a2_stat |= ALL_STAT_COLOR_C021;
|
||||||
g_use_bw_hires = 1;
|
g_use_bw_hires = 1;
|
||||||
|
} else if(!strcmp("-scanline", argv[i])) {
|
||||||
|
g_scanline_simulator = 1;
|
||||||
|
} else if(!strcmp("-noscanline", argv[i])) {
|
||||||
|
g_scanline_simulator = 0;
|
||||||
} else if(!strcmp("-enet", argv[i])) {
|
} else if(!strcmp("-enet", argv[i])) {
|
||||||
if((i+1) >= argc) {
|
if((i+1) >= argc) {
|
||||||
printf("Missing argument\n");
|
printf("Missing argument\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user