;mode800,value300
*define
;spi "nscrpng.spi|png"

globalon
nsa

rmenu "画像表示",windowerase ,"セーブ",save,"ロード",load,"選択肢まで進む",skip,"回想",lookback,"終了する",reset

effect 2,10,50

transmode alpha

windowback
humanz 50

numalias sysg,10
numalias name,20
numalias face,30
numalias winb,50
numalias tati,70
numalias spch,90
numalias sech,1
numalias ldpos,0
numalias sppos,1
numalias ldk,5
numalias a,-1

numalias mon,200
numalias day,201
numalias fee,210
numalias mia,211
numalias mai,212
numalias ntk,213
numalias say,214
numalias feec,300
numalias miac,301
numalias maic,302
numalias ntkc,303
numalias sayc,304
numalias wrec,305
numalias root1,306
numalias root2,307
numalias kyrnroot,308
numalias allroot,309
numalias wkwkm1,310
numalias wkwkm2,311
numalias wkwkm3,312
numalias wkwkm4,313
numalias wkwkm5,314
numalias wkwkm6,315
numalias wkwkm16,316

stralias gst,"ghost"

dim ?ldpos[2][ldk]

defsub ld
defsub ldc
defsub cl
defsub moveld
defsub nbg
defsub nbg2
defsub clbg
defsub cwin
defsub facel

game

;七次元モジュール（暗黒微笑）ここから
*ld
	getparam %1,%0,$0,%2
	if $0==gst mov ?ldpos[0][%1],50*%0-297:mov ?ldpos[1][%1],0:mov ?ldpos[2][%1],297:cl %1,%2:return
	lsp tati-%1,$0,0,0
	getspsize tati-%1,%3,%4
	mov ?ldpos[2][%1],%3/2
	mov %3,50*%0-%3/2
	mov ?ldpos[0][%1],%3
	mov ?ldpos[1][%1],600-%4
	amsp tati-%1,%3,600-%4
	if %2==0 print 1:return
	print 10,%2
return

*ldc
	getparam %0,$0,%1
	if $0==gst cl %0,%1:return
	lsp tati-%0,$0,?ldpos[0][%0],?ldpos[1][%0]
	if %1==0 print 1:return
	print 10,%1
return

*cl
	getparam %0,%1
	notif %0=a vsp tati-%0,0:csp tati-%0
	if %0=a vsp tati,0:vsp tati-1,0:vsp tati-2,0:vsp tati-3,0:vsp tati-4,0
	if %0=a csp tati:csp tati-1:csp tati-2:csp tati-3:csp tati-4
	if %1==0 print 1:return
	print 10,%1
return

*nbg
	getparam $0,%0,%1
	clbg
	if %1==0 bg $0,1:return
	bg $0,%0,%1
return

*nbg2
	getparam $0,%0,%1,$1
	clbg
	bg $0,%0,%1,$1
return

*clbg
	vsp tati,0:vsp tati-1,0:vsp tati-2,0:vsp tati-3,0:vsp tati-4,0
	csp tati:csp tati-1:csp tati-2:csp tati-3:csp tati-4
	print 0
return

*moveld
	getparam %10,%11,%12,$10
	saveoff
;	cpu 333
	getspmode %16,tati-%10
	mov %15,255
	mov %17,0
	if %16==0 lsp tati-%10,$10,?ldpos[0][%10],?ldpos[1][%10],0:mov %17,1:mov %15,0
	mov %11,%11*50-?ldpos[2][%10]-?ldpos[0][%10]
	resettimer
	for %13=1 to 10 step 0
		gettimer %14
		if %12<=%14 break
		if $10==gst mov %15,255-255*%14/%12
		if %17==1 mov %15,255*%14/%12
		amsp tati-%10,%11*%14/%12+?ldpos[0][%10],?ldpos[1][%10],%15
		print 1
	next
	if $10==gst mov %15,0
	if %17==1 mov %15,255
	amsp tati-%10,%11+?ldpos[0][%10],?ldpos[1][%10],%15
	print 1
	mov ?ldpos[0][%10],?ldpos[0][%10]+%11+?ldpos[2][%10]
	if $10==gst cl %10,1:jumpf
	lsp tati-%10,$10,0,0
	getspsize tati-%10,%11,%12
	mov ?ldpos[2][%10],%11/2
	mov ?ldpos[0][%10],?ldpos[0][%10]-%11/2
	mov ?ldpos[1][%10],600-%12
	amsp tati-%10,?ldpos[0][%10],600-%12
	print 1
~
;	cpu 222
	saveon
return

*cwin
	getrapam %0
	itoa $0,%0
	setwindow 195,478,24,3,24,24,0,4,20,0,1,"sysgrp/SGMsgWnd00000"+$0+".jpg",0,409
return

*facel
	getparam $0,%0
	lsp face,$0,0,0
	getspsize face,%1,%2
	amsp face,0,600-%2
	if %0==0 print 1:return
	print 10,%0
return
;ここまで

*start

setwindow 195,478,24,3,24,24,0,4,20,0,1,"sysgrp/SGMsgWnd000000.jpg",0,409
erasetextwindow 0
