XRacing (MSXDev 2018 entry)

Page 10/13
3 | 4 | 5 | 6 | 7 | 8 | 9 | | 11 | 12 | 13

By ARTRAG

Enlighted (6243)

ARTRAG's picture

19-02-2019, 20:03

I've just tried it but it is not useful for having an insight of my code
Tile viewer shows one tile at time and it does not take into account of the actual setting of the VDP registers for colors and patterns.
The two pages are obtained by setting the two VDP registers for colors and patterns, the tileset changes with a couple of OUTs

By santiontanon

Paladin (833)

santiontanon's picture

20-02-2019, 18:37

I bet we could just update the current OpenMSX script to take the VDP registers into account, even if it'll display the tiles one by one. Is this a TCL script? or is it built in in to the C++ side?

By ARTRAG

Enlighted (6243)

ARTRAG's picture

20-02-2019, 22:56

Maybe it is simpler to give a glance to the code of uridium where I use the same trick
https://github.com/artrag/Uridium-msx1/blob/master/main64.asm
Lines 120 and 125

By Manuel

Ascended (15750)

Manuel's picture

20-02-2019, 23:22

santiontanon wrote:

I bet we could just update the current OpenMSX script to take the VDP registers into account, even if it'll display the tiles one by one. Is this a TCL script? or is it built in in to the C++ side?

See https://github.com/openMSX/openMSX/blob/master/share/scripts...

It's just reading VRAM and VDP registers to create the current output. I'd be happy to receive patches on this script that improve it :)

By santiontanon

Paladin (833)

santiontanon's picture

21-02-2019, 07:03

Happy to look into it, since I'd like to learn more about ARTRAG's method. Will do a pull request if I get something that works Smile

By NYYRIKKI

Enlighted (5382)

NYYRIKKI's picture

21-02-2019, 17:22

santiontanon wrote:

Oh, and btw, I just write an entry on my blog explaining a few of the technical details of the flag animation in the title. Will describe the scroll in another post :): https://santiontanon.blogspot.com/2019/02/the-flag-effect-in-xracing.html

Indeed very interesting read...

Your algorithm anyway forgets that while human eye can give very much away in moving parts of the picture the more static parts should be made more accurately... If you ie. manually fix outlook of tiles 387, 390, 394 and 421 the result already looks a lot better.

By Vampier

Prophet (2297)

Vampier's picture

21-02-2019, 21:13

santiontanon the tcl script isn't the fastest - I remember creating that in 1 evening. The sprite viewer was done around the same time and maybe they can both be combined into 1.

By NYYRIKKI

Enlighted (5382)

NYYRIKKI's picture

21-02-2019, 22:18

Well... I made this really ugly helper script around it... I know there are tons of things that could be done better, but maybe better than nothing.


namespace eval tileselect {

  proc select_tile {} {

       bind -layer tileviewer "mouse button1 down" {tileselect::checkclick}
       activate_input_layer tileviewer

       hide_tile_viewer
       osd destroy tile_select
       osd create rectangle tile_select -x 0 -y 0 -h 480 -w 640 -rgba 16

       for {set y 0} {$y < 24} {incr y} {
         for {set x 0} {$x < 32} {incr x} {
             osd create rectangle tile_select.$x-$y -x [expr {$x * 18.3 + 26}] -w 19 -y [expr {$y * 16 + 48}] -h 16 -bordersize 1 -borderrgba 0x00ff0080 -rgba 0xffffff10
         }
       }
  }

  proc checkclick {} {
    lassign [osd info tile_select -mousecoord] x y
    if {($x >= 0 && $x <= 1) && ($y >= 0 && $y <= 1)} {
       set bx [expr {int(35*($x-0.040625))}]
       set by [expr {int(30*($y-0.1))}]
       if {($bx >= 0 && $bx <= 31) && ($by >= 0 && $by <= 23)} {
           osd destroy tile_select
           view_tile [expr {[vpeek [expr {0x400 * [vdpreg 2] + $bx + $by * 32 }]]+ int($by / 8) * 256 }]
       }
    }
  }
  namespace export select_tile
}

namespace import tileselect::*

By NYYRIKKI

Enlighted (5382)

NYYRIKKI's picture

21-02-2019, 23:01

Here is example of what the animation looks like after a bit of manual tweaking.
https://youtu.be/89kdSUiuNQU

By santiontanon

Paladin (833)

santiontanon's picture

22-02-2019, 07:57

@Vampier: Good to know! Knowing you created it I'll definitively shoot you any questions I might have when I look at it! Big smile

@NYYRIKKI: Nice!!! It indeed looks much better! And indeed you are right. The Clustering algorithm I use does not take that into account! Another thing that it does not take into account is how often a tile appears (to make sure that tiles that appear more often on the screen are represented more faithfully). I wanted to at least add that, but didn't have the bandwidth to get it done for the deadline.

Page 10/13
3 | 4 | 5 | 6 | 7 | 8 | 9 | | 11 | 12 | 13