Previous 199869 Revisions Next

r36310 Saturday 7th March, 2015 at 21:42:07 UTC by hap
fix MR and pattern offsets
[src/emu/cpu/hmcs40]hmcs40.c hmcs40op.inc
[src/mess/drivers]hh_hmcs40.c

trunk/src/emu/cpu/hmcs40/hmcs40.c
r244821r244822
6767// internal memory maps
6868static ADDRESS_MAP_START(program_1k, AS_PROGRAM, 16, hmcs40_cpu_device)
6969   AM_RANGE(0x0000, 0x03ff) AM_ROM
70   AM_RANGE(0x0400, 0x043f) AM_ROM
70   AM_RANGE(0x0780, 0x07bf) AM_ROM // patterns on page 30
7171ADDRESS_MAP_END
7272
7373static ADDRESS_MAP_START(program_2k, AS_PROGRAM, 16, hmcs40_cpu_device)
7474   AM_RANGE(0x0000, 0x07ff) AM_ROM
75   AM_RANGE(0x0800, 0x087f) AM_ROM
75   AM_RANGE(0x0f40, 0x0fbf) AM_ROM // patterns on page 61,62
7676ADDRESS_MAP_END
7777
7878
trunk/src/emu/cpu/hmcs40/hmcs40op.inc
r244821r244822
44
55inline UINT8 hmcs40_cpu_device::ram_r()
66{
7   UINT16 address = (m_x << 4 | m_y) & m_datamask;
7   UINT8 address = (m_x << 4 | m_y) & m_datamask;
88   return m_data->read_byte(address) & 0xf;
99}
1010
1111inline void hmcs40_cpu_device::ram_w(UINT8 data)
1212{
13   UINT16 address = (m_x << 4 | m_y) & m_datamask;
13   UINT8 address = (m_x << 4 | m_y) & m_datamask;
1414   m_data->write_byte(address, data & 0xf);
1515}
1616
r244821r244822
7575   // XAMR m: Exchange A and MR(m)
7676   
7777   // determine MR(Memory Register) location
78   UINT8 y = m_op & 0xf;
79   UINT8 x = (y > 3) ? 0xf : (y + 12);
80   UINT16 address = (x << 4 | y) & m_datamask;
78   UINT8 address = m_op & 0xf;
8179   
80   // HMCS42: MR0 on file 0, MR4-MR15 on file 4 (there is no file 1-3)
81   // HMCS43: MR0-MR3 on file 0-3, MR4-MR15 on file 4
82   if (m_family == FAMILY_HMCS42 || m_family == FAMILY_HMCS43)
83      address |= (address < 4) ? (address << 4) : 0x40;
84   
85   // HMCS44/45/46/47: all on last file
86   else
87      address |= 0xf0;
88   
89   address &= m_datamask;
8290   UINT8 old_a = m_a;
8391   m_a = m_data->read_byte(address) & 0xf;
8492   m_data->write_byte(address, old_a & 0xf);
trunk/src/mess/drivers/hh_hmcs40.c
r244821r244822
208208READ16_MEMBER(hh_hmcs40_state::alnattck_d_r)
209209{
210210   // D5: inputs
211   return (offset == 5) ? (read_inputs(7) << 5 & 0x20) : 0;
211   return (read_inputs(7) & 1) << 5;
212212}
213213
214214WRITE16_MEMBER(hh_hmcs40_state::alnattck_d_w)
r244821r244822
321321***************************************************************************/
322322
323323ROM_START( alnattck )
324   ROM_REGION( 0x1100, "maincpu", 0 )
325   ROM_LOAD( "hd38800a25", 0x0000, 0x1100, CRC(18b50869) SHA1(11e9d5f7b4ae818b077b0ee14a3b43190e20bff3) )
324   ROM_REGION( 0x2000, "maincpu", ROMREGION_ERASE00 )
325   ROM_LOAD( "hd38800a25", 0x0000, 0x1000, CRC(18b50869) SHA1(11e9d5f7b4ae818b077b0ee14a3b43190e20bff3) )
326   ROM_CONTINUE(           0x1e80, 0x0100 )
326327ROM_END
327328
328329
329330ROM_START( tmtron )
330   ROM_REGION( 0x1100, "maincpu", 0 )
331   ROM_LOAD( "hd38800a88", 0x0000, 0x1100, CRC(33db9670) SHA1(d6f747a59356526698784047bcfdbb59e79b9a23) )
331   ROM_REGION( 0x2000, "maincpu", ROMREGION_ERASE00 )
332   ROM_LOAD( "hd38800a88", 0x0000, 0x1000, CRC(33db9670) SHA1(d6f747a59356526698784047bcfdbb59e79b9a23) )
333   ROM_CONTINUE(           0x1e80, 0x0100 )
332334ROM_END
333335
334336


Previous 199869 Revisions Next


© 1997-2024 The MAME Team