Giter Site home page Giter Site logo

sonicport's Introduction

SoniCPort

Sonic the Hedgehog (1991, Sega Genesis / MegaDrive) C Port

Dependencies

  • SDL2 (if BACKEND is set to SDL2)
  • pkg-config (for builds that require static-linkage)

Building

This project uses CMake, allowing it to be built with a range of compilers.

Switch to the terminal and cd into this folder.

After that, generate the files for your build system with:

cmake -B build -DCMAKE_BUILD_TYPE=Release

MSYS2 users should append -G"MSYS Makefiles" -DPKG_CONFIG_STATIC_LIBS=ON to this command, also.

You can also add the following flags:

Name Function
-DBACKEND=SDL2 Use the SDL2 backend (default)
-DREV01=ON Compile a REV01 ROM
-DJAPANESE=ON Compile a Japanese ROM
-DFIX_BUGS=ON Fix bugs that are blatant screw-ups that may harm performance (not gameplay bugs)
-DLTO=ON Enable link-time optimisation
-DMSVC_LINK_STATIC_RUNTIME=ON Link the static MSVC runtime library, to reduce the number of required DLL files (Visual Studio only)

You can pass your own compiler flags with -DCMAKE_C_FLAGS and -DCMAKE_CXX_FLAGS.

You can then compile the executable with this command:

cmake --build build --config Release

Disclaimer

This project is not endorsed by SEGA or Sonic Team.

Credits

Sonic Team - Original game

Sonic Retro - Sonic 1 Github Disassembly

Clownacy - Additional porting (compression algorithms)

sonicport's People

Contributors

clownacy avatar cuckydev avatar deathegg avatar geffdev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

sonicport's Issues

Screen Scale temporary variable?

I see you plan to make the screen size a variable, and maybe support screen resizing:

#define SCREEN_SCALE 2 //TODO: make screen scale a variable

In the meantime, how would you feel about declaring SCREEN_SCALE as an extern in Constants.h, setting it to 2 by default in the renderer implementation file, and putting something simple like this in main (at least until more things need to be added):

	if (argc >= 2) 
        {
		int scale = atoi(argv[1]);
		SCREEN_SCALE = (scale > 1) ? scale : 2;
	}

I tried it and it seems to work with no problem.

Reaching level 2

Really great project ! is there some hope to see more levels running ? the first level is stucked here ๐Ÿ‘

image

cannot find -lSDL2-static (or i just need help compiling)

image
top: mingw64 - bottom: ubuntu 20.04 wsl

before this i got errors relating to ./src/Backend/SDL2 not importing SDL.h properly (i got past that by changing them to SDL2/SDL.h)
i've tried resolving this issue by installing SDL2 in any other way i can and can't get this fixed at all

Corrupted graphics, misplaced objects

I'm using Visual Studio 2019, SDL2-2.0.14 (https://www.libsdl.org/release/SDL2-devel-2.0.14-VC.zip), and I have commit 5650a16 checked out.

I run the following command to build the solution:
cmake -B build -DCMAKE_BUILD_TYPE=Release -DBACKEND=SDL2 -DMSVC_LINK_STATIC_RUNTIME=ON -DSDL2_DIR=[path]\SDL2-2.0.14

I then open the .sln file in VS2019, build (x64, Debug or Release made no difference) and run. The graphics are corrupted as shown.

In the third screenshot, Sonic is standing on solid terrain. The bridge next to him works if he stands on it, but it's not over a gap as intended.

Gfx corruption 1
Gfx corruption 2
Gfx corruption 3
Gfx corruption 4

Errors when compiling the executable with on Chromebook

I was trying to compile the executable (I had generated the build files already) and got these messages, causing it to abort (I use the Chromebook Crostini Linux and had all the dependencies installed)

image

tg20@penguin:~/SoniCPort$ cmake --build build --config Release
[ 3%] Built target bin2h
[ 3%] Building C object CMakeFiles/SoniCPort.dir/src/Object/HUD.c.o
/home/tg20/SoniCPort/src/Object/HUD.c: In function โ€˜Obj_HUDโ€™:
/home/tg20/SoniCPort/src/Object/HUD.c:52:5: error: a label can only be part of a statement and a declaration is not a statement
52 | uint8_t frame = 0;
| ^~~~~~~
gmake[2]: *** [CMakeFiles/SoniCPort.dir/build.make:2000: CMakeFiles/SoniCPort.dir/src/Object/HUD.c.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:124: CMakeFiles/SoniCPort.dir/all] Error 2
gmake: *** [Makefile:103: all] Error 2

Is there something I'm missing or is it supposed to do that?

GHZ1 Demo desyncs

Green Hill Zone Act 1 demo appears to desync. About halfway through the demo, Sonic hits a Buzz Bomber that he doesn't in the original, and I haven't done any extensive testing to see where exactly the issue is.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.