-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v0.78.0 | 2023/12/17 03:16 | Refactored a lot today. Now every .h fil…
…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
1 parent
aef9205
commit ff22b20
Showing
47 changed files
with
11,674 additions
and
5,834 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 */ |
Oops, something went wrong.