wok view oldrunner/stuff/remap.u @ rev 25456

BootProg: fix fat16 case
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Sep 22 14:50:47 2022 +0000 (2022-09-22)
parents 78727b04c002
children
line source
1 --- oldrunner.c 2010-07-17 17:30:32.000000000 +0000
2 +++ oldrunner.c 2022-09-22 07:31:51.585297479 +0000
3 @@ -36,6 +36,8 @@
5 #include "oldrunner.h"
7 +int remap_apple = 0;
8 +
9 /*
10 * Oldrunner is a remake of the Loadrunner game from Broderbund, and one of the
11 * first computer games my father offered me. I wrote this in memory of him.
12 @@ -50,7 +52,7 @@
13 int ch, startlvl;
15 startlvl = 0;
16 - while ((ch = getopt (argc, argv, "l:v")) != -1)
17 + while ((ch = getopt (argc, argv, "l:av")) != -1)
18 {
19 switch (ch)
20 {
21 @@ -62,6 +64,9 @@
22 return 1;
23 }
24 break;
25 + case 'a':
26 + remap_apple++;
27 + break;
28 case 'v':
29 fputs ("oldrunner-" VERSION "\n", stdout);
30 return 0;
31 @@ -74,7 +79,7 @@
32 if (argc >= 1)
33 {
34 err:
35 - fputs ("usage: oldrunner [-v] [-l<num>]\n", stderr);
36 + fputs ("usage: oldrunner [-v] [-a] [-l<num>]\n", stderr);
37 return 0;
38 }
40 --- usr.c 2010-07-17 17:30:32.000000000 +0000
41 +++ usr.c 2022-09-22 07:28:52.590988791 +0000
42 @@ -43,6 +43,31 @@
43 rec_input.key = ORKEY_NONE;
44 }
46 +static int
47 +remap (int key)
48 +{
49 + extern int remap_apple;
50 + if (remap_apple)
51 + {
52 + switch (key | 0x20)
53 + {
54 + case 'u':
55 + return ORKEY_DIG_LEFT;
56 + case 'i':
57 + return ORKEY_MOVE_UP;
58 + case 'o':
59 + return ORKEY_DIG_RIGHT;
60 + case 'j':
61 + return ORKEY_MOVE_LEFT;
62 + case 'k':
63 + return ORKEY_MOVE_DOWN;
64 + case 'l':
65 + return ORKEY_MOVE_RIGHT;
66 + }
67 + }
68 + return key;
69 +}
70 +
71 void
72 usr_input (void)
73 {
74 @@ -63,7 +88,7 @@
75 continue;
76 }
78 - switch (rec_input.key)
79 + switch (remap(rec_input.key))
80 {
81 case ORKEY_EXIT:
82 return;
83 --- oldrunner.6 2012-01-31 15:04:21.000000000 +0000
84 +++ oldrunner.6 2022-09-22 08:22:18.940247242 +0000
85 @@ -34,7 +34,7 @@
86 Oldrunner \- Broderbund's Loderunner remake
87 .SH SYNOPSIS
88 .B "oldrunner "
89 -[\fB-v\fP] [\fB-l\fP<\fInum\fP>]
90 +[\fB-v\fP] [\fB-a\fP] [\fB-l\fP<\fInum\fP>]
91 .SH DESCRIPTION
92 Oldrunner is a remake of Broderbund's Loderunner which contains the
93 150 original game levels. In order to win a level, the player '\fB@\fP'
94 @@ -53,6 +53,9 @@
95 \fB-l\fP <num>
96 Start the game at level number \fInum\fP.
97 .TP
98 +\fB-a\fP
99 +Use Apple II keys mapping: j,l,i,k for the moves and u,o to dig.
100 +.TP
101 \fB-v\fP
102 Display oldrunner version and exit.
103 .SH CONFIGURATION