src/mess/machine/genesis_pcb.c
| r9670 | r9671 | |
| 1 | | /***************************************************************************************** |
| 2 | | |
| 3 | | Genesis/MegaDrive Cart PCBs Emulation |
| 4 | | |
| 5 | | ****************************************************************************************/ |
| 6 | | |
| 7 | | #include "emu.h" |
| 8 | | #include "genesis_pcb.h" |
| 9 | | |
| 10 | | typedef struct _md_pcb md_pcb; |
| 11 | | struct _md_pcb |
| 12 | | { |
| 13 | | const char *pcb_name; |
| 14 | | int pcb_id; |
| 15 | | }; |
| 16 | | |
| 17 | | // Here, we take the feature attribute from .xml (i.e. the PCB name) and we assign a unique ID to it |
| 18 | | static const md_pcb pcb_list[] = |
| 19 | | { |
| 20 | | /* Standard Sega PCB (one rom) */ |
| 21 | | {"171-5703", STD_ROM}, |
| 22 | | {"171-5927", STD_ROM}, |
| 23 | | {"171-5978B", STD_ROM}, |
| 24 | | {"171-5978BA", STD_ROM}, |
| 25 | | {"171-6329A", STD_ROM}, |
| 26 | | |
| 27 | | /* Sega PCB with two roms */ |
| 28 | | {"171-5841", STD_ROM}, |
| 29 | | |
| 30 | | /* Sega PCB with Serial EEPROM */ |
| 31 | | {"171-5878", SEGA_5878}, |
| 32 | | {"171-6584A", SEGA_6584A}, |
| 33 | | |
| 34 | | /* Sega PCB with sram */ |
| 35 | | {"171-5921", SEGA_5921}, |
| 36 | | {"171-6278A", SEGA_6278A}, |
| 37 | | |
| 38 | | /* Sega PCB with fram */ |
| 39 | | {"171-6658A", SEGA_6658A}, |
| 40 | | |
| 41 | | /* Namcot PCB (blob epoxy chip) */ |
| 42 | | {"837-8861", STD_ROM}, |
| 43 | | |
| 44 | | /* Codemasters PCB */ |
| 45 | | {"SRJCV1-2", CM_JCART}, |
| 46 | | {"SRJCV2-1", CM_JCART_SEPROM}, |
| 47 | | {"SRJCV2-2", CM_JCART_SEPROM} |
| 48 | | }; |
| 49 | | |
| 50 | | int md_get_pcb_id(const char *pcb) |
| 51 | | { |
| 52 | | int i; |
| 53 | | |
| 54 | | for (i = 0; i < ARRAY_LENGTH(pcb_list); i++) |
| 55 | | { |
| 56 | | if (!mame_stricmp(pcb_list[i].pcb_name, pcb)) |
| 57 | | return pcb_list[i].pcb_id; |
| 58 | | } |
| 59 | | |
| 60 | | return STD_ROM; |
| 61 | | } |
src/mess/machine/gen_pcb.c
| r0 | r9671 | |
| 1 | /***************************************************************************************** |
| 2 | |
| 3 | Genesis/MegaDrive Cart PCBs Emulation |
| 4 | |
| 5 | ****************************************************************************************/ |
| 6 | |
| 7 | #include "emu.h" |
| 8 | #include "gen_pcb.h" |
| 9 | |
| 10 | typedef struct _md_pcb md_pcb; |
| 11 | struct _md_pcb |
| 12 | { |
| 13 | const char *pcb_name; |
| 14 | int pcb_id; |
| 15 | }; |
| 16 | |
| 17 | // Here, we take the feature attribute from .xml (i.e. the PCB name) and we assign a unique ID to it |
| 18 | static const md_pcb pcb_list[] = |
| 19 | { |
| 20 | /* Standard Sega PCB (one rom) */ |
| 21 | {"171-5703", STD_ROM}, |
| 22 | {"171-5927", STD_ROM}, |
| 23 | {"171-5978B", STD_ROM}, |
| 24 | {"171-5978BA", STD_ROM}, |
| 25 | {"171-6329A", STD_ROM}, |
| 26 | |
| 27 | /* Sega PCB with two roms */ |
| 28 | {"171-5841", STD_ROM}, |
| 29 | |
| 30 | /* Sega PCB with Serial EEPROM */ |
| 31 | {"171-5878", SEGA_5878}, |
| 32 | {"171-6584A", SEGA_6584A}, |
| 33 | |
| 34 | /* Sega PCB with sram */ |
| 35 | {"171-5921", SEGA_5921}, |
| 36 | {"171-6278A", SEGA_6278A}, |
| 37 | |
| 38 | /* Sega PCB with fram */ |
| 39 | {"171-6658A", SEGA_6658A}, |
| 40 | |
| 41 | /* Namcot PCB (blob epoxy chip) */ |
| 42 | {"837-8861", STD_ROM}, |
| 43 | |
| 44 | /* Codemasters PCB */ |
| 45 | {"SRJCV1-2", CM_JCART}, |
| 46 | {"SRJCV2-1", CM_JCART_SEPROM}, |
| 47 | {"SRJCV2-2", CM_JCART_SEPROM} |
| 48 | }; |
| 49 | |
| 50 | int md_get_pcb_id(const char *pcb) |
| 51 | { |
| 52 | int i; |
| 53 | |
| 54 | for (i = 0; i < ARRAY_LENGTH(pcb_list); i++) |
| 55 | { |
| 56 | if (!mame_stricmp(pcb_list[i].pcb_name, pcb)) |
| 57 | return pcb_list[i].pcb_id; |
| 58 | } |
| 59 | |
| 60 | return STD_ROM; |
| 61 | } |