Sega Virtua Processor/Virtua Racing Research

Discussion in 'Engineering & Reverse Engineering' started by Ralakimus, Nov 12, 2018.

  1. JaviTaiyou

    JaviTaiyou

    Member
    25
    33
    13
    Hopefully that's the case! It's a shame something like this was "hidden" in plain sight and no one seemed to know about it. In any case, anyone interested can recreate the binary by assembling the code so that shouldn't be an issue :))
     
  2. ICEknight

    ICEknight

    Researcher Researcher
    Can we have the SHA-1 hash of the raw data, to make sure that the compiled file is correct?
     
  3. JaviTaiyou

    JaviTaiyou

    Member
    25
    33
    13
    Oh sure! That's the SHA-1 hash:

    0b951ea9c6094b3c34e4f0b64d031c75c237564f

    I've added to the wiki too for reference. Thanks!!
     
  4. ICEknight

    ICEknight

    Researcher Researcher
    Thanks!
     
  5. biggestsonicfan

    biggestsonicfan

    Model2wannaB Tech Member
    1,200
    155
    43
    Formerly Sonic the Fighters
    Getting an error trying to assemble SVP_Internal_ROM.svp with ssp16asm:

     
  6. JaviTaiyou

    JaviTaiyou

    Member
    25
    33
    13
    Hey, thanks for giving it a try! I was assembling the BIOS code with the installed version and I hadn't try with 'cargo run', which runs in debug mode and can throw on those situations (this was while creating the labels in the symbol table, not sure while it reached an overflow though). I updated the code to wrap on those situations and I've tried it on debug mode too without issues (I've verified that the generated binary is the same as the one I extracted from the SVP and it matches perfectly).

    Could you update the code from the repository and try again?

    Thanks!

    PS: I've updated the comments in the wiki page and the disassembly itself. It seems that the three main trigonometric functions in the BIOS are calculating rotations over one of the three axis. They expect a list of 3D points (Z, Y and X coords) and each function overwrites the point with a new point rotated over the axis you want (and the angle you provided it).

    I hope to find some time to test these up!
     
    Last edited: Feb 22, 2021
  7. biggestsonicfan

    biggestsonicfan

    Model2wannaB Tech Member
    1,200
    155
    43
    Formerly Sonic the Fighters
    I am getting an SHA1 of 5b7fbb3b4f360dee96cb38aacd36e6aa1b95e00b not 0b951ea9c6094b3c34e4f0b64d031c75c237564f.

    EDIT: The file has the first 0x1F800 bytes filed with 0s?
     
  8. JaviTaiyou

    JaviTaiyou

    Member
    25
    33
    13
    Hey, you need to trim the spaces in the file at the beginning of the generated binary (because of the ORG 0xFC00 directive at the beginning of the file). Otherwise you can remove that directive, as I currently have the absolute values for the jump locations in each routine. Let me know if that works for you (i.e.: if not, let me know how you calculated the SHA-1 number so I can verify).
     
  9. biggestsonicfan

    biggestsonicfan

    Model2wannaB Tech Member
    1,200
    155
    43
    Formerly Sonic the Fighters
    That did the trick! SHA-1 matches 0b951ea9c6094b3c34e4f0b64d031c75c237564f, nice! Thanks!
     
  10. JaviTaiyou

    JaviTaiyou

    Member
    25
    33
    13
    Hi! I've spent this weekend researching on timings, one of the less known areas about the SVP. I've managed to measure how fast IRAM runs against code in ROM (and also the internal ROM speed), while also figuring out a way to measure individual instructions being executed on the SVP (by completely halting the MD and checking the address lines in the EPROM of my cartridge). There's lots of work to be done here, but I'm happy that at least I have the basis going.

    You can check the current data here, I'll be updating the page as often as I get more information: https://github.com/jdesiloniz/svpdev/wiki/Timings

    If you see something off, please let me know! Thanks!