UK Vintage Radio Repair and Restoration Discussion Forum

UK Vintage Radio Repair and Restoration Discussion Forum (https://www.vintage-radio.net/forum/index.php)
-   Vintage Computers (https://www.vintage-radio.net/forum/forumdisplay.php?f=16)
-   -   How do I convert hex files to binary for use in the MK14 mame VDU emulator? (https://www.vintage-radio.net/forum/showthread.php?t=196537)

777xxxx 4th Dec 2022 6:27 pm

How do I convert hex files to binary for use in the MK14 mame VDU emulator?
 
i managed to get a copy of mame mk14 vdu working, thanks to pernod70. not exactly sure how to convert the hex files of other games, etc into binary, so i can load them into the debugger. any help would be appreciated as always.

Mark1960 4th Dec 2022 6:32 pm

Re: how do i convert hex files to binary for use in the mk14 mame vdu emulator?
 
I use HxD.exe for converting hex files, I think it should do the job.

As always take care with downloading executables.

777xxxx 4th Dec 2022 6:41 pm

Re: how do i convert hex files to binary for use in the mk14 mame vdu emulator?
 
Quote:

Originally Posted by Mark1960 (Post 1518707)
I use HxD.exe for converting hex files, I think it should do the job.

As always take care with downloading executables.

there doesnt seem to be a way of converting it to a bin file. if i save it with a .bin extension, it just saves it as hex.

Pernod70 4th Dec 2022 6:58 pm

Re: how do i convert hex files to binary for use in the mk14 mame vdu emulator?
 
Quote:

Originally Posted by 777xxxx (Post 1518711)
there doesnt seem to be a way of converting it to a bin file. if i save it with a .bin extension, it just saves it as hex.

Use File -> Import -> Intel Hex

ortek_service 4th Dec 2022 7:15 pm

Re: how do i convert hex files to binary for use in the mk14 mame vdu emulator?
 
Yes, there isn't an option in HxD to convert it once loaded. So you have to Import it as a hex file for it to show the true binary - Trying to look at the raw Intel Hex file in a hex editor won't be too helpful as they are designed to be standard ASCII-text files.
Also make sure you're using the latest version (2.5.0.0 2021) of HxD, as earlier versions didn't have much in the way of support for other formats.

You can also use the Dataman Programmer free-download software (in Demo-mode, without programmer) to load (it will auto-detect many) / save in a variety of formats as well as using it's built-in Hex-editor of the buffer. You just have to select a suitable-size memory device, to match target system ROM-size.

SiriusHardware 5th Dec 2022 12:09 am

Re: How do I convert hex files to binary for use in the MK14 mame VDU emulator?
 
777xxxx, If you are talking about Intel Hex files, be careful as some of them contain blocks of code spread around different memory areas, because memory on the MK14 is split up into several distinct blocks.

Those ones won't convert / translate directly into single raw binary files. I'm surprised MAME doesn't support the loading of Hex files.

777xxxx 5th Dec 2022 3:36 am

Re: How do I convert hex files to binary for use in the MK14 mame VDU emulator?
 
Quote:

Originally Posted by SiriusHardware (Post 1518790)
777xxxx, If you are talking about Intel Hex files, be careful as some of them contain blocks of code spread around different memory areas, because memory on the MK14 is split up into several distinct blocks.

Those ones won't convert / translate directly into single raw binary files. I'm surprised MAME doesn't support the loading of Hex files.

theres also a problem with me trying to load and run things in the debugger anyway. when i load invaders from the mk14_quik directory it doesnt work when i hit run. the invaders file from that directory works when i load it normally.

SiriusHardware 5th Dec 2022 9:54 am

Re: How do I convert hex files to binary for use in the MK14 mame VDU emulator?
 
Invaders is written to reside in continuous memory 0200-07FF (which includes the screen memory area) so that one can actually be loaded in 'one load'.

Unfortunately, I don't know MAME at all so can't help you with the problems you are having there, perhaps Pernod70 can assist if he is still about.

Realtime 5th Dec 2022 2:23 pm

Re: How do I convert hex files to binary for use in the MK14 mame VDU emulator?
 
By coincidence, I also ran MK14VDU MAME for the first time last night (thanks again to Pernod70). I wanted to run Invaders V2 (includes a 3 digit score counter) but couldn't figure out how to load the code and it was getting late so I gave up. I've now read the MAME debugger help files and hope to get that running this evening. Credit to Pernod70 for a very nice emulation of the MK14. I particularly like the large 7 segment display situated under the video display.

But getting back on-subject - there is a very simple command line conversion tool Hex2Bin available which may be useful to you.

Pernod70 5th Dec 2022 5:35 pm

Re: How do I convert hex files to binary for use in the MK14 mame VDU emulator?
 
Quote:

Originally Posted by SiriusHardware (Post 1518790)
I'm surprised MAME doesn't support the loading of Hex files.

It's the first time I've seen a request for them. We normally support physical media such as tapes, disks, ROMs, etc. How do you normally transfer programs to your real hardware?

Quote:

Originally Posted by 777xxxx (Post 1518804)
theres also a problem with me trying to load and run things in the debugger anyway. when i load invaders from the mk14_quik directory it doesnt work when i hit run. the invaders file from that directory works when i load it normally.

How are you trying to load invaders.bin in the debugger? There's nothing in the binary file to tell MAME where to load it so you'll have to specify the load address:
load invaders.bin,200
See documentation at https://docs.mamedev.org/debugger/memory.html#

Quote:

Originally Posted by Realtime (Post 1518889)
By coincidence, I also ran MK14VDU MAME for the first time last night (thanks again to Pernod70). I wanted to run Invaders V2 (includes a 3 digit score counter) but couldn't figure out how to load the code and it was getting late so I gave up. I've now read the MAME debugger help files and hope to get that running this evening. Credit to Pernod70 for a very nice emulation of the MK14. I particularly like the large 7 segment display situated under the video display.

Thanks, glad you like it, and hope it helps with your development.

777xxxx 5th Dec 2022 6:14 pm

Re: How do I convert hex files to binary for use in the MK14 mame VDU emulator?
 
Quote:

Originally Posted by Pernod70 (Post 1518949)
Quote:

Originally Posted by SiriusHardware (Post 1518790)
I'm surprised MAME doesn't support the loading of Hex files.

It's the first time I've seen a request for them. We normally support physical media such as tapes, disks, ROMs, etc. How do you normally transfer programs to your real hardware?

Quote:

Originally Posted by 777xxxx (Post 1518804)
theres also a problem with me trying to load and run things in the debugger anyway. when i load invaders from the mk14_quik directory it doesnt work when i hit run. the invaders file from that directory works when i load it normally.

How are you trying to load invaders.bin in the debugger? There's nothing in the binary file to tell MAME where to load it so you'll have to specify the load address:
load invaders.bin,200
See documentation at https://docs.mamedev.org/debugger/memory.html#

Quote:

Originally Posted by Realtime (Post 1518889)
By coincidence, I also ran MK14VDU MAME for the first time last night (thanks again to Pernod70). I wanted to run Invaders V2 (includes a 3 digit score counter) but couldn't figure out how to load the code and it was getting late so I gave up. I've now read the MAME debugger help files and hope to get that running this evening. Credit to Pernod70 for a very nice emulation of the MK14. I particularly like the large 7 segment display situated under the video display.

Thanks, glad you like it, and hope it helps with your development.

what are the actual command flags that you are typing? whatever i do i cant get it to work, sorry.

it comes up with this error:

Error: unknown option: -<UNADORNED2>

SiriusHardware 5th Dec 2022 6:40 pm

Re: How do I convert hex files to binary for use in the MK14 mame VDU emulator?
 
We have a couple of methods circulating at the moment - the first uses this project (or one of the various subsequent spins of it) to read an Intel Hex file and convert it to the same keypresses which a human operator would use to enter the code. It types the code in slightly faster than a human could do it.

https://vintage-radio.net/forum/showthread.php?t=151851

Shortcut to a video about it here:

https://www.youtube.com/watch?v=-AXgyeH0F2E

Intel Hex was chosen for three reasons:-

1) Not necessary for the user to inform the MK14 what the load address should be, as the destination addresses are contained within the Intel Hex file

2) The ability to upload code to all areas of the MK14's non-continuous code memory areas from a single file, so if you have a program which resides in Normal RAM, Optional RAM, I/O RAM and extra-extra RAM at 0200-07FF, all of that code can be contained in one Intel Hex file and uploaded from it in a single load operation.

3) There is a 'trick feature' in the uploader which looks for two bytes in the file at FFFE and FFFF, which are not real addresses on an MK14. If the uploader finds bytes at those addresses in the file it uses them as the execution address and automatically runs the program after uploading.

More recently there was another uploading method introduced by Coolsnaz2 which involves using an offboard micro board to first load a speedloader using the inbuilt cassette loading routines (the offboard micro generates a signal which mimics the digital signal output by the cassette interface).

https://www.vintage-radio.net/forum/...d.php?t=186247

The Speedloader then uses synchronous serial data transfer (clock + data) to transfer even large programs to the MK14 near-instantly, an example video of it working here:-

https://www.youtube.com/watch?v=BemPyaoNqb4

..You can not fail to be impressed by how fast that loads. :)

However, I don't know whether Coolsnaz2's project works with Intel Hex, specifically whether it works with code split across more than one memory area.

Pernod70 5th Dec 2022 8:37 pm

Re: How do I convert hex files to binary for use in the MK14 mame VDU emulator?
 
Quote:

Originally Posted by 777xxxx (Post 1518957)
what are the actual command flags that you are typing? whatever i do i cant get it to work, sorry.

it comes up with this error:

Error: unknown option: -<UNADORNED2>

I've already specified the command to load invaders at 200 into RAM:
load invaders.bin,200

Give me a clue as to exactly what you're doing, attach a screenshot if it'll help.

Pernod70 5th Dec 2022 8:49 pm

Re: How do I convert hex files to binary for use in the MK14 mame VDU emulator?
 
Quote:

Originally Posted by SiriusHardware (Post 1518964)
We have a couple of methods circulating at the moment - the first uses this project (or one of the various subsequent spins of it) to read an Intel Hex file and convert it to the same keypresses which a human operator would use to enter the code. It types the code in slightly faster than a human could do it.

Is this method able to create an ASCII txt file of all the keypresses? MAME supports pasting a file from the clipboard and each character will be interpreted as a keypress.

SiriusHardware 5th Dec 2022 9:03 pm

Re: How do I convert hex files to binary for use in the MK14 mame VDU emulator?
 
Not as it stands, it reads the Intel Hex file (in this case from the SD card of a Raspberry Pi) and drives a small network of optocouplers which are connected to the keypad edge connector of the MK14 so the Pi can 'press' keys on the physical MK14.

DeltaAlpha52 created an Arduino 'spin' of the project in which a Python program on a host PC outputs single characters over a serial link to an Arduino which performs the character-to-keypad keypress translation. I suppose it wouldn't be too hard to get the Python program to write its key press output to a file instead.

Keys 0-F are transmitted as those characters, keys 'Go', 'Mem', 'Term' as 'G' 'M' and 'T' respectively - key 'Abort' is transmitted as 'Q' since 'A' is already taken, and reset is 'R'.

777xxxx 6th Dec 2022 3:34 am

Re: How do I convert hex files to binary for use in the MK14 mame VDU emulator?
 
2 Attachment(s)
Quote:

Originally Posted by Pernod70 (Post 1519001)
Quote:

Originally Posted by 777xxxx (Post 1518957)
what are the actual command flags that you are typing? whatever i do i cant get it to work, sorry.

it comes up with this error:

Error: unknown option: -<UNADORNED2>

I've already specified the command to load invaders at 200 into RAM:
load invaders.bin,200

Give me a clue as to exactly what you're doing, attach a screenshot if it'll help.

ive had this problem before with documentation for switches not being so good.

all i need is an example of what to type...

heres 2 of the things ive tried so far but i did try other ways too:

Realtime 6th Dec 2022 9:21 am

Re: How do I convert hex files to binary for use in the MK14 mame VDU emulator?
 
Invaders is a VDU based application so needs MK14VDU to be instantiated. so the command line becomes
mk14 mk14vdu -debug

That will open up the MAME debugger window and MK14 emulation. In the debugger window (bottom line) type

load invaders.bin,400

400 because that is the start of the program memory - 200 would load it into the VDU memory. I think invaders.bin needs to be in the same folder as the mk14 executable.

Type GO (in the debugger window) to start the MK14 emulation. The 7 segment display will appear.

In the emulator window type 400 x (i.e. 400 GO) and invaders will run.

777xxxx 6th Dec 2022 11:53 am

Re: How do I convert hex files to binary for use in the MK14 mame VDU emulator?
 
ok, that works, so far. thank you.

777xxxx 6th Dec 2022 11:57 am

Re: how do i convert hex files to binary for use in the mk14 mame vdu emulator?
 
Quote:

Originally Posted by Pernod70 (Post 1518718)
Quote:

Originally Posted by 777xxxx (Post 1518711)
there doesnt seem to be a way of converting it to a bin file. if i save it with a .bin extension, it just saves it as hex.

Use File -> Import -> Intel Hex

ok, ive done this but it seems to be saving it as a 64k file, which i think is too big. it should be 1k, i think.

...yeah, i get an i/o error in the debugger

SiriusHardware 6th Dec 2022 12:03 pm

Re: How do I convert hex files to binary for use in the MK14 mame VDU emulator?
 
If the file you are trying to convert spans several address blocks then the hex to bin converter may be generating a single binary file which spans all of the addresses from the lowest address in the hex file to the highest.

Can you provide a link to, or attach (as a .zip file) the actual hex file you are trying to convert, and then we may be able to suggest the required approach for that file.


All times are GMT +1. The time now is 12:16 pm.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright ©2002 - 2023, Paul Stenning.