src/mame/drivers/megadriv.c
| r9391 | r9392 | |
| 3937 | 3937 | ((segacd_maincpu_has_ram_access) << 0); |
| 3938 | 3938 | } |
| 3939 | 3939 | |
| 3940 | |
| 3941 | /* I'm still not 100% clear how this works, the sources I have are a bit vague, |
| 3942 | it might still be incorrect in both modes |
| 3943 | */ |
| 3944 | |
| 3945 | // DMNA = Decleration Mainram No Access (bit 0) |
| 3946 | // RET = Return access (bit 1) |
| 3947 | |
| 3948 | /* In Mode 0 |
| 3949 | |
| 3950 | */ |
| 3951 | |
| 3952 | /* In Mode 1 |
| 3953 | |
| 3954 | |
| 3955 | RET |
| 3956 | |
| 3957 | 0 = Main CPU Accesses WordRam0 (1st Half of WordRAM) |
| 3958 | Sub CPU Accesses WordRam1 (2nd Half of WordRAM) |
| 3959 | |
| 3960 | 1 = Main CPU Accesses WordRam1 (2nd Half of WordRAM) |
| 3961 | Sub CPU Accesses WordRam0 (1st Half of WordRAM) |
| 3962 | |
| 3963 | DMNA |
| 3964 | |
| 3965 | Setting this bis sends a Swap request to the SUB-CPU (Main CPU access only?) |
| 3966 | 1 = Swap Reqested / In Progress |
| 3967 | 0 = Swap Complete |
| 3968 | |
| 3969 | (personal note, is this just a software flag? in this mode? sub p11/p12) |
| 3970 | |
| 3971 | */ |
| 3972 | |
| 3940 | 3973 | static WRITE16_HANDLER( scd_a12002_memory_mode_w ) |
| 3941 | 3974 | { |
| 3942 | 3975 | //printf("scd_a12002_memory_mode_w %04x %04x\n", data, mem_mask); |
| r9391 | r9392 | |
| 3947 | 3980 | //if (data&0x0001) printf("ret bit set (invalid? can't set from main68k?)\n"); |
| 3948 | 3981 | if (data&0x0002) |
| 3949 | 3982 | { |
| 3950 | | //printf("dmn set (swap requested)\n"); // give ram to sub? |
| 3983 | //printf("dmna set (swap requested)\n"); // give ram to sub? |
| 3951 | 3984 | |
| 3952 | 3985 | // this should take some time? |
| 3953 | 3986 | segacd_maincpu_has_ram_access = 0; |
| r9391 | r9392 | |
| 4002 | 4035 | } |
| 4003 | 4036 | |
| 4004 | 4037 | |
| 4005 | | //if (data&0x0002) printf("dmn set (swap requested) (invalid, can't be set from sub68k?\n"); |
| 4038 | //if (data&0x0002) printf("dmna set (swap requested) (invalid, can't be set from sub68k?\n"); |
| 4006 | 4039 | |
| 4007 | 4040 | //if (data&0x0004) |
| 4008 | 4041 | { |
| r9391 | r9392 | |
| 4282 | 4315 | } |
| 4283 | 4316 | else if (segacd_ram_mode==1) |
| 4284 | 4317 | { |
| 4285 | | printf("Unspported: segacd_main_dataram_part1_r in mode 1\n"); |
| 4286 | | return 0x0000; |
| 4318 | |
| 4319 | if (offset<0x20000/2) |
| 4320 | { |
| 4321 | // wordram accees |
| 4322 | printf("Unspported: segacd_main_dataram_part1_r (word RAM) in mode 1\n"); |
| 4323 | return 0x0000; |
| 4324 | } |
| 4325 | else |
| 4326 | { |
| 4327 | printf("Unspported: segacd_main_dataram_part1_r (Cell rearranged RAM) in mode 1\n"); |
| 4328 | return 0x0000; |
| 4329 | } |
| 4287 | 4330 | } |
| 4288 | 4331 | |
| 4289 | 4332 | return 0x0000; |
| r9391 | r9392 | |
| 4306 | 4349 | } |
| 4307 | 4350 | else if (segacd_ram_mode==1) |
| 4308 | 4351 | { |
| 4309 | | printf("Unspported: segacd_main_dataram_part1_w in mode 1\n"); |
| 4352 | if (offset<0x20000/2) |
| 4353 | { |
| 4354 | printf("Unspported: segacd_main_dataram_part1_w (word RAM) in mode 1\n"); |
| 4355 | // wordram accees |
| 4356 | } |
| 4357 | else |
| 4358 | { |
| 4359 | printf("Unspported: segacd_main_dataram_part1_w (Cell rearranged RAM) in mode 1 (illega?)\n"); // is this legal?? |
| 4360 | } |
| 4310 | 4361 | } |
| 4311 | 4362 | } |
| 4312 | 4363 | |
| r9391 | r9392 | |
| 4986 | 5037 | } |
| 4987 | 5038 | else if (segacd_ram_mode==1) |
| 4988 | 5039 | { |
| 4989 | | printf("Unspported: segacd_sub_dataram_part1_r in mode 1\n"); |
| 5040 | printf("Unspported: segacd_sub_dataram_part1_r in mode 1 (Word RAM Expander - 1 Byte Per Pixel)\n"); |
| 4990 | 5041 | return 0x0000; |
| 4991 | 5042 | } |
| 4992 | 5043 | |
| r9391 | r9392 | |
| 5010 | 5061 | } |
| 5011 | 5062 | else if (segacd_ram_mode==1) |
| 5012 | 5063 | { |
| 5013 | | printf("Unspported: segacd_sub_dataram_part1_w in mode 1\n"); |
| 5064 | printf("Unspported: segacd_sub_dataram_part1_w in mode 1 (Word RAM Expander - 1 Byte Per Pixel)\n"); |
| 5014 | 5065 | } |
| 5015 | 5066 | } |
| 5016 | 5067 | |
| r9391 | r9392 | |
| 5018 | 5069 | { |
| 5019 | 5070 | if (segacd_ram_mode==0) |
| 5020 | 5071 | { |
| 5021 | | printf("ILLEGAL segacd_sub_dataram_part2_r in mode 1\n"); |
| 5072 | printf("ILLEGAL segacd_sub_dataram_part2_r in mode 0\n"); // not mapepd to anything in mode 0 |
| 5022 | 5073 | return 0x0000; |
| 5023 | 5074 | } |
| 5024 | 5075 | else if (segacd_ram_mode==1) |
| 5025 | 5076 | { |
| 5026 | | printf("Unspported: segacd_sub_dataram_part2_r in mode 1\n"); |
| 5077 | printf("Unspported: segacd_sub_dataram_part2_r in mode 1 (Word RAM)\n"); |
| 5027 | 5078 | return 0x0000; |
| 5028 | 5079 | } |
| 5029 | 5080 | |
| r9391 | r9392 | |
| 5034 | 5085 | { |
| 5035 | 5086 | if (segacd_ram_mode==0) |
| 5036 | 5087 | { |
| 5037 | | printf("ILLEGAL segacd_sub_dataram_part2_w in mode 1\n"); |
| 5088 | printf("ILLEGAL segacd_sub_dataram_part2_w in mode 0\n"); // not mapepd to anything in mode 0 |
| 5038 | 5089 | } |
| 5039 | 5090 | else if (segacd_ram_mode==1) |
| 5040 | 5091 | { |
| 5041 | | printf("Unsupported: segacd_sub_dataram_part2_w in mode 1\n"); |
| 5092 | printf("Unsupported: segacd_sub_dataram_part2_w in mode 1 (Word RAM)\n"); |
| 5042 | 5093 | } |
| 5043 | 5094 | } |
| 5044 | 5095 | |