Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
RACE
Commits
2cf40232
Commit
2cf40232
authored
Dec 27, 2019
by
frangarcj
Browse files
DRZ80 + Logger
parent
deb11f4f
Changes
6
Hide whitespace changes
Inline
Side-by-side
DrZ80_support.cpp
View file @
2cf40232
...
...
@@ -11,7 +11,7 @@
//
#ifndef __GP32__
#include "
s
td
a
fx.h"
#include "
S
td
A
fx.h"
#endif
#include "main.h"
#include "memory.h"
...
...
Makefile.common
View file @
2cf40232
...
...
@@ -36,10 +36,14 @@ SOURCES_CXX := $(CORE_DIR)/input.cpp \
$(CORE_DIR)
/main.cpp
\
$(CORE_DIR)
/state.cpp
\
$(CORE_DIR)
/sound.cpp
\
$(CORE_DIR)
/libretro/libretro.cpp
$(CORE_DIR)
/libretro/libretro.cpp
\
$(CORE_DIR)
/libretro/log.cpp
ifeq
($(DRZ80),1)
FLAGS
+=
-DDRZ80
SOURCES_CXX
+=
$(CORE_DIR)
/DrZ80_support.cpp
SOURCES_ASM
:=
$(CORE_DIR)
/DrZ80.s
else
FLAGS
+=
-DCZ80
SOURCES_CXX
+=
$(CORE_DIR)
/cz80.cpp
\
...
...
libretro/libretro.cpp
View file @
2cf40232
#include "libretro.h"
#include "log.h"
#include <string.h>
#include <fstream>
...
...
@@ -137,10 +138,8 @@ static void check_variables(void)
}
void
retro_init
(
void
)
{
struct
retro_log_callback
log
;
environ_cb
(
RETRO_ENVIRONMENT_GET_LOG_INTERFACE
,
&
log
);
if
(
log
.
log
)
log_cb
=
log
.
log
;
/* set up some logging */
init_log
(
environ_cb
);
check_variables
();
...
...
@@ -250,8 +249,10 @@ static bool race_initialize_system(const char* gamepath)
{
mainemuinit
();
if
(
!
handleInputFile
((
char
*
)
gamepath
))
return
false
;
if
(
!
handleInputFile
((
char
*
)
gamepath
)){
handle_error
(
"ERROR handleInputFile"
);
return
false
;
}
return
true
;
}
...
...
libretro/log.cpp
0 → 100644
View file @
2cf40232
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include "libretro.h"
static
retro_log_printf_t
log_cb
;
void
init_log
(
retro_environment_t
environ_cb
)
{
struct
retro_log_callback
log
;
if
(
environ_cb
(
RETRO_ENVIRONMENT_GET_LOG_INTERFACE
,
&
log
))
log_cb
=
log
.
log
;
else
log_cb
=
NULL
;
}
void
handle_error
(
const
char
*
error
)
{
char
str
[
256
];
if
(
error
)
{
sprintf
(
str
,
"Error: %s"
,
error
);
log_cb
(
RETRO_LOG_ERROR
,
str
);
}
}
void
handle_info
(
const
char
*
info
)
{
char
str
[
256
];
if
(
info
)
{
sprintf
(
str
,
"Info: %s
\n
"
,
info
);
log_cb
(
RETRO_LOG_INFO
,
str
);
}
}
\ No newline at end of file
libretro/log.h
0 → 100644
View file @
2cf40232
#ifndef RACE_LIBRETRO_LOG_H__
#define RACE_LIBRETRO_LOG_H__
#include "libretro.h"
void
init_log
(
retro_environment_t
environ_cb
);
void
handle_error
(
const
char
*
error
);
void
handle_info
(
const
char
*
info
);
#endif
\ No newline at end of file
main.cpp
View file @
2cf40232
...
...
@@ -83,8 +83,10 @@ void mainemuinit()
// initialize the TLCS-900H cpu
tlcs_init
();
#if
defined(DRZ80) ||
defined(CZ80)
#if defined(CZ80)
Z80_Init
();
#endif
#if defined(DRZ80) || defined(CZ80)
Z80_Reset
();
#else
z80Init
();
...
...
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