Skip to content

Instantly share code, notes, and snippets.

View oupo's full-sized avatar

oupo oupo

  • Japan
View GitHub Profile
@oupo
oupo / desmume-3d-zoom-screenshot.diff
Created June 27, 2010 06:18
desmume-3d-zoom-screenshot.diff
diff -up src-orig/lua-engine.cpp src/lua-engine.cpp
--- src-orig/lua-engine.cpp 2010-02-04 15:22:54.000000000 +0900
+++ src/lua-engine.cpp 2010-06-27 15:05:54.984375000 +0900
@@ -3195,6 +3195,15 @@ DEFINE_LUA_FUNCTION(gui_gdscreenshot, "[
return 1;
}
+extern int ZOOM_SCREEN_SHOT_WIDTH;
+extern int ZOOM_SCREEN_SHOT_HEIGHT;
+DEFINE_LUA_FUNCTION(gui_save_3d_zoom_screenshot, "width,height")
# 0211E6C8 - 0211E754
def f1(charcodes)
r13_0x0 = 0
r13_0x4 = 0
8.times do |i|
charcode = charcodes[7-i]
if i != 0
r13_0x4 = u32((r13_0x4 << 7) | (r13_0x0 >> 25))
r13_0x0 = u32(r13_0x0 << 7)
end
#!ruby -Ku
require "kconv"
# 0211E6C8 - 0211E754
def f1(charcodes)
a = 0
b = 0
8.times do |i|
charcode = charcodes[7-i]
if i != 0
#!ruby -Ku
require "kconv"
# 0211E6C8 - 0211E754
def f1(charcodes)
a = 0
b = 0
8.times do |i|
charcode = charcodes[7-i]
if i != 0
@oupo
oupo / binary.rb
Created July 12, 2010 12:53
inazuma3-unitstat-dump.rb
unless "".respond_to?(:getbyte)
class String
def getbyte(n)
self[n]
end
def setbyte(n, c)
self[n] = c
end
end
@oupo
oupo / trace-inzm3-rom-read.lua
Created July 13, 2010 07:15
trace-inzm3-rom-read.lua
loadfile("../myutil.lua")()
function read_filelist(path)
local f, e = io.open(path, "rb")
if not f then
error(e)
end
local result = {}
while true do
local line = f:read("*l")

アイテムドロップ乱数調整

使われる乱数

アイテムドロップの判定に使われる乱数は以下の64bitの線形合同法です

u64 seed;

u32 rand(u32 max) {
	seed = seed * 0x5d588b656c078965 + 0x0000000000269ec3;

return ((seed >> 32) * max) >> 32;

@oupo
oupo / binary.rb
Created July 23, 2010 21:07
inazuma3-games-dump.rb
unless "".respond_to?(:getbyte)
class String
def getbyte(n)
self[n]
end
def setbyte(n, c)
self[n] = c
end
end

エンカウント

いつものことですが間違っている可能性があります

使われる乱数

使われる乱数は選手バインダーやアイテムドロップとは別系列の乱数です。 乱数の式と初期seed、タイトル画面で時間経過により消費されることは同じです。

参照: http://gist.github.com/479329

@oupo
oupo / inzm3-encount.txt
Created August 15, 2010 05:21
inzm3-encount.txt
商店街
マッスルズ (34%)
メンバー: ふきいし,おおにわ,おおさか,かじわら,やわら,みえ,よしの,よこた
ドロップ: おにぎり(45%),ぎゅうにゅう(45%),しこふみ(6%)
クリアポイント: 4, 熱血: 36, 友情: 6
ラフヘアーズ (33%)
メンバー: ユイリー,はやぼし,すなお,ふき,しわ,なつか
ドロップ: おにぎり(45%),ぎゅうにゅう(45%),しこふみ(6%)
クリアポイント: 4, 熱血: 36, 友情: 6
グリニーズ (33%)