Commit Graph

121 Commits

Author SHA1 Message Date
npwoods
0f5cfa7c1d Defaulting to empty search path if null 2019-06-16 12:03:17 -04:00
Vas Crabb
97b6717027 (nw) Clean up the mess on master
This effectively reverts b380514764 and
c24473ddff, restoring the state at
598cd52272.

Before pushing, please check that what you're about to push is sane.
Check your local commit log and ensure there isn't anything out-of-place
before pushing to mainline.  When things like this happen, it wastes
everyone's time.  I really don't need this in a week when real work™ is
busting my balls and I'm behind where I want to be with preparing for
MAME release.
2019-03-26 11:13:37 +11:00
andreasnaive
b380514764 Revert "conflict resolution (nw)"
This reverts commit c24473ddff, reversing
changes made to 009cba4fb8.
2019-03-25 23:13:40 +01:00
AJR
50f045ba74 Eliminate the default address map member of address_space_config (nw)
Since all device address maps are now class methods defined in ordinary C++, default RAM maps can be provided more simply with an explicit has_configured_map check in an internal map definition.

A number of default address maps that probably weren't meant to be overridden have also been changed to ordinary internal maps.
2019-02-17 11:50:17 -05:00
AJR
297b99c0fa Move ROM loading macros to romentry.h and remove romload.h from emu.h (nw) 2018-06-24 09:05:55 -04:00
Vas Crabb
93eaa6a494 as if millions of this pointers suddenly cried out in terror, and were suddenly silenced
* streamline templates in addrmap.h
* get rid of overloads on read/write member names - this will become even more important in the near future
2018-06-08 01:29:39 +10:00
Olivier Galibert
d7f5f63ce8 maps: Finish mame/audio and the lone dummy (nw) 2018-04-20 11:26:34 +02:00
AJR
358e6b23be Eliminate vestigial member that was behind machine().first_screen() (nw) 2018-03-21 14:16:30 -04:00
Olivier Galibert
c5345b9ea8 Grammar police (nw) 2018-02-24 14:09:46 +01:00
Olivier Galibert
5f215ff7d4 Fixes (nw) 2018-02-13 10:55:23 +01:00
Olivier Galibert
c521964316 API change: Memory maps are now methods of the owner class [O. Galibert]
Also, a lot more freedom happened, that's going to be more visible
soon.
2018-02-12 10:04:52 +01:00
Julian Sikorski
8cc758355d Enable use of system-wide asio, glm and rapidjson (#3172)
* Fixed building using system utf8proc

* Fixed building using system portaudio

* Allow using system-wide asio headers (1.11.0 or higher required).

* Allow using system-wide glm headers

* Allow using system-wide rapidjson headers
2018-02-08 16:06:25 -05:00
AJR
2f9ea2b4e1 Eliminate machine().firstcpu (nw) 2018-01-04 23:00:26 -05:00
AJR
a72b3e4ae6 Add option to disable saving NVRAM on exit 2017-12-26 14:04:39 -05:00
Vas Crabb
25f84e3bf0 srcclean and manual cleanups (nw)
please people, remember to keep source UTF-8 and if you're committing on behalf of others, clean up indents to meet MAME conventions
anyone can run srcclean over a submission and see what will get hit
2017-12-24 15:03:04 +11:00
vadosnaprimer
7e7f2fafd0 rewind implementation fixes and improvements
- reset scheduler savestate to what it was for years before rewind
-- changing saved variables should be done after thorough testing. right now, adding some vars breaks some machines, adding other vars breaks others
- switch to megabyte-wise capacity
-- savestate size greatly differs between machines, relying on state count is unstable
- switch to internal indexing
-- no longer depends on inaccurate machine time
- rewind accelerator key in debugger (Ctrl+F11)
- report capacity hit (once), with some useful info
- make error reports saner
- mention rewind and rewind_capacity in the docs
2017-12-22 04:39:14 +03:00
AJR
469caf4245 Cause of crash reported on MAMEWorld (nw) 2017-12-18 10:50:49 -05:00
Firehawke
9ece34eb21 Revert "Revert "Merge branch 'master' of https://github.com/mamedev/mame""
This reverts commit 54155441e9.
2017-12-13 21:31:27 -07:00
Firehawke
54155441e9 Revert "Merge branch 'master' of https://github.com/mamedev/mame"
This reverts commit f537428e5a, reversing
changes made to 0d70d79810.
2017-12-13 21:01:10 -07:00
vadosnaprimer
a66cb36cc7 Rewind feature and RAM savestates.
This starts the work requested in #2398.

How RAM states work.

Implemented using util::vectorstream. Instead of dumping m_save.m_entry_list to file, it writes them as binary to vectorstream. Compression is not used, as it would slow down the process. The header is written as usual, also in binary. When a state is loaded, the savestate data gets binary-read from vectorstream.

How rewind works.

Rewind is optional, it can be turned off through MAME GUI while not running. Rewind capacity is available there too. Rewind step hotkey is available from the standard hotkey menu. In the debugger you have the "rewind" command ("rw" shortcut) that works the same as the hotkey.

Every time you advance a frame (pause step), rewinder captures a RAM savestate of the frame you were at. It does the same when you do step into/over/out in the debugger. Every time it captures a new state (and when you unpause), it marks as invalid all its states that go after the current machine time, because input might change, so they are not relevant anymore. It keeps their buffers allocated though, for future use. When rewinder runs out of allowed amount of savestates it can have, it invalidates the first state in the list and tosses its unique_ptr to the end of the list, then it uses its buffer to capture a new state. When you hit the rewind step key, or use "rewind" command in the debugger, it loads a state that is immediately before the current machine time. Invalid states between valid ones are not allowed to appear, as that breaks rewinder integrity and causes problems. Rewinder keeps its own set of ram states as a vector of unique_ptr's. All rewinder operations and errors get reported using machine().popmessage().
2017-12-06 19:31:10 +03:00
Vas Crabb
d5ac7c11cf Move object finder resolution before device_start - should solve github #2759 2017-10-28 13:58:03 +11:00
Vas Crabb
a734a3b8e9 (nw) srcclean - please use UTF-8 for source files, stuff that isn't valid UTF-8 will be nuked, and cleaning it up by hand is annoying 2017-09-24 11:41:45 +10:00
angelosa
5e249520ff Revert Z80_R usage in alibaba, added a note about machine().rand(), open to suggestions (nw) 2017-09-15 00:47:08 +02:00
James Baicoianu
785e6f2fc9 Export soft_reset, hard_reset, exit, load, and save functions for Emscripten builds 2017-07-15 15:17:29 +10:00
James Baicoianu
15c2bb0c08 Fix save/load states in Emscripten build (#2470)
* Fix save/load states in Emscripten build
* Simplified Emscripten integration points
* Moved standalone JS functions to be static member functions of running_machine
* Improved Emscripten main loop
* Use convenience functions for cleaner code

As an added bonus, this now allows for proper shutdown of the running machine when running in the Emscripten environment - previously, attempts to exit the program were just being ignored.
2017-07-15 14:00:09 +10:00
AJR
e906f29a38 Make machine().describe_context() a const function returning a std::string (nw)
As part of this change (because std::string is not printf-compatible), several devices have been updated to use the modern logmacro.h logging system.
2017-07-13 12:58:47 -04:00
AJR
ca88a7720b Minor core cleanups (nw)
- disound.cpp: Make a few more methods const
- machine.cpp: c_str() is no longer needed with emu_file::open since it now takes a std::string
2017-07-13 10:36:19 -04:00
Vas Crabb
536b2153d9 make device_memory_interface slightly less of a special case, use a typedef to avoid nested templates everywhere (nw) 2017-07-10 19:35:07 +10:00
Vas Crabb
d18aa3e097 never hurts to srcclean (nw) 2017-07-09 03:21:32 +10:00
Christian Brunschen
3bcb2546db better handle the case where HTTP is not enabled. 2017-07-06 00:19:04 +01:00
Christian Brunschen
0206314395 Add an external panel for the Ensoniq VFX family of keyboards, with a websocket interface and an HTML/Javascript implementation that can be served over HTTP. 2017-07-05 17:27:34 +01:00
Olivier Galibert
92ef0f292c Initialization ordering fixes (nw) 2017-07-03 22:22:22 +02:00
Olivier Galibert
cbbbd07484 dimemory: Lift the cap on the number of address spaces per device [O. Galibert] 2017-07-03 08:03:57 +02:00
Vas Crabb
96c9112785 general cleanup:
* move rarely-used output and pty interfaces out of emu.h
* consolidate and de-duplicate forward declarations, also remove some obsolete ones
* clean up more #include guard macros
* scope down a few more things

(nw) Everyone, please keep forward declarations for src/emu in src/emu/emufwd.h -
this will make it far easier to keep them in sync with declarations than having
them scattered through all the other files.
2017-05-23 15:01:11 +10:00
Vas Crabb
0f0d39ef81 Move static data out of devices into the device types. This is a significant change, so please pay attention.
The core changes are:
* Short name, full name and source file are no longer members of device_t, they are part of the device type
* MACHINE_COFIG_START no longer needs a driver class
* MACHINE_CONFIG_DERIVED_CLASS is no longer necessary
* Specify the state class you want in the GAME/COMP/CONS line
* The compiler will work out the base class where the driver init member is declared
* There is one static device type object per driver rather than one per machine configuration

Use DECLARE_DEVICE_TYPE or DECLARE_DEVICE_TYPE_NS to declare device type.
* DECLARE_DEVICE_TYPE forward-declares teh device type and class, and declares extern object finders.
* DECLARE_DEVICE_TYPE_NS is for devices classes in namespaces - it doesn't forward-declare the device type.

Use  DEFINE_DEVICE_TYPE or DEFINE_DEVICE_TYPE_NS to define device types.
* These macros declare storage for the static data, and instantiate the device type and device finder templates.

The rest of the changes are mostly just moving stuff out of headers that shouldn't be there, renaming stuff for consistency, and scoping stuff down where appropriate.

Things I've actually messed with substantially:
* More descriptive names for a lot of devices
* Untangled the fantasy sound from the driver state, which necessitates breaking up sound/flip writes
* Changed DECO BSMT2000 ready callback into a device delegate
* Untangled Microprose 3D noise from driver state
* Used object finders for CoCo multipak, KC85 D002, and Irem sound subdevices
* Started to get TI-99 stuff out of the TI-990 directory and arrange bus devices properly
* Started to break out common parts of Samsung ARM SoC devices
* Turned some of FM, SID, SCSP DSP, EPIC12 and Voodoo cores into something resmbling C++
* Tried to make Z180 table allocation/setup a bit safer
* Converted generic keyboard/terminal to not use WRITE8 - space/offset aren't relevant
* Dynamically allocate generic terminal buffer so derived devices (e.g. teleprinter) can specify size
* Imporved encapsulation of Z80DART channels
* Refactored the SPC7110 bit table generator loop to make it more readable
* Added wrappers for SNES PPU operations so members can be made protected
* Factored out some boilerplate for YM chips with PSG
* toaplan2 gfx
* stic/intv resolution
* Video System video
* Out Run/Y-board sprite alignment
* GIC video hookup
* Amstrad CPC ROM box members
* IQ151 ROM cart region
* MSX cart IRQ callback resolution time
* SMS passthrough control devices starting subslots

I've smoke-tested several drivers, but I've probably missed something.  Things I've missed will likely blow up spectacularly with failure to bind errors and the like.  Let me know if there's more subtle breakage (could have happened in FM or Voodoo).

And can everyone please, please try to keep stuff clean.  In particular, please stop polluting the global namespace.  Keep things out of headers that don't need to be there, and use things that can be scoped down rather than macros.
It feels like an uphill battle trying to get this stuff under control while more of it's added.
2017-05-14 21:44:11 +10:00
Nathan Woods
c5ef33acdc Refactoring/cleanup to state load/save handling
- Changed running_machine::schedule_[load|save]() to take 'std::string &&' instead of 'const char *'
- Changed running_machine::saveload_schedule to be 'enum class'
2017-05-10 10:04:10 +10:00
Justin Kerk
aba51822ee Fixed issue with the Emscripten port where the emulation would continue to run while paused. [Steven Hugg] 2017-05-03 03:09:39 +00:00
Miodrag Milanovic
ad2bedf06b Refactored HTTP handling to be easier to extend and use (nw) 2017-03-19 18:35:05 +01:00
Olivier Galibert
0cdc64d36c debugger_access: Refactor [O. Galibert] 2017-03-02 22:51:59 +01:00
Vas Crabb
6c23897483 Self-registering devices prep:
* Make device_creator a variable template and get rid of the ampersands
* Remove screen.h and speaker.h from emu.h and add where necessary
* Centralise instantiations of screen and speaker finder templates
* Add/standardise #include guards in many hearers
* Remove many redundant #includes
* Order #includesr to help catch headers that can't be #included alone

(nw) This changes #include order to be prefix, unit header if applicable
then other stuff roughly in order from most dependent to least dependent
library.  This helps catch headers that don't #include things that they
use.
2017-02-27 22:57:14 +11:00
PugsyMAME
246b98a3c0 Update machine.cpp 2017-02-25 17:23:22 +00:00
Vas Crabb
edf64df1db srcclean (nw) 2017-01-22 15:37:37 +11:00
Miodrag Milanovic
b5df96fd37 Fix issue enabling/disabling http (nw) 2017-01-04 19:42:13 +01:00
Miodrag Milanovic
7119f5ba73 One more fix (nw) 2017-01-04 16:23:47 +01:00
Miodrag Milanovic
63e3f48775 Added initial HTTP/HTTPS webserver/websocket server support (nw) 2017-01-04 16:15:57 +01:00
Vas Crabb
c7352f5684 Revert "moved debugger_access() from address space to machine & removed the anti-patterns that updated cascading address spaces. [smf]"
This reverts commit 5f05fbf613.
2016-11-21 05:57:46 +11:00
smf-
5f05fbf613 moved debugger_access() from address space to machine & removed the anti-patterns that updated cascading address spaces. [smf] 2016-11-19 22:18:58 +00:00
Vas Crabb
8179a84458 Introduce u8/u16/u32/u64/s8/s16/s32/s64
* New abbreviated types are in osd and util namespaces, and also in global namespace for things that #include "emu.h"
* Get rid of import of cstdint types to global namespace (C99 does this anyway)
* Remove the cstdint types from everything in emu
* Get rid of U64/S64 macros
* Fix a bug in dps16 caused by incorrect use of macro
* Fix debugcon not checking for "do " prefix case-insensitively
* Fix a lot of messed up tabulation
* More constexpr
* Fix up many __names
2016-11-19 05:38:48 +11:00
cracyc
1a9cdb5c7a machine: don't do the periodic_check before every timeslice (nw) 2016-11-17 16:23:40 -06:00
Miodrag Milanovic
2027d59e7f Do not use FUNC in delegate where applicable (nw) 2016-11-06 14:11:55 +01:00