1 // license:BSD-3-Clause
2 // copyright-holders:Ryan Holtz
3 /*
4     VM Labs Aries 3 "NUON Multi-Media Architecture" simulator
5 
6     - Changelist -
7       10 Mar. 2018
8       - Initial skeleton version.
9 */
10 
11 #include "emu.h"
12 #include "nuon.h"
13 #include "nuondasm.h"
14 #include "debugger.h"
15 
16 #define VERBOSE_LEVEL   (0)
17 
18 #define ENABLE_VERBOSE_LOG (0)
19 
verboselogout(device_t & dev,uint32_t pc,const char * s_fmt,...)20 static inline void ATTR_PRINTF(3, 4) verboselogout(device_t &dev, uint32_t pc, const char *s_fmt, ...)
21 {
22 	va_list v;
23 	char buf[32768];
24 	va_start(v, s_fmt);
25 	vsprintf(buf, s_fmt, v);
26 	va_end(v);
27 	dev.logerror("%08x: %s", pc, buf);
28 }
29 
30 #define verboselog(x,y,...) do { if (ENABLE_VERBOSE_LOG && (VERBOSE_LEVEL >= y)) verboselogout(*this, x, __VA_ARGS__); } while (false)
31 
32 //**************************************************************************
33 //  DEVICE INTERFACE
34 //**************************************************************************
35 
36 DEFINE_DEVICE_TYPE(NUON,   nuon_device,   "nuon",   "Aries 3 \"Nuon\"")
37 
38 //-------------------------------------------------
39 //  nuon_device - constructor
40 //-------------------------------------------------
41 
nuon_device(const machine_config & mconfig,const char * tag,device_t * owner,uint32_t clock)42 nuon_device::nuon_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
43 	: cpu_device(mconfig, NUON, tag, owner, clock)
44 	, m_program_configs{{"program_mpe0", ENDIANNESS_BIG, 32, 32},
45 						{"program_mpe1", ENDIANNESS_BIG, 32, 32},
46 						{"program_mpe2", ENDIANNESS_BIG, 32, 32},
47 						{"program_mpe3", ENDIANNESS_BIG, 32, 32}}
48 {
49 }
50 
51 //-------------------------------------------------
52 //  unimplemented_opcode - bail on unspuported
53 //  instruction
54 //-------------------------------------------------
55 
unimplemented_opcode(uint32_t op)56 void nuon_device::unimplemented_opcode(uint32_t op)
57 {
58 //  machine().debug_break();
59 	fatalerror("Nuon: unknown opcode (%08x) at %08x\n", op, m_pc);
60 }
61 
62 
63