Previous Thread
Next Thread
Print Thread
Page 1 of 2 1 2
Wonderswan driver update #117077 03/25/20 10:44 AM
Joined: Mar 2020
Posts: 7
K
KanedaFr Offline OP
Member
OP Offline
Member
K
Joined: Mar 2020
Posts: 7
Hi,

Introduction:
After several years on Megadrive side, I recently get hooked by the lil' Wonderswan.
I was looking for a way to homebrew develop on it and unfortunalty, no dedicated emulator include debug feature.
So I moved to MAME, since it include a full debugger and GFX Viewer.
Unfortunately, the GFX Viewer part isn't present, like most of the CONS system it seems.
And so began my journey on MAME driver update.
I must say, sorry, that it was VERY difficult to start and while I was about to stop, I finally was able to add GFX Viewer support.
and so I'm currently improve it step by step....


What is done
GFX Viewer for WS Classic
use of LOGMasked
(available on my MAME fork, wswan branch at https://github.com/KanedaFr/mame/tree/wswan)

What is in progress
Serial link support

My main reason to post of this forum is to be sure I do it the right way and, if interested, understand how to post my update to main branch, to allow any other people to use it.
I hope it's alright with the guidelines and that I will be able to at last give somethink back to MAME, after so many years using it for playing, hacking, etc....

Re: Wonderswan driver update [Re: KanedaFr] #117078 03/25/20 10:48 AM
Joined: Mar 2020
Posts: 7
K
KanedaFr Offline OP
Member
OP Offline
Member
K
Joined: Mar 2020
Posts: 7
Serial:

On the Wonderswan, you can connect on serial port
- a cable link (2 player support)
- a wonderwave (IR)
- a digimon connector
- a gps
- a sonar
- a mobilegate
....

How MAME allows to select what is connected to a port ?


I'm currently adding cable link support (using socket, similar to Sega Model1/2/32 driver), and so I'd like to know how to activate it ....

Re: Wonderswan driver update [Re: KanedaFr] #117082 03/25/20 03:09 PM
Joined: May 2009
Posts: 1,842
J
Just Desserts Offline
Very Senior Member
Offline
Very Senior Member
J
Joined: May 2009
Posts: 1,842
Please do not use sockets directly, those are for communicating with the outside world.

MAME uses "slot devices" for things that allow you to connect multiple things to a port. I would advise looking at the contents of src/devices/bus/rs232/ for inspiration.

Re: Wonderswan driver update [Re: KanedaFr] #117083 03/25/20 05:13 PM
Joined: Mar 2001
Posts: 16,499
R
R. Belmont Online Content
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,499
I think they *do* want to communicate with the outside world. MAME has existing abstractions for that though.

Re: Wonderswan driver update [Re: KanedaFr] #117084 03/26/20 05:54 PM
Joined: Mar 2020
Posts: 7
K
KanedaFr Offline OP
Member
OP Offline
Member
K
Joined: Mar 2020
Posts: 7
Exactly, I'd like to be able to play at 2 players using 2 MAME, on same machine or not. It's why my code is based on socket.

I added

/bus/wswan/serial.cpp

with
Code
class ws_serial_device : public device_t
...
    required_device<ws_cable_link_device> m_cable_link;


class ws_cable_link_device : public device_t



it's required_device that's bug me

of course if comm_localhost/comm_remotehost aren't defined at commandLine, it won't work but I wonder how i could let the player choose to activate it or not...
I doubt adding an option on commandLine, specific to one driver is expected....

Re: Wonderswan driver update [Re: KanedaFr] #117085 03/27/20 01:38 AM
Joined: Mar 2020
Posts: 7
K
KanedaFr Offline OP
Member
OP Offline
Member
K
Joined: Mar 2020
Posts: 7
It seems I found a way to do it : using device_slot_interface
This way user could select device connected on serial port using MAME options

Is it the right way to do it ?

Re: Wonderswan driver update [Re: KanedaFr] #117086 03/27/20 06:52 AM
Joined: Nov 2016
Posts: 50
P
pmackinlay Offline
Member
Offline
Member
P
Joined: Nov 2016
Posts: 50
Yes, slot devices are the right way to do it, that's what Just Desserts mentioned above. But per R. Belmont's comment, MAME already has a way to do what you're asking, using the BITBANGER device and related support. You can look into how that's connected to the RS-232 null modem as an example, but in principle it allows you to transmit and receive arbitrary streams of data through sockets on the host, without having to implement your own network code (and the various operating system dependencies that entails).

To experiment, you can activate this function from the command line on any driver which implements an RS-232 port by adding arguments as follows:

Code
-<port_name> null_modem -bitbngr socket.<address>:<port>

where <port_name> is whatever the driver calls its serial port, and <address> and <port> are the IP address and port number of the socket you want to use.

In your case, if the link isn't RS-232, you can still follow the same approach to leverage BITBANGER for yourself.

Last edited by pmackinlay; 03/27/20 06:54 AM.
Re: Wonderswan driver update [Re: KanedaFr] #117087 03/27/20 07:56 AM
Joined: Feb 2004
Posts: 2,145
Vas Crabb Offline
Very Senior Member
Offline
Very Senior Member
Joined: Feb 2004
Posts: 2,145
The TI-82 and TI-85 calculators use non-RS232 communications and can talk between MAME instances over sockets. It’s implemented using device_slot_interface. Cooked and raw communication over the socket is supported. Try following that example?

Re: Wonderswan driver update [Re: KanedaFr] #117088 03/27/20 09:34 AM
Joined: Mar 2020
Posts: 7
K
KanedaFr Offline OP
Member
OP Offline
Member
K
Joined: Mar 2020
Posts: 7
Just Desserts : sorry! I didn't realize the already point me to the right anwser frown I thought you were talking about using socket or not.

pmackinlay, Vas Crabb : I found the bitbanger solution while Googling, on TI82 related page but for some reason I didn't find it on command line... I thought it was since replaced by comm_localhost/comm_remotehost

so what the difference / benetifs of bitbanger vs comm_localhost/comm_remotehost ?
At this time, I successfully send data (TX), I have to fix some part of my receive code (RX) but should I move to bitbanger first ?

I'll try using device_slot after that, based on TI82 or NES example

thanks!!!!

Re: Wonderswan driver update [Re: KanedaFr] #117160 04/13/20 08:42 PM
Joined: Mar 2020
Posts: 7
K
KanedaFr Offline OP
Member
OP Offline
Member
K
Joined: Mar 2020
Posts: 7
I'm still working on my project.

For some reason, MAME quits without message when my 2 sessions connects.
I tested with a MAME session and some kind of socket server, it works (at least the server receive data).

Is there any way to make MAME more verbose, to diagnose the real reason of this raw crash ?

The only thing I found is that on my socket server, if i close the socket just after receiving first byte, MAME crashes the same way...

any hint is welcome....

Page 1 of 2 1 2

Who's Online Now
0 registered members (), 54 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
ShoutChat Box
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics8,775
Posts115,470
Members4,899
Most Online890
Jan 17th, 2020
Powered by UBB.threads™ PHP Forum Software 7.7.3