Abbaye des Morts MSX

By geijoenr

Expert (92)

geijoenr's picture

26-02-2018, 20:36

Hi,
I have been working for some time (an rather slowly) in a game engine for MSX1, in order to test it I am making a port of Abbaye des Morts.

https://www.youtube.com/watch?v=N6NBt1l_3eM

the source is in github and open for pull requests.

https://github.com/retrodeluxe/rlengine-msx1

E.-

Login or register to post comments

By ARTRAG

Enlighted (6174)

ARTRAG's picture

26-02-2018, 21:57

For music you can try to adapt this player

http://www.dvik-joyrex.com/download/pt3play.zip

By geijoenr

Expert (92)

geijoenr's picture

26-02-2018, 23:06

thanks

By jltursan

Prophet (2126)

jltursan's picture

27-02-2018, 19:42

Cool project!!

In your "vdp_fastcopy_nametable" function you're sending data to VDP too fast (that's why it only works in MSX2). You need to add a "NOP" after every OUTI and prolly it would work in MSX1 (you're under the minimum t-states to wait tho, YMMV). You can also wait until vblank but seems a bad solution except if you plan to build a VDP engine with an execution queue ready to work only when vblank arrives, maybe too complex for a initial release of your library Smile

Check this interesting thread: https://www.msx.org/forum/msx-talk/development/respecting-29-t-states-timing?page=1

By Grauw

Enlighted (8031)

Grauw's picture

27-02-2018, 20:42

Looks like fun!

Don’t miss the nice code snippet from the first post of that thread jltursan linked: loop: outi / jp nz,loop takes exactly 29 cycles. So this exactly matches the maximum transfer speed on screen 2. Handy!

Additionally, considering this loop:

vdp__copy_to_vram_loop:
        outi
        dec de
        ld a,d
        or e
        jr nz,vdp__copy_to_vram_loop

Rather than this 16-bit counter, by using two nested 8-bit loops and a tiny bit of math, using b and another register for the outer loop, you can get a faster loop, as described here. Like so:

    ld b,e          ; 16-bit counter (de) to two 8-bit counters (d, b)
    dec de
    inc d
vdp__copy_to_vram_loop:
    outi
    jp nz,vdp__copy_to_vram_loop
    dec d
    jr nz,vdp__copy_to_vram_loop

Given screen 2’s maximum transfer speed during active display, the extra speed of an unrolled loop is only useful if you plan to time your VRAM I/O in the VBLANK period, disable sprites, or code for V9938.

Finally, although it is fun to talk about, and good to know about these techniques, try not to get too absorbed by performance optimisation in places where it doesn’t really matter. Since as much as it is fun, it is also a huge time sink :). For me this is always a pitfall I try hard to avoid (and often fail), while I think in the end a finished product is what is most important.

By FiXato

Scribe (1514)

FiXato's picture

27-02-2018, 20:58

First make it work, then make it better. Wink

By alexito

Champion (383)

alexito's picture

28-02-2018, 04:48

Excellent Game and excellent review:

https://www.youtube.com/watch?v=YyknMZAB1CA