summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/gunpey.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/gunpey.cpp')
-rw-r--r--src/mame/drivers/gunpey.cpp112
1 files changed, 56 insertions, 56 deletions
diff --git a/src/mame/drivers/gunpey.cpp b/src/mame/drivers/gunpey.cpp
index d7ccfe19747..78422ba6fb5 100644
--- a/src/mame/drivers/gunpey.cpp
+++ b/src/mame/drivers/gunpey.cpp
@@ -207,12 +207,12 @@ public:
required_device<cpu_device> m_maincpu;
required_device<okim6295_device> m_oki;
- required_shared_ptr<UINT16> m_wram;
+ required_shared_ptr<uint16_t> m_wram;
required_device<palette_device> m_palette;
- std::unique_ptr<UINT16[]> m_blit_buffer;
- UINT16 m_blit_ram[0x10];
- UINT8 m_irq_cause, m_irq_mask;
+ std::unique_ptr<uint16_t[]> m_blit_buffer;
+ uint16_t m_blit_ram[0x10];
+ uint8_t m_irq_cause, m_irq_mask;
DECLARE_WRITE8_MEMBER(gunpey_status_w);
DECLARE_READ8_MEMBER(gunpey_status_r);
DECLARE_READ8_MEMBER(gunpey_inputs_r);
@@ -224,18 +224,18 @@ public:
DECLARE_WRITE16_MEMBER(gunpey_vregs_addr_w);
DECLARE_DRIVER_INIT(gunpey);
virtual void video_start() override;
- UINT32 screen_update_gunpey(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ uint32_t screen_update_gunpey(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(gunpey_scanline);
TIMER_CALLBACK_MEMBER(blitter_end);
- void gunpey_irq_check(UINT8 irq_type);
- UINT8 draw_gfx(bitmap_ind16 &bitmap,const rectangle &cliprect,int count,UINT8 scene_gradient);
- UINT16 m_vram_bank;
- UINT16 m_vreg_addr;
+ void gunpey_irq_check(uint8_t irq_type);
+ uint8_t draw_gfx(bitmap_ind16 &bitmap,const rectangle &cliprect,int count,uint8_t scene_gradient);
+ uint16_t m_vram_bank;
+ uint16_t m_vreg_addr;
- UINT8* m_blit_rom;
- UINT8* m_blit_rom2;
+ uint8_t* m_blit_rom;
+ uint8_t* m_blit_rom2;
- UINT8* m_vram;
+ uint8_t* m_vram;
// work variables for the decompression
int m_srcx;
@@ -243,7 +243,7 @@ public:
int m_scrxcount;
int m_srcy;
int m_srcycount;
- UINT8 m_sourcewide;
+ uint8_t m_sourcewide;
int m_ysize;
int m_xsize;
int m_dstx;
@@ -254,24 +254,24 @@ public:
bool m_out_of_data;
int m_latched_bits_left;
- UINT8 m_latched_byte;
+ uint8_t m_latched_byte;
int m_zero_bit_count;
void get_stream_next_byte(void);
int get_stream_bit(void);
- UINT32 gunpey_state_get_stream_bits(int bits);
+ uint32_t gunpey_state_get_stream_bits(int bits);
- int write_dest_byte(UINT8 usedata);
- //UINT16 main_m_vram[0x800][0x800];
+ int write_dest_byte(uint8_t usedata);
+ //uint16_t main_m_vram[0x800][0x800];
};
void gunpey_state::video_start()
{
- m_blit_buffer = std::make_unique<UINT16[]>(512*512);
+ m_blit_buffer = std::make_unique<uint16_t[]>(512*512);
}
-UINT8 gunpey_state::draw_gfx(bitmap_ind16 &bitmap,const rectangle &cliprect,int count,UINT8 scene_gradient)
+uint8_t gunpey_state::draw_gfx(bitmap_ind16 &bitmap,const rectangle &cliprect,int count,uint8_t scene_gradient)
{
int x,y;
int bpp_sel;
@@ -306,23 +306,23 @@ UINT8 gunpey_state::draw_gfx(bitmap_ind16 &bitmap,const rectangle &cliprect,int
{
x = (m_wram[count+3] >> 8) | ((m_wram[count+4] & 0x03) << 8);
y = (m_wram[count+4] >> 8) | ((m_wram[count+4] & 0x30) << 4);
- UINT8 zoomheight = (m_wram[count+5] >> 8);
- UINT8 zoomwidth = (m_wram[count+5] & 0xff);
+ uint8_t zoomheight = (m_wram[count+5] >> 8);
+ uint8_t zoomwidth = (m_wram[count+5] & 0xff);
bpp_sel = (m_wram[count+0] & 0x18);
color = (m_wram[count+0] >> 8);
x-=0x160;
y-=0x188;
- UINT8 sourcewidth = (m_wram[count+6] & 0xff);
- UINT8 sourceheight = (m_wram[count+7] >> 8);
+ uint8_t sourcewidth = (m_wram[count+6] & 0xff);
+ uint8_t sourceheight = (m_wram[count+7] >> 8);
int xsource = ((m_wram[count+2] & 0x003f) << 5) | ((m_wram[count+1] & 0xf800) >> 11);
int ysource = ((m_wram[count+3] & 0x001f) << 6) | ((m_wram[count+2] & 0xfc00) >> 10);
int alpha = m_wram[count+1] & 0x1f;
- UINT16 unused;
+ uint16_t unused;
if (debug) printf("sprite %04x %04x %04x %04x %04x %04x %04x %04x\n", m_wram[count+0], m_wram[count+1], m_wram[count+2], m_wram[count+3], m_wram[count+4], m_wram[count+5], m_wram[count+6], m_wram[count+7]);
unused = m_wram[count+0]&~0xff98; if (unused) printf("unused bits set in word 0 - %04x\n", unused);
@@ -345,10 +345,10 @@ UINT8 gunpey_state::draw_gfx(bitmap_ind16 &bitmap,const rectangle &cliprect,int
{
for(int xi=0;xi<sourcewidth/2;xi++)
{
- UINT8 data = m_vram[((((ysource+yi)&0x7ff)*0x800) + ((xsource+xi)&0x7ff))];
- UINT8 pix;
- UINT32 col_offs;
- UINT16 color_data;
+ uint8_t data = m_vram[((((ysource+yi)&0x7ff)*0x800) + ((xsource+xi)&0x7ff))];
+ uint8_t pix;
+ uint32_t col_offs;
+ uint16_t color_data;
pix = (data & 0x0f);
col_offs = ((pix + color*0x10) & 0xff) << 1;
@@ -382,7 +382,7 @@ UINT8 gunpey_state::draw_gfx(bitmap_ind16 &bitmap,const rectangle &cliprect,int
}
else
{
- UINT16 basecolor = bitmap.pix16(y+yi, x+(xi*2));
+ uint16_t basecolor = bitmap.pix16(y+yi, x+(xi*2));
int base_r = ((basecolor >> 10)&0x1f)*alpha;
int base_g = ((basecolor >> 5)&0x1f)*alpha;
int base_b = ((basecolor >> 0)&0x1f)*alpha;
@@ -430,7 +430,7 @@ UINT8 gunpey_state::draw_gfx(bitmap_ind16 &bitmap,const rectangle &cliprect,int
}
else
{
- UINT16 basecolor = bitmap.pix16(y+yi, x+1+(xi*2));
+ uint16_t basecolor = bitmap.pix16(y+yi, x+1+(xi*2));
int base_r = ((basecolor >> 10)&0x1f)*alpha;
int base_g = ((basecolor >> 5)&0x1f)*alpha;
int base_b = ((basecolor >> 0)&0x1f)*alpha;
@@ -458,10 +458,10 @@ UINT8 gunpey_state::draw_gfx(bitmap_ind16 &bitmap,const rectangle &cliprect,int
{
for(int xi=0;xi<sourcewidth;xi++)
{
- UINT8 data = m_vram[((((ysource+yi)&0x7ff)*0x800) + ((xsource+xi)&0x7ff))];
- UINT8 pix;
- UINT32 col_offs;
- UINT16 color_data;
+ uint8_t data = m_vram[((((ysource+yi)&0x7ff)*0x800) + ((xsource+xi)&0x7ff))];
+ uint8_t pix;
+ uint32_t col_offs;
+ uint16_t color_data;
pix = (data & 0x3f);
if(cliprect.contains(x+xi, y+yi))
@@ -476,10 +476,10 @@ UINT8 gunpey_state::draw_gfx(bitmap_ind16 &bitmap,const rectangle &cliprect,int
{
for(int xi=0;xi<sourcewidth;xi++)
{
- UINT8 data = m_vram[((((ysource+yi)&0x7ff)*0x800) + ((xsource+xi)&0x7ff))];
- UINT8 pix;
- UINT32 col_offs;
- UINT16 color_data;
+ uint8_t data = m_vram[((((ysource+yi)&0x7ff)*0x800) + ((xsource+xi)&0x7ff))];
+ uint8_t pix;
+ uint32_t col_offs;
+ uint16_t color_data;
pix = (data & 0xff);
col_offs = ((pix + color*0x100) & 0xff) << 1;
@@ -515,7 +515,7 @@ UINT8 gunpey_state::draw_gfx(bitmap_ind16 &bitmap,const rectangle &cliprect,int
}
else
{
- UINT16 basecolor = bitmap.pix16(y+yi, x+xi);
+ uint16_t basecolor = bitmap.pix16(y+yi, x+xi);
int base_r = ((basecolor >> 10)&0x1f)*alpha;
int base_g = ((basecolor >> 5)&0x1f)*alpha;
int base_b = ((basecolor >> 0)&0x1f)*alpha;
@@ -545,12 +545,12 @@ UINT8 gunpey_state::draw_gfx(bitmap_ind16 &bitmap,const rectangle &cliprect,int
return m_wram[count+0] & 0x80;
}
-UINT32 gunpey_state::screen_update_gunpey(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+uint32_t gunpey_state::screen_update_gunpey(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- //UINT16 *blit_buffer = m_blit_buffer;
- UINT16 vram_bank = m_vram_bank & 0x7fff;
- UINT16 vreg_addr = m_vreg_addr & 0x7fff;
- UINT8 end_mark;
+ //uint16_t *blit_buffer = m_blit_buffer;
+ uint16_t vram_bank = m_vram_bank & 0x7fff;
+ uint16_t vreg_addr = m_vreg_addr & 0x7fff;
+ uint8_t end_mark;
int count;
int scene_index;
@@ -561,11 +561,11 @@ UINT32 gunpey_state::screen_update_gunpey(screen_device &screen, bitmap_ind16 &b
for(scene_index = vreg_addr/2;scene_index<(vreg_addr+0x400)/2;scene_index+=0x10/2)
{
- UINT16 start_offs;
- UINT16 end_offs;
- UINT8 scene_end_mark;
- UINT8 scene_enabled;
- UINT8 scene_gradient;
+ uint16_t start_offs;
+ uint16_t end_offs;
+ uint8_t scene_end_mark;
+ uint8_t scene_enabled;
+ uint8_t scene_gradient;
start_offs = (vram_bank+(m_wram[scene_index+5] << 8))/2;
end_offs = (vram_bank+(m_wram[scene_index+5] << 8)+0x1000)/2; //safety check
@@ -594,7 +594,7 @@ UINT32 gunpey_state::screen_update_gunpey(screen_device &screen, bitmap_ind16 &b
return 0;
}
-void gunpey_state::gunpey_irq_check(UINT8 irq_type)
+void gunpey_state::gunpey_irq_check(uint8_t irq_type)
{
m_irq_cause |= irq_type;
@@ -684,9 +684,9 @@ int gunpey_state::get_stream_bit(void)
return bit;
}
-UINT32 gunpey_state::gunpey_state_get_stream_bits(int bits)
+uint32_t gunpey_state::gunpey_state_get_stream_bits(int bits)
{
- UINT32 output = 0;
+ uint32_t output = 0;
for (int i=0;i<bits;i++)
{
output = output<<1;
@@ -696,7 +696,7 @@ UINT32 gunpey_state::gunpey_state_get_stream_bits(int bits)
return output;
}
-int gunpey_state::write_dest_byte(UINT8 usedata)
+int gunpey_state::write_dest_byte(uint8_t usedata)
{
// write the byte we and to destination and increase our counters
m_vram[(((m_dsty)&0x7ff)*0x800)+((m_dstx)&0x7ff)] = usedata;
@@ -1076,7 +1076,7 @@ ooutcount was 51
WRITE8_MEMBER(gunpey_state::gunpey_blitter_w)
{
- UINT16 *blit_ram = m_blit_ram;
+ uint16_t *blit_ram = m_blit_ram;
//printf("gunpey_blitter_w offset %01x data %02x\n", offset,data);
@@ -1160,7 +1160,7 @@ WRITE8_MEMBER(gunpey_state::gunpey_blitter_w)
- UINT8 usedata = 0xff;
+ uint8_t usedata = 0xff;
if (!m_out_of_data)
{
#ifdef SHOW_COMPRESSED_DATA_DEBUG
@@ -1228,7 +1228,7 @@ WRITE8_MEMBER(gunpey_state::gunpey_blitter_w)
for (;;)
{
- UINT8 usedata = m_blit_rom[(((m_srcy)&0x7ff)*0x800)+((m_srcx)&0x7ff)];
+ uint8_t usedata = m_blit_rom[(((m_srcy)&0x7ff)*0x800)+((m_srcx)&0x7ff)];
m_blit_rom2[(((m_srcy)&0x7ff)*0x800)+((m_srcx)&0x7ff)] = 0x44; // debug
m_srcx++; m_scrxcount++;
if (m_scrxcount==m_xsize)