summaryrefslogtreecommitdiff
path: root/multimedia/regionset/patches/patch-ab
blob: cf5ea7e066289e20d3e481c6380f9848d3c80928 (plain)
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
$NetBSD: patch-ab,v 1.3 2005/06/19 10:42:27 hira Exp $

--- regionset.c.old	2003-10-30 07:32:34.000000000 -0500
+++ regionset.c	2005-04-16 02:42:40.000000000 -0400
@@ -27,7 +27,11 @@
 #include <stdio.h>
 #include "dvd_udf.h"
 
+#if defined(__NetBSD__) || defined(__OpenBSD__)
+#define DEFAULTDEVICE "/dev/cd0a"
+#else /* linux */
 #define DEFAULTDEVICE "/dev/dvd"
+#endif
 #define VERSION "0.1"
 
 int main (int argc, char* argv[]) 
@@ -39,8 +43,9 @@
 	if (argc>1) err=UDFOpenDisc(argv[1]);
 	else err=UDFOpenDisc(DEFAULTDEVICE);
 	if (err<0) {
-		printf("ERROR: Could not open disc \"%s\"!\n",((argc>=1)?argv[1]:DEFAULTDEVICE));
+		printf("ERROR: Could not open disc \"%s\"!\n",((argc>=2)?argv[1]:DEFAULTDEVICE));
                 printf("Ensure that there is any readable CD or DVD in the drive.\n");
+		printf("usage: regionset [dvd-device-node]\n");
 		return 1;
 	}
 	if (UDFRPCGet(&type,&vra,&ucca,&region_mask,&rpc_scheme)) {
@@ -60,6 +65,20 @@
 	printf("Would you like to change the region setting of your drive? [y/n]:");
 	fgets(ch,3,stdin);
 	if ((ch[0]=='y') || (ch[0]=='Y')) {
+		printf("Choices include (not complete list):\n");
+		printf(" 0: Regionless DVDs only\n");
+		printf(" 1: USA, Canada, US Territories\n");
+		printf(" 2: W. Europe, Greenland, S. Africa, Lesotho, "
+		    "Swaziland, Japan, Egypt, Mid-East\n");
+		printf(" 3: Southeast Asia, South Korea, Hong Kong, Macau, "
+		    "Taiwan\n");
+		printf(" 4: Australia, New Zealand, Oceania, Mexico, Central "
+		    "America\n");
+		printf(" 5: Russia (& former Soviet Union), E. Europe, Indian "
+		    "subcontinent, Mongolia\n    N. Korea, rest of Africa\n");
+		printf(" 6: People's Republic of China\n");
+		printf(" 7: reserved\n");
+		printf(" 8: International Venues\n");
 		printf("Enter the new region number for your drive [1..8]:");
 		fgets(ch,3,stdin);
 		if ((ch[0]<'0') || (ch[0]>'8')) {
@@ -72,7 +91,7 @@
 			printf("Identical region code already set, aborting!\n");
 			goto ERROR;
 		}
-		printf("New mask: 0x%02X, correct? [y/n]:",i);
+		printf("New mask: 0x%02X, correct? [y/n]:",i & 0xff);
 		fgets(ch,3,stdin);
 		if ((ch[0]=='y') || (ch[0]=='Y')) {
 			if (UDFRPCSet(i)) {