Files
ci-libretro-fceumm/src/video.c

105 lines
2.1 KiB
C
Raw Normal View History

/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2002 Xodnizel
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include "fceu-types.h"
#include "video.h"
#include "fceu.h"
#include "general.h"
2014-03-30 22:29:30 +02:00
#include "fceu-memory.h"
#include "crc32.h"
#include "state.h"
#include "palette.h"
#include "nsf.h"
#include "input.h"
#include "vsuni.h"
uint8 *XBuf = NULL;
2015-08-06 12:57:18 +02:00
void FCEU_KillVirtualVideo(void)
{
if (XBuf)
free(XBuf);
XBuf = 0;
}
2015-08-06 12:57:18 +02:00
int FCEU_InitVirtualVideo(void)
{
2017-01-02 05:09:34 +01:00
/* 256 bytes per scanline, * 240 scanline maximum, +8 for alignment, */
if (!XBuf)
XBuf = (uint8*)(FCEU_malloc(256 * (256 + extrascanlines + 8)));
2017-02-20 13:20:53 +08:00
if (!XBuf)
2017-01-02 05:09:34 +01:00
return 0;
2015-08-06 12:57:18 +02:00
memset(XBuf, 128, 256 * (256 + extrascanlines));
2015-08-06 12:57:18 +02:00
return 1;
}
static int howlong;
static char errmsg[65];
#include "drawing.h"
2015-08-06 12:57:18 +02:00
void FCEUI_SaveSnapshot(void) { }
2015-08-06 12:57:18 +02:00
void FCEU_PutImage(void)
{
if (GameInfo->type == GIT_NSF)
DrawNSF(XBuf);
2015-08-06 12:57:18 +02:00
else
{
if (GameInfo->type == GIT_VSUNI)
FCEU_VSUniDraw(XBuf);
}
2015-08-06 12:57:18 +02:00
if (howlong) howlong--;
2017-09-09 16:16:12 +08:00
FCEU_DrawInput(XBuf);
2015-08-06 12:57:18 +02:00
}
void FCEU_PutImageDummy(void)
{
}
2015-08-06 12:57:18 +02:00
void FCEU_DispMessage(char *format, ...)
{
2017-02-20 13:20:53 +08:00
va_list ap;
2017-02-20 13:20:53 +08:00
va_start(ap, format);
vsprintf(errmsg, format, ap);
va_end(ap);
2017-02-20 13:20:53 +08:00
howlong = 180;
FCEUD_DispMessage(errmsg);
}
2015-08-06 12:57:18 +02:00
void FCEU_ResetMessages(void)
{
howlong = 180;
}
2015-08-06 12:57:18 +02:00
int SaveSnapshot(void)
{
return(0);
}