Skip to content
Snippets Groups Projects
  • Geo Ster's avatar
    1d16fdad
    Introducing the IOP · 1d16fdad
    Geo Ster authored
    * So after a week, it's finally here! The initial implementation of the
    IOP has been added to the emulator. You might wonder why did it take so
    long? This was mostly because I wanted to make the implementation as complete
    as possible and also test it to ensure it's bug free. So this is actually
    based on the MIPS R3000A interpreter I wrote last year for my PS1 emulator.
    So did I just copy the code and call it a day? Hell no, the code in that
    ancient project is awful, even if it works. So I completely rewrote the
    interpreter by using our modern techiniques of storing state. So rewriting the old
    code allowed me to test if it actually worked in that environment
    and could boot PSX games.
    
    * Due to this, the implementation is a bit more complete than the EE
    as it includes interrupt support. In addition we have to account for
    the fact that the IOP runs at 36.864MHz, in constrast to the EE which
    clocks at 295MHz. This maps approximatly to an 1/8 ratio, which means
    that 1 IOP instruction will run every 8 EE cycles. The current implementation
    of this is hacky and a bit inaccurate because some EE instructions
    can take more than 1 cycle to execute, but it's good enough for now
    (Play! assumes this as well and can boot 40%+ of games).
    
    * Because both the CPU emulators can share a lot of naming conventions,
    to avoid confusion each processor has been seperated into a namespace
    so we can always know which CPU we are refering to. Finally, for now
    reads/writes except for the BIOS and IOP RAM, haven't been implemented
    but will come soon.
    1d16fdad
    History
    Introducing the IOP
    Geo Ster authored
    * So after a week, it's finally here! The initial implementation of the
    IOP has been added to the emulator. You might wonder why did it take so
    long? This was mostly because I wanted to make the implementation as complete
    as possible and also test it to ensure it's bug free. So this is actually
    based on the MIPS R3000A interpreter I wrote last year for my PS1 emulator.
    So did I just copy the code and call it a day? Hell no, the code in that
    ancient project is awful, even if it works. So I completely rewrote the
    interpreter by using our modern techiniques of storing state. So rewriting the old
    code allowed me to test if it actually worked in that environment
    and could boot PSX games.
    
    * Due to this, the implementation is a bit more complete than the EE
    as it includes interrupt support. In addition we have to account for
    the fact that the IOP runs at 36.864MHz, in constrast to the EE which
    clocks at 295MHz. This maps approximatly to an 1/8 ratio, which means
    that 1 IOP instruction will run every 8 EE cycles. The current implementation
    of this is hacky and a bit inaccurate because some EE instructions
    can take more than 1 cycle to execute, but it's good enough for now
    (Play! assumes this as well and can boot 40%+ of games).
    
    * Because both the CPU emulators can share a lot of naming conventions,
    to avoid confusion each processor has been seperated into a namespace
    so we can always know which CPU we are refering to. Finally, for now
    reads/writes except for the BIOS and IOP RAM, haven't been implemented
    but will come soon.