Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbbert committed Jul 20, 2024
2 parents 5a0f099 + 7ab573d commit daf42dc
Show file tree
Hide file tree
Showing 9 changed files with 198 additions and 15 deletions.
2 changes: 2 additions & 0 deletions scripts/src/bus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1424,6 +1424,8 @@ if (BUSES["FP1000"]~=null) then
files {
MAME_DIR .. "src/devices/bus/fp1000/fp1000_exp.cpp",
MAME_DIR .. "src/devices/bus/fp1000/fp1000_exp.h",
MAME_DIR .. "src/devices/bus/fp1000/fp1020fd.cpp",
MAME_DIR .. "src/devices/bus/fp1000/fp1020fd.h",
MAME_DIR .. "src/devices/bus/fp1000/fp1030_rampack.cpp",
MAME_DIR .. "src/devices/bus/fp1000/fp1030_rampack.h",
MAME_DIR .. "src/devices/bus/fp1000/fp1060io.cpp",
Expand Down
9 changes: 6 additions & 3 deletions src/devices/bus/fp1000/fp1000_exp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
#include "emu.h"
#include "fp1000_exp.h"

#define VERBOSE 1
//#define LOG_OUTPUT_FUNC osd_printf_info
#include "logmacro.h"

DEFINE_DEVICE_TYPE(FP1000_EXP_SLOT, fp1000_exp_slot_device, "fp1000_exp_slot", "FP-1000/FP-1100 Expansion Slot")

fp1000_exp_slot_device::fp1000_exp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
Expand Down Expand Up @@ -45,21 +49,20 @@ void device_fp1000_exp_interface::interface_pre_start()

void device_fp1000_exp_interface::interface_post_start()
{
// m_slot->install_io_device(*this, &device_fp1000_exp_interface::io_map);
m_slot->select_w(false);
}

void fp1000_exp_slot_device::remap_cb()
{
if (!m_main_enable || m_dev == nullptr)
{
logerror("%s: unmap\n", machine().describe_context());
LOG("%s: unmap\n", machine().describe_context());
m_iospace->unmap_readwrite(0x0000, 0xfeff);
m_iospace->unmap_readwrite(0xff00, 0xff7f);
}
else
{
logerror("%s: map\n", machine().describe_context());
LOG("%s: map\n", machine().describe_context());
m_iospace->install_readwrite_handler(0xff00, 0xff7f, read8sm_delegate(*m_dev, FUNC(device_fp1000_exp_interface::id_r)), write8sm_delegate(*this, FUNC(fp1000_exp_slot_device::main_cs_w)));
m_dev->remap_cb();
}
Expand Down
91 changes: 91 additions & 0 deletions src/devices/bus/fp1000/fp1020fd.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
// license:BSD-3-Clause
// copyright-holders:Angelo Salese

#include "emu.h"
#include "fp1020fd.h"

#define VERBOSE 1
//#define LOG_OUTPUT_FUNC osd_printf_info
#include "logmacro.h"

DEFINE_DEVICE_TYPE(FP1020FD, fp1020fd_device, "fp1020fd", "FP-1020FD FDCPACK")

fp1020fd_device::fp1020fd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: fp1060io_exp_device(mconfig, FP1020FD, tag, owner, clock)
, m_fdc(*this, "fdc")
, m_floppy(*this, "fdc:%u", 0)
{
}

void fp1020fd_device::io_map(address_map &map)
{
map(0x0000, 0x0000).mirror(0xfef9).unmapr().lw8(
NAME([this](offs_t offset, u8 data) {
(void)data;
for (auto floppy : m_floppy)
{
floppy_image_device *fl = floppy->get_device();
fl->mon_w(0);
}

m_motor_timer->adjust(attotime::from_seconds(60));
})
);
map(0x0002, 0x0002).mirror(0xfef9).unmapr().lw8(
NAME([this](offs_t offset, u8 data) {
(void)data;
m_fdc->tc_w(true);
m_fdc->tc_w(false);
})
);
map(0x0004, 0x0004).mirror(0xfef8).r(m_fdc, FUNC(upd765a_device::msr_r));
map(0x0005, 0x0005).mirror(0xfef8).rw(m_fdc, FUNC(upd765a_device::fifo_r), FUNC(upd765a_device::fifo_w));
map(0x0006, 0x0006).mirror(0xfef8).rw(m_fdc, FUNC(upd765a_device::dma_r), FUNC(upd765a_device::dma_w));
map(0x0007, 0x0007).mirror(0xfef8).unmaprw();
}



static void fd1020fd_floppies(device_slot_interface &device)
{
device.option_add("525dsdd", FLOPPY_525_DD);
}

void fp1020fd_device::intrq_w(int state)
{
LOG("intrq_w %d\n",state);
}

void fp1020fd_device::drq_w(int state)
{
LOG("drq_w %d\n",state);
}

void fp1020fd_device::device_add_mconfig(machine_config &config)
{
// UPD765AC
// TODO: verify clock and parameters
UPD765A(config, m_fdc, 8'000'000, true, true);
m_fdc->intrq_wr_callback().set(FUNC(fp1020fd_device::intrq_w));
m_fdc->drq_wr_callback().set(FUNC(fp1020fd_device::drq_w));
FLOPPY_CONNECTOR(config, "fdc:0", fd1020fd_floppies, "525dsdd", floppy_image_device::default_mfm_floppy_formats).enable_sound(true);
FLOPPY_CONNECTOR(config, "fdc:1", fd1020fd_floppies, "525dsdd", floppy_image_device::default_mfm_floppy_formats).enable_sound(true);
}

void fp1020fd_device::device_start()
{
m_motor_timer = timer_alloc(FUNC(fp1020fd_device::motor_timeout_cb), this);
}

void fp1020fd_device::device_reset()
{
}

TIMER_CALLBACK_MEMBER(fp1020fd_device::motor_timeout_cb)
{
for (auto floppy : m_floppy)
{
floppy_image_device *fl = floppy->get_device();
fl->mon_w(1);
}
}
43 changes: 43 additions & 0 deletions src/devices/bus/fp1000/fp1020fd.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// license:BSD-3-Clause
// copyright-holders:Angelo Salese

#ifndef MAME_BUS_FP1020FD_H
#define MAME_BUS_FP1020FD_H

#pragma once

#include "fp1060io_exp.h"
#include "imagedev/floppy.h"
#include "machine/timer.h"
#include "machine/upd765.h"

class fp1020fd_device : public fp1060io_exp_device
{
public:
fp1020fd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);

virtual void io_map(address_map &map) override;
virtual u8 get_id() override { return 0x04; };


protected:
virtual void device_start() override;
virtual void device_reset() override;

private:
virtual void device_add_mconfig(machine_config &config) override;

required_device<upd765a_device> m_fdc;
required_device_array<floppy_connector, 2> m_floppy;

TIMER_CALLBACK_MEMBER(motor_timeout_cb);
emu_timer *m_motor_timer;

void intrq_w(int state);
void drq_w(int state);
};

DECLARE_DEVICE_TYPE(FP1020FD, fp1020fd_device)


#endif // MAME_BUS_FP1020FD_H
2 changes: 2 additions & 0 deletions src/devices/bus/fp1000/fp1030_rampack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ FP-1030 RAMPACK
FILES"PACK<x>:" where <x> is the designated slot number 0-7
LOAD"PACKx:<filename>"
RUN
FORMAT"PACK<x>:" to use it in BASIC as a writable buffer
**************************************************************************************************/

Expand All @@ -23,6 +24,7 @@ fp1030_rampack_device::fp1030_rampack_device(const machine_config &mconfig, cons

void fp1030_rampack_device::io_map(address_map &map)
{
// TODO: verify mirror/unmap
map(0x0000, 0x3fff).lrw8(
NAME([this](offs_t offset) { return m_nvram_ptr[offset & 0x3fff]; }),
NAME([this](offs_t offset, uint8_t data) { m_nvram_ptr[offset & 0x3fff] = data; })
Expand Down
12 changes: 8 additions & 4 deletions src/devices/bus/fp1000/fp1060io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
#include "emu.h"
#include "fp1060io.h"

#define VERBOSE 1
//#define LOG_OUTPUT_FUNC osd_printf_info
#include "logmacro.h"

DEFINE_DEVICE_TYPE(FP1060IO, fp1060io_device, "fp1060io", "FP-1060I/O Expansion Box")

fp1060io_device::fp1060io_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
Expand Down Expand Up @@ -32,11 +36,11 @@ void fp1060io_device::device_reset()

u8 fp1060io_device::id_r(offs_t offset)
{
logerror("%s: ID select %02x\n", machine().describe_context(), m_slot_select);
LOG("ID select %02x\n", m_slot_select);
if (m_slot_select & 0xc)
return 0xff;
const auto dev = m_subslot[m_slot_select]->m_dev;
//logerror("\texists: %d\n", dev != nullptr);
//LOG("\texists: %d\n", dev != nullptr);

if (dev == nullptr)
return 0xff;
Expand All @@ -51,13 +55,13 @@ void fp1060io_device::cs_w(offs_t offset, u8 data)

void fp1060io_device::remap_cb()
{
logerror("%s: remap_cb %02x\n", machine().describe_context(), m_slot_select);
LOG("remap_cb %02x\n", m_slot_select);
if (m_slot_select & 0xc)
m_slot->iospace().unmap_readwrite(0x0000, 0xfeff);
else
{
const auto dev = m_subslot[m_slot_select]->m_dev;
//logerror("\texists %d\n", dev != nullptr);
//LOG("\texists %d\n", dev != nullptr);
if (dev == nullptr)
m_slot->iospace().unmap_readwrite(0x0000, 0xfeff);
else
Expand Down
5 changes: 3 additions & 2 deletions src/devices/bus/fp1000/fp1060io_exp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ void device_fp1060io_exp_interface::interface_pre_start()

void device_fp1060io_exp_interface::interface_post_start()
{
// m_slot->install_io_device(*this, &device_fp1000_exp_interface::io_map);
// m_slot->select_w(false);
// Dynamic mapping, shouldn't need anything from here
}

fp1060io_exp_device::fp1060io_exp_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
Expand All @@ -78,10 +77,12 @@ void fp1060io_exp_device::device_start()
}


#include "fp1020fd.h"
#include "fp1030_rampack.h"

void fp1060io_slot_devices(device_slot_interface &device)
{
device.option_add("fdcpack", FP1020FD);
device.option_add("rampack", FP1030_RAMPACK);
}

7 changes: 4 additions & 3 deletions src/mame/mame.lst
Original file line number Diff line number Diff line change
Expand Up @@ -40879,9 +40879,10 @@ cshooter // (c) 1987 JKH (bootleg)
failgate // (c) 1991 Seibu Kaihatsu

@source:seibu/banprestoms.cpp
marioun //
tvdenwad //
tvdenwam //
marioun // (c) 1993
tvdenwad // (c) 1991
tvdenwam // (c) 1992
tvdenwat // (c) 1992

@source:seibu/bloodbro.cpp
bloodbro // (c) 1990 Tad
Expand Down
42 changes: 39 additions & 3 deletions src/mame/seibu/banprestoms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Banpresto medal games with Seibu customs
Confirmed games (but there are probably several more):
Terebi Denwa Doraemon
Terebi Denwa Super Mario World
Terebi Denwa Thomas the Tank Engine and Friends
Mario Undoukai
The following is from Mario Undoukai PCB pics:
Expand Down Expand Up @@ -512,6 +513,40 @@ ROM_START( tvdenwam )
ROM_LOAD( "sc006.u248", 0x800, 0x117, NO_DUMP ) // gal16v8a
ROM_END

ROM_START( tvdenwat )
ROM_REGION( 0x100000, "maincpu", 0 )
ROM_LOAD16_BYTE( "s72_b02.u15", 0x00000, 0x20000, CRC(db713202) SHA1(4883152273925207929757da0eae333ac18aa585) )
ROM_LOAD16_BYTE( "s72_b01.u14", 0x00001, 0x20000, CRC(fe4e48ff) SHA1(2a31520ddd3c4a61daf2868114cfd1f1a5f3f201) )

ROM_REGION( 0x80000, "spr_gfx", 0 )
ROM_LOAD( "s72_a05.u119", 0x00000, 0x80000, CRC(9fda5789) SHA1(5d1e37d42c9f255253bcb3714be8fd04238b47fa) )

ROM_REGION( 0x80000, "gfx_tiles", 0 )
ROM_LOAD( "s72_a04.u18", 0x00000, 0x80000, CRC(66fbbf66) SHA1(4d46204661282c311ace3c749d9484c2e3e69500) )

ROM_REGION( 0x80000, "bg_gfx", 0 )
ROM_COPY( "gfx_tiles" , 0x00000, 0x00000, 0x80000)

ROM_REGION( 0x80000, "md_gfx", 0 )
ROM_COPY( "gfx_tiles" , 0x00000, 0x00000, 0x80000)

ROM_REGION( 0x80000, "fg_gfx", 0 )
ROM_COPY( "gfx_tiles" , 0x00000, 0x00000, 0x80000)

ROM_REGION( 0x80000, "tx_gfx", 0 )
ROM_COPY( "gfx_tiles" , 0x00000, 0x00000, 0x80000)

ROM_REGION( 0x100000, "oki", 0 )
ROM_LOAD( "s72_a03.u17", 0x000000, 0x100000, CRC(e7d09642) SHA1(0cee5193497698239f44ef457d92f1d1d042c42b) )

ROM_REGION( 0xa00, "plds", 0 )
ROM_LOAD( "sc001.u110", 0x000, 0x104, NO_DUMP ) // tibpal16l8-25cn
ROM_LOAD( "sc002.u235", 0x200, 0x104, NO_DUMP ) // tibpal16l8-25cn
ROM_LOAD( "sc003.u36", 0x400, 0x155, NO_DUMP ) // 18cv8pc-25
ROM_LOAD( "sc004c.u68", 0x600, 0x117, NO_DUMP ) // gal16v8a
ROM_LOAD( "sc006.u248", 0x800, 0x117, NO_DUMP ) // gal16v8a
ROM_END

ROM_START( marioun )
ROM_REGION( 0x100000, "maincpu", 0 )
ROM_LOAD16_BYTE( "s98_b02.u15", 0x00000, 0x20000, CRC(d88eecfc) SHA1(5a15a1f925ae10e439e5aee8f3ef5a2fa956b80f) )
Expand Down Expand Up @@ -580,6 +615,7 @@ void banprestoms_state::init_oki() // The Oki mask ROM is in an unusual format,
} // Anonymous namespace


GAME( 1991, tvdenwad, 0, banprestoms, tvdenwad, banprestoms_state, init_oki, ROT0, "Banpresto", "Terebi Denwa Doraemon", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
GAME( 1992, tvdenwam, 0, banprestoms, tvdenwad, banprestoms_state, init_oki, ROT0, "Banpresto", "Terebi Denwa Super Mario World", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
GAME( 1993, marioun, 0, banprestoms, marioun, banprestoms_state, init_oki, ROT0, "Banpresto", "Super Mario World - Mario Undoukai", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
GAME( 1991, tvdenwad, 0, banprestoms, tvdenwad, banprestoms_state, init_oki, ROT0, "Banpresto", "Terebi Denwa Doraemon", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
GAME( 1992, tvdenwam, 0, banprestoms, tvdenwad, banprestoms_state, init_oki, ROT0, "Banpresto", "Terebi Denwa Super Mario World", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
GAME( 1992, tvdenwat, 0, banprestoms, tvdenwad, banprestoms_state, init_oki, ROT0, "Banpresto", "Terebi Denwa Thomas the Tank Engine and Friends", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
GAME( 1993, marioun, 0, banprestoms, marioun, banprestoms_state, init_oki, ROT0, "Banpresto", "Super Mario World - Mario Undoukai", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )

0 comments on commit daf42dc

Please sign in to comment.