Dio's Jag Emu for the Mac

Inane baanter or words of wisdom - you decide...
Post Reply
User avatar
Stone
Sheepie Whore
Sheepie Whore
Posts: 14497
Joined: Thu Jun 26, 2003 6:49 pm 0
XBL Gamertag: thestony1
Location: Harpenden

Post by Stone »

I've got an NTSC Jag but I don't use it because the video output circuit is shit :lol:

How does it look if you force the window to be 4:3 and put varying amounts of pixels-per-line in it? I think this is how the Jag does it internally because I seem to remember we had plans for making something widescreen-capable by just running loads of pixels horizontally and letting the Jag display it 'squashed' into 4:3 so the telly could expand it back into 16:9, but I don't remembr now :?

Stone
User avatar
Dio
Sheepie Whore
Sheepie Whore
Posts: 18887
Joined: Mon May 31, 2004 1:08 pm 0
Location: Newcastle UK

Post by Dio »

The timing generator runs at a constant rate of 1688 (NTSC) cycles per line. You then program the video / OP with a cycles per pixel count so the game can select the aspect ratio of the pixel.

Most games use 4 cycles/pixel. This gives a 320-wide screen on most games and (now the light has dawned and I fixed some calculations after writing that last night!) a 352-wide screen on T2K (presumably without borders). I would guess that 4 cycles corresponds to the standard 10:11 NTSC pixel aspect ratio, but it's possible that this is in fact square or something random around there.

A few games use others. Trevor McFur uses 3 cycles/pixel for a 448-wide screen and decidedly non-square pixels, which results in a very odd artifact on the title screen where the circle in the bottom right is roughly circular, but the one on the Crescent Galaxy logo is squashed to hell. Similarly, in the game the powerups are squeezed sideways but the round enemies are pretty much circular. Looks like some of the artwork worked around the non-square pixel issue and some didn't.

Doom uses an 8-cycle main view (160 2:1 pixels wide - it's got the same mode on the DOS version that was necessary on 386's) and a 4-cycle bottom window.

So for your trick, I guess you'd program 3 cycles and you'd get something around an anamorphic widescreen display, as (448/230)*(10/11) ~= 16/9, your pixels would have the same aspect ratios as 352 on a 4:3 TV so the art would all be fine.

With the settings I have at the moment, T2K is a bit widescreen, with the webs just slightly out of symmetry, and 320-wide games are pretty close to 4:3. It feels about right to me. But it's only a couple of lines to change it if I find something to convince me it looks better elsewhere - I've got a full pixel aspect ratio calculation system in there so all I need to tune is the default ratio constants. D3D's stretchblit to the main screen handles 99% of the work.

The main thing I'd like to know is if the square web on T2K is, in fact, square on an NTSC Jag. But if it isn't I doubt if I'd change it much since it feels about right just now.
User avatar
tufty
Sheepie Whore
Sheepie Whore
Posts: 12524
Joined: Fri Jan 07, 2005 4:52 pm 0
Location: French Alps

Post by tufty »

Dio - a quickie.

Playing with getting sound input working on the Mac port, but for the life of me I can't get the emulator to start asking for samples. I'm sure I'm missing something fundamental / stupid. Any ideas?

Simon
"massive retard™", "full of shit™", "tiny bitch™", "retarted™", "a bit of a one trick pony™", "petty™", "simple minded idealistic twat™", "miserable humourless fucker™"
User avatar
Dio
Sheepie Whore
Sheepie Whore
Posts: 18887
Joined: Mon May 31, 2004 1:08 pm 0
Location: Newcastle UK

Post by Dio »

It's never calling the SoundGetCaptureData callback? Is the soundcapture control var set? The data path is JerryRead(0xf1a14e) -> IncWav -> SoundGetCaptureData.

I really should label the interface between the core and window system a bit better. I'll probably start prefixing all the important callbacks and variables with WSI.
User avatar
gravy
Sheepie Whore
Sheepie Whore
Posts: 19572
Joined: Wed May 01, 2002 1:28 pm 0
Location: The Other Place

Post by gravy »

Dio wrote:It's never calling the SoundGetCaptureData callback? Is the soundcapture control var set? The data path is JerryRead(0xf1a14e) -> IncWav -> SoundGetCaptureData.

I really should label the interface between the core and window system a bit better. I'll probably start prefixing all the important callbacks and variables with WSI.
I'm trying to play a wav so I've set done this in the mac side init:
soundcapture = 0;
strcpy(musicfilenames,"/a.wav");
which I'm assuming will cause JerryRead to call LoadMusicFile and then IncWac to play from the wav data.

I've breakpointed where there * are below

Code: Select all

    case 0xf1a148:
    case 0xf1a14a:  // I2S left channel (CDROM reads)
*        LoadMusicFile();
        return(IncWav(1));
    case 0xf1a14c:
    case 0xf1a14e:  // I2S right channel (CDROM reads)
*        LoadMusicFile();
        return(IncWav(2));
And that part of the switch statement never gets called. Bit puzzled :)
User avatar
tufty
Sheepie Whore
Sheepie Whore
Posts: 12524
Joined: Fri Jan 07, 2005 4:52 pm 0
Location: French Alps

Post by tufty »

Dio wrote:It's never calling the SoundGetCaptureData callback? Is the soundcapture control var set? The data path is JerryRead(0xf1a14e) -> IncWav -> SoundGetCaptureData.
Yeah, I'd figured that much out, I'm setting soundcapture to 1 before initialising the emulator, but soundgetcapturedata never seems to get called.

I'll take the rest of thiss to email, I think.

Simon
"massive retard™", "full of shit™", "tiny bitch™", "retarted™", "a bit of a one trick pony™", "petty™", "simple minded idealistic twat™", "miserable humourless fucker™"
matt
Sheepie Whore
Sheepie Whore
Posts: 14826
Joined: Mon Apr 22, 2002 4:07 pm 0
XBL Gamertag: gingerbeardman
PSN: wirehang
Location: here && there
Contact:

Post by matt »

Dio wrote:Does anyone on here own an NTSC Jaguar?
I was on the understanding that a Jag running over SCART was effectively NTSC.

matt
User avatar
Firefox
Sheepie Whore
Sheepie Whore
Posts: 11412
Joined: Fri Apr 26, 2002 6:15 pm 0
Location: Sheffield

Post by Firefox »

Dio wrote:Ha! At least one more game looks like it works fully, Sensible Soccer.
Go Dio, go! :D
"I am a very considerate person. If I want to go out all night on my miniature golf course and shoot lizards, well, no reason to keep the neighbours awake..."
User avatar
Stone
Sheepie Whore
Sheepie Whore
Posts: 14497
Joined: Thu Jun 26, 2003 6:49 pm 0
XBL Gamertag: thestony1
Location: Harpenden

Post by Stone »

matt wrote:
Dio wrote:Does anyone on here own an NTSC Jaguar?
I was on the understanding that a Jag running over SCART was effectively NTSC.
Yes and no :)

If it's a PAL JAG (to start with) and it's on a SCART cable, then you're getting a 50Hz display with composite video encoded with PAL. If you use RGB it's just normal 50Hz RGB (both composite and RGB are hooked up in the SCART cable so you can still use it even if your telly doesn't support RGB). If it's an NTSC JAG then it's always outputting at 60Hz, but it still uses NTSC if you're on the composite feed.

Or you can just make a 50/60Hz switch (wire a switch across R140 and remove the zero-ohm resistor on it if there is one) and do it that way :)

Stone
[edited so it's correct now. Sorry!]
Last edited by Stone on Fri Sep 08, 2006 12:45 pm 0, edited 1 time in total.
User avatar
Dio
Sheepie Whore
Sheepie Whore
Posts: 18887
Joined: Mon May 31, 2004 1:08 pm 0
Location: Newcastle UK

Post by Dio »

Now I'm confused. :D

I built my own composite cable, what on earth will I get?
User avatar
Kelloggs
Baaaaa!
Baaaaa!
Posts: 1859
Joined: Wed Jun 22, 2005 11:38 pm 0
XBL Gamertag: TheAntiKelloggs
Location: Widnes or Altrincham. Take your pick.

Post by Kelloggs »

Dio wrote:Now I'm confused. :D

I built my own composite cable, what on earth will I get?
Solder burns? Experience? :wink:
User avatar
Stone
Sheepie Whore
Sheepie Whore
Posts: 14497
Joined: Thu Jun 26, 2003 6:49 pm 0
XBL Gamertag: thestony1
Location: Harpenden

Post by Stone »

Dio wrote:Now I'm confused. :D

I built my own composite cable, what on earth will I get?
Facetious answer: Composite :D

[The SCART connector carries signals for composite, and RGB+sync, and audio. The Jag's edge connector has the same, plus S-video. Using an official cable, if your telly supports it it'll use RGB+audio, if not it'll use composite+audio. If you use composite (either through SCART or with a composite-only lead) then you'll be getting composite video, PAL-encoded or NTSC-encoded depending on the format of the console. All it does is tap the video signal before it goes through the UHF modulator so you get less distortion :) If you hook up the RGB lines on the Jag to the ones on the telly then you'll get true RGB, which looks very much better]

Stone
User avatar
Dio
Sheepie Whore
Sheepie Whore
Posts: 18887
Joined: Mon May 31, 2004 1:08 pm 0
Location: Newcastle UK

Post by Dio »

Right, so since it's a PAL Jag I'll get 50Hz and a 625-line screen, as will anyone else with any cable on a PAL Jag.

(The reason I'm confused is that you mixed up a lot of 50s and 60s above).
User avatar
zbandito
Baaaaaa!
Baaaaaa!
Posts: 2916
Joined: Sat May 18, 2002 10:00 pm 0
Location: Portland, Oregon
Contact:

Post by zbandito »

Well NTSC as a standard is 60hz and I thought the NTSC Jag was as well...

I think it's actually 59.94hz IIRC; 1 frame @ 29.97 of two interlaced fields each, a stupid number based on history of television development and old electrical standards.. :roll:
Bogdan
Baaaaa!
Baaaaa!
Posts: 1131
Joined: Tue Feb 18, 2003 2:15 am 0

Post by Bogdan »

I gave the emulator and Tempest 2k a go on an old 1.25 Ghz eMac last night. First off, the emulator works like a charm. Fast and fluid gameplay, just like I remember it. However, the music in T2k sounds weird, sort of like it's missing some sound channels.
Is this due to the emulator or the rom?
Post Reply