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

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

By Daemos

Prophet (2166)

Daemos's picture

02-06-2023, 07:28

I think i get what you mean but not fully. What i think you should do is try your idea codewise. put a ton of sprites on screen with your technique and see what happens. I have rom templates if you need any so you only need to do something in a loop. You will allready have a keyboard control and inthandler at your disposal.

But thats just what i usually do. I come up with all kinds of ideas and try then out. Sometimes I get what i want and sometimes i get disappointed.

By BadWolf359

Resident (38)

BadWolf359's picture

02-06-2023, 10:58

It would be nice to have/create a knowledge base of tricks and ideas like this. They say "A Magician Never Reveals His Secrets", and I'm not suggesting to reveal every trick in the book, but it would be a shame if this knowledge got lost over time. It might also be helpful for other developers to have a HOWTO for "actually not possible, but maybe if I...." tricks. Smile

By TomH

Champion (375)

TomH's picture

02-06-2023, 17:27

Daemos wrote:

I think i get what you mean but not fully.

You're well ahead of me then.

The Yamaha VDPs fetch only 8 sprite patterns per line. They can therefore draw only 8 sprite patterns per line. That is a hard limit. There is no software way to display more than 8 hardware sprites during a line of output. It's software sprites or flickering to include more moving objects on your line.

This is distinct from some other architectures, such as the Atari 2500 or the Commodore Amiga, where sprite details can be pushed during a line, potentially causing the same hardware sprite to trigger twice. There is no pushing of sprite details on the MSX; the VDP pulls them at fixed moments. That aspect of the VDP is not programmable.

See Grauw's timing documentation. If you're in a bitmap mode and have reached cycle 130 then sprite locations and contents have been locked in for the line that is about to be serialised. There is no means to change any aspect of sprite output for that line after that point. You are going to get at most eight sprites displayed on your line, full stop.

By DarkSchneider

Paragon (1030)

DarkSchneider's picture

02-06-2023, 17:45

Also remember that we usually don't draw single sprites but Characters, that is a set of sprites, with their priority order. So any method used should be aware of that.

By Accumulator

Champion (351)

Accumulator's picture

02-06-2023, 20:13

Sample code is almost done. I always get distracted by other ideas that game up.
Before end of weekend it will be finished... Tongue

By Daemos

Prophet (2166)

Daemos's picture

03-06-2023, 00:02

Truly curious about the result. Please post your results as a rom if you can.

By Accumulator

Champion (351)

Accumulator's picture

03-06-2023, 09:19

I came to this concept because I was checking some of my old sources of the 90's and I stumbled on some sources I made for Aerifero / New World Order. It was a screensplit horizontal and vertical, left side of screen scrolling down and right side scrolling upwards.
If you can manipulate VDP R23, during a single line, why not R5?
Just got a aha moment, unfortunately we only have 128kb and 64kb not visible in SCREEN5. So if I would set base at 10000h, and set VDP 17 at 5 with bit 7 set. Theoretically I could use 8 SATs per line., I have the time to send at least 8 bytes to a VDP port. But no time to change the pattern table.. Grrrrr..
Theoretically if what I wrote above is correct, we could use 4 sprites in or mode per 32 pixels.. and have in total 32 sprites per line... But.. theoretically, reality has to be proven.
Get back...
Also I noticed (in OpenMSX) the timing of changing VDP registers within a display line is related to VDP R18. The timing also depends on the value set to VDP R18. Shifting to left or right by about 8 pixels (added to the 32 pixels of line detection fluctuation)

By wouter_

Hero (535)

wouter_'s picture

03-06-2023, 09:43

Accumulator wrote:

...If you can manipulate VDP R23, during a single line, why not R5?...

Yes, you can change R23 at arbitrary moments (multiple times per line). But the change is only taken into account once every 8 pixels. Similarly for R5: you can change it at any time, but the change is only taken into account once per line.

Compared to vertical scrolling (R23) sprite rendering is quite more complex. Think about it: to figure out which sprites are visible the VDP has to fetch various data from VRAM. You cannot expect the VDP to constantly re-fetch this data whenever you change R5. Instead the VDP only fetches this data once per line.

I've intentionally simplified quite a few things in the previous paragraphs. For more details see the VDP VRAM timing article I wrote (as already pointed out by TomH a few post above). It explains when exactly the VDP fetches the sprite attribute/pattern data from VRAM.

By Accumulator

Champion (351)

Accumulator's picture

03-06-2023, 10:19

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..

By DarkSchneider

Paragon (1030)

DarkSchneider's picture

03-06-2023, 11:02

Accumulator wrote:

If you can manipulate VDP R23, during a single line, why not R5?

The main issue I see for that is for vertical we have the line interrupt as sync method, but for horizontal we haven't. Cannot attach the behavior to something specific like cycles as we can have Z80A, Z80B, Z80H and R800, and/or any other point like having VDP WAIT signal or the Fast VDP option enabled (in FPGA models) which could vary the whole thing, for something that changing a single cycle could bring totally different results.

@wouter_ sure that changing R23 only at 8px steps? I change it at line 36 and shows correctly. Not tested yet a change line-by-line, but maybe you mean instead 8px steps is that it can change only after 8 drawn lines from the previous change?

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