#include <sys/bios.h>
#include <stdlib.h>
void main(int argc, char *argv[])
{
	int iKey;
	int x = 0,y = 0;
	int Arw;
	text_set_screen(SCREEN2);
	text_window_init(4, 0, 20, 3,1); 
	text_put_string(6, 0,"[開梱ゲーム]");
	
	for(y = 0;y >= -60;y--){
	sys_wait(2);
	    screen_set_scroll(SCREEN2, x, y);
	}
	sys_wait(20);
	text_put_string(0, 2,"-PUSH ANY KEY START-");

	while(1){

		key_wait();

		text_window_init(4, 0, 20, 4,1); 
		text_put_string(0, 0,"Q:あなたはパスポートを持っていますか？");
		text_put_string(8, 2,"はい。");
		text_put_string(8, 3,"いいえ。");

		Arw = 2;
		cursor_display(1);
		cursor_set_location(11,Arw,5,1);

		while(1){
	    	iKey = key_wait();
    		if (iKey & KEY_START)	goto END;
    		if (iKey & KEY_B)		goto END;
    		if (iKey & KEY_DOWN1)   Arw = 3;
    		if (iKey & KEY_UP1)	    Arw = 2;
    		if (iKey & KEY_A){
				cursor_display(0);
				text_window_init(4, 0, 20, 4,1); 
    			if(Arw == 2){
    				if(rand() &1){
    					text_put_string(4, 1,"じゃ、シンセン(中国)ね。");
    					break;
					}
					else{
    					text_put_string(5, 1,"じゃ、オランダね。");
    					break;
					}
				}
				else{
    				text_put_string(6, 1,"じゃ、御殿場ね。");
    				break;
				}
			}
			cursor_set_location(11,Arw,5,1);
		}
	}

END: return;
}

