Skip to content

Commit

Permalink
idk wather
Browse files Browse the repository at this point in the history
  • Loading branch information
user95401 committed Apr 11, 2024
1 parent 2f146dd commit 1b2b696
Show file tree
Hide file tree
Showing 59 changed files with 80,626 additions and 8,450 deletions.
14 changes: 11 additions & 3 deletions _Src/_controllers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ void UpdatePagesSetup() {
WriteProcMem(addr, { 0xBE, toRewrite[0], toRewrite[1], toRewrite[2], toRewrite[3] });
}
#else
//0x3ebda2
WriteProcMem(geode::base::get() + 0x3ebda2, { 0xBE, toRewrite[0], toRewrite[1], toRewrite[2], toRewrite[3] });
//0x3ebda2 (v2.2.1.3-armeabi-v7a)
//WriteProcMem(geode::base::get() + 0x3ebda2, { 0xBE, toRewrite[0], toRewrite[1], toRewrite[2], toRewrite[3] });
#endif
}

Expand All @@ -109,7 +109,7 @@ class $modify(PlayLayer) {

#include <Geode/modify/LoadingLayer.hpp>
class $modify(LoadingLayer) {
TodoReturn loadingFinished() {
void loadingFinished() {
//create some inis
LevelSelectLayer::create(0);
for (int levelID = 0; levelID < 127; levelID++) {
Expand All @@ -136,6 +136,14 @@ class $modify(LevelSelectLayer) {
bool init(int p0) {
UpdatePagesSetup();
auto rtn = LevelSelectLayer::init(p0);
BoomScrollLayer* ohfuck = MEMBERBYOFFSET(BoomScrollLayer*, this, 336);
#ifndef GEODE_IS_WINDOWS
ohfuck = MEMBERBYOFFSET(BoomScrollLayer*, this, 84);//84 armeabi-v7a
#endif
ohfuck->setRotation(3.f);
#ifndef GEODE_IS_WINDOWS
//todo: controll this shit on android
#endif
return rtn;
};
ccColor3B colorForPage(int page) {
Expand Down
37 changes: 36 additions & 1 deletion _Src/_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,23 @@ class MainLevelsEditorLayer : public CCLayer {
});
if (!asd) pop->onBtn2(asd);
}
void editorCopyLevel(CCObject* asd) {
auto saveTar = dynamic_cast<InputNode*>(this->getChildByIDRecursive("saveTar"));
FLAlertLayer* pop;
pop = geode::createQuickPopup(
"Copy Level",
"Copy this level into main level?\nsettings, data, audio file will be saved"
"\n" + fmt::format("Tar: {}", saveTar->getString()),
"Abort", "Copy!",
460.f,
[this, saveTar](void*, bool a) {
if (!a) return;
FLAlertLayer* pop = geode::createQuickPopup("Finish info", "asd", "OK", nullptr, 460.f, nullptr, 0);
pop->m_noElasticity = 1;
pop->show();
}
);
}
void editorEditLevel(CCObject* asd) {
auto pop = geode::createQuickPopup(
"Main Level Editor Notice",
Expand Down Expand Up @@ -284,6 +301,23 @@ class MainLevelsEditorLayer : public CCLayer {
editLevel->setPositionY(-10.f);
container->addChild(editLevel);
}
CCMenuItemSpriteExtra* copyLevel;
{
auto hi = CCSprite::createWithSpriteFrameName("GJ_copyStateBtn_001.png");
copyLevel = CCMenuItemSpriteExtra::create(hi, me, menu_selector(MainLevelsEditorLayer::editorCopyLevel));
copyLevel->setPositionX(208.f);
copyLevel->setPositionY(22.f);
container->addChild(copyLevel);
}
//saveTar
{
auto saveTar = InputNode::create(60.f, "saveTar", "chatFont.fnt");
saveTar->setPositionX(238.f);
saveTar->setPositionY(22.f);
saveTar->setID("saveTar");
saveTar->getInput()->setAllowedChars("1234567890");
container->addChild(saveTar);
};
inputsContainer->addChild(container);
}
//update and add menu
Expand Down Expand Up @@ -373,7 +407,7 @@ class $modify(LevelInfoLayerExt, LevelInfoLayer) {
}
return 1;
}
TodoReturn setupLevelInfo() {
void setupLevelInfo() {
if (Mod::get()->getSettingValue<bool>("SL"))
this->m_level = processOutLevelByConfig(this->m_level->m_levelID.value(), this->m_level);
LevelInfoLayer::setupLevelInfo();
Expand Down Expand Up @@ -582,6 +616,7 @@ class $modify(LevelAreaInnerLayerExt, LevelAreaInnerLayer) {
EditBtn::createAndSetup(menu->getChildByTag(5002));
EditBtn::createAndSetup(menu->getChildByTag(5003));
EditBtn::createAndSetup(menu->getChildByTag(5004));
break;//1st menu only
};
};
};
Expand Down
127 changes: 127 additions & 0 deletions bindings/.github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
name: Build Codegen

on:
pull_request:
push:
branches:
- '**'

jobs:
filter:
runs-on: ubuntu-latest
name: Filter
outputs:
should-run: ${{ steps.changed.outputs.any_changed }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get changed files in the codegen folder
id: changed
uses: tj-actions/changed-files@v42
with:
files: |
.github/workflows/build.yml
codegen/**
build:
needs: filter
if: needs.filter.outputs.should-run == 'true'

strategy:
fail-fast: false
matrix:
config:
- name: Windows
os: windows-latest
id: win
- name: macOS
os: macos-latest
id: mac
- name: Linux
os: ubuntu-latest
id: linux

name: Build ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}

env:
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm-cache

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup CPM Cache
uses: actions/cache@v4
with:
path: cpm-cache
key: cpm-${{ matrix.config.id }}-v1-${{ hashFiles('codegen/CMakeLists.txt') }}
restore-keys: |
cpm-${{ matrix.config.id }}-v1-
- name: Install Ninja
shell: bash
run: |
curl -L https://github.com/ninja-build/ninja/releases/latest/download/ninja-${{ matrix.config.id }}.zip -o ninja.zip
7z x ninja.zip -o"$GITHUB_WORKSPACE/ninja"
echo "$GITHUB_WORKSPACE/ninja" >> $GITHUB_PATH
- name: Configure
run: >
cmake codegen -B codegen/build
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_C_COMPILER=clang
-DCMAKE_CXX_COMPILER=clang++
-G Ninja
- name: Build
run: cmake --build codegen/build --config Release --parallel

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: geode-codegen-${{ matrix.config.id }}
path: |
codegen/build/Codegen
codegen/build/Codegen.exe
if-no-files-found: ignore

publish:
name: Publish
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Download Artifacts
uses: actions/download-artifact@v4

- name: Move Binaries
run: |
mv geode-codegen-win/Codegen.exe geode-codegen-win.exe
mv geode-codegen-mac/Codegen geode-codegen-mac-temp
mv geode-codegen-linux/Codegen geode-codegen-linux-temp
rmdir geode-codegen-mac
rmdir geode-codegen-linux
mv geode-codegen-mac-temp geode-codegen-mac
mv geode-codegen-linux-temp geode-codegen-linux
- name: Update Codegen Release
uses: andelf/nightly-release@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: codegen
name: 'Codegen Release'
body: Geode codegen release for commit ${{ github.sha }}.
files: |
./geode-codegen-win.exe
./geode-codegen-mac
./geode-codegen-linux
136 changes: 136 additions & 0 deletions bindings/.github/workflows/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
name: 'Verify bindings syntax'

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Restore cache
id: codegen-cache
uses: actions/cache@v3
with:
path: bin
key: codegen-${{ hashFiles('codegen/**') }}

- name: Build Codegen binary
if: steps.codegen-cache.outputs.cache-hit != 'true'
run: |
cmake ./codegen -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=./bin -B build
cmake --build build --config RelWithDebInfo
cmake --install build
- name: Upload Codegen binary
uses: actions/upload-artifact@v3
with:
name: Codegen
path: bin/Codegen

verify:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Download Codegen binary
uses: actions/download-artifact@v3
with:
name: Codegen

- name: Verify
run: 'chmod +x ./Codegen && ./Codegen Win32 bindings/2.200 out'

test-members:
# dont bother running member test if broma isnt even valid
needs: verify

strategy:
fail-fast: false
matrix:
config:
- name: Windows
os: windows-2022
prefixes: ''
extra_flags: >
-A win32
-D USE_HACKY_SCRIPT=ON
- name: Android32
os: ubuntu-latest
prefixes: ''
extra_flags: >
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake
-DANDROID_ABI=armeabi-v7a
-DANDROID_PLATFORM=android-23
-G Ninja
-D USE_HACKY_SCRIPT=ON
- name: Android64
os: ubuntu-latest
prefixes: ''
extra_flags: >
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake
-DANDROID_ABI=arm64-v8a
-DANDROID_PLATFORM=android-23
-G Ninja
-D USE_HACKY_SCRIPT=ON
- name: macOS
os_identifier: mac
os: macos-latest
extra_flags: >
-DCMAKE_C_COMPILER=clang
-DCMAKE_CXX_COMPILER=clang++
-DCMAKE_BUILD_TYPE=Debug
name: Test Offsets ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}

steps:
- name: Checkout bindings
uses: actions/checkout@v4

- name: Checkout geode
uses: actions/checkout@v4
with:
repository: geode-sdk/geode
path: geode

- name: Set up codegen binary cache
id: codegen-cache
uses: actions/cache@v3
with:
path: build/bindings/codegen
# cache by os since for android32 and 64 the codegen binary is the same
key: codegen-${{ hashFiles('codegen/**') }}-${{ matrix.config.os }}

- name: Set up android env
run: |
sudo apt install ninja-build
if: matrix.config.os == 'ubuntu-latest'

- name: Set GEODE_SDK
shell: bash
run: echo "GEODE_SDK=${{ github.workspace }}/geode" >> $GITHUB_ENV

- name: Configure CMake
shell: bash
run: >
cmake -B build -S test/members
-D SKIP_BUILDING_CODEGEN=${{ steps.codegen-cache.outputs.cache-hit }}
${{ matrix.config.extra_flags }}
# SKIP_BUILDING_CODEGEN will skip building codegen if finds a cached binary,
# locally you dont need to set it
# USE_HACKY_SCRIPT will use the python script and some hackery to print the
# offsets in a nicer way. it is also not required

- name: Build member test
run: |
cmake --build build --config RelWithDebInfo --parallel --target TestMembers
- name: Show Errors
run: python test/members/check.py build
7 changes: 7 additions & 0 deletions bindings/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
build/
.vscode/
__scripts
**/.DS_Store
scripts/Bindings.json
__optcall.xml
__membercall.xml
2 changes: 1 addition & 1 deletion bindings/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ We are mainly only looking for new addresses for the latest version of GD (Updat
## SyncBromaScript
You can automatically sync addresses from-and-to Broma using the [`SyncBromaScript`](scripts/SyncBromaScript.java) script for Ghidra. This script automatically pulls function names, signatures & addresses from Broma, adds them to your Ghidra project, and then adds any addresses you have found back into the Broma.
You can automatically sync addresses from-and-to Broma using the [`SyncBromaScript`](scripts/ghidra/SyncBromaScript.java) script for Ghidra. This script automatically pulls function names, signatures & addresses from Broma, adds them to your Ghidra project, and then adds any addresses you have found back into the Broma.
**To install SyncBromaScript**, open up the `Script Manager` in Ghidra, then select `Manage Script Directories` from the top right toolbar. Add the path to the `scripts` directory in your local copy of Bindings, then refresh your scripts in `Script Manager`. You should see a `GeodeSDK` category appear with `SyncBromaScript.java` in it
Expand Down
Loading

0 comments on commit 1b2b696

Please sign in to comment.