mirror of
https://github.com/holub/mame
synced 2025-04-22 16:31:49 +03:00
midwayic: Squelch logerror from interrupt control (nw)
zeus2: Add better game selector and use register values for mwskins direct rendering (nw)
This commit is contained in:
parent
e252486d17
commit
cf306ff920
@ -8,6 +8,8 @@
|
||||
#include "zeus2.h"
|
||||
|
||||
#define LOG_REGS 1
|
||||
// Setting ALWAYS_LOG_FIFO will always log the fifo versus having to hold 'L'
|
||||
#define ALWAYS_LOG_FIFO 0
|
||||
|
||||
/*************************************
|
||||
* Constructor
|
||||
@ -86,7 +88,16 @@ void zeus2_device::device_start()
|
||||
vblank_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(zeus2_device::display_irq), this));
|
||||
|
||||
//printf("%s\n", machine().system().name);
|
||||
m_thegrid = strcmp(machine().system().name, "thegrid")==0;
|
||||
// Set system type
|
||||
if (strcmp(machine().system().name, "thegrid") == 0) {
|
||||
m_system = THEGRID;
|
||||
}
|
||||
else if (strcmp(machine().system().name, "crusnexo") == 0) {
|
||||
m_system = CRUSNEXO;
|
||||
}
|
||||
else {
|
||||
m_system = MWSKINS;
|
||||
}
|
||||
|
||||
/* save states */
|
||||
save_pointer(NAME(waveram), WAVERAM0_WIDTH * WAVERAM0_HEIGHT * 2);
|
||||
@ -108,8 +119,8 @@ void zeus2_device::device_start()
|
||||
save_item(NAME(zeus_quad_size));
|
||||
save_item(NAME(m_fill_color));
|
||||
save_item(NAME(m_fill_depth));
|
||||
save_item(NAME(m_renderAddr));
|
||||
save_item(NAME(m_yScale));
|
||||
save_item(NAME(m_system));
|
||||
}
|
||||
|
||||
void zeus2_device::device_reset()
|
||||
@ -128,7 +139,6 @@ void zeus2_device::device_reset()
|
||||
zeus_fifo_words = 0;
|
||||
m_fill_color = 0;
|
||||
m_fill_depth = 0;
|
||||
m_renderAddr = 0;
|
||||
}
|
||||
#if DUMP_WAVE_RAM
|
||||
#include <iostream>
|
||||
@ -502,8 +512,7 @@ void zeus2_device::zeus2_register_update(offs_t offset, uint32_t oldval, int log
|
||||
uint32_t temp = m_zeusbase[0x38];
|
||||
m_zeusbase[0x38] = oldval;
|
||||
m_screen->update_partial(m_screen->vpos());
|
||||
log_fifo = machine().input().code_pressed(KEYCODE_L);
|
||||
//log_fifo = 1;
|
||||
log_fifo = machine().input().code_pressed(KEYCODE_L) | ALWAYS_LOG_FIFO;
|
||||
m_zeusbase[0x38] = temp;
|
||||
}
|
||||
break;
|
||||
@ -721,8 +730,7 @@ void zeus2_device::zeus2_register_update(offs_t offset, uint32_t oldval, int log
|
||||
}
|
||||
break;
|
||||
case 0x51:
|
||||
// Set direct rendering location
|
||||
m_renderAddr = frame_addr_from_phys_addr(m_zeusbase[0x51]);
|
||||
// Set rendering location
|
||||
/* in this mode, crusnexo expects the reads to immediately latch */
|
||||
//if ((m_zeusbase[0x50] == 0x00a20000) || (m_zeusbase[0x50] == 0x00720000))
|
||||
if (m_zeusbase[0x50] == 0x00a20000)
|
||||
@ -1174,7 +1182,7 @@ bool zeus2_device::zeus2_fifo_process(const uint32_t *data, int numwords)
|
||||
// 0x14: atlantis
|
||||
case 0x14:
|
||||
case 0x1c:
|
||||
if (m_thegrid) {
|
||||
if (m_system == THEGRID) {
|
||||
if (numwords < 3)
|
||||
return false;
|
||||
if (log_fifo)
|
||||
@ -1232,7 +1240,9 @@ bool zeus2_device::zeus2_fifo_process(const uint32_t *data, int numwords)
|
||||
return false;
|
||||
if (log_fifo)
|
||||
log_fifo_command(data, numwords, "\n");
|
||||
m_renderAddr = frame_addr_from_phys_addr(data[1]);
|
||||
// Need to figure how the 0x40 gets there
|
||||
m_zeusbase[0x5e] = (data[0] << 16) | 0x40;
|
||||
m_zeusbase[0x51] = data[1];
|
||||
//zeus2_draw_model(data[1], data[0] & 0xff, log_fifo);
|
||||
break;
|
||||
|
||||
@ -1252,16 +1262,22 @@ bool zeus2_device::zeus2_fifo_process(const uint32_t *data, int numwords)
|
||||
if (data[0] == 0x38000000) {
|
||||
if (numwords < 3)
|
||||
return false;
|
||||
// Direct write to frame buffer
|
||||
m_frameColor[m_renderAddr++] = conv_rgb555_to_rgb32((uint16_t)data[1]);
|
||||
m_frameColor[m_renderAddr++] = conv_rgb555_to_rgb32((uint16_t)(data[1] >> 16));
|
||||
m_frameColor[m_renderAddr++] = conv_rgb555_to_rgb32((uint16_t)data[2]);
|
||||
m_frameColor[m_renderAddr++] = conv_rgb555_to_rgb32((uint16_t)(data[2] >> 16));
|
||||
} else if (numwords < 12)
|
||||
// mwskins direct write to frame buffer
|
||||
m_zeusbase[0x58] = conv_rgb555_to_rgb32((uint16_t)data[1]);
|
||||
m_zeusbase[0x59] = conv_rgb555_to_rgb32((uint16_t)(data[1] >> 16));
|
||||
frame_write();
|
||||
m_zeusbase[0x58] = conv_rgb555_to_rgb32((uint16_t)data[2]);
|
||||
m_zeusbase[0x59] = conv_rgb555_to_rgb32((uint16_t)(data[2] >> 16));
|
||||
frame_write();
|
||||
if (((m_zeusbase[0x51] & 0xff) == 2) && log_fifo)
|
||||
log_fifo_command(data, numwords, "\n");
|
||||
}
|
||||
else if (numwords < 12) {
|
||||
return false;
|
||||
//print_fifo_command(data, numwords, "\n");
|
||||
if (log_fifo)
|
||||
log_fifo_command(data, numwords, "\n");
|
||||
//print_fifo_command(data, numwords, "\n");
|
||||
if (log_fifo)
|
||||
log_fifo_command(data, numwords, "\n");
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -1691,7 +1707,7 @@ void zeus2_renderer::zeus2_draw_quad(const uint32_t *databuffer, uint32_t texdat
|
||||
float xOrigin = reinterpret_cast<float&>(m_state->m_zeusbase[0x6a]);
|
||||
float yOrigin = reinterpret_cast<float&>(m_state->m_zeusbase[0x6b]);
|
||||
|
||||
float oozBase = (m_state->m_atlantis) ? 1024.0f : (m_state->m_thegrid) ? 512.0f : 512.0f;
|
||||
float oozBase = (m_state->m_atlantis) ? 1024.0f : (m_state->m_system == m_state->THEGRID) ? 512.0f : 512.0f;
|
||||
//oozBase = 1 << m_state->m_zeusbase[0x6c];
|
||||
maxx = maxy = -1000.0f;
|
||||
for (i = 0; i < numverts; i++)
|
||||
|
@ -137,8 +137,6 @@ public:
|
||||
float zeus_point2[3];
|
||||
uint32_t zeus_texbase;
|
||||
int zeus_quad_size;
|
||||
uint32_t m_renderAddr;
|
||||
bool m_thegrid;
|
||||
|
||||
uint32_t *waveram;
|
||||
std::unique_ptr<uint32_t[]> m_frameColor;
|
||||
@ -154,6 +152,9 @@ public:
|
||||
int texel_width;
|
||||
float zbase;
|
||||
|
||||
enum { THEGRID, CRUSNEXO, MWSKINS };
|
||||
int m_system;
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
@ -185,7 +186,6 @@ private:
|
||||
|
||||
int m_yScale;
|
||||
|
||||
|
||||
#if TRACK_REG_USAGE
|
||||
struct reg_info
|
||||
{
|
||||
|
@ -1222,7 +1222,7 @@ WRITE32_MEMBER( midway_ioasic_device::write )
|
||||
/* bit 6 = sound input buffer full */
|
||||
/* bit 7 = sound output buffer empty */
|
||||
/* bit 14 = LED? */
|
||||
if ((oldreg ^ newreg) & 0x3ff6)
|
||||
if (LOG_IOASIC && ((oldreg ^ newreg) & 0x3ff6))
|
||||
logerror("IOASIC int control = %04X\n", data);
|
||||
update_ioasic_irq();
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user