XRacing (MSXDev 2018 entry)

페이지 13/13
6 | 7 | 8 | 9 | 10 | 11 | 12 |

By santiontanon

Paladin (835)

santiontanon의 아바타

22-04-2019, 09:59

Btw, if anyone wants to read a bit more about how the scrolling routine in XRacing works, I wrote about it in my blog here:

https://santiontanon.blogspot.com/2019/04/smooth-scroll-in-x...

I should have written this a long time ago, but didn't get a chance to do it earlier :)

By ARTRAG

Enlighted (6252)

ARTRAG의 아바타

22-04-2019, 11:48

Great reading (and never the less I'm very interested in the details of the optimization technique you have used to build the common tile set and the two additional sets!)

About my suggestion, it is used in Uridium where there are 1024 tiles pre-loaded in VRAM. Uridium works like having two VRAM pages of 256x128 pixels, each with 256+256 tiles, sharing the same definitions of color. There is a lot of optimization needed to match color definitions in the 3rd and the 2nd bank, but all works nicely because the game only scrolls horizontally.

For vertical scroll, the 2nd and 3rd bank should share the same tiles. What holds here is that you can use the two pages with independent tile sets. You can use these pages to show 512 pre-loaded tiles or to double buffer the VRAM transfer of 256 tiles. You can see the 512 pre-loaded tiles on two pages in this demo here while double buffering is in the demo here.

The two pages are obtained by reducing to 2K the PCTs of the 3 banks (sometimes it is referred as half hybrid mode).

.page1: ; page 1 active
_setVdp 3,0x9F ; PCT at 0x2000 (hybrid)
_setVdp 4,0x03 ; PGT at 0x0000 (regular: used 0x0800 0x1000)
ret
.page0: ; page 0 active
_setVdp 3,0x1F ; PCT at 0x0000 (hybrid)
_setVdp 4,0x07 ; PGT at 0x2000 (regular: used 0x2800 0x3000)
ret
Note1:
The 1st bank becomes very difficult to be used, because its definitions host the colors of the other two banks in both pages. You can use a dummy pattern and and sprites (as in Uridium) or a split screen and screen 1 (as in the demos).
Note2:
You can reduce also the PGT to 2K, but on regular TMS9918 it will affect sprites on planes after the 8th one (sprite cloning), so this not convenient unless you can live with only 8 sprites.

By santiontanon

Paladin (835)

santiontanon의 아바타

23-04-2019, 04:37

Thanks a lot for all the pointers Artrag!! I take note of all of this! Busy at the moment with a couple of other projects, but eager to start playing around with this!

By santiontanon

Paladin (835)

santiontanon의 아바타

23-04-2019, 08:04

Oh, and I missed the part about the details of tile assignment. I write an explanation as an answer to your comment in the blog Smile (I don't think I was very clear, but happy to clarify. I wanted to put the code in GitHub, but it's such a mess from trying this and that, that I was ashamed to push it! hahaha)

페이지 13/13
6 | 7 | 8 | 9 | 10 | 11 | 12 |