err.c
4.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
/*---------------------------------------------------------------------*
Copyright (C) 1998 Nintendo.
$RCSfile: err.c,v $
$Revision: 1.1.1.1 $
$Date: 2002/05/02 03:27:09 $
*---------------------------------------------------------------------*/
#include "main.h"
#include "herr.h"
#include "hdd.h"
#include "font.h"
#include "hscr.h"
u8 err_str[60];
static s32 _err_show=0,_err_no=0;
static void _print(Gfx ** gpp);
static void _printNum(Gfx **gpp);
/* static s32 _init(void); */
static s32 _mes ;
static u8 temp[32];
void
_printNum(Gfx **gpp)
{
Gfx *gp=*gpp;
font_set_pos( 96, 64 );
jfont_show_string( &gp, 3 );
font_set_pos( 178, 64 );
sprintf(temp, "%02d", dd_getStatus()->errno);
font_show_string( &gp, temp );
*gpp = gp;
}
void
_print(Gfx **gpp)
{
u8 temp[32];
Gfx *gp=*gpp;
_mes = dd_getStatus()->errmes;
font_set_transparent( 0 );
font_set_color(255, 255, 255, 255 );
if( dd_getStatus()->mode & ( DDSTAT_DEAD | DDSTAT_DIALOGUE) )
{
switch( _mes & 0xFF)
{
/* 必須メッセ−ジ(領域1、2) */
case ERRMES__SET_CLOCK:
if( _getCurrentScreen() != SCREEN_SETRTC)
{
_printNum(&gp);
font_set_pos( 40, 88 );
jfont_show_string( &gp, ES_JIKOKU_WO_SETTEI );
font_set_pos( 40, 108 );
jfont_show_string( &gp, ES_KUWASIKU_HA_SETUMEISHO );
font_set_pos( 40, 128 );
jfont_show_string( &gp, ES_OYOMIKUDASAI );
font_set_pos( 40, 172 );
jfont_show_string( &gp, ES_A_BUTTON_WO_OSHITE );
}
break;
case ERRMES__RAMPACK_NOT_CONNECTED:
_printNum(&gp);
font_set_pos( 40, 88 );
jfont_show_string( &gp, ES_KAKCHO_RAM_PAK );
font_set_pos( 40, 108 );
jfont_show_string( &gp, ES_SASHIKONNDE_ARIMASUKA );
font_set_pos( 40, 128 );
jfont_show_string( &gp, ES_KUWASIKU_HA_SETUMEISHO );
font_set_pos( 40, 148 );
jfont_show_string( &gp, ES_OYOMIKUDASAI );
break;
case ERRMES__TORISETSU_YOME:
_printNum(&gp);
font_set_pos( 40, 88 );
jfont_show_string( &gp, ES_TORIATUKAI_SETUMEISHO );
break;
case ERRMES__NOW_IN_RESTORE:
font_set_pos( 40, 108 );
jfont_show_string( &gp, ES_ZENKAI_DATA_GA);
font_set_pos( 40, 128 );
jfont_show_string( &gp, ES_SAVE_DEKIMASEN);
font_set_pos( 40, 148 );
jfont_show_string( &gp, ES_DATA_WO_SHOKIKA);
font_set_pos( 40, 172 );
jfont_show_string( &gp, ES_A_BUTTON_WO_OSHITE );
break;
case ERRMES__ACCESSLAMP:
_printNum(&gp);
font_set_pos( 40, 88 );
jfont_show_string( &gp, ES_ACCESS_LAMP );
font_set_pos( 40, 108 );
jfont_show_string( &gp, ES_DISK_WO_NUKANAIDE );
font_set_pos( 40, 128 );
jfont_show_string( &gp, ES_KUWASIKU_HA_SETUMEISHO );
font_set_pos( 40, 148 );
jfont_show_string( &gp, ES_OYOMIKUDASAI );
break;
case ERRMES__WRONG_DISK:
font_set_pos( 40, 88 );
jfont_show_string( &gp, ES_MACHIGATTA_DISK );
font_set_pos( 40, 108 );
jfont_show_string( &gp, ES_KANOSEI_GA_ARIMASU );
font_set_pos( 40, 128 );
jfont_show_string( &gp, ES_TADASHII_DISK_NI );
font_set_pos( 40, 148 );
jfont_show_string( &gp, ES_KUDASAI );
break;
default:
break;
}
/* 必須メッセ−ジ(領域3) */
switch( _mes & 0xFF00 )
{
case ERRMES__DISK_WO_NUKE:
font_set_pos( 40, 172 );
jfont_show_string( &gp, ES_DISK_WO_TORIDASHITE );
break;
case ERRMES__DISK_WO_IRERO:
font_set_pos( 40, 172 );
jfont_show_string( &gp, ES_DISK_WO_SASHIKONDE );
break;
case ERRMES__INSERT_AGAIN:
font_set_pos( 24, 172 );
jfont_show_string( &gp, ES_DISK_WO_SASHIKOMINAOSHITE );
break;
}
}
/* アプリケーション独自のメッセ−ジ (あれば)*/
else if( dd_getStatus()->mode & DDSTAT_KILLED )
{
switch( _mes & 0xFF)
{
case ERRMES__DRIVE_NOT_FOUND:
font_set_pos( 80, 108 );
sprintf(temp, "%s", "64DD DRIVE NOT FOUND!");
font_show_string( &gp, temp );
break;
}
}
else
{
if( _err_show )
{
switch( _err_no )
{
case 1:
break;
}
}
}
*gpp = gp;
}
void
err_set(s32 no)
{
_err_show = 1;
_err_no = no;
}
void
scr_error(Gfx ** gpp)
{
static s32 _first = 1;
if(_first)
{
--_first;
/* _init();
*/
}
_print(gpp);
if( conts[0].nowtrg & A_BUTTON )
{
switch ( _mes & 0xFF )
{
case ERRMES__NOW_IN_RESTORE:
dd_thaw(ERRMES__NOW_IN_RESTORE);
break;
}
}
}