;******************************************************************************* ; MC-Genjin Memory Mapper for PC-Engine * ;******************************************************************************* ; MC-Genjin is a memory mapper for the PC-Engine console which is implementable ; on a single Altera EPM7032LC44 CPLD. It supports up to 8MB of ROM and internal ; swapping of the datalines for region control. Two user chipselect lines are ; given, each with a 256KB mapping area. ; ; The region of memory for HuCards is arranged as follows... ; ; $000000 - $03FFFF : Low 256KB of ROM ; $040000 - $07FFFF : Selected 256KB ROM Bank ; $080000 - $0BFFFF : User CS0 ; $0C0000 - $0FFFFF : User CS1 ; ; The two mapper registers are are accessed by writing to $000000 - $07FFFF. ; ; - Writes to EVEN addresses (A0 == '0') set the mapper region control. ; ; 76543210 ; Mapper Region Control : xxxxxxxS ; ; 0 == Direct data order (Native) ; 1 == Reversed data order (Swapped) ; ; - Writes to ODD addresses (A0 == '1') select the current 256KB ROM Bank ; visible in $040000 - $07FFFF. ; ; 76543210 ; Mapper Bank Control : xxxBBBBB ; ; BBBBB == A22 - A18 of the 256KB Bank ; ; While data read from ROM is swapped when dataline transposition is enabled, ; any writes to the mapper will remain unaltered. ;------------------------------------------------------------------------------- .define MCGENJIN_REGION $FFFE .define REGION_SWAPPED $FF .define REGION_USWAPPED $00 .define MCGENJIN_BANK $FFFF