summaryrefslogtreecommitdiffstats
path: root/src/mame/drivers/bfcobra.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/bfcobra.cpp')
-rw-r--r--src/mame/drivers/bfcobra.cpp172
1 files changed, 86 insertions, 86 deletions
diff --git a/src/mame/drivers/bfcobra.cpp b/src/mame/drivers/bfcobra.cpp
index 81ac7473a95..2533e233674 100644
--- a/src/mame/drivers/bfcobra.cpp
+++ b/src/mame/drivers/bfcobra.cpp
@@ -103,13 +103,13 @@
union ADDR_REG
{
#ifdef LSB_FIRST
- struct { UINT16 loword, hiword ; } as16bit;
- struct { UINT8 addr0, addr1, addr2; } as8bit;
+ struct { uint16_t loword, hiword ; } as16bit;
+ struct { uint8_t addr0, addr1, addr2; } as8bit;
#else
- struct { UINT16 hiword, loword ; } as16bit;
- struct { UINT8 addr2, addr1, addr0; } as8bit;
+ struct { uint16_t hiword, loword ; } as16bit;
+ struct { uint8_t addr2, addr1, addr0; } as8bit;
#endif
- UINT32 addr;
+ uint32_t addr;
};
/* Blitter register flag bits */
@@ -152,26 +152,26 @@ struct bf_blitter_t
{
ADDR_REG program;
- UINT8 control;
- UINT8 status;
+ uint8_t control;
+ uint8_t status;
- UINT8 command;
+ uint8_t command;
ADDR_REG source;
ADDR_REG dest;
- UINT8 modectl;
- UINT8 compfunc;
- UINT8 outercnt;
+ uint8_t modectl;
+ uint8_t compfunc;
+ uint8_t outercnt;
- UINT8 innercnt;
- UINT8 step;
- UINT8 pattern;
+ uint8_t innercnt;
+ uint8_t step;
+ uint8_t pattern;
};
#define LOOPTYPE ( ( blitter.command&0x60 ) >> 5 )
struct fdc_t
{
- UINT8 MSR;
+ uint8_t MSR;
int side;
int track;
@@ -189,8 +189,8 @@ struct fdc_t
int cmd_cnt;
int res_len;
int res_cnt;
- UINT8 cmd[10];
- UINT8 results[8];
+ uint8_t cmd[10];
+ uint8_t results[8];
};
@@ -231,30 +231,30 @@ public:
{
}
- UINT8 m_bank_data[4];
- std::unique_ptr<UINT8[]> m_work_ram;
- std::unique_ptr<UINT8[]> m_video_ram;
- UINT8 m_h_scroll;
- UINT8 m_v_scroll;
- UINT8 m_flip_8;
- UINT8 m_flip_22;
- UINT8 m_videomode;
- UINT8 m_data_r;
- UINT8 m_data_t;
+ uint8_t m_bank_data[4];
+ std::unique_ptr<uint8_t[]> m_work_ram;
+ std::unique_ptr<uint8_t[]> m_video_ram;
+ uint8_t m_h_scroll;
+ uint8_t m_v_scroll;
+ uint8_t m_flip_8;
+ uint8_t m_flip_22;
+ uint8_t m_videomode;
+ uint8_t m_data_r;
+ uint8_t m_data_t;
int m_irq_state;
int m_acia_irq;
int m_vblank_irq;
int m_blitter_irq;
- UINT8 m_z80_int;
- UINT8 m_z80_inten;
- UINT32 m_meter_latch;
- UINT32 m_mux_input;
- UINT32 m_mux_outputlatch;
- UINT8 m_col4bit[16];
- UINT8 m_col3bit[16];
- UINT8 m_col8bit[256];
- UINT8 m_col7bit[256];
- UINT8 m_col6bit[256];
+ uint8_t m_z80_int;
+ uint8_t m_z80_inten;
+ uint32_t m_meter_latch;
+ uint32_t m_mux_input;
+ uint32_t m_mux_outputlatch;
+ uint8_t m_col4bit[16];
+ uint8_t m_col3bit[16];
+ uint8_t m_col8bit[256];
+ uint8_t m_col7bit[256];
+ uint8_t m_col6bit[256];
struct bf_blitter_t m_blitter;
struct fdc_t m_fdc;
DECLARE_READ8_MEMBER(chipset_r);
@@ -277,16 +277,16 @@ public:
DECLARE_DRIVER_INIT(bfcobra);
virtual void machine_reset() override;
virtual void video_start() override;
- UINT32 screen_update_bfcobra(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+ uint32_t screen_update_bfcobra(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(timer_irq);
INTERRUPT_GEN_MEMBER(vblank_gen);
void RunBlit(address_space &space);
void update_irqs();
void reset_fdc();
- void exec_w_phase(UINT8 data);
+ void exec_w_phase(uint8_t data);
void init_ram();
- void command_phase(struct fdc_t &fdc, UINT8 data);
- inline UINT8* blitter_get_addr(UINT32 addr);
+ void command_phase(struct fdc_t &fdc, uint8_t data);
+ inline uint8_t* blitter_get_addr(uint32_t addr);
inline void z80_bank(int num, int data);
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
@@ -299,7 +299,7 @@ public:
};
-static const UINT8 col4bit_default[16]=
+static const uint8_t col4bit_default[16]=
{
BLUE_0 | GREEN_0 | RED_0,
BLUE_1,
@@ -319,7 +319,7 @@ static const UINT8 col4bit_default[16]=
RED_7 | GREEN_7 | BLUE_3
};
-static const UINT8 col3bit_default[16]=
+static const uint8_t col3bit_default[16]=
{
0,
BLUE_3,
@@ -339,7 +339,7 @@ static const UINT8 col3bit_default[16]=
RED_7 | GREEN_7 | BLUE_3
};
-static const UINT8 col76index[] = {0, 2, 4, 7};
+static const uint8_t col76index[] = {0, 2, 4, 7};
void bfcobra_state::video_start()
@@ -350,7 +350,7 @@ void bfcobra_state::video_start()
memcpy(m_col3bit, col3bit_default, sizeof(m_col3bit));
for (i = 0; i < 256; ++i)
{
- UINT8 col;
+ uint8_t col;
m_col8bit[i] = i;
col = i & 0x7f;
@@ -363,14 +363,14 @@ void bfcobra_state::video_start()
}
}
-UINT32 bfcobra_state::screen_update_bfcobra(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
+uint32_t bfcobra_state::screen_update_bfcobra(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
int x, y;
- UINT8 *src;
- UINT32 *dest;
- UINT32 offset;
- UINT8 *hirescol;
- UINT8 *lorescol;
+ uint8_t *src;
+ uint32_t *dest;
+ uint32_t offset;
+ uint8_t *hirescol;
+ uint8_t *lorescol;
/* Select screen has to be programmed into two registers */
/* No idea what happens if the registers are different */
@@ -397,14 +397,14 @@ UINT32 bfcobra_state::screen_update_bfcobra(screen_device &screen, bitmap_rgb32
for (y = cliprect.min_y; y <= cliprect.max_y; ++y)
{
- UINT16 y_offset = (y + m_v_scroll) * 256;
+ uint16_t y_offset = (y + m_v_scroll) * 256;
src = &m_video_ram[offset + y_offset];
dest = &bitmap.pix32(y);
for (x = cliprect.min_x; x <= cliprect.max_x / 2; ++x)
{
- UINT8 x_offset = x + m_h_scroll;
- UINT8 pen = *(src + x_offset);
+ uint8_t x_offset = x + m_h_scroll;
+ uint8_t pen = *(src + x_offset);
if ( ( m_videomode & 0x81 ) == 1 || (m_videomode & 0x80 && pen & 0x80) )
{
@@ -422,27 +422,27 @@ UINT32 bfcobra_state::screen_update_bfcobra(screen_device &screen, bitmap_rgb32
return 0;
}
-UINT8* bfcobra_state::blitter_get_addr(UINT32 addr)
+uint8_t* bfcobra_state::blitter_get_addr(uint32_t addr)
{
if (addr < 0x10000)
{
/* Is this region fixed? */
- return (UINT8*)(memregion("user1")->base() + addr);
+ return (uint8_t*)(memregion("user1")->base() + addr);
}
else if(addr < 0x20000)
{
addr &= 0xffff;
addr += (m_bank_data[0] & 1) ? 0x10000 : 0;
- return (UINT8*)(memregion("user1")->base() + addr + ((m_bank_data[0] >> 1) * 0x20000));
+ return (uint8_t*)(memregion("user1")->base() + addr + ((m_bank_data[0] >> 1) * 0x20000));
}
else if (addr >= 0x20000 && addr < 0x40000)
{
- return (UINT8*)&m_video_ram[addr - 0x20000];
+ return (uint8_t*)&m_video_ram[addr - 0x20000];
}
else
{
- return (UINT8*)&m_work_ram[addr - 0x40000];
+ return (uint8_t*)&m_work_ram[addr - 0x40000];
}
}
@@ -462,8 +462,8 @@ void bfcobra_state::RunBlit(address_space &space)
do
{
- UINT8 srcdata = 0;
- UINT8 dstdata = 0;
+ uint8_t srcdata = 0;
+ uint8_t dstdata = 0;
/* Read the blitter command */
BLITPRG_READ(source.as8bit.addr0);
@@ -518,7 +518,7 @@ void bfcobra_state::RunBlit(address_space &space)
/* Begin outer loop */
for (;;)
{
- UINT8 innercnt = blitter.innercnt;
+ uint8_t innercnt = blitter.innercnt;
dstdata = blitter.pattern;
if (blitter.command & CMD_LINEDRAW)
@@ -571,10 +571,10 @@ void bfcobra_state::RunBlit(address_space &space)
}
else do
{
- UINT8 inhibit = 0;
+ uint8_t inhibit = 0;
/* TODO: Set this correctly */
- UINT8 result = blitter.pattern;
+ uint8_t result = blitter.pattern;
if (LOOPTYPE == 3 && innercnt == blitter.innercnt)
{
@@ -672,15 +672,15 @@ void bfcobra_state::RunBlit(address_space &space)
The existing destination pixel is used as a lookup
into the table and the colours is replaced.
*/
- UINT8 dest = *blitter_get_addr( blitter.dest.addr);
- UINT8 newcol = *(blitter_get_addr( (blitter.source.addr + dest) & 0xfffff));
+ uint8_t dest = *blitter_get_addr( blitter.dest.addr);
+ uint8_t newcol = *(blitter_get_addr( (blitter.source.addr + dest) & 0xfffff));
*blitter_get_addr( blitter.dest.addr) = newcol;
cycles_used += 3;
}
else
{
- UINT8 final_result = 0;
+ uint8_t final_result = 0;
if (blitter.compfunc & CMPFUNC_LOG3)
final_result |= result & dstdata;
@@ -799,7 +799,7 @@ void bfcobra_state::update_irqs()
READ8_MEMBER(bfcobra_state::chipset_r)
{
- UINT8 val = 0xff;
+ uint8_t val = 0xff;
switch(offset)
{
@@ -945,7 +945,7 @@ void bfcobra_state::z80_bank(int num, int data)
if (data < 0x08)
{
- UINT32 offset = ((m_bank_data[0] >> 1) * 0x20000) + ((0x4000 * data) ^ ((m_bank_data[0] & 1) ? 0 : 0x10000));
+ uint32_t offset = ((m_bank_data[0] >> 1) * 0x20000) + ((0x4000 * data) ^ ((m_bank_data[0] & 1) ? 0 : 0x10000));
membank(bank_names[num - 1])->set_base(memregion("user1")->base() + offset);
}
@@ -1020,7 +1020,7 @@ void bfcobra_state::reset_fdc()
READ8_MEMBER(bfcobra_state::fdctrl_r)
{
- UINT8 val = 0;
+ uint8_t val = 0;
val = m_fdc.MSR;
@@ -1034,7 +1034,7 @@ READ8_MEMBER(bfcobra_state::fddata_r)
#define SPT 10
#define BPT 1024*10
- UINT8 val = 0;
+ uint8_t val = 0;
if (fdc.phase == EXECUTION_R)
{
@@ -1122,7 +1122,7 @@ WRITE8_MEMBER(bfcobra_state::fdctrl_w)
}
}
-void bfcobra_state::command_phase(struct fdc_t &fdc, UINT8 data)
+void bfcobra_state::command_phase(struct fdc_t &fdc, uint8_t data)
{
if (fdc.cmd_cnt == 0)
{
@@ -1204,18 +1204,18 @@ void bfcobra_state::command_phase(struct fdc_t &fdc, UINT8 data)
}
#ifdef UNUSED_FUNCTION
-UINT8 bfcobra_state::exec_r_phase(void)
+uint8_t bfcobra_state::exec_r_phase(void)
{
return 0;
}
#endif
-void bfcobra_state::exec_w_phase(UINT8 data)
+void bfcobra_state::exec_w_phase(uint8_t data)
{
}
#ifdef UNUSED_FUNCTION
-UINT8 bfcobra_state::results_phase(void)
+uint8_t bfcobra_state::results_phase(void)
{
return 0;
}
@@ -1519,10 +1519,10 @@ INPUT_PORTS_END
void bfcobra_state::init_ram()
{
/* 768kB work RAM */
- m_work_ram = make_unique_clear<UINT8[]>(0xC0000);
+ m_work_ram = make_unique_clear<uint8_t[]>(0xC0000);
/* 128kB video RAM */
- m_video_ram = make_unique_clear<UINT8[]>(0x20000);
+ m_video_ram = make_unique_clear<uint8_t[]>(0x20000);
}
@@ -1563,22 +1563,22 @@ DRIVER_INIT_MEMBER(bfcobra_state,bfcobra)
6809 ROM address and data lines are scrambled.
This is the same scrambling as Scorpion 2.
*/
- static const UINT8 datalookup[] = { 1, 3, 5, 6, 4, 2, 0, 7 };
- static const UINT8 addrlookup[] = { 11, 12, 0, 2, 3, 5, 7, 9, 8, 6, 1, 4, 10, 13, 14 };
+ static const uint8_t datalookup[] = { 1, 3, 5, 6, 4, 2, 0, 7 };
+ static const uint8_t addrlookup[] = { 11, 12, 0, 2, 3, 5, 7, 9, 8, 6, 1, 4, 10, 13, 14 };
- UINT32 i;
- UINT8 *rom;
+ uint32_t i;
+ uint8_t *rom;
- std::vector<UINT8> tmp(0x8000);
+ std::vector<uint8_t> tmp(0x8000);
rom = memregion("audiocpu")->base() + 0x8000;
memcpy(&tmp[0], rom, 0x8000);
for (i = 0; i < 0x8000; i++)
{
- UINT16 addr = 0;
- UINT8 x;
- UINT8 data = 0;
- UINT8 val = tmp[i];
+ uint16_t addr = 0;
+ uint8_t x;
+ uint8_t data = 0;
+ uint8_t val = tmp[i];
for (x = 0; x < 8; x ++)
data |= ((val >> x) & 1) << datalookup[x];