Skip to content

Commit

Permalink
Update for HOS 14.0.0
Browse files Browse the repository at this point in the history
Fixes issue #2
  • Loading branch information
proferabg committed Mar 26, 2022
1 parent 7b8d70f commit 932788d
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 50 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ endif

APP_TITLE := EdiZon
APP_AUTHOR := WerWolv & proferabg
APP_VERSION := v1.0.2b
APP_VERSION := v1.0.2c

TARGET := EdiZon
OUTDIR := out
Expand Down
3 changes: 1 addition & 2 deletions include/cheat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@
#pragma once

#include <edizon.h>
//#include <helpers/dmntcht.h>
#include <helpers/util.h>
#include "dmntcht.h"
#include "cheat_engine_types.hpp"
#include "result.hpp"
#include "results.hpp"
#include "dmntcht.h"

#include <string>
#include <vector>
Expand Down
6 changes: 2 additions & 4 deletions include/dmntcht.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2020 Atmosphère-NX
* Copyright (c) Atmosphère-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
Expand All @@ -15,8 +15,7 @@
*/

#pragma once

#include <edizon.h>
#include <switch.h>

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -65,7 +64,6 @@ Service* dmntchtGetServiceSession(void);

Result dmntchtHasCheatProcess(bool *out);
Result dmntchtGetCheatProcessEvent(Event *event);
Result pmdmntAtmosphereGetProcessInfo(Handle* handle_out, u64 pid);
Result dmntchtGetCheatProcessMetadata(DmntCheatProcessMetadata *out_metadata);
Result dmntchtForceOpenCheatProcess(void);
Result dmntchtForceCloseCheatProcess(void);
Expand Down
9 changes: 5 additions & 4 deletions include/service_guard.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#pragma once

#ifdef __cplusplus
extern "C" {
#endif

#include <switch/types.h>
#include <switch/result.h>
#include <switch/kernel/mutex.h>
#include <switch/sf/service.h>
#include <switch/services/sm.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef struct ServiceGuard {
Mutex mutex;
u32 refCount;
Expand Down
35 changes: 1 addition & 34 deletions source/dmntcht.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2020 Atmosphère-NX
* Copyright (c) Atmosphère-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
Expand All @@ -14,7 +14,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define NX_SERVICE_ASSUME_NON_DOMAIN

#include "service_guard.h"
#include "dmntcht.h"

Expand All @@ -30,7 +29,6 @@ void _dmntchtCleanup(void) {
serviceClose(&g_dmntchtSrv);
}


Service* dmntchtGetServiceSession(void) {
return &g_dmntchtSrv;
}
Expand All @@ -55,37 +53,6 @@ Result dmntchtGetCheatProcessEvent(Event *event) {

return rc;
}
typedef struct {
u64 keys_held;
u64 flags;
} CfgOverrideStatus;

Result pmdmntAtmosphereGetProcessInfo(Handle* handle_out, u64 pid) { //NcmProgramLocation *loc_out, CfgOverrideStatus *status_out,
Handle tmp_handle;

struct {
NcmProgramLocation loc;
CfgOverrideStatus status;
} out;

Result rc = serviceDispatchInOut(pmdmntGetServiceSession(), 65000, pid, out,
.out_handle_attrs = { SfOutHandleAttr_HipcCopy },
.out_handles = &tmp_handle,
);

if (R_SUCCEEDED(rc)) {
if (handle_out) {
*handle_out = tmp_handle;
} else {
svcCloseHandle(tmp_handle);
}

// if (loc_out) *loc_out = out.loc;
// if (status_out) *status_out = out.status;
}

return rc;
}

Result dmntchtGetCheatProcessMetadata(DmntCheatProcessMetadata *out_metadata) {
return serviceDispatchOut(&g_dmntchtSrv, 65002, *out_metadata);
Expand Down
17 changes: 12 additions & 5 deletions source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,17 @@ class GuiStats : public tsl::Gui {
renderer->drawString("WiFi Signal:", false, 45, 360, 18, renderer->a(tsl::style::color::ColorText));

s32 temparature = 0;
tsGetTemperatureMilliC(TsLocation_Internal, &temparature);
renderer->drawString(formatString("%.02f °C", temparature / 1000.0F).c_str(), false, 240, 160, 18, renderer->a(tsl::style::color::ColorHighlight));
tsGetTemperatureMilliC(TsLocation_External, &temparature);
renderer->drawString(formatString("%.02f °C", temparature / 1000.0F).c_str(), false, 240, 190, 18, renderer->a(tsl::style::color::ColorHighlight));
if(hosversionAtLeast(14,0,0)){
tsGetTemperature(TsLocation_Internal, &temparature);
renderer->drawString(formatString("%d °C", temparature).c_str(), false, 240, 160, 18, renderer->a(tsl::style::color::ColorHighlight));
tsGetTemperature(TsLocation_External, &temparature);
renderer->drawString(formatString("%d °C", temparature).c_str(), false, 240, 190, 18, renderer->a(tsl::style::color::ColorHighlight));
} else {
tsGetTemperatureMilliC(TsLocation_Internal, &temparature);
renderer->drawString(formatString("%.02f °C", temparature / 1000.0F).c_str(), false, 240, 160, 18, renderer->a(tsl::style::color::ColorHighlight));
tsGetTemperatureMilliC(TsLocation_External, &temparature);
renderer->drawString(formatString("%.02f °C", temparature / 1000.0F).c_str(), false, 240, 190, 18, renderer->a(tsl::style::color::ColorHighlight));
}

u32 cpuClock = 0, gpuClock = 0, memClock = 0;

Expand Down Expand Up @@ -258,7 +265,7 @@ class GuiMain : public tsl::Gui {
auto *rootFrame = new tsl::elm::HeaderOverlayFrame();
rootFrame->setHeader(new tsl::elm::CustomDrawer([this](tsl::gfx::Renderer *renderer, s32 x, s32 y, s32 w, s32 h) {
renderer->drawString("EdiZon", false, 20, 50, 30, renderer->a(tsl::style::color::ColorText));
renderer->drawString("v1.0.2b", false, 20, 70, 15, renderer->a(tsl::style::color::ColorDescription));
renderer->drawString("v1.0.2c", false, 20, 70, 15, renderer->a(tsl::style::color::ColorDescription));

if (edz::cheat::CheatManager::getProcessID() != 0) {
renderer->drawString("Program ID:", false, 150, 40, 15, renderer->a(tsl::style::color::ColorText));
Expand Down

0 comments on commit 932788d

Please sign in to comment.