Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix debugger #55

Merged
merged 1 commit into from
Jun 29, 2024
Merged

Fix debugger #55

merged 1 commit into from
Jun 29, 2024

Conversation

joajfreitas
Copy link
Collaborator

@joajfreitas joajfreitas commented Jun 24, 2024

ToDo:

  • print from memory location: pu8, pu16, pi8, pi16
  • print register
  • next
  • help
  • watchpoints
  • list

Implemented:

  • Reintroduce debug events

@joajfreitas joajfreitas self-assigned this Jun 24, 2024
@joajfreitas
Copy link
Collaborator Author

@pineman I'm am once again trying to understand why the debugger cannot be a wrapper around the cpu. We've moved the debugger inside the cpu but that means that we have to "push" all the information to the debugger now.

When the functionality of the debugger is small this not an issue, since not that much information is needed. But when we actually want good print functionality then things get a bit harder.

@joajfreitas
Copy link
Collaborator Author

I also don't understand why actually pausing the cpu is implemented in fpt-egui. To me it would obviously be either the responsibility of Gameboy or LR35902 and PPU.

@pineman
Copy link
Owner

pineman commented Jun 24, 2024

my question is just why can't "the debugger" just be a bunch of methods of the cpu/gameboy or on the cpu/gameboy. seems much easier? and we can worry about boundaries later when we actually know what we've built.

but I'm fine with whatever as long as it works and the client can still have a decent api. it needs to be able to run individual cycles, at least. It could be argued though that running individual instructions could be good enough (timing-wise) as long as the ppu can be kept in sync

@pineman
Copy link
Owner

pineman commented Jun 24, 2024

on pausing, what do you mean? the client needs to, at least, be able to toggle pausing itself and check if the gb is paused or not. what changes exactly do you suggest?

@pineman
Copy link
Owner

pineman commented Jun 24, 2024

I had also implemented watchpoints, did that get deleted as well? I believe it was just a trigger on set_mem8

two more features that would be great to have:

  • step over
  • continue until current loop is done

@joajfreitas
Copy link
Collaborator Author

my question is just why can't "the debugger" just be a bunch of methods of the cpu/gameboy or on the cpu/gameboy. seems much easier? and we can worry about boundaries later when we actually know what we've built.

but I'm fine with whatever as long as it works and the client can still have a decent api. it needs to be able to run individual cycles, at least. It could be argued though that running individual instructions could be good enough (timing-wise) as long as the ppu can be kept in sync

To me at least, when a single component becomes very large, it also becomes impossible for me to understand. Sometimes its harder when the "communication" between components is also very complex, however in general smaller components are easier to "grok"

@joajfreitas
Copy link
Collaborator Author

on pausing, what do you mean? the client needs to, at least, be able to toggle pausing itself and check if the gb is paused or not. what changes exactly do you suggest?

I agree the functionality itself makes a lot of sense. However, it is still surprising to me that the pausing of the gameboy is directly implemented in the fpt egui. To me it would make sense that the gameboy would offer the capability, but implement it internally.

This was so surprising that I spent around 1 hour until I thought of going to look inside fpt-egui for the pause functionality.

@joajfreitas joajfreitas mentioned this pull request Jun 29, 2024
6 tasks
@joajfreitas joajfreitas merged commit 9d80356 into main Jun 29, 2024
1 check passed
@joajfreitas joajfreitas deleted the fix_debugger branch June 29, 2024 11:21
@joajfreitas joajfreitas added the bug Something isn't working label Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants