Release Pcsx-Rearmed


just that you are aware off - i've finished crash bandicoot 1, no crash for me.

*edit*clarification*
 
Notaz - one issue that I've seen, which isn't a huge deal, is that in Lunar: The silver star Story (US) - the selection indicator in the menus for Lunar don't draw. So if you go to load/save a game - you have no idea what is selected.
 
notaz said:
Started but not finished:
  • Gun support - guncon investigated, shalma's code read, need to do own implementation for pandora..
  • Tenka memcards - fix available in pcsxr ngemu thread, need to check it (maybe validate it on hardware)
  • STAR WARS The Phantom Menace corruption - some investigation done, state uploaded to hardware recovers geometry, so it's not one-time corruption thing. Could not boot it on pcsxr at all for comparison.

Todo:
  • Gamera 2000 (JP) - voice
  • Final Doom - loading hang


If you validate Tenka / DW7 memcard hack on real hw, people will love you. Devs anyway. ;)
(our work = guess stuff. so unreliable in many ways)
(DW7 = $04/$08 flags)
(sio.c) http://www.sendspace.com/file/pj2p97


If you need help understanding basics Guncon, please ask. Calibration is a pita though - every game handles differently (slightly). Probably distance from TV screen.


Gamera 2000 looks something like this (cdxa_attenuation)
- some speed hit (maybe you can optimize for $80 - $00 / $80 - $00 (normal volume)?)
(cdrom.c) http://www.sendspace.com/file/4b7h7t


You may need add this (useful!)
http://pcsxr.codeplex.com/workitem/8867


Doom - Final Doom 'LOADING' hang may be related AddIrqQueue reschedule (nasty piece code)


Timing is juggling game - must send BIAS 1 (psxcommon.h) --> SLOWDOWN.
- Then set RAM = 4 (average) + IO = 4 (average) + Scratchpad = 1
- Fixes some game speed problems (MML1, UMKT speech, blah blah)


What our build looks like (exe only, sorry) (BIAS 1 + other silly stuff)
(pcsxr-shalma) http://www.sendspace.com/file/5rhqrw


Good luck!
- PS: Did you see DSound win32 Tron Bonne fix? Leave channel running + silent envelope volume.
 
Last edited by a moderator:
Another bug, again in Zanac X Zanac. The game is actually a compilation of the original Zanac and a new game. The original Zanac not only has broken sound, but crashes after a few seconds of gameplay.

And DoDonPachi has no music (tried two different ISOs), as well as taking an abnormally long time to load the first level. The levels after load quickly. It's in EBOOT format (as are all my other games), dunno if that has anything to do with it.

Finally, DonPachi (not DoDonPachi) has no music (a bad rip, maybe?), and freezes for a second frequently, making the game impossible to play. When it runs, though, it runs well.
 
Bonapart said:
notaz: miss: ninja: shadow of darkness(post)
Threads of Fate: tnx for this game
p.s. hoping git update will be soon
Updated list. I'll only sync git after r9 release, sorry (I like rebasing/messing with the history).
Edit: seems to work in r9.

crow_riot said:
just that you are aware off - i've finished crash bandicoot 1, no crash for me.
ok, removing from list until evidence (savestate) is provided.

gretar said:
(our work = guess stuff. so unreliable in many ways)
(DW7 = $04/$08 flags)
(sio.c) http://www.sendspace.com/file/pj2p97

Gamera 2000 looks something like this (cdxa_attenuation)
- some speed hit (maybe you can optimize for $80 - $00 / $80 - $00 (normal volume)?)
(cdrom.c) http://www.sendspace.com/file/4b7h7t

Doom - Final Doom 'LOADING' hang may be related AddIrqQueue reschedule (nasty piece code)
Will take a look, thanks.

gretar said:
If you need help understanding basics Guncon, please ask. Calibration is a pita though - every game handles differently (slightly). Probably distance from TV screen.
More like gun and screen variations, I tried Time Crisis on the real thing and it was offset quite a bit to bottom-right, so ingame calibration was needed..

gretar said:
You may need add this (useful!)
http://pcsxr.codeplex.com/workitem/8867
looks good. On a related note I've seen ff7 aborting DMA chain by forcing bit24 to 0, then resubmiting the list again. This has no visible effects but causes severe slowdowns on ARM because the scene ends up rendered twice by GPU plugin..

gretar said:
- PS: Did you see DSound win32 Tron Bonne fix? Leave channel running + silent envelope volume.
Yeah but that eventually ends up with all 24 channels running, annihilating performance on ARM..

gretar said:
Timing is juggling game - must send BIAS 1 (psxcommon.h) --> SLOWDOWN.
- Then set RAM = 4 (average) + IO = 4 (average) + Scratchpad = 1
- Fixes some game speed problems (MML1, UMKT speech, blah blah)
Same here, we are already too slow in many cases, maybe make it optional someday..

Blue Protoman said:
And DoDonPachi has no music (tried two different ISOs), as well as taking an abnormally long time to load the first level. The levels after load quickly. It's in EBOOT format (as are all my other games), dunno if that has anything to do with it.
I don't know how CDDA is stored in eboots, so I'm just ignoring it, likely causing these problems. I need to make testing file for this, do you know any eboot tools that handle cdda correctly?
 
Last edited by a moderator:
(s)
You can check out some of pSX MAME source
http://www.sendspace.com/file/krg717


Turns out pSXAuthor returns 'nothing' for an illegal memcard state (none) - basically a no-response timeout. Real hw may do this too then?

He also does something called 'VAG Cache' (SPU2-X does this also). Never understood this but maybe you can gain some fps with it?

Jake Stine of SPU2-X also optimized Neill's reverb equation down to a few lines (may save you some speed too) (see SPU2-X plugin - Air's reverb.c notes).

Have you tried optimizing your adsr sustain full - zero levels (0x7fffffff vs 0)? We got a nice +10 fps boost with this for Tron Bonne (nullified our silence flags + always play fix).

I think the old spu noise core uses rand() + mod/mul/div. Have you tried using Dr. Hell's noise formula? It makes a big difference in FF (Tactics) spells / summons quality. You don't need to run it every apu cycle like we do - just run it when a channel requests the noise output (once per cycle).

You could seize an opportunity with the Tron Bonne hack - it only fires IRQs on ch19 (1-24). So on ADSR release, if IRQ on + ch19, keep on. Until IRQ off is set inside of registers.c. Then ch19.on = 0. Smaller speed hit. :)



For CDXA attenuation, you could just use the 'easy' version to get some speed out of it. Just output: zero or normal volume. Ignore the fade-out effects ($01-ff --> $80). And just memcpy when Gamera 2000 sets left = 00-00, right = 80-80.

(Gamera note: 80-80 / 00-00 ==> Japanese, 00-00 / 80-80 ==> English) or vice versa



As a thought, have you tried 'optimizing' the MDEC code? The pandora has a 'small' screen, enough that maybe you could reduce the MDEC quality for speed hacks?
http://jpsxdec.blogspot.com/

He says that pcsx-r quality is > real console. So you could get away with it.



Lastly, Spyro may be a GTE problem? (never played it)
http://pcsxr.codeplex.com/discussions/262529



Wish we could help you get more speed out of that device. But we are aw-fu-l at optimizations (what happened to win32 pcsxr speed) :lol: :sad:
- Thanks for that FF7 note BTW (curiously interesting)

(removed)
 
notaz said:
Blue Protoman said:
And DoDonPachi has no music (tried two different ISOs), as well as taking an abnormally long time to load the first level. The levels after load quickly. It's in EBOOT format (as are all my other games), dunno if that has anything to do with it.
I don't know how CDDA is stored in eboots, so I'm just ignoring it, likely causing these problems. I need to make testing file for this, do you know any eboot tools that handle cdda correctly?

No, sorry. I use Popstation GUI 3.00 for mine. Dunno how that affects anything. Perhaps at one point I'll try the game outside of an EBOOT.
 
Last edited by a moderator:
gretar said:
Thanks for all those ideas, reverb indeed causes noticeable slowdown and noise uses division that's bad thing on ARM. Not sure about Tron Bonne hack, but it's tempting :)


gretar said:
As a thought, have you tried 'optimizing' the MDEC code? The pandora has a 'small' screen, enough that maybe you could reduce the MDEC quality for speed hacks?
http://jpsxdec.blogspot.com/

He says that pcsx-r quality is > real console. So you could get away with it.
Luckily there are enough cycles for that one, even without overclock.

gretar said:
Wish we could help you get more speed out of that device.
Already helped with useful advice, this also has N900 port and is used as a base of psx4droid, so I think it's worth the effort.
 
Last edited by a moderator:
(s)
Thanks. If there's an opening to pitch in a little, it's fun (and refreshing) to try.


We took a look at ePSXe's dynarec some more. Don't know how this compares with Ari64 recompiler

1- They directly dynarec rewrote the memmap cycle penalties into custom x86. Little register usage in that subroutine other than some dynarec temp vars. Plus no register trashing.

Gives them a nice speed boost (until we dll hacked it to fix the scratchpad cycles).


2- They run the system in roughly $862 / 86D (ntsc/pal) system clock interrupt cycles. Which is when they drop out to take care of counters and such. They use 16-bit dec method.

Turns out they directly embedded interrupt checks into dynarec also after each opcode runs.

I think they added an alternative interrupt handler on top embedded in dynarec also though (runs after every branch i.t.)



A few other notes (looking at r8 git repository)
- psxcounters.c

1-
Bump HSyncTotal 262->263, 312->313
(fixes Wipeout 2 rotation models)


2-
You _might_ be able to play around with a variable SpuUpdInterval

Some games are more tolerant of higher values (longer call stretches)


3-
There's enough DIV code here.
- Clock is often '1' (use an if check to bypass DIV)
- When clock is '8', optimize a bitshift
- Maybe optimize _psxRcntRcount -> 0,1,2,3 versions (???) for custom optimization


4-
(Optional)
- Give option to swap vsync irq hits (There's 2 games iirc that benefit - Chrono Cross + ?)



By random chance, do you have a G-Con 45 to test with? Kinda Justifier-related (Silent Hill hyperblaster detection).
 
(s)
http://pcsxr.codeplex.com/workitem/8874
- This will fix the Soul Reaver missing souls problem - GTE RTPS / RTPT


Also in cdrom.c, you'll want a 'faster' version of the Ape Escape fix for Specter Land theme park


psxDma3

1978 if( (cdr.pTransfer-cdr.Transfer) + cdsize > 2352 )
1979 {
1980 // avoid crash - probably should wrap here
1981 //memcpy(ptr, cdr.pTransfer, cdsize);
1982 }

// This is needed to get cutscene rolling (castle)
memcpy(ptr, cdr.pTransfer, 2352 - (cdr.pTransfer-cdr.Transfer) );

// TODO: Wrap and memcpy rest data
// - may not be needed for Ape Escape though



EDIT:

(r8 git)
spu.c

(1)
615 sval = (MixADSR(ch) * fa) / 1023; // mix adsr
==>
615 sval = (MixADSR(ch) * fa) / 1024; // mix adsr



(2)
675 d = SSumLR[ns] / voldiv; SSumLR[ns] = 0;
682 d = SSumLR[ns] / voldiv; SSumLR[ns] = 0;

note: hard-code a /2 here. unless compiler is smart enough to optimize the const var.


(3)
589 if(flags!=3 || s_chan[ch].pLoop==NULL) // PETE: if we don't check exactly for 3, loop hang ups will happen (DQ4, for example)
590 { // and checking if pLoop is set avoids crashes, yeah

===>

Xenogears (flags = 7)

if( (flags!=3 && flags!=7) || s_chan[ch].pLoop==NULL)
// aka 'silent' run
start = (unsigned char*)-1;

// Actua Soccer 2, Jungle Book, other games that check for this condition
// - note: you may want to do this though at -next- loop (prevent voice cutoff?)
s_chan[ch].ADSRX.EnvelopeVol = 0;
}


(4)
There's also the Silhouette Mirage stuff
- if(predict_nr > 5) predict_nr = 0
- if(s_chan[ch].pCurr >= 0x80000) (unsigned char*) s_chan[ch].pCurr = -1;

// Tron Bonne sometimes does this ^^
- if(flags>7) flags=0



registers.c
SPUreadRegister
= zap case 14: // get loop address
(we now know this is wrong ;)



I suppose you'll be busy for awhile improving stuff. :)
 
gretar said:
We took a look at ePSXe's dynarec some more. Don't know how this compares with Ari64 recompiler

1- They directly dynarec rewrote the memmap cycle penalties into custom x86. Little register usage in that subroutine other than some dynarec temp vars. Plus no register trashing.

Gives them a nice speed boost (until we dll hacked it to fix the scratchpad cycles).
I didn't do anything fancy, it just counts 1 cycle per instruction. I think notaz underclocked it by half though (ie 16.9 million instructions per second).


gretar said:
2- They run the system in roughly $862 / 86D (ntsc/pal) system clock interrupt cycles. Which is when they drop out to take care of counters and such. They use 16-bit dec method.

Turns out they directly embedded interrupt checks into dynarec also after each opcode runs.

I think they added an alternative interrupt handler on top embedded in dynarec also though (runs after every branch i.t.)
Is that sort of timing really necessary for anything newer than SNES? Checking after every instruction contributes to code bloat and L1 cache misses. Also handling interrupts in delay slots is annoying, so I avoided doing that.
 
Last edited by a moderator:
gretar said:
We took a look at ePSXe's dynarec some more. Don't know how this compares with Ari64 recompiler
It's very sophisticated and easily the best MIPS->ARM recompiler available (from open ones at least), you can read about it here:
http://pandorawiki.org/Mupen64plus_dynamic_recompiler

gretar said:
1- They directly dynarec rewrote the memmap cycle penalties into custom x86. Little register usage in that subroutine other than some dynarec temp vars. Plus no register trashing.
I just use 2 penalty cycles for writes anywhere and cop2 loads/stores, doing penalties on reads is causing problems on PCSX as you probably know.

gretar said:
2- They run the system in roughly $862 / 86D (ntsc/pal) system clock interrupt cycles. Which is when they drop out to take care of counters and such. They use 16-bit dec method.
I just run it until next scheduled event, which is set by PCSX core. The recompiler is maintaining cycle counter (usually in a register) and calls the emu back after it expires. It does counter checks after branches. The counter is reloaded after a write (as that may result in new event, like new DMA to expire and such).

gretar said:
Turns out they directly embedded interrupt checks into dynarec also after each opcode runs.
Hm that doesn't sound good for performance? Doing checks on branches seems good enough, the ARM version of Mupen64plus and even PCSX interpreter works this way.

gretar said:
Bump HSyncTotal 262->263, 312->313
(fixes Wipeout 2 rotation models)
Saw this before but not merged for some reason, I guess will do it this time.

gretar said:
You _might_ be able to play around with a variable SpuUpdInterval

Some games are more tolerant of higher values (longer call stretches)
I'm already doing it on SPU side, see SPUasync()

gretar said:
There's enough DIV code here.
- Clock is often '1' (use an if check to bypass DIV)
- When clock is '8', optimize a bitshift
- Maybe optimize _psxRcntRcount -> 0,1,2,3 versions (???) for custom optimization
Unless the game is reprogramming the counters like crazy or polling them a lot it shouldn't really be needed, at least somehow root counters don't pop up in the profiles.
Also a note about division by multiples of 2 - the default division routines already have fast path for those.

gretar said:
4-
(Optional)
- Give option to swap vsync irq hits (There's 2 games iirc that benefit - Chrono Cross + ?)
What do you mean?

gretar said:
By random chance, do you have a G-Con 45 to test with? Kinda Justifier-related (Silent Hill hyperblaster detection).
I was sent the original Namco Guncon and a clone called Scorpion, which has a button for guncon/justifier modes. Not sure how faithful the clone is, in guncon mode it reacts different to unused commands compared to real guncon, for example. I'll see if it's detected by Silent Hill.
http://www.defconsoft.co.uk/hardware/guns/scorpion-gun/
 
Last edited by a moderator:
gretar said:
http://pcsxr.codeplex.com/workitem/8874
- This will fix the Soul Reaver missing souls problem - GTE RTPS / RTPT
Hey this also fixed Spyro, nice!

gretar said:
Also in cdrom.c, you'll want a 'faster' version of the Ape Escape fix for Specter Land theme park
ok

gretar said:
615 sval = (MixADSR(ch) * fa) / 1023; // mix adsr
==>
615 sval = (MixADSR(ch) * fa) / 1024; // mix adsr
Divisions by constant are also not a big deal, compiler knows how to convert this to multiplication + shift, and ARM can multiply fast.

gretar said:
(2)
675 d = SSumLR[ns] / voldiv; SSumLR[ns] = 0;
682 d = SSumLR[ns] / voldiv; SSumLR[ns] = 0;

note: hard-code a /2 here. unless compiler is smart enough to optimize the const var.
No point, it knows constant vars too.

gretar said:
<some SPU stuff>
ok thanks.
 
Last edited by a moderator:
(s)
Thanks for all the feedback.

Me = certified unintelligent when it comes to dynarec design (entry bozo level). Slowly learning from everyone's writings and doings. :)


I just use 2 penalty cycles for writes anywhere and cop2 loads/stores, doing penalties on reads is causing problems on PCSX as you probably know.

Didn't know that. :oops:

We use BIAS 1 (win32), so we have to use penalty cycles everywhere on RAM access + scratchpad. Other problem is that BIAS 1 exposes lots of semi-unemulated quirks (interlace bits needed for InuYasha, gpu dma timing bits, vsync irq, ..) so we're checking them out. Stuff that works on BIAS 2 but falls apart on BIAS 1 - sometimes flickering yuck or input stuck because of random bad interrupt timing.

And pig slow. Is the paranoia needed? If it fixes a stupid bug for my debugger, so be it. ;)



edgbla put a note about the vsync irq in psxcounters.c - use this for best timing (commented out). Just putting it out there.


BTW, you'd want to be careful about cdda games. Some like Wild 9 setup a watchdog timer. Gets all curmudgeony when the REPPLAY doesn't come back within the 2/75 read timing.
 
Alerino said:
gretar, just to let you know we also have a N64 emulator, that's getting love from Ari,notaz, bzfrank and others . More love is always welcome. :D

Kinda fit '2-trick pony' category - psx pc gets lot less activity. Easy to work quietly. If N64 gets comatose for long time, maybe~ (seems kinda lukewarm - hot lots time).

Don't think could add to n64 (pnd/win) discussion though. Seems so~ different from psx. :(


Even extra psx contributions seem (mostly) done. ^^
(notaz basically got all already)
 
Last edited by a moderator:
notaz, is there any raw date you want to release the new version? I don't mean to push you, but knowing that the possibility to play Edge Fencer and Team Buddies is already given, just not yet released makes it hard to wait.

Btw, thank you for your contributions, gretar!!!
 
Two Simple 1500 Series games (The Meiro and The Dungeon RPG) don't boot. Black screens, though apparently after a point where the resolution changes to 640x480.
 
Bugs Bunny lost in time has some weird bug when you go to get the first clock from the wizard guy.

It goes through various speech changes and attempts to unlock new things
 
Racing (yes, that's the name) has garbage displayed on a third of the screen in-game. Guess what genre the game is?

And Rapid Reload and Tempest X3 suffer from occasionaly, but seizuriffic, black flashes. They last under a second a pop.
 
Back
Top