Skip to content

Commit

Permalink
Miscellaneous cleanup:
Browse files Browse the repository at this point in the history
render/bgfx/chainmanager.cpp: Only treat source file or more sepecific
INI as higher priority than CFG file for setting screen chains.

sega/model2.cpp, taito/taitocchip.cpp: Got rid of bankdev.

Adjusted some doucmentation files.
  • Loading branch information
cuavas committed Mar 21, 2023
1 parent a55f0b1 commit f4b165a
Show file tree
Hide file tree
Showing 10 changed files with 89 additions and 145 deletions.
37 changes: 16 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@

[![Join the chat at https://gitter.im/mamedev/mame](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mamedev/mame?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Build status:
Continuous integration build status:

| OS/Compiler | Status |
| ------------- |:-------------:|
| Linux/GCC and clang | ![CI (Linux)](https://github.com/mamedev/mame/workflows/CI%20(Linux)/badge.svg) |
| Windows/MinGW GCC | ![CI (Windows)](https://github.com/mamedev/mame/workflows/CI%20(Windows)/badge.svg) |
| macOS/clang | ![CI (macOS)](https://github.com/mamedev/mame/workflows/CI%20(macOS)/badge.svg) |
| UI Translations | ![Compile UI translations](https://github.com/mamedev/mame/workflows/Compile%20UI%20translations/badge.svg) |
| Documentation | ![Build documentation](https://github.com/mamedev/mame/workflows/Build%20documentation/badge.svg) |
| OS/Compiler | Status |
| --------------------------- |:-------------:|
| Linux/clang and GCC | ![CI (Linux)](https://github.com/mamedev/mame/workflows/CI%20(Linux)/badge.svg) |
| Windows/MinGW GCC and clang | ![CI (Windows)](https://github.com/mamedev/mame/workflows/CI%20(Windows)/badge.svg) |
| macOS/clang | ![CI (macOS)](https://github.com/mamedev/mame/workflows/CI%20(macOS)/badge.svg) |
| UI Translations | ![Compile UI translations](https://github.com/mamedev/mame/workflows/Compile%20UI%20translations/badge.svg) |
| Documentation | ![Build documentation](https://github.com/mamedev/mame/workflows/Build%20documentation/badge.svg) |
| BGFX Shaders | ![Rebuild BGFX shaders](https://github.com/mamedev/mame/workflows/Rebuild%20BGFX%20shaders/badge.svg) |

Static analysis status for entire build (except for third-party parts of project):

Expand All @@ -33,27 +34,21 @@ If you're on a UNIX-like system (including Linux and macOS), it could be as easy
make
```

for a MAME build,
for a full build,

```
make SUBTARGET=arcade
make SUBTARGET=tiny
```

for an arcade-only build, or

```
make SUBTARGET=mess
```

for a MESS build.
for a build including a small subset of supported systems.

See the [Compiling MAME](http://docs.mamedev.org/initialsetup/compilingmame.html) page on our documentation site for more information, including prerequisites for macOS and popular Linux distributions.

For recent versions of macOS you need to install [Xcode](https://developer.apple.com/xcode/) including command-line tools and [SDL 2.0](https://www.libsdl.org/download-2.0.php).
For recent versions of macOS you need to install [Xcode](https://developer.apple.com/xcode/) including command-line tools and [SDL 2.0](https://github.com/libsdl-org/SDL/releases/latest).

For Windows users, we provide a ready-made [build environment](http://mamedev.org/tools/) based on MinGW-w64.
For Windows users, we provide a ready-made [build environment](http://www.mamedev.org/tools/) based on MinGW-w64.

Visual Studio builds are also possible, but you still need [build environment](http://mamedev.org/tools/) based on MinGW-w64.
Visual Studio builds are also possible, but you still need [build environment](http://www.mamedev.org/tools/) based on MinGW-w64.
In order to generate solution and project files just run:

```
Expand All @@ -69,7 +64,7 @@ make vs2019 MSBUILD=1
Where can I find out more?
=============

* [Official MAME Development Team Site](https://mamedev.org/) (includes binary downloads, wiki, forums, and more)
* [Official MAME Development Team Site](https://www.mamedev.org/) (includes binary downloads, wiki, forums, and more)
* [Official MESS Wiki](http://mess.redump.net/)
* [MAME Testers](https://mametesters.org/) (official bug tracker for MAME and MESS)

Expand Down
42 changes: 22 additions & 20 deletions src/emu/render.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1072,28 +1072,29 @@ void render_target::set_visibility_toggle(unsigned index, bool enable)

unsigned render_target::configured_view(const char *viewname, int targetindex, int numtargets)
{
layout_view *view = nullptr;

// if it isn't "auto" or an empty string, try to match it as a view name prefix
if (viewname && *viewname && strcmp(viewname, "auto"))
{
// scan for a matching view name
size_t const viewlen = strlen(viewname);
for (unsigned i = 0; !view && (m_views.size() > i); ++i)
for (unsigned i = 0; m_views.size() > i; ++i)
{
if (!core_strnicmp(m_views[i].first.name().c_str(), viewname, viewlen))
view = &m_views[i].first;
return i;
}
}

// if we don't have a match, default to the nth view
std::vector<std::reference_wrapper<screen_device> > screens;
for (screen_device &screen : screen_device_enumerator(m_manager.machine().root_device()))
screens.push_back(screen);
if (!view && !screens.empty())
if (!screens.empty())
{
// if we have enough targets to be one per screen, assign in order
if (numtargets >= screens.size())
{
// find the first view with this screen and this screen only
layout_view *view = nullptr;
screen_device const &screen = screens[index() % screens.size()];
for (unsigned i = 0; !view && (m_views.size() > i); ++i)
{
Expand All @@ -1111,22 +1112,21 @@ unsigned render_target::configured_view(const char *viewname, int targetindex, i
}
}
}
if (view)
return view_index(*view);
}

// otherwise, find the first view that has all the screens
if (!view)
for (unsigned i = 0; m_views.size() > i; ++i)
{
for (unsigned i = 0; !view && (m_views.size() > i); ++i)
{
layout_view &curview = m_views[i].first;
if (std::find_if(screens.begin(), screens.end(), [&curview] (screen_device &screen) { return !curview.has_screen(screen); }) == screens.end())
view = &curview;
}
layout_view &curview = m_views[i].first;
if (std::find_if(screens.begin(), screens.end(), [&curview] (screen_device &screen) { return !curview.has_screen(screen); }) == screens.end())
return i;
}
}

// make sure it's a valid view
return view ? view_index(*view) : 0;
// default to the first view
return 0;
}


Expand Down Expand Up @@ -2661,20 +2661,22 @@ void render_target::config_load(util::xml::data_node const *targetnode)
if (!targetnode)
return;

// TODO: consider option priority - command line should take precedence over CFG
// not practical at the moment because view selection options are in the OSD layer

// find the view
const char *viewname = targetnode->get_attribute_string("view", nullptr);
if (viewname != nullptr)
for (int viewnum = 0; viewnum < 1000; viewnum++)
if (viewname)
{
for (unsigned viewnum = 0; m_views.size() > viewnum; viewnum++)
{
const char *testname = view_name(viewnum);
if (testname == nullptr)
break;
if (!strcmp(viewname, testname))
if (!strcmp(viewname, view_name(viewnum)))
{
set_view(viewnum);
break;
}
}
}

// modify the artwork config
int const zoom = targetnode->get_attribute_int("zoom", -1);
Expand Down
3 changes: 3 additions & 0 deletions src/mame/arcade.flt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Example system driver filter file - includes only arcade amusement and gambling machines
// May be out of sync with source code

acorn/aristmk5.cpp
acorn/ertictac.cpp
acorn/ssfindo.cpp
Expand Down
5 changes: 4 additions & 1 deletion src/mame/jaleco/tetrisp2_v.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,10 @@ void tetrisp2_state::tetrisp2_vram_fg_w(offs_t offset, u16 data, u16 mem_mask)
{
// VJ and Stepping Stage write to the upper byte here to display ASCII text,
// other usages in those games outside of ASCII text write a full 16-bit value.
m_vram_fg[offset] = data & 0x00ff;
if (mem_mask == 0xff00)
m_vram_fg[offset] = data & 0x00ff;
else
m_vram_fg[offset] = data;

m_tilemap_fg->mark_tile_dirty(offset/2);
}
Expand Down
3 changes: 3 additions & 0 deletions src/mame/mess.flt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Example system driver filter file - includes systems that are not arcade amusement or gambling machines
// May be out of sync with source code

access/acvirus.cpp
acorn/aa310.cpp
acorn/accomm.cpp
Expand Down
31 changes: 7 additions & 24 deletions src/mame/sega/model2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,19 +439,15 @@ void model2_tgp_state::copro_tgp_data_map(address_map &map)
map(0x0200, 0x03ff).ram();
}

void model2_tgp_state::copro_tgp_bank_map(address_map &map)
void model2_tgp_state::copro_tgp_io_map(address_map &map)
{
map(0x00020, 0x00023).rw(FUNC(model2_tgp_state::copro_sincos_r), FUNC(model2_tgp_state::copro_sincos_w));
map(0x00024, 0x00027).rw(FUNC(model2_tgp_state::copro_atan_r), FUNC(model2_tgp_state::copro_atan_w));
map(0x00028, 0x00029).rw(FUNC(model2_tgp_state::copro_inv_r), FUNC(model2_tgp_state::copro_inv_w));
map(0x0002a, 0x0002b).rw(FUNC(model2_tgp_state::copro_isqrt_r), FUNC(model2_tgp_state::copro_isqrt_w));

map(0x10000, 0x1ffff).rw(FUNC(model2_tgp_state::copro_tgp_memory_r), FUNC(model2_tgp_state::copro_tgp_memory_w));
}

void model2_tgp_state::copro_tgp_io_map(address_map &map)
{
map(0x0000, 0xffff).m(m_copro_tgp_bank, FUNC(address_map_bank_device::amap32));
map(0x0000, 0xffff).view(m_copro_tgp_bank);
m_copro_tgp_bank[0](0x0000, 0xffff).rw(FUNC(model2_tgp_state::copro_tgp_memory_r), FUNC(model2_tgp_state::copro_tgp_memory_w));
}

void model2_tgp_state::copro_tgp_rf_map(address_map &map)
Expand Down Expand Up @@ -491,7 +487,10 @@ void model2_tgp_state::copro_tgp_memory_w(offs_t offset, u32 data, u32 mem_mask)
void model2_tgp_state::copro_tgp_bank_w(offs_t offset, u32 data, u32 mem_mask)
{
COMBINE_DATA(&m_copro_tgp_bank_reg);
m_copro_tgp_bank->set_bank(m_copro_tgp_bank_reg & 0xc00000 ? 1 : 0);
if(m_copro_tgp_bank_reg & 0xc00000)
m_copro_tgp_bank.select(0);
else
m_copro_tgp_bank.disable();
}

void model2_tgp_state::copro_sincos_w(offs_t offset, u32 data, u32 mem_mask)
Expand Down Expand Up @@ -2520,14 +2519,6 @@ void model2o_state::model2o(machine_config &config)
m_copro_tgp->set_addrmap(AS_IO, &model2o_state::copro_tgp_io_map);
m_copro_tgp->set_addrmap(mb86233_device::AS_RF, &model2o_state::copro_tgp_rf_map);

ADDRESS_MAP_BANK(config, m_copro_tgp_bank, 0);
m_copro_tgp_bank->set_addrmap(0, &model2o_state::copro_tgp_bank_map);
m_copro_tgp_bank->set_endianness(ENDIANNESS_LITTLE);
m_copro_tgp_bank->set_data_width(32);
m_copro_tgp_bank->set_addr_width(17);
m_copro_tgp_bank->set_shift(-2);
m_copro_tgp_bank->set_stride(0x10000);

GENERIC_FIFO_U32(config, m_copro_fifo_in, 0);
GENERIC_FIFO_U32(config, m_copro_fifo_out, 0);

Expand Down Expand Up @@ -2678,14 +2669,6 @@ void model2a_state::model2a(machine_config &config)
m_copro_tgp->set_addrmap(AS_IO, &model2a_state::copro_tgp_io_map);
m_copro_tgp->set_addrmap(mb86233_device::AS_RF, &model2a_state::copro_tgp_rf_map);

ADDRESS_MAP_BANK(config, m_copro_tgp_bank, 0);
m_copro_tgp_bank->set_addrmap(0, &model2a_state::copro_tgp_bank_map);
m_copro_tgp_bank->set_endianness(ENDIANNESS_LITTLE);
m_copro_tgp_bank->set_data_width(32);
m_copro_tgp_bank->set_addr_width(17);
m_copro_tgp_bank->set_shift(-2);
m_copro_tgp_bank->set_stride(0x10000);

GENERIC_FIFO_U32(config, m_copro_fifo_in, 0);
GENERIC_FIFO_U32(config, m_copro_fifo_out, 0);

Expand Down
4 changes: 1 addition & 3 deletions src/mame/sega/model2.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "cpu/mb86233/mb86233.h"
#include "cpu/sharc/sharc.h"
#include "cpu/mb86235/mb86235.h"
#include "machine/bankdev.h"
#include "machine/eepromser.h"
#include "machine/gen_fifo.h"
#include "machine/i8251.h"
Expand Down Expand Up @@ -342,7 +341,7 @@ class model2_tgp_state : public model2_state
required_device<mb86234_device> m_copro_tgp;
required_shared_ptr<u32> m_copro_tgp_program;
required_region_ptr<u32> m_copro_tgp_tables;
required_device<address_map_bank_device> m_copro_tgp_bank;
memory_view m_copro_tgp_bank;

u32 m_copro_tgp_bank_reg = 0;
u32 m_copro_sincos_base = 0;
Expand Down Expand Up @@ -373,7 +372,6 @@ class model2_tgp_state : public model2_state

void copro_tgp_prog_map(address_map &map);
void copro_tgp_data_map(address_map &map);
void copro_tgp_bank_map(address_map &map);
void copro_tgp_io_map(address_map &map);
void copro_tgp_rf_map(address_map &map);

Expand Down
Loading

0 comments on commit f4b165a

Please sign in to comment.