MMM rebooted

Страница 2/4
1 | | 3 | 4

By inchl

Resident (33)

Аватар пользователя inchl

21-07-2020, 16:28

The mmm game engine support 232 scanlines. This is the vdp in overscan mode as some call it.
In the following post it is explained by grauw
https://www.msx.org/forum/msx-talk/graphics-and-music/overscan

He talks about polling for the vertical blank. We execute cursor/mouse read code during this polling. Otherwise polling it's a waste of cpu time. If you have an OPL4 we even use one of its hardware timers for vertical blank detector (after sync with the last line interrupt that is possible during the overscan mode). When using the opl4 timer any cursor/mouse reads are only executed once per 6 frames. If a delta is detected we revert back to the non-OPL4 technique for a few seconds, so the mouse is always updated each frame (so always smooth, except for the initial start moving).

The 130 colors support is possible because the game engine uses 14 colors for fixed pallette and 2 dynamic colors that are updated on each 4 scanlines. In total we have 232/4 = 58 screensplits. Each screen split updates 2 colors so we have 58x2 = 116 dynamic colors. A total of 14 fixed colors + 116 dynamic colors = 130 colors.
The tricky part is that it take a lot of precalculation to determine which colors are to be put in the 14 fixed colors and which ones in the dynamic pallette. Since sprites can be put all over the screen, its likely that colors used in sprites are part of the fixed pallette. But,... that all depends on the optimal pallette calculation result.
Of course this technique is most suitable for vertical gradient kind of graphics. Once your need horizontal gradients it all comes down to use an other technique like dithering. 130 colors is the max, but on average only 40-60 colors are in the final precalculation result.

By Manel46

Hero (601)

Аватар пользователя Manel46

21-07-2020, 16:51

Thank you very much for the explication.
Correct about the 130 colors, I understand.
I'm trying to understand the overscan thing.

By Pac

Guardian (5926)

Аватар пользователя Pac

21-07-2020, 17:44

Very good news, I loved the music of this game. Wink

By erpirao

Paragon (1102)

Аватар пользователя erpirao

22-07-2020, 16:12

I just tested it on my turbo GT, with MGFSD and also with Flashjacks
first failure: does not start in configuration (boot) by default): not enough memory available
To make it start with the flashjacks and 1MB expansion I have forced the external mapper as primary.
if it runs in r800 mode, a lot of graphics errors appear, if you force the z80 it works perfectly
wavy 720FD: OK

By inchl

Resident (33)

Аватар пользователя inchl

22-07-2020, 16:57

Thanks for your feedback....
The script engine that loads the game is selecting memory in the primary mapper. This is ok if that mapper holds at least 512 kb of ram. If not, then we should check if any other mapper holds the 512kb minimum of ram. Easy to fix!
The graphics errors are likely caused because of timing issues (we use 58 screensplits). I hope it is possible to switch to z80 mode in runtime somehow. If anyone knowns how, any help will be appreciated!

I do not have a turbo-r,... so testing on these issues is difficult. Are you in to become a tester? :-)

By Grauw

Ascended (9396)

Аватар пользователя Grauw

22-07-2020, 18:23

inchl wrote:

The graphics errors are likely caused because of timing issues (we use 58 screensplits). I hope it is possible to switch to z80 mode in runtime somehow. I do not have a turbo-r,... so testing on these issues is difficult.

Testing can be done in openMSX, it has a pretty accurate emulation of VDP access speed restrictions. Though of course eventually testing on real hardware is still necessary.

This does seem a type of game that could benefit from the speed of the R800 to get an FPS boost! Smile However if you want to force Z80 mode, see CHGCPU. Check MSX version at 002DH before calling it.

By inchl

Resident (33)

Аватар пользователя inchl

22-07-2020, 18:38

Is it allowed to use a secondary memory mapper In R800 mode?

a FPS boost is also available by pressing the F-key :-)

By Grauw

Ascended (9396)

Аватар пользователя Grauw

22-07-2020, 19:07

Yes it is allowed. Internal memory will be faster though. For optimal performance it’s best to have code in the primary mapper and data in secondary mappers if necessary.

By erpirao

Paragon (1102)

Аватар пользователя erpirao

22-07-2020, 19:42

new test:
turboR at z80: 7 ~ 9.9fps
msx2 + wavy: 7 ~ 9
msx2 bluemsx: between 8 and 9
Surely it is to put me where they don't call me, but would it be possible to make it run with "only" 330KB free?
(mgfsd: nextor + system: 176KB reserved)
Carnivore2 / flashjack / sunrise ide: nextor + system: 112KB reserved

By inchl

Resident (33)

Аватар пользователя inchl

22-07-2020, 21:32

Yes, that would be possible. However, using other slots for ram is preferred (we need to make that work in code). Does your machine have secondary ram?

We looked at the turbo-r cpu switch bios routines that grauw posted some replies back. It seems that switching to z80 mode does not release the memory used to store the rom->ram stuff. Is there any way to enable this?

Страница 2/4
1 | | 3 | 4