mirror of
https://github.com/holub/mame
synced 2025-04-22 16:31:49 +03:00
(nw) z8: fixed more bugs; jtc: fixed cassette, wave sound, added quickload
This commit is contained in:
parent
b98658573b
commit
4c9172a0d7
@ -321,16 +321,28 @@ uint8_t z8_device::register_read(uint8_t offset)
|
||||
case Z8_REGISTER_P0:
|
||||
switch (P01M & Z8_P01M_P0L_MODE_MASK)
|
||||
{
|
||||
case Z8_P01M_P0L_MODE_OUTPUT: data = m_output[offset] & 0x0f; break;
|
||||
case Z8_P01M_P0L_MODE_INPUT: mask = 0x0f; break;
|
||||
default: /* A8...A11 */ data = 0x0f; break;
|
||||
case Z8_P01M_P0L_MODE_OUTPUT:
|
||||
data = m_output[offset] & 0x0f;
|
||||
break;
|
||||
case Z8_P01M_P0L_MODE_INPUT:
|
||||
mask = 0x0f;
|
||||
break;
|
||||
default: /* A8...A11 */
|
||||
data = 0x0f;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (P01M & Z8_P01M_P0H_MODE_MASK)
|
||||
{
|
||||
case Z8_P01M_P0H_MODE_OUTPUT: data |= m_output[offset] & 0xf0; break;
|
||||
case Z8_P01M_P0H_MODE_INPUT: mask |= 0xf0; break;
|
||||
default: /* A12...A15 */ data |= 0xf0; break;
|
||||
case Z8_P01M_P0H_MODE_OUTPUT:
|
||||
data |= m_output[offset] & 0xf0;
|
||||
break;
|
||||
case Z8_P01M_P0H_MODE_INPUT:
|
||||
mask |= 0xf0;
|
||||
break;
|
||||
default: /* A12...A15 */
|
||||
data |= 0xf0;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!(P3M & Z8_P3M_P0_STROBED))
|
||||
@ -344,9 +356,15 @@ uint8_t z8_device::register_read(uint8_t offset)
|
||||
case Z8_REGISTER_P1:
|
||||
switch (P01M & Z8_P01M_P1_MODE_MASK)
|
||||
{
|
||||
case Z8_P01M_P1_MODE_OUTPUT: data = m_output[offset]; break;
|
||||
case Z8_P01M_P1_MODE_INPUT: mask = 0xff; break;
|
||||
default: /* AD0..AD7 */ data = 0xff; break;
|
||||
case Z8_P01M_P1_MODE_OUTPUT:
|
||||
data = m_output[offset];
|
||||
break;
|
||||
case Z8_P01M_P1_MODE_INPUT:
|
||||
mask = 0xff;
|
||||
break;
|
||||
default: /* AD0..AD7 */
|
||||
data = 0xff;
|
||||
break;
|
||||
}
|
||||
|
||||
if ((P3M & Z8_P3M_P33_P34_MASK) != Z8_P3M_P33_P34_DAV1_RDY1)
|
||||
@ -370,10 +388,10 @@ uint8_t z8_device::register_read(uint8_t offset)
|
||||
|
||||
case Z8_REGISTER_P3:
|
||||
// TODO: special port 3 modes
|
||||
if (!(P3M & 0x7c))
|
||||
{
|
||||
//if (!(P3M & 0x7c))
|
||||
//{
|
||||
mask = 0x0f;
|
||||
}
|
||||
//}
|
||||
|
||||
if (mask) m_input[offset] = m_input_cb[3](0, mask);
|
||||
|
||||
@ -439,10 +457,10 @@ void z8_device::register_write(uint8_t offset, uint8_t data)
|
||||
m_output[offset] = data;
|
||||
|
||||
// TODO: special port 3 modes
|
||||
if (!(P3M & 0x7c))
|
||||
{
|
||||
//if (!(P3M & 0x7c))
|
||||
//{
|
||||
mask = 0xf0;
|
||||
}
|
||||
//}
|
||||
|
||||
if (mask) m_output_cb[3](0, data & mask, mask);
|
||||
break;
|
||||
|
@ -37,8 +37,8 @@
|
||||
_func(dst, src);
|
||||
|
||||
#define mode_IR2_R1(_func) \
|
||||
uint8_t src = read(R);\
|
||||
uint8_t dst = IR;\
|
||||
uint8_t src = m_r[read(R)];\
|
||||
uint8_t dst = R;\
|
||||
_func(dst, src);
|
||||
|
||||
#define mode_R1_IM(_func) \
|
||||
|
@ -1,6 +1,6 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Curt Coder, Robbbert
|
||||
/***************************************************************************
|
||||
/***************************************************************************************
|
||||
|
||||
Jugend+Technik CompJU+TEr
|
||||
|
||||
@ -9,13 +9,12 @@ Jugend+Technik CompJU+TEr
|
||||
2018-09: Made mostly working
|
||||
|
||||
To Do:
|
||||
- Add quickload of jtc files
|
||||
- Find out if cassette works
|
||||
- Figure out how to use the so-called "Basic", all documents are in German.
|
||||
- Fix any remaining CPU bugs
|
||||
- On jtces40, the use of ALT key will usually freeze the system. Normal, or a bug?
|
||||
- On jtces40, no backspace?
|
||||
- On jtces40, is there a way to type lower case?
|
||||
- On jtces40, hires gfx and colours to fix.
|
||||
|
||||
****************************************************************************************/
|
||||
|
||||
@ -26,6 +25,7 @@ To Do:
|
||||
#include "machine/ram.h"
|
||||
#include "sound/spkrdev.h"
|
||||
#include "sound/wave.h"
|
||||
#include "imagedev/snapquik.h"
|
||||
#include "emupal.h"
|
||||
#include "screen.h"
|
||||
#include "speaker.h"
|
||||
@ -48,12 +48,6 @@ public:
|
||||
, m_video_ram(*this, "videoram")
|
||||
{ }
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<ram_device> m_ram;
|
||||
required_device<cassette_image_device> m_cassette;
|
||||
required_device<speaker_sound_device> m_speaker;
|
||||
required_device<centronics_device> m_centronics;
|
||||
|
||||
virtual void machine_start() override;
|
||||
|
||||
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
@ -62,13 +56,20 @@ public:
|
||||
DECLARE_READ8_MEMBER( p3_r );
|
||||
DECLARE_WRITE8_MEMBER( p3_w );
|
||||
DECLARE_PALETTE_INIT(jtc_es40);
|
||||
optional_shared_ptr<uint8_t> m_video_ram;
|
||||
DECLARE_QUICKLOAD_LOAD_MEMBER( jtc );
|
||||
|
||||
int m_centronics_busy;
|
||||
DECLARE_WRITE_LINE_MEMBER(write_centronics_busy);
|
||||
void basic(machine_config &config);
|
||||
void jtc(machine_config &config);
|
||||
void jtc_mem(address_map &map);
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<ram_device> m_ram;
|
||||
required_device<cassette_image_device> m_cassette;
|
||||
required_device<speaker_sound_device> m_speaker;
|
||||
required_device<centronics_device> m_centronics;
|
||||
optional_shared_ptr<uint8_t> m_video_ram;
|
||||
};
|
||||
|
||||
|
||||
@ -158,10 +159,6 @@ READ8_MEMBER( jtc_state::p3_r )
|
||||
P31
|
||||
P32
|
||||
P33 centronics busy input
|
||||
P34
|
||||
P35
|
||||
P36 tape output
|
||||
P37 speaker output
|
||||
|
||||
*/
|
||||
|
||||
@ -179,10 +176,6 @@ WRITE8_MEMBER( jtc_state::p3_w )
|
||||
|
||||
bit description
|
||||
|
||||
P30 tape input
|
||||
P31
|
||||
P32
|
||||
P33 centronics busy input
|
||||
P34
|
||||
P35
|
||||
P36 tape output
|
||||
@ -597,6 +590,94 @@ static INPUT_PORTS_START( jtces40 )
|
||||
PORT_START("Y15")
|
||||
INPUT_PORTS_END
|
||||
|
||||
QUICKLOAD_LOAD_MEMBER( jtc_state, jtc )
|
||||
{
|
||||
address_space &space = m_maincpu->space(AS_PROGRAM);
|
||||
u16 i, quick_addr, quick_length;
|
||||
std::vector<uint8_t> quick_data;
|
||||
image_init_result result = image_init_result::FAIL;
|
||||
|
||||
quick_length = image.length();
|
||||
if (image.is_filetype("jtc"))
|
||||
{
|
||||
if (quick_length < 0x0088)
|
||||
{
|
||||
image.seterror(IMAGE_ERROR_INVALIDIMAGE, "File too short");
|
||||
image.message(" File too short");
|
||||
}
|
||||
else
|
||||
if (quick_length > 0x8000)
|
||||
{
|
||||
image.seterror(IMAGE_ERROR_INVALIDIMAGE, "File too long");
|
||||
image.message(" File too long");
|
||||
}
|
||||
else
|
||||
{
|
||||
quick_data.resize(quick_length+1);
|
||||
u16 read_ = image.fread( &quick_data[0], quick_length);
|
||||
if (read_ != quick_length)
|
||||
{
|
||||
image.seterror(IMAGE_ERROR_INVALIDIMAGE, "Cannot read the file");
|
||||
image.message(" Cannot read the file");
|
||||
}
|
||||
else
|
||||
{
|
||||
quick_addr = quick_data[0x12] * 256 + quick_data[0x11];
|
||||
quick_length = quick_data[0x14] * 256 + quick_data[0x13] - quick_addr + 0x81;
|
||||
if (image.length() != quick_length)
|
||||
{
|
||||
image.seterror(IMAGE_ERROR_INVALIDIMAGE, "Invalid file header");
|
||||
image.message(" Invalid file header");
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0x80; i < image.length(); i++)
|
||||
space.write_byte(quick_addr+i-0x80, quick_data[i]);
|
||||
|
||||
/* display a message about the loaded quickload */
|
||||
image.message(" Quickload: size=%04X : loaded at %04X",quick_length,quick_addr);
|
||||
|
||||
result = image_init_result::PASS;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
if (image.is_filetype("bin"))
|
||||
{
|
||||
quick_addr = 0xe000;
|
||||
if (quick_length > 0x8000)
|
||||
{
|
||||
image.seterror(IMAGE_ERROR_INVALIDIMAGE, "File too long");
|
||||
image.message(" File too long");
|
||||
}
|
||||
else
|
||||
{
|
||||
quick_data.resize(quick_length+1);
|
||||
u16 read_ = image.fread( &quick_data[0], quick_length);
|
||||
if (read_ != quick_length)
|
||||
{
|
||||
image.seterror(IMAGE_ERROR_INVALIDIMAGE, "Cannot read the file");
|
||||
image.message(" Cannot read the file");
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < image.length(); i++)
|
||||
space.write_byte(quick_addr+i, quick_data[i]);
|
||||
|
||||
/* display a message about the loaded quickload */
|
||||
image.message(" Quickload: size=%04X : loaded at %04X",quick_length,quick_addr);
|
||||
|
||||
result = image_init_result::PASS;
|
||||
m_maincpu->set_pc(quick_addr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/* Video */
|
||||
|
||||
uint32_t jtc_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
@ -737,19 +818,21 @@ MACHINE_CONFIG_START(jtc_state::basic)
|
||||
MCFG_Z8_PORT_P3_READ_CB(READ8(*this, jtc_state, p3_r))
|
||||
MCFG_Z8_PORT_P3_WRITE_CB(WRITE8(*this, jtc_state, p3_w))
|
||||
|
||||
/* cassette */
|
||||
MCFG_CASSETTE_ADD( "cassette" )
|
||||
MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED)
|
||||
|
||||
/* sound hardware */
|
||||
SPEAKER(config, "mono").front_center();
|
||||
SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.25);
|
||||
|
||||
WAVE(config, "wave", "cassette").add_route(1, "mono", 0.25);
|
||||
|
||||
/* cassette */
|
||||
MCFG_CASSETTE_ADD("cassette")
|
||||
MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED)
|
||||
WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.05);
|
||||
|
||||
/* printer */
|
||||
MCFG_DEVICE_ADD(m_centronics, CENTRONICS, centronics_devices, "printer")
|
||||
MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(*this, jtc_state, write_centronics_busy))
|
||||
|
||||
/* quickload */
|
||||
MCFG_QUICKLOAD_ADD("quickload", jtc_state, jtc, "jtc,bin", 2)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
MACHINE_CONFIG_START(jtc_state::jtc)
|
||||
|
Loading…
Reference in New Issue
Block a user