} \
}
+// this is almost never used (Wiz and menu bg gen only)
void FinalizeLine32xRGB555(int sh, int line)
{
unsigned short *pd = DrawLineDest;
}
}
-void PicoDraw32xSetFrameMode(int is_on, int only_32x)
+void PicoDrawSetOutFormat32x(pdso_t which, int use_32x_line_mode)
{
#ifdef _ASM_32X_DRAW
extern void *Pico32xNativePal;
Pico32xNativePal = Pico32xMem->pal_native;
#endif
- if (is_on) {
- // use the same layout as alt renderer
- PicoDrawSetInternalBuf(PicoDraw2FB, 328);
- Pico32xDrawMode = only_32x ? PDM32X_32X_ONLY : PDM32X_BOTH;
- } else {
+ if (which == PDF_RGB555 && use_32x_line_mode) {
+ // we'll draw via FinalizeLine32xRGB555 (rare)
PicoDrawSetInternalBuf(NULL, 0);
Pico32xDrawMode = PDM32X_OFF;
+ return;
}
+
+ // use the same layout as alt renderer
+ PicoDrawSetInternalBuf(PicoDraw2FB, 328);
+ Pico32xDrawMode = (which == PDF_RGB555) ? PDM32X_32X_ONLY : PDM32X_BOTH;
}
+// vim:shiftwidth=2:ts=2:expandtab
}\r
}\r
\r
-void PicoDrawSetOutFormat(pdso_t which, int allow_32x)\r
+void PicoDrawSetOutFormat(pdso_t which, int use_32x_line_mode)\r
{\r
switch (which)\r
{\r
break;\r
\r
case PDF_RGB555:\r
- if ((PicoAHW & PAHW_32X) && allow_32x)\r
+ if ((PicoAHW & PAHW_32X) && use_32x_line_mode)\r
FinalizeLine = FinalizeLine32xRGB555;\r
else\r
FinalizeLine = FinalizeLine555;\r
FinalizeLine = NULL;\r
break;\r
}\r
+ PicoDrawSetOutFormat32x(which, use_32x_line_mode);\r
PicoDrawSetOutputMode4(which);\r
rendstatus_old = -1;\r
}\r
\r
#define TILE_ROWS END_ROW-START_ROW\r
\r
-#define USE_CACHE\r
-\r
// note: this is not implemented in ARM asm\r
#if defined(DRAW2_OVERRIDE_LINE_WIDTH)\r
#define LINE_WIDTH DRAW2_OVERRIDE_LINE_WIDTH\r
#define LINE_WIDTH 328\r
#endif\r
\r
+static unsigned char PicoDraw2FB_[(8+320) * (8+240+8)];\r
+unsigned char *PicoDraw2FB = PicoDraw2FB_;\r
+\r
static int HighCache2A[41*(TILE_ROWS+1)+1+1]; // caches for high layers\r
static int HighCache2B[41*(TILE_ROWS+1)+1+1];\r
\r
PDF_RGB555, // RGB/BGR output, depends on compile options\r
PDF_8BIT, // 8-bit out (handles shadow/hilight mode, sonic water)\r
} pdso_t;\r
-void PicoDrawSetOutFormat(pdso_t which, int allow_32x);\r
+void PicoDrawSetOutFormat(pdso_t which, int use_32x_line_mode);\r
void PicoDrawSetOutBuf(void *dest, int increment);\r
void PicoDrawSetCallbacks(int (*begin)(unsigned int num), int (*end)(unsigned int num));\r
extern void *DrawLineDest;\r
\r
void Pico32xSetClocks(int msh2_hz, int ssh2_hz);\r
\r
-// 32x/draw.c\r
-void PicoDraw32xSetFrameMode(int is_on, int only_32x);\r
-\r
#else\r
\r
#define Pico32xSetClocks(msh2_khz, ssh2_khz)\r
void p32x_sh2_poll_event(SH2 *sh2, unsigned int flags, unsigned int m68k_cycles);\r
\r
// 32x/draw.c\r
+void PicoDrawSetOutFormat32x(pdso_t which, int use_32x_line_mode);\r
void FinalizeLine32xRGB555(int sh, int line);\r
void PicoDraw32xLayer(int offs, int lines, int mdbg);\r
void PicoDraw32xLayerMdOnly(int offs, int lines);\r
#define PicoFrame32x()\r
#define PicoUnload32x()\r
#define Pico32xStateLoaded()\r
-#define PicoDraw32xSetFrameMode(...)\r
#define FinalizeLine32xRGB555 NULL\r
#define p32x_pwm_update(...)\r
#define p32x_timers_recalc()\r
#include "input_pico.h"
#include "version.h"
-// FIXME: these 2 shouldn't be here
-static unsigned char PicoDraw2FB_[(8+320) * (8+240+8)];
-unsigned char *PicoDraw2FB = PicoDraw2FB_;
-
static void *shadow_fb;
static const struct in_default_bind in_sdl_defbinds[] = {
// main 300K gfx-related buffer. Used by menu and renderers.
unsigned char gfx_buffer[321*240*2*2];
-unsigned char *PicoDraw2FB = gfx_buffer; // temporary buffer for alt renderer ( (8+320)*(8+240+8) )
static short *snd_cbuff = NULL;
static int snd_cbuf_samples = 0, snd_all_samples = 0;
extern int crashed_940;\r
\r
static short __attribute__((aligned(4))) sndBuffer[2*(44100+100)/50];\r
-static unsigned char PicoDraw2FB_[(8+320) * (8+240+8)];\r
-unsigned char *PicoDraw2FB = PicoDraw2FB_;\r
static int osd_fps_x, osd_y, doing_bg_frame;\r
const char *renderer_names[] = { "16bit accurate", " 8bit accurate", " 8bit fast", NULL };\r
const char *renderer_names32x[] = { "accurate", "faster", "fastest", NULL };\r
// Wiz 16bit is an exception, uses line rendering due to rotation mess\r
if (renderer == RT_16BIT && (currentConfig.EmuOpt & EOPT_WIZ_TEAR_FIX)) {\r
PicoDrawSetOutFormat(PDF_RGB555, 1);\r
- PicoDraw32xSetFrameMode(0, 0);\r
}\r
else {\r
PicoDrawSetOutFormat(PDF_NONE, 0);\r
- PicoDraw32xSetFrameMode(1, 0);\r
}\r
PicoDrawSetOutBuf(g_screen_ptr, g_screen_width * 2);\r
gp2x_mode = 16;\r
{\r
doing_bg_frame = 1;\r
PicoDrawSetOutBuf(g_screen_ptr, g_screen_width * 2);\r
- PicoDraw32xSetFrameMode(0, 0);\r
PicoDrawSetCallbacks(NULL, NULL);\r
Pico.m.dirtyPal = 1;\r
\r
static short __attribute__((aligned(4))) sndBuffer[2*44100/50];
-// FIXME: these 2 shouldn't be here
-static unsigned char PicoDraw2FB_[(8+320) * (8+240+8)];
-unsigned char *PicoDraw2FB = PicoDraw2FB_;
-
static void snd_write(int len);
#ifdef _WIN32
void emu_32x_startup(void)
{
- PicoDrawSetOutFormat(PDF_RGB555, 1);
}
#ifndef ANDROID
vout_buf = malloc(VOUT_MAX_WIDTH * VOUT_MAX_HEIGHT * 2);
PicoInit();
- PicoDrawSetOutFormat(PDF_RGB555, 1);
+ PicoDrawSetOutFormat(PDF_RGB555, 0);
PicoDrawSetOutBuf(vout_buf, vout_width * 2);
//PicoMessage = plat_status_msg_busy_next;
break;\r
}\r
\r
- if (PicoAHW & PAHW_32X) {\r
- int only_32x = 0;\r
- if (currentConfig.renderer == RT_16BIT)\r
- only_32x = 1;\r
- else\r
- PicoDrawSetOutFormat(PDF_NONE, 0);\r
- PicoDraw32xSetFrameMode(1, only_32x);\r
+ if (PicoAHW & PAHW_32X)\r
PicoDrawSetOutBuf(g_screen_ptr, g_screen_width * 2);\r
- }\r
- //PicoDraw32xSetFrameMode(0, 0);\r
- //PicoDrawSetOutFormat(PDF_RGB555, 1);\r
}\r
\r
void plat_video_toggle_renderer(int change, int is_menu)\r
void pemu_forced_frame(int no_scale, int do_emu)\r
{\r
PicoDrawSetOutBuf(g_screen_ptr, g_screen_width * 2);\r
- PicoDraw32xSetFrameMode(0, 0);\r
PicoDrawSetCallbacks(NULL, NULL);\r
Pico.m.dirtyPal = 1;\r
\r
#include "log_io.h"
int current_keys;
-unsigned char *PicoDraw2FB;
#ifdef FBDEV
g_menubg_ptr = realloc(g_menubg_ptr, size);
memset(g_screen_ptr, 0, size);
memset(g_menubg_ptr, 0, size);
- PicoDraw2FB = g_menubg_ptr;
scr_changed = 0;
}
g_screen_width = g_menuscreen_w = w;
g_screen_height = g_menuscreen_h = h;
g_menubg_ptr = realloc(g_menubg_ptr, w * g_screen_height * 2);
- PicoDraw2FB = g_menubg_ptr;
#else
realloc_screen();
memset(g_screen_ptr, 0, g_screen_width * g_screen_height * 2);
static const char pnd_script_base[] = "sudo -n /usr/pandora/scripts";\r
static unsigned char __attribute__((aligned(4))) fb_copy[320 * 240 * 2];\r
static void *temp_frame;\r
-unsigned char *PicoDraw2FB;\r
const char *renderer_names[] = { NULL };\r
const char *renderer_names32x[] = { NULL };\r
\r
}\r
}\r
\r
-static int emuscan(unsigned int num)\r
-{\r
- DrawLineDest = (unsigned short *)g_screen_ptr + num * g_screen_width;\r
-\r
- return 0;\r
-}\r
-\r
void pemu_finalize_frame(const char *fps, const char *notice)\r
{\r
if (notice && notice[0])\r
void plat_video_flip(void)\r
{\r
g_screen_ptr = vout_fbdev_flip(layer_fb);\r
+ PicoDrawSetOutBuf(g_screen_ptr, g_screen_width * 2);\r
\r
// XXX: drain OS event queue here, maybe we'll actually use it someday..\r
xenv_update(NULL, NULL, NULL, NULL);\r
return;\r
\r
PicoDrawSetOutFormat(PDF_RGB555, 1);\r
- PicoDrawSetCallbacks(emuscan, NULL);\r
+ PicoDrawSetOutBuf(g_screen_ptr, g_screen_width * 2);\r
\r
if (is_32cols) {\r
fb_w = 256;\r
}\r
g_menubg_ptr = temp_frame;\r
g_menubg_src_ptr = temp_frame;\r
- PicoDraw2FB = temp_frame;\r
\r
pnd_menu_init();\r
\r
int sceAudioOutput2GetRestSample();
-unsigned char *PicoDraw2FB = (unsigned char *)VRAM_CACHED_STUFF + 8; // +8 to be able to skip border with 1 quadword..
+//unsigned char *PicoDraw2FB = (unsigned char *)VRAM_CACHED_STUFF + 8; // +8 to be able to skip border with 1 quadword..
int engineStateSuspend;
#define PICO_PEN_ADJUST_X 4
#include "main.h"
static unsigned short screen_buff[320 * 240];
-static unsigned char PicoDraw2FB_[(8+320) * (8+240+8)];
-unsigned char *PicoDraw2FB = PicoDraw2FB_;
const char *renderer_names[] = { NULL };
const char *renderer_names32x[] = { NULL };