Metal Gear 3: Return for Jennifer (MSX w/ v9938/v9958/V9990)

Page 5/7
1 | 2 | 3 | 4 | | 6 | 7

By wouter_

Hero (535)

wouter_'s picture

03-06-2023, 12:41

DarkSchneider wrote:

...@wouter_ sure that changing R23 only at 8px steps...?

I mean horizontally. Thus changing R23 multiple times within a single line.

The reason for this is that the VDP uses "burst mode" to read the bitmap data from VRAM. That is: it calculates the address once (using the value of R23) and then reads 4 consecutive bytes (=8 pixels) from VRAM. R23 can be changed at any time, also within a group of 8 horizontal pixels. But it only takes effect on the next group of 8 pixels. (I'm again simplifying, see the article for details).

Similarly R5 can be changed at any moment in time. But the VDP only uses R5 to calculate the VRAM-address for sprite-attribute fetches. Thus changes only have an effect when the VDP reads the next sprite-attribute-data from VRAM. And that is only at specific moments within a horizontal line.

By TomH

Champion (375)

TomH's picture

03-06-2023, 14:12

Accumulator wrote:

I will test and see. Dual hopes.. I hope you are correct and hope I have it at the right end. I know from the past I can change colors as many times per line as I can. If I can adjust multiple VDP registers per line, and some more than one, why r5 just once. I can remember I changed a VDP R more than one per line and worked. What is so special about r5?
In. my opinion and experience, the VDP is just executing your command, whenever you instruct. If it is in the beginning, midst, or any other position, it will just do what you instruct. Have not seen other behavior..

Nothing is special about R5; you are free to change the base address of the sprite table whenever you want. And that’s what it’ll be the next time the VDP uses it, when it is next doing its scheduled reads from the sprite attribute table.

What doesn’t happen is that the contents of the sprite attribute table magically retransfer themselves upon the change, revealing that the VDP secretly had gigabytes of memory bandwidth they just decided not otherwise to use for some reason.

By Accumulator

Champion (351)

Accumulator's picture

03-06-2023, 20:06

With Changing R5 I change the base address, and if I have set different SATs at those addresses... 1 st sat starts at 0, 2nd, 0 + 16 etcetc. The second reason I came up with this idea, when I changed the sat in the midden of a 16x16 sprite and not correctly timed at the beginning it changed a centemeter to the right of the left border.
Than I knew SAT is able to change within 1 line. from line to line there is a fluctuation of 32 pixels, compared from line to line, at fixed beginning of SAT change, therefore you need to cover the fluctuations with same sprites of previous SAT and after fluctuation, other sprites. During fluctuation of change you need the last shown of previous SAT and begin with them in the next Sat, to overlap. (also depends on your timing). Bij 16x16 sprites you have 2 overlapping SAT sprites.
As Wouter_ indeed mentions the sprites are updated several times per line at specific times. If I change 3 times sat address table it works.
@wouter_, how many times is the SAT read per line, even when SAT address changes over and over per line? To know the limitations before getting annoyed or frustrated it is not working anymore... Haha

By wouter_

Hero (535)

wouter_'s picture

03-06-2023, 20:25

Accumulator wrote:

@wouter_, how many times is the SAT read per line, even when SAT address changes over and over per line?

You misunderstood. The sprite attribute table is read just once per line...
... Well, different parts are read at different moments in time, and by changing R5 you could obtain a mix between different tables. But that's nothing that can't also be achieved by a single SAT.
Please (re-)read the article.

By PingPong

Enlighted (4156)

PingPong's picture

03-06-2023, 21:23

Exactly!!!

By Accumulator

Champion (351)

Accumulator's picture

03-06-2023, 23:22

@Wouter, how would you explain, if I alter the SAT address within the line, it alters the spites. That is a fact, tested!
As the VDP is min. 4 times faster than the CPU, I would assume reading SAT at least 4 times per line. (CPU 3.5Mhz, VDP 21Mhz).
I have read and re-read te article, but cannot find anything that states the above. What am I mssing?
Try to have the code working by tomorrow, as no other code changes and aha moments pop-up.
Thinking of use of 1 base SAT and splitting in several parts, but at the end still having 128 bytes per SAT (32*4).
Of course I am stubborn and will disagree until I have seen/proven my concept rules or fails, but again thinking out of the box grows the knowledge of VDP handling.
Wink

By Daemos

Prophet (2170)

Daemos's picture

03-06-2023, 23:35

Quote:

As the VDP is min. 4 times faster than the CPU, I would assume reading SAT at least 4 times per line. (CPU 3.5Mhz, VDP 21Mhz).

Internally the VDP runs at a clock that is divided by 4. So at exactly the speed of the z80a. There was a reason for the 21 mhz crystal I read somewhere before but the VDP is not faster. But maybe I misunderstood that part.

By Accumulator

Champion (351)

Accumulator's picture

04-06-2023, 00:47

@DarkSchneider, I can give you a routine that moves the left part of screen down and right side part down, split of vdp 23 in middle of screen. (It is a routine from the 90's, so can be improved)
VDP23 Routine

By DarkSchneider

Paragon (1030)

DarkSchneider's picture

04-06-2023, 09:10

Accumulator wrote:

@DarkSchneider, I can give you a routine that moves the left part of screen down and right side part down, split of vdp 23 in middle of screen. (It is a routine from the 90's, so can be improved)
VDP23 Routine

Cannot open, it's seen as a binary file instead a text one. Even on the MSX using TYPE shows binary content.

But what sync method uses to decide that is the middle of the screen? That's the question.

By TomH

Champion (375)

TomH's picture

04-06-2023, 15:28

DarkSchneider wrote:
Accumulator wrote:

@DarkSchneider, I can give you a routine that moves the left part of screen down and right side part down, split of vdp 23 in middle of screen. (It is a routine from the 90's, so can be improved)
VDP23 Routine

Cannot open, it's seen as a binary file instead a text one. Even on the MSX using TYPE shows binary content.

But what sync method uses to decide that is the middle of the screen? That's the question.

You can either just cycle-count from a line interrupt, or set up an invisible-sprite collision and poll that flag. Subject to heavy care.

Page 5/7
1 | 2 | 3 | 4 | | 6 | 7