酷使して壊れたゲームパッドを買い替えた
同じシリーズのエレコムのケーブル付きパッドだったので、ワイヤレスにしてみた
R3ボタンが軽くなったから、使いやすくなった
ついでにワイヤレスって快適だ
知らなかった
2019年08月24日
ゲームパッド買い替えて快適
posted by とーふ at 12:12| Comment(0)
| アニメ・マンガ・ゲーム
2019年08月03日
PCのスクショをとって、http サーバで提供する
監視カメラサーバをPCで動かしているんだが、別のところでも同じ画面が見たい
ただ複数のクライアントを動かすとサーバの負荷があがるので、台数が増やせない
というニッチな要望に対応したバッチファイル その2
今度は、http サーバとして動作します
悪用されると困るので、localhost のみ対応
参考にしたのは、
使用例:
httpserve.bat を実行するとポート 8080 で待ち受ける
とすると、スクリーンショットが現れる
httpserve.bat
@echo off
cd /d %~dp0
:最小化状態で実行する
if not "%X_MIMIMIZED%"=="1" (
set X_MIMIMIZED=1
start /min cmd /c,"%~0" %*
exit
)
:これ以下に必要な処理を書く
echo "最小化!"
:loop
powershell.exe -NoProfile -ExecutionPolicy Unrestricted .\httpserver.ps1
timeout /t 10
goto loop
httpserver.ps1
# simple http server written in powershell
#
$port = 8080
$root = "d:\htm"
[Reflection.Assembly]::LoadWithPartialName("System.Drawing")
function screenshot([Drawing.Rectangle]$bounds, $strm) {
$bmp = New-Object Drawing.Bitmap $bounds.width, $bounds.height
$graphics = [Drawing.Graphics]::FromImage($bmp)
$graphics.CopyFromScreen($bounds.Location, [Drawing.Point]::Empty, $bounds.size)
$bmp.Save($strm, [System.Drawing.Imaging.ImageFormat]::Jpeg)
$graphics.Dispose()
$bmp.Dispose()
}
function Get-PrimaryScreenshot($mstream) {
[void] [Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
[void] [Reflection.Assembly]::LoadWithPartialName("System.Drawing")
$Screens = [system.windows.forms.screen]::AllScreens
foreach ($Screen in $Screens) {
$DeviceName = $Screen.DeviceName
$Width = $Screen.Bounds.Width
$Height = $Screen.Bounds.Height
$IsPrimary = $Screen.Primary
if( $IsPrimary )
{
$bounds = [Drawing.Rectangle]::FromLTRB(0, 0, $Width, $Height)
screenshot $bounds $mstream
}
}
}
$bounds = [Drawing.Rectangle]::FromLTRB(0, 0, 2560, 1080)
$mstream = New-Object System.IO.MemoryStream
[console]::TreatControlCAsInput = $true
Write-Host "Simple Http Server start."
$listener = New-Object system.net.HttpListener
$listener.Prefixes.Add('http://127.0.0.1:'+$port+'/')
$listener.Start()
while($true) {
if ([console]::KeyAvailable) {
$key = [system.console]::readkey($true)
if (($key.modifiers -band [consolemodifiers]"control") -and($key.key -eq "C")) {
"Terminating..."
break
}
}
$context = $listener.GetContext() # block
$request = $context.Request
$request.RawUrl
if( $request.RawUrl -eq "/" )
{
$path = $root + "\index.html"
}
else
{
$path = $root + $request.RawUrl.Replace("/", "\");
}
$path
$response = $context.Response
if( $path.EndsWith("\screen.jpg" ) )
{
Get-PrimaryScreenshot $mstream
$response.ContentType = "image/jpeg"
$buffer = [System.Byte[]]::CreateInstance([System.Byte],$mstream.length)
$mstream.seek(0,0)
$mstream.read($buffer, 0, $buffer.length)
$mstream.seek(0,0)
}
else
{
if( Test-Path $path ) {
# 要求されたURLに対応するコンテンツを返す。
$page = Get-Content -Path $path -Encoding Byte
if( $path.EndsWith(".png"))
{
$response.ContentType = "image/png"
$buffer = Get-Content -Path $path -Encoding Byte
}
elseif( $path.EndsWith(".jpg"))
{
$response.ContentType = "image/jpeg"
$buffer = Get-Content -Path $path -Encoding Byte
}
else
{
$page = Get-Content -Path $path
$buffer = [System.Text.Encoding]::UTF8.GetBytes($page)
}
} else {
# 404
"404"
$errfile = $root + "\404.html"
$page = Get-Content -Path $errfile
$buffer = [System.Text.Encoding]::UTF8.GetBytes($page)
}
}
$response.ContentLength64 = $buffer.Length
$output = $response.OutputStream
$output.Write($buffer,0,$buffer.Length)
$output.Close()
}
$listener.Stop()
index.html
<head>
<meta http-equiv="refresh" content="10" />
</head>
<img src=screen.jpg>
posted by とーふ at 15:38| Comment(0)
| PCソフト
Ryzen7 3800X + Radeon RX5700XT 導入して一週間
さすがに最新の環境なのでトラブルも満載
いろいろと調べると知らなかったことが出てきて興味深い
・DDR4-3200のメモリを買ったが、JEDEC 標準では DDR4-2132
拡張パラメータ XMP として 3200 の設定があること
ちなみに、XMP は、intel 向けの規格だけどこのマザボは対応してる
ついでに標準設定だとベンチ結果がすげー悪い・マザボの電源供給が EPS12V の8PinとATX12Vの4Pin の両方が必要
そんな電源見当たらないよ?みんなどうしてるの?
仕方ないので、PCIe 補助電源ケーブルを加工して無理やり接続
・Ryzen7に対応した最適化スケジューラは、Windows10 1903 にて対応
アップデートしたらFFベンチが 5% ぐらい性能アップ
漆黒のヴィランズ 16092 -> 16816
・買ったマザボは日本のMSIのサイトには書かれていないw
今のところの不具合はGPUドライバが不安定でゲームが起動しないものがある程度
・CHAOS;CHILD がエラーで動かない
GPUドライバのバージョンで挙動が違うので、ドライバ待ち
・MSI のツール(Dragon Center) をインストールすると FF ベンチ動かすとブルースクリーンで落ちる
ドライバ名からするとGPUドライバ
手持ちのケースに入れたけど、邪魔だったのでケースを新調
ATXマザーボードがギリギリ入ってコンパクトなので満足
でも電源ケーブルが余ってかっこ悪いし、SSDが固定できてない
比較
入れ替え前
posted by とーふ at 06:09| Comment(0)
| PCハード