#include <sys/time.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <strings.h>
#include <stdarg.h>
#include <unistd.h>
#include <ctype.h>
#include <assert.h>
#include <SDL.h>
#include <SDL_audio.h>
#include <SDL_opengl.h>
#include "md.h"
#include "rc.h"
#include "rc-vars.h"
#include "pd.h"
#include "pd-defs.h"
#include "font.h"
#include "system.h"
#include "prompt.h"
#include "romload.h"
#include "splash.h"
#include "hqx.h"
#include "scalebit.h"
Classes | |
union | bpp_t |
Generic type for supported colour depths. More... | |
struct | cbuf_t |
Circular buffer and related functions. More... | |
struct | prompt_command |
struct | filter |
Filter that works on an output frame. More... | |
struct | scaling |
struct | kb_input_t |
Keyboard input. More... | |
struct | ctl |
Macros | |
#define | HQX_NO_UINT24 |
SDL interface. | |
#define | PROMPT_RET_CONT 0x01 |
Prompt return values. | |
#define | PROMPT_RET_EXIT 0x02 |
leave prompt normally | |
#define | PROMPT_RET_ERROR 0x04 |
leave prompt with error | |
#define | PROMPT_RET_ENTER 0x10 |
previous line entered | |
#define | PROMPT_RET_MSG 0x80 |
stop_events_msg() has been used | |
#define | CMD_OK 0x00 |
Extra commands return values. | |
#define | CMD_EINVAL 0x01 |
invalid argument | |
#define | CMD_FAIL 0x02 |
command failed | |
#define | CMD_ERROR 0x03 |
fatal error, DGen should exit | |
#define | CMD_MSG 0x80 |
stop_events_msg() has been used | |
#define | MESSAGE_LIFE 3000000 |
Number of microseconds to sustain messages. | |
#define | TEXTURE_16_TYPE GL_UNSIGNED_SHORT_5_6_5 |
#define | TEXTURE_32_TYPE GL_UNSIGNED_BYTE |
#define | FILTER_TEXT_ESCAPE "\033" |
Special characters interpreted by filter_text(). | |
#define | FILTER_TEXT_BG_NONE FILTER_TEXT_ESCAPE "\x01\x01" |
#define | FILTER_TEXT_BG_BLACK FILTER_TEXT_ESCAPE "\x01\x02" |
#define | FILTER_TEXT_7X6 FILTER_TEXT_ESCAPE "\x02\x01" |
#define | FILTER_TEXT_8X13 FILTER_TEXT_ESCAPE "\x02\x02" |
#define | FILTER_TEXT_16X26 FILTER_TEXT_ESCAPE "\x02\x03" |
#define | FILTER_TEXT_CENTER FILTER_TEXT_ESCAPE "\x03\x01" |
#define | FILTER_TEXT_LEFT FILTER_TEXT_ESCAPE "\x03\x02" |
#define | FILTER_TEXT_RIGHT FILTER_TEXT_ESCAPE "\x03\x03" |
#define | FILTER_TEXT_IS(f) |
#define | HISTORY_LEN 32 |
#define | CE(i, s) { i, s, sizeof(s) } |
Functions | |
static void | pd_message_process (void) |
Process status bar message. | |
static size_t | pd_message_write (const char *msg, size_t len, unsigned int mark) |
static size_t | pd_message_display (const char *msg, size_t len, unsigned int mark, bool update) |
static void | pd_message_postpone (const char *msg) |
Postpone a message. | |
static void | release_texture () |
static int | init_texture () |
static void | update_texture () |
static int | screen_lock () |
Call this before accessing screen.buf. | |
static void | screen_unlock () |
Call this after accessing screen.buf. | |
static void | screen_update_once () |
Do not call this directly, use screen_update() instead. | |
static void | screen_update () |
Call this after writing into screen.buf. | |
void | md_save (md &megad) |
void | md_load (md &megad) |
static void | mdscr_splash () |
Display splash screen. | |
size_t | cbuf_write (cbuf_t *cbuf, uint8_t *src, size_t size) |
Write/copy data into a circular buffer. | |
size_t | cbuf_read (uint8_t *dst, cbuf_t *cbuf, size_t size) |
Read bytes out of a circular buffer. | |
static int | prompt_cmd_exit (class md &, unsigned int, const char **) |
Prompt "exit" command handler. | |
static int | prompt_cmd_load (class md &md, unsigned int ac, const char **av) |
Prompt "load" command handler. | |
static char * | prompt_cmpl_load (class md &, unsigned int, const char **, unsigned int) |
static int | prompt_cmd_unload (class md &, unsigned int, const char **) |
static int | prompt_cmd_reset (class md &, unsigned int, const char **) |
static int | prompt_cmd_unbind (class md &, unsigned int, const char **) |
static char * | prompt_cmpl_unbind (class md &, unsigned int, const char **, unsigned int) |
static int | prompt_cmd_filter_push (class md &, unsigned int, const char **) |
static char * | prompt_cmpl_filter_push (class md &, unsigned int, const char **, unsigned int) |
static int | prompt_cmd_filter_pop (class md &, unsigned int, const char **) |
static int | prompt_cmd_filter_none (class md &, unsigned int, const char **) |
static int | prompt_cmd_calibrate (class md &, unsigned int n_args, const char **args) |
Interactively calibrate a controller. | |
unsigned long | pd_usecs (void) |
Elapsed time in microseconds. | |
static void | stop_events_msg (unsigned int mark, const char *msg,...) |
static void | rehash_prompt_complete_common () |
static void | filters_push (const struct filter **stack, const struct filter *f) |
Add filter to stack. | |
static void | filters_push_once (const struct filter **stack, const struct filter *f) |
Add filter to stack if not already in it. | |
static void | filters_pop (const struct filter **stack) |
Remove last filter from stack. | |
static void | filters_pluck (const struct filter **stack, const struct filter *f) |
Remove all occurences of filter from the stack. | |
static void | filters_empty (const struct filter **stack) |
Empty filters stack. | |
static void | set_swab () |
static void | do_screenshot (md &megad) |
Take a screenshot. | |
void | pd_help () |
SDL flags help. | |
void | pd_rc () |
Handle rc variables. | |
void | pd_option (char c, const char *) |
Handle the switches. | |
static void | texture_init_id () |
static void | texture_init_dlist () |
static uint32_t | roundup2 (uint32_t v) |
Round a value up to nearest power of two. | |
static void | rescale_32_1x1 (uint32_t *dst, unsigned int dst_pitch, uint32_t *src, unsigned int src_pitch, unsigned int xsize, unsigned int xscale, unsigned int ysize, unsigned int yscale) |
static void | rescale_32_any (uint32_t *dst, unsigned int dst_pitch, uint32_t *src, unsigned int src_pitch, unsigned int xsize, unsigned int xscale, unsigned int ysize, unsigned int yscale) |
static void | rescale_24_1x1 (uint24_t *dst, unsigned int dst_pitch, uint24_t *src, unsigned int src_pitch, unsigned int xsize, unsigned int xscale, unsigned int ysize, unsigned int yscale) |
static void | rescale_24_any (uint24_t *dst, unsigned int dst_pitch, uint24_t *src, unsigned int src_pitch, unsigned int xsize, unsigned int xscale, unsigned int ysize, unsigned int yscale) |
static void | rescale_16_1x1 (uint16_t *dst, unsigned int dst_pitch, uint16_t *src, unsigned int src_pitch, unsigned int xsize, unsigned int xscale, unsigned int ysize, unsigned int yscale) |
static void | rescale_16_any (uint16_t *dst, unsigned int dst_pitch, uint16_t *src, unsigned int src_pitch, unsigned int xsize, unsigned int xscale, unsigned int ysize, unsigned int yscale) |
static void | rescale_8_1x1 (uint8_t *dst, unsigned int dst_pitch, uint8_t *src, unsigned int src_pitch, unsigned int xsize, unsigned int xscale, unsigned int ysize, unsigned int yscale) |
static void | rescale_8_any (uint8_t *dst, unsigned int dst_pitch, uint8_t *src, unsigned int src_pitch, unsigned int xsize, unsigned int xscale, unsigned int ysize, unsigned int yscale) |
static void | rescale_1x1 (bpp_t dst, unsigned int dst_pitch, bpp_t src, unsigned int src_pitch, unsigned int xsize, unsigned int xscale, unsigned int ysize, unsigned int yscale, unsigned int bpp) |
static void | rescale_any (bpp_t dst, unsigned int dst_pitch, bpp_t src, unsigned int src_pitch, unsigned int xsize, unsigned int xscale, unsigned int ysize, unsigned int yscale, unsigned int bpp) |
static void | rescale_hqx (bpp_t dst, unsigned int dst_pitch, bpp_t src, unsigned int src_pitch, unsigned int xsize, unsigned int xscale, unsigned int ysize, unsigned int yscale, unsigned int bpp) |
static void | rescale_scale2x (bpp_t dst, unsigned int dst_pitch, bpp_t src, unsigned int src_pitch, unsigned int xsize, unsigned int xscale, unsigned int ysize, unsigned int yscale, unsigned int bpp) |
static void | filter_blur_u32 (uint32_t *buf, unsigned int buf_pitch, unsigned int xsize, unsigned int ysize) |
static void | filter_blur_u24 (uint24_t *buf, unsigned int buf_pitch, unsigned int xsize, unsigned int ysize) |
static void | filter_blur_u16 (uint16_t *buf, unsigned int buf_pitch, unsigned int xsize, unsigned int ysize) |
static void | filter_blur_u15 (uint16_t *buf, unsigned int buf_pitch, unsigned int xsize, unsigned int ysize) |
static void | filter_blur (bpp_t buf, unsigned int buf_pitch, unsigned int xsize, unsigned int ysize, unsigned int bpp) |
static void | filter_scanline_frame (bpp_t buf, unsigned int buf_pitch, unsigned int xsize, unsigned int ysize, unsigned int bpp, unsigned int frame) |
static void | filter_scanline (bpp_t buf, unsigned int buf_pitch, unsigned int xsize, unsigned int ysize, unsigned int bpp) |
static void | filter_interlace (bpp_t buf, unsigned int buf_pitch, unsigned int xsize, unsigned int ysize, unsigned int bpp) |
static void | filter_swab (bpp_t buf, unsigned int buf_pitch, unsigned int xsize, unsigned int ysize, unsigned int bpp) |
static void | filter_text_msg (const char *fmt,...) |
Append message to filter_text_str[]. | |
static void | filter_text (bpp_t buf, unsigned int buf_pitch, unsigned int xsize, unsigned int ysize, unsigned int bpp) |
Text overlay filter. | |
static void | filter_off (bpp_t buf, unsigned int buf_pitch, unsigned int xsize, unsigned int ysize, unsigned int bpp) |
No-op filter. | |
static void | manage_calibration (bool type, intptr_t code) |
Handle input during calibration process. | |
static int | set_scaling (const char *name) |
static int | screen_init (unsigned int width, unsigned int height) |
Initialize screen. | |
static int | set_fullscreen (int toggle) |
Set fullscreen mode. | |
int | pd_graphics_init (int want_sound, int want_pal, int hz) |
Initialize SDL, and the graphics. | |
int | pd_graphics_reinit (int, int want_pal, int hz) |
Reinitialize graphics. | |
void | pd_graphics_palette_update () |
Update palette. | |
void | pd_graphics_update (bool update) |
Display screen. | |
static void | snd_callback (void *, Uint8 *stream, int len) |
Callback for sound. | |
int | pd_sound_init (long &freq, unsigned int &samples) |
Initialize the sound. | |
void | pd_sound_deinit () |
Deinitialize sound subsystem. | |
void | pd_sound_start () |
Start/stop audio processing. | |
void | pd_sound_pause () |
Pause sound. | |
unsigned int | pd_sound_rp () |
Return samples read/write indices in the buffer. | |
unsigned int | pd_sound_wp () |
void | pd_sound_write () |
Write contents of sndi to sound.cbuf. | |
int | pd_stopped () |
Tells whether DGen stopped intentionally so emulation can resume without skipping frames. | |
static enum kb_input | kb_input (kb_input_t *input, uint32_t ksym, uint16_t ksym_uni) |
Manage text input with some rudimentary history. | |
static int | prompt_rehash_rc_field (const struct rc_field *rc, md &megad) |
Rehash rc vars that require special handling (see "SH" in rc.cpp). | |
static void | prompt_show_rc_field (const struct rc_field *rc) |
static int | handle_prompt_enter (class md &md) |
static void | handle_prompt_complete_clear () |
static int | handle_prompt_complete (class md &md, bool rwd) |
static int | handle_prompt (uint32_t ksym, uint16_t ksym_uni, md &megad) |
static int | stop_events (md &megad, int gg) |
static int | ctl_pad1 (struct ctl &ctl, md &megad) |
static int | ctl_pad1_release (struct ctl &ctl, md &megad) |
static int | ctl_pad2 (struct ctl &ctl, md &megad) |
static int | ctl_pad2_release (struct ctl &ctl, md &megad) |
static int | ctl_dgen_quit (struct ctl &, md &) |
static int | ctl_dgen_craptv_toggle (struct ctl &, md &) |
static int | ctl_dgen_scaling_toggle (struct ctl &, md &) |
static int | ctl_dgen_reset (struct ctl &, md &megad) |
static int | ctl_dgen_slot (struct ctl &ctl, md &) |
static int | ctl_dgen_save (struct ctl &, md &megad) |
static int | ctl_dgen_load (struct ctl &, md &megad) |
static int | ctl_dgen_z80_toggle (struct ctl &, md &megad) |
static int | ctl_dgen_cpu_toggle (struct ctl &, md &megad) |
static int | ctl_dgen_stop (struct ctl &, md &megad) |
static int | ctl_dgen_prompt (struct ctl &, md &megad) |
static int | ctl_dgen_game_genie (struct ctl &, md &megad) |
static int | ctl_dgen_volume (struct ctl &ctl, md &) |
static int | ctl_dgen_fullscreen_toggle (struct ctl &, md &) |
static int | ctl_dgen_fix_checksum (struct ctl &, md &megad) |
static int | ctl_dgen_screenshot (struct ctl &, md &megad) |
static int | ctl_dgen_debug_enter (struct ctl &, md &megad) |
static int | manage_bindings (md &md, bool pressed, bool type, intptr_t code) |
int | pd_handle_events (md &megad) |
void | pd_message (const char *msg,...) |
Write a message to the status bar. | |
void | pd_clear_message () |
void | pd_show_carthead (md &megad) |
void | pd_quit () |
Variables | |
struct { | |
unsigned int width | |
texture width | |
unsigned int height | |
texture height | |
unsigned int vis_width | |
visible width | |
unsigned int vis_height | |
visible height | |
GLuint id | |
texture identifier | |
GLuint dlist | |
display list | |
unsigned int u32:1 | |
texture is 32-bit | |
unsigned int linear:1 | |
linear filtering is enabled | |
union { | |
uint16_t * u16 | |
uint32_t * u32 | |
} buf | |
16 or 32-bit buffer | |
} | texture |
Framebuffer texture. | |
struct { | |
unsigned int width | |
window width | |
unsigned int height | |
window height | |
unsigned int bpp | |
bits per pixel | |
unsigned int Bpp | |
bytes per pixel | |
unsigned int x_offset | |
horizontal offset | |
unsigned int y_offset | |
vertical offset | |
unsigned int info_height | |
message bar height | |
bpp_t buf | |
generic pointer to pixel data | |
unsigned int pitch | |
number of bytes per line in buf | |
SDL_Surface * surface | |
SDL surface. | |
unsigned int want_fullscreen:1 | |
want fullscreen | |
unsigned int is_fullscreen:1 | |
fullscreen enabled | |
unsigned int last_video_height | |
last video.height value | |
unsigned int want_opengl:1 | |
want OpenGL | |
unsigned int is_opengl:1 | |
OpenGL enabled. | |
unsigned int opengl_ok:1 | |
if textures are initialized | |
SDL_Color color [64] | |
SDL colors for 8bpp modes. | |
} | screen |
struct { | |
const unsigned int width | |
320 | |
unsigned int height | |
224 or 240 (NTSC_VBLANK or PAL_VBLANK) | |
unsigned int x_scale | |
scale horizontally | |
unsigned int y_scale | |
scale vertically | |
unsigned int hz | |
refresh rate | |
unsigned int is_pal: 1 | |
PAL enabled. | |
uint8_t palette [256] | |
palette for 8bpp modes (mdpal) | |
} | video |
int | slot |
struct bmap | mdscr |
unsigned char * | mdpal = NULL |
struct sndinfo | sndi |
const char * | pd_options = "fX:Y:S:G:" |
struct { | |
unsigned int rate | |
samples rate | |
unsigned int samples | |
number of samples required by the callback | |
cbuf_t cbuf | |
circular buffer | |
} | sound |
Sound. | |
struct { | |
unsigned int displayed:1 | |
whether message is currently displayed | |
unsigned long since | |
since this number of microseconds | |
size_t length | |
remaining length to display | |
char message [2048] | |
message | |
} | info |
Messages. | |
struct { | |
struct prompt status | |
prompt status | |
char ** complete | |
completion results array | |
unsigned int skip | |
number of entries to skip in the array | |
unsigned int common | |
common length of all entries | |
} | prompt |
Prompt. | |
static struct prompt_command | prompt_command [] |
List of commands to auto complete. | |
static int | stopped = 0 |
Stopped flag used by pd_stopped() | |
bool | pd_freeze = false |
Enable emulation by default. | |
static struct filter * | filters_prescale [64] |
static struct filter * | filters_postscale [64] |
static void(* | scaling )(bpp_t dst, unsigned int dst_pitch, bpp_t src, unsigned int src_pitch, unsigned int xsize, unsigned int xscale, unsigned int ysize, unsigned int yscale, unsigned int bpp) |
static char | filter_text_str [2048] |
static struct filter | filter_text_def = { "text", filter_text } |
static struct filter | filters_list [] |
List of available filters. | |
static bool | calibrating = false |
static unsigned int | calibrating_controller |
Controller being calibrated. | |
static struct scaling | scaling_list [] |
static uint16_t | kpress [0x100] |
static struct ctl | control [] |
struct { | |
char const * name | |
Controller button name. | |
enum ctl_e const id [2] | |
Controls indices in control[]. | |
bool once | |
If button has been pressed once. | |
bool twice | |
If button has been pressed twice. | |
bool type | |
Type of code, false for keysym, true for joypad. | |
intptr_t code | |
Temporary keysym or joypad code. | |
} | calibration_steps [] |
#define CMD_EINVAL 0x01 |
invalid argument
#define CMD_ERROR 0x03 |
fatal error, DGen should exit
#define CMD_FAIL 0x02 |
command failed
#define CMD_MSG 0x80 |
stop_events_msg() has been used
#define CMD_OK 0x00 |
Extra commands return values.
command successful
#define FILTER_TEXT_16X26 FILTER_TEXT_ESCAPE "\x02\x03" |
#define FILTER_TEXT_7X6 FILTER_TEXT_ESCAPE "\x02\x01" |
#define FILTER_TEXT_8X13 FILTER_TEXT_ESCAPE "\x02\x02" |
#define FILTER_TEXT_BG_BLACK FILTER_TEXT_ESCAPE "\x01\x02" |
#define FILTER_TEXT_BG_NONE FILTER_TEXT_ESCAPE "\x01\x01" |
#define FILTER_TEXT_CENTER FILTER_TEXT_ESCAPE "\x03\x01" |
#define FILTER_TEXT_ESCAPE "\033" |
Special characters interpreted by filter_text().
FILTER_TEXT_BG_NONE transparent background. FILTER_TEXT_BG_BLACK black background. FILTER_TEXT_7X6 use 7x6 font. FILTER_TEXT_8X13 use 8x13 font. FILTER_TEXT_16X26 use 16x26 font. FILTER_TEXT_CENTER center justify. FILTER_TEXT_LEFT left justify. FILTER_TEXT_RIGHT right justify.
#define FILTER_TEXT_IS | ( | f | ) |
#define FILTER_TEXT_LEFT FILTER_TEXT_ESCAPE "\x03\x02" |
#define FILTER_TEXT_RIGHT FILTER_TEXT_ESCAPE "\x03\x03" |
#define HISTORY_LEN 32 |
#define HQX_NO_UINT24 |
SDL interface.
#define MESSAGE_LIFE 3000000 |
Number of microseconds to sustain messages.
#define PROMPT_RET_CONT 0x01 |
Prompt return values.
waiting for more input
#define PROMPT_RET_ENTER 0x10 |
previous line entered
#define PROMPT_RET_ERROR 0x04 |
leave prompt with error
#define PROMPT_RET_EXIT 0x02 |
leave prompt normally
#define PROMPT_RET_MSG 0x80 |
stop_events_msg() has been used
#define TEXTURE_16_TYPE GL_UNSIGNED_SHORT_5_6_5 |
#define TEXTURE_32_TYPE GL_UNSIGNED_BYTE |
enum ctl_e |
enum kb_input |
size_t cbuf_read | ( | uint8_t * | dst, |
cbuf_t * | cbuf, | ||
size_t | size | ||
) |
Read bytes out of a circular buffer.
[out] | dst | Destination buffer. |
[in,out] | cbuf | Circular buffer to read from. |
size | Maximum number of bytes to copy to dst. |
size_t cbuf_write | ( | cbuf_t * | cbuf, |
uint8_t * | src, | ||
size_t | size | ||
) |
Write/copy data into a circular buffer.
[in,out] | cbuf | Destination buffer. |
[in] | src | Buffer to copy from. |
size | Size of src. |
|
static |
Take a screenshot.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
No-op filter.
|
static |
|
static |
|
static |
|
static |
Text overlay filter.
|
static |
Append message to filter_text_str[].
|
static |
Empty filters stack.
stack | Stack of filters. |
Remove all occurences of filter from the stack.
stack | Stack of current filters. |
f | Filter to remove. |
|
static |
Remove last filter from stack.
stack | Stack of filters. |
Add filter to stack.
stack | Stack of filters. |
f | Filter to add. |
Add filter to stack if not already in it.
stack | Stack of filters. |
f | Filter to add. |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Manage text input with some rudimentary history.
input | Input buffer. |
ksym | Keyboard symbol. |
ksym_uni | Unicode translation for keyboard symbol. |
|
static |
|
static |
Handle input during calibration process.
type | Type of code (false for keysym, true for joypad). |
code | keysym/joypad code to process. |
void md_load | ( | md & | megad | ) |
void md_save | ( | md & | megad | ) |
|
static |
Display splash screen.
void pd_clear_message | ( | ) |
int pd_graphics_init | ( | int | want_sound, |
int | want_pal, | ||
int | hz | ||
) |
Initialize SDL, and the graphics.
want_sound | Nonzero if we want sound. |
want_pal | Nonzero for PAL mode. |
hz | Requested frame rate (between 0 and 1000). |
void pd_graphics_palette_update | ( | ) |
Update palette.
int pd_graphics_reinit | ( | int | , |
int | want_pal, | ||
int | hz | ||
) |
Reinitialize graphics.
want_pal | Nonzero for PAL mode. |
hz | Requested frame rate (between 0 and 1000). |
void pd_graphics_update | ( | bool | update | ) |
Display screen.
update | False if screen buffer is garbage and must be updated first. |
int pd_handle_events | ( | md & | megad | ) |
void pd_help | ( | ) |
SDL flags help.
void pd_message | ( | const char * | msg, |
... | |||
) |
Write a message to the status bar.
|
static |
|
static |
Postpone a message.
|
static |
Process status bar message.
|
static |
void pd_option | ( | char | c, |
const char * | |||
) |
Handle the switches.
c | Switch's value. |
void pd_quit | ( | ) |
void pd_rc | ( | ) |
Handle rc variables.
void pd_show_carthead | ( | md & | megad | ) |
void pd_sound_deinit | ( | ) |
Deinitialize sound subsystem.
int pd_sound_init | ( | long & | freq, |
unsigned int & | samples | ||
) |
Initialize the sound.
freq | Sound samples rate. | |
[in,out] | samples | Minimum buffer size in samples. |
void pd_sound_pause | ( | ) |
Pause sound.
unsigned int pd_sound_rp | ( | ) |
Return samples read/write indices in the buffer.
void pd_sound_start | ( | ) |
Start/stop audio processing.
unsigned int pd_sound_wp | ( | ) |
void pd_sound_write | ( | ) |
Write contents of sndi to sound.cbuf.
int pd_stopped | ( | ) |
Tells whether DGen stopped intentionally so emulation can resume without skipping frames.
unsigned long pd_usecs | ( | void | ) |
Elapsed time in microseconds.
|
static |
Interactively calibrate a controller.
If n_args == 1, controller 0 will be configured. If n_args == 2, configure controller in string args[1].
n_args | Number of arguments. | |
[in] | args | List of arguments. |
|
static |
Prompt "exit" command handler.
|
static |
|
static |
|
static |
|
static |
Prompt "load" command handler.
md | Context. |
ac | Number of arguments in av. |
av | Arguments. |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Rehash rc vars that require special handling (see "SH" in rc.cpp).
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Round a value up to nearest power of two.
v | Value. |
|
static |
Initialize screen.
width | Width of display. |
height | Height of display. |
|
static |
Call this before accessing screen.buf.
No syscalls allowed before screen_unlock().
|
static |
Call this after accessing screen.buf.
|
static |
Call this after writing into screen.buf.
|
static |
Do not call this directly, use screen_update() instead.
|
static |
Set fullscreen mode.
toggle | Nonzero to enable fullscreen, otherwise disable it. |
|
static |
|
static |
|
static |
Callback for sound.
stream | Sound destination buffer. |
len | Length of destination buffer. |
|
static |
|
static |
|
static |
|
static |
|
static |
unsigned int bpp |
bits per pixel
unsigned int Bpp |
bytes per pixel
bpp_t buf |
16 or 32-bit buffer
generic pointer to pixel data
|
static |
|
static |
Controller being calibrated.
struct { ... } calibration_steps[] |
cbuf_t cbuf |
circular buffer
intptr_t code |
Temporary keysym or joypad code.
SDL_Color color[64] |
SDL colors for 8bpp modes.
unsigned int common |
common length of all entries
char** complete |
completion results array
|
static |
unsigned int displayed |
whether message is currently displayed
GLuint dlist |
display list
|
static |
|
static |
|
static |
List of available filters.
|
static |
|
static |
unsigned int height |
texture height
224 or 240 (NTSC_VBLANK or PAL_VBLANK)
window height
unsigned int hz |
refresh rate
enum ctl_e const id[2] |
texture identifier
Controls indices in control[].
struct { ... } info |
Messages.
unsigned int info_height |
message bar height
unsigned int is_fullscreen |
fullscreen enabled
unsigned int is_opengl |
OpenGL enabled.
unsigned int is_pal |
PAL enabled.
|
static |
unsigned int last_video_height |
last video.height value
size_t length |
remaining length to display
unsigned int linear |
linear filtering is enabled
unsigned char* mdpal = NULL |
struct bmap mdscr |
char message[2048] |
message
char const* name |
Controller button name.
bool once |
If button has been pressed once.
unsigned int opengl_ok |
if textures are initialized
uint8_t palette[256] |
palette for 8bpp modes (mdpal)
bool pd_freeze = false |
Enable emulation by default.
const char* pd_options = "fX:Y:S:G:" |
unsigned int pitch |
number of bytes per line in buf
struct { ... } prompt |
Prompt.
|
static |
List of commands to auto complete.
unsigned int rate |
samples rate
unsigned int samples |
number of samples required by the callback
|
static |
|
static |
struct { ... } screen |
unsigned long since |
since this number of microseconds
unsigned int skip |
number of entries to skip in the array
int slot |
struct sndinfo sndi |
struct { ... } sound |
Sound.
struct prompt status |
prompt status
|
static |
Stopped flag used by pd_stopped()
SDL_Surface* surface |
SDL surface.
struct { ... } texture |
Framebuffer texture.
bool twice |
If button has been pressed twice.
bool type |
Type of code, false for keysym, true for joypad.
uint16_t* u16 |
uint32_t* u32 |
texture is 32-bit
struct { ... } video |
unsigned int vis_height |
visible height
unsigned int vis_width |
visible width
unsigned int want_fullscreen |
want fullscreen
unsigned int want_opengl |
want OpenGL
const unsigned int width |
texture width
320
window width
unsigned int x_offset |
horizontal offset
unsigned int x_scale |
scale horizontally
unsigned int y_offset |
vertical offset
unsigned int y_scale |
scale vertically