Previous 15994 Revisions Next

r1203 Tuesday 30th October, 2007 at 21:49:23 UTC by Wilbert Pol
[OSBORNE1] Changed irq acknowledgements to work like the real hardware.
[src/mess/drivers]osborne1.c
[src/mess/includes]osborne1.h
[src/mess/machine]osborne1.c

src/mess/includes/osborne1.h
r1202r1203
11#ifndef __OSBORNE1_H
22#define __OSBORNE1_H
33
4extern const struct z80_irq_daisy_chain osborne1_daisy_chain[];
5
46WRITE8_HANDLER( osborne1_0000_w );
57WRITE8_HANDLER( osborne1_1000_w );
68READ8_HANDLER( osborne1_2000_r );
src/mess/machine/osborne1.c
r1202r1203
1111#include "cpu/z80/z80.h"
1212#include "machine/6821pia.h"
1313#include "machine/6850acia.h"
14#include "includes/osborne1.h"
1514#include "machine/wd17xx.h"
1615#include "devices/basicdsk.h"
16#include "cpu/z80/z80daisy.h"
17#include "includes/osborne1.h"
1718
1819static struct osborne1 {
1920   UINT8   bank2_enabled;
r1202r1203
3435   UINT8   beep;
3536} osborne1;
3637
38/* Prototypes */
39static void osborne1_z80_reset(int);
40static int osborne1_z80_irq_state(int);
41static int osborne1_z80_irq_ack(int);
42static void osborne1_z80_irq_reti(int);
43
44const struct z80_irq_daisy_chain osborne1_daisy_chain[] = {
45   { osborne1_z80_reset, osborne1_z80_irq_state, osborne1_z80_irq_ack, osborne1_z80_irq_reti, 0 },
46   { NULL, NULL, NULL, NULL, -1 }
47};
48
49
3750WRITE8_HANDLER( osborne1_0000_w ) {
3851   /* Check whether regular RAM is enabled */
3952   if ( ! osborne1.bank2_enabled ) {
r1202r1203
157170   memory_set_bankptr( 4, osborne1.bank4_ptr );
158171}
159172
173static void osborne1_z80_reset(int param) {
174   osborne1.pia_1_irq_state = 0;
175}
176
177static int osborne1_z80_irq_state(int param) {
178   return ( osborne1.pia_1_irq_state ? Z80_DAISY_INT : 0 );
179}
180
181static int osborne1_z80_irq_ack(int param) {
182   /* Enable ROM and I/O when IRQ is acknowledged */
183   osborne1_bankswitch_w( 0, 0 );
184   return 0xF8;
185}
186
187static void osborne1_z80_irq_reti(int param) {
188}
189
160190static void osborne1_update_irq_state(void) {
161191   //logerror("Changing irq state; pia_0_irq_state = %s, pia_1_irq_state = %s\n", osborne1.pia_0_irq_state ? "SET" : "CLEARED", osborne1.pia_1_irq_state ? "SET" : "CLEARED" );
162192
163193   if ( osborne1.pia_1_irq_state ) {
164      /* ROM is enabled when an IRQ is received */
165      osborne1_bankswitch_w( 0, 0 );
166      cpunum_set_input_line_and_vector( 0, 0, ASSERT_LINE, 0xF8 );
194      cpunum_set_input_line( 0, 0, ASSERT_LINE );
167195   } else {
168196      cpunum_set_input_line( 0, 0, CLEAR_LINE );
169197   }
src/mess/drivers/osborne1.c
r1202r1203
3535#include "cpu/z80/z80.h"
3636#include "inputx.h"
3737#include "devices/basicdsk.h"
38#include "cpu/z80/z80daisy.h"
3839#include "includes/osborne1.h"
3940
4041#define MAIN_CLOCK   15974400
r1202r1203
141142   MDRV_CPU_ADD_TAG( "main", Z80, MAIN_CLOCK/4 )
142143   MDRV_CPU_PROGRAM_MAP( osborne1_mem, 0 )
143144   MDRV_CPU_IO_MAP( osborne1_io, 0 )
145   MDRV_CPU_CONFIG( osborne1_daisy_chain )
144146
145147   MDRV_MACHINE_RESET( osborne1 )
146148

Previous 15994 Revisions Next


© 1998-2018 The MESS Team