annotate render.h @ 1156:b519965f6394

Clear sprite overflow flag when control port read. Fix vcounter progression in Mode 4
author Michael Pavone <pavone@retrodev.com>
date Thu, 05 Jan 2017 19:15:53 -0800
parents 928a65750345
children b1147418254a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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>
parents: 449 467
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
741
80a67be1770b Initial work on Windows port
Michael Pavone <pavone@retrodev.com>
parents: 504
diff changeset
9 //TODO: Throw an ifdef in here once there's more than one renderer
80a67be1770b Initial work on Windows port
Michael Pavone <pavone@retrodev.com>
parents: 504
diff changeset
10 #include <SDL.h>
1035
284d905ca582 Added support for binding a bunch more "special" keys
Michael Pavone <pavone@retrodev.com>
parents: 937
diff changeset
11 #define RENDERKEY_UP SDLK_UP
284d905ca582 Added support for binding a bunch more "special" keys
Michael Pavone <pavone@retrodev.com>
parents: 937
diff changeset
12 #define RENDERKEY_DOWN SDLK_DOWN
284d905ca582 Added support for binding a bunch more "special" keys
Michael Pavone <pavone@retrodev.com>
parents: 937
diff changeset
13 #define RENDERKEY_LEFT SDLK_LEFT
284d905ca582 Added support for binding a bunch more "special" keys
Michael Pavone <pavone@retrodev.com>
parents: 937
diff changeset
14 #define RENDERKEY_RIGHT SDLK_RIGHT
284d905ca582 Added support for binding a bunch more "special" keys
Michael Pavone <pavone@retrodev.com>
parents: 937
diff changeset
15 #define RENDERKEY_ESC SDLK_ESCAPE
284d905ca582 Added support for binding a bunch more "special" keys
Michael Pavone <pavone@retrodev.com>
parents: 937
diff changeset
16 #define RENDERKEY_DEL SDLK_DELETE
284d905ca582 Added support for binding a bunch more "special" keys
Michael Pavone <pavone@retrodev.com>
parents: 937
diff changeset
17 #define RENDERKEY_LSHIFT SDLK_LSHIFT
284d905ca582 Added support for binding a bunch more "special" keys
Michael Pavone <pavone@retrodev.com>
parents: 937
diff changeset
18 #define RENDERKEY_RSHIFT SDLK_RSHIFT
284d905ca582 Added support for binding a bunch more "special" keys
Michael Pavone <pavone@retrodev.com>
parents: 937
diff changeset
19 #define RENDERKEY_LCTRL SDLK_LCTRL
284d905ca582 Added support for binding a bunch more "special" keys
Michael Pavone <pavone@retrodev.com>
parents: 937
diff changeset
20 #define RENDERKEY_RCTRL SDLK_RCTRL
284d905ca582 Added support for binding a bunch more "special" keys
Michael Pavone <pavone@retrodev.com>
parents: 937
diff changeset
21 #define RENDERKEY_LALT SDLK_LALT
284d905ca582 Added support for binding a bunch more "special" keys
Michael Pavone <pavone@retrodev.com>
parents: 937
diff changeset
22 #define RENDERKEY_RALT SDLK_RALT
284d905ca582 Added support for binding a bunch more "special" keys
Michael Pavone <pavone@retrodev.com>
parents: 937
diff changeset
23 #define RENDERKEY_HOME SDLK_HOME
284d905ca582 Added support for binding a bunch more "special" keys
Michael Pavone <pavone@retrodev.com>
parents: 937
diff changeset
24 #define RENDERKEY_END SDLK_END
284d905ca582 Added support for binding a bunch more "special" keys
Michael Pavone <pavone@retrodev.com>
parents: 937
diff changeset
25 #define RENDERKEY_PAGEUP SDLK_PAGEUP
284d905ca582 Added support for binding a bunch more "special" keys
Michael Pavone <pavone@retrodev.com>
parents: 937
diff changeset
26 #define RENDERKEY_PAGEDOWN SDLK_PAGEDOWN
284d905ca582 Added support for binding a bunch more "special" keys
Michael Pavone <pavone@retrodev.com>
parents: 937
diff changeset
27 #define RENDERKEY_F1 SDLK_F1
284d905ca582 Added support for binding a bunch more "special" keys
Michael Pavone <pavone@retrodev.com>
parents: 937
diff changeset
28 #define RENDERKEY_F2 SDLK_F2
284d905ca582 Added support for binding a bunch more "special" keys
Michael Pavone <pavone@retrodev.com>
parents: 937
diff changeset
29 #define RENDERKEY_F3 SDLK_F3
284d905ca582 Added support for binding a bunch more "special" keys
Michael Pavone <pavone@retrodev.com>
parents: 937
diff changeset
30 #define RENDERKEY_F4 SDLK_F4
284d905ca582 Added support for binding a bunch more "special" keys
Michael Pavone <pavone@retrodev.com>
parents: 937
diff changeset
31 #define RENDERKEY_F5 SDLK_F5
284d905ca582 Added support for binding a bunch more "special" keys
Michael Pavone <pavone@retrodev.com>
parents: 937
diff changeset
32 #define RENDERKEY_F6 SDLK_F6
284d905ca582 Added support for binding a bunch more "special" keys
Michael Pavone <pavone@retrodev.com>
parents: 937
diff changeset
33 #define RENDERKEY_F7 SDLK_F7
284d905ca582 Added support for binding a bunch more "special" keys
Michael Pavone <pavone@retrodev.com>
parents: 937
diff changeset
34 #define RENDERKEY_F8 SDLK_F8
284d905ca582 Added support for binding a bunch more "special" keys
Michael Pavone <pavone@retrodev.com>
parents: 937
diff changeset
35 #define RENDERKEY_F9 SDLK_F9
284d905ca582 Added support for binding a bunch more "special" keys
Michael Pavone <pavone@retrodev.com>
parents: 937
diff changeset
36 #define RENDERKEY_F10 SDLK_F10
284d905ca582 Added support for binding a bunch more "special" keys
Michael Pavone <pavone@retrodev.com>
parents: 937
diff changeset
37 #define RENDERKEY_F11 SDLK_F11
284d905ca582 Added support for binding a bunch more "special" keys
Michael Pavone <pavone@retrodev.com>
parents: 937
diff changeset
38 #define RENDERKEY_F12 SDLK_F12
284d905ca582 Added support for binding a bunch more "special" keys
Michael Pavone <pavone@retrodev.com>
parents: 937
diff changeset
39 #define RENDERKEY_SELECT SDLK_SELECT
284d905ca582 Added support for binding a bunch more "special" keys
Michael Pavone <pavone@retrodev.com>
parents: 937
diff changeset
40 #define RENDERKEY_PLAY SDLK_AUDIOPLAY
284d905ca582 Added support for binding a bunch more "special" keys
Michael Pavone <pavone@retrodev.com>
parents: 937
diff changeset
41 #define RENDERKEY_SEARCH SDLK_AC_SEARCH
284d905ca582 Added support for binding a bunch more "special" keys
Michael Pavone <pavone@retrodev.com>
parents: 937
diff changeset
42 #define RENDERKEY_BACK SDLK_AC_BACK
284d905ca582 Added support for binding a bunch more "special" keys
Michael Pavone <pavone@retrodev.com>
parents: 937
diff changeset
43 #define RENDER_DPAD_UP SDL_HAT_UP
284d905ca582 Added support for binding a bunch more "special" keys
Michael Pavone <pavone@retrodev.com>
parents: 937
diff changeset
44 #define RENDER_DPAD_DOWN SDL_HAT_DOWN
284d905ca582 Added support for binding a bunch more "special" keys
Michael Pavone <pavone@retrodev.com>
parents: 937
diff changeset
45 #define RENDER_DPAD_LEFT SDL_HAT_LEFT
284d905ca582 Added support for binding a bunch more "special" keys
Michael Pavone <pavone@retrodev.com>
parents: 937
diff changeset
46 #define RENDER_DPAD_RIGHT SDL_HAT_RIGHT
915
9e882eca717e Initial support for relative mouse mode and skeleton of support for capture mode. Avoid mouse position overflow in absolute mode. Allow absolute mode to be set by ROM DB.
Michael Pavone <pavone@retrodev.com>
parents: 914
diff changeset
47 #define render_relative_mouse SDL_SetRelativeMouseMode
741
80a67be1770b Initial work on Windows port
Michael Pavone <pavone@retrodev.com>
parents: 504
diff changeset
48
80a67be1770b Initial work on Windows port
Michael Pavone <pavone@retrodev.com>
parents: 504
diff changeset
49 #define MAX_JOYSTICKS 8
897
b9564fb88a5a WIP support for mega mouse
Michael Pavone <pavone@retrodev.com>
parents: 884
diff changeset
50 #define MAX_MICE 8
907
b5d35222047e Mega mouse support is mostly done
Michael Pavone <pavone@retrodev.com>
parents: 903
diff changeset
51 #define MAX_MOUSE_BUTTONS 8
741
80a67be1770b Initial work on Windows port
Michael Pavone <pavone@retrodev.com>
parents: 504
diff changeset
52
1077
1a66d5165ea7 Cleanup the separation of render backend and VDP code in preparation for having extra debug windows. Make determination of H40/H32 based on number of lines in each mode.
Michael Pavone <pavone@retrodev.com>
parents: 1035
diff changeset
53 #define FRAMEBUFFER_ODD 0
1a66d5165ea7 Cleanup the separation of render backend and VDP code in preparation for having extra debug windows. Make determination of H40/H32 based on number of lines in each mode.
Michael Pavone <pavone@retrodev.com>
parents: 1035
diff changeset
54 #define FRAMEBUFFER_EVEN 1
1a66d5165ea7 Cleanup the separation of render backend and VDP code in preparation for having extra debug windows. Make determination of H40/H32 based on number of lines in each mode.
Michael Pavone <pavone@retrodev.com>
parents: 1035
diff changeset
55
20
f664eeb55cb4 Mostly broken VDP core and savestate viewer
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
56 #include "vdp.h"
354
15dd6418fe67 Initial PSG support. Mostly works, noise channel is borked though.
Mike Pavone <pavone@retrodev.com>
parents: 342
diff changeset
57 #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
58 #include "ym2612.h"
449
7696d824489d Started work on OpenGL support in new branch
Mike Pavone <pavone@retrodev.com>
parents: 426
diff changeset
59
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
60 uint32_t render_map_color(uint8_t r, uint8_t g, uint8_t b);
1077
1a66d5165ea7 Cleanup the separation of render backend and VDP code in preparation for having extra debug windows. Make determination of H40/H32 based on number of lines in each mode.
Michael Pavone <pavone@retrodev.com>
parents: 1035
diff changeset
61 uint32_t *render_get_framebuffer(uint8_t which, int *pitch);
1a66d5165ea7 Cleanup the separation of render backend and VDP code in preparation for having extra debug windows. Make determination of H40/H32 based on number of lines in each mode.
Michael Pavone <pavone@retrodev.com>
parents: 1035
diff changeset
62 void render_framebuffer_updated(uint8_t which, int width);
1103
22e87b739ad6 WIP split of ROM loading/argument parsing from Genesis emulation code. Compiles and doesn't crash, but nothing works. Still a few too many globals as well.
Michael Pavone <pavone@retrodev.com>
parents: 1102
diff changeset
63 void render_init(int width, int height, char * title, uint8_t fullscreen);
874
b6842dfb8edf ROM is now run after being selected in menu. Initial path for menu is read from config file.
Michael Pavone <pavone@retrodev.com>
parents: 792
diff changeset
64 void render_update_caption(char *title);
43
3fc57e1a2c56 Add debug render mode and fix vertical flip bit for bg tiles
Mike Pavone <pavone@retrodev.com>
parents: 33
diff changeset
65 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
66 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
67 void render_wait_ym(ym2612_context * context);
1117
928a65750345 Initial support for Genesis/Megadrive PBC mode. VDP still needs Mode 4 to be useful.
Michael Pavone <pavone@retrodev.com>
parents: 1103
diff changeset
68 void render_disable_ym();
928a65750345 Initial support for Genesis/Megadrive PBC mode. VDP still needs Mode 4 to be useful.
Michael Pavone <pavone@retrodev.com>
parents: 1103
diff changeset
69 void render_enable_ym();
354
15dd6418fe67 Initial PSG support. Mostly works, noise channel is borked though.
Mike Pavone <pavone@retrodev.com>
parents: 342
diff changeset
70 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
71 uint32_t render_sample_rate();
409
c1bddeadc566 Process events in vgm player so that quitting works
Mike Pavone <pavone@retrodev.com>
parents: 398
diff changeset
72 void process_events();
914
28ec32e720b2 Scale mouse data based on window size
Michael Pavone <pavone@retrodev.com>
parents: 907
diff changeset
73 int render_width();
28ec32e720b2 Scale mouse data based on window size
Michael Pavone <pavone@retrodev.com>
parents: 907
diff changeset
74 int render_height();
915
9e882eca717e Initial support for relative mouse mode and skeleton of support for capture mode. Avoid mouse position overflow in absolute mode. Allow absolute mode to be set by ROM DB.
Michael Pavone <pavone@retrodev.com>
parents: 914
diff changeset
75 int render_fullscreen();
723
7178d750efbd Process events while waiting for 68K debugger input. This prevents "not responsive" dialogs when sitting in the debugger
Michael Pavone <pavone@retrodev.com>
parents: 719
diff changeset
76 void process_events();
792
724bbec47f86 Use a new fatal_error function instead of calling fprintf and exit for fatal errors. This new function more gracefully handles the case in which BlastEm was not started from a terminal or disconnected from ther terminal (Windows).
Michael Pavone <pavone@retrodev.com>
parents: 744
diff changeset
77 void render_errorbox(char *title, char *message);
724bbec47f86 Use a new fatal_error function instead of calling fprintf and exit for fatal errors. This new function more gracefully handles the case in which BlastEm was not started from a terminal or disconnected from ther terminal (Windows).
Michael Pavone <pavone@retrodev.com>
parents: 744
diff changeset
78 void render_warnbox(char *title, char *message);
724bbec47f86 Use a new fatal_error function instead of calling fprintf and exit for fatal errors. This new function more gracefully handles the case in which BlastEm was not started from a terminal or disconnected from ther terminal (Windows).
Michael Pavone <pavone@retrodev.com>
parents: 744
diff changeset
79 void render_infobox(char *title, char *message);
418
dbf4e1c86f3c Implement basic joystick support
Mike Pavone <pavone@retrodev.com>
parents: 409
diff changeset
80
20
f664eeb55cb4 Mostly broken VDP core and savestate viewer
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
81
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
82 #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
83