Annotation of previous/src/video.c, revision 1.1.1.4

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: */
1.1.1.4 ! root        8: const char Video_fileid[] = "Previous video.c : " __DATE__ " " __TIME__;
1.1       root        9: 
1.1.1.4 ! root       10: #include <stdbool.h>
1.1       root       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"
1.1.1.3   root       21: #include "dma.h"
                     22: #include "sysReg.h"
                     23: #include "tmc.h"
1.1.1.4 ! root       24: #include "nd_sdl.h"
1.1       root       25: 
                     26: /*--------------------------------------------------------------*/
                     27: /* Local functions prototypes                                   */
                     28: /*--------------------------------------------------------------*/
                     29: 
                     30: 
                     31: /*-----------------------------------------------------------------------*/
                     32: /**
                     33:  * Reset video chip
                     34:  */
1.1.1.4 ! root       35: void Video_Reset(void) {
1.1       root       36:        Video_StartInterrupts(0);
1.1.1.4 ! root       37:     nd_start_interrupts();
1.1       root       38: }
                     39: 
1.1.1.4 ! root       40: #define NEXT_VBL_FREQ 68
1.1       root       41: 
                     42: /**
1.1.1.4 ! root       43:  * Start VBL interrupt
1.1       root       44:  */
1.1.1.4 ! root       45: void Video_StartInterrupts ( int PendingCyclesOver ) {
        !            46:     CycInt_AddRelativeInterruptUs((1000*1000)/NEXT_VBL_FREQ, 0, INTERRUPT_VIDEO_VBL);
1.1       root       47: }
                     48: 
1.1.1.3   root       49: /**
                     50:  * Generate vertical video retrace interrupt
                     51:  */
1.1.1.4 ! root       52: static void Video_InterruptHandler(void) {
1.1.1.3   root       53:        if (ConfigureParams.System.bTurbo) {
                     54:                tmc_video_interrupt();
                     55:        } else if (ConfigureParams.System.bColor) {
                     56:         color_video_interrupt();
                     57:     } else {
                     58:         dma_video_interrupt();
                     59:     }
                     60: }
                     61: 
                     62: 
1.1       root       63: /*-----------------------------------------------------------------------*/
                     64: /**
                     65:  * VBL interrupt : set new interrupts, draw screen, generate sound,
                     66:  * reset counters, ...
                     67:  */
1.1.1.4 ! root       68: static bool statusBarToggle;
        !            69: void Video_InterruptHandler_VBL ( void ) {
1.1       root       70:        CycInt_AcknowledgeInterrupt();
1.1.1.4 ! root       71:     host_blank(0, MAIN_DISPLAY, true);
        !            72:     if(statusBarToggle) Update_StatusBar();
        !            73:     statusBarToggle = !statusBarToggle;
1.1.1.3   root       74:     Video_InterruptHandler();
1.1.1.4 ! root       75:     CycInt_AddRelativeInterruptUs((1000*1000)/NEXT_VBL_FREQ, 0, INTERRUPT_VIDEO_VBL);
1.1       root       76: }
                     77: 
                     78: 
                     79: 
                     80: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.