Skip to content

Instantly share code, notes, and snippets.

@akiyan
akiyan / playback_timeline.md
Last active July 13, 2026 02:24
SEGA-CD Tile Texture Reuse Codec — hardware playback timeline (dual-68000 execution & sync)

SEGA-CD Tile Texture Reuse Codec — 実機再生タイムライン(68000 二基)

SEGA-CD(メガCD)の 2 つの 68000 CPU が、実機で MOVIE.DAT ストリームを再生する とき 実際に何を実行し、どう同期し、どのメモリをどれだけ使うか を実行時の視点で まとめたもの。対象は Tile Texture Reuse Codec のプレイヤー boot/movieplay_sp.s(Sub CPU)と boot/movieplay_ip.s(Main CPU)。 メモリ数値は H40フル(320×224 / 40×28=1120セル / 15fps)の実測ビルドに基づく。

この設計は、3 つの厳しいハード制約を 同時に 満たすために存在する:

@akiyan
akiyan / H40_FULL_JOURNEY.md
Created July 12, 2026 00:12
SEGA-CD full-screen H40 FMV: the journey to a clean full-length playback, and a field method for reasoning without an advisor (EN + JA)

The Journey to a Full-Screen H40 Sega CD FMV

How the full-screen H40 (320×224, 40×28 = 1120 tiles) machi (街) ending was made to stream from disc and play back cleanly — video and audio — with no resolution or audio quality lost.

Final result: S(slip)=0 for the whole movie, steady 15 fps, clean and synced audio, frame 0 a complete load. Build 20260711.e8.p3https://youtu.be/5C6t5pvUo-Y (unlisted).

@akiyan
akiyan / gist:c7f8479f99e61807d2c7
Last active August 29, 2015 14:22
MP4Box different result

Ubuntu 14.04

$ /usr/bin/MP4Box -version
MP4Box - GPAC version 0.5.1-DEV-rev4065
GPAC Copyright (c) Telecom ParisTech 2000-2012
GPAC Configuration: --build=x86_64-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --libdir=${prefix}/lib/x86_64-linux-gnu --libexecdir=${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode --disable-dependency-tracking --prefix=/usr --mandir=${prefix}/share/man --libdir=lib/x86_64-linux-gnu --extra-cflags=-Wall -fPIC -DPIC -I/usr/include/mozjs -DXP_UNIX --enable-joystick --enable-debug --disable-ssl
Features: GPAC_HAS_JPEG GPAC_HAS_PNG
$ /usr/bin/MP4Box -add 206.mp4:ext=.mp4 -new 206_ext.mp4
IsoMedia import 206.mp4 - track ID 1 - Video (size 480 x 360)
[iso file] Box "minf" has 57 extra bytes
@akiyan
akiyan / gist:9948326
Created April 3, 2014 04:36
縦長動画の `ffprobe -show_format -show_streams` result, ffmpeg 2.2.0 (0.10.11-7:0.10.11-1~precise1)
$ ffprobe -show_format -show_streams 8.mp4
ffprobe version 0.10.11-7:0.10.11-1~precise1 Copyright (c) 2007-2014 the FFmpeg developers
  built on Feb  6 2014 16:53:05 with gcc 4.6.3
  configuration: --arch=amd64 --disable-stripping --enable-pthreads --enable-runtime-cpudetect --extra-version='7:0.10.11-1~precise1' --libdir=/usr/lib/x86_64-linux-gnu --prefix=/usr --enable-bzlib --enable-libdc1394 --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable-libmp3lame --enable-librtmp --enable-libopencv --enable-libopenjpeg --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvpx --enable-zlib --enable-gpl --enable-postproc --enable-libcdio --enable-x11grab --enable-libx264 --shlibdir=/usr/lib/x86_64-linux-gnu --enable-shared --disable-static
  libavutil      51. 35.100 / 51. 35.100
  libavcodec     53. 61.100 / 53. 61.100
  libavformat    53. 32.100 / 53. 32.100
  libavdevice    53.  4.100 / 53.  4.100
 
@akiyan
akiyan / gist:9947868
Created April 3, 2014 03:34
縦長動画の `avprobe -show_format -show_streams` result
$ avprobe -show_format -show_streams 8.mp4
avprobe version 0.8.10-4:0.8.10-0ubuntu0.12.04.1, Copyright (c) 2007-2013 the Libav developers
  built on Feb  6 2014 20:56:59 with gcc 4.6.3
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '8.mp4':
  Metadata:
    major_brand     : qt
    minor_version   : 0
    compatible_brands: qt
    creation_time   : 2014-04-03 03:33:31
@akiyan
akiyan / gist:9947820
Last active August 29, 2015 13:58
横長動画の `avprobe -show_format -show_streams` result
$ avprobe -show_format -show_streams 3.mp4
avprobe version 0.8.10-4:0.8.10-0ubuntu0.12.04.1, Copyright (c) 2007-2013 the Libav developers
  built on Feb  6 2014 20:56:59 with gcc 4.6.3
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '3.mp4':
  Metadata:
    major_brand     : qt
    minor_version   : 0
    compatible_brands: qt
    creation_time   : 2014-02-28 00:42:29
@akiyan
akiyan / gist:9947776
Created April 3, 2014 03:24
`avprobe -show_format -show_streams -print_format xml` result
$ avprobe -show_format -show_streams -print_format xml 3.mp4
avprobe version 0.8.10-4:0.8.10-0ubuntu0.12.04.1, Copyright (c) 2007-2013 the Libav developers
  built on Feb  6 2014 20:56:59 with gcc 4.6.3
Unrecognized option 'print_format'
Failed to set value 'xml' for option 'print_format'

$ avprobe -v debug
avprobe version 0.8.10-4:0.8.10-0ubuntu0.12.04.1, Copyright (c) 2007-2013 the Libav developers
  built on Feb  6 2014 20:56:59 with gcc 4.6.3
@akiyan
akiyan / autoUpdate.php
Last active December 29, 2015 15:29 — forked from Leko/autoUpdate.php
UserAgentがそのまま(PHP/x.x.)だとForbiddenが出るので適当なUAに変更するようにした。 Warning: file_get_contents(https://api.github.com/repos/boxen/puppet-autoconf/tags): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden in /Users/akiyan/our-boxen/bin/autoUpdate.php on line 14
<?php
define("READ_START_SYMBOL", "# ---auto update---");
define("READ_END_SYMBOL", "# ---/auto update---");
//
function notify_update($name, $from, $to) {
echo "updated '".$name."' from ".$from." to ".$to."\n";
}
<?php
class WebAuthTest extends PHPUnit_Extensions_Selenium2TestCase {
protected function setUp() {
$this->setBrowser('phantomjs');
$this->setBrowserUrl('http://www.google.com/');
}
public function testText() {
$this->url('http://127.0.0.1:10080/auth/twitter');
$this->assertEquals('Hello', $this->title());
function init_db_by_fixture() {
require_once CAKE . 'TestSuite' . DS . 'Fixture' . DS . 'CakeTestFixture.php';
$model_files = glob(APP . 'Model/*.php');
$fixture_db = ConnectionManager::getDataSource('test');
foreach ($model_files as $path) {
$model = Inflector::camelize(str_replace('.php', '', basename($path)));
$modelObj = ClassRegistry::init($model);
if (isset($modelObj->useDbConfig) && $modelObj->useDbConfig == 'default' && is_string($modelObj->useTable)) {
$fixtureName = $model;