Cleaned up some recent changes a little.

This commit is contained in:
Vas Crabb 2023-11-20 04:45:19 +11:00
parent e4d59f2179
commit bfbc03c559
10 changed files with 44 additions and 55 deletions

View File

@ -100,8 +100,8 @@ uint8_t bbc_quinkey_intf_device::ch_r(int channel)
device_bbc_quinkey_interface::device_bbc_quinkey_interface(const machine_config &mconfig, device_t &device)
: device_interface(device, "bbcquinkey")
, m_slot(dynamic_cast<bbc_quinkey_slot_device *>(device.owner()))
{
m_slot = dynamic_cast<bbc_quinkey_slot_device *>(device.owner());
}

View File

@ -83,7 +83,7 @@ public:
protected:
device_bbc_quinkey_interface(const machine_config &mconfig, device_t &device);
bbc_quinkey_slot_device *m_slot;
bbc_quinkey_slot_device *const m_slot;
};

View File

@ -278,7 +278,7 @@ protected:
float maxwidth(origwidth);
for (Iter it = begin; it != end; ++it)
{
std::string_view const line(*it);
std::string_view const &line(*it);
if (!line.empty())
{
text_layout layout(*ui().get_font(), text_size * m_last_aspect, text_size, 1.0, justify, wrap);

View File

@ -179,7 +179,7 @@ int jvc_format::identify(util::random_read &io, uint32_t form_factor, const std:
{
int header_size, tracks, heads, sectors, sector_size, sector_base_id;
if (parse_header(io, header_size, tracks, heads, sectors, sector_size, sector_base_id))
return header_size ? FIFID_STRUCT | FIFID_SIZE : FIFID_SIZE;
return header_size ? (FIFID_STRUCT | FIFID_SIZE) : FIFID_SIZE;
else
return 0;
}

View File

@ -203,7 +203,6 @@ private:
void scrollx_lo_w(uint8_t data);
void scrollx_hi_w(uint8_t data);
void flip_screen_w(uint8_t data);
template <unsigned N> uint8_t videoram_r(offs_t offset);
void videoram_w(offs_t offset, uint8_t data);
void palette_init(palette_device &palette) const;
@ -263,9 +262,9 @@ uint32_t progolf_state::screen_update(screen_device &screen, bitmap_rgb32 &bitma
int count = 0;
// TODO: rewrite using standard tilemap
for(int x = 0; x < 128; x++)
for (int x = 0; x < 128; x++)
{
for(int y = 0; y < 32; y++)
for (int y = 0; y < 32; y++)
{
int const tile = m_videoram[count];
@ -281,31 +280,28 @@ uint32_t progolf_state::screen_update(screen_device &screen, bitmap_rgb32 &bitma
// framebuffer is 8x8 chars arranged like a bitmap
{
const int pitch = 32;
for(int y = 0; y < 256; y+= 8)
for (int y = 0; y < 256; y+= 8)
{
for(int x = 0; x < 256; x+= 8)
for (int x = 0; x < 256; x+= 8)
{
u32 fb_offset = ((y >> 3) + (x >> 3) * pitch) << 3;
const u32 fb_offset = ((y >> 3) + (x >> 3) * pitch) << 3;
for (int xi = 0; xi < 8; xi ++)
{
for (int yi = 0; yi < 8; yi ++)
{
int res_x = 256 - x + xi;
int res_y = y + yi;
if(!cliprect.contains(res_x, res_y))
const int res_x = 256 - x + xi;
const int res_y = y + yi;
if (!cliprect.contains(res_x, res_y))
continue;
u8 pen = 0;
pen |= BIT(m_fbram[fb_offset + (yi | 0x0000)], 7 - xi) << 0;
pen |= BIT(m_fbram[fb_offset + (yi | 0x2000)], 7 - xi) << 1;
pen |= BIT(m_fbram[fb_offset + (yi | 0x4000)], 7 - xi) << 2;
pen &= 7;
const u8 pen =
(BIT(m_fbram[fb_offset + (yi | 0x0000)], 7 - xi) << 0) |
(BIT(m_fbram[fb_offset + (yi | 0x2000)], 7 - xi) << 1) |
(BIT(m_fbram[fb_offset + (yi | 0x4000)], 7 - xi) << 2);
if (!pen)
continue;
bitmap.pix(res_y, res_x) = m_palette->pen(pen);
if (pen)
bitmap.pix(res_y, res_x) = m_palette->pen(pen);
}
}
}
@ -379,11 +375,6 @@ void progolf_state::flip_screen_w(uint8_t data)
logerror("$9600: with data = %02x used\n",data);
}
template <unsigned N> uint8_t progolf_state::videoram_r(offs_t offset)
{
return m_videoram[offset | (0x800 * N)];
}
void progolf_state::videoram_w(offs_t offset, uint8_t data)
{
m_videoram[offset] = data;
@ -393,14 +384,14 @@ void progolf_state::main_map(address_map &map)
{
map(0x0000, 0x5fff).ram();
map(0x6000, 0x7fff).rw(FUNC(progolf_state::charram_r), FUNC(progolf_state::charram_w));
map(0x8000, 0x8fff).w(FUNC(progolf_state::videoram_w)).share("videoram");
map(0x8000, 0x8fff).ram().w(FUNC(progolf_state::videoram_w)).share("videoram");
map(0x8000, 0x87ff).view(m_video_view0);
m_video_view0[0](0x8000, 0x87ff).r(FUNC(progolf_state::videoram_r<0>));
m_video_view0[0]; // falls through to RAM read
m_video_view0[1](0x8000, 0x87ff).rom().region("gfx1", 0x0000);
m_video_view0[2](0x8000, 0x87ff).rom().region("gfx1", 0x1000);
m_video_view0[3](0x8000, 0x87ff).rom().region("gfx1", 0x2000);
map(0x8800, 0x8fff).view(m_video_view1);
m_video_view1[0](0x8800, 0x8fff).r(FUNC(progolf_state::videoram_r<1>));
m_video_view1[0]; // falls through to RAM read
m_video_view1[1](0x8800, 0x8fff).rom().region("gfx1", 0x0800);
m_video_view1[2](0x8800, 0x8fff).rom().region("gfx1", 0x1800);
m_video_view1[3](0x8800, 0x8fff).rom().region("gfx1", 0x2800);

View File

@ -365,33 +365,29 @@ this is the data written to internal ram on startup:
void thunderx_state::run_collisions( int s0, int e0, int s1, int e1, int cm, int hm )
{
for (uint8_t* p0 = &m_pmcram[s0]; p0 < &m_pmcram[e0]; p0 += 5)
for (uint8_t *p0 = &m_pmcram[s0]; p0 < &m_pmcram[e0]; p0 += 5)
{
int l0, r0, b0, t0;
// check valid
if (!(p0[0] & cm))
continue;
// get area
l0 = p0[3] - p0[1];
r0 = p0[3] + p0[1];
t0 = p0[4] - p0[2];
b0 = p0[4] + p0[2];
const int l0 = p0[3] - p0[1];
const int r0 = p0[3] + p0[1];
const int t0 = p0[4] - p0[2];
const int b0 = p0[4] + p0[2];
for (uint8_t* p1 = &m_pmcram[s1]; p1 < &m_pmcram[e1]; p1 += 5)
for (uint8_t *p1 = &m_pmcram[s1]; p1 < &m_pmcram[e1]; p1 += 5)
{
int l1,r1,b1,t1;
// check valid
if (!(p1[0] & hm))
continue;
// get area
l1 = p1[3] - p1[1];
r1 = p1[3] + p1[1];
t1 = p1[4] - p1[2];
b1 = p1[4] + p1[2];
const int l1 = p1[3] - p1[1];
const int r1 = p1[3] + p1[1];
const int t1 = p1[4] - p1[2];
const int b1 = p1[4] + p1[2];
// overlap check
if (l1 >= r0) continue;
@ -412,8 +408,6 @@ void thunderx_state::run_collisions( int s0, int e0, int s1, int e1, int cm, int
void thunderx_state::calculate_collisions()
{
int s0, s1;
// the data at 0x00 to 0x06 defines the operation
//
// 0x00 : word : last byte of set 0
@ -433,14 +427,14 @@ void thunderx_state::calculate_collisions()
// hit mask is 40 to set bit on object 0 and object 1
// hit mask is 20 to set bit on object 1 only
const int e0 = (m_pmcram[0]<<8) | m_pmcram[1];
const int e0 = (m_pmcram[0] << 8) | m_pmcram[1];
const int e1 = m_pmcram[2];
int s0, s1;
if (m_pmcram[5] < 16)
{
// US Thunder Cross uses this form
s0 = m_pmcram[5];
s0 = (s0 << 8) + m_pmcram[6];
s0 = (m_pmcram[5] << 8) + m_pmcram[6];
s1 = m_pmcram[7];
}
else

View File

@ -417,15 +417,15 @@ INPUT_PORTS_END
// 0 -> 1 clocks NMI, 1 -> 0 pushes data to the ADPCM if available from the bus.
void suprgolf_state::adpcm_int(int state)
{
if (!state && m_adpcm_available_data)
if(!state && m_adpcm_available_data)
{
m_msm->data_w(m_adpcm_data >> 4);
m_adpcm_data <<= 4;
m_adpcm_available_data --;
m_adpcm_available_data--;
return;
}
if (state && m_adpcm_available_data == 0 && m_adpcm_nmi_enable)
if(state && m_adpcm_available_data == 0 && m_adpcm_nmi_enable)
m_maincpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero);
}

View File

@ -23,6 +23,8 @@ TODO:
#include "bus/pc_kbd/pc_kbdc.h"
#include "softlist_dev.h"
namespace {
class teradrive_state : public driver_device
{
public:
@ -143,5 +145,7 @@ ROM_START( teradrive )
ROM_LOAD( "tera_tmss.bin", 0x0000, 0x1000, CRC(424a9d11) SHA1(1c470a9a8d0b211c5feea1c1c2376aa1f7934b16) )
ROM_END
} // anonymous namespace
COMP( 1991, teradrive, 0, 0, teradrive, 0, teradrive_state, empty_init, "Sega / International Business Machines", "TeraDrive (Japan)", MACHINE_NOT_WORKING )

View File

@ -196,8 +196,8 @@ void fwheel_state::fwheel(machine_config &config)
SPEAKER(config, "mono").front_center();
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
m_screen->set_raw(XTAL(10'738'000) / 2, \
sega315_5124_device::WIDTH , sega315_5124_device::LBORDER_START + sega315_5124_device::LBORDER_WIDTH - 2, sega315_5124_device::LBORDER_START + sega315_5124_device::LBORDER_WIDTH + 256 + 10, \
m_screen->set_raw(XTAL(10'738'000) / 2,
sega315_5124_device::WIDTH , sega315_5124_device::LBORDER_START + sega315_5124_device::LBORDER_WIDTH - 2, sega315_5124_device::LBORDER_START + sega315_5124_device::LBORDER_WIDTH + 256 + 10,
sega315_5124_device::HEIGHT_NTSC, sega315_5124_device::TBORDER_START + sega315_5124_device::NTSC_224_TBORDER_HEIGHT, sega315_5124_device::TBORDER_START + sega315_5124_device::NTSC_224_TBORDER_HEIGHT + 224);
m_screen->set_refresh_hz(XTAL(10'738'000) / 2 / (sega315_5124_device::WIDTH * sega315_5124_device::HEIGHT_NTSC));
m_screen->set_screen_update(m_vdp, FUNC(sega315_5246_device::screen_update));

View File

@ -14,9 +14,9 @@
#pragma once
#include "video/mc6847.h"
#include "machine/6883sam.h"
#include "machine/ram.h"
#include "video/mc6847.h"
//**************************************************************************