summaryrefslogtreecommitdiff
path: root/lib/isobuilder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/isobuilder.cpp')
-rw-r--r--lib/isobuilder.cpp26
1 files changed, 19 insertions, 7 deletions
diff --git a/lib/isobuilder.cpp b/lib/isobuilder.cpp
index 6ed8abd..80133b1 100644
--- a/lib/isobuilder.cpp
+++ b/lib/isobuilder.cpp
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: isobuilder.cpp,v 1.15 2004-11-27 21:47:56 pixel Exp $ */
+/* $Id: isobuilder.cpp,v 1.16 2004-12-17 11:48:41 pixel Exp $ */
#include "isobuilder.h"
@@ -526,7 +526,7 @@ int isobuilder::putdatas(Byte * _datas, size_t size, int smode, int n) {
return dsect;
}
-int isobuilder::createsector(Byte * datas, int smode, int n) {
+int isobuilder::createsector(Byte * datas, int smode, int n, int FN, int CN, int SM, int CI) {
Byte dsector[2352];
int rsector;
if (n >= 0)
@@ -543,11 +543,11 @@ int isobuilder::createsector(Byte * datas, int smode, int n) {
if ((smode == MODE2_FORM1) || (smode == MODE2_FORM2)) {
// Mode 2 Form 2 would be odd, but well....
- dsector[16] = dsector[20] = 0; // File Number
- dsector[17] = dsector[21] = 0; // Channel Number
- dsector[18] = dsector[22] = sub_EOR | sub_EOF | 8 |
- (smode == MODE2_FORM2 ? 32 : 0);
- dsector[19] = dsector[23] = 0; // Coding Info
+ dsector[16] = dsector[20] = FN < 0 ? 0 : FN; // File Number
+ dsector[17] = dsector[21] = CN < 0 ? 0 : CN; // Channel Number
+ dsector[18] = dsector[22] = SM < 0 ? (sub_EOR | sub_EOF | 8 |
+ (smode == MODE2_FORM2 ? 32 : 0)) : SM;
+ dsector[19] = dsector[23] = CI < 0 ? 0 : CI; // Coding Info
}
if (smode != MODE_RAW) {
@@ -569,6 +569,18 @@ int isobuilder::createsector(Byte * datas, int smode, int n) {
return rsector;
}
+int isobuilder::createsector(Handle * file, int smode, int n, int FN, int CN, int SM, int CI) {
+ Byte dsector[2352];
+
+ if (smode < 0)
+ smode = dmode;
+
+ memset(dsector, 0, 2352);
+ file->read(dsector, sec_sizes[smode]);
+
+ return createsector(dsector, smode, n, FN, CN, SM, CI);
+}
+
void isobuilder::setEOF() {
sub_EOF = 128;
sub_EOR = 1;