summaryrefslogtreecommitdiffstats
path: root/src/mame
diff options
context:
space:
mode:
authorGravatarGravatar Angelo Salese <angelosa@users.noreply.github.com>2013-02-07 16:42:33 +0000
committerGravatarGravatar Angelo Salese <angelosa@users.noreply.github.com>2013-02-07 16:42:33 +0000
commit10353d4b7d8eb67597942e3c77954a88fccc4cac (patch) (github)
tree73381b86bce9fd82bb9107ec374dc7b2760c03c8 /src/mame
parent8a06e80089b9730225e55d3c368254c10a57b4f2 (diff)
downloadmame-10353d4b7d8eb67597942e3c77954a88fccc4cac.tar.bz2
mame-10353d4b7d8eb67597942e3c77954a88fccc4cac.zip
Removed 'gfx_decode' and fixed compile. Minor speed gain
Diffstat (limited to 'src/mame')
-rw-r--r--src/mame/includes/stv.h1
-rw-r--r--src/mame/machine/stvcd.c1
-rw-r--r--src/mame/video/stvvdp1.c53
3 files changed, 14 insertions, 41 deletions
diff --git a/src/mame/includes/stv.h b/src/mame/includes/stv.h
index d4c7d70a372..20aca5963cb 100644
--- a/src/mame/includes/stv.h
+++ b/src/mame/includes/stv.h
@@ -68,7 +68,6 @@ public:
rectangle user_cliprect;
UINT16 *framebuffer[2];
UINT16 **framebuffer_draw_lines;
- UINT8 *gfx_decode;
UINT16 lopr;
UINT16 copr;
UINT16 ewdr;
diff --git a/src/mame/machine/stvcd.c b/src/mame/machine/stvcd.c
index 04be6fc89df..f7f15be6bae 100644
--- a/src/mame/machine/stvcd.c
+++ b/src/mame/machine/stvcd.c
@@ -25,7 +25,6 @@
#include "imagedev/chd_cd.h"
#include "includes/stv.h"
#include "cdrom.h"
-#include "stvcd.h"
#include "sound/cdda.h"
#include "debugger.h"
#include "coreutil.h"
diff --git a/src/mame/video/stvvdp1.c b/src/mame/video/stvvdp1.c
index ded533cd6b7..eef02dbbe22 100644
--- a/src/mame/video/stvvdp1.c
+++ b/src/mame/video/stvvdp1.c
@@ -311,21 +311,7 @@ READ32_MEMBER ( saturn_state::saturn_vdp1_vram_r )
WRITE32_MEMBER ( saturn_state::saturn_vdp1_vram_w )
{
- UINT8 *vdp1 = m_vdp1.gfx_decode;
-
- COMBINE_DATA (&m_vdp1_vram[offset]);
-
-// if (((offset * 4) > 0xdf) && ((offset * 4) < 0x140))
-// {
-// logerror("cpu %s (PC=%08X): VRAM dword write to %08X = %08X & %08X\n", space.device().tag(), space.device().safe_pc(), offset*4, data, mem_mask);
-// }
-
- data = m_vdp1_vram[offset];
- /* put in gfx region for easy decoding */
- vdp1[offset*4+0] = (data & 0xff000000) >> 24;
- vdp1[offset*4+1] = (data & 0x00ff0000) >> 16;
- vdp1[offset*4+2] = (data & 0x0000ff00) >> 8;
- vdp1[offset*4+3] = (data & 0x000000ff) >> 0;
+ COMBINE_DATA(&m_vdp1_vram[offset]);
}
WRITE32_MEMBER ( saturn_state::saturn_vdp1_framebuffer0_w )
@@ -838,9 +824,10 @@ void saturn_state::drawpixel_poly(int x, int y, int patterndata, int offsetcnt)
void saturn_state::drawpixel_8bpp_trans(int x, int y, int patterndata, int offsetcnt)
{
+ UINT8 *vdp1_vram = (UINT8 *)m_vdp1_vram;
UINT16 pix;
- pix = m_vdp1.gfx_decode[patterndata+offsetcnt];
+ pix = vdp1_vram[(patterndata+offsetcnt/2)^3];
if ( pix & 0xff )
{
m_vdp1.framebuffer_draw_lines[y][x] = pix | m_sprite_colorbank;
@@ -849,18 +836,20 @@ void saturn_state::drawpixel_8bpp_trans(int x, int y, int patterndata, int offse
void saturn_state::drawpixel_4bpp_notrans(int x, int y, int patterndata, int offsetcnt)
{
+ UINT8 *vdp1_vram = (UINT8 *)m_vdp1_vram;
UINT16 pix;
- pix = m_vdp1.gfx_decode[patterndata+offsetcnt/2];
+ pix = vdp1_vram[(patterndata+offsetcnt/2)^3];
pix = offsetcnt&1 ? (pix & 0x0f):((pix & 0xf0)>>4) ;
m_vdp1.framebuffer_draw_lines[y][x] = pix | m_sprite_colorbank;
}
void saturn_state::drawpixel_4bpp_trans(int x, int y, int patterndata, int offsetcnt)
{
+ UINT8 *vdp1_vram = (UINT8 *)m_vdp1_vram;
UINT16 pix;
- pix = m_vdp1.gfx_decode[patterndata+offsetcnt/2];
+ pix = vdp1_vram[(patterndata+offsetcnt/2)^3];
pix = offsetcnt&1 ? (pix & 0x0f):((pix & 0xf0)>>4) ;
if ( pix )
m_vdp1.framebuffer_draw_lines[y][x] = pix | m_sprite_colorbank;
@@ -868,6 +857,7 @@ void saturn_state::drawpixel_4bpp_trans(int x, int y, int patterndata, int offse
void saturn_state::drawpixel_generic(int x, int y, int patterndata, int offsetcnt)
{
+ UINT8 *vdp1_vram = (UINT8 *)m_vdp1_vram;
int pix,mode,transmask, spd = stv2_current_sprite.CMDPMOD & 0x40;
int mesh = stv2_current_sprite.CMDPMOD & 0x100;
int pix2;
@@ -897,7 +887,7 @@ void saturn_state::drawpixel_generic(int x, int y, int patterndata, int offsetcn
{
case 0x0000: // mode 0 16 colour bank mode (4bits) (hanagumi blocks)
// most of the shienryu sprites use this mode
- pix = m_vdp1.gfx_decode[(patterndata+offsetcnt/2) & 0xfffff];
+ pix = vdp1_vram[((patterndata+offsetcnt/2)^3) & 0xfffff];
pix = offsetcnt&1 ? (pix & 0x0f):((pix & 0xf0)>>4) ;
pix = pix+((stv2_current_sprite.CMDCOLR&0xfff0));
mode = 0;
@@ -905,7 +895,7 @@ void saturn_state::drawpixel_generic(int x, int y, int patterndata, int offsetcn
break;
case 0x0008: // mode 1 16 colour lookup table mode (4bits)
// shienryu explosisons (and some enemies) use this mode
- pix2 = m_vdp1.gfx_decode[(patterndata+offsetcnt/2) & 0xfffff];
+ pix2 = vdp1_vram[((patterndata+offsetcnt/2)^3) & 0xfffff];
pix2 = offsetcnt&1 ? (pix2 & 0x0f):((pix2 & 0xf0)>>4);
pix = pix2&1 ?
((((m_vdp1_vram[(((stv2_current_sprite.CMDCOLR&0xffff)*8)>>2)+((pix2&0xfffe)/2)])) & 0x0000ffff) >> 0):
@@ -927,25 +917,25 @@ void saturn_state::drawpixel_generic(int x, int y, int patterndata, int offsetcn
}
break;
case 0x0010: // mode 2 64 colour bank mode (8bits) (character select portraits on hanagumi)
- pix = m_vdp1.gfx_decode[(patterndata+offsetcnt) & 0xfffff];
+ pix = vdp1_vram[((patterndata+offsetcnt)^3) & 0xfffff];
mode = 2;
pix = pix+(stv2_current_sprite.CMDCOLR&0xffc0);
transmask = 0x3f;
break;
case 0x0018: // mode 3 128 colour bank mode (8bits) (little characters on hanagumi use this mode)
- pix = m_vdp1.gfx_decode[(patterndata+offsetcnt) & 0xfffff];
+ pix = vdp1_vram[((patterndata+offsetcnt)^3) & 0xfffff];
pix = pix+(stv2_current_sprite.CMDCOLR&0xff80);
transmask = 0x7f;
mode = 3;
break;
case 0x0020: // mode 4 256 colour bank mode (8bits) (hanagumi title)
- pix = m_vdp1.gfx_decode[(patterndata+offsetcnt) & 0xfffff];
+ pix = vdp1_vram[((patterndata+offsetcnt)^3) & 0xfffff];
pix = pix+(stv2_current_sprite.CMDCOLR&0xff00);
transmask = 0xff;
mode = 4;
break;
case 0x0028: // mode 5 32,768 colour RGB mode (16bits)
- pix = m_vdp1.gfx_decode[(patterndata+offsetcnt*2+1) & 0xfffff] | (m_vdp1.gfx_decode[(patterndata+offsetcnt*2) & 0xfffff]<<8) ;
+ pix = vdp1_vram[((patterndata+offsetcnt*2+1)^3) & 0xfffff] | (vdp1_vram[((patterndata+offsetcnt*2)^3) & 0xfffff]<<8) ;
mode = 5;
transmask = -1; /* TODO: check me */
break;
@@ -2049,31 +2039,16 @@ void saturn_state::video_update_vdp1( void )
void saturn_state::stv_vdp1_state_save_postload( void )
{
- UINT8 *vdp1 = m_vdp1.gfx_decode;
- int offset;
- UINT32 data;
-
m_vdp1.framebuffer_mode = -1;
m_vdp1.framebuffer_double_interlace = -1;
stv_set_framebuffer_config();
-
- for (offset = 0; offset < 0x80000/4; offset++ )
- {
- data = m_vdp1_vram[offset];
- /* put in gfx region for easy decoding */
- vdp1[offset*4+0] = (data & 0xff000000) >> 24;
- vdp1[offset*4+1] = (data & 0x00ff0000) >> 16;
- vdp1[offset*4+2] = (data & 0x0000ff00) >> 8;
- vdp1[offset*4+3] = (data & 0x000000ff) >> 0;
- }
}
int saturn_state::stv_vdp1_start ( void )
{
m_vdp1_regs = auto_alloc_array_clear(machine(), UINT16, 0x020/2 );
m_vdp1_vram = auto_alloc_array_clear(machine(), UINT32, 0x100000/4 );
- m_vdp1.gfx_decode = auto_alloc_array(machine(), UINT8, 0x100000 );
stv_vdp1_shading_data = auto_alloc(machine(), struct stv_vdp1_poly_scanline_data);