Developers wanted for PCSX Revival!

Discussion in 'PCSX Discussion' started by Squall-Leonhart, Dec 31, 2008.

  1. shalma

    shalma Discontinued Emu Author

    Messages:
    1,192
    Likes Received:
    0
    All I'm going to mention about RE3 is that it's a game with (cpu?) timing problems for us. Honestly don't know anything more.


    We're a collection of psx enthusiasts. Most (all) of the contributing regulars here at ngemu happen to be loosely affiliated with one of PCSX's forks
    - win32 / linux / mac / (..) = PCSX-Reloaded
    - gp32 / maemo = Pcsx-Rearmed - GP32X.com - GP32 GP2X Pandora The Wiz - open source entertainment

    We participate here to openly advance emulation knowledge for ourselves and outside projects. Or share psx coding tips or educated problems that another dev could pick up later someday.

    I think we're now all at the checkpoint where actual hardware tests is the practical way to go.


    Anyone is allowed to contribute and leave - point is we're all helping each other.

    There will always be a higher demand for
    - people who can write good hardware tests
    - people who can run, report hardware tests
    - analysts who have a good understanding of psx internals and can explain away some oddball results
    - people who can add new findings into the pcsx-reloaded code (main branch) + plugins
    - people who can update, maintain pcsx-reloaded
    (ex. add event based timing system, mouse emulation, etc.)

    Testing with Xebra emu is also recommended as its accuracy is normally very high.

    ===========================================
    ===========================================

    *** Warning ***

    To BIOS printf users:
    - Some (many?) versions will have a stack bug that will eat up to 8-16 bytes of your -own- stack area (sp + $0 / sp + $4)
    - In my case, it caused a 'jr ra' crash
  2. nhyone

    nhyone New Member

    Messages:
    52
    Likes Received:
    0
    Did you reserve the space for a0-a3?

    Here's my printf code:

    Code:
    print:
        add s7, ra, r0
    
        li t1, $3f
        jal $800000a0
        addi sp, sp, -16        ; create reg overflow stack space
    
        jr s7
        addi sp, sp, 16
    
    I saw from the PCSX-R HLE BIOS printf that it puts a0-a3 on the stack, thus I realized there's a register overflow area. (This is quite common. x86-64 for Windows also has it.)
  3. shalma

    shalma Discontinued Emu Author

    Messages:
    1,192
    Likes Received:
    0
    Ah! Thanks for the tip. Didn't know that ;)

    ==================================
    ==================================

    SPU behavior (part 2)


    Background:
    Battery of tests to improve understanding


    Xebra (interpreter, dynarec = buggy)

    re-irq testing
    001 - 0201 (dma-w 1010+40 / irq ff8)
    002 - 0001 (dma-w 1010+40 / irq 1000)
    003 - 0001 (dma-w 1010+40 / irq 1008)
    004 - 0201 (dma-w 1010+40 / irq 2000)
    005 - 0001 (dma-w 1010+40 / irq 40000)
    006 - 0201 (dma-w 1010+40 / irq 7fff8)
    (???)

    007 - 0201 (dma-r 1010+40 / irq ff8)
    008 - 0001 (dma-r 1010+40 / irq 1000)
    009 - 0001 (dma-r 1010+40 / irq 1008)
    010 - 0001 (dma-r 1010+40 / irq 2000)
    011 - 0001 (dma-r 1010+40 / irq 40000)
    012 - 0201 (dma-r 1010+40 / irq 7fff8)
    (???)



    extra irq testing
    101 - 0001 (mode = no data + dma-w 1010+40 / irq 1000)
    102 - 0001 (mode = no data + dma-w 1010+40 / irq 1008)
    103 - 0200 (mode = no data + dma-w 1010+40 / irq 1040)
    104 - 0200 (mode = no data + dma-w 1010+40 / irq 1048)
    (check irq anyway + bump ptr)

    105 - 0001 (mode = no data + dma-r 1010+40 / irq 1000)
    106 - 0001 (mode = no data + dma-r 1010+40 / irq 1008)
    107 - 0200 (mode = no data + dma-r 1010+40 / irq 1040)
    108 - 0200 (mode = no data + dma-r 1010+40 / irq 1048)
    (check irq anyway + bump ptr)

    (this causes xebra problems with music)
    109 - 0001 (mode = no data + data-w 1010 / irq 1000)
    110 - 0001 (mode = no data + data-w 1012 / irq 1000)
    111 - 0001 (mode = no data + data-w 1014 / irq 1008)
    112 - 0001 (mode = no data + data-w 1016 / irq 1008)
    (no irq check + bump ptr)

    113 - 0001 (mode = no data + data-r 1010 / irq 1008)
    114 - 0001 (mode = no data + data-r 1012 / irq 1008)
    115 - 0001 (mode = no data + data-r 1014 / irq 1010)
    116 - 0001 (mode = no data + data-r 1016 / irq 1010)
    (no irq check + bump ptr)

    117 - 0001 (mode = dma-w + data-w 1010 / irq 1000)
    118 - 0001 (mode = dma-w + data-w 1012 / irq 1008)
    119 - 0001 (mode = dma-r + data-w 1014 / irq 1010)
    120 - 0001 (mode = dma-r + data-w 1016 / irq 1018)
    (no irq check + bump ptr)

    121 - 0001 (mode = non-dma + data-w 1010 / irq 1010)
    122 - 0001 (mode = non-dma + data-w 1012 / irq 1010)
    123 - 0001 (mode = non-dma + data-w 1014 / irq 1018)
    124 - 0001 (mode = non-dma + data-r 1016 / irq 1018)
    125 - 0001 (mode = non-dma + data-r 1018 / irq 1018)
    126 - 0001 (mode = non-dma + data-r 101a / irq 1020)
    (no irq check + bump ptr)


    voice testing
    201 - set 1dac to 0.50x speed
    202 - set 1dac to 1.00x speed
    (constant speed)

    203 - 0000 ffff (check status reg ($f800 write mask))
    204 - 1200 8001 (check start reg + ch1 on ($40008 write) - $7 loop)
    (status reg = writable?)

    205 - 0021 (check irq $40000)
    206 - 0021 (check irq $40008)
    207 - 0221 (check irq $40010)
    (irq at $7 loop end)

    208 - 8003 8003 (check loop reg ($40018 write))

    209 - 0021 (jump to $7fff0, irq at $1000)
    210 - 0021 (jump to $7fff0, irq at $1010)
    211 - 0221 (jump to $7fff0, irq at $7fff8 (after wait))
    212 - 0000 (check ch1 mute)
    (loops at end if over - keeps playing)

    213 - 0221 (set reverb $7ffe0, irq at $7ffe0)
    214 - 0221 (set reverb $7ffe0, irq at $7ffe8)
    (reverb irq hits)



    Program:
    Modified rootexample + printgpu by doomed/padua




    Results:
    - Hardware =

    001 - 0201 (dma-w 1010+40 / irq ff8)
    002 - 0001 (dma-w 1010+40 / irq 1000)
    003 - 0001 (dma-w 1010+40 / irq 1008)
    004 - 0001 (dma-w 1010+40 / irq 2000)
    005 - 0001 (dma-w 1010+40 / irq 40000)
    006 - 0001 (dma-w 1010+40 / irq 7fff8)
    (normal dma irq ranges?)

    007 - 0201 (dma-r 1010+40 / irq ff8)
    008 - 0001 (dma-r 1010+40 / irq 1000)
    009 - 0001 (dma-r 1010+40 / irq 1008)
    010 - 0001 (dma-r 1010+40 / irq 2000)
    011 - 0001 (dma-r 1010+40 / irq 40000)
    012 - 0001 (dma-r 1010+40 / irq 7fff8)
    (normal dma irq ranges?)



    extra irq testing
    101 - 0001 (mode = no data + dma-w 1010+40 / irq 1000)
    102 - 0001 (mode = no data + dma-w 1010+40 / irq 1008)
    103 - 0200 (mode = no data + dma-w 1010+40 / irq 1040)
    104 - 0200 (mode = no data + dma-w 1010+40 / irq 1048)
    (check irq anyway + bump ptr)

    105 - 0001 (mode = no data + dma-r 1010+40 / irq 1000)
    106 - 0001 (mode = no data + dma-r 1010+40 / irq 1008)
    107 - 0200 (mode = no data + dma-r 1010+40 / irq 1040)
    (incomplete)

    (system crash)

    (testers = notaz)



    Files:
    - test1 = hacked, unknown results

    ==========================================
    ==========================================

    Going to be the last spu hw test for a long while - plain sick of working on this. :)

    Results can come in whenever. ;)


    Xebra doesn't like doing illegal data writes (blows out sound). There might be a chance that $1dac is a 'clock register' ($04 = normal, $03 = half-speed)

    When voice play hits ram end (maybe reverb too), just loops around last block. Reverb buffer hits IRQs.

    Voice IRQs are checked post-bump (ala Pete).

    Illegal data access resets addr to $1000 or $1008 (more likely).



    Want to grab those joypad constants next. And maybe test that cdrom data reschedule thingy.

    Afterwards, I'm really burned out.
    Last edited: Apr 14, 2011
  4. shalma

    shalma Discontinued Emu Author

    Messages:
    1,192
    Likes Received:
    0
    SPU side-note first:
    BIOS sets data (now called dma) flag to 00. Then writes data. No illegal stuff going on. So be sure to allow it (old code).

    dma mode 01 may be 'illegal' or 'unused' - doesn't respond to dma like 10 or 11 do.



    Now putting this out there since I'm partly confused.

    edgbla discovered cdda attenuation
    1 2 | 3 4
    out-left = left * 1 + right * 4
    out-right = right * 3 + left * 2


    Gamera 2000 does this same formula for its xa movies (japanese vs english speech)
    ex. 0 0 | 7f 7f (stereo xa - english)


    Eggs of Steel does
    EB EB | 0 0 (stereo xa)


    Chronicles of the Sword does
    0 0 | 7f 7f (cdda - speech 1)
    7f 7f | 0 0 (cdda - speech 2)


    Now Chronicles of the Sword (xa movies) does
    7f 0 | 0 7f

    Normal attenuation does not work here - sends all data to output left only. We can't figure out what's missing to get both channels to play.
    (Xebra does the same thing here)



    ePSXe SPU core xa movie sounds correct because they use a different method-
    left = 7f | 0 (> 0 so in-left = output-left)
    right = 0 | 7f (> 0 so in-right = output-right)

    in-game cdda speech alternates left-only / right-only depending on the speech track

    But Gamera 2000 plays English speech through output-right only
    Eggs of Steel plays xa through output-left only


    It should be reasonably convincing that CotS movies will play xa speech through both speakers, unlike Xebra + Pcsx. Fortunately, only this game seems affected.

    A confusing why.
  5. notaz

    notaz New Member

    Messages:
    10
    Likes Received:
    0
    demo4b seems to hang before finishing it's job, and only 12 values come through printf redirection. There is completely no sound, not even a pop.
  6. shalma

    shalma Discontinued Emu Author

    Messages:
    1,192
    Likes Received:
    0
    Thanks anyway for testing it. Don't have the foggiest idea why the system 'crashed'. And normal dma r/w results seem so inconsistent from demo4a.

    All I see is that Xebra is mostly right (reverb cursor should not be moving around then). And Eternal 1.50 looks good too (up to the crash) - minus one possible IRQ (that's a stretch).
    (need to check that plugin again more often)


    I've reached the point where I can't seem to make good judgment calls about (psx) hw behavior. I'd need hours of personal, few case - 1-program testing. :(

    I'm not sure what to make out of demo3-4 anymore, other than bad coders = bad programs = faulty results.

    If I were you, I'd just throw them all out and start over with new unrecycled code. Meaning someone more experienced should get trusted data out of the spu.


    Thanks for at least giving us a chance. But I'm ready to give up now on hw testing. Done wasting others' time. :dead::cry:

    The part I'd do differently is not rely on what others' say what the hw should do.
    ex.
    (normal) set dma flag mode / wait for flag to to set correctly (doomed/padua hard-coded mod player)
    (alt) set dma flag mode / burn some time / print ctrl+status reg then do test then print ctrl+status reg again
  7. notaz

    notaz New Member

    Messages:
    10
    Likes Received:
    0
    Well it only takes seconds to do the test, it's basically 2 commands: one to uncompress and another to do upload/run of exe on caetla, so if you can live with my few day turnaround times I can keep running those tests.
  8. shalma

    shalma Discontinued Emu Author

    Messages:
    1,192
    Likes Received:
    0
    That I don't mind. :)
    Hard to find anyone to do hw tests these days.

    Constantly getting bad results because we don't know what we're doing is what driving me permanently KO (retirement home).


    Had a talk with Dr. Hell of Xebra and he's confident in his emu - whatever results I'm getting is most likely for unknown reasons.
    - Only exception is spu dma mode 00 (demo4b) - spu is not accepting dma transfers and dma hangs forever (which explains your stop result)
    (unverified guess though)

    - He says that reverb is constantly running (never turns off), so you should hear bios shell reverb in the bg (that's new to me) and get IRQs (unlike demo4b result) :(
    ex. 006 - 0001 (dma-w 1010+40 / irq 7fff8) (notaz hw)

    - Also said that ctrl $01 = cd audio (direct processing), $03 = cd audio (reverb processing) (that's new to me)

    - There's a few other things he mentioned that caught me by surprise (again) - he put up a picture of how the ADPCM interpolation works (actually used an Excel function to nearly simulate exactly the Gaussian curve)

    - There's a dma read flag inconsistency with Xebra

    - There's this one
    (demo4a - hw)
    (*) 202 - 0200 (dma-w 1010+40 / irq 1008)
    200 - 0200 (dma-w 1010+40 / irq 1010)
    203 - 0201 (dma-w 1010+40 / irq 1048)
    (*) 201 - 0201 (dma-w 1010+40 / irq 1050)

    (demo4b - hw)
    003 - 0001 (dma-w 1010+40 / irq 1008)


    - And this one

    (demo4b - hw)
    101 - 0001 (mode = no data + dma-w 1010+40 / irq 1000)
    102 - 0001 (mode = no data + dma-w 1010+40 / irq 1008)
    103 - 0200 (mode = no data + dma-w 1010+40 / irq 1040)
    104 - 0200 (mode = no data + dma-w 1010+40 / irq 1048)

    Actually this didn't hang. But this did.

    105 - 0001 (mode = no data + dma-r 1010+40 / irq 1000)
    106 - 0001 (mode = no data + dma-r 1010+40 / irq 1008)
    107 - 0200 (mode = no data + dma-r 1010+40 / irq 1040)
    (incomplete)


    Or maybe it was this that did it.
    (this causes xebra problems with music)
    109 - 0001 (mode = no data + data-w 1010 / irq 1000)
    110 - 0001 (mode = no data + data-w 1012 / irq 1000)
    111 - 0001 (mode = no data + data-w 1014 / irq 1008)
    112 - 0001 (mode = no data + data-w 1016 / irq 1008)



    It's stuff like that. That drives me crazy. Just can't understand. :dead::sad:

    Don't know who / what to believe anymore. :(
    Last edited: Apr 15, 2011
  9. shalma

    shalma Discontinued Emu Author

    Messages:
    1,192
    Likes Received:
    0
    update:
    Hopkat says she'll think of trying one more time.

    She'll take charge. Write new code. No mod player. No fancy stuff.

    Xebra results are a guideline only - hardware = gospel. Final say. And Xebra comparisons will be dropped. Dump old results.

    One package. Lots of small test programs. Each one with a special task. A lot of work if it goes through. ;)



    update2:
    One more Dr. Hell followup - Vib Ribbon

    He mentioned that reverb is always playing. The reverb $80 flag is some type of write-protect for the reverb buffer.

    Here's how his tip plays out.

    Vib Ribbon is reading the cdda in the decoded buffer. Dma read. Then dma write the cdda data back to the --reverb buffer-- later. Game syncs up the play.

    Not working yet but verified with Eternal. Finally - I've spent 2 years on this game (personal interest) and the trick is solved!!
  10. edgbla

    edgbla Member

    Messages:
    41
    Likes Received:
    3
    shalma:
    Final Fantasy Origins (USA) (v1.2), KKND, TM2...
    Program received signal SIGSEGV, Segmentation fault.
    MixXA () at xa.c:92
    92 spuMem[ (decoded_xa + 0x000)/2 ] = (short) lc;
    Last edited: Apr 17, 2011
  11. shalma

    shalma Discontinued Emu Author

    Messages:
    1,192
    Likes Received:
    0
    Sorry about that - didn't try out anything with xa. Cdda should work.

    Code:
    70 	
    ·int·decoded_xa;
    71 	
    ·int·decoded_cdda;
    72 	
    
    
    (add this line here to fix crash)
    decoded_xa = decoded_ptr;
    
     
    73 	
    ·lc·=·0;
    74 	
    ·rc·=·0; 
    
    
    (this is okay)
    157 	
    ·decoded_cdda·=·decoded_ptr; 
    
    Shows why I'm stupid and overly careless often enough. I'll stop patching pcsx - always seem to break more things and give you guys more headache.
  12. edgbla

    edgbla Member

    Messages:
    41
    Likes Received:
    3
    good job.
  13. shalma

    shalma Discontinued Emu Author

    Messages:
    1,192
    Likes Received:
    0
    Which version of Gran Turismo?

    redump.org • Discs

    Europe
    redump.org • Gran Turismo
    redump.org • Gran Turismo

    USA
    redump.org • Gran Turismo
    redump.org • Gran Turismo

    Japan
    redump.org • Gran Turismo • ?????????????
    redump.org • Gran Turismo • ????????


    (USA GH 1.1)
    Tried pcsxr SVN w/ padgnneco. Config = twist + digital.

    Started game. Hit F to skip intro. Hit down. Hit right. Hit F.

    Config screen - hit right x2. Negcon is on.
    Hit right again. Able to calibrate a supremely dummy negcon.



    edit:
    Try using config - digital. Boot into game. Save state. Quit.

    Config - twist + digital. Load state. Enable (?) analog (Z). Enter config. Check negcon.



    edit2:
    Got in touch with a PAL gamer.

    Says negcon plugin works using a real and simulated bios.
    Last edited: May 20, 2011
  14. shalma

    shalma Discontinued Emu Author

    Messages:
    1,192
    Likes Received:
    0
    Lifeforce Tenka only wants 1 memcard maximum.

    PCSX-r already has code for unknown devices
    Code:
    case 0x01: // start pad
    case 0x81: // memory card
    case 0xae: // GameShark CDX - start dongle
    
    default: // no hardware found
    #ifdef PAD_LOG
    	PAD_LOG( "DEVICE NOT FOUND!!!\n" );
    #endif
    
    	StatReg |= RX_RDY;
    	return;
    
    Returns a dummy byte for 1 read. Then shuts down RX_RDY. Works the same for memcards - but you have to check $2000 for port1 or port2.

    ex. blank name = memcard2 file

    (ctrl & $2000 != 0) + NULL name ==>
    Code:
    case 0x81: // start memcard
    if( CtrlReg & 0x2000 )
    {
    	StatReg |= RX_RDY;
    
    	// Lifeforce Tenka - no memcard detected
    	// - no data to send
    	bufcount = 0;
    
    	SIO_INT(SIO_CYCLES);
    	return;
    }
    
    Threads of Fate is also a good place to check this out
    - reports memcard not inserted
    - file not found on memcard
    - save found on memcard


    When you plug the card back in
    - report buf[1] |= 0x04 (1 frame)
    - report buf[1] |= 0x08 (1 frame)
    - report buf[1] |= 0x00 (rest)
  15. shalma

    shalma Discontinued Emu Author

    Messages:
    1,192
    Likes Received:
    0
    Ape Escape - Specter Land (castle cutscene - back gate)
    - Game requires cdrom wrapping for dma3 (> 2352 bytes returned)

    Code:
    example - cdrom.c
    
    			// fast copy - no wrap
    			if( cdr.pTransfer + cdsize <= cdwrap_ptr ) {
    				memcpy(ptr, cdr.pTransfer, cdsize);
    
    				psxCpu->Clear(madr, cdsize / 4);
    				cdr.pTransfer += cdsize;
    			} else {
    				int lcv;
    
    				/*
    				CDROM wrapping
    
    				Ape Escape - used several times
    				Gameshark Lite - opening movie
    
    				Gameshark CDX: enhancement CD patcher
    				- calls CdlPlay @ 0:2:0
    				- spams DMA3 and overruns buffer
    				*/
    
    				for( lcv = 0; lcv < cdsize; lcv++ )
    				{
    					// wrap cdrom ptr
    					if( cdr.pTransfer == cdwrap_ptr ) {
    						switch (cdr.Mode & (MODE_SIZE_2340|MODE_SIZE_2328)) {
    							case MODE_SIZE_2328:
    							case MODE_SIZE_2048:
    								cdr.pTransfer = cdr.Transfer + 12;
    								break;
    
    							case MODE_SIZE_2340:
    								cdr.pTransfer = cdr.Transfer + 0;
    								break;
    						}
    					}
    
    
    					*(ptr+lcv) = *cdr.pTransfer;
    	
    					cdr.pTransfer++;
    				}
    

    On a side-note, it seems that
    - No controller
    - Digital joypad
    - (?) Mouse
    - Guncon
    - (?) Justifier
    - (?) Multitap
    - (?) Negcon

    When you request $43-4f, controller responds with usual ID + $00 + (no response = no RX_RDY + TX_RDY on)
    - controller timeout
    - seems more 'proper' fix than using 'fake ID' like $65 for Guncon $43 sio cmd
    Last edited: May 30, 2011
  16. shalma

    shalma Discontinued Emu Author

    Messages:
    1,192
    Likes Received:
    0
    If anyone else is interested in the Ape Escape (NTSC) Specter Land bug (for your own emu debugging), memcard attached
    - Use in-game save #2
    - Enter Specter Land
    - Head past fountain into big gate
    - Enter door
    - Cutscene plays or dies


    It should be pointed out that the above code method is -not- canon (maybe it is hw-correct, I'll just claim it isn't to be safe)
    - For whatever reason, it does work with pcsxr though ^^
  17. vingadorjr

    vingadorjr New Member

    Messages:
    1
    Likes Received:
    0
    Thanks!

    Many thanks for the developers that are still working in this fantastic emu. I would love to see some update in the DX Plugins, something like at least a nice vsync option, cause ive searched everywhere and cannot find one, not even Peters GPU... Its horrible to play any game and watch that line going from top to botton...

    I do think maybe you guys are overdoing some secondary things here... the compatibility are great already... but the GPU Plugins sux for this decade... I Would love to see some graphical improvments.

    Thank Shalma and guys!
  18. shalma

    shalma Discontinued Emu Author

    Messages:
    1,192
    Likes Received:
    0
    Thought I could close the book on ps1 development career (aside from maybe posting the Gamera 2000 issue + xa attenuation solution in the pcsx-r forum).


    Mega Man Legends 1 suffers from a noticeable system timing issue

    Use in-game save #1
    - Open door
    - Listen to TV reporter
    > Emus (see below) run dialogue speech too fast, not sync'ing up with the cutscene (really bad lip sync)
    > Listen for "city hall is doomed as.." + pause in reporter speech (grabbing news flash) + pause again later for more breaking news


    Temporary solutions:
    - ePSXe 170: run "-p -4"

    - pcsx-r: set bias 1 (psxcommon.h)
    > This also fixes Mortal Kombat Trilogy speech


    Or use this svn of 67260 to see what we're talking about (fixed)
    > This slows down the streaming speech and gets everything in sync
  19. cinfidel

    cinfidel New Member

    Messages:
    1
    Likes Received:
    0
    Hey I'm just an interested onlooker. I started emulating PSX a few days ago, just for kicks, and first I used ePSXe, but then switched to PCSX because even with compatibility fixes ePSXe had generally more slowdowns than PCSX, and then now I have been using PCSX-Reloaded. And now I have found this forum. Basically you guys seem to be some of the last legitimately active members still around, could you guys compare/contrast the different emulators for me? Just quickly, not to demand much. It just seems strange to me that there are so many different branches of everything.
  20. Madmab

    Madmab New Member

    Messages:
    8
    Likes Received:
    0
    Hi.. I've been playing around with the new GTE code (based off of the one imported from the wii version). The most noticeable fix is the invisible cars in Crash Team Racing. But are there other games with noticeable fixes, playability, improvements from the switch?

    Where is this "pcsx-r forum" you refer too?

    Thanks.

Share This Page