..:: PCSX2 Forums ::..

Full Version: PCSX2 - Widescreen Game Patches
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803
Um... Japanese players, you know, the people who own around a third of the game copies. A widescreen patch should be what it says it is, a widescreen patch, especially if they are officially included with the emulator.
(11-15-2015, 10:15 PM)K.F Wrote: [ -> ]Um... Japanese players, you know, the people who own around a third of the game copies. A widescreen patch should be what it says it is, a widescreen patch, especially if they are officially included with the emulator.

I brought this up before. And I agree. You can leave the code in but comment it out.
(11-15-2015, 10:15 PM)K.F Wrote: [ -> ]Um... Japanese players, you know, the people who own around a third of the game copies. A widescreen patch should be what it says it is, a widescreen patch, especially if they are officially included with the emulator.

I sometimes include useful cheats and codes because they're a pain to collect elsewhere.

I didn't realize Japanese players actually use PCSX2 and my archive. I never see any here.

But fine, I'll disable it by default.
Anyone interested in Stretch Panic pnaches Smile?


Background:
A little while ago, sergx12 created ISO HEX codes for this game and mentioned its field of views (FOVs) are stored in binary files. That put Stretch Panic in a weird situation, in that it became the only game in Devina's widescreen hacks archive that lacked a pnach variant.

I decided to give creating a pnach a shot. So I checked out the game. At first I tried comparing PCSX2 save states of the original ISO against a fully patched HEX-edited ISO in the hopes of finding an static X FOV address in live memory. No luck.

Then I created 9 copies of a vanilla ISO, applied one "part" of sergx12's HEX edits to each one and tried running them all. I was hoping to find a single, specific "part" that covers the whole game, look for its HEX representation in live memory and go from there. That didn't pan out.

I paid special attention to my 3rd hacked ISO - which makes the hub level (MUSIUM.BIN) widescreen. I reviewed changes in the before and after HEX patterns for it (from sergx12's ISO hacks). I compared non-widescreen and widescreen PCSX2 save states to seek out the before and after HEX patterns for my level in live memory. Then I setup a write breakpoint in PCSX2's debugger to see what writes to those addresses (I assumed the HEX patterns were data that gets interpreted by the game's ELF file). No luck. Then I accidently switched one of my breakpoints into an execute one and had an "ahah!" moment. It stopped at the execute breakpoint and MIPS instructions were showing in surrounding addresses within the debugger.

This irritated me a lot. If each of the game's 21 BIN files are like "distinct" mini ELF files that handle all of their game logic independently, it'd make for very long and complicated live memory-only hacks, full of E-type conditions. I looked around at the registers involved in the MIPS instructions sergx12's ISO hacks changed for my level, and sought out the store word (sw) instructions that store those registers' values into live memory addresses. This lead me to finding the "active" X FOV addresses for my level. Both contain positive and negative versions of the same float number. All playable levels seem to use the same FOV values, but store them at dynamic addresses (lame...).

Furthermore, the FOV values aren't the same for all situations. They're different during the in-game cutscenes (like the intro) compared to playable levels. So there was a need to create a MIPS injection hack to multiply the FOVs (whatever they happen to be) by 1.333333373 on-the-fly while the game is running. To do that, I'd need a good spot to insert a jump (j) instruction to run the MIPS injection hack. A spot that'll always be at the same address and run after the MIPS instructions in the BIN files. So it had to be somewhere in the game's main ELF file. In IDA Pro, I looked for j/jr/jal instructions in my level's BIN file and found a jal that pointed to the address of a function situated in the game's main ELF file. That function ran occasionally, but not at the right points in time (it ran before the BIN files).

So I tried something else. I set read breakpoints on the X FOV addresses in PCSX2, hoping that maybe a function in the game's main ELF is what reads the FOV addresses to render the graphics (as opposed to MIPS instructions in those stupid individual BIN files). Luckily, it was the game's main ELF that does it. So I was able to inject my ELF hacks' jump instruction at the point in time the game attempts to read X FOV values from live memory. That means that every time the game reads the FOV addresses, my hack will kick in and multiply what got read by 1.333333373 (or something else for Y FOVs). If the BIN files had been responsible for reading the FOV values they wrote earlier to render graphics, I would've been stuck in a horrible situation where the read instructions are at different addresses in each level. Since the read instructions are in the game's main ELF file, they'll always be at the exact same addresses at all times.

I came very close to making this post over the past week or so, but kept running into last-minute snags with the hacks. The first time around, while taking comparison screenshots I realized the hacks weren't working properly for in-game cutscenes. They panned out the viewport in all directions. So instead of becoming widescreen, the cutscenes just looked zoomed-out. I wasn't able to come up with a fix. As a result, that left me with hacks that messed up cutscenes but worked when playing... To address that, I reworked the hacks to skip the widescreen calculations if a cutscene is playing. On my next release attempt, I noticed full booting PCSX2 with the hacks enabled caused the game to crash due to a bug in PCSX2 (game pnaches getting injected into BIOS memory), so I added conditional E-type codes to prevent the hacks from taking effect until the game's ELF file has loaded.

TL;DR All of this game's levels are stored in BIN files, which are like "mini" ELFs. The BIN files write FOVs to dynamic addresses... but the game's "main" ELF reads them to render graphics. My ELF hacks intercept the reads to manipulate the FOVs. Cutscenes are a no-go.


Pnaches:
Changelog (compared to sergx12's ISO HEX codes):
  • Created pnach widescreen patches, via ELF hacks.
  • Ported the hacks to other regions' versions of the game:
    • Freak Out (PAL)
    • Hippa Linda (NTSC-J)
  • Added two 16:10 modes:
    • 16:10 (Normal) - Uses a wider X field of view (FOV) than 4:3, but isn't as wide as 16:9.
    • 16:10 (Ultra) - Uses the same X FOV as 16:9, with a taller Y FOV to account for 16:10's increased height.

What's missing (sorry - forgot to include this in my last few release posts):
  • Company logos (FMVs?) need to be thinned-out.
  • In-game cutscenes (like the intro) need FOV hacks. Might look strange though since it's really obvious they were designed with a 4:3 aspect ratio in mind.
  • HUDs need to be thinned-out and repositioned to the far left/right edges of the screen.
  • 2D text needs to be thinned-out.

Note:
  • To enable one of the 16:10 hacks, comment-out the 16:9 hack and uncomment your desired 16:10 one.

Other:
  • @monsterjamp I'll try to follow up on post #4.642 at some point.
  • @Devina I'll also follow-up if I notice any other requested games or WIP/incomplete hacks missing from the widescreen archive post.

Screenshot descriptions:
  1. 4:3
  2. 16:10 (normal)
  3. 16:9
  4. 16:10 (ultra)
Wow, that sounds like a big pain in the ass. Glad you got it working. Smile Thank you.

Can anyone check out Gitaroo Man (NTSC-U)?
There's a widescreen patch in the archive, but it makes the HUD non-centered to the left. Could be improved.

It'd be nice if everyone could help chip in with attempting the requests, some of them have been on there for a long time.

Some of this thread's best widescreen patchers seem to have left or are busy.

I'm also surprised Magic Pengel hasn't been done yet. Seems tricky.
(11-17-2015, 02:46 PM)Devina Wrote: [ -> ]It'd be nice if everyone could help chip in with attempting the requests, some of them have been on there for a long time.
There's a reason for that, at least for the games I've tried. And most of the requests are for NTSC games, which I don't own, and I don't own any of the PAL requested games.
(11-17-2015, 04:38 PM)FlatOut Wrote: [ -> ]There's a reason for that, at least for the games I've tried. And most of the requests are for NTSC games, which I don't own, and I don't own any of  the PAL requested games.

I, myself, don't mind if people temporarily download .isos, make a widescreen patch for them, and delete the .iso right after.

I don't think it's ethically or morally wrong if you do it for this sole purpose, as long as you don't encourage it.

I'm just speaking for myself, however, not the forum, so whether you do this is up to you.
Yes I will say that we as the forum can't condone that. I personally agree with what you said, but it's one of those things where I have to follow(and in my case enforce) rules that I don't always agree with. For the greater good.

What you do is your business, but obviously if it becomes obvious that sort of thing is happening then there will be a warning.

(I'm not here to be a *****, I just wanted to clarify the forum's position)
^ Pretty much.

If you do decide to do it, don't admit it on the forum. This goes for everyone here.

Evidently, there are tons and tons of people on this forum, and even in this thread, who pirate games, but at the end of the day, it's your decision and we can not publicly condone piracy.

However, by saying "I don't own any NTSC-U games and I don't own any of the PAL requested games.", you just kinda back yourself in a corner because if you suddenly do fulfill a request for any of the games on the (current) request list, then we'll know you pirated it.

Just keep this in mind for the future.
(11-17-2015, 07:11 PM)Devina Wrote: [ -> ]However, by saying "I don't own any NTSC-U games and I don't own any of the PAL requested games.", you just kinda back yourself in a corner because if you suddenly do make a request for any of the games on the (current) request list, then we'll know you pirated it.

No we won't. He could have bought a used copy of the game. People still do that.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803