ルギア君の戯言

雑多な記事。

無題

PC (スリムタワー) の電源が死んでしまった。


しばらくは何も作業できそうにない…
というのも PC 屋いって電源を買ったところでこの PC 自体が古いから新しいのがほしいなあとか思いつつ目ぼしいのがない

ああ、Parallella はまだ来てないっていうか買い直すことにした


おわり。

TeX Live 2014 - その2

make check したら引っかかったのでメモ。

1 回目テストした際に、メモリ不足だったので、あげたら、確かに規定値 (3000) より使っているらしい。 ところどころで出るメッセージを見ると全体的に多く使っている模様。処理自体は問題ないらしい。

でもこれってどうやって直せば良いんだろうか。

まあ、これは後回しでいいや。とりあえずパッケージ化だけしちゃおう。

==================================
   Web2C 2014: ./test-suite.log
==================================

# TOTAL: 64
# PASS:  63
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: triptest
==============

>>> Running TRIP test for TeX.
>>> See /home/lunastra/Momonga/pkgs/texlive/BUILD/texlive-2014/texlive-20140525-source/texk/web2c/triptrap/trip.diffs for example of acceptable diffs.
+ ../pltotf /home/lunastra/Momonga/pkgs/texlive/BUILD/texlive-2014/texlive-20140525-source/texk/web2c/triptrap/trip.pl trip.tfm
+ ../tftopl ./trip.tfm trip.pl
+ diff /home/lunastra/Momonga/pkgs/texlive/BUILD/texlive-2014/texlive-20140525-source/texk/web2c/triptrap/trip.pl trip.pl
+ ln -s /home/lunastra/Momonga/pkgs/texlive/BUILD/texlive-2014/texlive-20140525-source/texk/web2c/triptrap/trip.tex .
+ ../tex --progname=initex --ini
+ mv trip.log tripin.log
+ diff /home/lunastra/Momonga/pkgs/texlive/BUILD/texlive-2014/texlive-20140525-source/texk/web2c/triptrap/tripin.log tripin.log
1c1
< This is TeX, Version 3.14159265 (INITEX)  7 JAN 2014 09:09
---
> This is TeX, Version 3.14159265 (TeX Live 2014) (INITEX)  6 SEP 2014 18:44
3c3
< (trip.tex
---
> (./trip.tex
450,453c450,453
<  (preloaded format=trip 2014.1.7)
< 1326 strings of total length 23646
< 471 memory locations dumped; current usage is 96&278
< 341 multiletter control sequences
---
>  (preloaded format=trip 2014.9.6)
> 1372 strings of total length 24612
> 479 memory locations dumped; current usage is 104&278
> 342 multiletter control sequences
461c461
< Hyphenation trie of length 273 has 9 ops out of 500
---
> Hyphenation trie of length 273 has 9 ops out of 35111
+ ../tex --progname=tex
+ diff /home/lunastra/Momonga/pkgs/texlive/BUILD/texlive-2014/texlive-20140525-source/texk/web2c/triptrap/trip.fot trip.fot
1,3c1,2
< This is TeX, Version 3.14159265 (INITEX)
< ** &trip  trip 
< (trip.tex ##
---
> This is TeX, Version 3.14159265 (TeX Live 2014) (preloaded format=tex)
> **(./trip.tex ##
17c16
< Memory usage before: 159&313; after: 102&278; still untouched: 1613
---
> Memory usage before: 185&313; after: 112&278; still untouched: 298613
75c74
< Memory usage before: 334&431; after: 292&418; still untouched: 175
---
> Memory usage before: 434&431; after: 376&418; still untouched: 295444
+ diff -u /home/lunastra/Momonga/pkgs/texlive/BUILD/texlive-2014/texlive-20140525-source/texk/web2c/triptrap/trip.log trip.log
--- /home/lunastra/Momonga/pkgs/texlive/BUILD/texlive-2014/texlive-20140525-source/texk/web2c/triptrap/trip.log 2014-01-20 20:01:30.000000000 +0900
+++ trip.log    2014-09-06 18:44:21.435187577 +0900
@@ -1,6 +1,6 @@
-This is TeX, Version 3.14159265 (preloaded format=trip 2014.1.7)  7 JAN 2014 09:59
+This is TeX, Version 3.14159265 (TeX Live 2014) (preloaded format=trip 2014.9.6)  6 SEP 2014 18:44
 ** &trip  trip
-(trip.tex ##
+(./trip.tex ##
 {vertical mode: \tracingrestores}
 {\write}
 {blank space  }
@@ -56,6 +56,10 @@
 ..\rule(-19.0+20.0)x1.0
 
 log file only0
+\openout0 = `8terminal.tex'.
+
+\openout10 = `tripos.tex'.
+
 {no mode: \number}
 
 ! Missing number, treated as zero.
@@ -70,7 +74,7 @@
 
 {\romannumeral}
 {\the}
-Memory usage before: 159&313; after: 102&278; still untouched: 1613
+Memory usage before: 185&313; after: 112&278; still untouched: 298613
 {vertical mode: \batchmode}
 
 {\output}
@@ -639,7 +643,7 @@
 ....\glue 4.0 plus 2.0 minus 1.0
 ..\mark{alpha}
 
-Memory usage before: 747&484; after: 581&481; still untouched: 1492
+Memory usage before: 1027&484; after: 795&481; still untouched: 297492
 {internal vertical mode: blank space  }
 {\unvcopy}
 {\showlists}
@@ -812,7 +816,7 @@
 .\vbox(2.0+0.0)x0.0 []
 .etc.
 
-Memory usage before: 475&470; after: 290&466; still untouched: 1473
+Memory usage before: 653&470; after: 384&466; still untouched: 297473
 {internal vertical mode: blank space  }
 {\unvcopy}
 {\showlists}
@@ -912,7 +916,7 @@
 .\vbox(10000.0+0.0)x0.0 []
 .\vbox(55.0+-1.0)x0.0 []
 
-Memory usage before: 218&459; after: 149&458; still untouched: 1473
+Memory usage before: 286&459; after: 181&458; still untouched: 297473
 {internal vertical mode: blank space  }
 {\unvcopy}
 {\showlists}
@@ -1067,7 +1071,7 @@
 .\glue(\topskip) 1.0 plus 44.0
 .\hbox(0.0+0.0)x23.0
 
-Memory usage before: 118&328; after: 102&328; still untouched: 1473
+Memory usage before: 132&328; after: 110&328; still untouched: 297473
 {restoring \box254=void}
 {restoring \hoffset=0.0pt}
 {restoring \showboxdepth=1}
@@ -1402,7 +1406,7 @@
 
 
 Completed box being shipped out [-2.0.0.0.11]
-\vbox(16383.99998+0.0)x1000.0, glue set 16342.0fil
+\vbox(16383.99998+0.0)x1000.0, glue set 16341.99998fil
 .\glue(\topskip) 0.0 plus 1.0fil
 .\hbox(22.0+0.0)x1000.0, glue set 237.5
 ..\glue(\leftskip) 4.0
@@ -1508,7 +1512,7 @@
 ..\glue(\parfillskip) 0.0
 ..\glue(\rightskip) 0.0
 
-Memory usage before: 990&376; after: 584&370; still untouched: 735
+Memory usage before: 1396&376; after: 788&370; still untouched: 297473
 {restoring \box254=void}
 {restoring \hoffset=0.0pt}
 {restoring \showboxdepth=1}
@@ -1951,7 +1955,7 @@
 
 {\relax}
 {\input}
-(tripos.tex
+(./tripos.tex
 {\par}
 {\uppercase}
 {the character 0}
@@ -2015,7 +2019,7 @@
 
 
 Completed box being shipped out [-2.0.0.0.11]
-\vbox(16383.99998+1.0)x100.0, glue set 16239.0fil
+\vbox(16383.99998+1.0)x100.0, glue set 16238.99998fil
 .\glue(\topskip) 12.0 plus 1.0fil
 .\hbox(8.0+2.0)x100.0, glue set 33.53377
 ..\glue(\leftskip) 3.0
@@ -2186,7 +2190,7 @@
 ..\glue(\parfillskip) 0.0
 ..\glue(\rightskip) 0.0
 
-Memory usage before: 950&531; after: 546&448; still untouched: 706
+Memory usage before: 1400&531; after: 772&448; still untouched: 297444
 {restoring \box254=void}
 {restoring \hoffset=0.0pt}
 {restoring \showboxdepth=1}
@@ -2530,7 +2534,7 @@
 
 
 Completed box being shipped out [-2.0.0.0.11.0.327680]
-\vbox(16383.99998+0.0)x20.0, glue set 16331.0fil
+\vbox(16383.99998+0.0)x20.0, glue set 16330.99998fil
 .\glue(\topskip) 20.0 plus 1.0fil
 .\hbox(0.0+0.0)x11.0, glue set 1.3fil, shifted 1.0
 ..\glue(\leftskip) 3.0
@@ -2572,7 +2576,7 @@
 ..\hbox(0.0+0.0)x0.0
 ..\glue(\tabskip) 0.0 plus 40.0
 
-Memory usage before: 339&413; after: 236&405; still untouched: 706
+Memory usage before: 455&413; after: 296&405; still untouched: 297444
 {restoring \box254=void}
 {restoring \hoffset=0.0pt}
 {restoring \showboxdepth=1}
@@ -3323,7 +3327,7 @@
 
 
 Completed box being shipped out [-2.0.0.0.11.0.327680]
-\vbox(10000.0+2.0)x28.0, glue set 9737.58789fil
+\vbox(10000.0+2.0)x28.0, glue set 9737.58742fil
 .\glue(\topskip) 7.3 plus 1.0fil
 .\hbox(12.7+3.7)x17.0, glue set 0.17223fil, shifted 7.0
 ..\glue(\leftskip) 3.0
@@ -3613,7 +3617,7 @@
 ....\hbox(0.0+0.0)x0.1, shifted -7.0
 .\penalty 7
 
-Memory usage before: 2170&521; after: 1181&459; still untouched: 175
+Memory usage before: 3016&521; after: 1607&459; still untouched: 295444
 {restoring \box254=void}
 {restoring \hoffset=0.0pt}
 {restoring \showboxdepth=1}
@@ -3861,7 +3865,7 @@
 
 Completed box being shipped out [-2.0.0.0.11.0.327680.1572864.0.-1073741
 823]
-\vbox(16383.99998+2.0)x100.0, glue set 16318.0fil
+\vbox(16383.99998+2.0)x100.0, glue set 16317.99997fil
 .\glue(\topskip) 19.0 plus 1.0fil
 .\hbox(1.0+0.0)x90.0, glue set 41.0
 ..\glue(\leftskip) 0.0 plus -10.0fil
@@ -3948,7 +3952,7 @@
 I'm forgetting what you said and using zero instead.
 
 0
-Memory usage before: 640&415; after: 397&410; still untouched: 175
+Memory usage before: 888&415; after: 525&410; still untouched: 295444
 {restoring \box254=void}
 {restoring \hoffset=0.0pt}
 {restoring \showboxdepth=1}
@@ -4031,7 +4035,7 @@
 
 Completed box being shipped out [-2.0.0.0.11.0.327680.1572864.1073741823
 .-1073741823]
-\vbox(16383.99998+0.0)x8236.0, glue set 16344.0fil
+\vbox(16383.99998+0.0)x8236.0, glue set 16343.99998fil
 .\glue(\topskip) 13.0 plus 1.0fil
 .\hbox(7.0+1.0)x100.0, glue set 0.85295
 ..\glue(\leftskip) 3.0
@@ -4050,7 +4054,7 @@
 .\glue(\baselineskip) 10.0 plus 41.0
 .\hbox(0.0+0.0)x-7127.0, shifted 7227.0
 
-Memory usage before: 235&401; after: 178&399; still untouched: 175
+Memory usage before: 307&401; after: 218&399; still untouched: 295444
 {restoring \box254=void}
 {restoring \hoffset=0.0pt}
 {restoring \showboxdepth=1}
@@ -4417,7 +4421,7 @@
 
 Completed box being shipped out [-2.0.0.0.11.196608.327680.1572864.10737
 41823]
-\vbox(16383.99998+0.0)x100.0, glue set 16332.0fil
+\vbox(16383.99998+0.0)x100.0, glue set 16331.99998fil
 .\glue(\topskip) 9.0 plus 1.0fil
 .\vbox(11.0+1.0)x10.0, glue set - 1.0
 ..\hbox(7.0+1.0)x10.0, glue set - 1.0
@@ -4503,7 +4507,7 @@
 ...\glue(\rightskip) 0.0
 ..\glue 10.0 minus 10.0
 
-Memory usage before: 651&432; after: 417&418; still untouched: 175
+Memory usage before: 941&432; after: 565&418; still untouched: 295444
 {restoring \box254=void}
 {restoring \hoffset=0.0pt}
 {restoring \showboxdepth=1}
@@ -4739,7 +4743,7 @@
 
 Completed box being shipped out [-2.2.-1118806.0.11.196608.327680.157286
 4.1073741823]
-\vbox(16383.99998+0.0)x205.12613, glue set 16344.0fil
+\vbox(16383.99998+0.0)x205.12613, glue set 16343.99998fil
 .\glue(\topskip) 0.0 plus 1.0fil
 .\hbox(20.0+2.0)x205.12613, glue set - 0.5
 ..\glue(\tabskip) 0.0154 minus 3.21002
@@ -4825,7 +4829,7 @@
 .\mark{a}
 .\mark{b}
 
-Memory usage before: 776&458; after: 464&452; still untouched: 175
+Memory usage before: 1098&458; after: 630&452; still untouched: 295444
 {restoring \box254=void}
 {restoring \hoffset=0.0pt}
 {restoring \showboxdepth=1}
@@ -6377,7 +6381,7 @@
 {\input}
 {\endinput}
 {\input}
-(tripos.tex
+(./tripos.tex
 \stopinput ->\error \let \input \die 
 {undefined}
 ! Undefined control sequence.
@@ -6592,7 +6596,7 @@
 .etc.
 
 ]
-Memory usage before: 819&428; after: 720&426; still untouched: 175
+Memory usage before: 1155&428; after: 1016&426; still untouched: 295444
 
 ^^M->|relax 
 {vertical mode: |relax}
@@ -7152,7 +7156,7 @@
 % t=3796.80188 plus 332.0 plus 2.0fil plus -803.0fill minus 49.0 g=10000
 .0 b=0 p=-10001 c=-10001#
 [-2.2.-1118806.0.11.196608.327680.1572864.1073741823]
-Memory usage before: 895&439; after: 290&420; still untouched: 175
+Memory usage before: 1269&439; after: 374&420; still untouched: 295444
 {|deadcycles}
 {end-group character }}
 {restoring |output={|showthe |deadcycles |global |advance |ETC.}
@@ -7285,7 +7289,7 @@
 I can't handle that very well; good luck.
 
 unbal
-Memory usage before: 334&431; after: 292&418; still untouched: 175
+Memory usage before: 434&431; after: 376&418; still untouched: 295444
 {vertical mode: end}
  )
 (end occurred inside a group at level 1)
@@ -7293,12 +7297,12 @@
 (end occurred when ifcase on line 419 was incomplete)
 (end occurred when iftrue on line 413 was incomplete) 
 Here is how much of TeX's memory you used:
- 47 strings out of 1674
- 253 string characters out of 8354
- 2825 words of memory out of 3000
- 372 multiletter control sequences out of 2100
+ 44 strings out of 1628
+ 261 string characters out of 15388
+ 4556 words of memory out of 300000
+ 373 multiletter control sequences out of 15000+0
  3041 words of font info for 4 fonts, out of 20000 for 75
- 2 hyphenation exceptions out of 307
+ 1 hyphenation exception out of 659
  7i,7n,9p,113b,38s stack positions out of 200i,40n,60p,500b,600s
 
 Output written on trip.dvi (16 pages, 2920 bytes).
+ eval ../dvitype -output-level=2 -dpi=72.27 '-page-start='\''*.*.*.*.*.*.*.*.*.*'\''' trip.dvi
++ ../dvitype -output-level=2 -dpi=72.27 '-page-start=*.*.*.*.*.*.*.*.*.*' trip.dvi
+ diff -u /home/lunastra/Momonga/pkgs/texlive/BUILD/texlive-2014/texlive-20140525-source/texk/web2c/triptrap/trip.typ trip.typ
--- /home/lunastra/Momonga/pkgs/texlive/BUILD/texlive-2014/texlive-20140525-source/texk/web2c/triptrap/trip.typ 2014-01-20 20:01:30.000000000 +0900
+++ trip.typ    2014-09-06 18:44:21.462187577 +0900
@@ -1,4 +1,4 @@
-This is DVItype, Version 3.6
+This is DVItype, Version 3.6 (TeX Live 2014)
 Options selected:
   Starting page = *.*.*.*.*.*.*.*.*.* 
   Maximum number of pages = 1000000
@@ -6,7 +6,7 @@
   Resolution =  72.27000000 pixels per inch
 numerator/denominator=25400000/473628672
 magnification=2000;       0.00003052 pixels per DVI unit
-' TeX output 2014.01.07:0959'
+' TeX output 2014.09.06:1844'
  
 42: beginning of page 0.0.0.0.11.0.0.0.0.0 
 87: down4 129105920 
@@ -416,7 +416,7 @@
 1075: eop 
  
 1076: beginning of page -2.0.0.0.11.0.327680.0.0.0 
-1121: down4 639342208 
+1121: down4 639342177 
 1126: push 
 1127: push 
 1128: push 
@@ -1084,8 +1084,8 @@
 [M]
 2533: pop 
 2534: pop 
-2535: y4 203921760 
-2540: y0 203921760 
+2535: y4 203921756 
+2540: y0 203921756 
 2541: push 
 2542: push 
 2543: right3 196608 
+ for f in tripin.log trip.fot trip.log trip.typ
+ sed /home/lunastra/Momonga/pkgs/texlive/BUILD/texlive-2014/texlive-20140525-source/texk/web2c/triptrap/tripin.log -f filter
+ sed tripin.log -f filter
+ diff a/tripin.log b/tripin.log
452,453c452,453
< 471 memory locations dumped; current usage is 96&278
< 341 multiletter control sequences
---
> 479 memory locations dumped; current usage is 104&278
> 342 multiletter control sequences
+ is_OK=false
+ for f in tripin.log trip.fot trip.log trip.typ
+ sed /home/lunastra/Momonga/pkgs/texlive/BUILD/texlive-2014/texlive-20140525-source/texk/web2c/triptrap/trip.fot -f filter
+ sed trip.fot -f filter
+ diff a/trip.fot b/trip.fot
17c17
< Memory usage before: 159&313; after: 102&278; still untouched: 1613
---
> Memory usage before: 185&313; after: 112&278; still untouched: 298613
75c75
< Memory usage before: 334&431; after: 292&418; still untouched: 175
---
> Memory usage before: 434&431; after: 376&418; still untouched: 295444
+ is_OK=false
+ for f in tripin.log trip.fot trip.log trip.typ
+ sed /home/lunastra/Momonga/pkgs/texlive/BUILD/texlive-2014/texlive-20140525-source/texk/web2c/triptrap/trip.log -f filter
+ sed trip.log -f filter
+ diff a/trip.log b/trip.log
73c73
< Memory usage before: 159&313; after: 102&278; still untouched: 1613
---
> Memory usage before: 185&313; after: 112&278; still untouched: 298613
642c642
< Memory usage before: 747&484; after: 581&481; still untouched: 1492
---
> Memory usage before: 1027&484; after: 795&481; still untouched: 297492
815c815
< Memory usage before: 475&470; after: 290&466; still untouched: 1473
---
> Memory usage before: 653&470; after: 384&466; still untouched: 297473
915c915
< Memory usage before: 218&459; after: 149&458; still untouched: 1473
---
> Memory usage before: 286&459; after: 181&458; still untouched: 297473
1070c1070
< Memory usage before: 118&328; after: 102&328; still untouched: 1473
---
> Memory usage before: 132&328; after: 110&328; still untouched: 297473
1511c1511
< Memory usage before: 990&376; after: 584&370; still untouched: 735
---
> Memory usage before: 1396&376; after: 788&370; still untouched: 297473
2189c2189
< Memory usage before: 950&531; after: 546&448; still untouched: 706
---
> Memory usage before: 1400&531; after: 772&448; still untouched: 297444
2575c2575
< Memory usage before: 339&413; after: 236&405; still untouched: 706
---
> Memory usage before: 455&413; after: 296&405; still untouched: 297444
3616c3616
< Memory usage before: 2170&521; after: 1181&459; still untouched: 175
---
> Memory usage before: 3016&521; after: 1607&459; still untouched: 295444
3951c3951
< Memory usage before: 640&415; after: 397&410; still untouched: 175
---
> Memory usage before: 888&415; after: 525&410; still untouched: 295444
4053c4053
< Memory usage before: 235&401; after: 178&399; still untouched: 175
---
> Memory usage before: 307&401; after: 218&399; still untouched: 295444
4506c4506
< Memory usage before: 651&432; after: 417&418; still untouched: 175
---
> Memory usage before: 941&432; after: 565&418; still untouched: 295444
4828c4828
< Memory usage before: 776&458; after: 464&452; still untouched: 175
---
> Memory usage before: 1098&458; after: 630&452; still untouched: 295444
6595c6595
< Memory usage before: 819&428; after: 720&426; still untouched: 175
---
> Memory usage before: 1155&428; after: 1016&426; still untouched: 295444
7155c7155
< Memory usage before: 895&439; after: 290&420; still untouched: 175
---
> Memory usage before: 1269&439; after: 374&420; still untouched: 295444
7288c7288
< Memory usage before: 334&431; after: 292&418; still untouched: 175
---
> Memory usage before: 434&431; after: 376&418; still untouched: 295444
7298,7299c7298,7299
<  2825 words of memory out of 3000
<  372 multiletter control sequences out of YYYY
---
>  4556 words of memory out of 300000
>  373 multiletter control sequences out of YYYY
+ is_OK=false
+ for f in tripin.log trip.fot trip.log trip.typ
+ sed /home/lunastra/Momonga/pkgs/texlive/BUILD/texlive-2014/texlive-20140525-source/texk/web2c/triptrap/trip.typ -f filter
+ sed trip.typ -f filter
+ diff a/trip.typ b/trip.typ
+ false
+ echo '*** Error(s) found in trip test, investigate!'
*** Error(s) found in trip test, investigate!
+ exit 1

ARM のクロスコンパイラをビルドする

Parallella (16-core) が面倒な方法を使わなくても日本でも買えるようになってたので頼んでみたのだが、発送が 9 月になるってどういうこと?

来なかったりして。まあいいや。

別に本当はこんなことはしなくても良いのです (Adapteva で配布している Ubuntu の中に開発ツールは一式揃っているため)。でも、Momonga でクロスコンパイルできたらいいかなと思ってメモ。

Rasberry Pi にも応用できると思いますが、詳しいことはわかりません。

メタ情報

項目 内容
インストール先 /opt/parallella
ARM SYSROOT (Little) /opt/parallella/arm-lemomonga-linux-gnueabihf
ARM SYSROOT (Big) /opt/parallella/arm-bemomonga-linux-gnueabihf
ビルドディレクトリ ~/Build

今は Big は使わないけども。ARM だと Little のほうが速いのかな。/opt/parallella 以下は手を入れるので自分で書き換えられるようにしておきます。

ソースの準備

用意するソースは、binutils, gcc, cloog, isl, mpfr, mpc, gmp, glibc と、Parallella の Linux カーネルのソースの 9 個。cloog と isl はなくても良いが、その場合 gcc での最適化に少し影響がある (と思われる)。

$ cd
$ mkdir Build/src
$ cd Build/src
$ wget ftp://ftp.gnu.org/gnu/binutils/binutils-2.23.2.tar.bz2
$ wget ftp://ftp.gnu.org/gnu/gcc/gcc-4.9.0/gcc-4.9.0.tar.bz2
$ wget ftp://gcc.gnu.org/pub/gcc/infrastructure/cloog-0.18.1.tar.gz
$ wget ftp://gcc.gnu.org/pub/gcc/infrastructure/isl-0.12.2.tar.bz2
$ wget ftp://ftp.gnu.org/gnu/mpfr/mpfr-3.1.2.tar.xz
$ wget ftp://ftp.gnu.org/gnu/mpc/mpc-1.0.2.tar.gz
$ wget ftp://ftp.gnu.org/gnu/gmp/gmp-5.1.3.tar.xz
$ wget ftp://ftp.gnu.org/gnu/glibc/glibc-2.19.tar.xz
$ cd ..
$ tar jxvf src/binutils-2.23.2.tar.bz2
$ tar jxvf src/gcc-4.9.0.tar.bz2
   (省略)
$ tar Jxvf src/glibc-2.19.tar.xz
$ git clone https://github.com/parallella/parallella-linux-adi.git

あとからビルドするのは面倒なので、gcc で必要なライブラリをすべて中へ放り込む。

$ cd gcc-4.9.0
$ cp -R ../cloog-0.18.1 cloog
$ cp -R ../gmp-5.1.3 gmp
$ cp -R ../mpfr-3.1.2 mpfr
$ cp -R ../mpc-1.0.2 mpc
$ cp -R ../isl-0.12.2 isl

ネイティブ GCC のビルド

現時点の development では 4.6.4 で、やや古いので、新しいバージョンをビルドしてインストールします。

$ pushd gcc-4.9.0
$ mkdir x86_64-momonga-linux-gnu
$ cd x86_64-momonga-linux-gnu
$ ../configure --prefix=/opt/parallella
$ make
$ make install
$ popd
$ export PATH=/opt/parallella/bin:$PATH
$ export LD_LIBRARY_PATH=/opt/parallella/lib64:$LD_LIBRARY_PATH

(32bit の場合は /opt/parallella/lib64 ではなく /opt/parallella/lib)

ちなみに、このままビルドすると、gcj もビルドしてしまいます。基本的に使うことはないと思いますので、

--enable-languages=c,c++,fortran,lto,objc

と除いてもよいでしょう。ちなみに、gcj をビルドするには gtk や jack などが必要です (64bit かつ --disable-multilib を指定していない場合はこれらのライブラリの 32bit 版も必要です)。更にいうと以下のビルドでは fortran も使いません。

binutils のビルド

まずはネイティブ版から。

$ pushd binutils-2.23.2
$ mkdir x86_64-momonga-linux-gnu
$ cd x86_64-momonga-linux-gnu
$ ../configure \
>   --prefix=/opt/parallella \
>   --disable-werror
$ make
$ make install

次に ARM 用。

$ cd ..
$ mkdir arm-lemomonga-linux-gnueabihf
$ cd arm-lemomonga-linux-gnueabihf
$ ../configure \
>   --prefix=/opt/parallella \
>   --disable-werror \
>   --with-sysroot=/opt/parallella/arm-lemomonga-linux-gnueabihf \
>   --target=arm-lemomonga-linux-gnueabihf
$ make
$ make install

UsrMove をしておきます。include は UsrMove には含まれていませんが、クロスコンパイラはここしか検索しないので、これもリンクを作っておきます。

なぜか glibc の一部のファイルが lib64 以下にインストールされていたので、その回避も。

$ pushd /opt/parallella/arm-lemomonga-linux-gnueabihf
$ mkdir usr
$ mv bin lib usr
$ ln -s usr/bin bin
$ ln -s usr/lib lib
$ ln -s usr/lib64 lib64
$ ln -s usr/sbin sbin
$ ln -s usr/include include
$ cd usr
$ ln -s lib lib64
$ popd
$ popd

カーネルヘッダのインストール

$ pushd parallella-linux-adi
$ make mrproper
$ make ARCH=arm parallella_defconfig
$ make ARCH=arm headers_check
$ make ARCH=arm INSTALL_HDR_PATH=/opt/parallella/arm-lemomonga-linux-gnueabihf/usr headers_install
$ popd

C ヘッダのインストール

といってもまだコンパイラがないので、ダミーでインストールします。

$ cd glibc-2.19
$ mkdir install-headers
$ cd install-headers
$ echo "libc_cv_forced_unwind=yes" > config.cache
$ echo "libc_cv_c_cleanup=yes" >> config.cache
$ ../configure \
>    --prefix=/opt/parallella/arm-lemomonga-linux-gnueabihf/usr \
>    --with-headers=/opt/parallella/arm-lemomonga-linux-gnueabihf/usr/include \
>    --config-cache
$ make -k cross_compiling=yes install-headers
$ cp ../include/gnu/stubs.h /opt/parallella/arm-lemomonga-linux-gnueabihf/usr/include/gnu

gcc のビルド (1 回目)

まずはスレッドと共有ライブラリを無効化し、C だけビルドします。Parallella の Zynq 7010 (Cortex-A9) には neon が付いているようなので、neon-vfpv4 でビルドしちゃいます。なお、汎用的には neon ではないほうが良いようです (References 参照)。

$ pushd gcc-4.9.0
$ mkdir arm-lemomonga-linux-gnueabihf
$ cd arm-lemomonga-linux-gnueabihf
$ ../configure \
>    --prefix=/opt/parallella \
>    --disable-werror \
>    --target=arm-lemomonga-linux-gnueabihf \
>    --with-sysroot=/opt/parallella/arm-lemomonga-linux-gnueabihf \
>    --enable-languages=c \
>    --disable-threads \
>    --disable-shared \
>    --disable-libssp \
>    --enable-__cxa_atexit \
>    --disable-libmudflap \
>    --disable-libgomp \
>    --disable-nls \
>    --disable-libstdcxx \
>    --disable-libatomic \
>    --disable-libquadmath \
>    --disable-cloog \
>    --without-headers \
>    --with-float=hard \
>    --with-fpu=neon-vfpv4 \
>    --with-mode=thumb \
>    --with-arch=armv7-a
$ make
$ make install
$ popd

glibc のビルド (1回目)

さっきインストールしたダミーのヘッダはすべて上書きされます。config.cache の強制はなくても良いかもしれない。 次の libgcc のビルド中、libc.so.6 のパスに SYROOT (/opt/parallella/arm-lemomonga-gnueabihf) が付かないので、まずは SYSROOT のパス付きでインストールします。

$ pushd glibc-2.19
$ mkdir arm-lemomonga-linux-gnueabihf
$ cd arm-lemomonga-linux-gnueabihf
$ echo "libc_cv_forced_unwind=yes" > config.cache
$ echo "libc_cv_c_cleanup=yes" >> config.cache
$ ../configure \
>    --disable-werror \
>    --build=x86_64-momonga-linux-gnu \
>    --host=arm-lemomonga-linux-gnueabihf \
>    --prefix=/opt/parallella/arm-lemomonga-linux-gnueabihf/usr \
>    --disable-multilib \
>    --with-fp \
>    --disable-sjlj-exceptions \
>    --enable-threads=posix \
>    --disable-nscd \
>    --config-cache
$ make -k install-headers cross_compiling=yes
$ make
$ make install
$ popd

gcc のビルド (2 回目)

$ pushd gcc-4.9.0
$ mkdir arm-lemomonga-linux-gnueabihf-r2
$ cd arm-lemomonga-linux-gnueabihf-r2
$ ../configure \
>    --prefix=/opt/parallella \
>    --disable-werror \
>    --target=arm-lemomonga-linux-gnueabihf \
>    --with-sysroot=/opt/parallella/arm-lemomonga-linux-gnueabihf \
>    --enable-languages=c,c++,fortran,lto,objc,obj-c++ \
>    --enable-__cxa_atexit \
>    --with-float=hard \
>    --with-fpu=neon-vfpv4 \
>    --with-mode=thumb \
>    --with-arch=armv7-a \
>    --disable-multilib
$ make
$ make install
$ popd

glibc のビルド (2回目)

普段のコンパイルではライブラリを SYSROOT 付きで検索するので prefix から SYSROOT をとってビルドし直します。gcc のバグな気もしなくもないが。

$ pushd glibc-2.19
$ mkdir arm-lemomonga-linux-gnueabihf-r2
$ cd arm-lemomonga-linux-gnueabihf-r2
$ echo "libc_cv_forced_unwind=yes" > config.cache
$ echo "libc_cv_c_cleanup=yes" >> config.cache
$ ../configure \
>    --disable-werror \
>    --build=x86_64-momonga-linux-gnu \
>    --host=arm-lemomonga-linux-gnueabihf \
>    --prefix=/usr \
>    --disable-multilib \
>    --with-fp \
>    --disable-sjlj-exceptions \
>    --enable-threads=posix \
>    --disable-nscd \
>    --config-cache
$ make
$ make install install_root=/opt/parallella/arm-lemomonga-linux-gnueabihf
$ popd

テスト

[lunastra@teostra sandbox]% cat a.c                                     [12:13]
#include <stdio.h>

float b(float);

int main()
{
  printf("Hello, World, %f\n", b(2.2));
  return 0;
}
[lunastra@teostra sandbox]% cat b.c                                     [12:16]
float b(float u)
{
  return u * 1.2;
}
[lunastra@teostra sandbox]% arm-lemomonga-linux-gnueabihf-gcc --verbose a.c b.c
組み込み spec を使用しています。
COLLECT_GCC=arm-lemomonga-linux-gnueabihf-gcc
COLLECT_LTO_WRAPPER=/opt/parallella/libexec/gcc/arm-lemomonga-linux-gnueabihf/4.9.0/lto-wrapper
ターゲット: arm-lemomonga-linux-gnueabihf
configure 設定: ../configure --prefix=/opt/parallella --disable-werror 
--target=arm-lemomonga-linux-gnueabihf 
--with-sysroot=/opt/parallella/arm-lemomonga-linux-gnueabihf 
--enable-languages=c,c++,fortran,lto,objc,obj-c++ 
--enable-__cxa_atexit --with-float=hard 
--with-fpu=neon-vfpv4 --with-mode=thumb 
--with-arch=armv7-a --disable-multilib
スレッドモデル: posix
gcc バージョン 4.9.0 (GCC) 
COLLECT_GCC_OPTIONS='-v' '-march=armv7-a' '-mfloat-abi=hard' '-mfpu=neon-vfpv4' '-mthumb' '-mtls-dialect=gnu'
 /opt/parallella/libexec/gcc/arm-lemomonga-linux-gnueabihf/4.9.0/cc1 -quiet -v a.c -quiet -dumpbase a.c -march=armv7-a -mfloat-abi=hard -mfpu=neon-vfpv4 -mthumb -mtls-dialect=gnu -auxbase a -version -o /tmp/ccpd0RRc.s
GNU C (GCC) version 4.9.0 (arm-lemomonga-linux-gnueabihf)
        compiled by GNU C version 4.9.0, GMP version 5.1.3, MPFR version 3.1.2, MPC version 1.0.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
存在しないディレクトリ "/opt/parallella/arm-lemomonga-linux-gnueabihf/usr/local/include" を無視します
重複したディレクトリ "/opt/parallella/arm-lemomonga-linux-gnueabihf/usr/include" を無視します
#include "..." の探索はここから始まります:
#include <...> の探索はここから始まります:
 /opt/parallella/lib/gcc/arm-lemomonga-linux-gnueabihf/4.9.0/include
 /opt/parallella/lib/gcc/arm-lemomonga-linux-gnueabihf/4.9.0/include-fixed
 /opt/parallella/lib/gcc/arm-lemomonga-linux-gnueabihf/4.9.0/../../../../arm-lemomonga-linux-gnueabihf/include
探索リストの終わりです。
GNU C (GCC) version 4.9.0 (arm-lemomonga-linux-gnueabihf)
        compiled by GNU C version 4.9.0, GMP version 5.1.3, MPFR version 3.1.2, MPC version 1.0.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 28eb21db3a3ac98e105c2e964d186c02
COLLECT_GCC_OPTIONS='-v' '-march=armv7-a' '-mfloat-abi=hard' '-mfpu=neon-vfpv4' '-mthumb' '-mtls-dialect=gnu'
 /opt/parallella/lib/gcc/arm-lemomonga-linux-gnueabihf/4.9.0/../../../../arm-lemomonga-linux-gnueabihf/bin/as -v -march=armv7-a -mfloat-abi=hard -mfpu=neon-vfpv4 -meabi=5 -o /tmp/ccxP6G8x.o /tmp/ccpd0RRc.s
GNU アセンブラ バージョン 2.23.2 (arm-lemomonga-linux-gnueabihf)、BFD バージョン (GNU Binutils) 2.23.2 を使用
COLLECT_GCC_OPTIONS='-v' '-march=armv7-a' '-mfloat-abi=hard' '-mfpu=neon-vfpv4' '-mthumb' '-mtls-dialect=gnu'
 /opt/parallella/libexec/gcc/arm-lemomonga-linux-gnueabihf/4.9.0/cc1 -quiet -v b.c -quiet -dumpbase b.c -march=armv7-a -mfloat-abi=hard -mfpu=neon-vfpv4 -mthumb -mtls-dialect=gnu -auxbase b -version -o /tmp/ccpd0RRc.s
GNU C (GCC) version 4.9.0 (arm-lemomonga-linux-gnueabihf)
        compiled by GNU C version 4.9.0, GMP version 5.1.3, MPFR version 3.1.2, MPC version 1.0.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
存在しないディレクトリ "/opt/parallella/arm-lemomonga-linux-gnueabihf/usr/local/include" を無視します
重複したディレクトリ "/opt/parallella/arm-lemomonga-linux-gnueabihf/usr/include" を無視します
#include "..." の探索はここから始まります:
#include <...> の探索はここから始まります:
 /opt/parallella/lib/gcc/arm-lemomonga-linux-gnueabihf/4.9.0/include
 /opt/parallella/lib/gcc/arm-lemomonga-linux-gnueabihf/4.9.0/include-fixed
 /opt/parallella/lib/gcc/arm-lemomonga-linux-gnueabihf/4.9.0/../../../../arm-lemomonga-linux-gnueabihf/include
探索リストの終わりです。
GNU C (GCC) version 4.9.0 (arm-lemomonga-linux-gnueabihf)
        compiled by GNU C version 4.9.0, GMP version 5.1.3, MPFR version 3.1.2, MPC version 1.0.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 28eb21db3a3ac98e105c2e964d186c02
COLLECT_GCC_OPTIONS='-v' '-march=armv7-a' '-mfloat-abi=hard' '-mfpu=neon-vfpv4' '-mthumb' '-mtls-dialect=gnu'
 /opt/parallella/lib/gcc/arm-lemomonga-linux-gnueabihf/4.9.0/../../../../arm-lemomonga-linux-gnueabihf/bin/as -v -march=armv7-a -mfloat-abi=hard -mfpu=neon-vfpv4 -meabi=5 -o /tmp/cckiRjvT.o /tmp/ccpd0RRc.s
GNU アセンブラ バージョン 2.23.2 (arm-lemomonga-linux-gnueabihf)、BFD バージョン (GNU Binutils) 2.23.2 を使用
COMPILER_PATH=/opt/parallella/libexec/gcc/arm-lemomonga-linux-gnueabihf/4.9.0/:/opt/parallella/libexec/gcc/arm-lemomonga-linux-gnueabihf/4.9.0/:/opt/parallella/libexec/gcc/arm-lemomonga-linux-gnueabihf/:/opt/parallella/lib/gcc/arm-lemomonga-linux-gnueabihf/4.9.0/:/opt/parallella/lib/gcc/arm-lemomonga-linux-gnueabihf/:/opt/parallella/lib/gcc/arm-lemomonga-linux-gnueabihf/4.9.0/../../../../arm-lemomonga-linux-gnueabihf/bin/
LIBRARY_PATH=/opt/parallella/lib/gcc/arm-lemomonga-linux-gnueabihf/4.9.0/:/opt/parallella/lib/gcc/arm-lemomonga-linux-gnueabihf/4.9.0/../../../../arm-lemomonga-linux-gnueabihf/lib/:/opt/parallella/arm-lemomonga-linux-gnueabihf/lib/:/opt/parallella/arm-lemomonga-linux-gnueabihf/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-march=armv7-a' '-mfloat-abi=hard' '-mfpu=neon-vfpv4' '-mthumb' '-mtls-dialect=gnu'
 /opt/parallella/libexec/gcc/arm-lemomonga-linux-gnueabihf/4.9.0/collect2
 -plugin /opt/parallella/libexec/gcc/arm-lemomonga-linux-gnueabihf/4.9.0/liblto_plugin.so
 -plugin-opt=/opt/parallella/libexec/gcc/arm-lemomonga-linux-gnueabihf/4.9.0/lto-wrapper
 -plugin-opt=-fresolution=/tmp/ccu376Te.res -plugin-opt=-pass-through=-lgcc
 -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc
 -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s
 --sysroot=/opt/parallella/arm-lemomonga-linux-gnueabihf
 --eh-frame-hdr -dynamic-linker /lib/ld-linux-armhf.so.3 -X
 -m armelf_linux_eabi /opt/parallella/lib/gcc/arm-lemomonga-linux-gnueabihf/4.9.0/../../../../arm-lemomonga-linux-gnueabihf/lib/crt1.o
 /opt/parallella/lib/gcc/arm-lemomonga-linux-gnueabihf/4.9.0/../../../../arm-lemomonga-linux-gnueabihf/lib/crti.o
 /opt/parallella/lib/gcc/arm-lemomonga-linux-gnueabihf/4.9.0/crtbegin.o
 -L/opt/parallella/lib/gcc/arm-lemomonga-linux-gnueabihf/4.9.0
 -L/opt/parallella/lib/gcc/arm-lemomonga-linux-gnueabihf/4.9.0/../../../../arm-lemomonga-linux-gnueabihf/lib
 -L/opt/parallella/arm-lemomonga-linux-gnueabihf/lib
 -L/opt/parallella/arm-lemomonga-linux-gnueabihf/usr/lib
 /tmp/ccxP6G8x.o /tmp/cckiRjvT.o
 -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed
 -lgcc_s --no-as-needed /opt/parallella/lib/gcc/arm-lemomonga-linux-gnueabihf/4.9.0/crtend.o
 /opt/parallella/lib/gcc/arm-lemomonga-linux-gnueabihf/4.9.0/../../../../arm-lemomonga-linux-gnueabihf/lib/crtn.o
[lunastra@teostra sandbox]% arm-lemomonga-linux-gnueabihf-objdump -d a.out     

a.out:     ファイル形式 elf32-littlearm

(略)

セクション .text の逆アセンブル:
(略)

000083b4 <main>:
    83b4:       b580            push    {r7, lr}
    83b6:       af00            add     r7, sp, #0
    83b8:       ed9f 0a09       vldr    s0, [pc, #36]   ; 83e0 <main+0x2c>
    83bc:       f000 f814       bl      83e8 <b>
    83c0:       eef0 7a40       vmov.f32        s15, s0
    83c4:       eef7 0ae7       vcvt.f64.f32    d16, s15
    83c8:       f248 4070       movw    r0, #33904      ; 0x8470
    83cc:       f2c0 0000       movt    r0, #0
    83d0:       ec53 2b30       vmov    r2, r3, d16
    83d4:       f7ff ef64       blx     82a0 <_init+0x20>
    83d8:       2300            movs    r3, #0
    83da:       4618            mov     r0, r3
    83dc:       bd80            pop     {r7, pc}
    83de:       bf00            nop
    83e0:       400ccccd        .word   0x400ccccd
    83e4:       00000000        .word   0x00000000

000083e8 <b>:
    83e8:       b480            push    {r7}
    83ea:       b083            sub     sp, #12
    83ec:       af00            add     r7, sp, #0
    83ee:       ed87 0a01       vstr    s0, [r7, #4]
    83f2:       edd7 7a01       vldr    s15, [r7, #4]
    83f6:       eef7 1ae7       vcvt.f64.f32    d17, s15
    83fa:       eddf 0b07       vldr    d16, [pc, #28]  ; 8418 <b+0x30>
    83fe:       ee61 0ba0       vmul.f64        d16, d17, d16
    8402:       eef7 7be0       vcvt.f32.f64    s15, d16
    8406:       eeb0 0a67       vmov.f32        s0, s15
    840a:       370c            adds    r7, #12
    840c:       46bd            mov     sp, r7
    840e:       f85d 7b04       ldr.w   r7, [sp], #4
    8412:       4770            bx      lr
    8414:       f3af 8000       nop.w
    8418:       33333333        .word   0x33333333
    841c:       3ff33333        .word   0x3ff33333

まとめ

gmp や mpfr などを shared にしたかったけど、パス。

References

Final Fantasy Tactics をいじって遊ぶ

はじめに (重要)

  1. この記事ではデータの改造チートを扱っています。この記事の真似をして無関係のデータが破壊されたなど何らかの損害を被ったとしても私は責任を負えません。
  2. パソコンを別の作業に使用している間の暇つぶし等でプレイするため、PSP に CFW と CWCHEAT を入れて使いますが、プレイするのは PS 版の FFT です。また、自分で所持している FFT を××してプレイするため初期版なのか後期版なのか、はたまたアーカイブスで配布しているバージョンと同じものかは知るよしもありません。少なくとも、2つある武器増殖バグのうち、二刀流がなくてもできる方法は修正されているバージョンのようです。
  3. PSP 版でも異なるコードで同じことができるようですが、見かけたページに載っていたSSでは、ルカヴィたちのHPとMPの補正値が最初から10倍されているように見えるため、HP/MP が低いというスリル感はなくなります。
    • PS 版のルカヴィは、戦闘時、特定のメモリアドレスにルカヴィのデータを読み込んだ場合(もちろん、敵用の場所)に補正値を10倍する、という処理になっているため、チートでは補正値を10倍することはできません。
  4. あくまで自己満足です。

ルール

ネタとしては、他にもやった人はいそうだが。簡単に言うとルカヴィ集団でクリアを目指す、というもの。

使用するルカヴィたち

選定の理由は主に姿から、第2に性能 (HP/MP/Speed/AT/MA) である。キュクレインザルエラは姿が残念なため使用しない。ザルエラはアビリティまで含めればそこそこ使えそうだが、やはり MP がなぁ…。

  • ベリアス (魔人)
  • ハシュマリム (統制者)
  • アドラメレク (憤怒の霊帝)
  • エリディブス (サーペンタリウス) (以下エリディブスと呼ぶには畏れ多いのでエーピオネと呼ぶことにする。エーピオネはチョコボデータにおける彼のデフォルトネームである。)
    • おまけ
  • アルケオデーモン

本当はアルテマを使いたかったが、彼(彼女?)のジョブである「聖天使」は以下に示す方法で登場させると、メインのアクションアビリティが存在しておらず、また、スプライト用のメモリが足りなくなるのかプレイに支障はないものの他のルカヴィたちと一緒にいるとどっちかの表示がおかしくなるため断念。

なので空いてしまう5人目の枠にデーモンを1体召喚する。

セットする武器・防具

  • 武器/防具/アクセサリは一切装備しない(チートを適用する前に装備を解除する)。
    • ハシュマリムのスピードルーインについては、剣をアクセサリ等手以外に装備すれば使えるようになり、通常攻撃のアニメーションもおかしくならない。が、使いにくい技であることは間違いないので、とりあえず使わないで進める。モンスター化してしまうと戦闘時に装備が外れるためどう頑張っても無理だった(ただし、ハシュマリムは実際の登場時は男性型ルカヴィ(=断末魔が男性キャラ)なので、モンスター化しなくても良かったのかも)
    • ちなみに、モンスターとして取り扱われるため、装備にはチートを使う必要あり。

セットするサブアクションアビリティ

これが一番ゲームバランスを左右する要素であると思う。MP が少ないため、彼らが敵として登場する時のサブアクションアビリティでは、(恐怖がそこそこ使えるのでそもそも使う機会があまりないかもしれないが)序盤から中盤、最悪の場合、終盤になってもろくにこれらの魔法を活用できないため、以下のルールでもって変更を良しとする。

  • エーピオネとアルケオデーモン
    • 彼らはもともとサブをセットしてないため、ここではセット禁止。
  • ベリアス
    • 「魔人召喚」は「召喚魔法」のサブセットであるため、「召喚魔法」の使用も可とする。召喚魔法は魔人だけではないが…。
  • ハシュマリム
    • 「次元魔法」は「時魔法」のメテオを含んでいるため、「時魔法」の使用も可とする。
  • アドラメレク

    • 「全魔法」には「白魔法」「黒魔法」「時魔法」「召喚魔法」を含んでいるため、「白魔法」「黒魔法」「時魔法」「召喚魔法」の使用も可とする。
  • 装備と同様変更にはチートが必要となる。また、これらのアビリティを覚えるのにもチートが必要(転生する前に覚えさせれば使えるが、面倒な上、意味がないのでチートを使用)。

セットするリアクションアビリティ

モンスター的な扱いであるため、標準以外は付けない。要するに、

  • エーピオネとアルケオデーモンには「カウンター」
  • それ以外はなし。

  • ジョブチェンジしたあと1戦交えると自動的にセットされる。

セットするサポート・ムーブアビリティ

  • セットしない。

初期能力値

初期能力値は成長値・補正値をかける前の値であるが、Lv. 1 の人間のパラメータを使うと HP が少し弱くなってしまうため、モンスターのパラメータを使用してもよいものとする (この場合、MP の値はかなり下がる)。

具体的な値は以下の通り。

データは、ここから。

初期値
HP 35-37.999...
MP 8-8.999...
Sp 5
AT 5-5.999...
MA 5-5.999...
ハシュ アドラ ベリア エーピ アルケ
HP成長 12 12 12 10 8
HP補正 83 90 90 100 140
MP成長 10 10 10 8 9
MP補正 87 95 85 150 200
Sp成長 ≒100 ≒100 ≒200 ≒200 100
Sp補正 ≒140 ≒150 ≒140 ≒90 111
AT成長 ≒35 ≒58 ≒45 ≒50 39
AT補正 ≒150 ≒160 ≒150 ≒45 130
MA成長 ≒40 ≒80 ≒200 ≒140 45
MA補正 ≒150 ≒130 ≒200 ≒200 145

ここまで調べて思ったのだが、エーピオネ以外はHPが低いだけでそこそこ活躍できるのかも。

クリアするマップ

最初のオーボンヌ修道院での戦闘はこういったチートが有効だとスタックしてしまう。 その後の魔法都市ガリランドでの戦闘ではチートが使えるが、編成画面がないため、装備やアビリティを外すチートが別途必要になり面倒である。 よってそのあとのマンダリア平原から。 終わりは未定。

その他

  • ラムザは適当なコードを使って転生させると除名できるようになるため、除名して雇い直す。
  • ラムザ不在の影響
    • 戦闘中会話は条件を満たせなくなるためほとんど発生しなくなるだけ。戦闘前後はどこからともなくラムザの声が聞こえてくる。いずれもプレイには問題ない模様。
    • ライオネル城の城門はラムザでないと開けられないが、クリアには支障がないので開けない。
    • ベスラ要塞の水門もラムザでないと開けられないが、こちらはクリアに支障があるので、ラムザを用意しておく。
    • リオファネス城のウィーグラフ戦ではラムザがいないとマップに登場せず、味方不在により即ゲームオーバーとなるため(笑)、これもラムザを用意しておく。
  • 動画にするつもりはない(AV出力コードもキャプチャ機、DVDレコーダーいずれも持っていないため)。

使用するチートまとめ

  • ユニットをモンスター化(断末魔、星座相性、戦士斡旋所での名前変更の判定用)
  • ユニットを転生(エーピオネ、アルケオデーモンは汎用モンスター扱い)
  • ユニットのジョブを変更(エーピオネとアルケオデーモンのジョブをサーペンタリウス、アルケオデーモンにするのに必要。他は通常の方法でジョブチェンジする)
  • ユニットの星座を変更(全員雇い直すと初期の所持金では不足するため)
  • パラメータ調整
  • 装備(必要な場合、ハシュマリムのアクセサリにナグラロクを装備させるのみ)
  • アビリティのセット、習得。
  • 無限ループや例外などで詰む場合の回避
Addr. Value Notes
300552F8 00000045 1人目キャラ : アドラメレク
300553F8 00000040 2人目キャラ : ハシュマリム
300554F8 0000003C 3人目キャラ : ベリアス
300555F8 00000082 4人目キャラ : モンスター
300556F8 00000082 5人目キャラ : モンスター
300555FA 00000097 4人目ジョブ : サーペンタリウス
300556FA 00000099 5人目ジョブ : アルケオデーモン
300552FE 00000090 1人目星座 : 磨羯
300553FE 00000040 2人目星座 : 獅子
300554FE 00000000 3人目星座 : 白羊
300555FE 000000C0 4人目星座 : 蛇遣
300552FF 00000078 1人目サブアクションアビリティ : 全魔法(アドラメレク
300552FF 0000000A 1人目サブアクションアビリティ : 白魔法
300552FF 0000000B 1人目サブアクションアビリティ : 黒魔法
300552FF 0000000C 1人目サブアクションアビリティ : 時魔法
300552FF 0000000D 1人目サブアクションアビリティ : 召喚魔法
300553FF 00000070 2人目サブアクションアビリティ : 次元魔法
300553FF 0000000C 2人目サブアクションアビリティ : 時魔法
300554FF 00000068 3人目サブアクションアビリティ : 魔人召喚
300554FF 0000000D 3人目サブアクションアビリティ : 召喚魔法
30055408 0000001F 2人目アクセサリ装備 : ナグラロク
30055323 000000FF 1人目固有Aアビリティ習得 (恐怖・暗雲・闇魔術に対応)
30055324 000000FF 1人目固有Aアビリティ習得 (全魔法等に対応)
30055332 000000FF 1人目白魔法習得 (ケアル〜リジェネ)
30055333 000000FE 1人目白魔法習得 (プロテス〜ホーリー)
30055335 000000FF 1人目黒魔法習得 (ファイア〜サンダジャ)
30055336 000000FF 1人目黒魔法習得 (ブリザド〜フレア)
30055338 000000FF 1人目時魔法習得 (ヘイスト〜リフレク)
30055339 000000F0 1人目時魔法習得 (クイック〜メテオ)
3005533B 000000FF 1人目召喚魔法習得 (モーグリ〜バハムート)
3005533C 000000FF 1人目召喚魔法習得 (オーディンゾディアーク)
30055423 000000FF 2人目固有Aアビリティ習得
30055424 000000FF 2人目固有Aアビリティ習得
30055438 000000FF 2人目時魔法習得
30055439 000000F0 2人目時魔法習得
30055523 000000FF 3人目固有Aアビリティ習得
30055524 000000FF 3人目固有Aアビリティ習得
3005553B 000000FF 3人目召喚魔法習得
3005553C 000000FF 3人目召喚魔法習得
30055623 000000FF 4人目固有Aアビリティ習得
30055723 000000FF 5人目固有Aアビリティ習得
-------- -------- (以下戦闘開始時に適用)
D018E88E 00000001 コントロール用マスターコード?
3019049E 00000020 1人目性別判定・ST表示有無 : モンスター、有り
3019065E 00000020 2人目性別判定・ST表示有無 : モンスター、有り
3019081E 00000020 3人目性別判定・ST表示有無 : モンスター、有り
301909DE 00000020 4人目性別判定・ST表示有無 : モンスター、有り
30190B9E 00000020 5人目性別判定・ST表示有無 : モンスター、有り
-------- -------- (ベスラ要塞など必要な時)
300558F8 00000000 7人目キャラ : ラムザ(第1章)
300558F8 00000001 7人目キャラ : ラムザ(第2章)
300558F8 00000002 7人目キャラ : ラムザ(第3章)
300558F8 00000003 7人目キャラ : ラムザ(第4章)

Acknowledgements

素敵なコードを見つけてくれた方々に感謝。

後日談

(2015/11/4 追記。やらなくなったのはもうだいぶ前だが。)

  • 失われた聖域の難易度が激高。クリアできたのはこの前まで。
  • (すでに知られているかもしれないが) イグーロス城のダイスダーク戦で、味方のアドラメレクを戦闘不能にさせると、そのまま戦闘が終了し、兄さんたちの生存ルートができる。嬉しくないし、もちろん、その後のストーリーが変わるわけでもないけど。
    • 勝利条件の判定は基本的にはちゃんと敵側でやっている(っぽい)ので、イグーロス城以外でこのトリックは使えない。
    • ダイスダーク戦の間も「アドラメレクを倒せ」の勝利条件の判定が存在していて、味方も判定の対象になっている不思議。デバッグ用か?
    • 当のアドラメレクはそのイベントで消滅するが、その後の編成画面ではちゃんといるのでご安心を (?)。

f:id:lugia:20140711220620j:plain

TeX Live 2014 - その 1

時間があるときに少しずつ TeX Live のパッケージし直し作業をしていて、とりあえず 2013 で調整していたが、昨日見たら 5/25 に 2014 がリリースされていたので、2014 へ移行することにした。TeX wiki を見るといくつか不具合が上がっていたりしているみたいなので、2014 にしたほうがよさそう。

2013 は特別問題なくビルドはできていたので、2014 も問題ないだろうと思っていたら、そんなことはなかった。

ビルド

見やすいようにバックスラッシュと改行を追加した。

+ ./configure --build=x86_64-unknown-linux-gnu \
              --host=x86_64-unknown-linux-gnu \
              --target=x86_64-momonga-linux \
              --program-prefix= \
              --prefix=/usr \
              --exec-prefix=/usr \
              --bindir=/usr/bin \
              --sbindir=/usr/sbin \
              --sysconfdir=/etc \
              --datadir=/usr/share \
              --includedir=/usr/include \
              --libdir=/usr/lib64 \
              --libexecdir=/usr/libexec \
              --localstatedir=/var \
              --sharedstatedir=/usr/com \
              --mandir=/usr/share/man \
              --infodir=/usr/share/info \
             '--with-banner-add=built for Momonga Linux' \
              --disable-native-texlive-build \
              --enable-tex-synctex \
              --enable-etex \
              --enable-shared \
              --enable-xindy \
              --disable-xindy-docs \
              --with-system-gd \
              --with-system-libpng \
              --with-system-cairo \
              --with-system-t1lib \
              --with-system-libgs \
              --with-system-icu \
              --with-system-zziplib \
              --with-system-freetype2 \
              --with-system-teckit \
              --with-system-harfbuzz \
              --with-system-xpdf \
              --with-system-zlib \
              --with-system-poppler \
              --with-system-pixman \
              --with-system-potrace \
              --with-system-libpaper \
              --with-xdvi-x-toolkit=motif \
              --with-x \
              --with-clisp-runtime=system

(中略)

checking for x86_64-unknown-linux-gnu-freetype-config... no
checking for freetype-config... freetype-config
checking kpathsea/version.h usability... yes
checking kpathsea/version.h presence... yes
checking for kpathsea/version.h... yes
configure: error: Sorry, you need libpng
=== configuring in dvipdfm-x failed
make[2]: *** [recurse] Error 1
make[2]: Leaving directory  `/home/lunastra/Momonga/pkgs/texlive/BUILD/texlive-2014/build/texk'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/lunastra/Momonga/pkgs/texlive/BUILD/texlive-2014/build/texk'
make: *** [all-recursive] Error 1
エラー: /var/tmp/rpm-tmp.v1wjij の不正な終了ステータス (%build)

ん?

configure: error: Sorry, you need libpng

入ってないわけなかろう。

> rpm -q libpng-devel
libpng-devel-1.2.51-1m.mo8.x86_64

原因調査

> less texlive-20140525-source/texk/dvipdfm-x/configure.ac

....

KPSE_ADD_FLAGS([libpng])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <png.h>]],
                                [[png_const_structp png; png_const_infop info; int err;
                                  err=png_get_image_width(png, info);]])],
               [],
               [AC_MSG_ERROR([Sorry, you need libpng])])

ふむ。ログは、と。

libtool: link: gcc -o .libs/conftest -O2 -pipe -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -Wno-unused-but-set-variable -Wno-unused-but-set-parameter -m64 -mtune=generic -fPIC -I/usr/include/libpng12 -I/home/lunastra/Momonga/pkgs/texlive/BUILD/texlive-2014/build/texk -I/home/lunastra/Momonga/pkgs/texlive/BUILD/texlive-2014/texlive-20140525-source/texk conftest.c  -lpng12 -lz /home/lunastra/Momonga/pkgs/texlive/BUILD/texlive-2014/build/texk/kpathsea/.libs/libkpathsea.so -lm -Wl,-rpath -Wl,/usr/lib64
conftest.c: In function 'main':
conftest.c:68:1: error: unknown type name 'png_const_structp'
conftest.c:68:24: error: unknown type name 'png_const_infop'
conftest.c:69:35: warning: passing argument 1 of 'png_get_image_width' makes pointer from integer without a cast [enabled by default]
/usr/include/libpng12/png.h:2293:8: note: expected 'png_structp' but argument is of type 'int'
conftest.c:69:35: warning: passing argument 2 of 'png_get_image_width' makes pointer from integer without a cast [enabled by default]
/usr/include/libpng12/png.h:2293:8: note: expected 'png_infop' but argument is of type 'int'

ChangeLog も見るか。

2014-01-02  Peter Breitenlohner  <peb@...>

        * pngimage.c: Allow libpng >= 1.6.3 to read images with
        incorrect CMF bytes.

なるほど。新しいバージョンの libpng が必要なわけですな。

なのだが、

> pwd
/home/lunastra/Momonga/pkgs/texlive/BUILD/texlive-2014/texlive-20140525-source/texk/dvipdfm-x
> grep -R png\\.h *
README:     http://www.libpng.org/pub/png/libpng.html
configure:$(LIBPNG_DEPEND): ${top_builddir}/../../libs/libpng/include/png.h
configure:${top_builddir}/../../libs/libpng/include/png.h:
configure:#include <png.h>
configure.ac:AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <png.h>]],
pngimage.c:#include <png.h>
> gcc -c pngimage.c 
>

バージョンチェックに使っているのみでコンパイル自体は通りそう。というわけでパッチを作成。

--- texlive-20140525-source/texk/dvipdfm-x/configure.orig       2014-03-18 01:24:19.000000000 +0900
+++ texlive-20140525-source/texk/dvipdfm-x/configure    2014-06-22 18:03:46.857922497 +0900
@@ -15715,7 +15715,7 @@
 int
 main ()
 {
-png_const_structp png; png_const_infop info; int err;
+png_structp png; png_infop info; int err;
                                   err=png_get_image_width(png, info);
   ;
   return 0;

まあ、どうせ libpng のバージョンは上げるらしいから一時的なものということで。

RPM ビルドエラー:
    インストール済み(ただし未伸張)ファイルが見つかりました:
   /usr/bin/a2ping
   /usr/bin/a5toa4
   /usr/bin/adhocfilelist
   /usr/bin/afm2afm
   /usr/bin/afm2pl
   /usr/bin/afm2tfm
   /usr/bin/aleph
   /usr/bin/allcm
   /usr/bin/allec
   /usr/bin/allneeded
   /usr/bin/arara
   /usr/bin/arlatex
(以下略)

おお、ビルド通った。

ちなみに、harfbuzz には graphite2 関係のヘッダファイルが(修正済)、potrace にはライブラリがごっそり抜けているが texlive をビルドする際に必要なので、texlive を上げるときに(有効になっていなければ)一緒に有効にしたいと思います。

バンドルされている libpng じゃダメなのかっていう話も多分あるだろうけど、システムにインストールされているのを使うライブラリとバンドルを使うライブラリのライブラリの組み合わせによってだと思うが、なんかうまく行かなかった。

とりあえず、終わり。次はいつだろう。

Qt5

Windows で Qt5 と戯れていたけどいつの間にか Momonga にもいたのか。

というわけで早速使ってみた。 (うちは LANG=ja_JP.utf-8英語キーボードという状態)

どのアプリを起動しても

Error:    Couldn't find file "symbols/en" in include paths
Error:    1 include paths searched:
Error:          /usr/share/X11/xkb
Error:    1 include paths could not be added:
Error:          /home/lunastra/.xkb
Error:    Abandoning symbols file "(unnamed)"
Error:    Failed to compile xkb_symbols
Error:    Failed to compile keymap
Qt: Failed to compile a keymap

というエラーが出てたので少し調べていたのだが、キーボードの種類 (言語?) が en で、/usr/share/X11/xkb/symbols/en がないよっていう話みたいなので、

$ mkdir -p ~/.xkb/symbols
$ ln -s /usr/share/X11/xkb/symbols/us ~/.xkb/symbols/en

してやったら出なくなった。

でもなぜ us ではなく en なのかは謎。果たしてこれで良いのかも謎。このキーボードは Mitsumi 製で、別にUS-Internationalでもありませんしね。

f:id:lugia:20140416001652p:plain

上から (メインのテキストには MigMix 2M のフォントを指定している。)

  • デザイナ内での表示
  • デザイナでのプレビュー
  • 実際にプログラムに組み込んだ際の表示

果たして fontconfig の設定で直せるんだろうか (メインのテキストの英字部分に MigMix 2M が適用されたのはわかるが、それ以外はすべて中国語のフォントになっている)。

Linuxに

もどってきた。

それにしてもかなり重くなったなぁ。

f:id:lugia:20140110225029p:plain

えーと、うちの子は NVIDIAGeForce 7100 なので、NVIDIAプロプライエタリなドライバを使う場合、304.xx 以下じゃないといけないわけです。

結構長い間 304.88 のままだったから、kernel 3.12.x になった時にカーネルモジュールがビルドできなくなって、もうサポートされなくなるなと思って OpenIndiana を使っていたんだけど、

そんなことはなかったぜ…みたいな。

…と言っても、現時点でもベータ版の方を見に行かないとないけど。

ちなみに、うちの環境では nouveau-1.0.9 のドライバで 3D を表示させると見るに耐えない映像になる (か、クラッシュする) のでプロプライエタリなドライバを使っているのはそういう理由であります。 (ちなみに 3D と言っても Minecraft ではなくて…)

TeX のパッケージングの続きでもやりますかな。