Previous 15994 Revisions Next

r8542 Monday 19th July, 2010 at 20:32:20 UTC by Wilbert Pol
[3DO] Renamed a memory area and some documentation updates.
[src/mess/drivers]3do.c
[src/mess/includes]3do.h
[src/mess/machine]3do.c

src/mess/machine/3do.c
r8541r8542
1/*
12
3With nothing on the slow2 expansion bus:
4- 0300035c - after determining memory size
5- dspp stuff
6- 03000568
7*/
8
29#include "emu.h"
310#include "includes/3do.h"
411
12
513typedef struct {
14   /* 03180000 - 0318003f - configuration group */
15   /* 03180040 - 0318007f - diagnostic UART */
16
17   UINT8   cg_r_count;
18   UINT8   cg_w_count;
19   UINT32   cg_input;
20   UINT32   cg_output;
21} SLOW2;
22
23
24typedef struct {
625   UINT32   revision;      /* 03300000 */
726   UINT32   msysbits;      /* 03300004 */
827   UINT32   mctl;         /* 03300008 */
r8541r8542
129148} CLIO;
130149
131150
132//static UINT32 unk_318_data_0 = 0;
151static SLOW2   slow2;
133152static MADAM   madam;
134153static CLIO      clio;
135154static UINT32   svf_color;
r8541r8542
147166
148167
149168/*
150    I have no idea what piece of hardware this is. Possibly some kind of communication hardware.
169    I have no idea what piece of hardware this is. Possibly some kind of communication hardware using shift registers.
151170
152171    During booting the following things get written/read:
153    write 03180000 to 03180000
154    4 read actions from 03180000, if lower bit is 1 0 1 0 then
155    write 02000000 to 03180000
156    write 04000000 to 03180000
157    write 08000000 to 03180000
158    write 10000000 to 03180000
159    write 20000000 to 03180000
160    write 40000000 to 03180000
161    write 80000000 to 03180000
162    write 00000001 to 03180000
163    write 00000002 to 03180000
164    write 00000004 to 03180000
165    write 00000008 to 03180000
166    write 00000010 to 03180000
167    write 00000020 to 03180000
168    write 00000040 to 03180000
169    write 00000080 to 03180000
170    write 00000100 to 03180000
171    read from 03180000
172    write 04000000 to 03180000
173    write 08000000 to 03180000
174    write 10000000 to 03180000
175    write 20000000 to 03180000
176    write 40000000 to 03180000
177    write 80000000 to 03180000
178    write 00000001 to 03180000
179    write 00000002 to 03180000
180    write 00000004 to 03180000
181    write 00000008 to 03180000
182    write 00000010 to 03180000
183    write 00000020 to 03180000
184    write 00000040 to 03180000
185    write 00000080 to 03180000
186    write 00000100 to 03180000
187    write 00002000 to 03180000
188    several groups of 16 write actions or 16 read actions
172    - write 03180000 to 03180000 (init reading sequence)
173    - 4 read actions from 03180000 bit#0, if lower bit is 1 0 1 0 then   (expect to read 0x0a)
174   - read from 03180000 (init writing sequence)
175   - write 0x0100 to shift register bit#0
176   - reset PON bit in CSTATBITS
177    - wait a little while
178    - read from 03180000
179   - write 0x0200 to shift register bit#0
180   - write 0x0002 to shift register bit#1
181   - dummy write to 03180000
182   - read from shift register bits #0 and #1.
183   - check if data read equals 0x44696167 (=Diag)   If so, jump 302196c in default bios
184   - dummy read from shift register
185   - write 0x0300 to shift register bit #0
186   - dummy write to shift register
187    - read data from shift register bit #0.
188    - xor that data with 0x07ff
189   - write that data & 0x00ff | 0x4000 to the shift register
1903022630
189191*/
190192
191READ32_HANDLER( _3do_unk_318_r ) {
193READ32_HANDLER( _3do_slow2_r ) {
194   UINT32 data = 0;
195
192196   logerror( "%08X: UNK_318 read offset = %08X\n", cpu_get_pc(space->machine->device("maincpu")), offset );
193#if 0
197
194198   switch( offset ) {
195199   case 0:      /* Boot ROM checks here and expects to read 1, 0, 1, 0 in the lowest bit */
196      unk_318_data_0 ^= 1;
197      return unk_318_data_0;
200      data = slow2.cg_output & 0x00000001;
201      slow2.cg_output = slow2.cg_output >> 1;
202      slow2_cg_w_count = 0;
198203   }
199#endif
200   return 0;
204   return data;
201205}
202206
203207
204WRITE32_HANDLER( _3do_unk_318_w )
208WRITE32_HANDLER( _3do_slow2_w )
205209{
206210   logerror( "%08X: UNK_318 write offset = %08X, data = %08X, mask = %08X\n", cpu_get_pc(space->machine->device("maincpu")), offset, data, mem_mask );
207211
r8541r8542
212216         /* disable ROM overlay */
213217         memory_set_bank(space->machine, "bank1", 0);
214218      }
219      slow2.cg_input = slow2.cg_input << 1 | ( data & 0x00000001 );
220      slow2.cg_w_count ++;
221      if ( slow2.cg_w_count == 16 )
222      {
223      }
215224      break;
216225   }
217226}
218227
219228
229void _3do_slow2_init( running_machine *machine )
230{
231   slow2.cg_input = 0;
232   slow2.cg_output = 0x00000005 - 1;
233}
234
235
220236READ32_HANDLER( _3do_svf_r )
221237{
222238   logerror( "%08X: SVF read offset = %08X\n", cpu_get_pc(space->machine->device("maincpu")), offset*4 );
r8541r8542
588604}
589605
590606
591void _3do_madam_init( void )
607void _3do_madam_init( running_machine *machine )
592608{
593609   memset( &madam, 0, sizeof(MADAM) );
594610   madam.revision = 0x01020000;
r8541r8542
882898   }
883899}
884900
885void _3do_clio_init( void )
901void _3do_clio_init( running_machine *machine )
886902{
887903   memset( &clio, 0, sizeof(CLIO) );
888   clio.revision = 0x02022000;
904   clio.revision = 0x02022000 /* 0x04000000 */;
889905   clio.cstatbits = 0x01;   /* bit 0 = reset of clio caused by power on */
890906   clio.unclerev = 0x03800000;
891907}
src/mess/includes/3do.h
r8541r8542
2323READ32_HANDLER( _3do_nvarea_r );
2424WRITE32_HANDLER( _3do_nvarea_w );
2525
26READ32_HANDLER( _3do_unk_318_r );
27WRITE32_HANDLER( _3do_unk_318_w );
26READ32_HANDLER( _3do_slow2_r );
27WRITE32_HANDLER( _3do_slow2_w );
28void _3do_slow2_init( running_machine *machine );
2829
2930READ32_HANDLER( _3do_svf_r );
3031WRITE32_HANDLER( _3do_svf_w );
3132
3233READ32_HANDLER( _3do_madam_r );
3334WRITE32_HANDLER( _3do_madam_w );
34void _3do_madam_init( void );
35void _3do_madam_init( running_machine *machine );
3536
3637READ32_HANDLER( _3do_clio_r );
3738WRITE32_HANDLER( _3do_clio_w );
38void _3do_clio_init( void );
39void _3do_clio_init( running_machine *machine );
3940
4041
4142#endif /* _3DO_H_ */
src/mess/drivers/3do.c
r8541r8542
113113   AM_RANGE(0x00200000, 0x002FFFFF) AM_RAM   AM_BASE_MEMBER(_3do_state,vram)                           /* VRAM */
114114   AM_RANGE(0x03000000, 0x030FFFFF) AM_ROMBANK("bank2")                           /* BIOS */
115115   AM_RANGE(0x03140000, 0x0315FFFF) AM_READWRITE(_3do_nvarea_r, _3do_nvarea_w)            /* NVRAM */
116   AM_RANGE(0x03180000, 0x031FFFFF) AM_READWRITE(_3do_unk_318_r, _3do_unk_318_w)         /* ???? */
116   AM_RANGE(0x03180000, 0x031BFFFF) AM_READWRITE(_3do_slow2_r, _3do_slow2_w)            /* Slow bus - additional expansion */
117117   AM_RANGE(0x03200000, 0x0320FFFF) AM_READWRITE(_3do_svf_r, _3do_svf_w)               /* special vram access1 */
118118   AM_RANGE(0x03300000, 0x033FFFFF) AM_READWRITE(_3do_madam_r, _3do_madam_w)            /* address decoder */
119119   AM_RANGE(0x03400000, 0x034FFFFF) AM_READWRITE(_3do_clio_r, _3do_clio_w)               /* io controller */
r8541r8542
145145   /* start with overlay enabled */
146146   memory_set_bank(machine, "bank1", 1);
147147
148   _3do_madam_init();
149   _3do_clio_init();
148   _3do_slow2_init(machine);
149   _3do_madam_init(machine);
150   _3do_clio_init(machine);
150151}
151152
152153

Previous 15994 Revisions Next


© 1998-2018 The MESS Team