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
#ifndef defer | |
struct defer_dummy {}; | |
template <class F> struct deferrer { F f; ~deferrer() { f(); } }; | |
template <class F> deferrer<F> operator*(defer_dummy, F f) { return {f}; } | |
#define DEFER_(LINE) zz_defer##LINE | |
#define DEFER(LINE) DEFER_(LINE) | |
#define defer auto DEFER(__LINE__) = defer_dummy{} *[&]() | |
#endif // defer |
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
struct Output | |
{ | |
float4 position_cs : SV_POSITION; | |
float2 texcoord : TEXCOORD; | |
}; | |
Output main(uint id: SV_VertexID) | |
{ | |
Output output; |
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
@echo off | |
set SCRIPT_ROOT=%~dp0 | |
set FFMPEG=%SCRIPT_ROOT%ffmpeg.exe | |
set INPUT_FULLPATH=%1 | |
set INPUT_FILENAME=%~n1 | |
set INPUT_FOLDER=%~dp1 | |
set OUTPUT_FULLPATH="%INPUT_FOLDER%%INPUT_FILENAME%.mp3" | |
echo Extraction audio from %INPUT_FULLPATH% |
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
Shader | |
layout (location = 0) in vec3 inPos; | |
layout (location = 1) in vec3 inColor; | |
layout (location = 2) in vec3 inPosB; | |
layout (location = 3) in vec3 inColorB; | |
... | |
Application |
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
首先说明LBA保护是什么。讲到这里就插入一点背景知识。 | |
PSP的UMD数据基于ISO9660格式存储。(关于ISO9660的具体信息请查阅相关资料) | |
众所周知,ISO9660的数据存储基于逻辑块(Logical Block)。数据必须以逻辑块为单位对齐。 | |
其大小可在VolumeDescriptor结构的logical_block_size中获得。 | |
在PSP上,这个值是0x800,也就是2048字节。 | |
sony为PSP的isofs驱动(在用户层一般由disc0访问)提供了一种特殊的访问模式。 | |
这种模式就是LBA,也就是Logical Block Addressing,即逻辑块寻址模式。 | |
可以使用户通过提供逻辑块编号和文件长度,直接访问相应位置的数据,而不需要沿ISO数据结构下溯。 | |
(事实上,下溯的结果也只是这两个数据而已。) | |
但事实上,提供这种方法的主要目的并不是节约寻址时间。 |
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
import os | |
import sys | |
def jis_rename(root): | |
for root,dirs,files in os.walk(root): | |
for file in files: | |
file = os.path.join(root, file) | |
d = os.path.dirname(file) | |
f = os.path.basename(file) |
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
#!/bin/bash | |
# Switch GPU on Debian system with reboot. | |
# Because there's no nvidia-prime package for Debian distro, | |
# I did some work to achieve the same functionality as nvidia-prime provide. | |
# Follow the instructions here: | |
# 1. Follow instructions here to install nvidia proprietary driver: |