libretro / prosystem-libretro

Port of ProSystem to the libretro API.
GNU General Public License v2.0
13 stars 39 forks source link

Fix savestates and music for "Rikki & Vikki" #72

Closed tachimarten closed 1 year ago

tachimarten commented 1 year ago

This pull request builds upon #71 in these two ways:

lgtm-com[bot] commented 1 year ago

This pull request fixes 2 alerts when merging f141b4192f98ac2b8ddd4923f85caaf8c6a441f4 into 1c235e7308768bfc5c6a018f5990d976072dce19 - view on LGTM.com

fixed alerts:

tachimarten commented 1 year ago

I found one other bug; let me fix before merging.

tachimarten commented 1 year ago

OK, this should work now. Should be ready to merge.

lgtm-com[bot] commented 1 year ago

This pull request fixes 2 alerts when merging c176a8cc9114a21b0416ff44cfb61812e03865bd into 1c235e7308768bfc5c6a018f5990d976072dce19 - view on LGTM.com

fixed alerts:

lgtm-com[bot] commented 1 year ago

This pull request fixes 2 alerts when merging 3439d3784bf28546ccfd04eaeb41b4f86f634644 into 1c235e7308768bfc5c6a018f5990d976072dce19 - view on LGTM.com

fixed alerts:

LibretroAdmin commented 1 year ago

Hi @tachimarten ,

is it possible for you to fix this warning?

core/../bupboop/coretone/music.c: In function 'ct_instr_setup': core/../bupboop/coretone/music.c:67:15: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] 67 | uiY = (uint32_t)pInstrPak; | ^ core/../bupboop/coretone/sample.c: In function 'ct_sample_setup': core/../bupboop/coretone/sample.c:133:15: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] 133 | uiY = (uint32_t)pSamplePak; | ^

LibretroAdmin commented 1 year ago

Some other warnings here which would be nice to fix -

core/../bupboop/coretone/channel.c: In function 'ct_channel_render': core/../bupboop/coretone/channel.c:53:9: warning: enumeration value 'eCHANNEL_MODE_OFF' not handled in switch [-Wswitch] 53 | switch(pChannel->eMode) | ^~ core/../bupboop/coretone/channel.c:53:9: warning: enumeration value 'eCHANNEL_MODE_FOOTER' not handled in switch [-Wswitch]

LibretroAdmin commented 1 year ago

Another issue I found but which I will be fixing myself - don't do for loop initial declarations. This breaks C89 builds, and some of our platforms depend on it. Always declare variables either at the start of a function or the start of a code block.

LibretroAdmin commented 1 year ago

Also, please do not use stdbool.h in the future. This kills off backwards compatibility. If you absolutely have to use the bool type, use the libretro-common provided header file boolean.h instead.

LibretroAdmin commented 1 year ago

There were numerous variables that were not declared either at the start of a code block or function, breaking C89 builds. Next time try compiling with -std=c89 (preferably add pedantic to it) so that you can catch some of these issues.