Skip to content

Cartridge.cpp ppuWrite calling pMapper.ppuMapRead? #13

Open

Description

@olitee

I'm just in the process of porting this code, and this method has me a little confused. Is line 124 a typo? Should the ppuWrite method be obtaining the mapped address using the ppuMapRead logic?

if (pMapper->ppuMapRead(addr, mapped_addr))

Full method:

bool Cartridge::ppuWrite(uint16_t addr, uint8_t data)
{
	uint32_t mapped_addr = 0;
	if (pMapper->ppuMapRead(addr, mapped_addr))
	{
		vCHRMemory[mapped_addr] = data;
		return true;
	}
	else
		return false;
}

Activity

  1. OneLoneCoder commented on Sep 13, 2019

    @OneLoneCoder
    Owner

    Yeah good spot - a copying error indeed :D

  2. olitee commented on Sep 14, 2019

    @olitee
    Author

    Ah good :D - I thought I'd totally misunderstood the mapper for a while there!

    Looking forward to Part 4, @OneLoneCoder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions