VRC4 in VHDL

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Post Reply
squall926
Posts: 35
Joined: Wed Jan 03, 2018 3:50 pm

VRC4 in VHDL

Post by squall926 »

Hello,
I need some help to understands the mirror from VRC4(23) mapper.

Code: Select all

	...
	...
	mirror		<= cpu_data_i(1 downto 0); -- 9xxx
	...
	...
	
	
	ciram_ce	<= not ppu_addr_i(13);
	
	-- Try One, best result at now.
	with mirror select 	ciram_a10	<=
		ppu_addr_i(10)	when "00", -- Vertical Mirror
		ppu_addr_i(11)	when "01", -- Horizontal Mirror
		mirror(0)	when "10",
		'1'		when "11",
		'1'		when others;
	
	-- Try Two.
	-- ciram_a10	<= 	mirror(0) 	when mirror(1) = '1' else
	-- 			ppu_addr_i(10)	when mirror(0) = '0' else
	-- 			ppu_addr_i(11);
Tested with Kid Dracula, but at begin, when sun animation start, the screen glitch, and the scroll at game title glitch too. I believe the mirror is wrong.
At https://www.nesdev.org/wiki/VRC2_and_VRC4 just say:
Mirroring (0: vertical; 1: horizontal; 2: one-screen, lower bank; 3: one-screen, upper bank)
Macrocells Used: 138/144 (96%)
Another maybe important thing, me mapper is using a XC95144Xl and when i implement the IRQ i need to reduce the ppu banks to only 7(6 to 0), in others words, control A16toA10 from memory, 128kB char rom.

If someone can confirm this mirror method is right, ill be back to irq.

Thanks for your time.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: VRC4 in VHDL

Post by lidnariq »

what does "mirror(0)" do? It should just be 0...
Post Reply