|
|
1.1 root 1: /*
2: video.c
3:
4: This file is distributed under the GNU Public License, version 2 or at
5: your option any later version. Read the file gpl.txt for details.
6:
7: */
8: const char Video_fileid[] = "Previous video.c : " __DATE__ " " __TIME__;
9:
10: #include <stdbool.h>
11: #include <SDL_endian.h>
12:
13: #include "configuration.h"
14: #include "cycInt.h"
15: #include "ioMem.h"
16: #include "m68000.h"
17: #include "screen.h"
18: #include "shortcut.h"
19: #include "nextMemory.h"
20: #include "video.h"
21: #include "dma.h"
22: #include "sysReg.h"
23: #include "tmc.h"
24: #include "nd_sdl.hpp"
25:
26: /*--------------------------------------------------------------*/
27: /* Local functions prototypes */
28: /*--------------------------------------------------------------*/
29:
30:
31: /*-----------------------------------------------------------------------*/
32: /**
33: * Reset video chip
34: */
35: void Video_Reset(void) {
36: Video_StartInterrupts(0);
37: }
38:
39: #define NEXT_VBL_FREQ 68
40:
41: /**
42: * Start VBL interrupt
43: */
44: void Video_StartInterrupts ( int PendingCyclesOver ) {
45: CycInt_AddRelativeInterruptUs((1000*1000)/NEXT_VBL_FREQ, 0, INTERRUPT_VIDEO_VBL);
46: }
47:
48: /**
49: * Generate vertical video retrace interrupt
50: */
51: static void Video_InterruptHandler(void) {
52: if (ConfigureParams.System.bTurbo) {
53: tmc_video_interrupt();
54: } else if (ConfigureParams.System.bColor) {
55: color_video_interrupt();
56: } else {
57: dma_video_interrupt();
58: }
59: }
60:
61:
62: /*-----------------------------------------------------------------------*/
63: /**
64: * VBL interrupt : set new interrupts, draw screen, generate sound,
65: * reset counters, ...
66: */
67: static bool statusBarToggle;
68: void Video_InterruptHandler_VBL ( void ) {
69: CycInt_AcknowledgeInterrupt();
70: host_blank(0, MAIN_DISPLAY, true);
71: if(statusBarToggle) Update_StatusBar();
72: statusBarToggle = !statusBarToggle;
73: Video_InterruptHandler();
74: CycInt_AddRelativeInterruptUs((1000*1000)/NEXT_VBL_FREQ, 0, INTERRUPT_VIDEO_VBL);
75: }
76:
77:
78:
79:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.