Another round of cleanups - the main code no longer refers to, let alone uses, anything in the platform folder - completely separated!
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
/* Copyright holders: Sarah Walker
|
||||
see COPYING for more details
|
||||
*/
|
||||
extern LPDIRECTINPUT lpdi;
|
||||
@@ -1,76 +0,0 @@
|
||||
/*
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Definitions for the platform OpenDir module.
|
||||
*
|
||||
* Version: @(#)plat_dir.h 1.0.1 2017/05/17
|
||||
*
|
||||
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Copyright 2017 Fred N. van Kempen.
|
||||
*/
|
||||
#ifndef PLAT_DIR_H
|
||||
# define PLAT_DIR_H
|
||||
|
||||
|
||||
#ifdef _MAX_FNAME
|
||||
# define MAXNAMLEN _MAX_FNAME
|
||||
#else
|
||||
# define MAXNAMLEN 15
|
||||
#endif
|
||||
# define MAXDIRLEN 127
|
||||
|
||||
|
||||
struct direct {
|
||||
long d_ino;
|
||||
unsigned short d_reclen;
|
||||
unsigned short d_off;
|
||||
#ifdef UNICODE
|
||||
wchar_t d_name[MAXNAMLEN + 1];
|
||||
#else
|
||||
char d_name[MAXNAMLEN + 1];
|
||||
#endif
|
||||
};
|
||||
#define d_namlen d_reclen
|
||||
|
||||
|
||||
typedef struct {
|
||||
short flags; /* internal flags */
|
||||
short offset; /* offset of entry into dir */
|
||||
long handle; /* open handle to Win32 system */
|
||||
short sts; /* last known status code */
|
||||
char *dta; /* internal work data */
|
||||
#ifdef UNICODE
|
||||
wchar_t dir[MAXDIRLEN+1]; /* open dir */
|
||||
#else
|
||||
char dir[MAXDIRLEN+1]; /* open dir */
|
||||
#endif
|
||||
struct direct dent; /* actual directory entry */
|
||||
} DIR;
|
||||
|
||||
|
||||
/* Directory routine flags. */
|
||||
#define DIR_F_LOWER 0x0001 /* force to lowercase */
|
||||
#define DIR_F_SANE 0x0002 /* force this to sane path */
|
||||
#define DIR_F_ISROOT 0x0010 /* this is the root directory */
|
||||
|
||||
|
||||
/* Function prototypes. */
|
||||
#ifdef UNICODE
|
||||
extern DIR *opendirw(const wchar_t *);
|
||||
#else
|
||||
extern DIR *opendir(const char *);
|
||||
#endif
|
||||
extern struct direct *readdir(DIR *);
|
||||
extern long telldir(DIR *);
|
||||
extern void seekdir(DIR *, long);
|
||||
extern int closedir(DIR *);
|
||||
|
||||
#define rewinddir(dirp) seekdir(dirp, 0L)
|
||||
|
||||
|
||||
#endif /*PLAT_DIR_H*/
|
||||
@@ -1,30 +0,0 @@
|
||||
/*
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Define the Dynamic Module Loader interface.
|
||||
*
|
||||
* Version: @(#)plat_dynld.h 1.0.1 2017/05/21
|
||||
*
|
||||
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Copyright 2017 Fred N. van Kempen
|
||||
*/
|
||||
#ifndef PLAT_DYNLD_H
|
||||
# define PLAT_DYNLD_H
|
||||
|
||||
|
||||
typedef struct {
|
||||
const char *name;
|
||||
void *func;
|
||||
} dllimp_t;
|
||||
|
||||
|
||||
extern void *dynld_module(const char *, dllimp_t *);
|
||||
extern void dynld_close(void *);
|
||||
|
||||
|
||||
#endif /*PLAT_DYNLD_H*/
|
||||
@@ -1,69 +0,0 @@
|
||||
/* Copyright holders: Sarah Walker
|
||||
see COPYING for more details
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
void joystick_init();
|
||||
void joystick_close();
|
||||
void joystick_poll();
|
||||
|
||||
typedef struct plat_joystick_t
|
||||
{
|
||||
char name[64];
|
||||
|
||||
int a[8];
|
||||
int b[32];
|
||||
int p[4];
|
||||
|
||||
struct
|
||||
{
|
||||
char name[32];
|
||||
int id;
|
||||
} axis[8];
|
||||
|
||||
struct
|
||||
{
|
||||
char name[32];
|
||||
int id;
|
||||
} button[32];
|
||||
|
||||
struct
|
||||
{
|
||||
char name[32];
|
||||
int id;
|
||||
} pov[4];
|
||||
|
||||
int nr_axes;
|
||||
int nr_buttons;
|
||||
int nr_povs;
|
||||
} plat_joystick_t;
|
||||
|
||||
#define MAX_PLAT_JOYSTICKS 8
|
||||
|
||||
extern plat_joystick_t plat_joystick_state[MAX_PLAT_JOYSTICKS];
|
||||
extern int joysticks_present;
|
||||
|
||||
#define POV_X 0x80000000
|
||||
#define POV_Y 0x40000000
|
||||
|
||||
typedef struct joystick_t
|
||||
{
|
||||
int axis[8];
|
||||
int button[32];
|
||||
int pov[4];
|
||||
|
||||
int plat_joystick_nr;
|
||||
int axis_mapping[8];
|
||||
int button_mapping[32];
|
||||
int pov_mapping[4][2];
|
||||
} joystick_t;
|
||||
|
||||
#define MAX_JOYSTICKS 4
|
||||
extern joystick_t joystick_state[MAX_JOYSTICKS];
|
||||
|
||||
#define JOYSTICK_PRESENT(n) (joystick_state[n].plat_joystick_nr != 0)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -1,22 +0,0 @@
|
||||
/* Copyright holders: Sarah Walker
|
||||
see COPYING for more details
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
void keyboard_init();
|
||||
void keyboard_close();
|
||||
void keyboard_poll_host();
|
||||
extern int recv_key[272];
|
||||
extern int rawinputkey[272];
|
||||
|
||||
#ifndef __unix
|
||||
#define KEY_LCONTROL 0x1d
|
||||
#define KEY_RCONTROL (0x1d | 0x80)
|
||||
#define KEY_END (0x4f | 0x80)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
void plat_midi_init();
|
||||
void plat_midi_close();
|
||||
void plat_midi_play_msg(uint8_t* val);
|
||||
void plat_midi_play_sysex(uint8_t* data, unsigned int len);
|
||||
int plat_midi_write(uint8_t val);
|
||||
int plat_midi_get_num_devs();
|
||||
void plat_midi_get_dev_name(int num, char *s);
|
||||
@@ -1,16 +0,0 @@
|
||||
/* Copyright holders: Sarah Walker
|
||||
see COPYING for more details
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void mouse_init();
|
||||
void mouse_close();
|
||||
extern int mouse_buttons;
|
||||
void mouse_poll_host();
|
||||
void mouse_get_mickeys(int *x, int *y, int *z);
|
||||
extern int mousecapture;
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -1,52 +0,0 @@
|
||||
/*
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Definitions for the Bottom Half of the SERIAL card.
|
||||
*
|
||||
* Version: @(#)plat_serial.h 1.0.5 2017/06/04
|
||||
*
|
||||
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Copyright 2017 Fred N. van Kempen.
|
||||
*/
|
||||
#ifndef PLAT_SERIAL_H
|
||||
# define PLAT_SERIAL_H
|
||||
|
||||
|
||||
typedef struct {
|
||||
char name[80]; /* name of open port */
|
||||
void (*rd_done)(void *, int);
|
||||
void *rd_arg;
|
||||
#ifdef BHTTY_C
|
||||
HANDLE handle;
|
||||
OVERLAPPED rov, /* READ and WRITE events */
|
||||
wov;
|
||||
int tmo; /* current timeout value */
|
||||
DCB dcb, /* terminal settings */
|
||||
odcb;
|
||||
thread_t *tid; /* pointer to receiver thread */
|
||||
char buff[1024];
|
||||
int icnt, ihead, itail;
|
||||
#endif
|
||||
} BHTTY;
|
||||
|
||||
|
||||
extern BHTTY *bhtty_open(char *__port, int __tmo);
|
||||
extern void bhtty_close(BHTTY *);
|
||||
extern int bhtty_flush(BHTTY *);
|
||||
extern void bhtty_raw(BHTTY *, void *__arg);
|
||||
extern int bhtty_speed(BHTTY *, long __speed);
|
||||
extern int bhtty_params(BHTTY *, char __dbit, char __par, char __sbit);
|
||||
extern int bhtty_sstate(BHTTY *, void *__arg);
|
||||
extern int bhtty_gstate(BHTTY *, void *__arg);
|
||||
extern int bhtty_crtscts(BHTTY *, char __yesno);
|
||||
extern int bhtty_active(BHTTY *, int);
|
||||
extern int bhtty_write(BHTTY *, unsigned char);
|
||||
extern int bhtty_read(BHTTY *, unsigned char *, int);
|
||||
|
||||
|
||||
#endif /*PLAT_SERIAL_H*/
|
||||
@@ -1,32 +0,0 @@
|
||||
/* Copyright holders: Sarah Walker
|
||||
see COPYING for more details
|
||||
*/
|
||||
#ifndef PLAT_THREAD_H
|
||||
# define PLAT_THREAD_H
|
||||
|
||||
|
||||
typedef void thread_t;
|
||||
typedef void event_t;
|
||||
|
||||
|
||||
extern thread_t *thread_create(void (*thread_rout)(void *param), void *param);
|
||||
extern void thread_kill(thread_t *handle);
|
||||
|
||||
extern event_t *thread_create_event(void);
|
||||
extern void thread_set_event(event_t *event);
|
||||
extern void thread_reset_event(event_t *_event);
|
||||
extern int thread_wait_event(event_t *event, int timeout);
|
||||
extern void thread_destroy_event(event_t *_event);
|
||||
|
||||
extern void thread_sleep(int t);
|
||||
|
||||
extern void *thread_create_mutex(wchar_t *name);
|
||||
extern void thread_close_mutex(void *mutex);
|
||||
extern uint8_t thread_wait_mutex(void *mutex);
|
||||
extern uint8_t thread_release_mutex(void *mutex);
|
||||
|
||||
extern void startslirp(void);
|
||||
extern void endslirp(void);
|
||||
|
||||
|
||||
#endif /*PLAT_THREAD_H*/
|
||||
@@ -1,2 +0,0 @@
|
||||
uint32_t get_ticks(void);
|
||||
void delay_ms(uint32_t count);
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* The Emulator's Windows core.
|
||||
*
|
||||
* Version: @(#)win.c 1.0.19 2017/10/09
|
||||
* Version: @(#)win.c 1.0.20 2017/10/10
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include <wchar.h>
|
||||
#include "../86box.h"
|
||||
#include "../config.h"
|
||||
@@ -53,14 +54,11 @@
|
||||
#include "../sound/sound.h"
|
||||
#include "../sound/snd_dbopl.h"
|
||||
#include "../plat.h"
|
||||
#include "../plat_keyboard.h"
|
||||
#include "../plat_mouse.h"
|
||||
#include "../plat_midi.h"
|
||||
#include "../ui.h"
|
||||
#include "plat_keyboard.h"
|
||||
#include "plat_mouse.h"
|
||||
#include "plat_midi.h"
|
||||
#include "plat_thread.h"
|
||||
#include "plat_ticks.h"
|
||||
#include "win.h"
|
||||
#include "win_cgapal.h"
|
||||
#include "win_ddraw.h"
|
||||
#include "win_d3d.h"
|
||||
|
||||
@@ -527,10 +525,10 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
case IDM_VID_D3D:
|
||||
startblit();
|
||||
video_wait_for_blit();
|
||||
CheckMenuItem(hmenu, IDM_VID_DDRAW + vid_api, MF_UNCHECKED);
|
||||
CheckMenuItem(hmenu, IDM_VID_DDRAW+vid_api, MF_UNCHECKED);
|
||||
vid_apis[0][vid_api].close();
|
||||
vid_api = LOWORD(wParam) - IDM_VID_DDRAW;
|
||||
CheckMenuItem(hmenu, IDM_VID_DDRAW + vid_api, MF_CHECKED);
|
||||
CheckMenuItem(hmenu, IDM_VID_DDRAW+vid_api, MF_CHECKED);
|
||||
vid_apis[0][vid_api].init(hwndRender);
|
||||
endblit();
|
||||
config_save();
|
||||
@@ -1469,6 +1467,60 @@ plat_get_string_from_string(char *str)
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* If these are in the headers, doesn't work...? --FvK */
|
||||
//extern void ddraw_take_screenshot(wchar_t *);
|
||||
//extern void ddraw_fs_take_screenshot(wchar_t *);
|
||||
//extern void d3d_take_screenshot(wchar_t *);
|
||||
//extern void d3d_fs_take_screenshot(wchar_t *);
|
||||
|
||||
void
|
||||
take_screenshot(void)
|
||||
{
|
||||
wchar_t path[1024], fn[128];
|
||||
struct tm *info;
|
||||
time_t now;
|
||||
|
||||
pclog("Screenshot: video API is: %i\n", vid_api);
|
||||
if ((vid_api < 0) || (vid_api > 1)) return;
|
||||
|
||||
memset(fn, 0, sizeof(fn));
|
||||
memset(path, 0, sizeof(path));
|
||||
|
||||
(void)time(&now);
|
||||
info = localtime(&now);
|
||||
|
||||
append_filename_w(path, cfg_path, SCREENSHOT_PATH, sizeof(path)-2);
|
||||
|
||||
if (! dir_check_exist(path))
|
||||
dir_create(path);
|
||||
|
||||
#ifdef WIN32
|
||||
wcscat(path, L"\\");
|
||||
#else
|
||||
wcscat(path, L"/");
|
||||
#endif
|
||||
|
||||
if (vid_api == 1) {
|
||||
wcsftime(fn, 128, L"%Y%m%d_%H%M%S.png", info);
|
||||
append_filename_w(path, cfg_path, fn, 1024);
|
||||
if (video_fullscreen)
|
||||
d3d_fs_take_screenshot(path);
|
||||
else
|
||||
d3d_take_screenshot(path);
|
||||
} else if (vid_api == 0) {
|
||||
wcsftime(path, 128, L"%Y%m%d_%H%M%S.bmp", info);
|
||||
append_filename_w(path, cfg_path, fn, 1024);
|
||||
if (video_fullscreen)
|
||||
ddraw_fs_take_screenshot(path);
|
||||
else
|
||||
ddraw_take_screenshot(path);
|
||||
}
|
||||
|
||||
pclog("Screenshot: fn='%ws'\n", path);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
startblit(void)
|
||||
{
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* The Windows CGA palette handler header.
|
||||
*
|
||||
* Version: @(#)win_cgapal.h 1.0.0 2017/05/30
|
||||
*
|
||||
* Author: Miran Grca, <mgrca8@gmail.com>
|
||||
* Copyright 2016-2017 Miran Grca.
|
||||
*/
|
||||
|
||||
extern PALETTE cgapal;
|
||||
extern PALETTE cgapal_mono[6];
|
||||
|
||||
extern uint32_t pal_lookup[256];
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
void cgapal_rebuild();
|
||||
void destroy_bitmap(BITMAP *b);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -8,10 +8,11 @@
|
||||
*
|
||||
* Direct3D 9 rendererer and screenshots taking.
|
||||
*
|
||||
* Version: @(#)win_d3d.cc 1.0.1 2017/08/23
|
||||
* Version: @(#)win_d3d.cc 1.0.2 2017/10/10
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
*
|
||||
* Copyright 2008-2017 Sarah Walker.
|
||||
* Copyright 2016,2017 Miran Grca.
|
||||
*/
|
||||
@@ -19,7 +20,6 @@
|
||||
#include "../video/video.h"
|
||||
#include "win.h"
|
||||
#include "win_d3d.h"
|
||||
#include "win_cgapal.h"
|
||||
|
||||
|
||||
extern "C" void fatal(const char *format, ...);
|
||||
@@ -28,6 +28,7 @@ extern "C" void pclog(const char *format, ...);
|
||||
extern "C" void device_force_redraw(void);
|
||||
extern "C" void video_blit_complete(void);
|
||||
|
||||
extern "C" void d3d_take_screenshot(wchar_t *fn);
|
||||
|
||||
void d3d_init_objects(void);
|
||||
void d3d_close_objects(void);
|
||||
@@ -99,9 +100,13 @@ int d3d_init(HWND h)
|
||||
fatal("CreateDevice failed\n");
|
||||
|
||||
d3d_init_objects();
|
||||
|
||||
|
||||
#if 0
|
||||
video_setblit(d3d_blit_memtoscreen_8, d3d_blit_memtoscreen);
|
||||
#else
|
||||
video_blit_memtoscreen_func = d3d_blit_memtoscreen;
|
||||
video_blit_memtoscreen_8_func = d3d_blit_memtoscreen_8;
|
||||
#endif
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
*
|
||||
* Direct3D 9 rendererer and screenshots taking.
|
||||
*
|
||||
* Version: @(#)win_d3d.h 1.0.0 2017/05/30
|
||||
* Version: @(#)win_d3d.h 1.0.1 2017/10/10
|
||||
*
|
||||
* Author: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
*
|
||||
* Copyright 2008-2017 Sarah Walker.
|
||||
* Copyright 2016-2017 Miran Grca.
|
||||
* Copyright 2016,2017 Miran Grca.
|
||||
*/
|
||||
|
||||
#ifndef WIN_D3D_H
|
||||
# define WIN_D3D_H
|
||||
# define UNICODE
|
||||
@@ -39,6 +39,7 @@ extern int d3d_fs_init(HWND h);
|
||||
extern void d3d_fs_close(void);
|
||||
extern void d3d_fs_reset(void);
|
||||
extern void d3d_fs_resize(int x, int y);
|
||||
extern void d3d_fs_take_screenshot(wchar_t *fn);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -8,10 +8,11 @@
|
||||
*
|
||||
* Direct3D 9 full-screen rendererer.
|
||||
*
|
||||
* Version: @(#)win_d3d_fs.cc 1.0.3 2017/10/05
|
||||
* Version: @(#)win_d3d_fs.cc 1.0.4 2017/10/10
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
*
|
||||
* Copyright 2008-2017 Sarah Walker.
|
||||
* Copyright 2016,2017 Miran Grca.
|
||||
*/
|
||||
@@ -21,7 +22,6 @@
|
||||
#include "../video/video.h"
|
||||
#include "win.h"
|
||||
#include "win_d3d.h"
|
||||
#include "win_cgapal.h"
|
||||
|
||||
|
||||
extern "C" void fatal(const char *format, ...);
|
||||
@@ -29,13 +29,15 @@ extern "C" void pclog(const char *format, ...);
|
||||
|
||||
extern "C" void device_force_redraw(void);
|
||||
|
||||
extern "C" void video_blit_complete(void);
|
||||
|
||||
extern "C" void d3d_fs_take_screenshot(wchar_t *fn);
|
||||
|
||||
static void d3d_fs_init_objects(void);
|
||||
static void d3d_fs_close_objects(void);
|
||||
static void d3d_fs_blit_memtoscreen(int x, int y, int y1, int y2, int w, int h);
|
||||
static void d3d_fs_blit_memtoscreen_8(int x, int y, int w, int h);
|
||||
|
||||
extern "C" void video_blit_complete(void);
|
||||
|
||||
|
||||
static LPDIRECT3D9 d3d = NULL;
|
||||
static LPDIRECT3DDEVICE9 d3ddev = NULL;
|
||||
@@ -56,75 +58,6 @@ struct CUSTOMVERTEX
|
||||
};
|
||||
|
||||
|
||||
PALETTE cgapal = {
|
||||
{0,0,0},{0,42,0},{42,0,0},{42,21,0},
|
||||
{0,0,0},{0,42,42},{42,0,42},{42,42,42},
|
||||
{0,0,0},{21,63,21},{63,21,21},{63,63,21},
|
||||
{0,0,0},{21,63,63},{63,21,63},{63,63,63},
|
||||
|
||||
{0,0,0},{0,0,42},{0,42,0},{0,42,42},
|
||||
{42,0,0},{42,0,42},{42,21,00},{42,42,42},
|
||||
{21,21,21},{21,21,63},{21,63,21},{21,63,63},
|
||||
{63,21,21},{63,21,63},{63,63,21},{63,63,63},
|
||||
|
||||
{0,0,0},{0,21,0},{0,0,42},{0,42,42},
|
||||
{42,0,21},{21,10,21},{42,0,42},{42,0,63},
|
||||
{21,21,21},{21,63,21},{42,21,42},{21,63,63},
|
||||
{63,0,0},{42,42,0},{63,21,42},{41,41,41},
|
||||
|
||||
{0,0,0},{0,42,42},{42,0,0},{42,42,42},
|
||||
{0,0,0},{0,42,42},{42,0,0},{42,42,42},
|
||||
{0,0,0},{0,63,63},{63,0,0},{63,63,63},
|
||||
{0,0,0},{0,63,63},{63,0,0},{63,63,63},
|
||||
};
|
||||
|
||||
PALETTE cgapal_mono[6] = {
|
||||
{ /* 0 - green, 4-color-optimized contrast. */
|
||||
{0x00,0x00,0x00},{0x00,0x0d,0x03},{0x01,0x17,0x05},
|
||||
{0x01,0x1a,0x06},{0x02,0x28,0x09},{0x02,0x2c,0x0a},
|
||||
{0x03,0x39,0x0d},{0x03,0x3c,0x0e},{0x00,0x07,0x01},
|
||||
{0x01,0x13,0x04},{0x01,0x1f,0x07},{0x01,0x23,0x08},
|
||||
{0x02,0x31,0x0b},{0x02,0x35,0x0c},{0x05,0x3f,0x11},{0x0d,0x3f,0x17},
|
||||
},
|
||||
{ /* 1 - green, 16-color-optimized contrast. */
|
||||
{0x00,0x00,0x00},{0x00,0x0d,0x03},{0x01,0x15,0x05},
|
||||
{0x01,0x17,0x05},{0x01,0x21,0x08},{0x01,0x24,0x08},
|
||||
{0x02,0x2e,0x0b},{0x02,0x31,0x0b},{0x01,0x22,0x08},
|
||||
{0x02,0x28,0x09},{0x02,0x30,0x0b},{0x02,0x32,0x0c},
|
||||
{0x03,0x39,0x0d},{0x03,0x3b,0x0e},{0x09,0x3f,0x14},{0x0d,0x3f,0x17},
|
||||
},
|
||||
{ /* 2 - amber, 4-color-optimized contrast. */
|
||||
{0x00,0x00,0x00},{0x15,0x05,0x00},{0x20,0x0b,0x00},
|
||||
{0x24,0x0d,0x00},{0x33,0x18,0x00},{0x37,0x1b,0x00},
|
||||
{0x3f,0x26,0x01},{0x3f,0x2b,0x06},{0x0b,0x02,0x00},
|
||||
{0x1b,0x08,0x00},{0x29,0x11,0x00},{0x2e,0x14,0x00},
|
||||
{0x3b,0x1e,0x00},{0x3e,0x21,0x00},{0x3f,0x32,0x0a},{0x3f,0x38,0x0d},
|
||||
},
|
||||
{ /* 3 - amber, 16-color-optimized contrast. */
|
||||
{0x00,0x00,0x00},{0x15,0x05,0x00},{0x1e,0x09,0x00},
|
||||
{0x21,0x0b,0x00},{0x2b,0x12,0x00},{0x2f,0x15,0x00},
|
||||
{0x38,0x1c,0x00},{0x3b,0x1e,0x00},{0x2c,0x13,0x00},
|
||||
{0x32,0x17,0x00},{0x3a,0x1e,0x00},{0x3c,0x1f,0x00},
|
||||
{0x3f,0x27,0x01},{0x3f,0x2a,0x04},{0x3f,0x36,0x0c},{0x3f,0x38,0x0d},
|
||||
},
|
||||
{ /* 4 - grey, 4-color-optimized contrast. */
|
||||
{0x00,0x00,0x00},{0x0e,0x0f,0x10},{0x15,0x17,0x18},
|
||||
{0x18,0x1a,0x1b},{0x24,0x25,0x25},{0x27,0x28,0x28},
|
||||
{0x33,0x34,0x32},{0x37,0x38,0x35},{0x09,0x0a,0x0b},
|
||||
{0x11,0x12,0x13},{0x1c,0x1e,0x1e},{0x20,0x22,0x22},
|
||||
{0x2c,0x2d,0x2c},{0x2f,0x30,0x2f},{0x3c,0x3c,0x38},{0x3f,0x3f,0x3b},
|
||||
},
|
||||
{ /* 5 - grey, 16-color-optimized contrast. */
|
||||
{0x00,0x00,0x00},{0x0e,0x0f,0x10},{0x13,0x14,0x15},
|
||||
{0x15,0x17,0x18},{0x1e,0x20,0x20},{0x20,0x22,0x22},
|
||||
{0x29,0x2a,0x2a},{0x2c,0x2d,0x2c},{0x1f,0x21,0x21},
|
||||
{0x23,0x25,0x25},{0x2b,0x2c,0x2b},{0x2d,0x2e,0x2d},
|
||||
{0x34,0x35,0x33},{0x37,0x37,0x34},{0x3e,0x3e,0x3a},{0x3f,0x3f,0x3b},
|
||||
}
|
||||
};
|
||||
|
||||
uint32_t pal_lookup[256];
|
||||
|
||||
static CUSTOMVERTEX d3d_verts[] =
|
||||
{
|
||||
{ 0.0f, 0.0f, 1.0f, 1.0f, 0xffffff, 0.0f, 0.0f},
|
||||
@@ -145,43 +78,6 @@ static CUSTOMVERTEX d3d_verts[] =
|
||||
};
|
||||
|
||||
|
||||
void cgapal_rebuild(void)
|
||||
{
|
||||
int c;
|
||||
for (c = 0; c < 256; c++)
|
||||
{
|
||||
pal_lookup[c] = makecol(video_6to8[cgapal[c].r], video_6to8[cgapal[c].g], video_6to8[cgapal[c].b]);
|
||||
}
|
||||
if ((cga_palette > 1) && (cga_palette < 8))
|
||||
{
|
||||
if (vid_cga_contrast != 0)
|
||||
{
|
||||
for (c = 0; c < 16; c++)
|
||||
{
|
||||
pal_lookup[c] = makecol(video_6to8[cgapal_mono[cga_palette - 2][c].r], video_6to8[cgapal_mono[cga_palette - 2][c].g], video_6to8[cgapal_mono[cga_palette - 2][c].b]);
|
||||
pal_lookup[c + 16] = makecol(video_6to8[cgapal_mono[cga_palette - 2][c].r], video_6to8[cgapal_mono[cga_palette - 2][c].g], video_6to8[cgapal_mono[cga_palette - 2][c].b]);
|
||||
pal_lookup[c + 32] = makecol(video_6to8[cgapal_mono[cga_palette - 2][c].r], video_6to8[cgapal_mono[cga_palette - 2][c].g], video_6to8[cgapal_mono[cga_palette - 2][c].b]);
|
||||
pal_lookup[c + 48] = makecol(video_6to8[cgapal_mono[cga_palette - 2][c].r], video_6to8[cgapal_mono[cga_palette - 2][c].g], video_6to8[cgapal_mono[cga_palette - 2][c].b]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (c = 0; c < 16; c++)
|
||||
{
|
||||
pal_lookup[c] = makecol(video_6to8[cgapal_mono[cga_palette - 1][c].r], video_6to8[cgapal_mono[cga_palette - 1][c].g], video_6to8[cgapal_mono[cga_palette - 1][c].b]);
|
||||
pal_lookup[c + 16] = makecol(video_6to8[cgapal_mono[cga_palette - 1][c].r], video_6to8[cgapal_mono[cga_palette - 1][c].g], video_6to8[cgapal_mono[cga_palette - 1][c].b]);
|
||||
pal_lookup[c + 32] = makecol(video_6to8[cgapal_mono[cga_palette - 1][c].r], video_6to8[cgapal_mono[cga_palette - 1][c].g], video_6to8[cgapal_mono[cga_palette - 1][c].b]);
|
||||
pal_lookup[c + 48] = makecol(video_6to8[cgapal_mono[cga_palette - 1][c].r], video_6to8[cgapal_mono[cga_palette - 1][c].g], video_6to8[cgapal_mono[cga_palette - 1][c].b]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (cga_palette == 8)
|
||||
{
|
||||
pal_lookup[0x16] = makecol(video_6to8[42], video_6to8[42], video_6to8[0]);
|
||||
}
|
||||
}
|
||||
|
||||
int d3d_fs_init(HWND h)
|
||||
{
|
||||
int c;
|
||||
@@ -190,11 +86,10 @@ int d3d_fs_init(HWND h)
|
||||
d3d_fs_w = GetSystemMetrics(SM_CXSCREEN);
|
||||
d3d_fs_h = GetSystemMetrics(SM_CYSCREEN);
|
||||
|
||||
d3d_hwnd = h;
|
||||
for (c = 0; c < 256; c++)
|
||||
pal_lookup[c] = makecol(cgapal[c].r << 2, cgapal[c].g << 2, cgapal[c].b << 2);
|
||||
|
||||
d3d_hwnd = h;
|
||||
|
||||
/*FIXME: should be done once, in win.c */
|
||||
_swprintf(emulator_title, L"%s v%s", EMU_NAME_W, EMU_VERSION_W);
|
||||
d3d_device_window = CreateWindowEx (
|
||||
@@ -234,9 +129,13 @@ int d3d_fs_init(HWND h)
|
||||
fatal("CreateDevice failed\n");
|
||||
|
||||
d3d_fs_init_objects();
|
||||
|
||||
|
||||
#if 0
|
||||
video_setblit(d3d_fs_blit_memtoscreen_8, d3d_fs_blit_memtoscreen);
|
||||
#else
|
||||
video_blit_memtoscreen_func = d3d_fs_blit_memtoscreen;
|
||||
video_blit_memtoscreen_8_func = d3d_fs_blit_memtoscreen_8;
|
||||
#endif
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include "../plat.h"
|
||||
#include "../ui.h"
|
||||
#include "win_ddraw.h"
|
||||
#include "win_cgapal.h"
|
||||
#include "win.h"
|
||||
|
||||
|
||||
@@ -22,6 +21,7 @@ extern "C" void device_force_redraw(void);
|
||||
|
||||
extern "C" int ddraw_init(HWND h);
|
||||
extern "C" void ddraw_close(void);
|
||||
extern "C" void ddraw_take_screenshot(wchar_t *fn);
|
||||
|
||||
extern "C" void video_blit_complete(void);
|
||||
|
||||
@@ -365,8 +365,13 @@ ddraw_init(HWND h)
|
||||
if (FAILED(lpdds_pri->SetClipper(lpdd_clipper))) return(0);
|
||||
|
||||
ddraw_hwnd = h;
|
||||
|
||||
#if 0
|
||||
video_setblit(ddraw_blit_memtoscreen_8, ddraw_blit_memtoscreen);
|
||||
#else
|
||||
video_blit_memtoscreen_func = ddraw_blit_memtoscreen;
|
||||
video_blit_memtoscreen_8_func = ddraw_blit_memtoscreen_8;
|
||||
#endif
|
||||
|
||||
return(1);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ extern void ddraw_take_screenshot(wchar_t *fn);
|
||||
|
||||
extern int ddraw_fs_init(HWND h);
|
||||
extern void ddraw_fs_close(void);
|
||||
extern void ddraw_fs_take_screenshot(wchar_t *fn);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include <stdint.h>
|
||||
#include "../video/video.h"
|
||||
#include "win_ddraw.h"
|
||||
#include "win_cgapal.h"
|
||||
|
||||
|
||||
static LPDIRECTDRAW lpdd = NULL;
|
||||
@@ -25,6 +24,7 @@ extern "C" void device_force_redraw(void);
|
||||
|
||||
extern "C" int ddraw_fs_init(HWND h);
|
||||
extern "C" void ddraw_fs_close(void);
|
||||
extern "C" void ddraw_fs_take_screenshot(wchar_t *fn);
|
||||
|
||||
extern void ddraw_common_take_screenshot(wchar_t *fn, IDirectDrawSurface7 *pDDSurface);
|
||||
|
||||
@@ -92,8 +92,12 @@ int ddraw_fs_init(HWND h)
|
||||
|
||||
pclog("DDRAW_INIT complete\n");
|
||||
ddraw_hwnd = h;
|
||||
#if 0
|
||||
video_setblit(ddraw_fs_blit_memtoscreen_8, ddraw_fs_blit_memtoscreen);
|
||||
#else
|
||||
video_blit_memtoscreen_func = ddraw_fs_blit_memtoscreen;
|
||||
video_blit_memtoscreen_8_func = ddraw_fs_blit_memtoscreen_8;
|
||||
#endif
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Windows device configuration dialog implementation.
|
||||
*
|
||||
* Version: @(#)win_deviceconfig.c 1.0.5 2017/10/09
|
||||
* Version: @(#)win_deviceconfig.c 1.0.7 2017/10/10
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -24,8 +24,8 @@
|
||||
#include "../config.h"
|
||||
#include "../device.h"
|
||||
#include "../plat.h"
|
||||
#include "../plat_midi.h"
|
||||
#include "../ui.h"
|
||||
#include "plat_midi.h"
|
||||
#include "win.h"
|
||||
#include <windowsx.h>
|
||||
|
||||
|
||||
@@ -8,9 +8,10 @@
|
||||
*
|
||||
* Try to load a support DLL.
|
||||
*
|
||||
* Version: @(#)win_dynld.c 1.0.3 2017/09/24
|
||||
* Version: @(#)win_dynld.c 1.0.4 2017/10/10
|
||||
*
|
||||
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
* Copyright 2017 Fred N. van Kempen
|
||||
*/
|
||||
#include <stdio.h>
|
||||
@@ -20,8 +21,8 @@
|
||||
#include <wchar.h>
|
||||
#include <pcap.h>
|
||||
#include <windows.h>
|
||||
#include "plat_dynld.h"
|
||||
#include "../ibm.h"
|
||||
#include "../plat_dynld.h"
|
||||
|
||||
|
||||
void *
|
||||
|
||||
@@ -8,10 +8,11 @@
|
||||
*
|
||||
* Joystick interface to host device.
|
||||
*
|
||||
* Version: @(#)win_joystick.cc 1.0.2 2017/10/01
|
||||
* Version: @(#)win_joystick.cc 1.0.3 2017/10/10
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
*
|
||||
* Copyright 2008-2017 Sarah Walker.
|
||||
* Copyright 2016,2017 Miran Grca.
|
||||
*/
|
||||
@@ -23,7 +24,8 @@ extern "C" {
|
||||
#include "../device.h"
|
||||
#include "../game/gameport.h"
|
||||
}
|
||||
#include "plat_joystick.h"
|
||||
#include "../plat.h"
|
||||
#include "../plat_joystick.h"
|
||||
#include "win.h"
|
||||
|
||||
extern "C" int video_fullscreen;
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
#include "../config.h"
|
||||
#include "../device.h"
|
||||
#include "../game/gameport.h"
|
||||
#include "plat_joystick.h"
|
||||
#include "../plat.h"
|
||||
#include "../plat_joystick.h"
|
||||
#include "win.h"
|
||||
|
||||
|
||||
|
||||
@@ -8,28 +8,27 @@
|
||||
*
|
||||
* Windows raw keyboard input handler.
|
||||
*
|
||||
* Version: @(#)win_d3d.cc 1.0.1 2017/09/24
|
||||
* Version: @(#)win_keyboard.c 1.0.2 2017/10/10
|
||||
*
|
||||
* Author: Miran Grca, <mgrca8@gmail.com>
|
||||
*
|
||||
* Copyright 2016-2017 Miran Grca.
|
||||
*/
|
||||
|
||||
#define UNICODE
|
||||
#define _WIN32_WINNT 0x0501
|
||||
#define BITMAP WINDOWS_BITMAP
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
#undef BITMAP
|
||||
#include <commctrl.h>
|
||||
#include <commdlg.h>
|
||||
#include <process.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
//#include <commctrl.h>
|
||||
//#include <commdlg.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include "../device.h"
|
||||
#include "plat_keyboard.h"
|
||||
#include "../plat.h"
|
||||
#include "../plat_keyboard.h"
|
||||
#include "win.h"
|
||||
|
||||
|
||||
|
||||
@@ -7,13 +7,14 @@
|
||||
#include "../ibm.h"
|
||||
#include "../config.h"
|
||||
#include "../sound/midi.h"
|
||||
#include "plat_midi.h"
|
||||
#include "../plat.h"
|
||||
#include "../plat_midi.h"
|
||||
|
||||
|
||||
int midi_id = 0;
|
||||
static HMIDIOUT midi_out_device = NULL;
|
||||
|
||||
HANDLE m_event;
|
||||
|
||||
static HMIDIOUT midi_out_device = NULL;
|
||||
static uint8_t midi_rt_buf[1024];
|
||||
static uint8_t midi_cmd_buf[1024];
|
||||
static int midi_cmd_pos = 0;
|
||||
|
||||
@@ -8,17 +8,19 @@
|
||||
*
|
||||
* Mouse interface to host device.
|
||||
*
|
||||
* Version: @(#)win_mouse.cc 1.0.2 2017/09/24
|
||||
* Version: @(#)win_mouse.cc 1.0.3 2017/10/10
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
*
|
||||
* Copyright 2008-2017 Sarah Walker.
|
||||
* Copyright 2016,2017 Miran Grca.
|
||||
*/
|
||||
#define DIRECTINPUT_VERSION 0x0800
|
||||
#include <dinput.h>
|
||||
#include <stdint.h>
|
||||
#include "plat_mouse.h"
|
||||
#include "../plat.h"
|
||||
#include "../plat_mouse.h"
|
||||
#include "win.h"
|
||||
|
||||
|
||||
|
||||
@@ -10,9 +10,10 @@
|
||||
*
|
||||
* Based on old original code @(#)dir_win32.c 1.2.0 2007/04/19
|
||||
*
|
||||
* Version: @(#)win_opendir.c 1.0.2 2017/09/24
|
||||
* Version: @(#)win_opendir.c 1.0.3 2017/10/10
|
||||
*
|
||||
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
* Copyright 1998-2007 MicroWalt Corporation
|
||||
* Copyright 2017 Fred N. van Kempen
|
||||
*/
|
||||
@@ -25,7 +26,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "plat_dir.h"
|
||||
#include "../plat.h"
|
||||
#include "../plat_dir.h"
|
||||
|
||||
|
||||
#ifdef UNICODE
|
||||
|
||||
@@ -12,21 +12,20 @@
|
||||
* Windows and UNIX systems, with support for FTDI and Prolific
|
||||
* USB ports. Support for these has been removed.
|
||||
*
|
||||
* Version: @(#)win_serial.c 1.0.4 2017/09/12
|
||||
* Version: @(#)win_serial.c 1.0.6 2017/10/10
|
||||
*
|
||||
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
* Copyright 2017 Fred N. van Kempen.
|
||||
*/
|
||||
#include <windows.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "plat_thread.h"
|
||||
#define BHTTY_C
|
||||
#include "plat_serial.h"
|
||||
|
||||
|
||||
extern void pclog(char *__fmt, ...);
|
||||
#define PLAT_SERIAL_C
|
||||
#include "../ibm.h"
|
||||
#include "../plat.h"
|
||||
#include "../plat_serial.h"
|
||||
|
||||
|
||||
/* Handle the receiving of data from the host port. */
|
||||
@@ -324,10 +323,10 @@ int
|
||||
bhtty_flush(BHTTY *pp)
|
||||
{
|
||||
DWORD dwErrs;
|
||||
COMSTAT cs;
|
||||
COMSTAT cst;
|
||||
|
||||
/* First, clear any errors. */
|
||||
(void)ClearCommError(pp->handle, &dwErrs, &cs);
|
||||
(void)ClearCommError(pp->handle, &dwErrs, &cst);
|
||||
|
||||
/* Now flush all buffers. */
|
||||
if (PurgeComm(pp->handle,
|
||||
@@ -338,7 +337,7 @@ bhtty_flush(BHTTY *pp)
|
||||
}
|
||||
|
||||
/* Re-clear any errors. */
|
||||
if (ClearCommError(pp->handle, &dwErrs, &cs) == FALSE) {
|
||||
if (ClearCommError(pp->handle, &dwErrs, &cst) == FALSE) {
|
||||
pclog("%s: clear errors: %d\n", pp->name, GetLastError());
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -51,8 +51,8 @@
|
||||
#include "../video/video.h"
|
||||
#include "../video/vid_voodoo.h"
|
||||
#include "../plat.h"
|
||||
#include "../plat_midi.h"
|
||||
#include "../ui.h"
|
||||
#include "plat_midi.h"
|
||||
#include "win.h"
|
||||
|
||||
|
||||
|
||||
@@ -8,10 +8,11 @@
|
||||
*
|
||||
* Implement threads and mutexes for the Win32 platform.
|
||||
*
|
||||
* Version: @(#)win_thread.c 1.0.1 2017/10/05
|
||||
* Version: @(#)win_thread.c 1.0.2 2017/10/10
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
* Copyright 2008-2017 Sarah Walker.
|
||||
* Copyright 2017 Fred N. van Kempen.
|
||||
*/
|
||||
@@ -27,7 +28,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "plat_thread.h"
|
||||
#include "../plat.h"
|
||||
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
/* Copyright holders: Sarah Walker
|
||||
see COPYING for more details
|
||||
*/
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "../video/video.h"
|
||||
#include "win_cgapal.h"
|
||||
|
||||
|
||||
BITMAP *screen;
|
||||
|
||||
|
||||
void hline(BITMAP *b, int x1, int y, int x2, uint32_t col)
|
||||
{
|
||||
if (y < 0 || y >= buffer->h)
|
||||
return;
|
||||
|
||||
if (b == buffer)
|
||||
memset(&b->line[y][x1], col, x2 - x1);
|
||||
else
|
||||
memset(&((uint32_t *)b->line[y])[x1], col, (x2 - x1) * 4);
|
||||
}
|
||||
|
||||
void blit(BITMAP *src, BITMAP *dst, int x1, int y1, int x2, int y2, int xs, int ys)
|
||||
{
|
||||
}
|
||||
|
||||
void stretch_blit(BITMAP *src, BITMAP *dst, int x1, int y1, int xs1, int ys1, int x2, int y2, int xs2, int ys2)
|
||||
{
|
||||
}
|
||||
|
||||
void rectfill(BITMAP *b, int x1, int y1, int x2, int y2, uint32_t col)
|
||||
{
|
||||
}
|
||||
|
||||
void set_palette(PALETTE p)
|
||||
{
|
||||
}
|
||||
|
||||
void destroy_bitmap(BITMAP *b)
|
||||
{
|
||||
}
|
||||
|
||||
BITMAP *create_bitmap(int x, int y)
|
||||
{
|
||||
BITMAP *b = malloc(sizeof(BITMAP) + (y * sizeof(uint8_t *)));
|
||||
int c;
|
||||
b->dat = malloc(x * y * 4);
|
||||
for (c = 0; c < y; c++)
|
||||
{
|
||||
b->line[c] = b->dat + (c * x * 4);
|
||||
}
|
||||
b->w = x;
|
||||
b->h = y;
|
||||
return b;
|
||||
}
|
||||
Reference in New Issue
Block a user