-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Conversation
----------- Vampire (prototype?) [Tomasz Slanina, Heiko Klusmann]
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. |
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; |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
PORT_DIPNAME( 0x40, 0x40, "Infinite Time" ) | ||
PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | ||
PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
There was a problem hiding this comment.
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" ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above.
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; |
There was a problem hiding this comment.
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.
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; |
There was a problem hiding this comment.
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.
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)); | ||
} |
There was a problem hiding this comment.
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
#define MAIN_XTAL (8_MHz_XTAL) | ||
#define AUDIO_XTAL (4_MHz_XTAL) | ||
#define PIT_CLOCK (AUDIO_XTAL/2) |
There was a problem hiding this comment.
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.
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]; | ||
} |
There was a problem hiding this comment.
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.
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. |
Why you opened this PR in the first place then if "you aren't the author"? |
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. |
new WORKING machines
Vampire (prototype?) [Tomasz Slanina, Heiko Klusmann]