Previous 199869 Revisions Next

r26353 Friday 22nd November, 2013 at 10:50:06 UTC by Jürgen Buchmüller
Add reset_... methods to all sub-devices and call them at soft_reset() time. TODO: read ioport(CONFIG) flags.
[/branches/alto2/src/emu/cpu/alto2]a2curt.c a2curt.h a2dht.c a2dht.h a2disk.c a2disk.h a2disp.c a2disp.h a2dvt.c a2dvt.h a2dwt.c a2dwt.h a2emu.c a2emu.h a2ether.c a2ether.h a2hw.c a2hw.h a2kbd.c a2kbd.h a2ksec.c a2ksec.h a2kwd.c a2kwd.h a2mem.c a2mem.h a2mouse.c a2mouse.h a2mrt.c a2mrt.h a2part.c a2part.h a2ram.c a2ram.h alto2cpu.c alto2cpu.h
[/branches/alto2/src/mess/drivers]alto2.c

branches/alto2/src/emu/cpu/alto2/a2hw.c
r26352r26353
88 *
99 *****************************************************************************/
1010#include "alto2cpu.h"
11#include "a2roms.h"
1112
1213/**
1314 * @brief read printer paper ready bit
r26352r26353
315316}
316317
317318/**
319 * <PRE>
320 * TODO: use madr.a65 and madr.a64 to determine the actual I/O address ranges
321 *
322 * madr.a65
323 *   address   line   connected to
324 *   -------------------------------
325 *   A0      MAR[11]
326 *   A1      KEYSEL
327 *   A2      MAR[7-10] == 0
328 *   A3      MAR[12]
329 *   A4      MAR[13]
330 *   A5      MAR[14]
331 *   A6      MAR[15]
332 *   A7      IOREF (MAR[0-6] == 1)
333 *
334 *   output data   connected to
335 *   -------------------------------
336 *   D0      IOSEL0
337 *   D1      IOSEL1
338 *   D2      IOSEL2
339 *   D3      INTIO
340 *
341 * madr.a64
342 *   address   line   connected to
343 *   -------------------------------
344 *   A0      STORE
345 *   A1      MAR[11]
346 *   A2      MAR[7-10] == 0
347 *   A3      MAR[12]
348 *   A4      MAR[13]
349 *   A5      MAR[14]
350 *   A6      MAR[15]
351 *   A7      IOREF (MAR[0-6] == 1)
352 *
353 *   output data   connected to
354 *   -------------------------------
355 *   D0      & MISYSCLK -> SELP
356 *   D1      ^ INTIO -> INTIOX
357 *   "      ^ 1 -> NERRSEL
358 *   "      & WRTCLK -> NRSTE
359 *   D2      XREG'
360 *   D3      & MISYSCLK -> LOADERC
361 * </PRE>
362 */
363
364static const prom_load_t pl_madr_a64 =
365{
366   "madr.a64",
367   0,
368   "a66b0eda",
369   "4d9088f592caa3299e90966b17765be74e523144",
370   /* size */   0400,
371   /* amap */   AMAP_DEFAULT,
372   /* axor */   0,
373   /* dxor */   017,                  // invert D0-D3
374   /* width */   4,
375   /* shift */   0,
376   /* dmap */   DMAP_DEFAULT,
377   /* dand */   ZERO,
378   /* type */   sizeof(UINT8)
379};
380
381static const prom_load_t pl_madr_a65 =
382{
383   "madr.a65",
384   0,
385   "ba37febd",
386   "82e9db1cb65f451755295f0d179e6f8fe3349d4d",
387   /* size */   0400,
388   /* amap */   AMAP_DEFAULT,
389   /* axor */   0,
390   /* dxor */   017,                  // invert D0-D3
391   /* width */   4,
392   /* shift */   0,
393   /* dmap */   DMAP_DEFAULT,
394   /* dand */   ZERO,
395   /* type */   sizeof(UINT8)
396};
397
398/**
318399 * @brief clear all keys and install the mmio handler for KBDAD to KBDAD+3
319400 */
320401void alto2_cpu_device::init_hw()
321402{
322403   memset(&m_hw, 0, sizeof(m_hw));
404   m_madr_a64 = prom_load(machine(), &pl_madr_a64, memregion("madr_a64")->base());
405   m_madr_a65 = prom_load(machine(), &pl_madr_a65, memregion("madr_a65")->base());
406}
323407
324   // open inputs on UTILIN
325   m_hw.utilin = 0177777;
408void alto2_cpu_device::exit_hw()
409{
410   // nothing to do yet
411}
326412
413void alto2_cpu_device::reset_hw()
414{
415   m_hw.eia = 0;
416   m_hw.utilout = 0;
327417   // open inputs on the XBUS (?)
328418   m_hw.xbus[0] = 0177777;
329419   m_hw.xbus[1] = 0177777;
330420   m_hw.xbus[2] = 0177777;
331421   m_hw.xbus[3] = 0177777;
422   // open inputs on UTILIN
423   m_hw.utilin = 0177777;
332424}
333
334void alto2_cpu_device::exit_hw()
335{
336   // nothing to do yet
337}
338
branches/alto2/src/emu/cpu/alto2/a2mem.c
r26352r26353
782782 */
783783void alto2_cpu_device::init_memory()
784784{
785    memset(&m_mem, 0, sizeof(m_mem));
785   memset(&m_mem, 0, sizeof(m_mem));
786}
786787
787#if   0   // can't read ioport() at this time
788   // allocate 64KB or 128KB of main memory
789   m_mem.size = ioport("CONFIG")->read() & 1 ? ALTO2_RAM_SIZE : 2 * ALTO2_RAM_SIZE;
790#else
791   m_mem.size = 2 * ALTO2_RAM_SIZE;
792#endif
793   printf("main memory %u KB\n", m_mem.size / 1024);
794   m_mem.ram = auto_alloc_array_clear(machine(), UINT32, sizeof(UINT16) * m_mem.size);
795   m_mem.hpb = auto_alloc_array_clear(machine(), UINT8,  sizeof(UINT16) * m_mem.size);
796
797   /**
798    * <PRE>
799    * TODO: use madr.a65 and madr.a64 to determine the actual I/O address ranges
800    *
801    * madr.a65
802    *   address   line   connected to
803    *   -------------------------------
804    *   A0      MAR[11]
805    *   A1      KEYSEL
806    *   A2      MAR[7-10] == 0
807    *   A3      MAR[12]
808    *   A4      MAR[13]
809    *   A5      MAR[14]
810    *   A6      MAR[15]
811    *   A7      IOREF (MAR[0-6] == 1)
812    *
813    *   output data   connected to
814    *   -------------------------------
815    *   D0      IOSEL0
816    *   D1      IOSEL1
817    *   D2      IOSEL2
818    *   D3      INTIO
819    *
820    * madr.a64
821    *   address   line   connected to
822    *   -------------------------------
823    *   A0      STORE
824    *   A1      MAR[11]
825    *   A2      MAR[7-10] == 0
826    *   A3      MAR[12]
827    *   A4      MAR[13]
828    *   A5      MAR[14]
829    *   A6      MAR[15]
830    *   A7      IOREF (MAR[0-6] == 1)
831    *
832    *   output data   connected to
833    *   -------------------------------
834    *   D0      & MISYSCLK -> SELP
835    *   D1      ^ INTIO -> INTIOX
836    *   "      ^ 1 -> NERRSEL
837    *   "      & WRTCLK -> NRSTE
838    *   D2      XREG'
839    *   D3      & MISYSCLK -> LOADERC
840    * </PRE>
841    */
842
843#if   ALTO2_HAMMING_CHECK
844   // Initialize the hamming codes and parity bit
845   for (UINT32 addr = 0; addr < ALTO2_IO_PAGE_BASE; addr++) {
846      hamming_code(1, addr, 0);
847      hamming_code(1, 0200000 + addr, 0);
788void alto2_cpu_device::exit_memory()
789{
790   if (m_mem.ram) {
791      auto_free(machine(), m_mem.ram);
792      m_mem.ram = 0;
848793   }
849#endif
794   if (m_mem.hpb) {
795      auto_free(machine(), m_mem.hpb);
796      m_mem.hpb = 0;
797   }
850798}
851799
852void alto2_cpu_device::exit_memory()
800void alto2_cpu_device::reset_memory()
853801{
854802   if (m_mem.ram) {
855803      auto_free(machine(), m_mem.ram);
r26352r26353
859807      auto_free(machine(), m_mem.hpb);
860808      m_mem.hpb = 0;
861809   }
810   // allocate 64K or 128K words of main memory
811   ioport_port* config = ioport("CONFIG");
812   if (config)
813      m_mem.size = config->read() & 1 ? ALTO2_RAM_SIZE : 2 * ALTO2_RAM_SIZE;
814   else
815      m_mem.size = ALTO2_RAM_SIZE;
816   logerror("Main memory %u KiB\n", static_cast<UINT32>(sizeof(UINT16) * m_mem.size / 1024));
817
818   m_mem.ram = auto_alloc_array_clear(machine(), UINT32, sizeof(UINT16) * m_mem.size);
819   m_mem.hpb = auto_alloc_array_clear(machine(), UINT8,  sizeof(UINT16) * m_mem.size);
820
821#if   ALTO2_HAMMING_CHECK
822   // Initialize the hamming codes and parity bit
823   for (UINT32 addr = 0; addr < ALTO2_IO_PAGE_BASE; addr++) {
824      hamming_code(1, addr, 0);
825      hamming_code(1, 0200000 + addr, 0);
826   }
827#endif
828   m_mem.mar = 0;
829   m_mem.rmdd = 0;
830   m_mem.wmdd = 0;
831   m_mem.md = 0;
832   m_mem.cycle = 0;
833   m_mem.access = 0;
834   m_mem.error = 0;
835   m_mem.mear = 0;
836   m_mem.mesr = 0;
837   m_mem.mecr = 0;
862838}
branches/alto2/src/emu/cpu/alto2/a2ram.c
r26352r26353
431431   // nothing to do yet
432432}
433433
434void alto2_cpu_device::reset_ram()
435{
436   m_rdram_flag = false;
437   m_wrtram_flag = false;
438   m_m = 0;
439   memset(m_s, 0, sizeof(m_s));
440}
441
442
branches/alto2/src/emu/cpu/alto2/a2curt.h
r26352r26353
2525void activate_curt();                     //!< curt_activate: called by the CPU when the cursor task becomes active
2626void init_curt(int task = task_curt);          //!< initialize cursor task
2727void exit_curt();                        //!< deinitialize cursor task
28void reset_curt();                        //!< reset cursor task
2829#endif // _A2CURT_H_
2930#endif   // ALTO2_DEFINE_CONSTANTS
branches/alto2/src/emu/cpu/alto2/a2mem.h
r26352r26353
6464 * @return false, if memory address can be loaded
6565 */
6666inline bool check_mem_load_mar_stall(UINT8 rsel) {
67    if (ALTO2_MEM_NONE == m_mem.access)
68        return false;
69    return cycle() < m_mem.cycle+5;
67   if (ALTO2_MEM_NONE == m_mem.access)
68      return false;
69   return cycle() < m_mem.cycle+5;
7070}
7171
7272/**
r26352r26353
8282 * @return false, if memory can be read without wait cycle
8383 */
8484inline bool check_mem_read_stall() {
85    if (ALTO2_MEM_NONE == m_mem.access)
86        return false;
87    return cycle() < m_mem.cycle+4;
85   if (ALTO2_MEM_NONE == m_mem.access)
86      return false;
87   return cycle() < m_mem.cycle+4;
8888}
8989
9090/**
r26352r26353
9999 * @return false, if memory can be written without wait cycle
100100 */
101101inline bool check_mem_write_stall() {
102    if (ALTO2_MEM_NONE == m_mem.access)
103        return false;
104    return cycle() < m_mem.cycle+2;
102   if (ALTO2_MEM_NONE == m_mem.access)
103      return false;
104   return cycle() < m_mem.cycle+2;
105105}
106106
107107
r26352r26353
136136
137137void init_memory();                        //!< initialize the memory system
138138void exit_memory();                        //!< deinitialize the memory system
139void reset_memory();                     //!< reset the memory system
139140#endif // _A2MEM_H_
140141#endif   // ALTO2_DEFINE_CONSTANTS
branches/alto2/src/emu/cpu/alto2/a2hw.h
r26352r26353
6363
6464void init_hw();                        //!< initialize miscellaneous hardware
6565void exit_hw();                        //!< deinitialize miscellaneous hardware
66void reset_hw();                     //!< reset miscellaneous hardware
6667#endif   // _A2HW_H_
6768#endif   // ALTO2_DEFINE_CONSTANTS
branches/alto2/src/emu/cpu/alto2/a2ram.h
r26352r26353
5050
5151//!< F1 functions for RAM related tasks
5252enum {
53    f1_ram_swmode      = f1_task_10,          //!< f1 10: switch mode to CROM/CRAM in same page
54    f1_ram_wrtram      = f1_task_11,          //!< f1 11: start WRTRAM cycle
55    f1_ram_rdram      = f1_task_12,          //!< f1 12: start RDRAM cycle
53   f1_ram_swmode      = f1_task_10,          //!< f1 10: switch mode to CROM/CRAM in same page
54   f1_ram_wrtram      = f1_task_11,          //!< f1 11: start WRTRAM cycle
55   f1_ram_rdram      = f1_task_12,          //!< f1 12: start RDRAM cycle
5656#if   (ALTO2_UCODE_RAM_PAGES == 3)
57    f1_ram_load_rmr      = f1_task_13,          //!< f1 13: load the reset mode register
57   f1_ram_load_rmr      = f1_task_13,          //!< f1 13: load the reset mode register
5858#else   // ALTO2_UCODE_RAM_PAGES != 3
59    f1_ram_load_srb      = f1_task_13           //!< f1 14: load the S register bank from BUS[12-14]
59   f1_ram_load_srb      = f1_task_13           //!< f1 14: load the S register bank from BUS[12-14]
6060#endif
6161};
6262
r26352r26353
7474void f1_late_load_srb();                  //!< F1 func: load the S register bank from BUS[12-14]
7575#endif
7676void init_ram(int task);                  //!< called by RAM related tasks
77void exit_ram();
77void exit_ram();                        //!< deinitialize the RAM related tasks
78void reset_ram();                        //!< reset the RAM related tasks
7879#endif // A2RAM_H
7980#endif   // ALTO2_DEFINE_CONSTANTS
branches/alto2/src/emu/cpu/alto2/a2kwd.c
r26352r26353
4848   // nothing to do yet
4949}
5050
51
51void alto2_cpu_device::reset_kwd()
52{
53   // nothing to do yet
54}
branches/alto2/src/emu/cpu/alto2/a2ksec.c
r26352r26353
5050   // nothing to do yet
5151}
5252
53void alto2_cpu_device::reset_ksec()
54{
55   // nothing to do yet
56}
branches/alto2/src/emu/cpu/alto2/a2emu.c
r26352r26353
707707   // nothing to do yet
708708}
709709
710void alto2_cpu_device::reset_emu()
711{
712   m_emu.ir = 0;
713   m_emu.skip = 0;
714   m_emu.cy = 0;
715}
branches/alto2/src/emu/cpu/alto2/a2mouse.c
r26352r26353
262262{
263263   // nothing to do yet
264264}
265
266void alto2_cpu_device::reset_mouse()
267{
268   m_mouse.x = 0;
269   m_mouse.y = 0;
270   m_mouse.dx = 0;
271   m_mouse.dy = 0;
272   m_mouse.latch = 0;
273   m_mouse.phase = 0;
274}
branches/alto2/src/emu/cpu/alto2/a2kwd.h
r26352r26353
4444};
4545
4646void f1_early_kwd_block();                  //!< F1 func: disable the disk word task
47void init_kwd(int task = task_kwd);            //!< initialize disk word task
48void exit_kwd();                        //!< deinitialize disk word task
47void init_kwd(int task = task_kwd);            //!< initialize the disk word task
48void exit_kwd();                        //!< deinitialize the disk word task
49void reset_kwd();                        //!< reset the disk word task
4950#endif // _A2KWD_H_
5051#endif   // ALTO2_DEFINE_CONSTANTS
branches/alto2/src/emu/cpu/alto2/a2ksec.h
r26352r26353
4343};
4444
4545void f1_early_ksec_block(void);                 //!< block ksec task
46void init_ksec(int task = task_ksec);         //!< initialize disk sector task
47void exit_ksec();                        //!< deinitialize disk sector task
46void init_ksec(int task = task_ksec);         //!< initialize the disk sector task
47void exit_ksec();                        //!< deinitialize the disk sector task
48void reset_ksec();                        //!< reset the disk sector task
4849#endif // _A2KSEC_H_
4950#endif   // ALTO2_DEFINE_CONSTANTS
branches/alto2/src/emu/cpu/alto2/a2emu.h
r26352r26353
6464void f2_late_idisp();                     //!< F2 func: branch on: arithmetic IR_SH, others PROM ctl2k_u3[IR[1-7]]
6565void f2_early_acsource();                  //!< F2 func: modify RSELECT with SrcAC = (3 - IR[1-2])
6666void f2_late_acsource();                  //!< F2 func: branch on arithmetic IR_SH, others PROM ctl2k_u3[IR[1-7]]
67void init_emu(int task = task_emu);            //!< initialize emulator task
68void exit_emu();                        //!< deinitialize emulator task
67void init_emu(int task = task_emu);            //!< initialize the emulator task
68void exit_emu();                        //!< deinitialize the emulator task
69void reset_emu();                        //!< reset the emulator task
6970#endif // _A2EMU_H_
7071#endif   // ALTO2_DEFINE_CONSTANTS
branches/alto2/src/emu/cpu/alto2/a2mouse.h
r26352r26353
6666}   m_mouse;
6767
6868UINT16 mouse_read();                     //!< return the mouse motion flags
69void init_mouse();                        //!< initialize the mouse context to useful values
70void exit_mouse();                        //!< deinitialize the mouse
69void init_mouse();                        //!< initialize the mouse context
70void exit_mouse();                        //!< deinitialize the mouse context
71void reset_mouse();                        //!< reset the mouse context
7172#endif   // _A2MOUSE_H_
7273#endif   // ALTO2_DEFINE_CONSTANTS
branches/alto2/src/emu/cpu/alto2/a2dwt.c
r26352r26353
5454{
5555   // nothing to do yet
5656}
57
58void alto2_cpu_device::reset_dwt()
59{
60   m_dsp.dwt_blocks = false;
61   memset(m_dsp.fifo, 0, sizeof(m_dsp.fifo));
62   m_dsp.fifo_wr = 0;
63   m_dsp.fifo_rd = 0;
64}
branches/alto2/src/emu/cpu/alto2/a2kbd.c
r26352r26353
4949void alto2_cpu_device::init_kbd(UINT16 bootkey)
5050{
5151   m_kbd.bootkey = bootkey;
52   m_kbd.matrix[0] = 0177777;
53   m_kbd.matrix[1] = 0177777;
54   m_kbd.matrix[2] = 0177777;
55   m_kbd.matrix[3] = 0177777;
5652}
5753
5854void alto2_cpu_device::exit_kbd()
r26352r26353
6056   // nothing to do yet
6157}
6258
59void alto2_cpu_device::reset_kbd()
60{
61   m_kbd.matrix[0] = 0177777;
62   m_kbd.matrix[1] = 0177777;
63   m_kbd.matrix[2] = 0177777;
64   m_kbd.matrix[3] = 0177777;
65}
branches/alto2/src/emu/cpu/alto2/a2dwt.h
r26352r26353
1515
1616//! F2 functions for display word task
1717enum {
18    f2_dwt_load_ddr      = f2_task_10            //!< f2 10: load display data register
18   f2_dwt_load_ddr      = f2_task_10            //!< f2 10: load display data register
1919};
2020
2121void f1_early_dwt_block();                  //!< F1 func: block the display word task
2222void f2_late_dwt_load_ddr();               //!< F2 func: load the display data register
23void init_dwt(int task = task_dwt);            //!< initialize display word task
24void exit_dwt();                        //!< deinitialize display word task
23void init_dwt(int task = task_dwt);            //!< initialize the display word task
24void exit_dwt();                        //!< deinitialize the display word task
25void reset_dwt();                        //!< reset the display word task
2526#endif  // _A2DWT_H_
2627#endif   // ALTO2_DEFINE_CONSTANTS
branches/alto2/src/emu/cpu/alto2/a2kbd.h
r26352r26353
106106
107107void init_kbd(UINT16 bootkey = 0177777);   //!< initialize the keyboard hardware, optinally set the boot key
108108void exit_kbd();                     //!< deinitialize the keyboard hardware
109void reset_kbd();                     //!< reset the keyboard hardware
109110#endif // _A2KBD_H_
110111#endif   // ALTO2_DEFINE_CONSTANTS
branches/alto2/src/emu/cpu/alto2/a2part.c
r26352r26353
1212//! called by the CPU when the parity task becomes active
1313void alto2_cpu_device::activate_part()
1414{
15   /* TODO: what do we do here ? */
1615   m_task_wakeup &= ~(1 << m_task);
1716}
1817
r26352r26353
2726   // nothing to do yet
2827}
2928
29void alto2_cpu_device::reset_part()
30{
31   // nothing to do yet
32}
33
34
branches/alto2/src/emu/cpu/alto2/a2ether.c
r26352r26353
808808   m_ether_a42 = prom_load(machine(), &pl_enet_a42, memregion("ether_a42")->base());
809809   m_ether_a49 = prom_load(machine(), &pl_enet_a49, memregion("ether_a49")->base());
810810
811   // FIXME: read configuration for m_eth.duckbreath enable
812   m_eth.duckbreath = m_duckbreath_sec;
813
814811   set_bs(task, bs_ether_eidfct,   &alto2_cpu_device::bs_early_eidfct,   0);
815812
816813   set_f1(task, f1_block,         &alto2_cpu_device::f1_early_eth_block, 0);
r26352r26353
846843   // nothing to do yet
847844}
848845
846//! delay between two duckbreaths in seconds
847static const int duckbreath_sec[8] = {
848   0, 5, 10, 15, 30, 60, 90, 120
849};
850void alto2_cpu_device::reset_ether()
851{
852   memset(m_eth.fifo, 0, sizeof(m_eth.fifo));
853   m_eth.fifo_rd = 0;
854   m_eth.fifo_wr = 0;
855   m_eth.status = 0;
856   m_eth.rx_crc = 0;
857   m_eth.tx_crc = 0;
858   m_eth.rx_count = 0;
859   m_eth.tx_count = 0;
860   m_eth.rx_timer->reset();
861   m_eth.tx_timer->reset();
862   ioport_port* config = ioport("CONFIG");
863   if (config)
864      m_eth.duckbreath = duckbreath_sec[(config->read() >> 4) & 7];
865   else
866      m_eth.duckbreath = 0;
867}
branches/alto2/src/emu/cpu/alto2/a2part.h
r26352r26353
1313#ifndef _A2PART_H_
1414#define _A2PART_H_
1515void activate_part();
16void init_part(int task = task_part);         //!< initialize parity task
17void exit_part();                        //!< deinitialize parity task
16void init_part(int task = task_part);         //!< initialize the parity task
17void exit_part();                        //!< deinitialize the parity task
18void reset_part();                        //!< reset the parity task
1819#endif // _A2PART_H_
1920#endif   // ALTO2_DEFINE_CONSTANTS
branches/alto2/src/emu/cpu/alto2/a2ether.h
r26352r26353
8484void f2_late_ecbfct();                     //!< F2 func: Ethernet countdown branch function
8585void f2_late_eisfct();                     //!< F2 func: Ethernet input start function
8686void activate_eth();                     //!< called by the CPU when the Ethernet task becomes active
87void init_ether(int task = task_ether);         //!< initialize ethernet task
88void exit_ether();                        //!< deinitialize ethernet task
87void init_ether(int task = task_ether);         //!< initialize the ethernet task
88void exit_ether();                        //!< deinitialize the ethernet task
89void reset_ether();                        //!< reset the ethernet task
8990#endif // _A2ETHER_H_
9091#endif   // ALTO2_DEFINE_CONSTANTS
branches/alto2/src/emu/cpu/alto2/a2dht.c
r26352r26353
1515void alto2_cpu_device::f1_early_dht_block()
1616{
1717   m_dsp.dht_blocks = true;
18   /* clear the wakeup for the display horizontal task */
18   // clear the wakeup for the display horizontal task
1919   m_task_wakeup &= ~(1 << m_task);
2020   LOG((LOG_DHT,2,"   BLOCK %s\n", task_name(m_task)));
2121}
r26352r26353
4141 */
4242void alto2_cpu_device::activate_dht()
4343{
44   /* TODO: what do we do here? */
4544   m_task_wakeup &= ~(1 << m_task);
4645}
4746
r26352r26353
6362   // nothing to do yet
6463}
6564
65void alto2_cpu_device::reset_dht()
66{
67   m_dsp.dht_blocks = true;
68   m_dsp.setmode = 0;
69}
branches/alto2/src/emu/cpu/alto2/a2dht.h
r26352r26353
2424void activate_dht();                     //!< called by the CPU when the display horizontal task becomes active
2525void init_dht(int task = task_dht);            //!< initialize display horizontal task
2626void exit_dht();                        //!< deinitialize display horizontal task
27void reset_dht();                        //!< reset the display horizontal task
2728#endif // _A2DHT_H_
2829#endif   // ALTO2_DEFINE_CONSTANTS
branches/alto2/src/emu/cpu/alto2/a2disk.c
r26352r26353
16901690}
16911691
16921692/**
1693 * @brief exit disk controller - free all timers
1693 * @brief exit disk controller - free all timers?
16941694 */
16951695void alto2_cpu_device::exit_disk()
16961696{
16971697   // nothing to do yet
16981698}
16991699
1700void alto2_cpu_device::reset_disk()
1701{
1702   m_dsk.drive = 0;
1703   m_dsk.kaddr = 0;
1704   m_dsk.kadr = 0;
1705   m_dsk.kstat = 0;
1706   m_dsk.kcom = 0;
1707   m_dsk.krecno = 0;
1708   m_dsk.egate = 1;
1709   m_dsk.wrgate = 1;
1710   m_dsk.rdgate = 1;
1711   m_dsk.shiftin = 0;
1712   m_dsk.shiftout = 0;
1713   m_dsk.datain = 0;
1714   m_dsk.dataout = 0;
1715   m_dsk.krwc = 0;
1716   m_dsk.kfer = 0;
1717   m_dsk.wdtskena = 1;
1718   m_dsk.wddone = 0;
1719   m_dsk.wdinit0 = 0;
1720   m_dsk.wdinit = 0;
1721   m_dsk.strobe = 0;
1722   m_dsk.strobon_timer->reset();
1723   m_dsk.bitclk = 0;
1724#if   USE_BITCLK_TIMER
1725   m_dsk.bitclk_timer->reset();
1726#else
1727   m_dsk.bitclk_time[0] = static_cast<int>(attotime::from_nsec(300).as_attoseconds() / 1000000);
1728   m_dsk.bitclk_time[1] = static_cast<int>(attotime::from_nsec(300).as_attoseconds() / 1000000);
1729#endif
1730   m_dsk.datin = 0;
1731   m_dsk.bitcount = 0;
1732   m_dsk.carry = 0;
1733   m_dsk.seclate = 0;
1734   m_dsk.seclate_timer->reset();
1735   m_dsk.seekok = 0;
1736   m_dsk.ok_to_run = 0;
1737   m_dsk.ok_to_run_timer->adjust(attotime::from_nsec(35 * ALTO2_UCYCLE / 1000), 1);
1738   m_dsk.ready_mf31a = 0;
1739   m_dsk.ready_timer->reset();
1740   m_dsk.seclate_mf31b = 0;
1741   m_dsk.ff_21a = JKFF_0;
1742   m_dsk.ff_21a_old = JKFF_0;
1743   m_dsk.ff_21b = JKFF_0;
1744   m_dsk.ff_22a = JKFF_0;
1745   m_dsk.ff_22b = JKFF_0;
1746   m_dsk.ff_43b = JKFF_0;
1747   m_dsk.ff_53a = JKFF_0;
1748   m_dsk.ff_43a = JKFF_0;
1749   m_dsk.ff_53b = JKFF_0;
1750   m_dsk.ff_44a = JKFF_0;
1751   m_dsk.ff_44b = JKFF_0;
1752   m_dsk.ff_45a = JKFF_0;
1753   m_dsk.ff_45b = JKFF_0;
1754
1755}
branches/alto2/src/emu/cpu/alto2/a2dvt.c
r26352r26353
4242   // nothing to do yet
4343}
4444
45void alto2_cpu_device::reset_dvt()
46{
47   // nothing to do yet
48}
branches/alto2/src/emu/cpu/alto2/a2disp.c
r26352r26353
528528   // nothing to do yet
529529}
530530
531void alto2_cpu_device::reset_disp()
532{
533   m_dsp.state = 020;
534   m_dsp.hlc = ALTO2_DISPLAY_HLC_START;
535   m_dsp.a63 = 0;
536   m_dsp.a66 = 0;
537   m_dsp.setmode = 0;
538   m_dsp.inverse = 0;
539   m_dsp.halfclock = 0;
540   m_dsp.clr = 0;
541   m_dsp.fifo_wr = 0;
542   m_dsp.fifo_rd = 0;
543   m_dsp.dht_blocks = false;
544   m_dsp.dwt_blocks = false;
545   m_dsp.curt_blocks = false;
546   m_dsp.curt_wakeup = false;
547   m_dsp.vblank = 0;
548   m_dsp.xpreg = 0;
549   m_dsp.csr = 0;
550   m_dsp.curword = 0;
551   m_dsp.curdata = 0;
552   memset(m_dsp.raw_bitmap, 0, sizeof(UINT16) * ALTO2_DISPLAY_HEIGHT * ALTO2_DISPLAY_SCANLINE_WORDS);
553   for (int y = 0; y < ALTO2_DISPLAY_HEIGHT; y++)
554      memset(m_dsp.scanline[y], 0, sizeof(UINT8) * ALTO2_DISPLAY_TOTAL_WIDTH);
555   m_dsp.odd_frame = false;
556}
557
531558/* Video update */
532559UINT32 alto2_cpu_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
533560{
branches/alto2/src/emu/cpu/alto2/a2disk.h
r26352r26353
102102void f2_late_swrnrdy();                     //!< F2 func: branch on the disk ready signal
103103void f2_late_nfer();                     //!< f2_nfer late: branch on the disk fatal error condition
104104void f2_late_strobon();                     //!< f2_strobon late: branch on the seek busy status
105void init_disk();                        //!< initialize the disk context
106void exit_disk();                        //!< deinitialize the disk context
105void init_disk();                        //!< initialize the disk controller
106void exit_disk();                        //!< deinitialize the disk controller
107void reset_disk();                        //!< reset the disk controller
107108#endif   // _A2DISK_H_
108109#endif   // ALTO2_DEFINE_CONSTANTS
branches/alto2/src/emu/cpu/alto2/a2mrt.c
r26352r26353
3636{
3737   // nothing to do yet
3838}
39
40void alto2_cpu_device::reset_mrt()
41{
42   // nothing to do yet
43}
branches/alto2/src/emu/cpu/alto2/a2dvt.h
r26352r26353
1515
1616//! F2 functions for display vertical task
1717enum {
18    f2_dvt_evenfield   = f2_task_10           //!< f2 10: load even field
18   f2_dvt_evenfield   = f2_task_10           //!< f2 10: load even field
1919};
2020
2121void f1_early_dvt_block();                  //!< F1 func: disable the display word task
2222void activate_dvt();                     //!< called by the CPU when the display vertical task becomes active
23void init_dvt(int task = task_dvt);            //!< initialize display vertical task
24void exit_dvt();                        //!< deinitialize display vertical task
23void init_dvt(int task = task_dvt);            //!< initialize the display vertical task
24void exit_dvt();                        //!< deinitialize the display vertical task
25void reset_dvt();                        //!< reset the display vertical task
2526#endif  // _A2DVT_H_
2627#endif   // ALTO2_DEFINE_CONSTANTS
branches/alto2/src/emu/cpu/alto2/a2disp.h
r26352r26353
294294
295295void init_disp();               //!< initialize the display context
296296void exit_disp();               //!< deinitialize the display context
297void reset_disp();               //!< reset the display context
297298
298299#endif   // _A2DISP_H_
299300#endif   // ALTO2_DEFINE_CONSTANTS
branches/alto2/src/emu/cpu/alto2/alto2cpu.c
r26352r26353
757757   /* type */   sizeof(UINT8)
758758};
759759
760static const prom_load_t pl_madr_a64 =
761{
762   "madr.a64",
763   0,
764   "a66b0eda",
765   "4d9088f592caa3299e90966b17765be74e523144",
766   /* size */   0400,
767   /* amap */   AMAP_DEFAULT,
768   /* axor */   0,
769   /* dxor */   017,                  // invert D0-D3
770   /* width */   4,
771   /* shift */   0,
772   /* dmap */   DMAP_DEFAULT,
773   /* dand */   ZERO,
774   /* type */   sizeof(UINT8)
775};
776
777static const prom_load_t pl_madr_a65 =
778{
779   "madr.a65",
780   0,
781   "ba37febd",
782   "82e9db1cb65f451755295f0d179e6f8fe3349d4d",
783   /* size */   0400,
784   /* amap */   AMAP_DEFAULT,
785   /* axor */   0,
786   /* dxor */   017,                  // invert D0-D3
787   /* width */   4,
788   /* shift */   0,
789   /* dmap */   DMAP_DEFAULT,
790   /* dand */   ZERO,
791   /* type */   sizeof(UINT8)
792};
793
794760static const prom_load_t pl_madr_a90 =
795761{
796762   "madr.a90",
r26352r26353
867833   m_ctl2k_u76 = prom_load(machine(), &pl_2kctl_u76, memregion("2kctl_u76")->base());
868834   m_alu_a10 = prom_load(machine(), &pl_alu_a10, memregion("alu_a10")->base());
869835   m_cram3k_a37 = prom_load(machine(), &pl_3kcram_a37, memregion("3kcram_a37")->base());
870   m_madr_a64 = prom_load(machine(), &pl_madr_a64, memregion("madr_a64")->base());
871   m_madr_a65 = prom_load(machine(), &pl_madr_a65, memregion("madr_a65")->base());
872836   m_madr_a90 = prom_load(machine(), &pl_madr_a90, memregion("madr_a90")->base());
873837   m_madr_a91 = prom_load(machine(), &pl_madr_a91, memregion("madr_a91")->base());
874838
r26352r26353
11941158//  device_reset - device-specific reset
11951159//-------------------------------------------------
11961160
1197// FIXME
11981161void alto2_cpu_device::device_reset()
11991162{
12001163   soft_reset();
1164
1165   // call all sub-devices' reset_...
1166   reset_memory();
1167   reset_disk();
1168   reset_disp();
1169   reset_kbd();
1170   reset_mouse();
1171   reset_hw();
1172
1173   reset_emu();
1174   reset_ksec();
1175   reset_ether();
1176   reset_mrt();
1177   reset_dwt();
1178   reset_curt();
1179   reset_dht();
1180   reset_dvt();
1181   reset_part();
1182   reset_kwd();
12011183}
12021184
12031185/**
r26352r26353
12131195
12141196void alto2_cpu_device::interface_post_reset()
12151197{
1216
12171198   // set the disk unit sector callbacks
12181199   for (int unit = 0; unit < diablo_hd_device::DIABLO_UNIT_MAX; unit++) {
12191200      diablo_hd_device* dhd = m_drive[unit];
r26352r26353
28722853}
28732854
28742855/** @brief software initiated reset (STARTF) */
2875int alto2_cpu_device::soft_reset()
2856void alto2_cpu_device::soft_reset()
28762857{
28772858
28782859   for (int task = 0; task < ALTO2_TASKS; task++) {
r26352r26353
28862867
28872868   m_dsp_time = 0;               // reset the display state timing
28882869
2889   // FIXME: all sub-devices need a reset_... method as well
2890
2891   return m_next_task;            // return next task (?)
2870   m_task = task_emu;            // start with task 0 (emulator)
2871   m_task_wakeup |= 1 << task_emu;   // set wakeup flag
28922872}
branches/alto2/src/emu/cpu/alto2/a2mrt.h
r26352r26353
1414#define _A2MRT_H_
1515void f1_early_mrt_block();                  //!< F1 func: block the display word task
1616void activate_mrt();                     //!< called by the CPU when MRT becomes active
17void init_mrt(int task = task_mrt);            //!< initialize memory refresh task
18void exit_mrt();                        //!< deinitialize memory refresh task
17void init_mrt(int task = task_mrt);            //!< initialize the memory refresh task
18void exit_mrt();                        //!< deinitialize the memory refresh task
19void reset_mrt();                        //!< reset the memory refresh task
1920#endif // _A2MRT_H_
2021#endif   // ALTO2_DEFINE_CONSTANTS
branches/alto2/src/emu/cpu/alto2/alto2cpu.h
r26352r26353
873873   UINT64 ntime() { return m_cycle*ALTO2_UCYCLE/1000; }   //!< return the current nano seconds
874874
875875   void hard_reset();                        //!< reset the various registers
876   int soft_reset();                        //!< soft reset
876   void soft_reset();                        //!< soft reset
877877
878878   void fn_bs_bad_0();                        //! bs dummy early function
879879   void fn_bs_bad_1();                        //! bs dummy late function
branches/alto2/src/emu/cpu/alto2/a2curt.c
r26352r26353
7777   // nothing to do yet
7878}
7979
80void alto2_cpu_device::reset_curt()
81{
82   m_dsp.curt_blocks = false;
83   m_dsp.xpreg = 0;
84   m_dsp.csr = 0;
85   m_dsp.curdata = 0;
86   m_dsp.curword = 0;
87}
branches/alto2/src/mess/drivers/alto2.c
r26352r26353
123123   PORT_CONFNAME( 0x01, 0x01, "Memory switch")
124124   PORT_CONFSETTING( 0x00, "on")
125125   PORT_CONFSETTING( 0x01, "off")
126   PORT_CONFNAME( 0x70, 0x00, "Ethernet 'duckbreath' fake")
127   PORT_CONFSETTING( 0x00, "off")
128   PORT_CONFSETTING( 0x10, "5 seconds")
129   PORT_CONFSETTING( 0x20, "10 seconds")
130   PORT_CONFSETTING( 0x30, "15 seconds")
131   PORT_CONFSETTING( 0x40, "30 seconds")
132   PORT_CONFSETTING( 0x50, "60 seconds")
133   PORT_CONFSETTING( 0x60, "90 seconds")
134   PORT_CONFSETTING( 0x70, "120 seconds")
126135INPUT_PORTS_END
127136
128137/* ROM */

Previous 199869 Revisions Next


© 1997-2024 The MAME Team