提交 fdcab561 编写于 作者: Z Zihao Yu

Merge branch 'fceux-no-gui' into 'master'

apps,fceux: support video without GUI

See merge request projectn/nexus-am!47
......@@ -18,6 +18,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#define HAS_GUI
#include "sdl.h"
#include "../common/vidblit.h"
#include "../../fceu.h"
......@@ -115,8 +117,6 @@ static uint32_t canvas[NWIDTH * 240];
void
BlitScreen(uint8 *XBuf)
{
int xo = 0, yo = 0;
// refresh the palette if required
if(s_paletterefresh) {
SetPaletteBlitToHigh((uint8*)s_psdl);
......@@ -134,6 +134,20 @@ BlitScreen(uint8 *XBuf)
// ensure that the display is updated
draw_rect(canvas, xo + (screen_width() - 256) / 2, yo + (screen_height() - 240) / 2, scrw, s_tlines);
#ifdef HAS_GUI
draw_rect(canvas, (screen_width() - 256) / 2, (screen_height() - 240) / 2, scrw, s_tlines);
draw_sync();
#else
printf("\033[0;0H");
for (int y = 0; y < s_tlines; y += 4) {
//draw_rect(&screen[y][8], xpad, ypad + y, W, 1);
for (int x = 0; x < scrw; x += 2) {
uint32_t color = canvas[y * 256 + x];
const char *list = "o. *O0@#";
char c = list[color / 0x222222u];
_putc(c);
}
_putc('\n');
}
#endif
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册