Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vmp3700 Raf Electronics Videokê #7839

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

felipesanches
Copy link
Contributor

Back in 2017 I started drafting a driver for the Raf Electronics VMP3700 videoke. I've then shelved this pet-project for many years and by September 2020 I gave it a second chance by rebasing the old commits against git master and then attempting to update the code-style to re-sync with MAME's current codebase.

Yesterday a friend asked me about this project and I decided to make it public "as is" so that it is not lost forever in a branch of my local copy on my laptop.

Unfortunately, there is one portion of that code that I was not able to update properly, which involves the implementation of the 386EX device, which is basically a 386 CPU with some other typical PC chipset all included in a single chip (this is a simplistic description, but gives you a general idea of what this is about). I'd like to ask for some help here to at least fix build. I know that there may be many code-style tweaks that may be needed to make this PR acceptable for merge, and I will address them, but this is not yet a PR intended for merging. I want to just fix the build so that I can get back to studying the device. The ability to run its boot code and inspect it on MAME's debugger is very important in helping me to figure out other aspects of the emulation that still need to be implemented or fixed.

I plan to get back to it on my free time during this weekend. Any feedback on this preliminary set of commits will be much appreciated.

cheers!

* Sketched an initial Vmp3700 driver
* Determined the mapping of the chip-select signals
* Declared the ROMs (including 2 undumped maskroms which are soldered to the PCB)
* Started working on an Intel 386EX processor driver.
* Hooked up the internal I/O maps for the embedded i386EX interrupt controllers (master and slave PIC8259).
* Mapped the bank-switching high-address bits for the maskroms (a few Port 3 bits)
* Parallel Port I/O handlers (boilerplate code)
* helper method to print bit patterns in log messages
* PINCFG (Pin Configuration)
* implementing a few more boilerplate code of configuration registers
* parse chip-select-unit register values + mem map tweaks + frontpanel mcu + misc changes
* set clock prescaler
…ME codebase as lots of things changed since 2017
@happppp
Copy link
Member

happppp commented Mar 4, 2021

Could you move the device to i386ex.cpp and i386ex.h or is there a conflict with macros?
Also, MAME's default is 4 spaces=1 tab. your 8 spaces would be converted to 2 tabs by our srcclean tool.

@villedevs
Copy link
Member

Is the FETCH() replacement really necessary?

@cuavas
Copy link
Member

cuavas commented Mar 6, 2021

This definitely needs cleanup, and the 386ex should be moved out to a separate file. Pulling in all the peripheral chip headers for everything using the 386 is undesirable.

@felipesanches
Copy link
Contributor Author

OK, I can do the refactoring you suggested, for sure.

But can someone tell me why this does not build properly (regardless of code-style cleanup considerations)? I recall I gave up late last year after trying for a few days to update the code to the newest code-base.

@Osso13
Copy link
Member

Osso13 commented Mar 9, 2021

OK, I can do the refactoring you suggested, for sure.

But can someone tell me why this does not build properly (regardless of code-style cleanup considerations)? I recall I gave up late last year after trying for a few days to update the code to the newest code-base.

It compiled and linked fine here, what error are you getting?

@felipesanches
Copy link
Contributor Author

It compiled and linked fine here, what error are you getting?

Interesting! Maybe it was a runtime error then. I will get back to it later (probably on the weekend) so that I can better describe what's wrong. Last time I touched this code was circa September 2020 if I recall correctly

@felipesanches
Copy link
Contributor Author

I've just updated the code to cleanup indentation, to move the 386EX into separate .cpp/.h files, and to remove the FETCH override.

The problem is a SegFault at runtime:

Screenshot from 2021-03-13 23-28-29

Screenshot from 2021-03-13 23-28-57

@felipesanches
Copy link
Contributor Author

what's the purpose of the i386_device::mem_pr8 method and why would it crash here?

@villedevs
Copy link
Member

I think the problem is, the memory accessors need overrides for 16-bit bus.
From i386sx_device:
virtual u8 mem_pr8(offs_t address) override { return macache16.read_byte(address); };
virtual u16 mem_pr16(offs_t address) override { return macache16.read_word(address); };
virtual u32 mem_pr32(offs_t address) override { return macache16.read_dword(address); };

Or you could just derive the class from i386sx_device instead.

@felipesanches
Copy link
Contributor Author

I will try the overrides later and I'll let you know if it worked well. Thanks a lot!

@felipesanches
Copy link
Contributor Author

yes, it worked! Thanks, @villedevs

@felipesanches felipesanches marked this pull request as ready for review March 17, 2021 07:18
@felipesanches
Copy link
Contributor Author

Please consider merging this preliminary work, as-is, since I do not plan to continue working on it on the short-term. I may revisit it on the future for further improvements, though.

@felipesanches
Copy link
Contributor Author

I'll be happy to make minor tweaks in order to get this merged, of course! Please, let me know.

@@ -0,0 +1,316 @@
#include "i386ex.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is missing the standard header comment, and the PCH.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is PCH?

Comment on lines +18 to +19
{
zero_state();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it necessary to avoid calling i386_device::device_reset? It’s usually better to call the base device_reset and patch up things that need to be different.

@smf-
Copy link
Member

smf- commented May 26, 2021 via email

@felipesanches
Copy link
Contributor Author

Oh, I see! I was not aware of that. Thanks for the clarification ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants