|
Joined: May 2009
Posts: 2,214 Likes: 382
Very Senior Member
|
Very Senior Member
Joined: May 2009
Posts: 2,214 Likes: 382 |
For the two-timers solution you'd start the second timer in the service routine for the first one. It's a fairly common pattern in MAME/MESS. To me, this seems like a good use case for some sort of 555 device. It would manage two timers and one output line, generating a fixed PWM pulse train. Simple to implement, but given how commonplace the 555 was, it might prove useful.
|
|
|
|
Joined: Jul 2009
Posts: 78
Member
|
OP
Member
Joined: Jul 2009
Posts: 78 |
Hey, Belmont. Could you give an example of a MESS machine that implements this?
|
|
|
|
Joined: Apr 2004
Posts: 1,563 Likes: 12
Very Senior Member
|
Very Senior Member
Joined: Apr 2004
Posts: 1,563 Likes: 12 |
There is NE555 stuff in the discrete sound emulation. I don't know how reusable that is.
See src/emu/sound/discrete.h and src/emu/sound/disc_dev.c.
|
|
|
|
Joined: Feb 2005
Posts: 449
Senior Member
|
Senior Member
Joined: Feb 2005
Posts: 449 |
I don't think the discrete system supports output via WRITE_LINE_DEVICE_HANDLER ?
|
|
|
|
Joined: Mar 2001
Posts: 17,215 Likes: 234
Very Senior Member
|
Very Senior Member
Joined: Mar 2001
Posts: 17,215 Likes: 234 |
Also, it's difficult to sync audio devices with the emulation. I just had to add a timer to the ASC that does nothing but stream_update() to get the latency on the "buffer half empty" IRQ to a reasonable level.
|
|
|
|
Joined: Jul 2009
Posts: 78
Member
|
OP
Member
Joined: Jul 2009
Posts: 78 |
FINALLY! I got a MacBook Pro, installed XCode, svn'd down MESS source code and managed to make a functional change. MC-1000 doesn't provide the external ROM that MC6847 may use to get the characters bytes when it is in "External Alphanumerics" mode (AG=0, AS=0, INTEXT=1). Currently the emulation doesn't provide a cfg.get_char_rom at VIDEO_START, and thus it works as if a byte 0x00 is read. In the actual machine, though, MC6847 puts the character code byte into the wires trying to reach the external character ROM, and then reads the wires again for the pattern... but it gets the very same byte that it put there, i.e., the ASCII code of the character. I think you could add something like...
UINT8 mc1000_get_char_rom(running_machine *machine, UINT8 ch,int line)
{
return ch;
}
Then @ VIDEO_START: cfg.get_char_rom = mc1000_get_char_rom; The result is not usefull at all, as you can see by accessing this MC-1000 Java emulator and typing but that's how it works, so here you have it. In fact, there was no need for VIDEO_START. I found another machine that used external character ROM and found a solution. Under MACHINE_CONFIG_START I added:
MDRV_MC6847_CHAR_ROM(mc1000_get_char_rom)
And voil�. I'll see if "svn diff" can really send my changes for approval now...
|
|
|
|
Joined: Jul 2009
Posts: 78
Member
|
OP
Member
Joined: Jul 2009
Posts: 78 |
Well, according to Duke @ the Shout Box, you need to capture the output [of "svn diff"] and send it to nathan, who will then apply it (or not)
see mess.org contacts And so I did. Since this is my first change submission, I think it's better to document it in case I'm doing something wrong. Here is the diff:
Index: src/mess/drivers/mc1000.c
===================================================================
--- src/mess/drivers/mc1000.c (revision 9441)
+++ src/mess/drivers/mc1000.c (working copy)
@@ -272,6 +272,11 @@
return mc6847_update(state->mc6847, bitmap, cliprect);
}
+UINT8 mc1000_get_char_rom(running_machine *machine, UINT8 ch,int line)
+{
+ return ch;
+}
+
/* AY-3-8910 Interface */
static WRITE8_DEVICE_HANDLER( keylatch_w )
@@ -438,6 +443,7 @@
MDRV_MC6847_ADD(MC6847_TAG, mc1000_mc6847_intf)
MDRV_MC6847_TYPE(M6847_VERSION_ORIGINAL_NTSC)
+ MDRV_MC6847_CHAR_ROM(mc1000_get_char_rom)
/* sound hardware */
MDRV_SPEAKER_STANDARD_MONO("mono")
|
|
|
|
Joined: Jul 2009
Posts: 78
Member
|
OP
Member
Joined: Jul 2009
Posts: 78 |
MC-1000's keyboard has a single SHIFT key to the left, and a single CTRL key to the right: The emulation replicates this, recognizing only LEFT SHIFT and RIGHT CONTROL keys from a PC keyboard. This annoyed me a little: From time to time I press the "wrong" CONTROL or SHIFT key. Even worse: I bought a MacBook Pro 33", and it has ONLY ONE CONTROL KEY, to the LEFT. I tried to stop MESS running a BASIC program with CTRL-C and couldn't do it. Since the emulation has nothing mapped to PC's RIGHT SHIFT and LEFT CONTROL keys, it would be more comfortable to have both left and right keys map to MC-1000's single keys. The emulation currently has:
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("SHIFT") PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CTRL") PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR(UCHAR_MAMEKEY(RCONTROL))
How can we have both SHIFT/CTRL keys recognized by the emulation? Is it enough to add the PORT_CODE(KEYCODE_RSHIFT) and PORT_CODE(KEYCODE_LCONTROL) in both lines? Is it necessary to change something in the PORT_CHAR() part?
|
|
|
|
Joined: Mar 2001
Posts: 17,215 Likes: 234
Very Senior Member
|
Very Senior Member
Joined: Mar 2001
Posts: 17,215 Likes: 234 |
That diff looks fine. I'll apply it myself later if nobody else does.
|
|
|
|
Joined: Feb 2000
Posts: 219 Likes: 1
Senior Member
|
Senior Member
Joined: Feb 2000
Posts: 219 Likes: 1 |
Even worse: I bought a MacBook Pro 33" Sound pretty nice to me!
tim lindner tlindner@macmess.org
|
|
|
1 members (MrBogi),
303
guests, and
1
robot. |
Key:
Admin,
Global Mod,
Mod
|
|
Forums9
Topics9,320
Posts121,929
Members5,074
|
Most Online1,283 Dec 21st, 2022
|
|
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!
|
|
|
|