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
9c62ae30
Commit
9c62ae30
authored
Feb 18, 2011
by
GnoStiC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
puae 2.3.1
parent
a746c3ae
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
165 additions
and
25 deletions
+165
-25
configure.in
configure.in
+6
-0
custom.c
src/custom.c
+1
-1
cocoaui.m
src/gui-cocoa/cocoaui.m
+122
-22
support.c
src/md-i386-gcc/support.c
+36
-2
No files found.
configure.in
View file @
9c62ae30
...
@@ -1757,6 +1757,12 @@ have_sse2=no
...
@@ -1757,6 +1757,12 @@ have_sse2=no
have_sse=no
have_sse=no
have_3dnow=no
have_3dnow=no
dnl -- macos
if [[ "x$OSDEP" = "xod-macosx" ]]; then
have_mmx=no
fi
dnl -- linux
CPUFLAGS=`cat /proc/cpuinfo | grep flags`
CPUFLAGS=`cat /proc/cpuinfo | grep flags`
AC_MSG_CHECKING([host cpu MMX support])
AC_MSG_CHECKING([host cpu MMX support])
if grep "^flags.* mmx" /proc/cpuinfo > /dev/null; then
if grep "^flags.* mmx" /proc/cpuinfo > /dev/null; then
...
...
src/custom.c
View file @
9c62ae30
...
@@ -5063,7 +5063,7 @@ static void fpscounter (void)
...
@@ -5063,7 +5063,7 @@ static void fpscounter (void)
timeframes
++
;
timeframes
++
;
if
((
timeframes
%
mcnt
)
==
0
)
{
if
((
timeframes
%
mcnt
)
==
0
)
{
double
idle
=
1000
-
(
idletime
==
0
?
0
.
0
:
(
double
)
idletime
*
1000
.
0
/
(
vsynctime
*
mcnt
));
double
idle
=
1000
-
(
idletime
==
0
?
0
.
0
:
(
double
)
idletime
*
1000
.
0
/
(
vsynctime
*
mcnt
));
int
fps
=
frametime2
==
0
?
0
:
(
syncbase
*
mcnt
)
/
(
frametime2
/
10
);
int
fps
=
frametime2
==
0
?
0
:
(
int
)(
syncbase
*
mcnt
)
/
(
int
)
(
frametime2
/
10
);
if
(
fps
>
9999
)
if
(
fps
>
9999
)
fps
=
9999
;
fps
=
9999
;
if
(
idle
<
0
)
if
(
idle
<
0
)
...
...
src/gui-cocoa/cocoaui.m
View file @
9c62ae30
...
@@ -101,6 +101,7 @@ static BOOL wasFullscreen = NO; // used by ensureNotFullscreen() and restoreFull
...
@@ -101,6 +101,7 @@ static BOOL wasFullscreen = NO; // used by ensureNotFullscreen() and restoreFull
NSArray
*
KickRomTypes
;
NSArray
*
KickRomTypes
;
NSArray
*
FlashRamTypes
;
NSArray
*
FlashRamTypes
;
NSArray
*
CartridgeTypes
;
NSArray
*
CartridgeTypes
;
NSArray
*
SaveStateTypes
;
}
}
+
(
id
)
sharedInstance
;
+
(
id
)
sharedInstance
;
-
(
void
)
createMenus
;
-
(
void
)
createMenus
;
...
@@ -158,9 +159,10 @@ static BOOL wasFullscreen = NO; // used by ensureNotFullscreen() and restoreFull
...
@@ -158,9 +159,10 @@ static BOOL wasFullscreen = NO; // used by ensureNotFullscreen() and restoreFull
#endif
#endif
nil
];
// Note: Use lowercase for these
nil
];
// Note: Use lowercase for these
KickRomTypes
=
[[
NSArray
alloc
]
initWithObjects
:
@"rom"
,
@"roz"
];
KickRomTypes
=
[[
NSArray
alloc
]
initWithObjects
:
@"rom"
,
@"roz"
,
nil
];
FlashRamTypes
=
[[
NSArray
alloc
]
initWithObjects
:
@"nvr"
];
FlashRamTypes
=
[[
NSArray
alloc
]
initWithObjects
:
@"nvr"
,
nil
];
CartridgeTypes
=
[[
NSArray
alloc
]
initWithObjects
:
@"cart"
,
@"rom"
,
@"roz"
];
CartridgeTypes
=
[[
NSArray
alloc
]
initWithObjects
:
@"crt"
,
@"rom"
,
@"roz"
,
nil
];
SaveStateTypes
=
[[
NSArray
alloc
]
initWithObjects
:
@"uss"
,
nil
];
}
}
return
self
;
return
self
;
...
@@ -223,6 +225,11 @@ static BOOL wasFullscreen = NO; // used by ensureNotFullscreen() and restoreFull
...
@@ -223,6 +225,11 @@ static BOOL wasFullscreen = NO; // used by ensureNotFullscreen() and restoreFull
[
vAmigaMenu
addItem
:[
NSMenuItem
separatorItem
]];
[
vAmigaMenu
addItem
:[
NSMenuItem
separatorItem
]];
[
self
createMenuItemInMenu
:
vAmigaMenu
withTitle
:
@"Save State"
action
:
@selector
(
selectSaveState
:
)
tag
:
0
];
[
self
createMenuItemInMenu
:
vAmigaMenu
withTitle
:
@"Load State"
action
:
@selector
(
selectLoadState
:
)
tag
:
0
];
[
vAmigaMenu
addItem
:[
NSMenuItem
separatorItem
]];
[
self
createMenuItemInMenu
:
vAmigaMenu
withTitle
:
@"Select Kick ROM"
action
:
@selector
(
selectKickROM
:
)
tag
:
0
];
[
self
createMenuItemInMenu
:
vAmigaMenu
withTitle
:
@"Select Kick ROM"
action
:
@selector
(
selectKickROM
:
)
tag
:
0
];
[
self
createMenuItemInMenu
:
vAmigaMenu
withTitle
:
@"Select Cartridge ROM"
action
:
@selector
(
selectCartridge
:
)
tag
:
0
];
[
self
createMenuItemInMenu
:
vAmigaMenu
withTitle
:
@"Select Cartridge ROM"
action
:
@selector
(
selectCartridge
:
)
tag
:
0
];
[
self
createMenuItemInMenu
:
vAmigaMenu
withTitle
:
@"Select Flash RAM"
action
:
@selector
(
selectFlashRAM
:
)
tag
:
0
];
[
self
createMenuItemInMenu
:
vAmigaMenu
withTitle
:
@"Select Flash RAM"
action
:
@selector
(
selectFlashRAM
:
)
tag
:
0
];
...
@@ -949,7 +956,7 @@ static BOOL wasFullscreen = NO; // used by ensureNotFullscreen() and restoreFull
...
@@ -949,7 +956,7 @@ static BOOL wasFullscreen = NO; // used by ensureNotFullscreen() and restoreFull
// Invoked when the user selects "Eject All Disks"
// Invoked when the user selects "Eject All Disks"
-
(
void
)
ejectAllDisks
:
(
id
)
sender
-
(
void
)
ejectAllDisks
:
(
id
)
sender
{
{
int
i
;
unsigned
int
i
;
for
(
i
=
0
;
i
<
4
;
i
++
)
for
(
i
=
0
;
i
<
4
;
i
++
)
if
((
!
gui_data
.
drive_disabled
[
i
])
&&
(
!
disk_empty
(
i
)))
if
((
!
gui_data
.
drive_disabled
[
i
])
&&
(
!
disk_empty
(
i
)))
disk_eject
(
i
);
disk_eject
(
i
);
...
@@ -1055,7 +1062,7 @@ static BOOL wasFullscreen = NO; // used by ensureNotFullscreen() and restoreFull
...
@@ -1055,7 +1062,7 @@ static BOOL wasFullscreen = NO; // used by ensureNotFullscreen() and restoreFull
}
}
// kick.rom
// kick.rom
-
(
void
)
displayOpenPanelForKickROM
:
(
i
d
)
sender
-
(
void
)
displayOpenPanelForKickROM
:
(
i
nt
)
foo
{
{
ensureNotFullscreen
();
ensureNotFullscreen
();
...
@@ -1067,7 +1074,7 @@ static BOOL wasFullscreen = NO; // used by ensureNotFullscreen() and restoreFull
...
@@ -1067,7 +1074,7 @@ static BOOL wasFullscreen = NO; // used by ensureNotFullscreen() and restoreFull
[
oPanel
setMessage
:
@"Select Kick ROM"
];
[
oPanel
setMessage
:
@"Select Kick ROM"
];
[
oPanel
setPrompt
:
@"Select"
];
[
oPanel
setPrompt
:
@"Select"
];
NSString
*
contextInfo
=
""
;
NSString
*
contextInfo
=
[[
NSString
alloc
]
initWithString
:
@"kick"
]
;
// recall the path of kick rom that was loaded last time
// recall the path of kick rom that was loaded last time
NSString
*
nskickpath
=
[[
NSUserDefaults
standardUserDefaults
]
stringForKey
:
@"LastUsedKickPath"
];
NSString
*
nskickpath
=
[[
NSUserDefaults
standardUserDefaults
]
stringForKey
:
@"LastUsedKickPath"
];
...
@@ -1111,7 +1118,7 @@ static BOOL wasFullscreen = NO; // used by ensureNotFullscreen() and restoreFull
...
@@ -1111,7 +1118,7 @@ static BOOL wasFullscreen = NO; // used by ensureNotFullscreen() and restoreFull
}
}
// flash.rom
// flash.rom
-
(
void
)
displayOpenPanelForFlashRAM
:
(
i
d
)
sender
-
(
void
)
displayOpenPanelForFlashRAM
:
(
i
nt
)
foo
{
{
ensureNotFullscreen
();
ensureNotFullscreen
();
...
@@ -1123,9 +1130,9 @@ static BOOL wasFullscreen = NO; // used by ensureNotFullscreen() and restoreFull
...
@@ -1123,9 +1130,9 @@ static BOOL wasFullscreen = NO; // used by ensureNotFullscreen() and restoreFull
[
oPanel
setMessage
:
@"Select Flash RAM"
];
[
oPanel
setMessage
:
@"Select Flash RAM"
];
[
oPanel
setPrompt
:
@"Select"
];
[
oPanel
setPrompt
:
@"Select"
];
NSString
*
contextInfo
=
""
;
NSString
*
contextInfo
=
[[
NSString
alloc
]
initWithString
:
@"flash"
]
;
// recall the path of
kick ro
m that was loaded last time
// recall the path of
flash ra
m that was loaded last time
NSString
*
nsflashpath
=
[[
NSUserDefaults
standardUserDefaults
]
stringForKey
:
@"LastUsedFlashPath"
];
NSString
*
nsflashpath
=
[[
NSUserDefaults
standardUserDefaults
]
stringForKey
:
@"LastUsedFlashPath"
];
// If the configuration includes a setting for the "flash_path" attribute
// If the configuration includes a setting for the "flash_path" attribute
...
@@ -1167,7 +1174,7 @@ static BOOL wasFullscreen = NO; // used by ensureNotFullscreen() and restoreFull
...
@@ -1167,7 +1174,7 @@ static BOOL wasFullscreen = NO; // used by ensureNotFullscreen() and restoreFull
}
}
// cartridge rom
// cartridge rom
-
(
void
)
displayOpenPanelForCartridge
:
(
i
d
)
sender
-
(
void
)
displayOpenPanelForCartridge
:
(
i
nt
)
foo
{
{
ensureNotFullscreen
();
ensureNotFullscreen
();
...
@@ -1179,9 +1186,9 @@ static BOOL wasFullscreen = NO; // used by ensureNotFullscreen() and restoreFull
...
@@ -1179,9 +1186,9 @@ static BOOL wasFullscreen = NO; // used by ensureNotFullscreen() and restoreFull
[
oPanel
setMessage
:
@"Select Cartridge ROM"
];
[
oPanel
setMessage
:
@"Select Cartridge ROM"
];
[
oPanel
setPrompt
:
@"Select"
];
[
oPanel
setPrompt
:
@"Select"
];
NSString
*
contextInfo
=
""
;
NSString
*
contextInfo
=
[[
NSString
alloc
]
initWithString
:
@"cart"
]
;
// recall the path of
kick rom
that was loaded last time
// recall the path of
cartridge
that was loaded last time
NSString
*
nscartpath
=
[[
NSUserDefaults
standardUserDefaults
]
stringForKey
:
@"LastUsedCartPath"
];
NSString
*
nscartpath
=
[[
NSUserDefaults
standardUserDefaults
]
stringForKey
:
@"LastUsedCartPath"
];
// If the configuration includes a setting for the "cart_path" attribute
// If the configuration includes a setting for the "cart_path" attribute
...
@@ -1222,6 +1229,62 @@ static BOOL wasFullscreen = NO; // used by ensureNotFullscreen() and restoreFull
...
@@ -1222,6 +1229,62 @@ static BOOL wasFullscreen = NO; // used by ensureNotFullscreen() and restoreFull
[[
NSUserDefaults
standardUserDefaults
]
setObject
:[
file
stringByDeletingLastPathComponent
]
forKey
:
@"LastUsedCartPath"
];
[[
NSUserDefaults
standardUserDefaults
]
setObject
:[
file
stringByDeletingLastPathComponent
]
forKey
:
@"LastUsedCartPath"
];
}
}
// load save state
-
(
void
)
displayOpenPanelForLoadSate
:
(
id
)
sender
{
ensureNotFullscreen
();
NSOpenPanel
*
oPanel
=
[
NSOpenPanel
openPanel
];
[
oPanel
setTitle
:
@"Select a Save State to Load"
];
// make sure setMessage (OS X 10.3+) is available before calling it
if
([
oPanel
respondsToSelector
:
@selector
(
setMessage
:)])
[
oPanel
setMessage
:
@"Select a Save State to Load"
];
[
oPanel
setPrompt
:
@"Select"
];
NSString
*
contextInfo
=
[[
NSString
alloc
]
initWithString
:
@"loadstate"
];
// recall the path of save state that was loaded last time
NSString
*
nssavestatepath
=
[[
NSUserDefaults
standardUserDefaults
]
stringForKey
:
@"LastUsedSaveStatePath"
];
// If the configuration includes a setting for the "savestate_path" attribute
// start the OpenPanel in that directory.. but only the first time.
static
int
sstate_run_once
=
0
;
if
(
!
sstate_run_once
)
{
sstate_run_once
++
;
const
char
*
savestate_path
=
currprefs
.
cartfile
;
if
(
savestate_path
!=
NULL
)
{
char
homedir
[
MAX_PATH
];
snprintf
(
homedir
,
MAX_PATH
,
"%s/"
,
getenv
(
"HOME"
));
// default value for savestate_path is "$HOME/"
if
(
strncmp
(
savestate_path
,
homedir
,
MAX_PATH
)
!=
0
)
nssavestatepath
=
[
NSString
stringWithCString
:
savestate_path
encoding
:
NSASCIIStringEncoding
];
}
}
[
oPanel
beginSheetForDirectory
:
nssavestatepath
file
:
nil
types
:
SaveStateTypes
modalForWindow
:
[
NSApp
mainWindow
]
modalDelegate
:
self
didEndSelector
:
@selector
(
selectLoadStatePanelDidEnd
:
returnCode
:
contextInfo
:
)
contextInfo
:
contextInfo
];
}
// called after load a save state selection panel
-
(
void
)
selectLoadStatePanelDidEnd
:
(
NSOpenPanel
*
)
sheet
returnCode
:
(
int
)
returnCode
contextInfo
:
(
void
*
)
contextInfo
{
if
(
returnCode
!=
NSOKButton
)
return
;
NSArray
*
files
=
[
sheet
filenames
];
NSString
*
file
=
[
files
objectAtIndex
:
0
];
// lossyASCIICopy (changed_prefs.cartfile, file, COCOA_GUI_MAX_PATH);
[[
NSUserDefaults
standardUserDefaults
]
setObject
:[
file
stringByDeletingLastPathComponent
]
forKey
:
@"LastUsedSaveStatePath"
];
}
-
(
void
)
hebeHebe
:
(
id
)
sender
-
(
void
)
hebeHebe
:
(
id
)
sender
{
{
NSRect
frame
=
NSMakeRect
(
100
,
100
,
200
,
200
);
NSRect
frame
=
NSMakeRect
(
100
,
100
,
200
,
200
);
...
@@ -1572,36 +1635,73 @@ void cocoa_gui_early_setup (void)
...
@@ -1572,36 +1635,73 @@ void cocoa_gui_early_setup (void)
int
gui_init
(
void
)
int
gui_init
(
void
)
{
{
// read_rom_list ();
inputdevice_updateconfig
(
&
changed_prefs
);
return
1
;
}
}
int
gui_update
(
void
)
int
gui_update
(
void
)
{
{
return
0
;
return
1
;
}
}
void
gui_exit
(
void
)
void
gui_exit
(
void
)
{
{
}
}
void
gui_fps
(
int
fps
,
int
idle
)
static
void
gui_flicker_led2
(
int
led
,
int
unitnum
,
int
status
)
{
{
gui_data
.
fps
=
fps
;
static
int
resetcounter
[
LED_MAX
];
gui_data
.
idle
=
idle
;
uae_u8
old
;
uae_u8
*
p
;
if
(
led
==
LED_HD
)
p
=
&
gui_data
.
hd
;
else
if
(
led
==
LED_CD
)
p
=
&
gui_data
.
cd
;
else
if
(
led
==
LED_MD
)
p
=
&
gui_data
.
md
;
else
return
;
old
=
*
p
;
if
(
status
==
0
)
{
resetcounter
[
led
]
--
;
if
(
resetcounter
[
led
]
>
0
)
return
;
}
*
p
=
status
;
resetcounter
[
led
]
=
6
;
if
(
old
!=
*
p
)
gui_led
(
led
,
*
p
);
}
}
void
gui_flicker_led
(
int
led
,
int
unitnum
,
int
status
)
void
gui_flicker_led
(
int
led
,
int
unitnum
,
int
status
)
{
{
if
(
led
<
0
)
{
gui_flicker_led2
(
LED_HD
,
0
,
0
);
gui_flicker_led2
(
LED_CD
,
0
,
0
);
gui_flicker_led2
(
LED_MD
,
0
,
0
);
}
else
{
gui_flicker_led2
(
led
,
unitnum
,
status
);
}
}
}
void
gui_
led
(
int
led
,
int
on
)
void
gui_
fps
(
int
fps
,
int
idle
)
{
{
gui_data
.
fps
=
0
;
//LATER: fps
gui_data
.
idle
=
0
;
//LATER: idle
gui_led
(
LED_FPS
,
0
);
gui_led
(
LED_CPU
,
0
);
gui_led
(
LED_SND
,
(
gui_data
.
sndbuf_status
>
1
||
gui_data
.
sndbuf_status
<
0
)
?
0
:
1
);
}
}
void
gui_
filename
(
int
num
,
const
char
*
name
)
void
gui_
led
(
int
led
,
int
on
)
{
{
}
}
static
void
getline
(
char
*
p
)
void
gui_filename
(
int
num
,
const
char
*
name
)
{
{
}
}
...
...
src/md-i386-gcc/support.c
View file @
9c62ae30
...
@@ -80,6 +80,38 @@ static frame_time_t beos_get_tsc_freq (void)
...
@@ -80,6 +80,38 @@ static frame_time_t beos_get_tsc_freq (void)
}
}
#endif
#endif
#ifdef __APPLE__
frame_time_t
apple_get_tsc_freq
(
void
)
{
int
sysctl_hw
;
char
buffer
[
1024
];
uae_s64
tsc_freq
=
0
;
sysctl_hw
=
open
(
"sysctl -a hw"
,
O_RDONLY
);
if
(
sysctl_hw
>=
0
)
{
char
*
ptr
=
&
buffer
[
0
];
int
size_read
=
read
(
sysctl_hw
,
ptr
,
1024
);
while
(
size_read
>
0
)
{
if
(
strncmp
(
ptr
,
"hw.cpufrequency: "
,
17
)
!=
0
)
{
while
((
size_read
--
>
0
)
&&
(
*
ptr
!=
'\n'
))
ptr
++
;
size_read
--
;
ptr
++
;
continue
;
}
else
{
ptr
+=
17
;
tsc_freq
=
atoll
(
ptr
)
*
1000000
/
2
;
}
}
}
close
(
sysctl_hw
);
return
tsc_freq
;
}
#endif
static
volatile
frame_time_t
last_time
,
best_time
;
static
volatile
frame_time_t
last_time
,
best_time
;
static
frame_time_t
timebase
;
static
frame_time_t
timebase
;
...
@@ -179,6 +211,9 @@ int machdep_inithrtimer (void)
...
@@ -179,6 +211,9 @@ int machdep_inithrtimer (void)
#ifdef __BEOS__
#ifdef __BEOS__
timebase
=
beos_get_tsc_freq
();
timebase
=
beos_get_tsc_freq
();
#endif
#endif
#ifdef __APPLE__
// timebase = apple_get_tsc_freq ();
#endif
#endif
#endif
if
(
timebase
<=
0
)
{
if
(
timebase
<=
0
)
{
...
@@ -218,7 +253,6 @@ int machdep_inithrtimer (void)
...
@@ -218,7 +253,6 @@ int machdep_inithrtimer (void)
}
}
write_log
(
"TSC frequency: %f MHz
\n
"
,
timebase
/
1000000
.
0
);
write_log
(
"TSC frequency: %f MHz
\n
"
,
timebase
/
1000000
.
0
);
done
=
1
;
done
=
1
;
}
}
return
done
;
return
done
;
...
...
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