notaz.gp2x.de
/
picodrive.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
drc: support ms ABI
[picodrive.git]
/
pico
/
cd
/
gfx.c
diff --git
a/pico/cd/gfx.c
b/pico/cd/gfx.c
index
bf91552
..
e3434e1
100644
(file)
--- a/
pico/cd/gfx.c
+++ b/
pico/cd/gfx.c
@@
-50,7
+50,7
@@
typedef struct
uint16 bufferOffset; /* image buffer column offset */
uint32 bufferStart; /* image buffer start index */
uint32 y_step; /* pico: render line step */
uint16 bufferOffset; /* image buffer column offset */
uint32 bufferStart; /* image buffer start index */
uint32 y_step; /* pico: render line step */
- uint8 lut_prio[4][0x10
0][0x100];
/* WORD-RAM data writes priority lookup table */
+ uint8 lut_prio[4][0x10
][0x10];
/* WORD-RAM data writes priority lookup table */
uint8 lut_pixel[0x200]; /* Graphics operation dot offset lookup table */
uint8 lut_cell[0x100]; /* Graphics operation stamp offset lookup table */
} gfx_t;
uint8 lut_pixel[0x200]; /* Graphics operation dot offset lookup table */
uint8 lut_cell[0x100]; /* Graphics operation stamp offset lookup table */
} gfx_t;
@@
-71,16
+71,16
@@
void gfx_init(void)
memset(&gfx, 0, sizeof(gfx));
/* Initialize priority modes lookup table */
memset(&gfx, 0, sizeof(gfx));
/* Initialize priority modes lookup table */
- for (i
=0; i<0x10
0; i++)
+ for (i
= 0; i < 0x1
0; i++)
{
{
- for (j
=0; j<0x10
0; j++)
+ for (j
= 0; j < 0x1
0; j++)
{
/* normal */
gfx.lut_prio[0][i][j] = j;
/* underwrite */
{
/* normal */
gfx.lut_prio[0][i][j] = j;
/* underwrite */
- gfx.lut_prio[1][i][j] =
((i & 0x0f) ? (i & 0x0f) : (j & 0x0f)) | ((i & 0xf0) ? (i & 0xf0) : (j & 0xf0))
;
+ gfx.lut_prio[1][i][j] =
i ? i : j
;
/* overwrite */
/* overwrite */
- gfx.lut_prio[2][i][j] =
((j & 0x0f) ? (j & 0x0f) : (i & 0x0f)) | ((j & 0xf0) ? (j & 0xf0) : (i & 0xf0))
;
+ gfx.lut_prio[2][i][j] =
j ? j : i
;
/* invalid */
gfx.lut_prio[3][i][j] = i;
}
/* invalid */
gfx.lut_prio[3][i][j] = i;
}
@@
-180,7
+180,7
@@
static void gfx_render(uint32 bufferIndex, uint32 width)
uint8 pixel_in, pixel_out;
uint16 stamp_data;
uint32 stamp_index;
uint8 pixel_in, pixel_out;
uint16 stamp_data;
uint32 stamp_index;
- uint32
reg
;
+ uint32
priority
;
/* pixel map start position for current line (13.3 format converted to 13.11) */
uint32 xpos = *gfx.tracePtr++ << 8;
/* pixel map start position for current line (13.3 format converted to 13.11) */
uint32 xpos = *gfx.tracePtr++ << 8;
@@
-190,6
+190,9
@@
static void gfx_render(uint32 bufferIndex, uint32 width)
uint32 xoffset = (int16) *gfx.tracePtr++;
uint32 yoffset = (int16) *gfx.tracePtr++;
uint32 xoffset = (int16) *gfx.tracePtr++;
uint32 yoffset = (int16) *gfx.tracePtr++;
+ priority = (Pico_mcd->s68k_regs[2] << 8) | Pico_mcd->s68k_regs[3];
+ priority = (priority >> 3) & 0x03;
+
/* process all dots */
while (width--)
{
/* process all dots */
while (width--)
{
@@
-274,17
+277,19
@@
static void gfx_render(uint32 bufferIndex, uint32 width)
/* update left or rigth pixel */
if (bufferIndex & 1)
{
/* update left or rigth pixel */
if (bufferIndex & 1)
{
+ /* priority mode write */
+ pixel_out = gfx.lut_prio[priority][pixel_in & 0x0f][pixel_out];
+
pixel_out |= (pixel_in & 0xf0);
}
else
{
pixel_out |= (pixel_in & 0xf0);
}
else
{
+ /* priority mode write */
+ pixel_out = gfx.lut_prio[priority][pixel_in >> 4][pixel_out];
+
pixel_out = (pixel_out << 4) | (pixel_in & 0x0f);
}
pixel_out = (pixel_out << 4) | (pixel_in & 0x0f);
}
- /* priority mode write */
- reg = (Pico_mcd->s68k_regs[2] << 8) | Pico_mcd->s68k_regs[3];
- pixel_out = gfx.lut_prio[(reg >> 3) & 0x03][pixel_in][pixel_out];
-
/* write data to image buffer */
WRITE_BYTE(Pico_mcd->word_ram2M, bufferIndex >> 1, pixel_out);
/* write data to image buffer */
WRITE_BYTE(Pico_mcd->word_ram2M, bufferIndex >> 1, pixel_out);
@@
-311,7
+316,7
@@
void gfx_start(unsigned int base)
/* make sure 2M mode is enabled */
if (!(Pico_mcd->s68k_regs[3] & 0x04))
{
/* make sure 2M mode is enabled */
if (!(Pico_mcd->s68k_regs[3] & 0x04))
{
- uint32 mask;
+ uint32 mask
= 0
;
uint32 reg;
/* trace vector pointer */
uint32 reg;
/* trace vector pointer */
@@
-429,7
+434,7
@@
void gfx_update(unsigned int cycles)
pcd_event_schedule(cycles, PCD_EVENT_GFX, 5 * w * lines);
}
pcd_event_schedule(cycles, PCD_EVENT_GFX, 5 * w * lines);
}
- if (Pico
O
pt & POPT_EN_MCD_GFX)
+ if (Pico
In.o
pt & POPT_EN_MCD_GFX)
{
/* render lines */
while (lines--)
{
/* render lines */
while (lines--)