Previous 199869 Revisions Next

r26092 Sunday 10th November, 2013 at 19:26:21 UTC by Jürgen Buchmüller
Overriding the device_memory_interface doesn't help either.
[/branches/alto2/src/emu/cpu/alto2]alto2.c alto2.h
[/branches/alto2/src/mess/drivers]alto2.c

branches/alto2/src/emu/cpu/alto2/alto2.c
r26091r26092
6464   m_log_level(9),
6565   m_log_newline(true),
6666#endif
67   m_ucode_config("ucode", ENDIANNESS_BIG, 32, 14, -2),
67   m_ucode_config("maincpu", ENDIANNESS_BIG, 32, 14, -2),
6868   m_const_config("const", ENDIANNESS_BIG, 16, 8, -1),
6969   m_ucode(0),
7070   m_const(0),
71   m_ucode_map(*this, "ucode"),
72   m_const_map(*this, "const"),
71   m_ucode_map(*this, "^maincpu"),
72   m_const_map(*this, "^const"),
7373   m_icount(0),
7474   m_task_mpc(),
7575   m_task_next2(),
r26091r26092
152152//-------------------------------------------------
153153
154154ROM_START( alto2_cpu )
155   // decoded micro code region
156   ROM_REGION( 16 * 02000, "ucode", 0 )
157
158   // decoded constant PROMs region
159   ROM_REGION( 4 * 00400, "const", 0 )
160
161   // 2 x 64K x 39 bit memory
162   ROM_REGION( 2*ALTO2_RAM_SIZE, "memory", 0 )
163
164155   ROM_REGION( 16 * 02000, "ucode_proms", 0 )
165156   ROM_LOAD( "55x.3",     0*02000, 0x400, CRC(de870d75) SHA1(2b98cc769d8302cb39948711424d987d94e4159b) )   //!< 00000-01777 RSEL(0)',RSEL(1)',RSEL(2)',RSEL(3)'
166157   ROM_LOAD( "64x.3",     1*02000, 0x400, CRC(51b444c0) SHA1(8756e51f7f3253a55d75886465beb7ee1be6e1c4) )   //!< 00000-01777 RSEL(4)',ALUF(0)',ALUF(1)',ALUF(2)'
r26091r26092
254245   return ROM_NAME( alto2_cpu );
255246}
256247
248//-------------------------------------------------
249// device_memory_interface overrides
250//-------------------------------------------------
251
252bool alto2_cpu_device::memory_read(address_spacenum spacenum, offs_t offset, int size, UINT64 &value)
253{
254//   printf("%s: spacenum=%d offset=%#x size=%d\n", __FUNCTION__, int(spacenum), unsigned(offset), size);
255   switch (spacenum) {
256   case AS_0:
257      switch (size) {
258      case 1:
259         value = m_ucode_proms[offset];
260         return true;
261      case 2:
262         value = m_ucode_proms[offset+0] | (m_ucode_proms[offset+1] << 8);
263         return true;
264      case 4:
265         value = m_ucode_proms[offset+0] |
266               (m_ucode_proms[offset+1] << 8) |
267               (m_ucode_proms[offset+2] << 16) |
268               (m_ucode_proms[offset+3] << 24);
269         return true;
270      }
271      return false;
272   case AS_1:
273      switch (size) {
274      case 1:
275         value = m_const_proms[offset];
276         return true;
277      case 2:
278         value = m_const_proms[offset+0] | (m_ucode_proms[offset+1] << 8);
279         return true;
280      }
281      return false;
282   default:
283      return false;
284   }
285}
286
287bool alto2_cpu_device::memory_write(address_spacenum spacenum, offs_t offset, int size, UINT64 value)
288{
289//   printf("%s: spacenum=%d offset=%#x size=%d\n", __FUNCTION__, int(spacenum), unsigned(offset), size);
290   switch (spacenum) {
291   case AS_0:
292      switch (size) {
293      case 1:
294         m_ucode_proms[offset] = value;
295         return true;
296      case 2:
297         m_ucode_proms[offset+0] = value;
298         m_ucode_proms[offset+1] = value >> 8;
299         return true;
300      case 4:
301         m_ucode_proms[offset+0] = value;
302         m_ucode_proms[offset+1] = value >> 8;
303         m_ucode_proms[offset+2] = value >> 16;
304         m_ucode_proms[offset+3] = value >> 24;
305         return true;
306      }
307      return false;
308   case AS_1:
309      switch (size) {
310      case 1:
311         m_const_proms[offset] = value;
312         return true;
313      case 2:
314         m_const_proms[offset+0] = value;
315         m_ucode_proms[offset+1] = value >> 8;
316         return true;
317      }
318      return false;
319   default:
320      return false;
321   }
322}
323
324
257325/**
258326 * @brief list of microcode PROM loading options
259327 */
r26091r26092
861929
862930   m_ucode_proms = prom_load(ucode_prom_list, memregion("ucode_proms")->base(), ALTO2_UCODE_ROM_PAGES, 8);
863931   m_const_proms = prom_load(const_prom_list, memregion("const_proms")->base(), 1, 4);
864
865   for (offs_t offs = 0; offs < ALTO2_UCODE_RAM_BASE; offs++) {
866      UINT32 data = (m_ucode_proms[4*offs+0] << 0) | (m_ucode_proms[4*offs+1] << 8) |
867             (m_ucode_proms[4*offs+2] << 16) | (m_ucode_proms[4*offs+3] << 24);
868      if (0 == offs % 8)
869         printf("%04x:", offs);
870      printf(" %08x",  data);
871      if (7 == offs % 8)
872         printf("\n");
873      m_ucode->write_dword(offs, data);
874   }
875   for (offs_t offs = 0; offs < ALTO2_CONST_SIZE; offs++) {
876      UINT32 data = (m_const_proms[2*offs+0] << 0) | (m_const_proms[2*offs+1] << 8);
877      if (0 == offs % 8)
878         printf("%04x:", offs);
879      printf(" %04x",  data);
880      if (7 == offs % 8)
881         printf("\n");
882      m_const->write_word(offs, data);
883   }
884
885932   m_disp_a38 = prom_load(&pl_displ_a38, memregion("displ_a38")->base());
886933   m_disp_a63 = prom_load(&pl_displ_a63, memregion("displ_a63")->base());
887934   m_disp_a66 = prom_load(&pl_displ_a66, memregion("displ_a66")->base());
r26091r26092
11121159// FIXME
11131160void alto2_cpu_device::device_reset()
11141161{
1162   for (offs_t offs = 0; offs < ALTO2_UCODE_RAM_BASE; offs++) {
1163      UINT32 data = (m_ucode_proms[4*offs+0] << 0) | (m_ucode_proms[4*offs+1] << 8) |
1164             (m_ucode_proms[4*offs+2] << 16) | (m_ucode_proms[4*offs+3] << 24);
1165      if (0 == offs % 8)
1166         printf("%04x:", offs);
1167      printf(" %08x",  data);
1168      if (7 == offs % 8)
1169         printf("\n");
1170   }
1171   for (offs_t offs = 0; offs < ALTO2_CONST_SIZE; offs++) {
1172      UINT32 data = (m_const_proms[2*offs+0] << 0) | (m_const_proms[2*offs+1] << 8);
1173      if (0 == offs % 8)
1174         printf("%04x:", offs);
1175      printf(" %04x",  data);
1176      if (7 == offs % 8)
1177         printf("\n");
1178   }
1179
11151180   soft_reset();
11161181}
11171182
branches/alto2/src/emu/cpu/alto2/alto2.h
r26091r26092
235235
236236   //! device (P)ROMs
237237   virtual const rom_entry *device_rom_region() const;
238
238   //! device_memory_interface overrides
239   virtual bool memory_read(address_spacenum spacenum, offs_t offset, int size, UINT64 &value);
240   virtual bool memory_write(address_spacenum spacenum, offs_t offset, int size, UINT64 value);
239241   //! device_state_interface overrides
240242   void state_string_export(const device_state_entry &entry, astring &string);
241243
branches/alto2/src/mess/drivers/alto2.c
r26091r26092
4343/* Memory Maps */
4444
4545static ADDRESS_MAP_START( alto2_ucode_map, AS_PROGRAM, 32, alto2_state )
46   ADDRESS_MAP_UNMAP_HIGH
4647   AM_RANGE(0,                    ALTO2_UCODE_RAM_BASE-1) AM_ROM
4748   AM_RANGE(ALTO2_UCODE_RAM_BASE, ALTO2_UCODE_SIZE-1)     AM_RAM
4849ADDRESS_MAP_END
4950
5051static ADDRESS_MAP_START( alto2_const_map, AS_DATA, 16, alto2_state )
52   ADDRESS_MAP_UNMAP_HIGH
5153   AM_RANGE(0,                    ALTO2_CONST_SIZE-1)     AM_ROM
5254ADDRESS_MAP_END
5355
5456/* main memory and memory mapped i/o in range ALTO2_IO_PAGE_BASE ... ALTO2_IO_PAGE_BASE + ALTO2_IO_PAGE_SIZE - 1 */
5557static ADDRESS_MAP_START( alto2_ram_map, AS_IO, 16, alto2_state )
58   ADDRESS_MAP_UNMAP_HIGH
5659   AM_RANGE(0,                    ALTO2_IO_PAGE_BASE - 1) AM_READWRITE(alto2_ram_r,  alto2_ram_w)
5760   AM_RANGE(ALTO2_IO_PAGE_BASE,   0177777)                AM_READWRITE(alto2_mmio_r, alto2_mmio_w)
5861ADDRESS_MAP_END
r26091r26092
260263/* ROM */
261264ROM_START( alto2 )
262265   // decoded micro code region
263   ROM_REGION( ALTO2_RAM_SIZE, "maincpu", 0 )
264   // 2 x 64K x 39 bit memory
265   ROM_REGION( 2*ALTO2_RAM_SIZE, "memory", 0 )
266   ROM_REGION( sizeof(UINT32)*ALTO2_UCODE_SIZE, "maincpu", 0 )
267   // decoded constant PROMs region
268   ROM_REGION( sizeof(UINT16)*ALTO2_CONST_SIZE, "const", 0 )
266269ROM_END
267270
268271/* Palette Initialization */

Previous 199869 Revisions Next


© 1997-2024 The MAME Team