Skip to content

Commit d246968

Browse files
committed
Cleaned up some recent commits.
1 parent 270c318 commit d246968

File tree

5 files changed

+80
-75
lines changed

5 files changed

+80
-75
lines changed

src/lib/formats/h8_cas.cpp

+25-22
Original file line numberDiff line numberDiff line change
@@ -20,59 +20,62 @@ We output a leader, followed by the contents of the H8T file.
2020

2121
namespace {
2222

23-
static constexpr double ONE_FREQ = 1200.0;
24-
static constexpr double ONE_FREQ_VARIANCE = 300.0;
25-
static constexpr double ZERO_FREQ = 2400.0;
26-
static constexpr double ZERO_FREQ_VARIANCE = 600.0;
23+
constexpr double ONE_FREQ = 1200.0;
24+
constexpr double ONE_FREQ_VARIANCE = 300.0;
25+
constexpr double ZERO_FREQ = 2400.0;
26+
constexpr double ZERO_FREQ_VARIANCE = 600.0;
2727

28-
static const cassette_image::Modulation heath_h8t_modulation =
28+
const cassette_image::Modulation heath_h8t_modulation =
2929
{
3030
cassette_image::MODULATION_SINEWAVE,
3131
ONE_FREQ - ONE_FREQ_VARIANCE, ONE_FREQ, ONE_FREQ + ONE_FREQ_VARIANCE,
3232
ZERO_FREQ - ZERO_FREQ_VARIANCE, ZERO_FREQ, ZERO_FREQ + ZERO_FREQ_VARIANCE
3333
};
3434

35-
static cassette_image::error heath_h8t_identify(cassette_image *cassette, cassette_image::Options *opts)
35+
cassette_image::error heath_h8t_identify(cassette_image *cassette, cassette_image::Options *opts)
3636
{
3737
return cassette->modulation_identify(heath_h8t_modulation, opts);
3838
}
3939

4040

41-
#define MODULATE(_value) \
42-
for (int i = 0; i < (_value ? 8 : 4); i++) { \
43-
err = cassette->put_modulated_data_bit(0, time_index, _value, heath_h8t_modulation, &time_displacement); \
44-
if (err != cassette_image::error::SUCCESS) return err; \
45-
time_index += time_displacement; \
46-
}
47-
48-
static cassette_image::error heath_h8t_load(cassette_image *cassette)
41+
cassette_image::error heath_h8t_load(cassette_image *cassette)
4942
{
5043
cassette_image::error err = cassette_image::error::SUCCESS;
5144
uint64_t image_size = cassette->image_size();
5245
double time_index = 0.0;
5346
double time_displacement;
5447

48+
auto const MODULATE =
49+
[&cassette, &err, &time_index, &time_displacement] (unsigned value)
50+
{
51+
for (int i = 0; (i < (value ? 8 : 4)); i++)
52+
{
53+
err = cassette->put_modulated_data_bit(0, time_index, value, heath_h8t_modulation, &time_displacement);
54+
if (cassette_image::error::SUCCESS == err)
55+
time_index += time_displacement;
56+
else
57+
return;
58+
}
59+
};
60+
5561
// leader - 1 second
56-
while (time_index < 1.0)
57-
{
62+
while ((cassette_image::error::SUCCESS == err) && (time_index < 1.0))
5863
MODULATE(1);
59-
}
6064

61-
for (uint64_t image_pos = 0; image_pos < image_size; image_pos++)
65+
for (uint64_t image_pos = 0; (cassette_image::error::SUCCESS == err) && (image_pos < image_size); image_pos++)
6266
{
6367
uint8_t data = cassette->image_read_byte(image_pos);
6468

6569
// start bit
6670
MODULATE(0);
6771

6872
// data bits
69-
for (int bit = 0; bit < 8; bit++)
70-
{
73+
for (int bit = 0; (cassette_image::error::SUCCESS == err) && (bit < 8); bit++)
7174
MODULATE(util::BIT(data, bit));
72-
}
7375

7476
// stop bit
75-
MODULATE(1);
77+
if (cassette_image::error::SUCCESS == err)
78+
MODULATE(1);
7679
}
7780

7881
return err;

src/mame/intel/intellec8.cpp

+40-37
Original file line numberDiff line numberDiff line change
@@ -78,47 +78,50 @@ ROM_START( intlc8 )
7878
ROM_LOAD( "miss7.bin", 0x0700, 0x0100, NO_DUMP )
7979
ROM_END
8080

81-
ROM_START( intlc8m80a )
82-
ROM_REGION( 0x2000, "maincpu", ROMREGION_ERASEFF )
83-
ROM_LOAD( "3000_1702a.chip_0", 0x0000, 0x0100, CRC(a72cdab9) SHA1(c9931f1b55558383054a02b40fa716e9658ce3c4) )
84-
ROM_LOAD( "3100h_1702a.chip_1", 0x0100, 0x0100, CRC(62fbc181) SHA1(e704b5b198e43ff0b9c57067e375070a7674f3dd) )
85-
ROM_LOAD( "3200_1702a.chip_2", 0x0200, 0x0100, CRC(65215a39) SHA1(aaaae0f226a0d0f4eeac51e836b1ea674eb0f996) )
86-
// Empty sockets from CHIP 3 to CHIP 4
87-
ROM_LOAD( "icon_2708-p_mon8_3800_1702a.chip_5", 0x0300, 0x0100, CRC(00445543) SHA1(63ab074ba8c43905e2a43761b5cc5e0618f6e403) )
88-
ROM_LOAD( "prog_3600_1702a.chip_6", 0x0400, 0x0100, CRC(61a99002) SHA1(2be84f3191d6de5e184a8c7a40312c663b4c1817) )
89-
ROM_LOAD( "1702a.chip_7", 0x0500, 0x0100, CRC(90d9a76b) SHA1(3d66bc7aa5caa2abb487dfe28ab989b373fe6703) )
90-
ROM_LOAD( "3800_mon8_1702a.chip_8", 0x0600, 0x0100, CRC(ee7a08dc) SHA1(f12a690d72f08ef333e65634e0e60aff40746b7a) )
91-
ROM_LOAD( "3900h_mon8_1702a.chip_9", 0x0700, 0x0100, CRC(d2795e4d) SHA1(f3ef8e197fcfaf6752da8cee6ee776b7a450cef2) )
92-
ROM_LOAD( "3a00h_mon8_1702a.chip_a", 0x0800, 0x0100, CRC(c92f98e3) SHA1(dcb4316c6f037666a2a4b88df7e18ca74e754dd0) )
93-
ROM_LOAD( "3b00h_mon8_1702a.chip_b", 0x0900, 0x0100, CRC(23083008) SHA1(57af12b20f160d5faa99ad2bda597f21e52078c9) )
94-
ROM_LOAD( "3c00h_mon8_1702a.chip_c", 0x0a00, 0x0100, CRC(32f5c81b) SHA1(2371c0e087486c8bcb909575f158fd5ac9209bc8) )
95-
ROM_LOAD( "3d00h_mon8_1702a.chip_d", 0x0b00, 0x0100, CRC(5307307a) SHA1(f38adac5e1a8bb015e23f13be5ab434394e6495f) )
96-
ROM_LOAD( "3e00h_mon8_1702a.chip_e", 0x0c00, 0x0100, NO_DUMP )
97-
ROM_LOAD( "3f00h_mon8_1702a.chip_f", 0x0d00, 0x0100, CRC(beca9bd7) SHA1(8162306bfbd94a373736b9e8e9f426af104d744e) )
98-
ROM_END
81+
// FIXME: these are for an 8080-based system and possibly don't belong here
82+
83+
ROM_START( intlc8m80 )
84+
ROM_DEFAULT_BIOS("884a")
85+
ROM_SYSTEM_BIOS(0, "880", "880")
86+
ROM_SYSTEM_BIOS(1, "884a", "884A")
9987

100-
ROM_START( intlc8m80b )
10188
ROM_REGION( 0x2000, "maincpu", ROMREGION_ERASEFF )
102-
ROM_LOAD( "1702a.chip_0", 0x0000, 0x0100, CRC(64a1aa3a) SHA1(7158e866eb222b1fbc1f573cdc748f5aedd6d0d4) )
103-
ROM_LOAD( "1702a.chip_1", 0x0100, 0x0100, CRC(4583b6c3) SHA1(f9073ecfe0c043756437af595aa87b7224bf370d) )
104-
ROM_LOAD( "1702a.chip_2", 0x0200, 0x0100, CRC(5a2951cc) SHA1(d9252365a330cd390ebe029517c83d9e579750a2) )
105-
ROM_LOAD( "1702a.chip_3", 0x0300, 0x0100, CRC(37b1b90b) SHA1(b88872d56d03efe6ebc550fc9608e55ca0cae3cd) )
106-
ROM_LOAD( "1702a.chip_4", 0x0400, 0x0100, CRC(dcbcc405) SHA1(1dc65e9c73416353e2650158183ff4ff33a9eb0e) )
89+
90+
ROMX_LOAD( "3000_1702a.chip_0", 0x0000, 0x0100, CRC(a72cdab9) SHA1(c9931f1b55558383054a02b40fa716e9658ce3c4), ROM_BIOS(0) )
91+
ROMX_LOAD( "3100h_1702a.chip_1", 0x0100, 0x0100, CRC(62fbc181) SHA1(e704b5b198e43ff0b9c57067e375070a7674f3dd), ROM_BIOS(0) )
92+
ROMX_LOAD( "3200_1702a.chip_2", 0x0200, 0x0100, CRC(65215a39) SHA1(aaaae0f226a0d0f4eeac51e836b1ea674eb0f996), ROM_BIOS(0) )
93+
// Empty sockets from CHIP 3 to CHIP 4
94+
ROMX_LOAD( "icon_2708-p_mon8_3800_1702a.chip_5", 0x0300, 0x0100, CRC(00445543) SHA1(63ab074ba8c43905e2a43761b5cc5e0618f6e403), ROM_BIOS(0) )
95+
ROMX_LOAD( "prog_3600_1702a.chip_6", 0x0400, 0x0100, CRC(61a99002) SHA1(2be84f3191d6de5e184a8c7a40312c663b4c1817), ROM_BIOS(0) )
96+
ROMX_LOAD( "1702a.chip_7", 0x0500, 0x0100, CRC(90d9a76b) SHA1(3d66bc7aa5caa2abb487dfe28ab989b373fe6703), ROM_BIOS(0) )
97+
ROMX_LOAD( "3800_mon8_1702a.chip_8", 0x0600, 0x0100, CRC(ee7a08dc) SHA1(f12a690d72f08ef333e65634e0e60aff40746b7a), ROM_BIOS(0) )
98+
ROMX_LOAD( "3900h_mon8_1702a.chip_9", 0x0700, 0x0100, CRC(d2795e4d) SHA1(f3ef8e197fcfaf6752da8cee6ee776b7a450cef2), ROM_BIOS(0) )
99+
ROMX_LOAD( "3a00h_mon8_1702a.chip_a", 0x0800, 0x0100, CRC(c92f98e3) SHA1(dcb4316c6f037666a2a4b88df7e18ca74e754dd0), ROM_BIOS(0) )
100+
ROMX_LOAD( "3b00h_mon8_1702a.chip_b", 0x0900, 0x0100, CRC(23083008) SHA1(57af12b20f160d5faa99ad2bda597f21e52078c9), ROM_BIOS(0) )
101+
ROMX_LOAD( "3c00h_mon8_1702a.chip_c", 0x0a00, 0x0100, CRC(32f5c81b) SHA1(2371c0e087486c8bcb909575f158fd5ac9209bc8), ROM_BIOS(0) )
102+
ROMX_LOAD( "3d00h_mon8_1702a.chip_d", 0x0b00, 0x0100, CRC(5307307a) SHA1(f38adac5e1a8bb015e23f13be5ab434394e6495f), ROM_BIOS(0) )
103+
ROMX_LOAD( "3e00h_mon8_1702a.chip_e", 0x0c00, 0x0100, NO_DUMP, ROM_BIOS(0) )
104+
ROMX_LOAD( "3f00h_mon8_1702a.chip_f", 0x0d00, 0x0100, CRC(beca9bd7) SHA1(8162306bfbd94a373736b9e8e9f426af104d744e), ROM_BIOS(0) )
105+
106+
ROMX_LOAD( "1702a.chip_0", 0x0000, 0x0100, CRC(64a1aa3a) SHA1(7158e866eb222b1fbc1f573cdc748f5aedd6d0d4), ROM_BIOS(1) )
107+
ROMX_LOAD( "1702a.chip_1", 0x0100, 0x0100, CRC(4583b6c3) SHA1(f9073ecfe0c043756437af595aa87b7224bf370d), ROM_BIOS(1) )
108+
ROMX_LOAD( "1702a.chip_2", 0x0200, 0x0100, CRC(5a2951cc) SHA1(d9252365a330cd390ebe029517c83d9e579750a2), ROM_BIOS(1) )
109+
ROMX_LOAD( "1702a.chip_3", 0x0300, 0x0100, CRC(37b1b90b) SHA1(b88872d56d03efe6ebc550fc9608e55ca0cae3cd), ROM_BIOS(1) )
110+
ROMX_LOAD( "1702a.chip_4", 0x0400, 0x0100, CRC(dcbcc405) SHA1(1dc65e9c73416353e2650158183ff4ff33a9eb0e), ROM_BIOS(1) )
107111
// Empty sockets from CHIP 5 to CHIP 6
108-
ROM_LOAD( "3700_1702a.chip_7", 0x0500, 0x0100, CRC(cf5a0f6e) SHA1(13841fe28ac310f00d4c55ed07fee8be556ecc9b) )
109-
ROM_LOAD( "1702a.chip_8", 0x0600, 0x0100, CRC(fee2425f) SHA1(0210012153d9e294f46ab3653b4eb439125b6cfe) )
110-
ROM_LOAD( "3900_1702a.chip_9", 0x0700, 0x0100, CRC(d2795e4d) SHA1(f3ef8e197fcfaf6752da8cee6ee776b7a450cef2) )
111-
ROM_LOAD( "1702a.chip_a", 0x0800, 0x0100, CRC(c92f98e3) SHA1(dcb4316c6f037666a2a4b88df7e18ca74e754dd0) )
112-
ROM_LOAD( "1702a.chip_b", 0x0900, 0x0100, CRC(23083008) SHA1(57af12b20f160d5faa99ad2bda597f21e52078c9) )
113-
ROM_LOAD( "3c00_1702a.chip_c", 0x0a00, 0x0100, CRC(32f5c81b) SHA1(2371c0e087486c8bcb909575f158fd5ac9209bc8) )
114-
ROM_LOAD( "1702a.chip_d", 0x0b00, 0x0100, CRC(5307307a) SHA1(f38adac5e1a8bb015e23f13be5ab434394e6495f) )
115-
ROM_LOAD( "3e00_1702a.chip_e", 0x0c00, 0x0100, CRC(a90bd1d4) SHA1(b85a4a3d6515aa4ae298a800192077716a060f85) )
116-
ROM_LOAD( "1702a.chip_f", 0x0d00, 0x0100, CRC(ae7c919b) SHA1(ab9e2f70ef19d969ce7238784118ae53a5c7ac85) )
112+
ROMX_LOAD( "3700_1702a.chip_7", 0x0500, 0x0100, CRC(cf5a0f6e) SHA1(13841fe28ac310f00d4c55ed07fee8be556ecc9b), ROM_BIOS(1) )
113+
ROMX_LOAD( "1702a.chip_8", 0x0600, 0x0100, CRC(fee2425f) SHA1(0210012153d9e294f46ab3653b4eb439125b6cfe), ROM_BIOS(1) )
114+
ROMX_LOAD( "3900_1702a.chip_9", 0x0700, 0x0100, CRC(d2795e4d) SHA1(f3ef8e197fcfaf6752da8cee6ee776b7a450cef2), ROM_BIOS(1) )
115+
ROMX_LOAD( "1702a.chip_a", 0x0800, 0x0100, CRC(c92f98e3) SHA1(dcb4316c6f037666a2a4b88df7e18ca74e754dd0), ROM_BIOS(1) )
116+
ROMX_LOAD( "1702a.chip_b", 0x0900, 0x0100, CRC(23083008) SHA1(57af12b20f160d5faa99ad2bda597f21e52078c9), ROM_BIOS(1) )
117+
ROMX_LOAD( "3c00_1702a.chip_c", 0x0a00, 0x0100, CRC(32f5c81b) SHA1(2371c0e087486c8bcb909575f158fd5ac9209bc8), ROM_BIOS(1) )
118+
ROMX_LOAD( "1702a.chip_d", 0x0b00, 0x0100, CRC(5307307a) SHA1(f38adac5e1a8bb015e23f13be5ab434394e6495f), ROM_BIOS(1) )
119+
ROMX_LOAD( "3e00_1702a.chip_e", 0x0c00, 0x0100, CRC(a90bd1d4) SHA1(b85a4a3d6515aa4ae298a800192077716a060f85), ROM_BIOS(1) )
120+
ROMX_LOAD( "1702a.chip_f", 0x0d00, 0x0100, CRC(ae7c919b) SHA1(ab9e2f70ef19d969ce7238784118ae53a5c7ac85), ROM_BIOS(1) )
117121
ROM_END
118122

119123
} // Anonymous namespace
120124

121-
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS
122-
COMP( 1973, intlc8, 0, 0, intlc8, intlc8, intlc8_state, empty_init, "Intel", "Intellec 8 MCS", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) // MOD8 or MOD80?
123-
COMP( 1974, intlc8m80a, 0, 0, intlc8, intlc8, intlc8_state, empty_init, "Intel", "Intellec 8 MCS MOD80 (set 1, 884A)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING )
124-
COMP( 1974, intlc8m80b, intlc8m80a, 0, intlc8, intlc8, intlc8_state, empty_init, "Intel", "Intellec 8 MCS MOD80 (set 2, 880)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING )
125+
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS
126+
COMP( 1973, intlc8, 0, 0, intlc8, intlc8, intlc8_state, empty_init, "Intel", "intellec 8", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) // MOD8 or MOD80?
127+
COMP( 1974, intlc8m80, 0, 0, intlc8, intlc8, intlc8_state, empty_init, "Intel", "intellec 8/Mod 80", MACHINE_NO_SOUND | MACHINE_NOT_WORKING )

src/mame/konami/k001005.cpp

+11-11
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ k001005_renderer::k001005_renderer(device_t &parent, screen_device &screen, devi
2828
int const width = 512;
2929
int const height = 384;
3030

31-
m_fb[0] = std::make_unique<bitmap_rgb32>(width, height);
32-
m_fb[1] = std::make_unique<bitmap_rgb32>(width, height);
31+
m_fb[0].allocate(width, height);
32+
m_fb[1].allocate(width, height);
3333

34-
m_zb = std::make_unique<bitmap_ind32>(width, height);
34+
m_zb.allocate(width, height);
3535

3636
m_3dfifo = std::make_unique<uint32_t []>(0x10000);
3737
m_3dfifo_ptr = 0;
@@ -75,9 +75,9 @@ k001005_renderer::k001005_renderer(device_t &parent, screen_device &screen, devi
7575
// save state
7676
parent.save_pointer(NAME(m_3dfifo), 0x10000);
7777
parent.save_item(NAME(m_3dfifo_ptr));
78-
parent.save_item(NAME(*m_fb[0]));
79-
parent.save_item(NAME(*m_fb[1]));
80-
parent.save_item(NAME(*m_zb));
78+
parent.save_item(NAME(m_fb[0]));
79+
parent.save_item(NAME(m_fb[1]));
80+
parent.save_item(NAME(m_zb));
8181
parent.save_item(NAME(m_fb_page));
8282
parent.save_item(NAME(m_light_r));
8383
parent.save_item(NAME(m_light_g));
@@ -122,10 +122,10 @@ void k001005_renderer::swap_buffers()
122122
{
123123
m_fb_page ^= 1;
124124

125-
m_fb[m_fb_page]->fill(0, m_cliprect);
125+
m_fb[m_fb_page].fill(0, m_cliprect);
126126

127127
float const zvalue = 10000000000.0F;
128-
m_zb->fill(*(int*)&zvalue, m_cliprect);
128+
m_zb.fill(*(int*)&zvalue, m_cliprect);
129129
}
130130

131131
bool k001005_renderer::fifo_filled()
@@ -139,8 +139,8 @@ void k001005_renderer::draw_scanline_generic(int32_t scanline, const extent_t& e
139139
{
140140
k001006_device* k001006 = downcast<k001006_device*>(m_k001006);
141141

142-
uint32_t *const fb = &m_fb[m_fb_page]->pix(scanline);
143-
float *const zb = (float*)&m_zb->pix(scanline);
142+
uint32_t *const fb = &m_fb[m_fb_page].pix(scanline);
143+
float *const zb = (float*)&m_zb.pix(scanline);
144144

145145
float z = extent.param[POLY_Z].start;
146146
float const dz = extent.param[POLY_Z].dpdx;
@@ -690,7 +690,7 @@ void k001005_renderer::draw(bitmap_rgb32 &bitmap, const rectangle &cliprect)
690690
for (int j = cliprect.min_y; j <= cliprect.max_y; j++)
691691
{
692692
uint32_t *const bmp = &bitmap.pix(j);
693-
uint32_t const *const src = &m_fb[m_fb_page ^ 1]->pix(j - cliprect.min_y);
693+
uint32_t const *const src = &m_fb[m_fb_page ^ 1].pix(j - cliprect.min_y);
694694

695695
for (int i = cliprect.min_x; i <= cliprect.max_x; i++)
696696
{

src/mame/konami/k001005.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ class k001005_renderer : public poly_manager<float, k001005_polydata, 10>
5959
static constexpr int POLY_A = 9;
6060

6161
private:
62-
std::unique_ptr<bitmap_rgb32> m_fb[2];
63-
std::unique_ptr<bitmap_ind32> m_zb;
62+
bitmap_rgb32 m_fb[2];
63+
bitmap_ind32 m_zb;
6464
rectangle m_cliprect;
6565
int m_fb_page;
6666

67-
std::unique_ptr<uint32_t[]> m_3dfifo;
67+
std::unique_ptr<uint32_t []> m_3dfifo;
6868
int m_3dfifo_ptr;
6969

7070
vertex_t m_vertexb[4];

src/mame/mame.lst

+1-2
Original file line numberDiff line numberDiff line change
@@ -21518,8 +21518,7 @@ intlc440 //
2151821518

2151921519
@source:intel/intellec8.cpp
2152021520
intlc8 //
21521-
intlc8m80a //
21522-
intlc8m80b //
21521+
intlc8m80 //
2152321522

2152421523
@source:intel/ipc.cpp
2152521524
ipb // intel

0 commit comments

Comments
 (0)