Page 1 of 1
Python program to pad ROMs to exactly 48 K (e.g. for sQLux)
Posted: Mon Mar 10, 2025 12:14 am
by ql_freak
UQLX can use ROMs which are less than 49152 Bytes (48 K), but sQLux complains. So I have written a quick and dirty Python program to make a 48 K ROM from those ROMs. Hint: The program does not allow to overwrite the existing ROM on disk, you must save it with another name.
Re: Python program to pad ROMs to exactly 48 K (e.g. for sQLux)
Posted: Mon Mar 10, 2025 12:24 am
by tofro
The next release of sqlux will likely accept ROMs shorter than 49152 Bytes.
Re: Python program to pad ROMs to exactly 48 K (e.g. for sQLux)
Posted: Mon Mar 10, 2025 12:42 am
by ql_freak
I'm not sure, if this is a good idea. A ROM should have exactly 49152 bytes. With the current version of sQLux it is much more difficult, to load a file, which is no QL-ROM. It would only make sense, if ROMs >48K can be loaded as system ROM, and even than, it would be nice, if sQLux checks, that it is e.g 64, 128, ... KBytes exactly.
Re: Python program to pad ROMs to exactly 48 K (e.g. for sQLux)
Posted: Mon Mar 10, 2025 7:07 am
by XorA
truncate -s 48k test.rom
Much easier than python
Re: Python program to pad ROMs to exactly 48 K (e.g. for sQLux)
Posted: Mon Mar 10, 2025 12:08 pm
by tofro
ql_freak wrote: Mon Mar 10, 2025 12:42 am
I'm not sure, if this is a good idea. A ROM should have exactly 49152 bytes. With the current version of sQLux it is much more difficult, to load a file, which is no QL-ROM. It would only make sense, if ROMs >48K can be loaded as system ROM, and even than, it would be nice, if sQLux checks, that it is e.g 64, 128, ... KBytes exactly.
Well, we need to accept what's out there. And there's plenty of ROMs floating about shorter than 49152 bytes. If we supply a warning if a "short ROM" is detected, that should be enough.
Re: Python program to pad ROMs to exactly 48 K (e.g. for sQLux)
Posted: Mon Mar 10, 2025 9:12 pm
by XorA
tofro wrote: Mon Mar 10, 2025 12:08 pm
ql_freak wrote: Mon Mar 10, 2025 12:42 am
I'm not sure, if this is a good idea. A ROM should have exactly 49152 bytes. With the current version of sQLux it is much more difficult, to load a file, which is no QL-ROM. It would only make sense, if ROMs >48K can be loaded as system ROM, and even than, it would be nice, if sQLux checks, that it is e.g 64, 128, ... KBytes exactly.
Well, we need to accept what's out there. And there's plenty of ROMs floating about shorter than 49152 bytes. If we supply a warning if a "short ROM" is detected, that should be enough.
I accepted tofro's reasoning and sQLay3 already did except short roms, so I merged his patch a few minutes ago!