trunk/src/mess/machine/nes_bootleg.c
| r22604 | r22605 | |
| 1109 | 1109 | (UNL-)09-034A |
| 1110 | 1110 | |
| 1111 | 1111 | Games: Zanac FDS conversion with two PRG chips and |
| 1112 | | no CHRROM (apparently also a Volleyball FDS conversion |
| 1113 | | but the ones we have do not seem to be on this hw |
| 1112 | no CHRROM and Volleyball FDS conversion with two PRG |
| 1113 | chips and CHRROM. |
| 1114 | 1114 | Originally dumps were marked as UNL-SMB2J pcb |
| 1115 | | |
| 1116 | 1115 | |
| 1117 | 1116 | iNES: |
| 1118 | 1117 | |
| 1119 | | In MESS: Supported (for Zanac) |
| 1118 | In MESS: Supported. |
| 1120 | 1119 | |
| 1121 | 1120 | -------------------------------------------------*/ |
| 1122 | 1121 | |
| r22604 | r22605 | |
| 1125 | 1124 | LOG_MMC(("09-034a write_ex, offset: %04x, data: %02x\n", offset, data)); |
| 1126 | 1125 | |
| 1127 | 1126 | if (offset == 7) // $4027 |
| 1128 | | { |
| 1129 | 1127 | m_reg = data & 1; |
| 1130 | | if (m_chr_source == CHRRAM) // zanac has no CHRROM and is wired differently so to access the second PRG chip |
| 1131 | | m_reg += 4; |
| 1132 | | } |
| 1133 | 1128 | } |
| 1134 | 1129 | |
| 1135 | 1130 | READ8_MEMBER(nes_09034a_device::read_m) |
| 1136 | 1131 | { |
| 1137 | 1132 | LOG_MMC(("09-034a read_m, offset: %04x\n", offset)); |
| 1138 | | return m_prg[(m_reg * 0x2000) + offset]; |
| 1133 | // in 0x6000-0x7fff is mapped the 2nd PRG chip which starts after 32K (hence the +4) |
| 1134 | return m_prg[((m_reg + 4) * 0x2000) + offset]; |
| 1139 | 1135 | } |
| 1140 | 1136 | |
| 1141 | 1137 | /*------------------------------------------------- |
trunk/src/mess/machine/nes_slot.c
| r22604 | r22605 | |
| 3 | 3 | |
| 4 | 4 | Nintendo NES/FC cart emulation |
| 5 | 5 | (through slot devices) |
| 6 | |
| 7 | The driver exposes address ranges |
| 8 | 0x4100-0x5fff to read_l/write_l |
| 9 | 0x6000-0x7fff to read_m/write_m (here are *usually* installed NVRAM & WRAM, if any) |
| 10 | 0x8000-0xffff to write_h (reads are directed to 4 x 8K PRG banks) |
| 11 | Default implementations of these handlers are available here, to be rewritten by PCB-specific ones when needed. |
| 6 | 12 | |
| 7 | | TODO: add notes about driver connections + about open bus (and our sketchy implementation) + about bus conflict... |
| 8 | | |
| 9 | | ***********************************************************************************************************/ |
| 13 | Additional handlers are available, but have to be manually installed at machine_start |
| 14 | * read_ex/write_ex for address range 0x4020-0x40ff |
| 15 | * read_h for address range 0x8000-0xffff when a cart does some protection or address scramble before reading ROM |
| 10 | 16 | |
| 11 | | /***************************************************************************************** |
| 17 | PPU exposes address ranges |
| 18 | 0x0000-0x1fff to chr_r/chr_w |
| 19 | 0x2000-0x3eff to nt_r/nt_w |
| 20 | Default implementations of these handlers are available here, to be rewritten by PCB-specific ones when needed. |
| 21 | |
| 22 | Plus a few of latch functions are available: ppu_latch (see MMC2), hblank_irq and scanline_irq (see e.g. MMC3), |
| 23 | but these might be subject to future changes when the PPU is revisited. |
| 12 | 24 | |
| 13 | | Notes to be merged / split... |
| 25 | Notes: |
| 26 | - Differently from later systems (like SNES or MD), it is uncommon to find PRG ROMs of NES games which are not a |
| 27 | power of 2K, so we do not perform any mirroring by default. |
| 28 | A bunch of pcb types, though, come with 1.5MB of PRG (some Waixing translations) or with multiple PRG chips |
| 29 | having peculiar size (32K + 16K, 32K + 8K, 32K + 2K). Hence, if such a configuration is detected, we provide |
| 30 | a m_prg_bank_map array to handle internally PRG mirroring up to the next power of 2K, as long as the size is |
| 31 | a multiple of 8K (i.e. the unit chunk for standard PRG). |
| 32 | For the case of PRG chips which are not-multiple of 8K (e.g. UNL-MARIO2-MALEE pcb), the handling has to be |
| 33 | handled in the pcb-specific code! |
| 34 | - Our open bus emulation is very sketchy, by simply returning the higher 8bits of the accessed address. This seems |
| 35 | enough for most games (only two sets have issues with this). A slightly better implementation is almost ready |
| 36 | to fix these two remaining cases, but I plan to revisit the whole implementation in an accurate way at a later |
| 37 | stage |
| 38 | - Bus conflict is implemented based on latest tests by Blargg. There is some uncertainty about AxROM behavior |
| 39 | (some AOROM pcbs suffers from bus conflict, some do not... since no AOROM game is known to glitch due to lack |
| 40 | of bus conflict it seems safe to emulate the board without bus conflict, but eventually it would be good to |
| 41 | differentiate the real variants) |
| 14 | 42 | |
| 15 | | Many information about the mappers below come from the wonderful doc written by Disch. |
| 43 | |
| 44 | Many information about the mappers/pcbs come from the wonderful doc written by Disch. |
| 16 | 45 | Current info (when used) are based on v0.6.1 of his docs. |
| 17 | 46 | You can find the latest version of the doc at http://www.romhacking.net/docs/362/ |
| 18 | 47 | |
| 48 | A lot of details have been based on the researches carried on at NesDev forums (by Blargg, Quietust and many more) |
| 49 | and collected on the NesDev Wiki http://wiki.nesdev.com/ |
| 19 | 50 | |
| 51 | Particular thanks go to |
| 52 | - Martin Freij for his work on NEStopia |
| 53 | - Cah4e3 for his efforts on FCEUMM and the reverse engineering of pirate boards |
| 54 | - BootGod, lidnariq and naruko for the PCB tests which made possible |
| 55 | |
| 56 | |
| 57 | ***********************************************************************************************************/ |
| 58 | |
| 59 | /***************************************************************************************** |
| 60 | |
| 20 | 61 | A few Mappers suffer of hardware conflict: original dumpers have used the same mapper number for more than |
| 21 | 62 | a kind of boards. In these cases (and only in these cases) we exploit nes.hsi to set up accordingly |
| 22 | 63 | emulation. Games which requires this hack are the following: |
| r22604 | r22605 | |
| 118 | 159 | m_prg = auto_alloc_array_clear(machine, UINT8, size); |
| 119 | 160 | m_prg_size = size; |
| 120 | 161 | m_prg_chunks = size / 0x4000; |
| 121 | | if (size % 0x4000) |
| 162 | if (size % 0x2000) |
| 122 | 163 | { |
| 123 | 164 | // A few pirate carts have PRG made of 32K + 2K or some weird similar config |
| 124 | 165 | // in this case we treat the banking as if this 'extra' PRG is not present and |
| 125 | 166 | // the pcb code has to handle it by accessing directly m_prg! |
| 126 | | printf("Warning! The loaded PRG has size not a multiple of 16KB (0x%X)\n", (UINT32)size); |
| 167 | printf("Warning! The loaded PRG has size not a multiple of 8KB (0x%X)\n", (UINT32)size); |
| 127 | 168 | m_prg_chunks--; |
| 128 | 169 | } |
| 129 | 170 | |
trunk/hash/nes.xml
| r22604 | r22605 | |
| 63462 | 63462 | </part> |
| 63463 | 63463 | </software> |
| 63464 | 63464 | |
| 63465 | | <software name="vballfdsa" cloneof="volley" supported="no"> |
| 63465 | <software name="vballfds" cloneof="volley" supported="no"> |
| 63466 | 63466 | <description>Volleyball (Asia, FDS conversion, Alt)</description> |
| 63467 | 63467 | <year>19??</year> |
| 63468 | 63468 | <publisher><pirate></publisher> |
| 63469 | 63469 | <part name="cart" interface="nes_cart"> |
| 63470 | | <feature name="slot" value="smb2j" /> |
| 63470 | <feature name="slot" value="09034a" /> |
| 63471 | 63471 | <feature name="pcb" value="UNL-SMB2J" /> |
| 63472 | <feature name="mirroring" value="vertical" /> |
| 63472 | 63473 | <dataarea name="chr" size="8192"> |
| 63473 | 63474 | <rom name="volleyball (fds conversion) (unl) [u].chr" size="8192" crc="0101a6fb" sha1="fd7338e3802b897172f0f22e7f5a191bc68dd6d2" offset="00000" status="baddump" /> |
| 63474 | 63475 | </dataarea> |
| 63475 | | <dataarea name="prg" size="32768"> |
| 63476 | | <rom name="volleyball (fds conversion) (unl) [u].prg" size="32768" crc="d4fb2cd8" sha1="56cacee106de0116857421081c778ebc9d480aa0" offset="00000" status="baddump" /> |
| 63476 | <dataarea name="prg" size="40960"> |
| 63477 | <rom name="volleyball (fds conversion) (unl) [u].prg0" size="32768" crc="d4fb2cd8" sha1="56cacee106de0116857421081c778ebc9d480aa0" offset="0x0000" status="baddump" /> |
| 63478 | <rom name="volleyball (fds conversion) (unl) [u].prg1" size="8192" crc="b160e5eb" sha1="c5564e86cd50468745c8dff34398f95422a6d877" offset="0x8000" status="baddump" /> |
| 63477 | 63479 | </dataarea> |
| 63478 | 63480 | </part> |
| 63479 | 63481 | </software> |
| r22604 | r22605 | |
| 63718 | 63720 | </part> |
| 63719 | 63721 | </software> |
| 63720 | 63722 | |
| 63721 | | <software name="vballfds" cloneof="volley" supported="no"> |
| 63723 | <software name="vballfdsa" cloneof="volley" supported="no"> |
| 63722 | 63724 | <description>Volleyball (Asia, FDS conversion)</description> |
| 63723 | 63725 | <year>19??</year> |
| 63724 | 63726 | <publisher><pirate></publisher> |