Added optional code for a pseudo CD-RW to test the code for MMC multi-session

This commit is contained in:
Thomas Schmitt 2007-09-29 22:18:34 +00:00
parent 22d0969098
commit 0c6ab93875

View File

@ -9,6 +9,12 @@
Copyright 2007 Thomas Schmitt, <scdbackup@gmx.net> Copyright 2007 Thomas Schmitt, <scdbackup@gmx.net>
*/ */
/* <<< A70929 : hardcoded CD-RW with fabricated -msinfo = 0,1600
#define Hardcoded_cd_rW 1
#define Hardcoded_cd_rw_c1 0
#define Hardcoded_cd_rw_nwA 1600
*/
#include <stdio.h> #include <stdio.h>
#include <ctype.h> #include <ctype.h>
@ -60,6 +66,14 @@ static int isoburn_welcome_media(struct isoburn **o, struct burn_drive *d,
ret= isoburn_create_data_source(*o); ret= isoburn_create_data_source(*o);
if(ret<=0) if(ret<=0)
goto ex; goto ex;
#ifdef Hardcoded_cd_rW
/* <<< A70929 : hardcoded CD-RW with fabricated -msinfo */
caps->start_adr= 0;
(*o)->fabricated_disc_status= BURN_DISC_APPENDABLE;
/* is not set with MMC multi-session: (*o)->nwa= Hardcoded_cd_rw_nwA; */
#endif
if(caps->start_adr) { /* set emulation to overwriteable */ if(caps->start_adr) { /* set emulation to overwriteable */
(*o)->emulation_mode= 1; (*o)->emulation_mode= 1;
ret= isoburn_start_emulation(*o, 0); ret= isoburn_start_emulation(*o, 0);
@ -214,6 +228,12 @@ int isoburn_disc_get_msc1(struct burn_drive *d, int *start_lba)
int ret; int ret;
struct isoburn *o; struct isoburn *o;
#ifdef Hardcoded_cd_rW
/* <<< A70929 : hardcoded CD-RW with fabricated -msinfo */
*start_lba= Hardcoded_cd_rw_c1;
return(1);
#endif
if(isoburn_disc_get_status(d)!=BURN_DISC_APPENDABLE) if(isoburn_disc_get_status(d)!=BURN_DISC_APPENDABLE)
return(0); return(0);
ret= isoburn_find_emulator(&o, d, 0); ret= isoburn_find_emulator(&o, d, 0);
@ -234,6 +254,13 @@ int isoburn_disc_track_lba_nwa(struct burn_drive *d,
int ret; int ret;
struct isoburn *o; struct isoburn *o;
#ifdef Hardcoded_cd_rW
/* <<< A70929 : hardcoded CD-RW with fabricated -msinfo */
*lba= Hardcoded_cd_rw_c1;
*nwa= Hardcoded_cd_rw_nwA;
return(1);
#endif
ret= isoburn_find_emulator(&o, d, 0); ret= isoburn_find_emulator(&o, d, 0);
if(ret<0) if(ret<0)
return(0); return(0);
@ -264,6 +291,13 @@ void isoburn_disc_write(struct burn_write_opts *opts, struct burn_disc *disc)
} }
} }
burn_write_opts_set_multi(opts, multi); burn_write_opts_set_multi(opts, multi);
#ifdef Hardcoded_cd_rW
/* <<< A70929 : hardcoded CD-RW with fabricated -msinfo */
burn_write_opts_set_start_byte(opts,
((off_t) Hardcoded_cd_rw_nwA) * (off_t) 2048);
#endif
burn_disc_write(opts, disc); burn_disc_write(opts, disc);
} }