UK Vintage Radio Repair and Restoration Powered By Google Custom Search Vintage Radio and TV Service Data

Go Back   UK Vintage Radio Repair and Restoration Discussion Forum > Specific Vintage Equipment > Vintage Computers

Notices

Vintage Computers Any vintage computer systems, calculators, video games etc., but with an emphasis on 1980s and earlier equipment.

Closed Thread
 
Thread Tools
Old 4th Dec 2022, 6:27 pm   #1
777xxxx
Tetrode
 
Join Date: Nov 2022
Location: Cornwall, UK.
Posts: 60
Default 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.
777xxxx is offline  
Old 4th Dec 2022, 6:32 pm   #2
Mark1960
Octode
 
Join Date: Mar 2020
Location: Kitchener, Ontario, Canada
Posts: 1,294
Default 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.
Mark1960 is online now  
Old 4th Dec 2022, 6:41 pm   #3
777xxxx
Tetrode
 
Join Date: Nov 2022
Location: Cornwall, UK.
Posts: 60
Default Re: how do i convert hex files to binary for use in the mk14 mame vdu emulator?

Quote:
Originally Posted by Mark1960 View Post
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.
777xxxx is offline  
Old 4th Dec 2022, 6:58 pm   #4
Pernod70
Triode
 
Join Date: Nov 2022
Location: Croydon, Surrey, UK
Posts: 37
Default Re: how do i convert hex files to binary for use in the mk14 mame vdu emulator?

Quote:
Originally Posted by 777xxxx View Post
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

Last edited by Pernod70; 4th Dec 2022 at 7:23 pm.
Pernod70 is offline  
Old 4th Dec 2022, 7:15 pm   #5
ortek_service
Octode
 
ortek_service's Avatar
 
Join Date: May 2018
Location: Northampton, Northamptonshire, UK.
Posts: 1,440
Default 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.
ortek_service is offline  
Old 5th Dec 2022, 12:09 am   #6
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 11,560
Default 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.
SiriusHardware is online now  
Old 5th Dec 2022, 3:36 am   #7
777xxxx
Tetrode
 
Join Date: Nov 2022
Location: Cornwall, UK.
Posts: 60
Default Re: How do I convert hex files to binary for use in the MK14 mame VDU emulator?

Quote:
Originally Posted by SiriusHardware View Post
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.
777xxxx is offline  
Old 5th Dec 2022, 9:54 am   #8
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 11,560
Default 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.
SiriusHardware is online now  
Old 5th Dec 2022, 2:23 pm   #9
Realtime
Hexode
 
Join Date: Jan 2021
Location: Ashford, Kent, UK
Posts: 318
Default 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.
Realtime is offline  
Old 5th Dec 2022, 5:35 pm   #10
Pernod70
Triode
 
Join Date: Nov 2022
Location: Croydon, Surrey, UK
Posts: 37
Default Re: How do I convert hex files to binary for use in the MK14 mame VDU emulator?

Quote:
Originally Posted by SiriusHardware View Post
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 View Post
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 View Post
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.
Pernod70 is offline  
Old 5th Dec 2022, 6:14 pm   #11
777xxxx
Tetrode
 
Join Date: Nov 2022
Location: Cornwall, UK.
Posts: 60
Default Re: How do I convert hex files to binary for use in the MK14 mame VDU emulator?

Quote:
Originally Posted by Pernod70 View Post
Quote:
Originally Posted by SiriusHardware View Post
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 View Post
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 View Post
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>

Last edited by 777xxxx; 5th Dec 2022 at 6:28 pm.
777xxxx is offline  
Old 5th Dec 2022, 6:40 pm   #12
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 11,560
Default 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.

Last edited by SiriusHardware; 5th Dec 2022 at 6:56 pm.
SiriusHardware is online now  
Old 5th Dec 2022, 8:37 pm   #13
Pernod70
Triode
 
Join Date: Nov 2022
Location: Croydon, Surrey, UK
Posts: 37
Default Re: How do I convert hex files to binary for use in the MK14 mame VDU emulator?

Quote:
Originally Posted by 777xxxx View Post
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 is offline  
Old 5th Dec 2022, 8:49 pm   #14
Pernod70
Triode
 
Join Date: Nov 2022
Location: Croydon, Surrey, UK
Posts: 37
Default Re: How do I convert hex files to binary for use in the MK14 mame VDU emulator?

Quote:
Originally Posted by SiriusHardware View Post
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.
Pernod70 is offline  
Old 5th Dec 2022, 9:03 pm   #15
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 11,560
Default 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'.
SiriusHardware is online now  
Old 6th Dec 2022, 3:34 am   #16
777xxxx
Tetrode
 
Join Date: Nov 2022
Location: Cornwall, UK.
Posts: 60
Default Re: How do I convert hex files to binary for use in the MK14 mame VDU emulator?

Quote:
Originally Posted by Pernod70 View Post
Quote:
Originally Posted by 777xxxx View Post
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:
Attached Thumbnails
Click image for larger version

Name:	xxx.png
Views:	34
Size:	17.1 KB
ID:	269415   Click image for larger version

Name:	ppp,png.png
Views:	34
Size:	6.3 KB
ID:	269416  

Last edited by 777xxxx; 6th Dec 2022 at 3:47 am.
777xxxx is offline  
Old 6th Dec 2022, 9:21 am   #17
Realtime
Hexode
 
Join Date: Jan 2021
Location: Ashford, Kent, UK
Posts: 318
Default 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.
Realtime is offline  
Old 6th Dec 2022, 11:53 am   #18
777xxxx
Tetrode
 
Join Date: Nov 2022
Location: Cornwall, UK.
Posts: 60
Default 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 is offline  
Old 6th Dec 2022, 11:57 am   #19
777xxxx
Tetrode
 
Join Date: Nov 2022
Location: Cornwall, UK.
Posts: 60
Default Re: how do i convert hex files to binary for use in the mk14 mame vdu emulator?

Quote:
Originally Posted by Pernod70 View Post
Quote:
Originally Posted by 777xxxx View Post
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
777xxxx is offline  
Old 6th Dec 2022, 12:03 pm   #20
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 11,560
Default 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.
SiriusHardware is online now  
Closed Thread




All times are GMT +1. The time now is 11:10 pm.


All information and advice on this forum is subject to the WARNING AND DISCLAIMER located at https://www.vintage-radio.net/rules.html.
Failure to heed this warning may result in death or serious injury to yourself and/or others.


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