Subject: CIA timer value in the Infogrames replayer

From: DrMcCoy
Date: Sat Feb 3 15:48:57 2007

To: UADE-Developer-discussion
Hi!

I found what could be a bug in the Infogrames replayer. After I REd it for use in ScummVM for the Amiga version of Gobliins 2, I found the playing to be too fast compared to what the original does in UAE: the replayer sets the CIA timer to 0x1A00 (~ 107 Hz), while the original sounds more like 80 Hz. After rummaging a bit through the disassembly of Gobliins 2, I saw it explicitely sets the timer to 0x2400 (~ 77 Hz).
I have no idea if that's specific to the Gobliins 2 music, though...

DrMcCoy / ScummVM Team

---

From: shd
Date: Sat Feb 3 17:03:48 2007

To: UADE-Developer-discussion
[quote:e12fb46e50="DrMcCoy"]I found what could be a bug in the Infogrames replayer. After I REd it for use in ScummVM for the Amiga version of Gobliins 2, I found the playing to be too fast compared to what the original does in UAE: the replayer sets the CIA timer to 0x1A00 (~ 107 Hz), while the original sounds more like 80 Hz. After rummaging a bit through the disassembly of Gobliins 2, I saw it explicitely sets the timer to 0x2400 (~ 77 Hz).
I have no idea if that's specific to the Gobliins 2 music, though...
[/quote:e12fb46e50]
Is it a playtime setting or init time setting? If it is set only once during init, it's possibly easier to work-around. Run-time (variable) stuff is more annoying.

Maybe we could fix it for uade somehow. Possible with an exception list that computes a CRC of the song and sets timer accordingly.

Could you email me the REed source and resource file of the eagleplayer?

---

From: Guest
Date: Sat Feb 3 18:10:40 2007

To: UADE-Developer-discussion
[quote:d3a760b7c8="shd"]Is it a playtime setting or init time setting?[/quote:d3a760b7c8]

It's just done once during init.

[quote:d3a760b7c8="shd"]Could you email me the REed source and resource file of the eagleplayer?[/quote:d3a760b7c8]

Done.

---

From: shd
Date: Sat Feb 3 18:49:39 2007

To: UADE-Developer-discussion
It turns the actual game uses timer value 0x24ff. I ran the game in UAE.

---

From: DrMcCoy
Date: Sat Feb 3 19:21:11 2007

To: UADE-Developer-discussion
Ah, Ok, I assumed the low byte would be cleared to 0.
The main point still stands, with &quot;s/0x2400 (~ 77 Hz)/024FF (~ 75 Hz)/&quot; though... ;)

---

From: shd
Date: Sat Feb 3 20:50:18 2007

To: UADE-Developer-discussion
Okay, the CVS now has an Infogrames replayer that work-arounds Gobliins 2.

Some person should go through all Infogrames games with UAE and record CIA-B timer A values which are used. It is done by going into UAE debugger while the song is played, and then issue command &quot;c&quot;. An example of Gobliins 2 intro song:
[code:1:cd08c35a75]
&gt;c
A&#58; CRA&#58; 00, CRB&#58; 08, IMASK&#58; 0a, TOD&#58; 00000c48         TA&#58; ffff &#40;ffff&#41;, TB&#58; 02cb &#40;02cb&#41;
B&#58; CRA&#58; 01, CRB&#58; 84, IMASK&#58; 01, TOD&#58; 00000139         TA&#58; 24ff &#40;24ff&#41;, TB&#58; ffff &#40;ffff&#41;
LED is ON
Drive 0&#58; motor  on cylinder 51 selected 1
Drive 1&#58; motor off cylinder  1 selected 2
Drive 2&#58; motor off cylinder  1 selected 4
Drive 3&#58; motor off cylinder  1 selected 8
DMACON&#58; 3fe INTENA&#58; 206c INTREQ&#58; 17a0 VPOS&#58; 0 HPOS&#58; 3
COP1LC&#58; 00002368, COP2LC&#58; 00021b50
DIWSTRT&#58; 0581 DIWSTOP&#58; 40c1 DDFSTRT&#58; 0038 DDFSTOP&#58; 00d0
Average frame time&#58; 19 ms &#91;frames&#58; 3518 time&#58; 70193&#93;
[/code:1:cd08c35a75]
The output may not look exactly like that, but the value what is being searched for is on this line:
[code:1:cd08c35a75]
B&#58; CRA&#58; 01, CRB&#58; 84, IMASK&#58; 01, TOD&#58; 00000139         TA&#58; 24ff &#40;24ff&#41;, TB&#58; ffff &#40;ffff&#41;
[/code:1:cd08c35a75]
Get value &quot;y&quot; from &quot;B: CRA ...stuff... TA: x (y)&quot;. In this case y = 24ff (hexadecimal).

However! It is possible that some games will actually record CIA-B timer B or some CIA-A timer value, so probably the best thing is to save both &quot;A:&quot; and &quot;B:&quot; to a text file and send them over.

---

From: shd
Date: Sat Feb 3 23:13:54 2007

To: UADE-Developer-discussion
Okay, excluding Gobliins 2, these games need timer values checked:

[url]http://www.exotica.org.uk/tunes/pages-full/RH-RobHubbard-2.html[/url]

Thank Exotica! Volunteers?

---

From: mld/uade team
Date: Sun Feb 4 11:33:48 2007

To: UADE-Developer-discussion
I can check Bobo (my sister loved that game), so I happen to have the orig disks lying here... well, somewhere. Hope they are still intact :-)

Have to see if I can find Captain Blood. 

Btw. I think either the repalyer or the ripped mods are bugged. Some Drakkhen tunes don't play

---

From: shd
Date: Sun Feb 4 12:51:11 2007

To: UADE-Developer-discussion
[quote:f01400572c="mld/uade team"]I can check Bobo (my sister loved that game), so I happen to have the orig disks lying here... well, somewhere. Hope they are still intact :-)

Btw. I think either the repalyer or the ripped mods are bugged. Some Drakkhen tunes don't play[/quote:f01400572c]

I checked Captain Blood, it is 0x19xx.

---

From: shd
Date: Sun Feb 4 14:41:16 2007

To: UADE-Developer-discussion
It turns out some games don't use CIA timers at all, so the method I described to find out tempos will not work. Horror Zombies from the Crypt is one example.

Correct tempo value for Horror zombies rip is 0x1b66.

---

From: DrMcCoy
Date: Sun Feb 4 16:04:30 2007

To: UADE-Developer-discussion
0x24FF for Goblins 3, too...

---

From: mld/uade team
Date: Sun Feb 4 16:06:53 2007

To: UADE-Developer-discussion
And here are the results of the German jury:

Bobo Intro + Food + Patate:
A:  TA: 3117 (3117), TB: 827d (ffff)
B:  TA: 19ff (19ff), TB: ffff (ffff)

So  I guess, it's the same for the rest of the Bobo song

North and South:
A: TA: ffae (ffff), TB: 0ebe (ffff)
B: TA: 19ff (19ff), TB: ffff (ffff)

Shufflepuck Café:
A: TA: ffae (ffff), TB: 119b (ffff)
B: TA: 19ff (19ff), TB: ffff (ffff)

---

From: Guest
Date: Sun Feb 4 16:23:27 2007

some more:

Drakkhen: 19ff
Tintin: 19ff

---

From: shd
Date: Sun Feb 4 17:02:57 2007

To: UADE-Developer-discussion
[quote:1c5702fd95="DrMcCoy"]0x24FF for Goblins 3, too...[/quote:1c5702fd95]
Thanks! Updated latest CVS version to contain this workaround. Hopefully gobliins 3 uses CIA timing rather than VBI so you will still have to verify the result by comparing with uade.

---

From: shd
Date: Sun Feb 4 17:03:38 2007

To: UADE-Developer-discussion
Okay, so far I've done all work-arounds reported here. However, 19ff is practically the same as 1a00 so they don't need a workaround.

---

From: DrMcCoy
Date: Sun Feb 4 17:39:23 2007

To: UADE-Developer-discussion
[quote:c7f652eb33="shd"]Hopefully gobliins 3 uses CIA timing rather than VBI so you will still have to verify the result by comparing with uade.[/quote:c7f652eb33]

Yes, sounds correct now. :)

---

From: mld/uade team
Date: Mon Feb 5 13:45:42 2007

To: UADE-Developer-discussion
1a00 was a value that I choose by ear when I tried to sync the replayer for Capt. Blood. So I guess 19ff is the correct default value

---

From: DrMcCoy
Date: Mon Feb 12 16:41:32 2007

To: UADE-Developer-discussion
And for the [url=http://www.exotica.org.uk/tunes/archive/RH-RobHubbard-2/Ween.txt]Ween music[/url], it's 0x24FF as well...

---

From: shd
Date: Tue Feb 13 13:29:20 2007

To: UADE-Developer-discussion
[quote:1c0c07285e="DrMcCoy"]And for the [url=http://www.exotica.org.uk/tunes/archive/RH-RobHubbard-2/Ween.txt]Ween music[/url], it's 0x24FF as well...[/quote:1c0c07285e]
Updated into CVS.