Skip to content

Commit fdd4607

Browse files
committed
msx: rough version of all screen/input functions
1 parent 5198023 commit fdd4607

File tree

3 files changed

+174
-86
lines changed

3 files changed

+174
-86
lines changed

src/connect_wifi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ void connect_wifi(void)
3434
return;
3535
}
3636
#endif /* _CMOC_VERSION_ */
37-
37+
3838
fuji_get_wifi_status(&s);
3939

4040
switch (s)
@@ -46,7 +46,7 @@ void connect_wifi(void)
4646
case 3:
4747
screen_error("CONNECTION SUCCESS!");
4848
state = HOSTS_AND_DEVICES;
49-
#ifdef BUILD_ADAM
49+
#if defined(BUILD_ADAM) || defined(BUILD_MSX)
5050
screen_should_be_cleared=true;
5151
#endif
5252
pause(60);

src/msx/input.c

Lines changed: 62 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,12 @@ WSSubState input_set_wifi_select(void)
123123

124124
void input_line_set_wifi_custom(char *c)
125125
{
126-
input_line(0,19,0,c,32,false);
126+
input_line(0,22,0,c,32,false);
127127
}
128128

129129
void input_line_set_wifi_password(char *c)
130130
{
131-
input_line(0,19,0,c,64,true);
131+
input_line(0,22,0,c,64,true);
132132
}
133133

134134
HDSubState input_hosts_and_devices_hosts(void)
@@ -216,6 +216,10 @@ HDSubState input_hosts_and_devices_devices(void)
216216
case KEY_2:
217217
case KEY_3:
218218
case KEY_4:
219+
case KEY_5:
220+
case KEY_6:
221+
case KEY_7:
222+
case KEY_8:
219223
bar_jump(k-KEY_1);
220224
selected_device_slot=bar_get();
221225
//hosts_and_devices_long_filename();
@@ -268,7 +272,7 @@ void input_line_hosts_and_devices_host_slot(uint_fast8_t i, uint_fast8_t o, char
268272

269273
void input_line_filter(char *c)
270274
{
271-
input_line(0,19,0,c,32,false);
275+
input_line(0,22,0,c,32,false);
272276
}
273277

274278
SFSubState input_select_file_choose(void)
@@ -294,6 +298,8 @@ SFSubState input_select_file_choose(void)
294298
bar_down();
295299
select_display_long_filename();
296300
break;
301+
case 'M':
302+
case 'm':
297303
case KEY_RETURN:
298304
pos += bar_get();
299305
entryType = select_file_entry_type();
@@ -313,46 +319,71 @@ SFSubState input_select_file_choose(void)
313319
case 'F':
314320
case 'f':
315321
return SF_FILTER;
316-
// case 'N':
317-
// case 'n':
318-
// return SF_NEW;
319-
// case 'C':
320-
// case 'c':
321-
// pos += bar_get();
322-
// select_file_set_source_filename();
323-
// return SF_COPY;
324-
case ',':
325-
case '<':
326-
if (pos > 0)
327-
return SF_PREV_PAGE;
328-
break;
329-
case '.':
330-
case '>':
331-
if (dir_eof == false)
332-
return SF_NEXT_PAGE;
333-
break;
322+
case 'N':
323+
case 'n':
324+
return SF_NEW;
325+
case 'C':
326+
case 'c':
327+
pos += bar_get();
328+
select_file_set_source_filename();
329+
return SF_COPY;
330+
// case ',':
331+
// case '<':
332+
// if (pos > 0)
333+
// return SF_PREV_PAGE;
334+
// break;
335+
// case '.':
336+
// case '>':
337+
// if (dir_eof == false)
338+
// return SF_NEXT_PAGE;
339+
// break;
334340
}
335341
return SF_CHOOSE;
336342
}
337343

338344
unsigned char input_select_file_new_type(void)
339345
{
346+
unsigned char k = input();
347+
// TODO: Actually define disk types
348+
switch (k)
349+
{
350+
case '1':
351+
return 1;
352+
case '2':
353+
return 2;
354+
case 'B':
355+
case 'b':
356+
return 3;
357+
}
340358
return 0;
341359
}
342360

343361
unsigned long input_select_file_new_size(unsigned char t)
344362
{
363+
unsigned char k = input();
364+
// TODO: Actually define disk types
365+
switch (k)
366+
{
367+
case '3':
368+
return 360;
369+
case '7':
370+
return 720;
371+
case 'C':
372+
case 'c':
373+
return 1;
374+
}
345375
return 0;
346376
}
347377

348378
unsigned long input_select_file_new_custom(void)
349379
{
350-
return 0;
380+
char s[9];
381+
input_line(0,22,0,s,8,false);
351382
}
352383

353384
void input_select_file_new_name(char *c)
354385
{
355-
// input_line(SCR_X0, SCR_Y0 + 19, 0, c, 40, false); // should be 255(?), but we do not handle multiline strings yet
386+
input_line(0,22,0,c,32,false);
356387
}
357388

358389
SSSubState input_select_slot_choose(void)
@@ -376,28 +407,20 @@ SSSubState input_select_slot_choose(void)
376407
case KEY_RIGHT_ARROW:
377408
bar_down();
378409
return SS_CHOOSE;
379-
// Memory Module 'M' -> '4'
380-
case 'M':
381-
case 'm':
382-
k = KEY_4;
383-
// fall throw
384-
// Tape 'T' -> '3'
385-
case 'T':
386-
case 't':
387-
if (k != KEY_4)
388-
k = KEY_3;
389-
// fall throw
390410
case KEY_1:
391411
case KEY_2:
392412
case KEY_3:
393413
case KEY_4:
414+
case KEY_5:
415+
case KEY_6:
416+
case KEY_7:
417+
case KEY_8:
394418
bar_jump(k-KEY_1);
395-
return SS_CHOOSE;
396-
// case KEY_SMART_IV:
397-
case 'E':
398-
case 'e':
399-
select_slot_eject(bar_get());
400419
return SS_CHOOSE;
420+
// case 'E':
421+
// case 'e':
422+
// select_slot_eject(bar_get());
423+
// return SS_CHOOSE;
401424
case 'R':
402425
case 'r':
403426
case KEY_RETURN:

0 commit comments

Comments
 (0)