summaryrefslogtreecommitdiff
path: root/audio/rio500/patches/patch-ac
blob: b3b7ef2eb63d3ad4d11f2d63683e2f8161f785cd (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
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
$NetBSD: patch-ac,v 1.2 2000/08/22 15:40:12 dmcmahill Exp $

--- lib/librio500.c.orig	Tue Aug 22 14:52:30 2000
+++ lib/librio500.c	Tue Aug 22 14:55:42 2000
@@ -24,7 +24,7 @@
 #include "libfon.h"
 
 #ifdef WORDS_BIGENDIAN
-#include <byteswap.h>
+#include <machine/bswap.h>
 #endif
 
 void
@@ -55,9 +55,9 @@
    need to byteswap to get to le */
 
 #ifdef WORDS_BIGENDIAN
-  location.offset     = bswap_16(location.offset);
-  location.bytes      = bswap_16(location.bytes);
-  location.folder_num = bswap_16(location.folder_num);
+  location.offset     = bswap16(location.offset);
+  location.bytes      = bswap16(location.bytes);
+  location.folder_num = bswap16(location.folder_num);
 #endif
 
   rio_ctl_msg (fd, RIO_DIR_OUT, 0x56, 0, 0, 
@@ -87,13 +87,13 @@
    to read correctly */
 
 #ifdef WORDS_BIGENDIAN
-  status.dunno1 = bswap_16(status.dunno1);
-  status.block_size = bswap_16(status.block_size);
-  status.num_blocks = bswap_16(status.num_blocks);
-  status.first_free_block = bswap_16(status.first_free_block);
-  status.num_unused_blocks = bswap_16(status.num_unused_blocks);
-  status.dunno2 = bswap_32(status.dunno2);
-  status.dunno3 = bswap_32(status.dunno3);
+  status.dunno1 = bswap16(status.dunno1);
+  status.block_size = bswap16(status.block_size);
+  status.num_blocks = bswap16(status.num_blocks);
+  status.first_free_block = bswap16(status.first_free_block);
+  status.num_unused_blocks = bswap16(status.num_unused_blocks);
+  status.dunno2 = bswap32(status.dunno2);
+  status.dunno3 = bswap32(status.dunno3);
 #endif
 
   return &status;
@@ -476,25 +476,25 @@
 void
 bswap_folder_entry (folder_entry *fe)
 {
-  fe->offset = bswap_16(fe->offset);
-  fe->dunno1 = bswap_16(fe->dunno1);
-  fe->fst_free_entry_off = bswap_16(fe->fst_free_entry_off);
-  fe->dunno2 = bswap_16(fe->dunno2);
-  fe->dunno3 = bswap_32(fe->dunno3);
-  fe->dunno4 = bswap_32(fe->dunno4);
-  fe->time = bswap_32(fe->time);
+  fe->offset = bswap16(fe->offset);
+  fe->dunno1 = bswap16(fe->dunno1);
+  fe->fst_free_entry_off = bswap16(fe->fst_free_entry_off);
+  fe->dunno2 = bswap16(fe->dunno2);
+  fe->dunno3 = bswap32(fe->dunno3);
+  fe->dunno4 = bswap32(fe->dunno4);
+  fe->time = bswap32(fe->time);
 }
 
 void
 bswap_song_entry (song_entry *se)
 {
-  se->offset = bswap_16(se->offset);
-  se->dunno1 = bswap_16(se->dunno1);
-  se->length = bswap_32(se->length);
-  se->dunno2 = bswap_16(se->dunno2);
-  se->dunno3 = bswap_16(se->dunno3);
-  se->mp3sig = bswap_32(se->mp3sig);
-  se->time = bswap_32(se->time);
+  se->offset = bswap16(se->offset);
+  se->dunno1 = bswap16(se->dunno1);
+  se->length = bswap32(se->length);
+  se->dunno2 = bswap16(se->dunno2);
+  se->dunno3 = bswap16(se->dunno3);
+  se->mp3sig = bswap32(se->mp3sig);
+  se->time = bswap32(se->time);
 }
 
 
@@ -662,7 +662,7 @@
   rio_ctl_msg (fd, RIO_DIR_IN, req, val, idx, 4, (BYTE*)&status);
 
 #ifdef WORDS_BIGENDIAN
-   status = bswap_32 (status);
+   status = bswap32 (status);
 #endif
 
   return status;
@@ -740,7 +740,7 @@
 /* on big_endian platforms, need to byteswap num_blocks to write to le rio */
 
 #ifdef WORDS_BIGENDIAN
-   new_smiley->num_blocks = bswap_16(new_smiley->num_blocks);
+   new_smiley->num_blocks = bswap16(new_smiley->num_blocks);
 #endif
 
    return new_smiley;
@@ -802,7 +802,7 @@
    transfer to rio */
 
 #ifdef WORDS_BIGENDIAN
-  new_bitmap->num_blocks = bswap_16(new_bitmap->num_blocks);
+  new_bitmap->num_blocks = bswap16(new_bitmap->num_blocks);
 #endif
 
   return new_bitmap;