Skip to content

Instantly share code, notes, and snippets.

View Subv's full-sized avatar

Sebastian Valle Subv

  • Barranquilla, Colombia
View GitHub Profile
@Subv
Subv / .cpp
Created November 9, 2017 23:53
SharedPtr<Event> HLERequestContext::SleepClientThread(SharedPtr<Thread> thread,
const std::string& reason, u64 timeout,
WakeupCallback&& callback) {
SharedPtr<ServerSession> server_session = session;
// Put the client thread to sleep until the wait event is signaled or the timeout expires.
thread->wakeup_callback = [server_session, callback](ThreadWakeupReason reason,
SharedPtr<Thread> thread,
SharedPtr<WaitObject> object) {
ASSERT(thread->status == THREADSTATUS_WAIT_HLE_EVENT);
@Subv
Subv / custom_service.cpp
Created November 9, 2017 03:48
Custom 3DS service tst:srv
#include <3ds.h>
#include <cinttypes>
#include <stdio.h>
#include <string.h>
#define STACKSIZE (4 * 1024)
#define HELLO_COMMAND_ID 0x1
#define SHUTDOWN_COMMAND_ID 0x2
Handle server_port;
#include <Windows.h>
#include <cmath>
using namespace std;
int main() {
int a = max(4, 6);
return 0;
}
ndm.cpp
Code Generation Summary
Total Function Count: 651
Elapsed Time: 1.107 sec
Total Compilation Time: 3.115 sec
Efficiency: 281.4%
Average time per function: 0.005 sec
Anomalistic Compile Times: 16
??$CreateDevice@V?$InputDevice@V?$tuple@MM@std@@@Input@@@Input@@YA?AV?$unique_ptr@V?$InputDevice@V?$tuple@MM@std@@@Input@@U?$default_delete@V?$InputDevice@V?$tuple@MM@std@@@Input@@@std@@@std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z: 0.167 sec, 0 instrs
??$CreateDevice@V?$InputDevice@_N@Input@@@Input@@YA?AV?$unique_ptr@V?$InputDevice@_N@Input@@U?$default_delete@V?$InputDevice@_N@Input@@@std@@@std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z: 0.156 sec, 0 instrs
@Subv
Subv / .c
Created October 3, 2017 17:22
#define CONCAT2(x, y) DO_CONCAT2(x, y)
#define DO_CONCAT2(x, y) x ## y
#define variable_name(var) CONCAT2(var, __LINE__)
#define printf(...) { u8* variable_name(savedbuff) = my_printf_guard(); printf(__VA_ARGS__); my_printf_restore(variable_name(savedbuff)); }
u8* my_printf_guard() {
// Saves the contents of the TLS command buffer and returns them in a variable
// The caller is responsible for the management of the returned memory.
@Subv
Subv / 3ds_enet.patch
Last active October 3, 2017 00:11
Patch to make enet compile under devkitARM for the Nintendo 3DS
diff --git a/unix.c b/unix.c
index c36a082..96b6ae6 100644
--- a/unix.c
+++ b/unix.c
@@ -51,7 +51,7 @@
#endif
#ifdef HAS_POLL
-#include <sys/poll.h>
+#include <poll.h>
@Subv
Subv / .cpp
Created September 30, 2017 14:18
// Copyright 2017 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include <memory>
#include <vector>
#include <catch.hpp>
#include "core/core.h"
#include "core/core_timing.h"
#include "core/hle/kernel/event.h"
@Subv
Subv / .cpp
Last active September 28, 2017 16:55
// Copyright 2017 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include <memory>
#include <vector>
#include <catch.hpp>
#include "core/hle/kernel/event.h"
#include "core/hle/kernel/process.h"
#include "core/hle/kernel/thread.h"
@Subv
Subv / final.asm
Last active September 25, 2017 16:14
00007FF66C69BD00 mov qword ptr [rsp+8],rbx
00007FF66C69BD05 push rdi
00007FF66C69BD06 sub rsp,20h
00007FF66C69BD0A mov rbx,rcx
00007FF66C69BD0D movsxd rdi,r8d
00007FF66C69BD10 mov ecx,r9d
00007FF66C69BD13 call Memory::GetPhysicalPointer (07FF66C5A5250h)
00007FF66C69BD18 lea r8d,[rdi*4]
00007FF66C69BD20 mov rdx,rax
00007FF66C69BD23 mov rcx,rbx
@Subv
Subv / .diff
Created September 25, 2017 15:51
Citra Vertex Loader direct-call
diff --git a/src/video_core/vertex_loader.cpp b/src/video_core/vertex_loader.cpp
index 37c5224..8f9db2e 100644
--- a/src/video_core/vertex_loader.cpp
+++ b/src/video_core/vertex_loader.cpp
@@ -13,9 +13,37 @@
#include "video_core/regs_pipeline.h"
#include "video_core/shader/shader.h"
#include "video_core/vertex_loader.h"
+#include "common/microprofile.h"