Giter Site home page Giter Site logo

Comments (13)

ppeccin avatar ppeccin commented on May 12, 2024

Ok, I'll have look at this. Its good to have a test case to analyse.
Thanks.

from webmsx.

grauw avatar grauw commented on May 12, 2024

In e.g. renderLineModeG4():

var realLine = (currentScanline - startingActiveScanline + register[23]) & 255;

I think instead of subtracting startingActiveScanline there, you should initialise currentScanline to -startingActiveScanline. So something like:

startingScanline = -16 - addBorder - verticalAdjust;
startingVisibleTopBorderScanline = -8;
startingActiveScanline = 0;
startingVisibleBottomBorderScanline = activeHeight;
startingInvisibleScanline = startingVisibleBottomBorderScanline + 8 + addBorder;
finishingScanline = frameVideoStandard.totalHeight + startingScanline;

That way the realLine is no longer affected immediately by a signal metrics change, that only happens in beginFrame(). This is also how it works in the 1chipMSX’s VHDL code.

from webmsx.

ppeccin avatar ppeccin commented on May 12, 2024

from webmsx.

ppeccin avatar ppeccin commented on May 12, 2024

Hey, It has been some time!
I am finally trying to solve this problem.

But I got suck in a question...
How does the Vertical Adjust value (r18) affect the line interrupts?

I was able to solve the rendering issue on you attached overscan test. It uses Vertical Adjust = 2

But my simulation still breaks in Sex Bomb Bunny game by Matra. It uses Vertical Adjust = -6.
The line interrupts happens too early on this game, and the overscan does not happen properly.

I wonder if this is caused by the Vertical Adjust value?

Paulo

from webmsx.

grauw avatar grauw commented on May 12, 2024

These posts may provide some further insight:

https://www.msx.org/forum/msx-talk/development/grauw%E2%80%99s-rpg-in-development?page=14#comment-338647

openMSX/openMSX#1106

from webmsx.

ppeccin avatar ppeccin commented on May 12, 2024

Nice... I will read it all!

But... Do you have any clue why the line int happens so early in Sex Bomb Bunny (on WebMSX)?

from webmsx.

grauw avatar grauw commented on May 12, 2024

I tried the demo version of Sex Bomb Bunny in openMSX… There too it currently does not work (probably due to that bug). But I checked what the game does with the debugger :).

Sex Bomb Bunny uses a split on line 200 and line 230 to get the overscan. The maximum vertical interrupt line is 234 in 60 Hz 192 line mode. If adjust affects the maximum line (which it shouldn’t), then an adjust of -6 would probably put it on line 236 effectively, causing it to be missed. Or something along those lines.

A simple test would be to do “set adjust(0, 6)” on that machine, and then boot Sex Bomb Bunny. If the game runs normally, then indeed you’re incorrectly letting the maximum split line be affected by the adjust.

from webmsx.

ppeccin avatar ppeccin commented on May 12, 2024

from webmsx.

grauw avatar grauw commented on May 12, 2024

Hmm. It’s past bed-time but let me write down some thoughts;

startingScanline = -16 - addBorder - verticalAdjust;
startingVisibleTopBorderScanline = -8;
startingActiveScanline = 0;
startingVisibleBottomBorderScanline = activeHeight;
startingInvisibleScanline = startingVisibleBottomBorderScanline + 8 + addBorder;
finishingScanline = frameVideoStandard.totalHeight + startingScanline;

And

if (currentScanline >= finishingScanline) finishFrame();

finishingScanline here depends on startingScanline, which depends on verticalAdjust. But we established already that the vertical adjust does not affect the last scan line, so that can’t be right.

Quoting a bit from the forum thread:

Given that the maximum interrupt line doesn’t change with the vertical adjustment, I thought maybe IL wasn’t affected by vertical adjust, but it is and openMSX emulates that correctly. But I did notice on my real MSX that the top lines repeat when the adjust is 7 while overscanning (except for the last), openMSX doesn’t do this.

I think this could be explained by the VDP resetting its internal line counter up to seven lines later than usual (so the first few get an old value), rather than immediately after top erase with an offset. Which would explain the maximum interrupt line not changing.

In other words, vertical adjust changes the line on which the line counter is reset, rather than the value the line counter is reset to.

Something along those lines.

I’ll have to think a bit more about what this means exactly in the WebMSX code.

from webmsx.

ppeccin avatar ppeccin commented on May 12, 2024

from webmsx.

ppeccin avatar ppeccin commented on May 12, 2024

Problem solved!
Sex Bomb Bunny working perfectly.

I'll explain it later, after more tests!

Thanks,
Paulo

from webmsx.

ppeccin avatar ppeccin commented on May 12, 2024

Well, the problem was that I was calculating the starting of the bottom border considering the entire frame structure and metrics of the screen as specified on page 147 of the Tech Data Book.

That made a window of only 10 lines after line 192 for the overscan trick, not 20, because the way I saw it, 10 lines of the extra 20 would be at the top, and 10 at the bottom.

But it seems that the bottom border is started in relation to the REAL starting active line, in fact 192 or 212 lines AFTER the real starting active line, and not on the frame "position" it would be in a normal frame where you don't change LN mid-frame, giving really 20 extra lines of active rendering.
Is that correct the way you see it?

I still have to test and validate it a bit more, but games that use overscan started to work now.

Grauw... Another related question for you...
Regarding the TOP border finishing line and starting of the active screen. Could we do the same LN trick to bypass the starting of the active screen? That would make the entire screen stay in the border section. Like the opposite effect of the overscan technique.
Is that possible?
If so, how all the line counting would happen then? Would line interrupts even happen?

Paulo

from webmsx.

ppeccin avatar ppeccin commented on May 12, 2024

Well, I think it's fixed!
Please, try again the new version 5.3 (already online)!

Thanks for the information!

from webmsx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.