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
9657f1c9
Commit
9657f1c9
authored
Dec 21, 2010
by
GnoStiC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
puae 2.3.1
parent
226404ac
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
188 additions
and
26 deletions
+188
-26
puae_bridge.cpp
src/gui-qt/puae_bridge.cpp
+170
-5
puae_bridge.h
src/gui-qt/puae_bridge.h
+5
-0
puae_mainwindow.h
src/gui-qt/puae_mainwindow.h
+1
-1
puae_registry.h
src/gui-qt/puae_registry.h
+12
-20
No files found.
src/gui-qt/puae_bridge.cpp
View file @
9657f1c9
...
...
@@ -14,13 +14,29 @@
#include "puae_mainwindow.h"
//#include "ui_puae_mainwindow.h"
static
unsigned
int
gui_available
;
extern
"C"
{
#include "puae_registry.h"
#include "gui.h"
#include "options.h"
#include "writelog.h"
extern
struct
uae_prefs
workprefs
;
extern
void
romlist_clear
(
void
);
extern
int
load_keyring
(
struct
uae_prefs
*
p
,
const
char
*
path
);
extern
int
scan_roms
(
int
);
}
static
unsigned
int
gui_available
;
static
int
allow_quit
;
static
int
restart_requested
;
static
int
full_property_sheet
=
1
;
static
struct
uae_prefs
*
pguiprefs
;
static
int
currentpage
;
static
int
qs_request_reset
;
static
int
qs_override
;
int
gui_active
;
static
int
forceroms
;
/*
*
*
...
...
@@ -46,12 +62,93 @@ extern "C" void cocoa_gui_early_setup (void)
{
}
void
read_rom_list
(
void
)
{
char
tmp2
[
1000
];
int
idx
,
idx2
;
char
tmp
[
1000
];
int
size
,
size2
,
exists
;
romlist_clear
();
exists
=
regexiststree
(
"DetectedROMs"
);
if
(
!
exists
||
forceroms
)
{
load_keyring
(
NULL
,
NULL
);
scan_roms
(
forceroms
?
0
:
1
);
}
forceroms
=
0
;
}
static
void
prefs_to_gui
(
struct
uae_prefs
*
p
)
{
workprefs
=
*
p
;
/* filesys hack */
workprefs
.
mountitems
=
currprefs
.
mountitems
;
memcpy
(
&
workprefs
.
mountconfig
,
&
currprefs
.
mountconfig
,
MOUNT_CONFIG_SIZE
*
sizeof
(
struct
uaedev_config_info
));
//updatewinfsmode (&workprefs);
}
static
void
gui_to_prefs
(
void
)
{
/* Always copy our prefs to changed_prefs, ... */
changed_prefs
=
workprefs
;
/* filesys hack */
currprefs
.
mountitems
=
changed_prefs
.
mountitems
;
memcpy
(
&
currprefs
.
mountconfig
,
&
changed_prefs
.
mountconfig
,
MOUNT_CONFIG_SIZE
*
sizeof
(
struct
uaedev_config_info
));
fixup_prefs
(
&
changed_prefs
);
//updatewinfsmode (&changed_prefs);
}
int
GetSettings
(
int
all_options
)
{
static
int
init_called
=
0
;
int
first
=
0
;
gui_active
++
;
full_property_sheet
=
all_options
;
allow_quit
=
all_options
;
pguiprefs
=
&
currprefs
;
memset
(
&
workprefs
,
0
,
sizeof
(
struct
uae_prefs
));
default_prefs
(
&
workprefs
,
0
);
prefs_to_gui
(
&
changed_prefs
);
if
(
!
init_called
)
{
first
=
1
;
init_called
=
1
;
}
if
(
first
)
write_log
(
"Entering GUI idle loop
\n
"
);
full_property_sheet
=
0
;
gui_active
--
;
return
0
;
}
int
gui_init
(
void
)
{
// MyThread *QT_GUI_Thread=new MyThread;
// QT_GUI_Thread->start();
return
0
;
int
ret
;
read_rom_list
();
inputdevice_updateconfig
(
&
workprefs
);
for
(;;)
{
ret
=
GetSettings
(
1
);
if
(
!
restart_requested
)
break
;
restart_requested
=
0
;
}
#ifdef AVIOUTPUT
if
(
ret
>
0
)
{
AVIOutput_Begin
();
}
#endif
return
ret
;
}
void
gui_exit
(
void
)
...
...
@@ -61,6 +158,7 @@ void gui_exit (void)
int
gui_update
(
void
)
{
return
1
;
}
void
gui_display
(
int
shortcut
)
...
...
@@ -97,18 +195,85 @@ extern "C" void gui_message (const char *format,...)
void
gui_fps
(
int
fps
,
int
idle
)
{
gui_data
.
fps
=
fps
;
gui_data
.
idle
=
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_handle_events
(
void
)
{
}
void
gui_led
(
int
num
,
int
on
)
void
gui_led
(
int
led
,
int
on
)
{
int
writing
=
0
,
playing
=
0
,
active2
=
0
;
int
center
=
0
;
if
(
led
>=
LED_DF0
&&
led
<=
LED_DF3
)
{
}
else
if
(
led
==
LED_POWER
)
{
}
else
if
(
led
==
LED_HD
)
{
if
(
on
>
1
)
writing
=
1
;
}
else
if
(
led
==
LED_CD
)
{
if
(
on
&
LED_CD_AUDIO
)
playing
=
1
;
else
if
(
on
&
LED_CD_ACTIVE2
)
active2
=
1
;
on
&=
1
;
}
else
if
(
led
==
LED_FPS
)
{
double
fps
=
(
double
)
gui_data
.
fps
/
10.0
;
if
(
fps
>
999.9
)
fps
=
999.9
;
}
else
if
(
led
==
LED_CPU
)
{
}
else
if
(
led
==
LED_SND
&&
gui_data
.
drive_disabled
[
3
])
{
}
else
if
(
led
==
LED_MD
)
{
}
}
static
void
gui_flicker_led2
(
int
led
,
int
unitnum
,
int
status
)
{
static
int
resetcounter
[
LED_MAX
];
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
;
}
#ifdef RETROPLATFORM
if
(
led
==
LED_HD
)
rp_hd_activity
(
unitnum
,
status
?
1
:
0
,
status
==
2
?
1
:
0
);
else
if
(
led
==
LED_CD
)
rp_cd_activity
(
unitnum
,
status
);
#endif
*
p
=
status
;
resetcounter
[
led
]
=
6
;
if
(
old
!=
*
p
)
gui_led
(
led
,
*
p
);
}
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_gameport_axis_change
(
int
port
,
int
axis
,
int
state
,
int
max
)
...
...
src/gui-qt/puae_bridge.h
View file @
9657f1c9
...
...
@@ -16,4 +16,9 @@ typedef long uae_s32;
#define MAX_DPATH 512
#define STATIC_INLINE static __inline__
extern
"C"
{
extern
void
inputdevice_updateconfig
(
struct
uae_prefs
*
prefs
);
}
extern
void
read_rom_list
(
void
);
#endif // PUAE_BRIDGE_H
src/gui-qt/puae_mainwindow.h
View file @
9657f1c9
...
...
@@ -18,7 +18,7 @@ public:
explicit
puae_MainWindow
(
QWidget
*
parent
=
0
);
~
puae_MainWindow
();
//
private:
private
:
Ui
::
puae_MainWindow
*
ui
;
private
slots
:
...
...
src/gui-qt/puae_registry.h
View file @
9657f1c9
#ifndef PUAE_REGISTRY_H
#define PUAE_REGISTRY_H
struct
UAEREG
{
char
*
fkey
;
char
*
inipath
;
};
extern
int
getregmode
(
void
);
extern
int
reginitializeinit
(
const
char
*
path
);
extern
void
regstatus
(
void
);
extern
int
regsetstr
(
UAEREG
*
,
const
char
*
name
,
const
char
*
str
);
extern
int
regsetint
(
UAEREG
*
,
const
char
*
name
,
int
val
);
extern
int
regqueryint
(
UAEREG
*
,
const
char
*
name
,
int
*
val
);
extern
int
regquerystr
(
UAEREG
*
,
const
char
*
name
,
char
*
str
,
int
*
size
);
extern
int
regdelete
(
UAEREG
*
,
const
char
*
name
);
extern
void
regdeletetree
(
UAEREG
*
,
const
char
*
name
);
extern
int
regsetstr
(
const
char
*
name
,
const
char
*
str
);
extern
int
regsetint
(
const
char
*
name
,
int
val
);
extern
int
regqueryint
(
const
char
*
name
,
int
*
val
);
extern
int
regquerystr
(
const
char
*
name
,
char
*
str
,
int
*
size
);
extern
int
reg
exists
(
UAEREG
*
,
const
char
*
name
);
extern
int
regexiststree
(
UAEREG
*
,
const
char
*
name
);
extern
int
reg
delete
(
const
char
*
name
);
extern
void
regdeletetree
(
const
char
*
name
);
extern
int
regquerydatasize
(
UAEREG
*
root
,
const
char
*
name
,
int
*
size
);
extern
int
regsetdata
(
UAEREG
*
,
const
char
*
name
,
const
void
*
str
,
int
size
);
extern
int
regquerydata
(
UAEREG
*
root
,
const
char
*
name
,
void
*
str
,
int
*
size
);
extern
int
regexists
(
const
char
*
name
);
extern
int
regexiststree
(
const
char
*
name
);
extern
int
regenumstr
(
UAEREG
*
,
int
idx
,
char
*
name
,
int
*
nsize
,
char
*
str
,
int
*
size
);
extern
int
regquerydatasize
(
const
char
*
name
,
int
*
size
);
extern
int
regsetdata
(
const
char
*
name
,
const
void
*
str
,
int
size
);
extern
int
regquerydata
(
const
char
*
name
,
void
*
str
,
int
*
size
);
extern
UAEREG
*
regcreatetree
(
UAEREG
*
,
const
char
*
name
);
extern
void
regclosetree
(
UAEREG
*
key
);
extern
int
regenumstr
(
int
idx
,
char
*
name
,
int
*
nsize
,
char
*
str
,
int
*
size
);
#endif // PUAE_REGISTRY_H
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