Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
savaughn committed Sep 22, 2023
0 parents commit 38640bd
Show file tree
Hide file tree
Showing 232 changed files with 18,773 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
*.dSYM
*.sav
*.gb
*.gbc
*.gba

// ignore binaries
*.exe
*.out
*.dll
*.so
20 changes: 20 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"configurations": [
{
"name": "Mac",
"includePath": [
"${workspaceFolder}/**",
"${workspaceFolder}/libpksav/include"
],
"defines": [],
"macFrameworkPath": [
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks"
],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "macos-gcc-arm"
}
],
"version": 4
}
34 changes: 34 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: gcc build active file",
"command": "/usr/bin/gcc",
"args": [
"-fdiagnostics-color=always",
"-g",
"${file}",
"-o",
"${fileDirname}/pokeromtrader.out",
"-I",
"../libpksav/include",
"-L",
"../libpksav/lib",
"-l",
"pksav",
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "Task generated by Debugger."
}
],
"version": "2.0.0"
}
87 changes: 87 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Define compiler and flags
CC = gcc
CFLAGS = -Ilibpksav/include -Llibpksav/lib -lpksav

# Define source file and executable name
SOURCE = src/main.c
EXECUTABLE = src/pokeromtrader.out
BUILD_DIR = build/macos

# Define App Properties
APP_NAME = PokeromTrader
APP_VERSION = 0.1.0
APP_BUNDLE_ID = com.yourcompany.pokeromtrader
APP_BUNDLE_NAME = PokeromTrader
APP_BUNDLE_EXECUTABLE = pokeromtrader

# Define macOS bundle directory
MACOS_BUNDLE = PokeromTrader.app
MACOS_DESTINATION = $(BUILD_DIR)/$(MACOS_BUNDLE)/Contents/MacOS
# Define macOS bundle directory
INFO_PLIST = $(BUILD_DIR)/$(MACOS_BUNDLE)/Contents/Info.plist

# Define mGBA path and save file
SAVES_DIR = $(realpath saves)
SAVE_FILE = crystal2.gbc.sav
ROM_PATH = $(realpath rom)
ROM_FILE = pk-perfectcrystal.gbc


.PHONY: all run launch clean

all: $(EXECUTABLE)

$(EXECUTABLE): $(SOURCE)
@$(CC) $(SOURCE) -o $(EXECUTABLE) $(CFLAGS)

run: $(EXECUTABLE)
@cd src && ./pokeromtrader.out && cd ..

launch: all run

clean-exe:
@rm -f $(EXECUTABLE)

# Clean build folder
clean-build:
@rm -rf build

## clean all
clean: clean-exe clean-build

bundle: all
@# Create the build directory if it doesn't exist
@mkdir -p "$(BUILD_DIR)"

@# Create the directory structure
@mkdir -p "$(MACOS_DESTINATION)"
@mkdir -p "$(MACOS_BUNDLE)/Contents/Resources"

@# Copy the executable to the .app bundle
@cp "$(EXECUTABLE)" "$(MACOS_DESTINATION)/$(APP_BUNDLE_EXECUTABLE)"

@# Create Info.plist file
@echo '<?xml version="1.0" encoding="UTF-8"?>' > "$(INFO_PLIST)"
@echo '<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">' >> "$(INFO_PLIST)"
@echo '<plist version="1.0">' >> "$(INFO_PLIST)"
@echo '<dict>' >> "$(INFO_PLIST)"
@echo ' <key>CFBundleExecutable</key>' >> "$(INFO_PLIST)"
@echo ' <string>$(APP_BUNDLE_EXECUTABLE)</string>' >> "$(INFO_PLIST)"
@echo ' <key>CFBundleIdentifier</key>' >> "$(INFO_PLIST)"
@echo ' <string>$(APP_BUNDLE_ID)</string>' >> "$(INFO_PLIST)"
@echo ' <key>CFBundleName</key>' >> "$(INFO_PLIST)"
@echo ' <string>$(APP_BUNDLE_NAME)</string>' >> "$(INFO_PLIST)"
@echo '</dict>' >> "$(INFO_PLIST)"
@echo '</plist>' >> "$(INFO_PLIST)"

@# Make the executable executable
@chmod +x "$(MACOS_DESTINATION)/$(APP_BUNDLE_EXECUTABLE)"

@echo "$(MACOS_BUNDLE) bundle created"

.DEFAULT:
@echo "Nothing to do. Please specify a target (e.g., 'make run')."

mgba:
@mgba "$(ROM_PATH)/$(ROM_FILE)"

16 changes: 16 additions & 0 deletions libpksav/include/CMakeFiles/CMakeDirectoryInformation.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.27

# Relative path conversion top directories.
set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/Users/spencer/Projects/pksav")
set(CMAKE_RELATIVE_PATH_TOP_BINARY "/Users/spencer/Projects/pksav")

# Force unix paths in dependencies.
set(CMAKE_FORCE_UNIX_PATHS 1)


# The C and CXX include file regular expressions for this directory.
set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$")
set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$")
set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN})
set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN})
1 change: 1 addition & 0 deletions libpksav/include/CMakeFiles/progress.marks
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
16 changes: 16 additions & 0 deletions libpksav/include/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#
# Copyright (c) 2016 Nicholas Corgan ([email protected])
#
# Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt
# or copy at http://opensource.org/licenses/MIT)
#

IF(NOT PKSAV_DONT_INSTALL_HEADERS)
INSTALL(
FILES pksav.h
DESTINATION ${INCLUDE_DIR}
COMPONENT Headers
)
ENDIF(NOT PKSAV_DONT_INSTALL_HEADERS)

ADD_SUBDIRECTORY(pksav)
200 changes: 200 additions & 0 deletions libpksav/include/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.27

# Default target executed when no arguments are given to make.
default_target: all
.PHONY : default_target

# Allow only one "make -f Makefile2" at a time, but pass parallelism.
.NOTPARALLEL:

#=============================================================================
# Special targets provided by cmake.

# Disable implicit rules so canonical targets will work.
.SUFFIXES:

# Disable VCS-based implicit rules.
% : %,v

# Disable VCS-based implicit rules.
% : RCS/%

# Disable VCS-based implicit rules.
% : RCS/%,v

# Disable VCS-based implicit rules.
% : SCCS/s.%

# Disable VCS-based implicit rules.
% : s.%

.SUFFIXES: .hpux_make_needs_suffix_list

# Command-line flag to silence nested $(MAKE).
$(VERBOSE)MAKESILENT = -s

#Suppress display of executed commands.
$(VERBOSE).SILENT:

# A target that is always out of date.
cmake_force:
.PHONY : cmake_force

#=============================================================================
# Set environment variables for the build.

# The shell in which to execute make rules.
SHELL = /bin/sh

# The CMake executable.
CMAKE_COMMAND = /opt/homebrew/Cellar/cmake/3.27.4/bin/cmake

# The command to remove a file.
RM = /opt/homebrew/Cellar/cmake/3.27.4/bin/cmake -E rm -f

# Escaping for special characters.
EQUALS = =

# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /Users/spencer/Projects/pksav

# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /Users/spencer/Projects/pksav

#=============================================================================
# Targets provided globally by CMake.

# Special rule for the target test
test:
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Running tests..."
/opt/homebrew/Cellar/cmake/3.27.4/bin/ctest --force-new-ctest-process $(ARGS)
.PHONY : test

# Special rule for the target test
test/fast: test
.PHONY : test/fast

# Special rule for the target edit_cache
edit_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Running CMake cache editor..."
/opt/homebrew/Cellar/cmake/3.27.4/bin/ccmake -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : edit_cache

# Special rule for the target edit_cache
edit_cache/fast: edit_cache
.PHONY : edit_cache/fast

# Special rule for the target rebuild_cache
rebuild_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Running CMake to regenerate build system..."
/opt/homebrew/Cellar/cmake/3.27.4/bin/cmake --regenerate-during-build -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : rebuild_cache

# Special rule for the target rebuild_cache
rebuild_cache/fast: rebuild_cache
.PHONY : rebuild_cache/fast

# Special rule for the target list_install_components
list_install_components:
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Available install components are: \"Headers\" \"Libraries\" \"Unspecified\" \"doxygen\""
.PHONY : list_install_components

# Special rule for the target list_install_components
list_install_components/fast: list_install_components
.PHONY : list_install_components/fast

# Special rule for the target install
install: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Install the project..."
/opt/homebrew/Cellar/cmake/3.27.4/bin/cmake -P cmake_install.cmake
.PHONY : install

# Special rule for the target install
install/fast: preinstall/fast
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Install the project..."
/opt/homebrew/Cellar/cmake/3.27.4/bin/cmake -P cmake_install.cmake
.PHONY : install/fast

# Special rule for the target install/local
install/local: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Installing only the local directory..."
/opt/homebrew/Cellar/cmake/3.27.4/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
.PHONY : install/local

# Special rule for the target install/local
install/local/fast: preinstall/fast
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Installing only the local directory..."
/opt/homebrew/Cellar/cmake/3.27.4/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
.PHONY : install/local/fast

# Special rule for the target install/strip
install/strip: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Installing the project stripped..."
/opt/homebrew/Cellar/cmake/3.27.4/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
.PHONY : install/strip

# Special rule for the target install/strip
install/strip/fast: preinstall/fast
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Installing the project stripped..."
/opt/homebrew/Cellar/cmake/3.27.4/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
.PHONY : install/strip/fast

# The main all target
all: cmake_check_build_system
cd /Users/spencer/Projects/pksav && $(CMAKE_COMMAND) -E cmake_progress_start /Users/spencer/Projects/pksav/CMakeFiles /Users/spencer/Projects/pksav/include//CMakeFiles/progress.marks
cd /Users/spencer/Projects/pksav && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 include/all
$(CMAKE_COMMAND) -E cmake_progress_start /Users/spencer/Projects/pksav/CMakeFiles 0
.PHONY : all

# The main clean target
clean:
cd /Users/spencer/Projects/pksav && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 include/clean
.PHONY : clean

# The main clean target
clean/fast: clean
.PHONY : clean/fast

# Prepare targets for installation.
preinstall: all
cd /Users/spencer/Projects/pksav && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 include/preinstall
.PHONY : preinstall

# Prepare targets for installation.
preinstall/fast:
cd /Users/spencer/Projects/pksav && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 include/preinstall
.PHONY : preinstall/fast

# clear depends
depend:
cd /Users/spencer/Projects/pksav && $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
.PHONY : depend

# Help Target
help:
@echo "The following are some of the valid targets for this Makefile:"
@echo "... all (the default if no target is provided)"
@echo "... clean"
@echo "... depend"
@echo "... edit_cache"
@echo "... install"
@echo "... install/local"
@echo "... install/strip"
@echo "... list_install_components"
@echo "... rebuild_cache"
@echo "... test"
.PHONY : help



#=============================================================================
# Special targets to cleanup operation of make.

# Special rule to run CMake to check the build system integrity.
# No rule that depends on this can have commands that come from listfiles
# because they might be regenerated.
cmake_check_build_system:
cd /Users/spencer/Projects/pksav && $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
.PHONY : cmake_check_build_system

Loading

0 comments on commit 38640bd

Please sign in to comment.