src/mess/machine/osborne1.c
| r1202 | r1203 | |
| 11 | 11 | #include "cpu/z80/z80.h" |
| 12 | 12 | #include "machine/6821pia.h" |
| 13 | 13 | #include "machine/6850acia.h" |
| 14 | | #include "includes/osborne1.h" |
| 15 | 14 | #include "machine/wd17xx.h" |
| 16 | 15 | #include "devices/basicdsk.h" |
| 16 | #include "cpu/z80/z80daisy.h" |
| 17 | #include "includes/osborne1.h" |
| 17 | 18 | |
| 18 | 19 | static struct osborne1 { |
| 19 | 20 | UINT8 bank2_enabled; |
| r1202 | r1203 | |
| 34 | 35 | UINT8 beep; |
| 35 | 36 | } osborne1; |
| 36 | 37 | |
| 38 | /* Prototypes */ |
| 39 | static void osborne1_z80_reset(int); |
| 40 | static int osborne1_z80_irq_state(int); |
| 41 | static int osborne1_z80_irq_ack(int); |
| 42 | static void osborne1_z80_irq_reti(int); |
| 43 | |
| 44 | const 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 | |
| 37 | 50 | WRITE8_HANDLER( osborne1_0000_w ) { |
| 38 | 51 | /* Check whether regular RAM is enabled */ |
| 39 | 52 | if ( ! osborne1.bank2_enabled ) { |
| r1202 | r1203 | |
| 157 | 170 | memory_set_bankptr( 4, osborne1.bank4_ptr ); |
| 158 | 171 | } |
| 159 | 172 | |
| 173 | static void osborne1_z80_reset(int param) { |
| 174 | osborne1.pia_1_irq_state = 0; |
| 175 | } |
| 176 | |
| 177 | static int osborne1_z80_irq_state(int param) { |
| 178 | return ( osborne1.pia_1_irq_state ? Z80_DAISY_INT : 0 ); |
| 179 | } |
| 180 | |
| 181 | static 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 | |
| 187 | static void osborne1_z80_irq_reti(int param) { |
| 188 | } |
| 189 | |
| 160 | 190 | static void osborne1_update_irq_state(void) { |
| 161 | 191 | //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" ); |
| 162 | 192 | |
| 163 | 193 | 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 ); |
| 167 | 195 | } else { |
| 168 | 196 | cpunum_set_input_line( 0, 0, CLEAR_LINE ); |
| 169 | 197 | } |
src/mess/drivers/osborne1.c
| r1202 | r1203 | |
| 35 | 35 | #include "cpu/z80/z80.h" |
| 36 | 36 | #include "inputx.h" |
| 37 | 37 | #include "devices/basicdsk.h" |
| 38 | #include "cpu/z80/z80daisy.h" |
| 38 | 39 | #include "includes/osborne1.h" |
| 39 | 40 | |
| 40 | 41 | #define MAIN_CLOCK 15974400 |
| r1202 | r1203 | |
| 141 | 142 | MDRV_CPU_ADD_TAG( "main", Z80, MAIN_CLOCK/4 ) |
| 142 | 143 | MDRV_CPU_PROGRAM_MAP( osborne1_mem, 0 ) |
| 143 | 144 | MDRV_CPU_IO_MAP( osborne1_io, 0 ) |
| 145 | MDRV_CPU_CONFIG( osborne1_daisy_chain ) |
| 144 | 146 | |
| 145 | 147 | MDRV_MACHINE_RESET( osborne1 ) |
| 146 | 148 | |