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
Hide 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,13 +1954,11 @@ STATIC_INLINE void do_color_changes (line_draw_func worker_border, line_draw_fun
...
@@ -1954,13 +1954,11 @@ 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
if
(
regno
>=
0
)
{
}
else
{
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
...
@@ -252,8 +252,8 @@ static void generate_header(void)
...
@@ -252,8 +252,8 @@ static void generate_header(void)
{
{
unsigned
int
i
;
unsigned
int
i
;
for
(
i
=
0
;
i
<
sizeof
(
blttbl
);
i
++
)
{
for
(
i
=
0
;
i
<
sizeof
(
blttbl
);
i
++
)
{
printf
(
"extern blitter_func blitdofast_%x;
\n
"
,
blttbl
[
i
]);
printf
(
"extern blitter_func blitdofast_%x;
\n
"
,
blttbl
[
i
]);
printf
(
"extern blitter_func blitdofast_desc_%x;
\n
"
,
blttbl
[
i
]);
printf
(
"extern blitter_func blitdofast_desc_%x;
\n
"
,
blttbl
[
i
]);
}
}
}
}
...
...
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.
*
*
* Copyright 1999 Patrick Ohly
* Copyright 1999 Patrick Ohly
*
*
* Uses the EXTER interrupt that is setup in filesys.c
* Uses the EXTER interrupt that is setup in filesys.c
* and needs thread support.
* and needs thread support.
*/
*/
#include "sysconfig.h"
#include "sysconfig.h"
#include "sysdeps.h"
#include "sysdeps.h"
...
@@ -31,7 +31,7 @@ static uae_sem_t n2asem;
...
@@ -31,7 +31,7 @@ static uae_sem_t n2asem;
void
native2amiga_install
(
void
)
void
native2amiga_install
(
void
)
{
{
init_comm_pipe
(
&
native2amiga_pending
,
100
,
2
);
init_comm_pipe
(
&
native2amiga_pending
,
100
,
2
);
uae_sem_init
(
&
n2asem
,
0
,
1
);
uae_sem_init
(
&
n2asem
,
0
,
1
);
}
}
void
native2amiga_reset
(
void
)
void
native2amiga_reset
(
void
)
...
@@ -58,50 +58,50 @@ int native2amiga_isfree (void)
...
@@ -58,50 +58,50 @@ int native2amiga_isfree (void)
void
uae_Cause
(
uaecptr
interrupt
)
void
uae_Cause
(
uaecptr
interrupt
)
{
{
uae_sem_wait
(
&
n2asem
);
uae_sem_wait
(
&
n2asem
);
write_comm_pipe_int
(
&
native2amiga_pending
,
3
,
0
);
write_comm_pipe_int
(
&
native2amiga_pending
,
3
,
0
);
write_comm_pipe_u32
(
&
native2amiga_pending
,
interrupt
,
1
);
write_comm_pipe_u32
(
&
native2amiga_pending
,
interrupt
,
1
);
do_uae_int_requested
();
do_uae_int_requested
();
uae_sem_post
(
&
n2asem
);
uae_sem_post
(
&
n2asem
);
}
}
void
uae_ReplyMsg
(
uaecptr
msg
)
void
uae_ReplyMsg
(
uaecptr
msg
)
{
{
uae_sem_wait
(
&
n2asem
);
uae_sem_wait
(
&
n2asem
);
write_comm_pipe_int
(
&
native2amiga_pending
,
2
,
0
);
write_comm_pipe_int
(
&
native2amiga_pending
,
2
,
0
);
write_comm_pipe_u32
(
&
native2amiga_pending
,
msg
,
1
);
write_comm_pipe_u32
(
&
native2amiga_pending
,
msg
,
1
);
do_uae_int_requested
();
do_uae_int_requested
();
uae_sem_post
(
&
n2asem
);
uae_sem_post
(
&
n2asem
);
}
}
void
uae_PutMsg
(
uaecptr
port
,
uaecptr
msg
)
void
uae_PutMsg
(
uaecptr
port
,
uaecptr
msg
)
{
{
uae_sem_wait
(
&
n2asem
);
uae_sem_wait
(
&
n2asem
);
write_comm_pipe_int
(
&
native2amiga_pending
,
1
,
0
);
write_comm_pipe_int
(
&
native2amiga_pending
,
1
,
0
);
write_comm_pipe_u32
(
&
native2amiga_pending
,
port
,
0
);
write_comm_pipe_u32
(
&
native2amiga_pending
,
port
,
0
);
write_comm_pipe_u32
(
&
native2amiga_pending
,
msg
,
1
);
write_comm_pipe_u32
(
&
native2amiga_pending
,
msg
,
1
);
do_uae_int_requested
();
do_uae_int_requested
();
uae_sem_post
(
&
n2asem
);
uae_sem_post
(
&
n2asem
);
}
}
void
uae_Signal
(
uaecptr
task
,
uae_u32
mask
)
void
uae_Signal
(
uaecptr
task
,
uae_u32
mask
)
{
{
uae_sem_wait
(
&
n2asem
);
uae_sem_wait
(
&
n2asem
);
write_comm_pipe_int
(
&
native2amiga_pending
,
0
,
0
);
write_comm_pipe_int
(
&
native2amiga_pending
,
0
,
0
);
write_comm_pipe_u32
(
&
native2amiga_pending
,
task
,
0
);
write_comm_pipe_u32
(
&
native2amiga_pending
,
task
,
0
);
write_comm_pipe_int
(
&
native2amiga_pending
,
mask
,
1
);
write_comm_pipe_int
(
&
native2amiga_pending
,
mask
,
1
);
do_uae_int_requested
();
do_uae_int_requested
();
uae_sem_post
(
&
n2asem
);
uae_sem_post
(
&
n2asem
);
}
}
void
uae_NotificationHack
(
uaecptr
port
,
uaecptr
nr
)
void
uae_NotificationHack
(
uaecptr
port
,
uaecptr
nr
)
{
{
uae_sem_wait
(
&
n2asem
);
uae_sem_wait
(
&
n2asem
);
write_comm_pipe_int
(
&
native2amiga_pending
,
4
,
0
);
write_comm_pipe_int
(
&
native2amiga_pending
,
4
,
0
);
write_comm_pipe_int
(
&
native2amiga_pending
,
port
,
0
);
write_comm_pipe_int
(
&
native2amiga_pending
,
port
,
0
);
write_comm_pipe_int
(
&
native2amiga_pending
,
nr
,
1
);
write_comm_pipe_int
(
&
native2amiga_pending
,
nr
,
1
);
do_uae_int_requested
();
do_uae_int_requested
();
uae_sem_post
(
&
n2asem
);
uae_sem_post
(
&
n2asem
);
}
}
#endif
#endif
...
...
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
...
@@ -3218,7 +3218,7 @@ void m68k_go (int may_quit)
...
@@ -3218,7 +3218,7 @@ void m68k_go (int may_quit)
#endif
#endif
set_x_funcs
();
set_x_funcs
();
#if defined(MMU) && defined(JIT)
#if defined(MMU) && defined(JIT)
if
(
mmu_enabled
&&
!
currprefs
.
cachesize
)
{
if
(
mmu_enabled
&&
!
currprefs
.
cachesize
)
{
run_func
=
m68k_run_mmu
;
run_func
=
m68k_run_mmu
;
}
else
{
}
else
{
#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.
*/
*/
...
@@ -44,10 +45,10 @@
...
@@ -44,10 +45,10 @@
#include "uae_endian.h"
#include "uae_endian.h"
#ifdef JIT
#ifdef JIT
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
...
@@ -82,10 +83,10 @@ struct picasso_vidbuf_description picasso_vidinfo;
...
@@ -82,10 +83,10 @@ struct picasso_vidbuf_description picasso_vidinfo;
/* have to fill this in, otherwise problems occur
/* have to fill this in, otherwise problems occur
* @@@ ??? what problems?
* @@@ ??? what problems?
*/
*/
struct
ScreenResolution
planar
=
{
320
,
240
};
struct
ScreenResolution
planar
=
{
320
,
240
};
struct
ScreenResolution
chunky
=
{
640
,
480
};
struct
ScreenResolution
chunky
=
{
640
,
480
};
struct
ScreenResolution
hicolour
=
{
640
,
480
};
struct
ScreenResolution
hicolour
=
{
640
,
480
};
struct
ScreenResolution
truecolour
=
{
640
,
480
};
struct
ScreenResolution
truecolour
=
{
640
,
480
};
struct
ScreenResolution
alphacolour
=
{
640
,
480
};
struct
ScreenResolution
alphacolour
=
{
640
,
480
};
uae_u16
picasso96_pixel_format
=
RGBFF_CHUNKY
;
uae_u16
picasso96_pixel_format
=
RGBFF_CHUNKY
;
...
@@ -112,35 +113,34 @@ static void DumpModeInfoStructure (uaecptr amigamodeinfoptr)
...
@@ -112,35 +113,34 @@ static void DumpModeInfoStructure (uaecptr amigamodeinfoptr)
write_log
(
" Node.ln_Succ = 0x%x
\n
"
,
get_long
(
amigamodeinfoptr
));
write_log
(
" Node.ln_Succ = 0x%x
\n
"
,
get_long
(
amigamodeinfoptr
));
write_log
(
" Node.ln_Pred = 0x%x
\n
"
,
get_long
(
amigamodeinfoptr
+
4
));
write_log
(
" Node.ln_Pred = 0x%x
\n
"
,
get_long
(
amigamodeinfoptr
+
4
));
write_log
(
" Node.ln_Type = 0x%x
\n
"
,
get_byte
(
amigamodeinfoptr
+
8
));
write_log
(
" Node.ln_Type = 0x%x
\n
"
,
get_byte
(
amigamodeinfoptr
+
8
));
write_log
(
" Node.ln_Pri = %d
\n
"
,
get_byte
(
amigamodeinfoptr
+
9
));
write_log
(
" Node.ln_Pri = %d
\n
"
,
get_byte
(
amigamodeinfoptr
+
9
));
/*write_log (" Node.ln_Name = %s\n", uaememptr->Node.ln_Name); */
/*write_log (" Node.ln_Name = %s\n", uaememptr->Node.ln_Name); */
write_log
(
" OpenCount = %d
\n
"
,
get_word
(
amigamodeinfoptr
+
PSSO_ModeInfo_OpenCount
));
write_log
(
" OpenCount = %d
\n
"
,
get_word
(
amigamodeinfoptr
+
PSSO_ModeInfo_OpenCount
));
write_log
(
" Active = %d
\n
"
,
get_byte
(
amigamodeinfoptr
+
PSSO_ModeInfo_Active
));
write_log
(
" Active = %d
\n
"
,
get_byte
(
amigamodeinfoptr
+
PSSO_ModeInfo_Active
));
write_log
(
" Width = %d
\n
"
,
get_word
(
amigamodeinfoptr
+
PSSO_ModeInfo_Width
));
write_log
(
" Width = %d
\n
"
,
get_word
(
amigamodeinfoptr
+
PSSO_ModeInfo_Width
));
write_log
(
" Height = %d
\n
"
,
get_word
(
amigamodeinfoptr
+
PSSO_ModeInfo_Height
));
write_log
(
" Height = %d
\n
"
,
get_word
(
amigamodeinfoptr
+
PSSO_ModeInfo_Height
));
write_log
(
" Depth = %d
\n
"
,
get_byte
(
amigamodeinfoptr
+
PSSO_ModeInfo_Depth
));
write_log
(
" Depth = %d
\n
"
,
get_byte
(
amigamodeinfoptr
+
PSSO_ModeInfo_Depth
));
write_log
(
" Flags = %d
\n
"
,
get_byte
(
amigamodeinfoptr
+
PSSO_ModeInfo_Flags
));
write_log
(
" Flags = %d
\n
"
,
get_byte
(
amigamodeinfoptr
+
PSSO_ModeInfo_Flags
));
write_log
(
" HorTotal = %d
\n
"
,
get_word
(
amigamodeinfoptr
+
PSSO_ModeInfo_HorTotal
));
write_log
(
" HorTotal = %d
\n
"
,
get_word
(
amigamodeinfoptr
+
PSSO_ModeInfo_HorTotal
));
write_log
(
" HorBlankSize = %d
\n
"
,
get_word
(
amigamodeinfoptr
+
PSSO_ModeInfo_HorBlankSize
));
write_log
(
" HorBlankSize = %d
\n
"
,
get_word
(
amigamodeinfoptr
+
PSSO_ModeInfo_HorBlankSize
));
write_log
(
" HorSyncStart = %d
\n
"
,
get_word
(
amigamodeinfoptr
+
PSSO_ModeInfo_HorSyncStart
));
write_log
(
" HorSyncStart = %d
\n
"
,
get_word
(
amigamodeinfoptr
+
PSSO_ModeInfo_HorSyncStart
));
write_log
(
" HorSyncSize = %d
\n
"
,
get_word
(
amigamodeinfoptr
+
PSSO_ModeInfo_HorSyncSize
));
write_log
(
" HorSyncSize = %d
\n
"
,
get_word
(
amigamodeinfoptr
+
PSSO_ModeInfo_HorSyncSize
));
write_log
(
" HorSyncSkew = %d
\n
"
,
get_byte
(
amigamodeinfoptr
+
PSSO_ModeInfo_HorSyncSkew
));
write_log
(
" HorSyncSkew = %d
\n
"
,
get_byte
(
amigamodeinfoptr
+
PSSO_ModeInfo_HorSyncSkew
));
write_log
(
" HorEnableSkew = %d
\n
"
,
get_byte
(
amigamodeinfoptr
+
PSSO_ModeInfo_HorEnableSkew
));
write_log
(
" HorEnableSkew = %d
\n
"
,
get_byte
(
amigamodeinfoptr
+
PSSO_ModeInfo_HorEnableSkew
));
write_log
(
" VerTotal = %d
\n
"
,
get_word
(
amigamodeinfoptr
+
PSSO_ModeInfo_VerTotal
));
write_log
(
" VerTotal = %d
\n
"
,
get_word
(
amigamodeinfoptr
+
PSSO_ModeInfo_VerTotal
));
write_log
(
" VerBlankSize = %d
\n
"
,
get_word
(
amigamodeinfoptr
+
PSSO_ModeInfo_VerBlankSize
));
write_log
(
" VerBlankSize = %d
\n
"
,
get_word
(
amigamodeinfoptr
+
PSSO_ModeInfo_VerBlankSize
));
write_log
(
" VerSyncStart = %d
\n
"
,
get_word
(
amigamodeinfoptr
+
PSSO_ModeInfo_VerSyncStart
));
write_log
(
" VerSyncStart = %d
\n
"
,
get_word
(
amigamodeinfoptr
+
PSSO_ModeInfo_VerSyncStart
));
write_log
(
" VerSyncSize = %d
\n
"
,
get_word
(
amigamodeinfoptr
+
PSSO_ModeInfo_VerSyncSize
));
write_log
(
" VerSyncSize = %d
\n
"
,
get_word
(
amigamodeinfoptr
+
PSSO_ModeInfo_VerSyncSize
));
write_log
(
" Clock = %d
\n
"
,
get_byte
(
amigamodeinfoptr
+
PSSO_ModeInfo_first_union
));
write_log
(
" Clock = %d
\n
"
,
get_byte
(
amigamodeinfoptr
+
PSSO_ModeInfo_first_union
));
write_log
(
" ClockDivide = %d
\n
"
,
get_byte
(
amigamodeinfoptr
+
PSSO_ModeInfo_second_union
));
write_log
(
" ClockDivide = %d
\n
"
,
get_byte
(
amigamodeinfoptr
+
PSSO_ModeInfo_second_union
));
write_log
(
" PixelClock = %d
\n
"
,
get_long
(
amigamodeinfoptr
+
PSSO_ModeInfo_PixelClock
));
write_log
(
" PixelClock = %d
\n
"
,
get_long
(
amigamodeinfoptr
+
PSSO_ModeInfo_PixelClock
));
}
}
static
void
DumpLibResolutionStructure
(
uaecptr
amigalibresptr
)
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
;
...
@@ -151,9 +151,9 @@ static void DumpLibResolutionStructure (uaecptr amigalibresptr)
...
@@ -151,9 +151,9 @@ static void DumpLibResolutionStructure (uaecptr amigalibresptr)
}
else
{
}
else
{
write_log
(
" Name = %s
\n
"
,
uaememptr
->
P96ID
);
write_log
(
" Name = %s
\n
"
,
uaememptr
->
P96ID
);
write_log
(
" DisplayID = 0x%x
\n
"
,
get_long
(
amigalibresptr
+
PSSO_LibResolution_DisplayID
));
write_log
(
" DisplayID = 0x%x
\n
"
,
get_long
(
amigalibresptr
+
PSSO_LibResolution_DisplayID
));
write_log
(
" Width = %d
\n
"
,
get_word
(
amigalibresptr
+
PSSO_LibResolution_Width
));
write_log
(
" Width = %d
\n
"
,
get_word
(
amigalibresptr
+
PSSO_LibResolution_Width
));
write_log
(
" Height = %d
\n
"
,
get_word
(
amigalibresptr
+
PSSO_LibResolution_Height
));
write_log
(
" Height = %d
\n
"
,
get_word
(
amigalibresptr
+
PSSO_LibResolution_Height
));
write_log
(
" Flags = %d
\n
"
,
get_word
(
amigalibresptr
+
PSSO_LibResolution_Flags
));
write_log
(
" Flags = %d
\n
"
,
get_word
(
amigalibresptr
+
PSSO_LibResolution_Flags
));
for
(
i
=
0
;
i
<
MAXMODES
;
i
++
)
{
for
(
i
=
0
;
i
<
MAXMODES
;
i
++
)
{
amigamodeinfoptr
=
get_long
(
amigalibresptr
+
PSSO_LibResolution_Modes
+
i
*
4
);
amigamodeinfoptr
=
get_long
(
amigalibresptr
+
PSSO_LibResolution_Modes
+
i
*
4
);
write_log
(
" ModeInfo[%d] = 0x%x
\n
"
,
i
,
amigamodeinfoptr
);
write_log
(
" ModeInfo[%d] = 0x%x
\n
"
,
i
,
amigamodeinfoptr
);
...
@@ -255,34 +255,33 @@ STATIC_INLINE uae_u8 GetBytesPerPixel (uae_u32 RGBfmt)
...
@@ -255,34 +255,33 @@ 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
);
if
(
valid_address
(
memp
,
PSSO_RenderInfo_sizeof
))
{
if
(
valid_address
(
memp
,
PSSO_RenderInfo_sizeof
))
{
ri
->
AMemory
=
memp
;
ri
->
AMemory
=
memp
;
ri
->
Memory
=
get_real_address
(
memp
);
ri
->
Memory
=
get_real_address
(
memp
);
ri
->
BytesPerRow
=
get_word
(
amigamemptr
+
PSSO_RenderInfo_BytesPerRow
);
ri
->
BytesPerRow
=
get_word
(
amigamemptr
+
PSSO_RenderInfo_BytesPerRow
);
ri
->
RGBFormat
=
get_long
(
amigamemptr
+
PSSO_RenderInfo_RGBFormat
);
ri
->
RGBFormat
=
get_long
(
amigamemptr
+
PSSO_RenderInfo_RGBFormat
);
return
1
;
return
1
;
}
}
write_log
(
"P96: ERROR - Invalid RenderInfo memory area.
\n
"
);
write_log
(
"P96: ERROR - Invalid RenderInfo memory area.
\n
"
);
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
);
if
(
valid_address
(
memp
,
PSSO_Pattern_sizeof
))
{
if
(
valid_address
(
memp
,
PSSO_Pattern_sizeof
))
{
pattern
->
Memory
=
get_real_address
(
memp
);
pattern
->
Memory
=
get_real_address
(
memp
);
pattern
->
XOffset
=
get_word
(
amigamemptr
+
PSSO_Pattern_XOffset
);
pattern
->
XOffset
=
get_word
(
amigamemptr
+
PSSO_Pattern_XOffset
);
pattern
->
YOffset
=
get_word
(
amigamemptr
+
PSSO_Pattern_YOffset
);
pattern
->
YOffset
=
get_word
(
amigamemptr
+
PSSO_Pattern_YOffset
);
pattern
->
FgPen
=
get_long
(
amigamemptr
+
PSSO_Pattern_FgPen
);
pattern
->
FgPen
=
get_long
(
amigamemptr
+
PSSO_Pattern_FgPen
);
pattern
->
BgPen
=
get_long
(
amigamemptr
+
PSSO_Pattern_BgPen
);
pattern
->
BgPen
=
get_long
(
amigamemptr
+
PSSO_Pattern_BgPen
);
pattern
->
Size
=
get_byte
(
amigamemptr
+
PSSO_Pattern_Size
);
pattern
->
Size
=
get_byte
(
amigamemptr
+
PSSO_Pattern_Size
);
pattern
->
DrawMode
=
get_byte
(
amigamemptr
+
PSSO_Pattern_DrawMode
);
pattern
->
DrawMode
=
get_byte
(
amigamemptr
+
PSSO_Pattern_DrawMode
);
return
1
;
return
1
;
}
}
...
@@ -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
);
...
@@ -304,14 +302,13 @@ static int CopyBitMapStructureA2U (uaecptr amigamemptr, struct BitMap *bm)
...
@@ -304,14 +302,13 @@ static int CopyBitMapStructureA2U (uaecptr amigamemptr, struct BitMap *bm)
int
i
;
int
i
;
bm
->
BytesPerRow
=
get_word
(
amigamemptr
+
PSSO_BitMap_BytesPerRow
);
bm
->
BytesPerRow
=
get_word
(
amigamemptr
+
PSSO_BitMap_BytesPerRow
);
bm
->
Rows
=
get_word
(
amigamemptr
+
PSSO_BitMap_Rows
);
bm
->
Rows
=
get_word
(
amigamemptr
+
PSSO_BitMap_Rows
);
bm
->
Flags
=
get_byte
(
amigamemptr
+
PSSO_BitMap_Flags
);
bm
->
Flags
=
get_byte
(
amigamemptr
+
PSSO_BitMap_Flags
);
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
;
}
}
for
(
i
=
0
;
i
<
bm
->
Depth
;
i
++
)
{
for
(
i
=
0
;
i
<
bm
->
Depth
;
i
++
)
{
...
@@ -334,28 +331,26 @@ static int CopyBitMapStructureA2U (uaecptr amigamemptr, struct BitMap *bm)
...
@@ -334,28 +331,26 @@ 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
);
if
(
valid_address
(
memp
,
1
/* FIXME */
))
{
if
(
valid_address
(
memp
,
1
/* FIXME */
))
{
tmpl
->
Memory
=
get_real_address
(
memp
);
tmpl
->
Memory
=
get_real_address
(
memp
);
tmpl
->
BytesPerRow
=
get_word
(
amigamemptr
+
PSSO_Template_BytesPerRow
);
tmpl
->
BytesPerRow
=
get_word
(
amigamemptr
+
PSSO_Template_BytesPerRow
);
tmpl
->
XOffset
=
get_byte
(
amigamemptr
+
PSSO_Template_XOffset
);
tmpl
->
XOffset
=
get_byte
(
amigamemptr
+
PSSO_Template_XOffset
);
tmpl
->
DrawMode
=
get_byte
(
amigamemptr
+
PSSO_Template_DrawMode
);
tmpl
->
DrawMode
=
get_byte
(
amigamemptr
+
PSSO_Template_DrawMode
);
tmpl
->
FgPen
=
get_long
(
amigamemptr
+
PSSO_Template_FgPen
);
tmpl
->
FgPen
=
get_long
(
amigamemptr
+
PSSO_Template_FgPen
);
tmpl
->
BgPen
=
get_long
(
amigamemptr
+
PSSO_Template_BgPen
);
tmpl
->
BgPen
=
get_long
(
amigamemptr
+
PSSO_Template_BgPen
);
return
1
;
return
1
;
}
}
write_log
(
"P96: ERROR - Invalid Template memory area.
\n
"
);
write_log
(
"P96: ERROR - Invalid Template memory area.
\n
"
);
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
;
...
@@ -482,9 +476,9 @@ static void do_fillrect (uae_u8 *src, int x, int y, int width, int height,
...
@@ -482,9 +476,9 @@ static void do_fillrect (uae_u8 *src, int x, int y, int width, int height,
dst
+=
picasso_vidinfo
.
rowbytes
;
dst
+=
picasso_vidinfo
.
rowbytes
;
}
}
}
else
{
}
else
{
while
(
height
--
>
0
)
{
while
(
height
--
>
0
)
{
memcpy
(
dst
,
src
,
width
);
memcpy
(
dst
,
src
,
width
);
dst
+=
picasso_vidinfo
.
rowbytes
;
dst
+=
picasso_vidinfo
.
rowbytes
;
}
}
}
}
}
else
{
}
else
{
...
@@ -585,10 +579,10 @@ static void do_blit (struct RenderInfo *ri, int Bpp, int srcx, int srcy,
...
@@ -585,10 +579,10 @@ static void do_blit (struct RenderInfo *ri, int Bpp, int srcx, int srcy,
if
(
picasso_vidinfo
.
rgbformat
==
picasso96_state
.
RGBFormat
)
{
if
(
picasso_vidinfo
.
rgbformat
==
picasso96_state
.
RGBFormat
)
{
width
*=
Bpp
;
width
*=
Bpp
;
while
(
height
--
>
0
)
{
while
(
height
--
>
0
)
{
memcpy
(
dstp
,
srcp
,
width
);
memcpy
(
dstp
,
srcp
,
width
);
srcp
+=
ri
->
BytesPerRow
;
srcp
+=
ri
->
BytesPerRow
;
dstp
+=
picasso_vidinfo
.
rowbytes
;
dstp
+=
picasso_vidinfo
.
rowbytes
;
}
}
}
else
{
}
else
{
int
psiz
=
GetBytesPerPixel
(
picasso_vidinfo
.
rgbformat
);
int
psiz
=
GetBytesPerPixel
(
picasso_vidinfo
.
rgbformat
);
...
@@ -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. */
...
@@ -660,7 +653,7 @@ static void wgfx_do_flushline (void)
...
@@ -660,7 +653,7 @@ static void wgfx_do_flushline (void)
int
src_y
=
wgfx_y
;
int
src_y
=
wgfx_y
;
long
x0
,
x1
,
width
;
long
x0
,
x1
,
width
;
uae_u8
*
src
,
*
dstp
;
uae_u8
*
src
,
*
dstp
;
int
Bpp
=
GetBytesPerPixel
(
picasso_vidinfo
.
rgbformat
);
int
Bpp
=
GetBytesPerPixel
(
picasso_vidinfo
.
rgbformat
);
int
fb_bpp
=
picasso96_state
.
BytesPerPixel
;
int
fb_bpp
=
picasso96_state
.
BytesPerPixel
;
wgfx_y
-=
picasso96_state
.
YOffset
;
wgfx_y
-=
picasso96_state
.
YOffset
;
...
@@ -689,11 +682,11 @@ static void wgfx_do_flushline (void)
...
@@ -689,11 +682,11 @@ static void wgfx_do_flushline (void)
P96TRACE
((
"flushing %d
\n
"
,
wgfx_y
));
P96TRACE
((
"flushing %d
\n
"
,
wgfx_y
));
src
=
gfxmemory
+
wgfx_min
;
src
=
gfxmemory
+
wgfx_min
;
if
(
picasso_vidinfo
.
rgbformat
==
picasso96_state
.
RGBFormat
)
{
if
(
picasso_vidinfo
.
rgbformat
==
picasso96_state
.
RGBFormat
)
{
dstp
+=
wgfx_y
*
picasso_vidinfo
.
rowbytes
+
x0
;
dstp
+=
wgfx_y
*
picasso_vidinfo
.
rowbytes
+
x0
;
memcpy
(
dstp
,
src
,
width
);
memcpy
(
dstp
,
src
,
width
);
}
else
{
}
else
{
int
i
;
int
i
;
if
(
picasso96_state
.
RGBFormat
!=
RGBFB_CHUNKY
)
if
(
picasso96_state
.
RGBFormat
!=
RGBFB_CHUNKY
)
abort
();
abort
();
...
@@ -703,15 +696,15 @@ static void wgfx_do_flushline (void)
...
@@ -703,15 +696,15 @@ static void wgfx_do_flushline (void)
case
2
:
case
2
:
for
(
i
=
0
;
i
<
width
;
i
++
)
for
(
i
=
0
;
i
<
width
;
i
++
)
*
((
uae_u16
*
)
dstp
+
i
)
=
picasso_vidinfo
.
clut
[
src
[
i
]];
*
((
uae_u16
*
)
dstp
+
i
)
=
picasso_vidinfo
.
clut
[
src
[
i
]];
break
;
break
;
case
4
:
case
4
:
for
(
i
=
0
;
i
<
width
;
i
++
)
for
(
i
=
0
;
i
<
width
;
i
++
)
*
((
uae_u32
*
)
dstp
+
i
)
=
picasso_vidinfo
.
clut
[
src
[
i
]];
*
((
uae_u32
*
)
dstp
+
i
)
=
picasso_vidinfo
.
clut
[
src
[
i
]];
break
;
break
;
default:
default:
abort
();
abort
();
}
}
}
}
out:
out:
gfx_unlock_picasso
();
gfx_unlock_picasso
();
...
@@ -765,7 +758,7 @@ void picasso_refresh (int call_setpalette)
...
@@ -765,7 +758,7 @@ void picasso_refresh (int call_setpalette)
#endif
#endif
/* Make sure that the first time we show a Picasso video mode, we don't
/* Make sure that the first time we show a Picasso video mode, we don't
* blit any crap. We can do this by checking if we have an Address yet. */
* blit any crap. We can do this by checking if we have an Address yet.
*/
if
(
picasso96_state
.
Address
)
{
if
(
picasso96_state
.
Address
)
{
unsigned
int
width
,
height
;
unsigned
int
width
,
height
;
/* blit the stuff from our static frame-buffer to the gfx-card */
/* blit the stuff from our static frame-buffer to the gfx-card */
...
@@ -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
;
...
@@ -892,11 +884,11 @@ STATIC_INLINE void do_blitrect_frame_buffer (struct RenderInfo *ri,
...
@@ -892,11 +884,11 @@ STATIC_INLINE void do_blitrect_frame_buffer (struct RenderInfo *ri,
break
;
break
;
case
30
:
//code for swap source with dest in byte
case
30
:
//code for swap source with dest in byte
{
{
uae_u32
temp
;
uae_u32
temp
;
temp
=
*
src2_32
;
temp
=
*
src2_32
;
*
src2_32
=
*
dst2_32
;
*
src2_32
=
*
dst2_32
;
*
dst2_32
=
temp
;
*
dst2_32
=
temp
;
}
}
break
;
break
;
case
BLIT_LAST
:
case
BLIT_LAST
:
write_log
(
"P96: ERROR - do_blitrect_frame_buffer shouldn't get BLIT_LAST!
\n
"
);
write_log
(
"P96: ERROR - do_blitrect_frame_buffer shouldn't get BLIT_LAST!
\n
"
);
...
@@ -959,10 +951,10 @@ STATIC_INLINE void do_blitrect_frame_buffer (struct RenderInfo *ri,
...
@@ -959,10 +951,10 @@ STATIC_INLINE void do_blitrect_frame_buffer (struct RenderInfo *ri,
break
;
break
;
case
30
:
//code for swap source with dest in long
case
30
:
//code for swap source with dest in long
{
{
uae_u8
temp
;
uae_u8
temp
;
temp
=
*
src2
;
temp
=
*
src2
;
*
src2
=
*
dst2
;
*
src2
=
*
dst2
;
*
dst2
=
temp
;
*
dst2
=
temp
;
}
}
break
;
break
;
}
/* switch opcode */
}
/* switch opcode */
...
@@ -1116,10 +1108,10 @@ uae_u32 picasso_InitCard (void)
...
@@ -1116,10 +1108,10 @@ uae_u32 picasso_InitCard (void)
uaecptr
amigamemptr
=
0
;
uaecptr
amigamemptr
=
0
;
uaecptr
AmigaBoardInfo
=
m68k_areg
(
regs
,
2
);
uaecptr
AmigaBoardInfo
=
m68k_areg
(
regs
,
2
);
put_word
(
AmigaBoardInfo
+
PSSO_BoardInfo_BitsPerCannon
,
DX_BitsPerCannon
());
put_word
(
AmigaBoardInfo
+
PSSO_BoardInfo_BitsPerCannon
,
DX_BitsPerCannon
());
put_word
(
AmigaBoardInfo
+
PSSO_BoardInfo_RGBFormats
,
picasso96_pixel_format
);
put_word
(
AmigaBoardInfo
+
PSSO_BoardInfo_RGBFormats
,
picasso96_pixel_format
);
put_word
(
AmigaBoardInfo
+
PSSO_BoardInfo_SoftSpriteFlags
,
picasso96_pixel_format
);
put_word
(
AmigaBoardInfo
+
PSSO_BoardInfo_SoftSpriteFlags
,
picasso96_pixel_format
);
put_long
(
AmigaBoardInfo
+
PSSO_BoardInfo_BoardType
,
BT_uaegfx
);
put_long
(
AmigaBoardInfo
+
PSSO_BoardInfo_BoardType
,
BT_uaegfx
);
put_word
(
AmigaBoardInfo
+
PSSO_BoardInfo_MaxHorResolution
+
0
,
planar
.
width
);
put_word
(
AmigaBoardInfo
+
PSSO_BoardInfo_MaxHorResolution
+
0
,
planar
.
width
);
put_word
(
AmigaBoardInfo
+
PSSO_BoardInfo_MaxHorResolution
+
2
,
chunky
.
width
);
put_word
(
AmigaBoardInfo
+
PSSO_BoardInfo_MaxHorResolution
+
2
,
chunky
.
width
);
put_word
(
AmigaBoardInfo
+
PSSO_BoardInfo_MaxHorResolution
+
4
,
hicolour
.
width
);
put_word
(
AmigaBoardInfo
+
PSSO_BoardInfo_MaxHorResolution
+
4
,
hicolour
.
width
);
...
@@ -1136,16 +1128,16 @@ uae_u32 picasso_InitCard (void)
...
@@ -1136,16 +1128,16 @@ uae_u32 picasso_InitCard (void)
/* Add a LibResolution structure to the ResolutionsList MinList in our BoardInfo */
/* Add a LibResolution structure to the ResolutionsList MinList in our BoardInfo */
res
.
DisplayID
=
AssignModeID
(
i
,
LibResolutionStructureCount
);
res
.
DisplayID
=
AssignModeID
(
i
,
LibResolutionStructureCount
);
res
.
BoardInfo
=
AmigaBoardInfo
;
res
.
BoardInfo
=
AmigaBoardInfo
;
res
.
Width
=
DisplayModes
[
i
].
res
.
width
;
res
.
Width
=
DisplayModes
[
i
].
res
.
width
;
res
.
Height
=
DisplayModes
[
i
].
res
.
height
;
res
.
Height
=
DisplayModes
[
i
].
res
.
height
;
res
.
Flags
=
P96F_PUBLIC
;
res
.
Flags
=
P96F_PUBLIC
;
res
.
P96ID
[
0
]
=
'P'
;
res
.
P96ID
[
0
]
=
'P'
;
res
.
P96ID
[
1
]
=
'9'
;
res
.
P96ID
[
1
]
=
'9'
;
res
.
P96ID
[
2
]
=
'6'
;
res
.
P96ID
[
2
]
=
'6'
;
res
.
P96ID
[
3
]
=
'-'
;
res
.
P96ID
[
3
]
=
'-'
;
res
.
P96ID
[
4
]
=
'0'
;
res
.
P96ID
[
4
]
=
'0'
;
res
.
P96ID
[
5
]
=
':'
;
res
.
P96ID
[
5
]
=
':'
;
strcpy
(
res
.
Name
,
"uaegfx:"
);
strcpy
(
res
.
Name
,
"uaegfx:"
);
strncat
(
res
.
Name
,
DisplayModes
[
i
].
name
,
strchr
(
DisplayModes
[
i
].
name
,
','
)
-
DisplayModes
[
i
].
name
);
strncat
(
res
.
Name
,
DisplayModes
[
i
].
name
,
strchr
(
DisplayModes
[
i
].
name
,
','
)
-
DisplayModes
[
i
].
name
);
res
.
Modes
[
PLANAR
]
=
0
;
res
.
Modes
[
PLANAR
]
=
0
;
res
.
Modes
[
CHUNKY
]
=
0
;
res
.
Modes
[
CHUNKY
]
=
0
;
...
@@ -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
...
@@ -1265,8 +1257,8 @@ uae_u32 picasso_SetColorArray (void)
...
@@ -1265,8 +1257,8 @@ uae_u32 picasso_SetColorArray (void)
* We need this for CLUT-based displays, and for mapping CLUT to hi/true
* We need this for CLUT-based displays, and for mapping CLUT to hi/true
* colour */
* colour */
uaecptr
boardinfo
=
m68k_areg
(
regs
,
0
);
uaecptr
boardinfo
=
m68k_areg
(
regs
,
0
);
uae_u16
start
=
m68k_dreg
(
regs
,
0
);
uae_u16
start
=
m68k_dreg
(
regs
,
0
);
uae_u16
count
=
m68k_dreg
(
regs
,
1
);
uae_u16
count
=
m68k_dreg
(
regs
,
1
);
uaecptr
clut
=
boardinfo
+
PSSO_BoardInfo_CLUT
+
start
*
3
;
uaecptr
clut
=
boardinfo
+
PSSO_BoardInfo_CLUT
+
start
*
3
;
int
changed
=
0
;
int
changed
=
0
;
int
i
;
int
i
;
...
@@ -1278,9 +1270,9 @@ uae_u32 picasso_SetColorArray (void)
...
@@ -1278,9 +1270,9 @@ uae_u32 picasso_SetColorArray (void)
changed
|=
(
picasso96_state
.
CLUT
[
i
].
Red
!=
r
||
picasso96_state
.
CLUT
[
i
].
Green
!=
g
||
picasso96_state
.
CLUT
[
i
].
Blue
!=
b
);
changed
|=
(
picasso96_state
.
CLUT
[
i
].
Red
!=
r
||
picasso96_state
.
CLUT
[
i
].
Green
!=
g
||
picasso96_state
.
CLUT
[
i
].
Blue
!=
b
);
picasso96_state
.
CLUT
[
i
].
Red
=
r
;
picasso96_state
.
CLUT
[
i
].
Red
=
r
;
picasso96_state
.
CLUT
[
i
].
Green
=
g
;
picasso96_state
.
CLUT
[
i
].
Green
=
g
;
picasso96_state
.
CLUT
[
i
].
Blue
=
b
;
picasso96_state
.
CLUT
[
i
].
Blue
=
b
;
clut
+=
3
;
clut
+=
3
;
}
}
...
@@ -1312,12 +1304,12 @@ uae_u32 picasso_SetDAC (void)
...
@@ -1312,12 +1304,12 @@ uae_u32 picasso_SetDAC (void)
static
void
init_picasso_screen
(
void
)
static
void
init_picasso_screen
(
void
)
{
{
int
width
=
picasso96_state
.
Width
;
int
width
=
picasso96_state
.
Width
;
int
height
=
picasso96_state
.
Height
;
int
height
=
picasso96_state
.
Height
;
int
vwidth
=
picasso96_state
.
VirtualWidth
;
int
vwidth
=
picasso96_state
.
VirtualWidth
;
int
vheight
=
picasso96_state
.
VirtualHeight
;
int
vheight
=
picasso96_state
.
VirtualHeight
;
int
xoff
=
0
;
int
xoff
=
0
;
int
yoff
=
0
;
int
yoff
=
0
;
if
(
!
set_gc_called
)
if
(
!
set_gc_called
)
return
;
return
;
...
@@ -1392,7 +1384,7 @@ uae_u32 picasso_SetGC (void)
...
@@ -1392,7 +1384,7 @@ uae_u32 picasso_SetGC (void)
*/
*/
uae_u32
picasso_SetPanning
(
void
)
uae_u32
picasso_SetPanning
(
void
)
{
{
uae_u16
Width
=
m68k_dreg
(
regs
,
0
);
uae_u16
Width
=
m68k_dreg
(
regs
,
0
);
uaecptr
start_of_screen
=
m68k_areg
(
regs
,
1
);
uaecptr
start_of_screen
=
m68k_areg
(
regs
,
1
);
uaecptr
bi
=
m68k_areg
(
regs
,
0
);
uaecptr
bi
=
m68k_areg
(
regs
,
0
);
uaecptr
bmeptr
=
get_long
(
bi
+
PSSO_BoardInfo_BitMapExtra
);
/* Get our BoardInfo ptr's BitMapExtra ptr */
uaecptr
bmeptr
=
get_long
(
bi
+
PSSO_BoardInfo_BitMapExtra
);
/* Get our BoardInfo ptr's BitMapExtra ptr */
...
@@ -1410,13 +1402,13 @@ uae_u32 picasso_SetPanning (void)
...
@@ -1410,13 +1402,13 @@ uae_u32 picasso_SetPanning (void)
#endif
#endif
picasso96_state
.
Address
=
start_of_screen
;
/* Amiga-side address */
picasso96_state
.
Address
=
start_of_screen
;
/* Amiga-side address */
picasso96_state
.
XOffset
=
(
uae_s16
)
m68k_dreg
(
regs
,
1
);
picasso96_state
.
XOffset
=
(
uae_s16
)
m68k_dreg
(
regs
,
1
);
picasso96_state
.
YOffset
=
(
uae_s16
)
m68k_dreg
(
regs
,
2
);
picasso96_state
.
YOffset
=
(
uae_s16
)
m68k_dreg
(
regs
,
2
);
picasso96_state
.
VirtualWidth
=
get_word
(
bmeptr
+
PSSO_BitMapExtra_Width
);
picasso96_state
.
VirtualWidth
=
get_word
(
bmeptr
+
PSSO_BitMapExtra_Width
);
picasso96_state
.
VirtualHeight
=
get_word
(
bmeptr
+
PSSO_BitMapExtra_Height
);
picasso96_state
.
VirtualHeight
=
get_word
(
bmeptr
+
PSSO_BitMapExtra_Height
);
picasso96_state
.
RGBFormat
=
m68k_dreg
(
regs
,
7
);
picasso96_state
.
RGBFormat
=
m68k_dreg
(
regs
,
7
);
picasso96_state
.
BytesPerPixel
=
GetBytesPerPixel
(
picasso96_state
.
RGBFormat
);
picasso96_state
.
BytesPerPixel
=
GetBytesPerPixel
(
picasso96_state
.
RGBFormat
);
picasso96_state
.
BytesPerRow
=
Width
*
picasso96_state
.
BytesPerPixel
;
picasso96_state
.
BytesPerRow
=
Width
*
picasso96_state
.
BytesPerPixel
;
set_panning_called
=
1
;
set_panning_called
=
1
;
P96TRACE
((
"SetPanning(%d, %d, %d) Start 0x%x, BPR %d
\n
"
,
P96TRACE
((
"SetPanning(%d, %d, %d) Start 0x%x, BPR %d
\n
"
,
...
@@ -1475,13 +1467,13 @@ static void do_xor8 (uae_u8 * ptr, long len, uae_u32 val)
...
@@ -1475,13 +1467,13 @@ static void do_xor8 (uae_u8 * ptr, long len, uae_u32 val)
*/
*/
uae_u32
picasso_InvertRect
(
void
)
uae_u32
picasso_InvertRect
(
void
)
{
{
uaecptr
renderinfo
=
m68k_areg
(
regs
,
1
);
uaecptr
renderinfo
=
m68k_areg
(
regs
,
1
);
unsigned
long
X
=
(
uae_u16
)
m68k_dreg
(
regs
,
0
);
unsigned
long
X
=
(
uae_u16
)
m68k_dreg
(
regs
,
0
);
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
;
struct
RenderInfo
ri
;
struct
RenderInfo
ri
;
...
@@ -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
);
}
}
}
}
...
@@ -1582,14 +1574,14 @@ FillRect:
...
@@ -1582,14 +1574,14 @@ FillRect:
***********************************************************/
***********************************************************/
uae_u32
picasso_FillRect
(
void
)
uae_u32
picasso_FillRect
(
void
)
{
{
uaecptr
renderinfo
=
m68k_areg
(
regs
,
1
);
uaecptr
renderinfo
=
m68k_areg
(
regs
,
1
);
uae_u32
X
=
(
uae_u16
)
m68k_dreg
(
regs
,
0
);
uae_u32
X
=
(
uae_u16
)
m68k_dreg
(
regs
,
0
);
uae_u32
Y
=
(
uae_u16
)
m68k_dreg
(
regs
,
1
);
uae_u32
Y
=
(
uae_u16
)
m68k_dreg
(
regs
,
1
);
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
;
uae_u8
*
oldstart
;
uae_u8
*
oldstart
;
...
@@ -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,53 +1695,53 @@ uae_u32 picasso_FillRect (void)
...
@@ -1703,53 +1695,53 @@ 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
;
struct
RenderInfo
dstri_struct
;
struct
RenderInfo
dstri_struct
;
struct
RenderInfo
*
ri
;
/* Self-referencing pointers */
struct
RenderInfo
*
ri
;
/* Self-referencing pointers */
struct
RenderInfo
*
dstri
;
struct
RenderInfo
*
dstri
;
unsigned
long
srcx
;
unsigned
long
srcx
;
unsigned
long
srcy
;
unsigned
long
srcy
;
unsigned
long
dstx
;
unsigned
long
dstx
;
unsigned
long
dsty
;
unsigned
long
dsty
;
unsigned
long
width
;
unsigned
long
width
;
unsigned
long
height
;
unsigned
long
height
;
uae_u8
mask
;
uae_u8
mask
;
BLIT_OPCODE
opcode
;
BLIT_OPCODE
opcode
;
}
blitrectdata
;
}
blitrectdata
;
STATIC_INLINE
int
BlitRectHelper
(
void
)
STATIC_INLINE
int
BlitRectHelper
(
void
)
{
{
struct
RenderInfo
*
ri
=
blitrectdata
.
ri
;
struct
RenderInfo
*
ri
=
blitrectdata
.
ri
;
struct
RenderInfo
*
dstri
=
blitrectdata
.
dstri
;
struct
RenderInfo
*
dstri
=
blitrectdata
.
dstri
;
unsigned
long
srcx
=
blitrectdata
.
srcx
;
unsigned
long
srcx
=
blitrectdata
.
srcx
;
unsigned
long
srcy
=
blitrectdata
.
srcy
;
unsigned
long
srcy
=
blitrectdata
.
srcy
;
unsigned
long
dstx
=
blitrectdata
.
dstx
;
unsigned
long
dstx
=
blitrectdata
.
dstx
;
unsigned
long
dsty
=
blitrectdata
.
dsty
;
unsigned
long
dsty
=
blitrectdata
.
dsty
;
unsigned
long
width
=
blitrectdata
.
width
;
unsigned
long
width
=
blitrectdata
.
width
;
unsigned
long
height
=
blitrectdata
.
height
;
unsigned
long
height
=
blitrectdata
.
height
;
uae_u8
mask
=
blitrectdata
.
mask
;
uae_u8
mask
=
blitrectdata
.
mask
;
BLIT_OPCODE
opcode
=
blitrectdata
.
opcode
;
BLIT_OPCODE
opcode
=
blitrectdata
.
opcode
;
uae_u8
Bpp
=
GetBytesPerPixel
(
ri
->
RGBFormat
);
uae_u8
Bpp
=
GetBytesPerPixel
(
ri
->
RGBFormat
);
unsigned
long
total_width
=
width
*
Bpp
;
unsigned
long
total_width
=
width
*
Bpp
;
...
@@ -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
;
...
@@ -1840,7 +1832,7 @@ BlitRect:
...
@@ -1840,7 +1832,7 @@ BlitRect:
***********************************************************/
***********************************************************/
uae_u32
picasso_BlitRect
(
void
)
uae_u32
picasso_BlitRect
(
void
)
{
{
uaecptr
renderinfo
=
m68k_areg
(
regs
,
1
);
uaecptr
renderinfo
=
m68k_areg
(
regs
,
1
);
unsigned
long
srcx
=
(
uae_u16
)
m68k_dreg
(
regs
,
0
);
unsigned
long
srcx
=
(
uae_u16
)
m68k_dreg
(
regs
,
0
);
unsigned
long
srcy
=
(
uae_u16
)
m68k_dreg
(
regs
,
1
);
unsigned
long
srcy
=
(
uae_u16
)
m68k_dreg
(
regs
,
1
);
unsigned
long
dstx
=
(
uae_u16
)
m68k_dreg
(
regs
,
2
);
unsigned
long
dstx
=
(
uae_u16
)
m68k_dreg
(
regs
,
2
);
...
@@ -1882,15 +1874,15 @@ BlitRectNoMaskComplete:
...
@@ -1882,15 +1874,15 @@ BlitRectNoMaskComplete:
***********************************************************/
***********************************************************/
uae_u32
picasso_BlitRectNoMaskComplete
(
void
)
uae_u32
picasso_BlitRectNoMaskComplete
(
void
)
{
{
uaecptr
srcri
=
m68k_areg
(
regs
,
1
);
uaecptr
srcri
=
m68k_areg
(
regs
,
1
);
uaecptr
dstri
=
m68k_areg
(
regs
,
2
);
uaecptr
dstri
=
m68k_areg
(
regs
,
2
);
unsigned
long
srcx
=
(
uae_u16
)
m68k_dreg
(
regs
,
0
);
unsigned
long
srcx
=
(
uae_u16
)
m68k_dreg
(
regs
,
0
);
unsigned
long
srcy
=
(
uae_u16
)
m68k_dreg
(
regs
,
1
);
unsigned
long
srcy
=
(
uae_u16
)
m68k_dreg
(
regs
,
1
);
unsigned
long
dstx
=
(
uae_u16
)
m68k_dreg
(
regs
,
2
);
unsigned
long
dstx
=
(
uae_u16
)
m68k_dreg
(
regs
,
2
);
unsigned
long
dsty
=
(
uae_u16
)
m68k_dreg
(
regs
,
3
);
unsigned
long
dsty
=
(
uae_u16
)
m68k_dreg
(
regs
,
3
);
unsigned
long
width
=
(
uae_u16
)
m68k_dreg
(
regs
,
4
);
unsigned
long
width
=
(
uae_u16
)
m68k_dreg
(
regs
,
4
);
unsigned
long
height
=
(
uae_u16
)
m68k_dreg
(
regs
,
5
);
unsigned
long
height
=
(
uae_u16
)
m68k_dreg
(
regs
,
5
);
uae_u8
OpCode
=
m68k_dreg
(
regs
,
6
);
uae_u8
OpCode
=
m68k_dreg
(
regs
,
6
);
uae_u32
RGBFmt
=
m68k_dreg
(
regs
,
7
);
uae_u32
RGBFmt
=
m68k_dreg
(
regs
,
7
);
uae_u32
result
=
0
;
uae_u32
result
=
0
;
...
@@ -1901,7 +1893,7 @@ uae_u32 picasso_BlitRectNoMaskComplete (void)
...
@@ -1901,7 +1893,7 @@ uae_u32 picasso_BlitRectNoMaskComplete (void)
wgfx_flushline
();
wgfx_flushline
();
P96TRACE
((
"BlitRectNoMaskComplete() op 0x%2x, xy(%4d,%4d) --> xy(%4d,%4d), wh(%4d,%4d)
\n
"
,
P96TRACE
((
"BlitRectNoMaskComplete() op 0x%2x, xy(%4d,%4d) --> xy(%4d,%4d), wh(%4d,%4d)
\n
"
,
OpCode
,
srcx
,
srcy
,
dstx
,
dsty
,
width
,
height
));
OpCode
,
srcx
,
srcy
,
dstx
,
dsty
,
width
,
height
));
result
=
BlitRect
(
srcri
,
dstri
,
srcx
,
srcy
,
dstx
,
dsty
,
width
,
height
,
0xFF
,
OpCode
);
result
=
BlitRect
(
srcri
,
dstri
,
srcx
,
srcy
,
dstx
,
dsty
,
width
,
height
,
0xFF
,
OpCode
);
...
@@ -1977,14 +1969,14 @@ STATIC_INLINE void PixelWrite (uae_u8 * mem, int bits, uae_u32 fgpen, uae_u8 Bpp
...
@@ -1977,14 +1969,14 @@ STATIC_INLINE void PixelWrite (uae_u8 * mem, int bits, uae_u32 fgpen, uae_u8 Bpp
*/
*/
uae_u32
picasso_BlitPattern
(
void
)
uae_u32
picasso_BlitPattern
(
void
)
{
{
uaecptr
rinf
=
m68k_areg
(
regs
,
1
);
uaecptr
rinf
=
m68k_areg
(
regs
,
1
);
uaecptr
pinf
=
m68k_areg
(
regs
,
2
);
uaecptr
pinf
=
m68k_areg
(
regs
,
2
);
unsigned
long
X
=
(
uae_u16
)
m68k_dreg
(
regs
,
0
);
unsigned
long
X
=
(
uae_u16
)
m68k_dreg
(
regs
,
0
);
unsigned
long
Y
=
(
uae_u16
)
m68k_dreg
(
regs
,
1
);
unsigned
long
Y
=
(
uae_u16
)
m68k_dreg
(
regs
,
1
);
unsigned
long
W
=
(
uae_u16
)
m68k_dreg
(
regs
,
2
);
unsigned
long
W
=
(
uae_u16
)
m68k_dreg
(
regs
,
2
);
unsigned
long
H
=
(
uae_u16
)
m68k_dreg
(
regs
,
3
);
unsigned
long
H
=
(
uae_u16
)
m68k_dreg
(
regs
,
3
);
uae_u8
Mask
=
(
uae_u8
)
m68k_dreg
(
regs
,
4
);
uae_u8
Mask
=
(
uae_u8
)
m68k_dreg
(
regs
,
4
);
uae_u32
RGBFmt
=
m68k_dreg
(
regs
,
7
);
uae_u32
RGBFmt
=
m68k_dreg
(
regs
,
7
);
uae_u8
Bpp
=
GetBytesPerPixel
(
RGBFmt
);
uae_u8
Bpp
=
GetBytesPerPixel
(
RGBFmt
);
int
inversion
=
0
;
int
inversion
=
0
;
struct
RenderInfo
ri
;
struct
RenderInfo
ri
;
...
@@ -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
;
...
@@ -2071,27 +2063,27 @@ uae_u32 picasso_BlitPattern (void)
...
@@ -2071,27 +2063,27 @@ uae_u32 picasso_BlitPattern (void)
switch
(
Bpp
)
{
switch
(
Bpp
)
{
case
1
:
case
1
:
{
{
uae_u8
*
addr
=
uae_mem2
+
bits
;
uae_u8
*
addr
=
uae_mem2
+
bits
;
do_put_mem_byte
(
addr
,
(
uae_u8
)(
do_get_mem_byte
(
addr
)
^
fgpen
));
do_put_mem_byte
(
addr
,
(
uae_u8
)(
do_get_mem_byte
(
addr
)
^
fgpen
));
}
}
break
;
break
;
case
2
:
case
2
:
{
{
uae_u16
*
addr
=
((
uae_u16
*
)
uae_mem2
)
+
bits
;
uae_u16
*
addr
=
((
uae_u16
*
)
uae_mem2
)
+
bits
;
do_put_mem_word
(
addr
,
(
uae_u16
)(
do_get_mem_word
(
addr
)
^
fgpen
));
do_put_mem_word
(
addr
,
(
uae_u16
)(
do_get_mem_word
(
addr
)
^
fgpen
));
}
}
break
;
break
;
case
3
:
case
3
:
{
{
uae_u32
*
addr
=
(
uae_u32
*
)(
uae_mem2
+
bits
*
3
);
uae_u32
*
addr
=
(
uae_u32
*
)(
uae_mem2
+
bits
*
3
);
do_put_mem_long
(
addr
,
do_get_mem_long
(
addr
)
^
(
fgpen
&
0x00FFFFFF
));
do_put_mem_long
(
addr
,
do_get_mem_long
(
addr
)
^
(
fgpen
&
0x00FFFFFF
));
}
}
break
;
break
;
case
4
:
case
4
:
{
{
uae_u32
*
addr
=
((
uae_u32
*
)
uae_mem2
)
+
bits
;
uae_u32
*
addr
=
((
uae_u32
*
)
uae_mem2
)
+
bits
;
do_put_mem_long
(
addr
,
do_get_mem_long
(
addr
)
^
fgpen
);
do_put_mem_long
(
addr
,
do_get_mem_long
(
addr
)
^
fgpen
);
}
}
break
;
break
;
}
/* switch (Bpp) */
}
/* switch (Bpp) */
}
}
...
@@ -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
;
}
}
...
@@ -2133,13 +2125,13 @@ BlitTemplate:
...
@@ -2133,13 +2125,13 @@ BlitTemplate:
uae_u32
picasso_BlitTemplate
(
void
)
uae_u32
picasso_BlitTemplate
(
void
)
{
{
uae_u8
inversion
=
0
;
uae_u8
inversion
=
0
;
uaecptr
rinf
=
m68k_areg
(
regs
,
1
);
uaecptr
rinf
=
m68k_areg
(
regs
,
1
);
uaecptr
tmpl
=
m68k_areg
(
regs
,
2
);
uaecptr
tmpl
=
m68k_areg
(
regs
,
2
);
unsigned
long
X
=
(
uae_u16
)
m68k_dreg
(
regs
,
0
);
unsigned
long
X
=
(
uae_u16
)
m68k_dreg
(
regs
,
0
);
unsigned
long
Y
=
(
uae_u16
)
m68k_dreg
(
regs
,
1
);
unsigned
long
Y
=
(
uae_u16
)
m68k_dreg
(
regs
,
1
);
unsigned
long
W
=
(
uae_u16
)
m68k_dreg
(
regs
,
2
);
unsigned
long
W
=
(
uae_u16
)
m68k_dreg
(
regs
,
2
);
unsigned
long
H
=
(
uae_u16
)
m68k_dreg
(
regs
,
3
);
unsigned
long
H
=
(
uae_u16
)
m68k_dreg
(
regs
,
3
);
uae_u16
Mask
=
(
uae_u16
)
m68k_dreg
(
regs
,
4
);
uae_u16
Mask
=
(
uae_u16
)
m68k_dreg
(
regs
,
4
);
struct
Template
tmp
;
struct
Template
tmp
;
struct
RenderInfo
ri
;
struct
RenderInfo
ri
;
unsigned
long
rows
;
unsigned
long
rows
;
...
@@ -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
;
...
@@ -2247,26 +2239,26 @@ uae_u32 picasso_BlitTemplate (void)
...
@@ -2247,26 +2239,26 @@ uae_u32 picasso_BlitTemplate (void)
switch
(
Bpp
)
{
switch
(
Bpp
)
{
case
1
:
case
1
:
{
{
uae_u8
*
addr
=
uae_mem2
+
bits
;
uae_u8
*
addr
=
uae_mem2
+
bits
;
do_put_mem_byte
(
addr
,
(
uae_u8
)
(
do_get_mem_byte
(
addr
)
^
fgpen
));
do_put_mem_byte
(
addr
,
(
uae_u8
)
(
do_get_mem_byte
(
addr
)
^
fgpen
));
}
}
break
;
break
;
case
2
:
case
2
:
{
{
uae_u16
*
addr
=
((
uae_u16
*
)
uae_mem2
)
+
bits
;
uae_u16
*
addr
=
((
uae_u16
*
)
uae_mem2
)
+
bits
;
do_put_mem_word
(
addr
,
(
uae_u16
)
(
do_get_mem_word
(
addr
)
^
fgpen
));
do_put_mem_word
(
addr
,
(
uae_u16
)
(
do_get_mem_word
(
addr
)
^
fgpen
));
}
}
break
;
break
;
case
3
:
case
3
:
{
{
uae_u32
*
addr
=
(
uae_u32
*
)(
uae_mem2
+
bits
*
3
);
uae_u32
*
addr
=
(
uae_u32
*
)(
uae_mem2
+
bits
*
3
);
do_put_mem_long
(
addr
,
do_get_mem_long
(
addr
)
^
(
fgpen
&
0x00FFFFFF
));
do_put_mem_long
(
addr
,
do_get_mem_long
(
addr
)
^
(
fgpen
&
0x00FFFFFF
));
}
}
break
;
break
;
case
4
:
case
4
:
{
{
uae_u32
*
addr
=
((
uae_u32
*
)
uae_mem2
)
+
bits
;
uae_u32
*
addr
=
((
uae_u32
*
)
uae_mem2
)
+
bits
;
do_put_mem_long
(
addr
,
do_get_mem_long
(
addr
)
^
fgpen
);
do_put_mem_long
(
addr
,
do_get_mem_long
(
addr
)
^
fgpen
);
}
}
break
;
break
;
}
/* switch (Bpp) */
}
/* switch (Bpp) */
...
@@ -2296,7 +2288,7 @@ uae_u32 picasso_BlitTemplate (void)
...
@@ -2296,7 +2288,7 @@ uae_u32 picasso_BlitTemplate (void)
uae_u32
picasso_CalculateBytesPerRow
(
void
)
uae_u32
picasso_CalculateBytesPerRow
(
void
)
{
{
uae_u16
width
=
m68k_dreg
(
regs
,
0
);
uae_u16
width
=
m68k_dreg
(
regs
,
0
);
uae_u32
type
=
m68k_dreg
(
regs
,
7
);
uae_u32
type
=
m68k_dreg
(
regs
,
7
);
width
=
GetBytesPerPixel
(
type
)
*
width
;
width
=
GetBytesPerPixel
(
type
)
*
width
;
P96TRACE
((
"CalculateBytesPerRow() = %d
\n
"
,
width
));
P96TRACE
((
"CalculateBytesPerRow() = %d
\n
"
,
width
));
...
@@ -2332,7 +2324,7 @@ uae_u32 picasso_WaitVerticalSync (void)
...
@@ -2332,7 +2324,7 @@ uae_u32 picasso_WaitVerticalSync (void)
/* NOTE: Watch for those planeptrs of 0x00000000 and 0xFFFFFFFF for all zero / all one bitmaps !!!! */
/* NOTE: Watch for those planeptrs of 0x00000000 and 0xFFFFFFFF for all zero / all one bitmaps !!!! */
static
void
PlanarToChunky
(
struct
RenderInfo
*
ri
,
struct
BitMap
*
bm
,
static
void
PlanarToChunky
(
struct
RenderInfo
*
ri
,
struct
BitMap
*
bm
,
unsigned
long
srcx
,
unsigned
long
srcy
,
unsigned
long
srcx
,
unsigned
long
srcy
,
unsigned
long
dstx
,
unsigned
long
dsty
,
unsigned
long
width
,
unsigned
long
height
,
uae_u8
mask
)
unsigned
long
dstx
,
unsigned
long
dsty
,
unsigned
long
width
,
unsigned
long
height
,
uae_u8
mask
)
{
{
int
j
;
int
j
;
...
@@ -2418,16 +2410,16 @@ static void PlanarToChunky (struct RenderInfo *ri, struct BitMap *bm,
...
@@ -2418,16 +2410,16 @@ static void PlanarToChunky (struct RenderInfo *ri, struct BitMap *bm,
*/
*/
uae_u32
picasso_BlitPlanar2Chunky
(
void
)
uae_u32
picasso_BlitPlanar2Chunky
(
void
)
{
{
uaecptr
bm
=
m68k_areg
(
regs
,
1
);
uaecptr
bm
=
m68k_areg
(
regs
,
1
);
uaecptr
ri
=
m68k_areg
(
regs
,
2
);
uaecptr
ri
=
m68k_areg
(
regs
,
2
);
unsigned
long
srcx
=
(
uae_u16
)
m68k_dreg
(
regs
,
0
);
unsigned
long
srcx
=
(
uae_u16
)
m68k_dreg
(
regs
,
0
);
unsigned
long
srcy
=
(
uae_u16
)
m68k_dreg
(
regs
,
1
);
unsigned
long
srcy
=
(
uae_u16
)
m68k_dreg
(
regs
,
1
);
unsigned
long
dstx
=
(
uae_u16
)
m68k_dreg
(
regs
,
2
);
unsigned
long
dstx
=
(
uae_u16
)
m68k_dreg
(
regs
,
2
);
unsigned
long
dsty
=
(
uae_u16
)
m68k_dreg
(
regs
,
3
);
unsigned
long
dsty
=
(
uae_u16
)
m68k_dreg
(
regs
,
3
);
unsigned
long
width
=
(
uae_u16
)
m68k_dreg
(
regs
,
4
);
unsigned
long
width
=
(
uae_u16
)
m68k_dreg
(
regs
,
4
);
unsigned
long
height
=
(
uae_u16
)
m68k_dreg
(
regs
,
5
);
unsigned
long
height
=
(
uae_u16
)
m68k_dreg
(
regs
,
5
);
uae_u8
minterm
=
m68k_dreg
(
regs
,
6
)
&
0xFF
;
uae_u8
minterm
=
m68k_dreg
(
regs
,
6
)
&
0xFF
;
uae_u8
mask
=
m68k_dreg
(
regs
,
7
)
&
0xFF
;
uae_u8
mask
=
m68k_dreg
(
regs
,
7
)
&
0xFF
;
struct
RenderInfo
local_ri
;
struct
RenderInfo
local_ri
;
struct
BitMap
local_bm
;
struct
BitMap
local_bm
;
...
@@ -2438,7 +2430,7 @@ uae_u32 picasso_BlitPlanar2Chunky (void)
...
@@ -2438,7 +2430,7 @@ uae_u32 picasso_BlitPlanar2Chunky (void)
return
0
;
return
0
;
}
}
if
(
!
CopyRenderInfoStructureA2U
(
ri
,
&
local_ri
)
if
(
!
CopyRenderInfoStructureA2U
(
ri
,
&
local_ri
)
||
!
CopyBitMapStructureA2U
(
bm
,
&
local_bm
))
||
!
CopyBitMapStructureA2U
(
bm
,
&
local_bm
))
return
0
;
return
0
;
P96TRACE
((
"BlitPlanar2Chunky(%d, %d, %d, %d, %d, %d) Minterm 0x%x, Mask 0x%x, Depth %d
\n
"
,
P96TRACE
((
"BlitPlanar2Chunky(%d, %d, %d, %d, %d, %d) Minterm 0x%x, Mask 0x%x, Depth %d
\n
"
,
...
@@ -2452,8 +2444,8 @@ uae_u32 picasso_BlitPlanar2Chunky (void)
...
@@ -2452,8 +2444,8 @@ uae_u32 picasso_BlitPlanar2Chunky (void)
}
}
static
void
PlanarToDirect
(
struct
RenderInfo
*
ri
,
struct
BitMap
*
bm
,
static
void
PlanarToDirect
(
struct
RenderInfo
*
ri
,
struct
BitMap
*
bm
,
unsigned
long
srcx
,
unsigned
long
srcy
,
unsigned
long
srcx
,
unsigned
long
srcy
,
unsigned
long
dstx
,
unsigned
long
dsty
,
unsigned
long
dstx
,
unsigned
long
dsty
,
unsigned
long
width
,
unsigned
long
height
,
uae_u8
mask
,
struct
ColorIndexMapping
*
cim
)
unsigned
long
width
,
unsigned
long
height
,
uae_u8
mask
,
struct
ColorIndexMapping
*
cim
)
{
{
int
j
;
int
j
;
...
@@ -2556,16 +2548,16 @@ static void PlanarToDirect (struct RenderInfo *ri, struct BitMap *bm,
...
@@ -2556,16 +2548,16 @@ static void PlanarToDirect (struct RenderInfo *ri, struct BitMap *bm,
uae_u32
picasso_BlitPlanar2Direct
(
void
)
uae_u32
picasso_BlitPlanar2Direct
(
void
)
{
{
uaecptr
bm
=
m68k_areg
(
regs
,
1
);
uaecptr
bm
=
m68k_areg
(
regs
,
1
);
uaecptr
ri
=
m68k_areg
(
regs
,
2
);
uaecptr
ri
=
m68k_areg
(
regs
,
2
);
uaecptr
cim
=
m68k_areg
(
regs
,
3
);
uaecptr
cim
=
m68k_areg
(
regs
,
3
);
unsigned
long
srcx
=
(
uae_u16
)
m68k_dreg
(
regs
,
0
);
unsigned
long
srcx
=
(
uae_u16
)
m68k_dreg
(
regs
,
0
);
unsigned
long
srcy
=
(
uae_u16
)
m68k_dreg
(
regs
,
1
);
unsigned
long
srcy
=
(
uae_u16
)
m68k_dreg
(
regs
,
1
);
unsigned
long
dstx
=
(
uae_u16
)
m68k_dreg
(
regs
,
2
);
unsigned
long
dstx
=
(
uae_u16
)
m68k_dreg
(
regs
,
2
);
unsigned
long
dsty
=
(
uae_u16
)
m68k_dreg
(
regs
,
3
);
unsigned
long
dsty
=
(
uae_u16
)
m68k_dreg
(
regs
,
3
);
unsigned
long
width
=
(
uae_u16
)
m68k_dreg
(
regs
,
4
);
unsigned
long
width
=
(
uae_u16
)
m68k_dreg
(
regs
,
4
);
unsigned
long
height
=
(
uae_u16
)
m68k_dreg
(
regs
,
5
);
unsigned
long
height
=
(
uae_u16
)
m68k_dreg
(
regs
,
5
);
uae_u8
minterm
=
m68k_dreg
(
regs
,
6
);
uae_u8
minterm
=
m68k_dreg
(
regs
,
6
);
uae_u8
Mask
=
m68k_dreg
(
regs
,
7
);
uae_u8
Mask
=
m68k_dreg
(
regs
,
7
);
struct
RenderInfo
local_ri
;
struct
RenderInfo
local_ri
;
struct
BitMap
local_bm
;
struct
BitMap
local_bm
;
...
@@ -2581,8 +2573,8 @@ uae_u32 picasso_BlitPlanar2Direct (void)
...
@@ -2581,8 +2573,8 @@ uae_u32 picasso_BlitPlanar2Direct (void)
if
(
minterm
!=
0x0C
)
{
if
(
minterm
!=
0x0C
)
{
write_log
(
"WARNING - BlitPlanar2Direct() has unhandled op-code 0x%x. Using fall-back routine.
\n
"
,
minterm
);
write_log
(
"WARNING - BlitPlanar2Direct() has unhandled op-code 0x%x. Using fall-back routine.
\n
"
,
minterm
);
}
else
if
(
CopyRenderInfoStructureA2U
(
ri
,
&
local_ri
)
&&
CopyBitMapStructureA2U
(
bm
,
&
local_bm
))
{
}
else
if
(
CopyRenderInfoStructureA2U
(
ri
,
&
local_ri
)
&&
CopyBitMapStructureA2U
(
bm
,
&
local_bm
))
{
Mask
=
0xFF
;
Mask
=
0xFF
;
CopyColorIndexMappingA2U
(
cim
,
&
local_cim
);
CopyColorIndexMappingA2U
(
cim
,
&
local_cim
);
P96TRACE
((
"BlitPlanar2Direct(%d, %d, %d, %d, %d, %d) Minterm 0x%x, Mask 0x%x, Depth %d
\n
"
,
P96TRACE
((
"BlitPlanar2Direct(%d, %d, %d, %d, %d, %d) Minterm 0x%x, Mask 0x%x, Depth %d
\n
"
,
srcx
,
srcy
,
dstx
,
dsty
,
width
,
height
,
minterm
,
Mask
,
local_bm
.
Depth
));
srcx
,
srcy
,
dstx
,
dsty
,
width
,
height
,
minterm
,
Mask
,
local_bm
.
Depth
));
...
@@ -2590,7 +2582,7 @@ uae_u32 picasso_BlitPlanar2Direct (void)
...
@@ -2590,7 +2582,7 @@ uae_u32 picasso_BlitPlanar2Direct (void)
PlanarToDirect
(
&
local_ri
,
&
local_bm
,
srcx
,
srcy
,
dstx
,
dsty
,
width
,
height
,
Mask
,
&
local_cim
);
PlanarToDirect
(
&
local_ri
,
&
local_bm
,
srcx
,
srcy
,
dstx
,
dsty
,
width
,
height
,
Mask
,
&
local_cim
);
if
(
renderinfo_is_current_screen
(
&
local_ri
))
if
(
renderinfo_is_current_screen
(
&
local_ri
))
do_blit
(
&
local_ri
,
GetBytesPerPixel
(
local_ri
.
RGBFormat
),
dstx
,
dsty
,
dstx
,
dsty
,
width
,
height
,
BLIT_SRC
,
0
);
do_blit
(
&
local_ri
,
GetBytesPerPixel
(
local_ri
.
RGBFormat
),
dstx
,
dsty
,
dstx
,
dsty
,
width
,
height
,
BLIT_SRC
,
0
);
result
=
1
;
result
=
1
;
}
}
return
result
;
return
result
;
}
}
...
@@ -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
);
...
@@ -2868,13 +2860,13 @@ void InitPicasso96 (void)
...
@@ -2868,13 +2860,13 @@ void InitPicasso96 (void)
for
(
i
=
0
;
i
<
256
;
i
++
)
{
for
(
i
=
0
;
i
<
256
;
i
++
)
{
p2ctab
[
i
][
0
]
=
(((
i
&
128
)
?
0x01000000
:
0
)
p2ctab
[
i
][
0
]
=
(((
i
&
128
)
?
0x01000000
:
0
)
|
((
i
&
64
)
?
0x010000
:
0
)
|
((
i
&
64
)
?
0x010000
:
0
)
|
((
i
&
32
)
?
0x0100
:
0
)
|
((
i
&
32
)
?
0x0100
:
0
)
|
((
i
&
16
)
?
0x01
:
0
));
|
((
i
&
16
)
?
0x01
:
0
));
p2ctab
[
i
][
1
]
=
(((
i
&
8
)
?
0x01000000
:
0
)
p2ctab
[
i
][
1
]
=
(((
i
&
8
)
?
0x01000000
:
0
)
|
((
i
&
4
)
?
0x010000
:
0
)
|
((
i
&
4
)
?
0x010000
:
0
)
|
((
i
&
2
)
?
0x0100
:
0
)
|
((
i
&
2
)
?
0x0100
:
0
)
|
((
i
&
1
)
?
0x01
:
0
));
|
((
i
&
1
)
?
0x01
:
0
));
}
}
mode_count
=
DX_FillResolutions
(
&
picasso96_pixel_format
);
mode_count
=
DX_FillResolutions
(
&
picasso96_pixel_format
);
qsort
(
DisplayModes
,
mode_count
,
sizeof
(
struct
PicassoResolution
),
resolution_compare
);
qsort
(
DisplayModes
,
mode_count
,
sizeof
(
struct
PicassoResolution
),
resolution_compare
);
...
...
src/rommgr.c
View file @
8f059ce4
/*
/*
* UAE - The Un*x Amiga Emulator
* UAE - The Un*x Amiga Emulator
*
*
* ROM file management
* ROM file management
*
*
*/
*/
#include "sysconfig.h"
#include "sysconfig.h"
#include "sysdeps.h"
#include "sysdeps.h"
...
@@ -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
);
...
@@ -1560,7 +1560,7 @@ ACTION REPLAY
...
@@ -1560,7 +1560,7 @@ ACTION REPLAY
Model (1,2,3) 4
Model (1,2,3) 4
path to rom image
path to rom image
RAM space (depends on model)
RAM space (depends on model)
ROM CRC
4
ROM CRC 4
"CDx "
"CDx "
...
...
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