Mercurial > repos > blastem
annotate render.h @ 677:687c1dd3bcb9
Fake busack when Z80 is disabled
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sat, 03 Jan 2015 21:54:41 -0800 |
parents | 7b0df1aaf384 |
children | 019d27995e32 80a67be1770b |
rev | line source |
---|---|
467
140af5509ce7
Added copyright notice to source files and added GPL license text in COPYING
Mike Pavone <pavone@retrodev.com>
parents:
444
diff
changeset
|
1 /* |
140af5509ce7
Added copyright notice to source files and added GPL license text in COPYING
Mike Pavone <pavone@retrodev.com>
parents:
444
diff
changeset
|
2 Copyright 2013 Michael Pavone |
487
c08a4efeee7f
Update opengl branch from default. Fix build breakage unrelated to merge
Mike Pavone <pavone@retrodev.com>
diff
changeset
|
3 This file is part of BlastEm. |
467
140af5509ce7
Added copyright notice to source files and added GPL license text in COPYING
Mike Pavone <pavone@retrodev.com>
parents:
444
diff
changeset
|
4 BlastEm is free software distributed under the terms of the GNU General Public License version 3 or greater. See COPYING for full license text. |
140af5509ce7
Added copyright notice to source files and added GPL license text in COPYING
Mike Pavone <pavone@retrodev.com>
parents:
444
diff
changeset
|
5 */ |
398
c26e48a93fa3
Make keybindings data driven so they can be populated from a config file later
Mike Pavone <pavone@retrodev.com>
parents:
364
diff
changeset
|
6 #ifndef RENDER_H_ |
c26e48a93fa3
Make keybindings data driven so they can be populated from a config file later
Mike Pavone <pavone@retrodev.com>
parents:
364
diff
changeset
|
7 #define RENDER_H_ |
20
f664eeb55cb4
Mostly broken VDP core and savestate viewer
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
8 |
f664eeb55cb4
Mostly broken VDP core and savestate viewer
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
9 #include "vdp.h" |
354
15dd6418fe67
Initial PSG support. Mostly works, noise channel is borked though.
Mike Pavone <pavone@retrodev.com>
parents:
342
diff
changeset
|
10 #include "psg.h" |
364
62177cc39049
Incredibly broken YM2612 support plus a fix to Z80 bus request
Mike Pavone <pavone@retrodev.com>
parents:
354
diff
changeset
|
11 #include "ym2612.h" |
449
7696d824489d
Started work on OpenGL support in new branch
Mike Pavone <pavone@retrodev.com>
parents:
426
diff
changeset
|
12 |
7696d824489d
Started work on OpenGL support in new branch
Mike Pavone <pavone@retrodev.com>
parents:
426
diff
changeset
|
13 typedef struct { |
7696d824489d
Started work on OpenGL support in new branch
Mike Pavone <pavone@retrodev.com>
parents:
426
diff
changeset
|
14 void *oddbuf; |
7696d824489d
Started work on OpenGL support in new branch
Mike Pavone <pavone@retrodev.com>
parents:
426
diff
changeset
|
15 void *evenbuf; |
7696d824489d
Started work on OpenGL support in new branch
Mike Pavone <pavone@retrodev.com>
parents:
426
diff
changeset
|
16 int stride; |
7696d824489d
Started work on OpenGL support in new branch
Mike Pavone <pavone@retrodev.com>
parents:
426
diff
changeset
|
17 } surface_info; |
7696d824489d
Started work on OpenGL support in new branch
Mike Pavone <pavone@retrodev.com>
parents:
426
diff
changeset
|
18 |
426
add9e2f5c0e3
Make VDP render in native pixel format of the renderer for a modest performance gain and to make it easier to use OpenGL for rendering
Mike Pavone <pavone@retrodev.com>
parents:
418
diff
changeset
|
19 uint32_t render_map_color(uint8_t r, uint8_t g, uint8_t b); |
487
c08a4efeee7f
Update opengl branch from default. Fix build breakage unrelated to merge
Mike Pavone <pavone@retrodev.com>
diff
changeset
|
20 void render_alloc_surfaces(vdp_context * context); |
426
add9e2f5c0e3
Make VDP render in native pixel format of the renderer for a modest performance gain and to make it easier to use OpenGL for rendering
Mike Pavone <pavone@retrodev.com>
parents:
418
diff
changeset
|
21 uint8_t render_depth(); |
487
c08a4efeee7f
Update opengl branch from default. Fix build breakage unrelated to merge
Mike Pavone <pavone@retrodev.com>
diff
changeset
|
22 void render_init(int width, int height, char * title, uint32_t fps, uint8_t fullscreen, uint8_t use_gl); |
20
f664eeb55cb4
Mostly broken VDP core and savestate viewer
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
23 void render_context(vdp_context * context); |
43
3fc57e1a2c56
Add debug render mode and fix vertical flip bit for bg tiles
Mike Pavone <pavone@retrodev.com>
parents:
33
diff
changeset
|
24 void render_wait_quit(vdp_context * context); |
364
62177cc39049
Incredibly broken YM2612 support plus a fix to Z80 bus request
Mike Pavone <pavone@retrodev.com>
parents:
354
diff
changeset
|
25 void render_wait_psg(psg_context * context); |
62177cc39049
Incredibly broken YM2612 support plus a fix to Z80 bus request
Mike Pavone <pavone@retrodev.com>
parents:
354
diff
changeset
|
26 void render_wait_ym(ym2612_context * context); |
338
5c34a9c39394
Re-enable frame limit, but add a command line flag to disable it
Mike Pavone <pavone@retrodev.com>
parents:
198
diff
changeset
|
27 int wait_render_frame(vdp_context * context, int frame_limit); |
342
13f994c88c34
Get frame time correct and frame rate sort of correct for EUR region
Mike Pavone <pavone@retrodev.com>
parents:
340
diff
changeset
|
28 void render_fps(uint32_t fps); |
354
15dd6418fe67
Initial PSG support. Mostly works, noise channel is borked though.
Mike Pavone <pavone@retrodev.com>
parents:
342
diff
changeset
|
29 uint32_t render_audio_buffer(); |
15dd6418fe67
Initial PSG support. Mostly works, noise channel is borked though.
Mike Pavone <pavone@retrodev.com>
parents:
342
diff
changeset
|
30 uint32_t render_sample_rate(); |
398
c26e48a93fa3
Make keybindings data driven so they can be populated from a config file later
Mike Pavone <pavone@retrodev.com>
parents:
364
diff
changeset
|
31 void render_debug_mode(uint8_t mode); |
c26e48a93fa3
Make keybindings data driven so they can be populated from a config file later
Mike Pavone <pavone@retrodev.com>
parents:
364
diff
changeset
|
32 void render_debug_pal(uint8_t pal); |
409
c1bddeadc566
Process events in vgm player so that quitting works
Mike Pavone <pavone@retrodev.com>
parents:
398
diff
changeset
|
33 void process_events(); |
418
dbf4e1c86f3c
Implement basic joystick support
Mike Pavone <pavone@retrodev.com>
parents:
409
diff
changeset
|
34 int render_joystick_num_buttons(int joystick); |
dbf4e1c86f3c
Implement basic joystick support
Mike Pavone <pavone@retrodev.com>
parents:
409
diff
changeset
|
35 int render_joystick_num_hats(int joystick); |
432
18cde14e8c10
Read joystick bindings from config file
Mike Pavone <pavone@retrodev.com>
parents:
426
diff
changeset
|
36 int render_num_joysticks(); |
20
f664eeb55cb4
Mostly broken VDP core and savestate viewer
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
37 |
398
c26e48a93fa3
Make keybindings data driven so they can be populated from a config file later
Mike Pavone <pavone@retrodev.com>
parents:
364
diff
changeset
|
38 //TODO: Throw an ifdef in here once there's more than one renderer |
c26e48a93fa3
Make keybindings data driven so they can be populated from a config file later
Mike Pavone <pavone@retrodev.com>
parents:
364
diff
changeset
|
39 #include <SDL.h> |
418
dbf4e1c86f3c
Implement basic joystick support
Mike Pavone <pavone@retrodev.com>
parents:
409
diff
changeset
|
40 #define RENDERKEY_UP SDLK_UP |
dbf4e1c86f3c
Implement basic joystick support
Mike Pavone <pavone@retrodev.com>
parents:
409
diff
changeset
|
41 #define RENDERKEY_DOWN SDLK_DOWN |
dbf4e1c86f3c
Implement basic joystick support
Mike Pavone <pavone@retrodev.com>
parents:
409
diff
changeset
|
42 #define RENDERKEY_LEFT SDLK_LEFT |
dbf4e1c86f3c
Implement basic joystick support
Mike Pavone <pavone@retrodev.com>
parents:
409
diff
changeset
|
43 #define RENDERKEY_RIGHT SDLK_RIGHT |
444
cc754a309ead
Add fullscreen support and add a keybinding for exiting the emulator
Mike Pavone <pavone@retrodev.com>
parents:
432
diff
changeset
|
44 #define RENDERKEY_ESC SDLK_ESCAPE |
504
7b0df1aaf384
Add support for left and right shift keys
Mike Pavone <pavone@retrodev.com>
parents:
487
diff
changeset
|
45 #define RENDERKEY_LSHIFT SDLK_LSHIFT |
7b0df1aaf384
Add support for left and right shift keys
Mike Pavone <pavone@retrodev.com>
parents:
487
diff
changeset
|
46 #define RENDERKEY_RSHIFT SDLK_RSHIFT |
418
dbf4e1c86f3c
Implement basic joystick support
Mike Pavone <pavone@retrodev.com>
parents:
409
diff
changeset
|
47 #define RENDER_DPAD_UP SDL_HAT_UP |
dbf4e1c86f3c
Implement basic joystick support
Mike Pavone <pavone@retrodev.com>
parents:
409
diff
changeset
|
48 #define RENDER_DPAD_DOWN SDL_HAT_DOWN |
dbf4e1c86f3c
Implement basic joystick support
Mike Pavone <pavone@retrodev.com>
parents:
409
diff
changeset
|
49 #define RENDER_DPAD_LEFT SDL_HAT_LEFT |
dbf4e1c86f3c
Implement basic joystick support
Mike Pavone <pavone@retrodev.com>
parents:
409
diff
changeset
|
50 #define RENDER_DPAD_RIGHT SDL_HAT_RIGHT |
dbf4e1c86f3c
Implement basic joystick support
Mike Pavone <pavone@retrodev.com>
parents:
409
diff
changeset
|
51 |
dbf4e1c86f3c
Implement basic joystick support
Mike Pavone <pavone@retrodev.com>
parents:
409
diff
changeset
|
52 #define MAX_JOYSTICKS 8 |
20
f664eeb55cb4
Mostly broken VDP core and savestate viewer
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
53 |
398
c26e48a93fa3
Make keybindings data driven so they can be populated from a config file later
Mike Pavone <pavone@retrodev.com>
parents:
364
diff
changeset
|
54 #endif //RENDER_H_ |
c26e48a93fa3
Make keybindings data driven so they can be populated from a config file later
Mike Pavone <pavone@retrodev.com>
parents:
364
diff
changeset
|
55 |