News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

CPC ROM editing

Started by Brocky, 15:41, 29 May 25

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Brocky

im wondering if its possible to edit the CPC ROMs (externally loaded BASIC rom?) to allow tapes to source data from the BUSY pin instead of the RD Data pin? and maybe save to a single pin on the printer port

bascially i want |TAPE:RUN" to access bit 6 instead of bit 7 of the B port on the PPI/printer port.. and |TAPE:SAVE" to access D0 of the printer port..

is it possible.. does anyone have any insight?.. would the RUN" be as simple as changing a single bit in the rom that it accesses the tape with? or would i need to write my own RSX routines?

i have an idea for a device on the printer port that can send data both ways..and maybe even be able to send "magic packets" to that can change modes from the CPC to the device
i dont want to give away all my ideas just yet!

im thinking this would be a much simpler project for me to work on before moving to bigger projects on the expansion port

any insight would be great..thanks!

Brocky

#1
found the ROM listing book.. is there an english version anywhere?!
it seems it might be a simple change.. i want to patch the rom just to keep compatibility with most tape loaders..

the only place i can find a reference to bit 7 on port B is at &29EB AND &80... im going to try changing this to &40.. (currently only looking at 464 rom.. i realize there maybe differences for 664/6128)

am i going about this the right way?! ..or should i just be patching the rom on the fly?


pelrun

It does sound like you're solving the wrong problem. Patching the tape routines to read from somewhere non-standard might only involve a couple of bytes changed, but you still end up needing to fully implement a replacement lowerrom to do it, and you are stuck with all the other design decisions that the tape routines have like low speed and half-duplex operation. 

Is there a specific reason you want to do it this way instead of adding a extension rom with it's own access routines, or a UniDOS node?

Bread80

You can find source code for the 6128 cassette routines at https://github.com/Bread80/CPC6128-Firmware-Source/blob/main/Cassette.asm

That repository is buildable - ie. you can modify and assemble and it will work (if it still fits into 16k!).

Bear in mind that cassette code requires careful timing of the instructions used, and the Z80 has more efficient ways to test and set  bit 7 than it does bit 6 (depending on how the sources are coded).

Other possible solutions (depending on use case) might be:
* Plug into the cassette lines on the internal header (of a '464).
* Patch the firmware jumpblock to read/write directly to/from your add on device. Ie. bypassing the ROM routines.

Brocky

#4
thanks guys
yeah.. after some more thought, it might be a bit ambitious to modify the roms.. its not really needed just would make a nicer device..
basically what im building is a digiblaster (and or OPL3) + tzxduino + print to file + more via an ESP32, hence why i wanted to use the busy pin for the tzx mode.. and maybe sending small packets of data back to the CPC (like RTC/NTP time, or a sensor connected to the ESP32 via I2C)
im hopeing i can send magic packets over the printer port to change modes..

so really for best compatibility i should leave the ROM alone! and just use the original ports for the tzx part..(might even just leave it out all together!)


there is one other solution...
bodge wire the WR/RD/Motor cassette pins to unused pins on the printer port! (but will people be willing to do that?!)

Bryce

Quote from: Brocky on 20:40, 30 May 25thanks guys
yeah.. after some more thought, it might be a bit ambitious to modify the roms.. its not really needed just would make a nicer device..
basically what im building is a digiblaster (and or OPL3) + tzxduino + print to file + more via an ESP32, hence why i wanted to use the busy pin for the tzx mode.. and maybe sending small packets of data back to the CPC (like RTC/NTP time, or a sensor connected to the ESP32 via I2C)
im hopeing i can send magic packets over the printer port to change modes..

so really for best compatibility i should leave the ROM alone! and just use the original ports for the tzx part..(might even just leave it out all together!)


there is one other solution...
bodge wire the WR/RD/Motor cassette pins to unused pins on the printer port! (but will people be willing to do that?!)

Perhaps you could use the joystick inputs for this instead?

Bryce.

Brocky

#6
Quote from: Bryce on 18:41, 31 May 25
Quote from: Brocky on 20:40, 30 May 25thanks guys
yeah.. after some more thought, it might be a bit ambitious to modify the roms.. its not really needed just would make a nicer device..
basically what im building is a digiblaster (and or OPL3) + tzxduino + print to file + more via an ESP32, hence why i wanted to use the busy pin for the tzx mode.. and maybe sending small packets of data back to the CPC (like RTC/NTP time, or a sensor connected to the ESP32 via I2C)
im hopeing i can send magic packets over the printer port to change modes..

so really for best compatibility i should leave the ROM alone! and just use the original ports for the tzx part..(might even just leave it out all together!)


there is one other solution...
bodge wire the WR/RD/Motor cassette pins to unused pins on the printer port! (but will people be willing to do that?!)

Perhaps you could use the joystick inputs for this instead?

Bryce.

that was a thought.. but whats the compatibility like with games that have their own loader?...im guessing low..and still has all the limitations of using the BUSY pin..

i came to the conclusion that it would be best to use everything as standard as possible to keep the compatibility
for the 6128, thats easy done with the tape port on the side, the 464 will be a bit uglier...

edit: and ive just realised im out of usable pins on the ESP32...maybe ill have to leave the tzxdunio bit out...
gonna work on getting the ESP32 switching from default digiblaster mode, to printer mode..
i have an idea for mp3/web radio player too, if i can get the ESP32 to switch and be able to take commands from the CPC.. im calling them magic packets coz they should be something that would never be seen in music or anything sent in digiblaster mode..

Bread80

If a game has it's own loader then modify the ROMs won't have the desired effect anyway...

Brocky

Quote from: Bread80 on 21:16, 01 June 25If a game has it's own loader then modify the ROMs won't have the desired effect anyway...
yup ..that was the eventual conclusion i came to aswell... 
i had thought it might be a simple rom change, to swap the tape RD pin with the BUSY pin. but it looks a bit more complicated and a bit out of my scope atm...
and any changes are going to break compatibility with alot of games..so best to leave things how they are...

 

Powered by SMFPacks Menu Editor Mod