| 621 | // |
| 622 | |
| 623 | void GSLocalMemory::SaveBMP(const std::string& fn, u32 bp, u32 bw, u32 psm, int w, int h, int x, int y) |
| 624 | { |
| 625 | int pitch = w * 4; |
| 626 | int size = pitch * h; |
| 627 | void* bits = _aligned_malloc(size, VECTOR_ALIGNMENT); |
| 628 | |
| 629 | GIFRegTEX0 TEX0; |
| 630 | |
| 631 | TEX0.TBP0 = bp; |
| 632 | TEX0.TBW = bw; |
| 633 | TEX0.PSM = psm; |
| 634 | |
| 635 | readPixel rp = m_psm[psm].rp; |
| 636 | |
| 637 | u8* p = (u8*)bits; |
| 638 | |
| 639 | for (int j = 0; j < h; j++, p += pitch) |
| 640 | { |
| 641 | for (int i = 0; i < w; i++) |
| 642 | { |
| 643 | ((u32*)p)[i] = (this->*rp)(x + i, y + j, TEX0.TBP0, TEX0.TBW); |
| 644 | } |
| 645 | } |
| 646 | |
| 647 | GSPng::Save((IsDevBuild || GSConfig.SaveAlpha) ? GSPng::RGB_A_PNG : GSPng::RGB_PNG, fn, static_cast<u8*>(bits), w, h, pitch, GSConfig.PNGCompressionLevel, false); |
| 648 | |
| 649 | _aligned_free(bits); |
| 650 | } |
| 651 | |
| 652 | // GSOffset |
| 653 |
no test coverage detected