chungquantin / nes

NES Emulator written in Rust
0 stars 0 forks source link

mem: handle mirror effect of physical RAM in singular vector #3

Closed chungquantin closed 7 months ago

chungquantin commented 7 months ago

ISSUE

Screenshot 2023-12-13 at 22 44 21
dromaz commented 7 months ago

Hey, I've simulated the behavior of the mirror effect when accessing memory on the RAM.

However, I'm not convinced that completely abstracting everything from the bus system component is the best approach.

Please take a look at the linked branch, share your feedback, and then let's finalize this so we can move on to the graphics part :))

dromaz commented 7 months ago

In my opinion, both of these tickets are related and can be closed together once one of them is completed.

1

chungquantin commented 7 months ago

Hey @dromaz, I just took a look at your code, very clean! And thanks for writing the test case for it as well. Could you explain more what do you mean by saying abstracting everything from the bus system component?

dromaz commented 7 months ago

In reference to the ticket, #1 you mentioned this resource: https://bugzmanov.github.io/nes_ebook/chapter_4.html.

I believe that in their scenario, abstracting the bus into its own module makes sense, considering the logic of their codebase/tutorial.

At the moment, we only need to focus on managing the mirror effect carried out by the bus, without having to create a separate module or trait and integrating it into the CPU module.

chungquantin commented 7 months ago

@dromaz I see. Agree, I think with what you are having right now for the mirror effect, it is unnecessary to over-complicate with the concept of bus. If we can handle the memory in a right way, I guess that's fine.

So do you think this issue can be closed?

dromaz commented 7 months ago

For me, yes, also than #1