mirror of
https://github.com/86Box/86Box.git
synced 2026-02-24 10:28:19 -07:00
Merge remote-tracking branch 'upstream/master' into feature/ich2
This commit is contained in:
@@ -60,16 +60,22 @@ extern const device_t ide_vlb_2ch_device; /* vlb_ide_2ch */
|
||||
extern const device_t ide_pci_device; /* pci_ide */
|
||||
extern const device_t ide_pci_2ch_device; /* pci_ide_2ch */
|
||||
|
||||
extern const device_t ide_cmd640_vlb_device; /* CMD PCI-640B VLB */
|
||||
extern const device_t ide_cmd640_vlb_178_device; /* CMD PCI-640B VLB (Port 178h) */
|
||||
extern const device_t ide_cmd640_pci_device; /* CMD PCI-640B PCI */
|
||||
extern const device_t ide_cmd640_pci_legacy_only_device; /* CMD PCI-640B PCI (Legacy Mode Only) */
|
||||
extern const device_t ide_cmd640_pci_single_channel_device; /* CMD PCI-640B PCI (Only primary channel) */
|
||||
extern const device_t ide_cmd646_device; /* CMD PCI-646 */
|
||||
extern const device_t ide_cmd646_legacy_only_device; /* CMD PCI-646 (Legacy Mode Only) */
|
||||
extern const device_t ide_cmd646_single_channel_device; /* CMD PCI-646 (Only primary channel) */
|
||||
extern const device_t ide_cmd640_vlb_device; /* CMD PCI-640B VLB */
|
||||
extern const device_t ide_cmd640_vlb_178_device; /* CMD PCI-640B VLB (Port 178h) */
|
||||
extern const device_t ide_cmd640_vlb_pri_device; /* CMD PCI-640B VLB (Only primary channel) */
|
||||
extern const device_t ide_cmd640_vlb_pri_178_device; /* CMD PCI-640B VLB (Only primary channel) (Port 178h) */
|
||||
extern const device_t ide_cmd640_vlb_sec_device; /* CMD PCI-640B VLB (Only secondary channel) */
|
||||
extern const device_t ide_cmd640_vlb_sec_178_device; /* CMD PCI-640B VLB (Only secondary channel) (Port 178h) */
|
||||
extern const device_t ide_cmd640_pci_device; /* CMD PCI-640B PCI */
|
||||
extern const device_t ide_cmd640_pci_legacy_only_device; /* CMD PCI-640B PCI (Legacy Mode Only) */
|
||||
extern const device_t ide_cmd640_pci_single_channel_device; /* CMD PCI-640B PCI (Only primary channel) */
|
||||
extern const device_t ide_cmd640_pci_single_channel_sec_device; /* CMD PCI-640B PCI (Only secondary channel) */
|
||||
extern const device_t ide_cmd646_device; /* CMD PCI-646 */
|
||||
extern const device_t ide_cmd646_legacy_only_device; /* CMD PCI-646 (Legacy Mode Only) */
|
||||
extern const device_t ide_cmd646_single_channel_device; /* CMD PCI-646 (Only primary channel) */
|
||||
|
||||
extern const device_t ide_opti611_vlb_device; /* OPTi 82c611/611A VLB */
|
||||
extern const device_t ide_opti611_vlb_device; /* OPTi 82c611/611A VLB */
|
||||
extern const device_t ide_opti611_vlb_sec_device; /* OPTi 82c611/611A VLB (Secondary channel) */
|
||||
|
||||
extern const device_t ide_ter_device;
|
||||
extern const device_t ide_ter_pnp_device;
|
||||
|
||||
@@ -268,9 +268,9 @@ extern void keyboard_get_states(uint8_t *cl, uint8_t *nl, uint8_t *sl);
|
||||
extern void keyboard_set_states(uint8_t cl, uint8_t nl, uint8_t sl);
|
||||
extern int keyboard_recv(uint16_t key);
|
||||
extern int keyboard_isfsenter(void);
|
||||
extern int keyboard_isfsenter_down(void);
|
||||
extern int keyboard_isfsenter_up(void);
|
||||
extern int keyboard_isfsexit(void);
|
||||
extern int keyboard_isfsexit_down(void);
|
||||
extern int keyboard_isfsexit_up(void);
|
||||
extern int keyboard_ismsexit(void);
|
||||
extern void keyboard_set_is_amstrad(int ams);
|
||||
|
||||
|
||||
@@ -52,7 +52,6 @@
|
||||
#define IDS_2077 2077 // "Click to capture mouse"
|
||||
#define IDS_2078 2078 // "Press F12-F8 to release mouse"
|
||||
#define IDS_2079 2079 // "Press F12-F8 or middle button.."
|
||||
#define IDS_2080 2080 // "Unable to initialize Flui.."
|
||||
#define IDS_2081 2081 // "Bus"
|
||||
#define IDS_BUS IDS_2081 // "Bus"
|
||||
#define IDS_2082 2082 // "File"
|
||||
@@ -98,7 +97,6 @@
|
||||
#define IDS_2108 2108 // "%u MB (CHS: %i, %i, %i)"
|
||||
#define IDS_2109 2109 // "Floppy %i (%s): %ls"
|
||||
#define IDS_2110 2110 // "All floppy images (*.0??;*.."
|
||||
#define IDS_2111 2111 // "Unable to initialize Free.."
|
||||
#define IDS_2112 2112 // "Unable to initialize SDL..."
|
||||
#define IDS_2113 2113 // "Are you sure you want to..."
|
||||
#define IDS_2114 2114 // "Are you sure you want to..."
|
||||
@@ -119,9 +117,7 @@
|
||||
#define IDS_2129 2129 // "Hardware not available"
|
||||
#define IDS_2130 2130 // "Make sure " LIB_NAME_PCAP "..."
|
||||
#define IDS_2131 2131 // "Invalid configuration"
|
||||
#define IDS_2132 2132 // LIB_NAME_FREETYPE " is required..."
|
||||
#define IDS_2133 2133 // LIB_NAME_GS " is required for...
|
||||
#define IDS_2134 2134 // LIB_NAME_FLUIDSYNTH " is required..."
|
||||
#define IDS_2135 2135 // "Entering fullscreen mode"
|
||||
#define IDS_2136 2136 // "Don't show this message again"
|
||||
#define IDS_2137 2137 // "Don't exit"
|
||||
|
||||
@@ -194,7 +194,7 @@ typedef struct _mem_mapping_ {
|
||||
|
||||
/* There is never a needed to pass a pointer to the mapping itself, it is much preferable to
|
||||
prepare a structure with the requires data (usually, the base address and mask) instead. */
|
||||
void *p; /* backpointer to device */
|
||||
void *priv; /* backpointer to device */
|
||||
} mem_mapping_t;
|
||||
|
||||
#ifdef USE_NEW_DYNAREC
|
||||
@@ -207,9 +207,9 @@ extern uint64_t *byte_code_present_mask;
|
||||
|
||||
# define EVICT_NOT_IN_LIST ((uint32_t) -1)
|
||||
typedef struct page_t {
|
||||
void (*write_b)(uint32_t addr, uint8_t val, struct page_t *p);
|
||||
void (*write_w)(uint32_t addr, uint16_t val, struct page_t *p);
|
||||
void (*write_l)(uint32_t addr, uint32_t val, struct page_t *p);
|
||||
void (*write_b)(uint32_t addr, uint8_t val, struct page_t *page);
|
||||
void (*write_w)(uint32_t addr, uint16_t val, struct page_t *page);
|
||||
void (*write_l)(uint32_t addr, uint32_t val, struct page_t *page);
|
||||
|
||||
uint8_t *mem;
|
||||
|
||||
@@ -218,9 +218,11 @@ typedef struct page_t {
|
||||
/*Head of codeblock tree associated with this page*/
|
||||
uint16_t head;
|
||||
|
||||
uint64_t code_present_mask, dirty_mask;
|
||||
uint64_t code_present_mask;
|
||||
uint64_t dirty_mask;
|
||||
|
||||
uint32_t evict_prev, evict_next;
|
||||
uint32_t evict_prev;
|
||||
uint32_t evict_next;
|
||||
|
||||
uint64_t *byte_dirty_mask;
|
||||
uint64_t *byte_code_present_mask;
|
||||
@@ -228,31 +230,33 @@ typedef struct page_t {
|
||||
|
||||
extern uint32_t purgable_page_list_head;
|
||||
__attribute__((always_inline)) static inline int
|
||||
page_in_evict_list(page_t *p)
|
||||
page_in_evict_list(page_t *page)
|
||||
{
|
||||
return (p->evict_prev != EVICT_NOT_IN_LIST);
|
||||
return (page->evict_prev != EVICT_NOT_IN_LIST);
|
||||
}
|
||||
void page_remove_from_evict_list(page_t *p);
|
||||
void page_add_to_evict_list(page_t *p);
|
||||
void page_remove_from_evict_list(page_t *page);
|
||||
void page_add_to_evict_list(page_t *page);
|
||||
#else
|
||||
typedef struct _page_ {
|
||||
void (*write_b)(uint32_t addr, uint8_t val, struct _page_ *p);
|
||||
void (*write_w)(uint32_t addr, uint16_t val, struct _page_ *p);
|
||||
void (*write_l)(uint32_t addr, uint32_t val, struct _page_ *p);
|
||||
void (*write_b)(uint32_t addr, uint8_t val, struct _page_ *page);
|
||||
void (*write_w)(uint32_t addr, uint16_t val, struct _page_ *page);
|
||||
void (*write_l)(uint32_t addr, uint32_t val, struct _page_ *page);
|
||||
|
||||
uint8_t *mem;
|
||||
|
||||
uint64_t code_present_mask[4],
|
||||
dirty_mask[4];
|
||||
uint64_t code_present_mask[4];
|
||||
uint64_t dirty_mask[4];
|
||||
|
||||
struct codeblock_t *block[4], *block_2[4];
|
||||
struct codeblock_t *block[4];
|
||||
struct codeblock_t *block_2[4];
|
||||
|
||||
/*Head of codeblock tree associated with this page*/
|
||||
struct codeblock_t *head;
|
||||
} page_t;
|
||||
#endif
|
||||
|
||||
extern uint8_t *ram, *ram2;
|
||||
extern uint8_t *ram;
|
||||
extern uint8_t *ram2;
|
||||
extern uint32_t rammask;
|
||||
|
||||
extern uint8_t *rom;
|
||||
@@ -336,37 +340,37 @@ extern void addwritelookup(uint32_t virt, uint32_t phys);
|
||||
extern void mem_mapping_set(mem_mapping_t *,
|
||||
uint32_t base,
|
||||
uint32_t size,
|
||||
uint8_t (*read_b)(uint32_t addr, void *p),
|
||||
uint16_t (*read_w)(uint32_t addr, void *p),
|
||||
uint32_t (*read_l)(uint32_t addr, void *p),
|
||||
void (*write_b)(uint32_t addr, uint8_t val, void *p),
|
||||
void (*write_w)(uint32_t addr, uint16_t val, void *p),
|
||||
void (*write_l)(uint32_t addr, uint32_t val, void *p),
|
||||
uint8_t (*read_b)(uint32_t addr, void *priv),
|
||||
uint16_t (*read_w)(uint32_t addr, void *priv),
|
||||
uint32_t (*read_l)(uint32_t addr, void *priv),
|
||||
void (*write_b)(uint32_t addr, uint8_t val, void *priv),
|
||||
void (*write_w)(uint32_t addr, uint16_t val, void *priv),
|
||||
void (*write_l)(uint32_t addr, uint32_t val, void *priv),
|
||||
uint8_t *exec,
|
||||
uint32_t flags,
|
||||
void *p);
|
||||
void *priv);
|
||||
extern void mem_mapping_add(mem_mapping_t *,
|
||||
uint32_t base,
|
||||
uint32_t size,
|
||||
uint8_t (*read_b)(uint32_t addr, void *p),
|
||||
uint16_t (*read_w)(uint32_t addr, void *p),
|
||||
uint32_t (*read_l)(uint32_t addr, void *p),
|
||||
void (*write_b)(uint32_t addr, uint8_t val, void *p),
|
||||
void (*write_w)(uint32_t addr, uint16_t val, void *p),
|
||||
void (*write_l)(uint32_t addr, uint32_t val, void *p),
|
||||
uint8_t (*read_b)(uint32_t addr, void *priv),
|
||||
uint16_t (*read_w)(uint32_t addr, void *priv),
|
||||
uint32_t (*read_l)(uint32_t addr, void *priv),
|
||||
void (*write_b)(uint32_t addr, uint8_t val, void *priv),
|
||||
void (*write_w)(uint32_t addr, uint16_t val, void *priv),
|
||||
void (*write_l)(uint32_t addr, uint32_t val, void *priv),
|
||||
uint8_t *exec,
|
||||
uint32_t flags,
|
||||
void *p);
|
||||
void *priv);
|
||||
|
||||
extern void mem_mapping_set_handler(mem_mapping_t *,
|
||||
uint8_t (*read_b)(uint32_t addr, void *p),
|
||||
uint16_t (*read_w)(uint32_t addr, void *p),
|
||||
uint32_t (*read_l)(uint32_t addr, void *p),
|
||||
void (*write_b)(uint32_t addr, uint8_t val, void *p),
|
||||
void (*write_w)(uint32_t addr, uint16_t val, void *p),
|
||||
void (*write_l)(uint32_t addr, uint32_t val, void *p));
|
||||
uint8_t (*read_b)(uint32_t addr, void *priv),
|
||||
uint16_t (*read_w)(uint32_t addr, void *priv),
|
||||
uint32_t (*read_l)(uint32_t addr, void *priv),
|
||||
void (*write_b)(uint32_t addr, uint8_t val, void *priv),
|
||||
void (*write_w)(uint32_t addr, uint16_t val, void *priv),
|
||||
void (*write_l)(uint32_t addr, uint32_t val, void *priv));
|
||||
|
||||
extern void mem_mapping_set_p(mem_mapping_t *, void *p);
|
||||
extern void mem_mapping_set_p(mem_mapping_t *, void *priv);
|
||||
|
||||
extern void mem_mapping_set_addr(mem_mapping_t *,
|
||||
uint32_t base, uint32_t size);
|
||||
@@ -407,9 +411,9 @@ extern uint64_t mmutranslate_noabrt(uint32_t addr, int rw);
|
||||
|
||||
extern void mem_invalidate_range(uint32_t start_addr, uint32_t end_addr);
|
||||
|
||||
extern void mem_write_ramb_page(uint32_t addr, uint8_t val, page_t *p);
|
||||
extern void mem_write_ramw_page(uint32_t addr, uint16_t val, page_t *p);
|
||||
extern void mem_write_raml_page(uint32_t addr, uint32_t val, page_t *p);
|
||||
extern void mem_write_ramb_page(uint32_t addr, uint8_t val, page_t *page);
|
||||
extern void mem_write_ramw_page(uint32_t addr, uint16_t val, page_t *page);
|
||||
extern void mem_write_raml_page(uint32_t addr, uint32_t val, page_t *page);
|
||||
extern void mem_flush_write_page(uint32_t addr, uint32_t virt);
|
||||
|
||||
extern void mem_reset_page_blocks(void);
|
||||
|
||||
@@ -40,10 +40,11 @@ typedef struct midi_in_handler_t {
|
||||
int cnt;
|
||||
uint32_t len;
|
||||
|
||||
void (*msg)(void *p, uint8_t *msg, uint32_t len);
|
||||
int (*sysex)(void *p, uint8_t *buffer, uint32_t len, int abort);
|
||||
struct midi_in_handler_t *p;
|
||||
struct midi_in_handler_t *prev, *next;
|
||||
void (*msg)(void *priv, uint8_t *msg, uint32_t len);
|
||||
int (*sysex)(void *priv, uint8_t *buffer, uint32_t len, int abort);
|
||||
struct midi_in_handler_t *priv;
|
||||
struct midi_in_handler_t *prev;
|
||||
struct midi_in_handler_t *next;
|
||||
} midi_in_handler_t;
|
||||
|
||||
typedef struct midi_t {
|
||||
@@ -77,7 +78,7 @@ extern void midi_raw_out_byte(uint8_t val);
|
||||
extern void midi_clear_buffer(void);
|
||||
extern void midi_poll(void);
|
||||
|
||||
extern void midi_in_handler(int set, void (*msg)(void *p, uint8_t *msg, uint32_t len), int (*sysex)(void *p, uint8_t *buffer, uint32_t len, int abort), void *p);
|
||||
extern void midi_in_handler(int set, void (*msg)(void *p, uint8_t *msg, uint32_t len), int (*sysex)(void *p, uint8_t *buffer, uint32_t len, int abort), void *priv);
|
||||
extern void midi_in_handlers_clear(void);
|
||||
extern void midi_in_msg(uint8_t *msg, uint32_t len);
|
||||
extern void midi_in_sysex(uint8_t *buffer, uint32_t len);
|
||||
|
||||
@@ -69,7 +69,7 @@ enum {
|
||||
PCI_CARD_SOUND = 0x13,
|
||||
PCI_CARD_IDE = 0x14,
|
||||
PCI_CARD_NETWORK = 0x15,
|
||||
PCI_CARD_BRIDGE = 0x16,
|
||||
PCI_CARD_BRIDGE = 0x16
|
||||
};
|
||||
|
||||
enum {
|
||||
|
||||
@@ -55,6 +55,10 @@ extern int strnicmp(const char *s1, const char *s2, size_t n);
|
||||
# define off64_t off_t
|
||||
#endif
|
||||
|
||||
#if !defined (__APPLE__) && !defined(__clang__)
|
||||
# define FALLTHROUGH_ANNOTATION
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# define UNUSED(arg) arg
|
||||
#else
|
||||
|
||||
25
src/include/86box/plat_fallthrough.h
Normal file
25
src/include/86box/plat_fallthrough.h
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Define the various platform support functions.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Jasmine Iwanek, <jasmine@iwanek.co.uk>
|
||||
*
|
||||
* Copyright 2023 Jasmine Iwanek
|
||||
*/
|
||||
|
||||
#ifndef EMU_PLAT_FALLTHROUGH_H
|
||||
#define EMU_PLAT_FALLTHROUGH_H
|
||||
|
||||
#if !defined (__APPLE__) && !defined(__clang__)
|
||||
# define FALLTHROUGH_ANNOTATION
|
||||
#endif
|
||||
|
||||
#endif /*EMU_PLAT_FALLTHROUGH_H*/
|
||||
@@ -54,7 +54,7 @@ extern uint32_t rom_readl(uint32_t addr, void *p);
|
||||
|
||||
extern FILE *rom_fopen(const char *fn, char *mode);
|
||||
extern int rom_getfile(char *fn, char *s, int size);
|
||||
extern int rom_present(char *fn);
|
||||
extern int rom_present(const char *fn);
|
||||
|
||||
extern int rom_load_linear_oddeven(const char *fn, uint32_t addr, int sz,
|
||||
int off, uint8_t *ptr);
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#ifndef SOUND_AC97_H
|
||||
#define SOUND_AC97_H
|
||||
|
||||
#define AC97_VENDOR_ID(f, s, t, dev) ((((f) &0xff) << 24) | (((s) &0xff) << 16) | (((t) &0xff) << 8) | ((dev) &0xff))
|
||||
#define AC97_VENDOR_ID(a, b, c, i) ((((a) &0xff) << 24) | (((b) &0xff) << 16) | (((c) &0xff) << 8) | ((i) &0xff))
|
||||
|
||||
/* Misc support bits (misc_flags). Most of these are not part of any
|
||||
registers, but control enabling/disabling of registers and bits. */
|
||||
@@ -91,32 +91,26 @@
|
||||
#define AC97_PRK (1 << 13)
|
||||
#define AC97_PRL (1 << 14)
|
||||
|
||||
/* New codecs should be added to the end of this enum to avoid breaking configs. */
|
||||
enum {
|
||||
AC97_CODEC_AD1881 = 0,
|
||||
AC97_CODEC_ALC100 = 1,
|
||||
AC97_CODEC_CS4297 = 2,
|
||||
AC97_CODEC_CS4297A = 3,
|
||||
AC97_CODEC_WM9701A = 4,
|
||||
AC97_CODEC_STAC9708 = 5,
|
||||
AC97_CODEC_STAC9721 = 6,
|
||||
AC97_CODEC_AK4540 = 7
|
||||
};
|
||||
/* Codec IDs. */
|
||||
#define AC97_CODEC_AD1881 AC97_VENDOR_ID('A', 'D', 'S', 0x40)
|
||||
#define AC97_CODEC_AK4540 AC97_VENDOR_ID('A', 'D', 'S', 0x40)
|
||||
#define AC97_CODEC_ALC100 AC97_VENDOR_ID('A', 'L', 'C', 0x20)
|
||||
#define AC97_CODEC_CS4297 AC97_VENDOR_ID('C', 'R', 'Y', 0x03)
|
||||
#define AC97_CODEC_CS4297A AC97_VENDOR_ID('C', 'R', 'Y', 0x11)
|
||||
#define AC97_CODEC_STAC9708 AC97_VENDOR_ID(0x83, 0x84, 0x76, 0x08)
|
||||
#define AC97_CODEC_STAC9721 AC97_VENDOR_ID(0x83, 0x84, 0x76, 0x09)
|
||||
#define AC97_CODEC_TR28023 AC97_VENDOR_ID('T', 'R', 'A', 0x03)
|
||||
#define AC97_CODEC_WM9701A AC97_VENDOR_ID('W', 'M', 'L', 0x00)
|
||||
|
||||
typedef struct ac97_vendor_reg_t {
|
||||
const uint16_t index;
|
||||
const uint16_t value;
|
||||
const uint16_t write_mask;
|
||||
uint8_t page; /* for paged registers [60:6F], 0 otherwise */
|
||||
uint8_t index;
|
||||
uint16_t value;
|
||||
uint16_t write_mask;
|
||||
} ac97_vendor_reg_t;
|
||||
|
||||
typedef struct ac97_codec_t {
|
||||
uint32_t vendor_id;
|
||||
uint32_t min_rate;
|
||||
uint32_t max_rate;
|
||||
uint32_t misc_flags;
|
||||
uint16_t reset_flags;
|
||||
uint16_t extid_flags;
|
||||
uint16_t powerdown_mask;
|
||||
int model;
|
||||
uint16_t regs[64];
|
||||
uint8_t codec_id;
|
||||
uint8_t vendor_reg_page_max;
|
||||
@@ -129,7 +123,7 @@ extern void ac97_codec_writew(ac97_codec_t *dev, uint8_t reg, uint16_
|
||||
extern void ac97_codec_reset(void *priv);
|
||||
extern void ac97_codec_getattn(void *priv, uint8_t reg, int *l, int *r);
|
||||
extern uint32_t ac97_codec_getrate(void *priv, uint8_t reg);
|
||||
extern const device_t *ac97_codec_get(int model);
|
||||
extern const device_t *ac97_codec_get(uint32_t id);
|
||||
|
||||
extern void ac97_via_set_slot(void *priv, int slot, int irq_pin);
|
||||
extern uint8_t ac97_via_read_status(void *priv, uint8_t modem);
|
||||
@@ -152,8 +146,10 @@ extern const device_t ak4540_device;
|
||||
extern const device_t alc100_device;
|
||||
extern const device_t cs4297_device;
|
||||
extern const device_t cs4297a_device;
|
||||
# define ct1297_device tr28023_device
|
||||
extern const device_t stac9708_device;
|
||||
extern const device_t stac9721_device;
|
||||
extern const device_t tr28023_device;
|
||||
extern const device_t wm9701a_device;
|
||||
|
||||
extern const device_t ac97_via_device;
|
||||
|
||||
@@ -47,8 +47,8 @@ typedef struct pc_timer_t {
|
||||
double period; /* This is used for large period timers to count
|
||||
the microseconds and split the period. */
|
||||
|
||||
void (*callback)(void *p);
|
||||
void *p;
|
||||
void (*callback)(void *priv);
|
||||
void *priv;
|
||||
|
||||
struct pc_timer_t *prev;
|
||||
struct pc_timer_t *next;
|
||||
@@ -76,7 +76,7 @@ extern void timer_init(void);
|
||||
|
||||
/*Add new timer. If start_timer is set, timer will be enabled with a zero
|
||||
timestamp - this is useful for permanently enabled timers*/
|
||||
extern void timer_add(pc_timer_t *timer, void (*callback)(void *p), void *p, int start_timer);
|
||||
extern void timer_add(pc_timer_t *timer, void (*callback)(void *priv), void *priv, int start_timer);
|
||||
|
||||
/*1us in 32:32 format*/
|
||||
extern uint64_t TIMER_USEC;
|
||||
@@ -162,16 +162,16 @@ timer_get_remaining_u64(pc_timer_t *timer)
|
||||
|
||||
/*Set timer callback function*/
|
||||
static __inline void
|
||||
timer_set_callback(pc_timer_t *timer, void (*callback)(void *p))
|
||||
timer_set_callback(pc_timer_t *timer, void (*callback)(void *priv))
|
||||
{
|
||||
timer->callback = callback;
|
||||
}
|
||||
|
||||
/*Set timer private data*/
|
||||
static __inline void
|
||||
timer_set_p(pc_timer_t *timer, void *p)
|
||||
timer_set_p(pc_timer_t *timer, void *priv)
|
||||
{
|
||||
timer->p = p;
|
||||
timer->priv = priv;
|
||||
}
|
||||
|
||||
/* The API for big timer periods starts here. */
|
||||
@@ -209,7 +209,7 @@ timer_process_inline(void)
|
||||
if (timer->flags & TIMER_SPLIT)
|
||||
timer_advance_ex(timer, 0); /* We're splitting a > 1 s period into multiple <= 1 s periods. */
|
||||
else if (timer->callback != NULL) /* Make sure it's no NULL, so that we can have a NULL callback when no operation is needed. */
|
||||
timer->callback(timer->p);
|
||||
timer->callback(timer->priv);
|
||||
}
|
||||
|
||||
timer_target = timer_head->ts.ts32.integer;
|
||||
|
||||
@@ -31,22 +31,30 @@ typedef struct ibm8514_t {
|
||||
uint32_t vram_mask;
|
||||
|
||||
PALETTE vgapal;
|
||||
uint8_t dac_mask, dac_status;
|
||||
uint8_t dac_mask;
|
||||
uint8_t dac_status;
|
||||
uint32_t *map8;
|
||||
int dac_addr, dac_pos, dac_r, dac_g;
|
||||
int dac_addr;
|
||||
int dac_pos;
|
||||
int dac_r;
|
||||
int dac_g;
|
||||
int internal_pitch;
|
||||
|
||||
struct {
|
||||
uint16_t subsys_cntl;
|
||||
uint16_t setup_md;
|
||||
uint8_t advfunc_cntl, ext_advfunc_cntl;
|
||||
uint16_t cur_y, cur_y_bitres;
|
||||
uint16_t cur_x, cur_x_bitres;
|
||||
uint8_t advfunc_cntl;
|
||||
uint8_t ext_advfunc_cntl;
|
||||
uint16_t cur_y;
|
||||
uint16_t cur_y_bitres;
|
||||
uint16_t cur_x;
|
||||
uint16_t cur_x_bitres;
|
||||
int16_t desty_axstp;
|
||||
int16_t destx_distp;
|
||||
int16_t err_term;
|
||||
int16_t maj_axis_pcnt;
|
||||
uint16_t cmd, cmd_back;
|
||||
uint16_t cmd;
|
||||
uint16_t cmd_back;
|
||||
uint16_t short_stroke;
|
||||
uint16_t bkgd_color;
|
||||
uint16_t frgd_color;
|
||||
@@ -57,63 +65,120 @@ typedef struct ibm8514_t {
|
||||
uint16_t frgd_mix;
|
||||
uint16_t multifunc_cntl;
|
||||
uint16_t multifunc[16];
|
||||
int16_t clip_left, clip_top;
|
||||
int16_t clip_left;
|
||||
int16_t clip_top;
|
||||
uint8_t pix_trans[2];
|
||||
int poly_draw;
|
||||
int ssv_state;
|
||||
int16_t x1, x2, x3, y1, y2;
|
||||
int sys_cnt, sys_cnt2;
|
||||
int x1;
|
||||
int x2;
|
||||
int x3;
|
||||
int y1;
|
||||
int y2;
|
||||
int sys_cnt;
|
||||
int sys_cnt2;
|
||||
int temp_cnt;
|
||||
int16_t cx, cy, oldcy;
|
||||
int16_t sx, sy;
|
||||
int16_t dx, dy;
|
||||
int16_t cx;
|
||||
int16_t cy;
|
||||
int16_t oldcy;
|
||||
int16_t sx;
|
||||
int16_t sy;
|
||||
int16_t dx;
|
||||
int16_t dy;
|
||||
int16_t err;
|
||||
uint32_t src, dest;
|
||||
uint32_t newsrc_blt, newdest_blt;
|
||||
uint32_t newdest_in, newdest_out;
|
||||
uint8_t *writemono, *nibbleset;
|
||||
int x_count, xx_count, y_count;
|
||||
int input, output;
|
||||
uint32_t src;
|
||||
uint32_t dest;
|
||||
uint32_t newsrc_blt;
|
||||
uint32_t newdest_blt;
|
||||
uint32_t newdest_in;
|
||||
uint32_t newdest_out;
|
||||
uint8_t *writemono;
|
||||
uint8_t *nibbleset;
|
||||
int x_count;
|
||||
int xx_count;
|
||||
int y_count;
|
||||
int input;
|
||||
int output;
|
||||
|
||||
uint16_t cur_x_bit12, cur_y_bit12;
|
||||
uint16_t cur_x_bit12;
|
||||
uint16_t cur_y_bit12;
|
||||
int ssv_len;
|
||||
uint8_t ssv_dir;
|
||||
uint8_t ssv_draw;
|
||||
int odd_in, odd_out;
|
||||
int odd_in;
|
||||
int odd_out;
|
||||
|
||||
uint16_t scratch;
|
||||
int fill_state, xdir, ydir;
|
||||
int fill_state;
|
||||
int xdir;
|
||||
int ydir;
|
||||
uint32_t ge_offset;
|
||||
} accel;
|
||||
|
||||
uint16_t test;
|
||||
int ibm_mode;
|
||||
int ibm_mode;
|
||||
|
||||
int v_total, dispend, v_syncstart, split,
|
||||
h_disp, h_disp_old, h_total, h_disp_time, rowoffset,
|
||||
dispon, hdisp_on, linecountff,
|
||||
vc, linepos, oddeven, cursoron, blink, scrollcache,
|
||||
firstline, lastline, firstline_draw, lastline_draw,
|
||||
displine, fullchange;
|
||||
uint32_t ma, maback;
|
||||
int v_total;
|
||||
int dispend;
|
||||
int v_syncstart;
|
||||
int split;
|
||||
int h_disp;
|
||||
int h_disp_old;
|
||||
int h_total;
|
||||
int h_disp_time;
|
||||
int rowoffset;
|
||||
int dispon;
|
||||
int hdisp_on;
|
||||
int linecountff;
|
||||
int vc;
|
||||
int linepos;
|
||||
int oddeven;
|
||||
int cursoron;
|
||||
int blink;
|
||||
int scrollcache;
|
||||
int firstline;
|
||||
int lastline;
|
||||
int firstline_draw;
|
||||
int lastline_draw;
|
||||
int displine;
|
||||
int fullchange;
|
||||
uint32_t ma;
|
||||
uint32_t maback;
|
||||
|
||||
uint8_t *vram, *changedvram, linedbl;
|
||||
uint8_t *vram;
|
||||
uint8_t *changedvram;
|
||||
uint8_t linedbl;
|
||||
|
||||
uint8_t data_available, data_available2;
|
||||
uint8_t scanmodulos, rowcount;
|
||||
int htotal, hdisp, vtadj, vdadj, vsadj, sc,
|
||||
vtb, vdb, vsb, vsyncstart, vsyncwidth;
|
||||
int vtotal, vdisp;
|
||||
int disp_cntl, interlace;
|
||||
uint8_t subsys_cntl, subsys_stat;
|
||||
uint8_t data_available;
|
||||
uint8_t data_available2;
|
||||
uint8_t scanmodulos;
|
||||
uint8_t rowcount;
|
||||
int htotal;
|
||||
int hdisp;
|
||||
int vtadj;
|
||||
int vdadj;
|
||||
int vsadj;
|
||||
int sc;
|
||||
int vtb;
|
||||
int vdb;
|
||||
int vsb;
|
||||
int vsyncstart;
|
||||
int vsyncwidth;
|
||||
int vtotal;
|
||||
int vdisp;
|
||||
int disp_cntl;
|
||||
int interlace;
|
||||
uint8_t subsys_cntl;
|
||||
uint8_t subsys_stat;
|
||||
|
||||
atomic_int force_busy, force_busy2;
|
||||
atomic_int force_busy;
|
||||
atomic_int force_busy2;
|
||||
|
||||
int blitter_busy;
|
||||
uint64_t blitter_time;
|
||||
uint64_t status_time;
|
||||
int pitch;
|
||||
int ext_pitch;
|
||||
int ext_crt_pitch;
|
||||
int pitch;
|
||||
int ext_pitch;
|
||||
int ext_crt_pitch;
|
||||
} ibm8514_t;
|
||||
#endif /*VIDEO_8514A_H*/
|
||||
|
||||
@@ -32,8 +32,12 @@ enum {
|
||||
typedef struct ati_eeprom_t {
|
||||
uint16_t data[256];
|
||||
|
||||
int oldclk, oldena;
|
||||
int opcode, state, count, out;
|
||||
int oldclk;
|
||||
int oldena;
|
||||
int opcode;
|
||||
int state;
|
||||
int count;
|
||||
int out;
|
||||
int wp;
|
||||
uint32_t dat;
|
||||
int type;
|
||||
|
||||
@@ -28,21 +28,31 @@ typedef struct cga_t {
|
||||
|
||||
uint8_t cgastat;
|
||||
|
||||
uint8_t cgamode, cgacol;
|
||||
uint8_t cgamode;
|
||||
uint8_t cgacol;
|
||||
|
||||
int fontbase;
|
||||
int linepos, displine;
|
||||
int sc, vc;
|
||||
int linepos;
|
||||
int displine;
|
||||
int sc;
|
||||
int vc;
|
||||
int cgadispon;
|
||||
int con, coff, cursoron, cgablink;
|
||||
int vsynctime, vadj;
|
||||
uint16_t ma, maback;
|
||||
int con;
|
||||
int coff;
|
||||
int cursoron;
|
||||
int cgablink;
|
||||
int vsynctime;
|
||||
int vadj;
|
||||
uint16_t ma;
|
||||
uint16_t maback;
|
||||
int oddeven;
|
||||
|
||||
uint64_t dispontime, dispofftime;
|
||||
uint64_t dispontime;
|
||||
uint64_t dispofftime;
|
||||
pc_timer_t timer;
|
||||
|
||||
int firstline, lastline;
|
||||
int firstline;
|
||||
int lastline;
|
||||
|
||||
int drawcursor;
|
||||
|
||||
@@ -59,12 +69,12 @@ typedef struct cga_t {
|
||||
} cga_t;
|
||||
|
||||
void cga_init(cga_t *cga);
|
||||
void cga_out(uint16_t addr, uint8_t val, void *p);
|
||||
uint8_t cga_in(uint16_t addr, void *p);
|
||||
void cga_write(uint32_t addr, uint8_t val, void *p);
|
||||
uint8_t cga_read(uint32_t addr, void *p);
|
||||
void cga_out(uint16_t addr, uint8_t val, void *priv);
|
||||
uint8_t cga_in(uint16_t addr, void *priv);
|
||||
void cga_write(uint32_t addr, uint8_t val, void *priv);
|
||||
uint8_t cga_read(uint32_t addr, void *priv);
|
||||
void cga_recalctimings(cga_t *cga);
|
||||
void cga_poll(void *p);
|
||||
void cga_poll(void *priv);
|
||||
|
||||
#ifdef EMU_DEVICE_H
|
||||
extern const device_config_t cga_config[];
|
||||
|
||||
@@ -21,13 +21,11 @@
|
||||
#ifndef VIDEO_CGA_COMP_H
|
||||
#define VIDEO_CGA_COMP_H
|
||||
|
||||
#define Bit8u uint8_t
|
||||
#define Bit32u uint32_t
|
||||
#define Bitu unsigned int
|
||||
#define bool uint8_t
|
||||
#define Bitu unsigned int
|
||||
#define bool uint8_t
|
||||
|
||||
void update_cga16_color(uint8_t cgamode);
|
||||
void cga_comp_init(int revision);
|
||||
Bit32u *Composite_Process(uint8_t cgamode, Bit8u border, Bit32u blocks /*, bool doublewidth*/, Bit32u *TempLine);
|
||||
Bit32u *Composite_Process(uint8_t cgamode, uint8_t border, uint32_t blocks /*, bool doublewidth*/, uint32_t *TempLine);
|
||||
|
||||
#endif /*VIDEO_CGA_COMP_H*/
|
||||
|
||||
@@ -27,11 +27,26 @@ typedef struct ega_t {
|
||||
|
||||
rom_t bios_rom;
|
||||
|
||||
uint8_t crtcreg, gdcaddr, attraddr, attrff,
|
||||
attr_palette_enable, seqaddr, miscout,
|
||||
writemask, la, lb, lc, ld,
|
||||
stat, colourcompare, colournocare, scrblank,
|
||||
plane_mask, pad, pad0, pad1;
|
||||
uint8_t crtcreg;
|
||||
uint8_t gdcaddr;
|
||||
uint8_t attraddr;
|
||||
uint8_t attrff;
|
||||
uint8_t attr_palette_enable;
|
||||
uint8_t seqaddr;
|
||||
uint8_t miscout;
|
||||
uint8_t writemask;
|
||||
uint8_t la;
|
||||
uint8_t lb;
|
||||
uint8_t lc;
|
||||
uint8_t ld;
|
||||
uint8_t stat;
|
||||
uint8_t colourcompare;
|
||||
uint8_t colournocare;
|
||||
uint8_t scrblank;
|
||||
uint8_t plane_mask;
|
||||
uint8_t pad;
|
||||
uint8_t pad0;
|
||||
uint8_t pad1;
|
||||
uint8_t crtc[32];
|
||||
uint8_t gdcreg[16];
|
||||
uint8_t attrregs[32];
|
||||
@@ -41,25 +56,72 @@ typedef struct ega_t {
|
||||
|
||||
uint8_t *vram;
|
||||
|
||||
int vidclock, fast, extvram, vres,
|
||||
readmode, writemode, readplane, vrammask,
|
||||
chain4, chain2_read, chain2_write, con,
|
||||
oddeven_page, oddeven_chain, vc, sc,
|
||||
dispon, hdisp_on, cursoron, blink, fullchange,
|
||||
linepos, vslines, linecountff, oddeven,
|
||||
lowres, interlace, linedbl, lindebl, rowcount,
|
||||
vtotal, dispend, vsyncstart, split,
|
||||
hdisp, hdisp_old, htotal, hdisp_time, rowoffset,
|
||||
vblankstart, scrollcache, firstline, lastline,
|
||||
firstline_draw, lastline_draw, x_add, y_add,
|
||||
displine, res_x, res_y, bpp, index;
|
||||
int vidclock;
|
||||
int fast;
|
||||
int extvram;
|
||||
int vres;
|
||||
int readmode;
|
||||
int writemode;
|
||||
int readplane;
|
||||
int vrammask;
|
||||
int chain4;
|
||||
int chain2_read;
|
||||
int chain2_write;
|
||||
int con;
|
||||
int oddeven_page;
|
||||
int oddeven_chain;
|
||||
int vc;
|
||||
int sc;
|
||||
int dispon;
|
||||
int hdisp_on;
|
||||
int cursoron;
|
||||
int blink;
|
||||
int fullchange;
|
||||
int linepos;
|
||||
int vslines;
|
||||
int linecountff;
|
||||
int oddeven;
|
||||
int lowres;
|
||||
int interlace;
|
||||
int linedbl;
|
||||
int lindebl;
|
||||
int rowcount;
|
||||
int vtotal;
|
||||
int dispend;
|
||||
int vsyncstart;
|
||||
int split;
|
||||
int hdisp;
|
||||
int hdisp_old;
|
||||
int htotal;
|
||||
int hdisp_time;
|
||||
int rowoffset;
|
||||
int vblankstart;
|
||||
int scrollcache;
|
||||
int firstline;
|
||||
int lastline;
|
||||
int firstline_draw;
|
||||
int lastline_draw;
|
||||
int x_add;
|
||||
int y_add;
|
||||
int displine;
|
||||
int res_x;
|
||||
int res_y;
|
||||
int bpp;
|
||||
int index;
|
||||
|
||||
uint32_t charseta, charsetb, ma_latch, ma,
|
||||
maback, ca, vram_limit, overscan_color;
|
||||
uint32_t charseta;
|
||||
uint32_t charsetb;
|
||||
uint32_t ma_latch;
|
||||
uint32_t ma;
|
||||
uint32_t maback;
|
||||
uint32_t ca;
|
||||
uint32_t vram_limit;
|
||||
uint32_t overscan_color;
|
||||
|
||||
uint32_t *pallook;
|
||||
|
||||
uint64_t dispontime, dispofftime;
|
||||
uint64_t dispontime;
|
||||
uint64_t dispofftime;
|
||||
pc_timer_t timer;
|
||||
|
||||
double clock;
|
||||
@@ -97,18 +159,22 @@ extern void ega_recalctimings(struct ega_t *ega);
|
||||
extern void ega_recalc_remap_func(struct ega_t *ega);
|
||||
#endif
|
||||
|
||||
extern void ega_out(uint16_t addr, uint8_t val, void *p);
|
||||
extern uint8_t ega_in(uint16_t addr, void *p);
|
||||
extern void ega_poll(void *p);
|
||||
extern void ega_write(uint32_t addr, uint8_t val, void *p);
|
||||
extern uint8_t ega_read(uint32_t addr, void *p);
|
||||
extern void ega_out(uint16_t addr, uint8_t val, void *priv);
|
||||
extern uint8_t ega_in(uint16_t addr, void *priv);
|
||||
extern void ega_poll(void *priv);
|
||||
extern void ega_write(uint32_t addr, uint8_t val, void *priv);
|
||||
extern uint8_t ega_read(uint32_t addr, void *priv);
|
||||
|
||||
extern int firstline_draw, lastline_draw;
|
||||
extern int firstline_draw;
|
||||
extern int lastline_draw;
|
||||
extern int displine;
|
||||
extern int sc;
|
||||
|
||||
extern uint32_t ma, ca;
|
||||
extern int con, cursoron, cgablink;
|
||||
extern uint32_t ma;
|
||||
extern uint32_t ca;
|
||||
extern int con;
|
||||
extern int cursoron;
|
||||
extern int cgablink;
|
||||
|
||||
extern int scrollcache;
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ ega_recalc_remap_func(ega_t *ega)
|
||||
func_nr = VAR_DWORD_MODE;
|
||||
else if (ega->crtc[0x17] & 0x40)
|
||||
func_nr = VAR_BYTE_MODE;
|
||||
else if ((ega->crtc[0x17] & 0x20) && ega->vram_limit > 64*1024)
|
||||
else if ((ega->crtc[0x17] & 0x20) && ega->vram_limit > 64 * 1024)
|
||||
func_nr = VAR_WORD_MODE_MA15;
|
||||
else
|
||||
func_nr = VAR_WORD_MODE_MA13;
|
||||
|
||||
@@ -25,30 +25,32 @@
|
||||
typedef struct {
|
||||
mem_mapping_t mapping;
|
||||
|
||||
uint8_t crtc[32], charbuffer[4096];
|
||||
uint8_t crtc[32];
|
||||
uint8_t charbuffer[4096];
|
||||
int crtcreg;
|
||||
|
||||
uint8_t ctrl,
|
||||
ctrl2,
|
||||
stat;
|
||||
uint8_t ctrl;
|
||||
uint8_t ctrl2;
|
||||
uint8_t stat;
|
||||
|
||||
uint64_t dispontime,
|
||||
dispofftime;
|
||||
uint64_t dispontime;
|
||||
uint64_t dispofftime;
|
||||
pc_timer_t timer;
|
||||
|
||||
int firstline,
|
||||
lastline;
|
||||
int firstline;
|
||||
int lastline;
|
||||
|
||||
int linepos,
|
||||
displine;
|
||||
int vc,
|
||||
sc;
|
||||
uint16_t ma,
|
||||
maback;
|
||||
int con, coff,
|
||||
cursoron;
|
||||
int dispon,
|
||||
blink;
|
||||
int linepos;
|
||||
int displine;
|
||||
int vc;
|
||||
int sc;
|
||||
uint16_t ma;
|
||||
uint16_t maback;
|
||||
int con;
|
||||
int coff;
|
||||
int cursoron;
|
||||
int dispon;
|
||||
int blink;
|
||||
int vsynctime;
|
||||
int vadj;
|
||||
|
||||
|
||||
@@ -11,18 +11,27 @@ typedef struct mda_t {
|
||||
uint8_t crtc[32];
|
||||
int crtcreg;
|
||||
|
||||
uint8_t ctrl, stat;
|
||||
uint8_t ctrl;
|
||||
uint8_t stat;
|
||||
|
||||
uint64_t dispontime, dispofftime;
|
||||
uint64_t dispontime;
|
||||
uint64_t dispofftime;
|
||||
pc_timer_t timer;
|
||||
|
||||
int firstline, lastline;
|
||||
int firstline;
|
||||
int lastline;
|
||||
|
||||
int linepos, displine;
|
||||
int vc, sc;
|
||||
uint16_t ma, maback;
|
||||
int con, coff, cursoron;
|
||||
int dispon, blink;
|
||||
int linepos;
|
||||
int displine;
|
||||
int vc;
|
||||
int sc;
|
||||
uint16_t ma;
|
||||
uint16_t maback;
|
||||
int con;
|
||||
int coff;
|
||||
int cursoron;
|
||||
int dispon;
|
||||
int blink;
|
||||
int vsynctime;
|
||||
int vadj;
|
||||
int monitor_index;
|
||||
@@ -43,12 +52,12 @@ typedef struct mda_t {
|
||||
|
||||
void mda_init(mda_t *mda);
|
||||
void mda_setcol(int chr, int blink, int fg, uint8_t cga_ink);
|
||||
void mda_out(uint16_t addr, uint8_t val, void *p);
|
||||
uint8_t mda_in(uint16_t addr, void *p);
|
||||
void mda_write(uint32_t addr, uint8_t val, void *p);
|
||||
uint8_t mda_read(uint32_t addr, void *p);
|
||||
void mda_out(uint16_t addr, uint8_t val, void *priv);
|
||||
uint8_t mda_in(uint16_t addr, void *priv);
|
||||
void mda_write(uint32_t addr, uint8_t val, void *priv);
|
||||
uint8_t mda_read(uint32_t addr, void *priv);
|
||||
void mda_recalctimings(mda_t *mda);
|
||||
void mda_poll(void *p);
|
||||
void mda_poll(void *priv);
|
||||
|
||||
#ifdef EMU_DEVICE_H
|
||||
extern const device_t mda_device;
|
||||
|
||||
@@ -59,10 +59,10 @@ typedef struct pgc {
|
||||
mem_mapping_t mapping;
|
||||
mem_mapping_t cga_mapping;
|
||||
|
||||
pgc_cl_t *clist,
|
||||
*clcur;
|
||||
const pgc_cmd_t *master,
|
||||
*commands;
|
||||
pgc_cl_t *clist;
|
||||
pgc_cl_t *clcur;
|
||||
const pgc_cmd_t *master;
|
||||
const pgc_cmd_t *commands;
|
||||
|
||||
uint8_t mapram[2048]; /* host <> PGC communication buffer */
|
||||
uint8_t *cga_vram;
|
||||
@@ -73,10 +73,18 @@ typedef struct pgc {
|
||||
uint32_t userpal[256];
|
||||
uint32_t maxw, maxh; /* maximum framebuffer size */
|
||||
uint32_t visw, vish; /* maximum screen size */
|
||||
uint32_t screenw, screenh;
|
||||
int16_t pan_x, pan_y;
|
||||
uint16_t win_x1, win_x2, win_y1, win_y2;
|
||||
uint16_t vp_x1, vp_x2, vp_y1, vp_y2;
|
||||
uint32_t screenw;
|
||||
uint32_t screenh;
|
||||
int16_t pan_x;
|
||||
int16_t pan_y;
|
||||
uint16_t win_x1;
|
||||
uint16_t win_x2;
|
||||
uint16_t win_y1;
|
||||
uint16_t win_y2;
|
||||
uint16_t vp_x1;
|
||||
uint16_t vp_x2;
|
||||
uint16_t vp_y1;
|
||||
uint16_t vp_y2;
|
||||
int16_t fill_pattern[16];
|
||||
int16_t line_pattern;
|
||||
uint8_t draw_mode;
|
||||
@@ -86,7 +94,9 @@ typedef struct pgc {
|
||||
uint8_t tjust_v; /* vert alignment 1=bottom 2=ctr 3=top*/
|
||||
int32_t tsize; /* horizontal spacing */
|
||||
|
||||
int32_t x, y, z; /* drawing position */
|
||||
int32_t x;
|
||||
int32_t y;
|
||||
int32_t z; /* drawing position */
|
||||
|
||||
thread_t *pgc_thread;
|
||||
event_t *pgc_wake_thread;
|
||||
@@ -98,18 +108,23 @@ typedef struct pgc {
|
||||
int ascii_mode;
|
||||
int result_count;
|
||||
|
||||
int fontbase;
|
||||
int linepos,
|
||||
displine;
|
||||
int fontbase;
|
||||
int linepos;
|
||||
int displine;
|
||||
int vc;
|
||||
int cgadispon;
|
||||
int con, coff, cursoron, cgablink;
|
||||
int vsynctime, vadj;
|
||||
uint16_t ma, maback;
|
||||
int con;
|
||||
int coff;
|
||||
int cursoron;
|
||||
int cgablink;
|
||||
int vsynctime;
|
||||
int vadj;
|
||||
uint16_t ma;
|
||||
uint16_t maback;
|
||||
int oddeven;
|
||||
|
||||
uint64_t dispontime,
|
||||
dispofftime;
|
||||
uint64_t dispontime;
|
||||
uint64_t dispofftime;
|
||||
pc_timer_t timer;
|
||||
double native_pixel_clock;
|
||||
|
||||
@@ -140,10 +155,14 @@ extern void pgc_init(pgc_t *,
|
||||
extern void pgc_sto_raster(pgc_t *, int16_t *x, int16_t *y);
|
||||
extern void pgc_ito_raster(pgc_t *, int32_t *x, int32_t *y);
|
||||
extern void pgc_dto_raster(pgc_t *, double *x, double *y);
|
||||
// extern int pgc_input_byte(pgc_t *, uint8_t *val);
|
||||
// extern int pgc_output_byte(pgc_t *, uint8_t val);
|
||||
#if 0
|
||||
extern int pgc_input_byte(pgc_t *, uint8_t *val);
|
||||
extern int pgc_output_byte(pgc_t *, uint8_t val);
|
||||
#endif
|
||||
extern int pgc_output_string(pgc_t *, const char *val);
|
||||
// extern int pgc_error_byte(pgc_t *, uint8_t val);
|
||||
#if 0
|
||||
extern int pgc_error_byte(pgc_t *, uint8_t val);
|
||||
#endif
|
||||
extern int pgc_error_string(pgc_t *, const char *val);
|
||||
extern int pgc_error(pgc_t *, int err);
|
||||
|
||||
|
||||
@@ -31,16 +31,23 @@
|
||||
# define FLAG_NOSKEW 16
|
||||
# define FLAG_ADDR_BY16 32
|
||||
# define FLAG_RAMDAC_SHIFT 64
|
||||
# define FLAG_ATI 128
|
||||
# define FLAG_ATI 128
|
||||
# define FLAG_S3_911_16BIT 256
|
||||
# define FLAG_512K_MASK 512
|
||||
struct monitor_t;
|
||||
|
||||
typedef struct {
|
||||
int ena,
|
||||
x, y, xoff, yoff, cur_xsize, cur_ysize,
|
||||
v_acc, h_acc;
|
||||
uint32_t addr, pitch;
|
||||
typedef struct hwcursor_t {
|
||||
int ena;
|
||||
int x;
|
||||
int y;
|
||||
int xoff;
|
||||
int yoff;
|
||||
int cur_xsize;
|
||||
int cur_ysize;
|
||||
int v_acc;
|
||||
int h_acc;
|
||||
uint32_t addr;
|
||||
uint32_t pitch;
|
||||
} hwcursor_t;
|
||||
|
||||
typedef union {
|
||||
@@ -55,25 +62,78 @@ typedef struct svga_t {
|
||||
xga_t xga;
|
||||
mem_mapping_t mapping;
|
||||
|
||||
uint8_t fast, chain4, chain2_write, chain2_read,
|
||||
ext_overscan, bus_size,
|
||||
lowres, interlace, linedbl, rowcount,
|
||||
set_reset_disabled, bpp, ramdac_type, fb_only,
|
||||
readmode, writemode, readplane,
|
||||
hwcursor_oddeven, dac_hwcursor_oddeven, overlay_oddeven,
|
||||
fcr, hblank_overscan;
|
||||
uint8_t fast;
|
||||
uint8_t chain4;
|
||||
uint8_t chain2_write;
|
||||
uint8_t chain2_read;
|
||||
uint8_t ext_overscan;
|
||||
uint8_t bus_size;
|
||||
uint8_t lowres;
|
||||
uint8_t interlace;
|
||||
uint8_t linedbl;
|
||||
uint8_t rowcount;
|
||||
uint8_t set_reset_disabled;
|
||||
uint8_t bpp;
|
||||
uint8_t ramdac_type;
|
||||
uint8_t fb_only;
|
||||
uint8_t readmode;
|
||||
uint8_t writemode;
|
||||
uint8_t readplane;
|
||||
uint8_t hwcursor_oddeven;
|
||||
uint8_t dac_hwcursor_oddeven;
|
||||
uint8_t overlay_oddeven;
|
||||
uint8_t fcr;
|
||||
uint8_t hblank_overscan;
|
||||
|
||||
int dac_addr, dac_pos, dac_r, dac_g,
|
||||
vtotal, dispend, vsyncstart, split, vblankstart,
|
||||
hdisp, hdisp_old, htotal, hdisp_time, rowoffset,
|
||||
dispon, hdisp_on,
|
||||
vc, sc, linepos, vslines, linecountff, oddeven,
|
||||
con, cursoron, blink, scrollcache, char_width,
|
||||
firstline, lastline, firstline_draw, lastline_draw,
|
||||
displine, fullchange, x_add, y_add, pan,
|
||||
vram_display_mask, vidclock, dots_per_clock, hblank_ext,
|
||||
hwcursor_on, dac_hwcursor_on, overlay_on, set_override,
|
||||
hblankstart, hblankend, hblank_sub, hblank_end_val, hblank_end_len;
|
||||
int dac_addr;
|
||||
int dac_pos;
|
||||
int dac_r;
|
||||
int dac_g;
|
||||
int vtotal;
|
||||
int dispend;
|
||||
int vsyncstart;
|
||||
int split;
|
||||
int vblankstart;
|
||||
int hdisp;
|
||||
int hdisp_old;
|
||||
int htotal;
|
||||
int hdisp_time;
|
||||
int rowoffset;
|
||||
int dispon;
|
||||
int hdisp_on;
|
||||
int vc;
|
||||
int sc;
|
||||
int linepos;
|
||||
int vslines;
|
||||
int linecountff;
|
||||
int oddeven;
|
||||
int con;
|
||||
int cursoron;
|
||||
int blink;
|
||||
int scrollcache;
|
||||
int char_width;
|
||||
int firstline;
|
||||
int lastline;
|
||||
int firstline_draw;
|
||||
int lastline_draw;
|
||||
int displine;
|
||||
int fullchange;
|
||||
int x_add;
|
||||
int y_add;
|
||||
int pan;
|
||||
int vram_display_mask;
|
||||
int vidclock;
|
||||
int dots_per_clock;
|
||||
int hblank_ext;
|
||||
int hwcursor_on;
|
||||
int dac_hwcursor_on;
|
||||
int overlay_on;
|
||||
int set_override;
|
||||
int hblankstart;
|
||||
int hblankend;
|
||||
int hblank_sub;
|
||||
int hblank_end_val;
|
||||
int hblank_end_len;
|
||||
|
||||
/*The three variables below allow us to implement memory maps like that seen on a 1MB Trio64 :
|
||||
0MB-1MB - VRAM
|
||||
@@ -84,35 +144,47 @@ typedef struct svga_t {
|
||||
For the example memory map, decode_mask would be 4MB-1 (4MB address space), vram_max would be 2MB
|
||||
(present video memory only responds to first 2MB), vram_mask would be 1MB-1 (video memory wraps at 1MB)
|
||||
*/
|
||||
uint32_t decode_mask, vram_max,
|
||||
vram_mask,
|
||||
charseta, charsetb,
|
||||
adv_flags, ma_latch,
|
||||
ca_adj, ma, maback,
|
||||
write_bank, read_bank,
|
||||
extra_banks[2],
|
||||
banked_mask,
|
||||
ca, overscan_color,
|
||||
*map8, pallook[512];
|
||||
uint32_t decode_mask;
|
||||
uint32_t vram_max;
|
||||
uint32_t vram_mask;
|
||||
uint32_t charseta;
|
||||
uint32_t charsetb;
|
||||
uint32_t adv_flags;
|
||||
uint32_t ma_latch;
|
||||
uint32_t ca_adj;
|
||||
uint32_t ma;
|
||||
uint32_t maback;
|
||||
uint32_t write_bank;
|
||||
uint32_t read_bank;
|
||||
uint32_t extra_banks[2];
|
||||
uint32_t banked_mask;
|
||||
uint32_t ca;
|
||||
uint32_t overscan_color;
|
||||
uint32_t *map8;
|
||||
uint32_t pallook[512];
|
||||
|
||||
PALETTE vgapal;
|
||||
|
||||
uint64_t dispontime, dispofftime;
|
||||
uint64_t dispontime;
|
||||
uint64_t dispofftime;
|
||||
latch_t latch;
|
||||
|
||||
pc_timer_t timer;
|
||||
|
||||
double clock;
|
||||
|
||||
hwcursor_t hwcursor, hwcursor_latch,
|
||||
dac_hwcursor, dac_hwcursor_latch,
|
||||
overlay, overlay_latch;
|
||||
hwcursor_t hwcursor;
|
||||
hwcursor_t hwcursor_latch;
|
||||
hwcursor_t dac_hwcursor;
|
||||
hwcursor_t dac_hwcursor_latch;
|
||||
hwcursor_t overlay;
|
||||
hwcursor_t overlay_latch;
|
||||
|
||||
void (*render)(struct svga_t *svga);
|
||||
void (*recalctimings_ex)(struct svga_t *svga);
|
||||
|
||||
void (*video_out)(uint16_t addr, uint8_t val, void *p);
|
||||
uint8_t (*video_in)(uint16_t addr, void *p);
|
||||
void (*video_out)(uint16_t addr, uint8_t val, void *priv);
|
||||
uint8_t (*video_in)(uint16_t addr, void *priv);
|
||||
|
||||
void (*hwcursor_draw)(struct svga_t *svga, int displine);
|
||||
|
||||
@@ -123,7 +195,7 @@ typedef struct svga_t {
|
||||
void (*vblank_start)(struct svga_t *svga);
|
||||
|
||||
void (*ven_write)(struct svga_t *svga, uint8_t val, uint32_t addr);
|
||||
float (*getclock)(int clock, void *p);
|
||||
float (*getclock)(int clock, void *priv);
|
||||
|
||||
/* Called when VC=R18 and friends. If this returns zero then MA resetting
|
||||
is skipped. Matrox Mystique in Power mode reuses this counter for
|
||||
@@ -133,24 +205,39 @@ typedef struct svga_t {
|
||||
/*Called at the start of vertical sync*/
|
||||
void (*vsync_callback)(struct svga_t *svga);
|
||||
|
||||
uint32_t (*translate_address)(uint32_t addr, void *p);
|
||||
uint32_t (*translate_address)(uint32_t addr, void *priv);
|
||||
/*If set then another device is driving the monitor output and the SVGA
|
||||
card should not attempt to display anything */
|
||||
int override;
|
||||
void *p;
|
||||
void *priv;
|
||||
|
||||
uint8_t crtc[256], gdcreg[256], attrregs[32], seqregs[256],
|
||||
egapal[16],
|
||||
*vram, *changedvram;
|
||||
uint8_t crtc[256];
|
||||
uint8_t gdcreg[256];
|
||||
uint8_t attrregs[32];
|
||||
uint8_t seqregs[256];
|
||||
uint8_t egapal[16];
|
||||
uint8_t *vram;
|
||||
uint8_t *changedvram;
|
||||
|
||||
uint8_t crtcreg, gdcaddr,
|
||||
attrff, attr_palette_enable, attraddr, seqaddr,
|
||||
miscout, cgastat, scrblank,
|
||||
plane_mask, writemask,
|
||||
colourcompare, colournocare,
|
||||
dac_mask, dac_status,
|
||||
dpms, dpms_ui,
|
||||
ksc5601_sbyte_mask, ksc5601_udc_area_msb[2];
|
||||
uint8_t crtcreg;
|
||||
uint8_t gdcaddr;
|
||||
uint8_t attrff;
|
||||
uint8_t attr_palette_enable;
|
||||
uint8_t attraddr;
|
||||
uint8_t seqaddr;
|
||||
uint8_t miscout;
|
||||
uint8_t cgastat;
|
||||
uint8_t scrblank;
|
||||
uint8_t plane_mask;
|
||||
uint8_t writemask;
|
||||
uint8_t colourcompare;
|
||||
uint8_t colournocare;
|
||||
uint8_t dac_mask;
|
||||
uint8_t dac_status;
|
||||
uint8_t dpms;
|
||||
uint8_t dpms_ui;
|
||||
uint8_t ksc5601_sbyte_mask;
|
||||
uint8_t ksc5601_udc_area_msb[2];
|
||||
|
||||
int ksc5601_swap_mode;
|
||||
uint16_t ksc5601_english_font_type;
|
||||
@@ -172,61 +259,62 @@ typedef struct svga_t {
|
||||
int remap_required;
|
||||
uint32_t (*remap_func)(struct svga_t *svga, uint32_t in_addr);
|
||||
|
||||
void *ramdac, *clock_gen;
|
||||
void *ramdac;
|
||||
void *clock_gen;
|
||||
|
||||
/* Monitor Index */
|
||||
uint8_t monitor_index;
|
||||
|
||||
/* Pointer to monitor */
|
||||
monitor_t* monitor;
|
||||
monitor_t *monitor;
|
||||
} svga_t;
|
||||
|
||||
extern int vga_on;
|
||||
extern int ibm8514_on;
|
||||
|
||||
extern void ibm8514_poll(ibm8514_t *dev, svga_t *svga);
|
||||
extern void ibm8514_recalctimings(svga_t *svga);
|
||||
extern uint8_t ibm8514_ramdac_in(uint16_t port, void *p);
|
||||
extern void ibm8514_ramdac_out(uint16_t port, uint8_t val, void *p);
|
||||
extern int ibm8514_cpu_src(svga_t *svga);
|
||||
extern int ibm8514_cpu_dest(svga_t *svga);
|
||||
extern void ibm8514_accel_out_pixtrans(svga_t *svga, uint16_t port, uint16_t val, int len);
|
||||
extern void ibm8514_short_stroke_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, svga_t *svga, uint8_t ssv, int len);
|
||||
extern void ibm8514_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, svga_t *svga, int len);
|
||||
extern void ibm8514_poll(ibm8514_t *dev, svga_t *svga);
|
||||
extern void ibm8514_recalctimings(svga_t *svga);
|
||||
extern uint8_t ibm8514_ramdac_in(uint16_t port, void *priv);
|
||||
extern void ibm8514_ramdac_out(uint16_t port, uint8_t val, void *priv);
|
||||
extern int ibm8514_cpu_src(svga_t *svga);
|
||||
extern int ibm8514_cpu_dest(svga_t *svga);
|
||||
extern void ibm8514_accel_out_pixtrans(svga_t *svga, uint16_t port, uint16_t val, int len);
|
||||
extern void ibm8514_short_stroke_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, svga_t *svga, uint8_t ssv, int len);
|
||||
extern void ibm8514_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, svga_t *svga, int len);
|
||||
|
||||
extern void xga_poll(xga_t *xga, svga_t *svga);
|
||||
extern void xga_recalctimings(svga_t *svga);
|
||||
|
||||
extern int svga_init(const device_t *info, svga_t *svga, void *p, int memsize,
|
||||
extern int svga_init(const device_t *info, svga_t *svga, void *priv, int memsize,
|
||||
void (*recalctimings_ex)(struct svga_t *svga),
|
||||
uint8_t (*video_in)(uint16_t addr, void *p),
|
||||
void (*video_out)(uint16_t addr, uint8_t val, void *p),
|
||||
uint8_t (*video_in)(uint16_t addr, void *priv),
|
||||
void (*video_out)(uint16_t addr, uint8_t val, void *priv),
|
||||
void (*hwcursor_draw)(struct svga_t *svga, int displine),
|
||||
void (*overlay_draw)(struct svga_t *svga, int displine));
|
||||
extern void svga_recalctimings(svga_t *svga);
|
||||
extern void svga_close(svga_t *svga);
|
||||
|
||||
uint8_t svga_read(uint32_t addr, void *p);
|
||||
uint16_t svga_readw(uint32_t addr, void *p);
|
||||
uint32_t svga_readl(uint32_t addr, void *p);
|
||||
void svga_write(uint32_t addr, uint8_t val, void *p);
|
||||
void svga_writew(uint32_t addr, uint16_t val, void *p);
|
||||
void svga_writel(uint32_t addr, uint32_t val, void *p);
|
||||
uint8_t svga_read_linear(uint32_t addr, void *p);
|
||||
uint8_t svga_readb_linear(uint32_t addr, void *p);
|
||||
uint16_t svga_readw_linear(uint32_t addr, void *p);
|
||||
uint32_t svga_readl_linear(uint32_t addr, void *p);
|
||||
void svga_write_linear(uint32_t addr, uint8_t val, void *p);
|
||||
void svga_writeb_linear(uint32_t addr, uint8_t val, void *p);
|
||||
void svga_writew_linear(uint32_t addr, uint16_t val, void *p);
|
||||
void svga_writel_linear(uint32_t addr, uint32_t val, void *p);
|
||||
uint8_t svga_read(uint32_t addr, void *priv);
|
||||
uint16_t svga_readw(uint32_t addr, void *priv);
|
||||
uint32_t svga_readl(uint32_t addr, void *priv);
|
||||
void svga_write(uint32_t addr, uint8_t val, void *priv);
|
||||
void svga_writew(uint32_t addr, uint16_t val, void *priv);
|
||||
void svga_writel(uint32_t addr, uint32_t val, void *priv);
|
||||
uint8_t svga_read_linear(uint32_t addr, void *priv);
|
||||
uint8_t svga_readb_linear(uint32_t addr, void *priv);
|
||||
uint16_t svga_readw_linear(uint32_t addr, void *priv);
|
||||
uint32_t svga_readl_linear(uint32_t addr, void *priv);
|
||||
void svga_write_linear(uint32_t addr, uint8_t val, void *priv);
|
||||
void svga_writeb_linear(uint32_t addr, uint8_t val, void *priv);
|
||||
void svga_writew_linear(uint32_t addr, uint16_t val, void *priv);
|
||||
void svga_writel_linear(uint32_t addr, uint32_t val, void *priv);
|
||||
|
||||
void svga_add_status_info(char *s, int max_len, void *p);
|
||||
void svga_add_status_info(char *s, int max_len, void *priv);
|
||||
|
||||
extern uint8_t svga_rotate[8][256];
|
||||
|
||||
void svga_out(uint16_t addr, uint8_t val, void *p);
|
||||
uint8_t svga_in(uint16_t addr, void *p);
|
||||
void svga_out(uint16_t addr, uint8_t val, void *priv);
|
||||
uint8_t svga_in(uint16_t addr, void *priv);
|
||||
|
||||
svga_t *svga_get_pri(void);
|
||||
void svga_set_override(svga_t *svga, int val);
|
||||
@@ -246,65 +334,65 @@ enum {
|
||||
|
||||
/* We need a way to add a device with a pointer to a parent device so it can attach itself to it, and
|
||||
possibly also a second ATi 68860 RAM DAC type that auto-sets SVGA render on RAM DAC render change. */
|
||||
extern void ati68860_ramdac_out(uint16_t addr, uint8_t val, void *p, svga_t *svga);
|
||||
extern uint8_t ati68860_ramdac_in(uint16_t addr, void *p, svga_t *svga);
|
||||
extern void ati68860_set_ramdac_type(void *p, int type);
|
||||
extern void ati68860_ramdac_set_render(void *p, svga_t *svga);
|
||||
extern void ati68860_ramdac_set_pallook(void *p, int i, uint32_t col);
|
||||
extern void ati68860_ramdac_out(uint16_t addr, uint8_t val, void *priv, svga_t *svga);
|
||||
extern uint8_t ati68860_ramdac_in(uint16_t addr, void *priv, svga_t *svga);
|
||||
extern void ati68860_set_ramdac_type(void *priv, int type);
|
||||
extern void ati68860_ramdac_set_render(void *priv, svga_t *svga);
|
||||
extern void ati68860_ramdac_set_pallook(void *priv, int i, uint32_t col);
|
||||
extern void ati68860_hwcursor_draw(svga_t *svga, int displine);
|
||||
|
||||
extern void att49x_ramdac_out(uint16_t addr, int rs2, uint8_t val, void *p, svga_t *svga);
|
||||
extern uint8_t att49x_ramdac_in(uint16_t addr, int rs2, void *p, svga_t *svga);
|
||||
extern void att49x_ramdac_out(uint16_t addr, int rs2, uint8_t val, void *priv, svga_t *svga);
|
||||
extern uint8_t att49x_ramdac_in(uint16_t addr, int rs2, void *priv, svga_t *svga);
|
||||
|
||||
extern void att498_ramdac_out(uint16_t addr, int rs2, uint8_t val, void *p, svga_t *svga);
|
||||
extern uint8_t att498_ramdac_in(uint16_t addr, int rs2, void *p, svga_t *svga);
|
||||
extern float av9194_getclock(int clock, void *p);
|
||||
extern void att498_ramdac_out(uint16_t addr, int rs2, uint8_t val, void *priv, svga_t *svga);
|
||||
extern uint8_t att498_ramdac_in(uint16_t addr, int rs2, void *priv, svga_t *svga);
|
||||
extern float av9194_getclock(int clock, void *priv);
|
||||
|
||||
extern void bt48x_ramdac_out(uint16_t addr, int rs2, int rs3, uint8_t val, void *p, svga_t *svga);
|
||||
extern uint8_t bt48x_ramdac_in(uint16_t addr, int rs2, int rs3, void *p, svga_t *svga);
|
||||
extern void bt48x_recalctimings(void *p, svga_t *svga);
|
||||
extern void bt48x_ramdac_out(uint16_t addr, int rs2, int rs3, uint8_t val, void *priv, svga_t *svga);
|
||||
extern uint8_t bt48x_ramdac_in(uint16_t addr, int rs2, int rs3, void *priv, svga_t *svga);
|
||||
extern void bt48x_recalctimings(void *priv, svga_t *svga);
|
||||
extern void bt48x_hwcursor_draw(svga_t *svga, int displine);
|
||||
|
||||
extern void ibm_rgb528_ramdac_out(uint16_t addr, int rs2, uint8_t val, void *p, svga_t *svga);
|
||||
extern uint8_t ibm_rgb528_ramdac_in(uint16_t addr, int rs2, void *p, svga_t *svga);
|
||||
extern void ibm_rgb528_recalctimings(void *p, svga_t *svga);
|
||||
extern void ibm_rgb528_ramdac_out(uint16_t addr, int rs2, uint8_t val, void *priv, svga_t *svga);
|
||||
extern uint8_t ibm_rgb528_ramdac_in(uint16_t addr, int rs2, void *priv, svga_t *svga);
|
||||
extern void ibm_rgb528_recalctimings(void *priv, svga_t *svga);
|
||||
extern void ibm_rgb528_hwcursor_draw(svga_t *svga, int displine);
|
||||
|
||||
extern void icd2061_write(void *p, int val);
|
||||
extern float icd2061_getclock(int clock, void *p);
|
||||
extern void icd2061_write(void *priv, int val);
|
||||
extern float icd2061_getclock(int clock, void *priv);
|
||||
|
||||
/* The code is the same, the #define's are so that the correct name can be used. */
|
||||
# define ics9161_write icd2061_write
|
||||
# define ics9161_getclock icd2061_getclock
|
||||
|
||||
extern float ics2494_getclock(int clock, void *p);
|
||||
extern float ics2494_getclock(int clock, void *priv);
|
||||
|
||||
extern void ics2595_write(void *p, int strobe, int dat);
|
||||
extern double ics2595_getclock(void *p);
|
||||
extern void ics2595_setclock(void *p, double clock);
|
||||
extern void ics2595_write(void *priv, int strobe, int dat);
|
||||
extern double ics2595_getclock(void *priv);
|
||||
extern void ics2595_setclock(void *priv, double clock);
|
||||
|
||||
extern void sc1148x_ramdac_out(uint16_t addr, int rs2, uint8_t val, void *p, svga_t *svga);
|
||||
extern uint8_t sc1148x_ramdac_in(uint16_t addr, int rs2, void *p, svga_t *svga);
|
||||
extern void sc1148x_ramdac_out(uint16_t addr, int rs2, uint8_t val, void *priv, svga_t *svga);
|
||||
extern uint8_t sc1148x_ramdac_in(uint16_t addr, int rs2, void *priv, svga_t *svga);
|
||||
|
||||
extern void sc1502x_ramdac_out(uint16_t addr, uint8_t val, void *p, svga_t *svga);
|
||||
extern uint8_t sc1502x_ramdac_in(uint16_t addr, void *p, svga_t *svga);
|
||||
extern void sc1502x_ramdac_out(uint16_t addr, uint8_t val, void *priv, svga_t *svga);
|
||||
extern uint8_t sc1502x_ramdac_in(uint16_t addr, void *priv, svga_t *svga);
|
||||
|
||||
extern void sdac_ramdac_out(uint16_t addr, int rs2, uint8_t val, void *p, svga_t *svga);
|
||||
extern uint8_t sdac_ramdac_in(uint16_t addr, int rs2, void *p, svga_t *svga);
|
||||
extern float sdac_getclock(int clock, void *p);
|
||||
extern void sdac_ramdac_out(uint16_t addr, int rs2, uint8_t val, void *priv, svga_t *svga);
|
||||
extern uint8_t sdac_ramdac_in(uint16_t addr, int rs2, void *priv, svga_t *svga);
|
||||
extern float sdac_getclock(int clock, void *priv);
|
||||
|
||||
extern void stg_ramdac_out(uint16_t addr, uint8_t val, void *p, svga_t *svga);
|
||||
extern uint8_t stg_ramdac_in(uint16_t addr, void *p, svga_t *svga);
|
||||
extern float stg_getclock(int clock, void *p);
|
||||
extern void stg_ramdac_out(uint16_t addr, uint8_t val, void *priv, svga_t *svga);
|
||||
extern uint8_t stg_ramdac_in(uint16_t addr, void *priv, svga_t *svga);
|
||||
extern float stg_getclock(int clock, void *priv);
|
||||
|
||||
extern void tkd8001_ramdac_out(uint16_t addr, uint8_t val, void *p, svga_t *svga);
|
||||
extern uint8_t tkd8001_ramdac_in(uint16_t addr, void *p, svga_t *svga);
|
||||
extern void tkd8001_ramdac_out(uint16_t addr, uint8_t val, void *priv, svga_t *svga);
|
||||
extern uint8_t tkd8001_ramdac_in(uint16_t addr, void *priv, svga_t *svga);
|
||||
|
||||
extern void tvp3026_ramdac_out(uint16_t addr, int rs2, int rs3, uint8_t val, void *p, svga_t *svga);
|
||||
extern uint8_t tvp3026_ramdac_in(uint16_t addr, int rs2, int rs3, void *p, svga_t *svga);
|
||||
extern void tvp3026_recalctimings(void *p, svga_t *svga);
|
||||
extern void tvp3026_ramdac_out(uint16_t addr, int rs2, int rs3, uint8_t val, void *priv, svga_t *svga);
|
||||
extern uint8_t tvp3026_ramdac_in(uint16_t addr, int rs2, int rs3, void *priv, svga_t *svga);
|
||||
extern void tvp3026_recalctimings(void *priv, svga_t *svga);
|
||||
extern void tvp3026_hwcursor_draw(svga_t *svga, int displine);
|
||||
extern float tvp3026_getclock(int clock, void *p);
|
||||
extern float tvp3026_getclock(int clock, void *priv);
|
||||
|
||||
# ifdef EMU_DEVICE_H
|
||||
extern const device_t ati68860_ramdac_device;
|
||||
|
||||
@@ -20,12 +20,16 @@
|
||||
#ifndef VIDEO_SVGA_RENDER_H
|
||||
#define VIDEO_SVGA_RENDER_H
|
||||
|
||||
extern int firstline_draw, lastline_draw;
|
||||
extern int firstline_draw;
|
||||
extern int lastline_draw;
|
||||
extern int displine;
|
||||
extern int sc;
|
||||
|
||||
extern uint32_t ma, ca;
|
||||
extern int con, cursoron, cgablink;
|
||||
extern uint32_t ma;
|
||||
extern uint32_t ca;
|
||||
extern int con;
|
||||
extern int cursoron;
|
||||
extern int cgablink;
|
||||
|
||||
extern int scrollcache;
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ typedef struct vga_t {
|
||||
|
||||
static video_timings_t timing_vga = { VIDEO_ISA, 8, 16, 32, 8, 16, 32 };
|
||||
|
||||
void vga_out(uint16_t addr, uint8_t val, void *p);
|
||||
uint8_t vga_in(uint16_t addr, void *p);
|
||||
void vga_out(uint16_t addr, uint8_t val, void *priv);
|
||||
uint8_t vga_in(uint16_t addr, void *priv);
|
||||
|
||||
#endif /*VIDEO_VGA_H*/
|
||||
|
||||
@@ -18,6 +18,6 @@
|
||||
#ifndef VIDEO_VOODOO_BANSHEE_H
|
||||
#define VIDEO_VOODOO_BANSHEE_H
|
||||
|
||||
void banshee_set_overlay_addr(void *p, uint32_t addr);
|
||||
void banshee_set_overlay_addr(void *priv, uint32_t addr);
|
||||
|
||||
#endif /*VIDEO_VOODOO_BANSHEE_H*/
|
||||
|
||||
@@ -38,7 +38,9 @@ typedef struct voodoo_x86_data_t {
|
||||
int is_tiled;
|
||||
} voodoo_x86_data_t;
|
||||
|
||||
// static voodoo_x86_data_t voodoo_x86_data[2][BLOCK_NUM];
|
||||
#if 0
|
||||
static voodoo_x86_data_t voodoo_x86_data[2][BLOCK_NUM];
|
||||
#endif
|
||||
|
||||
static int last_block[4] = { 0, 0 };
|
||||
static int next_block_to_write[4] = { 0, 0 };
|
||||
@@ -234,10 +236,12 @@ codegen_texture_fetch(uint8_t *code_block, voodoo_t *voodoo, voodoo_params_t *pa
|
||||
addlong(1);
|
||||
addbyte(0x28); /*SUB DL, CL*/
|
||||
addbyte(0xca);
|
||||
// addbyte(0x8a); /*MOV DL, params->tex_shift[RSI+ECX*4]*/
|
||||
// addbyte(0x94);
|
||||
// addbyte(0x8e);
|
||||
// addlong(offsetof(voodoo_params_t, tex_shift));
|
||||
#if 0
|
||||
addbyte(0x8a); /*MOV DL, params->tex_shift[RSI+ECX*4]*/
|
||||
addbyte(0x94);
|
||||
addbyte(0x8e);
|
||||
addlong(offsetof(voodoo_params_t, tex_shift));
|
||||
#endif
|
||||
addbyte(0xd3); /*SHL EBP, CL*/
|
||||
addbyte(0xe5);
|
||||
addbyte(0x8b); /*MOV EAX, state->tex_s[RDI]*/
|
||||
@@ -656,24 +660,29 @@ voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo_params_t *params,
|
||||
int depth_jump_pos = 0;
|
||||
int depth_jump_pos2 = 0;
|
||||
int loop_jump_pos = 0;
|
||||
// xmm_01_w = (__m128i)0x0001000100010001ull;
|
||||
// xmm_ff_w = (__m128i)0x00ff00ff00ff00ffull;
|
||||
// xmm_ff_b = (__m128i)0x00000000ffffffffull;
|
||||
#if 0
|
||||
xmm_01_w = (__m128i)0x0001000100010001ull;
|
||||
xmm_ff_w = (__m128i)0x00ff00ff00ff00ffull;
|
||||
xmm_ff_b = (__m128i)0x00000000ffffffffull;
|
||||
#endif
|
||||
xmm_01_w = _mm_set_epi32(0, 0, 0x00010001, 0x00010001);
|
||||
xmm_ff_w = _mm_set_epi32(0, 0, 0x00ff00ff, 0x00ff00ff);
|
||||
xmm_ff_b = _mm_set_epi32(0, 0, 0, 0x00ffffff);
|
||||
minus_254 = _mm_set_epi32(0, 0, 0xff02ff02, 0xff02ff02);
|
||||
// *(uint64_t *)&const_1_48 = 0x45b0000000000000ull;
|
||||
// block_pos = 0;
|
||||
// voodoo_get_depth = &code_block[block_pos];
|
||||
#if 0
|
||||
*(uint64_t *)&const_1_48 = 0x45b0000000000000ull;
|
||||
block_pos = 0;
|
||||
voodoo_get_depth = &code_block[block_pos];
|
||||
#endif
|
||||
/*W at (%esp+4)
|
||||
Z at (%esp+12)
|
||||
new_depth at (%esp+16)*/
|
||||
// if ((params->fbzMode & FBZ_DEPTH_ENABLE) && (depth_op == DEPTHOP_NEVER))
|
||||
// {
|
||||
// addbyte(0xC3); /*RET*/
|
||||
// return;
|
||||
// }
|
||||
#if 0
|
||||
if ((params->fbzMode & FBZ_DEPTH_ENABLE) && (depth_op == DEPTHOP_NEVER)) {
|
||||
addbyte(0xC3); /*RET*/
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
addbyte(0x55); /*PUSH RBP*/
|
||||
addbyte(0x57); /*PUSH RDI*/
|
||||
addbyte(0x56); /*PUSH RSI*/
|
||||
@@ -796,7 +805,9 @@ voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo_params_t *params,
|
||||
addbyte(0x75); /*JNZ got_depth*/
|
||||
depth_jump_pos = block_pos;
|
||||
addbyte(0);
|
||||
// addbyte(4+5+2+3+2+5+5+3+2+2+2+/*3+*/3+2+6+4+5+2+3);
|
||||
#if 0
|
||||
addbyte(4+5+2+3+2+5+5+3+2+2+2+/*3+*/3+2+6+4+5+2+3);
|
||||
#endif
|
||||
addbyte(0x8b); /*MOV EDX, w*/
|
||||
addbyte(0x97);
|
||||
addlong(offsetof(voodoo_state_t, w));
|
||||
@@ -810,7 +821,9 @@ voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo_params_t *params,
|
||||
addbyte(0x74); /*JZ got_depth*/
|
||||
depth_jump_pos2 = block_pos;
|
||||
addbyte(0);
|
||||
// addbyte(5+5+3+2+2+2+/*3+*/3+2+6+4+5+2+3);
|
||||
#if 0
|
||||
addbyte(5+5+3+2+2+2+/*3+*/3+2+6+4+5+2+3);
|
||||
#endif
|
||||
addbyte(0xb9); /*MOV ECX, 19*/
|
||||
addlong(19);
|
||||
addbyte(0x0f); /*BSR EAX, EDX*/
|
||||
@@ -2224,10 +2237,12 @@ voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo_params_t *params,
|
||||
addbyte(10);
|
||||
addbyte(0x01); /*ADD EAX, EBX*/
|
||||
addbyte(0xd8);
|
||||
/* int fog_idx = (w_depth >> 10) & 0x3f;
|
||||
#if 0
|
||||
int fog_idx = (w_depth >> 10) & 0x3f;
|
||||
|
||||
fog_a = params->fogTable[fog_idx].fog;
|
||||
fog_a += (params->fogTable[fog_idx].dfog * ((w_depth >> 2) & 0xff)) >> 10;*/
|
||||
fog_a = params->fogTable[fog_idx].fog;
|
||||
fog_a += (params->fogTable[fog_idx].dfog * ((w_depth >> 2) & 0xff)) >> 10;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case FOG_Z:
|
||||
@@ -2239,7 +2254,9 @@ voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo_params_t *params,
|
||||
addbyte(12);
|
||||
addbyte(0x25); /*AND EAX, 0xff*/
|
||||
addlong(0xff);
|
||||
// fog_a = (z >> 20) & 0xff;
|
||||
#if 0
|
||||
fog_a = (z >> 20) & 0xff;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case FOG_ALPHA:
|
||||
@@ -2261,7 +2278,9 @@ voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo_params_t *params,
|
||||
addbyte(0x0f); /*CMOVAE EAX, EBX*/
|
||||
addbyte(0x43);
|
||||
addbyte(0xc3);
|
||||
// fog_a = CLAMP(ia >> 12);
|
||||
#if 0
|
||||
fog_a = CLAMP(ia >> 12);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case FOG_W:
|
||||
@@ -2282,7 +2301,9 @@ voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo_params_t *params,
|
||||
addbyte(0x0f); /*CMOVAE EAX, EBX*/
|
||||
addbyte(0x43);
|
||||
addbyte(0xc3);
|
||||
// fog_a = CLAMP(w >> 32);
|
||||
#if 0
|
||||
fog_a = CLAMP(w >> 32);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
addbyte(0x01); /*ADD EAX, EAX*/
|
||||
@@ -3164,12 +3185,11 @@ int voodoo_recomp = 0;
|
||||
static inline void *
|
||||
voodoo_get_block(voodoo_t *voodoo, voodoo_params_t *params, voodoo_state_t *state, int odd_even)
|
||||
{
|
||||
int c;
|
||||
int b = last_block[odd_even];
|
||||
voodoo_x86_data_t *voodoo_x86_data = voodoo->codegen_data;
|
||||
voodoo_x86_data_t *data;
|
||||
|
||||
for (c = 0; c < 8; c++) {
|
||||
for (uint8_t c = 0; c < 8; c++) {
|
||||
data = &voodoo_x86_data[odd_even + c * 4]; //&voodoo_x86_data[odd_even][b];
|
||||
|
||||
if (state->xdir == data->xdir && params->alphaMode == data->alphaMode && params->fbzMode == data->fbzMode && params->fogMode == data->fogMode && params->fbzColorPath == data->fbzColorPath && (voodoo->trexInit1[0] & (1 << 18)) == data->trexInit1 && params->textureMode[0] == data->textureMode[0] && params->textureMode[1] == data->textureMode[1] && (params->tLOD[0] & LOD_MASK) == data->tLOD[0] && (params->tLOD[1] & LOD_MASK) == data->tLOD[1] && ((params->col_tiled || params->aux_tiled) ? 1 : 0) == data->is_tiled) {
|
||||
@@ -3181,7 +3201,9 @@ voodoo_get_block(voodoo_t *voodoo, voodoo_params_t *params, voodoo_state_t *stat
|
||||
}
|
||||
voodoo_recomp++;
|
||||
data = &voodoo_x86_data[odd_even + next_block_to_write[odd_even] * 4];
|
||||
// code_block = data->code_block;
|
||||
#if 0
|
||||
code_block = data->code_block;
|
||||
#endif
|
||||
|
||||
voodoo_generate(data->code_block, voodoo, params, state, depth_op);
|
||||
|
||||
@@ -3205,11 +3227,9 @@ voodoo_get_block(voodoo_t *voodoo, voodoo_params_t *params, voodoo_state_t *stat
|
||||
void
|
||||
voodoo_codegen_init(voodoo_t *voodoo)
|
||||
{
|
||||
int c;
|
||||
|
||||
voodoo->codegen_data = plat_mmap(sizeof(voodoo_x86_data_t) * BLOCK_NUM * 4, 1);
|
||||
|
||||
for (c = 0; c < 256; c++) {
|
||||
for (uint16_t c = 0; c < 256; c++) {
|
||||
int d[4];
|
||||
int _ds = c & 0xf;
|
||||
int dt = c >> 4;
|
||||
|
||||
@@ -639,24 +639,29 @@ voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo_params_t *params,
|
||||
int depth_jump_pos = 0;
|
||||
int depth_jump_pos2 = 0;
|
||||
int loop_jump_pos = 0;
|
||||
// xmm_01_w = (__m128i)0x0001000100010001ull;
|
||||
// xmm_ff_w = (__m128i)0x00ff00ff00ff00ffull;
|
||||
// xmm_ff_b = (__m128i)0x00000000ffffffffull;
|
||||
#if 0
|
||||
xmm_01_w = (__m128i)0x0001000100010001ull;
|
||||
xmm_ff_w = (__m128i)0x00ff00ff00ff00ffull;
|
||||
xmm_ff_b = (__m128i)0x00000000ffffffffull;
|
||||
#endif
|
||||
xmm_01_w = _mm_set_epi32(0, 0, 0x00010001, 0x00010001);
|
||||
xmm_ff_w = _mm_set_epi32(0, 0, 0x00ff00ff, 0x00ff00ff);
|
||||
xmm_ff_b = _mm_set_epi32(0, 0, 0, 0x00ffffff);
|
||||
minus_254 = _mm_set_epi32(0, 0, 0xff02ff02, 0xff02ff02);
|
||||
// *(uint64_t *)&const_1_48 = 0x45b0000000000000ull;
|
||||
// block_pos = 0;
|
||||
// voodoo_get_depth = &code_block[block_pos];
|
||||
#if 0
|
||||
*(uint64_t *)&const_1_48 = 0x45b0000000000000ull;
|
||||
block_pos = 0;
|
||||
voodoo_get_depth = &code_block[block_pos];
|
||||
#endif
|
||||
/*W at (%esp+4)
|
||||
Z at (%esp+12)
|
||||
new_depth at (%esp+16)*/
|
||||
// if ((params->fbzMode & FBZ_DEPTH_ENABLE) && (depth_op == DEPTHOP_NEVER))
|
||||
// {
|
||||
// addbyte(0xC3); /*RET*/
|
||||
// return;
|
||||
// }
|
||||
#if 0
|
||||
if ((params->fbzMode & FBZ_DEPTH_ENABLE) && (depth_op == DEPTHOP_NEVER)) {
|
||||
addbyte(0xC3); /*RET*/
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
addbyte(0x55); /*PUSH EBP*/
|
||||
addbyte(0x57); /*PUSH EDI*/
|
||||
addbyte(0x56); /*PUSH ESI*/
|
||||
@@ -871,16 +876,19 @@ voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo_params_t *params,
|
||||
fatal("Bad depth_op\n");
|
||||
} else if ((params->fbzMode & FBZ_DEPTH_ENABLE) && (depthop == DEPTHOP_NEVER)) {
|
||||
addbyte(0xC3); /*RET*/
|
||||
// addbyte(0x30); /*XOR EAX, EAX*/
|
||||
// addbyte(0xc0);
|
||||
#if 0
|
||||
addbyte(0x30); /*XOR EAX, EAX*/
|
||||
addbyte(0xc0);
|
||||
#endif
|
||||
}
|
||||
#if 0
|
||||
else {
|
||||
addbyte(0xb0); /*MOV AL, 1*/
|
||||
addbyte(1);
|
||||
}
|
||||
// else
|
||||
// {
|
||||
// addbyte(0xb0); /*MOV AL, 1*/
|
||||
// addbyte(1);
|
||||
// }
|
||||
|
||||
// voodoo_combine = &code_block[block_pos];
|
||||
voodoo_combine = &code_block[block_pos];
|
||||
#endif
|
||||
/*XMM0 = colour*/
|
||||
/*XMM2 = 0 (for unpacking*/
|
||||
|
||||
@@ -2076,12 +2084,13 @@ voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo_params_t *params,
|
||||
addbyte(0x05);
|
||||
addlong((uint32_t) &xmm_ff_b);
|
||||
}
|
||||
// #if 0
|
||||
// addbyte(0x66); /*MOVD state->out[EDI], XMM0*/
|
||||
// addbyte(0x0f);
|
||||
// addbyte(0x7e);
|
||||
// addbyte(0x87);
|
||||
// addlong(offsetof(voodoo_state_t, out));
|
||||
#if 0
|
||||
addbyte(0x66); /*MOVD state->out[EDI], XMM0*/
|
||||
addbyte(0x0f);
|
||||
addbyte(0x7e);
|
||||
addbyte(0x87);
|
||||
addlong(offsetof(voodoo_state_t, out));
|
||||
#endif
|
||||
if (params->fogMode & FOG_ENABLE) {
|
||||
if (params->fogMode & FOG_CONSTANT) {
|
||||
addbyte(0x66); /*MOVD XMM3, params->fogColor[ESI]*/
|
||||
@@ -2093,11 +2102,18 @@ voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo_params_t *params,
|
||||
addbyte(0x0f);
|
||||
addbyte(0xdc);
|
||||
addbyte(0xc3);
|
||||
/* src_r += params->fogColor.r;
|
||||
src_g += params->fogColor.g;
|
||||
src_b += params->fogColor.b; */
|
||||
#if 0
|
||||
src_r += params->fogColor.r;
|
||||
src_g += params->fogColor.g;
|
||||
src_b += params->fogColor.b; */
|
||||
#endif
|
||||
} else {
|
||||
/*int fog_r, fog_g, fog_b, fog_a; */
|
||||
#if 0
|
||||
int fog_r;
|
||||
int fog_g;
|
||||
int fog_b;
|
||||
int fog_a;
|
||||
#endif
|
||||
|
||||
addbyte(0x66); /*PUNPCKLBW XMM0, XMM2*/
|
||||
addbyte(0x0f);
|
||||
@@ -2168,10 +2184,12 @@ voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo_params_t *params,
|
||||
addbyte(0x01); /*ADD EAX, EBX*/
|
||||
addbyte(0xd8);
|
||||
|
||||
/* int fog_idx = (w_depth >> 10) & 0x3f;
|
||||
#if 0
|
||||
int fog_idx = (w_depth >> 10) & 0x3f;
|
||||
|
||||
fog_a = params->fogTable[fog_idx].fog;
|
||||
fog_a += (params->fogTable[fog_idx].dfog * ((w_depth >> 2) & 0xff)) >> 10;*/
|
||||
fog_a = params->fogTable[fog_idx].fog;
|
||||
fog_a += (params->fogTable[fog_idx].dfog * ((w_depth >> 2) & 0xff)) >> 10;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case FOG_Z:
|
||||
@@ -2183,7 +2201,9 @@ voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo_params_t *params,
|
||||
addbyte(12);
|
||||
addbyte(0x25); /*AND EAX, 0xff*/
|
||||
addlong(0xff);
|
||||
// fog_a = (z >> 20) & 0xff;
|
||||
#if 0
|
||||
fog_a = (z >> 20) & 0xff;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case FOG_ALPHA:
|
||||
@@ -2205,7 +2225,9 @@ voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo_params_t *params,
|
||||
addbyte(0x0f); /*CMOVAE EAX, EBX*/
|
||||
addbyte(0x43);
|
||||
addbyte(0xc3);
|
||||
// fog_a = CLAMP(ia >> 12);
|
||||
#if 0
|
||||
fog_a = CLAMP(ia >> 12);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case FOG_W:
|
||||
@@ -2226,13 +2248,16 @@ voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo_params_t *params,
|
||||
addbyte(0x0f); /*CMOVAE EAX, EBX*/
|
||||
addbyte(0x43);
|
||||
addbyte(0xc3);
|
||||
// fog_a = CLAMP(w >> 32);
|
||||
#if 0
|
||||
fog_a = CLAMP(w >> 32);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
addbyte(0x01); /*ADD EAX, EAX*/
|
||||
addbyte(0xc0);
|
||||
// fog_a++;
|
||||
|
||||
#if 0
|
||||
fog_a++;
|
||||
#endif
|
||||
addbyte(0x66); /*PMULLW XMM3, alookup+4[EAX*8]*/
|
||||
addbyte(0x0f);
|
||||
addbyte(0xd5);
|
||||
@@ -2244,9 +2269,11 @@ voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo_params_t *params,
|
||||
addbyte(0x71);
|
||||
addbyte(0xe3);
|
||||
addbyte(7);
|
||||
/* fog_r = (fog_r * fog_a) >> 8;
|
||||
fog_g = (fog_g * fog_a) >> 8;
|
||||
fog_b = (fog_b * fog_a) >> 8;*/
|
||||
#if 0
|
||||
fog_r = (fog_r * fog_a) >> 8;
|
||||
fog_g = (fog_g * fog_a) >> 8;
|
||||
fog_b = (fog_b * fog_a) >> 8;
|
||||
#endif
|
||||
|
||||
if (params->fogMode & FOG_MULT) {
|
||||
addbyte(0xf3); /*MOV XMM0, XMM3*/
|
||||
@@ -2258,9 +2285,11 @@ voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo_params_t *params,
|
||||
addbyte(0x0f);
|
||||
addbyte(0xfd);
|
||||
addbyte(0xc3);
|
||||
/* src_r += fog_r;
|
||||
src_g += fog_g;
|
||||
src_b += fog_b;*/
|
||||
#if 0
|
||||
src_r += fog_r;
|
||||
src_g += fog_g;
|
||||
src_b += fog_b;
|
||||
#endif
|
||||
}
|
||||
addbyte(0x66); /*PACKUSWB XMM0, XMM0*/
|
||||
addbyte(0x0f);
|
||||
@@ -2268,9 +2297,11 @@ voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo_params_t *params,
|
||||
addbyte(0xc0);
|
||||
}
|
||||
|
||||
/* src_r = CLAMP(src_r);
|
||||
src_g = CLAMP(src_g);
|
||||
src_b = CLAMP(src_b);*/
|
||||
#if 0
|
||||
src_r = CLAMP(src_r);
|
||||
src_g = CLAMP(src_g);
|
||||
src_b = CLAMP(src_b);
|
||||
#endif
|
||||
}
|
||||
|
||||
if ((params->alphaMode & 1) && (alpha_func != AFUNC_NEVER) && (alpha_func != AFUNC_ALWAYS)) {
|
||||
@@ -2696,12 +2727,13 @@ voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo_params_t *params,
|
||||
addbyte(0x67);
|
||||
addbyte(0xc0);
|
||||
}
|
||||
// #endif
|
||||
|
||||
// addbyte(0x8b); /*MOV EDX, x (ESP+12)*/
|
||||
// addbyte(0x54);
|
||||
// addbyte(0x24);
|
||||
// addbyte(12);
|
||||
#if 0
|
||||
addbyte(0x8b); /*MOV EDX, x (ESP+12)*/
|
||||
addbyte(0x54);
|
||||
addbyte(0x24);
|
||||
addbyte(12);
|
||||
#endif
|
||||
|
||||
addbyte(0x8b); /*MOV EDX, state->x[EDI]*/
|
||||
addbyte(0x97);
|
||||
@@ -2716,9 +2748,11 @@ voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo_params_t *params,
|
||||
addbyte(0xc0);
|
||||
|
||||
if (params->fbzMode & FBZ_RGB_WMASK) {
|
||||
// addbyte(0x89); /*MOV state->rgb_out[EDI], EAX*/
|
||||
// addbyte(0x87);
|
||||
// addlong(offsetof(voodoo_state_t, rgb_out));
|
||||
#if 0
|
||||
addbyte(0x89); /*MOV state->rgb_out[EDI], EAX*/
|
||||
addbyte(0x87);
|
||||
addlong(offsetof(voodoo_state_t, rgb_out));
|
||||
#endif
|
||||
|
||||
if (dither) {
|
||||
addbyte(0x8b); /*MOV ESI, real_y (ESP+16)*/
|
||||
@@ -3118,7 +3152,9 @@ voodoo_get_block(voodoo_t *voodoo, voodoo_params_t *params, voodoo_state_t *stat
|
||||
}
|
||||
voodoo_recomp++;
|
||||
data = &codegen_data[odd_even + next_block_to_write[odd_even] * 4];
|
||||
// code_block = data->code_block;
|
||||
#if 0
|
||||
code_block = data->code_block;
|
||||
#endif
|
||||
|
||||
voodoo_generate(data->code_block, voodoo, params, state, depth_op);
|
||||
|
||||
@@ -3142,11 +3178,9 @@ voodoo_get_block(voodoo_t *voodoo, voodoo_params_t *params, voodoo_state_t *stat
|
||||
void
|
||||
voodoo_codegen_init(voodoo_t *voodoo)
|
||||
{
|
||||
int c;
|
||||
|
||||
voodoo->codegen_data = plat_mmap(sizeof(voodoo_x86_data_t) * BLOCK_NUM * 4, 1);
|
||||
|
||||
for (c = 0; c < 256; c++) {
|
||||
for (uint16_t c = 0; c < 256; c++) {
|
||||
int d[4];
|
||||
int _ds = c & 0xf;
|
||||
int dt = c >> 4;
|
||||
|
||||
@@ -596,7 +596,9 @@ typedef struct voodoo_t {
|
||||
uint32_t vidOverlayDudxOffsetSrcWidth;
|
||||
uint32_t vidOverlayDvdy;
|
||||
uint32_t vidOverlayDvdyOffset;
|
||||
// uint32_t vidDesktopOverlayStride;
|
||||
#if 0
|
||||
uint32_t vidDesktopOverlayStride;
|
||||
#endif
|
||||
|
||||
int start_x;
|
||||
int start_y;
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#include <86box/rom.h>
|
||||
|
||||
typedef struct {
|
||||
typedef struct xga_hwcursor_t {
|
||||
int ena;
|
||||
int x;
|
||||
int y;
|
||||
@@ -36,12 +36,15 @@ typedef struct xga_t {
|
||||
mem_mapping_t linear_mapping;
|
||||
mem_mapping_t video_mapping;
|
||||
rom_t bios_rom;
|
||||
rom_t vga_bios_rom;
|
||||
xga_hwcursor_t hwcursor, hwcursor_latch;
|
||||
rom_t vga_bios_rom;
|
||||
xga_hwcursor_t hwcursor;
|
||||
xga_hwcursor_t hwcursor_latch;
|
||||
PALETTE extpal;
|
||||
|
||||
uint8_t test, atest[2], testpixel;
|
||||
;
|
||||
uint8_t test;
|
||||
uint8_t atest[2];
|
||||
uint8_t testpixel;
|
||||
|
||||
uint8_t pos_regs[8];
|
||||
uint8_t disp_addr;
|
||||
uint8_t cfg_reg;
|
||||
@@ -54,33 +57,44 @@ typedef struct xga_t {
|
||||
uint8_t regs_idx;
|
||||
uint8_t hwc_hotspot_x;
|
||||
uint8_t hwc_hotspot_y;
|
||||
uint8_t disp_cntl_1, disp_cntl_2;
|
||||
uint8_t clk_sel_1, clk_sel_2;
|
||||
uint8_t disp_cntl_1;
|
||||
uint8_t disp_cntl_2;
|
||||
uint8_t clk_sel_1;
|
||||
uint8_t clk_sel_2;
|
||||
uint8_t hwc_control;
|
||||
uint8_t bus_arb;
|
||||
uint8_t isa_pos_enable;
|
||||
uint8_t hwcursor_oddeven;
|
||||
uint8_t cfg_reg_instance;
|
||||
uint8_t rowcount;
|
||||
uint8_t pal_idx, pal_idx_prefetch;
|
||||
uint8_t pal_idx;
|
||||
uint8_t pal_idx_prefetch;
|
||||
uint8_t pal_seq;
|
||||
uint8_t pal_mask;
|
||||
uint8_t pal_r, pal_r_prefetch;
|
||||
uint8_t pal_g, pal_g_prefetch;
|
||||
uint8_t pal_b, pal_b_prefetch;
|
||||
uint8_t pal_r;
|
||||
uint8_t pal_r_prefetch;
|
||||
uint8_t pal_g;
|
||||
uint8_t pal_g_prefetch;
|
||||
uint8_t pal_b;
|
||||
uint8_t pal_b_prefetch;
|
||||
uint8_t sprite_data[1024];
|
||||
uint8_t scrollcache;
|
||||
uint8_t border_color;
|
||||
uint8_t direct_color;
|
||||
uint8_t dma_channel;
|
||||
uint8_t instance_isa, instance_num, ext_mem_addr;
|
||||
uint8_t *vram, *changedvram;
|
||||
uint8_t instance_isa;
|
||||
uint8_t instance_num;
|
||||
uint8_t ext_mem_addr;
|
||||
uint8_t *vram;
|
||||
uint8_t *changedvram;
|
||||
|
||||
int16_t hwc_pos_x;
|
||||
int16_t hwc_pos_y;
|
||||
|
||||
uint16_t pos_idx;
|
||||
uint16_t htotal;
|
||||
uint16_t sprite_idx, sprite_idx_prefetch;
|
||||
uint16_t sprite_idx;
|
||||
uint16_t sprite_idx_prefetch;
|
||||
uint16_t hdisp;
|
||||
uint16_t vtotal;
|
||||
uint16_t vdispend;
|
||||
@@ -88,41 +102,74 @@ typedef struct xga_t {
|
||||
uint16_t vsyncstart;
|
||||
uint16_t linecmp;
|
||||
uint16_t pix_map_width;
|
||||
uint16_t sprite_pal_addr_idx, old_pal_addr_idx;
|
||||
uint16_t sprite_pal_addr_idx;
|
||||
uint16_t old_pal_addr_idx;
|
||||
uint16_t sprite_pal_addr_idx_prefetch;
|
||||
|
||||
int v_total, dispend, v_syncstart, split, v_blankstart,
|
||||
h_disp, h_disp_old, h_total, h_disp_time, rowoffset,
|
||||
dispon, h_disp_on, vc, sc, linepos, oddeven, firstline, lastline,
|
||||
firstline_draw, lastline_draw, displine, fullchange, interlace,
|
||||
char_width, hwcursor_on;
|
||||
int pal_pos, pal_pos_prefetch;
|
||||
int v_total;
|
||||
int dispend;
|
||||
int v_syncstart;
|
||||
int split;
|
||||
int v_blankstart;
|
||||
int h_disp;
|
||||
int h_disp_old;
|
||||
int h_total;
|
||||
int h_disp_time;
|
||||
int rowoffset;
|
||||
int dispon;
|
||||
int h_disp_on;
|
||||
int vc;
|
||||
int sc;
|
||||
int linepos;
|
||||
int oddeven;
|
||||
int firstline;
|
||||
int lastline;
|
||||
int firstline_draw;
|
||||
int lastline_draw;
|
||||
int displine;
|
||||
int fullchange;
|
||||
int interlace;
|
||||
int char_width;
|
||||
int hwcursor_on;
|
||||
int pal_pos;
|
||||
int pal_pos_prefetch;
|
||||
int on;
|
||||
int op_mode_reset, linear_endian_reverse;
|
||||
int sprite_pos, sprite_pos_prefetch, cursor_data_on;
|
||||
int pal_test, a5_test;
|
||||
int type, bus;
|
||||
int op_mode_reset;
|
||||
int linear_endian_reverse;
|
||||
int sprite_pos;
|
||||
int sprite_pos_prefetch;
|
||||
int cursor_data_on;
|
||||
int pal_test;
|
||||
int a5_test;
|
||||
int type;
|
||||
int bus;
|
||||
|
||||
uint32_t linear_base, linear_size, banked_mask;
|
||||
uint32_t linear_base;
|
||||
uint32_t linear_size;
|
||||
uint32_t banked_mask;
|
||||
uint32_t base_addr_1mb;
|
||||
uint32_t hwc_color0, hwc_color1;
|
||||
uint32_t hwc_color0;
|
||||
uint32_t hwc_color1;
|
||||
uint32_t disp_start_addr;
|
||||
uint32_t ma_latch;
|
||||
uint32_t vram_size;
|
||||
uint32_t vram_mask;
|
||||
uint32_t rom_addr;
|
||||
uint32_t ma, maback;
|
||||
uint32_t ma;
|
||||
uint32_t maback;
|
||||
uint32_t extpallook[256];
|
||||
uint32_t read_bank, write_bank;
|
||||
uint32_t read_bank;
|
||||
uint32_t write_bank;
|
||||
uint32_t px_map_base;
|
||||
|
||||
uint64_t dispontime, dispofftime;
|
||||
uint64_t dispontime;
|
||||
uint64_t dispofftime;
|
||||
|
||||
struct
|
||||
{
|
||||
struct {
|
||||
uint8_t control;
|
||||
uint8_t px_map_idx;
|
||||
uint8_t frgd_mix, bkgd_mix;
|
||||
uint8_t frgd_mix;
|
||||
uint8_t bkgd_mix;
|
||||
uint8_t cc_cond;
|
||||
uint8_t octant;
|
||||
uint8_t draw_mode;
|
||||
@@ -133,15 +180,19 @@ typedef struct xga_t {
|
||||
uint8_t short_stroke_vector4;
|
||||
|
||||
int16_t bres_err_term;
|
||||
int16_t bres_k1, bres_k2;
|
||||
int16_t bres_k1;
|
||||
int16_t bres_k2;
|
||||
|
||||
uint16_t blt_width;
|
||||
uint16_t blt_height;
|
||||
uint16_t mask_map_origin_x_off;
|
||||
uint16_t mask_map_origin_y_off;
|
||||
uint16_t src_map_x, src_map_y;
|
||||
uint16_t dst_map_x, dst_map_y;
|
||||
uint16_t pat_map_x, pat_map_y;
|
||||
uint16_t src_map_x;
|
||||
uint16_t src_map_y;
|
||||
uint16_t dst_map_x;
|
||||
uint16_t dst_map_y;
|
||||
uint16_t pat_map_x;
|
||||
uint16_t pat_map_y;
|
||||
|
||||
int ssv_state;
|
||||
int pat_src;
|
||||
@@ -149,7 +200,14 @@ typedef struct xga_t {
|
||||
int dst_map;
|
||||
int bkgd_src;
|
||||
int fore_src;
|
||||
int x, y, sx, sy, dx, dy, px, py;
|
||||
int x;
|
||||
int y;
|
||||
int sx;
|
||||
int sy;
|
||||
int dx;
|
||||
int dy;
|
||||
int px;
|
||||
int py;
|
||||
int pattern;
|
||||
int command_len;
|
||||
|
||||
@@ -157,7 +215,8 @@ typedef struct xga_t {
|
||||
uint32_t color_cmp;
|
||||
uint32_t carry_chain;
|
||||
uint32_t plane_mask;
|
||||
uint32_t frgd_color, bkgd_color;
|
||||
uint32_t frgd_color;
|
||||
uint32_t bkgd_color;
|
||||
uint32_t command;
|
||||
uint32_t dir_cmd;
|
||||
|
||||
@@ -167,6 +226,6 @@ typedef struct xga_t {
|
||||
uint32_t px_map_base[4];
|
||||
} accel;
|
||||
|
||||
volatile int force_busy;
|
||||
int big_endian_linear;
|
||||
} xga_t;
|
||||
#endif /*VIDEO_XGA_H*/
|
||||
|
||||
@@ -1,206 +0,0 @@
|
||||
/*
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Minimal reimplementation of GLib for libslirp.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: RichardG, <richardg867@gmail.com>
|
||||
*
|
||||
* Copyright 2020 RichardG.
|
||||
*/
|
||||
#ifndef TINYGLIB_H
|
||||
#define TINYGLIB_H
|
||||
|
||||
/* Define this to bypass TinyGLib and use full GLib instead. */
|
||||
#ifdef TINYGLIB_USE_GLIB
|
||||
# include <glib.h>
|
||||
#else
|
||||
|
||||
# include <stdarg.h>
|
||||
# include <stdint.h>
|
||||
# include <stdio.h>
|
||||
# include <stdlib.h>
|
||||
# define HAVE_STDARG_H
|
||||
# include <86box/86box.h>
|
||||
|
||||
/* Definitions */
|
||||
|
||||
# define G_LITTLE_ENDIAN 1234
|
||||
# define G_BIG_ENDIAN 4321
|
||||
# define G_PDP_ENDIAN 3412
|
||||
# ifdef __BYTE_ORDER__
|
||||
# if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
||||
# define G_BYTE_ORDER G_LITTLE_ENDIAN
|
||||
# elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
|
||||
# define G_BYTE_ORDER G_BIG_ENDIAN
|
||||
# elif __BYTE_ORDER__ == __ORDER_PDP_ENDIAN__
|
||||
# define G_BYTE_ORDER G_PDP_ENDIAN
|
||||
# endif
|
||||
# endif
|
||||
# ifndef G_BYTE_ORDER
|
||||
/* Safe to assume LE for MSVC, as Windows is LE on all architectures. */
|
||||
# define G_BYTE_ORDER G_LITTLE_ENDIAN
|
||||
# endif
|
||||
|
||||
# ifdef _WIN32
|
||||
# define G_OS_WIN32 1
|
||||
# else
|
||||
# define G_OS_UNIX 1
|
||||
# endif
|
||||
|
||||
# define G_SPAWN_SEARCH_PATH 0
|
||||
|
||||
# if defined(__LP64__) || defined(__LLP64__) || defined(_WIN64)
|
||||
# define GLIB_SIZEOF_VOID_P 8
|
||||
# if defined(__LLP64__) || defined(_WIN64)
|
||||
# define GLIB_SIZEOF_LONG 4
|
||||
# else
|
||||
# define GLIB_SIZEOF_LONG 8
|
||||
# endif
|
||||
# define GLIB_SIZEOF_SIZE_T 8
|
||||
# define GLIB_SIZEOF_SSIZE_T 8
|
||||
# else
|
||||
# define GLIB_SIZEOF_VOID_P 4
|
||||
# define GLIB_SIZEOF_LONG 4
|
||||
# define GLIB_SIZEOF_SIZE_T 4
|
||||
# define GLIB_SIZEOF_SSIZE_T 4
|
||||
# endif
|
||||
|
||||
/* Types */
|
||||
|
||||
/* 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
|
||||
|
||||
# define gboolean int
|
||||
# define gchar char
|
||||
# define gint int
|
||||
# define gint16 int16_t
|
||||
# define gint32 int32_t
|
||||
# define gint64 int64_t
|
||||
# define glong long
|
||||
# define GPid void *
|
||||
# define gpointer void *
|
||||
# define gsize size_t
|
||||
# define GSpawnFlags void *
|
||||
# define GSpawnChildSetupFunc void *
|
||||
# define gssize ssize_t
|
||||
# define GString char
|
||||
# define GStrv char **
|
||||
# define guint unsigned int
|
||||
# define guint16 uint16_t
|
||||
# define guint32 uint32_t
|
||||
# define guint64 uint64_t
|
||||
|
||||
typedef struct _GDebugKey {
|
||||
char key[32];
|
||||
int val;
|
||||
} GDebugKey;
|
||||
|
||||
typedef struct _GError {
|
||||
char message[1];
|
||||
} GError;
|
||||
|
||||
typedef struct _GRand {
|
||||
uint8_t dummy;
|
||||
} GRand;
|
||||
|
||||
/* Functions */
|
||||
extern gboolean g_spawn_async_with_fds(const gchar *working_directory, gchar **argv,
|
||||
gchar **envp, GSpawnFlags flags,
|
||||
GSpawnChildSetupFunc child_setup,
|
||||
gpointer user_data, GPid *child_pid, gint stdin_fd,
|
||||
gint stdout_fd, gint stderr_fd, GError **error);
|
||||
extern gboolean g_str_has_prefix (const gchar *str,
|
||||
const gchar *prefix);
|
||||
extern GString *g_string_new(gchar *base);
|
||||
extern gchar *g_string_free(GString *string, gboolean free_segment);
|
||||
extern gchar *g_strstr_len(const gchar *haystack, gssize haystack_len, const gchar *needle);
|
||||
extern guint g_strv_length(gchar **str_array);
|
||||
|
||||
/* Macros */
|
||||
# define tinyglib_pclog(f, s, ...) pclog("TinyGLib " f "(): " s "\n", ##__VA_ARGS__)
|
||||
|
||||
# define GLIB_CHECK_VERSION(a, b, c) 1
|
||||
# ifdef __GNUC__
|
||||
# define G_GNUC_PRINTF(format_idx, arg_idx) __attribute__((__format__(__printf__, format_idx, arg_idx)))
|
||||
# else
|
||||
# define G_GNUC_PRINTF(format_idx, arg_idx)
|
||||
# endif
|
||||
# define G_N_ELEMENTS(arr) (sizeof(arr) / sizeof((arr)[0]))
|
||||
# define G_STATIC_ASSERT(e) /* this should probably do something */
|
||||
# define G_UNLIKELY(e) (e)
|
||||
|
||||
# define g_assert(e) \
|
||||
do { \
|
||||
if (!(e)) \
|
||||
fatal("TinyGLib g_assert(" #e ")\n"); \
|
||||
} while (0)
|
||||
# ifdef __GNUC__
|
||||
# define g_assert_not_reached __builtin_unreachable
|
||||
# else
|
||||
# ifdef _MSC_VER
|
||||
# define g_assert_not_reached() __assume(0)
|
||||
# else
|
||||
# define g_assert_not_reached()
|
||||
# endif
|
||||
# endif
|
||||
# define g_critical(s, ...) fatal("TinyGLib g_critical(): " s "\n", ##__VA_ARGS__)
|
||||
# ifdef TINYGLIB_DEBUG
|
||||
# define g_debug(s, ...) tinyglib_pclog("g_debug", s, ##__VA_ARGS__)
|
||||
# else
|
||||
# define g_debug(s, ...)
|
||||
# endif
|
||||
# define g_error(s, ...) tinyglib_pclog("g_error", s, ##__VA_ARGS__)
|
||||
# define g_error_free(err)
|
||||
# define g_malloc0(s) calloc(1, s)
|
||||
# define g_new(t, n) (t *) malloc(sizeof(t) * n)
|
||||
# define g_new0(t, n) (t *) calloc(n, sizeof(t))
|
||||
# ifdef TINYGLIB_DEBUG
|
||||
# define g_parse_debug_string(s, k, n) ((!!sizeof(k)) * -1) /* unimplemented; always enables all debug flags */
|
||||
# else
|
||||
# define g_parse_debug_string(s, k, n) (!sizeof(k))
|
||||
# endif
|
||||
# define g_rand_int_range(r, min, max) (rand() % (max + 1 - min) + min)
|
||||
# define g_rand_new() calloc(1, sizeof(GRand))
|
||||
# define g_return_val_if_fail(e, v) \
|
||||
if (!(e)) \
|
||||
return (v)
|
||||
# define g_shell_parse_argv(a, b, c, d) !!(sizeof(b)) /* unimplemented */
|
||||
# define g_strdup(str) ((str) ? strdup(str) : NULL)
|
||||
# define g_warn_if_fail(e) \
|
||||
do { \
|
||||
if (!(e)) \
|
||||
pclog("TinyGLib g_warn_if_fail(" #e ")\n"); \
|
||||
} while (0)
|
||||
# define g_warn_if_reached() pclog("TinyGLib g_warn_if_reached()\n")
|
||||
# define g_warning(s, ...) tinyglib_pclog("g_warning", s, ##__VA_ARGS__)
|
||||
|
||||
/* Remapped functions */
|
||||
# define g_free free
|
||||
# define g_getenv getenv
|
||||
# define g_malloc malloc
|
||||
# define g_rand_free free
|
||||
# define g_realloc realloc
|
||||
# define g_snprintf snprintf
|
||||
# define g_strerror strerror
|
||||
# define g_strfreev free
|
||||
# define g_string_append_printf sprintf /* unimplemented */
|
||||
# define g_vsnprintf vsnprintf
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user