Previous Thread
Next Thread
Print Thread
Page 3 of 3 1 2 3
Re: Adding new system - HP 3478A multimeter [Re: fenugrec] #114281
11/13/18 05:20 PM
11/13/18 05:20 PM
Joined: Nov 2018
Posts: 11
F
fenugrec Offline OP
Member
fenugrec  Offline OP
Member
F
Joined: Nov 2018
Posts: 11
Thanks. Finally got it to sortof work (as far as I can tell...) with some #IRC help, and it even almost looks like the real thing, after a few beers:

[Linked Image]

Feels like the CAL RAM was one major obstacle; I don't expect the other short-term TODO items (keypad, DIP switch) will be as difficult.

Re: Adding new system - HP 3478A multimeter [Re: fenugrec] #114282
11/13/18 06:45 PM
11/13/18 06:45 PM
Joined: Mar 2001
Posts: 16,070
USA
R
R. Belmont Offline
Very Senior Member
R. Belmont  Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 16,070
USA
Nice. Congrats!

Re: Adding new system - HP 3478A multimeter [Re: fenugrec] #114335
11/24/18 07:17 AM
11/24/18 07:17 AM
Joined: Nov 2018
Posts: 11
F
fenugrec Offline OP
Member
fenugrec  Offline OP
Member
F
Joined: Nov 2018
Posts: 11
keypad actually works now and UI responds mostly as expected. Next order of business : nvram write-protect switch. There is a physical switch that enables writing to the nvram but isn't read directly by the CPU.

I have something like this
Code
map(0x000, 0x0ff).ram().region("nvram", 0).share("nvram");


(full code)

my first idea would be to configure that region to have a custom WRITE8 handler that discards writes while write-protected ?

About that switch, how about something like
Code
PORT_START("config")
PORT_CONFNAME(1, 0, "CAL enable")

Re: Adding new system - HP 3478A multimeter [Re: fenugrec] #114336
11/24/18 10:52 AM
11/24/18 10:52 AM
Joined: May 2009
Posts: 1,747
J
Just Desserts Offline
Very Senior Member
Just Desserts  Offline
Very Senior Member
J
Joined: May 2009
Posts: 1,747
Yep, sounds like you've got it! You would have a custom write handler that checks BIT(m_config->read(), 0) or whatever, and skips the write to NVRAM. There doesn't seem to be a write-protect function for the NVRAM device: perhaps there should be. smile

Re: Adding new system - HP 3478A multimeter [Re: Just Desserts] #114346
11/26/18 12:19 AM
11/26/18 12:19 AM
Joined: Nov 2018
Posts: 11
F
fenugrec Offline OP
Member
fenugrec  Offline OP
Member
F
Joined: Nov 2018
Posts: 11
Originally Posted by Just Desserts
Yep, sounds like you've got it!

I wish. I still can't figure out how do "forward the write" to the NVRAM.

Code
WRITE8_MEMBER( hp3478a_state::nvwrite ) {
	if (m_calenable->read()) {
		* (uint8_t *) space.get_write_ptr(offset) = data;     		//XXXXX segfault

		m_nvram->write_byte(offset, data); 		//XXXXX segfault, since it ends up calling this handler

		((uint8_t *)space.map()->m_device->memshare("nvram")->ptr())[offset] = data;		//XXXXX segfault

		space.map()->??		// this isn't the member you're looking for

		m_nvram->get_base()		// haha, nice try



how hard can this be ?
[EDIT] solved, thanks to @cuavas. It needed some "required_shared_ptr" magic...

Last edited by fenugrec; 11/26/18 01:28 AM. Reason: solved
Page 3 of 3 1 2 3

Who's Online Now
1 registered members (1 invisible), 114 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Shout Box
Forum Statistics
Forums9
Topics8,606
Posts112,516
Members4,827
Most Online296
Dec 5th, 2018
Powered by UBB.threads™ PHP Forum Software 7.6.1.1
(Release build 20180111)
Page Time: 0.093s Queries: 15 (0.018s) Memory: 5.6724 MB (Peak: 5.8576 MB) Zlib enabled. Server Time: 2018-12-16 11:25:37 UTC