Skip to content

Commit

Permalink
v0.78.0 | 2023/12/17 03:16 | Refactored a lot today. Now every .h fil…
Browse files Browse the repository at this point in the history
…e has a .c file, so hopefully the code can be a bit more maintainable. Additionally, the code now compiles to both the Ti84CE and Windows by uncommenting the desired platform. ''Endless-Super-Sweeper'' was a new game-mode I had thought of where new lines of mines will emerge from one end of the screen, and will explode at the other end if they are not flagged in time.
  • Loading branch information
ZERICO2005 committed Dec 17, 2023
1 parent aef9205 commit ff22b20
Show file tree
Hide file tree
Showing 47 changed files with 11,674 additions and 5,834 deletions.
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ set(INCLUDE_PATH "${TOOLCHAIN_PATH}/include")
set(LIB_PATH "${TOOLCHAIN_PATH}/lib")

set(SRC_DIR "./src")
set(SRC_LCD_DIR "./src-lcd")

set(PROJECT_NAME "Super-Sweeper-Windows")
set(PROJECT_NAME "Endless-Super-Sweeper")
project(${PROJECT_NAME})

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "./bin")
Expand All @@ -23,10 +24,11 @@ set(CMAKE_CXX_STANDARD 17)
# Packages
find_package(SDL2 REQUIRED)

file(GLOB SRC_FILES "${SRC_DIR}/*.c")
file(GLOB SRC_FILES "${SRC_DIR}/*.c" "${SRC_LCD_DIR}/*.c")
# Create an executable
add_executable(${PROJECT_NAME} ${SRC_FILES})

target_include_directories(${PROJECT_NAME} PUBLIC ${SRC_LCD_DIR})
# Compiler Flags Debug(-g -O0) Release(-O3)
set(OPT_FLAG -O3)
target_compile_options(${PROJECT_NAME} PUBLIC ${OPT_FLAG} -Wall)
Expand Down
10 changes: 7 additions & 3 deletions README.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Super-Sweeper Windows Edition v0.77.1
zerico2005 | 2023/12/01
Super-Sweeper Windows Edition v0.78.0
zerico2005 | 2023/12/16

Super-Sweeper Windows Edition is a port of Super-Sweeper for the Ti84CE.

Super-Sweeper v0.77.0 was ported to Windows on June 3rd 2023. Super-Sweeper v0.77.1 has most of the source code unchanged apart from some formating and a minor bug fix. The source code is not too great because I coded Super Sweeper before I knew how to have multiple C files in a program. Otherwise the source code is under an MIT license.
Super-Sweeper v0.77.0 was ported to Windows on June 3rd 2023. Super-Sweeper v0.77.1 has most of the source code unchanged apart from some formating and a minor bug fix. The source code is not too great because I coded Super Sweeper before I knew how to have multiple C files in a program. Super-Sweeper v0.77.2 onwards will introduce new and improved code as I have gotten better at C/C++ overtime.

Also included are the programs I used to generate the menus and videos.

Expand All @@ -22,6 +22,10 @@ Attributions:
- The 6x8 pixel font used in the program is a slightly modified version of the "even" font created by Christian Munk (CMunk), which can be found at https://fontstruct.com/fontstructions/show/275268/even_2. The "even" font is lincesed under Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0). Original License URL: https://creativecommons.org/licenses/by-sa/3.0/

Compiliation Setup used:
Windows Version:
- Windows 10 64bit x86
- MSYS2 MinGW64
- GCC CMake Ninja
Ti84CE Version:
- CE Programming Toolchain: https://github.com/CE-Programming/toolchain/releases
- CEmu for Ti84CE emulation: https://ce-programming.github.io/CEmu/
File renamed without changes.
Binary file modified icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# ----------------------------
# Makefile Options
# ----------------------------

NAME = MINESWEP
ICON = icon.png
DESCRIPTION = "Endless-Super-Sweeper"
COMPRESSED = NO

CFLAGS = -Wall -Wextra -Oz
CXXFLAGS = -Wall -Wextra -Oz

# ----------------------------

include $(shell cedev-config --makefile)
File renamed without changes.
31 changes: 31 additions & 0 deletions src-lcd/x86_Common_Def.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
** Author: zerico2005 (2023)
** Project: Endless-Super-Sweeper
** License: MIT License
** A copy of the MIT License should be included with
** this project. If not, see https://opensource.org/license/MIT
*/

#include "x86_Common_Def.h"

fp64 getDecimalTime() {
struct timespec tp;
if (clock_gettime(CLOCK_REALTIME, &tp) == 0) {
uint64_t nanoTime = tp.tv_sec * 1000000000 + tp.tv_nsec;
return (fp64)nanoTime / 1.0e9;
} else {
perror("clock_gettime");
return 0.0;
}
}

int64_t getNanoTime() {
struct timespec tp;
if (clock_gettime(CLOCK_REALTIME, &tp) == 0) {
int64_t nanoTime = tp.tv_sec * 1000000000 + tp.tv_nsec;
return nanoTime;
} else {
perror("clock_gettime");
return 0;
}
}
67 changes: 67 additions & 0 deletions src-lcd/x86_Common_Def.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
** Author: zerico2005 (2023)
** Project: Endless-Super-Sweeper
** License: MIT License
** A copy of the MIT License should be included with
** this project. If not, see https://opensource.org/license/MIT
*/

#ifndef X86_COMMON_DEF_H
#define X86_COMMON_DEF_H

#include <stdint.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>

#include <stdio.h>
#include <stdbool.h>
#include <time.h>


typedef uint32_t uint24_t;
typedef int32_t int24_t;
typedef uint32_t u24;
typedef int32_t i24;

typedef uint8_t u8;
typedef uint16_t u16;
typedef uint32_t u32;
typedef uint64_t u64;
typedef int8_t i8;
typedef int16_t i16;
typedef int32_t i32;
typedef int64_t i64;

typedef float fp32;
typedef double fp64;

/* Constants */

#define PI 3.1415926535897932384626433832795
#define TAU 6.2831853071795864769252867665590
#define EULER 2.7182818284590452353602874713527

/* Functions */

#define ARRAY_LENGTH(x) (sizeof(x) / sizeof(x[0]))
#define FREE(x) free(x); x = NULL

// Left Circular Shift
#define ROL(n,b) (((n) << (b)) | ((n) >> ((sizeof(n) * 8) - (b))))
// Right Circular Shift
#define ROR(n,b) (((n) >> (b)) | ((n) << ((sizeof(n) * 8) - (b))))

#define valueLimit(value,minimum,maximum) { if ((value) < (minimum)) { (value) = (minimum); } else if ((value) > (maximum)) { (value) = (maximum); } }
#define valueMinimum(value,minimum) { if ((value) < (minimum)) { (value) = (minimum); } }
#define valueMaximum(value,maximum) { if ((value) > (maximum)) { (value) = (maximum); } }

#define linearInterpolation(x,x0,x1,y0,y1) ( (y0) + ( (((y1) - (y0)) * ((x) - (x0))) / ((x1) - (x0)) ) )
#define linearInterpolationClamp(x,x0,x1,y0,y1) ( ((x) <= (x0)) ? (y0) : ( ((x) >= (x1)) ? (y1) : linearInterpolation((x),(x0),(x1),(y0),(y1)) ) )

/* Time */

int64_t getNanoTime();
fp64 getDecimalTime();

#endif /* X86_COMMON_DEF_H */
Loading

0 comments on commit ff22b20

Please sign in to comment.