summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/video/pc6001.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/video/pc6001.cpp')
-rw-r--r--src/mame/video/pc6001.cpp39
1 files changed, 20 insertions, 19 deletions
diff --git a/src/mame/video/pc6001.cpp b/src/mame/video/pc6001.cpp
index 0de586a2982..e5943be7514 100644
--- a/src/mame/video/pc6001.cpp
+++ b/src/mame/video/pc6001.cpp
@@ -81,7 +81,7 @@ void pc6001mk2_state::pc6001mk2_palette(palette_device &palette) const
ATTR_CONST pc6001_state::uint8_t pc6001_get_attributes(uint8_t c,int scanline, int pos)
{
uint8_t result = 0x00;
- uint8_t val = m_video_ram [(scanline / 12) * 0x20 + pos];
+ uint8_t val = m_video_base [(scanline / 12) * 0x20 + pos];
if (val & 0x01) {
result |= M6847_INV;
@@ -95,7 +95,7 @@ ATTR_CONST pc6001_state::uint8_t pc6001_get_attributes(uint8_t c,int scanline, i
const pc6001_state::uint8_t *pc6001_get_video_ram(int scanline)
{
- return m_video_ram +0x0200+ (scanline / 12) * 0x20;
+ return m_video_base +0x0200+ (scanline / 12) * 0x20;
}
uint8_t pc6001_state::pc6001_get_char_rom(uint8_t ch, int line)
@@ -117,7 +117,8 @@ void pc6001_state::video_start()
cfg.get_char_rom = pc6001_get_char_rom;
m6847_init(machine(), &cfg);
#endif
- m_video_ram = auto_alloc_array_clear(machine(), uint8_t, 0x4000);
+ m_video_ram = make_unique_clear<uint8_t[]>(0x4000);
+ m_video_base = &m_video_ram[0];
}
void pc6001mk2_state::video_start()
@@ -127,7 +128,7 @@ void pc6001mk2_state::video_start()
void pc6001sr_state::video_start()
{
-// m_video_ram = auto_alloc_array_clear(machine(), uint8_t, 0x4000);
+// m_video_ram = std::make_unique<uint8_t[]>(0x4000);
m_gvram = std::make_unique<uint8_t []>(320*256*8); // TODO: size
std::fill_n(m_gvram.get(), 320*256*8, 0);
save_pointer(NAME(m_gvram), 320*256*8);
@@ -157,7 +158,7 @@ void pc6001_state::draw_gfx_mode4(bitmap_ind16 &bitmap,const rectangle &cliprect
{
for(int x=0;x<32;x++)
{
- int tile = m_video_ram[(x+(y*32))+0x200];
+ int tile = m_video_base[(x+(y*32))+0x200];
if(col_setting == 0x00) //monochrome
{
@@ -199,7 +200,7 @@ void pc6001_state::draw_bitmap_2bpp(bitmap_ind16 &bitmap,const rectangle &clipre
{
for(int x=0;x<w;x++)
{
- int tile = m_video_ram[(x+(y*32))+0x200];
+ int tile = m_video_base[(x+(y*32))+0x200];
for(int yi=0;yi<shrink_y;yi++)
{
@@ -221,7 +222,7 @@ void pc6001_state::draw_bitmap_2bpp(bitmap_ind16 &bitmap,const rectangle &clipre
{
for(int x=0;x<w;x++)
{
- int tile = m_video_ram[(x+((y/3)*32))+0x200];
+ int tile = m_video_base[(x+((y/3)*32))+0x200];
for(int yi=0;yi<shrink_y;yi++)
{
@@ -330,7 +331,7 @@ void pc6001_state::draw_border(bitmap_ind16 &bitmap,const rectangle &cliprect,in
void pc6001_state::pc6001_screen_draw(bitmap_ind16 &bitmap,const rectangle &cliprect, int has_mc6847)
{
- int attr = m_video_ram[0];
+ int attr = m_video_base[0];
draw_border(bitmap,cliprect,attr,has_mc6847);
@@ -351,8 +352,8 @@ void pc6001_state::pc6001_screen_draw(bitmap_ind16 &bitmap,const rectangle &clip
{
for(int x=0;x<32;x++)
{
- int tile = m_video_ram[(x+(y*32))+0x200];
- attr = m_video_ram[(x+(y*32)) & 0x1ff];
+ int tile = m_video_base[(x+(y*32))+0x200];
+ attr = m_video_base[(x+(y*32)) & 0x1ff];
if(attr & 0x40)
{
@@ -398,8 +399,8 @@ uint32_t pc6001mk2_state::screen_update_pc6001mk2(screen_device &screen, bitmap_
color |= pal_num[(pen[0] & 3) | ((pen[1] & 3) << 2)];
#endif
- pen[0] = m_video_ram[count+0x0000] >> (6-i*2) & 3;
- pen[1] = m_video_ram[count+0x2000] >> (6-i*2) & 3;
+ pen[0] = m_video_base[count+0x0000] >> (6-i*2) & 3;
+ pen[1] = m_video_base[count+0x2000] >> (6-i*2) & 3;
int color = 0x10;
color |= ((pen[0] & 1) << 2);
@@ -435,8 +436,8 @@ uint32_t pc6001mk2_state::screen_update_pc6001mk2(screen_device &screen, bitmap_
color |= pal_num[(pen[0] & 1) | ((pen[1] & 1) << 1)];
#endif
- pen[0] = m_video_ram[count+0x0000] >> (7-i) & 1;
- pen[1] = m_video_ram[count+0x2000] >> (7-i) & 1;
+ pen[0] = m_video_base[count+0x0000] >> (7-i) & 1;
+ pen[1] = m_video_base[count+0x2000] >> (7-i) & 1;
int color;
if(m_bgcol_bank & 4) //PC-6001 emulation mode
@@ -478,8 +479,8 @@ uint32_t pc6001mk2_state::screen_update_pc6001mk2(screen_device &screen, bitmap_
---- xxxx fg color
Note that the exgfx banks a different gfx ROM
*/
- int tile = m_video_ram[(x+(y*40))+0x400] + 0x200;
- int attr = m_video_ram[(x+(y*40)) & 0x3ff];
+ int tile = m_video_base[(x+(y*40))+0x400] + 0x200;
+ int attr = m_video_base[(x+(y*40)) & 0x3ff];
tile += ((attr & 0x80) << 1);
for(int yi=0;yi<12;yi++)
@@ -502,7 +503,7 @@ uint32_t pc6001mk2_state::screen_update_pc6001mk2(screen_device &screen, bitmap_
}
else
{
- //attr = m_video_ram[0];
+ //attr = m_video_base[0];
pc6001_screen_draw(bitmap,cliprect,0);
}
@@ -521,8 +522,8 @@ uint32_t pc6001sr_state::screen_update_pc6001sr(screen_device &screen, bitmap_in
{
for(int x=0;x<40;x++)
{
- int tile = m_video_ram[(x+(y*40))*2+0];
- int attr = m_video_ram[(x+(y*40))*2+1];
+ int tile = m_video_base[(x+(y*40))*2+0];
+ int attr = m_video_base[(x+(y*40))*2+1];
tile += ((attr & 0x80) << 1);
for(int yi=0;yi<12;yi++)