Page 29 of 37
Posted: Wed May 14, 2008 5:38 am
by AamirM
Hi,
I think I still haven't got this completely right. It will slow down the DAC in Mega Turrican. But I think it has somthing to do with trace feature of 68k (trace exceptions). I think that is not being emulated correctly. I will look at it again though and will get back with the results.
stay safe,
AamirM
Posted: Wed May 14, 2008 10:30 am
by Eke
Chilly Willy wrote:Eke wrote:
nice finding, thanks, but it also seems to me that the last musashi core was emulating this instruction correctly, or at least, like described in 68k docs, i.e 12 cycles +/- 2 extra cycles depending on the compare result... so what was wrong ?
According to Motorola, the DBcc instruction has three conditions on the timing:
1) cc is true - 12 cycles
2) cc is false, and the count has not expired - 10 cycles
3) cc is false, but the count has expired - 14 cycles
I suspect the CPU core probably just handled cc being true or false without handling the count condition.
no, this is properly handled by musahshi, here's the C sourcecode:
M68KMAKE_OP(dbf, 16, ., .)
{
uint* r_dst = &DY;
uint res = MASK_OUT_ABOVE_16(*r_dst - 1);
*r_dst = MASK_OUT_BELOW_16(*r_dst) | res;
if(res != 0xffff)
{
uint offset = OPER_I_16();
REG_PC -= 2;
m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
m68ki_branch_16(offset);
USE_CYCLES(CYC_DBCC_F_NOEXP);
return;
}
REG_PC += 2;
USE_CYCLES(CYC_DBCC_F_EXP);
}
with:
default cycle is 12 in op table
CYC_DBCC_F_NOEXP = -2
CYC_DBCC_F_EXP = +2
so thi stakes clearly 10 cycles when the counter is not expired and 14 cycles when counter expires (condition is always FALSE with DBF)
In Zero the Kamikaze, incrementing the default cycle for DBF (DBRA) to 14 (this makes 12 and 16 cycles) simply delay certains CRAM write that should not occur at the end of a scanline but during the next scanline
00004CF8 MOVE.L $00FF1202,A0
00004CFE MOVE.L #$C0360000,$00C00004
00004D08 MOVEQ #$12,D0
00004D0A DBRA D0,$00004D0A <--- wait loop
00004D0E MOVE.W (A0)+,$00C00000
This is what cause the flickering in the sky
I didn't look into Pacman 2 yet...
Posted: Wed May 14, 2008 11:06 am
by notaz
I suspect the CPU core probably just handled cc being true or false without handling the count condition.
I can confirm original Musashi handles all 3 cases correctly (i.e. the way docs say).
AamirM wrote:But I think it has somthing to do with trace feature of 68k (trace exceptions). I think that is not being emulated correctly.
Don't know how you got this idea, but I've looked at this too, and it surely doesn't do trace. In fact, I haven't encountered any game which would do that.
Posted: Fri May 16, 2008 3:22 pm
by King Of Chaos
Aamir's Regen site is done, comments are appreciated.
http://aamirm.hacking-cult.org/
Posted: Fri May 16, 2008 3:39 pm
by AamirM
notaz wrote:I suspect the CPU core probably just handled cc being true or false without handling the count condition.
I can confirm original Musashi handles all 3 cases correctly (i.e. the way docs say).
AamirM wrote:But I think it has somthing to do with trace feature of 68k (trace exceptions). I think that is not being emulated correctly.
Don't know how you got this idea, but I've looked at this too, and it surely doesn't do trace. In fact, I haven't encountered any game which would do that.
Hi,
Yes, no trace. I was going in the wrong direction. Still haven't figured out the correct solution. I have very less time these days.
stay safe,
AamirM
Posted: Fri May 16, 2008 7:59 pm
by Stef
AamirM wrote:notaz wrote:I suspect the CPU core probably just handled cc being true or false without handling the count condition.
I can confirm original Musashi handles all 3 cases correctly (i.e. the way docs say).
AamirM wrote:But I think it has somthing to do with trace feature of 68k (trace exceptions). I think that is not being emulated correctly.
Don't know how you got this idea, but I've looked at this too, and it surely doesn't do trace. In fact, I haven't encountered any game which would do that.
Hi,
Yes, no trace. I was going in the wrong direction. Still haven't figured out the correct solution. I have very less time these days.
stay safe,
AamirM
Don't search on 68000 core, problem is timing and specially interrupts timings. I spent *many* time with them on Gens. I adjusted them probably more than hundred time, a single cycle can fix more 1 or 2 games but break 3 others :-/ Today i know my timings are almost completly wrong, i had just luck with all my adjustements and fudges...
Posted: Fri May 16, 2008 9:00 pm
by Eke
exactly, this is something that i still driving me crazy, just to fix one game sometime
For me, the most difficult is still getting the exact occurence of HINT regarding to HBLANK, and also HBLANK exact duration,so we could render the line in the emulator at the exact moment when all required settings (i.e VDP writes) for the line are supposed to have occured.
HCounter values regarding those events (HINT,VINT,HBLANK, Vcounter increment...) would also be useful for the few games using this
Posted: Fri May 16, 2008 10:47 pm
by Zoomer
Found that on ReGen site:
-Loading a ROM from the Load ROM dialog then loading a cheat for the game, causes the Load ROM window to open at the Cheats folder, not the ROMs folder. Possible Vista-only issue. Needs To Be Confirmed By Others On Vista
Yup, confirmed. Running under Vista x64 sp1 w/o elevated access rights.
Posted: Sat May 17, 2008 4:12 am
by King Of Chaos
Ah, thank you very much for confirming!

Posted: Sat May 17, 2008 4:12 pm
by AamirM
Hi,
I have said this already and saying it again. Nice job! Although I think it would look even better if there was a way to move the search option some other place.
@ Zoomer
Thanks for confirming. I better start doing some testing on Vista.
stay safe,
AamirM
Posted: Sat May 17, 2008 7:04 pm
by Zoomer
No probs, I can test some specific things if you need. And it'll be very interesting to see multithreaded version of emu

Posted: Wed Jun 11, 2008 3:16 pm
by AamirM
Hi,
Okay, after weeks of trying, I've finally got my hands on Mac OS X 10.5.2

. Now just pray it runs. At least on VMWare or something.
stay safe,
AamirM
Posted: Thu Jun 12, 2008 7:01 pm
by King Of Chaos
On VMware, it's extremely slow and more or less unusable. It's best to dual boot with Mac OSX86.
Posted: Fri Jun 13, 2008 11:22 am
by AamirM
King Of Chaos wrote:On VMware, it's extremely slow and more or less unusable. It's best to dual boot with Mac OSX86.
Hi,
Well, it doesn't work on VMWare

. Will try to run natively when I get some time (and free hd space!).
stay safe,
AamirM
Posted: Fri Jun 13, 2008 4:29 pm
by King Of Chaos
Make sure it's Mac OSX hacked for PCs (OSX86) or else it won't work, as Macs have special hardware needed to run OSX.