summaryrefslogtreecommitdiffstats
path: root/src/mame/drivers/mlanding.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/mlanding.cpp')
-rw-r--r--src/mame/drivers/mlanding.cpp136
1 files changed, 68 insertions, 68 deletions
diff --git a/src/mame/drivers/mlanding.cpp b/src/mame/drivers/mlanding.cpp
index f321c4c7939..febfef81e74 100644
--- a/src/mame/drivers/mlanding.cpp
+++ b/src/mame/drivers/mlanding.cpp
@@ -69,7 +69,7 @@ public:
TIMER_DMA_COMPLETE
};
- static const UINT32 c_dma_bank_words = 0x2000;
+ static const uint32_t c_dma_bank_words = 0x2000;
mlanding_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
@@ -101,26 +101,26 @@ public:
required_device<z80ctc_device> m_ctc;
required_memory_bank m_dma_bank;
- required_region_ptr<UINT8> m_msm1_rom;
- required_region_ptr<UINT8> m_msm2_rom;
+ required_region_ptr<uint8_t> m_msm1_rom;
+ required_region_ptr<uint8_t> m_msm2_rom;
- required_shared_ptr<UINT16> m_g_ram;
- required_shared_ptr<UINT16> m_cha_ram;
- required_shared_ptr<UINT16> m_dot_ram;
- required_shared_ptr<UINT8> m_power_ram;
+ required_shared_ptr<uint16_t> m_g_ram;
+ required_shared_ptr<uint16_t> m_cha_ram;
+ required_shared_ptr<uint16_t> m_dot_ram;
+ required_shared_ptr<uint8_t> m_power_ram;
required_device<palette_device> m_palette;
- std::unique_ptr<UINT16[]> m_dma_ram;
- UINT8 m_dma_cpu_bank;
- UINT8 m_dma_busy;
- UINT16 m_dsp_hold_signal;
+ std::unique_ptr<uint16_t[]> m_dma_ram;
+ uint8_t m_dma_cpu_bank;
+ uint8_t m_dma_busy;
+ uint16_t m_dsp_hold_signal;
- UINT32 m_msm_pos[2];
- UINT8 m_msm_reset[2];
- UINT8 m_msm_nibble[2];
- UINT8 m_msm2_vck;
- UINT8 m_msm2_vck2;
+ uint32_t m_msm_pos[2];
+ uint8_t m_msm_reset[2];
+ uint8_t m_msm_nibble[2];
+ uint8_t m_msm2_vck;
+ uint8_t m_msm2_vck2;
virtual void machine_start() override;
virtual void machine_reset() override;
@@ -153,8 +153,8 @@ public:
DECLARE_READ8_MEMBER(motor_r);
- UINT32 screen_update_mlanding(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- UINT32 exec_dma();
+ uint32_t screen_update_mlanding(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ uint32_t exec_dma();
void msm5205_update(int chip);
protected:
@@ -172,7 +172,7 @@ protected:
void mlanding_state::machine_start()
{
// Allocate two DMA RAM banks
- m_dma_ram = std::make_unique<UINT16[]>(c_dma_bank_words * 2);
+ m_dma_ram = std::make_unique<uint16_t[]>(c_dma_bank_words * 2);
m_dma_bank->configure_entries(0, 2, m_dma_ram.get(), c_dma_bank_words * 2);
// Register state for saving
@@ -215,16 +215,16 @@ void mlanding_state::machine_reset()
*
*************************************/
-UINT32 mlanding_state::screen_update_mlanding(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+uint32_t mlanding_state::screen_update_mlanding(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
const pen_t *pens = m_palette->pens();
- for (UINT32 y = cliprect.min_y; y <= cliprect.max_y; ++y)
+ for (uint32_t y = cliprect.min_y; y <= cliprect.max_y; ++y)
{
- UINT16 *src = &m_g_ram[(112 + y) * 512 + cliprect.min_x];
- UINT16 *dst = &bitmap.pix16(y, cliprect.min_x);
+ uint16_t *src = &m_g_ram[(112 + y) * 512 + cliprect.min_x];
+ uint16_t *dst = &bitmap.pix16(y, cliprect.min_x);
- for (UINT32 x = cliprect.min_x; x <= cliprect.max_x; ++x)
+ for (uint32_t x = cliprect.min_x; x <= cliprect.max_x; ++x)
{
*dst++ = pens[*src++ & 0x3fff];
}
@@ -246,7 +246,7 @@ WRITE16_MEMBER(mlanding_state::dma_start_w)
m_dma_cpu_bank ^= 1;
membank("dma_ram")->set_entry(m_dma_cpu_bank);
- UINT32 pixels = exec_dma();
+ uint32_t pixels = exec_dma();
if (pixels)
{
@@ -282,58 +282,58 @@ WRITE16_MEMBER(mlanding_state::dma_stop_w)
3 ........ ....xxxx Colour
*/
-UINT32 mlanding_state::exec_dma()
+uint32_t mlanding_state::exec_dma()
{
- UINT32 pixcnt = 0;
- UINT32 gram_mask = m_g_ram.bytes() - 1;
- UINT16 *dma_ram = &m_dma_ram[(m_dma_cpu_bank ^ 1) * c_dma_bank_words];
+ uint32_t pixcnt = 0;
+ uint32_t gram_mask = m_g_ram.bytes() - 1;
+ uint16_t *dma_ram = &m_dma_ram[(m_dma_cpu_bank ^ 1) * c_dma_bank_words];
// Process the entries in DMA RAM
- for (UINT32 offs = 0; offs < c_dma_bank_words; offs += 4)
+ for (uint32_t offs = 0; offs < c_dma_bank_words; offs += 4)
{
- UINT16 attr = dma_ram[offs];
+ uint16_t attr = dma_ram[offs];
if (attr == 0)
continue;
- UINT16 code = attr & 0x1fff;
+ uint16_t code = attr & 0x1fff;
- UINT16 xword = dma_ram[offs + 1];
- UINT16 yword = dma_ram[offs + 2];
+ uint16_t xword = dma_ram[offs + 1];
+ uint16_t yword = dma_ram[offs + 2];
- UINT16 x = xword & 0x1ff;
- UINT16 y = yword & 0x1ff;
- UINT16 sx = ((xword >> 11) & 0x1f) + 1;
- UINT16 sy = ((yword >> 11) & 0x1f) + 1;
+ uint16_t x = xword & 0x1ff;
+ uint16_t y = yword & 0x1ff;
+ uint16_t sx = ((xword >> 11) & 0x1f) + 1;
+ uint16_t sy = ((yword >> 11) & 0x1f) + 1;
- UINT8 colour = dma_ram[offs + 3] & 0xff;
+ uint8_t colour = dma_ram[offs + 3] & 0xff;
if ((attr & 0x2000) == 0)
{
// Normal draw mode
- UINT8 basepix = colour << 4;
+ uint8_t basepix = colour << 4;
- for (UINT32 j = 0; j < sx; ++j)
+ for (uint32_t j = 0; j < sx; ++j)
{
- for (UINT32 k = 0; k < sy; ++k)
+ for (uint32_t k = 0; k < sy; ++k)
{
// Draw an 8x8 tile
- for (UINT32 y1 = 0; y1 < 8; ++y1)
+ for (uint32_t y1 = 0; y1 < 8; ++y1)
{
- UINT16 *src = &m_cha_ram[(code * 2 * 8) + y1 * 2];
- UINT32 byteaddr = ((y + k * 8 + y1) * 512 + (j * 8 + x)) * 2;
+ uint16_t *src = &m_cha_ram[(code * 2 * 8) + y1 * 2];
+ uint32_t byteaddr = ((y + k * 8 + y1) * 512 + (j * 8 + x)) * 2;
- UINT8 *pixdata = reinterpret_cast<UINT8 *>(m_g_ram.target()) + BYTE_XOR_BE(1);
+ uint8_t *pixdata = reinterpret_cast<uint8_t *>(m_g_ram.target()) + BYTE_XOR_BE(1);
- UINT8 p2 = *src & 0xff;
- UINT8 p1 = *src++ >> 8;
- UINT8 p4 = *src;
- UINT8 p3 = *src++ >> 8;
+ uint8_t p2 = *src & 0xff;
+ uint8_t p1 = *src++ >> 8;
+ uint8_t p4 = *src;
+ uint8_t p3 = *src++ >> 8;
// Draw 8 pixels
- for (UINT32 x1 = 0; x1 < 8; ++x1)
+ for (uint32_t x1 = 0; x1 < 8; ++x1)
{
- UINT16 pix = (BIT(p4, x1) << 3) | (BIT(p3, x1) << 2) | (BIT(p2, x1) << 1) | BIT(p1, x1);
+ uint16_t pix = (BIT(p4, x1) << 3) | (BIT(p3, x1) << 2) | (BIT(p2, x1) << 1) | BIT(p1, x1);
if ((attr & 0x8000) == 0)
{
@@ -359,16 +359,16 @@ UINT32 mlanding_state::exec_dma()
else
{
// Set pixel or palette data
- for (UINT32 y1 = 0; y1 < sy * 8; ++y1)
+ for (uint32_t y1 = 0; y1 < sy * 8; ++y1)
{
- UINT32 byteaddr = (((y + y1) * 512) + x) * 2;
+ uint32_t byteaddr = (((y + y1) * 512) + x) * 2;
if ((attr & 0x4000) == 0)
{
// Clear pixel data
- UINT8 *pixdata = reinterpret_cast<UINT8 *>(m_g_ram.target()) + BYTE_XOR_BE(1);
+ uint8_t *pixdata = reinterpret_cast<uint8_t *>(m_g_ram.target()) + BYTE_XOR_BE(1);
- for (UINT32 x1 = 0; x1 < sx * 8; ++x1)
+ for (uint32_t x1 = 0; x1 < sx * 8; ++x1)
{
pixdata[byteaddr & gram_mask] = colour;
byteaddr += 2;
@@ -378,9 +378,9 @@ UINT32 mlanding_state::exec_dma()
else
{
// Clear palette data
- UINT8 *paldata = reinterpret_cast<UINT8 *>(m_g_ram.target()) + BYTE_XOR_BE(0);
+ uint8_t *paldata = reinterpret_cast<uint8_t *>(m_g_ram.target()) + BYTE_XOR_BE(0);
- for (UINT32 x1 = 0; x1 < sx * 8; ++x1)
+ for (uint32_t x1 = 0; x1 < sx * 8; ++x1)
{
paldata[byteaddr & gram_mask] = colour;
byteaddr += 2;
@@ -425,8 +425,8 @@ READ16_MEMBER(mlanding_state::input_r)
x....... ........ DMA busy
*/
- UINT8 dswa = ioport("DSWA")->read();
- UINT8 dswb = ioport("DSWB")->read() & 0x7f;
+ uint8_t dswa = ioport("DSWA")->read();
+ uint8_t dswb = ioport("DSWB")->read() & 0x7f;
return m_dma_busy << 15 | dswb << 8 | dswa;
}
@@ -483,10 +483,10 @@ READ16_MEMBER(mlanding_state::analog1_lsb_r)
..x..... Slot down
.x...... Slot up
*/
- UINT16 throttle = ioport("THROTTLE")->read();
- UINT16 x = ioport("STICK_X")->read();
+ uint16_t throttle = ioport("THROTTLE")->read();
+ uint16_t x = ioport("STICK_X")->read();
- UINT8 res = 0x70 | (throttle & 0x0f);
+ uint8_t res = 0x70 | (throttle & 0x0f);
if (throttle & 0x800)
res ^= 0x20;
@@ -519,10 +519,10 @@ READ16_MEMBER(mlanding_state::analog3_lsb_r)
..x..... Handle right
.x...... Handle down
*/
- UINT16 x = ioport("STICK_X")->read();
- UINT16 y = ioport("STICK_Y")->read();
+ uint16_t x = ioport("STICK_X")->read();
+ uint16_t y = ioport("STICK_Y")->read();
- UINT8 res = 0x70 | (y & 0x0f);
+ uint8_t res = 0x70 | (y & 0x0f);
if (y & 0x800)
res ^= 0x40;
@@ -576,8 +576,8 @@ void mlanding_state::msm5205_update(int chip)
if (m_msm_reset[chip])
return;
- const UINT8 *rom = chip ? m_msm2_rom : m_msm1_rom;
- UINT8 data = rom[m_msm_pos[chip]];
+ const uint8_t *rom = chip ? m_msm2_rom : m_msm1_rom;
+ uint8_t data = rom[m_msm_pos[chip]];
msm5205_device *msm = chip ? m_msm2 : m_msm1;
msm->data_w((m_msm_nibble[chip] ? data : data >> 4) & 0xf);