src/mess/machine/3do.c
| r8541 | r8542 | |
| 1 | /* |
| 1 | 2 | |
| 3 | With nothing on the slow2 expansion bus: |
| 4 | - 0300035c - after determining memory size |
| 5 | - dspp stuff |
| 6 | - 03000568 |
| 7 | */ |
| 8 | |
| 2 | 9 | #include "emu.h" |
| 3 | 10 | #include "includes/3do.h" |
| 4 | 11 | |
| 12 | |
| 5 | 13 | typedef 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 | |
| 24 | typedef struct { |
| 6 | 25 | UINT32 revision; /* 03300000 */ |
| 7 | 26 | UINT32 msysbits; /* 03300004 */ |
| 8 | 27 | UINT32 mctl; /* 03300008 */ |
| r8541 | r8542 | |
| 129 | 148 | } CLIO; |
| 130 | 149 | |
| 131 | 150 | |
| 132 | | //static UINT32 unk_318_data_0 = 0; |
| 151 | static SLOW2 slow2; |
| 133 | 152 | static MADAM madam; |
| 134 | 153 | static CLIO clio; |
| 135 | 154 | static UINT32 svf_color; |
| r8541 | r8542 | |
| 147 | 166 | |
| 148 | 167 | |
| 149 | 168 | /* |
| 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. |
| 151 | 170 | |
| 152 | 171 | 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 |
| 190 | 3022630 |
| 189 | 191 | */ |
| 190 | 192 | |
| 191 | | READ32_HANDLER( _3do_unk_318_r ) { |
| 193 | READ32_HANDLER( _3do_slow2_r ) { |
| 194 | UINT32 data = 0; |
| 195 | |
| 192 | 196 | logerror( "%08X: UNK_318 read offset = %08X\n", cpu_get_pc(space->machine->device("maincpu")), offset ); |
| 193 | | #if 0 |
| 197 | |
| 194 | 198 | switch( offset ) { |
| 195 | 199 | 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; |
| 198 | 203 | } |
| 199 | | #endif |
| 200 | | return 0; |
| 204 | return data; |
| 201 | 205 | } |
| 202 | 206 | |
| 203 | 207 | |
| 204 | | WRITE32_HANDLER( _3do_unk_318_w ) |
| 208 | WRITE32_HANDLER( _3do_slow2_w ) |
| 205 | 209 | { |
| 206 | 210 | logerror( "%08X: UNK_318 write offset = %08X, data = %08X, mask = %08X\n", cpu_get_pc(space->machine->device("maincpu")), offset, data, mem_mask ); |
| 207 | 211 | |
| r8541 | r8542 | |
| 212 | 216 | /* disable ROM overlay */ |
| 213 | 217 | memory_set_bank(space->machine, "bank1", 0); |
| 214 | 218 | } |
| 219 | slow2.cg_input = slow2.cg_input << 1 | ( data & 0x00000001 ); |
| 220 | slow2.cg_w_count ++; |
| 221 | if ( slow2.cg_w_count == 16 ) |
| 222 | { |
| 223 | } |
| 215 | 224 | break; |
| 216 | 225 | } |
| 217 | 226 | } |
| 218 | 227 | |
| 219 | 228 | |
| 229 | void _3do_slow2_init( running_machine *machine ) |
| 230 | { |
| 231 | slow2.cg_input = 0; |
| 232 | slow2.cg_output = 0x00000005 - 1; |
| 233 | } |
| 234 | |
| 235 | |
| 220 | 236 | READ32_HANDLER( _3do_svf_r ) |
| 221 | 237 | { |
| 222 | 238 | logerror( "%08X: SVF read offset = %08X\n", cpu_get_pc(space->machine->device("maincpu")), offset*4 ); |
| r8541 | r8542 | |
| 588 | 604 | } |
| 589 | 605 | |
| 590 | 606 | |
| 591 | | void _3do_madam_init( void ) |
| 607 | void _3do_madam_init( running_machine *machine ) |
| 592 | 608 | { |
| 593 | 609 | memset( &madam, 0, sizeof(MADAM) ); |
| 594 | 610 | madam.revision = 0x01020000; |
| r8541 | r8542 | |
| 882 | 898 | } |
| 883 | 899 | } |
| 884 | 900 | |
| 885 | | void _3do_clio_init( void ) |
| 901 | void _3do_clio_init( running_machine *machine ) |
| 886 | 902 | { |
| 887 | 903 | memset( &clio, 0, sizeof(CLIO) ); |
| 888 | | clio.revision = 0x02022000; |
| 904 | clio.revision = 0x02022000 /* 0x04000000 */; |
| 889 | 905 | clio.cstatbits = 0x01; /* bit 0 = reset of clio caused by power on */ |
| 890 | 906 | clio.unclerev = 0x03800000; |
| 891 | 907 | } |
src/mess/drivers/3do.c
| r8541 | r8542 | |
| 113 | 113 | AM_RANGE(0x00200000, 0x002FFFFF) AM_RAM AM_BASE_MEMBER(_3do_state,vram) /* VRAM */ |
| 114 | 114 | AM_RANGE(0x03000000, 0x030FFFFF) AM_ROMBANK("bank2") /* BIOS */ |
| 115 | 115 | 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 */ |
| 117 | 117 | AM_RANGE(0x03200000, 0x0320FFFF) AM_READWRITE(_3do_svf_r, _3do_svf_w) /* special vram access1 */ |
| 118 | 118 | AM_RANGE(0x03300000, 0x033FFFFF) AM_READWRITE(_3do_madam_r, _3do_madam_w) /* address decoder */ |
| 119 | 119 | AM_RANGE(0x03400000, 0x034FFFFF) AM_READWRITE(_3do_clio_r, _3do_clio_w) /* io controller */ |
| r8541 | r8542 | |
| 145 | 145 | /* start with overlay enabled */ |
| 146 | 146 | memory_set_bank(machine, "bank1", 1); |
| 147 | 147 | |
| 148 | | _3do_madam_init(); |
| 149 | | _3do_clio_init(); |
| 148 | _3do_slow2_init(machine); |
| 149 | _3do_madam_init(machine); |
| 150 | _3do_clio_init(machine); |
| 150 | 151 | } |
| 151 | 152 | |
| 152 | 153 | |