31-12-2023, 10:47 AM
I will put my ROMs in the Repository when they have all been verified and working. But in the meantime if you want to make your own, and why not, here is a starting guide. I've made my PAK A and PAK B to have all the files of a Premium PC85 so when the SuperPak bee is first turned on, it boots to Basic. PAK 5 brings up the Premium PC85 opening menu and all options work as per an original Premium PC85. But PAK 6 brings up my 3 page Menu of all the games in the rest of the PAK's.
Basically, you need to add a header at the start of the game code to move it to its normal running location in memory. I use Cygnus Free Edition in Windows for all this work, but any Hex Editor will do. Basic programs all start at 08C0h with actual code from 0900h. Not all BEE files start at 0900h also, though its the default. You need to know where to load it to and what its start address is (which is not always its load addy). The Z80 also expects addresses to be in Low Byte first High byte second, so a jump to C003h looks like C3 03 C0. The first 3 bytes of your eprom MUST be a jump address else it wont be recognized at all. The 8k PAK alocated memory space is C000h to DFFFh in the Microbee's Memory Map. So, if you have an 8k (or less) Machine Code *.BEE program, then a header of 2 lines I use can look like this -
C3 03 C0 21 20 C0 11 00 09 01 E0 1F ED B0 C3 00
09 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
program code starts here
First 3 bytes jumps 3 bytes ahead
next 3 bytes is the start addy of the code to move
next 3 bytes is the load address your moving it to
next 3 bytes is the amount of bytes your wanting to move
next 2 bytes (LDIR) actually does the move
last 3 bytes jumps to the start address of the program you just moved
and in the 00's you can put the programs Name or your name or what ever, I just put my initials. If your game is a BASIC file, the load address is ALWAYS C0 08 (08C0h) and they all auto start at 1E 80 (801Eh).
If you if you have a 16k file, it needs to be spread across 2 x 8k PAK slots, so the header is a bit more complicated. Lets look at loading SCRAMBLER.BEE into PAKC rom which is PAK 16 to 23. it has load and start address of 768 (0300h). So it will fit into PAK 16 & PAK 17 as the game is 3F7Fh bytes long. We can use the code as above but then need to tell it to make PAK 17 visable and copy the 2nd part of code onto the end of the 1st part thats already been copied. So the header then becomes -
C3 03 C0 21 10 C0 11 F0 02 01 F0 1F ED B0 C3 F1
02 3E 11 D3 0A C3 00 C0 00 00 00 00 00 00 00 00
First 3 bytes jumps 3 bytes ahead
next 3 bytes is the start addy of the code to move (now also copies the 2nd line of this header)
next 3 bytes is the load address your moving it to (10h bytes lower to hold the 2nd line of header)
next 3 bytes is the amount of bytes your wanting to move
next 2 bytes (LDIR) actually does the move
next 3 bytes jumps to the 2nd line of header thats been copied
next 4 bytes makes PAK 17 (11h) active
last 3 bytes jumps to the start of code in PAK 17
program code starts here
Now an extra line of code needs to included at 2000h (start of PAK 17 code) which would be -
21 10 C0 11 22 E0 01 9F 1F ED B0 C3 00 03 00 00
First 3 bytes is the start addy of the code to move
next 3 bytes is the start address immediately after the 1st parts end thats already copied (made by adding 02F0h + 1FF0h from Header above)
next 3 bytes is the amount of the remainder of the code to be moved
next 2 bytes (LDIR) actually does the move
last 3 bytes jumps to the start address of the game
I fill on the unused space at the end of the code with 00's up to the start of 2000h so ready to add in the next game. If the games is only 10 or 11k long, for example, that means there is onlt 2 or 3k used in the second PAK location. Rather than waste the space, a smaller 4 to 6k game can be added in that space but you really need to make a Menu to access it.
The manual eprom_programmer_and_64k_rom_pak_instruction_manual.pdf explains it all more in technical terms, so grab it from the Repository as I'm sure it can help also.
Basically, you need to add a header at the start of the game code to move it to its normal running location in memory. I use Cygnus Free Edition in Windows for all this work, but any Hex Editor will do. Basic programs all start at 08C0h with actual code from 0900h. Not all BEE files start at 0900h also, though its the default. You need to know where to load it to and what its start address is (which is not always its load addy). The Z80 also expects addresses to be in Low Byte first High byte second, so a jump to C003h looks like C3 03 C0. The first 3 bytes of your eprom MUST be a jump address else it wont be recognized at all. The 8k PAK alocated memory space is C000h to DFFFh in the Microbee's Memory Map. So, if you have an 8k (or less) Machine Code *.BEE program, then a header of 2 lines I use can look like this -
C3 03 C0 21 20 C0 11 00 09 01 E0 1F ED B0 C3 00
09 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
program code starts here
First 3 bytes jumps 3 bytes ahead
next 3 bytes is the start addy of the code to move
next 3 bytes is the load address your moving it to
next 3 bytes is the amount of bytes your wanting to move
next 2 bytes (LDIR) actually does the move
last 3 bytes jumps to the start address of the program you just moved
and in the 00's you can put the programs Name or your name or what ever, I just put my initials. If your game is a BASIC file, the load address is ALWAYS C0 08 (08C0h) and they all auto start at 1E 80 (801Eh).
If you if you have a 16k file, it needs to be spread across 2 x 8k PAK slots, so the header is a bit more complicated. Lets look at loading SCRAMBLER.BEE into PAKC rom which is PAK 16 to 23. it has load and start address of 768 (0300h). So it will fit into PAK 16 & PAK 17 as the game is 3F7Fh bytes long. We can use the code as above but then need to tell it to make PAK 17 visable and copy the 2nd part of code onto the end of the 1st part thats already been copied. So the header then becomes -
C3 03 C0 21 10 C0 11 F0 02 01 F0 1F ED B0 C3 F1
02 3E 11 D3 0A C3 00 C0 00 00 00 00 00 00 00 00
First 3 bytes jumps 3 bytes ahead
next 3 bytes is the start addy of the code to move (now also copies the 2nd line of this header)
next 3 bytes is the load address your moving it to (10h bytes lower to hold the 2nd line of header)
next 3 bytes is the amount of bytes your wanting to move
next 2 bytes (LDIR) actually does the move
next 3 bytes jumps to the 2nd line of header thats been copied
next 4 bytes makes PAK 17 (11h) active
last 3 bytes jumps to the start of code in PAK 17
program code starts here
Now an extra line of code needs to included at 2000h (start of PAK 17 code) which would be -
21 10 C0 11 22 E0 01 9F 1F ED B0 C3 00 03 00 00
First 3 bytes is the start addy of the code to move
next 3 bytes is the start address immediately after the 1st parts end thats already copied (made by adding 02F0h + 1FF0h from Header above)
next 3 bytes is the amount of the remainder of the code to be moved
next 2 bytes (LDIR) actually does the move
last 3 bytes jumps to the start address of the game
I fill on the unused space at the end of the code with 00's up to the start of 2000h so ready to add in the next game. If the games is only 10 or 11k long, for example, that means there is onlt 2 or 3k used in the second PAK location. Rather than waste the space, a smaller 4 to 6k game can be added in that space but you really need to make a Menu to access it.
The manual eprom_programmer_and_64k_rom_pak_instruction_manual.pdf explains it all more in technical terms, so grab it from the Repository as I'm sure it can help also.
---------------------------
ChickenMan
ChickenMan
