Previous 15994 Revisions Next

r9862 Friday 31st December, 2010 at 19:24:36 UTC by Wilbert Pol
[OSBEXEC] Fixed banking of ROM and RAM at $0000.
[src/mess/drivers]osbexec.c

src/mess/drivers/osbexec.c
r9861r9862
55Screen is 80x24
66
77On boot at least bios seems to be enabled.
8Boot sequence:
9- set stack to and initialize Fxxx
10- write stuff to/initialize 2000-27FF
11- set PA to 80
12- initialize some more i/o
13- set PA to C0
14- test C000-CFFF
15- Set PA to 80
16- i/o things
17- Set PA to C0
18- Clear VRAM with 0x20
19- Write "PERFORMING SELF-TEST" to VRAM
20- Set PA to 80
21- (bp 0307)
22- Test 2000-27FF
23- Set SP to 27FF
24- Set PA to 80
25- Test 4000-FFFF
26- Set PA to 81
27- Test 4000-EFFF
28- (bp 2c6)
29- Test i/o
308
9Floppy breakpoints:
10- bp 0c50
11- bp 1449
12- bp 1465
3113
14
3215***************************************************************************/
3316
3417#include "emu.h"
r9861r9862
5134{
5235public:
5336   osbexec_state(running_machine &machine, const driver_device_config_base &config)
54      : driver_device(machine, config) { }
37      : driver_device(machine, config),
38         maincpu( *this, "maincpu" ),
39         mb8877( *this, "mb8877" ),
40         messram( *this, "messram" ),
41         pia_0( *this, "pia_0" ),
42         pia_1( *this, "pia_1" ),
43         sio( *this, "sio" ),
44         speaker( *this, "speaker" )
45   { }
5546
56   running_device   *maincpu;
57   running_device   *mb8877;
58   running_device   *messram;
59   running_device   *pia_0;
60   running_device   *pia_1;
61   running_device   *sio;
62   running_device   *speaker;
47   required_device<cpu_device>   maincpu;
48   required_device<running_device>   mb8877;
49   required_device<running_device>   messram;
50   required_device<pia6821_device>   pia_0;
51   required_device<pia6821_device>   pia_1;
52   required_device<z80dart_device>   sio;
53   required_device<running_device>   speaker;
6354
6455   region_info   *fontram_region;
6556   region_info *vram_region;
6657   UINT8   *fontram;
6758   UINT8   *vram;
59   UINT8   *ram_0000;
6860   emu_timer *video_timer;
6961
7062   /* PIA 0 (UD12) */
r9861r9862
8173
8274   void set_banks(running_machine *machine)
8375   {
84      UINT8 *messram_ptr = messram_get_ptr( messram );
76      ram_0000 = messram_get_ptr( messram );
8577
8678      if ( pia0_porta & 0x01 )
87         messram_ptr += 0x10000;
79         ram_0000 += 0x10000;
8880
89      memory_set_bankptr( machine, "4000", messram_ptr + 0x4000 );
90      memory_set_bankptr( machine, "c000", messram_ptr + 0xc000 );
91      memory_set_bankptr( machine, "e000", messram_ptr + 0xe000 );
81      memory_set_bankptr( machine, "0000", ram_0000 + 0x0000 );
82      memory_set_bankptr( machine, "4000", ram_0000 + 0x4000 );
83      memory_set_bankptr( machine, "c000", ram_0000 + 0xc000 );
84      memory_set_bankptr( machine, "e000", ram_0000 + 0xe000 );
9285
9386      if ( pia0_porta & 0x80 )
9487         memory_set_bankptr( machine, "0000", memory_region(machine, "maincpu") );
r9861r9862
117110      if ( offset < 0x1000 )
118111         state->fontram[ offset ] = data;
119112   }
113   else
114   {
115      state->ram_0000[ offset ] = data;
116   }
120117}
121118
122119
r9861r9862
339336   state->pia0_portb = data;
340337
341338   speaker_level_w( state->speaker, ( data & 0x08 ) ? 0 : 1 );
339
340   switch ( data & 0x06 )
341   {
342   case 0x02:
343      wd17xx_set_drive( state->mb8877, 1 );
344      break;
345   case 0x04:
346      wd17xx_set_drive( state->mb8877, 0 );
347      break;
348   }
349
342350   wd17xx_dden_w( state->mb8877, ( data & 0x01 ) ? 1 : 0 );
343351}
344352
r9861r9862
567575}
568576
569577
570static MACHINE_START( osbexec )
571{
572   osbexec_state *state = machine->driver_data<osbexec_state>();
573
574   state->maincpu = machine->device( "maincpu" );
575   state->mb8877  = machine->device( "mb8877" );
576   state->messram = machine->device( "messram" );
577   state->pia_0   = machine->device( "pia_0" );
578   state->pia_1   = machine->device( "pia_1" );
579   state->sio     = machine->device( "sio" );
580   state->speaker = machine->device( "speaker" );
581}
582
583
584578static MACHINE_RESET( osbexec )
585579{
586580   osbexec_state *state = machine->driver_data<osbexec_state>();
r9861r9862
608602   MDRV_CPU_IO_MAP( osbexec_io)
609603   MDRV_CPU_CONFIG( osbexec_daisy_config )
610604
611   MDRV_MACHINE_START( osbexec )
612605   MDRV_MACHINE_RESET( osbexec )
613606
614607   MDRV_SCREEN_ADD("screen", RASTER)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team