forked from mamedev/mame
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
casio/cz230s.cpp: Added Casio CZ-230S and SZ-1. (mamedev#11969)
* cpu/upd7810: Added support for internal RAM. * sound/upd934g.cpp: Corrected channel mapping for play sample command. * video/mn1252.cpp: Added Panasonic MN1252 LCD controller emulation. * casio/ra3.cpp: Added RA-5 8 KiB RAM cartridge. New working systems ---------- Casio CZ-230S [BCM, =CO=Windler, Devin Acker] Casio SZ-1 [BCM, Devin Acker]
- Loading branch information
1 parent
893c9ae
commit bbd2f48
Showing
14 changed files
with
1,729 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
// license:BSD-3-Clause | ||
// copyright-holders:Devin Acker | ||
/*************************************************************************** | ||
Panasonic MN1252 LCD controller | ||
***************************************************************************/ | ||
|
||
#include "emu.h" | ||
#include "mn1252.h" | ||
|
||
#include <cassert> | ||
|
||
|
||
DEFINE_DEVICE_TYPE(MN1252, mn1252_device, "mn1252", "Panasonic MN1252 LCD controller") | ||
|
||
const u8 mn1252_device::OUTPUT_DIGITS[0x40] = | ||
{ | ||
// bit 0..7 = segment a..h (from datasheet) | ||
0x00, 0x77, 0x7f, 0x39, 0x3f, 0x79, 0x71, 0x3d, | ||
0x76, 0x06, 0x1e, 0xf0, 0x38, 0xb7, 0xb6, 0xbf, | ||
0x73, 0xbf, 0xf3, 0x6d, 0x07, 0x3e, 0xa6, 0xbe, | ||
0xf2, 0x6e, 0x5b, 0x48, 0x0f, 0x46, 0x49, 0x44, | ||
0x00, 0x08, 0x10, 0x18, 0x20, 0x28, 0x30, 0x38, | ||
0x7c, 0x58, 0x5e, 0x54, 0x5c, 0x40, 0x21, 0x0c, | ||
0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, | ||
0x7f, 0x6f, 0x01, 0x36, 0x5f, 0x7b, 0x74, 0x62 | ||
}; | ||
|
||
mn1252_device::mn1252_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) | ||
: device_t(mconfig, MN1252, tag, owner, clock) | ||
{ | ||
} | ||
|
||
/**************************************************************************/ | ||
void mn1252_device::device_start() | ||
{ | ||
save_item(NAME(m_data)); | ||
save_item(NAME(m_first_nibble)); | ||
save_item(NAME(m_nibble_count)); | ||
save_item(NAME(m_ce)); | ||
save_item(NAME(m_std)); | ||
save_item(NAME(m_output)); | ||
} | ||
|
||
/**************************************************************************/ | ||
void mn1252_device::device_reset() | ||
{ | ||
m_data = m_first_nibble = 0; | ||
m_nibble_count = 0; | ||
m_ce = m_std = 0; | ||
|
||
std::fill(std::begin(m_output), std::end(m_output), 0); | ||
} | ||
|
||
/**************************************************************************/ | ||
u16 mn1252_device::output(offs_t digit) const | ||
{ | ||
assert(digit < 6); | ||
return m_output[digit]; | ||
} | ||
|
||
/**************************************************************************/ | ||
void mn1252_device::data_w(u8 data) | ||
{ | ||
m_data = data & 0xf; | ||
} | ||
|
||
/**************************************************************************/ | ||
void mn1252_device::ce_w(int state) | ||
{ | ||
if (!m_ce && state) | ||
{ | ||
m_nibble_count = 0; | ||
} | ||
|
||
m_ce = state; | ||
} | ||
|
||
/**************************************************************************/ | ||
void mn1252_device::std_w(int state) | ||
{ | ||
if (m_ce && m_std && !state && m_nibble_count < 12) | ||
{ | ||
if (!(m_nibble_count % 2)) | ||
{ | ||
m_first_nibble = m_data; | ||
} | ||
else | ||
{ | ||
const u8 data = (m_first_nibble << 4) | m_data; | ||
u16 output = OUTPUT_DIGITS[data & 0x3f]; | ||
if (BIT(data, 6)) output |= 0x80; // segment h | ||
if (BIT(data, 7)) output |= 0x100; // segment p | ||
|
||
m_output[m_nibble_count / 2] = output; | ||
} | ||
|
||
m_nibble_count++; | ||
} | ||
|
||
m_std = state; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// license:BSD-3-Clause | ||
// copyright-holders:Devin Acker | ||
/*************************************************************************** | ||
Panasonic MN1252 LCD controller | ||
***************************************************************************/ | ||
|
||
#ifndef MAME_VIDEO_MN1252_H | ||
#define MAME_VIDEO_MN1252_H | ||
|
||
#pragma once | ||
|
||
class mn1252_device : public device_t | ||
{ | ||
public: | ||
mn1252_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); | ||
|
||
u16 output(offs_t digit) const; | ||
|
||
void data_w(u8 data); | ||
void ce_w(int state); | ||
void std_w(int state); | ||
|
||
protected: | ||
virtual void device_start() override; | ||
virtual void device_reset() override; | ||
|
||
private: | ||
static const u8 OUTPUT_DIGITS[0x40]; | ||
|
||
u8 m_data; | ||
u8 m_first_nibble; | ||
u8 m_nibble_count; | ||
u8 m_ce, m_std; | ||
|
||
u16 m_output[6]; | ||
}; | ||
|
||
DECLARE_DEVICE_TYPE(MN1252, mn1252_device) | ||
|
||
#endif // MAME_VIDEO_MN1252_H |
Oops, something went wrong.