summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/includes/model1.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/includes/model1.h')
-rw-r--r--src/mame/includes/model1.h130
1 files changed, 69 insertions, 61 deletions
diff --git a/src/mame/includes/model1.h b/src/mame/includes/model1.h
index 062fe7c876e..ce7762f4d44 100644
--- a/src/mame/includes/model1.h
+++ b/src/mame/includes/model1.h
@@ -11,6 +11,7 @@
#include "cpu/mb86233/mb86233.h"
#include "cpu/v60/v60.h"
#include "machine/i8251.h"
+#include "machine/gen_fifo.h"
#include "machine/m1comm.h"
#include "machine/timer.h"
#include "video/segaic24.h"
@@ -37,11 +38,14 @@ public:
, m_m1uart(*this, "m1uart")
, m_m1comm(*this, "m1comm")
, m_dsbz80(*this, DSBZ80_TAG)
- , m_tgp(*this, "tgp")
+ , m_tgp_copro(*this, "tgp_copro")
, m_screen(*this, "screen")
, m_io_timer(*this, "iotimer")
+ , m_copro_fifo_in(*this, "copro_fifo_in")
+ , m_copro_fifo_out(*this, "copro_fifo_out")
, m_poly_rom(*this, "polygons")
- , m_tgp_data(*this, "tgp_data")
+ , m_copro_tables(*this, "copro_tables")
+ , m_copro_data(*this, "copro_data")
, m_mr2(*this, "mr2")
, m_mr(*this, "mr")
, m_display_list0(*this, "display_list0")
@@ -59,7 +63,6 @@ public:
// Machine
DECLARE_MACHINE_START(model1);
DECLARE_MACHINE_RESET(model1);
- DECLARE_MACHINE_RESET(model1_vr);
DECLARE_READ16_MEMBER(network_ctl_r);
DECLARE_WRITE16_MEMBER(network_ctl_w);
@@ -81,25 +84,44 @@ public:
DECLARE_WRITE16_MEMBER(mr_w);
DECLARE_WRITE16_MEMBER(mr2_w);
- DECLARE_READ16_MEMBER(model1_tgp_copro_r);
- DECLARE_WRITE16_MEMBER(model1_tgp_copro_w);
- DECLARE_READ16_MEMBER(model1_tgp_copro_adr_r);
- DECLARE_WRITE16_MEMBER(model1_tgp_copro_adr_w);
- DECLARE_READ16_MEMBER(model1_tgp_copro_ram_r);
- DECLARE_WRITE16_MEMBER(model1_tgp_copro_ram_w);
- DECLARE_READ16_MEMBER(model1_tgp_vr_adr_r);
- DECLARE_WRITE16_MEMBER(model1_tgp_vr_adr_w);
- DECLARE_READ16_MEMBER(model1_vr_tgp_ram_r);
- DECLARE_WRITE16_MEMBER(model1_vr_tgp_ram_w);
- DECLARE_READ16_MEMBER(model1_vr_tgp_r);
- DECLARE_WRITE16_MEMBER(model1_vr_tgp_w);
+ DECLARE_READ16_MEMBER(v60_copro_fifo_r);
+ DECLARE_WRITE16_MEMBER(v60_copro_fifo_w);
+ DECLARE_READ16_MEMBER(v60_copro_ram_adr_r);
+ DECLARE_WRITE16_MEMBER(v60_copro_ram_adr_w);
+ DECLARE_READ16_MEMBER(v60_copro_ram_r);
+ DECLARE_WRITE16_MEMBER(v60_copro_ram_w);
DECLARE_READ32_MEMBER(copro_ram_r);
DECLARE_WRITE32_MEMBER(copro_ram_w);
- DECLARE_READ_LINE_MEMBER(copro_fifoin_pop_ok);
DECLARE_READ32_MEMBER(copro_fifoin_pop);
DECLARE_WRITE32_MEMBER(copro_fifoout_push);
+ DECLARE_WRITE32_MEMBER(copro_sincos_w);
+ DECLARE_READ32_MEMBER(copro_sincos_r);
+ DECLARE_WRITE32_MEMBER(copro_inv_w);
+ DECLARE_READ32_MEMBER(copro_inv_r);
+ DECLARE_WRITE32_MEMBER(copro_isqrt_w);
+ DECLARE_READ32_MEMBER(copro_isqrt_r);
+ DECLARE_WRITE32_MEMBER(copro_atan_w);
+ DECLARE_READ32_MEMBER(copro_atan_r);
+ DECLARE_WRITE32_MEMBER(copro_data_w);
+ DECLARE_READ32_MEMBER(copro_data_r);
+ DECLARE_WRITE32_MEMBER(copro_ramadr_w);
+ DECLARE_READ32_MEMBER(copro_ramadr_r);
+ DECLARE_WRITE32_MEMBER(copro_ramdata_w);
+ DECLARE_READ32_MEMBER(copro_ramdata_r);
+
+ void copro_hle_vf();
+ void copro_hle_swa();
+ void copro_reset();
+
+ u32 m_copro_sincos_base;
+ u32 m_copro_inv_base;
+ u32 m_copro_isqrt_base;
+ u32 m_copro_atan_base[4];
+ u32 m_copro_data_base;
+ u32 m_copro_ram_adr;
+
uint16_t m_r360_state;
DECLARE_DRIVER_INIT(wingwar360);
DECLARE_READ16_MEMBER(r360_r);
@@ -187,27 +209,32 @@ public:
};
void model1(machine_config &config);
- void wingwar(machine_config &config);
- void swa(machine_config &config);
- void netmerc(machine_config &config);
- void model1_vr(machine_config &config);
+
+ void model1_hle(machine_config &config);
void vr(machine_config &config);
void vformula(machine_config &config);
+ void swa(machine_config &config);
+ void netmerc(machine_config &config);
+ void wingwar(machine_config &config);
+
void model1_io(address_map &map);
void model1_mem(address_map &map);
void model1_comm_mem(address_map &map);
- void model1_vr_io(address_map &map);
- void model1_vr_mem(address_map &map);
- void model1_vr_tgp_map(address_map &map);
+
+ void copro_prog_map(address_map &map);
+ void copro_data_map(address_map &map);
+ void copro_external_map(address_map &map);
+ void copro_io_map(address_map &map);
+ void copro_rf_map(address_map &map);
+
void polhemus_map(address_map &map);
+
private:
// Machine
void irq_raise(int level);
void irq_init();
int m_last_irq;
- bool m_dump;
- bool m_swa;
uint8_t m_io_command;
@@ -217,12 +244,14 @@ private:
required_device<i8251_device> m_m1uart;
optional_device<m1comm_device> m_m1comm; // Model 1 communication board
optional_device<dsbz80_device> m_dsbz80; // Digital Sound Board
- optional_device<mb86233_cpu_device> m_tgp;
+ optional_device<mb86233_device> m_tgp_copro;
required_device<screen_device> m_screen;
required_device<timer_device> m_io_timer;
+ required_device<generic_fifo_u32_device> m_copro_fifo_in, m_copro_fifo_out;
required_region_ptr<uint32_t> m_poly_rom;
- optional_region_ptr<uint32_t> m_tgp_data;
+ required_region_ptr<uint32_t> m_copro_tables;
+ optional_memory_region m_copro_data;
required_shared_ptr<uint16_t> m_mr2;
required_shared_ptr<uint16_t> m_mr;
@@ -234,32 +263,16 @@ private:
int m_sound_irq;
// TGP FIFO
- uint32_t fifoout_pop();
void fifoout_push(uint32_t data);
void fifoout_push_f(float data);
uint32_t fifoin_pop();
- void fifoin_push(uint32_t data);
float fifoin_pop_f();
uint16_t ram_get_i();
float ram_get_f();
- void copro_fifoin_push(uint32_t data);
- uint32_t copro_fifoout_pop();
- void next_fn();
-
- uint32_t m_copro_r;
- uint32_t m_copro_w;
- int m_copro_fifoout_rpos;
- int m_copro_fifoout_wpos;
- uint32_t m_copro_fifoout_data[FIFO_SIZE];
- int m_copro_fifoout_num;
- int m_copro_fifoin_rpos;
- int m_copro_fifoin_wpos;
- uint32_t m_copro_fifoin_data[FIFO_SIZE];
- int m_copro_fifoin_num;
+ u32 m_v60_copro_fifo_r, m_v60_copro_fifo_w;
// TGP
- void vr_tgp_reset();
- void tgp_reset(bool swa);
+ void tgp_reset();
DECLARE_TGP_FUNCTION( fadd );
DECLARE_TGP_FUNCTION( fsub );
@@ -385,12 +398,8 @@ private:
quad_t *m_quadpt;
quad_t **m_quadind;
offs_t m_pushpc;
- int m_fifoin_rpos;
- int m_fifoin_wpos;
- uint32_t m_fifoin_data[FIFO_SIZE];
- int m_fifoin_cbcount;
+ u32 m_copro_hle_active_list_pos, m_copro_hle_active_list_length;
typedef void (model1_state::*tgp_func)();
- tgp_func m_fifoin_cb;
struct function
{
@@ -398,12 +407,12 @@ private:
int count;
};
+ static float tsin(s16 angle);
+ static float tcos(s16 angle);
+
static const struct function ftab_vf[];
static const struct function ftab_swa[];
- int32_t m_fifoout_rpos;
- int32_t m_fifoout_wpos;
- uint32_t m_fifoout_data[FIFO_SIZE];
- uint32_t m_list_length;
+ uint32_t m_copro_hle_list_length;
float m_cmat[12];
float m_mat_stack[MAT_STACK_SIZE][12];
float m_mat_vector[21][12];
@@ -426,15 +435,12 @@ private:
float m_tgp_int_py;
float m_tgp_int_pz;
uint32_t m_tgp_int_adr;
- uint16_t m_ram_adr;
- uint16_t m_ram_latch[2];
- uint16_t m_ram_scanadr;
- std::unique_ptr<uint32_t[]> m_ram_data;
+ uint16_t m_v60_copro_ram_adr;
+ uint16_t m_v60_copro_ram_latch[2];
+ uint16_t m_copro_hle_ram_scan_adr;
+ std::unique_ptr<uint32_t[]> m_copro_ram_data;
float m_tgp_vr_base[4];
- int m_puuu;
int m_ccount;
- uint32_t m_vr_r;
- uint32_t m_vr_w;
uint16_t m_listctl[2];
uint16_t *m_glist;
bool m_render_done;
@@ -442,6 +448,8 @@ private:
std::unique_ptr<uint16_t[]> m_tgp_ram;
std::unique_ptr<uint32_t[]> m_poly_ram;
+ void configure_fifos();
+
// Rendering helper functions
uint32_t readi(int adr) const;
int16_t readi16(int adr) const;