trying to convert .rom into .cas with a bash script

Page 3/3
1 | 2 |

By NYYRIKKI

Enlighted (4619)

NYYRIKKI's picture

08-05-2016, 16:06

nitrofurano wrote:

sounds confusing... couldn’t then instead #0000-#3FFF be wholly transferred after #4000-#7FFF, and then #8000-#BFFF and run?

I would transfer the data from low addresses to high addresses order.

By NYYRIKKI

Enlighted (4619)

NYYRIKKI's picture

08-05-2016, 16:13

Alexey wrote:

I also tried a different approach - I replaced the address of init code (at address 4002h) with the address of the patcher. I didn't need to place a CALL then. So the patcher was restoring only 3 bytes at address 8000h and passing control to the ROM's init code. But that didn't work. Not even after restoring the original init code address at 4000h. For whatever reason the memory configuration at the patcher's code start up was wrong - both BIOS and BASIC were present. So I had to hack into the init code itself. From there it worked properly. I have no explanation why that happens yet...

This is because the address is called with BIOS standard interslot call. Let's say the init address is originally #4010 and now you change it to #C000. What happens when you do a interslot call with RAM slotID to #C000 ? It will change memory area #C000-#FFFF to RAM and call #C000... Naturally it will not switch #4000-#7FFF area to RAM, because that is not the address range you asked it to go for.

By Alexey

Paragon (1059)

Alexey's picture

08-05-2016, 16:32

NYYRIKKI wrote:
Alexey wrote:

I also tried a different approach - I replaced the address of init code (at address 4002h) with the address of the patcher. I didn't need to place a CALL then. So the patcher was restoring only 3 bytes at address 8000h and passing control to the ROM's init code. But that didn't work. Not even after restoring the original init code address at 4000h. For whatever reason the memory configuration at the patcher's code start up was wrong - both BIOS and BASIC were present. So I had to hack into the init code itself. From there it worked properly. I have no explanation why that happens yet...

This is because the address is called with BIOS standard interslot call. Let's say the init address is originally #4010 and now you change it to #C000. What happens when you do a interslot call with RAM slotID to #C000 ? It will change memory area #C000-#FFFF to RAM and call #C000... Naturally it will not switch #4000-#7FFF area to RAM, because that is not the address range you asked it to go for.

Ah, this explains it. I tried to manually switch page 1 to RAM and restore the call address, but there were still some glitches. Anyway, the patching solution worked well.

By nitrofurano

Master (232)

nitrofurano's picture

08-05-2016, 22:39

(btw, and not wanting to interrupt the discussion above, i just updated my 3 bash converters into 1, and we can choose to play the .cas file as .wav there - i think that only the 48kb version is missing there! Wink - http://pastebin.com/raw/TZGcC6kT )

Page 3/3
1 | 2 |
My MSX profile