Commit Graph

55349 Commits

Author SHA1 Message Date
Olivier Galibert
c46e1007a8 emumem: API change [O. Galibert]
* direct_read_data is now a template which takes the address bus shift
  as a parameter.

* address_space::direct<shift>() is now a template method that takes
  the shift as a parameter and returns a pointer instead of a
  reference

* the address to give to {read|write}_* on address_space or
  direct_read_data is now the address one wants to access

Longer explanation:

Up until now, the {read|write}_* methods required the caller to give
the byte offset instead of the actual address.  That's the same on
byte-addressing CPUs, e.g. the ones everyone knows, but it's different
on the word/long/quad addressing ones (tms, sharc, etc...) or the
bit-addressing one (tms340x0).  Changing that required templatizing
the direct access interface on the bus addressing granularity,
historically called address bus shift.  Also, since everybody was
taking the address of the reference returned by direct(), and
structurally didn't have much choice in the matter, it got changed to
return a pointer directly.

Longest historical explanation:

In a cpu core, the hottest memory access, by far, is the opcode
fetching.  It's also an access with very good locality (doesn't move
much, tends to stay in the same rom/ram zone even when jumping around,
tends not to hit handlers), which makes efficient caching worthwhile
(as in, 30-50% faster core iirc on something like the 6502, but that
was 20 years ago and a number of things changed since then).  In fact,
opcode fetching was, in the distant past, just an array lookup indexed
by pc on an offset pointer, which was updated on branches.  It didn't
stay that way because more elaborate access is often needed (handlers,
banking with instructions crossing a bank...) but it still ends up with
a frontend of "if the address is still in the current range read from
pointer+address otherwise do the slowpath", e.g. two usually correctly
predicted branches plus the read most of the time.

Then the >8 bits cpus arrived.  That was ok, it just required to do
the add to a u8 *, then convert to a u16/u32 * and do the read.  At
the asm level, it was all identical except for the final read, and
read_byte/word/long being separate there was no test (and associated
overhead) added in the path.

Then the word-addressing CPUs arrived with, iirc, the tms cpus used in
atari games.  They require, to read from the pointer, to shift the
address, either explicitely, or implicitely through indexing a u16 *.
There were three possibilities:

1- create a new read_* method for each size and granularity.  That
   amounts to a lot of copy/paste in the end, and functions with
   identical prototypes so the compiler can't detect you're using the
   wrong one.

2- put a variable shift in the read path.  That was too expensive
   especially since the most critical cpus are byte-addressing (68000 at
   the time was the key).  Having bit-adressing cpus which means the
   shift can either be right or left depending on the variable makes
   things even worse.

3- require the caller to do the shift himself when needed.

The last solution was chosen, and starting that day the address was a
byte offset and not the real address.  Which is, actually, quite
surprising when writing a new cpu core or, worse, when using the
read/write methods from the driver code.

But since then, C++ happened.  And, in particular, templates with
non-type parameters.  Suddendly, solution 1 can be done without the
copy/paste and with different types allowing to detect (at runtime,
but systematically and at startup) if you got it wrong, while still
generating optimal code.  So it was time to switch to that solution
and makes the address parameter sane again.  Especially since it makes
mucking in the rest of the memory subsystem code a lot more
understandable.
2017-11-29 10:32:31 +01:00
Dirk Best
5676444d8c jvc_dsk: Fix MT #06779 2017-11-29 10:19:03 +01:00
Justin Kerk
1826aa157e New NOT_WORKING software list additions
---------------------------------------
ibm5150: IBM Personal Computer DOS (Version 1.10) (International master disk) [Justin Kerk]
2017-11-28 22:10:26 -08:00
briantro
bf38dfa679 bloodbro.cpp: Remove outdated comment, ROMs were bitswapped, not bad / corrupt (nw) 2017-11-28 22:32:31 -06:00
R. Belmont
ee500b2098
Merge pull request #2861 from DavidHaywood/271117
weststory: verified sprite data by converting original mask rom into …
2017-11-28 21:27:23 -05:00
R. Belmont
b94da90623
Merge pull request #2864 from SSTSylvain/patch-1
Update MAME French translation
2017-11-28 21:26:05 -05:00
R. Belmont
07ef6eba87
Merge pull request #2859 from pmackinlay/interpro
interpro: cpu and mmu improvements
2017-11-28 21:24:55 -05:00
Vas Crabb
f9609d1487 goodbye strcmp, hello polymorphism (nw) 2017-11-29 13:01:11 +11:00
Scott Stone
3a4ad35721 Demoted brdrlinet due to bad rom dump (never should have been considered working) (nw) 2017-11-28 19:31:52 -05:00
Vas Crabb
d556b01583 Merge branch 'master' into release0192 2017-11-29 08:50:34 +11:00
Vas Crabb
d771f54227 version bump (nw) 2017-11-29 05:24:46 +11:00
smf-
45cbbc5f0a fix TLCS870 disassembly (nw) 2017-11-28 17:37:47 +00:00
Ivan Vangelista
5f889c46bf hng64.cpp: very minor documentation update (nw)
vicdual.cpp: minor documentation update for supcrash (nw)
2017-11-28 18:30:20 +01:00
Ivan Vangelista
d19d5ea349 new not working machine
------------------------------------
Real Battle Super Phoenix Mahjong (Version 4.1) [Peter Wilhelmsen, The Dumping Union]
2017-11-28 18:28:16 +01:00
Vas Crabb
f93b70e57d stray space (nw) 2017-11-29 04:08:52 +11:00
Vas Crabb
bb8adf0b06 clean up unused translation strings (nw) 2017-11-29 04:05:47 +11:00
Vas Crabb
fb4d81a80e Merge branch 'master' of https://github.com/mourix/mame into release0192 2017-11-29 04:04:51 +11:00
Vas Crabb
af3cd2dd4d this file is Allman style, use nullptr for NULL pointers, DeviceIoControl returns BOOL so treat it like a boolean (nw) 2017-11-29 02:40:42 +11:00
Vas Crabb
8fe2198a26 clean up sjy change (nw) 2017-11-29 02:30:36 +11:00
SSTSylvain
415798b49e
Update French translation 2017-11-28 10:04:54 -05:00
smf-
c2e7f912c1 fix building with Visual Studio 2017 & clang 5.0.0 (also tested with gcc 7.2.0) (nw) 2017-11-28 09:10:05 +00:00
Olivier Galibert
b247832947 Nice subtle one coverity (nw) 2017-11-28 09:10:09 +01:00
Olivier Galibert
cec449c33b Fix tms0980 debugger hook and remove leftover debug code (nw) 2017-11-28 08:30:35 +01:00
Olivier Galibert
cbfa34e2c9 Fix inclusion test (nw) 2017-11-28 07:32:34 +01:00
arbee
b292d5df60 riscpc: fix ROM load for rpc600. [R Belmont] 2017-11-27 23:11:24 -05:00
hap
a72ac77141 tms1000 dasm: put simple getters in h file. only tms1100 and derivatives have chapter(paged2) bits (nw) 2017-11-28 00:05:29 +01:00
hap
5daf2fe560 tms1000: fix another 9bit related regression (nw) 2017-11-27 23:56:57 +01:00
hap
f9dae8e6b4 8085 dasm: spacing (nw) 2017-11-27 21:33:30 +01:00
Olivier Galibert
d2b2e181f0 Fix sparc bug I have nothing to do with (nw) 2017-11-27 21:11:44 +01:00
hap
aec3f346cc tms1000: these enums don't need to be public (nw) 2017-11-27 20:53:39 +01:00
hap
1b80b02eb0 tms1000: added preliminary tms1000c (nw) 2017-11-27 19:44:46 +01:00
AJR
83fb614378 et3400: Add "Segment Test" input 2017-11-27 13:16:13 -05:00
hap
aa0433f88c tms1000 dasm: fix 9bit branch offset (nw) 2017-11-27 18:55:06 +01:00
David Haywood
d92c34ac5b weststory: verified sprite data by converting original mask rom into bootleg format and figuring out what was scrambled from there, it's a very simple but quite stupid bitswap on 2 of the roms. made a note that one byte actually differs in the bootleg even after this, since it's been verified on 2 bootlegs it could be the original mask rom has a bad byte in it instead, should really be checked. 2017-11-27 17:42:13 +00:00
AJR
26017a2c25 et3400: Add reset key 2017-11-27 12:40:45 -05:00
hap
4a81ecd8c1 hh_tms1k: gamelist update (nw) 2017-11-27 17:58:09 +01:00
Olivier Galibert
ef4717d82a arm7 disasm fix (nw) 2017-11-27 17:46:44 +01:00
sjy96525
25f66968c3 Correct Landing Gear control [sjy96525] (#2842)
* Correct Landing Gear control [sjy96525]

Changed Landing Gear from Pedal to AD_STICK_Z.

* Everything Else.

* Another (nw)
2017-11-27 15:30:51 +01:00
ajrhacker
086d08482f
Merge pull request #2856 from sjy96525/patch-20
Correct LD Mahjong #4 Shabon-Dama year
2017-11-27 08:42:53 -05:00
ajrhacker
ee4ad9bdd2
Merge pull request #2855 from sjy96525/patch-19
Correct Master's Golf Year
2017-11-27 08:41:48 -05:00
ajrhacker
68bf89045e
Merge pull request #2858 from sjy96525/patch-26
Soreike! Anpanman Popcorn Factory year Confirmed as 1992.
2017-11-27 08:41:04 -05:00
Olivier Galibert
e1785764ed Fix 68000 dasm (nw) 2017-11-27 10:52:13 +01:00
Ivan Vangelista
2e49925b57 groundfx.cpp: added a note about an undumped version which has been seen in the wild (nw) 2017-11-27 08:27:05 +01:00
Patrick Mackinlay
3c36e304ed interpro: cpu and mmu improvements
* implemented most clipper cpu and mmu exceptions
* completed c300 instructions, adjusted for c400
* improved cammu dynamic translation and added faults
* refactored c300 cammu into separate instruction/data instances
* configurable ioga and sr bus memory access
2017-11-27 13:48:33 +07:00
sjy96525
0f9eab33e8
Soreike! Anpanman Popcorn Factory year Confirmed as 1992.
Soreike! Anpanman Popcorn Factory year found on SEGA and kidstube website.
https://sega.jp/business/news/0807/
http://kidstube.jp/2017/11/14/%e3%80%90%e8%b2%b4%e9%87%8d%e3%81%aa%e5%88%9d%e4%bb%a3%e3%80%91%e3%81%9d%e3%82%8c%e3%81%84%e3%81%91%ef%bc%81%e3%82%a2%e3%83%b3%e3%83%91%e3%83%b3%e3%83%9e%e3%83%b3-%e3%83%9d%e3%83%83%e3%83%97%e3%82%b3/
2017-11-27 14:13:18 +08:00
sjy96525
008369217a
Correct LD Mahjong #4 Shabon-Dama year
LD Mahjong #4 Shabon-Dama was released year is 1991 confirmed from Arcade TV Game List Kokunai - Kaigai Hen (1971 - 2005) at Page 56.
https://i.imgur.com/v9p72Ra.jpg
2017-11-27 13:33:45 +08:00
sjy96525
3219807dc7
Correct Master's Golf Year
Release year is 1985 confirmed from Arcade TV Game List Kokunai - Kaigai Hen (1971 - 2005) at Page 22.
 https://i.imgur.com/UmbcSAi.png
2017-11-27 13:18:53 +08:00
angelosa
23b9c43e56 metro.cpp: coin counters (nw) 2017-11-27 04:11:34 +01:00
angelosa
80b4a1272a metro.cpp: resolve conflict (nw) 2017-11-27 00:48:21 +01:00
angelosa
14c2e61b40 metro.cpp: notes (nw) 2017-11-27 00:47:33 +01:00