Active Threads | Active Posts | Unanswered Today | Since Yesterday | This Week
04/21/19 09:41 AM
I wanted to see if I could control the ioports for the joystick and after much fiddling and adding some code to luaengine and ioports.h and ioports.cpp I think I've got it.

Yes, it's a bit of a hack, but it's pretty useful to be able to precisely control an anlog input.

So now I can draw spirals with the graphics tablet:

function spiral()
for i=16384,16384+8192-1 do manager:machine().devices[":maincpu"].spaces["program"]:write_u8(i,0) end
for i=0,256*16,1 do 
ioports=manager:machine():ioport().ports ioports[":sl2:agraphtablet:joystick_3_x"].fields["P3 Joystick X"].live:set_analog_value(math.floor(x),math.floor(x),0)
ioports=manager:machine():ioport().ports ioports[":sl2:agraphtablet:joystick_3_y"].fields["P3 Joystick Y"].live:set_analog_value(math.floor(y),math.floor(y),0)
print (i,x,y,ioports[":sl2:agraphtablet:joystick_3_x"]:read(),ioports[":sl2:agraphtablet:joystick_3_y"]:read())
print (i,x,y,ioports[":sl2:agraphtablet:joystick_3_x"]:read(),ioports[":sl2:agraphtablet:joystick_3_y"]:read())
co1=coroutine.create(spiral) ok,err=coroutine.resume(co1) print(ok,err)

I wrote a function set_analog_value that just stuffs values into m_accum and m_previousvalue for the live ioport analog member. m_previousanalog doesn't seem to have any effect.

       // live analog value tracking
        s32                 m_accum;                // accumulated value (including relative adjustments)
        s32                 m_previous;             // previous adjusted value
        s32                 m_previousanalog;       // previous analog value

In ioport.h

struct ioport_field_live
        // construction/destruction
        ioport_field_live(ioport_field &field, analog_field *analog);

        void set_value(ioport_value newvalue) {value = newvalue;};
        void set_analog_value(s32 newaccumvalue, s32 newpreviousvalue, s32 newpreviousanalogvalue);

In ioport.cpp

void ioport_field_live::set_analog_value(s32 newaccumvalue, s32 newpreviousvalue, s32 newpreviousanalogvalue)
   {analog->set_accum(newaccumvalue); analog->set_previous(newpreviousvalue); analog->set_previousanalog(newpreviousanalogvalue);}

Just added set_accum, set_previous and set_previousanalog to class analog field:

// ======================> analog_field

// live analog field information
class analog_field
        friend class simple_list<analog_field>;
        friend class ioport_manager;
        friend void ioport_field::set_user_settings(const ioport_field::user_settings &settings);

        // construction/destruction
        analog_field(ioport_field &field);

        // getters
        analog_field *next() const { return m_next; }
        ioport_manager &manager() const { return m_field.manager(); }
        ioport_field &field() const { return m_field; }
        s32 sensitivity() const { return m_sensitivity; }
        bool reverse() const { return m_reverse; }
        s32 delta() const { return m_delta; }
        s32 centerdelta() const { return m_centerdelta; }

        // readers
        void read(ioport_value &value);
        float crosshair_read();
        void frame_update(running_machine &machine);

        void set_accum(s32 newvalue){m_accum=newvalue;};
        void set_previous(s32 newvalue){m_previous=newvalue;};
        void set_previousanalog(s32 newvalue){m_previousanalog=newvalue;};

In luaengine.cpp


	sol().registry().new_usertype<ioport_field_live>("ioport_field_live", "new", sol::no_constructor,
                        "set_value", &ioport_field_live::set_value,
                        "set_analog_value", &ioport_field_live::set_analog_value,		
			"name", &ioport_field_live::name,
                        "value", &ioport_field_live::value);

It kinda looks like a fingerprint.

[Linked Image]
329 48,956 Read More
04/21/19 08:22 AM
It looks like a ROM. Are you in a position to dump it?
42 1,578 Read More
04/21/19 12:03 AM
You can see on these pics the pcb of the colecovision adapter.
Only one chip, nothing else.
It's the only reference I have. Hope it helps 😊
42 1,578 Read More
04/20/19 11:36 PM
René, good to hear that your health is improving. Top priority should be to care for yourself now and to be patient.
Sounds helpless and boring and certainly it is. I had to pause MAME development for a long time to support my wife. Still fighting but when things calmed down I was able to return. Take your time and fight. All the best.
3 281 Read More
04/20/19 08:00 PM
Originally Posted by plgDavid
Didn't find a non working ColecoVision game so far (tried 20 or so)

Scanned the PCBs

Amazing! Good scans of the inside were really needed 👌 hope this would help one day 🤗 maybe for a fpga project 🤔?

You said you have only plugged the coleco games and it worked?
I had tried this with the emulator and nothing worked. It said "no cartridge".
What I had understood with the help of the debugger is that the bios search for "COPYRIGHT SOUNDIC" from $8000 to $8010. If it's not equal the cartridge is set unknown.
Maybe I've missed something?

For the adapter I had a pic of the inside I'll post it when I'll find it. In fact there is only one chip. My guess is there is only bios code. Maybe a replacement of the main bios? For me it's the only thing it does, but I don't know how 😅
42 1,578 Read More
04/20/19 02:39 PM
BGFX on Windows will generally use D3D11 by default, which may be part of the difference. (It's why BGFX works on a clean Win10 install when default MAME will just die).
4 161 Read More
04/20/19 01:28 PM
Has anyone made an apple II layout that shows the disk drive LED status?

I was fiddling around and can see the status in the sl6:diskiing;wozfdc/0/external_io_select (0 for drive 1, 1 for drive 2) and the motor in sl6:diskiing;wozfdc/0/active (0 for off, 1 for on, 2 for getting ready to stop)

It should be theoretically possible to do a track LED display too like those indus GT drives.

[Linked Image]
329 48,956 Read More
04/20/19 01:08 PM
Originally Posted by Heihachi_73
Does it happen with vsync turned off?

Yes, I turned it off and gave it a shot, but the problem remains.

Originally Posted by Heihachi_73
It happens with all games that run faster than 60fps regardless of the hardware

I would buy that if it happened with every video mode, but opengl and d3d have no problem running at 100%. I only experience this problem with bgfx. Maybe it's truly the case that bgfx is, as you say, more susceptible to framerate differences, that just seems odd to me.
4 161 Read More
04/20/19 11:18 AM
Originally Posted by Heihachi_73
This has always been one of my pet peeves with LCD/plasma etc. over the years, when they refuse to operate at anything besides 60Hz even though the display itself shouldn't care. My crappy old PC CRT from 2004 is quite happy running in 1600x1200 at 75Hz!

Variable refresh rate (Freesync / G-sync) is now relatively common on LCD displays wink
4 161 Read More
04/20/19 07:52 AM
Does it happen with vsync turned off? It sounds like the usual case of Pac-Man trying to run on a 60Hz display. Pac-Man runs at ~60.61fps and MAME (or the OS/video card) is trying to sync it to exactly 60Hz which pretty much means 99% speed. It happens with all games that run faster than 60fps regardless of the hardware (e.g. even the Aristocrat MK5 slots do that but will sit on 96% instead because they run at around 63fps).

Vs. Super Mario Bros is probably the same speed as the NES version e.g. 59.94fps (NTSC) so it doesn't show any issues. Heading in the other direction there is Mortal Kombat 1/2/3, IIRC they only ran at around 53Hz in the arcade, which is why the console versions always seemed faster.

This has always been one of my pet peeves with LCD/plasma etc. over the years, when they refuse to operate at anything besides 60Hz even though the display itself shouldn't care. My crappy old PC CRT from 2004 is quite happy running in 1600x1200 at 75Hz!
4 161 Read More
04/20/19 04:36 AM
I tried to make a layout file and struggled mightily.

If you want to see mame segfault, just put a stray < somewhere inside the layout file. That was fun to figure out.

I took a layout file from the snspell artwork at Mr. Do's and could not get the buttons to work. I tried and tried and tried, I put the flag MACHINE_CLICKABLE_ARTWORK in apple2p.cpp which didn't help.

COMP( 1979, apple2p, apple2, 0, apple2p, apple2p, apple2_state, empty_init, "Apple Computer", "Apple ][+", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )

I could see the buttons but they didn't work.

I thought I was going to go insane!

And then I found the answer at


So I noticed none of the buttons (clickable; move up/down when you press them) in this artwork file (mslug2) worked anymore. I look, and the neogeo driver was updated some time back.

I look some more, and I see that the controllers for neogeo are now bus devices.


> Because Neo Geo controllers are now bus devices, the input tags also need to be
> changed to edge:joy:JOY1 and edge:joy:JOY2. These tags appear in the -listxml output.

Ah... knew it would be something simple. I had simply changed them to JOY1 and JOY2.

That will help me with other thing, too.

Thank you!!! :cheers5:

So after changing INPUTTAG="joystick_3_buttons" to INPUTTAG="sl2:agraphtablet:joystick_3_buttons" they started working!!!

Sure enough, if you look at the ioports table it will be prefaced with sl2:agraphtablet:

[MAME]> print(manager:machine():ioport().ports)
table: 0x555dcaf592b0
[MAME]> function printt(a) for i,j in pairs(a) do print(i,j) end end 
[MAME]> printt(manager:machine():ioport().ports)
:X6	sol.ioport_port*: 0x555dcaf5a5d8
:sl2:agraphtablet:joystick_3_buttons	sol.ioport_port*: 0x555dcaf5ac68
:sl2:agraphtablet:a2mse_y	sol.ioport_port*: 0x555dcaf5acd8
:X2	sol.ioport_port*: 0x555dcaf5a798
:joystick_2_x	sol.ioport_port*: 0x555dcaf5aa38
:sl2:agraphtablet:Position Max	sol.ioport_port*: 0x555dcaf5ae98
:reset_dip	sol.ioport_port*: 0x555dcaf5ab88
:sl2:agraphtablet:joystick_3_y	sol.ioport_port*: 0x555dcaf5af08
:X3	sol.ioport_port*: 0x555dcaf5a728
:joystick_2_y	sol.ioport_port*: 0x555dcaf5a9c8
:joystick_buttons	sol.ioport_port*: 0x555dcaf5a958

I don't know what was worse, struggling to get this working or watching Aquaman at the same time... 8-)

Baby steps...

<!-- taken from snspell.lay and modified -->

<mamelayout version="2">
	<element name="shadow" defstate="0">
		<text string=" ">
			<bounds x="0" y="0" width="1" height="1" />
			<color red="0.0" green="0.0" blue="0.0" />
			<disk state="0">
			<bounds x="0.07" y="0.07" width="0.86" height="0.86" />
			<color red="1.0" green="0.0" blue="0.0" />
		<disk state="1">
			<bounds x="0.07" y="0.07" width="0.86" height="0.86" />
			<color red="0.0" green="0.0" blue="0.0" />
	<view name="Handheld_Artwork">
		   <screen index="0">
			<bounds x="0" y="0" width="5554" height="7842" />

		<!-- Keypad	-->
		<!-- ABCDE -->
			<cpanel element="shadow" inputtag="sl2:agraphtablet:joystick_3_buttons" inputmask="0x10"><bounds y="4484" x="600" width="305" height="305"/><color alpha="0.85" /></cpanel>
			<cpanel element="shadow" inputtag="sl2:agraphtablet:joystick_3_buttons" inputmask="0x20"><bounds y="4484" x="1060" width="305" height="305"/><color alpha="0.85" /></cpanel>

[Linked Image]
329 48,956 Read More
04/20/19 02:55 AM
I got a brand new rig the other night, and I was testing various MAME configurations. I enabled bgfx with the crt-geom-deluxe shader, and I typically display cropped artwork. I started playing some Pac-Man, and I noticed that the sound would hitch every once in a while, so I hit F11 to see the framerate. Sure enough, it hovered consistently at 99%. The same was true for Donkey Kong. Q*Bert was worse, dipping between 97% and 98%. Oddly enough, games like Vs. Super Mario Bros., and many NeoGeo titles had no problem staying at 100%. I started to think it was a horizontal vs. vertical thing, but I tried Gradius II, and it too hovered around 99%.

I tried a bunch of combinations to combat this, including turning all artwork off, but nothing really fixed the problem. Switching to d3d or opengl causes the problem to go away completely. In these modes, I can overclock Pac-Man to over 6000%. I know bgfx requires more horsepower, but don't really understand why it struggles like this. CPU is a Core i7-9700K and I know the graphics card doesn't really matter, but I'm using an nVidia RTX 2070, outputting to a 1080p HDTV via an HDMI cable, so the resolution is just the native 1920 x 1080.

Can anyone shed any light on this? I've got VSync turned on, I needed it because the screen tearing was so bad on a few titles. But I doubt that's the issue here. Thanks.
4 161 Read More
04/19/19 10:45 PM
Cool, this is a snap of the PCB showing the traces:
[Linked Image]

Let me know if there is anything else you need from the game smile
3,121 1,933,860 Read More
04/19/19 09:43 PM
Yeah, please post a pic of the back of the PCB. The Hold Up chip package is identical, so I'm sure it's a Hitachi chip. That databook lists some other related chips, but unfortunately no pinouts.
3,121 1,933,860 Read More
04/19/19 08:19 PM
Sean, the MCU on the Gakken game seems to have other pins than the HD43380. Let me know if you are interested in looking at a picture of the PCB, otherwise I'll send it to you with what else I have here.
3,121 1,933,860 Read More
04/19/19 07:51 PM
From the "why not" department:

PS/2-mode floppy controllers have a RDDATA bit in the SRB status register, which essentially samples flux transitions incoming from the drive (each transition toggles the flip-flop and its output is the RDDATA).

"MX:" is the format used by floppy controller on Soviet PDP-11 compatible desktops (the DVK series). Low level encoding is FM, and track format is not compatible with IBM 3740 --

MXONPC ( is a DOS program written by Vladimir Poletaev in 1997 to recover data from such floppies on a Pentium-class PC. And with a bit of hacking, it works in MAME (at least some of the time):

[Linked Image]

PR coming soon.
354 290,487 Read More
04/19/19 02:53 PM
Didn't find a non working ColecoVision game so far (tried 20 or so)

Scanned the PCBs
42 1,578 Read More
04/18/19 11:04 PM
743 573,090 Read More
04/18/19 02:17 PM
Just tried one game. Surely the switch from 1KiB to 2KiB of RAM will cause issues to some game assuming mirroring. I'll try a few more later.
42 1,578 Read More
04/18/19 01:53 PM
I was saying...

[Linked Image]
[Linked Image]
42 1,578 Read More
04/18/19 01:10 PM
So you want to see bigger fonts in the debugger?

You could use the -debugger_font_size option from the command line or
change the option from the lua console. You won't see it unless you open a new dasm or memory window.

[MAME]> function printt(a) for i,j in pairs(a) do print(i,j) end end
[MAME]> printt(manager:options().entries)

homepath	sol.core_options::entry*: 0x5603fbf64898
screen	sol.core_options::entry*: 0x5603fbf5d608
snapbilinear	sol.core_options::entry*: 0x5603fbf6fa28
gl_forcepow2texture	sol.core_options::entry*: 0x5603fbf361a8
volume	sol.core_options::entry*: 0x5603fbf6f1a8
... etc

[MAME]> print(manager:options().entries["debugger_font_size"]:description())
font size to use for debugger views

[MAME]> print(manager:options().entries["debugger_font_size"]:value())                -- 0.0 is the default
[MAME]> print(manager:options().entries["debugger_font_size"]:value(5.0))    -- font size for Tiny Elvis
[MAME]> print(manager:options().entries["debugger_font_size"]:value())
[MAME]> print(manager:options().entries["debugger_font_size"]:value(12.0))   -- mame's default seems to be about 12
[MAME]> print(manager:options().entries["debugger_font_size"]:value(13.0))
[MAME]> print(manager:options().entries["debugger_font_size"]:value(15.0))

[Linked Image]

Why not change the font too?

(monospace fonts are the best, memory views can get weird)

MAME]> print(manager:options().entries["debugger_font"]:value())
[MAME]> print(manager:options().entries["debugger_font"]:value("Verdana"))
[MAME]> print(manager:options().entries["debugger_font"]:value("NanumSquare Bold"))
[MAME]> print(manager:options().entries["debugger_font"]:value("Noto Mono"))

[Linked Image]
329 48,956 Read More
04/18/19 01:00 AM
More dumb fun: Using cassettes with the apple2 driver:

I typed in a short little applesoft program but didn't load DOS, so how to save it?

Just create a cassette image with the file manager with a .wav suffix (it won't work otherwise), then go to tape control, record and type SAVE and return from the command line.

After it beeps twice, your program is saved. Make sure you're recording before you type SAVE or you'll miss some of the program.

To load your program, type LOAD and return then rewind and play your tape image.

The wav file gets large, like 4MB to save a 4K file, but it works!

Once you reboot and load DOS 3.3, just LOAD from your cassette image.
329 48,956 Read More
04/17/19 09:30 PM
The ColecoVision carts insert perfectly in the main slot.

[EDIT] guess there is a CV compatible bios and some glue chips and thats it in the adapter

[Linked Image]

I'm confident I can just hook up a 27128+switch and have the bios change from one to the other.
42 1,578 Read More
04/17/19 08:57 PM
I thought the bios was different and incompatible? assuming cart space can completely override system space, I guess it contains a compatible bios?
42 1,578 Read More
04/17/19 08:56 PM
It shouldn't have any innards from what plg said. It's purely making the connections work.
42 1,578 Read More
Page 1 of 9 1 2 3 4 5 6 7 8 9
Who's Online Now
5 registered members (Vas Crabb, Pernod, shattered, Heihachi_73, 1 invisible), 130 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Shout Box
Forum Statistics
Most Online324
Dec 20th, 2018
Powered by UBB.threads™ PHP Forum Software
(Release build 20180111)
Page Time: 0.020s Queries: 6 (0.008s) Memory: 5.2610 MB (Peak: 5.3821 MB) Zlib enabled. Server Time: 2019-04-21 12:16:10 UTC