mirror of
https://github.com/86Box/86Box.git
synced 2026-02-24 10:28:19 -07:00
Merge branch 'master' into pc98x1
This commit is contained in:
@@ -20,4 +20,181 @@
|
||||
#ifndef SOUND_OPL_NUKED_H
|
||||
#define SOUND_OPL_NUKED_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
#ifndef OPL_ENABLE_STEREOEXT
|
||||
#define OPL_ENABLE_STEREOEXT 0
|
||||
#endif
|
||||
|
||||
#define OPL_WRITEBUF_SIZE 1024
|
||||
#define OPL_WRITEBUF_DELAY 2
|
||||
|
||||
typedef struct _opl3_slot opl3_slot;
|
||||
typedef struct _opl3_channel opl3_channel;
|
||||
typedef struct _opl3_chip opl3_chip;
|
||||
|
||||
struct _opl3_slot {
|
||||
opl3_channel *channel;
|
||||
opl3_chip *chip;
|
||||
int16_t out;
|
||||
int16_t fbmod;
|
||||
int16_t *mod;
|
||||
int16_t prout;
|
||||
uint16_t eg_rout;
|
||||
uint16_t eg_out;
|
||||
uint8_t eg_inc;
|
||||
uint8_t eg_gen;
|
||||
uint8_t eg_rate;
|
||||
uint8_t eg_ksl;
|
||||
uint8_t *trem;
|
||||
uint8_t reg_vib;
|
||||
uint8_t reg_type;
|
||||
uint8_t reg_ksr;
|
||||
uint8_t reg_mult;
|
||||
uint8_t reg_ksl;
|
||||
uint8_t reg_tl;
|
||||
uint8_t reg_ar;
|
||||
uint8_t reg_dr;
|
||||
uint8_t reg_sl;
|
||||
uint8_t reg_rr;
|
||||
uint8_t reg_wf;
|
||||
uint8_t key;
|
||||
uint32_t pg_reset;
|
||||
uint32_t pg_phase;
|
||||
uint16_t pg_phase_out;
|
||||
uint8_t slot_num;
|
||||
};
|
||||
|
||||
struct _opl3_channel {
|
||||
opl3_slot *slotz[2]; // Don't use "slots" keyword to avoid conflict with Qt applications
|
||||
opl3_channel *pair;
|
||||
opl3_chip *chip;
|
||||
int16_t *out[4];
|
||||
|
||||
#if OPL_ENABLE_STEREOEXT
|
||||
int32_t leftpan;
|
||||
int32_t rightpan;
|
||||
#endif
|
||||
|
||||
uint8_t chtype;
|
||||
uint16_t f_num;
|
||||
uint8_t block;
|
||||
uint8_t fb;
|
||||
uint8_t con;
|
||||
uint8_t alg;
|
||||
uint8_t ksv;
|
||||
uint16_t cha;
|
||||
uint16_t chb;
|
||||
uint16_t chc;
|
||||
uint16_t chd;
|
||||
uint8_t ch_num;
|
||||
};
|
||||
|
||||
typedef struct _opl3_writebuf {
|
||||
uint64_t time;
|
||||
uint16_t reg;
|
||||
uint8_t data;
|
||||
} opl3_writebuf;
|
||||
|
||||
struct _opl3_chip {
|
||||
opl3_channel channel[18];
|
||||
opl3_slot slot[36];
|
||||
uint16_t timer;
|
||||
uint64_t eg_timer;
|
||||
uint8_t eg_timerrem;
|
||||
uint8_t eg_state;
|
||||
uint8_t eg_add;
|
||||
uint8_t eg_timer_lo;
|
||||
uint8_t newm;
|
||||
uint8_t nts;
|
||||
uint8_t rhy;
|
||||
uint8_t vibpos;
|
||||
uint8_t vibshift;
|
||||
uint8_t tremolo;
|
||||
uint8_t tremolopos;
|
||||
uint8_t tremoloshift;
|
||||
uint32_t noise;
|
||||
int16_t zeromod;
|
||||
int32_t mixbuff[4];
|
||||
uint8_t rm_hh_bit2;
|
||||
uint8_t rm_hh_bit3;
|
||||
uint8_t rm_hh_bit7;
|
||||
uint8_t rm_hh_bit8;
|
||||
uint8_t rm_tc_bit3;
|
||||
uint8_t rm_tc_bit5;
|
||||
|
||||
#if OPL_ENABLE_STEREOEXT
|
||||
uint8_t stereoext;
|
||||
#endif
|
||||
|
||||
// OPL3L
|
||||
int32_t rateratio;
|
||||
int32_t samplecnt;
|
||||
int32_t oldsamples[4];
|
||||
int32_t samples[4];
|
||||
|
||||
uint64_t writebuf_samplecnt;
|
||||
uint32_t writebuf_cur;
|
||||
uint32_t writebuf_last;
|
||||
uint64_t writebuf_lasttime;
|
||||
opl3_writebuf writebuf[OPL_WRITEBUF_SIZE];
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
opl3_chip opl;
|
||||
int8_t flags;
|
||||
int8_t pad;
|
||||
|
||||
uint16_t port;
|
||||
uint8_t status;
|
||||
uint8_t timer_ctrl;
|
||||
uint16_t timer_count[2];
|
||||
uint16_t timer_cur_count[2];
|
||||
|
||||
pc_timer_t timers[2];
|
||||
|
||||
int pos;
|
||||
int32_t buffer[MUSICBUFLEN * 2];
|
||||
} nuked_drv_t;
|
||||
|
||||
enum {
|
||||
FLAG_CYCLES = 0x02,
|
||||
FLAG_OPL3 = 0x01
|
||||
};
|
||||
|
||||
enum {
|
||||
STAT_TMR_OVER = 0x60,
|
||||
STAT_TMR1_OVER = 0x40,
|
||||
STAT_TMR2_OVER = 0x20,
|
||||
STAT_TMR_ANY = 0x80
|
||||
};
|
||||
|
||||
enum {
|
||||
CTRL_RESET = 0x80,
|
||||
CTRL_TMR_MASK = 0x60,
|
||||
CTRL_TMR1_MASK = 0x40,
|
||||
CTRL_TMR2_MASK = 0x20,
|
||||
CTRL_TMR2_START = 0x02,
|
||||
CTRL_TMR1_START = 0x01
|
||||
};
|
||||
|
||||
void OPL3_Generate(opl3_chip *chip, int32_t *buf);
|
||||
void OPL3_GenerateResampled(opl3_chip *chip, int32_t *buf);
|
||||
void OPL3_Reset(opl3_chip *chip, uint32_t samplerate);
|
||||
void OPL3_WriteReg(void *priv, uint16_t reg, uint8_t val);
|
||||
void OPL3_WriteRegBuffered(void *priv, uint16_t reg, uint8_t val);
|
||||
void OPL3_GenerateStream(opl3_chip *chip, int32_t *sndptr, uint32_t numsamples);
|
||||
|
||||
static void OPL3_Generate4Ch(void *priv, int32_t *buf4);
|
||||
void OPL3_Generate4Ch_Resampled(opl3_chip *chip, int32_t *buf4);
|
||||
void OPL3_Generate4Ch_Stream(opl3_chip *chip, int32_t *sndptr1, int32_t *sndptr2, uint32_t numsamples);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /*SOUND_OPL_NUKED_H*/
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||
#ifndef LIBSLIRP_VERSION_H_
|
||||
#define LIBSLIRP_VERSION_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define SLIRP_MAJOR_VERSION 4
|
||||
#define SLIRP_MINOR_VERSION 7
|
||||
#define SLIRP_MICRO_VERSION 0
|
||||
#define SLIRP_VERSION_STRING "4.7.0-86Box"
|
||||
|
||||
#define SLIRP_CHECK_VERSION(major,minor,micro) \
|
||||
(SLIRP_MAJOR_VERSION > (major) || \
|
||||
(SLIRP_MAJOR_VERSION == (major) && SLIRP_MINOR_VERSION > (minor)) || \
|
||||
(SLIRP_MAJOR_VERSION == (major) && SLIRP_MINOR_VERSION == (minor) && \
|
||||
SLIRP_MICRO_VERSION >= (micro)))
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* LIBSLIRP_VERSION_H_ */
|
||||
@@ -1,273 +0,0 @@
|
||||
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||
#ifndef LIBSLIRP_H
|
||||
#define LIBSLIRP_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
#include <in6addr.h>
|
||||
#else
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
|
||||
#include "libslirp-version.h"
|
||||
|
||||
/* Windows does not define ssize_t, so we need to define it here. */
|
||||
#ifndef _SSIZE_T_DEFINED
|
||||
# define _SSIZE_T_DEFINED
|
||||
# undef ssize_t
|
||||
# ifdef _WIN64
|
||||
# define ssize_t int64_t
|
||||
# else
|
||||
# define ssize_t int32_t
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Opaque structure containing the slirp state */
|
||||
typedef struct Slirp Slirp;
|
||||
|
||||
/* Flags passed to SlirpAddPollCb and to be returned by SlirpGetREventsCb. */
|
||||
enum {
|
||||
SLIRP_POLL_IN = 1 << 0,
|
||||
SLIRP_POLL_OUT = 1 << 1,
|
||||
SLIRP_POLL_PRI = 1 << 2,
|
||||
SLIRP_POLL_ERR = 1 << 3,
|
||||
SLIRP_POLL_HUP = 1 << 4,
|
||||
};
|
||||
|
||||
typedef ssize_t (*SlirpReadCb)(void *buf, size_t len, void *opaque);
|
||||
typedef ssize_t (*SlirpWriteCb)(const void *buf, size_t len, void *opaque);
|
||||
typedef void (*SlirpTimerCb)(void *opaque);
|
||||
typedef int (*SlirpAddPollCb)(int fd, int events, void *opaque);
|
||||
typedef int (*SlirpGetREventsCb)(int idx, void *opaque);
|
||||
|
||||
typedef enum SlirpTimerId {
|
||||
SLIRP_TIMER_RA,
|
||||
SLIRP_TIMER_NUM,
|
||||
} SlirpTimerId;
|
||||
|
||||
/*
|
||||
* Callbacks from slirp, to be set by the application.
|
||||
*
|
||||
* The opaque parameter is set to the opaque pointer given in the slirp_new /
|
||||
* slirp_init call.
|
||||
*/
|
||||
typedef struct SlirpCb {
|
||||
/*
|
||||
* Send an ethernet frame to the guest network. The opaque parameter is the
|
||||
* one given to slirp_init(). If the guest is not ready to receive a frame,
|
||||
* the function can just drop the data. TCP will then handle retransmissions
|
||||
* at a lower pace.
|
||||
* <0 reports an IO error.
|
||||
*/
|
||||
SlirpWriteCb send_packet;
|
||||
/* Print a message for an error due to guest misbehavior. */
|
||||
void (*guest_error)(const char *msg, void *opaque);
|
||||
/* Return the virtual clock value in nanoseconds */
|
||||
int64_t (*clock_get_ns)(void *opaque);
|
||||
/* Create a new timer with the given callback and opaque data. Not
|
||||
* needed if timer_new_opaque is provided. */
|
||||
void *(*timer_new)(SlirpTimerCb cb, void *cb_opaque, void *opaque);
|
||||
/* Remove and free a timer */
|
||||
void (*timer_free)(void *timer, void *opaque);
|
||||
/* Modify a timer to expire at @expire_time (ms) */
|
||||
void (*timer_mod)(void *timer, int64_t expire_time, void *opaque);
|
||||
/* Register a fd for future polling */
|
||||
void (*register_poll_fd)(int fd, void *opaque);
|
||||
/* Unregister a fd */
|
||||
void (*unregister_poll_fd)(int fd, void *opaque);
|
||||
/* Kick the io-thread, to signal that new events may be processed because some TCP buffer
|
||||
* can now receive more data, i.e. slirp_socket_can_recv will return 1. */
|
||||
void (*notify)(void *opaque);
|
||||
|
||||
/*
|
||||
* Fields introduced in SlirpConfig version 4 begin
|
||||
*/
|
||||
|
||||
/* Initialization has completed and a Slirp* has been created. */
|
||||
void (*init_completed)(Slirp *slirp, void *opaque);
|
||||
/* Create a new timer. When the timer fires, the application passes
|
||||
* the SlirpTimerId and cb_opaque to slirp_handle_timer. */
|
||||
void *(*timer_new_opaque)(SlirpTimerId id, void *cb_opaque, void *opaque);
|
||||
} SlirpCb;
|
||||
|
||||
#define SLIRP_CONFIG_VERSION_MIN 1
|
||||
#define SLIRP_CONFIG_VERSION_MAX 4
|
||||
|
||||
typedef struct SlirpConfig {
|
||||
/* Version must be provided */
|
||||
uint32_t version;
|
||||
/*
|
||||
* Fields introduced in SlirpConfig version 1 begin
|
||||
*/
|
||||
int restricted;
|
||||
bool in_enabled;
|
||||
struct in_addr vnetwork;
|
||||
struct in_addr vnetmask;
|
||||
struct in_addr vhost;
|
||||
bool in6_enabled;
|
||||
struct in6_addr vprefix_addr6;
|
||||
uint8_t vprefix_len;
|
||||
struct in6_addr vhost6;
|
||||
const char *vhostname;
|
||||
const char *tftp_server_name;
|
||||
const char *tftp_path;
|
||||
const char *bootfile;
|
||||
struct in_addr vdhcp_start;
|
||||
struct in_addr vnameserver;
|
||||
struct in6_addr vnameserver6;
|
||||
const char **vdnssearch;
|
||||
const char *vdomainname;
|
||||
/* Default: IF_MTU_DEFAULT */
|
||||
size_t if_mtu;
|
||||
/* Default: IF_MRU_DEFAULT */
|
||||
size_t if_mru;
|
||||
/* Prohibit connecting to 127.0.0.1:* */
|
||||
bool disable_host_loopback;
|
||||
/*
|
||||
* Enable emulation code (*warning*: this code isn't safe, it is not
|
||||
* recommended to enable it)
|
||||
*/
|
||||
bool enable_emu;
|
||||
/*
|
||||
* Fields introduced in SlirpConfig version 2 begin
|
||||
*/
|
||||
struct sockaddr_in *outbound_addr;
|
||||
struct sockaddr_in6 *outbound_addr6;
|
||||
/*
|
||||
* Fields introduced in SlirpConfig version 3 begin
|
||||
*/
|
||||
bool disable_dns; /* slirp will not redirect/serve any DNS packet */
|
||||
/*
|
||||
* Fields introduced in SlirpConfig version 4 begin
|
||||
*/
|
||||
bool disable_dhcp; /* slirp will not reply to any DHCP requests */
|
||||
} SlirpConfig;
|
||||
|
||||
/* Create a new instance of a slirp stack */
|
||||
Slirp *slirp_new(const SlirpConfig *cfg, const SlirpCb *callbacks,
|
||||
void *opaque);
|
||||
/* slirp_init is deprecated in favor of slirp_new */
|
||||
Slirp *slirp_init(int restricted, bool in_enabled, struct in_addr vnetwork,
|
||||
struct in_addr vnetmask, struct in_addr vhost,
|
||||
bool in6_enabled, struct in6_addr vprefix_addr6,
|
||||
uint8_t vprefix_len, struct in6_addr vhost6,
|
||||
const char *vhostname, const char *tftp_server_name,
|
||||
const char *tftp_path, const char *bootfile,
|
||||
struct in_addr vdhcp_start, struct in_addr vnameserver,
|
||||
struct in6_addr vnameserver6, const char **vdnssearch,
|
||||
const char *vdomainname, const SlirpCb *callbacks,
|
||||
void *opaque);
|
||||
/* Shut down an instance of a slirp stack */
|
||||
void slirp_cleanup(Slirp *slirp);
|
||||
|
||||
/* This is called by the application when it is about to sleep through poll().
|
||||
* *timeout is set to the amount of virtual time (in ms) that the application intends to
|
||||
* wait (UINT32_MAX if infinite). slirp_pollfds_fill updates it according to
|
||||
* e.g. TCP timers, so the application knows it should sleep a smaller amount of
|
||||
* time. slirp_pollfds_fill calls add_poll for each file descriptor
|
||||
* that should be monitored along the sleep. The opaque pointer is passed as
|
||||
* such to add_poll, and add_poll returns an index. */
|
||||
void slirp_pollfds_fill(Slirp *slirp, uint32_t *timeout,
|
||||
SlirpAddPollCb add_poll, void *opaque);
|
||||
|
||||
/* This is called by the application after sleeping, to report which file
|
||||
* descriptors are available. slirp_pollfds_poll calls get_revents on each file
|
||||
* descriptor, giving it the index that add_poll returned during the
|
||||
* slirp_pollfds_fill call, to know whether the descriptor is available for
|
||||
* read/write/etc. (SLIRP_POLL_*)
|
||||
* select_error should be passed 1 if poll() returned an error. */
|
||||
void slirp_pollfds_poll(Slirp *slirp, int select_error,
|
||||
SlirpGetREventsCb get_revents, void *opaque);
|
||||
|
||||
/* This is called by the application when the guest emits a packet on the
|
||||
* guest network, to be interpreted by slirp. */
|
||||
void slirp_input(Slirp *slirp, const uint8_t *pkt, int pkt_len);
|
||||
|
||||
/* This is called by the application when a timer expires, if it provides
|
||||
* the timer_new_opaque callback. It is not needed if the application only
|
||||
* uses timer_new. */
|
||||
void slirp_handle_timer(Slirp *slirp, SlirpTimerId id, void *cb_opaque);
|
||||
|
||||
/* These set up / remove port forwarding between a host port in the real world
|
||||
* and the guest network. */
|
||||
int slirp_add_hostfwd(Slirp *slirp, int is_udp, struct in_addr host_addr,
|
||||
int host_port, struct in_addr guest_addr, int guest_port);
|
||||
int slirp_remove_hostfwd(Slirp *slirp, int is_udp, struct in_addr host_addr,
|
||||
int host_port);
|
||||
|
||||
#define SLIRP_HOSTFWD_UDP 1
|
||||
#define SLIRP_HOSTFWD_V6ONLY 2
|
||||
int slirp_add_hostxfwd(Slirp *slirp,
|
||||
const struct sockaddr *haddr, socklen_t haddrlen,
|
||||
const struct sockaddr *gaddr, socklen_t gaddrlen,
|
||||
int flags);
|
||||
int slirp_remove_hostxfwd(Slirp *slirp,
|
||||
const struct sockaddr *haddr, socklen_t haddrlen,
|
||||
int flags);
|
||||
|
||||
/* Set up port forwarding between a port in the guest network and a
|
||||
* command running on the host */
|
||||
int slirp_add_exec(Slirp *slirp, const char *cmdline,
|
||||
struct in_addr *guest_addr, int guest_port);
|
||||
/* Set up port forwarding between a port in the guest network and a
|
||||
* Unix port on the host */
|
||||
int slirp_add_unix(Slirp *slirp, const char *unixsock,
|
||||
struct in_addr *guest_addr, int guest_port);
|
||||
/* Set up port forwarding between a port in the guest network and a
|
||||
* callback that will receive the data coming from the port */
|
||||
int slirp_add_guestfwd(Slirp *slirp, SlirpWriteCb write_cb, void *opaque,
|
||||
struct in_addr *guest_addr, int guest_port);
|
||||
|
||||
/* TODO: rather identify a guestfwd through an opaque pointer instead of through
|
||||
* the guest_addr */
|
||||
|
||||
/* This is called by the application for a guestfwd, to determine how much data
|
||||
* can be received by the forwarded port through a call to slirp_socket_recv. */
|
||||
size_t slirp_socket_can_recv(Slirp *slirp, struct in_addr guest_addr,
|
||||
int guest_port);
|
||||
/* This is called by the application for a guestfwd, to provide the data to be
|
||||
* sent on the forwarded port */
|
||||
void slirp_socket_recv(Slirp *slirp, struct in_addr guest_addr, int guest_port,
|
||||
const uint8_t *buf, int size);
|
||||
|
||||
/* Remove entries added by slirp_add_exec, slirp_add_unix or slirp_add_guestfwd */
|
||||
int slirp_remove_guestfwd(Slirp *slirp, struct in_addr guest_addr,
|
||||
int guest_port);
|
||||
|
||||
/* Return a human-readable state of the slirp stack */
|
||||
char *slirp_connection_info(Slirp *slirp);
|
||||
|
||||
/* Return a human-readable state of the NDP/ARP tables */
|
||||
char *slirp_neighbor_info(Slirp *slirp);
|
||||
|
||||
/* Save the slirp state through the write_cb. The opaque pointer is passed as
|
||||
* such to the write_cb. */
|
||||
void slirp_state_save(Slirp *s, SlirpWriteCb write_cb, void *opaque);
|
||||
|
||||
/* Returns the version of the slirp state, to be saved along the state */
|
||||
int slirp_state_version(void);
|
||||
|
||||
/* Load the slirp state through the read_cb. The opaque pointer is passed as
|
||||
* such to the read_cb. The version should be given as it was obtained from
|
||||
* slirp_state_version when slirp_state_save was called. */
|
||||
int slirp_state_load(Slirp *s, int version_id, SlirpReadCb read_cb,
|
||||
void *opaque);
|
||||
|
||||
/* Return the version of the slirp implementation */
|
||||
const char *slirp_version_string(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* LIBSLIRP_H */
|
||||
@@ -23,6 +23,9 @@ target_link_libraries(86Box PkgConfig::SLIRP)
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(PkgConfig::SLIRP INTERFACE wsock32 ws2_32 iphlpapi iconv)
|
||||
if(STATIC_BUILD)
|
||||
add_compile_definitions(LIBSLIRP_STATIC)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (HAIKU)
|
||||
|
||||
@@ -171,7 +171,11 @@ net_slirp_notify(void *opaque)
|
||||
(void) opaque;
|
||||
}
|
||||
|
||||
#if SLIRP_CHECK_VERSION(4, 8, 0)
|
||||
slirp_ssize_t
|
||||
#else
|
||||
ssize_t
|
||||
#endif
|
||||
net_slirp_send_packet(const void *qp, size_t pkt_len, void *opaque)
|
||||
{
|
||||
net_slirp_t *slirp = (net_slirp_t *) opaque;
|
||||
|
||||
@@ -90,8 +90,12 @@ if(FLUIDSYNTH)
|
||||
target_link_libraries(86Box PkgConfig::FLUIDSYNTH)
|
||||
if(STATIC_BUILD)
|
||||
target_link_libraries(86Box -static ${FLUIDSYNTH_STATIC_LIBRARIES} -fopenmp)
|
||||
if(WIN32 AND CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64")
|
||||
target_link_libraries(86Box psapi)
|
||||
if(WIN32)
|
||||
add_compile_definitions(FLUIDSYNTH_NOT_A_DLL)
|
||||
|
||||
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64")
|
||||
target_link_libraries(86Box psapi)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#ifdef __unix__
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#define FLUIDSYNTH_NOT_A_DLL
|
||||
#include <fluidsynth.h>
|
||||
|
||||
#include <86box/86box.h>
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace reSIDfp
|
||||
const unsigned int FLOATING_OUTPUT_TTL_6581R3 = 54000;
|
||||
const unsigned int FLOATING_OUTPUT_FADE_6581R3 = 1400;
|
||||
// ~1s
|
||||
const unsigned int FLOATING_OUTPUT_TTL_6581R4 = 1000000;
|
||||
//const unsigned int FLOATING_OUTPUT_TTL_6581R4 = 1000000;
|
||||
// ~1s
|
||||
const unsigned int FLOATING_OUTPUT_TTL_8580R5 = 800000;
|
||||
const unsigned int FLOATING_OUTPUT_FADE_8580R5 = 50000;
|
||||
@@ -61,7 +61,7 @@ const unsigned int FLOATING_OUTPUT_FADE_8580R5 = 50000;
|
||||
const unsigned int SHIFT_REGISTER_RESET_6581R3 = 50000;
|
||||
const unsigned int SHIFT_REGISTER_FADE_6581R3 = 15000;
|
||||
// ~2.15s
|
||||
const unsigned int SHIFT_REGISTER_RESET_6581R4 = 2150000;
|
||||
//const unsigned int SHIFT_REGISTER_RESET_6581R4 = 2150000;
|
||||
// ~2.8s
|
||||
const unsigned int SHIFT_REGISTER_RESET_8580R5 = 986000;
|
||||
const unsigned int SHIFT_REGISTER_FADE_8580R5 = 314300;
|
||||
|
||||
@@ -860,7 +860,7 @@ cmi8x38_write(uint16_t addr, uint8_t val, void *priv)
|
||||
|
||||
case 0x1b:
|
||||
if (dev->type == CMEDIA_CMI8338)
|
||||
val &= 0xf0;
|
||||
val &= 0xf4; /* bit 2 reserved, mpxplay driver expects writable */
|
||||
else
|
||||
val &= 0xd7;
|
||||
break;
|
||||
@@ -909,6 +909,24 @@ cmi8x38_write(uint16_t addr, uint8_t val, void *priv)
|
||||
dev->sb->opl.write(addr, val, dev->sb->opl.priv);
|
||||
return;
|
||||
|
||||
case 0x80 ... 0x83:
|
||||
case 0x88 ... 0x8b:
|
||||
dev->io_regs[addr] = val;
|
||||
dev->dma[(addr & 0x78) >> 3].sample_ptr = *((uint32_t *) &dev->io_regs[addr & 0xfc]);
|
||||
return;
|
||||
|
||||
case 0x84 ... 0x85:
|
||||
case 0x8c ... 0x8d:
|
||||
dev->io_regs[addr] = val;
|
||||
dev->dma[(addr & 0x78) >> 3].frame_count_dma = dev->dma[(addr & 0x78) >> 3].sample_count_out = *((uint16_t *) &dev->io_regs[addr & 0xfe]) + 1;
|
||||
return;
|
||||
|
||||
case 0x86 ... 0x87:
|
||||
case 0x8e ... 0x8f:
|
||||
dev->io_regs[addr] = val;
|
||||
dev->dma[(addr & 0x78) >> 3].frame_count_fragment = *((uint16_t *) &dev->io_regs[addr & 0xfe]) + 1;
|
||||
return;
|
||||
|
||||
case 0x92:
|
||||
if (dev->type == CMEDIA_CMI8338)
|
||||
return;
|
||||
@@ -927,7 +945,6 @@ cmi8x38_write(uint16_t addr, uint8_t val, void *priv)
|
||||
case 0x26:
|
||||
case 0x70:
|
||||
case 0x71:
|
||||
case 0x80 ... 0x8f:
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -137,6 +137,11 @@ static const SOUND_CARD sound_cards[] = {
|
||||
{ &cms_device },
|
||||
{ &cs4235_device },
|
||||
{ &cs4236b_device },
|
||||
{ &ess_688_device },
|
||||
{ &ess_ess0100_pnp_device },
|
||||
{ &ess_1688_device },
|
||||
{ &ess_ess0102_pnp_device },
|
||||
{ &ess_ess0968_pnp_device },
|
||||
{ &gus_device },
|
||||
{ &sb_1_device },
|
||||
{ &sb_15_device },
|
||||
@@ -176,11 +181,6 @@ static const SOUND_CARD sound_cards[] = {
|
||||
{ &ct5880_device },
|
||||
{ &ad1881_device },
|
||||
{ &cs4297a_device },
|
||||
{ &ess_688_device },
|
||||
{ &ess_ess0100_pnp_device },
|
||||
{ &ess_1688_device },
|
||||
{ &ess_ess0102_pnp_device },
|
||||
{ &ess_ess0968_pnp_device },
|
||||
{ NULL }
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
@@ -2477,7 +2477,7 @@ chips_69000_init(const device_t *info)
|
||||
timer_add(&chips->decrement_timer, chips_69000_decrement_timer, chips, 0);
|
||||
timer_on_auto(&chips->decrement_timer, 1000000. / 2000.);
|
||||
|
||||
chips->i2c = i2c_gpio_init("chips_69000_ddc");
|
||||
chips->i2c = i2c_gpio_init("ddc_chips_69000");
|
||||
chips->ddc = ddc_init(i2c_gpio_get_bus(chips->i2c));
|
||||
|
||||
chips->flat_panel_regs[0x01] = 1;
|
||||
|
||||
@@ -45,6 +45,7 @@ typedef struct paradise_t {
|
||||
} type;
|
||||
|
||||
uint32_t vram_mask;
|
||||
uint32_t memory;
|
||||
|
||||
uint32_t read_bank[4], write_bank[4];
|
||||
|
||||
@@ -167,12 +168,10 @@ paradise_out(uint16_t addr, uint8_t val, void *priv)
|
||||
return;
|
||||
}
|
||||
|
||||
old = svga->gdcreg[svga->gdcaddr];
|
||||
switch (svga->gdcaddr) {
|
||||
case 6:
|
||||
if ((val & 0xc) != (old & 0xc)) {
|
||||
svga->gdcreg[6] = val;
|
||||
switch (svga->gdcreg[6] & 0xc) {
|
||||
if ((svga->gdcreg[6] & 0x0c) != (val & 0xc)) {
|
||||
switch (val & 0x0c) {
|
||||
case 0x0: /*128k at A0000*/
|
||||
mem_mapping_set_addr(&svga->mapping, 0xa0000, 0x20000);
|
||||
svga->banked_mask = 0xffff;
|
||||
@@ -193,8 +192,9 @@ paradise_out(uint16_t addr, uint8_t val, void *priv)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
paradise_remap(paradise);
|
||||
}
|
||||
svga->gdcreg[6] = val;
|
||||
paradise_remap(paradise);
|
||||
return;
|
||||
|
||||
case 9:
|
||||
@@ -296,6 +296,8 @@ paradise_recalctimings(svga_t *svga)
|
||||
{
|
||||
const paradise_t *paradise = (paradise_t *) svga->priv;
|
||||
|
||||
svga->lowres = !(svga->gdcreg[0x0e] & 0x01);
|
||||
|
||||
if (paradise->type == WD90C30) {
|
||||
if (svga->crtc[0x3e] & 0x01)
|
||||
svga->vtotal |= 0x400;
|
||||
@@ -309,22 +311,18 @@ paradise_recalctimings(svga_t *svga)
|
||||
svga->split |= 0x400;
|
||||
|
||||
svga->interlace = !!(svga->crtc[0x2d] & 0x20);
|
||||
|
||||
if (!svga->interlace && !(svga->gdcreg[0x0e] & 0x01) && (svga->hdisp >= 1024) && ((svga->gdcreg[5] & 0x60) == 0) && (svga->miscout >= 0x27) && (svga->miscout <= 0x2f) && ((svga->gdcreg[6] & 1) || (svga->attrregs[0x10] & 1))) { /*Horrible tweak to re-enable the interlace after returning to
|
||||
a windowed DOS box in Win3.x*/
|
||||
svga->interlace = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (paradise->type < WD90C30) {
|
||||
if ((svga->gdcreg[6] & 1) || (svga->attrregs[0x10] & 1)) {
|
||||
if ((svga->bpp >= 8) && (svga->gdcreg[0x0e] & 0x01)) {
|
||||
if ((svga->bpp >= 8) && !svga->lowres) {
|
||||
svga->render = svga_render_8bpp_highres;
|
||||
svga->vram_display_mask = (svga->crtc[0x2f] & 0x02) ? 0x3ffff : paradise->vram_mask;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ((svga->gdcreg[6] & 1) || (svga->attrregs[0x10] & 1)) {
|
||||
if ((svga->bpp >= 8) && (svga->gdcreg[0x0e] & 0x01)) {
|
||||
if ((svga->bpp >= 8) && !svga->lowres) {
|
||||
if (svga->bpp == 16) {
|
||||
svga->render = svga_render_16bpp_highres;
|
||||
svga->hdisp >>= 1;
|
||||
@@ -339,13 +337,16 @@ paradise_recalctimings(svga_t *svga)
|
||||
svga->hdisp += 12;
|
||||
if (svga->hdisp == 800)
|
||||
svga->ma_latch -= 3;
|
||||
} else {
|
||||
} else
|
||||
svga->render = svga_render_8bpp_highres;
|
||||
}
|
||||
}
|
||||
|
||||
svga->vram_display_mask = (svga->crtc[0x2f] & 0x02) ? 0x3ffff : paradise->vram_mask;
|
||||
} else if ((svga->bpp <= 8) && svga->lowres && !svga->interlace && (svga->hdisp >= 1024) &&
|
||||
(svga->miscout >= 0x27) && (svga->miscout <= 0x2f))
|
||||
svga->interlace = 1; /*Horrible tweak to re-enable the interlace after returning to
|
||||
a windowed DOS box in Win3.x*/
|
||||
}
|
||||
}
|
||||
svga->vram_display_mask = (svga->crtc[0x2f] & 0x02) ? 0x3ffff : paradise->vram_mask;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -356,15 +357,10 @@ paradise_write(uint32_t addr, uint8_t val, void *priv)
|
||||
uint32_t prev_addr;
|
||||
uint32_t prev_addr2;
|
||||
|
||||
if (!(svga->gdcreg[5] & 0x40)) {
|
||||
svga_write(addr, val, svga);
|
||||
return;
|
||||
}
|
||||
|
||||
addr = (addr & 0x7fff) + paradise->write_bank[(addr >> 15) & 3];
|
||||
|
||||
/*Could be done in a better way but it works.*/
|
||||
if ((svga->gdcreg[0x0e] & 0x01) || (svga->gdcreg[5] & 0x40)) {
|
||||
if (!svga->lowres || (svga->attrregs[0x10] & 0x40)) {
|
||||
if (((svga->gdcreg[6] & 0x0c) == 0x04) && (svga->crtc[0x14] & 0x40) && ((svga->gdcreg[0x0b] & 0xc0) == 0xc0) && !svga->chain4) {
|
||||
prev_addr = addr & 3;
|
||||
prev_addr2 = addr & 0xfffc;
|
||||
@@ -385,6 +381,7 @@ paradise_write(uint32_t addr, uint8_t val, void *priv)
|
||||
}
|
||||
svga_write_linear(addr, val, svga);
|
||||
}
|
||||
|
||||
static void
|
||||
paradise_writew(uint32_t addr, uint16_t val, void *priv)
|
||||
{
|
||||
@@ -393,15 +390,10 @@ paradise_writew(uint32_t addr, uint16_t val, void *priv)
|
||||
uint32_t prev_addr;
|
||||
uint32_t prev_addr2;
|
||||
|
||||
if (!(svga->gdcreg[5] & 0x40)) {
|
||||
svga_writew(addr, val, svga);
|
||||
return;
|
||||
}
|
||||
|
||||
addr = (addr & 0x7fff) + paradise->write_bank[(addr >> 15) & 3];
|
||||
|
||||
/*Could be done in a better way but it works.*/
|
||||
if ((svga->gdcreg[0x0e] & 0x01) || (svga->gdcreg[5] & 0x40)) {
|
||||
if (!svga->lowres || (svga->attrregs[0x10] & 0x40)) {
|
||||
if (((svga->gdcreg[6] & 0x0c) == 0x04) && (svga->crtc[0x14] & 0x40) && ((svga->gdcreg[0x0b] & 0xc0) == 0xc0) && !svga->chain4) {
|
||||
prev_addr = addr & 3;
|
||||
prev_addr2 = addr & 0xfffc;
|
||||
@@ -431,13 +423,10 @@ paradise_read(uint32_t addr, void *priv)
|
||||
uint32_t prev_addr;
|
||||
uint32_t prev_addr2;
|
||||
|
||||
if (!(svga->gdcreg[5] & 0x40))
|
||||
return svga_read(addr, svga);
|
||||
|
||||
addr = (addr & 0x7fff) + paradise->read_bank[(addr >> 15) & 3];
|
||||
|
||||
/*Could be done in a better way but it works.*/
|
||||
if ((svga->gdcreg[0x0e] & 0x01) || (svga->gdcreg[5] & 0x40)) {
|
||||
if (!svga->lowres || (svga->attrregs[0x10] & 0x40)) {
|
||||
if (((svga->gdcreg[6] & 0x0c) == 0x04) && (svga->crtc[0x14] & 0x40) && ((svga->gdcreg[0x0b] & 0xc0) == 0xc0) && !svga->chain4) {
|
||||
prev_addr = addr & 3;
|
||||
prev_addr2 = addr & 0xfffc;
|
||||
@@ -458,6 +447,7 @@ paradise_read(uint32_t addr, void *priv)
|
||||
}
|
||||
return svga_read_linear(addr, svga);
|
||||
}
|
||||
|
||||
static uint16_t
|
||||
paradise_readw(uint32_t addr, void *priv)
|
||||
{
|
||||
@@ -466,13 +456,10 @@ paradise_readw(uint32_t addr, void *priv)
|
||||
uint32_t prev_addr;
|
||||
uint32_t prev_addr2;
|
||||
|
||||
if (!(svga->gdcreg[5] & 0x40))
|
||||
return svga_readw(addr, svga);
|
||||
|
||||
addr = (addr & 0x7fff) + paradise->read_bank[(addr >> 15) & 3];
|
||||
|
||||
/*Could be done in a better way but it works.*/
|
||||
if ((svga->gdcreg[0x0e] & 0x01) || (svga->gdcreg[5] & 0x40)) {
|
||||
if (!svga->lowres || (svga->attrregs[0x10] & 0x40)) {
|
||||
if (((svga->gdcreg[6] & 0x0c) == 0x04) && (svga->crtc[0x14] & 0x40) && ((svga->gdcreg[0x0b] & 0xc0) == 0xc0) && !svga->chain4) {
|
||||
prev_addr = addr & 3;
|
||||
prev_addr2 = addr & 0xfffc;
|
||||
@@ -506,6 +493,8 @@ paradise_init(const device_t *info, uint32_t memsize)
|
||||
else
|
||||
video_inform(VIDEO_FLAG_TYPE_SPECIAL, &timing_paradise_wd90c);
|
||||
|
||||
paradise->memory = memsize >> 10;
|
||||
|
||||
switch (info->local) {
|
||||
case PVGA1A:
|
||||
svga_init(info, svga, paradise, memsize, /*256kb*/
|
||||
|
||||
Reference in New Issue
Block a user