Previous 15994 Revisions Next

r3630 Thursday 27th November, 2008 at 10:08:03 UTC by Miodrag Milanović
[OSBORNE1][Z88] Enabled
[src/mess]mess.mak messdriv.c
[src/mess/machine]osborne1.c

src/mess/messdriv.c
r3629r3630
213213//   DRIVER( a310 )      /* 1988 Acorn Archimedes 310                  */
214214
215215   /* CAMBRIDGE COMPUTERS */
216//128u4   DRIVER( z88 )      /*                                       */
216   DRIVER( z88 )      /*                                       */
217217
218218   /* AMSTRAD */
219219   DRIVER( cpc464 )   /* Amstrad (Schneider in Germany) 1984            */
r3629r3630
453453//128u4   DRIVER( at586 )      /* 19?? AT 586                              */
454454
455455   /* OSBORNE */
456//128u4   DRIVER( osborne1 )   /* 1981 Osborne-1                           */
456   DRIVER( osborne1 )   /* 1981 Osborne-1                           */
457457
458458   /* SINCLAIR RESEARCH */
459459   DRIVER( zx80 )      /* 1980 Sinclair ZX-80                        */
src/mess/machine/osborne1.c
r3629r3630
8585      switch( offset & 0x0F00 )
8686      {
8787      case 0x100:   /* Floppy */
88         data = wd17xx_r( machine, offset );
88         data = wd17xx_r( space, offset );
8989         break;
9090      case 0x200:   /* Keyboard */
9191         /* Row 0 */
92         if ( offset & 0x01 )   data &= input_port_read(machine, "ROW0");
92         if ( offset & 0x01 )   data &= input_port_read(space->machine, "ROW0");
9393         /* Row 1 */
94         if ( offset & 0x02 )   data &= input_port_read(machine, "ROW1");
94         if ( offset & 0x02 )   data &= input_port_read(space->machine, "ROW1");
9595         /* Row 2 */
96         if ( offset & 0x04 )   data &= input_port_read(machine, "ROW3");
96         if ( offset & 0x04 )   data &= input_port_read(space->machine, "ROW3");
9797         /* Row 3 */
98         if ( offset & 0x08 )   data &= input_port_read(machine, "ROW4");
98         if ( offset & 0x08 )   data &= input_port_read(space->machine, "ROW4");
9999         /* Row 4 */
100         if ( offset & 0x10 )   data &= input_port_read(machine, "ROW5");
100         if ( offset & 0x10 )   data &= input_port_read(space->machine, "ROW5");
101101         /* Row 5 */
102         if ( offset & 0x20 )   data &= input_port_read(machine, "ROW2");
102         if ( offset & 0x20 )   data &= input_port_read(space->machine, "ROW2");
103103         /* Row 6 */
104         if ( offset & 0x40 )   data &= input_port_read(machine, "ROW6");
104         if ( offset & 0x40 )   data &= input_port_read(space->machine, "ROW6");
105105         /* Row 7 */
106         if ( offset & 0x80 )   data &= input_port_read(machine, "ROW7");
106         if ( offset & 0x80 )   data &= input_port_read(space->machine, "ROW7");
107107         break;
108108      case 0x900:   /* IEEE488 PIA */
109         data = pia_0_r( machine, offset & 0x03 );
109         data = pia_0_r( space, offset & 0x03 );
110110         break;
111111      case 0xA00:   /* Serial */
112112         break;
113113      case 0xC00:   /* Video PIA */
114         data = pia_1_r( machine, offset & 0x03 );
114         data = pia_1_r( space, offset & 0x03 );
115115         break;
116116      }
117117   }
r3629r3630
136136      switch( offset & 0x0F00 )
137137      {
138138      case 0x100:   /* Floppy */
139         wd17xx_w( machine, offset, data );
139         wd17xx_w( space, offset, data );
140140         break;
141141      case 0x900:   /* IEEE488 PIA */
142         pia_0_w( machine, offset & 0x03, data );
142         pia_0_w( space, offset & 0x03, data );
143143         break;
144144      case 0xA00:   /* Serial */
145145         break;
146146      case 0xC00:   /* Video PIA */
147         pia_1_w( machine, offset & 0x03, data );
147         pia_1_w( space, offset & 0x03, data );
148148         break;
149149      }
150150   }
r3629r3630
195195   }
196196   if ( osborne1.bank2_enabled )
197197   {
198      memory_set_bankptr( 1, memory_region(machine, "main") );
199      memory_set_bankptr( 2, osborne1.empty_4K );
200      memory_set_bankptr( 3, osborne1.empty_4K );
198      memory_set_bankptr(space->machine,1, memory_region(space->machine, "main") );
199      memory_set_bankptr(space->machine,2, osborne1.empty_4K );
200      memory_set_bankptr(space->machine,3, osborne1.empty_4K );
201201   }
202202   else
203203   {
204      memory_set_bankptr( 1, mess_ram );
205      memory_set_bankptr( 2, mess_ram + 0x1000 );
206      memory_set_bankptr( 3, mess_ram + 0x3000 );
204      memory_set_bankptr(space->machine,1, mess_ram );
205      memory_set_bankptr(space->machine,2, mess_ram + 0x1000 );
206      memory_set_bankptr(space->machine,3, mess_ram + 0x3000 );
207207   }
208208   osborne1.bank4_ptr = mess_ram + ( ( osborne1.bank3_enabled ) ? 0x10000 : 0xF000 );
209   memory_set_bankptr( 4, osborne1.bank4_ptr );
209   memory_set_bankptr(space->machine,4, osborne1.bank4_ptr );
210210   osborne1.bankswitch = offset;
211211   osborne1.in_irq_handler = 0;
212212}
r3629r3630
218218   {
219219      if ( ! osborne1.bank2_enabled )
220220      {
221         opbase->mask = 0x0fff;
221         direct->mask = 0x0fff;
222222         direct->decrypted = mess_ram + 0x2000;
223223         direct->raw = mess_ram + 0x2000;
224         opbase->mem_min = 0x2000;
225         opbase->mem_max = 0x2fff;
224         direct->min = 0x2000;
225         direct->max = 0x2fff;
226226         return ~0;
227227      }
228228   }
r3629r3630
338338
339339static TIMER_CALLBACK(osborne1_video_callback)
340340{
341   const address_space* space = cpu_get_address_space(machine->cpu[0],ADDRESS_SPACE_PROGRAM);
341342   int y = video_screen_get_vpos(machine->primary_screen);
342343
343344   /* Check for start of frame */
r3629r3630
346347      /* Clear CA1 on video PIA */
347348      osborne1.start_y = ( osborne1.new_start_y - 1 ) & 0x1F;
348349      osborne1.charline = 0;
349      pia_1_ca1_w( machine, 0, 0 );
350      pia_1_ca1_w( space, 0, 0 );
350351   }
351352   if ( y == 240 )
352353   {
353354      /* Set CA1 on video PIA */
354      pia_1_ca1_w( machine, 0, 0xFF );
355      pia_1_ca1_w( space, 0, 0xFF );
355356   }
356357   if ( y < 240 )
357358   {
r3629r3630
479480
480481MACHINE_RESET( osborne1 )
481482{
483   const address_space* space = cpu_get_address_space(machine->cpu[0],ADDRESS_SPACE_PROGRAM);
482484   /* Initialize memory configuration */
483   osborne1_bankswitch_w( machine, 0x00, 0 );
485   osborne1_bankswitch_w( space, 0x00, 0 );
484486
485487   osborne1.pia_0_irq_state = FALSE;
486488   osborne1.pia_1_irq_state = FALSE;
r3629r3630
494496
495497   osborne1.video_timer = timer_alloc( osborne1_video_callback , NULL);
496498   timer_adjust_oneshot(osborne1.video_timer, video_screen_get_time_until_pos(machine->primary_screen, 1, 0 ), 0);
497   pia_1_ca1_w( machine, 0, 0 );
499   pia_1_ca1_w( space, 0, 0 );
498500
499501   timer_set( attotime_zero, NULL, 0, setup_beep );
500502
501   memory_set_direct_update_handler( 0, osborne1_opbase );
503   memory_set_direct_update_handler( space, osborne1_opbase );
502504}
503505
504506
r3629r3630
533535{
534536    /* Enable ROM and I/O when IRQ is acknowledged */
535537    UINT8   old_bankswitch = osborne1.bankswitch;
536    osborne1_bankswitch_w( device->machine, 0, 0 );
538    const address_space* space = cpu_get_address_space(device->machine->cpu[0],ADDRESS_SPACE_PROGRAM);
539   
540    osborne1_bankswitch_w( space, 0, 0 );
537541    osborne1.bankswitch = old_bankswitch;
538542    osborne1.in_irq_handler = 1;
539543    return 0xF8;
src/mess/mess.mak
r3629r3630
395395   $(MESSOBJ)/nintendo.a \
396396   $(MESSOBJ)/ondra.a \
397397   $(MESSOBJ)/orion.a \
398   $(MESSOBJ)/osborne.a \
398399   $(MESSOBJ)/p2000.a \
399400   $(MESSOBJ)/pcshare.a \
400401   $(MESSOBJ)/pel.a \
r3629r3630
457458#   $(MESSOBJ)/nascom1.a \
458459#   $(MESSOBJ)/nec.a \
459460#   $(MESSOBJ)/necpc.a \
460#   $(MESSOBJ)/osborne.a \
461461#   $(MESSOBJ)/pasogo.a \
462462#   $(MESSOBJ)/pc.a \
463463#   $(MESSOBJ)/pdp1.a \

Previous 15994 Revisions Next


© 1998-2018 The MESS Team