Previous 15994 Revisions Next

r2146 Saturday 29th March, 2008 at 19:22:00 UTC by Wilbert Pol
[IBMPC] Changed default cassette. Added motor switching support.
[src/mess/drivers]pc.c
[src/mess/machine]ibmpc.c

src/mess/machine/ibmpc.c
r2145r2146
22#include "memconv.h"
33#include "includes/ibmpc.h"
44#include "devices/cassette.h"
5#include "machine/pit8253.h"
56
67#include "machine/pcshare.h"
78#include "audio/pc.h"
r2145r2146
102103   int portc_switch_high;
103104   int speaker;
104105   int keyboard_disabled;
106   UINT8   portb;
105107} pc_ppi={ 0 };
106108
107109 READ8_HANDLER (pc_ppi_porta_r)
r2145r2146
160162      PIO_LOG(1,"PIO_C_r (lo)",("$%02x\n", data));
161163   }
162164
163   {
165   if ( ! ( pc_ppi.portb & 0x08 ) ) {
164166      double tap_val = cassette_input( image_from_devtype_and_index( IO_CASSETTE, 0 ) );
165167
166168      if ( tap_val < 0 ) {
r2145r2146
168170      } else {
169171         data |= 0x10;
170172      }
173   } else {
174      if ( pc_ppi.portb & 0x01 ) {
175         data = ( data & 0x10 ) | ( pit8253_get_output( 0, 2 ) ? 0x10 : 0x00 );
176      }
171177   }
172178   return data;
173179}
r2145r2146
181187WRITE8_HANDLER ( pc_ppi_portb_w )
182188{
183189   /* KB controller port B */
190   pc_ppi.portb = data;
184191   pc_ppi.portc_switch_high = data & 0x08;
185192   pc_ppi.keyboard_disabled = data & 0x80;
186193   pc_sh_speaker(machine, data & 0x03);
187194   pc_keyb_set_clock(data & 0x40);
188195
196   cassette_change_state( image_from_devtype_and_index( IO_CASSETTE, 0 ), ( data & 0x08 ) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR);
197
189198   if (data & 0x80)
190199      pc_keyb_clear();
191200}
src/mess/drivers/pc.c
r2145r2146
14991499
15001500   /* IBM PC 5150 (rev 0: 04/24/81) 2-screw case w/MDA Card, ROM Basic 1.0 */
15011501   /* ROM Basic 1.0 had a bug: Doing ".1 / 10" would result in the wrong answer. May have been fixed in 1.1 */
1502   ROM_SYSTEM_BIOS( 1, "rev0", "IBM PC 5150 ??????? 02/24/81" )
1502   ROM_SYSTEM_BIOS( 1, "rev1", "IBM PC 5150 ??????? 02/24/81" )
15031503   ROMX_LOAD("basicc10.f6", 0xf6000, 0x2000, NO_DUMP, ROM_BIOS(2))
15041504   ROMX_LOAD("basicc10.f8", 0xf8000, 0x2000, NO_DUMP, ROM_BIOS(2))
15051505   ROMX_LOAD("basicc10.fa", 0xfa000, 0x2000, NO_DUMP, ROM_BIOS(2))
r2145r2146
18071807static void ibmpc_cassette_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info) {
18081808   switch( state ) {
18091809   case MESS_DEVINFO_INT_COUNT:                  info->i = 1; break;
1810   case MESS_DEVINFO_INT_CASSETTE_DEFAULT_STATE:      info->i = CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED; break;
1810   case MESS_DEVINFO_INT_CASSETTE_DEFAULT_STATE:      info->i = CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED; break;
18111811
18121812   default:                                 cassette_device_getinfo(devclass, state, info); break;
18131813   }

Previous 15994 Revisions Next


© 1998-2018 The MESS Team