Viewing Issue Advanced Details
ID Category [?] Severity [?] Reproducibility Date Submitted Last Update
06060 DIP/Input Major Always Nov 1, 2015, 17:10 Nov 14, 2015, 17:11
Tester trebor View Status Public Platform MESS (Official Binary)
Assigned To Haze Resolution Fixed OS Windows Vista/7/8 (64-bit)
Status [?] Resolved Driver
Version 0.167 Fixed in Version 0.168 Build 64-bit
Fixed in Git Commit Github Pull Request #
Summary MESS-specific 06060: a7800 [1on1u]: Cannot start a game in One-On-One Basketball.
Description Since the merger of MESS to MAME from MAME 0.162 and newer a game of One-On-One Basketball cannot be started. You can select through game options; however, trying to select either "New Game" or "Demo" (via button press on option) does not a thing.

MESS 0.161 and older it works fine.
Steps To Reproduce Start MAME a7800 driver and One-On-One Basketball game ROM under MAME 0.162 or newer. Try to either select "New Game" or "Demo".

Result is it remains on the option screen.

Try MESS 0.161 or older utilizing the same aforementioned steps. A game starts without issue.
Additional Information
Github Commit
Flags
Regression Version 0.162
Affected Sets / Systems a7800 [1on1u]
Attached Files
zip file icon 7800utiltycart-lacking-full-2-button-setup.zip (10,816 bytes) Nov 4, 2015, 13:21 Uploaded by trebor
Modified version of the 7800 Utility cart that does the same incomplete setup as One On One.
zip file icon a7800utilitycart.zip (21,747 bytes) Nov 14, 2015, 17:11 Uploaded by trebor
Utility Cart with Memory Explorer containing *.bin and *.a78 files.
Relationships
There are no relationship linked to this issue.
Notes
20
User avatar
No.12104
Tafoid
Administrator
Nov 1, 2015, 20:28
This regression seems to be traced not to the merging, but to the new RIOT implementation on May 22, 2015:
https://github.com/mamedev/mame/commit/3651bad9c8ec0f42be7ec66894c7e8277a9be054
User avatar
No.12114
trebor
Tester
Nov 4, 2015, 13:20
Per Mike Saarna:

"RIOT lines can be set for input or output, and the official 7800 2-button joystick procedure is to set CTLSWB=$14 to enable output on 2 RIOT bits/lines and then to set SWCHB=0 to actually set the OUTPUT on those 2 pins low.

One On One does something a bit tricky - it does half the 2-button setup but leaves the SWCHB bits in their default state, after which it does a single-button style read using the INPT4 register. It seems the default state of the bits on real hardware (and the previous RIOT implementation) is to output high, but the new RIOT implementation seems to default its bits as low. This causes a premature completion of the 7800 2-button setup, blocking One On One from getting single-button mode info from INPT4.

Also, the RIOT port device mapping needs to lose the mirror that was added at +0x60. The 7800 Software Guide doesn't support the existence of such a mirror.

According to the guide, the RIOT ports should cover 0x280 to 0x2FF. In theory its not a big deal that the RIOT port driver was changed to cover 0x280 to 0x29F, since there aren't registers higher than 0x297, but I believe it should be restored to cover 0x280 to 0x2FF, so MAME will accurately document the address lines in play.

A modified version of the 7800 Utility cart that does the same incomplete setup as One On One is attached, for easier testing/illustrative purposes."
User avatar
No.12116
Robbbert
Senior Tester
Nov 5, 2015, 01:42
Haze made a fix, please test.
User avatar
No.12122
trebor
Tester
Nov 5, 2015, 16:48
Tried a 64-bit compile, based off of r41605, running Windows 7. Whether you launch the a7800 system and game ROM from Command Line, or launch the console and then select the game ROM via internal "tab" menu, MAME crashes with an Access Violation.

Same thing happens for some additional systems too, such as snes (Super Nintendo). However, other systems, such as coleco (ColecoVision), run without issue.

Here's the error with a7800:

-----------------------------------------------------
Exception at EIP=000000000253E566 (not found): ACCESS VIOLATION
While attempting to read memory at 0000000000000238
-----------------------------------------------------
RAX=0000019F004D0001 RBX=000000000022F3F0 RCX=0000000000000000 RDX=00000000086B
FB8
RSI=000000000493A2C0 RDI=00000000086BDDF0 RBP=0000000006FC8C9E RSP=000000000022
340
 R8=000000000022F4A0 R9=0000000000000002 R10=000000000A4BF7F3 R11=0000019F004D
0CC
R12=000000000022F3D0 R13=000000000A4C0BA8 R14=0000000000000009 R15=000000000022
3C0
-----------------------------------------------------
Stack crawl:
  000000000022F370: 000000000253E566 (not found)
  000000000022F440: 00000000024A9665 (not found)
  000000000022F480: 00000000024A97ED (not found)
  000000000022F4E0: 000000000158DAA3 (not found)
  000000000022F5E0: 00000000025FC1B8 (not found)
  000000000022F650: 00000000025FC2AB (not found)
  000000000022F6B0: 00000000025FC3D5 (not found)
  000000000022F850: 00000000025D6495 (not found)
  000000000022FE00: 0000000001530A65 (not found)
  000000000022FE50: 0000000002986ACE (not found)
  000000000022FF20: 00000000004013CA (not found)
  000000000022FF50: 00000000004014F8 (not found)
  000000000022FF80: 00000000772C5A4D (BaseThreadInitThunk+0x000d)
  000000000022FFD0: 00000000774FB831 (RtlUserThreadStart+0x0021)


Here's the error - very similar to the a7800 driver - using snes:
-----------------------------------------------------
Exception at EIP=000000000253E566 (not found): ACCESS VIOLATION
While attempting to read memory at 0000000000000238
-----------------------------------------------------
RAX=00000F1103650001 RBX=00000000002298D0 RCX=0000000000000000 RDX=000000000A38D
A08
RSI=000000000493A2C0 RDI=0000000013DF9010 RBP=0000000006FD6608 RSP=0000000000229
820
 R8=0000000000229980 R9=0000000000000002 R10=000000000A3C7B70 R11=00000F1103650
00B
R12=00000000002298B0 R13=000000000A3C90B8 R14=0000000000000008 R15=0000000000229
8A0
-----------------------------------------------------
Stack crawl:
  0000000000229850: 000000000253E566 (not found)
  0000000000229920: 00000000024A9665 (not found)
  0000000000229960: 00000000024A97ED (not found)
  00000000002299E0: 00000000015D3E5A (not found)
  0000000000229AE0: 00000000025FC1B8 (not found)
  0000000000229BC0: 00000000025FCE30 (not found)
  000000000022F6B0: 0000000002618F06 (not found)
  000000000022F850: 00000000025D7221 (not found)
  000000000022FE00: 0000000001530A65 (not found)
  000000000022FE50: 0000000002986ACE (not found)
  000000000022FF20: 00000000004013CA (not found)
  000000000022FF50: 00000000004014F8 (not found)
  000000000022FF80: 00000000772C5A4D (BaseThreadInitThunk+0x000d)
  000000000022FFD0: 00000000774FB831 (RtlUserThreadStart+0x0021)
User avatar
No.12123
Haze
Senior Tester
Nov 5, 2015, 17:50
edited on: Nov 5, 2015, 18:37
it simply looks like you've got a broken build... is it self-compiled or from one of the trashy sites that put out broken builds on a regular basis?

if it's your own compile, update tools, clean your folders and try again (and use GIT , not SVN ,SVN could be screwing up your files)

if it's from a site, well, it doesn't surprise me, most of them don't seem to have the first clue when it comes to compiling or packaging anything properly, and most of them seem more concerned with adding unsafe hacks / patches to the code (and either promoting them as features or failing to announce the modifications at all)
User avatar
No.12124
B2K24
Senior Tester
Nov 5, 2015, 18:18
edited on: Nov 5, 2015, 18:23
Sorry but you must be doing something wrong with either compiling or your running environment.

I just made a fresh compile and can confirm here that new game and changing the playing options as well as Demo mode works now, which makes this game playable.

[Edit] I forgot to mention that I'm softlist loading.

*mame64 a7800 1on1u*
User avatar
No.12125
trebor
Tester
Nov 5, 2015, 22:20
For the record, it was self-compiled from git.redump.net/mame/snapshot/mame-master.zip around 10:40 EST.

Had no problems building from official 0.167 or grabbing from the aforementioned link in the past and compiling my own. Perhaps just a fluke. Thanks for the confirmation of the fix, B2K24.
User avatar
No.12127
trebor
Tester
Nov 5, 2015, 23:14
edited on: Nov 5, 2015, 23:15
Just downloaded nother full source download from the aforementioned link.

Using the internal softlist (MAME a7800 1on1u) does indeed work fine:

C:\WIPMAME>mame a7800 1on1u
Average speed: 100.00% (4 seconds)
--- memory leak warning ---
#022202, nofree 104 bytes (../../../../../src/emu/mame.c:121)
a total of 104 bytes were not freed


However, there is still a problem running a game ROM from an external path for some systems:

C:\WIPMAME\MAME a7800 - cart "D:\ROMS\Atari 7800 ROMS\One On One Basketball.a78" --> Crash Access Violation

Or

Via "Tab" --> "File Manager" --> "cartridge" ---> Navigate to ROM path (I.E D:\ROMS\Atari 7800 ROMS\One On One Basketball.a78) --> Select Game ROM. --> Crash. Access Violation,

C:\WIPMAME>mame a7800 -cart "d:\rni\atari 7800 roms\One-on-One Basketball (1987) (Atari).a78"

-----------------------------------------------------
Exception at EIP=000000000253E566 (not found): ACCESS VIOLATION
While attempting to read memory at 0000000000000238
-----------------------------------------------------
RAX=000001A300DA0001 RBX=000000000022F3F0 RCX=0000000000000000 RDX=00000000085FC
078
RSI=000000000493A2C0 RDI=000000000A318180 RBP=0000000006FC8C9E RSP=000000000022F
340
 R8=000000000022F4A0 R9=0000000000000002 R10=000000000A31081A R11=000001A300DA0
0CB
R12=000000000022F3D0 R13=000000000A310878 R14=0000000000000009 R15=000000000022F
3C0
-----------------------------------------------------
Stack crawl:
  000000000022F370: 000000000253E566 (not found)
  000000000022F440: 00000000024A9665 (not found)
  000000000022F480: 00000000024A97ED (not found)
  000000000022F4E0: 000000000158DAA3 (not found)
  000000000022F5E0: 00000000025FC1B8 (not found)
  000000000022F650: 00000000025FC2AB (not found)
  000000000022F6B0: 00000000025FC3D5 (not found)
  000000000022F850: 00000000025D6495 (not found)
  000000000022FE00: 0000000001530A65 (not found)
  000000000022FE50: 0000000002986B0E (not found)
  000000000022FF20: 00000000004013CA (not found)
  000000000022FF50: 00000000004014F8 (not found)
  000000000022FF80: 0000000077A75A4D (BaseThreadInitThunk+0x000d)
  000000000022FFD0: 0000000077BAB831 (RtlUserThreadStart+0x0021)


Utilizing the same command...

make -j5 PTR64=1 TOOLS=1 STRIP_SYMBOLS=1

...There are no problems or errors when building an official 0.167 self compile works perfectly on my Core i7 running Win 7 64-bit.

EDIT: For grammar.
User avatar
No.12128
Robbbert
Senior Tester
Nov 5, 2015, 23:30
I can confirm the memory leak and a crash

>mame a7800 e:\software\a7800\pacman.zip results in an instant crash
User avatar
No.12129
B2K24
Senior Tester
Nov 6, 2015, 00:18
The crash should probably be made as a new report/issue since this original report was regarding starting a game which has been fixed and resolved.

I too get the crash when full path loading.

J:\MAME TEST GIT>mame64 a7800 -cart "J:\MAME\software\7800\pacman.zip"

-----------------------------------------------------
Exception at EIP=00000000024E823A (running_machine::vlogerror(char const*, char*
) const+0x000a): ACCESS VIOLATION
While attempting to read memory at 0000000000000238
-----------------------------------------------------
RAX=000001AB01AF0001 RBX=000000000022F3E0 RCX=0000000000000000 RDX=000000000A23D
B18
RSI=000000000480D760 RDI=000000000A2469D0 RBP=000000000022F350 RSP=000000000022F
330
 R8=000000000022F490 R9=0000000000000002 R10=08080000AA000000 R11=000001AB01AF0
0C7
R12=000000000022F3C0 R13=000000000A23EC18 R14=0000000000000009 R15=000000000022F
3B0
-----------------------------------------------------
Stack crawl:
  000000000022F340: 00000000024E823A (running_machine::vlogerror(char const*, ch
ar*) const+0x000a)
  000000000022F430: 00000000024444CB (device_t::vlogerror(char const*, char*) co
nst+0x015b)
  000000000022F470: 000000000244464D (device_t::logerror(char const*, ...) const
+0x001d)
  000000000022F4D0: 000000000151C38E (a78_cart_slot_device::get_default_card_sof
tware(std::string&)+0x010e)
  000000000022F5D0: 000000000247C69A (emu_options::update_slot_options()+0x035a)

  000000000022F640: 000000000247C78B (emu_options::parse_slot_devices(int, char*
*, std::string&, char const*, char const*)+0x00bb)
  000000000022F6A0: 000000000247C8AA (emu_options::parse_command_line(int, char*
*, std::string&)+0x004a)
  000000000022F840: 000000000243B277 (cli_frontend::execute(int, char**)+0x0067)

  000000000022FDF0: 00000000014D3C8D (utf8_main(int, char**)+0x016d)
  000000000022FE50: 0000000002916BAE (wmain+0x007e)
  000000000022FF20: 000000000040140C (__tmainCRTStartup+0x025c)
  000000000022FF50: 000000000040153B (mainCRTStartup+0x001b)
  000000000022FF80: 00000000779959DD (BaseThreadInitThunk+0x000d)
  000000000022FFD0: 0000000077BCA631 (RtlUserThreadStart+0x0021)
User avatar
No.12131
Haze
Senior Tester
Nov 6, 2015, 00:35
hmm I still don't get any crash

looks like it has more to do with micko's logerror changes than anything else based on what you're seeing tho, weird that I get absolutely no repro even under gdb tho, is something set in your ini files?
User avatar
No.12133
B2K24
Senior Tester
Nov 6, 2015, 00:54
Nope. The ini was made fresh after compile and nothing was changed in it.
User avatar
No.12134
Robbbert
Senior Tester
Nov 6, 2015, 01:34
The crash should probably be made as a new report/issue since this original report was regarding starting a game which has been fixed and resolved.

That's actually true, the reported problem is fixed, and now a new problem that hasn't had an official release yet.

I've passed the memory leak to the list. It's probably better to discuss the crash at MameWorld Emuchat forum.

btw this was also the first time I had run a7800 under MAME, as I normally use my local MESS build.
User avatar
No.12137
trebor
Tester
Nov 6, 2015, 03:22
Absolutely clean folder here too. In fact, just the executable, a roms folder with the necessary files, and the aforementioned results occurred for me. 0.167 official there are no such problems.
User avatar
No.12139
B2K24
Senior Tester
Nov 6, 2015, 03:34
Those are great points about the crash not occurring in official releases, but only occurring when doing a current GIT pull. Since this information has been passed on to the list, there's nothing more to do here until 0.168 releases as far as this issue is concerned.
User avatar
No.12168
Tafoid
Administrator
Nov 12, 2015, 00:44
edited on: Nov 12, 2015, 01:58
This issue concerning the a7800 internal ui/picker loader was resolved.
https://github.com/mamedev/mame/commit/c27f551ac3760a46cbeb2f3f2f5b14027db9109a
User avatar
No.12170
Tafoid
Administrator
Nov 12, 2015, 02:07
edited on: Nov 12, 2015, 02:07
Also, related to the RIOT memory map change patch that was submitted - I added this myself some days after forwarding to discussion list and not hearing anything said. As soon as I submitted it, I was informed that both do essentially the same thing. So, it was eventually reverted.

> - AM_RANGE(0x0280, 0x029f) AM_MIRROR(0x60) AM_DEVICE("riot", mos6532_t, io_map)
> + AM_RANGE(0x0280, 0x02ff) AM_DEVICE("riot", mos6532_t, io_map)
>
> Wait, don't these effectively mean the same thing? RIOT has 5 address lines
> for the i/o area (the 128-byte RAM area is entirely separate), which I
> believe should repeat the same 0x20 long block of io registers from 280-29f,
> 2a0-2bf, 2c0-2df, 2e0-2ff, so AM_MIRROR(0x60) should be correct?
User avatar
No.12171
Lord Nightmare
Developer
Nov 12, 2015, 03:33
edited on: Nov 12, 2015, 04:25
so basically, the 32 riot io registers are mapped as such:
> where 0 and 1 are bits which must be set, x is "don't care", * means the bit is used by the device itself, and ? is unknown:
> addr bits: 15 14 13 12  11 10  9  8   7  6  5  4   3  2  1  0
>             0  0  0  0   ?  0  1  0   1  x  x  *   *  *  *  *    RW   RIOT I/O Regs
> for the main map portion, this means the region we care about to go to the device is:
>             0  0  0  0   0  0  1  0   1  0  0  0   0  0  0  0
> to
>             0  0  0  0   0  0  1  0   1  0  0  1   1  1  1  1
> hence AM_RANGE(0x0280, 0x029f)
> and, to mirror that area, AM_MIRROR(0xnn) chooses which bits to ignore (the "don't care" bits)
> so the correct mirror is:             0  1  1  0   0  0  0  0
> i.e. AM_MIRROR(0x60)
> so the final line is AM_RANGE(0x0280, 0x029f) AM_MIRROR(0x60) AM_DEVICE("riot", mos6532_t, io_map)
> if addr bit 11 is actualy another "don't care" bit, then the AM_MIRROR line should be AM_MIRROR(0x0860)       
User avatar
No.12178
trebor
Tester
Nov 13, 2015, 21:26
Respecting the aforementioned submitted update, it seems there was a fundamental misunderstanding as to what AM_MIRROR(0x60) meant in MAME parlance. It was thought the line meant a mirror at +0x60 from the base address, but is now understood that 0x60 is a mask for "don't care bits" rather than an offset. In that case, the mirror would indeed be correct.
 
There's no RIOT mirror at 0xA80 (confirmed) so bit 11 is 0, not a "don't care".
User avatar
No.12180
trebor
Tester
Nov 14, 2015, 17:08
More extensive testing has been performed on several consoles including the various revisions.

The following has held true regarding documenting how the RIOT mirroring actually behaves, per Mike Saarna:

AM_RANGE(0x0280, 0x029f) AM_MIRROR(0x160) AM_DEVICE("riot", mos6532_t, io_map)

The old behavior of (0x60) should be updated to (0x160).

The A7800 utility cart by Mark Saarna is being uploaded in both *.bin and *.a78 format for those who wish to test for themselves.

Please see the "Memory Explorer" option and navigate through the different memory locations by pressing down on the Player 1 controller.