Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
PUAE
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PocketInsanity
PUAE
Commits
8f059ce4
Commit
8f059ce4
authored
Aug 19, 2010
by
Mustafa 'GnoStiC' TUFAN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
syncing 2.3.0
parent
bfe77db8
Changes
27
Show whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
628 additions
and
636 deletions
+628
-636
Makefile.am
src/Makefile.am
+1
-1
Makefile.in
src/Makefile.in
+13
-12
akiko.c
src/akiko.c
+47
-33
header.c
src/archivers/lha/header.c
+6
-6
lhamaketbl.c
src/archivers/lha/lhamaketbl.c
+1
-1
lharc.c
src/archivers/lha/lharc.c
+1
-1
unlzx.c
src/archivers/lzx/unlzx.c
+2
-2
warp.c
src/archivers/wrp/warp.c
+5
-5
blkdev.c
src/blkdev.c
+11
-12
cdtv.c
src/cdtv.c
+58
-64
drawing.c
src/drawing.c
+5
-7
genblitter.c
src/genblitter.c
+2
-2
ar.h
src/include/ar.h
+1
-0
blkdev.h
src/include/blkdev.h
+3
-3
rommgr.h
src/include/rommgr.h
+13
-12
savestate.h
src/include/savestate.h
+6
-6
sysdeps.h
src/include/sysdeps.h
+1
-0
misc.c
src/misc.c
+2
-2
native2amiga.c
src/native2amiga.c
+39
-39
newcpu.c
src/newcpu.c
+7
-7
picasso96.c
src/picasso96.c
+243
-251
rommgr.c
src/rommgr.c
+33
-31
savestate.c
src/savestate.c
+8
-8
scsiemul.c
src/scsiemul.c
+3
-3
config.log
src/tools/config.log
+3
-3
zfile.c
src/zfile.c
+50
-8
zfile_archive.c
src/zfile_archive.c
+64
-117
No files found.
src/Makefile.am
View file @
8f059ce4
...
@@ -133,7 +133,7 @@ EXTRA_DIST = \
...
@@ -133,7 +133,7 @@ EXTRA_DIST = \
uae_SOURCES
=
\
uae_SOURCES
=
\
main.c newcpu.c memory.c rommgr.c custom.c serial.c dongle.c cia.c
\
main.c newcpu.c memory.c rommgr.c custom.c serial.c dongle.c cia.c
\
blitter.c autoconf.c traps.c ersatz.c keybuf.c expansion.c
\
blitter.c autoconf.c traps.c ersatz.c keybuf.c expansion.c
\
diskutil.c zfile.c cfgfile.c picasso96.c inputdevice.c
\
diskutil.c zfile.c
zfile_archive.c
cfgfile.c picasso96.c inputdevice.c
\
gfxutil.c audio.c sinctable.c drawing.c consolehook.c
\
gfxutil.c audio.c sinctable.c drawing.c consolehook.c
\
native2amiga.c disk.c crc32.c savestate.c arcadia.c cdtv.c cd32_fmv.c
\
native2amiga.c disk.c crc32.c savestate.c arcadia.c cdtv.c cd32_fmv.c
\
uaeexe.c uaelib.c uaeresource.c fdi2raw.c hotkeys.c amax.c
\
uaeexe.c uaelib.c uaeresource.c fdi2raw.c hotkeys.c amax.c
\
...
...
src/Makefile.in
View file @
8f059ce4
...
@@ -79,17 +79,17 @@ am_uae_OBJECTS = main.$(OBJEXT) newcpu.$(OBJEXT) memory.$(OBJEXT) \
...
@@ -79,17 +79,17 @@ am_uae_OBJECTS = main.$(OBJEXT) newcpu.$(OBJEXT) memory.$(OBJEXT) \
dongle.
$(OBJEXT)
cia.
$(OBJEXT)
blitter.
$(OBJEXT)
\
dongle.
$(OBJEXT)
cia.
$(OBJEXT)
blitter.
$(OBJEXT)
\
autoconf.
$(OBJEXT)
traps.
$(OBJEXT)
ersatz.
$(OBJEXT)
\
autoconf.
$(OBJEXT)
traps.
$(OBJEXT)
ersatz.
$(OBJEXT)
\
keybuf.
$(OBJEXT)
expansion.
$(OBJEXT)
diskutil.
$(OBJEXT)
\
keybuf.
$(OBJEXT)
expansion.
$(OBJEXT)
diskutil.
$(OBJEXT)
\
zfile.
$(OBJEXT)
cfgfile.
$(OBJEXT)
picasso96
.
$(OBJEXT)
\
zfile.
$(OBJEXT)
zfile_archive.
$(OBJEXT)
cfgfile
.
$(OBJEXT)
\
inputdevice.
$(OBJEXT)
gfxutil.
$(OBJEXT)
audio
.
$(OBJEXT)
\
picasso96.
$(OBJEXT)
inputdevice.
$(OBJEXT)
gfxutil
.
$(OBJEXT)
\
sinctable.
$(OBJEXT)
drawing.
$(OBJEXT)
consolehook
.
$(OBJEXT)
\
audio.
$(OBJEXT)
sinctable.
$(OBJEXT)
drawing
.
$(OBJEXT)
\
native2amiga.
$(OBJEXT)
disk.
$(OBJEXT)
crc32
.
$(OBJEXT)
\
consolehook.
$(OBJEXT)
native2amiga.
$(OBJEXT)
disk
.
$(OBJEXT)
\
savestate.
$(OBJEXT)
arcadia.
$(OBJEXT)
cdtv
.
$(OBJEXT)
\
crc32.
$(OBJEXT)
savestate.
$(OBJEXT)
arcadia
.
$(OBJEXT)
\
cd
32_fmv.
$(OBJEXT)
uaeexe.
$(OBJEXT)
uaelib
.
$(OBJEXT)
\
cd
tv.
$(OBJEXT)
cd32_fmv.
$(OBJEXT)
uaeexe
.
$(OBJEXT)
\
uae
resource.
$(OBJEXT)
fdi2raw.
$(OBJEXT)
hotkeys
.
$(OBJEXT)
\
uae
lib.
$(OBJEXT)
uaeresource.
$(OBJEXT)
fdi2raw
.
$(OBJEXT)
\
amax.
$(OBJEXT)
ar.
$(OBJEXT)
driveclick
.
$(OBJEXT)
\
hotkeys.
$(OBJEXT)
amax.
$(OBJEXT)
ar
.
$(OBJEXT)
\
enforcer.
$(OBJEXT)
misc.
$(OBJEXT)
a2065
.
$(OBJEXT)
\
driveclick.
$(OBJEXT)
enforcer.
$(OBJEXT)
misc
.
$(OBJEXT)
\
gayle.
$(OBJEXT)
ncr_scsi.
$(OBJEXT)
missing
.
$(OBJEXT)
\
a2065.
$(OBJEXT)
gayle.
$(OBJEXT)
ncr_scsi
.
$(OBJEXT)
\
readcpu.
$(OBJEXT)
missing.
$(OBJEXT)
readcpu.
$(OBJEXT)
uae_OBJECTS
=
$(am_uae_OBJECTS)
uae_OBJECTS
=
$(am_uae_OBJECTS)
SCRIPTS
=
$(dist_noinst_SCRIPTS)
SCRIPTS
=
$(dist_noinst_SCRIPTS)
DEFAULT_INCLUDES
=
-I
.@am__isrc@
DEFAULT_INCLUDES
=
-I
.@am__isrc@
...
@@ -412,7 +412,7 @@ EXTRA_DIST = \
...
@@ -412,7 +412,7 @@ EXTRA_DIST = \
uae_SOURCES
=
\
uae_SOURCES
=
\
main.c newcpu.c memory.c rommgr.c custom.c serial.c dongle.c cia.c
\
main.c newcpu.c memory.c rommgr.c custom.c serial.c dongle.c cia.c
\
blitter.c autoconf.c traps.c ersatz.c keybuf.c expansion.c
\
blitter.c autoconf.c traps.c ersatz.c keybuf.c expansion.c
\
diskutil.c zfile.c cfgfile.c picasso96.c inputdevice.c
\
diskutil.c zfile.c
zfile_archive.c
cfgfile.c picasso96.c inputdevice.c
\
gfxutil.c audio.c sinctable.c drawing.c consolehook.c
\
gfxutil.c audio.c sinctable.c drawing.c consolehook.c
\
native2amiga.c disk.c crc32.c savestate.c arcadia.c cdtv.c cd32_fmv.c
\
native2amiga.c disk.c crc32.c savestate.c arcadia.c cdtv.c cd32_fmv.c
\
uaeexe.c uaelib.c uaeresource.c fdi2raw.c hotkeys.c amax.c
\
uaeexe.c uaelib.c uaeresource.c fdi2raw.c hotkeys.c amax.c
\
...
@@ -660,6 +660,7 @@ distclean-compile:
...
@@ -660,6 +660,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/uaeresource.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/uaeresource.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/writelog.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/writelog.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/zfile.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/zfile.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/zfile_archive.Po@am__quote@
.c.o
:
.c.o
:
@am__fastdepCC_TRUE@
$(COMPILE)
-MT
$@
-MD
-MP
-MF
$(DEPDIR)/$*.Tpo
-c
-o
$@
$<
@am__fastdepCC_TRUE@
$(COMPILE)
-MT
$@
-MD
-MP
-MF
$(DEPDIR)/$*.Tpo
-c
-o
$@
$<
...
...
src/akiko.c
View file @
8f059ce4
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
#include "threaddep/thread.h"
#include "threaddep/thread.h"
#include "akiko.h"
#include "akiko.h"
#include "gui.h"
#include "gui.h"
#include "crc32.h"
#include "sleep.h"
#include "sleep.h"
#include "custom.h"
#include "custom.h"
#include "newcpu.h"
#include "newcpu.h"
...
@@ -370,7 +371,7 @@ static uae_u32 akiko_c2p_read (int offset)
...
@@ -370,7 +371,7 @@ static uae_u32 akiko_c2p_read (int offset)
#define CH_ERR_ABNORMALSEEK 0xf0 // %11110000
#define CH_ERR_ABNORMALSEEK 0xf0 // %11110000
#define CH_ERR_NODISK 0xf8 // %11111000
#define CH_ERR_NODISK 0xf8 // %11111000
static
int
framecounter
,
subcodecounter
;
static
int
subcodecounter
;
#define MAX_SUBCODEBUFFER 20
#define MAX_SUBCODEBUFFER 20
static
volatile
int
subcodebufferoffset
,
subcodebufferoffsetw
;
static
volatile
int
subcodebufferoffset
,
subcodebufferoffsetw
;
...
@@ -398,7 +399,7 @@ static struct cd_toc_head cdrom_toc_cd_buffer;
...
@@ -398,7 +399,7 @@ static struct cd_toc_head cdrom_toc_cd_buffer;
static
uae_u8
qcode_buf
[
SUBQ_SIZE
];
static
uae_u8
qcode_buf
[
SUBQ_SIZE
];
static
int
qcode_valid
;
static
int
qcode_valid
;
static
int
cdrom_disk
,
cdrom_paused
,
cdrom_playing
;
static
int
cdrom_disk
,
cdrom_paused
,
cdrom_playing
,
cdrom_audiostatus
;
static
int
cdrom_command_active
;
static
int
cdrom_command_active
;
static
int
cdrom_command_length
;
static
int
cdrom_command_length
;
static
int
cdrom_checksum_error
,
cdrom_unknown_command
;
static
int
cdrom_checksum_error
,
cdrom_unknown_command
;
...
@@ -455,6 +456,7 @@ static void cdaudiostop_do (void)
...
@@ -455,6 +456,7 @@ static void cdaudiostop_do (void)
static
void
cdaudiostop
(
void
)
static
void
cdaudiostop
(
void
)
{
{
cdrom_audiostatus
=
0
;
cdrom_audiotimeout
=
0
;
cdrom_audiotimeout
=
0
;
cdrom_paused
=
0
;
cdrom_paused
=
0
;
cdrom_playing
=
0
;
cdrom_playing
=
0
;
...
@@ -499,6 +501,25 @@ static void subfunc (uae_u8 *data, int cnt)
...
@@ -499,6 +501,25 @@ static void subfunc (uae_u8 *data, int cnt)
uae_sem_post
(
&
sub_sem
);
uae_sem_post
(
&
sub_sem
);
}
}
static
int
statusfunc
(
int
status
)
{
if
(
status
==
-
1
)
return
0
;
if
(
status
==
-
2
)
return
150
;
if
(
cdrom_audiostatus
!=
status
)
{
if
(
status
==
AUDIO_STATUS_IN_PROGRESS
)
{
cdrom_playing
=
1
;
cdrom_audiotimeout
=
1
;
}
if
(
cdrom_playing
&&
status
!=
AUDIO_STATUS_IN_PROGRESS
&&
status
!=
AUDIO_STATUS_PAUSED
)
{
cdrom_audiotimeout
=
-
1
;
}
}
cdrom_audiostatus
=
status
;
return
0
;
}
static
void
cdaudioplay_do
(
void
)
static
void
cdaudioplay_do
(
void
)
{
{
uae_u32
startlsn
=
read_comm_pipe_u32_blocking
(
&
requests
);
uae_u32
startlsn
=
read_comm_pipe_u32_blocking
(
&
requests
);
...
@@ -508,7 +529,7 @@ static void cdaudioplay_do (void)
...
@@ -508,7 +529,7 @@ static void cdaudioplay_do (void)
if
(
unitnum
<
0
)
if
(
unitnum
<
0
)
return
;
return
;
sys_command_cd_pause
(
unitnum
,
0
);
sys_command_cd_pause
(
unitnum
,
0
);
sys_command_cd_play2
(
unitnum
,
startlsn
,
endlsn
,
scan
,
subfunc
);
sys_command_cd_play2
(
unitnum
,
startlsn
,
endlsn
,
scan
,
s
tatusfunc
,
s
ubfunc
);
}
}
static
bool
isaudiotrack
(
int
startlsn
)
static
bool
isaudiotrack
(
int
startlsn
)
...
@@ -583,9 +604,7 @@ static int cd_qcode (uae_u8 *d)
...
@@ -583,9 +604,7 @@ static int cd_qcode (uae_u8 *d)
buf
[
2
]
=
0x80
;
buf
[
2
]
=
0x80
;
if
(
!
qcode_valid
)
if
(
!
qcode_valid
)
return
0
;
return
0
;
if
(
cdrom_playing
)
// fake it!
if
(
cdrom_audiostatus
!=
AUDIO_STATUS_IN_PROGRESS
&&
cdrom_audiostatus
!=
AUDIO_STATUS_PAUSED
)
as
=
AUDIO_STATUS_IN_PROGRESS
;
if
(
as
!=
AUDIO_STATUS_IN_PROGRESS
&&
as
!=
AUDIO_STATUS_PAUSED
&&
as
!=
AUDIO_STATUS_PLAY_COMPLETE
&&
as
!=
AUDIO_STATUS_NO_STATUS
)
/* audio status ok? */
return
0
;
return
0
;
s
=
buf
+
4
;
s
=
buf
+
4
;
last_play_pos
=
msf2lsn
(
fromlongbcd
(
s
+
7
));
last_play_pos
=
msf2lsn
(
fromlongbcd
(
s
+
7
));
...
@@ -875,11 +894,11 @@ static int cdrom_command_multi (void)
...
@@ -875,11 +894,11 @@ static int cdrom_command_multi (void)
seekpos
,
msf2lsn
(
seekpos
),
endpos
,
msf2lsn
(
endpos
),
scan
);
seekpos
,
msf2lsn
(
seekpos
),
endpos
,
msf2lsn
(
endpos
),
scan
);
#endif
#endif
cdrom_playing
=
1
;
cdrom_playing
=
1
;
cdrom_result_buffer
[
1
]
|=
CDS_PLAYING
;
if
(
!
cd_play_audio
(
seekpos
,
endpos
,
0
))
{
if
(
!
cd_play_audio
(
seekpos
,
endpos
,
0
))
{
// play didn't start, report it in next status packet
// play didn't start, report it in next status packet
cdrom_audiotimeout
=
-
3
;
cdrom_audiotimeout
=
-
3
;
}
}
cdrom_result_buffer
[
1
]
|=
CDS_PLAYING
;
}
else
{
}
else
{
#if AKIKO_DEBUG_IO_CMD
#if AKIKO_DEBUG_IO_CMD
write_log
(
"SEEKTO %06X
\n
"
,
seekpos
);
write_log
(
"SEEKTO %06X
\n
"
,
seekpos
);
...
@@ -892,10 +911,15 @@ static int cdrom_command_multi (void)
...
@@ -892,10 +911,15 @@ static int cdrom_command_multi (void)
return
2
;
return
2
;
}
}
static
int
cdrom_playend_notify
(
int
err
)
static
int
cdrom_playend_notify
(
int
status
)
{
{
cdrom_result_buffer
[
0
]
=
4
;
cdrom_result_buffer
[
0
]
=
4
;
cdrom_result_buffer
[
1
]
=
err
?
0x80
:
0x00
;
if
(
status
<
0
)
cdrom_result_buffer
[
1
]
=
0x80
;
// error
else
if
(
status
==
0
)
cdrom_result_buffer
[
1
]
=
0x08
;
// play started
else
cdrom_result_buffer
[
1
]
=
0x00
;
// play ended
return
2
;
return
2
;
}
}
...
@@ -1089,6 +1113,10 @@ static void akiko_handler (void)
...
@@ -1089,6 +1113,10 @@ static void akiko_handler (void)
get_cdrom_toc
();
get_cdrom_toc
();
return
;
return
;
}
}
if
(
cdrom_audiotimeout
==
1
)
{
// play start
cdrom_start_return_data
(
cdrom_playend_notify
(
0
));
cdrom_audiotimeout
=
0
;
}
if
(
cdrom_audiotimeout
==
-
1
)
{
// play finished (or disk end)
if
(
cdrom_audiotimeout
==
-
1
)
{
// play finished (or disk end)
if
(
cdrom_playing
)
{
if
(
cdrom_playing
)
{
cdaudiostop
();
cdaudiostop
();
...
@@ -1097,12 +1125,13 @@ static void akiko_handler (void)
...
@@ -1097,12 +1125,13 @@ static void akiko_handler (void)
cdrom_audiotimeout
=
0
;
cdrom_audiotimeout
=
0
;
}
}
}
}
if
(
cdrom_audiotimeout
==
-
2
&&
qcode_buf
[
1
]
!=
AUDIO_STATUS_IN_PROGRESS
)
{
if
(
cdrom_audiotimeout
==
-
2
)
{
// play end notification
cdrom_start_return_data
(
cdrom_playend_notify
(
0
));
cdrom_start_return_data
(
cdrom_playend_notify
(
1
));
cdrom_audiotimeout
=
0
;
cdrom_audiotimeout
=
0
;
}
}
if
(
cdrom_audiotimeout
==
-
3
)
{
// play didn't start notification (illegal address)
cdrom_start_return_data
(
cdrom_playend_notify
(
1
));
if
(
cdrom_audiotimeout
==
-
3
)
{
// return error status
cdrom_start_return_data
(
cdrom_playend_notify
(
-
1
));
cdrom_audiotimeout
=
0
;
cdrom_audiotimeout
=
0
;
}
}
...
@@ -1132,6 +1161,7 @@ void AKIKO_hsync_handler (void)
...
@@ -1132,6 +1161,7 @@ void AKIKO_hsync_handler (void)
if
(
!
currprefs
.
cs_cd32cd
||
!
akiko_inited
)
if
(
!
currprefs
.
cs_cd32cd
||
!
akiko_inited
)
return
;
return
;
static
float
framecounter
;
framecounter
--
;
framecounter
--
;
if
(
framecounter
<=
0
)
{
if
(
framecounter
<=
0
)
{
if
(
cdrom_seek_delay
<=
0
)
{
if
(
cdrom_seek_delay
<=
0
)
{
...
@@ -1139,12 +1169,12 @@ void AKIKO_hsync_handler (void)
...
@@ -1139,12 +1169,12 @@ void AKIKO_hsync_handler (void)
}
else
{
}
else
{
cdrom_seek_delay
--
;
cdrom_seek_delay
--
;
}
}
framecounter
=
1000000
/
(
63
*
75
*
cdrom_speed
);
framecounter
+=
(
float
)
maxvpos
*
vblank_hz
/
(
75
.
0
*
cdrom_speed
);
}
}
subcodecounter
--
;
subcodecounter
--
;
if
(
subcodecounter
<=
0
)
{
if
(
subcodecounter
<=
0
)
{
if
((
cdrom_flags
&
CDFLAG_SUBCODE
)
&&
subcodebufferoffset
!=
subcodebufferoffsetw
)
{
if
((
cdrom_flags
&
CDFLAG_SUBCODE
)
&&
cdrom_playing
&&
subcodebufferoffset
!=
subcodebufferoffsetw
)
{
uae_sem_wait
(
&
sub_sem
);
uae_sem_wait
(
&
sub_sem
);
if
(
subcodebufferinuse
[
subcodebufferoffset
])
{
if
(
subcodebufferinuse
[
subcodebufferoffset
])
{
if
(
cdrom_subcodeoffset
>=
128
)
if
(
cdrom_subcodeoffset
>=
128
)
...
@@ -1164,7 +1194,7 @@ void AKIKO_hsync_handler (void)
...
@@ -1164,7 +1194,7 @@ void AKIKO_hsync_handler (void)
}
}
uae_sem_post
(
&
sub_sem
);
uae_sem_post
(
&
sub_sem
);
}
}
subcodecounter
=
1000000
/
(
70
*
75
*
cdrom_speed
)
;
subcodecounter
=
maxvpos
*
vblank_hz
/
(
75
*
cdrom_speed
)
-
5
;
}
}
if
(
frame2counter
>
0
)
if
(
frame2counter
>
0
)
...
@@ -1172,12 +1202,6 @@ void AKIKO_hsync_handler (void)
...
@@ -1172,12 +1202,6 @@ void AKIKO_hsync_handler (void)
if
(
mediacheckcounter
>
0
)
if
(
mediacheckcounter
>
0
)
mediacheckcounter
--
;
mediacheckcounter
--
;
if
(
cdrom_audiotimeout
>
0
)
{
cdrom_audiotimeout
--
;
if
(
cdrom_audiotimeout
==
0
)
cdrom_audiotimeout
=
-
1
;
}
akiko_internal
();
akiko_internal
();
akiko_handler
();
akiko_handler
();
}
}
...
@@ -1222,16 +1246,6 @@ static void *akiko_thread (void *null)
...
@@ -1222,16 +1246,6 @@ static void *akiko_thread (void *null)
if
(
unitnum
>=
0
&&
sys_command_cd_qcode
(
unitnum
,
qcode_buf
))
{
if
(
unitnum
>=
0
&&
sys_command_cd_qcode
(
unitnum
,
qcode_buf
))
{
uae_u8
as
=
qcode_buf
[
1
];
uae_u8
as
=
qcode_buf
[
1
];
qcode_valid
=
1
;
qcode_valid
=
1
;
if
(
as
==
AUDIO_STATUS_IN_PROGRESS
)
{
frame2counter
/=
4
;
if
(
cdrom_audiotimeout
==
0
)
{
int
lsn
=
msf2lsn
(
fromlongbcd
(
qcode_buf
+
4
+
7
));
// make sure audio play really ends because not all drives report position accurately
if
((
lsn
>=
cdrom_toc_cd_buffer
.
lastaddress
-
3
*
75
||
lsn
>=
last_play_end
-
3
*
75
))
{
cdrom_audiotimeout
=
3
*
312
;
}
}
}
}
}
}
}
...
...
src/archivers/lha/header.c
View file @
8f059ce4
...
@@ -394,19 +394,19 @@ bool get_header(struct zfile *fp, LzHeader *hdr)
...
@@ -394,19 +394,19 @@ bool get_header(struct zfile *fp, LzHeader *hdr)
if
(
zfile_fread
(
data
+
I_HEADER_CHECKSUM
,
if
(
zfile_fread
(
data
+
I_HEADER_CHECKSUM
,
sizeof
(
char
),
header_size
-
1
,
fp
)
<
header_size
-
1
)
{
sizeof
(
char
),
header_size
-
1
,
fp
)
<
header_size
-
1
)
{
fatal_error
(
L
"Invalid header (LHarc file ?)"
);
fatal_error
(
"Invalid header (LHarc file ?)"
);
return
FALSE
;
/* finish */
return
FALSE
;
/* finish */
}
}
setup_get
(
data
+
I_HEADER_LEVEL
);
setup_get
(
data
+
I_HEADER_LEVEL
);
hdr
->
header_level
=
get_byte
();
hdr
->
header_level
=
get_byte
();
if
(
hdr
->
header_level
!=
2
&&
if
(
hdr
->
header_level
!=
2
&&
zfile_fread
(
data
+
header_size
,
sizeof
(
char
),
2
,
fp
)
<
2
)
{
zfile_fread
(
data
+
header_size
,
sizeof
(
char
),
2
,
fp
)
<
2
)
{
fatal_error
(
L
"Invalid header (LHarc file ?)"
);
fatal_error
(
"Invalid header (LHarc file ?)"
);
return
FALSE
;
/* finish */
return
FALSE
;
/* finish */
}
}
if
(
hdr
->
header_level
>=
3
)
{
if
(
hdr
->
header_level
>=
3
)
{
fatal_error
(
L
"Unknown level header"
);
fatal_error
(
"Unknown level header"
);
return
FALSE
;
return
FALSE
;
}
}
...
@@ -427,7 +427,7 @@ bool get_header(struct zfile *fp, LzHeader *hdr)
...
@@ -427,7 +427,7 @@ bool get_header(struct zfile *fp, LzHeader *hdr)
if
((
hdr
->
header_level
=
get_byte
())
!=
2
)
{
if
((
hdr
->
header_level
=
get_byte
())
!=
2
)
{
if
(
calc_sum
(
data
+
I_METHOD
,
header_size
)
!=
checksum
)
if
(
calc_sum
(
data
+
I_METHOD
,
header_size
)
!=
checksum
)
warning
(
L"Checksum error (LHarc file?)"
,
L
""
);
warning
(
"Checksum error (LHarc file?)"
,
""
);
name_length
=
get_byte
();
name_length
=
get_byte
();
for
(
i
=
0
;
i
<
name_length
;
i
++
)
for
(
i
=
0
;
i
<
name_length
;
i
++
)
hdr
->
name
[
i
]
=
(
char
)
get_byte
();
hdr
->
name
[
i
]
=
(
char
)
get_byte
();
...
@@ -450,7 +450,7 @@ bool get_header(struct zfile *fp, LzHeader *hdr)
...
@@ -450,7 +450,7 @@ bool get_header(struct zfile *fp, LzHeader *hdr)
hdr
->
extend_type
=
EXTEND_GENERIC
;
hdr
->
extend_type
=
EXTEND_GENERIC
;
hdr
->
has_crc
=
FALSE
;
hdr
->
has_crc
=
FALSE
;
}
else
{
}
else
{
fatal_error
(
L
"Unkonwn header (lha file?)"
);
fatal_error
(
"Unkonwn header (lha file?)"
);
return
FALSE
;
return
FALSE
;
}
}
}
else
{
}
else
{
...
@@ -500,7 +500,7 @@ bool get_header(struct zfile *fp, LzHeader *hdr)
...
@@ -500,7 +500,7 @@ bool get_header(struct zfile *fp, LzHeader *hdr)
if
(
hdr
->
header_level
!=
2
&&
if
(
hdr
->
header_level
!=
2
&&
((
data
+
LZHEADER_STRAGE
-
get_ptr
<
header_size
)
||
((
data
+
LZHEADER_STRAGE
-
get_ptr
<
header_size
)
||
zfile_fread
(
get_ptr
,
sizeof
(
char
),
header_size
,
fp
)
<
header_size
))
{
zfile_fread
(
get_ptr
,
sizeof
(
char
),
header_size
,
fp
)
<
header_size
))
{
fatal_error
(
L
"Invalid header (LHa file ?)"
);
fatal_error
(
"Invalid header (LHa file ?)"
);
return
FALSE
;
return
FALSE
;
}
}
switch
(
get_byte
())
{
switch
(
get_byte
())
{
...
...
src/archivers/lha/lhamaketbl.c
View file @
8f059ce4
...
@@ -37,7 +37,7 @@ void lha_make_table(short nchar, unsigned char bitlen[], short tablebits, unsign
...
@@ -37,7 +37,7 @@ void lha_make_table(short nchar, unsigned char bitlen[], short tablebits, unsign
total
+=
weight
[
i
]
*
count
[
i
];
total
+=
weight
[
i
]
*
count
[
i
];
}
}
if
((
total
&
0xffff
)
!=
0
)
if
((
total
&
0xffff
)
!=
0
)
error
(
L"make_table()"
,
L
"Bad table (5)
\n
"
);
error
(
"make_table()"
,
"Bad table (5)
\n
"
);
/* shift data for make table. */
/* shift data for make table. */
m
=
16
-
tablebits
;
m
=
16
-
tablebits
;
...
...
src/archivers/lha/lharc.c
View file @
8f059ce4
...
@@ -163,7 +163,7 @@ char *xxrealloc(char *old, int size)
...
@@ -163,7 +163,7 @@ char *xxrealloc(char *old, int size)
{
{
char
*
p
=
(
char
*
)
xrealloc
(
char
,
old
,
size
);
char
*
p
=
(
char
*
)
xrealloc
(
char
,
old
,
size
);
if
(
!
p
)
if
(
!
p
)
fatal_error
(
L
"Not enough memory"
);
fatal_error
(
"Not enough memory"
);
return
p
;
return
p
;
}
}
...
...
src/archivers/lzx/unlzx.c
View file @
8f059ce4
...
@@ -667,7 +667,7 @@ struct zfile *archive_access_lzx (struct znode *zn)
...
@@ -667,7 +667,7 @@ struct zfile *archive_access_lzx (struct znode *zn)
unpsize
-=
decrunch_length
;
unpsize
-=
decrunch_length
;
crc_calc
(
pdest
,
decrunch_length
);
crc_calc
(
pdest
,
decrunch_length
);
}
else
{
}
else
{
write_log
(
L
"LZX corrupt compressed data %s
\n
"
,
zn
->
name
);
write_log
(
"LZX corrupt compressed data %s
\n
"
,
zn
->
name
);
goto
end
;
goto
end
;
}
}
}
}
...
@@ -812,7 +812,7 @@ struct zvolume *archive_directory_lzx (struct zfile *in_file)
...
@@ -812,7 +812,7 @@ struct zvolume *archive_directory_lzx (struct zfile *in_file)
else
else
abort
=
0
;
/* continue */
abort
=
0
;
/* continue */
//write_log (
L
"unp=%6d mrg=%6d pack=%6d off=%6d %s\n", unpack_size, merge_size, pack_size, zn->offset, zai.name);
//write_log ("unp=%6d mrg=%6d pack=%6d off=%6d %s\n", unpack_size, merge_size, pack_size, zn->offset, zai.name);
}
}
...
...
src/archivers/wrp/warp.c
View file @
8f059ce4
...
@@ -403,8 +403,8 @@ struct zfile *unwarp(struct zfile *zf)
...
@@ -403,8 +403,8 @@ struct zfile *unwarp(struct zfile *zf)
if
(
!
iswrp
(
buf
))
if
(
!
iswrp
(
buf
))
break
;
break
;
if
(
!
nf
)
{
if
(
!
nf
)
{
nf
=
zfile_fopen_empty
(
zf
,
L
"zipped.wrp"
,
1760
*
512
);
nf
=
zfile_fopen_empty
(
zf
,
"zipped.wrp"
,
1760
*
512
);
tmpf
=
zfile_fopen_empty
(
zf
,
L
"tmp"
,
outsize2
);
tmpf
=
zfile_fopen_empty
(
zf
,
"tmp"
,
outsize2
);
}
}
track
=
(
buf
[
10
]
<<
8
)
|
buf
[
11
];
track
=
(
buf
[
10
]
<<
8
)
|
buf
[
11
];
algo
=
buf
[
19
];
algo
=
buf
[
19
];
...
@@ -447,19 +447,19 @@ struct zfile *unwarp(struct zfile *zf)
...
@@ -447,19 +447,19 @@ struct zfile *unwarp(struct zfile *zf)
}
}
break
;
break
;
default:
default:
write_log
(
L
"WRP unknown compression method %d, track=%d,size=%d
\n
"
,
algo
,
track
,
side
);
write_log
(
"WRP unknown compression method %d, track=%d,size=%d
\n
"
,
algo
,
track
,
side
);
goto
end
;
goto
end
;
break
;
break
;
}
}
if
(
err
)
{
if
(
err
)
{
write_log
(
L
"WRP corrupt data, track=%d,side=%d,err=%d
\n
"
,
track
,
side
,
err
);
write_log
(
"WRP corrupt data, track=%d,side=%d,err=%d
\n
"
,
track
,
side
,
err
);
}
else
{
}
else
{
uae_u16
crc2
;
uae_u16
crc2
;
int
os
=
zfile_ftell
(
tmpf
);
int
os
=
zfile_ftell
(
tmpf
);
data
=
zfile_getdata
(
tmpf
,
0
,
os
);
data
=
zfile_getdata
(
tmpf
,
0
,
os
);
crc2
=
wrpcrc16
(
wrpcrc16table
,
data
,
os
);
crc2
=
wrpcrc16
(
wrpcrc16table
,
data
,
os
);
if
(
crc
!=
crc2
)
if
(
crc
!=
crc2
)
write_log
(
L
"WRP crc error %04x<>%04x, track=%d,side=%d
\n
"
,
crc
,
crc2
,
track
,
side
);
write_log
(
"WRP crc error %04x<>%04x, track=%d,side=%d
\n
"
,
crc
,
crc2
,
track
,
side
);
xfree
(
data
);
xfree
(
data
);
}
}
if
(
dstpos
>=
0
)
{
if
(
dstpos
>=
0
)
{
...
...
src/blkdev.c
View file @
8f059ce4
...
@@ -26,7 +26,7 @@ static int scsiemu[MAX_TOTAL_SCSI_DEVICES];
...
@@ -26,7 +26,7 @@ static int scsiemu[MAX_TOTAL_SCSI_DEVICES];
struct
device_functions
*
device_func
[
MAX_TOTAL_SCSI_DEVICES
];
struct
device_functions
*
device_func
[
MAX_TOTAL_SCSI_DEVICES
];
static
int
openlist
[
MAX_TOTAL_SCSI_DEVICES
];
static
int
openlist
[
MAX_TOTAL_SCSI_DEVICES
];
static
int
waspaused
[
MAX_TOTAL_SCSI_DEVICES
]
,
wasslow
[
MAX_TOTAL_SCSI_DEVICES
]
;
static
int
waspaused
[
MAX_TOTAL_SCSI_DEVICES
];
static
int
delayed
[
MAX_TOTAL_SCSI_DEVICES
];
static
int
delayed
[
MAX_TOTAL_SCSI_DEVICES
];
/* convert minutes, seconds and frames -> logical sector number */
/* convert minutes, seconds and frames -> logical sector number */
...
@@ -469,7 +469,6 @@ static void check_changes (int unitnum)
...
@@ -469,7 +469,6 @@ static void check_changes (int unitnum)
struct
device_info
di
;
struct
device_info
di
;
device_func
[
unitnum
]
->
info
(
unitnum
,
&
di
,
0
);
device_func
[
unitnum
]
->
info
(
unitnum
,
&
di
,
0
);
wasopen
[
unitnum
]
=
di
.
open
;
wasopen
[
unitnum
]
=
di
.
open
;
wasslow
[
unitnum
]
=
di
.
slow_unit
;
if
(
wasopen
[
unitnum
])
{
if
(
wasopen
[
unitnum
])
{
device_func
[
unitnum
]
->
closedev
(
unitnum
);
device_func
[
unitnum
]
->
closedev
(
unitnum
);
if
(
currprefs
.
scsi
)
{
if
(
currprefs
.
scsi
)
{
...
@@ -495,7 +494,7 @@ static void check_changes (int unitnum)
...
@@ -495,7 +494,7 @@ static void check_changes (int unitnum)
write_log
(
"CD: delayed insert '%s'
\n
"
,
currprefs
.
cdslots
[
unitnum
].
name
[
0
]
?
currprefs
.
cdslots
[
unitnum
].
name
:
"<EMPTY>"
);
write_log
(
"CD: delayed insert '%s'
\n
"
,
currprefs
.
cdslots
[
unitnum
].
name
[
0
]
?
currprefs
.
cdslots
[
unitnum
].
name
:
"<EMPTY>"
);
device_func_init
(
0
);
device_func_init
(
0
);
if
(
wasopen
[
unitnum
])
{
if
(
wasopen
[
unitnum
])
{
if
(
!
device_func
[
unitnum
]
->
opendev
(
unitnum
,
currprefs
.
cdslots
[
unitnum
].
name
,
wasslow
[
unitnum
]
))
{
if
(
!
device_func
[
unitnum
]
->
opendev
(
unitnum
,
currprefs
.
cdslots
[
unitnum
].
name
,
0
))
{
write_log
(
"-> device open failed
\n
"
);
write_log
(
"-> device open failed
\n
"
);
}
}
}
}
...
@@ -622,18 +621,18 @@ int sys_command_cd_play (int unitnum, int startlsn, int endlsn, int scan)
...
@@ -622,18 +621,18 @@ int sys_command_cd_play (int unitnum, int startlsn, int endlsn, int scan)
return
do_scsi
(
unitnum
,
cmd
,
sizeof
cmd
)
?
0
:
1
;
return
do_scsi
(
unitnum
,
cmd
,
sizeof
cmd
)
?
0
:
1
;
}
}
//startlsn = adjustplaypos (unitnum, startlsn);
//startlsn = adjustplaypos (unitnum, startlsn);
return
device_func
[
unitnum
]
->
play
(
unitnum
,
startlsn
,
endlsn
,
scan
,
NULL
);
return
device_func
[
unitnum
]
->
play
(
unitnum
,
startlsn
,
endlsn
,
scan
,
NULL
,
NULL
);
}
}
/* play CD audio with subchannels */
/* play CD audio with subchannels */
int
sys_command_cd_play2
(
int
unitnum
,
int
startlsn
,
int
endlsn
,
int
scan
,
play_subchannel_callback
subfunc
)
int
sys_command_cd_play2
(
int
unitnum
,
int
startlsn
,
int
endlsn
,
int
scan
,
play_s
tatus_callback
statusfunc
,
play_s
ubchannel_callback
subfunc
)
{
{
if
(
failunit
(
unitnum
))
if
(
failunit
(
unitnum
))
return
0
;
return
0
;
if
(
device_func
[
unitnum
]
->
play
==
NULL
)
if
(
device_func
[
unitnum
]
->
play
==
NULL
)
return
sys_command_cd_play
(
unitnum
,
startlsn
,
endlsn
,
scan
);
return
sys_command_cd_play
(
unitnum
,
startlsn
,
endlsn
,
scan
);
//startlsn = adjustplaypos (unitnum, startlsn);
//startlsn = adjustplaypos (unitnum, startlsn);
return
device_func
[
unitnum
]
->
play
(
unitnum
,
startlsn
,
endlsn
,
scan
,
subfunc
);
return
device_func
[
unitnum
]
->
play
(
unitnum
,
startlsn
,
endlsn
,
scan
,
s
tatusfunc
,
s
ubfunc
);
}
}
/* set CD audio volume */
/* set CD audio volume */
...
@@ -1370,7 +1369,7 @@ static int scsi_emulate (int unitnum, uae_u8 *cmdbuf, int scsi_cmd_len,
...
@@ -1370,7 +1369,7 @@ static int scsi_emulate (int unitnum, uae_u8 *cmdbuf, int scsi_cmd_len,
goto
errreq
;
goto
errreq
;
start
=
toc
->
toc
[
toc
->
first_track_offset
+
start
].
paddress
;
start
=
toc
->
toc
[
toc
->
first_track_offset
+
start
].
paddress
;
}
}
sys_command_cd_play
2
(
unitnum
,
start
,
end
,
scan
,
NULL
);
sys_command_cd_play
(
unitnum
,
start
,
end
,
scan
);
scsi_len
=
0
;
scsi_len
=
0
;
}
}
break
;
break
;
...
@@ -1390,7 +1389,7 @@ static int scsi_emulate (int unitnum, uae_u8 *cmdbuf, int scsi_cmd_len,
...
@@ -1390,7 +1389,7 @@ static int scsi_emulate (int unitnum, uae_u8 *cmdbuf, int scsi_cmd_len,
goto
errreq
;
goto
errreq
;
int
start
=
toc
->
toc
[
toc
->
first_track_offset
+
strack
-
1
].
paddress
;
int
start
=
toc
->
toc
[
toc
->
first_track_offset
+
strack
-
1
].
paddress
;
int
end
=
etrack
==
toc
->
last_track
?
toc
->
lastaddress
:
toc
->
toc
[
toc
->
first_track_offset
+
etrack
-
1
+
1
].
paddress
;
int
end
=
etrack
==
toc
->
last_track
?
toc
->
lastaddress
:
toc
->
toc
[
toc
->
first_track_offset
+
etrack
-
1
+
1
].
paddress
;
if
(
!
sys_command_cd_play
2
(
unitnum
,
start
,
end
,
0
,
NULL
))
if
(
!
sys_command_cd_play
(
unitnum
,
start
,
end
,
0
))
goto
notdatatrack
;
goto
notdatatrack
;
scsi_len
=
0
;
scsi_len
=
0
;
}
}
...
@@ -1411,7 +1410,7 @@ static int scsi_emulate (int unitnum, uae_u8 *cmdbuf, int scsi_cmd_len,
...
@@ -1411,7 +1410,7 @@ static int scsi_emulate (int unitnum, uae_u8 *cmdbuf, int scsi_cmd_len,
if
(
end
>
di
.
toc
.
lastaddress
)
if
(
end
>
di
.
toc
.
lastaddress
)
end
=
di
.
toc
.
lastaddress
;
end
=
di
.
toc
.
lastaddress
;
if
(
len
>
0
)
{
if
(
len
>
0
)
{
if
(
!
sys_command_cd_play
2
(
unitnum
,
start
,
start
+
len
,
0
,
NULL
))
if
(
!
sys_command_cd_play
(
unitnum
,
start
,
start
+
len
,
0
))
goto
notdatatrack
;
goto
notdatatrack
;
}
}
scsi_len
=
0
;
scsi_len
=
0
;
...
@@ -1434,7 +1433,7 @@ static int scsi_emulate (int unitnum, uae_u8 *cmdbuf, int scsi_cmd_len,
...
@@ -1434,7 +1433,7 @@ static int scsi_emulate (int unitnum, uae_u8 *cmdbuf, int scsi_cmd_len,
if
(
start
>
end
)
if
(
start
>
end
)
goto
errreq
;
goto
errreq
;
if
(
start
<
end
)
if
(
start
<
end
)
if
(
!
sys_command_cd_play
2
(
unitnum
,
start
,
end
,
0
,
NULL
))
if
(
!
sys_command_cd_play
(
unitnum
,
start
,
end
,
0
))
goto
notdatatrack
;
goto
notdatatrack
;
scsi_len
=
0
;
scsi_len
=
0
;
}
}
...
@@ -1459,7 +1458,7 @@ static int scsi_emulate (int unitnum, uae_u8 *cmdbuf, int scsi_cmd_len,
...
@@ -1459,7 +1458,7 @@ static int scsi_emulate (int unitnum, uae_u8 *cmdbuf, int scsi_cmd_len,
int
end
=
start
+
len
;
int
end
=
start
+
len
;
if
(
end
>
di
.
toc
.
lastaddress
)
if
(
end
>
di
.
toc
.
lastaddress
)
end
=
di
.
toc
.
lastaddress
;
end
=
di
.
toc
.
lastaddress
;
if
(
!
sys_command_cd_play
2
(
unitnum
,
start
,
end
,
0
,
NULL
))
if
(
!
sys_command_cd_play
(
unitnum
,
start
,
end
,
0
))
goto
notdatatrack
;
goto
notdatatrack
;
}
}
scsi_len
=
0
;
scsi_len
=
0
;
...
@@ -1483,7 +1482,7 @@ static int scsi_emulate (int unitnum, uae_u8 *cmdbuf, int scsi_cmd_len,
...
@@ -1483,7 +1482,7 @@ static int scsi_emulate (int unitnum, uae_u8 *cmdbuf, int scsi_cmd_len,
if
(
start
>
end
)
if
(
start
>
end
)
goto
errreq
;
goto
errreq
;
if
(
start
<
end
)
{
if
(
start
<
end
)
{
if
(
!
sys_command_cd_play
2
(
unitnum
,
start
,
end
,
0
,
NULL
))
if
(
!
sys_command_cd_play
(
unitnum
,
start
,
end
,
0
))
goto
notdatatrack
;
goto
notdatatrack
;
}
}
}
}
...
...
src/cdtv.c
View file @
8f059ce4
...
@@ -78,9 +78,9 @@ static volatile uae_u32 dmac_acr;
...
@@ -78,9 +78,9 @@ static volatile uae_u32 dmac_acr;
static
volatile
int
dmac_wtc
;
static
volatile
int
dmac_wtc
;
static
volatile
int
dmac_dma
;
static
volatile
int
dmac_dma
;
static
volatile
int
activate_stch
,
cdrom_command_done
,
play_state
,
play_statewait
;
static
volatile
int
activate_stch
,
cdrom_command_done
;
static
volatile
int
cdrom_sector
,
cdrom_sectors
,
cdrom_length
,
cdrom_offset
;
static
volatile
int
cdrom_sector
,
cdrom_sectors
,
cdrom_length
,
cdrom_offset
;
static
volatile
int
cd_playing
,
cd_paused
,
cd_motor
,
cd_media
,
cd_error
,
cd_finished
,
cd_isready
;
static
volatile
int
cd_playing
,
cd_paused
,
cd_motor
,
cd_media
,
cd_error
,
cd_finished
,
cd_isready
,
cd_audio_finished
;
static
uae_u32
last_play_pos
,
last_play_end
;
static
uae_u32
last_play_pos
,
last_play_end
;
static
volatile
int
cdtv_hsync
,
dma_finished
,
cdtv_sectorsize
;
static
volatile
int
cdtv_hsync
,
dma_finished
,
cdtv_sectorsize
;
...
@@ -142,28 +142,10 @@ static int get_toc (void)
...
@@ -142,28 +142,10 @@ static int get_toc (void)
return
1
;
return
1
;
}
}
static
void
finished_cdplay
(
void
)
{
cd_audio_status
=
AUDIO_STATUS_PLAY_COMPLETE
;
cd_playing
=
0
;
cd_finished
=
1
;
cd_paused
=
0
;
do_stch
();
}
static
int
get_qcode
(
void
)
static
int
get_qcode
(
void
)
{
{
if
(
!
sys_command_cd_qcode
(
unitnum
,
cdrom_qcode
))
if
(
!
sys_command_cd_qcode
(
unitnum
,
cdrom_qcode
))
return
0
;
return
0
;
if
(
cd_playing
)
{
if
(
cdrom_qcode
[
1
]
==
AUDIO_STATUS_IN_PROGRESS
)
{
int
end
=
msf2lsn
(
fromlongbcd
(
cdrom_qcode
+
4
+
7
));
if
(
end
>=
play_end
-
75
)
finished_cdplay
();
}
else
if
(
cdrom_qcode
[
1
]
==
AUDIO_STATUS_PLAY_COMPLETE
)
{
finished_cdplay
();
}
}
cdrom_qcode
[
1
]
=
cd_audio_status
;
cdrom_qcode
[
1
]
=
cd_audio_status
;
return
1
;
return
1
;
}
}
...
@@ -187,6 +169,7 @@ static void cdaudiostop (void)
...
@@ -187,6 +169,7 @@ static void cdaudiostop (void)
cd_playing
=
0
;
cd_playing
=
0
;
cd_paused
=
0
;
cd_paused
=
0
;
cd_motor
=
0
;
cd_motor
=
0
;
cd_audio_finished
=
0
;
write_comm_pipe_u32
(
&
requests
,
0x0104
,
1
);
write_comm_pipe_u32
(
&
requests
,
0x0104
,
1
);
}
}
...
@@ -285,7 +268,24 @@ static void subfunc (uae_u8 *data, int cnt)
...
@@ -285,7 +268,24 @@ static void subfunc (uae_u8 *data, int cnt)
subcodebufferoffsetw
=
offset
;
subcodebufferoffsetw
=
offset
;
uae_sem_post
(
&
sub_sem
);
uae_sem_post
(
&
sub_sem
);
}
}
static
int
statusfunc
(
int
status
)
{
if
(
status
==
-
1
)
return
500
;
if
(
status
==
-
2
)
return
75
;
if
(
cd_audio_status
!=
status
)
{
if
(
status
==
AUDIO_STATUS_PLAY_COMPLETE
||
status
==
AUDIO_STATUS_PLAY_ERROR
)
{
cd_audio_finished
=
1
;
}
else
{
if
(
status
==
AUDIO_STATUS_IN_PROGRESS
)
cd_playing
=
1
;
activate_stch
=
1
;
}
}
cd_audio_status
=
status
;
return
0
;
}
static
void
do_play
(
void
)
static
void
do_play
(
void
)
{
{
...
@@ -294,15 +294,21 @@ static void do_play (void)
...
@@ -294,15 +294,21 @@ static void do_play (void)
uae_u32
scan
=
read_comm_pipe_u32_blocking
(
&
requests
);
uae_u32
scan
=
read_comm_pipe_u32_blocking
(
&
requests
);
subreset
();
subreset
();
sys_command_cd_pause
(
unitnum
,
0
);
sys_command_cd_pause
(
unitnum
,
0
);
cd_audio_status
=
AUDIO_STATUS_PLAY_ERROR
;
sys_command_cd_volume
(
unitnum
,
(
cd_volume_stored
<<
5
)
|
(
cd_volume_stored
>>
5
),
(
cd_volume_stored
<<
5
)
|
(
cd_volume_stored
>>
5
));
sys_command_cd_volume
(
unitnum
,
(
cd_volume_stored
<<
5
)
|
(
cd_volume_stored
>>
5
),
(
cd_volume_stored
<<
5
)
|
(
cd_volume_stored
>>
5
));
if
(
sys_command_cd_play2
(
unitnum
,
start
,
end
,
0
,
subfunc
))
{
sys_command_cd_play2
(
unitnum
,
start
,
end
,
0
,
statusfunc
,
subfunc
);
cd_audio_status
=
AUDIO_STATUS_IN_PROGRESS
;
}
cd_playing
=
1
;
}
else
{
static
void
startplay
(
void
)
cd_error
=
1
;
{
}
subreset
();
write_comm_pipe_u32
(
&
requests
,
0x0110
,
0
);
write_comm_pipe_u32
(
&
requests
,
play_start
,
0
);
write_comm_pipe_u32
(
&
requests
,
play_end
,
0
);
write_comm_pipe_u32
(
&
requests
,
0
,
1
);
if
(
!
cd_motor
)
{
cd_motor
=
1
;
activate_stch
=
1
;
activate_stch
=
1
;
}
}
}
static
int
play_cdtrack
(
uae_u8
*
p
)
static
int
play_cdtrack
(
uae_u8
*
p
)
...
@@ -342,11 +348,11 @@ static int play_cdtrack (uae_u8 *p)
...
@@ -342,11 +348,11 @@ static int play_cdtrack (uae_u8 *p)
play_start
=
start
;
play_start
=
start
;
last_play_pos
=
start
;
last_play_pos
=
start
;
last_play_end
=
end
;
last_play_end
=
end
;
#ifdef CDTV_DEBUG
#ifdef CDTV_DEBUG
_CMD
write_log
(
"PLAY CD AUDIO from %d-%d, %06X (%d) to %06X (%d)
\n
"
,
write_log
(
"PLAY CD AUDIO from %d-%d, %06X (%d) to %06X (%d)
\n
"
,
track_start
,
track_end
,
start
,
start
,
end
,
end
);
track_start
,
track_end
,
start
,
start
,
end
,
end
);
#endif
#endif
play_state
=
1
;
startplay
()
;
return
0
;
return
0
;
}
}
...
@@ -366,11 +372,10 @@ static int play_cd (uae_u8 *p)
...
@@ -366,11 +372,10 @@ static int play_cd (uae_u8 *p)
cd_playing
=
0
;
cd_playing
=
0
;
cd_paused
=
0
;
cd_paused
=
0
;
cd_motor
=
0
;
cd_motor
=
0
;
cd_audio_status
=
AUDIO_STATUS_PLAY_COMPLETE
;
write_comm_pipe_u32
(
&
requests
,
0x0104
,
1
);
sys_command_cd_pause
(
unitnum
,
0
);
cd_audio_status
=
AUDIO_STATUS_NO_STATUS
;
sys_command_cd_stop
(
unitnum
);
cd_isready
=
50
;
cd_error
=
1
;
cd_error
=
1
;
activate_stch
=
1
;
return
0
;
return
0
;
}
}
if
(
p
[
0
]
!=
0x09
)
{
/* msf */
if
(
p
[
0
]
!=
0x09
)
{
/* msf */
...
@@ -388,7 +393,7 @@ static int play_cd (uae_u8 *p)
...
@@ -388,7 +393,7 @@ static int play_cd (uae_u8 *p)
write_log
(
"PLAY CD AUDIO from %06X (%d) to %06X (%d)
\n
"
,
write_log
(
"PLAY CD AUDIO from %06X (%d) to %06X (%d)
\n
"
,
lsn2msf
(
start
),
start
,
lsn2msf
(
end
),
end
);
lsn2msf
(
start
),
start
,
lsn2msf
(
end
),
end
);
#endif
#endif
play_state
=
1
;
startplay
()
;
return
0
;
return
0
;
}
}
...
@@ -512,9 +517,10 @@ static void cdrom_command_thread (uae_u8 b)
...
@@ -512,9 +517,10 @@ static void cdrom_command_thread (uae_u8 b)
{
{
case
0x01
:
/* seek */
case
0x01
:
/* seek */
if
(
cdrom_command_cnt_in
==
7
)
{
if
(
cdrom_command_cnt_in
==
7
)
{
uae_msleep
(
500
);
cdrom_command_accepted
(
0
,
s
,
&
cdrom_command_cnt_in
);
cdrom_command_accepted
(
0
,
s
,
&
cdrom_command_cnt_in
);
cd_finished
=
1
;
cd_finished
=
1
;
uae_msleep
(
500
);
activate_stch
=
1
;
}
}
break
;
break
;
case
0x02
:
/* read */
case
0x02
:
/* read */
...
@@ -799,8 +805,7 @@ static void init_play (int start, int end)
...
@@ -799,8 +805,7 @@ static void init_play (int start, int end)
write_log
(
"PLAY CD AUDIO from %06X (%d) to %06X (%d)
\n
"
,
write_log
(
"PLAY CD AUDIO from %06X (%d) to %06X (%d)
\n
"
,
lsn2msf
(
start
),
start
,
lsn2msf
(
end
),
end
);
lsn2msf
(
start
),
start
,
lsn2msf
(
end
),
end
);
#endif
#endif
play_state
=
1
;
startplay
();
subreset
();
}
}
bool
cdtv_front_panel
(
int
button
)
bool
cdtv_front_panel
(
int
button
)
...
@@ -1168,7 +1173,17 @@ void CDTV_hsync_handler (void)
...
@@ -1168,7 +1173,17 @@ void CDTV_hsync_handler (void)
sten
=
0
;
sten
=
0
;
}
}
if
(
cd_audio_finished
)
{
cd_audio_finished
=
0
;
cd_playing
=
0
;
cd_finished
=
1
;
cd_paused
=
0
;
//cd_error = 1;
activate_stch
=
1
;
}
static
int
subchannelcounter
;
static
int
subchannelcounter
;
int
cntmax
=
maxvpos
*
vblank_hz
/
75
-
6
;
if
(
subchannelcounter
>
0
)
if
(
subchannelcounter
>
0
)
subchannelcounter
--
;
subchannelcounter
--
;
if
(
subchannelcounter
<=
0
)
{
if
(
subchannelcounter
<=
0
)
{
...
@@ -1193,7 +1208,7 @@ void CDTV_hsync_handler (void)
...
@@ -1193,7 +1208,7 @@ void CDTV_hsync_handler (void)
tp_check_interrupts
();
tp_check_interrupts
();
}
}
uae_sem_post
(
&
sub_sem
);
uae_sem_post
(
&
sub_sem
);
subchannelcounter
=
200
;
subchannelcounter
=
cntmax
;
}
}
}
}
if
(
!
scor
&&
!
cd_playing
)
{
if
(
!
scor
&&
!
cd_playing
)
{
...
@@ -1201,35 +1216,14 @@ void CDTV_hsync_handler (void)
...
@@ -1201,35 +1216,14 @@ void CDTV_hsync_handler (void)
scor
=
1
;
scor
=
1
;
tp_check_interrupts
();
tp_check_interrupts
();
scor
=
0
;
scor
=
0
;
subchannelcounter
=
200
;
subchannelcounter
=
cntmax
;
}
}
}
}
if
(
cdtv_hsync
<
200
&&
cdtv_hsync
>=
0
)
if
(
cdtv_hsync
<
cntmax
&&
cdtv_hsync
>=
0
)
return
;
return
;
cdtv_hsync
=
0
;
cdtv_hsync
=
0
;
if
(
play_state
==
1
)
{
play_state
=
2
;
cd_playing
=
1
;
cd_motor
=
1
;
activate_stch
=
1
;
play_statewait
=
2
;
}
else
if
(
play_statewait
>
0
)
{
play_statewait
--
;
}
else
if
(
play_state
==
2
)
{
write_comm_pipe_u32
(
&
requests
,
0x0110
,
0
);
write_comm_pipe_u32
(
&
requests
,
play_start
,
0
);
write_comm_pipe_u32
(
&
requests
,
play_end
,
0
);
write_comm_pipe_u32
(
&
requests
,
0
,
1
);
play_state
=
0
;
}
if
(
cd_isready
>
0
)
{
cd_isready
--
;
if
(
!
cd_isready
)
do_stch
();
}
if
(
dmac_dma
||
dma_finished
)
if
(
dmac_dma
||
dma_finished
)
cd_led
|=
LED_CD_ACTIVE
;
cd_led
|=
LED_CD_ACTIVE
;
else
else
...
@@ -1884,7 +1878,7 @@ uae_u8 *save_cdtv (int *len)
...
@@ -1884,7 +1878,7 @@ uae_u8 *save_cdtv (int *len)
(
cd_motor
?
8
:
0
)
|
(
cd_error
?
16
:
0
)
|
(
cd_finished
?
32
:
0
)
|
(
cdrom_command_done
?
64
:
0
)
|
(
cd_motor
?
8
:
0
)
|
(
cd_error
?
16
:
0
)
|
(
cd_finished
?
32
:
0
)
|
(
cdrom_command_done
?
64
:
0
)
|
(
activate_stch
?
128
:
0
)
|
(
sten
?
256
:
0
)
|
(
stch
?
512
:
0
)
|
(
frontpanel
?
1024
:
0
));
(
activate_stch
?
128
:
0
)
|
(
sten
?
256
:
0
)
|
(
stch
?
512
:
0
)
|
(
frontpanel
?
1024
:
0
));
save_u8
(
cd_isready
);
save_u8
(
cd_isready
);
save_u8
(
play_state
);
save_u8
(
0
);
save_u16
(
cd_volume_stored
);
save_u16
(
cd_volume_stored
);
if
(
cd_playing
)
if
(
cd_playing
)
get_qcode
();
get_qcode
();
...
@@ -1939,7 +1933,7 @@ uae_u8 *restore_cdtv (uae_u8 *src)
...
@@ -1939,7 +1933,7 @@ uae_u8 *restore_cdtv (uae_u8 *src)
stch
=
(
v
&
512
)
?
1
:
0
;
stch
=
(
v
&
512
)
?
1
:
0
;
frontpanel
=
(
v
&
1024
)
?
1
:
0
;
frontpanel
=
(
v
&
1024
)
?
1
:
0
;
cd_isready
=
restore_u8
();
cd_isready
=
restore_u8
();
play_state
=
restore_u8
();
restore_u8
();
cd_volume_stored
=
restore_u16
();
cd_volume_stored
=
restore_u16
();
last_play_pos
=
restore_u32
();
last_play_pos
=
restore_u32
();
last_play_end
=
restore_u32
();
last_play_end
=
restore_u32
();
...
...
src/drawing.c
View file @
8f059ce4
...
@@ -1954,14 +1954,12 @@ STATIC_INLINE void do_color_changes (line_draw_func worker_border, line_draw_fun
...
@@ -1954,14 +1954,12 @@ STATIC_INLINE void do_color_changes (line_draw_func worker_border, line_draw_fun
(
*
worker_border
)
(
lastpos
,
nextpos_in_range
);
(
*
worker_border
)
(
lastpos
,
nextpos_in_range
);
lastpos
=
nextpos_in_range
;
lastpos
=
nextpos_in_range
;
}
}
if
(
i
!=
dip_for_drawing
->
last_color_change
)
{
if
(
regno
>=
0x1000
)
{
if
(
regno
>=
0x1000
)
{
pfield_expand_dp_bplconx
(
regno
,
value
);
pfield_expand_dp_bplconx
(
regno
,
value
);
}
else
{
}
else
if
(
regno
>=
0
)
{
color_reg_set
(
&
colors_for_drawing
,
regno
,
value
);
color_reg_set
(
&
colors_for_drawing
,
regno
,
value
);
colors_for_drawing
.
acolors
[
regno
]
=
getxcolor
(
value
);
colors_for_drawing
.
acolors
[
regno
]
=
getxcolor
(
value
);
}
}
}
if
(
lastpos
>=
endpos
)
if
(
lastpos
>=
endpos
)
break
;
break
;
}
}
...
...
src/genblitter.c
View file @
8f059ce4
src/include/ar.h
View file @
8f059ce4
...
@@ -42,6 +42,7 @@ extern int action_replay_load (void);
...
@@ -42,6 +42,7 @@ extern int action_replay_load (void);
extern
void
action_replay_memory_reset
(
void
);
extern
void
action_replay_memory_reset
(
void
);
extern
void
action_replay_init
(
int
);
extern
void
action_replay_init
(
int
);
extern
void
action_replay_cleanup
(
void
);
extern
void
action_replay_cleanup
(
void
);
//extern void action_replay_map_banks (void);
extern
void
REGPARAM3
chipmem_lput_actionreplay23
(
uaecptr
addr
,
uae_u32
l
)
REGPARAM
;
extern
void
REGPARAM3
chipmem_lput_actionreplay23
(
uaecptr
addr
,
uae_u32
l
)
REGPARAM
;
extern
void
REGPARAM3
chipmem_wput_actionreplay23
(
uaecptr
addr
,
uae_u32
w
)
REGPARAM
;
extern
void
REGPARAM3
chipmem_wput_actionreplay23
(
uaecptr
addr
,
uae_u32
w
)
REGPARAM
;
extern
void
REGPARAM3
chipmem_bput_actionreplay1
(
uaecptr
addr
,
uae_u32
b
)
REGPARAM
;
extern
void
REGPARAM3
chipmem_bput_actionreplay1
(
uaecptr
addr
,
uae_u32
b
)
REGPARAM
;
...
...
src/include/blkdev.h
View file @
8f059ce4
...
@@ -80,7 +80,6 @@ struct device_info {
...
@@ -80,7 +80,6 @@ struct device_info {
TCHAR
productid
[
18
];
TCHAR
productid
[
18
];
TCHAR
revision
[
6
];
TCHAR
revision
[
6
];
TCHAR
*
backend
;
TCHAR
*
backend
;
int
slow_unit
;
struct
cd_toc_head
toc
;
struct
cd_toc_head
toc
;
};
};
...
@@ -110,10 +109,11 @@ typedef uae_u8* (*execscsicmd_in_func) (int, uae_u8*, int, int*);
...
@@ -110,10 +109,11 @@ typedef uae_u8* (*execscsicmd_in_func) (int, uae_u8*, int, int*);
typedef
int
(
*
execscsicmd_direct_func
)
(
int
,
struct
amigascsi
*
);
typedef
int
(
*
execscsicmd_direct_func
)
(
int
,
struct
amigascsi
*
);
typedef
void
(
*
play_subchannel_callback
)
(
uae_u8
*
,
int
);
typedef
void
(
*
play_subchannel_callback
)
(
uae_u8
*
,
int
);
typedef
int
(
*
play_status_callback
)
(
int
);
typedef
int
(
*
pause_func
)
(
int
,
int
);
typedef
int
(
*
pause_func
)
(
int
,
int
);
typedef
int
(
*
stop_func
)
(
int
);
typedef
int
(
*
stop_func
)
(
int
);
typedef
int
(
*
play_func
)
(
int
,
int
,
int
,
int
,
play_subchannel_callback
);
typedef
int
(
*
play_func
)
(
int
,
int
,
int
,
int
,
play_s
tatus_callback
,
play_s
ubchannel_callback
);
typedef
uae_u32
(
*
volume_func
)
(
int
,
uae_u16
,
uae_u16
);
typedef
uae_u32
(
*
volume_func
)
(
int
,
uae_u16
,
uae_u16
);
typedef
int
(
*
qcode_func
)
(
int
,
uae_u8
*
,
int
);
typedef
int
(
*
qcode_func
)
(
int
,
uae_u8
*
,
int
);
typedef
int
(
*
toc_func
)
(
int
,
struct
cd_toc_head
*
);
typedef
int
(
*
toc_func
)
(
int
,
struct
cd_toc_head
*
);
...
@@ -160,7 +160,7 @@ extern struct device_info *sys_command_info (int unitnum, struct device_info *di
...
@@ -160,7 +160,7 @@ extern struct device_info *sys_command_info (int unitnum, struct device_info *di
extern
int
sys_command_cd_pause
(
int
unitnum
,
int
paused
);
extern
int
sys_command_cd_pause
(
int
unitnum
,
int
paused
);
extern
void
sys_command_cd_stop
(
int
unitnum
);
extern
void
sys_command_cd_stop
(
int
unitnum
);
extern
int
sys_command_cd_play
(
int
unitnum
,
int
startlsn
,
int
endlsn
,
int
);
extern
int
sys_command_cd_play
(
int
unitnum
,
int
startlsn
,
int
endlsn
,
int
);
extern
int
sys_command_cd_play2
(
int
unitnum
,
int
startlsn
,
int
endlsn
,
int
scan
,
play_subchannel_callback
subfunc
);
extern
int
sys_command_cd_play2
(
int
unitnum
,
int
startlsn
,
int
endlsn
,
int
scan
,
play_s
tatus_callback
statusfunc
,
play_s
ubchannel_callback
subfunc
);
extern
uae_u32
sys_command_cd_volume
(
int
unitnum
,
uae_u16
volume_left
,
uae_u16
volume_right
);
extern
uae_u32
sys_command_cd_volume
(
int
unitnum
,
uae_u16
volume_left
,
uae_u16
volume_right
);
extern
int
sys_command_cd_qcode
(
int
unitnum
,
uae_u8
*
);
extern
int
sys_command_cd_qcode
(
int
unitnum
,
uae_u8
*
);
extern
int
sys_command_cd_toc
(
int
unitnum
,
struct
cd_toc_head
*
);
extern
int
sys_command_cd_toc
(
int
unitnum
,
struct
cd_toc_head
*
);
...
...
src/include/rommgr.h
View file @
8f059ce4
...
@@ -52,28 +52,28 @@ struct romlist {
...
@@ -52,28 +52,28 @@ struct romlist {
struct
romdata
*
rd
;
struct
romdata
*
rd
;
};
};
extern
struct
romdata
*
getromdatabypath
(
TCHAR
*
path
);
extern
struct
romdata
*
getromdatabypath
(
const
TCHAR
*
path
);
extern
struct
romdata
*
getromdatabycrc
(
uae_u32
crc32
);
extern
struct
romdata
*
getromdatabycrc
(
uae_u32
crc32
);
extern
struct
romdata
*
getromdatabydata
(
uae_u8
*
rom
,
int
size
);
extern
struct
romdata
*
getromdatabydata
(
uae_u8
*
rom
,
int
size
);
extern
struct
romdata
*
getromdatabyid
(
int
id
);
extern
struct
romdata
*
getromdatabyid
(
int
id
);
extern
struct
romdata
*
getromdatabyidgroup
(
int
id
,
int
group
,
int
subitem
);
extern
struct
romdata
*
getromdatabyidgroup
(
int
id
,
int
group
,
int
subitem
);
//extern struct romdata *getromdatabyzfile (struct zfile *f);
//extern struct romdata *getromdatabyzfile (struct zfile *f);
extern
struct
romlist
**
getarcadiaroms
(
void
);
extern
struct
romlist
**
getarcadiaroms
(
void
);
extern
struct
romdata
*
getarcadiarombyname
(
TCHAR
*
name
);
extern
struct
romdata
*
getarcadiarombyname
(
const
TCHAR
*
name
);
extern
struct
romlist
**
getromlistbyident
(
int
ver
,
int
rev
,
int
subver
,
int
subrev
,
TCHAR
*
model
,
int
all
);
extern
struct
romlist
**
getromlistbyident
(
int
ver
,
int
rev
,
int
subver
,
int
subrev
,
const
TCHAR
*
model
,
int
all
);
extern
void
getromname
(
struct
romdata
*
,
TCHAR
*
);
extern
void
getromname
(
const
struct
romdata
*
,
TCHAR
*
);
//extern struct romdata *getromdatabyname (const TCHAR*);
//extern struct romdata *getromdatabyname (const TCHAR*);
extern
struct
romlist
*
getromlistbyids
(
int
*
ids
);
extern
struct
romlist
*
getromlistbyids
(
const
int
*
ids
);
extern
void
romwarning
(
int
*
ids
);
extern
void
romwarning
(
const
int
*
ids
);
extern
struct
romlist
*
getromlistbyromdata
(
struct
romdata
*
rd
);
extern
struct
romlist
*
getromlistbyromdata
(
const
struct
romdata
*
rd
);
extern
void
romlist_add
(
TCHAR
*
path
,
struct
romdata
*
rd
);
extern
void
romlist_add
(
const
TCHAR
*
path
,
struct
romdata
*
rd
);
extern
TCHAR
*
romlist_get
(
struct
romdata
*
rd
);
extern
TCHAR
*
romlist_get
(
const
struct
romdata
*
rd
);
extern
void
romlist_clear
(
void
);
extern
void
romlist_clear
(
void
);
extern
struct
zfile
*
read_rom
(
struct
romdata
**
rd
);
extern
struct
zfile
*
read_rom
(
struct
romdata
**
rd
);
extern
struct
zfile
*
read_rom_name
(
const
TCHAR
*
filename
);
extern
struct
zfile
*
read_rom_name
(
const
TCHAR
*
filename
);
extern
int
load_keyring
(
struct
uae_prefs
*
p
,
TCHAR
*
path
);
extern
int
load_keyring
(
struct
uae_prefs
*
p
,
const
TCHAR
*
path
);
extern
uae_u8
*
target_load_keyfile
(
struct
uae_prefs
*
p
,
TCHAR
*
path
,
int
*
size
,
TCHAR
*
name
);
extern
uae_u8
*
target_load_keyfile
(
struct
uae_prefs
*
p
,
const
TCHAR
*
path
,
int
*
size
,
TCHAR
*
name
);
extern
void
free_keyring
(
void
);
extern
void
free_keyring
(
void
);
extern
int
get_keyring
(
void
);
extern
int
get_keyring
(
void
);
extern
void
kickstart_fix_checksum
(
uae_u8
*
mem
,
int
size
);
extern
void
kickstart_fix_checksum
(
uae_u8
*
mem
,
int
size
);
...
@@ -83,7 +83,8 @@ extern int decode_rom (uae_u8 *mem, int size, int mode, int real_size);
...
@@ -83,7 +83,8 @@ extern int decode_rom (uae_u8 *mem, int size, int mode, int real_size);
extern
struct
zfile
*
rom_fopen
(
const
TCHAR
*
name
,
const
TCHAR
*
mode
,
int
mask
);
extern
struct
zfile
*
rom_fopen
(
const
TCHAR
*
name
,
const
TCHAR
*
mode
,
int
mask
);
extern
struct
zfile
*
read_rom_name_guess
(
const
TCHAR
*
filename
);
extern
struct
zfile
*
read_rom_name_guess
(
const
TCHAR
*
filename
);
extern
void
addkeydir
(
const
TCHAR
*
path
);
extern
void
addkeydir
(
const
TCHAR
*
path
);
extern
void
addkeyfile
(
const
TCHAR
*
path
);
extern
int
romlist_count
(
void
);
extern
int
romlist_count
(
void
);
extern
struct
romlist
*
romlist_getit
(
void
);
extern
struct
romlist
*
romlist_getit
(
void
);
extern
int
configure_rom
(
struct
uae_prefs
*
p
,
int
*
rom
,
int
msg
);
extern
int
configure_rom
(
struct
uae_prefs
*
p
,
const
int
*
rom
,
int
msg
);
src/include/savestate.h
View file @
8f059ce4
...
@@ -20,8 +20,8 @@ extern uae_u32 restore_u32_func (uae_u8 **);
...
@@ -20,8 +20,8 @@ extern uae_u32 restore_u32_func (uae_u8 **);
extern
uae_u16
restore_u16_func
(
uae_u8
**
);
extern
uae_u16
restore_u16_func
(
uae_u8
**
);
extern
uae_u8
restore_u8_func
(
uae_u8
**
);
extern
uae_u8
restore_u8_func
(
uae_u8
**
);
extern
void
save_string_func
(
uae_u8
**
,
const
char
*
);
extern
void
save_string_func
(
uae_u8
**
,
const
TCHAR
*
);
extern
char
*
restore_string_func
(
const
uae_u8
**
);
extern
TCHAR
*
restore_string_func
(
uae_u8
**
);
#define save_u64(x) save_u64_func (&dst, (x))
#define save_u64(x) save_u64_func (&dst, (x))
#define save_u32(x) save_u32_func (&dst, (x))
#define save_u32(x) save_u32_func (&dst, (x))
...
@@ -151,9 +151,9 @@ extern uae_u8 *save_action_replay (int *, uae_u8 *);
...
@@ -151,9 +151,9 @@ extern uae_u8 *save_action_replay (int *, uae_u8 *);
extern
uae_u8
*
restore_hrtmon
(
uae_u8
*
);
extern
uae_u8
*
restore_hrtmon
(
uae_u8
*
);
extern
uae_u8
*
save_hrtmon
(
int
*
,
uae_u8
*
);
extern
uae_u8
*
save_hrtmon
(
int
*
,
uae_u8
*
);
extern
void
savestate_initsave
(
const
char
*
filename
,
int
docompress
,
int
nodialogs
);
extern
void
savestate_initsave
(
const
TCHAR
*
filename
,
int
docompress
,
int
nodialogs
);
extern
int
save_state
(
const
char
*
filename
,
const
char
*
description
);
extern
int
save_state
(
const
TCHAR
*
filename
,
const
TCHAR
*
description
);
extern
void
restore_state
(
const
char
*
filename
);
extern
void
restore_state
(
const
TCHAR
*
filename
);
extern
void
savestate_restore_finish
(
void
);
extern
void
savestate_restore_finish
(
void
);
extern
void
custom_save_state
(
void
);
extern
void
custom_save_state
(
void
);
...
@@ -167,7 +167,7 @@ extern void custom_prepare_savestate (void);
...
@@ -167,7 +167,7 @@ extern void custom_prepare_savestate (void);
#define STATE_DOREWIND 32
#define STATE_DOREWIND 32
extern
int
savestate_state
;
extern
int
savestate_state
;
extern
char
savestate_fname
[
MAX_DPATH
];
extern
TCHAR
savestate_fname
[
MAX_DPATH
];
extern
struct
zfile
*
savestate_file
;
extern
struct
zfile
*
savestate_file
;
extern
void
savestate_quick
(
int
slot
,
int
save
);
extern
void
savestate_quick
(
int
slot
,
int
save
);
...
...
src/include/sysdeps.h
View file @
8f059ce4
...
@@ -425,4 +425,5 @@ extern void xfree (const void*);
...
@@ -425,4 +425,5 @@ extern void xfree (const void*);
#define true 1
#define true 1
#define false 0
#define false 0
#define _vsntprintf vsnprintf
#define _vsntprintf vsnprintf
#define max(a,b) ((a) > (b) ? (a) : (b))
#endif
#endif
src/misc.c
View file @
8f059ce4
...
@@ -424,7 +424,7 @@ uae_u32 emulib_target_getcpurate (uae_u32 v, uae_u32 *low)
...
@@ -424,7 +424,7 @@ uae_u32 emulib_target_getcpurate (uae_u32 v, uae_u32 *low)
*/
*/
return
0
;
return
0
;
}
}
/*
int isfat (uae_u8 *p)
int isfat (uae_u8 *p)
{
{
int i, b;
int i, b;
...
@@ -454,7 +454,7 @@ int isfat (uae_u8 *p)
...
@@ -454,7 +454,7 @@ int isfat (uae_u8 *p)
return 0;
return 0;
return 1;
return 1;
}
}
*/
void
setmouseactivexy
(
int
x
,
int
y
,
int
dir
)
void
setmouseactivexy
(
int
x
,
int
y
,
int
dir
)
{
{
/* int diff = 8;
/* int diff = 8;
...
...
src/native2amiga.c
View file @
8f059ce4
/*
/*
* UAE - The Un*x Amiga Emulator
* UAE - The Un*x Amiga Emulator
*
*
* Call Amiga Exec functions outside the main UAE thread.
* Call Amiga Exec functions outside the main UAE thread.
...
...
src/newcpu.c
View file @
8f059ce4
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
#define MOVEC_DEBUG 0
#define MOVEC_DEBUG 0
#define MMUOP_DEBUG 2
#define MMUOP_DEBUG 2
#define DEBUG_CD32CDTVIO 0
#include "sysconfig.h"
#include "sysconfig.h"
#include "sysdeps.h"
#include "sysdeps.h"
...
@@ -2675,8 +2676,7 @@ STATIC_INLINE int do_specialties (int cycles)
...
@@ -2675,8 +2676,7 @@ STATIC_INLINE int do_specialties (int cycles)
//static uae_u32 pcs[1000];
//static uae_u32 pcs[1000];
//#define DEBUG_CD32CDTVIO
#if DEBUG_CD32CDTVIO
#ifdef DEBUG_CD32CDTVIO
static
uae_u32
cd32nextpc
,
cd32request
;
static
uae_u32
cd32nextpc
,
cd32request
;
...
@@ -2768,7 +2768,7 @@ static void m68k_run_1 (void)
...
@@ -2768,7 +2768,7 @@ static void m68k_run_1 (void)
count_instr
(
opcode
);
count_instr
(
opcode
);
#if
def
DEBUG_CD32CDTVIO
#if DEBUG_CD32CDTVIO
out_cd32io
(
m68k_getpc
());
out_cd32io
(
m68k_getpc
());
#endif
#endif
...
@@ -2815,7 +2815,7 @@ static void m68k_run_1_ce (void)
...
@@ -2815,7 +2815,7 @@ static void m68k_run_1_ce (void)
ipl_fetch
();
ipl_fetch
();
for
(;;)
{
for
(;;)
{
uae_u32
opcode
=
r
->
ir
;
uae_u32
opcode
=
r
->
ir
;
#if
def
DEBUG_CD32CDTVIO
#if DEBUG_CD32CDTVIO
out_cd32io
(
m68k_getpc
());
out_cd32io
(
m68k_getpc
());
#endif
#endif
(
*
cpufunctbl
[
opcode
])(
opcode
);
(
*
cpufunctbl
[
opcode
])(
opcode
);
...
@@ -2947,7 +2947,7 @@ static void opcodedebug (uae_u32 pc, uae_u16 opcode)
...
@@ -2947,7 +2947,7 @@ static void opcodedebug (uae_u32 pc, uae_u16 opcode)
if
(
!
fault
)
{
if
(
!
fault
)
{
TCHAR
buf
[
100
];
TCHAR
buf
[
100
];
write_log
(
"mmufixup=%d %04x %04x
\n
"
,
mmufixup
[
0
].
reg
,
regs
.
wb3_status
,
regs
.
mmu_ssw
);
write_log
(
"mmufixup=%d %04x %04x
\n
"
,
mmufixup
[
0
].
reg
,
regs
.
wb3_status
,
regs
.
mmu_ssw
);
m68k_disasm_2
(
buf
,
100
,
addr
,
NULL
,
1
,
NULL
,
NULL
,
0
);
m68k_disasm_2
(
buf
,
sizeof
buf
/
sizeof
(
TCHAR
)
,
addr
,
NULL
,
1
,
NULL
,
NULL
,
0
);
write_log
(
"%s
\n
"
,
buf
);
write_log
(
"%s
\n
"
,
buf
);
m68k_dumpstate
(
stdout
,
NULL
);
m68k_dumpstate
(
stdout
,
NULL
);
}
}
...
@@ -3050,7 +3050,7 @@ static void m68k_run_2p (void)
...
@@ -3050,7 +3050,7 @@ static void m68k_run_2p (void)
uae_u32
opcode
;
uae_u32
opcode
;
uae_u32
pc
=
m68k_getpc
();
uae_u32
pc
=
m68k_getpc
();
#if
def
DEBUG_CD32CDTVIO
#if DEBUG_CD32CDTVIO
out_cd32io
(
m68k_getpc
());
out_cd32io
(
m68k_getpc
());
#endif
#endif
...
...
src/picasso96.c
View file @
8f059ce4
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
* accesses which may be rather slow.
* accesses which may be rather slow.
*
*
* TODO:
* TODO:
* - add panning capability
* - we want to add a manual switch to override SetSwitch for hardware banging
* - we want to add a manual switch to override SetSwitch for hardware banging
* programs started from a Picasso workbench.
* programs started from a Picasso workbench.
*/
*/
...
@@ -47,7 +48,7 @@
...
@@ -47,7 +48,7 @@
int
have_done_picasso
=
0
;
/* For the JIT compiler */
int
have_done_picasso
=
0
;
/* For the JIT compiler */
int
picasso_is_special
=
PIC_WRITE
;
/* ditto */
int
picasso_is_special
=
PIC_WRITE
;
/* ditto */
int
picasso_is_special_read
=
PIC_READ
;
/* ditto */
int
picasso_is_special_read
=
PIC_READ
;
/* ditto */
#
endif
#endif
#ifdef PICASSO96
#ifdef PICASSO96
...
@@ -139,8 +140,7 @@ static void DumpLibResolutionStructure (uaecptr amigalibresptr)
...
@@ -139,8 +140,7 @@ static void DumpLibResolutionStructure (uaecptr amigalibresptr)
{
{
int
i
;
int
i
;
uaecptr
amigamodeinfoptr
;
uaecptr
amigamodeinfoptr
;
struct
LibResolution
*
uaememptr
=
(
struct
LibResolution
*
)
struct
LibResolution
*
uaememptr
=
(
struct
LibResolution
*
)
get_mem_bank
(
amigalibresptr
).
xlateaddr
(
amigalibresptr
);
get_mem_bank
(
amigalibresptr
).
xlateaddr
(
amigalibresptr
);
return
;
return
;
...
@@ -255,8 +255,8 @@ STATIC_INLINE uae_u8 GetBytesPerPixel (uae_u32 RGBfmt)
...
@@ -255,8 +255,8 @@ STATIC_INLINE uae_u8 GetBytesPerPixel (uae_u32 RGBfmt)
/*
/*
* Amiga <-> native structure conversion functions
* Amiga <-> native structure conversion functions
*/
*/
static
int
CopyRenderInfoStructureA2U
(
uaecptr
amigamemptr
,
struct
RenderInfo
*
ri
)
static
int
CopyRenderInfoStructureA2U
(
uaecptr
amigamemptr
,
struct
RenderInfo
*
ri
)
{
{
uaecptr
memp
=
get_long
(
amigamemptr
+
PSSO_RenderInfo_Memory
);
uaecptr
memp
=
get_long
(
amigamemptr
+
PSSO_RenderInfo_Memory
);
...
@@ -271,8 +271,7 @@ static int CopyRenderInfoStructureA2U (uaecptr amigamemptr,
...
@@ -271,8 +271,7 @@ static int CopyRenderInfoStructureA2U (uaecptr amigamemptr,
return
0
;
return
0
;
}
}
static
int
CopyPatternStructureA2U
(
uaecptr
amigamemptr
,
static
int
CopyPatternStructureA2U
(
uaecptr
amigamemptr
,
struct
Pattern
*
pattern
)
struct
Pattern
*
pattern
)
{
{
uaecptr
memp
=
get_long
(
amigamemptr
+
PSSO_Pattern_Memory
);
uaecptr
memp
=
get_long
(
amigamemptr
+
PSSO_Pattern_Memory
);
...
@@ -290,8 +289,7 @@ static int CopyPatternStructureA2U (uaecptr amigamemptr,
...
@@ -290,8 +289,7 @@ static int CopyPatternStructureA2U (uaecptr amigamemptr,
return
0
;
return
0
;
}
}
static
void
CopyColorIndexMappingA2U
(
uaecptr
amigamemptr
,
static
void
CopyColorIndexMappingA2U
(
uaecptr
amigamemptr
,
struct
ColorIndexMapping
*
cim
)
struct
ColorIndexMapping
*
cim
)
{
{
int
i
;
int
i
;
cim
->
ColorMask
=
get_long
(
amigamemptr
);
cim
->
ColorMask
=
get_long
(
amigamemptr
);
...
@@ -309,8 +307,7 @@ static int CopyBitMapStructureA2U (uaecptr amigamemptr, struct BitMap *bm)
...
@@ -309,8 +307,7 @@ static int CopyBitMapStructureA2U (uaecptr amigamemptr, struct BitMap *bm)
bm
->
Depth
=
get_byte
(
amigamemptr
+
PSSO_BitMap_Depth
);
bm
->
Depth
=
get_byte
(
amigamemptr
+
PSSO_BitMap_Depth
);
if
(
bm
->
Depth
>
8
)
{
if
(
bm
->
Depth
>
8
)
{
write_log
(
"P96: WARNING - Can't handle %d-bit deep bitmap
\n
"
,
write_log
(
"P96: WARNING - Can't handle %d-bit deep bitmap
\n
"
,
bm
->
Depth
);
bm
->
Depth
);
return
0
;
return
0
;
}
}
...
@@ -334,8 +331,7 @@ static int CopyBitMapStructureA2U (uaecptr amigamemptr, struct BitMap *bm)
...
@@ -334,8 +331,7 @@ static int CopyBitMapStructureA2U (uaecptr amigamemptr, struct BitMap *bm)
return
1
;
return
1
;
}
}
static
int
CopyTemplateStructureA2U
(
uaecptr
amigamemptr
,
static
int
CopyTemplateStructureA2U
(
uaecptr
amigamemptr
,
struct
Template
*
tmpl
)
struct
Template
*
tmpl
)
{
{
uaecptr
memp
=
get_long
(
amigamemptr
+
PSSO_Template_Memory
);
uaecptr
memp
=
get_long
(
amigamemptr
+
PSSO_Template_Memory
);
...
@@ -352,10 +348,9 @@ static int CopyTemplateStructureA2U (uaecptr amigamemptr,
...
@@ -352,10 +348,9 @@ static int CopyTemplateStructureA2U (uaecptr amigamemptr,
return
0
;
return
0
;
}
}
static
void
CopyLibResolutionStructureU2A
(
struct
LibResolution
*
libres
,
static
void
CopyLibResolutionStructureU2A
(
struct
LibResolution
*
libres
,
uaecptr
amigamemptr
)
uaecptr
amigamemptr
)
{
{
uae_u8
*
uaememptr
=
0
;
char
*
uaememptr
=
0
;
int
i
;
int
i
;
/* I know that amigamemptr is inside my gfxmem chunk, so I can just do the xlate() */
/* I know that amigamemptr is inside my gfxmem chunk, so I can just do the xlate() */
...
@@ -424,8 +419,7 @@ static void do_fillrect (uae_u8 *src, int x, int y, int width, int height,
...
@@ -424,8 +419,7 @@ static void do_fillrect (uae_u8 *src, int x, int y, int width, int height,
{
{
uae_u8
*
dst
;
uae_u8
*
dst
;
P96TRACE
((
"P96: do_fillrect (src:%08x x:%d y:%d w:%d h%d pen:%08x)
\n
"
,
P96TRACE
((
"P96: do_fillrect (src:%08x x:%d y:%d w:%d h%d pen:%08x)
\n
"
,
src
,
x
,
y
,
width
,
height
,
pen
));
src
,
x
,
y
,
width
,
height
,
pen
));
/* Clipping. */
/* Clipping. */
x
-=
picasso96_state
.
XOffset
;
x
-=
picasso96_state
.
XOffset
;
...
@@ -621,8 +615,7 @@ static void do_blit (struct RenderInfo *ri, int Bpp, int srcx, int srcy,
...
@@ -621,8 +615,7 @@ static void do_blit (struct RenderInfo *ri, int Bpp, int srcx, int srcy,
* Invert a rectangle on the screen.
* Invert a rectangle on the screen.
*/
*/
static
void
do_invertrect
(
struct
RenderInfo
*
ri
,
int
Bpp
,
int
x
,
int
y
,
static
void
do_invertrect
(
struct
RenderInfo
*
ri
,
int
Bpp
,
int
x
,
int
y
,
int
width
,
int
height
)
int
width
,
int
height
)
{
{
#if 0
#if 0
/* Clipping. */
/* Clipping. */
...
@@ -781,8 +774,7 @@ void picasso_refresh (int call_setpalette)
...
@@ -781,8 +774,7 @@ void picasso_refresh (int call_setpalette)
height
=
picasso96_state
.
Height
;
height
=
picasso96_state
.
Height
;
}
}
do_blit
(
&
ri
,
picasso96_state
.
BytesPerPixel
,
0
,
0
,
0
,
0
,
width
,
do_blit
(
&
ri
,
picasso96_state
.
BytesPerPixel
,
0
,
0
,
0
,
0
,
width
,
height
,
BLIT_SRC
,
0
);
height
,
BLIT_SRC
,
0
);
}
else
}
else
write_log
(
"P96: ERROR - picasso_refresh() can't refresh!
\n
"
);
write_log
(
"P96: ERROR - picasso_refresh() can't refresh!
\n
"
);
}
}
...
@@ -812,7 +804,7 @@ STATIC_INLINE void do_blitrect_frame_buffer (struct RenderInfo *ri,
...
@@ -812,7 +804,7 @@ STATIC_INLINE void do_blitrect_frame_buffer (struct RenderInfo *ri,
}
}
if
(
mask
==
0xFF
||
Bpp
>
1
)
{
if
(
mask
==
0xFF
||
Bpp
>
1
)
{
if
(
opcode
==
BLIT_SRC
)
{
if
(
opcode
==
BLIT_SRC
)
{
/* handle normal case efficiently */
/* handle normal case efficiently */
if
(
ri
->
Memory
==
dstri
->
Memory
&&
dsty
==
srcy
)
{
if
(
ri
->
Memory
==
dstri
->
Memory
&&
dsty
==
srcy
)
{
unsigned
long
i
;
unsigned
long
i
;
...
@@ -838,10 +830,10 @@ STATIC_INLINE void do_blitrect_frame_buffer (struct RenderInfo *ri,
...
@@ -838,10 +830,10 @@ STATIC_INLINE void do_blitrect_frame_buffer (struct RenderInfo *ri,
unsigned
int
y
;
unsigned
int
y
;
for
(
y
=
0
;
y
<
height
;
y
++
)
{
for
(
y
=
0
;
y
<
height
;
y
++
)
{
uae_u32
*
bound
=
(
uae_u32
*
)(
src
+
total_width
-
4
)
;
int
bound
=
src
+
total_width
-
4
;
//copy now the longs
//copy now the longs
for
(
src2_32
=
(
uae_u32
*
)
src
,
dst2_32
=
(
uae_u32
*
)
dst
;
src2_32
<
bound
;
src2_32
++
,
dst2_32
++
)
{
for
(
src2_32
=
src
,
dst2_32
=
dst
;
src2_32
<
bound
;
src2_32
++
,
dst2_32
++
)
{
switch
(
(
uae_u8
)
opcode
)
{
switch
(
opcode
)
{
case
BLIT_FALSE
:
case
BLIT_FALSE
:
*
dst2_32
=
0
;
*
dst2_32
=
0
;
break
;
break
;
...
@@ -1200,7 +1192,7 @@ uae_u32 picasso_SetSwitch (void)
...
@@ -1200,7 +1192,7 @@ uae_u32 picasso_SetSwitch (void)
* whenever it is ready to change the screen state. */
* whenever it is ready to change the screen state. */
picasso_requested_on
=
!!
flag
;
picasso_requested_on
=
!!
flag
;
#ifdef JIT
#ifdef JIT
flush_icache
(
0
,
5
);
/* Changing the screen mode might make gfx memory
flush_icache
(
0
,
5
);
/* Changing the screen mode might make gfx memory
directly accessible, or no longer thus accessible */
directly accessible, or no longer thus accessible */
#endif
#endif
...
@@ -1480,7 +1472,7 @@ uae_u32 picasso_InvertRect (void)
...
@@ -1480,7 +1472,7 @@ uae_u32 picasso_InvertRect (void)
unsigned
long
Y
=
(
uae_u16
)
m68k_dreg
(
regs
,
1
);
unsigned
long
Y
=
(
uae_u16
)
m68k_dreg
(
regs
,
1
);
unsigned
long
Width
=
(
uae_u16
)
m68k_dreg
(
regs
,
2
);
unsigned
long
Width
=
(
uae_u16
)
m68k_dreg
(
regs
,
2
);
unsigned
long
Height
=
(
uae_u16
)
m68k_dreg
(
regs
,
3
);
unsigned
long
Height
=
(
uae_u16
)
m68k_dreg
(
regs
,
3
);
uae_u8
mask
=
(
uae_u8
)
m68k_dreg
(
regs
,
4
);
uae_u8
mask
=
(
uae_u8
)
m68k_dreg
(
regs
,
4
);
int
Bpp
=
GetBytesPerPixel
(
m68k_dreg
(
regs
,
7
));
int
Bpp
=
GetBytesPerPixel
(
m68k_dreg
(
regs
,
7
));
uae_u32
xorval
;
uae_u32
xorval
;
unsigned
int
lines
;
unsigned
int
lines
;
...
@@ -1563,7 +1555,7 @@ STATIC_INLINE void do_fillrect_frame_buffer (struct RenderInfo *ri, int X, int Y
...
@@ -1563,7 +1555,7 @@ STATIC_INLINE void do_fillrect_frame_buffer (struct RenderInfo *ri, int X, int Y
memcpy
(
dst
,
src
,
Width
*
Bpp
);
memcpy
(
dst
,
src
,
Width
*
Bpp
);
}
else
{
}
else
{
for
(
lines
=
0
;
lines
<
(
Height
-
1
);
lines
++
,
dst
+=
ri
->
BytesPerRow
)
for
(
lines
=
0
;
lines
<
(
Height
-
1
);
lines
++
,
dst
+=
ri
->
BytesPerRow
)
memset
(
dst
,
Pen
,
Width
);
memset
(
dst
,
Pen
,
Width
);
}
}
}
}
...
@@ -1588,7 +1580,7 @@ uae_u32 picasso_FillRect (void)
...
@@ -1588,7 +1580,7 @@ uae_u32 picasso_FillRect (void)
uae_u32
Width
=
(
uae_u16
)
m68k_dreg
(
regs
,
2
);
uae_u32
Width
=
(
uae_u16
)
m68k_dreg
(
regs
,
2
);
uae_u32
Height
=
(
uae_u16
)
m68k_dreg
(
regs
,
3
);
uae_u32
Height
=
(
uae_u16
)
m68k_dreg
(
regs
,
3
);
uae_u32
Pen
=
m68k_dreg
(
regs
,
4
);
uae_u32
Pen
=
m68k_dreg
(
regs
,
4
);
uae_u8
Mask
=
(
uae_u8
)
m68k_dreg
(
regs
,
5
);
uae_u8
Mask
=
(
uae_u8
)
m68k_dreg
(
regs
,
5
);
RGBFTYPE
RGBFormat
=
m68k_dreg
(
regs
,
7
);
RGBFTYPE
RGBFormat
=
m68k_dreg
(
regs
,
7
);
uae_u8
*
src
;
uae_u8
*
src
;
...
@@ -1625,7 +1617,7 @@ uae_u32 picasso_FillRect (void)
...
@@ -1625,7 +1617,7 @@ uae_u32 picasso_FillRect (void)
if
(
Width
==
1
)
{
if
(
Width
==
1
)
{
for
(
i
=
0
;
i
<
Height
;
i
++
)
{
for
(
i
=
0
;
i
<
Height
;
i
++
)
{
if
(
Bpp
==
4
)
if
(
Bpp
==
4
)
gfxmem_lput
(
addr
+
(
i
*
picasso96_state
.
BytesPerRow
),
Pen
);
gfxmem_lput
(
addr
+
(
i
*
picasso96_state
.
BytesPerRow
),
Pen
);
else
if
(
Bpp
==
2
)
else
if
(
Bpp
==
2
)
gfxmem_wput
(
addr
+
(
i
*
picasso96_state
.
BytesPerRow
),
Pen
);
gfxmem_wput
(
addr
+
(
i
*
picasso96_state
.
BytesPerRow
),
Pen
);
...
@@ -1639,7 +1631,7 @@ uae_u32 picasso_FillRect (void)
...
@@ -1639,7 +1631,7 @@ uae_u32 picasso_FillRect (void)
else
if
(
Bpp
==
2
)
else
if
(
Bpp
==
2
)
gfxmem_wput
(
addr
+
(
i
*
Bpp
),
Pen
);
gfxmem_wput
(
addr
+
(
i
*
Bpp
),
Pen
);
else
else
gfxmem_bput
(
addr
+
(
i
*
Bpp
),
Pen
);
gfxmem_bput
(
addr
+
(
i
*
Bpp
),
Pen
);
}
}
}
}
return
1
;
return
1
;
...
@@ -1691,7 +1683,7 @@ uae_u32 picasso_FillRect (void)
...
@@ -1691,7 +1683,7 @@ uae_u32 picasso_FillRect (void)
}
}
}
}
if
(
renderinfo_is_current_screen
(
&
ri
))
if
(
renderinfo_is_current_screen
(
&
ri
))
do_blit
(
&
ri
,
Bpp
,
X
,
Y
,
X
,
Y
,
Width
,
Height
,
BLIT_SRC
,
0
);
do_blit
(
&
ri
,
Bpp
,
X
,
Y
,
X
,
Y
,
Width
,
Height
,
BLIT_SRC
,
0
);
result
=
1
;
result
=
1
;
}
}
}
}
...
@@ -1703,25 +1695,25 @@ uae_u32 picasso_FillRect (void)
...
@@ -1703,25 +1695,25 @@ uae_u32 picasso_FillRect (void)
/*
/*
* BlitRect() is a generic (any chunky pixel format) rectangle copier
* BlitRect() is a generic (any chunky pixel format) rectangle copier
* NOTE: If dstri is NULL, then we're only dealing with one RenderInfo area, and called from picasso_BlitRect()
* NOTE: If dstri is NULL, then we're only dealing with one RenderInfo area, and called from picasso_BlitRect()
*
*
* OpCodes:
* OpCodes:
*
0 = FALSE: dst = 0
*
0 = FALSE: dst = 0
*
1 = NOR: dst = ~(src | dst)
*
1 = NOR: dst = ~(src | dst)
*
2 = ONLYDST: dst = dst & ~src
*
2 = ONLYDST: dst = dst & ~src
*
3 = NOTSRC: dst = ~src
*
3 = NOTSRC: dst = ~src
*
4 = ONLYSRC: dst = src & ~dst
*
4 = ONLYSRC: dst = src & ~dst
*
5 = NOTDST: dst = ~dst
*
5 = NOTDST: dst = ~dst
*
6 = EOR: dst = src^dst
*
6 = EOR: dst = src^dst
*
7 = NAND: dst = ~(src & dst)
*
7 = NAND: dst = ~(src & dst)
*
8 = AND: dst = (src & dst)
*
8 = AND: dst = (src & dst)
*
9 = NEOR: dst = ~(src ^ dst)
*
9 = NEOR: dst = ~(src ^ dst)
*
10 = DST: dst = dst
*
10 = DST: dst = dst
*
11 = NOTONLYSRC: dst = ~src | dst
*
11 = NOTONLYSRC: dst = ~src | dst
*
12 = SRC: dst = src
*
12 = SRC: dst = src
*
13 = NOTONLYDST: dst = ~dst | src
*
13 = NOTONLYDST: dst = ~dst | src
*
14 = OR: dst = src | dst
*
14 = OR: dst = src | dst
*
15 = TRUE: dst = 0xFF
*
15 = TRUE: dst = 0xFF
*/
*/
struct
blitdata
struct
blitdata
{
{
struct
RenderInfo
ri_struct
;
struct
RenderInfo
ri_struct
;
...
@@ -1807,7 +1799,7 @@ STATIC_INLINE int BlitRect (uaecptr ri, uaecptr dstri,
...
@@ -1807,7 +1799,7 @@ STATIC_INLINE int BlitRect (uaecptr ri, uaecptr dstri,
blitrectdata
.
ri
=
&
blitrectdata
.
ri_struct
;
blitrectdata
.
ri
=
&
blitrectdata
.
ri_struct
;
if
(
dstri
)
{
if
(
dstri
)
{
CopyRenderInfoStructureA2U
(
dstri
,
&
blitrectdata
.
dstri_struct
);
CopyRenderInfoStructureA2U
(
dstri
,
&
blitrectdata
.
dstri_struct
);
blitrectdata
.
dstri
=
&
blitrectdata
.
dstri_struct
;
blitrectdata
.
dstri
=
&
blitrectdata
.
dstri_struct
;
}
else
}
else
blitrectdata
.
dstri
=
NULL
;
blitrectdata
.
dstri
=
NULL
;
...
@@ -2012,10 +2004,10 @@ uae_u32 picasso_BlitPattern (void)
...
@@ -2012,10 +2004,10 @@ uae_u32 picasso_BlitPattern (void)
pattern
.
DrawMode
&=
0x03
;
pattern
.
DrawMode
&=
0x03
;
if
(
Mask
!=
0xFF
)
{
if
(
Mask
!=
0xFF
)
{
if
(
Bpp
>
1
)
if
(
Bpp
>
1
)
Mask
=
0xFF
;
Mask
=
0xFF
;
if
(
pattern
.
DrawMode
==
COMP
)
if
(
pattern
.
DrawMode
==
COMP
)
write_log
(
"WARNING - BlitPattern() has unhandled mask 0x%x with COMP DrawMode. Using fall-back routine.
\n
"
,
Mask
);
write_log
(
"WARNING - BlitPattern() has unhandled mask 0x%x with COMP DrawMode. Using fall-back routine.
\n
"
,
Mask
);
else
else
result
=
1
;
result
=
1
;
...
@@ -2103,7 +2095,7 @@ uae_u32 picasso_BlitPattern (void)
...
@@ -2103,7 +2095,7 @@ uae_u32 picasso_BlitPattern (void)
/* If we need to update a second-buffer (extra_mem is set), then do it only if visible! */
/* If we need to update a second-buffer (extra_mem is set), then do it only if visible! */
if
(
picasso_vidinfo
.
extra_mem
&&
renderinfo_is_current_screen
(
&
ri
))
if
(
picasso_vidinfo
.
extra_mem
&&
renderinfo_is_current_screen
(
&
ri
))
do_blit
(
&
ri
,
Bpp
,
X
,
Y
,
X
,
Y
,
W
,
H
,
BLIT_SRC
,
0
);
do_blit
(
&
ri
,
Bpp
,
X
,
Y
,
X
,
Y
,
W
,
H
,
BLIT_SRC
,
0
);
result
=
1
;
result
=
1
;
}
}
...
@@ -2195,9 +2187,9 @@ uae_u32 picasso_BlitTemplate (void)
...
@@ -2195,9 +2187,9 @@ uae_u32 picasso_BlitTemplate (void)
bitoffset
=
tmp
.
XOffset
%
8
;
bitoffset
=
tmp
.
XOffset
%
8
;
#
if defined( P96TRACING_ENABLED ) && ( P96TRACING_LEVEL > 0
)
#
if defined (P96TRACING_ENABLED) && (P96TRACING_LEVEL > 0
)
DumpTemplate
(
&
tmp
,
W
,
H
);
DumpTemplate
(
&
tmp
,
W
,
H
);
#
endif
#endif
tmpl_base
=
tmp
.
Memory
+
tmp
.
XOffset
/
8
;
tmpl_base
=
tmp
.
Memory
+
tmp
.
XOffset
/
8
;
...
@@ -2786,7 +2778,7 @@ static void REGPARAM2 gfxmem_wput (uaecptr addr, uae_u32 w)
...
@@ -2786,7 +2778,7 @@ static void REGPARAM2 gfxmem_wput (uaecptr addr, uae_u32 w)
addr
-=
gfxmem_start
;
addr
-=
gfxmem_start
;
addr
&=
gfxmem_mask
;
addr
&=
gfxmem_mask
;
m
=
(
uae_u16
*
)
(
gfxmemory
+
addr
);
m
=
(
uae_u16
*
)
(
gfxmemory
+
addr
);
do_put_mem_word
(
m
,
(
uae_u16
)
w
);
do_put_mem_word
(
m
,
(
uae_u16
)
w
);
/* write the word to our displayable memory */
/* write the word to our displayable memory */
write_gfx_word
(
addr
,
(
uae_u16
)
w
);
write_gfx_word
(
addr
,
(
uae_u16
)
w
);
...
...
src/rommgr.c
View file @
8f059ce4
/*
/*
* UAE - The Un*x Amiga Emulator
* UAE - The Un*x Amiga Emulator
*
*
* ROM file management
* ROM file management
...
@@ -30,7 +30,7 @@ int romlist_count (void)
...
@@ -30,7 +30,7 @@ int romlist_count (void)
return
romlist_cnt
;
return
romlist_cnt
;
}
}
TCHAR
*
romlist_get
(
struct
romdata
*
rd
)
TCHAR
*
romlist_get
(
const
struct
romdata
*
rd
)
{
{
int
i
;
int
i
;
...
@@ -43,7 +43,7 @@ TCHAR *romlist_get (struct romdata *rd)
...
@@ -43,7 +43,7 @@ TCHAR *romlist_get (struct romdata *rd)
return
0
;
return
0
;
}
}
static
struct
romlist
*
romlist_getrl
(
struct
romdata
*
rd
)
static
struct
romlist
*
romlist_getrl
(
const
struct
romdata
*
rd
)
{
{
int
i
;
int
i
;
...
@@ -57,7 +57,7 @@ static struct romlist *romlist_getrl (struct romdata *rd)
...
@@ -57,7 +57,7 @@ static struct romlist *romlist_getrl (struct romdata *rd)
}
}
static
void
romlist_cleanup
(
void
);
static
void
romlist_cleanup
(
void
);
void
romlist_add
(
TCHAR
*
path
,
struct
romdata
*
rd
)
void
romlist_add
(
const
TCHAR
*
path
,
struct
romdata
*
rd
)
{
{
struct
romlist
*
rl2
;
struct
romlist
*
rl2
;
...
@@ -73,7 +73,7 @@ void romlist_add (TCHAR *path, struct romdata *rd)
...
@@ -73,7 +73,7 @@ void romlist_add (TCHAR *path, struct romdata *rd)
}
}
struct
romdata
*
getromdatabypath
(
TCHAR
*
path
)
struct
romdata
*
getromdatabypath
(
const
TCHAR
*
path
)
{
{
int
i
;
int
i
;
for
(
i
=
0
;
i
<
romlist_cnt
;
i
++
)
{
for
(
i
=
0
;
i
<
romlist_cnt
;
i
++
)
{
...
@@ -88,7 +88,7 @@ struct romdata *getromdatabypath (TCHAR *path)
...
@@ -88,7 +88,7 @@ struct romdata *getromdatabypath (TCHAR *path)
return
NULL
;
return
NULL
;
}
}
#define NEXT_ROM_ID 7
3
#define NEXT_ROM_ID 7
4
static
struct
romheader
romheaders
[]
=
{
static
struct
romheader
romheaders
[]
=
{
{
"Freezer Cartridges"
,
1
},
{
"Freezer Cartridges"
,
1
},
...
@@ -106,6 +106,8 @@ static struct romdata roms[] = {
...
@@ -106,6 +106,8 @@ static struct romdata roms[] = {
0x869ae1b1
,
0x801bbab3
,
0x2e3d3738
,
0x6dd1636d
,
0x4f1d6fa7
,
0xe21d5874
},
0x869ae1b1
,
0x801bbab3
,
0x2e3d3738
,
0x6dd1636d
,
0x4f1d6fa7
,
0xe21d5874
},
{
"Cloanto Amiga Forever 2006 ROM key"
,
0
,
0
,
0
,
0
,
0
,
750
,
48
,
0
,
1
,
ROMTYPE_KEY
,
0
,
0
,
NULL
,
{
"Cloanto Amiga Forever 2006 ROM key"
,
0
,
0
,
0
,
0
,
0
,
750
,
48
,
0
,
1
,
ROMTYPE_KEY
,
0
,
0
,
NULL
,
0xb01c4b56
,
0xbba8e5cd
,
0x118b8d92
,
0xafed5693
,
0x5eeb9770
,
0x2a662d8f
},
0xb01c4b56
,
0xbba8e5cd
,
0x118b8d92
,
0xafed5693
,
0x5eeb9770
,
0x2a662d8f
},
{
"Cloanto Amiga Forever 2010 ROM key"
,
0
,
0
,
0
,
0
,
0
,
1544
,
73
,
0
,
1
,
ROMTYPE_KEY
,
0
,
0
,
NULL
,
0x8c4dd05c
,
0x05034f62
,
0x0b5bb7b2
,
0x86954ea9
,
0x164fdb90
,
0xfb2897a4
},
{
"KS ROM v1.0 (A1000)(NTSC)"
,
1
,
0
,
1
,
0
,
"A1000
\0
"
,
262144
,
1
,
0
,
0
,
ROMTYPE_KICK
,
0
,
0
,
NULL
,
{
"KS ROM v1.0 (A1000)(NTSC)"
,
1
,
0
,
1
,
0
,
"A1000
\0
"
,
262144
,
1
,
0
,
0
,
ROMTYPE_KICK
,
0
,
0
,
NULL
,
0x299790ff
,
0x00C15406
,
0xBEB4B8AB
,
0x1A16AA66
,
0xC05860E1
,
0xA7C1AD79
},
0x299790ff
,
0x00C15406
,
0xBEB4B8AB
,
0x1A16AA66
,
0xC05860E1
,
0xA7C1AD79
},
...
@@ -135,8 +137,8 @@ static struct romdata roms[] = {
...
@@ -135,8 +137,8 @@ static struct romdata roms[] = {
0x43b0df7b
,
0x02843C42
,
0x53BBD29A
,
0xBA535B0A
,
0xA3BD9A85
,
0x034ECDE4
},
0x43b0df7b
,
0x02843C42
,
0x53BBD29A
,
0xBA535B0A
,
0xA3BD9A85
,
0x034ECDE4
},
{
"KS ROM v2.04 (A3000)"
,
2
,
4
,
37
,
175
,
"A3000
\0
"
,
524288
,
71
,
3
,
0
,
ROMTYPE_KICK
,
0
,
0
,
NULL
,
{
"KS ROM v2.04 (A3000)"
,
2
,
4
,
37
,
175
,
"A3000
\0
"
,
524288
,
71
,
3
,
0
,
ROMTYPE_KICK
,
0
,
0
,
NULL
,
0x234a7233
,
0xd82ebb59
,
0xafc53540
,
0xddf2d718
,
0x7ecf239b
,
0x7ea91590
},
0x234a7233
,
0xd82ebb59
,
0xafc53540
,
0xddf2d718
,
0x7ecf239b
,
0x7ea91590
},
ALTROMPN
(
71
,
1
,
1
,
262144
,
ROMTYPE_EVEN
,
"390629-03"
,
0x
7db1332b
,
0x48f14b31
,
0x279da675
,
0x7848df6f
,
0xeb531881
,
0x8f8f576c
)
ALTROMPN
(
71
,
1
,
1
,
262144
,
ROMTYPE_EVEN
,
"390629-03"
,
0x
a245dbdf
,
0x83bab8e9
,
0x5d378b55
,
0xb0c6ae65
,
0x61385a96
,
0xf638598f
)
ALTROMPN
(
71
,
1
,
2
,
262144
,
ROMTYPE_ODD
,
"390630-03"
,
0x
a245dbdf
,
0x83bab8e9
,
0x5d378b55
,
0xb0c6ae65
,
0x61385a96
,
0xf638598f
)
ALTROMPN
(
71
,
1
,
2
,
262144
,
ROMTYPE_ODD
,
"390630-03"
,
0x
7db1332b
,
0x48f14b31
,
0x279da675
,
0x7848df6f
,
0xeb531881
,
0x8f8f576c
)
{
"KS ROM v3.0 (A1200)"
,
3
,
0
,
39
,
106
,
"A1200
\0
"
,
524288
,
11
,
0
,
0
,
ROMTYPE_KICK
,
0
,
0
,
NULL
,
{
"KS ROM v3.0 (A1200)"
,
3
,
0
,
39
,
106
,
"A1200
\0
"
,
524288
,
11
,
0
,
0
,
ROMTYPE_KICK
,
0
,
0
,
NULL
,
0x6c9b07d2
,
0x70033828
,
0x182FFFC7
,
0xED106E53
,
0x73A8B89D
,
0xDA76FAA5
},
0x6c9b07d2
,
0x70033828
,
0x182FFFC7
,
0xED106E53
,
0x73A8B89D
,
0xDA76FAA5
},
...
@@ -377,7 +379,7 @@ static void romlist_cleanup (void)
...
@@ -377,7 +379,7 @@ static void romlist_cleanup (void)
}
}
}
}
struct
romlist
**
getromlistbyident
(
int
ver
,
int
rev
,
int
subver
,
int
subrev
,
TCHAR
*
model
,
int
all
)
struct
romlist
**
getromlistbyident
(
int
ver
,
int
rev
,
int
subver
,
int
subrev
,
const
TCHAR
*
model
,
int
all
)
{
{
int
i
,
j
,
ok
,
out
,
max
;
int
i
,
j
,
ok
,
out
,
max
;
struct
romdata
*
rd
;
struct
romdata
*
rd
;
...
@@ -457,7 +459,7 @@ struct romlist **getromlistbyident (int ver, int rev, int subver, int subrev, TC
...
@@ -457,7 +459,7 @@ struct romlist **getromlistbyident (int ver, int rev, int subver, int subrev, TC
return
rdout
;
return
rdout
;
}
}
struct
romdata
*
getarcadiarombyname
(
TCHAR
*
name
)
struct
romdata
*
getarcadiarombyname
(
const
TCHAR
*
name
)
{
{
int
i
;
int
i
;
for
(
i
=
0
;
roms
[
i
].
name
;
i
++
)
{
for
(
i
=
0
;
roms
[
i
].
name
;
i
++
)
{
...
@@ -465,7 +467,7 @@ struct romdata *getarcadiarombyname (TCHAR *name)
...
@@ -465,7 +467,7 @@ struct romdata *getarcadiarombyname (TCHAR *name)
TCHAR
*
p
=
roms
[
i
].
name
;
TCHAR
*
p
=
roms
[
i
].
name
;
p
=
p
+
_tcslen
(
p
)
+
1
;
p
=
p
+
_tcslen
(
p
)
+
1
;
if
(
_tcslen
(
name
)
>=
_tcslen
(
p
)
+
4
)
{
if
(
_tcslen
(
name
)
>=
_tcslen
(
p
)
+
4
)
{
TCHAR
*
p2
=
name
+
_tcslen
(
name
)
-
_tcslen
(
p
)
-
4
;
const
TCHAR
*
p2
=
name
+
_tcslen
(
name
)
-
_tcslen
(
p
)
-
4
;
if
(
!
memcmp
(
p
,
p2
,
_tcslen
(
p
))
&&
!
memcmp
(
p2
+
_tcslen
(
p2
)
-
4
,
".zip"
,
4
))
if
(
!
memcmp
(
p
,
p2
,
_tcslen
(
p
))
&&
!
memcmp
(
p2
+
_tcslen
(
p2
)
-
4
,
".zip"
,
4
))
return
&
roms
[
i
];
return
&
roms
[
i
];
}
}
...
@@ -516,7 +518,7 @@ static int kickstart_checksum_do (uae_u8 *mem, int size)
...
@@ -516,7 +518,7 @@ static int kickstart_checksum_do (uae_u8 *mem, int size)
return
cksum
==
0xffffffff
;
return
cksum
==
0xffffffff
;
}
}
#define ROM_KEY_NUM
3
#define ROM_KEY_NUM
4
struct
rom_key
{
struct
rom_key
{
uae_u8
*
key
;
uae_u8
*
key
;
int
size
;
int
size
;
...
@@ -554,7 +556,7 @@ static void addkey (uae_u8 *key, int size, const TCHAR *name)
...
@@ -554,7 +556,7 @@ static void addkey (uae_u8 *key, int size, const TCHAR *name)
write_log
(
"ROM KEY '%s' %d bytes loaded
\n
"
,
name
,
size
);
write_log
(
"ROM KEY '%s' %d bytes loaded
\n
"
,
name
,
size
);
}
}
static
void
addkeyfile
(
const
TCHAR
*
path
)
void
addkeyfile
(
const
TCHAR
*
path
)
{
{
struct
zfile
*
f
;
struct
zfile
*
f
;
int
keysize
;
int
keysize
;
...
@@ -602,12 +604,12 @@ int get_keyring (void)
...
@@ -602,12 +604,12 @@ int get_keyring (void)
return
num
;
return
num
;
}
}
int
load_keyring
(
struct
uae_prefs
*
p
,
TCHAR
*
path
)
int
load_keyring
(
struct
uae_prefs
*
p
,
const
TCHAR
*
path
)
{
{
uae_u8
*
keybuf
;
uae_u8
*
keybuf
;
int
keysize
;
int
keysize
;
TCHAR
tmp
[
MAX_PATH
],
*
d
;
TCHAR
tmp
[
MAX_PATH
],
*
d
;
int
keyids
[]
=
{
0
,
48
,
-
1
};
int
keyids
[]
=
{
0
,
48
,
73
,
-
1
};
int
cnt
,
i
;
int
cnt
,
i
;
free_keyring
();
free_keyring
();
...
@@ -683,10 +685,10 @@ void free_keyring (void)
...
@@ -683,10 +685,10 @@ void free_keyring (void)
int
i
;
int
i
;
for
(
i
=
0
;
i
<
ROM_KEY_NUM
;
i
++
)
for
(
i
=
0
;
i
<
ROM_KEY_NUM
;
i
++
)
xfree
(
keyring
[
i
].
key
);
xfree
(
keyring
[
i
].
key
);
memset
(
keyring
,
0
,
sizeof
(
struct
rom_key
)
*
ROM_KEY_NUM
);
memset
(
keyring
,
0
,
sizeof
(
struct
rom_key
)
*
ROM_KEY_NUM
);
}
}
struct
romdata
*
getromdatabyname
(
TCHAR
*
name
)
struct
romdata
*
getromdatabyname
(
const
TCHAR
*
name
)
{
{
TCHAR
tmp
[
MAX_PATH
];
TCHAR
tmp
[
MAX_PATH
];
int
i
=
0
;
int
i
=
0
;
...
@@ -742,7 +744,7 @@ struct romdata *getromdatabycrc (uae_u32 crc32)
...
@@ -742,7 +744,7 @@ struct romdata *getromdatabycrc (uae_u32 crc32)
return
0
;
return
0
;
}
}
static
int
cmpsha1
(
uae_u8
*
s1
,
struct
romdata
*
rd
)
static
int
cmpsha1
(
const
uae_u8
*
s1
,
const
struct
romdata
*
rd
)
{
{
int
i
;
int
i
;
...
@@ -756,7 +758,7 @@ static int cmpsha1 (uae_u8 *s1, struct romdata *rd)
...
@@ -756,7 +758,7 @@ static int cmpsha1 (uae_u8 *s1, struct romdata *rd)
return
0
;
return
0
;
}
}
static
struct
romdata
*
checkromdata
(
uae_u8
*
sha1
,
int
size
,
uae_u32
mask
)
static
struct
romdata
*
checkromdata
(
const
uae_u8
*
sha1
,
int
size
,
uae_u32
mask
)
{
{
int
i
=
0
;
int
i
=
0
;
while
(
roms
[
i
].
name
)
{
while
(
roms
[
i
].
name
)
{
...
@@ -914,7 +916,7 @@ struct romdata *getromdatabyzfile (struct zfile *f)
...
@@ -914,7 +916,7 @@ struct romdata *getromdatabyzfile (struct zfile *f)
return
rd
;
return
rd
;
}
}
void
getromname
(
struct
romdata
*
rd
,
TCHAR
*
name
)
void
getromname
(
const
struct
romdata
*
rd
,
TCHAR
*
name
)
{
{
name
[
0
]
=
0
;
name
[
0
]
=
0
;
if
(
!
rd
)
if
(
!
rd
)
...
@@ -930,7 +932,7 @@ void getromname (struct romdata *rd, TCHAR *name)
...
@@ -930,7 +932,7 @@ void getromname (struct romdata *rd, TCHAR *name)
_stprintf
(
name
+
_tcslen
(
name
),
" [%s]"
,
rd
->
partnumber
);
_stprintf
(
name
+
_tcslen
(
name
),
" [%s]"
,
rd
->
partnumber
);
}
}
struct
romlist
*
getromlistbyromdata
(
struct
romdata
*
rd
)
struct
romlist
*
getromlistbyromdata
(
const
struct
romdata
*
rd
)
{
{
int
ids
[
2
];
int
ids
[
2
];
...
@@ -939,7 +941,7 @@ struct romlist *getromlistbyromdata (struct romdata *rd)
...
@@ -939,7 +941,7 @@ struct romlist *getromlistbyromdata (struct romdata *rd)
return
getromlistbyids
(
ids
);
return
getromlistbyids
(
ids
);
}
}
struct
romlist
*
getromlistbyids
(
int
*
ids
)
struct
romlist
*
getromlistbyids
(
const
int
*
ids
)
{
{
struct
romdata
*
rd
;
struct
romdata
*
rd
;
int
i
,
j
;
int
i
,
j
;
...
@@ -958,7 +960,7 @@ struct romlist *getromlistbyids (int *ids)
...
@@ -958,7 +960,7 @@ struct romlist *getromlistbyids (int *ids)
return
NULL
;
return
NULL
;
}
}
void
romwarning
(
int
*
ids
)
void
romwarning
(
const
int
*
ids
)
{
{
int
i
,
exp
;
int
i
,
exp
;
TCHAR
tmp1
[
MAX_DPATH
],
tmp2
[
MAX_DPATH
];
TCHAR
tmp1
[
MAX_DPATH
],
tmp2
[
MAX_DPATH
];
...
@@ -1029,7 +1031,7 @@ static void mergecd32 (uae_u8 *dst, uae_u8 *src, int size)
...
@@ -1029,7 +1031,7 @@ static void mergecd32 (uae_u8 *dst, uae_u8 *src, int size)
#endif
#endif
}
}
static
void
descramble
(
struct
romdata
*
rd
,
uae_u8
*
data
,
int
size
,
int
odd
)
static
void
descramble
(
const
struct
romdata
*
rd
,
uae_u8
*
data
,
int
size
,
int
odd
)
{
{
int
flags
=
rd
->
type
;
int
flags
=
rd
->
type
;
...
@@ -1037,7 +1039,7 @@ static void descramble (struct romdata *rd, uae_u8 *data, int size, int odd)
...
@@ -1037,7 +1039,7 @@ static void descramble (struct romdata *rd, uae_u8 *data, int size, int odd)
descramble_nordicpro
(
data
,
size
,
odd
);
descramble_nordicpro
(
data
,
size
,
odd
);
}
}
static
int
read_rom_file
(
uae_u8
*
buf
,
struct
romdata
*
rd
)
static
int
read_rom_file
(
uae_u8
*
buf
,
const
struct
romdata
*
rd
)
{
{
struct
zfile
*
zf
;
struct
zfile
*
zf
;
struct
romlist
*
rl
=
romlist_getrl
(
rd
);
struct
romlist
*
rl
=
romlist_getrl
(
rd
);
...
@@ -1300,7 +1302,7 @@ int kickstart_checksum (uae_u8 *mem, int size)
...
@@ -1300,7 +1302,7 @@ int kickstart_checksum (uae_u8 *mem, int size)
return
1
;
return
1
;
}
}
int
configure_rom
(
struct
uae_prefs
*
p
,
int
*
rom
,
int
msg
)
int
configure_rom
(
struct
uae_prefs
*
p
,
const
int
*
rom
,
int
msg
)
{
{
struct
romdata
*
rd
;
struct
romdata
*
rd
;
TCHAR
*
path
=
0
;
TCHAR
*
path
=
0
;
...
...
src/savestate.c
View file @
8f059ce4
...
@@ -199,7 +199,7 @@ uae_u8 restore_u8_func (uae_u8 **dstp)
...
@@ -199,7 +199,7 @@ uae_u8 restore_u8_func (uae_u8 **dstp)
*
dstp
=
dst
+
1
;
*
dstp
=
dst
+
1
;
return
v
;
return
v
;
}
}
TCHAR
*
restore_string_func
(
const
uae_u8
**
dstp
)
TCHAR
*
restore_string_func
(
uae_u8
**
dstp
)
{
{
int
len
;
int
len
;
uae_u8
v
;
uae_u8
v
;
...
@@ -219,7 +219,7 @@ TCHAR *restore_string_func (const uae_u8 **dstp)
...
@@ -219,7 +219,7 @@ TCHAR *restore_string_func (const uae_u8 **dstp)
#ifdef SAVESTATE
#ifdef SAVESTATE
/* read and write IFF-style hunks */
/* read and write IFF-style hunks */
static
void
save_chunk
(
struct
zfile
*
f
,
uae_u8
*
chunk
,
size_t
len
,
const
TCHAR
*
name
,
int
compress
)
static
void
save_chunk
(
struct
zfile
*
f
,
uae_u8
*
chunk
,
size_t
len
,
TCHAR
*
name
,
int
compress
)
{
{
uae_u8
tmp
[
8
],
*
dst
;
uae_u8
tmp
[
8
],
*
dst
;
uae_u8
zero
[
4
]
=
{
0
,
0
,
0
,
0
};
uae_u8
zero
[
4
]
=
{
0
,
0
,
0
,
0
};
...
@@ -287,7 +287,7 @@ static uae_u8 *restore_chunk (struct zfile *f, TCHAR *name, size_t *len, size_t
...
@@ -287,7 +287,7 @@ static uae_u8 *restore_chunk (struct zfile *f, TCHAR *name, size_t *len, size_t
uae_u8
tmp
[
6
],
dummy
[
4
],
*
mem
;
uae_u8
tmp
[
6
],
dummy
[
4
],
*
mem
;
const
uae_u8
*
src
;
const
uae_u8
*
src
;
uae_u32
flags
;
uae_u32
flags
;
size_
t
len2
;
in
t
len2
;
*
totallen
=
0
;
*
totallen
=
0
;
/* chunk name */
/* chunk name */
...
@@ -846,12 +846,12 @@ int save_state (const TCHAR *filename, const TCHAR *description)
...
@@ -846,12 +846,12 @@ int save_state (const TCHAR *filename, const TCHAR *description)
xfree
(
dst
);
xfree
(
dst
);
#endif
#endif
#ifdef CDTV
#ifdef CDTV
dst
=
save_dmac
(
&
len
);
save_chunk
(
f
,
dst
,
len
,
"DMAC"
,
0
);
xfree
(
dst
);
dst
=
save_cdtv
(
&
len
);
dst
=
save_cdtv
(
&
len
);
save_chunk
(
f
,
dst
,
len
,
"CDTV"
,
0
);
save_chunk
(
f
,
dst
,
len
,
"CDTV"
,
0
);
xfree
(
dst
);
xfree
(
dst
);
dst
=
save_dmac
(
&
len
);
save_chunk
(
f
,
dst
,
len
,
"DMAC"
,
0
);
xfree
(
dst
);
#endif
#endif
#ifdef ACTION_REPLAY
#ifdef ACTION_REPLAY
...
@@ -888,7 +888,7 @@ int save_state (const TCHAR *filename, const TCHAR *description)
...
@@ -888,7 +888,7 @@ int save_state (const TCHAR *filename, const TCHAR *description)
}
}
#endif
#endif
#ifdef CD32
#ifdef CD32
for
(
i
=
0
;
i
<
10
;
i
++
)
{
for
(
i
=
0
;
i
<
MAX_TOTAL_SCSI_DEVICES
;
i
++
)
{
dst
=
save_cd
(
i
,
&
len
);
dst
=
save_cd
(
i
,
&
len
);
if
(
dst
)
{
if
(
dst
)
{
_stprintf
(
name
,
"CDU%d"
,
i
);
_stprintf
(
name
,
"CDU%d"
,
i
);
...
...
src/scsiemul.c
View file @
8f059ce4
...
@@ -800,7 +800,7 @@ static int dev_do_io (struct devstruct *dev, uaecptr request)
...
@@ -800,7 +800,7 @@ static int dev_do_io (struct devstruct *dev, uaecptr request)
{
{
int
start
=
io_offset
;
int
start
=
io_offset
;
int
end
=
io_length
+
start
;
int
end
=
io_length
+
start
;
if
(
!
sys_command_cd_play
2
(
dev
->
di
.
unitnum
,
start
,
end
,
0
,
NULL
))
if
(
!
sys_command_cd_play
(
dev
->
di
.
unitnum
,
start
,
end
,
0
))
io_error
=
IOERR_BADADDRESS
;
io_error
=
IOERR_BADADDRESS
;
}
}
break
;
break
;
...
@@ -808,7 +808,7 @@ static int dev_do_io (struct devstruct *dev, uaecptr request)
...
@@ -808,7 +808,7 @@ static int dev_do_io (struct devstruct *dev, uaecptr request)
{
{
int
start
=
msf2lsn
(
io_offset
);
int
start
=
msf2lsn
(
io_offset
);
int
end
=
msf2lsn
(
io_length
)
+
start
;
int
end
=
msf2lsn
(
io_length
)
+
start
;
if
(
!
sys_command_cd_play
2
(
dev
->
di
.
unitnum
,
start
,
end
,
0
,
NULL
))
if
(
!
sys_command_cd_play
(
dev
->
di
.
unitnum
,
start
,
end
,
0
))
io_error
=
IOERR_BADADDRESS
;
io_error
=
IOERR_BADADDRESS
;
}
}
break
;
break
;
...
@@ -819,7 +819,7 @@ static int dev_do_io (struct devstruct *dev, uaecptr request)
...
@@ -819,7 +819,7 @@ static int dev_do_io (struct devstruct *dev, uaecptr request)
if
(
sys_command_cd_toc
(
dev
->
di
.
unitnum
,
&
toc
))
{
if
(
sys_command_cd_toc
(
dev
->
di
.
unitnum
,
&
toc
))
{
for
(
i
=
toc
.
first_track_offset
;
i
<
toc
.
last_track_offset
;
i
++
)
{
for
(
i
=
toc
.
first_track_offset
;
i
<
toc
.
last_track_offset
;
i
++
)
{
if
(
i
==
io_offset
&&
i
+
io_length
<=
toc
.
last_track_offset
)
{
if
(
i
==
io_offset
&&
i
+
io_length
<=
toc
.
last_track_offset
)
{
ok
=
sys_command_cd_play
2
(
dev
->
di
.
unitnum
,
toc
.
toc
[
i
].
address
,
toc
.
toc
[
i
+
io_length
].
address
,
0
,
NULL
);
ok
=
sys_command_cd_play
(
dev
->
di
.
unitnum
,
toc
.
toc
[
i
].
address
,
toc
.
toc
[
i
+
io_length
].
address
,
0
);
break
;
break
;
}
}
}
}
...
...
src/tools/config.log
View file @
8f059ce4
...
@@ -445,7 +445,7 @@ configure:4344: $? = 0
...
@@ -445,7 +445,7 @@ configure:4344: $? = 0
configure:4344: result: yes
configure:4344: result: yes
configure:4350: checking for _doprnt
configure:4350: checking for _doprnt
configure:4350: gcc -o conftest -g -O2 -Wall -W -Wno-unused conftest.c >&5
configure:4350: gcc -o conftest -g -O2 -Wall -W -Wno-unused conftest.c >&5
/tmp/cc
g6gkCX
.o: In function `main':
/tmp/cc
a25XDN
.o: In function `main':
/home/gnostic/puaex/src/tools/conftest.c:67: undefined reference to `_doprnt'
/home/gnostic/puaex/src/tools/conftest.c:67: undefined reference to `_doprnt'
collect2: ld returned 1 exit status
collect2: ld returned 1 exit status
configure:4350: $? = 1
configure:4350: $? = 1
...
@@ -533,7 +533,7 @@ configure:4364: $? = 0
...
@@ -533,7 +533,7 @@ configure:4364: $? = 0
configure:4364: result: yes
configure:4364: result: yes
configure:4364: checking for strcmpi
configure:4364: checking for strcmpi
configure:4364: gcc -o conftest -g -O2 -Wall -W -Wno-unused conftest.c >&5
configure:4364: gcc -o conftest -g -O2 -Wall -W -Wno-unused conftest.c >&5
/tmp/cc
yGlF54
.o: In function `main':
/tmp/cc
fgVok2
.o: In function `main':
/home/gnostic/puaex/src/tools/conftest.c:69: undefined reference to `strcmpi'
/home/gnostic/puaex/src/tools/conftest.c:69: undefined reference to `strcmpi'
collect2: ld returned 1 exit status
collect2: ld returned 1 exit status
configure:4364: $? = 1
configure:4364: $? = 1
...
@@ -613,7 +613,7 @@ configure: failed program was:
...
@@ -613,7 +613,7 @@ configure: failed program was:
configure:4364: result: no
configure:4364: result: no
configure:4364: checking for stricmp
configure:4364: checking for stricmp
configure:4364: gcc -o conftest -g -O2 -Wall -W -Wno-unused conftest.c >&5
configure:4364: gcc -o conftest -g -O2 -Wall -W -Wno-unused conftest.c >&5
/tmp/cc
t8UV89
.o: In function `main':
/tmp/cc
Y0iee7
.o: In function `main':
/home/gnostic/puaex/src/tools/conftest.c:69: undefined reference to `stricmp'
/home/gnostic/puaex/src/tools/conftest.c:69: undefined reference to `stricmp'
collect2: ld returned 1 exit status
collect2: ld returned 1 exit status
configure:4364: $? = 1
configure:4364: $? = 1
...
...
src/zfile.c
View file @
8f059ce4
...
@@ -1551,7 +1551,7 @@ int zfile_zopen (const TCHAR *name, zfile_callback zc, void *user)
...
@@ -1551,7 +1551,7 @@ int zfile_zopen (const TCHAR *name, zfile_callback zc, void *user)
TCHAR
path
[
MAX_DPATH
];
TCHAR
path
[
MAX_DPATH
];
manglefilename
(
path
,
name
);
manglefilename
(
path
,
name
);
l
=
zfile_fopen_2
(
path
,
L
"rb"
,
ZFD_NORMAL
);
l
=
zfile_fopen_2
(
path
,
"rb"
,
ZFD_NORMAL
);
if
(
!
l
)
if
(
!
l
)
return
0
;
return
0
;
ztype
=
iszip
(
l
);
ztype
=
iszip
(
l
);
...
@@ -1632,7 +1632,7 @@ static struct zfile *zfile_fopen_internet (const TCHAR *name, const TCHAR *mode,
...
@@ -1632,7 +1632,7 @@ static struct zfile *zfile_fopen_internet (const TCHAR *name, const TCHAR *mode,
if
(
!
hi
)
{
if
(
!
hi
)
{
hi
=
InternetOpen
(
WINUAEAPPNAME
,
INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY
,
NULL
,
NULL
,
0
);
hi
=
InternetOpen
(
WINUAEAPPNAME
,
INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY
,
NULL
,
NULL
,
0
);
if
(
hi
==
NULL
)
{
if
(
hi
==
NULL
)
{
write_log
(
L
"InternetOpen() failed, %d
\n
"
,
GetLastError
());
write_log
(
"InternetOpen() failed, %d
\n
"
,
GetLastError
());
return
NULL
;
return
NULL
;
}
}
}
}
...
@@ -1641,7 +1641,7 @@ static struct zfile *zfile_fopen_internet (const TCHAR *name, const TCHAR *mode,
...
@@ -1641,7 +1641,7 @@ static struct zfile *zfile_fopen_internet (const TCHAR *name, const TCHAR *mode,
DWORD
err
=
GetLastError
();
DWORD
err
=
GetLastError
();
if
(
err
==
ERROR_INTERNET_EXTENDED_ERROR
)
if
(
err
==
ERROR_INTERNET_EXTENDED_ERROR
)
InternetGetLastResponseInfo
(
&
ierr
,
tmp
,
&
outbuf
);
InternetGetLastResponseInfo
(
&
ierr
,
tmp
,
&
outbuf
);
write_log
(
L
"InternetOpenUrl(%s) failed %d (%d,%s)
\n
"
,
name
,
err
,
ierr
,
tmp
);
write_log
(
"InternetOpenUrl(%s) failed %d (%d,%s)
\n
"
,
name
,
err
,
ierr
,
tmp
);
goto
end
;
goto
end
;
}
}
...
@@ -1651,11 +1651,11 @@ static struct zfile *zfile_fopen_internet (const TCHAR *name, const TCHAR *mode,
...
@@ -1651,11 +1651,11 @@ static struct zfile *zfile_fopen_internet (const TCHAR *name, const TCHAR *mode,
DWORD
size
=
sizeof
statuscode
;
DWORD
size
=
sizeof
statuscode
;
if
(
!
HttpQueryInfo
(
i
,
HTTP_QUERY_STATUS_CODE
|
HTTP_QUERY_FLAG_NUMBER
,
&
statuscode
,
&
size
,
&
hindex
))
{
if
(
!
HttpQueryInfo
(
i
,
HTTP_QUERY_STATUS_CODE
|
HTTP_QUERY_FLAG_NUMBER
,
&
statuscode
,
&
size
,
&
hindex
))
{
DWORD
err
=
GetLastError
();
DWORD
err
=
GetLastError
();
write_log
(
L
"HttpQueryInfo(%s) failed %d
\n
"
,
name
,
err
);
write_log
(
"HttpQueryInfo(%s) failed %d
\n
"
,
name
,
err
);
goto
end
;
goto
end
;
}
}
if
(
statuscode
!=
200
)
{
if
(
statuscode
!=
200
)
{
write_log
(
L
"HttpQueryInfo(%s)=%d
\n
"
,
name
,
statuscode
);
write_log
(
"HttpQueryInfo(%s)=%d
\n
"
,
name
,
statuscode
);
goto
end
;
goto
end
;
}
}
}
}
...
@@ -1672,7 +1672,7 @@ static struct zfile *zfile_fopen_internet (const TCHAR *name, const TCHAR *mode,
...
@@ -1672,7 +1672,7 @@ static struct zfile *zfile_fopen_internet (const TCHAR *name, const TCHAR *mode,
DWORD
err
=
GetLastError
();
DWORD
err
=
GetLastError
();
if
(
err
==
ERROR_INTERNET_EXTENDED_ERROR
)
if
(
err
==
ERROR_INTERNET_EXTENDED_ERROR
)
InternetGetLastResponseInfo
(
&
ierr
,
tmp
,
&
outbuf
);
InternetGetLastResponseInfo
(
&
ierr
,
tmp
,
&
outbuf
);
write_log
(
L
"InternetReadFile(%s) failed %d (%d,%s)
\n
"
,
name
,
err
,
ierr
,
tmp
);
write_log
(
"InternetReadFile(%s) failed %d (%d,%s)
\n
"
,
name
,
err
,
ierr
,
tmp
);
break
;
break
;
}
}
if
(
didread
==
0
)
if
(
didread
==
0
)
...
@@ -1751,9 +1751,9 @@ static struct zfile *zfile_fopenx2 (const TCHAR *name, const TCHAR *mode, int ma
...
@@ -1751,9 +1751,9 @@ static struct zfile *zfile_fopenx2 (const TCHAR *name, const TCHAR *mode, int ma
static
struct
zfile
*
zfile_fopenx
(
const
TCHAR
*
name
,
const
TCHAR
*
mode
,
int
mask
,
int
index
)
static
struct
zfile
*
zfile_fopenx
(
const
TCHAR
*
name
,
const
TCHAR
*
mode
,
int
mask
,
int
index
)
{
{
struct
zfile
*
zf
;
struct
zfile
*
zf
;
//write_log (
L
"zfile_fopen('%s','%s',%08x,%d)\n", name, mode, mask, index);
//write_log ("zfile_fopen('%s','%s',%08x,%d)\n", name, mode, mask, index);
zf
=
zfile_fopenx2
(
name
,
mode
,
mask
,
index
);
zf
=
zfile_fopenx2
(
name
,
mode
,
mask
,
index
);
//write_log (
L
"=%p\n", zf);
//write_log ("=%p\n", zf);
return
zf
;
return
zf
;
}
}
...
@@ -2700,6 +2700,37 @@ struct znode *zvolume_adddir_abs (struct zvolume *zv, struct zarchive_info *zai)
...
@@ -2700,6 +2700,37 @@ struct znode *zvolume_adddir_abs (struct zvolume *zv, struct zarchive_info *zai)
return
znode_adddir
(
zn2
,
p
,
zai
);
return
znode_adddir
(
zn2
,
p
,
zai
);
}
}
struct
znode
*
zvolume_addfile_abs
(
struct
zvolume
*
zv
,
struct
zarchive_info
*
zai
)
{
struct
znode
*
zn
,
*
zn2
;
int
i
;
TCHAR
*
path
=
my_strdup
(
zai
->
name
);
TCHAR
*
p
,
*
p2
;
zn2
=
&
zv
->
root
;
p
=
p2
=
path
;
for
(
i
=
0
;
path
[
i
];
i
++
)
{
if
(
path
[
i
]
==
'/'
||
path
[
i
]
==
'\\'
)
{
path
[
i
]
=
0
;
zn2
=
znode_adddir
(
zn2
,
p
,
zai
);
path
[
i
]
=
FSDB_DIR_SEPARATOR
;
p
=
p2
=
&
path
[
i
+
1
];
}
}
if
(
p2
)
{
zn
=
znode_alloc_child
(
zn2
,
p2
);
zn
->
size
=
zai
->
size
;
zn
->
type
=
ZNODE_FILE
;
zn
->
mtime
=
zai
->
t
;
if
(
zai
->
comment
)
zn
->
comment
=
my_strdup
(
zai
->
comment
);
zn
->
flags
=
zai
->
flags
;
addvolumesize
(
zn
->
volume
,
zai
->
size
);
}
xfree
(
path
);
return
zn
;
}
void
zfile_fclose_archive
(
struct
zvolume
*
zv
)
void
zfile_fclose_archive
(
struct
zvolume
*
zv
)
{
{
struct
znode
*
zn
;
struct
znode
*
zn
;
...
@@ -2737,6 +2768,17 @@ void zfile_fclose_archive (struct zvolume *zv)
...
@@ -2737,6 +2768,17 @@ void zfile_fclose_archive (struct zvolume *zv)
xfree
(
zv
);
xfree
(
zv
);
}
}
struct
zdirectory
{
TCHAR
*
parentpath
;
struct
znode
*
first
;
struct
znode
*
n
;
bool
doclose
;
struct
zvolume
*
zv
;
int
cnt
;
int
offset
;
TCHAR
**
filenames
;
};
#ifdef _CONSOLE
#ifdef _CONSOLE
static
TCHAR
*
zerror
;
static
TCHAR
*
zerror
;
#define WRITE_LOG_BUF_SIZE 4096
#define WRITE_LOG_BUF_SIZE 4096
...
...
src/zfile_archive.c
View file @
8f059ce4
...
@@ -17,10 +17,10 @@
...
@@ -17,10 +17,10 @@
#include "options.h"
#include "options.h"
#include "zfile.h"
#include "zfile.h"
#include "archivers/zip/unzip.h"
#include "archivers/zip/unzip.h"
#include "archivers/dms/pfile.h"
#include "crc32.h"
#include "crc32.h"
#include "zarchive.h"
#include "zarchive.h"
#include "disk.h"
#include "disk.h"
#include "fsdb.h"
#include <zlib.h>
#include <zlib.h>
...
@@ -42,8 +42,8 @@ static time_t fromdostime (uae_u32 dd)
...
@@ -42,8 +42,8 @@ static time_t fromdostime (uae_u32 dd)
tm
.
tm_mon
=
((
dd
>>
21
)
&
0x0f
)
-
1
;
tm
.
tm_mon
=
((
dd
>>
21
)
&
0x0f
)
-
1
;
tm
.
tm_mday
=
(
dd
>>
16
)
&
0x1f
;
tm
.
tm_mday
=
(
dd
>>
16
)
&
0x1f
;
t
=
mktime
(
&
tm
);
t
=
mktime
(
&
tm
);
_
tzset
();
tzset
();
t
-=
_
timezone
;
t
-=
timezone
;
return
t
;
return
t
;
}
}
...
@@ -56,18 +56,18 @@ static struct zvolume *getzvolume (struct znode *parent, struct zfile *zf, unsig
...
@@ -56,18 +56,18 @@ static struct zvolume *getzvolume (struct znode *parent, struct zfile *zf, unsig
case
ArchiveFormatZIP
:
case
ArchiveFormatZIP
:
zv
=
archive_directory_zip
(
zf
);
zv
=
archive_directory_zip
(
zf
);
break
;
break
;
case
ArchiveFormat7Zip
:
//
case ArchiveFormat7Zip:
zv
=
archive_directory_7z
(
zf
);
//
zv = archive_directory_7z (zf);
break
;
//
break;
case
ArchiveFormatRAR
:
//
case ArchiveFormatRAR:
zv
=
archive_directory_rar
(
zf
);
//
zv = archive_directory_rar (zf);
break
;
//
break;
case
ArchiveFormatLHA
:
//
case ArchiveFormatLHA:
zv
=
archive_directory_lha
(
zf
);
//
zv = archive_directory_lha (zf);
break
;
//
break;
case
ArchiveFormatLZX
:
//
case ArchiveFormatLZX:
zv
=
archive_directory_lzx
(
zf
);
//
zv = archive_directory_lzx (zf);
break
;
//
break;
case
ArchiveFormatPLAIN
:
case
ArchiveFormatPLAIN
:
zv
=
archive_directory_plain
(
zf
);
zv
=
archive_directory_plain
(
zf
);
break
;
break
;
...
@@ -84,8 +84,8 @@ static struct zvolume *getzvolume (struct znode *parent, struct zfile *zf, unsig
...
@@ -84,8 +84,8 @@ static struct zvolume *getzvolume (struct znode *parent, struct zfile *zf, unsig
zv
=
archive_directory_fat
(
zf
);
zv
=
archive_directory_fat
(
zf
);
break
;
break
;
}
}
if
(
!
zv
)
//
if (!zv)
zv
=
archive_directory_arcacc
(
zf
,
id
);
//
zv = archive_directory_arcacc (zf, id);
return
zv
;
return
zv
;
}
}
...
@@ -251,7 +251,7 @@ struct zvolume *archive_directory_tar (struct zfile *z)
...
@@ -251,7 +251,7 @@ struct zvolume *archive_directory_tar (struct zfile *z)
struct
zvolume
*
zv
;
struct
zvolume
*
zv
;
struct
znode
*
zn
;
struct
znode
*
zn
;
_
tzset
();
tzset
();
zv
=
zvolume_alloc
(
z
,
ArchiveFormatTAR
,
NULL
,
NULL
);
zv
=
zvolume_alloc
(
z
,
ArchiveFormatTAR
,
NULL
,
NULL
);
for
(;;)
{
for
(;;)
{
uae_u8
block
[
512
];
uae_u8
block
[
512
];
...
@@ -280,15 +280,15 @@ struct zvolume *archive_directory_tar (struct zfile *z)
...
@@ -280,15 +280,15 @@ struct zvolume *archive_directory_tar (struct zfile *z)
if
(
ustar
&&
(
block
[
256
]
!=
0
&&
block
[
256
]
!=
'0'
))
if
(
ustar
&&
(
block
[
256
]
!=
0
&&
block
[
256
]
!=
'0'
))
valid
=
0
;
valid
=
0
;
size
=
_strtoui64
((
char
*
)
block
+
124
,
NULL
,
8
);
size
=
strtoul
((
char
*
)
block
+
124
,
NULL
,
8
);
if
(
valid
)
{
if
(
valid
)
{
memset
(
&
zai
,
0
,
sizeof
zai
);
memset
(
&
zai
,
0
,
sizeof
zai
);
zai
.
name
=
au
(
name
);
zai
.
name
=
my_strdup
(
name
);
zai
.
size
=
size
;
zai
.
size
=
size
;
zai
.
t
=
_strtoui64
((
char
*
)
block
+
136
,
NULL
,
8
);
zai
.
t
=
strtoul
((
char
*
)
block
+
136
,
NULL
,
8
);
zai
.
t
+=
_
timezone
;
zai
.
t
+=
timezone
;
if
(
_
daylight
)
if
(
daylight
)
zai
.
t
-=
1
*
60
*
60
;
zai
.
t
-=
1
*
60
*
60
;
if
(
zai
.
name
[
_tcslen
(
zai
.
name
)
-
1
]
==
'/'
)
{
if
(
zai
.
name
[
_tcslen
(
zai
.
name
)
-
1
]
==
'/'
)
{
zn
=
zvolume_adddir_abs
(
zv
,
&
zai
);
zn
=
zvolume_adddir_abs
(
zv
,
&
zai
);
...
@@ -307,14 +307,7 @@ struct zvolume *archive_directory_tar (struct zfile *z)
...
@@ -307,14 +307,7 @@ struct zvolume *archive_directory_tar (struct zfile *z)
struct
zfile
*
archive_access_tar
(
struct
znode
*
zn
)
struct
zfile
*
archive_access_tar
(
struct
znode
*
zn
)
{
{
#if 0
struct zfile *zf = zfile_fopen_empty (zn->volume->archive, zn->fullname, zn->size);
zfile_fseek (zn->volume->archive, zn->offset, SEEK_SET);
zfile_fwrite (zf->data, zn->size, 1, zn->volume->archive);
return zf;
#else
return
zfile_fopen_parent
(
zn
->
volume
->
archive
,
zn
->
fullname
,
zn
->
offset
,
zn
->
size
);
return
zfile_fopen_parent
(
zn
->
volume
->
archive
,
zn
->
fullname
,
zn
->
offset
,
zn
->
size
);
#endif
}
}
/* ZIP */
/* ZIP */
...
@@ -347,7 +340,7 @@ struct zvolume *archive_directory_zip (struct zfile *z)
...
@@ -347,7 +340,7 @@ struct zvolume *archive_directory_zip (struct zfile *z)
err
=
unzGetCurrentFileInfo
(
uz
,
&
file_info
,
filename_inzip2
,
sizeof
(
filename_inzip2
),
NULL
,
0
,
NULL
,
0
);
err
=
unzGetCurrentFileInfo
(
uz
,
&
file_info
,
filename_inzip2
,
sizeof
(
filename_inzip2
),
NULL
,
0
,
NULL
,
0
);
if
(
err
!=
UNZ_OK
)
if
(
err
!=
UNZ_OK
)
return
0
;
return
0
;
filename_inzip
=
au
(
filename_inzip2
);
filename_inzip
=
my_strdup
(
filename_inzip2
);
dd
=
file_info
.
dosDate
;
dd
=
file_info
.
dosDate
;
t
=
fromdostime
(
dd
);
t
=
fromdostime
(
dd
);
memset
(
&
zai
,
0
,
sizeof
zai
);
memset
(
&
zai
,
0
,
sizeof
zai
);
...
@@ -447,7 +440,7 @@ error:
...
@@ -447,7 +440,7 @@ error:
return
NULL
;
return
NULL
;
}
}
st
atic
st
ruct
zfile
*
archive_access_zip
(
struct
znode
*
zn
,
int
flags
)
struct
zfile
*
archive_access_zip
(
struct
znode
*
zn
,
int
flags
)
{
{
return
archive_do_zip
(
zn
,
NULL
,
flags
);
return
archive_do_zip
(
zn
,
NULL
,
flags
);
}
}
...
@@ -480,52 +473,6 @@ struct aaFileInArchiveInfo {
...
@@ -480,52 +473,6 @@ struct aaFileInArchiveInfo {
char
path
[
FileInArchiveInfoStringSize
];
char
path
[
FileInArchiveInfoStringSize
];
};
};
typedef
HRESULT
(
__stdcall
*
aaReadCallback
)(
int
StreamID
,
uae_u64
offset
,
uae_u32
count
,
void
*
buf
,
uae_u32
*
processedSize
);
typedef
HRESULT
(
__stdcall
*
aaWriteCallback
)(
int
StreamID
,
uae_u64
offset
,
uae_u32
count
,
const
void
*
buf
,
uae_u32
*
processedSize
);
typedef
aaHandle
(
__stdcall
*
aapOpenArchive
)(
aaReadCallback
function
,
int
StreamID
,
uae_u64
FileSize
,
int
ArchiveType
,
int
*
result
,
TCHAR
*
password
);
typedef
int
(
__stdcall
*
aapGetFileCount
)(
aaHandle
ArchiveHandle
);
typedef
int
(
__stdcall
*
aapGetFileInfo
)(
aaHandle
ArchiveHandle
,
int
FileNum
,
struct
aaFileInArchiveInfo
*
FileInfo
);
typedef
int
(
__stdcall
*
aapExtract
)(
aaHandle
ArchiveHandle
,
int
FileNum
,
int
StreamID
,
aaWriteCallback
WriteFunc
,
uae_u64
*
written
);
typedef
int
(
__stdcall
*
aapCloseArchive
)(
aaHandle
ArchiveHandle
);
static
aapOpenArchive
aaOpenArchive
;
static
aapGetFileCount
aaGetFileCount
;
static
aapGetFileInfo
aaGetFileInfo
;
static
aapExtract
aaExtract
;
static
aapCloseArchive
aaCloseArchive
;
#ifdef _WIN32
static
HMODULE
arcacc_mod
;
static
void
arcacc_free
(
void
)
{
if
(
arcacc_mod
)
FreeLibrary
(
arcacc_mod
);
arcacc_mod
=
NULL
;
}
static
int
arcacc_init
(
struct
zfile
*
zf
)
{
if
(
arcacc_mod
)
return
1
;
arcacc_mod
=
WIN32_LoadLibrary
(
L"archiveaccess.dll"
);
if
(
!
arcacc_mod
)
{
write_log
(
L"failed to open archiveaccess.dll ('%s')
\n
"
,
zfile_getname
(
zf
));
return
0
;
}
aaOpenArchive
=
(
aapOpenArchive
)
GetProcAddress
(
arcacc_mod
,
"aaOpenArchive"
);
aaGetFileCount
=
(
aapGetFileCount
)
GetProcAddress
(
arcacc_mod
,
"aaGetFileCount"
);
aaGetFileInfo
=
(
aapGetFileInfo
)
GetProcAddress
(
arcacc_mod
,
"aaGetFileInfo"
);
aaExtract
=
(
aapExtract
)
GetProcAddress
(
arcacc_mod
,
"aaExtract"
);
aaCloseArchive
=
(
aapCloseArchive
)
GetProcAddress
(
arcacc_mod
,
"aaCloseArchive"
);
if
(
!
aaOpenArchive
||
!
aaGetFileCount
||
!
aaGetFileInfo
||
!
aaExtract
||
!
aaCloseArchive
)
{
write_log
(
L"Missing functions in archiveaccess.dll. Old version?
\n
"
);
arcacc_free
();
return
0
;
}
return
1
;
}
#endif
#define ARCACC_STACKSIZE 10
#define ARCACC_STACKSIZE 10
static
struct
zfile
*
arcacc_stack
[
ARCACC_STACKSIZE
];
static
struct
zfile
*
arcacc_stack
[
ARCACC_STACKSIZE
];
...
@@ -595,7 +542,7 @@ struct zvolume *archive_directory_arcacc (struct zfile *z, unsigned int id)
...
@@ -595,7 +542,7 @@ struct zvolume *archive_directory_arcacc (struct zfile *z, unsigned int id)
if
(
fi
.
IsDir
)
if
(
fi
.
IsDir
)
continue
;
continue
;
name
=
au
(
fi
.
path
);
name
=
my_strdup
(
fi
.
path
);
memset
(
&
zai
,
0
,
sizeof
zai
);
memset
(
&
zai
,
0
,
sizeof
zai
);
zai
.
name
=
name
;
zai
.
name
=
name
;
zai
.
flags
=
-
1
;
zai
.
flags
=
-
1
;
...
@@ -700,7 +647,7 @@ struct zvolume *archive_directory_plain (struct zfile *z)
...
@@ -700,7 +647,7 @@ struct zvolume *archive_directory_plain (struct zfile *z)
char
*
an
=
ua
(
zai
.
name
);
char
*
an
=
ua
(
zai
.
name
);
char
*
data
=
xmalloc
(
char
,
1
+
strlen
(
an
)
+
1
+
1
+
1
);
char
*
data
=
xmalloc
(
char
,
1
+
strlen
(
an
)
+
1
+
1
+
1
);
sprintf
(
data
,
"
\"
%s
\"\n
"
,
an
);
sprintf
(
data
,
"
\"
%s
\"\n
"
,
an
);
zn
=
addfile
(
zv
,
z
,
L
"s/startup-sequence"
,
(
uae_u8
*
)
data
,
strlen
(
data
));
zn
=
addfile
(
zv
,
z
,
"s/startup-sequence"
,
(
uae_u8
*
)
data
,
strlen
(
data
));
xfree
(
data
);
xfree
(
data
);
xfree
(
an
);
xfree
(
an
);
}
}
...
@@ -733,14 +680,14 @@ struct zvolume *archive_directory_plain (struct zfile *z)
...
@@ -733,14 +680,14 @@ struct zvolume *archive_directory_plain (struct zfile *z)
}
}
return
zv
;
return
zv
;
}
}
st
atic
st
ruct
zfile
*
archive_access_plain
(
struct
znode
*
zn
)
struct
zfile
*
archive_access_plain
(
struct
znode
*
zn
)
{
{
struct
zfile
*
z
;
struct
zfile
*
z
;
if
(
zn
->
offset
)
{
if
(
zn
->
offset
)
{
struct
zfile
*
zf
;
struct
zfile
*
zf
;
z
=
zfile_fopen_empty
(
zn
->
volume
->
archive
,
zn
->
fullname
,
zn
->
size
);
z
=
zfile_fopen_empty
(
zn
->
volume
->
archive
,
zn
->
fullname
,
zn
->
size
);
zf
=
zfile_fopen2
(
zfile_getname
(
zn
->
volume
->
archive
),
L
"rb"
,
zn
->
volume
->
archive
->
zfdmask
&
~
ZFD_ADF
,
zn
->
offset
-
1
);
zf
=
zfile_fopen2
(
zfile_getname
(
zn
->
volume
->
archive
),
"rb"
,
zn
->
volume
->
archive
->
zfdmask
&
~
ZFD_ADF
,
zn
->
offset
-
1
);
if
(
zf
)
{
if
(
zf
)
{
zfile_fread
(
z
->
data
,
zn
->
size
,
1
,
zf
);
zfile_fread
(
z
->
data
,
zn
->
size
,
1
,
zf
);
zfile_fclose
(
zf
);
zfile_fclose
(
zf
);
...
@@ -792,7 +739,7 @@ static TCHAR *getBSTR (uae_u8 *bstr)
...
@@ -792,7 +739,7 @@ static TCHAR *getBSTR (uae_u8 *bstr)
for
(
i
=
0
;
i
<
n
;
i
++
)
for
(
i
=
0
;
i
<
n
;
i
++
)
buf
[
i
]
=
*
bstr
++
;
buf
[
i
]
=
*
bstr
++
;
buf
[
i
]
=
0
;
buf
[
i
]
=
0
;
return
au
(
buf
);
return
my_strdup
(
buf
);
}
}
static
uae_u32
gl
(
struct
adfhandle
*
adf
,
int
off
)
static
uae_u32
gl
(
struct
adfhandle
*
adf
,
int
off
)
...
@@ -925,7 +872,7 @@ static void recursesfs (struct znode *zn, int root, TCHAR *name, int sfs2)
...
@@ -925,7 +872,7 @@ static void recursesfs (struct znode *zn, int root, TCHAR *name, int sfs2)
memset
(
&
zai
,
0
,
sizeof
zai
);
memset
(
&
zai
,
0
,
sizeof
zai
);
zai
.
flags
=
glx
(
p
+
8
)
^
0x0f
;
zai
.
flags
=
glx
(
p
+
8
)
^
0x0f
;
s
=
p
+
(
sfs2
?
27
:
25
);
s
=
p
+
(
sfs2
?
27
:
25
);
fname
=
au
((
char
*
)
s
);
fname
=
my_strdup
((
char
*
)
s
);
i
=
0
;
i
=
0
;
while
(
*
s
)
{
while
(
*
s
)
{
s
++
;
s
++
;
...
@@ -934,7 +881,7 @@ static void recursesfs (struct znode *zn, int root, TCHAR *name, int sfs2)
...
@@ -934,7 +881,7 @@ static void recursesfs (struct znode *zn, int root, TCHAR *name, int sfs2)
s
++
;
s
++
;
i
++
;
i
++
;
if
(
*
s
)
if
(
*
s
)
zai
.
comment
=
au
((
char
*
)
s
);
zai
.
comment
=
my_strdup
((
char
*
)
s
);
while
(
*
s
)
{
while
(
*
s
)
{
s
++
;
s
++
;
i
++
;
i
++
;
...
@@ -1184,7 +1131,7 @@ static int sfsfindblock (struct adfhandle *adf, int btree, int theblock, struct
...
@@ -1184,7 +1131,7 @@ static int sfsfindblock (struct adfhandle *adf, int btree, int theblock, struct
}
}
st
atic
st
ruct
zfile
*
archive_access_adf
(
struct
znode
*
zn
)
struct
zfile
*
archive_access_adf
(
struct
znode
*
zn
)
{
{
struct
zfile
*
z
=
NULL
;
struct
zfile
*
z
=
NULL
;
int
root
,
ffs
;
int
root
,
ffs
;
...
@@ -1260,7 +1207,7 @@ static struct zfile *archive_access_adf (struct znode *zn)
...
@@ -1260,7 +1207,7 @@ static struct zfile *archive_access_adf (struct znode *zn)
for
(
i
=
0
;
i
<
sfsblockcnt
;
i
++
)
for
(
i
=
0
;
i
<
sfsblockcnt
;
i
++
)
bsize
+=
sfsblocks
[
i
].
length
*
adf
->
blocksize
;
bsize
+=
sfsblocks
[
i
].
length
*
adf
->
blocksize
;
if
(
bsize
<
size
)
if
(
bsize
<
size
)
write_log
(
L
"SFS extracting error, %s size mismatch %d<%d
\n
"
,
z
->
name
,
bsize
,
size
);
write_log
(
"SFS extracting error, %s size mismatch %d<%d
\n
"
,
z
->
name
,
bsize
,
size
);
dst
=
z
->
data
;
dst
=
z
->
data
;
block
=
zn
->
offset
;
block
=
zn
->
offset
;
...
@@ -1310,7 +1257,7 @@ static TCHAR *tochar (uae_u8 *s, int len)
...
@@ -1310,7 +1257,7 @@ static TCHAR *tochar (uae_u8 *s, int len)
}
}
tmp
[
j
]
=
0
;
tmp
[
j
]
=
0
;
}
}
return
au
(
tmp
);
return
my_strdup
(
tmp
);
}
}
struct
zvolume
*
archive_directory_rdb
(
struct
zfile
*
z
)
struct
zvolume
*
archive_directory_rdb
(
struct
zfile
*
z
)
...
@@ -1363,15 +1310,15 @@ struct zvolume *archive_directory_rdb (struct zfile *z)
...
@@ -1363,15 +1310,15 @@ struct zvolume *archive_directory_rdb (struct zfile *z)
dos
=
tochar
(
buf
+
192
,
4
);
dos
=
tochar
(
buf
+
192
,
4
);
if
(
!
memcmp
(
dos
,
L
"DOS"
,
3
))
if
(
!
memcmp
(
dos
,
"DOS"
,
3
))
rootblock
=
((
size
/
blocksize
)
-
1
+
2
)
/
2
;
rootblock
=
((
size
/
blocksize
)
-
1
+
2
)
/
2
;
else
else
rootblock
=
0
;
rootblock
=
0
;
devname
=
getBSTR
(
buf
+
36
);
devname
=
getBSTR
(
buf
+
36
);
_stprintf
(
tmp
,
L
"%s.hdf"
,
devname
);
_stprintf
(
tmp
,
"%s.hdf"
,
devname
);
memset
(
&
zai
,
0
,
sizeof
zai
);
memset
(
&
zai
,
0
,
sizeof
zai
);
_stprintf
(
comment
,
L
"FS=%s LO=%d HI=%d HEADS=%d SPT=%d RES=%d BLOCK=%d ROOT=%d"
,
_stprintf
(
comment
,
"FS=%s LO=%d HI=%d HEADS=%d SPT=%d RES=%d BLOCK=%d ROOT=%d"
,
dos
,
lowcyl
,
highcyl
,
surf
,
spt
,
reserved
,
blocksize
,
rootblock
);
dos
,
lowcyl
,
highcyl
,
surf
,
spt
,
reserved
,
blocksize
,
rootblock
);
zai
.
comment
=
comment
;
zai
.
comment
=
comment
;
xfree
(
dos
);
xfree
(
dos
);
...
@@ -1386,7 +1333,7 @@ struct zvolume *archive_directory_rdb (struct zfile *z)
...
@@ -1386,7 +1333,7 @@ struct zvolume *archive_directory_rdb (struct zfile *z)
zfile_fseek
(
z
,
0
,
SEEK_SET
);
zfile_fseek
(
z
,
0
,
SEEK_SET
);
p
=
buf
;
p
=
buf
;
zfile_fread
(
buf
,
1
,
512
,
z
);
zfile_fread
(
buf
,
1
,
512
,
z
);
zai
.
name
=
L
"rdb_dump.dat"
;
zai
.
name
=
"rdb_dump.dat"
;
bs
=
rl
(
p
+
16
);
bs
=
rl
(
p
+
16
);
zai
.
size
=
rl
(
p
+
140
)
*
bs
;
zai
.
size
=
rl
(
p
+
140
)
*
bs
;
zai
.
comment
=
NULL
;
zai
.
comment
=
NULL
;
...
@@ -1397,7 +1344,7 @@ struct zvolume *archive_directory_rdb (struct zfile *z)
...
@@ -1397,7 +1344,7 @@ struct zvolume *archive_directory_rdb (struct zfile *z)
return
zv
;
return
zv
;
}
}
st
atic
st
ruct
zfile
*
archive_access_rdb
(
struct
znode
*
zn
)
struct
zfile
*
archive_access_rdb
(
struct
znode
*
zn
)
{
{
struct
zfile
*
z
=
zn
->
volume
->
archive
;
struct
zfile
*
z
=
zn
->
volume
->
archive
;
struct
zfile
*
zf
;
struct
zfile
*
zf
;
...
@@ -1600,7 +1547,7 @@ static void fatdirectory (struct zfile *z, struct zvolume *zv, TCHAR *name, int
...
@@ -1600,7 +1547,7 @@ static void fatdirectory (struct zfile *z, struct zvolume *zv, TCHAR *name, int
}
}
fatname
[
cnt
]
=
0
;
fatname
[
cnt
]
=
0
;
fname
=
au
((
char
*
)
fatname
);
fname
=
my_strdup
((
char
*
)
fatname
);
name2
[
0
]
=
0
;
name2
[
0
]
=
0
;
if
(
name
[
0
])
{
if
(
name
[
0
])
{
TCHAR
sep
[]
=
{
FSDB_DIR_SEPARATOR
,
0
};
TCHAR
sep
[]
=
{
FSDB_DIR_SEPARATOR
,
0
};
...
@@ -1657,12 +1604,12 @@ struct zvolume *archive_directory_fat (struct zfile *z)
...
@@ -1657,12 +1604,12 @@ struct zvolume *archive_directory_fat (struct zfile *z)
dataregion
=
rootdir
+
rootentries
*
32
/
512
;
dataregion
=
rootdir
+
rootentries
*
32
/
512
;
zv
=
zvolume_alloc
(
z
,
ArchiveFormatFAT
,
NULL
,
NULL
);
zv
=
zvolume_alloc
(
z
,
ArchiveFormatFAT
,
NULL
,
NULL
);
fatdirectory
(
z
,
zv
,
L
""
,
rootdir
,
rootentries
,
sectorspercluster
,
reserved
,
dataregion
,
fatbits
);
fatdirectory
(
z
,
zv
,
""
,
rootdir
,
rootentries
,
sectorspercluster
,
reserved
,
dataregion
,
fatbits
);
zv
->
method
=
ArchiveFormatFAT
;
zv
->
method
=
ArchiveFormatFAT
;
return
zv
;
return
zv
;
}
}
st
atic
st
ruct
zfile
*
archive_access_fat
(
struct
znode
*
zn
)
struct
zfile
*
archive_access_fat
(
struct
znode
*
zn
)
{
{
uae_u8
buf
[
512
]
=
{
0
};
uae_u8
buf
[
512
]
=
{
0
};
int
fatbits
=
12
;
int
fatbits
=
12
;
...
@@ -1714,12 +1661,12 @@ void archive_access_close (void *handle, unsigned int id)
...
@@ -1714,12 +1661,12 @@ void archive_access_close (void *handle, unsigned int id)
case
ArchiveFormatZIP
:
case
ArchiveFormatZIP
:
archive_close_zip
(
handle
);
archive_close_zip
(
handle
);
break
;
break
;
case
ArchiveFormat7Zip
:
//
case ArchiveFormat7Zip:
archive_close_7z
(
handle
);
//
archive_close_7z (handle);
break
;
//
break;
case
ArchiveFormatRAR
:
//
case ArchiveFormatRAR:
archive_close_rar
(
handle
);
//
archive_close_rar (handle);
break
;
//
break;
case
ArchiveFormatLHA
:
case
ArchiveFormatLHA
:
break
;
break
;
case
ArchiveFormatADF
:
case
ArchiveFormatADF
:
...
@@ -1731,9 +1678,9 @@ void archive_access_close (void *handle, unsigned int id)
...
@@ -1731,9 +1678,9 @@ void archive_access_close (void *handle, unsigned int id)
}
}
}
}
st
atic
st
ruct
zfile
*
archive_access_dir
(
struct
znode
*
zn
)
struct
zfile
*
archive_access_dir
(
struct
znode
*
zn
)
{
{
return
zfile_fopen
(
zn
->
fullname
,
L
"rb"
,
0
);
return
zfile_fopen
(
zn
->
fullname
,
"rb"
,
0
);
}
}
...
@@ -1742,7 +1689,7 @@ struct zfile *archive_unpackzfile (struct zfile *zf)
...
@@ -1742,7 +1689,7 @@ struct zfile *archive_unpackzfile (struct zfile *zf)
struct
zfile
*
zout
=
NULL
;
struct
zfile
*
zout
=
NULL
;
if
(
!
zf
->
archiveparent
)
if
(
!
zf
->
archiveparent
)
return
NULL
;
return
NULL
;
unpack_log
(
L
"delayed unpack '%s'
\n
"
,
zf
->
name
);
unpack_log
(
"delayed unpack '%s'
\n
"
,
zf
->
name
);
zf
->
datasize
=
zf
->
size
;
zf
->
datasize
=
zf
->
size
;
switch
(
zf
->
archiveid
)
switch
(
zf
->
archiveid
)
{
{
...
@@ -1765,18 +1712,18 @@ struct zfile *archive_getzfile (struct znode *zn, unsigned int id, int flags)
...
@@ -1765,18 +1712,18 @@ struct zfile *archive_getzfile (struct znode *zn, unsigned int id, int flags)
case
ArchiveFormatZIP
:
case
ArchiveFormatZIP
:
zf
=
archive_access_zip
(
zn
,
flags
);
zf
=
archive_access_zip
(
zn
,
flags
);
break
;
break
;
case
ArchiveFormat7Zip
:
//
case ArchiveFormat7Zip:
zf
=
archive_access_7z
(
zn
);
//
zf = archive_access_7z (zn);
break
;
//
break;
case
ArchiveFormatRAR
:
//
case ArchiveFormatRAR:
zf
=
archive_access_rar
(
zn
);
//
zf = archive_access_rar (zn);
break
;
//
break;
case
ArchiveFormatLHA
:
//
case ArchiveFormatLHA:
zf
=
archive_access_lha
(
zn
);
//
zf = archive_access_lha (zn);
break
;
//
break;
case
ArchiveFormatLZX
:
//
case ArchiveFormatLZX:
zf
=
archive_access_lzx
(
zn
);
//
zf = archive_access_lzx (zn);
break
;
//
break;
case
ArchiveFormatPLAIN
:
case
ArchiveFormatPLAIN
:
zf
=
archive_access_plain
(
zn
);
zf
=
archive_access_plain
(
zn
);
break
;
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment