Hacking games to use ZXpand/Chroma/Other joystick
- 1024MAK
- Posts: 5118
- Joined: Mon Sep 26, 2011 10:56 am
- Location: Looking forward to summer in Somerset, UK...
Re: Hacking games to use ZXpand/Chroma/Other joystick
I kinda following (while getting distracted with other things... ).
You do know that hacked Kempston joystick interfaces (with ZX81 sized edge-connectors) exist that support two fire buttons... and hacked joysticks exist that support two fire buttons... (and of course game pads often have more than one fire button)... let there be mass
<other hacked joystick interfaces may be available- check your local hardware hacker for availability...>
Mark
You do know that hacked Kempston joystick interfaces (with ZX81 sized edge-connectors) exist that support two fire buttons... and hacked joysticks exist that support two fire buttons... (and of course game pads often have more than one fire button)... let there be mass
<other hacked joystick interfaces may be available- check your local hardware hacker for availability...>
Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp
Standby alert
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Looking forward to summer later in the year.
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp
Standby alert
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Looking forward to summer later in the year.
Re: Hacking games to use ZXpand/Chroma/Other joystick
Now it gets interesting. Here's a little program which is a proxy loader.
Copy SCRMPAT.P to your SD card, making sure that SCRMBL81.P is in the same folder.
LOAD "SCRMPAT" and ... scramble loads!
The loader is not modifying anything yet. But it will.
How it works:
The patcher sets memory configuration to its low setting, with 8K RAM at $2000. It copies its machine code there and jumps to it. SCRMBL81 is loaded. The stack is fixed up and then a return to BASIC is executed via SLOW. The effect of this is to RUN the program we just put in memory.
That's pretty much all there is to it for the moment - next up we add some code to alter the program in memory before it's executed.
Copy SCRMPAT.P to your SD card, making sure that SCRMBL81.P is in the same folder.
LOAD "SCRMPAT" and ... scramble loads!
The loader is not modifying anything yet. But it will.
How it works:
The patcher sets memory configuration to its low setting, with 8K RAM at $2000. It copies its machine code there and jumps to it. SCRMBL81 is loaded. The stack is fixed up and then a return to BASIC is executed via SLOW. The effect of this is to RUN the program we just put in memory.
That's pretty much all there is to it for the moment - next up we add some code to alter the program in memory before it's executed.
- Attachments
-
- scrmpat.zip
- (965 Bytes) Downloaded 166 times
Re: Hacking games to use ZXpand/Chroma/Other joystick
I know they exist. Hands up who's got one though? Anyone? Bueller? Anyone?1024MAK wrote: ↑Wed Aug 02, 2017 5:32 pmYou do know that hacked Kempston joystick interfaces (with ZX81 sized edge-connectors) exist that support two fire buttons... and hacked joysticks exist that support two fire buttons... (and of course game pads often have more than one fire button)... let there be mass
Thought not
- 1024MAK
- Posts: 5118
- Joined: Mon Sep 26, 2011 10:56 am
- Location: Looking forward to summer in Somerset, UK...
Re: Hacking games to use ZXpand/Chroma/Other joystick
sirmorris wrote: ↑Wed Aug 02, 2017 5:51 pmI know they exist. Hands up who's got one though? Anyone? Bueller? Anyone?1024MAK wrote: ↑Wed Aug 02, 2017 5:32 pmYou do know that hacked Kempston joystick interfaces (with ZX81 sized edge-connectors) exist that support two fire buttons... and hacked joysticks exist that support two fire buttons... (and of course game pads often have more than one fire button)... let there be mass
Thought not
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp
Standby alert
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Looking forward to summer later in the year.
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp
Standby alert
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Looking forward to summer later in the year.
Re: Hacking games to use ZXpand/Chroma/Other joystick
It seems like all your patches will work with ZxPand only.
Re: Hacking games to use ZXpand/Chroma/Other joystick
Here is the patch and its source. Would some kind soul please try it out for me? Believe it or not I don't actually have a device to try it with
This is true. That's because I wrote them for ZXpand. If you want to adapt it for another system then feel free - I have explained very clearly how to do it and supplied the source code!
- Attachments
-
- scrmblpat.zip
- (1.2 KiB) Downloaded 155 times
-
- Posts: 15
- Joined: Thu Jul 27, 2017 9:43 am
Re: Hacking games to use ZXpand/Chroma/Other joystick
Thank you sirmorris for these tips. I'm going to try it out. Next game I will try to rewrite myself, but do not offend as I asked something.
ZX-81, ZX-Pand AY, 48k "Rubber", 48K+, 128K + "Toastrack", +2 "grey" 1024k Profi, Masakrator FM, DivIDE 2K11, ZX Evolution rev. C, ZX-Uno, C64, C16 64K, Plus4 + 1541 Ultimate II + SD2IEC
Re: Hacking games to use ZXpand/Chroma/Other joystick
Please ask as many questions as you wish. The first 5 are free, the next five are ¢99 each
This was actually a very easy game to convert. Many are not so easy. Every one is different, that's for sure.
My other patchers were evidently becoming quite sophisticated. I removed a lot of the code from this one to make it easy to understand. Unfortunately I'm discovering a few bugs in ZX-IDE so some of the code was necessarily ugly. LD (HL),DE doesn't compile for instance, and there is a spurious opcode randomly inserted I've mailed Karl, I'm sure he will sort it out though.
The other patchers do things like check the ROM version and perform a CRC check on the hosted program to ensure it's right before running it. I will add these things back. Check out the source for PROTECTOR.
This was actually a very easy game to convert. Many are not so easy. Every one is different, that's for sure.
My other patchers were evidently becoming quite sophisticated. I removed a lot of the code from this one to make it easy to understand. Unfortunately I'm discovering a few bugs in ZX-IDE so some of the code was necessarily ugly. LD (HL),DE doesn't compile for instance, and there is a spurious opcode randomly inserted I've mailed Karl, I'm sure he will sort it out though.
The other patchers do things like check the ROM version and perform a CRC check on the hosted program to ensure it's right before running it. I will add these things back. Check out the source for PROTECTOR.
-
- Posts: 15
- Joined: Thu Jul 27, 2017 9:43 am
Re: Hacking games to use ZXpand/Chroma/Other joystick
I tried yesterday to run the SCRAMBLE81 version and after running SCRAMBLPAT.P from the Commander, it reboots the system with the standby "K" without the ZXPand information. It seems that the computer is no longer "seeing" the ZXpand interface, because when you press "Z" Get the word "COPY" and you need to reset your computer. As a guide, SCRAMBLE81 is in the same directory as your path. Did I do something wrong?sirmorris wrote: ↑Wed Aug 02, 2017 5:49 pm Now it gets interesting. Here's a little program which is a proxy loader.
Copy SCRMPAT.P to your SD card, making sure that SCRMBL81.P is in the same folder.
LOAD "SCRMPAT" and ... scramble loads!
The loader is not modifying anything yet. But it will.
How it works:
The patcher sets memory configuration to its low setting, with 8K RAM at $2000. It copies its machine code there and jumps to it. SCRMBL81 is loaded. The stack is fixed up and then a return to BASIC is executed via SLOW. The effect of this is to RUN the program we just put in memory.
That's pretty much all there is to it for the moment - next up we add some code to alter the program in memory before it's executed.
ZX-81, ZX-Pand AY, 48k "Rubber", 48K+, 128K + "Toastrack", +2 "grey" 1024k Profi, Masakrator FM, DivIDE 2K11, ZX Evolution rev. C, ZX-Uno, C64, C16 64K, Plus4 + 1541 Ultimate II + SD2IEC
Re: Hacking games to use ZXpand/Chroma/Other joystick
Check the write-protect setting of the files. If a file is write protected ZXpand disables the overlay ROM. Remove the flag and things will work.
I was considering removing this feature because it causes a lot of confusion. My mind is now made up! ByeBye 'feature'
*edit*
Removed. The fact it was labelled a hack really says it all.
I was considering removing this feature because it causes a lot of confusion. My mind is now made up! ByeBye 'feature'
*edit*
Code: Select all
// hack to make programs auto-disable ROM if read-only attribute is set
if (filinfo.fattrib & AM_RDO)
{
flags |= 1;
}