mamedev / mame

MAME
https://www.mamedev.org/
Other
8.26k stars 2.02k forks source link

Refactor jagobj and jagblit into actual device(s) #6041

Open angelosa opened 4 years ago

angelosa commented 4 years ago

jagblit and jagobj should be rewritten from scratch to an actual blitter device. jagblit should be obvious by quick glance, jagobj has zero respect over blitter timings (line 1033) plus naively erases scanline buffer without knowing what the height size is (line 1026). And that's only the bottom of the barrel.

ghost commented 4 years ago

fwiw Virtual Jaguar https://github.com/mirror/virtualjaguar appears to emulate all of this based on the internal programming of the actual chips (I guess those details are available somewhere)

however Virtual Jaguar now claims to be GPL3 (which we can't use) but is kinda interesting, because apparently it started off as Jaguar code from Aaron

"The original source was based upon Aaron Giles CoJag driver from M.A.M.E. and used the Starscream 68000 emulator core. Since then Starscream has been replaced by the more portable Musashi 68000 core and lots of improvements and changes have obscured the underlying code’s CoJag origins (to be fair, Mr. Raingeard had made quite a few changes from the CoJag driver before we got our hands on it)! The Musashi 68000 core has since been replaced with a heavily customized version of UAE’s 68000 core."

Unless Aaron gave them permission to use it under a difference license than the non-commercial MAME one of the era I'm not sure how that works (I know he did license some of his stuff differently, but CoJag code / original PJ forking of it is much older) and while it could be argued that there's none of that code left, if it was only removed in increments it's not really 'clean'

Either way, given that it started off as Aaron's code, maybe they'd allow it to be licensed as GPL2 for MAME's sake.

hargtholan commented 9 months ago

I have been looking into this and it seems according to one comment in the sources of virtualjaguar that John Mathieson provided documentation to Curt Vendel, and Curt facilitated it to James Hammons. It seems that Curt sadly passed away in 2020. I think we could approach the virtualjaguar author James Hammons jlhamm@acm.org first.

BTW I noticed that @angelosa had this in progress for a while but put it back to TODO. Has some work been done that could be continued? or anything new learned?

angelosa commented 9 months ago

I moved it back because there are two outstanding issues there:

  1. in order to rewrite the Blitter there's a catch: the BIOS actively uses it asap to do some decryption of the cart space, throwing the Red Screen of Death in case it is unhappy. That wasn't ideal to even start with messing around with it, nowadays there's Jaguar SDK which can be actually used for homebrew tests (and hopefully skip the BIOS RSoD for the time being) if anybody else didn't developed any kind of said integration already.
  2. Bus contention, in a nutshell every single entity on the bus has to check first if it can reach whatever it tried to access and depending on various modes of operation (BUSHI), an (outdated) source here to get the basic grasp. To date MAME has no concrete concept of this, which includes not tanking the performance to snail pace, the root issue of which is actively been worked on because being common denominator with several other computer bus designs.