No Description

Hiroaki Sakai 103ffe29f1 We implemented mmap (). Specifically, see README. 17 years ago
wonx 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
COPYING 3c624a304e Initial version 18 years ago
COPYRIGHT 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
HISTORY 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
MANUAL c0b964b4f4 Added dummy function of _asm_*(). 3 months ago
Makefile 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
OMAKE.jpn 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
Obj.c 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
Obj.h 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
ObjP.h d3f3c6903d Corresponding to colorization. Added XColorGC class for GC management. (It diverted from XFireworks) 3 months ago
README 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
UNIXSerialPort.c 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
UNIXSerialPort.h c0b964b4f4 Added dummy function of _asm_*(). 3 months ago
UNIXSerialPortP.h c0b964b4f4 Added dummy function of _asm_*(). 3 months ago
UNIXTimer.c 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
UNIXTimer.h c0b964b4f4 Added dummy function of _asm_*(). 3 months ago
UNIXTimerP.h f25d7235fb Changed official name from Wonx to WonX. 3 months ago
WWCharacter.c 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
WWCharacter.h 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
WWCharacterP.h d1cde9116a Added dump of RGB value when dumping palette data. 3 months ago
WWColorMap.c 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
WWColorMap.h c0b964b4f4 Added dummy function of _asm_*(). 3 months ago
WWColorMapP.h 3c624a304e Initial version 18 years ago
WWCursor.c 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
WWCursor.h c0b964b4f4 Added dummy function of _asm_*(). 3 months ago
WWCursorP.h c0b964b4f4 Added dummy function of _asm_*(). 3 months ago
WWDisplay.c 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
WWDisplay.h d3f3c6903d Corresponding to colorization. Added XColorGC class for GC management. (It diverted from XFireworks) 3 months ago
WWDisplayP.h d3f3c6903d Corresponding to colorization. Added XColorGC class for GC management. (It diverted from XFireworks) 3 months ago
WWInterrupt.c c0b964b4f4 Added dummy function of _asm_*(). 3 months ago
WWInterrupt.h 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
WWInterruptP.h 0f43e6d6ee Added interrupt handling. Timer interrupt support. 3 months ago
WWLCDPanel.c 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
WWLCDPanel.h d3f3c6903d Corresponding to colorization. Added XColorGC class for GC management. (It diverted from XFireworks) 3 months ago
WWLCDPanelP.h d3f3c6903d Corresponding to colorization. Added XColorGC class for GC management. (It diverted from XFireworks) 3 months ago
WWPalette.c 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
WWPalette.h d3f3c6903d Corresponding to colorization. Added XColorGC class for GC management. (It diverted from XFireworks) 3 months ago
WWPaletteP.h d3f3c6903d Corresponding to colorization. Added XColorGC class for GC management. (It diverted from XFireworks) 3 months ago
WWScreen.c 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
WWScreen.h d3f3c6903d Corresponding to colorization. Added XColorGC class for GC management. (It diverted from XFireworks) 3 months ago
WWScreenP.h 96b108c909 In UNIXTimer.c, callback function is called every time the callback function is called 3 months ago
WWSerialPort.c 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
WWSerialPort.h 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
WWSerialPortP.h c0b964b4f4 Added dummy function of _asm_*(). 3 months ago
WWSprite.c 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
WWSprite.h d3f3c6903d Corresponding to colorization. Added XColorGC class for GC management. (It diverted from XFireworks) 3 months ago
WWSpriteP.h 3c624a304e Initial version 18 years ago
WWText.c 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
WWText.h d3f3c6903d Corresponding to colorization. Added XColorGC class for GC management. (It diverted from XFireworks) 3 months ago
WWTextFonts.c d3f3c6903d Corresponding to colorization. Added XColorGC class for GC management. (It diverted from XFireworks) 3 months ago
WWTextP.h d3f3c6903d Corresponding to colorization. Added XColorGC class for GC management. (It diverted from XFireworks) 3 months ago
WWTimer.c 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
WWTimer.h 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
WWTimerP.h 0f43e6d6ee Added interrupt handling. Timer interrupt support. 3 months ago
WonX.c 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
WonX.h 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
WonXDisplay.c 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
WonXDisplay.h 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
WonXDisplayP.h f25d7235fb Changed official name from Wonx to WonX. 3 months ago
WonXP.h c0b964b4f4 Added dummy function of _asm_*(). 3 months ago
WonXSerialPort.c c0b964b4f4 Added dummy function of _asm_*(). 3 months ago
WonXSerialPort.h c0b964b4f4 Added dummy function of _asm_*(). 3 months ago
WonXSerialPortP.h c0b964b4f4 Added dummy function of _asm_*(). 3 months ago
WonXSystem.c 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
WonXSystem.h c0b964b4f4 Added dummy function of _asm_*(). 3 months ago
WonXSystemP.h f25d7235fb Changed official name from Wonx to WonX. 3 months ago
XColorGC.c d3f3c6903d Corresponding to colorization. Added XColorGC class for GC management. (It diverted from XFireworks) 3 months ago
XColorGC.h d3f3c6903d Corresponding to colorization. Added XColorGC class for GC management. (It diverted from XFireworks) 3 months ago
XColorGCP.h d3f3c6903d Corresponding to colorization. Added XColorGC class for GC management. (It diverted from XFireworks) 3 months ago
XDisplay.c 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
XDisplay.h 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
XDisplayP.h 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
bank.c 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
challsrc.sh 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
comm.c 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
disp.c 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
etc.c d1cde9116a Added dump of RGB value when dumping palette data. 3 months ago
etc.h d1cde9116a Added dump of RGB value when dumping palette data. 3 months ago
fcntl.c 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
filters.perl 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
findperl.sh 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
int2sint.perl 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
key.c 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
libwwc.c 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
makefile_for_smac 5e1a9795b7 Create your own header file. It became compilable with only Wonx. 3 months ago
makefile_for_wwterm c0b964b4f4 Added dummy function of _asm_*(). 3 months ago
sample1.c 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
sample2.c 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
sample3.c 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
service.c 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
smac-b02.zip 5e1a9795b7 Create your own header file. It became compilable with only Wonx. 3 months ago
sound.c 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
sout2str.perl 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
sys2wonx.perl 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
system.c 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
text.c 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
timer.c 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
wonx.c 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
wonx_configure.h 103ffe29f1 We implemented mmap (). Specifically, see README. 3 months ago
wwterm-b05.zip c0b964b4f4 Added dummy function of _asm_*(). 3 months ago

README

WonX - WonderWitch on X.

ۤä

ո˾ʤɴޤޤɤɤ󤻤
Х䥢ɥХСԤκ湰μޤǡɤɤ᡼뤯
ɥ쥹ϡ
hsakai@m8.people.or.jp
Ǥ
(ֻ񤯤Ȥϸ¤ʤ˾ȿǤȤ¤ޤΤ
ϤƼϤ)
ޤε¤ꡤåץǡȤϿԤäƤޤ
http://www.seki.ee.kagu.sut.ac.jp/~sakai/WonderWitch/index.html
ǡƤޤ
ʲϥߥ顼ȤǤ
http://hp.vector.co.jp/authors/VA014157/WonderWitch/index.html
http://www.people.or.jp/~hsakai/WonderWitch/index.html
ߥ顼Ȥϡ椬Ȥ˥åץǡȤΤǡ˺ǿ
Ȥ櫓ǤϤޤ󡥤ޤǥХååѤǤ

Ϥ

WonX ϡWonderWitch ѤΥץ X ץꥱȤƥѥ뤹
Ρ饤֥Ǥʲħޤ

C٥ǸߴǽäƤΤǡWonderWitch ѤΥץ
UNIXǤΤޤޥѥǤ롥(-lwonx ǥѥ뤹)
UNIXǥǥХåѤƥǥХåǤ褦ˤʤ롥(!)
饯ǡѥåȥǡΥ׵ǽ롥
ʰͤ䡤ѥåȤ䥭饯ʤǻѤʤɤ
å顼Ϥ(褦ˤ)顼å롥
ѤǤʤǽ(ؿѰդƤ뤬ޤƤʤäꡤ
äꤷơȤΤ)Ϥ󤢤롥
ɲäƤĤꡥ
β̼̿ñ˻롥(ǥǻäꡤѤ
ץȤäꤹɬפ̵ʤ) ϤȤ٤ꡥ
ߥ졼Ǥʤ饤֥ǤꡤɸƤΤǡ
ͳ˥ޥǽ
®٤٤ǥХåŪΤʤΤǡ®٤®뤳Ȥ
ޤͤƤʤ(嵭ΥǥХåͥ褹)
WonderWitch ѤΥץXdzڤिΤΤǤϤʤ
ޤߥ졼ŪʤΤǤϤʤ
ޤǥǥХåŪΤΡ(ݥꥷdzȯʤ)
äơWonderWitch Ǥư魯뤳Ȥ⡤ǥХå
Ϥ뤳Ȥ¤Τ䤹ͥ褷褦ʼ򤹤礬롥

ɬפʤ

WonX ǤϡʲΤΤѤƤޤ

perl
(WonderWitchѥ WonXѥɤѴ perl ץȤ
źդƤΤǡWonderWitchѥɤ˴äƤΤʤС
ܸ perl ˾ޤ)
źդ perl ץȤϡmake ˼ưƬ perl ؤΥեѥ
(#!/usr/bin/perl ʤ)ղäΤǡܸ perl ̤ΤȤˤ
ФˤϡƤѤƤ
ܸ perl ̵СޤդĤ perl Ǥ⤿֤פǤ礦
qkc
ѴԥѴɬס
(nkf Ǥ٤Ĥˤɡqkc ȲԥɤѴƤΤǡ
ʸǤ qkc ѤƤޤ)
qkc ϡʲΥȤǤޤ
http://hp.vector.co.jp/authors/VA000501/index.html
qkc ˤϡMS-DOS ǡWindows ǡUNIX ǤʤɤޤΤǡ
UNIX (qkcc100.zip)ꤷƤ
ѥϡmake ʤΤǤȤäƤñǤ
unzip
źդ smac-b02.zip, wwterm-b05.zip हΤɬס

Υޥ˥奢ϡʾΤΤ٤ƥ󥹥ȡ뤵Ƥ뤳ȤȤ
ʤޤɬפʤХ󥹥ȡ뤹뤫¾Υץꥱ
ѤƤ

3ʬWonX

ȤꤢɤʤΤƤߤȤǤ礦ʿͤϡ
ץץ򥳥ѥ롦¹ԤƤߤޤ礦
ʲΤ褦ˤƤߤƤ

~>% tar xvzf wonx-x.x.tar.gz
(ά)
~>% cd wonx

~/wonx>% make sample1
(ά)
~/wonx>% ./sample1

ɥơɸϤ˥åϤޤ
ڡС򲡤ȡλޤ

~/wonx>% make sample2
(ά)
~/wonx>% ./sample2

륭ξ岼ǡ饯ưޤ
ڡС򲡤ȡλޤ

~/wonx>% more sample1.c
~/wonx>% more sample2.c

ǡץץΥꥹȤ򸫤Ƥߤޤ礦

ˡWonderWitch ѤΥࡤ"SpeedMac" 򥳥ѥ롦¹ԤƤߤޤ

~/wonx>% make smac
(ά)
~/wonx>% cd smac
~/wonx/smac>% ./smac

ɥơɸϤ˥åϤޤ
ä F9 򲡤Ʋ OFF ˤޤ(٤ⲡɽ٥뤬
äƤޤΤǡĹ˲Ƥ)
Ф餯(åƤѤä) F10 (Ĺˣ)
ƤӲɽ ON ˤȡsmac Υȥ̤ɽޤ
ǥڡ򲡤ơˤޤ F9 Dzɽ OFF ˤơ
Ф餯(åƤѤä) F10 Dzɽ ON ˤޤ
ɤǤ SpeedMac Υ̤ɽƤǤ礦
륭ǰưڡǼͷǤ
ϤϥѴؿƤФ줿ȤͭǤϤʤΤǡ
ȿޤĹ˲Ƥ
F9, F10 򲡤ˤ ON, OFF ؤΤϡ褬٤ᡤ
ONΤޤޤȲ̥ꥢȤ˰۾˻֤뤫Ǥ

ǸˡWonderWitch Ѥüߥ졼 "WWTerm" 򥳥ѥ롦¹
Ƥߤޤ

~/wonx>% make wwterm
(ά)
~/wonx>% cd wwterm
~/wonx/wwterm>% ./terminal

10ʬWonX

ˡʤˤʤä WonderWitch ѤΥץ WonX Ȥä
ѥ롦󥯤ơX Window System ư褦ʼ¹Է
äƤߤޤ礦

ޤWonX Ÿơmake Ƥlibwonx.a ȳƼ perl ץȤ
Ǥޤ

~>% tar xvzf wonx-x.x.tar.gz
(ά)
~>% cd wonx
~/wonx>% make
(ά)
~/wonx>% ls libwonx.a
libwonx.a
~/wonx>%

ˡlibwonx.a ȡwonx ǥ쥯ȥȡ
challsrc.sh, filters.pl, sys2wonx.pl, int2sint.pl 򤢤ʤκäץ
ǥ쥯ȥ(ǤȤơyoursample Ȥޤ)˥ԡޤ

~/wonx>% cp -R libwonx.a wonx ../yoursample
~/wonx>% cp challsrc.sh filters.pl sys2wonx.pl int2sint.pl ../yoursample
~/wonx>% cd ../yoursample
~/yoursample>%

*.C Ȥե̾Υե뤬ä顤*.c ѹޤ
(*.C C++ ΥץȻפƤޤΤ)

~/yoursample>% mv SAMPLE2.C sample2.c

ʤκäץΤ٤ƤΥեФơʲΤȤԤޤ
MS-DOS ƥȷ UNIX ΥƥȷѴ롥
(Ĥޤꡤԥɤ \r\n \n Ѵơɤ SJIS
EUC Ѵޤ)
ץ #include Τ褦ʤΤ
#include "wonx/disp.h" ѹ롥(sys2wonx.pl ̤ȤѴƤ)
ǥեȤ int short int Ѵ롥
(int2sint.pl ̤ȤѴƤ)
Υե륿ޤȤ̤Ƥ filters.pl ȤץȤ
źդƤΤǡʲΤ褦ˤơ٤ƤΥեФơ
ɬפʥե륿̤Ƥ

~/yoursample>% ./filters.pl "qkc -e -u" ./sys2wonx.pl ./int2sint.pl -f *.[ch] [Mm]akefile* MAKEFILE*

⤷ϡʲΤ褦ˤƤ褤Ǥ

~/yoursample>% ./challsrc.sh *.[ch] [Mm]akefile* MAKEFILE*

(! filters.pl challsrc.sh ϡ*եΤ񤭴Ƥޤ*Τǡ
ѹȺ褦ʥեɬХååפƤ)

makefile ʲΤ褦˽롥
ѥˤ gcc Ѥ롥
֥ȥե *.obj *.o ѹ
ѥե饰 -I. -L. -L/usr/X11R6/lib -lwonx -lX11 -lXt ɲá
mkfent ʤɤˤ *.fx եκʤɤä顤ȥȤ롥

~/yoursample>% emacs makefile

餯makefile νܤݤǤ(ݤʤΤϡWonX ޤ
ŬѤǤʤäȤΥνǤ)
źդ makefile_for_smac makefile_for_wwterm 򻲹ͤˤơmakefile
Ƥ

Ǹˡmake 򤷤ޤ

~/yoursample>% make

ޤСǥѥ뤬̤äơ¹ԤǤޤ

~/yoursample>% ./sample

WonX

WonX ϡWonderWitch display_control() Ȥ display_status() Ȥäؿ
(BIOS Ф륷ƥॳ)ؤδؿäƤޤ
δؿϡX˥ɥ򳫤ơ WonderWitch ȸߴư
褦˽񤤤Ƥޤ

WonX make ȡlibwonx.a Ȥ饤֥꤬Ǥޤ
ǡWonderWitch ѤΥץUNIX -lwonx ƥѥ뤷ƤС
WonderWitch display_control() ȤΤˡWonX display_control()
󥯤졤X ư褦ˤʤ롤ȤȤߤǤ

إåեˤĤ

WonX ϡUNIXƥˤ libc ѤޤĤޤꡤ/usr/include
include ޤ(Τ strlen(), fopen() ʤɤɸ饤֥
UNIX °ΤΤѲǽ)
ޤWonderWitch ˤϡsys/types.h ʤɤȤäإåե뤬ޤ
äơWonderWitch Υإåե빽򤽤Τޤ WonX ˰Ѥȡ
WonX Υإåե UNIX Υإåե뤬եꥯȤ
ǽФƤޤ
(ȤСWonderWitch sys/types.h UNIX /usr/include/sys/types.h
եꥯȤ롤ʤɤǤ)
ϡWonderWitchѤΥץꥱ򥳥ѥ뤹ȤˡդǤ
ѥ뤬ޤȤʤȤ㳲θϡۤȤɤΤ褦ʡ
֥إåեΥեꥯȤ⤷ϸǧפ˵Ƥޤ

кȤơWonX Ǥ wonx Ȥǥ쥯ȥβ˥إåե
ǼƤޤ( sys Ȥǥ쥯ȥˤä
嵭кΤᡤΤ褦ˤ)
WonderWitch ѥץΡ
#include
Τ褦ʬϡ٤ơ
#include "wonx/types.h"
Τ褦˽ɬפޤ
(stdio.h stdlib.h ϡUNIX ƥ°ΤΤѤΤǡ
ΤޤޤǤޤޤ)
(եꥯȤʤȤФμʤ顤θ¤ǤϤޤ)
WonderWitch ΥץΡ#include ϡ٤
#include "wonx/*.h" ˽ɬפ롤ȤȤǤ
(ޤȤƹԤ sys2wonx.pl Ȥ perl ץȤźդ
ޤ./filters.pl ./sys2wonx.pl -f *.[ch] ¹Ԥȡä
񤭴Ƥޤ)

ޤUNIXƥˤäƤϡ/usr/include/sys/types.h ushort, ulong
ƤΤȤʤΤޤäơѥ
ulong ƤȤ礬ޤ(Linux ǤϤΤ褦
ʤ褦Ǥ)
ΤĴˤϡwonx ǥ쥯ȥʲΥեľܽ
ĴƤwonx/system_configure.h 뤳Ȥˤꡤ
ĴǤ褦ˤʤäƤޤ

WonX Υѥ

ޤ WonX 򥳥ѥ뤷ơlibwonx.a ɬפޤ
WonX ΥѥϡʲμǹԤޤ

1. WonX Ÿ롥

~>% tar xvzf wonx-x.x.tar.gz
~>% cd wonx
~/wonx>%

2. WonX make 롥

~/wonx>% make
gcc -c WWCharacter.c -O -I. -I/usr/X11R6/include
gcc -c WWColorMap.c -O -I. -I/usr/X11R6/include
...(ά)...
gcc -c wonx.c -O -I. -I/usr/X11R6/include
ar ruc libwonx.a WWCharacter.o WWColorMap.o WWDisplay.o WWLCDPanel.o WWPalette.o WWScreen.o WWSprite.o WonXDisplay.o XDisplay.o disp.o text.o key.o system.o timer.o etc.o wonx.o
~/wonx>% ls lib*
libwonx.a
~/wonx>%

ΤȤƼ perl ץȤƱ˺ޤ
ɬפ make install ȡƼإåե롤饤֥ꡤ
perl ץȤ󥹥ȡ뤵ޤ(󥹥ȡ뤷ʤƤ⹽ޤ
ʹߤϥ󥹥ȡ뤷ʤäΤȤޤ)

~/wonx>% su
Password:
# make install

ޤǤǡ饤֥κϽǤ

WonderWitch ѥץꥱΥѥ

ˡWonX ѤȤơۺ SpeedMac Ȥ WonderWitch Ѥ
򥳥ѥ뤷Ƥߤޤ
(SpeedMac ϥץץȤơWonX ɸźդƤޤ)
SpeedMac WonderWitch ѤΥץǤ WonderWitch
Ѥƥѥ뤷WonderSwan ǥڤिΤΤǤ
ȤơSpeedMac WonX 󥯤ơX ư SpeedMac
¹ԷƤߤޤ

1. Ÿ롥

~/wonx>% unzip smac-b02.zip
...(ά)...
~/wonx>% cd smac-b02
~/wonx/smac-b02>%

2. إåե libwonx.a 򥳥ԡ롥

~/wonx/smac-b02>% cp -R ../wonx .
~/wonx/smac-b02>% cp ../libwonx.a .
~/wonx/smac-b02>%

3. 롥

~/wonx/smac-b02>% emacs chara.c
~/wonx/smac-b02>% emacs dsp.c
... (եҤȤĤҤȤĽ)

MS-DOS ΥեˤʤäƤեϡUNIXΥƥȷ
ѴޤŪˤϡʲѴ򤷤ޤ
ԥɤ \r\n \n ˤ롥
ɤ SJIS EUC ˤ롥
qkc Ȥץꥱǡ嵭ΤȤ٤˹ԤȤǤޤ
ݤʤϡʲΤ褦ˤСޤȤѴޤ
~/wonx/smac-b02>% ./filters.pl "qkc -e -u" -f *.[ch]
qkc ̵ͤ... nkf ȤƤȤ˻ȤäѴƤ

ޤΡ
#include
#include
Τ褦ʬ
#include "wonx/disp.h"
#include "wonx/key.h"
Τ褦˽ޤ

ޤȤƤ뤿 perl ץ (sys2wonx.pl) źդƤΤǡ
ݤʤϡ
~/wonx/smac-b02>% cp ../filters.pl ../sys2wonx.pl .
~/wonx/smac-b02>% ./filters.pl ./sys2wonx.pl -f *.[ch]
Τ褦ˤƤ
(filters.pl ϡǻꤷե뼫Τ񤭴ƤޤΤ)

ˡWonderWitch Ǥ sizeof(int) == sizeof(short int) Ǥ
UNIX ǤϤդĤ sizeof(int) == sizeof(long int) ʤΤǡ
饯Υӥåȥޥåפʤɡint ΥХȥ˰¸ʬ
int ѤƤˤϡshort int ʤɤޤ

ޤȤƤ뤿 perl ץ (int2sint.pl) źդƤΤǡ
ݤʤϡ
~/wonx/smac-b02>% cp ../int2sint.pl .
~/wonx/smac-b02>% ./filters.pl ./int2sint.pl -f *.[ch]
Τ褦ˤƤ
(filters.pl ϡǻꤷե뼫Τ񤭴ƤޤΤ)

ܸ perl EUC ɤǤʤưʤΤǡ
sys2wonx.pl int2sint.pl Ѥˤϡޤ qkc Ǵɤ
EUC ѴƤ顤sys2wonx.pl int2sint.pl ѤƤ

4. makefile 롥

~/wonx/smac-b02>% emacs makefile

ʲΤ褦˽ޤ

ɤ EUC ˡԥɤ \r\n \n Ѵ롥
(ԥɤѴʤ make ưޤqkc ̤
Ǥ礦)
gcc ǥѥ򤹤褦˽롥ΤȤˡѥ륪ץˡ
-I. -L. -L/usr/X11R6/lib -lwonx -lX11 -lXt
ɲä롥
(ɬפʤ顤-g ɲä)
mkfent ˤեΥСȤʤɤä顤롥

makefile źդƤΤǡݤʤϼԽ뤫ˡ

~/wonx/smac-b02>% mv makefile makefile.orig
~/wonx/smac-b02>% cp ../makefile_for_smac ./makefile

Τ褦ˤƥԡƤ

5. make 롥

~/wonx/smac-b02>% make
gcc -c chara.c -g -I.
gcc -c game.c -g -I.
...(ά)...
gcc -c main.c -g -I.
gcc -g -o smac chara.o game.o man.o mansub.o mansub2.o map.o mapsub.o menu.o monster.o picture.o player.o smac.o stage.o dsp.o etc.o main.o -lwonx -lX11 -lXt -L. -L/usr/X11R6/lib
~/wonx/smac-b02>% ls smac
smac
~/wonx/smac-b02>%

6. smac ư롥

~/wonx/smac-b02>% ./smac

ȡޤǤäݤǤ¤ϡ

~/wonx>% make smac

ȡκȤäƤ褦ˤʤäƤޤ



smac ưȡɥޤޤߥʥˤϡ
ʲΥǥХåѤξɽޤ

WonderWitch شؿƤФȡͤɽޤ

ޤǤϡʲԤޤ

륭WonderSwan X1X4ܥбƤ롥
i,j,k,l WonderSwan Y1Y4ܥбƤ롥
ڡСȺեȥA,BܥбƤ롥
sSTARTܥбƤ롥
F1 򲡤ȡLCD顼ޥåפΥǡ׽Ϥ롥
F2 򲡤ȡѥåȤΥǡ׽Ϥ롥
F3 򲡤ȡ饯Υǡ׽Ϥ롥
F4 򲡤ȡץ饤ȤΥǡ׽Ϥ롥
F9 򲡤ȡ̤ɽ٥򲼤롥
F10 򲡤ȡ̤ɽ٥夲롥
ɽ٥ϥǥեȤ 1 ˤʤäƤꡤߤΥ٥뤬 1 ʾξΤ
̤Ԥ0 ʲξˤϡ̤ؤԤʤΤ֤®
F11 10ôߡ(̼̿ȤȤʤɤѤǤ)
(F11û˲ƤĹ˲ȡʤʤ褦Ǥ)
q ⤷ Ctrl-c ⤷ F12 Ƕλ
Ctrl-i ǥ󲽡

ǥեȤǤϤʤˤؿƤФ뤿Ӥ˲̤κԤᡤ
®Ǥ
ȤСʲΤ褦ʤȤäƤȡ®ˤʤޤ

/* ̤Υꥢ */
for (y = 0; y < 32; y++)
for (x = 0; x < 32; x++) {
screen_fill_char(0, x, y, 1, 1, 0); /* 褵 */
}
}

Τ褦ʾϡF9 򲡤ɽ٥򲼤ơ롼׽ä
Ƥ F10 򲡤ɽ٥夲Ƥ(٤ⲡɽ٥뤬
ɤɤ󲼤ä(⤷Ͼ夬ä)ޤΤǡĹˣƤ)

F1 F2 򲡤ȡǡ׽ϤΤǤɸǤϤ¾ˤ
å̤˽ϤƤΤǡդĤ F1 򲡤Ǥϡ
äȤޤ̤ΥåήƤޤȤޤ
Τ褦ʤȤϡʲΤ褦ˤƵưޤȤХѥ뤷
smac Ȥ¹ԷǤƤΤʤ顤

> smac | grep -v call

⤷⥭饯ֹ10֤Υ饯Υǡˤϡ
ʲΤ褦˼¹ԤƤ顤F3 򲡤ɤǤ礦

> smac | grep "character\[010\]"

WonX ϡåϤݤˡgrep ǥե륿󥰤Ǥ褦ˡ
ʤ餺ϥåƬˡΤʸɲäƤޤ
ȤСؿƤӽФɽåˤϡƬɬ
"call" ȤʸɲäƤޤäơgrep -v call ̤С
ؿƤӽФΥåäФʤʤ롤Ȥ褦ˤʤäƤޤ

ɸǤ̤ΥåФƤΤǡgrep 򤦤ޤȤ褦ˤƤ
⤷ϡ

> smac | grep call > function_call.log

Τ褦ˤơȤΤͭǤ礦

> smac > /dev/null

ȡʸ kterm ʤɤɽʤ֤(ʤ)®ˤʤޤ

­ʤ

ʲΤΤˤϤޤбƤޤ󡥤äơ㤨ХɴϢ
ؿƤӽФƤ⡤ⵯޤ(δؿˤʤäƤ)


ץ
쥯ȥ饤֥

դʤФʤʤ

WonX ϡ WonderWitch ѤȤƽ񤫤줿(⤷ϡ񤫤)ץ
UNIX ǥѥ롦󥯤뤿Υ饤֥Ǥꡤϡɥ
ߥ졼ȤΤǤϤޤ
Ǥ顤WonderWitch UNIX CΥåפΤᡤĤʤ
ʤʤȤĤޤ WonX 塤̵ȤǤ

ʲΤȤϡռ뤳Ȥȡ줤ʥץ񤯤Ȥǡ
ʤǤȻפޤ(ӥåȥޥåʤɤǡshort int ˤ٤
ȤǤϡάˤ short int Ȥ)

ޤWonX ŪŪʥХᤤʳ̵Ȥȡ
ŪХȥϡɤߤΥХڤΥƸ򶹤뤳Ȥȡ
椬ż֤Ǥ WonderWitch Υץ񤱤褦ˤ뤳ȤˤΤǡ
ΤؤϤΤȳڤäƻȤäƤ
WonX Ȥ¤ꡤʤ٤¸̵褦˿ޤ礦
(Ȥ int Υˤޤ¸ʤ褦ˤޤ礦)

[ѥ]

ˤ񤭤ޤѥǤʤȤ㳲Ф顤ϤƤ
إåեΥեꥯȤǤȤˡWonderWitch sys ʲ
ե򥤥󥯥롼ɤƤդƤ
ushort, ulong ʤɤϡsys/types.h Ƥ륷ƥ⤢뤷
Ǥʤƥ⤢ޤΤؤϡwonx/system_configure.h
ĴƤ
(FreeBSD Ǥ ushort ΤƤ뤬RedHat Linux Ǥϡ
uchort, ulong ȤƤΤǡΤޤޤȥѥ
Υ˥󥰤Фޤ)

[int ΰ]

WonderWitch Ǥ sizeof(short int) == sizeof(int) < sizeof(long int) Ǥ
UNIX ǤϤդĤ sizeof(short int) < sizeof(int) == sizeof(long int) Ǥ
ΤȤϡint ñʤ륫󥿤ȤƻѤ褦ʾˤ
ʤޤ󤬡ӥåȥޥåפγǼȤƻѤ褦ʤȤˤϡ
ˤʤޤ
ˤʤ䤹Τϡ饯Υӥåȥޥåפ򰷤Ǥ
(bmpcnv ѤơӥåȥޥåץǡνϤ unsigned int bitmap = {
Τ褦ˤʤäƤʤ)
font_set_colordata()ʤɤϡ16*8 ХȤΥ饯ǡ
short int Ȥư˻ޤWonderWitch Ǥ
sizeof(short int) == sizeof(int) ʤΤǡWonderWitch ѤΥץǤϡ
饯ǡ short int Ȥˡint ȤƤޤ
Ȥͤޤ( WonderWitch ʤ̵UNIX
¹Ԥ顤饯̯ʼʡȻפ)
Τ褦ʾˤϡUNIX ǥѥ뤹Ȥˤϡѥ饪ץ
ǥեȤ int short int ˤʤ褦˻ꤹ뤫⤷ϥ
int short int ˤ˽ɬפޤi386 gcc Ѥ
ˤϡΤ褦ʥѥ饪ץ̵Τǡ˥
Ȥˤʤޤ
int2sint.pl ̤ȡƤʤ int Ϥ٤ short int Ѵޤ
⤷⤢ʤ int2sint.pl ѤǤʤСǽƤդĤ
饯ΥӥåȥޥåץǡȤ򰷤ʬΤߤнʬǤ礦

ѥΥ˥󥰤ȳǧƤޤѥˤ
-Wall ץĤޤ礦
wonx-2.1 ϡ饯ΥӥåȥޥåϢ(font_set_colordata()ʤ)
δؿΰϡŬڤʷΥݥ󥿤˽Τǡѥ餬˥󥰤
ФƤ顤ӥåȥޥåץǡη⤷ޤ

ñʤ륫󥿤ե饰ȤƻѤƤ褦 int ϡ¿ξ
short int Ǥ long int ǤưѤޤ󤬡ȤȤƤ⡤
WonX Ѥơgcc -Wall ץĤƥѥ뤹ȡ
WonderWitch ưȤŪʥХ(short int ξ岼¤ˤޤĤ
Хʤ)ȯǤ뤳ȤΤǡʤ٤ʤ int2sint.pl int
ä short int ˤƤޤȤ򤪤ᤷޤ

[Хȥǥ]

WonderWitch CPU x86ϤǤSPARC ʤɤǻѤˤϡ
ǥդɬפޤ
font_set_colordata()ʤɤϡshort int ǥ饯ǡ
Τǡunsigned char * 饯ǡ short int * ˥㥹Ȥ
font_set_colordata()ϤʤɤΤȤ򤷤ƤȡҤä֤
Ȥͤޤ
i386 ϤΤ PC-UNIX ʤС餯̵Ǥ礦
WonX-2.1 顤饯ǡ˴ؤƤϡϥǥ˰¸ʤ褦
ޤi386 SPARC ǥǥ˰¸ʤȤưǧ
ƤޤǤ⡤饯ǡ unsigned char * ơ
ӥåȥޥåɤ߹Ѥδؿ˥饯ǡϤȤ short int *
㥹ȤϤ褦ʽ򤷤Ƥȡ¸ƤޤޤĤޤꡤ
WonX Τϥǥ˰¸ƤʤWonX Ѥץब
ǥ¸˽񤤤ƤäƤϡɤ褦ʤȤȤǤ

饯ǡΥӥåȥޥåɤ߹ѤδؿˤϡŬڤʷΥǡ
Ϥ褦ˤƤshort int * Ϥ٤Ȥˡunsigned char *
ϤꤹȡΤ褦ʥХθˤʤǽޤŬڤ
ݥ󥿤ϤƤˤϡѥ餬˥󥰤ФΤǡ
ѥΥ˥󥰤˽ʬդƤ

[޳ߤ]

WonderWitch ˤϥ޳ߤޤWonX ư٤ᡤ
WonderWitch λñ̤򤽤Τޤ UNIX ˻äƤ顤ߤ
äѤʤˤʤäƤޤޤäƥ޳ߤλñ̤ϡ
WonderWitch ⤫ʤ礭ˤƤޤ
ϡwonx_configure.h ĴǤޤ
ߥϥɥǡ˻֤Τʤɤ򤷤Ƥ
ˤϡߤλñ̤礭ƤǤʤȡϥɥ餫
äִ֤ˤޤϥɥ餬ƤФơ¹Ԥ˿ʤޤʤȤȤ
ʤޤ

[ϳߡꥢߤ]

(ޤ뤳ȤϤʤȻפޤ)ϳߤȥϸѴؿ
Ʊ롼ʻѤȡߤΤȤꤳܤ䤹ʤǽ
ޤ
ĤޤꡤʲΤ褦ʥץ񤯤ȤˤդƤ

void far key_handler()
{
/* Ϥν */
}

static intvector_t key_intvector;
static intvector_t key_last_intvector;

main()
{
key_intvector.callback = (void (near *)())FP_OFF(key_handler);
key_intvector.cs = _asm_inline("\tmov\tax,cs");
key_intvector.ds = _asm_inline("\tmov\tax,ds");

sys_interrupt_set_hook(SYS_INT_KEY, &key_intvector, &key_last_intvector);

while (1) {
/*
* ϳԤξ֤ʤΤˡkey_press_check() ǥϾ֤
* Ԥ
*/
key = key_press_check();
/* ʤŬʽ򤳤ΤؤǹԤäꤹ */
}
}

ϳߤԤʤ顤key_press_check() ǥϾ֤
̸Ĥ˸롤ȤȤȡߤΤȤꤳܤǽ
ޤ
(ϳߤˤäƸƤӽФߥϥɥ
key_press_check() Ѥ뤳Ȥꤢޤ(Ǥʤȳߤ
̵̣ʤäƤޤ) ޤǡƱ롼ʻѤ꤬
ȯǽ롤ȤȤǤ)

Ǥ⡤ʤؤʥץढޤ񤯤̵ʤȻפäƤޤ
(ľȤȡȤƤ⤿ؤʤΤ)
ΤȤϡꥢߤ˴ؤƤ⡤ƱͤǤ

[ϤˤĤ]

ϤϡѴؿƤФ줿ȤΤߴΤΤǡĹ˲Ƥʤ
ȿʤȤޤ
ȿʤȤäƤʤɤⲡΤǤʤĹμ¤˲褦
Ƥ

[MS-DOS եΰ]

MS-DOS եϡβԥɤ UNIX Υƥȥե
ۤʤΤǡդƤ*.[ch] եξ̵ΤǤ
makefile դƤ
(UNIX ΥƥȥեǤϡԤ \n ǤMS-DOS Ǥ \r\n Ǥ)
㤨Сmakefile ˡ

gcc -g -o smac $(OBJS) -L. -L/usr/X11R6/lib -lwonx -lX11 -lXt

Τ褦ʹԤäȤơ줬 MS-DOS ΥƥȷΥեȡ
-lXt ΤȤ;ʬʲԥ(\r)ղäƤޤᡤUNIX make
Ƥ⡤-lXt 饤̵֥꤬פܤƤޤޤ
(ºݤˤϥѥϡ-lXt\r ȻפäƤޤäơlibXt\r.a Ȥ饤֥
õƤޤΤǤ)
(⡤ե emacs less ʤɤǻȤƤ⡤ԥɤɽʤ
ᡤȤäƤ狼ˤ)
ޤ

gcc -g -o smac $(OBJS) -lwonx -lX11 -lXt -L. -L/usr/X11R6/lib

Τ褦ˤƤȡ/usr/X11R6/lib ꤷĤʤΤˡºݤˤ
/usr/X11R6/lib\r Ȥǥ쥯ȥ꤬ꤵ줿ȤˤʤäƤޤ
-lX11, -lXt θ˼ԤϤ make ˼Ԥޤ

ɤ˴ؤƤ⡤ƱȤޤUNIX Ǥδɤ EUC ʤΤǡ
SJIS δäƤȡޤѥǤʤäꡤ
make ޤưʤäꡤѥǤƤץ༫Τ
ưƤޤ⸶˵ŤˤʤäƤޤǽޤ
makefile 䥽ɤɬ
> cat makefile | qkc -e -u > makefile.tmp
> mv makefile.tmp makefile
ʤɤ̤ơUNIXΥƥȥեѴޤ礦

[ե̾]

MS-DOS Ǥϥե̾Ϥ٤ʸǤgcc Ǥ *.C Τ褦
ե̾Υե C++ ǽ񤫤ƤȽǤ뤿ᡤ
SAMPLE.C Τ褦̾Υե򥳥ѥ뤹ȡޤ󥯤Ǥʤ
Ȥޤ
Τ褦ʾϡsample.c ˥͡षƥѥ뤷Ƥ

[ꥢ̿ˤĤ]

ꥢ̿μѴؿ(comm_receive_char())ϡfgetc(stdin)
ʸơ\n \r Ѵ֤ޤϡŪ̿
ü򥨥ߥ졼Ȥ뤿Ǥ

ޤcomm_send_char() ϤʸϡɸϤ˽Ϥޤ
֤ԥɤϡ"\t" "\n" Τ褦ʸѴƽϤޤ
źդ sout2str.pl ̤Ȥˤꡤꥢ̿ؤνϤΤФơ
üؤνϤΥ᡼ɽ뤳ȤǤޤ
sout2str.pl ϰʲΤ褦ˤѤޤ
(terminal Ȥ WonderWitch ѥץWonX Ѥ UNIX
ѥ뤷ơsout2str.pl ̤ƥꥢؤνϤΥ᡼򸫤)

> ./terminal | ./sout2str.pl

ߤˤĤ

ϳߤ䥷ꥢߤʤɤϡUNIXΥ顼ॷʥ
ѤƼƤޤ(֤˥ݡ󥰤Ƥ)
äơʲΤ褦ʥץ⥳ѥ뤷ư
ȤǤޤ

void far key_handler()
{
int key;
key = key_press_check();
/* Ϥν */
}

/* ꥢγߥϥɥ */
void far com_handler()
{
int c;
c = comm_receive_char();
/* ꥢν */
}

static intvector_t key_intvector;
static intvector_t key_last_intvector;
static intvector_t com_intvector;
static intvector_t com_last_intvector;

main()
{
key_intvector.callback = (void (near *)())FP_OFF(key_handler);
com_intvector.callback = (void (near *)())FP_OFF(com_handler);
key_intvector.cs = _asm_inline("\tmov\tax,cs");
key_intvector.ds = _asm_inline("\tmov\tax,ds");
com_intvector.cs = _asm_inline("\tmov\tax,cs");
com_intvector.ds = _asm_inline("\tmov\tax,ds");

sys_interrupt_set_hook(SYS_INT_KEY,
&key_intvector, &key_last_intvector);
sys_interrupt_set_hook(SYS_INT_RECEIVEREADY,
&com_intvector, &com_last_intvector);

while (1) {
/* ̵¥롼סߤä顤Υϥɥ */
}
}

_asm_inline() Ͼ0֤ߡؿȤƤޤ
ޤFP_OFF(), FP_SEG() ϡ
#define FP_OFF(p) (p)
#define FP_SEG(p) (0)
Τ褦Ƥޤäơ嵭Τ褦ʥץ WonX
ѥ뤷Ƽ¹Ԥ뤳ȤǤޤ

Τ褦ˡwhile (1) {} ̵¥롼פ󤷤ơߤäȤ
褦ʥץ񤤤Ƥ⡤ưޤ
Ϥϥݡ󥰤ƤȤΤʤΤǡ
ϳߤ򤫤ˤϡĹ˥򲡤Ƥɬפޤ
(ϴŪߤΤǡȿޤĹ˲Ƥ)

WonX ¸ʬΤ꤫

WonderWitch ѤΥץȯƤݤˡWonX ξΤȤ߹ߤơ
WonderSwan Ǽ¹ԤȤˤϼɤäȤޤ
(㤨СǥХåνϤΤ printf() ʤ)
Τ褦ʤȤΤˡwonx/types.h
#define _WONX_
ƤΤǡΤ褦ʾ #ifdef _WONX_ ǤäƤ

WonX 󶡤륵ӥؿ

WonX ϰʲδؿǥХåѤΥӥؿȤ󶡤Ƥޤ
ʲδؿ¹Ԥ뤳ȤˤꡤǥХå stdout ˽Ϥޤ

#include "wonx/wonx.h"

/* 顼ޥå׾ν */
void wonx_print_colormap_data(void);

/* ѥåȾν */
void wonx_print_palette_data(int n);

/* ٤ƤΥѥåȾ */
void wonx_print_all_palette_data(void);

/* 饯ν */
void wonx_print_character_data(int n);

/* ٤ƤΥ饯 */
void wonx_print_all_character_data(void);

/* ץ饤Ⱦν */
void wonx_print_sprite_data(int n);

/* ٤ƤΥץ饤Ⱦ */
void wonx_print_all_sprite_data(void);

ȤХ԰¤ʾ꤬ä顤

#ifdef _WONX_
#include "wonx/wonx.h"
#endif

void func(void)
{

...(ά)...

#ifdef _WONX_
wonx_print_sprite_data(0);
#endif

/* ˥ץ饤ȤˤĤƤ԰¤ʥɤ */

#ifdef _WONX_
wonx_print_sprite_data(0);
#endif

...(ʲά)...

Τ褦ˤ԰¤ʥɤǥץǡȡǥХåΩ
Ǥ礦#ifdef _WONX_ ǤäƤСǥХåɤ򥽡˻Ĥ
ޤޤ WonderWitch Ǥ⥳ѥ뤬ǽʤΤǤ

ޤWonX Ǥϲ̤˻֤Τ˲äơ̤ϲ̴Ϣ
ƥॳ(ѥåȤѹʤɤޤ)ƤФ뤿Ӥ˹Ԥ뤿ᡤ

for (y = 0; y < TEXT_SCREEN_HEIGHT; y++) {
for (x = 0; x < TEXT_SCREEN_WIDTH; x++) {
text_put_char(x, y, ' ');
}
}

Τ褦ʥɤȡtext_put_char() θƤӽФΤӤ˲褬Ԥ
ᡤư٤ʤޤ

кȤơF9, F10 򲡤Ʋ̤ɽ٥Ѳ뤳Ȥ
̤ɽ/ɽؤ褦ˤƤΤǤʲΥӥؿ
Ѥ뤳Ȥǡץ椫̤ɽ٥Ǥޤ
ɽ٥ϥǥեȤǤ 1 ˤʤäƤꡤɽ٥뤬 1 ʾΤȤΤ
褬Ԥޤ
Ȥ gdb ʤɤȤäƥǥХåˤϡF9, F10 ȿߤʤä
뤪줬뤿ᡤǤ礦

#include "wonx/wonx.h"

/* ߤɽ/ɽΥ٥μ(1ʾɽ0ʲɽ) */
int wonx_get_lcddraw_level(void);

/* ߤɽ/ɽΥ٥ */
int wonx_set_lcddraw_level(int level);

/* ɽ٥򲼤 */
int wonx_lcddraw_level_down(void);

/* ɽ٥夲 */
int wonx_lcddraw_level_up(void);

ºݤΥץǤϡʲΤ褦ˤѤޤ

#ifdef _WONX_
#include "wonx/wonx.h"
#endif

void func(void)
{

...(ά)...

#ifdef _WONX_
wonx_lcddraw_level_down();
#endif

for (y = 0; y < TEXT_SCREEN_HEIGHT; y++) {
for (x = 0; x < TEXT_SCREEN_WIDTH; x++) {
text_put_char(x, y, ' ');
}
}

#ifdef _WONX_
wonx_lcddraw_level_up();
#endif

...(ʲά)...

Τ褦˽񤯤ȤˤꡤWonX ǤΥѥˤ text_put_char() ¹Ի
޻ߤơ®뤳ȤǤޤ
(#ifdef _WONX_ ǤΤ˺ʤ褦ˤޤ礦)

̤ɽ٥ˤĤ

WonX-2.2 顤̤ɽ٥ȤΤƳޤ
(WonX-2.1 ޤǤϡF10 ˤ ON/OFF ؤΤߤä)

ͳϡץ椫
(wonx_lcddraw_level_up(), wonx_lcddraw_level_down() ʤɤˤä)̤
椹ݤˡON/OFF Ǥʤȡؿ椫ؿƤ֤褦ʾ
̤ưʤǤȤаʲΤ褦ʾǤ

void sample1(void)
{
wonx_lcddraw_draw_off();

/* */

wonx_lcddraw_draw_on();
}

void sample2(void)
{
wonx_lcddraw_draw_off();

/* */

sample1();

/* */

wonx_lcddraw_draw_on();
}

ΰ֤ǤϲOFFˤʤäƤΤǤʬǤ
ԤȿƲ̤ ON ˤʤäƤޤޤǤϤɤδؿ
ON/OFF ƤΤդʤФʤʤʤꡤOFF ˤƤĤǤ
ɤ ON ˤʤäƤޤäƤȡΥǥХå򤷤ƤΤ狼ʤ
ʤäƤޤޤ
кȤơɽ٥ơʲΤ褦˽񤱤褦ˤޤ

void sample1(void)
{
wonx_lcddraw_level_down();

/* */

wonx_lcddraw_level_up();
}

void sample2(void)
{
wonx_lcddraw_level_down();

/* */

sample1();

/* */

wonx_lcddraw_level_up();
}

ȽΤȤǤɽ٥ -1ΤȤǤ
ɽ٥ 0 Ȥʤ뤿ᡤ̤ưƤޤ

mmap() ˤĤ

WonX ߷׻ۤǤϡUNIX¦ˤ¸ߤ륵ӥؿUNIXˤޤ
ȹͤƤ뤿ᡤfopen() ʤɤ WonX ǤѰդƤޤ
mmap() ˴ؤƤϡUNIX WonderWitch ưʤ㤦Τȡ
WonderWitch ΥץǼºݤ mmap() ѤƤΤ¿Ȥ
¾𤬤äΤǡWonX-2.2 mmap() ƥॳμԤޤ

꤬äơUNIX ¦Ǥ mmap() ϡ/usr/include/stdio.h ǡ

void * mmap(void * addr, size_t len, int prot, int flags, int fd, off_t offset);

Τ褦Ƥޤ(FreeBSD )
Ф WonderWitch Ǥϡinclude/sys/fcntl.h ǡ

void * mmap(char * filename);

Τ褦ʷǤƤޤ(ºݤˤϥݥ󥿤 far ݥ󥿤ˤʤäƤ뤬)
UNIX mmap() WonderWitch mmap() Ǥϡο㤤ޤ
Τ WonderWitch ˹碌 mmap() ȡWonX Υѥ
WonX 󥯤ץΥѥˡؿΰեꥯȤ
顼ȤʤäƤޤޤWonX 󥯤ץǤϡstdio.h
󥯥롼ɤǽ¸ߤΤǡܿι⤤ˡǤ
Ū˲褹뤳ȤϤǤޤ

ζкȤơWonX Ǥ mmap() wonx_mmap() Ȥ̾ơ
fcntl.h Ǥϡ

#define mmap wonx_mmap

뤳Ȥн褷ƤޤĤޤꡤmmap() μΤ wonx_mmap() Ȥʤޤ
Ūˤ fcntl.[ch] 򻲾ȤƤ
Τᡤfcntl.h 򥤥󥯥롼ɤΤ˺ mmap() Ѥȡ
UNIX mmap() (stdio.h mmap()) ͭˤʤäƤޤᡤ
ִؿΰäƤפȤƤΥ顼ФȻפΤǡ
դƤ

ޤˡ fcntl.h θ stdio.h 󥯥롼ɤ褦ʾˡ
stdio.h Ƥ mmap() wonx_mmap() ˽ѤäƤޤ
ϤؿΰեꥯȤƤޤޤкȤơfcntl.h Ƭն
stdio.h Υ󥯥롼ɤԤfcntl.h θ stdio.h 󥯥롼ɤƤ⡤
ܤΥ󥯥롼ɤˤʤäơstdio.h Ƭǡ
#ifndef _STDIO_H_
#define _STDIO_H_
ʤɤڤ褦ˤʤäƤޤ

ƱͤʴؿȤˤ⡤Ʊ褦нˤʤǤ礦

󡤤ۤȤ˶κʤ... #define Ĥ⤷

void * wonx_mmap(char * filename);
void * mmap;
mmap = wonx_mmap;

Τ褦ˤʤʤɤˡ⸡ƤΤǤɤ줬Ф
μ¤Ǥ狼䤹ˡʤ... ȻפäƤޤäȤǥä
Ƥ

¹Ԥι®ˤĤ

WonX ϥǥХåŪΥ饤֥Ǥ뤿ᡤޤ®ưΤȤ
ͤƤޤ󡥤Τᡤ٤ǤǤʲΤȤդ뤳Ȥǡ
ʤ®ư뤳ȤǤޤ

ץΥۥåȥݥåȤˤʤʬ
wonx_lcddraw_level_down(), wonx_lcddraw_level_up()
Ǥ롥ˤꡤF10 򲡤Ʋ OFF ˤΤƱ̤
ޤ

¹Իˤϡ

> ./smac > /dev/null

Τ褦ˤơϥå /dev/null ˼ΤƤ롥
WonX ̤ΥåϤޤkterm ʤɤưƤˤϡ
Υåν礭٤ˤʤޤΤᡤå
/dev/null ˼ΤƤƤޤȤǡ®ư뤳ȤǤ褦ˤʤޤ

ΤȤ˵ĤСʤ®ưȤǽˤʤޤ

źդΥġˤĤ

perl ץ(*.pl) make 뤳Ȥˤꡤ*.perl 鼫ưޤ
ΤȤperl ΤươץȤƬԤ
#!/usr/bin/perl Τ褦ʹԤɲäƤޤ

[sys2wonx.pl]

#include

#include "wonx/disp.h"
Τ褦Ѵե륿Ǥ

[int2sint.pl]

short long Ƥʤ int short int Ѵޤ
sizeof(int) uint* ⡤sizeof(short int), unsigned short int*
Ѵޤ
ҤäȤ餪Ѵ򤷤Ƥޤ... Ǥ⤿֤󤽤ΤȤˤ
ѥ˥顼Ф顤
perl Ϲñ̤˽Τǡ
long
int a;
Ȥ
void func(long
int a)
Τ褦Ѥʽ򤷤Ƥȡ
long
short int a;
Ȥ
void func(long
short int a)
ѴƤޤäơäȥ顼ˤʤ뤳ȤǤ礦ĤƤ

[filters.pl]

ʣΥե륿ޤȤ̤ perl ץȤǤ
񼰤ϡ
filters.pl [filters...] -f [files...]
Ǥ㤨С
> filters.pl sort head -f file1 file2 file3
ϡ
> cat file1 | sort | head > file1.tmp
> mv file1.tmp file1
> cat file2 | sort | head > file2.tmp
> mv file2.tmp file2
> cat file3 | sort | head > file3.tmp
> mv file3.tmp file3
򤹤뤳ȤǤ

[challsrc.sh]

WonderWitchѥ wonxѥ ؤѴ򤹤뤿Υ륹ץȤǤ
Ƥϡñˡ
./filters.pl "qkc -e -u" ./sys2wonx.pl ./int2sint.pl -f [files]
Ǥ
ܸ perl Ѥˤϡɤ EUC ǤʤưʤΤǡ
"qkc -e -u" ̤Ƥ ./sys2wonx.pl ./int2sint.pl
̤褦ʽ֤ˤʤäƤޤ

[sout2str.pl]

wonx ϡꥢݡȤؤνϤϡ
output to serial port : "A"
Ȥ
output to serial port : "\n"
Τ褦ˡɸϤ˽Ϥޤsout2str.pl ϡ "" Ǥ줿ʬ
ΤߤФơ\n \t ŬڤʥɤѴƽϤե륿Ǥ
ꥢݡȤѤץ(: wwterm)ưȤˤϡ
> wwterm | ./sout2str.pl
Τ褦ˤơsout2str.pl ̤Ƶư뤳ȤˤꡤºݤΥꥢݡ
ؤνϤ˥뤳ȤǤޤ



WonX ϡ湰μʬ̶֤ż֤ Libretto ǽ񤤤
ż֥եȥפǤGPLۤޤ
ԤˤĤƤϡźդ OMAKE.jpn 򻲾ȤƤ

湰μϢΥ᡼륢ɥ쥹ϡ
hsakai@m8.people.or.jp
ǤޤܥեȥκǿǤ
http://www.seki.ee.kagu.sut.ac.jp/~sakai/WonderWitch/index.html
ۤƤޤ
ʲϥߥ顼ȤǤ
http://hp.vector.co.jp/authors/VA014157/index.html
http://www.people.or.jp/~hsakai/index.html
ߥ顼Ȥϡ椬Ȥ˥åץǡȤΤǡ˺ǿ
Ȥ櫓ǤϤޤ󡥤ޤǥХååѤǤ

ΥեϤޤ