|
Joined: Mar 2001
Posts: 17,234 Likes: 259
Very Senior Member
|
Very Senior Member
Joined: Mar 2001
Posts: 17,234 Likes: 259 |
"joystick 0" turns off MESS reading any USB or gameport joypads/sticks you have connected to your PC/Mac. It does nothing to the internal mappings.
As for the rest of your problem, you appear to be doing something horribly wrong, but I do not understand keyboard mapping well enough to tell you what. Perhaps next time Justin signs in he would know.
|
|
|
|
Joined: Jul 2009
Posts: 78
Member
|
OP
Member
Joined: Jul 2009
Posts: 78 |
Hm... I see that MC6847's color artifacting is enabled via a UI config option, which is available to the code as a port:
INPUT_PORTS_START( m6847_artifacting )
PORT_START("artifacting")
PORT_CONFNAME( 0x03, 0x01, "Artifacting" ) PORT_CHANGED(artifacting_changed, NULL)
PORT_CONFSETTING( 0x00, DEF_STR( Off ) )
PORT_CONFSETTING( 0x01, DEF_STR( Standard ) )
PORT_CONFSETTING( 0x02, DEF_STR( Reverse ) )
INPUT_PORTS_END
Then...
/* are we artifacting? */
artifacting = input_port_read_safe(machine, "artifacting", 0x00) & 0x03;
if (artifacting == 0x00)
return;
...else ( artifacting != 0x00), proceed to produce the artifacting effect. I could do something similar, add a UI config option so that joystick is only mixed to the keyboard if the user chooses that. (Unless, of course, there is already something like that already implemented in MESS' core.) Whaddya think?
|
|
|
|
Joined: Jul 2007
Posts: 4,625
Very Senior Member
|
Very Senior Member
Joined: Jul 2007
Posts: 4,625 |
Is this a American slang expression ?
|
|
|
|
Joined: Mar 2001
Posts: 17,234 Likes: 259
Very Senior Member
|
Very Senior Member
Joined: Mar 2001
Posts: 17,234 Likes: 259 |
It's essentially a typed out version of "what do you think?" in a specific kind of New York accent
|
|
|
|
Joined: Jul 2007
Posts: 4,625
Very Senior Member
|
Very Senior Member
Joined: Jul 2007
Posts: 4,625 |
It's essentially a typed out version of "what do you think?" in a specific kind of New York accent Thank you for the explanation.
|
|
|
|
Joined: Jul 2009
Posts: 78
Member
|
OP
Member
Joined: Jul 2009
Posts: 78 |
I wouldn't be able to tell where "whaddya" comes from; it's just something I have read here and there and eventually incorporated into my own idiolect.
|
|
|
|
Joined: Jul 2009
Posts: 78
Member
|
OP
Member
Joined: Jul 2009
Posts: 78 |
I could do something similar, add a UI config option so that joystick is only mixed to the keyboard if the user chooses that. IMPLEMENTED. New driver configuration options allow user to enable/disable keyboard mapping for both joysticks independently. Both are disabled by default, so no more keyboard side effects. Yay! HERE IS THE NEW DIFF:
Index: src/mess/drivers/mc1000.c
===================================================================
--- src/mess/drivers/mc1000.c (revision 9472)
+++ src/mess/drivers/mc1000.c (working copy)
@@ -164,22 +164,39 @@
/* Input Ports */
static INPUT_PORTS_START( mc1000 )
+ PORT_START("JOYA") /* Player 1 */
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) /* = 'I' */
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) /* = 'Q' */
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) /* = 'Y' */
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) /* = '1' */
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) /* = '9' */
+ PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ PORT_START("JOYB") /* Player 2 */
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) /* = '@' */
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) /* = 'H' */
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) /* = 'P' */
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) /* = 'X' */
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) /* = '0' */
+ PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
+
PORT_START("ROW0")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('@')
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_CODE(KEYCODE_H) PORT_CHAR('H')
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_CODE(KEYCODE_P) PORT_CHAR('P')
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_CODE(KEYCODE_X) PORT_CHAR('X')
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_CODE(KEYCODE_0) PORT_CHAR('0')
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('@')
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('H')
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('P')
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('X')
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0')
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(')
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("ROW1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('A')
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_CODE(KEYCODE_I) PORT_CHAR('I')
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q')
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y')
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!')
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')')
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('I')
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q')
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y')
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!')
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')')
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("ROW2")
@@ -238,8 +255,18 @@
PORT_START("MODIFIERS")
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("SHIFT") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CTRL") PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR(UCHAR_MAMEKEY(LCONTROL)) PORT_CHAR(UCHAR_MAMEKEY(RCONTROL))
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CTRL") PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR(UCHAR_MAMEKEY(RCONTROL))
+ PORT_START("JOYAKEYMAP")
+ PORT_CONFNAME( 0x01, 0x00, "JOYSTICK A (P1) keyboard mapping" )
+ PORT_CONFSETTING( 0x00, DEF_STR( Off ) )
+ PORT_CONFSETTING( 0x01, DEF_STR( On ) )
+
+ PORT_START("JOYBKEYMAP")
+ PORT_CONFNAME( 0x01, 0x00, "JOYSTICK B (P2) keyboard mapping" )
+ PORT_CONFSETTING( 0x00, DEF_STR( Off ) )
+ PORT_CONFSETTING( 0x01, DEF_STR( On ) )
+
PORT_INCLUDE( m6847_artifacting )
INPUT_PORTS_END
@@ -294,15 +321,25 @@
UINT8 data = 0xff;
- if (!BIT(state->keylatch, 0)) data &= input_port_read(device->machine, "ROW0");
- if (!BIT(state->keylatch, 1)) data &= input_port_read(device->machine, "ROW1");
+ if (!BIT(state->keylatch, 0))
+ {
+ data &= input_port_read(device->machine, "ROW0");
+ if (input_port_read(device->machine, "JOYBKEYMAP"))
+ data &= input_port_read(device->machine, "JOYB");
+ }
+ if (!BIT(state->keylatch, 1))
+ {
+ data &= input_port_read(device->machine, "ROW1");
+ if (input_port_read(device->machine, "JOYAKEYMAP"))
+ data &= input_port_read(device->machine, "JOYA");
+ }
if (!BIT(state->keylatch, 2)) data &= input_port_read(device->machine, "ROW2");
if (!BIT(state->keylatch, 3)) data &= input_port_read(device->machine, "ROW3");
if (!BIT(state->keylatch, 4)) data &= input_port_read(device->machine, "ROW4");
if (!BIT(state->keylatch, 5)) data &= input_port_read(device->machine, "ROW5");
if (!BIT(state->keylatch, 6)) data &= input_port_read(device->machine, "ROW6");
if (!BIT(state->keylatch, 7)) data &= input_port_read(device->machine, "ROW7");
-
+
data = (input_port_read(device->machine, "MODIFIERS") & 0xc0) | (data & 0x3f);
if (cassette_input(state->cassette) < +0.0) data &= 0x7f;
@@ -378,20 +415,53 @@
/* Machine Driver */
+/*
+
+ Interrupt generator:
+ NE555 chip in astable circuit.
+
+ +---------*---*---o V+
+ | | |
+ +-+ | |
+ | |309K | |
+ | |R17 |8 |4
+ +-+ +-------+
+ | 7| |3
+ *-------| |-------> /INT (Z80)
+ | | |
+ | | |
+ +-+R16 2| IC 28 |
+ | |1K +--| |
+ | | | | 555 |
+ +-+ | | |
+ | | 6| |5
+ *----*�-| |---+
+ | | | |
+ ---C30 +-------+ ---C29
+ ---103 |1 ---103
+ _|_ _|_ _|_
+ /// /// ///
+
+ Calculated properties:
+
+ * 99.74489795918367 Duty Cycle Percentage
+ * 368.1126130105722 Frequency in Hertz
+ * 0.00000693 Seconds Low
+ * 0.0027096299999999998 Seconds High
+
+ */
+
+#define MC1000_NE555_FREQ (368) /* Hz */
+#define MC1000_NE555_DUTY_CYCLE (99.745) /* % */
+
static TIMER_DEVICE_CALLBACK( ne555_tick )
{
mc1000_state *state = timer.machine->driver_data<mc1000_state>();
- if (state->ne555_int == ASSERT_LINE)
- {
- state->ne555_int = CLEAR_LINE;
- }
- else
- {
- state->ne555_int = ASSERT_LINE;
- }
+ // (state->ne555_int not needed anymore and can be done with?)
+ state->ne555_int = param;
- cputag_set_input_line(timer.machine, Z80_TAG, INPUT_LINE_IRQ0, state->ne555_int);
+ cputag_set_input_line(timer.machine, Z80_TAG, INPUT_LINE_IRQ0, param);
}
static const cassette_config mc1000_cassette_config =
@@ -421,28 +491,34 @@
static MACHINE_CONFIG_START( mc1000, mc1000_state )
/* basic machine hardware */
- MDRV_CPU_ADD(Z80_TAG, Z80, 3579545)
- MDRV_CPU_PROGRAM_MAP(mc1000_mem)
- MDRV_CPU_IO_MAP(mc1000_io)
+ MDRV_CPU_ADD(Z80_TAG, Z80, 3579545)
+ MDRV_CPU_PROGRAM_MAP(mc1000_mem)
+ MDRV_CPU_IO_MAP(mc1000_io)
- MDRV_MACHINE_START(mc1000)
- MDRV_MACHINE_RESET(mc1000)
+ MDRV_MACHINE_START(mc1000)
+ MDRV_MACHINE_RESET(mc1000)
- MDRV_TIMER_ADD_PERIODIC("ne555", ne555_tick, HZ(60))
+ /* timers */
+ MDRV_TIMER_ADD_PERIODIC("ne555clear", ne555_tick, HZ(MC1000_NE555_FREQ))
+ MDRV_TIMER_PARAM(CLEAR_LINE)
- /* video hardware */
- MDRV_SCREEN_ADD(SCREEN_TAG, RASTER)
- MDRV_SCREEN_REFRESH_RATE(M6847_NTSC_FRAMES_PER_SECOND)
- MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
- MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
+ MDRV_TIMER_ADD_PERIODIC("ne555assert", ne555_tick, HZ(MC1000_NE555_FREQ))
+ MDRV_TIMER_START_DELAY(HZ(MC1000_NE555_FREQ * 100 / MC1000_NE555_DUTY_CYCLE))
+ MDRV_TIMER_PARAM(ASSERT_LINE)
+
+ /* video hardware */
+ MDRV_SCREEN_ADD(SCREEN_TAG, RASTER)
+ MDRV_SCREEN_REFRESH_RATE(M6847_NTSC_FRAMES_PER_SECOND)
+ MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
+ MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
MDRV_SCREEN_SIZE(320, 25+192+26)
MDRV_SCREEN_VISIBLE_AREA(0, 319, 1, 239)
- MDRV_PALETTE_LENGTH(16)
+ MDRV_PALETTE_LENGTH(16)
- MDRV_VIDEO_UPDATE(mc1000)
+ MDRV_VIDEO_UPDATE(mc1000)
- MDRV_MC6847_ADD(MC6847_TAG, mc1000_mc6847_intf)
- MDRV_MC6847_TYPE(M6847_VERSION_ORIGINAL_NTSC)
+ 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 */
|
|
|
|
Joined: Aug 2004
Posts: 1,458 Likes: 9
Very Senior Member
|
Very Senior Member
Joined: Aug 2004
Posts: 1,458 Likes: 9 |
Ok it's in, r9492.
Just wondering, if you make a syntax error, why does it say ?SN ERRO
Where did the trailing R go? It appears the driver has always does this, what about a real machine?
|
|
|
|
Joined: Jul 2009
Posts: 78
Member
|
OP
Member
Joined: Jul 2009
Posts: 78 |
"ERRO" is "ERROR" in Portuguese, robbbert. MC-1000's system messages ( error codes included) are in Portuguese. Stop a program 10 GOTO 10 with CTRL+C and you'll get PAUSA EM 10 ("pause at (line) 10").
|
|
|
|
Joined: Dec 2009
Posts: 351
Senior Member
|
Senior Member
Joined: Dec 2009
Posts: 351 |
Nice work on the MC-1000
noticed this.
10 PRINT "2"; 20 GOTO 10 RUN
after about 8 lines it doesn't print a character?
I.E.
2222222222 2222222222 2222222222 2222222222 222222222 2222222222 2222222222
is that a bug?
Last edited by ASH; 11/01/10 09:58 AM.
|
|
|
Forums9
Topics9,328
Posts122,128
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!
|
|
|
|