Skip to content

Commit 2b2cc71

Browse files
committed
update; fix pecom32/64.
# Conflicts: # docs/source/initialsetup/compilingmame.rst
2 parents 94259ef + 59ddfd7 commit 2b2cc71

16 files changed

Lines changed: 167 additions & 92 deletions

File tree

.github/workflows/ci-windows.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,17 @@ jobs:
2929
include:
3030
- compiler: gcc-x64
3131
os: windows-latest
32-
msys: MINGW64
33-
slug: mingw-w64-x86_64
32+
msys: UCRT64
33+
slug: mingw-w64-ucrt-x86_64
3434
cc: gcc
3535
cxx: g++
3636
subtarget: mame
3737
executable: mame
3838
- compiler: clang-x64
3939
os: windows-latest
40-
msys: MINGW64
41-
slug: mingw-w64-x86_64
40+
msys: CLANG64
41+
slug: mingw-w64-clang-x86_64
42+
extrapkg: mingw-w64-clang-x86_64-gcc-compat
4243
cc: clang
4344
cxx: clang++
4445
subtarget: tiny

makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ ifeq ($(MSYSTEM),MINGW32)
150150
PLATFORM := x86
151151
else ifeq ($(MSYSTEM),MINGW64)
152152
PLATFORM := x86
153+
else ifeq ($(MSYSTEM),UCRT64)
154+
PLATFORM := x86
153155
else ifeq ($(MSYSTEM),CLANG64)
154156
PLATFORM := x86
155157
else ifeq ($(MSYSTEM),CLANGARM64)
@@ -243,6 +245,8 @@ ifeq ($(MSYSTEM),MINGW32)
243245
MINGW32 := $(MINGW_PREFIX)
244246
else ifeq ($(MSYSTEM),MINGW64)
245247
MINGW64 := $(MINGW_PREFIX)
248+
else ifeq ($(MSYSTEM),UCRT64)
249+
MINGW64 := $(MINGW_PREFIX)
246250
else ifeq ($(MSYSTEM),CLANG64)
247251
MINGW64 := $(MINGW_PREFIX)
248252
else ifeq ($(MSYSTEM),CLANGARM64)
@@ -316,6 +320,8 @@ ifeq ($(MSYSTEM),MINGW32)
316320
ARCHITECTURE = _x86
317321
else ifeq ($(MSYSTEM),MINGW64)
318322
ARCHITECTURE := _x64
323+
else ifeq ($(MSYSTEM),UCRT64)
324+
ARCHITECTURE := _x64
319325
else ifeq ($(MSYSTEM),CLANG64)
320326
ARCHITECTURE := _x64
321327
else ifeq ($(MSYSTEM),CLANGARM64)

scripts/src/3rdparty.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@ if _OPTIONS["gcc"]~=nil then
101101
}
102102
end
103103
end
104+
if _OPTIONS["targetos"]=="windows" then
105+
buildoptions_c {
106+
"-Wno-error=format", -- GCC with UCRT produces warnings for the non-standard I64 size modifier
107+
"-Wno-error=format-extra-args",
108+
}
109+
end
104110

105111
configuration { }
106112

src/devices/bus/rs232/nss_tvinterface.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,15 +171,14 @@ u8 nss_tvinterface_device::p2_r()
171171
void nss_tvinterface_device::p2_w(u8 data)
172172
{
173173
// P24: serial out (blocked by default)
174-
if (m_conf->read() & 1)
175-
output_rxd(BIT(data, 4));
174+
output_rxd(BIT(data, 4) | BIT(m_conf->read(), 0));
176175
}
177176

178177
void nss_tvinterface_device::main_map(address_map &map)
179178
{
180179
map(0x8000, 0x87ff).ram().share(m_vram);
181180

182-
map(0xa3bd, 0xa3bd).portr("IN");
181+
map(0xa3bd, 0xa3bd).portr("IN"); // actually through TM6310
183182
map(0xa3be, 0xa3be).w(FUNC(nss_tvinterface_device::unknown_w));
184183

185184
map(0xa3d0, 0xa3d0).mirror(0x0006).w(m_crtc, FUNC(mc6845_device::address_w));
@@ -207,9 +206,9 @@ static INPUT_PORTS_START( nss_tvinterface )
207206
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Change")
208207

209208
PORT_START("CONF")
210-
PORT_CONFNAME( 0x01, 0x00, "Serial TxD" )
211-
PORT_CONFSETTING( 0x00, DEF_STR( Off ) )
212-
PORT_CONFSETTING( 0x01, DEF_STR( On ) )
209+
PORT_CONFNAME( 0x01, 0x01, "Serial TxD" )
210+
PORT_CONFSETTING( 0x01, DEF_STR( Off ) )
211+
PORT_CONFSETTING( 0x00, DEF_STR( On ) )
213212
INPUT_PORTS_END
214213

215214
ioport_constructor nss_tvinterface_device::device_input_ports() const

src/mame/capcom/bionicc.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@
4444
Timings verified at SYNC pin and BLUE pin (jamma edge),
4545
using an Agilent DSO9404A scope and two N2873A 500MHz probes.
4646
47-
MAME is using jotego's timing instead (262*384).
47+
The above claims result in 6MHz/(386*260) = ~59.78Hz, not 60.024Hz. MAME
48+
is using 384*260 instead like tigeroad, which nearly matches an older
49+
Bionic Commando measurement of H=15.625kHz, V=60.093Hz.
4850
4951
BTANB [MT00209] (verified on real PCB):
5052
- misplaced sprites (see beginning of level 1 or 2 for example)
@@ -78,7 +80,6 @@
7880
to 128 currently to compensate.
7981
- The game doesn't set the coin lockout in service mode, so the coin inputs
8082
can't be tested there if you uncomment and enable it.
81-
- Reverify video timing.
8283
8384
***************************************************************************/
8485

@@ -516,7 +517,7 @@ u8 bionicc_state::mcu_dma_r(offs_t offset)
516517
{
517518
u8 data = 0xff;
518519

519-
if (BIT(m_mcu_p3, 5) == 0)
520+
if (!BIT(m_mcu_p3, 5))
520521
{
521522
// various address bits are pulled high because the mcu doesn't drive them
522523
// the 3 upper address bits (p2.0, p2.1, p2.2) are connected to a14 to a16
@@ -529,7 +530,7 @@ u8 bionicc_state::mcu_dma_r(offs_t offset)
529530

530531
void bionicc_state::mcu_dma_w(offs_t offset, u8 data)
531532
{
532-
if (BIT(m_mcu_p3, 5) == 0)
533+
if (!BIT(m_mcu_p3, 5))
533534
{
534535
offs_t address = 0xe3e01 | ((offset & 0x700) << 6) | ((offset & 0xff) << 1);
535536
m_maincpu->space(AS_PROGRAM).write_byte(address, data);
@@ -547,16 +548,16 @@ void bionicc_state::mcu_p3_w(u8 data)
547548
// ------1- int0 flip-flop preset
548549
// -------0 int0 ack
549550

550-
if (BIT(m_mcu_p3, 0) == 1 && BIT(data, 0) == 0)
551+
if (BIT(m_mcu_p3, 0) && !BIT(data, 0))
551552
{
552553
m_mcu->set_input_line(MCS51_INT0_LINE, CLEAR_LINE);
553554
m_maincpu->resume(SUSPEND_REASON_HALT);
554555
}
555556

556-
if (BIT(m_mcu_p3, 4) == 1 && BIT(data, 4) == 0)
557+
if (BIT(m_mcu_p3, 4) && !BIT(data, 4))
557558
m_mcu->set_input_line(MCS51_INT1_LINE, CLEAR_LINE);
558559

559-
if (BIT(m_mcu_p3, 6) == 1 && BIT(data, 6) == 0)
560+
if (BIT(m_mcu_p3, 6) && !BIT(data, 6))
560561
m_mcu_to_audiocpu = m_mcu_p1;
561562

562563
m_mcu_p3 = data;
@@ -656,7 +657,7 @@ void bionicc_state::bionicc(machine_config &config)
656657

657658
// video hardware
658659
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
659-
m_screen->set_raw(24_MHz_XTAL / 4, 384, 0, 256, 262, 16, 240); // hsync is 306..333 (offset by 128), vsync is 251..253 (offset by 6)
660+
m_screen->set_raw(24_MHz_XTAL / 4, 384, 0, 256, 260, 16, 240);
660661
m_screen->set_screen_update(FUNC(bionicc_state::screen_update));
661662
m_screen->set_palette(m_palette);
662663

src/mame/capcom/tigeroad.cpp

Lines changed: 44 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,22 @@ F1 Dream (C) 1988 Capcom
77
88
cloned hardware:
99
Pushman (C) 1990 Comad
10-
Bouncing Balls (c) 1991 Comad
10+
Bouncing Balls (C) 1991 Comad
1111
1212
Please contact Phil Stroffolino (phil@maya.com) if there are any questions
1313
regarding this driver.
1414
15+
Video timing: measured 60.08Hz on Tiger Road, and 60.096Hz with 260 scanlines
16+
on F1 Dream. Pixel clock is 6MHz like other Capcom games.
17+
1518
TODO:
16-
- F1 Dream throws an address error if player wins all the races (i.e. when the
17-
game is supposed to give an ending):
19+
- F1 Dream throws an address error if player wins all the races in the highest
20+
tier (when the game is supposed to show the ranking and highscore table):
1821
010C68: 102E 001C move.b ($1c,A6), D0 ; reads 0xf from work RAM (misaligned)
1922
010C6C: 207B 000E movea.l ($e,PC,D0.w), A0 ; table from 0x10c7c onward
2023
010C70: 4E90 jsr (A0) ; throws address error here
21-
None of the available 5 vectors seems to fit here, btanb?
24+
None of the available 5 vectors seems to fit here.
25+
- what's up with the OBJ RAM test going up to 0xfe1807? address mirror?
2226
2327
BTANB:
2428
- race track fg tiles have priority over minimap in f1dream
@@ -32,7 +36,7 @@ Memory Overview:
3236
0xfe4002 protection (F1 Dream only)
3337
0xfe8000 scroll registers
3438
0xff8200 palette
35-
0xffC000 working RAM
39+
0xffc000 working RAM
3640
3741
**************************************************************************
3842
@@ -71,36 +75,41 @@ void tigeroad_state::msm5205_w(u8 data)
7175
m_msm->data_w(data & 0xf);
7276
}
7377

74-
void f1dream_state::out3_w(u8 data)
78+
79+
// F1 Dream protection
80+
81+
u8 f1dream_state::mcu_shared_r(offs_t offset)
82+
{
83+
if (!BIT(m_mcu_p3, 5))
84+
return m_maincpu->space(AS_PROGRAM).read_byte(0xffffe0 | offset << 1 | 1);
85+
else
86+
return 0xff;
87+
}
88+
89+
void f1dream_state::mcu_shared_w(offs_t offset, u8 data)
90+
{
91+
if (!BIT(m_mcu_p3, 5))
92+
m_maincpu->space(AS_PROGRAM).write_byte(0xffffe0 | offset << 1 | 1, data);
93+
}
94+
95+
void f1dream_state::mcu_out3_w(u8 data)
7596
{
76-
if ((m_old_p3 & 0x20) != (data & 0x20))
77-
{
78-
// toggles at the start and end of interrupt
79-
}
80-
81-
if ((m_old_p3 & 0x01) != (data & 0x01))
82-
{
83-
// toggles at the end of interrupt
84-
if (!(data & 0x01))
85-
{
86-
m_maincpu->resume(SUSPEND_REASON_HALT);
87-
}
88-
}
89-
90-
m_old_p3 = data;
97+
// toggles at the end of interrupt
98+
if (m_mcu_p3 & ~data & 1)
99+
m_maincpu->resume(SUSPEND_REASON_HALT);
100+
101+
m_mcu_p3 = data;
91102
}
92103

93104
void f1dream_state::to_mcu_w(u16 data)
94105
{
95106
m_mcu->set_input_line(MCS51_INT0_LINE, HOLD_LINE);
96107

97-
/* after triggering this address there are one or two NOPs in the 68k code, then it expects the response to be ready
98-
the MCU isn't that fast, so either the CPU is suspended on write, or when bit 0x20 of MCU Port 3 toggles in the
99-
MCU interrupt code, however no combination of increasing the clock / boosting interleave etc. allows the MCU code
100-
to get there in time before the 68k is already expecting a result */
108+
// after triggering this address there are one or two NOPs in the 68k code, then it expects the response to be ready
101109
m_maincpu->suspend(SUSPEND_REASON_HALT, true);
102110
}
103111

112+
104113
/***************************************************************************/
105114

106115
void tigeroad_state::main_map(address_map &map)
@@ -115,37 +124,25 @@ void tigeroad_state::main_map(address_map &map)
115124
map(0xfe4002, 0xfe4002).w("soundlatch", FUNC(generic_latch_8_device::write));
116125
map(0xfe4004, 0xfe4005).portr("DSW");
117126
map(0xfe8000, 0xfe8003).w(FUNC(tigeroad_state::scroll_w));
118-
map(0xfe800e, 0xfe800f).nopw(); // fe800e = watchdog or IRQ acknowledge
127+
map(0xfe800e, 0xfe800f).nopw(); // fe800e = watchdog or IRQ acknowledge or sprite DMA
119128
map(0xfec000, 0xfec7ff).ram().w(FUNC(tigeroad_state::videoram_w)).share("videoram");
120129

121130
map(0xff8000, 0xff87ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
122-
map(0xffc000, 0xffffff).ram().share("ram16");
123-
}
124-
125-
126-
u8 f1dream_state::mcu_shared_r(offs_t offset)
127-
{
128-
u8 ret = m_ram16[(0x3fe0 / 2) + offset];
129-
return ret;
130-
}
131-
132-
void f1dream_state::mcu_shared_w(offs_t offset, u8 data)
133-
{
134-
m_ram16[(0x3fe0 / 2) + offset] = (m_ram16[(0x3fe0 / 2) + offset] & 0xff00) | data;
131+
map(0xffc000, 0xffffff).ram();
135132
}
136133

137134
void f1dream_state::f1dream_map(address_map &map)
138135
{
139136
main_map(map);
140-
map(0xfe4002, 0xfe4003).portr("SYSTEM").w(FUNC(f1dream_state::to_mcu_w));
137+
map(0xfe4002, 0xfe4003).w(FUNC(f1dream_state::to_mcu_w));
141138
}
142139

143140
void f1dream_state::f1dream_mcu_data(address_map &map)
144141
{
142+
// never accesses under 0x7f0
145143
map(0x7f0, 0x7ff).rw(FUNC(f1dream_state::mcu_shared_r), FUNC(f1dream_state::mcu_shared_w));
146144
}
147145

148-
149146
void pushman_state::pushman_map(address_map &map)
150147
{
151148
main_map(map);
@@ -172,7 +169,7 @@ void pushman_state::bballs_map(address_map &map)
172169
map(0xec000, 0xec7ff).ram().w(FUNC(pushman_state::videoram_w)).share("videoram");
173170

174171
map(0xf8000, 0xf87ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
175-
map(0xfc000, 0xfffff).ram().share("ram16");
172+
map(0xfc000, 0xfffff).ram();
176173
}
177174

178175
// Capcom games ONLY
@@ -637,9 +634,8 @@ void tigeroad_state::tigeroad(machine_config &config)
637634
// video hardware
638635
BUFFERED_SPRITERAM16(config, "spriteram");
639636

640-
// Timings may be different, driver originally had 60.08Hz vblank.
641637
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
642-
screen.set_raw(24_MHz_XTAL / 4, 384, 0, 256, 262, 16, 240); // hsync is 306..333 (offset by 128), vsync is 251..253 (offset by 6)
638+
screen.set_raw(24_MHz_XTAL / 4, 384, 0, 256, 260, 16, 240);
643639
screen.set_screen_update(FUNC(tigeroad_state::screen_update));
644640
screen.screen_vblank().set("spriteram", FUNC(buffered_spriteram16_device::vblank_copy_rising));
645641
screen.set_palette(m_palette);
@@ -668,7 +664,7 @@ void tigeroad_state::tigeroad(machine_config &config)
668664

669665
void f1dream_state::machine_start()
670666
{
671-
save_item(NAME(m_old_p3));
667+
save_item(NAME(m_mcu_p3));
672668
}
673669

674670
void f1dream_state::f1dream(machine_config &config)
@@ -677,10 +673,10 @@ void f1dream_state::f1dream(machine_config &config)
677673

678674
m_maincpu->set_addrmap(AS_PROGRAM, &f1dream_state::f1dream_map);
679675

680-
I8751(config, m_mcu, 10_MHz_XTAL); // 8MHz rated chip, 10MHz or 6MHz(24/4)?
676+
I8751(config, m_mcu, 24_MHz_XTAL / 4); // 6MHz
681677
m_mcu->set_addrmap(AS_DATA, &f1dream_state::f1dream_mcu_data);
682678
m_mcu->port_out_cb<1>().set("soundlatch", FUNC(generic_latch_8_device::write));
683-
m_mcu->port_out_cb<3>().set(FUNC(f1dream_state::out3_w));
679+
m_mcu->port_out_cb<3>().set(FUNC(f1dream_state::mcu_out3_w));
684680
}
685681

686682
// same as above but with additional Z80 for samples playback
@@ -717,7 +713,7 @@ void tigeroad_state::f1dream_comad(machine_config &config) // COMAD-01 PCB with
717713
BUFFERED_SPRITERAM16(config, "spriteram");
718714

719715
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
720-
screen.set_raw(24_MHz_XTAL / 4, 384, 0, 256, 262, 16, 240); // hsync is 306..333 (offset by 128), vsync is 251..253 (offset by 6)
716+
screen.set_raw(24_MHz_XTAL / 4, 384, 0, 256, 260, 16, 240); // assume same as tigeroad
721717
screen.set_screen_update(FUNC(tigeroad_state::screen_update));
722718
screen.screen_vblank().set("spriteram", FUNC(buffered_spriteram16_device::vblank_copy_rising));
723719
screen.set_palette(m_palette);

src/mame/capcom/tigeroad.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,7 @@ class f1dream_state : public tigeroad_state
129129
f1dream_state(const machine_config &mconfig, device_type type, const char *tag)
130130
: tigeroad_state(mconfig, type, tag)
131131
, m_mcu(*this, "mcu")
132-
, m_ram16(*this, "ram16")
133-
, m_old_p3(0xff)
132+
, m_mcu_p3(0xff)
134133
{
135134
}
136135

@@ -143,14 +142,13 @@ class f1dream_state : public tigeroad_state
143142
void f1dream_map(address_map &map) ATTR_COLD;
144143
void f1dream_mcu_data(address_map &map) ATTR_COLD;
145144

146-
void out3_w(u8 data);
145+
void mcu_out3_w(u8 data);
147146

148147
u8 mcu_shared_r(offs_t offset);
149148
void mcu_shared_w(offs_t offset, u8 data);
150149

151150
void to_mcu_w(u16 data);
152151

153152
required_device<i8751_device> m_mcu;
154-
required_shared_ptr<u16> m_ram16;
155-
u8 m_old_p3;
153+
u8 m_mcu_p3;
156154
};

0 commit comments

Comments
 (0)