Home Page

New Fidelity chess modules

Posted By: fhub

New Fidelity chess modules - 04/07/16 09:50 AM

Hi,

thanks to hap there are now drivers for Fidelity chess modules, but unfortunately there's still no support for chess pieces.
So I'm currenty working on implementing chess pieces to the 'fidel68k.cpp' driver.
So far I've made an external layout (from the internal one), added chess pieces to it, and also found out how to put any piece to any of the 64 board fields (setting up the start position is already working).

But now I have a big problem:
How can I detect which of the 64 board fields (or the extra buttons on the right column) has been clicked with the mouse, so that I can update correctly the pieces on the board?

I've already made lots of trials, but I'm just too unexperienced with the MESS details to get this working, so it would be nice if any of the MESS experts here (hap, robbbert, ...?) could help me with this task.

What I would need is: which code is needed in the fidel68k driver to know, WHEN I've clicked on the chess board, and on WHICH of the 64 fields!

Franz
Posted By: hap

Re: New Fidelity chess modules - 04/07/16 10:17 AM

We need a new input abstraction, not in the chess driver module or a separate fake-emulation module (that was mboard). The way chess computers know which piece is where is that they know the start state, and every move from there on. They can't 'see' the chess pieces, we should keep this part separate in the emulation.

This input layer needs to be generic enough to support stuff like this too:
https://www.youtube.com/watch?v=bBHe8qcsEVc
https://www.youtube.com/watch?v=eGwsw8hRT7s
Posted By: fhub

Re: New Fidelity chess modules - 04/07/16 10:34 AM

Well, that's not really helpful.

I've been working (privately) on the MESS chess modules since version 0.152, and I've even made a special chess version (CB-Emu) where ALL chess programs (Mephisto and SuperConstellation) are working perfectly - much better than in original MESS (I've even added lots of new Mephisto modules to it).
So I know this mboard.c quite well (I've improved it a lot for my CB-Emu), and even without my modifications the chess programs have always worked in MESS until version 0.163.
But then they stopped working, anytime even mboard.c has completely been removed, and now none of the Mephisto modules is working anymore.

I prefer to continue working on my own version, I don't want to wait for another 10 or 20 releases until anyone implements such a 'new input abstraction'.

So I'm still waiting for any hints how to add the necessary code (described in my first posting) to the fidel68k driver ...

Franz
Posted By: hap

Re: New Fidelity chess modules - 04/07/16 11:01 AM

The reason mboard was removed was not for being a bad implementation, but for unresolved source code license. If the license was resolved, it'd be removed when a new input abstraction is implemented and not anytime before that.

A MAME chesscomputer fork is fine of course smile But please be aware that you must resolve the proper license. Any remaining source code in your fork by Ralf Schaefer is from 0.172 and onward unresolved.
*edit* if you fork from 0.171 or before, I believe you're in the clear unless the driver source files are GPL. But don't take my word for it =)

Anyway your question: I'd add a custom timer and 'listen' to mouseclicks with it. You can check for button presses with m_inp_matrix[i]->read(); where i=0 is IN.0 and so on.
Posted By: Robbbert

Re: New Fidelity chess modules - 04/07/16 11:15 AM

For the glasgow driver, I was maintaining it for a while until "mboard" came along, which is when I stepped down from it.

Then a few weeks ago, mboard was removed due to the license issues hap mentioned. So I reverted glasgow back to the time when I did work on it (before mboard existed, before Ralf got involved), then made it work with current MAME. Naturally the code is utterly horrible, but it *does* work, complete with chess pieces.

So, if you can follow the code, you can see how the mouse clicks are picked up from the artwork and passed on to MAME. Don't copy the code though - it's horrible. Write your own equivalent.

If you want to run it in MAME, the mouse might not appear in full screen mode.
Posted By: hap

Re: New Fidelity chess modules - 04/07/16 01:56 PM

Where can we download your CB-Emu?
Posted By: fhub

Re: New Fidelity chess modules - 04/07/16 02:27 PM

Originally Posted By hap
Where can we download your CB-Emu?

Well, I could upload it if anyone wants it.
But there might be problems with publishing it:
1) my modified sources are not included (because it's just for my private use), so maybe this would violate the MESS license?
2) and what about all the included chess ROMs? Although they are all available on different ROM sites, I'm not sure if it would be allowed to publish them.

So if these 2 points are no problems, then let me know and I'll upload CB-Emu to any filesharing site ...

BTW, both hints (from you and Robbbert) still didn't help me:
your single line is just ways too little information to write a working MESS code (at least for someone who has only very limited knowledge about MESS), and Robbbert's new Glasgow driver is just too complicated (for me!) to port it to the fidel68k source. frown

Franz
Posted By: hap

Re: New Fidelity chess modules - 04/07/16 02:33 PM

Yes, if it's for private use of course you don't have to release the source code. But if you share it publicly (which I've seen you have in the past), you must include the source code. This rule applies even before 0.172(version of official license change).

Personally I'm willing to ignore this but officially as a MAME team member I can not. I'm sorry I can't help you further.

For the ROMs, if you have the right from the publishers to redistribute them, it's fine.
Posted By: fhub

Re: New Fidelity chess modules - 04/07/16 03:03 PM

Ok, I've now removed all ROMs from the package (most people here know where to get them), and I've also included my modified sources now, so there are no MAME/MESS license problems anymore - here's the link:
http://www1.zippyshare.com/v/fcLoFWBo/file.html

It's based on MESS 0.152 (and the MinGW at this time 2 years ago), then the MESSUI 0.152 source from Robbbert's site, and finally updated with my own code modifications.

Since there have been so many changes in the MAME/MESS code in these last 20 releases, it would be quite hard to update this code for the current release 0.172.

Franz
Posted By: hap

Re: New Fidelity chess modules - 04/07/16 03:12 PM

Great smile
Anyway, for starters I'd update to 0.171, I believe fidel*.* is included there. I'm not familiar with MESSUI but it appears to have 0.171 available here: http://www.progettosnaps.net/mess/messui/

As I said, 0.172 isn't possible unless you get license clearence from Ralf Schaefer.
Posted By: fhub

Re: New Fidelity chess modules - 04/07/16 03:22 PM

Originally Posted By hap
Great smile
Anyway, for starters I'd update to 0.171, ...

Yes, but updating these old (0.152) drivers to the new version would not be easy - at least too much work for me to try it.
There have been so many changes in MAME/MESS in these last 20 releases, that probably my changed sources won't even work anymore in 0.171 (like all the official Mephisto modules).

Franz
Posted By: Stiletto

Re: New Fidelity chess modules - 04/07/16 03:25 PM

Originally Posted By hap
As I said, 0.172 isn't possible unless you get license clearence from Ralf Schaefer.


And if you've any way to talk to him, we've tried several times to reach out to him re: relicensing, no answer. frown
Posted By: hap

Re: New Fidelity chess modules - 04/07/16 03:31 PM

Ok. 0.152 it is. I assume you have backported the Fidelity drivers? To elaborate on my hint to create a custom timer:

put this in the class:
TIMER_DEVICE_CALLBACK_MEMBER(input_peek);

put this in the machine config:
MCFG_TIMER_DRIVER_ADD_PERIODIC("input_peek", fidel68k_state, input_peek, attotime::from_msec(someinterval))

then this function gets called every (someinterval) msec:
TIMER_DEVICE_CALLBACK_MEMBER(fidel68k_state::input_peek)
{
}

In here, you can check for button presses. For example: m_inp_matrix[0]->read() & 0x80 checks if chessboard square a1 is pressed.
Posted By: fhub

Re: New Fidelity chess modules - 04/07/16 03:38 PM

Originally Posted By hap
Ok. 0.152 it is. I assume you have backported the Fidelity drivers?

No, not yet - I'm sure it would be quite complicated with all those MAME changes from 0.152 to 0.171/172.
Quote:

To elaborate on my hint to create a custom timer:
...

Aaah, thanks - this looks quite a bit more promising ... smile

Franz
Posted By: fhub

Re: New Fidelity chess modules - 04/07/16 05:57 PM

Originally Posted By hap

In here, you can check for button presses. For example: m_inp_matrix[0]->read() & 0x80 checks if chessboard square a1 is pressed.

Unfortunately that doesn't seem to work. frown

I've added all your lines, used 50 (msec) for the timer, and tried it with this code:

TIMER_DEVICE_CALLBACK_MEMBER(fidel68k_state::input_peek)
{
if (m_inp_matrix[0]->read() & 0x80) logerror("a1 \n");
}

In the file error.log I get a long list of "[:] a1 " even if I'm not clicking at any board field at all - and also when I click on a1 there's no change.

I've also tried to output 'm_inp_matrix[0]->read()' directly, and it returns 0xff all the time, so with '& 0x80' it's of course always 0x80.

Either there's something wrong with this code, or I misunderstand anything ...
(BTW, on the field a1 in my artwork there's already a piece (a white rook), because I've already set up the start position, but I guess that's not the problem?)

Franz
Posted By: hap

Re: New Fidelity chess modules - 04/07/16 06:16 PM

You've modified the layout file? Under a1(and all other buttons) it should have an input notifier, original is like this:
<bezel element="hl" inputtag="IN.0" inputmask="0x80"><bounds x="3" y="73" width="10" height="10" /><color alpha="0.2" /></bezel>
Posted By: fhub

Re: New Fidelity chess modules - 04/07/16 06:26 PM

Originally Posted By hap
You've modified the layout file? Under a1(and all other buttons) it should have an input notifier, original is like this:
<bezel element="hl" inputtag="IN.0" inputmask="0x80"><bounds x="3" y="73" width="10" height="10" /><color alpha="0.2" /></bezel>

Yes, of course I've modified it, because I've added PNGs for the pieces in my external layout.
But I have not changed these lines for the chessboard sensors (as in your line above), I've only commented out the lines in <element name="hl" ...> to remove the circles from the board.

Edit: but also if I use your original internal layout I get the same behaviour.
Posted By: Stiletto

Re: New Fidelity chess modules - 04/07/16 06:53 PM

hap, I assume it predates before this so the inputtag's are different?
https://github.com/mamedev/mame/commit/9bac43a8a487b95c752476653c46d5259454f88a
Posted By: hap

Re: New Fidelity chess modules - 04/07/16 06:55 PM

Stiletto no this is with fidel68k =)
I just tried it myself, it's working as expected. Please upload your WIP fidel68k.cpp somewhere temporary.
Posted By: fhub

Re: New Fidelity chess modules - 04/07/16 07:16 PM

Ok, here's everything I've changed:
additionally to the driver, I've also included my artwork file.

http://www120.zippyshare.com/v/GeJuCKIy/file.html
Posted By: hap

Re: New Fidelity chess modules - 04/07/16 07:30 PM

You are testing with feagv10, right? I'd move the timer to static MACHINE_CONFIG_START( eag, fidel68k_state )

I see nothing in the way that prevents something as simple as checking a button from working. Did it even work at all before?
*edit* I assume you didn't change anything in fidelz80.cpp? Do the newgame/clear buttons work when you press R/del?
Try changing inputs (MAME TAB menu) square a1 from "None" to a key on your keyboard to see if that works.
Posted By: fhub

Re: New Fidelity chess modules - 04/07/16 07:48 PM

Originally Posted By hap
You are testing with feagv10, right?

Yes.
Quote:

I'd move the timer to static MACHINE_CONFIG_START( eag, fidel68k_state )

Ok, tried it - didn't change anything.
I still get "a1" with every timer event even without clicking anywhere with the mouse.
Quote:

I see nothing in the way that prevents something as simple as checking a button from working. Did it even work at all before?

Did WHAT work? The original did work, but only your circles (in the internal layout) were moving, and this was of course done in a completely different way.
Quote:

*edit* I assume you didn't change anything in fidelz80.cpp?

No, fidelz80.cpp is unchanged!
Quote:

Do the newgame/clear buttons work when you press R/del?

All buttons are working (I don't see any R/del)
Quote:

Try changing inputs (MAME TAB menu) square a1 from "None" to a key on your keyboard to see if that works.

Well, I'm using MESSUI, not MAME, and I don't see such options.
Posted By: hap

Re: New Fidelity chess modules - 04/07/16 07:57 PM

Then I give up =(

oh, and I meant R/del the actual keys on your pc keyboard.
Posted By: fhub

Re: New Fidelity chess modules - 04/07/16 08:20 PM

Originally Posted By hap
Then I give up =(

Ok, but maybe one last question ...

I didn't even believe that we would need any new code for recognizing the mouse clicks, because it must exist already - or how would you explain this:

If I start the Fidelity module, and make the move a2a3, then clicking on a2 the driver switches on the LED on the field a2, so he must know that I clicked at a2.
(and the same for my 2nd click at a3, the driver recognizes this click, because then the program start thinking).

So where in the driver is in fact the code which 'knows' that I've clicked on a2???
Exactly on the same place I could add my code to change any piece in the layout.
So why do I need an extra code for this 'mouseclick on field xy' recognition?
Posted By: hap

Re: New Fidelity chess modules - 04/07/16 08:38 PM

The program knows because it reads the buttons with read_inputs(9) in eag_input1_r, via input mux set in eag_mux_w. read_inputs() is a function in fidelz80.cpp. The driver does not know, the emulated program does, it's a big difference =)
Posted By: etabeta78

Re: New Fidelity chess modules - 04/08/16 07:24 AM

Originally Posted By hap
We need a new input abstraction, not in the chess driver module or a separate fake-emulation module (that was mboard).


What about a generic grid input device whose shape and read handlers can be configured when you add it to the machine config?
I had a preliminary implementation of such device when i was in the device-fication frenzy a few years ago but I never got to finalizing it. Of course the actual grid appearance would be taken care of in the lay file and the device would mostly scan the input matrix but if it is the kind of abstraction you are thinking to I could try to dig out the code :-)
Posted By: hap

Re: New Fidelity chess modules - 04/08/16 09:35 AM

My vision is simply movable sprites, I think a lua script combined with existing layout would suit fine for this. Sprites may have a weight/id or not: to make a distinction between for example pluggable or magnetized game pieces vs buttons you need to press.
Posted By: etabeta78

Re: New Fidelity chess modules - 04/08/16 10:35 AM

ah ok, you were referring mainly to the piece image handling...

I was talking about an abstract input device to handle input matrix accesses and layout outputs without too many per-driver repetitions, as it is being done for the terminal device.

both can be done eventually, but your proposal is definitely more relevant to this topic wink
Posted By: Anna Wu

Re: New Fidelity chess modules - 04/08/16 11:17 AM

Ups, I see some new driver (+ROMs) on CB-Emu which are missing on the official MAME/MESS. smile
Posted By: fhub

Re: New Fidelity chess modules - 04/08/16 11:36 AM

Originally Posted By Anna Wu
Ups, I see some new driver (+ROMs) on CB-Emu which are missing on the official MAME/MESS. smile

Yep, I've added quite a lot of new stuff (and fixed a few non-working drivers) for CB-Emu, but since it's based on MESS 0.152, it would be an immense work to port this to the current version 0.172.

And not to forget those new Fidelity chess modules, but as it seems they are very hard to make as comfortable to use as all the other (e.g. Mephisto) chess modules in CB-Emu.

Franz frown
Posted By: Anna Wu

Re: New Fidelity chess modules - 04/08/16 11:39 AM

Originally Posted By fhub
Originally Posted By Anna Wu
Ups, I see some new driver (+ROMs) on CB-Emu which are missing on the official MAME/MESS. smile

Yep, I've added quite a lot of new stuff (and fixed a few non-working drivers) for CB-Emu, but since it's based on MESS 0.152, it would be an immense work to port this to the current version 0.172.

And not to forget those new Fidelity chess modules, but as it seems they are very hard to make as comfortable to use as all the other (e.g. Mephisto) chess modules in CB-Emu.

Franz smile


A spanish forum was helpful to find something. I think you know what I mean. wink

PS. Es scheint, Du bist sehr aktiv in einem Deutschen Forum.
Posted By: fhub

Re: New Fidelity chess modules - 04/08/16 11:43 AM

Originally Posted By Anna Wu
A spanish forum was helpful to find something. I think you know what I mean. wink

Yes, they used my complete CB-Emu with all the files which I couldn't post here for obvious reasons.
Quote:

PS. Es scheint, Du bist sehr aktiv in einem Deutschen Forum.

Nicht nur in einem deutschen Forum ... laugh
Posted By: hap

Re: New Fidelity chess modules - 04/08/16 11:52 AM

eta IMO ioport array is already a good solution for grid-based inputs =)
A layout isn't guaranteed to have the input grid laid out linearly, so it still needs to be filled manually.

this one:
optional_ioport_array<11> m_inp_matrix;
Posted By: Anna Wu

Re: New Fidelity chess modules - 04/08/16 11:55 AM

Originally Posted By fhub

Nicht nur in einem deutschen Forum ... laugh


I see smile
Posted By: fhub

Re: New Fidelity chess modules - 04/08/16 12:07 PM

Originally Posted By Anna Wu

I see smile

Well, my dream would really be to make these new Fidelity modules working with board pieces (especially the Elite Avantgarde was indeed a very powerful chess computer) - this would make CB-Emu quite complete.

Since hap's suggestions didn't work at all here (I get completely different codes than expected from board clicks), today morning I tried to backport these Fidelity drivers to my old 0.152 version, but this gave me hundreds of error messages, so I gave up (there were just too many substantial changes in MAME/MESS in the last 20 releases).

I can understand that hap won't like to spend more time to get the chess pieces working for these new drivers, but without help of any MAME expert I'm certainly not able to do this completely by myself - so I guess my dream will remain a dream. frown

Franz
Posted By: R. Belmont

Re: New Fidelity chess modules - 04/08/16 12:14 PM

Originally Posted By fhub
Yep, I've added quite a lot of new stuff (and fixed a few non-working drivers) for CB-Emu, but since it's based on MESS 0.152, it would be an immense work to port this to the current version 0.172.


You keep asserting this, but 0.152 and 0.172 aren't *that* different at the driver level. There's a few one-liner changes necessary that will cause massive spews of compiler output, but any of us could port in either direction in minutes.
Posted By: fhub

Re: New Fidelity chess modules - 04/08/16 12:19 PM

Originally Posted By R. Belmont

You keep asserting this, but 0.152 and 0.172 aren't *that* different at the driver level. There's a few one-liner changes necessary that will cause massive spews of compiler output, but any of us could port in either direction in minutes.

Well, then feel free to make 0.152-compatible versions of the 3 Fidelity drivers (incl. the necessary files) ... wink
Posted By: etabeta78

Re: New Fidelity chess modules - 04/08/16 12:29 PM

Originally Posted By hap
eta IMO ioport array is already a good solution for grid-based inputs =)
A layout isn't guaranteed to have the input grid laid out linearly, so it still needs to be filled manually.

this one:
optional_ioport_array<11> m_inp_matrix;


what I had written was something along the lines of

Code:
MCFG_IPTGRID_ADD("tag", width, height)
MCFG_IPTGRID_PIECES("BK", "WK", ...)
MCFG_IPTGRID_DEFAULT(def_array)
MCFG_IPTGRID_STARTPOS(start_array)
MCFG_IPTGRID_READ(read_inp_handler)
MCFG_IPTGRID_WRITE(write_out_handler)


The base structure is a rectangular grid of size width x height.
"def_array" can be used to define which positions of the grid are accessible and which ones aren't (e.g. to define a non-rectangular grid, with some positions not available) and "start_array" defines the 'default' positions of the pieces at start / reset.
The device read/write handlers would then scan the accessible elements of the grid (calling "read_inp_handler" if necessary) and output the required signal to the layout.

I thought it could have been useful, but I was never motivated enough to complete the necessary code. The video you linked brought it to my mind though: for instance the D&D game you linked could define a grid where large squares (for pieces) are alternated with narrow ones (for walls), and the driver could just read them via the appropriate handler...
Posted By: hap

Re: New Fidelity chess modules - 04/08/16 01:19 PM

I'd like to avoid putting it in the driver, the emulation should have no knowledge of what piece is what, just like the real device.
Posted By: etabeta78

Re: New Fidelity chess modules - 04/08/16 02:16 PM

well, if you put no "read_inp_handler" the device would just take care of the output to LEDs of the layout.

but as I said previously your LUA idea is more relevant here: the internal device could not communicate the new position to the driver as if the appropriate buttons have been pressed, nor update the chess pieces according to CPU moves, while a scripting plugin could!
my device proposal was just an internal input abstraction, to avoid replicating input and output code across too many drivers without the need of a common driver class. wink
Posted By: fhub

Re: New Fidelity chess modules - 04/10/16 12:19 PM

A short question to hap:

Since the official MAME 0.172 release you have changed some Fidelity layouts and replaced piece symbols like "K" by strange codes like "&#x2654;".
When I use these new layout files in the 0.172 release and compile it again, then MESSUI crashes as soon as I load any of these Fidelity modules!

Are there any other new (or changed) MAME files that I would need to support these new layouts?

Franz
Posted By: hap

Re: New Fidelity chess modules - 04/10/16 12:29 PM

Then compile it with latest source, not 0.172! smile
The strange codes you saw are Unicode chess piece symbols, Unicode support for layouts was added by Haze post-0.172. I think the files are emu/rend*.*
Posted By: R. Belmont

Re: New Fidelity chess modules - 04/10/16 01:16 PM

And this is why you don't do development on MESSUI - either you're a developer or you're on training wheels. Can't do both, especially with how fast things go these days.
Posted By: Haze

Re: New Fidelity chess modules - 04/10/16 02:13 PM

doesn't really have anything to do with MESSUI in this case tho.

it's a case of trying to partially backport something and missing the important pieces.

Posted By: R. Belmont

Re: New Fidelity chess modules - 04/10/16 02:50 PM

Right, but it was being backported because he's not using normal MAME.
Posted By: Haze

Re: New Fidelity chess modules - 04/10/16 07:22 PM

I thought it was being backported because the license change means he can't use anything newer than 0.171 (well, slightly after, up to the point where we switched the license)

We couldn't get permission from Ralf and had to drop his code, the build here still depends on it.

he does have to be careful tho, anything in MAME post 0.172 that is GPL (rather than BSD) *can't* be backported in 0.171 or older because those versions aren't GPL compatible.
Posted By: R. Belmont

Re: New Fidelity chess modules - 04/10/16 07:40 PM

He was specifically trying to backport the new UTF-8 layouts with real chess symbols, this isn't related to the mboard.c fiasco.
Posted By: Haze

Re: New Fidelity chess modules - 04/10/16 07:51 PM

But surely his reason for backporting that is because he can't forward port the rest and wanted the improvements ;-)
Posted By: R. Belmont

Re: New Fidelity chess modules - 04/10/16 08:05 PM

I didn't know you liked to encourage derivative builds :-)

Our aim here should be to get him to recreate his enhancements on current codebase, no?
Posted By: Haze

Re: New Fidelity chess modules - 04/10/16 08:11 PM

indeed, but if there's a significant chunk of code missing, which there is (a lot of stuff needed to be ripped out those chess drivers) then the undertaking might be beyond his ability.
Posted By: fhub

Re: New Fidelity chess modules - 04/15/16 01:46 PM

Hi hap!

I've now finished the 1st step for the fidel68k driver - I'm now able to play a normal game with chess pieces on the board. smile

So far I've found out how to recognize mouse-clicks on the board and on the first 8 buttons on the right side (from PB to RV), but for adding some special features of this chess computer I would need a few more informations:

1) how can I recognize (in the driver) a mouse-click on the 3 remaining buttons NEW GAME, CL and DM ?
2) how can I check in the driver whether any of the 6 piece-LEDs (KQRBNP) and the LED for YOUR MOVE is ON ?
3) and the same for the 64 board-LEDs, how to recognize which of them is switched on?

Every information about these issues would be a great help, because finding this out by myself (with trial-and-error method) would be a very laborious task.

Franz
Posted By: LoganB

Re: New Fidelity chess modules - 04/15/16 01:54 PM

1 is done by setting the clickable region of the background to a button input in the lay file. Lots of examples in the other layouts.
Posted By: fhub

Re: New Fidelity chess modules - 04/15/16 02:17 PM

Originally Posted By LoganB
1 is done by setting the clickable region of the background to a button input in the lay file.

Thanks, but I guess you misunderstood what I meant.

There are already such clickable regions defined in the layout for these 3 buttons, and clicking on them is working fine (i.e. the chess module does respond to a click).
*I* know when I'm clicking on these buttons (and the chess computer too), but how does the *driver* know this, i.e. which code is required in the driver to recognize these clicks (because then the driver should execute some code)?
Posted By: etabeta78

Re: New Fidelity chess modules - 04/15/16 02:59 PM

you have to use the inputtag & inputmask attributes to identify which input ports have to be "poked" when users click on the key

for instance for "NEW GAME" you shall use
Code:
inputtag="IN.2" inputmask="0x100"
Posted By: hap

Re: New Fidelity chess modules - 04/15/16 03:01 PM

1) I gave up on trying to figure out why mouseclick detection didn't work on your build. See the INPUT_PORTS_START array which bit is which button. IN.0 & 0x100 is CL for example, so make sure not to use UINT8.

2) check the layout file which LED 'coordinate' is which LED. this stuff: bezel name="7.15" ..
Then in driver code: if (m_display_decay[7][15] != 0) { led is on }
Or maybe it's the other way around, not sure smile m_display_decay[15][7]

3) see 2
Posted By: fhub

Re: New Fidelity chess modules - 04/15/16 03:43 PM

Ok, thanks to both (etabeta78 and hap) - I'll try your suggestions!

Originally Posted By hap
1) I gave up on trying to figure out why mouseclick detection didn't work on your build.

Well, it did work, but not in the simple way you've described it.
This m_inp_matrix[i]->read() didn't only return a single bit (depending on the clicked field) - it returns the whole previous byte (before the click) XORed with the bit for the clicked field.
In the start position this matrix contains {0xff,0xff,0x00,0x00,0x00,0x00,0xff,0xff}, i.e. since line 0, 1, 6 and 7 are filled with the 16 chess pieces, these bytes are 0xff (a bit for every piece).
Now when I click e.g. on A1, bit 8 of line 0 changes, so the return value for this click is 0x7f, and I get your suggested 0x80 when I XOR this 0x7f with the old value 0xff.
This newvalue (for line 0) now remains 0x7f until I click again on any other field in line 0, so then I have to do this XOR again.
So this m_inp_matrix is in fact a 8x8-matrix containing a 1-bit for each piece on the board.
(only for m_inp_matrix[8], i.e. the right column of function keys, the return values are indeed 0x01..0x080)

It took me quite some time and many trials (with the help of a logfile) to discover this scheme and decrypt it.

Franz
Posted By: crazyc

Re: New Fidelity chess modules - 04/18/16 01:59 AM



It's not perfect but the pieces are moved by a lua script embedded in the layout file.
Posted By: R. Belmont

Re: New Fidelity chess modules - 04/18/16 03:07 AM

Super, super cool. Lua + layouts seems like potentially a very powerful setup, and a lot more flexible than the old mboard.cpp.
Posted By: fhub

Re: New Fidelity chess modules - 04/18/16 09:54 AM

Originally Posted By crazyc

It's not perfect but the pieces are moved by a lua script embedded in the layout file.

Oh, that's indeed an interesting solution!

Would this 'lua script' method also work with any external layout/artwork file?
If yes, then would it require any additional software (e.g. an installed LUA interpreter)?

Although I've already coded the support of these chess pieces for the 'feagv' driver, your solution would make things much easier (especially if you could do it within an external layout file without having to compile the whole stuff again).

Franz
Posted By: Stiletto

Re: New Fidelity chess modules - 04/18/16 12:15 PM

Originally Posted By fhub
If yes, then would it require any additional software (e.g. an installed LUA interpreter)?


Part of current MAME *IS* a LUA interpreter.

3rdparty has positively *exploded* in the last two years: https://github.com/mamedev/mame/tree/master/3rdparty
Posted By: fhub

Re: New Fidelity chess modules - 04/18/16 01:04 PM

Originally Posted By Stiletto

Part of current MAME *IS* a LUA interpreter.

Well, that may be so, but since I'm building only a VERY small subset of chess modules (my EXE is about 12 MB compared to the >100 MB official MAME), I'm not sure if it would contain this LUA interpreter.
And I still don't know if his method works with an external layout file ...
Posted By: R. Belmont

Re: New Fidelity chess modules - 04/18/16 01:08 PM

The new build system is pretty flexible, you can tell it you only want certain drivers and it'll (usually) do things right so you only get those and their dependencies.
Posted By: Olivier Galibert

Re: New Fidelity chess modules - 04/18/16 01:15 PM

Originally Posted By fhub
Originally Posted By Stiletto

Part of current MAME *IS* a LUA interpreter.

Well, that may be so, but since I'm building only a VERY small subset of chess modules (my EXE is about 12 MB compared to the >100 MB official MAME), I'm not sure if it would contain this LUA interpreter.
And I still don't know if his method works with an external layout file ...


It does, src/emu/luaengine.* depends on it, and that's driver-independant. Lua's interpreter is very small in practice.

OG.
Posted By: crazyc

Re: New Fidelity chess modules - 04/18/16 01:27 PM

Originally Posted By fhub

And I still don't know if his method works with an external layout file ...
Yes. It's still a WIP though as I'm thinking though some remaining issues.
Posted By: fhub

Re: New Fidelity chess modules - 04/18/16 01:37 PM

Originally Posted By R. Belmont
The new build system is pretty flexible, you can tell it you only want certain drivers and it'll (usually) do things right so you only get those and their dependencies.

You're certainly right, but for a MAME newbie like me it's hard to know all this.
E.g. for my special chess version I've removed all non-chess related entries in mame.lst, mess.flt and in mame.lua/mess lua (in the scripts folder), but I didn't dare to change anything wrt. CPUS/SOUNDS/VIDEOS/MACHINES/BUSES in mess.lua, because I was not sure if it still would work.
Now when I compiled my chess version the first time, it took about 2 hours (!) and listed all kinds of stuff that are certainly not necessary for my few chess modules.

So it would be nice if anyone could tell me how to tell the build system, that it should ONLY compile sources which are really necessary.
Is it possible to specify anywhere a list of (chess) drivers (e.g. fidel6502.cpp, fidel68k.cpp, fidelz80.cpp, glasgow.cpp, mephisto.cpp, ...), so that calling MAKE would ONLY compile these drivers (AND of course all dependent sources)?

Posted By: crazyc

Re: New Fidelity chess modules - 04/18/16 01:46 PM

make SUBTARGET=chess SOURCES=src/mame/drivers/fidel6502.cpp,src/mame/drivers/fidel68k.cpp,src/mame/drivers/fidelz80.cpp,src/mame/drivers/glasgow.cpp,src/mame/drivers/mephisto.cpp

SUBTARGET can be whatever you want.
Posted By: fhub

Re: New Fidelity chess modules - 04/18/16 02:01 PM

WOW, that's all? No other files need to be changed?

That would have saved me (and my poor notebook) a lot of time. wink

Many thanks, I'll try it when the next MAME version is released.

BTW, any chance to get your modified layout file for the chess module you've posted above?
It would be interesting to compare it with my solution in the driver (for the feagv10 module).

Franz
Posted By: crazyc

Re: New Fidelity chess modules - 04/18/16 02:13 PM

Here's a current diff. Some things will change though as it doesn't quite work as I'd expected.

Code:
 src/mame/layout/fidel_csc.lay | 293 +++++++++++++++++++++++++++++++-----------
 1 file changed, 219 insertions(+), 74 deletions(-)

diff --git a/src/mame/layout/fidel_csc.lay b/src/mame/layout/fidel_csc.lay
index 5774824..23e8f39 100644
--- a/src/mame/layout/fidel_csc.lay
+++ b/src/mame/layout/fidel_csc.lay
@@ -3,7 +3,65 @@
 
 <!-- other than panel button mappings, layout is identical to vsc -->
 
-<!-- define elements -->
+	<script>
+	local board
+	local first_sq
+	local curr_sq = {x = 0, y = 0}
+
+	local function move_piece(from, to)
+		if board[from.y][from.x] == 0 then
+			return false
+		end
+		board[to.y][to.x] = board[from.y][from.x]
+		board[from.y][from.x] = 0
+		machine:outputs():set_indexed_value("pos", (to.y * 10) + to.x, board[to.y][to.x])
+		machine:outputs():set_indexed_value("pos", (from.y * 10) + from.x, 0)
+		return true
+	end
+
+	function reset()
+		board = 
+			{{ 3, 5, 4, 2, 1, 4, 5, 3},
+	 		 { 6, 6, 6, 6, 6, 6, 6, 6},
+			 { 0, 0, 0, 0, 0, 0, 0, 0},
+			 { 0, 0, 0, 0, 0, 0, 0, 0},
+			 { 0, 0, 0, 0, 0, 0, 0, 0},
+			 { 0, 0, 0, 0, 0, 0, 0, 0},
+			 {12,12,12,12,12,12,12,12},
+			 { 9,11,10, 8, 7,10,11, 9}}
+		
+		for y, row in ipairs(board) do
+			for x, cell in ipairs(row) do
+				machine:outputs():set_indexed_value("pos", (y * 10) + x, board[y][x])
+			end
+		end
+	end
+
+	function click(y, x, tag, mask)
+		local port = machine:ioport().ports[tag]
+		if port then
+			local newvalue = port:read() &amp; mask
+			if (newvalue ~= 0) and ((x ~= curr_sq.x) or (y ~= curr_sq.y)) then
+				if not first_sq then
+					first_sq = {x = x, y = y}
+				else
+					if move_piece(first_sq, {x = x, y = y}) then
+						first_sq = nil
+					else
+						first_sq = {x = x, y = y}
+					end
+				end
+				curr_sq = {x = x, y = y}
+			end
+			if newvalue ~= 0 then
+				return 1
+			end 
+		end
+		return 0
+	end
+	</script>			 
+
+	<!-- define elements -->
 
 	<element name="static_black"><rect><color red="0.0" green="0.0" blue="0.0" /></rect></element>
 
@@ -176,8 +234,22 @@
 		<text string="LV"><color red="0.81" green="0.8" blue="0.79" /></text>
 	</element>
 
-
-<!-- build screen -->
+	<element name="piece" defstate="0">
+		<text string="&#x265a;" state="1"><color red="0.27" green="0.25" blue="0.25" /></text>
+		<text string="&#x265b;" state="2"><color red="0.27" green="0.25" blue="0.25" /></text>
+		<text string="&#x265c;" state="3"><color red="0.27" green="0.25" blue="0.25" /></text>
+		<text string="&#x265d;" state="4"><color red="0.27" green="0.25" blue="0.25" /></text>
+		<text string="&#x265e;" state="5"><color red="0.27" green="0.25" blue="0.25" /></text>
+		<text string="&#x265f;" state="6"><color red="0.27" green="0.25" blue="0.25" /></text>
+		
+		<text string="&#x265a;" state="7"><color red="0.71" green="0.7" blue="0.69" /></text>
+		<text string="&#x265b;" state="8"><color red="0.71" green="0.7" blue="0.69" /></text>
+		<text string="&#x265c;" state="9"><color red="0.71" green="0.7" blue="0.69" /></text>
+		<text string="&#x265d;" state="10"><color red="0.71" green="0.7" blue="0.69" /></text>
+		<text string="&#x265e;" state="11"><color red="0.71" green="0.7" blue="0.69" /></text>
+		<text string="&#x265f;" state="12"><color red="0.71" green="0.7" blue="0.69" /></text>
+	</element>	
+	<!-- build screen -->
 
 	<view name="Internal Layout">
 		<bounds left="-2" right="98" top="-18" bottom="88" />
@@ -251,6 +323,79 @@
 		<bezel element="black"><bounds x="23" y="73" width="10" height="10.5" /></bezel>
 		<bezel element="black"><bounds x="43" y="73" width="10" height="10.5" /></bezel>
 		<bezel element="black"><bounds x="63" y="73" width="10" height="10.5" /></bezel>
+		
+
+		<bezel name="pos11" element="piece"><bounds x="3" y="3" width="10" height="10" /></bezel>
+		<bezel name="pos12" element="piece"><bounds x="13" y="3" width="10" height="10" /></bezel>
+		<bezel name="pos13" element="piece"><bounds x="23" y="3" width="10" height="10" /></bezel>
+		<bezel name="pos14" element="piece"><bounds x="33" y="3" width="10" height="10" /></bezel>
+		<bezel name="pos15" element="piece"><bounds x="43" y="3" width="10" height="10" /></bezel>
+		<bezel name="pos16" element="piece"><bounds x="53" y="3" width="10" height="10" /></bezel>
+		<bezel name="pos17" element="piece"><bounds x="63" y="3" width="10" height="10" /></bezel>
+		<bezel name="pos18" element="piece"><bounds x="73" y="3" width="10" height="10" /></bezel>
+
+		<bezel name="pos21" element="piece"><bounds x="3" y="13" width="10" height="10" /></bezel>
+		<bezel name="pos22" element="piece"><bounds x="13" y="13" width="10" height="10" /></bezel>
+		<bezel name="pos23" element="piece"><bounds x="23" y="13" width="10" height="10" /></bezel>
+		<bezel name="pos24" element="piece"><bounds x="33" y="13" width="10" height="10" /></bezel>
+		<bezel name="pos25" element="piece"><bounds x="43" y="13" width="10" height="10" /></bezel>
+		<bezel name="pos26" element="piece"><bounds x="53" y="13" width="10" height="10" /></bezel>
+		<bezel name="pos27" element="piece"><bounds x="63" y="13" width="10" height="10" /></bezel>
+		<bezel name="pos28" element="piece"><bounds x="73" y="13" width="10" height="10" /></bezel>
+
+		<bezel name="pos31" element="piece"><bounds x="3" y="23" width="10" height="10" /></bezel>
+		<bezel name="pos32" element="piece"><bounds x="13" y="23" width="10" height="10" /></bezel>
+		<bezel name="pos33" element="piece"><bounds x="23" y="23" width="10" height="10" /></bezel>
+		<bezel name="pos34" element="piece"><bounds x="33" y="23" width="10" height="10" /></bezel>
+		<bezel name="pos35" element="piece"><bounds x="43" y="23" width="10" height="10" /></bezel>
+		<bezel name="pos36" element="piece"><bounds x="53" y="23" width="10" height="10" /></bezel>
+		<bezel name="pos37" element="piece"><bounds x="63" y="23" width="10" height="10" /></bezel>
+		<bezel name="pos38" element="piece"><bounds x="73" y="23" width="10" height="10" /></bezel>
+
+		<bezel name="pos41" element="piece"><bounds x="3" y="33" width="10" height="10" /></bezel>
+		<bezel name="pos42" element="piece"><bounds x="13" y="33" width="10" height="10" /></bezel>
+		<bezel name="pos43" element="piece"><bounds x="23" y="33" width="10" height="10" /></bezel>
+		<bezel name="pos44" element="piece"><bounds x="33" y="33" width="10" height="10" /></bezel>
+		<bezel name="pos45" element="piece"><bounds x="43" y="33" width="10" height="10" /></bezel>
+		<bezel name="pos46" element="piece"><bounds x="53" y="33" width="10" height="10" /></bezel>
+		<bezel name="pos47" element="piece"><bounds x="63" y="33" width="10" height="10" /></bezel>
+		<bezel name="pos48" element="piece"><bounds x="73" y="33" width="10" height="10" /></bezel>
+
+		<bezel name="pos51" element="piece"><bounds x="3" y="43" width="10" height="10" /></bezel>
+		<bezel name="pos52" element="piece"><bounds x="13" y="43" width="10" height="10" /></bezel>
+		<bezel name="pos53" element="piece"><bounds x="23" y="43" width="10" height="10" /></bezel>
+		<bezel name="pos54" element="piece"><bounds x="33" y="43" width="10" height="10" /></bezel>
+		<bezel name="pos55" element="piece"><bounds x="43" y="43" width="10" height="10" /></bezel>
+		<bezel name="pos56" element="piece"><bounds x="53" y="43" width="10" height="10" /></bezel>
+		<bezel name="pos57" element="piece"><bounds x="63" y="43" width="10" height="10" /></bezel>
+		<bezel name="pos58" element="piece"><bounds x="73" y="43" width="10" height="10" /></bezel>
+
+		<bezel name="pos61" element="piece"><bounds x="3" y="53" width="10" height="10" /></bezel>
+		<bezel name="pos62" element="piece"><bounds x="13" y="53" width="10" height="10" /></bezel>
+		<bezel name="pos63" element="piece"><bounds x="23" y="53" width="10" height="10" /></bezel>
+		<bezel name="pos64" element="piece"><bounds x="33" y="53" width="10" height="10" /></bezel>
+		<bezel name="pos65" element="piece"><bounds x="43" y="53" width="10" height="10" /></bezel>
+		<bezel name="pos66" element="piece"><bounds x="53" y="53" width="10" height="10" /></bezel>
+		<bezel name="pos67" element="piece"><bounds x="63" y="53" width="10" height="10" /></bezel>
+		<bezel name="pos68" element="piece"><bounds x="73" y="53" width="10" height="10" /></bezel>
+
+		<bezel name="pos71" element="piece"><bounds x="3" y="63" width="10" height="10" /></bezel>
+		<bezel name="pos72" element="piece"><bounds x="13" y="63" width="10" height="10" /></bezel>
+		<bezel name="pos73" element="piece"><bounds x="23" y="63" width="10" height="10" /></bezel>
+		<bezel name="pos74" element="piece"><bounds x="33" y="63" width="10" height="10" /></bezel>
+		<bezel name="pos75" element="piece"><bounds x="43" y="63" width="10" height="10" /></bezel>
+		<bezel name="pos76" element="piece"><bounds x="53" y="63" width="10" height="10" /></bezel>
+		<bezel name="pos77" element="piece"><bounds x="63" y="63" width="10" height="10" /></bezel>
+		<bezel name="pos78" element="piece"><bounds x="73" y="63" width="10" height="10" /></bezel>
+
+		<bezel name="pos81" element="piece"><bounds x="3" y="73" width="10" height="10" /></bezel>
+		<bezel name="pos82" element="piece"><bounds x="13" y="73" width="10" height="10" /></bezel>
+		<bezel name="pos83" element="piece"><bounds x="23" y="73" width="10" height="10" /></bezel>
+		<bezel name="pos84" element="piece"><bounds x="33" y="73" width="10" height="10" /></bezel>
+		<bezel name="pos85" element="piece"><bounds x="43" y="73" width="10" height="10" /></bezel>
+		<bezel name="pos86" element="piece"><bounds x="53" y="73" width="10" height="10" /></bezel>
+		<bezel name="pos87" element="piece"><bounds x="63" y="73" width="10" height="10" /></bezel>
+		<bezel name="pos88" element="piece"><bounds x="73" y="73" width="10" height="10" /></bezel>
 
 	<!-- chessboard leds -->
 
@@ -328,77 +473,77 @@
 
 	<!-- chessboard sensors -->
 
-		<bezel element="hl" inputtag="IN.0" inputmask="0x80"><bounds x="3" y="3" width="10" height="10" /><color alpha="0.4" /></bezel>
-		<bezel element="hl" inputtag="IN.1" inputmask="0x80"><bounds x="13" y="3" width="10" height="10" /><color alpha="0.2" /></bezel>
-		<bezel element="hl" inputtag="IN.2" inputmask="0x80"><bounds x="23" y="3" width="10" height="10" /><color alpha="0.4" /></bezel>
-		<bezel element="hl" inputtag="IN.3" inputmask="0x80"><bounds x="33" y="3" width="10" height="10" /><color alpha="0.2" /></bezel>
-		<bezel element="hl" inputtag="IN.4" inputmask="0x80"><bounds x="43" y="3" width="10" height="10" /><color alpha="0.4" /></bezel>
-		<bezel element="hl" inputtag="IN.5" inputmask="0x80"><bounds x="53" y="3" width="10" height="10" /><color alpha="0.2" /></bezel>
-		<bezel element="hl" inputtag="IN.6" inputmask="0x80"><bounds x="63" y="3" width="10" height="10" /><color alpha="0.4" /></bezel>
-		<bezel element="hl" inputtag="IN.7" inputmask="0x80"><bounds x="73" y="3" width="10" height="10" /><color alpha="0.2" /></bezel>
-
-		<bezel element="hl" inputtag="IN.0" inputmask="0x40"><bounds x="3" y="13" width="10" height="10" /><color alpha="0.2" /></bezel>
-		<bezel element="hl" inputtag="IN.1" inputmask="0x40"><bounds x="13" y="13" width="10" height="10" /><color alpha="0.4" /></bezel>
-		<bezel element="hl" inputtag="IN.2" inputmask="0x40"><bounds x="23" y="13" width="10" height="10" /><color alpha="0.2" /></bezel>
-		<bezel element="hl" inputtag="IN.3" inputmask="0x40"><bounds x="33" y="13" width="10" height="10" /><color alpha="0.4" /></bezel>
-		<bezel element="hl" inputtag="IN.4" inputmask="0x40"><bounds x="43" y="13" width="10" height="10" /><color alpha="0.2" /></bezel>
-		<bezel element="hl" inputtag="IN.5" inputmask="0x40"><bounds x="53" y="13" width="10" height="10" /><color alpha="0.4" /></bezel>
-		<bezel element="hl" inputtag="IN.6" inputmask="0x40"><bounds x="63" y="13" width="10" height="10" /><color alpha="0.2" /></bezel>
-		<bezel element="hl" inputtag="IN.7" inputmask="0x40"><bounds x="73" y="13" width="10" height="10" /><color alpha="0.4" /></bezel>
-
-		<bezel element="hl" inputtag="IN.0" inputmask="0x20"><bounds x="3" y="23" width="10" height="10" /><color alpha="0.4" /></bezel>
-		<bezel element="hl" inputtag="IN.1" inputmask="0x20"><bounds x="13" y="23" width="10" height="10" /><color alpha="0.2" /></bezel>
-		<bezel element="hl" inputtag="IN.2" inputmask="0x20"><bounds x="23" y="23" width="10" height="10" /><color alpha="0.4" /></bezel>
-		<bezel element="hl" inputtag="IN.3" inputmask="0x20"><bounds x="33" y="23" width="10" height="10" /><color alpha="0.2" /></bezel>
-		<bezel element="hl" inputtag="IN.4" inputmask="0x20"><bounds x="43" y="23" width="10" height="10" /><color alpha="0.4" /></bezel>
-		<bezel element="hl" inputtag="IN.5" inputmask="0x20"><bounds x="53" y="23" width="10" height="10" /><color alpha="0.2" /></bezel>
-		<bezel element="hl" inputtag="IN.6" inputmask="0x20"><bounds x="63" y="23" width="10" height="10" /><color alpha="0.4" /></bezel>
-		<bezel element="hl" inputtag="IN.7" inputmask="0x20"><bounds x="73" y="23" width="10" height="10" /><color alpha="0.2" /></bezel>
-
-		<bezel element="hl" inputtag="IN.0" inputmask="0x10"><bounds x="3" y="33" width="10" height="10" /><color alpha="0.2" /></bezel>
-		<bezel element="hl" inputtag="IN.1" inputmask="0x10"><bounds x="13" y="33" width="10" height="10" /><color alpha="0.4" /></bezel>
-		<bezel element="hl" inputtag="IN.2" inputmask="0x10"><bounds x="23" y="33" width="10" height="10" /><color alpha="0.2" /></bezel>
-		<bezel element="hl" inputtag="IN.3" inputmask="0x10"><bounds x="33" y="33" width="10" height="10" /><color alpha="0.4" /></bezel>
-		<bezel element="hl" inputtag="IN.4" inputmask="0x10"><bounds x="43" y="33" width="10" height="10" /><color alpha="0.2" /></bezel>
-		<bezel element="hl" inputtag="IN.5" inputmask="0x10"><bounds x="53" y="33" width="10" height="10" /><color alpha="0.4" /></bezel>
-		<bezel element="hl" inputtag="IN.6" inputmask="0x10"><bounds x="63" y="33" width="10" height="10" /><color alpha="0.2" /></bezel>
-		<bezel element="hl" inputtag="IN.7" inputmask="0x10"><bounds x="73" y="33" width="10" height="10" /><color alpha="0.4" /></bezel>
-
-		<bezel element="hl" inputtag="IN.0" inputmask="0x08"><bounds x="3" y="43" width="10" height="10" /><color alpha="0.4" /></bezel>
-		<bezel element="hl" inputtag="IN.1" inputmask="0x08"><bounds x="13" y="43" width="10" height="10" /><color alpha="0.2" /></bezel>
-		<bezel element="hl" inputtag="IN.2" inputmask="0x08"><bounds x="23" y="43" width="10" height="10" /><color alpha="0.4" /></bezel>
-		<bezel element="hl" inputtag="IN.3" inputmask="0x08"><bounds x="33" y="43" width="10" height="10" /><color alpha="0.2" /></bezel>
-		<bezel element="hl" inputtag="IN.4" inputmask="0x08"><bounds x="43" y="43" width="10" height="10" /><color alpha="0.4" /></bezel>
-		<bezel element="hl" inputtag="IN.5" inputmask="0x08"><bounds x="53" y="43" width="10" height="10" /><color alpha="0.2" /></bezel>
-		<bezel element="hl" inputtag="IN.6" inputmask="0x08"><bounds x="63" y="43" width="10" height="10" /><color alpha="0.4" /></bezel>
-		<bezel element="hl" inputtag="IN.7" inputmask="0x08"><bounds x="73" y="43" width="10" height="10" /><color alpha="0.2" /></bezel>
-
-		<bezel element="hl" inputtag="IN.0" inputmask="0x04"><bounds x="3" y="53" width="10" height="10" /><color alpha="0.2" /></bezel>
-		<bezel element="hl" inputtag="IN.1" inputmask="0x04"><bounds x="13" y="53" width="10" height="10" /><color alpha="0.4" /></bezel>
-		<bezel element="hl" inputtag="IN.2" inputmask="0x04"><bounds x="23" y="53" width="10" height="10" /><color alpha="0.2" /></bezel>
-		<bezel element="hl" inputtag="IN.3" inputmask="0x04"><bounds x="33" y="53" width="10" height="10" /><color alpha="0.4" /></bezel>
-		<bezel element="hl" inputtag="IN.4" inputmask="0x04"><bounds x="43" y="53" width="10" height="10" /><color alpha="0.2" /></bezel>
-		<bezel element="hl" inputtag="IN.5" inputmask="0x04"><bounds x="53" y="53" width="10" height="10" /><color alpha="0.4" /></bezel>
-		<bezel element="hl" inputtag="IN.6" inputmask="0x04"><bounds x="63" y="53" width="10" height="10" /><color alpha="0.2" /></bezel>
-		<bezel element="hl" inputtag="IN.7" inputmask="0x04"><bounds x="73" y="53" width="10" height="10" /><color alpha="0.4" /></bezel>
-
-		<bezel element="hl" inputtag="IN.0" inputmask="0x02"><bounds x="3" y="63" width="10" height="10" /><color alpha="0.4" /></bezel>
-		<bezel element="hl" inputtag="IN.1" inputmask="0x02"><bounds x="13" y="63" width="10" height="10" /><color alpha="0.2" /></bezel>
-		<bezel element="hl" inputtag="IN.2" inputmask="0x02"><bounds x="23" y="63" width="10" height="10" /><color alpha="0.4" /></bezel>
-		<bezel element="hl" inputtag="IN.3" inputmask="0x02"><bounds x="33" y="63" width="10" height="10" /><color alpha="0.2" /></bezel>
-		<bezel element="hl" inputtag="IN.4" inputmask="0x02"><bounds x="43" y="63" width="10" height="10" /><color alpha="0.4" /></bezel>
-		<bezel element="hl" inputtag="IN.5" inputmask="0x02"><bounds x="53" y="63" width="10" height="10" /><color alpha="0.2" /></bezel>
-		<bezel element="hl" inputtag="IN.6" inputmask="0x02"><bounds x="63" y="63" width="10" height="10" /><color alpha="0.4" /></bezel>
-		<bezel element="hl" inputtag="IN.7" inputmask="0x02"><bounds x="73" y="63" width="10" height="10" /><color alpha="0.2" /></bezel>
-
-		<bezel element="hl" inputtag="IN.0" inputmask="0x01"><bounds x="3" y="73" width="10" height="10" /><color alpha="0.2" /></bezel>
-		<bezel element="hl" inputtag="IN.1" inputmask="0x01"><bounds x="13" y="73" width="10" height="10" /><color alpha="0.4" /></bezel>
-		<bezel element="hl" inputtag="IN.2" inputmask="0x01"><bounds x="23" y="73" width="10" height="10" /><color alpha="0.2" /></bezel>
-		<bezel element="hl" inputtag="IN.3" inputmask="0x01"><bounds x="33" y="73" width="10" height="10" /><color alpha="0.4" /></bezel>
-		<bezel element="hl" inputtag="IN.4" inputmask="0x01"><bounds x="43" y="73" width="10" height="10" /><color alpha="0.2" /></bezel>
-		<bezel element="hl" inputtag="IN.5" inputmask="0x01"><bounds x="53" y="73" width="10" height="10" /><color alpha="0.4" /></bezel>
-		<bezel element="hl" inputtag="IN.6" inputmask="0x01"><bounds x="63" y="73" width="10" height="10" /><color alpha="0.2" /></bezel>
-		<bezel element="hl" inputtag="IN.7" inputmask="0x01"><bounds x="73" y="73" width="10" height="10" /><color alpha="0.4" /></bezel>
+		<bezel script="return click(1,1,':IN.0',0x80)" element="hl" inputtag="IN.0" inputmask="0x80"><bounds x="3" y="3" width="10" height="10" /><color alpha="0.4" /></bezel>
+		<bezel script="return click(1,2,':IN.1',0x80)" element="hl" inputtag="IN.1" inputmask="0x80"><bounds x="13" y="3" width="10" height="10" /><color alpha="0.2" /></bezel>
+		<bezel script="return click(1,3,':IN.2',0x80)" element="hl" inputtag="IN.2" inputmask="0x80"><bounds x="23" y="3" width="10" height="10" /><color alpha="0.4" /></bezel>
+		<bezel script="return click(1,4,':IN.3',0x80)" element="hl" inputtag="IN.3" inputmask="0x80"><bounds x="33" y="3" width="10" height="10" /><color alpha="0.2" /></bezel>
+		<bezel script="return click(1,5,':IN.4',0x80)" element="hl" inputtag="IN.4" inputmask="0x80"><bounds x="43" y="3" width="10" height="10" /><color alpha="0.4" /></bezel>
+		<bezel script="return click(1,6,':IN.5',0x80)" element="hl" inputtag="IN.5" inputmask="0x80"><bounds x="53" y="3" width="10" height="10" /><color alpha="0.2" /></bezel>
+		<bezel script="return click(1,7,':IN.6',0x80)" element="hl" inputtag="IN.6" inputmask="0x80"><bounds x="63" y="3" width="10" height="10" /><color alpha="0.4" /></bezel>
+		<bezel script="return click(1,8,':IN.7',0x80)" element="hl" inputtag="IN.7" inputmask="0x80"><bounds x="73" y="3" width="10" height="10" /><color alpha="0.2" /></bezel>
+
+		<bezel script="return click(2,1,':IN.0',0x40)" element="hl" inputtag="IN.0" inputmask="0x40"><bounds x="3" y="13" width="10" height="10" /><color alpha="0.2" /></bezel>
+		<bezel script="return click(2,2,':IN.1',0x40)" element="hl" inputtag="IN.1" inputmask="0x40"><bounds x="13" y="13" width="10" height="10" /><color alpha="0.4" /></bezel>
+		<bezel script="return click(2,3,':IN.2',0x40)" element="hl" inputtag="IN.2" inputmask="0x40"><bounds x="23" y="13" width="10" height="10" /><color alpha="0.2" /></bezel>
+		<bezel script="return click(2,4,':IN.3',0x40)" element="hl" inputtag="IN.3" inputmask="0x40"><bounds x="33" y="13" width="10" height="10" /><color alpha="0.4" /></bezel>
+		<bezel script="return click(2,5,':IN.4',0x40)" element="hl" inputtag="IN.4" inputmask="0x40"><bounds x="43" y="13" width="10" height="10" /><color alpha="0.2" /></bezel>
+		<bezel script="return click(2,6,':IN.5',0x40)" element="hl" inputtag="IN.5" inputmask="0x40"><bounds x="53" y="13" width="10" height="10" /><color alpha="0.4" /></bezel>
+		<bezel script="return click(2,7,':IN.6',0x40)" element="hl" inputtag="IN.6" inputmask="0x40"><bounds x="63" y="13" width="10" height="10" /><color alpha="0.2" /></bezel>
+		<bezel script="return click(2,8,':IN.7',0x40)" element="hl" inputtag="IN.7" inputmask="0x40"><bounds x="73" y="13" width="10" height="10" /><color alpha="0.4" /></bezel>
+
+		<bezel script="return click(3,1,':IN.0',0x20)" element="hl" inputtag="IN.0" inputmask="0x20"><bounds x="3" y="23" width="10" height="10" /><color alpha="0.4" /></bezel>
+		<bezel script="return click(3,2,':IN.1',0x20)" element="hl" inputtag="IN.1" inputmask="0x20"><bounds x="13" y="23" width="10" height="10" /><color alpha="0.2" /></bezel>
+		<bezel script="return click(3,3,':IN.2',0x20)" element="hl" inputtag="IN.2" inputmask="0x20"><bounds x="23" y="23" width="10" height="10" /><color alpha="0.4" /></bezel>
+		<bezel script="return click(3,4,':IN.3',0x20)" element="hl" inputtag="IN.3" inputmask="0x20"><bounds x="33" y="23" width="10" height="10" /><color alpha="0.2" /></bezel>
+		<bezel script="return click(3,5,':IN.4',0x20)" element="hl" inputtag="IN.4" inputmask="0x20"><bounds x="43" y="23" width="10" height="10" /><color alpha="0.4" /></bezel>
+		<bezel script="return click(3,6,':IN.5',0x20)" element="hl" inputtag="IN.5" inputmask="0x20"><bounds x="53" y="23" width="10" height="10" /><color alpha="0.2" /></bezel>
+		<bezel script="return click(3,7,':IN.6',0x20)" element="hl" inputtag="IN.6" inputmask="0x20"><bounds x="63" y="23" width="10" height="10" /><color alpha="0.4" /></bezel>
+		<bezel script="return click(3,8,':IN.7',0x20)" element="hl" inputtag="IN.7" inputmask="0x20"><bounds x="73" y="23" width="10" height="10" /><color alpha="0.2" /></bezel>
+
+		<bezel script="return click(4,1,':IN.0',0x10)" element="hl" inputtag="IN.0" inputmask="0x10"><bounds x="3" y="33" width="10" height="10" /><color alpha="0.2" /></bezel>
+		<bezel script="return click(4,2,':IN.1',0x10)" element="hl" inputtag="IN.1" inputmask="0x10"><bounds x="13" y="33" width="10" height="10" /><color alpha="0.4" /></bezel>
+		<bezel script="return click(4,3,':IN.2',0x10)" element="hl" inputtag="IN.2" inputmask="0x10"><bounds x="23" y="33" width="10" height="10" /><color alpha="0.2" /></bezel>
+		<bezel script="return click(4,4,':IN.3',0x10)" element="hl" inputtag="IN.3" inputmask="0x10"><bounds x="33" y="33" width="10" height="10" /><color alpha="0.4" /></bezel>
+		<bezel script="return click(4,5,':IN.4',0x10)" element="hl" inputtag="IN.4" inputmask="0x10"><bounds x="43" y="33" width="10" height="10" /><color alpha="0.2" /></bezel>
+		<bezel script="return click(4,6,':IN.5',0x10)" element="hl" inputtag="IN.5" inputmask="0x10"><bounds x="53" y="33" width="10" height="10" /><color alpha="0.4" /></bezel>
+		<bezel script="return click(4,7,':IN.6',0x10)" element="hl" inputtag="IN.6" inputmask="0x10"><bounds x="63" y="33" width="10" height="10" /><color alpha="0.2" /></bezel>
+		<bezel script="return click(4,8,':IN.7',0x10)" element="hl" inputtag="IN.7" inputmask="0x10"><bounds x="73" y="33" width="10" height="10" /><color alpha="0.4" /></bezel>
+
+		<bezel script="return click(5,1,':IN.0',0x08)" element="hl" inputtag="IN.0" inputmask="0x08"><bounds x="3" y="43" width="10" height="10" /><color alpha="0.4" /></bezel>
+		<bezel script="return click(5,2,':IN.1',0x08)" element="hl" inputtag="IN.1" inputmask="0x08"><bounds x="13" y="43" width="10" height="10" /><color alpha="0.2" /></bezel>
+		<bezel script="return click(5,3,':IN.2',0x08)" element="hl" inputtag="IN.2" inputmask="0x08"><bounds x="23" y="43" width="10" height="10" /><color alpha="0.4" /></bezel>
+		<bezel script="return click(5,4,':IN.3',0x08)" element="hl" inputtag="IN.3" inputmask="0x08"><bounds x="33" y="43" width="10" height="10" /><color alpha="0.2" /></bezel>
+		<bezel script="return click(5,5,':IN.4',0x08)" element="hl" inputtag="IN.4" inputmask="0x08"><bounds x="43" y="43" width="10" height="10" /><color alpha="0.4" /></bezel>
+		<bezel script="return click(5,6,':IN.5',0x08)" element="hl" inputtag="IN.5" inputmask="0x08"><bounds x="53" y="43" width="10" height="10" /><color alpha="0.2" /></bezel>
+		<bezel script="return click(5,7,':IN.6',0x08)" element="hl" inputtag="IN.6" inputmask="0x08"><bounds x="63" y="43" width="10" height="10" /><color alpha="0.4" /></bezel>
+		<bezel script="return click(5,8,':IN.7',0x08)" element="hl" inputtag="IN.7" inputmask="0x08"><bounds x="73" y="43" width="10" height="10" /><color alpha="0.2" /></bezel>
+
+		<bezel script="return click(6,1,':IN.0',0x04)" element="hl" inputtag="IN.0" inputmask="0x04"><bounds x="3" y="53" width="10" height="10" /><color alpha="0.2" /></bezel>
+		<bezel script="return click(6,2,':IN.1',0x04)" element="hl" inputtag="IN.1" inputmask="0x04"><bounds x="13" y="53" width="10" height="10" /><color alpha="0.4" /></bezel>
+		<bezel script="return click(6,3,':IN.2',0x04)" element="hl" inputtag="IN.2" inputmask="0x04"><bounds x="23" y="53" width="10" height="10" /><color alpha="0.2" /></bezel>
+		<bezel script="return click(6,4,':IN.3',0x04)" element="hl" inputtag="IN.3" inputmask="0x04"><bounds x="33" y="53" width="10" height="10" /><color alpha="0.4" /></bezel>
+		<bezel script="return click(6,5,':IN.4',0x04)" element="hl" inputtag="IN.4" inputmask="0x04"><bounds x="43" y="53" width="10" height="10" /><color alpha="0.2" /></bezel>
+		<bezel script="return click(6,6,':IN.5',0x04)" element="hl" inputtag="IN.5" inputmask="0x04"><bounds x="53" y="53" width="10" height="10" /><color alpha="0.4" /></bezel>
+		<bezel script="return click(6,7,':IN.6',0x04)" element="hl" inputtag="IN.6" inputmask="0x04"><bounds x="63" y="53" width="10" height="10" /><color alpha="0.2" /></bezel>
+		<bezel script="return click(6,8,':IN.7',0x04)" element="hl" inputtag="IN.7" inputmask="0x04"><bounds x="73" y="53" width="10" height="10" /><color alpha="0.4" /></bezel>
+
+		<bezel script="return click(7,1,':IN.0',0x02)" element="hl" inputtag="IN.0" inputmask="0x02"><bounds x="3" y="63" width="10" height="10" /><color alpha="0.4" /></bezel>
+		<bezel script="return click(7,2,':IN.1',0x02)" element="hl" inputtag="IN.1" inputmask="0x02"><bounds x="13" y="63" width="10" height="10" /><color alpha="0.2" /></bezel>
+		<bezel script="return click(7,3,':IN.2',0x02)" element="hl" inputtag="IN.2" inputmask="0x02"><bounds x="23" y="63" width="10" height="10" /><color alpha="0.4" /></bezel>
+		<bezel script="return click(7,4,':IN.3',0x02)" element="hl" inputtag="IN.3" inputmask="0x02"><bounds x="33" y="63" width="10" height="10" /><color alpha="0.2" /></bezel>
+		<bezel script="return click(7,5,':IN.4',0x02)" element="hl" inputtag="IN.4" inputmask="0x02"><bounds x="43" y="63" width="10" height="10" /><color alpha="0.4" /></bezel>
+		<bezel script="return click(7,6,':IN.5',0x02)" element="hl" inputtag="IN.5" inputmask="0x02"><bounds x="53" y="63" width="10" height="10" /><color alpha="0.2" /></bezel>
+		<bezel script="return click(7,7,':IN.6',0x02)" element="hl" inputtag="IN.6" inputmask="0x02"><bounds x="63" y="63" width="10" height="10" /><color alpha="0.4" /></bezel>
+		<bezel script="return click(7,8,':IN.7',0x02)" element="hl" inputtag="IN.7" inputmask="0x02"><bounds x="73" y="63" width="10" height="10" /><color alpha="0.2" /></bezel>
+
+		<bezel script="return click(8,1,':IN.0',0x01)" element="hl" inputtag="IN.0" inputmask="0x01"><bounds x="3" y="73" width="10" height="10" /><color alpha="0.2" /></bezel>
+		<bezel script="return click(8,2,':IN.1',0x01)" element="hl" inputtag="IN.1" inputmask="0x01"><bounds x="13" y="73" width="10" height="10" /><color alpha="0.4" /></bezel>
+		<bezel script="return click(8,3,':IN.2',0x01)" element="hl" inputtag="IN.2" inputmask="0x01"><bounds x="23" y="73" width="10" height="10" /><color alpha="0.2" /></bezel>
+		<bezel script="return click(8,4,':IN.3',0x01)" element="hl" inputtag="IN.3" inputmask="0x01"><bounds x="33" y="73" width="10" height="10" /><color alpha="0.4" /></bezel>
+		<bezel script="return click(8,5,':IN.4',0x01)" element="hl" inputtag="IN.4" inputmask="0x01"><bounds x="43" y="73" width="10" height="10" /><color alpha="0.2" /></bezel>
+		<bezel script="return click(8,6,':IN.5',0x01)" element="hl" inputtag="IN.5" inputmask="0x01"><bounds x="53" y="73" width="10" height="10" /><color alpha="0.4" /></bezel>
+		<bezel script="return click(8,7,':IN.6',0x01)" element="hl" inputtag="IN.6" inputmask="0x01"><bounds x="63" y="73" width="10" height="10" /><color alpha="0.2" /></bezel>
+		<bezel script="return click(8,8,':IN.7',0x01)" element="hl" inputtag="IN.7" inputmask="0x01"><bounds x="73" y="73" width="10" height="10" /><color alpha="0.4" /></bezel>
 
 	<!-- right side -->
 
Posted By: Just Desserts

Re: New Fidelity chess modules - 04/18/16 02:14 PM

Originally Posted By fhub
WOW, that's all? No other files need to be changed?

That would have saved me (and my poor notebook) a lot of time. wink


Even the developers think that MAME is too large to regularly do full builds except at release time, so we have made it very easy for ourselves to make build time as short as possible. It just happens to make the lives of external contributors a lot easier too! wink
Posted By: fhub

Re: New Fidelity chess modules - 04/18/16 02:30 PM

Originally Posted By crazyc
Here's a current diff. Some things will change though as it doesn't quite work as I'd expected.

Thanks!

I see it's not so much different to a driver solution, it just has the advantage that it can be done (and modified!) externally
by the user without needing to compile anything.

The most complicated things for such a chess module are some 'special' moves like enpassant or promotion -
it took me quite a long time to get these features working.

If anyone is interested - here's my current version for the Fidelity Elite Avantgarde modules (feagv2/7/10/11):
http://www29.zippyshare.com/v/ik5aWWiC/file.html

It's almost complete, only setting up positions (PB) and taking back capture moves (TB) are not yet implemented -
but all other functions are working, i.e. you can definitely play a full chess game.

Franz
Posted By: fhub

Re: New Fidelity chess modules - 04/18/16 04:11 PM

I hope I don't annoy anyone, but I'd have 2 more (rather technical) questions about MAME for my chess version:

1) as suggested I'm using the following timer:
MCFG_TIMER_DRIVER_ADD_PERIODIC("input_peek", fidel68k_state, input_peek, attotime::from_msec(someinterval))
What would be a good (or usual) value for someinterval?
I'm using 50 (msec) at the moment, but I don't know if this is ok!? (at least it works)
And what would happen if this timer interval is made too short, i.e. what if the code from the last timer call is not yet finished when the timer wants to fire up the next call?
(I guess this call would then just be skipped, else the code would get into big troubles, right?)

2) And now something that would be very handy for chess modules:
is it possible to 'simulate' a mouse-click via code in the driver, so that the module believes that I would have clicked on any chessboard field (or button), although I did not?
My main code is in TIMER_DEVICE_CALLBACK_MEMBER(fidel68k_state::input_peek), and I'm using m_inp_matrix[0]->read() to check for mouseclicks, but how to simulate such a mouse-click?
I've tried it with m_inp_matrix[0]->write(xx) instead of read(), but this didn' seem to work.
So is this possible at all?
(would be quite comfortable for capture moves, which require 3 clicks instead of 2 for other moves).

Franz
Posted By: hap

Re: New Fidelity chess modules - 04/18/16 05:57 PM

1) Don't worry about that, emulation runs in a single thread and the code in the timer will never be called while it's still inside the function. I'd use shorter intervals than 50ms, you know mouseclicks can be pretty short.

2) Not a bad idea IMO, please post it on github: https://github.com/mamedev/mame/issues
We used to be against this kind of feature, for fear of people abusing it to make money with MAME in arcade cabs. Another use of this would be to enable auto-power on/off button on MAME start or exit, related: https://github.com/mamedev/mame/issues/728
Posted By: R. Belmont

Re: New Fidelity chess modules - 04/18/16 06:18 PM

We're *still* against it for fear of people abusing it to make money. Just have a driver variable that you OR with the real inputs and stuff your fake input into that.
Posted By: hap

Re: New Fidelity chess modules - 04/18/16 06:37 PM

Not me, so not "we" either smile
Yeah it's a workaround, I'm doing that exact thing here: http://git.redump.net/mame/tree/src/mame/drivers/k28.cpp#n309

crazyc: hh_tms1k.cpp mdndclab is a good testcase for something not-chess. It also requires being able to rotate pieces and putting them next to buttons.
Another one, this time a chess computer again, is the Fidelity Phantom, which I hope to get emulated soon. The special feature in this one is the computer can move chesspieces by itself using a magnet underneath the board.
Posted By: fhub

Re: New Fidelity chess modules - 04/18/16 07:51 PM

Originally Posted By hap
I'd use shorter intervals than 50ms, you know mouseclicks can be pretty short.

Ok, I'll try it with 10 ms - it's *your* fault then, if it crashes. wink
Quote:

2) Not a bad idea IMO, please post it on github: https://github.com/mamedev/mame/issues

Well, I don't want to create one more account just for this problem - and they certainly won't change it only because I would like this feature (see Belmont's answer).
Originally Posted By hap

Yeah it's a workaround, I'm doing that exact thing here: http://git.redump.net/mame/tree/src/mame/drivers/k28.cpp#n309

But that won't help for my problem, would it?
The problem is not that the *code* in the driver should believe that a mouseclick has happened, the *module* itself is waiting for a mouseclick - or am I misunderstanding something here, i.e. would it indeed be possible with such a trick?
Posted By: Just Desserts

Re: New Fidelity chess modules - 04/18/16 08:15 PM

Originally Posted By fhub
Well, I don't want to create one more account just for this problem - and they certainly won't change it only because I would like this feature (see Belmont's answer).


Well, actually, hap is a developer on the project also, and he's in charge of the Chess drivers right now. "They" are the same people as hap, so I assure you, if hap is suggesting you do something, it means that developers are interested in doing it. smile
Posted By: R. Belmont

Re: New Fidelity chess modules - 04/18/16 08:54 PM

Yeah, my answer just means it's controversial amongst the devs (there are technical reasons I would oppose it as well), not that you should never suggest it. We've done a *lot* of controversial things in the last 12 months, and there's several more percolating.
Posted By: crazyc

Re: New Fidelity chess modules - 04/18/16 11:51 PM

Originally Posted By hap
crazyc: hh_tms1k.cpp mdndclab is a good testcase for something not-chess. It also requires being able to rotate pieces and putting them next to buttons.
It looks like there's no way to automatically set the walls when the player finds them without peeking into the cpu ram (which could be done but would kind of violate the separation that using scripts gains). The user could set the walls themselves though which is more accurate.
Posted By: hap

Re: New Fidelity chess modules - 04/19/16 10:56 AM

Originally Posted By fhub
But that won't help for my problem, would it?
The problem is not that the *code* in the driver should believe that a mouseclick has happened, the *module* itself is waiting for a mouseclick - or am I misunderstanding something here, i.e. would it indeed be possible with such a trick?
It's not a trick and yes it will work fine. I'm not going to write this new code for you, you can figure it out now that you kinda know how timers work and such. =)
Posted By: crazyc

Re: New Fidelity chess modules - 04/19/16 09:55 PM

The only reliable way to set the walls in mdndclab that I've found is to create an ioport field for every wall location (112) and check for clicks that why (scripts aren't even needed, just use PORT_TOGGLE). It also might be possible to use the crosshair to get the coordinates and find what area was clicked on that way. Of course, those are really ugly. There doesn't appear to be a way to create an ioport at runtime and there's no way to get the input layer to set the port to a unique value assigned to the clicked area.
Posted By: fhub

Re: New Fidelity chess modules - 04/20/16 03:32 PM

Originally Posted By hap

It's not a trick and yes it will work fine. I'm not going to write this new code for you, you can figure it out now that you kinda know how timers work and such. =)

Well, I'm still no MAME expert, so I've no idea how to realize this.
But no problem, I've now reached a more important issue, where I also don't know how to solve it:

I've now implemented the code for the problem/setup mode (key PB), and in principle it's working fine (although the Fidelity's method of changing between white and black pieces is more than complicated), but there's one feature which still doesn't work.
In this setup mode clicking on OPTION has the function of clearing the board (i.e. removing all pieces). Ok, so I'm clearing my board matrix 'm_board[]' and remove all pieces from the display - BUT: the Fidelity module is still thinking, that all pieces are still on the board!
It doesn't really show them (all LEDs are OFF), but if I switch back to the normal play mode, then all 32 LEDs (for the pieces in the 2 top and bottom rows) are suddenly ON again!?
The module seems to have still all pieces stored anywhere internally, although having executed this 'clear board' function.

Of course it would be possible to remove all these 'hidden' pieces manually by clicking on each of the fields where the LED is ON, but that's not what would expect from a 'clear board'.

So how can I do what the module does not do itself correctly?
How can I set, toggle or clear any bits which are responsible for these internally stored pieces, i.e. reset the internal board to an empty array?

1) A method to directly write into the module's memory is certainly too complicated (and maybe not even possible), and would require to know WHERE and HOW the board is stored.
2) Doing it with 'simulated' mouseclicks may be an other method, but that's just the problem we had in the last few postings here, so also not applicable.
3) And the last method that I could imagine, would be to load an empty board via a special config file (like the usual *.cfg files in the 'cfg' folder), but I don't know how this could be done, or if this would be possible at all while the emulation is already running.

Any hints to solve this problem are greatly appreciated ... wink

Franz
Posted By: hap

Re: New Fidelity chess modules - 04/20/16 07:54 PM

To be honest, I think it's getting very convoluted. I can't help you much other than suggest you to let the UI be as-is, meaning that it's done the same way as the real thing. Maybe provide a link to the original manual too if users don't know how to set things up.
Posted By: fhub

Re: New Fidelity chess modules - 04/20/16 09:19 PM

Well, I won't say that there's anything convoluted - I just want to make the driver work as expected. And the manual says, that using OPTION in the setup mode clears the board internally - but it does not do it! And so I try to find a method to do what the module *should* do.
(just imagine you want to setup a chess position with only a few pieces, but you have to remove all 20-25 other pieces before - not really funny!)

I just need to know one thing, which I'll explain here with the following example:

In the fidel68k driver there's this code:
Code:
INPUT_PORTS_START( eag )
	PORT_START("IN.0")
	PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square a1") 

If I change IP_ACTIVE_HIGH to IP_ACTIVE_LOW (and recompile the driver), then this changes the status of the LED on the square a1 when the module is started.

And there's also something related in the config file feagv10.cfg:
Code:
<port tag=":IN.0" type="KEYPAD" mask="128" defvalue="0" value="128" />

And again, changing this from value="128" to value="0" also changes the status of the LED on square a1 after the start.

So this "IN.0" seems to be the internal state of a piece on a1 (piece is there or not), and I just want to know if and how I can change this status-bit in the driver (i.e. in my timer code).

I can read out this with m_inp_matrix[0]->read(), but how can I change a single bit (or the whole byte) in this matrix?
Using write(xx) instead of read() doesn't seem to work, but I'm sure that this must be possible anyhow - I've just too little experience with MAME to do this without help, that's why I'm asking here!

Franz
Posted By: hap

Re: New Fidelity chess modules - 04/20/16 09:48 PM

That input matrix represents the magnet sensors. Of course chesspieces won't magically replace themselves if you press that button. Maybe you should get rid of PORT_TOGGLE in this case?

You can force change the input matrix at the place where it is read, by ORing or ANDing with a mask, eg. when row=0, | 0x80, or & 0x7f for square a1. Again, I'm not going to write the code for you, I gave up, sorry.
Posted By: fhub

Re: New Fidelity chess modules - 04/24/16 10:24 AM

Ok,
my last trial (after having tried to solve it myself for 3 days now without success):
(not addressed to 'hap', because he is already annoyed and doesn't want to help me with this problem)

The following line in the configuration file 'feagv10.cfg'
Code:
<input>
    <port tag=":IN.0" type="KEYPAD" mask="128" defvalue="0" value="128" />
</input>

puts a chess piece on the field "a1" of the Fidelity's internal chess board (when the moduls starts).

The corresponding definition in the 'fidel68.cpp' driver is:
Code:
static INPUT_PORTS_START( eag )
    PORT_START("IN.0")
    ...
    PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square a1")
    ...
INPUT_PORTS_END


Now the question:
Is it possible to achieve the same effect (just like this line above in the config file) with any code in the driver (after the machine has already started)?

Franz
Posted By: crazyc

Re: New Fidelity chess modules - 04/25/16 03:36 AM


Click to set walls.
Posted By: etabeta78

Re: New Fidelity chess modules - 04/25/16 05:08 AM

amazing!
Posted By: R. Belmont

Re: New Fidelity chess modules - 04/25/16 12:16 PM

That's awesome smile
Posted By: crazyc

Re: New Fidelity chess modules - 04/25/16 12:45 PM

It's mostly hap's work. Just showing I've found a solution to my previous issue.
Posted By: Dullaron

Re: New Fidelity chess modules - 04/25/16 12:45 PM

What is that?
Posted By: crazyc

Re: New Fidelity chess modules - 04/25/16 12:54 PM

https://youtu.be/eGwsw8hRT7s?t=1m39s
Posted By: Dullaron

Re: New Fidelity chess modules - 04/25/16 12:58 PM

Oh a castle game. Make sense now. smile
Posted By: fhub

Re: New Fidelity chess modules - 05/01/16 12:28 PM

Just in case anyone is interested - here's my final version for the Fidelity Elite Avantgarde (no ROMs included!):
http://www73.zippyshare.com/v/6pTyIWHk/file.html

Now it supports ALL features of these 4 chess modules (feagv2/7/10/11), e.g. setting up positions, taking back moves, etc...
(the new small chess pieces at the bottom of the board are needed e.g. for putting back captured pieces when you take back a capture move).

Franz
Posted By: Anna Wu

Re: New Fidelity chess modules - 05/01/16 02:49 PM

Originally Posted By fhub
Just in case anyone is interested - here's my final version for the Fidelity Elite Avantgarde (no ROMs included!):
http://www73.zippyshare.com/v/6pTyIWHk/file.html

Now it supports ALL features of these 4 chess modules (feagv2/7/10/11), e.g. setting up positions, taking back moves, etc...
(the new small chess pieces at the bottom of the board are needed e.g. for putting back captured pieces when you take back a capture move).

Franz


I like it. smile

feagv11
Posted By: fhub

Re: New Fidelity chess modules - 05/01/16 03:06 PM

Originally Posted By Anna Wu

I like it. smile

Nice to hear that, Anna! smile
Quote:

feagv11

One remark about this V11 version:
some time ago 'hap' has changed the clock frequency of this module from 72 to 144MHz, because the M68060 is not yet supported in MAME.
After this double speed (2*72MHz) not only the beeper is too high (that's not really a problem), but also the clock is running much too slow (about half the speed) and the whole module's reaction is much slower than normal (even the startup takes much longer).
It seems this 144MHz setting is just too high and the V11 module is not working correctly, so I've set it back to the previous 72MHz - maybe now the V11 is indeed not running with the same speed as the original machine, but at least its reaction time and the clock are behaving normally again (and you can always set it to 200% in the options menu, if you want).
For a real emulation we'll have to wait until M68060 support is implemented in MAME.

Franz
Posted By: Anna Wu

Re: New Fidelity chess modules - 05/01/16 03:32 PM

The MESSUI build for themselves seems to be buggy.
Example: Customise Fields

Posted By: fhub

Re: New Fidelity chess modules - 05/01/16 04:36 PM

Originally Posted By Anna Wu
The MESSUI build for themselves seems to be buggy.
Example: Customise Fields

Yep, I've also noticed this, and there are many other bugs, too.
For example, I can save the state of the feagv modules, but when I try to load such a state again, MessUI crashes.

Maybe I should recompile the Fidelity program as a plain MAME program (without the MESS GUI), but I've never tried this before (I don't even know how MAME looks like) - I just preferred MESSUI, because it's more a usual Windows program (unlike MESS).

Franz
Posted By: R. Belmont

Re: New Fidelity chess modules - 05/01/16 05:45 PM

It's likely at 144 MHz that your PC is too weak to handle the emulation; pressing F11 to show the % speed emulation is running at would verify that.
Posted By: fhub

Re: New Fidelity chess modules - 05/01/16 07:30 PM

Originally Posted By R. Belmont
It's likely at 144 MHz that your PC is too weak to handle the emulation; pressing F11 to show the % speed emulation is running at would verify that.

OMG, I would have never imagined that my notebook (Core2Duo @ 2GHZ) would be too slow for such an emulation.
But you were right, for 144MHz it shows about 70% speed - thanks for your hint!

I've now also tried 108MHz (3x36 instead of 4), but even this gives only 90%, so my decision to switch back to the original 76MHz was right.

BTW, I've now also made a MAME compile (instead of MESS), but I can't get the mouse working in the chess module (although it works in the MAME GUI). I've tried every setting in the option menus which have anything to do with mouse support, but without success.
In MESS (not the UI version), which BTW looks identical to MAME, the mouse works without problems, so I guess I'll stay with MESS.

Franz
Posted By: R. Belmont

Re: New Fidelity chess modules - 05/01/16 07:35 PM

If it works in MESS but not MAME, the difference has to be in the settings. Try copying your mess.ini to mame.ini and see if that helps.
Posted By: Anna Wu

Re: New Fidelity chess modules - 05/01/16 07:38 PM

Originally Posted By fhub

Maybe I should recompile the Fidelity program as a plain MAME program (without the MESS GUI), but I've never tried this before (I don't even know how MAME looks like) - I just preferred MESSUI, because it's more a usual Windows program (unlike MESS).

Franz


Try the MESS with NewUI.
http://messui.1emulation.com/
Posted By: fhub

Re: New Fidelity chess modules - 05/01/16 07:39 PM

Well, just tried it (using mess.ini as mame.ini), but no change. Whenever I load the any chess module, the mouse disappears.
Posted By: fhub

Re: New Fidelity chess modules - 05/01/16 07:50 PM

Originally Posted By Anna Wu

Try the MESS with NewUI.
http://messui.1emulation.com/

Yes, that's indeed my source, and I've always compiled both versions (mess and messui). Now after having compiled also a mame.exe, I see that it's in fact the same GUI as mess.exe (only about 50% bigger EXE), but the mouse doesn't work in a loaded module.
Posted By: Anna Wu

Re: New Fidelity chess modules - 05/01/16 07:50 PM

Originally Posted By fhub
Well, just tried it (using mess.ini as mame.ini), but no change. Whenever I load the any chess module, the mouse disappears.


You have the same problem with Rob(bb)ert's build if you load a official chess module?
His MESS version is not the standard one with the internal menu (TAB) only but, it is MESS with NewUI.
I was not talking about MESSUI.
Posted By: fhub

Re: New Fidelity chess modules - 05/01/16 07:57 PM

Originally Posted By Anna Wu

You have the same problem with Rob(bb)ert's build if you load a official chess module?
His MESS version is not the standard one with the internal menu (TAB) only but, it is MESS with NewUI.

No, in his MESS the mouse works fine.
I've always built both versions (mess and messui), and in both there are no mouse problems, but I like messui more, because its handling is just like in any other Windows program, and IMO more comfortable.
Posted By: Anna Wu

Re: New Fidelity chess modules - 05/01/16 08:02 PM

Originally Posted By fhub
Originally Posted By Anna Wu

You have the same problem with Rob(bb)ert's build if you load a official chess module?
His MESS version is not the standard one with the internal menu (TAB) only but, it is MESS with NewUI.

No, in his MESS the mouse works fine.
I've always built both versions (mess and messui), and in both there are no mouse problems, but I like messui more, because its handling is just like in any other Windows program, and IMO more comfortable.


Maybe Rob(bb)ert can help to solve your problem?
Posted By: fhub

Re: New Fidelity chess modules - 05/01/16 08:07 PM

Originally Posted By Anna Wu

Maybe Rob(bb)ert can help to solve your problem?

Well, that's not really necessary, because the problem exists only in the MAME compile, not in MESS or MESSUI, so I just don't use MAME and I have no problem at all. wink
Posted By: Anna Wu

Re: New Fidelity chess modules - 05/01/16 08:11 PM

Originally Posted By fhub
Originally Posted By Anna Wu

Maybe Rob(bb)ert can help to solve your problem?

Well, that's not really necessary, because the problem exists only in the MAME compile, not in MESS or MESSUI, so I just don't use MAME and I have no problem at all. wink

I stoppped to compile MAME/MESS a long time ago because of some MinGW problems on WinXP but this is another long story. ; )
Posted By: Darkstar

Re: New Fidelity chess modules - 05/01/16 09:21 PM

Originally Posted By Anna Wu
I stoppped to compile MAME/MESS a long time ago because of some MinGW problems on WinXP but this is another long story. ; )

You could install Windows 7 (or any other) in a VM and compile with that smile
Posted By: fhub

Re: New Fidelity chess modules - 05/05/16 01:50 PM

Hi,

the Fidelity modules feagv use "nvram" as defined here:
AM_RANGE(0x00e04000, 0x00e07fff) AM_RAM AM_SHARE("nvram")

One byte of this nvram (0x2b) has the information if the chessboard is turned (white pieces on top instead of on bottom).

How can I read this byte in the driver, so that I can setup the correct startup position?
Posted By: fhub

Re: New Fidelity chess modules - 05/06/16 03:16 PM

Originally Posted By fhub
Hi,

the Fidelity modules feagv use "nvram" as defined here:
AM_RANGE(0x00e04000, 0x00e07fff) AM_RAM AM_SHARE("nvram")

One byte of this nvram (0x2b) has the information if the chessboard is turned (white pieces on top instead of on bottom).

How can I read this byte in the driver, so that I can setup the correct startup position?

What's up - no answer yet? frown

Does here really nobody know how to access a byte in a module's RAM (not even the MAME experts)?
Or do you just not WANT to help me with this problem? (in this case I guess I should better leave this forum)

What I've tried myself so far:
running the feagv10 module in the debugger, I can see this byte at address 0x00e04028,
it changes its value between 0x00 and 0x80 when I turn the chessboard.
Now searching through many MAME drivers I've found something that looked promising to me,
so I've tried it with the following code:
UINT8 *ram = memregion("maincpu")->base();
And then tried to get this byte with ram[0x1e04028].
But it just doesn't return the expected values (0x00 or 0x80), so there's something seriously wrong in my trial.

Could please anyone tell me, what would be the right method to access this byte in the driver?

Franz
Posted By: R. Belmont

Re: New Fidelity chess modules - 05/06/16 03:31 PM

To your class definition, add these at the right place:

m_nvram(*this, "nvram"),


required_shared_ptr<UINT16> m_nvram; (16 can be 8 or 32 depending on what size the CPU's data bus is)

Then you can get a pointer with m_nvram->target(). Fair warning: MAME stores memory for big-endian CPUs in little-endian order on x86/x64 hosts as a speed optimization, so when you go poking around manually you need to be very careful.

Searching for AM_SHARE in src/mame/drivers would've found you many examples to copy, for future reference. Any time I encounter something I don't know how to use or don't remember the details of, I run a file search for other uses.
Posted By: fhub

Re: New Fidelity chess modules - 05/06/16 03:40 PM

Aaah, if that really works, then you've saved my day! smile

This was almost the last missing feature in my Fidelity code -
well, one other is still missing (simulating a mouse-click),
but you already said that you won't reveal this secret
(or have you changed your mind in the meantime? wink )

Many thanks,
Franz
Posted By: fhub

Re: New Fidelity chess modules - 05/06/16 05:30 PM

Well, it was too good to be true - it doesn't work. frown

Here's the class definition:
Code:
class fidel68k_state : public fidelz80base_state
{
public:
	fidel68k_state(const machine_config &mconfig, device_type type, const char *tag)
		: fidelz80base_state(mconfig, type, tag),
        m_nvram(*this, "nvram"),
        ...
	{ }

        required_shared_ptr<UINT16> m_nvram;
        ...
}

And now I try to use it here in my code
Code:
        ...
	UINT16 *ram = m_nvram->target();
        ...

and get this error message from the compiler:
Code:
../../../../../src/mame/drivers/fidel68k.cpp:229:25: error: request for member '
target' in '*((fidel68k_state*)this)->fidel68k_state::m_nvram.required_shared_pt
r<short unsigned int>::<anonymous>.shared_ptr_finder<short unsigned int, true>::
<anonymous>.object_finder_base<_ObjectClass>::operator-><short unsigned int>()',
 which is of non-class type 'short unsigned int'
  UINT16 *ram = m_nvram->target();
                         ^

Searching the driver directory I couldn't find this 'target()' in any sources, so I guess this may be the problem!?
Posted By: R. Belmont

Re: New Fidelity chess modules - 05/06/16 05:47 PM

Should be .target, not ->. That's my bad. Quoting drivers/namcos22.cpp:

Code:
READ16_MEMBER(namcos22_state::s22mcu_shared_r)
{
	UINT16 *share16 = (UINT16 *)m_shareram.target();
	return share16[BYTE_XOR_BE(offset)];
}
Posted By: fhub

Re: New Fidelity chess modules - 05/06/16 06:02 PM

Originally Posted By R. Belmont
Should be .target, not ->.

Thanks, now it compiles at least.

But I still don't get the expected value.
if the full address of this byte is 0x0e04028, do I then need ram[0x0e04028] or just the relative address ram[0x28], because this "nvram" is already declared as AM_RANGE(0x00e04000, 0x00e07fff) ?
Posted By: R. Belmont

Re: New Fidelity chess modules - 05/06/16 06:04 PM

It's the relative address; the base pointer is to the start of that area, e.g. 0xe04000. So subtract 0xe04000 from the address you're looking for.
Posted By: fhub

Re: New Fidelity chess modules - 05/06/16 06:18 PM

Ok, with the full address messui was even crashing.

But still no luck, it returns 0xffffffff with UINT32 (and these are definitely not the correct bytes), and when I try it with UINT16 messui quits with an error message "required shared pointer 'nvram' not found".

I guess I'll have to give up ... frown
Posted By: Haze

Re: New Fidelity chess modules - 05/06/16 06:46 PM

divide the offset by 2? might help.
4 if you're dealing with 32-bit.
Posted By: Just Desserts

Re: New Fidelity chess modules - 05/06/16 06:57 PM

Originally Posted By Haze
divide the offset by 2? might help.
4 if you're dealing with 32-bit.


That's exactly what needs doing.
Posted By: fhub

Re: New Fidelity chess modules - 05/06/16 07:30 PM

Originally Posted By Haze
divide the offset by 2? might help.
4 if you're dealing with 32-bit.


OMG, such a lot of things to consider for MAME programming (especially for an amateur)!

But that was indeed the problem - everything working now. smile

Many thanks to all for your help,
Franz
Posted By: fhub

Re: New Fidelity chess modules - 05/06/16 07:56 PM

Ooops, the next small problem:

This driver fidel68k.cpp contains 4 different models, feagv7/10/11 are 32bit, but feagv2 is 16bit, and so this new code with the UINT32 definition crashes when I run feagv2 (same error message: "required shared pointer 'nvram' not found"), i.e. for this module I would have to use UINT16.

Any ideas how to solve this?
Posted By: R. Belmont

Re: New Fidelity chess modules - 05/06/16 08:34 PM

Use separate shared pointers / code for the 16 and 32-bit systems. And make both of them optional_shared_ptr instead of required.
Posted By: fhub

Re: New Fidelity chess modules - 05/06/16 08:57 PM

Originally Posted By R. Belmont
Use separate shared pointers / code for the 16 and 32-bit systems. And make both of them optional_shared_ptr instead of required.


Yep, that worked - you're really a MAME expert! smile

I hope this was the last issue, and I don't have to annoy you any longer. wink

Thanks once more,
Franz
Posted By: Anna Wu

Re: New Fidelity chess modules - 05/08/16 12:20 AM

@fhub

Just for info. smile
Lector wrote (http://www.schachcomputer.info/forum) he has some problems with the last version of Fidelity.exe on WinXP.
Your last release is working on my WinXP SP3 32-bit OS.
I get no errors like
Failed to initialize function pointer for DXInputGetState. Error: 1157
XInput_api_helper failed to initialize Error: 4294967295
Posted By: fhub

Re: New Fidelity chess modules - 05/08/16 01:07 PM

Originally Posted By Anna Wu
@fhub
Just for info. smile
Lector wrote (http://www.schachcomputer.info/forum) he has some problems with the last version of Fidelity.exe on WinXP.

Thanks Anna,
I've seen this posting and I have the same problem on my 2nd WinXP partition, too.

Here's now a new update, which solves this WinXP problem with a patch (just execute the included XP_patch.bat),
and also fixes a small bug when the Fidelity should start the game with White (clicking on RV).

Fidelity_upd2.zip:
http://www30.zippyshare.com/v/sYS72trF/file.html

Franz
Posted By: fhub

Re: New Fidelity chess modules - 05/10/16 01:25 PM

Important question to 'hap':
(since you've written the Fidelity drivers, I guess you're the only one who could answer this)

Why the heck is the fidel68k.cpp driver so different (and does behave so differently) to the other 2 Fidelity drivers (and to all other about 40 old Mephisto modules I have)???

These 'feagv' machines are the only ones who write the board postition into their config file, no other chess machines do that - e.g. following lines in 'feagv10.cfg':
Code:
<input>
    <port tag=":IN.0" type="KEYPAD" mask="1" defvalue="0" value="1" />
    .....
</input>


And this fidel68k driver is the only one which uses PORT_TOGGLE in the input ports - again no other chess machine contains this PORT_TOGGLE.

When I remove this PORT_TOGGLE, then the port values are not stored in the config file anymore (as described above), but then a click on a board square does not toggle the LED status anymore - again a completely different behaviour than the other 2 Fidelity drivers (and all other chess machines).

Because of his different behaviour of the 'feagv' machines I'm not able to successfully implement the 'save & load state' feature, no matter what I do (and I've made already many trials), whereas for all other chess modules it's working perfectly.

So how can I change this unusual behaviour of the 'feagv' modules, so that they work like all other ones???

Franz
Posted By: hap

Re: New Fidelity chess modules - 05/10/16 01:54 PM

Remove PORT_TOGGLE then? This is the only emulated Fidelity board with magnet sensors. PORT_TOGGLE makes the sensors act as switches, I added that to make it playable (as blind chess instead of not playable at all).

When we get game pieces added with a weight under them to make the sensor active whenever there's a piece on it, PORT_TOGGLE will be removed. The current solution is a workaround.
Posted By: fhub

Re: New Fidelity chess modules - 05/10/16 02:00 PM

Originally Posted By hap
Remove PORT_TOGGLE then?

Well, I've already tried this, but as I said: clicking on the squares doesn't switch the status anymore (at least not permanently).
Quote:

When we get game pieces added with a weight under them to make the sensor active whenever there's a piece on it, ...

And how could this be done?
If it's not too difficult, then I would certainly try it ...
Posted By: hap

Re: New Fidelity chess modules - 05/10/16 06:00 PM

The place to start is the lua scripts crazyc was working on.
Posted By: Olivier Galibert

Re: New Fidelity chess modules - 05/10/16 06:23 PM

Originally Posted By hap
The place to start is the lua scripts crazyc was working on.

but howww specifically??
Posted By: fhub

Re: New Fidelity chess modules - 05/10/16 06:31 PM

Originally Posted By hap
The place to start is the lua scripts crazyc was working on.

Well, I've already looked at his script in the fidel_csc layout more than once, but this (LUA) is 'Chinese' for me.

There would be an other method, if I could directly set the port for any of the 64 board squares with any command(s) in the driver (as if I would have clicked on this square).
But since noone here wants to tell me in details how to achieve this, it's hopeless ... frown

Franz
Posted By: hap

Re: New Fidelity chess modules - 05/10/16 06:34 PM

Just to make it clear, the largest reason I'm unwilling to help more is that none of this old mboard stuff will make it into mainline MAME. It's a waste of time.
Posted By: fhub

Re: New Fidelity chess modules - 05/10/16 06:40 PM

Originally Posted By hap
Just to make it clear, the largest reason I'm unwilling to help more is that none of this old mboard stuff will make it into mainline MAME. It's a waste of time.

Sorry, but that's nonsense!
What I've done so far for the Fidelity (feagv) I've done from the scratch, i.e. this old mboard stuff is not required at all.
And of course I would publish my addition to the Fidelity driver (as I've done also for my CB-Emu), but only after EVERYTHING is working - and this includes that I would also be able to implement save & load the state.
Posted By: hap

Re: New Fidelity chess modules - 05/10/16 06:41 PM

I didn't mean your time smile
Posted By: fhub

Re: New Fidelity chess modules - 05/10/16 06:45 PM

Originally Posted By hap
I didn't mean your time smile

Well, what sense does it make to write a 'half-finished' driver (like those new Fidelity modules), when you are not interested that they may ever be finished - in their current form they are almost useless.
Posted By: hap

Re: New Fidelity chess modules - 05/10/16 06:49 PM

What I'm trying to aim for is a separation of chessboard and the emulation part of it. That's why a LUA script simulating gamepieces over the 'screen' is a good solution. The driver emulation has no knowledge of gamepieces just like the real thing.
Posted By: hap

Re: New Fidelity chess modules - 05/10/16 06:54 PM

And please tell me where I said I'm "not interested that they may ever be finished".

I have plenty patience. You gotta start somewhere, right? Look at some of my handheld drivers for example, where they didn't have good graphics implementation until a year later.
Posted By: fhub

Re: New Fidelity chess modules - 05/10/16 06:55 PM

But I still don't understand what should be so difficult (or require so much time) in my method mentioned above:
MAME is already reading this port configuration from the feagv.cfg file, and submits these port values to the module.
So why should the same not be possible in the driver?
Posted By: hap

Re: New Fidelity chess modules - 05/10/16 06:59 PM

brb gotta replace my fuses smile
Posted By: Vas Crabb

Re: New Fidelity chess modules - 05/11/16 03:38 AM

Originally Posted By fhub
And of course I would publish my addition to the Fidelity driver (as I've done also for my CB-Emu), but only after EVERYTHING is working - and this includes that I would also be able to implement save & load the state.


Trouble with the approach of holding onto everything until you have it working perfectly is that you may very well not be able to achieve that. If you submit something useful but not complete, someone else with knowledge/motivation/time may be able to help get it working.
Posted By: Stiletto

Re: New Fidelity chess modules - 05/11/16 04:18 AM

Also there's the bus issue, i.e. "what if you get hit by a bus" smile
Posted By: fhub

Re: New Fidelity chess modules - 05/11/16 07:50 AM

Originally Posted By Stiletto
Also there's the bus issue, i.e. "what if you get hit by a bus" smile

Well, that would end badly for the bus! wink
Posted By: fhub

Re: New Fidelity chess modules - 05/12/16 09:13 PM

The next 2 questions to 'hap':
(because now I'm working on the fidel6502 driver)

1) why does a 'Soft Reset' (in the menu) not work for the fscc12?
It works for all other chess modules, but the fscc12 does not reset anything, neither it's (internally stored) board position, nor any of his options settings.

2) why are the 2 LEDs of the squares d2 and d4 already ON when starting the fscc9?
Posted By: hap

Re: New Fidelity chess modules - 05/12/16 09:17 PM

'hap' went to get cigarettes and hasn't come back
Posted By: fhub

Re: New Fidelity chess modules - 05/12/16 09:23 PM

Originally Posted By hap
'hap' went to get cigarettes and hasn't come back

Does this mean that you aren't even interested in bugs in a driver which you have written?
Posted By: hap

Re: New Fidelity chess modules - 05/12/16 11:35 PM

I respect your perseverence but seriously, get off my back. I've told more than once I'm not helping you any further on Fidelity stuff. You can ask questions here, but please don't direct them specifically at me, it's annoying.

PS
1: don't use soft reset
2: it's not a bug
Posted By: R. Belmont

Re: New Fidelity chess modules - 05/13/16 12:58 AM

As Vas said, you can't hoard your changes *and* ask for help about them. None of us have the mental bandwidth to try and keep track of what your source tree looks like in order to answer your constant pleas.
Posted By: fhub

Re: New Fidelity chess modules - 05/13/16 07:43 AM

Ok, I've got it - goodbye to the forum here!
(you can remove me from the memberlist)

Franz
Posted By: Robbbert

Re: New Fidelity chess modules - 05/13/16 08:50 AM

Leaving so soon?

Good luck with your coding..
Posted By: Anna Wu

Re: New Fidelity chess modules - 05/13/16 11:05 AM

What happens?
Please do have a little patience. smile
Posted By: Darkstar

Re: New Fidelity chess modules - 05/13/16 12:07 PM

If you're going to throw the towel so easily you could at least dump your code somewhere so that someone else (with more patience) could pick off where you left. That's how Open Source is usually done anyway ;-)
Posted By: balrog

Re: New Fidelity chess modules - 05/13/16 12:30 PM

I'd recommend using GitHub for source management, just like we do: work in a branch, and then people can help out more directly!
Posted By: R. Belmont

Re: New Fidelity chess modules - 05/13/16 12:34 PM

He's also working off 0.152, which doesn't help.
Posted By: hap

Re: New Fidelity chess modules - 05/13/16 12:43 PM

I compliment your perseverence and at that moment you give up? :P

Anyways, I was harsh. I did a friendlier approach before to try make you understand I personally won't help you on this but that didn't work. I'm glad you understand now.

Of course that doesn't mean that noone else is going to help you out here. I also advice you to be more open though, eg. see balrog's reply.
Posted By: fhub

Re: New Fidelity chess modules - 05/29/16 09:51 AM

Hi,

from a friend I've now got the ROMs for the 'Fidelity Super 9 Sensory Chess Challenger':
http://www.schach-computer.info/wiki/index.php/Fidelity_Super_9_Sensory_Chess_Challenger
It is based on the hardware of the 'Champion Sensory Chess Challenger' (csc), but uses the program of the 'Fidelity Prestige'.

If anyone is able (and wants) to make a skeleton driver for this device, then let me know and I'll send you these ROM files.

Franz
Posted By: hap

Re: New Fidelity chess modules - 05/30/16 01:32 PM

You can send new dumps to: code at mamedev dot org
Posted By: fhub

Re: New Fidelity chess modules - 05/30/16 01:45 PM

Originally Posted By hap
You can send new dumps to: code at mamedev dot org

Are the ROM files enough for the MAME developers (or you), or are any other infos needed to create a driver?
The problem is that I don't have any further infos about this device (as e.g. RAM/ROM addresses), else I would write the driver myself (or would try it at least).

Franz
Posted By: hap

Re: New Fidelity chess modules - 05/30/16 01:51 PM

It's not easy, but yes, often we can emulate something just from the ROMs and a generic hw description (like on the schach-computer database). Around half of the drivers I emulated are done this way.
Posted By: fhub

Re: New Fidelity chess modules - 05/30/16 02:00 PM

Ok, then I'll send the files ...

Edit: email sent!

Franz


Posted By: hap

Re: New Fidelity chess modules - 05/31/16 05:43 PM

http://www.schach-computer.info/wiki/images/0/09/Fidelity_Super_9_Chess_Challenger_PCB.jpg

In above pic, the socketed chip next to the speech chip: The speech ROM wasn't dumped? I'll assume they're same as the other ones by Fidelity.

And the CB9 ROM(bottom-right chip I assume), was it dumped from the chesscomputer PCB, or from the CB9 module?
Posted By: fhub

Re: New Fidelity chess modules - 05/31/16 06:06 PM

Originally Posted By hap
http://www.schach-computer.info/wiki/images/0/09/Fidelity_Super_9_Chess_Challenger_PCB.jpg

In above pic, the socketed chip next to the speech chip: The speech ROM wasn't dumped? I'll assume they're same as the other ones by Fidelity.

I guess your assumption is ok, the ROMs I've sent are all that I got.
Quote:

And the CB9 ROM(bottom-right chip I assume), was it dumped from the chesscomputer PCB, or from the CB9 module?

From the PCB, but I also have a dump of the original CB9 module and both are exactly the same.
Posted By: fhub

Re: New Fidelity chess modules - 06/11/16 09:27 PM

Many thanks to 'hap' for implementing the 'Super 9' in the Fidelity driver! smile

I've just sent a few more ROMs for Fidelity chess computers to the MAME developers email address,
just in case anyone may be interested to create new drivers ... wink

Franz
Posted By: fhub

Re: New Fidelity chess modules - 06/12/16 08:49 AM

BTW, for chess players here's my new CB-Fidelity package (without ROMs!):
http://www29.zippyshare.com/v/65ziaEeg/file.html

The new 'Super 9' and 'Elite Avantgarde V9' are already included -
you can find the necessary ROMs at the usual place ... wink

Franz
Posted By: Anna Wu

Re: New Fidelity chess modules - 06/12/16 09:38 AM

Originally Posted By fhub
BTW, for chess players here's my new CB-Fidelity package (without ROMs!):
http://www29.zippyshare.com/v/65ziaEeg/file.html

The new 'Super 9' and 'Elite Avantgarde V9' are already included -
you can find the necessary ROMs at the usual place ... wink

Franz


Thanks for the support of the real V9 ROM. smile
Posted By: fhub

Re: New Fidelity chess modules - 06/12/16 11:22 AM

Originally Posted By Anna Wu

Thanks for the support of the real V9 ROM. smile

You're welcome!

The V9 was easy to implement, I just had to copy and modify a few lines from the V7.
For really new modules (as e.g. the Super 9) I can write the code for supporting chess pieces, but I can't create a new driver from the scratch (I've just too little knowledge of hardware and MAME internals) - for this we need indeed a true MAME expert like 'hap'! smile

Franz
Posted By: fhub

Re: New Fidelity chess modules - 06/19/16 05:08 PM

The new Fidelity A/S (Budapest & Glasgow) is waiting in the wings ... wink

Posted By: fhub

Re: New Fidelity chess modules - 07/03/16 08:02 PM

Hi,

from a friend I've got a modified ROM for the Sensory Chess Challenger (SC9), it is from a tuned (8MHz) machine.
It is indeed very similar to the version implemented in MAME (by 'hap'), it has the same size and the same ROM addresses, and essentially it's working.

There's only one big problem:
it only responds to mouseclicks on the 8th row of the chessboard (a8-h8), all other fields are simply ignored. frown

I've now already tried to solve this problem for many days, but unfortunately without success. The current routine 'sc9_input_r' in the SC9 driver is
Code:
	return read_inputs(9) ^ 0xff;

and I've changed this in many different ways, but nothing worked.

Has anyone any ideas what else I could do (or try) to solve this problem?
Is there any method to find out what exactly the device expects to get from from the driver, when you click on any sensor field of the chessboard?
Or are there any other places in the driver that could be the reason for this problem?

Regards,
Franz
Posted By: fhub

Re: New Fidelity chess modules - 07/04/16 09:54 AM

Ok, forget my previous post.

I've now finally found the solution for this problem, and I found it myself! smile

"Don't rely on the help of others" is indeed a good motto - especially here in this forum. wink

Franz
Posted By: Duke

Re: New Fidelity chess modules - 07/04/16 10:16 AM

Insulting the people who wrote the software you use probably isn't though.
Posted By: fhub

Re: New Fidelity chess modules - 07/04/16 11:55 AM

Originally Posted By Duke
Insulting the people who wrote the software you use probably isn't though.


'Insulting'? Where did I insult anyone?

Some people have really strange opinions ... wink

Franz
Posted By: Edstrom

Re: New Fidelity chess modules - 07/04/16 12:56 PM

I think you implied that people are not helpful in this forum, but I think they really are if you contribute to the goal of the project, including using/testing the software.

Good that you could help yourself though, people here are really busy here spending energy on the core parts rather than specific drivers, unless they drive development of core parts that is.

I have a few chess computers myself and will at some time dump them, I know that at least two of them are not in mame yet, one with speech, http://www.mephisto.net/talking.html, and a variant of a Mephisto travel chess computer. I also got a Boris but that has been dumped already. That will be a future project though. smile
© 2020 Forums