Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new WORKING machines (Vampire) #12133

Merged
merged 1 commit into from
Mar 13, 2024
Merged

new WORKING machines (Vampire) #12133

merged 1 commit into from
Mar 13, 2024

Conversation

mamehaze
Copy link
Contributor

new WORKING machines

Vampire (prototype?) [Tomasz Slanina, Heiko Klusmann]

-----------
Vampire (prototype?) [Tomasz Slanina, Heiko Klusmann]
@mamehaze mamehaze changed the title new WORKING machines new WORKING machines (Vampire) Mar 12, 2024
@mamehaze
Copy link
Contributor Author

note, this is not my driver, it's being submitted on behalf of Tomasz Slanina. I've only done a couple of clean-up passes on it, rather than authoring anything, so I'm not crediting myself.

Comment on lines +355 to +362
for (int y = 0; y < 256; ++y)
{
for (int x = 0; x < 256; ++x)
{
bitmap.pix(y, x) = (m_blitter.flags & 0x10) ? m_blitter.layer_1[256 * y + x] : m_blitter.layer_2[256 * y + x];
}
}
return 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honor cliprect, there are 32 lines not worth drawing for screen update here.

TODO;
- correct interrupt handling (main and sound cpu)
- communication between main and audio cpu
- PIT outpus
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

Comment on lines +511 to +513
PORT_DIPNAME( 0x40, 0x40, "Infinite Time" )
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conventionally needs (Cheat) suffix.

PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x40, DEF_STR( On ) )
PORT_DIPNAME( 0x80, 0x00, "Infinite Lives" )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above.

Comment on lines +241 to +259
struct
{
int base_x = 0;
int base_y = 0;

int last_offset = 0;
int last_data = 0;

int flags = 0xff;

std::unique_ptr<uint8_t[]> layer_1;
std::unique_ptr<uint8_t[]> layer_2;
std::unique_ptr<uint8_t[]> slots;
} m_blitter;

int m_audio_nmi = 0;
int m_audio_latch = 0;

int m_ppi_output = 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use explicitly sized types for anything that has to go in save states to avoid portability issues.

Comment on lines +256 to +278
int m_audio_nmi = 0;
int m_audio_latch = 0;

int m_ppi_output = 0;

void vampire_memory(address_map &map);
void vampire_audio(address_map &map);

void pit_out_w0(int state);
void pit_out_w1(int state);
void pit_out_w2(int state);

uint8_t sound_sync_r(offs_t offset);
void soundlatch_w(offs_t offset, uint8_t data);
uint8_t sound_ack_r(offs_t offset);
void blitter_flags_w(offs_t offset, uint8_t data);
void blitter_control_w(offs_t offset, uint8_t data);
uint8_t io814_r(offs_t offset);
uint8_t io815_r(offs_t offset);

uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);

required_region_ptr<uint8_t> m_gfxrom;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep the data member declarations together rather than intermixing them with member function declarations.

Comment on lines +307 to +313
void vampire_state::soundlatch_w(offs_t offset, uint8_t data)
{
m_audio_nmi = 0x00;
m_audio_latch = data;
m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
machine().scheduler().perfect_quantum(attotime::from_usec(10));
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you don’t use synchronize(...) to set m_audio_latch, you’ll still get potential issues because the sound CPU will see the latch value change before it “catches up” and sees the NMI

Comment on lines +565 to +567
#define MAIN_XTAL (8_MHz_XTAL)
#define AUDIO_XTAL (4_MHz_XTAL)
#define PIT_CLOCK (AUDIO_XTAL/2)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make these const XTAL inside the one function where they’re used – there’s no need for macros.

Comment on lines +621 to +641
void vampire_state::palette(palette_device& palette) const
{
uint8_t* proms = memregion("proms")->base();
for (int i = 0; i < 256; ++i)
{
int g = ((proms[i] & 0b00000011) >> 0) * 85;
int r = ((proms[i] & 0b00011100) >> 2) * 36;
int b = ((proms[i] & 0b11100000) >> 5) * 36;
palette.set_pen_color(i, rgb_t(r, g, b));
}
}

void vampire_state::init_vampire()
{
uint8_t* rom = memregion("maincpu")->base();
//hack interrupt vectors
rom[0xfff6] = rom[0xffe0];
rom[0xfff7] = rom[0xffe1];
rom[0xfff8] = rom[0xffe2];
rom[0xfff9] = rom[0xffe3];
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These belong inside the anonymous namespace.

@mamehaze
Copy link
Contributor Author

You may have to do these cleanups yourself. I already did a round of them for dox, prior to the rudeness on the Dumping Union list. I don't plan on making any further changes here as it isn't my driver.

@angelosa
Copy link
Member

Why you opened this PR in the first place then if "you aren't the author"?

@mamehaze
Copy link
Contributor Author

mamehaze commented Mar 13, 2024

RB said I should, and even insulted me at the time, saying it was a joke that I wouldn't, claiming the driver didn't even exist etc. This is the driver, it exists. The lovely gaslighting and projection on the DU even had Klaus (who dumped this) complaining directly to me about Vas again.

@happppp happppp self-assigned this Mar 13, 2024
@happppp happppp merged commit 3a79aca into mamedev:master Mar 13, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants