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

NTSC/PAL border setup at frame access, cleaner debug output. #236

Merged
merged 1 commit into from
Mar 23, 2021
Merged

NTSC/PAL border setup at frame access, cleaner debug output. #236

merged 1 commit into from
Mar 23, 2021

Conversation

hernandp
Copy link
Contributor

Changes:

  • per-frame video mode setup, the sane way to do it.
  • legacy registers interpret routine did the vertical border setup before, this was bad as HOTREGS is not required to change when NTSC/PAL is switched, but borders must be setup.
    Now I partitioned the old routine into vertical border, horizontal border and legacy registers.
    Moved them at top to mantain static declarations.
    And as a side effect, you will see cleaner debugging information.

@lgblgblgb
Copy link
Owner

lgblgblgb commented Mar 23, 2021

Thanks, I'll have a look once I have some time to do so (hopefully tonight, ehm, I meant in European time or such ... as usual).

@lgblgblgb
Copy link
Owner

Have you put this part:

if (!in_hypervisor) {
    vic4_update_sideborder_dimensions();
    vic4_update_vertical_borders();
}

into vic4_open_frame_access? I have a worry about this ... Maybe the PAL/VIC change by register write happens some time, but for the time, when a new frame is started, it's already not true that we're still in hypervisor mode, or vice-versa. That was the problem of mine, when I mentioned that I'm really out of ideas how to manage things in a "split situation" like this (split in time, I mean, the effect is not happening when the write itself).

@hernandp
Copy link
Contributor Author

Have you put this part:

if (!in_hypervisor) {
    vic4_update_sideborder_dimensions();
    vic4_update_vertical_borders();
}

into vic4_open_frame_access? I have a worry about this ... Maybe the PAL/VIC change by register write happens some time, but for the time, when a new frame is started, it's already not true that we're still in hypervisor mode, or vice-versa. That was the problem of mine, when I mentioned that I'm really out of ideas how to manage things in a "split situation" like this (split in time, I mean, the effect is not happening when the write itself).

We should not check of hypervisor presence as of yet, and simply let the video mode setup go through at vic4_open_frame_access. I think we can remove that check and annotate a reference to the topic for later.

@lgblgblgb
Copy link
Owner

Probably. I think we can't figure out a 100% correct solution, works also after a million years from now ;) But, maybe this is not even very frequent that somebody changes video mode. At least I wouldn't find that useful to try to set NTSC/PAL at every second frame or so (a modern LCD monitor may even blank on video mode change for seconds anyway ... at least for more than zero frame). One thing that can be interesting that it seems freezer may use another video standard than the "user program" so there can be a true "danger" of video mode transition on hypervisor enter/leave boundaries. But again, I "blog" these here that we can refer it later maybe. On shorter term, the goal now to have something which in usual cases works (and anyway Xemu cannot use freezer currently, that's another point ...).

@lgblgblgb lgblgblgb merged commit 2bf0d86 into lgblgblgb:merger Mar 23, 2021
@lgblgblgb
Copy link
Owner

I've merged now, honestly I don't even know why I waited with this, since we have no "danger" here to merge anything, it's a kind of "wild" branch ;)

@hernandp
Copy link
Contributor Author

No problem at all with commenting, waiting, reasoning about this etc. I appreciate your opinions very much.

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

Successfully merging this pull request may close these issues.

MEGA65: integrate Hernan's ideas/work on VIC-IV enhancements with the possibility of re-factoring meanwhile
2 participants