ps2dev / gsKit

gsKit is a C interface to the PS2 Graphics Synthesizer
Other
103 stars 27 forks source link

Fixed gsKit #3

Closed AKuHAK closed 8 years ago

AKuHAK commented 8 years ago

Various fixes:

Maybe someone knows how to fix this warning: gsFontM.c: In function 'gsKit_fontm_print_scaled': gsFontM.c:510:34: warning: operation on 'gsFontM->VramIdx' may be undefined [-Wsequence-point] gsFontM->VramIdx = (++gsFontM->VramIdx) % GS_FONTM_PAGE_COUNT; ^

I tested all samples. All samples works fine except for font sample which crashes with "not enough VRAM" error. LIBPNG and LIBTIFF samples also are fine. LIBJPEG sample crashes.

Everything was tested in both: new and old toolchains (don't forget for -mnostartfiles option).

AKuHAK commented 8 years ago

gsFontM.c: In function 'gsKit_fontm_print_scaled': gsFontM.c:510:34: warning: operation on 'gsFontM->VramIdx' may be undefined [-Wsequence-point] gsFontM->VramIdx = (++gsFontM->VramIdx) % GS_FONTM_PAGE_COUNT; ^

uyjulian commented 8 years ago
gsFontM->VramIdx = gsFontM->VramIdx + 1;
gsFontM->VramIdx = gsFontM->VramIdx % GS_FONTM_PAGE_COUNT;

?

sp193 commented 8 years ago

gsFontM->VramIdx = (gsFontM->VramIdx + 1) % GS_FONTM_PAGE_COUNT; @AKuHAK, did any of the new problems that you mentioned in the STATUS file happen with the old toolchain? If not, then I think that further changes have to be made first, but I'll do that for you when I manually pull+merge your pull request. What happens to VSYNC when you use PS2GDB?

AKuHAK2 commented 8 years ago

@sp193 Yes all the problems that I mention was in old toolchain too. It even more I fixed some of them but not all, so my pull request is safe for merging. Yes this problem when you enable -DGSKIT_DEBUG was in old gsKit and toolchain too. The problem with libjpeg library also was presented cause there was bug in old gsKit that ignore HAVE_LIBJPEG at all. And all these samples that were not working still are not working.

As about VSYNC problem - this is the only problem that maybe appears in new toolchain - but maybe it is not real problem cause this is the only bug that I tested on emulator not at real ps2. VSYNC sample with enabled debug output produces "epilepsy" screen. Square have to move much slower that it happens while sample is running. But anyway this problem is with old gsKit too, so it maybe something in new toolchain or maybe pcsx2 vsync emulation isn't proper - I will test it at real hardware and then publish info. But anyway my pull request is safe if you are worry about it. Everything that was working - is working the same way after update

sp193 commented 8 years ago

Thanks. I was really just busy with math tests, although it is true that I would like to know what I approve. ;) I was originally thinking of manually committing your stuff with the additional fix that you requested, but I noticed that you wrote that there are still more warnings to fix (so it can wait). I was also thinking about whether LIBJPEG support has a problem - given that uLaunchELF uses JPEG support (does this mean that uLaunchELF doesn't use the gsToolkit JPEG support?). Anyway, that's another matter to solve.