#include "hspdxfix.as" ;hspdxfix.dllを使えるようにする #include "hspio.as" ;hspio.dllを使えるようにする #define LTP 0x00378;パラレルポートのアドレス *initialize io_init 2;GIVEIO.SYSを使えるようにする es_ini;hspdxfix.dllを使えるようにする es_screen 640,480,32,0; スクリーン初期化 ;es_screen 640,480,32,3; debug用 if stat=1 : goto *dderr1 if stat=2 : goto *dderr2 goto *readfiles;正常に完了 *dderr1 dialog "DirectXの初期化に失敗しました。",1 goto *finish2 *dderr2 dialog "スクリーンの初期化に失敗しました。",1 goto *finish2 *dderr3 es_bye dialog "VRAMの容量が不足しています。",1 goto *finish2 *readfiles repeat 9,1 buffer 1,480,480;buffer 1を準備 picload strf("upwell%02d.bmp",cnt);画像読み込み es_buffer cnt,0; offscreen bufferにデータを転送 loop upwell=1;upwell01.bmpから始めます。 direction=1;順方向 STIM=0 *mainloop es_cls 0,0,0;画面を黒で塗りつぶし gmode 0,480,480;Windowsのメモリ転送関数BitBltと同じ pos 80,0; es_copy upwell,0,0 await 0; Windowsへタスクを知らせる es_sync 50;画面の更新 if STIM==5:io_out LTP,(direction+3)/2:else:io_out LTP,0;刺激呈示 stick key if key==128:goto *finish;ESCキーで終了 STIM=rnd(10);C言語の乱数は余り信じてないのですが・・・ if STIM==5:direction=-direction;方向を転換 upwell=upwell+direction if upwell>9:upwell=1 if upwell<1:upwell=9 goto *mainloop *finish es_bye;DirextX中止 *finish2 io_free;giveio.sysを開放する end