mirror of
https://github.com/holub/mame
synced 2025-06-27 06:39:03 +03:00
Merge branch 'master' of https://github.com/mamedev/mame.git
This commit is contained in:
commit
403b27d615
9
3rdparty/sqlite3/sqlite3.h
vendored
9
3rdparty/sqlite3/sqlite3.h
vendored
@ -256,6 +256,13 @@ typedef struct sqlite3 sqlite3;
|
||||
typedef sqlite_int64 sqlite3_int64;
|
||||
typedef sqlite_uint64 sqlite3_uint64;
|
||||
|
||||
/* pointer-sized values */
|
||||
#ifdef PTR64
|
||||
typedef sqlite3_uint64 FPTR;
|
||||
#else
|
||||
typedef unsigned int FPTR;
|
||||
#endif
|
||||
|
||||
/*
|
||||
** If compiling for a processor that lacks floating point support,
|
||||
** substitute integer for floating-point.
|
||||
@ -4382,7 +4389,7 @@ SQLITE_API void sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(voi
|
||||
*/
|
||||
typedef void (*sqlite3_destructor_type)(void*);
|
||||
#define SQLITE_STATIC ((sqlite3_destructor_type)0)
|
||||
#define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1)
|
||||
#define SQLITE_TRANSIENT ((sqlite3_destructor_type)(FPTR)-1)
|
||||
|
||||
/*
|
||||
** CAPI3REF: Setting The Result Of An SQL Function
|
||||
|
@ -134,6 +134,9 @@ void amis2000_device::device_start()
|
||||
// zerofill
|
||||
memset(m_callstack, 0, sizeof(m_callstack));
|
||||
m_pc = 0;
|
||||
m_ppr = 0;
|
||||
m_pbr = 0;
|
||||
m_pp_index = 0;
|
||||
m_skip = false;
|
||||
m_op = 0;
|
||||
m_f = 0;
|
||||
@ -148,6 +151,9 @@ void amis2000_device::device_start()
|
||||
// register for savestates
|
||||
save_item(NAME(m_callstack));
|
||||
save_item(NAME(m_pc));
|
||||
save_item(NAME(m_ppr));
|
||||
save_item(NAME(m_pbr));
|
||||
save_item(NAME(m_pp_index));
|
||||
save_item(NAME(m_skip));
|
||||
save_item(NAME(m_op));
|
||||
save_item(NAME(m_f));
|
||||
@ -182,6 +188,8 @@ void amis2000_device::device_start()
|
||||
void amis2000_device::device_reset()
|
||||
{
|
||||
m_pc = 0;
|
||||
m_skip = false;
|
||||
m_op = 0;
|
||||
}
|
||||
|
||||
|
||||
@ -198,6 +206,15 @@ void amis2000_device::execute_run()
|
||||
{
|
||||
m_icount--;
|
||||
|
||||
// increase PP prefix count
|
||||
if ((m_op & 0xf0) == 0x60)
|
||||
{
|
||||
if (m_pp_index < 2)
|
||||
m_pp_index++;
|
||||
}
|
||||
else
|
||||
m_pp_index = 0;
|
||||
|
||||
debugger_instruction_hook(this, m_pc);
|
||||
m_op = m_program->read_byte(m_pc);
|
||||
m_pc = (m_pc + 1) & 0x1fff;
|
||||
|
@ -72,13 +72,16 @@ protected:
|
||||
|
||||
UINT8 m_bu_bits;
|
||||
UINT16 m_bu_mask;
|
||||
UINT8 m_callstack_bits;
|
||||
UINT8 m_callstack_bits; // number of program counter bits held in callstack
|
||||
UINT16 m_callstack_mask;
|
||||
UINT8 m_callstack_depth; // callstack levels: 3 on 2000/2150, 5 on 2200/2400
|
||||
UINT16 m_callstack[5]; // max 5
|
||||
|
||||
UINT16 m_pc;
|
||||
bool m_skip;
|
||||
UINT16 m_pc; // 13-bit program counter
|
||||
UINT8 m_ppr; // prepared page register (PP 1)
|
||||
UINT8 m_pbr; // prepared bank register (PP 2)
|
||||
UINT8 m_pp_index; // number of handled PP prefixes
|
||||
bool m_skip; // skip next opcode, including PP prefixes
|
||||
UINT8 m_op;
|
||||
UINT8 m_f; // generic flags: 2 on 2000/2150, 6 on 2200/2400
|
||||
UINT8 m_carry; // carry flag
|
||||
@ -99,6 +102,8 @@ protected:
|
||||
|
||||
UINT8 ram_r();
|
||||
void ram_w(UINT8 data);
|
||||
void pop_callstack();
|
||||
void push_callstack();
|
||||
void op_illegal();
|
||||
|
||||
void op_lai();
|
||||
|
@ -14,6 +14,25 @@ void amis2000_device::ram_w(UINT8 data)
|
||||
m_data->write_byte(address, data & 0xf);
|
||||
}
|
||||
|
||||
void amis2000_device::pop_callstack()
|
||||
{
|
||||
m_pc = (m_pc & ~m_callstack_mask) | (m_callstack[0] & m_callstack_mask);
|
||||
for (int i = 0; i < m_callstack_depth-1; i++)
|
||||
{
|
||||
m_callstack[i] = m_callstack[i+1];
|
||||
m_callstack[i+1] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void amis2000_device::push_callstack()
|
||||
{
|
||||
for (int i = m_callstack_depth-1; i >= 1; i--)
|
||||
{
|
||||
m_callstack[i] = m_callstack[i-1];
|
||||
}
|
||||
m_callstack[0] = m_pc & m_callstack_mask;
|
||||
}
|
||||
|
||||
void amis2000_device::op_illegal()
|
||||
{
|
||||
logerror("%s unknown opcode $%02X at $%04X\n", tag(), m_op, m_pc);
|
||||
@ -207,31 +226,56 @@ void amis2000_device::op_eur()
|
||||
void amis2000_device::op_pp()
|
||||
{
|
||||
// PP _X: prepare page/bank with _X
|
||||
op_illegal();
|
||||
UINT8 param = ~m_op & 0x0f;
|
||||
if (m_pp_index == 0)
|
||||
m_ppr = param;
|
||||
else
|
||||
m_pbr = param & 7;
|
||||
}
|
||||
|
||||
void amis2000_device::op_jmp()
|
||||
{
|
||||
// JMP X: jump to X(+PP)
|
||||
op_illegal();
|
||||
UINT16 mask = 0x3f;
|
||||
UINT16 param = m_op & mask;
|
||||
if (m_pp_index > 0)
|
||||
{
|
||||
param |= m_ppr << 6;
|
||||
mask |= 0x3c0;
|
||||
}
|
||||
if (m_pp_index > 1)
|
||||
{
|
||||
param |= m_pbr << 10;
|
||||
mask |= 0x1c00;
|
||||
}
|
||||
m_pc = (m_pc & ~mask) | param;
|
||||
}
|
||||
|
||||
void amis2000_device::op_jms()
|
||||
{
|
||||
// JMS X: call to X(+PP)
|
||||
op_illegal();
|
||||
m_icount--;
|
||||
push_callstack();
|
||||
if (m_pp_index == 0)
|
||||
{
|
||||
// subroutines default location is page 15
|
||||
m_ppr = 0xf;
|
||||
m_pp_index++;
|
||||
}
|
||||
op_jmp();
|
||||
}
|
||||
|
||||
void amis2000_device::op_rt()
|
||||
{
|
||||
// RT: return from subroutine
|
||||
op_illegal();
|
||||
pop_callstack();
|
||||
}
|
||||
|
||||
void amis2000_device::op_rts()
|
||||
{
|
||||
// RTS: return from subroutine and skip next
|
||||
op_illegal();
|
||||
op_rt();
|
||||
m_skip = true;
|
||||
}
|
||||
|
||||
void amis2000_device::op_nop()
|
||||
|
@ -73,8 +73,8 @@ private:
|
||||
static inline be_parameter make_ireg(int regnum) { assert(regnum >= 0 && regnum < x64emit::REG_MAX); return be_parameter(PTYPE_INT_REGISTER, regnum); }
|
||||
static inline be_parameter make_freg(int regnum) { assert(regnum >= 0 && regnum < x64emit::REG_MAX); return be_parameter(PTYPE_FLOAT_REGISTER, regnum); }
|
||||
static inline be_parameter make_vreg(int regnum) { assert(regnum >= 0 && regnum < x64emit::REG_MAX); return be_parameter(PTYPE_VECTOR_REGISTER, regnum); }
|
||||
static inline be_parameter make_memory(void *base) { return be_parameter(PTYPE_MEMORY, reinterpret_cast<be_parameter_value>(base)); }
|
||||
static inline be_parameter make_memory(const void *base) { return be_parameter(PTYPE_MEMORY, reinterpret_cast<be_parameter_value>(const_cast<void *>(base))); }
|
||||
static inline be_parameter make_memory(void *base) { return be_parameter(PTYPE_MEMORY, static_cast<be_parameter_value>(reinterpret_cast<FPTR>(base))); }
|
||||
static inline be_parameter make_memory(const void *base) { return be_parameter(PTYPE_MEMORY, static_cast<be_parameter_value>(reinterpret_cast<FPTR>(const_cast<void *>(base)))); }
|
||||
|
||||
// operators
|
||||
bool operator==(const be_parameter &rhs) const { return (m_type == rhs.m_type && m_value == rhs.m_value); }
|
||||
|
@ -73,8 +73,8 @@ private:
|
||||
static inline be_parameter make_ireg(int regnum) { assert(regnum >= 0 && regnum < x86emit::REG_MAX); return be_parameter(PTYPE_INT_REGISTER, regnum); }
|
||||
static inline be_parameter make_freg(int regnum) { assert(regnum >= 0 && regnum < x86emit::REG_MAX); return be_parameter(PTYPE_FLOAT_REGISTER, regnum); }
|
||||
static inline be_parameter make_vreg(int regnum) { assert(regnum >= 0 && regnum < x86emit::REG_MAX); return be_parameter(PTYPE_VECTOR_REGISTER, regnum); }
|
||||
static inline be_parameter make_memory(void *base) { return be_parameter(PTYPE_MEMORY, reinterpret_cast<be_parameter_value>(base)); }
|
||||
static inline be_parameter make_memory(const void *base) { return be_parameter(PTYPE_MEMORY, reinterpret_cast<be_parameter_value>(const_cast<void *>(base))); }
|
||||
static inline be_parameter make_memory(void *base) { return be_parameter(PTYPE_MEMORY, static_cast<be_parameter_value>(reinterpret_cast<FPTR>(base))); }
|
||||
static inline be_parameter make_memory(const void *base) { return be_parameter(PTYPE_MEMORY, static_cast<be_parameter_value>(reinterpret_cast<FPTR>(const_cast<void *>(base)))); }
|
||||
|
||||
// operators
|
||||
bool operator==(const be_parameter &rhs) const { return (m_type == rhs.m_type && m_value == rhs.m_value); }
|
||||
|
@ -305,7 +305,7 @@ namespace uml
|
||||
parameter(UINT64 val) : m_type(PTYPE_IMMEDIATE), m_value(val) { }
|
||||
parameter(operand_size size, memory_scale scale) : m_type(PTYPE_SIZE_SCALE), m_value((scale << 4) | size) { assert(size >= SIZE_BYTE && size <= SIZE_DQWORD); assert(scale >= SCALE_x1 && scale <= SCALE_x8); }
|
||||
parameter(operand_size size, memory_space space) : m_type(PTYPE_SIZE_SPACE), m_value((space << 4) | size) { assert(size >= SIZE_BYTE && size <= SIZE_DQWORD); assert(space >= SPACE_PROGRAM && space <= SPACE_IO); }
|
||||
parameter(code_handle &handle) : m_type(PTYPE_CODE_HANDLE), m_value(reinterpret_cast<parameter_value>(&handle)) { }
|
||||
parameter(code_handle &handle) : m_type(PTYPE_CODE_HANDLE), m_value(static_cast<parameter_value>(reinterpret_cast<FPTR>(&handle))) { }
|
||||
parameter(code_label &label) : m_type(PTYPE_CODE_LABEL), m_value(label) { }
|
||||
|
||||
// creators for types that don't safely default
|
||||
@ -313,11 +313,11 @@ namespace uml
|
||||
static inline parameter make_freg(int regnum) { assert(regnum >= REG_F0 && regnum < REG_F_END); return parameter(PTYPE_FLOAT_REGISTER, regnum); }
|
||||
static inline parameter make_vreg(int regnum) { assert(regnum >= REG_V0 && regnum < REG_V_END); return parameter(PTYPE_VECTOR_REGISTER, regnum); }
|
||||
static inline parameter make_mapvar(int mvnum) { assert(mvnum >= MAPVAR_M0 && mvnum < MAPVAR_END); return parameter(PTYPE_MAPVAR, mvnum); }
|
||||
static inline parameter make_memory(void *base) { return parameter(PTYPE_MEMORY, reinterpret_cast<parameter_value>(base)); }
|
||||
static inline parameter make_memory(const void *base) { return parameter(PTYPE_MEMORY, reinterpret_cast<parameter_value>(const_cast<void *>(base))); }
|
||||
static inline parameter make_memory(void *base) { return parameter(PTYPE_MEMORY, static_cast<parameter_value>(reinterpret_cast<FPTR>(base))); }
|
||||
static inline parameter make_memory(const void *base) { return parameter(PTYPE_MEMORY, static_cast<parameter_value>(reinterpret_cast<FPTR>(const_cast<void *>(base)))); }
|
||||
static inline parameter make_size(operand_size size) { assert(size >= SIZE_BYTE && size <= SIZE_DQWORD); return parameter(PTYPE_SIZE, size); }
|
||||
static inline parameter make_string(const char *string) { return parameter(PTYPE_STRING, reinterpret_cast<parameter_value>(const_cast<char *>(string))); }
|
||||
static inline parameter make_cfunc(c_function func) { return parameter(PTYPE_C_FUNCTION, reinterpret_cast<parameter_value>(func)); }
|
||||
static inline parameter make_string(const char *string) { return parameter(PTYPE_STRING, static_cast<parameter_value>(reinterpret_cast<FPTR>(const_cast<char *>(string)))); }
|
||||
static inline parameter make_cfunc(c_function func) { return parameter(PTYPE_C_FUNCTION, static_cast<parameter_value>(reinterpret_cast<FPTR>(func))); }
|
||||
static inline parameter make_rounding(float_rounding_mode mode) { assert(mode >= ROUND_TRUNC && mode <= ROUND_DEFAULT); return parameter(PTYPE_ROUNDING, mode); }
|
||||
|
||||
// operators
|
||||
|
@ -73,7 +73,7 @@ void ui_menu_input_groups::handle()
|
||||
/* process the menu */
|
||||
const ui_menu_event *menu_event = process(0);
|
||||
if (menu_event != NULL && menu_event->iptkey == IPT_UI_SELECT)
|
||||
ui_menu::stack_push(auto_alloc_clear(machine(), ui_menu_input_general(machine(), container, int((long long)(menu_event->itemref)-1))));
|
||||
ui_menu::stack_push(auto_alloc_clear(machine(), ui_menu_input_general(machine(), container, int((long long)((FPTR)menu_event->itemref)-1))));
|
||||
}
|
||||
|
||||
|
||||
|
@ -151,7 +151,7 @@ void ui_menu_main::handle()
|
||||
/* process the menu */
|
||||
const ui_menu_event *menu_event = process(0);
|
||||
if (menu_event != NULL && menu_event->iptkey == IPT_UI_SELECT) {
|
||||
switch((long long)(menu_event->itemref)) {
|
||||
switch((long long)((FPTR) menu_event->itemref)) {
|
||||
case INPUT_GROUPS:
|
||||
ui_menu::stack_push(auto_alloc_clear(machine(), ui_menu_input_groups(machine(), container)));
|
||||
break;
|
||||
|
@ -49,7 +49,7 @@ inline INT32 bitmap_t::compute_rowpixels(int width, int xslop)
|
||||
inline void bitmap_t::compute_base(int xslop, int yslop)
|
||||
{
|
||||
m_base = m_alloc + (m_rowpixels * yslop + xslop) * (m_bpp / 8);
|
||||
UINT64 aligned_base = ((reinterpret_cast<UINT64>(m_base) + (BITMAP_OVERALL_ALIGN - 1)) / BITMAP_OVERALL_ALIGN) * BITMAP_OVERALL_ALIGN;
|
||||
UINT64 aligned_base = ((static_cast<UINT64>(reinterpret_cast<FPTR>(m_base)) + (BITMAP_OVERALL_ALIGN - 1)) / BITMAP_OVERALL_ALIGN) * BITMAP_OVERALL_ALIGN;
|
||||
m_base = reinterpret_cast<void *>(aligned_base);
|
||||
}
|
||||
|
||||
|
@ -31,6 +31,7 @@
|
||||
#pragma warning (disable: 5025 5026 5027)
|
||||
#define _CRT_STDIO_LEGACY_WIDE_SPECIFIERS
|
||||
#endif
|
||||
#define strtoll _strtoi64
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
|
Loading…
Reference in New Issue
Block a user