Skip to content

Commit

Permalink
Merge pull request #239 from SergioMartin86/master
Browse files Browse the repository at this point in the history
Adding compilation-time flag to disable all fixes for vanilla execution
  • Loading branch information
NagyD committed Apr 18, 2021
2 parents 8319e5c + 7d654bf commit c59177a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
4 changes: 4 additions & 0 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ The authors of this program may be contacted at https://forum.princed.org

// The mentioned tricks can be found here: https://www.popot.org/documentation.php?doc=Tricks

// A compilation-time option to disable all fixes. Useful for automated solving tools that require vanilla emulation.
#ifndef DISABLE_ALL_FIXES

// If a room is linked to itself on the left, the closing sounds of the gates in that room can't be heard.
#define FIX_GATE_SOUNDS

Expand Down Expand Up @@ -247,6 +250,7 @@ The authors of this program may be contacted at https://forum.princed.org
// Explanation: https://forum.princed.org/viewtopic.php?p=32701#p32701
#define FIX_CAPED_PRINCE_SLIDING_THROUGH_GATE

#endif // ifndef DISABLE_ALL_FIXES

// Debug features:

Expand Down
2 changes: 1 addition & 1 deletion src/seg006.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ int __pascal far find_room_of_tile() {
//find_room_of_tile();
goto again;
}
#ifdef FIX_CORNER_GRAB
#ifndef FIX_CORNER_GRAB
// if (tile_row < 0) was here originally
if (tile_row < 0) {
tile_row += 3;
Expand Down
1 change: 1 addition & 0 deletions src/seg007.c
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,7 @@ void __pascal far loose_shake(int arg_0) {
// Sounds 20,21,22: loose floor shaking
sound_id = prandom(2) + sound_20_loose_shake_1;
} while(sound_id == last_loose_sound);
prandom(2); // For vanilla pop compatibility, an RNG cycle is wasted here
if (sound_flags & sfDigi) {
last_loose_sound = sound_id;
// random sample rate (10500..11500)
Expand Down
2 changes: 1 addition & 1 deletion src/seg008.c
Original file line number Diff line number Diff line change
Expand Up @@ -1432,7 +1432,7 @@ void __pascal far draw_leveldoor() {

// seg008:1E0C
void __pascal far get_room_address(int room) {
if (room < 0 || room > 24) printf("Tried to access room %d, not in 0..24.\n", room);
//if (room < 0 || room > 24) printf("Tried to access room %d, not in 0..24.\n", room);
loaded_room = (word) room;
if (room) {
curr_room_tiles = &level.fg[(room-1)*30];
Expand Down
13 changes: 8 additions & 5 deletions src/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,16 @@ The authors of this program may be contacted at https://forum.princed.org
#define STB_VORBIS_HEADER_ONLY
#include "stb_vorbis.c"

#if !defined(_MSC_VER)
# include <SDL2/SDL.h>
# include <SDL2/SDL_image.h>
#else
//#if !defined(_MSC_VER)
//# include <SDL2/SDL.h>
//# include <SDL2/SDL_image.h>
//#else
// These headers for SDL seem to be the pkgconfig/meson standard as per the
// latest versions. If the old ones should be used, the ifdef must be used
// to compare versions.
# include <SDL.h>
# include <SDL_image.h>
#endif
//#endif

#if SDL_BYTEORDER != SDL_LIL_ENDIAN
#error This program is not (yet) prepared for big endian CPUs, please contact the author.
Expand Down

0 comments on commit c59177a

Please sign in to comment.