Author Topic: How to Transfer ROMS to rom board from cpr file, for ALCON, future os,spacem etc  (Read 399 times)

0 Members and 1 Guest are viewing this topic.

Offline ikonsgr

  • 6128 Plus
  • ******
  • Posts: 572
  • Country: gr
    • ikonsgr 80's Home Micros WorkBench
    • Awards
Hi,

 I'm currently working on a 512K RAM expansion/ Rom board for Amstrad cpc 464/6128.
So far, i've managed to use RAM as Rom board by placing individual 16K ROM binary files (loaded from usb flash drive using USIfAC II board, which i've also designed), in various Rom slots (implemented in 512K SRAM space).
 But i seem to have problems when i want to use cpr files as source for the roms. I followed this: https://www.cpcwiki.eu/index.php/Format:CPR_CPC_Plus_cartridge_file_format to decode cpr file, remove various headers, and place the raw 16k data to each slot, according to the rom number indicated in cpr file, e.g. cb00->rom 0, cb01->rom1 etc.
But, although rom data seemed to be placed correctly in each rom slot, no cpr file seemed to work. I've tried so far, ALCON2020, SpaceM, Klax, FutureOS.
Since i never involved with cpr files in the past, i've made a couple of general assumptions:
- All roms in a cpr file are always upper roms.
- Rom slot is defined ONLY by placement in the cpr file (e.g. cb00->rom 0, cb01->rom1 etc.)
Are the above assumptions correct? Although if they are, then i really can't understand why isn't working...  ???
like
0
No reactions

Offline gerald

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.572
    • Awards
Some assumptions are not correct  :D

The Plus cartridge is made of an up to 512KB EPROM, split in 32 16KB block :
CB00 start from EPROM address 0x00000 
CB1F start from EPROM address 0x7C000
The CPR format describe where to put block within this EPROM.

 
On a Plus, sll the slot are mapped as upper ROM from ROM number 0x80 = CB00 to 0x9F = CB1F
 
CB00 is also mapped as lower ROM 
CB01 is also mapped as upper ROM 0 (Basic)
CB03 is also mapped as upper ROM 7 (AMSDOS)

So if you want to run a CPR from your ROM extension, you need to manage the plus specific mapping : mapping from UROM 0x80 + BASIC/AMSDOS aliasing + lower ROM
like
0
No reactions

Offline ikonsgr

  • 6128 Plus
  • ******
  • Posts: 572
  • Country: gr
    • ikonsgr 80's Home Micros WorkBench
    • Awards
Well i'm a bit confused....  ::)
How can i determine if a specific rom in a cpr file, should be upper or lower or mapped/mirrored to a different rom slot?
Is there any specifc "rom mapping guide" to determine this (e.g. rom at cb00 will have to respond to upper/lower rom at slot "X", rom at cb01 should respond to upper/lower rom at slot "Y" etc), , or maybe the information is in the cpr file it self?
For example, the 1st byte of each rom should determine the ROM type ( http://cpctech.cpc-live.com/docs/manual/s158se09.pdf ) . So maybe if i read 0x80 and above at 1st rom byte, it means that this rom should be upper rom? But if it's 0-2 means it's lower rom?
For example, i checked alcon2020 and found out that all 1st bytes of all roms at places cb01-cb31 are "1" (meaning that should be lower roms?  ::) ) except rom@cb00 which is 0xF3 which is larger than 0x80=> ROM0 = upper rom? 

 And why am i starting to feel that amstrad really messed up with rom mapping in plus models...  ???  :)
« Last Edit: 22:24, 18 October 21 by ikonsgr »
like
0
No reactions

Offline andycadley

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.010
    • Awards
The cartridge ROM slots all exist beyond what the firmware would normally scan, so the concept of Foreground/Background ROMS as per the Firmware guide doesn't really apply (except for the "special" mapping of the first 3 cartridge banks). The special mapping of these three slots is also the only place where the difference between upper/lower ROM makes any real difference.


The first slot gets mapped as ROM 0x80 and also as the Lower ROM.


The second slot gets mapped as ROM 0x81 and also as ROM 0


The third slot gets mapped as ROM 0x82 and also as ROM 7.


Every subsequent slot gets mapped from 0x83 onwards. The "special" mappings of those first three is really just a backwards compatibility function, to keep the paging consistent with the older machines.


As far as the contents of the ROMs go, the Plus hardware doesn't care at all so the first byte in any given ROM means nothing at all. Even on old CPC models this is only used to indicate to the Firmware how the ROM should be treated, but the Firmware isn't ever going to scan the additional cart ROMs (partly because it doesn't usually scan beyond ROM 0x15 but mostly because when a non-BASIC cart is inserted the Firmware isn't there at all).
like
0
No reactions

Offline ikonsgr

  • 6128 Plus
  • ******
  • Posts: 572
  • Country: gr
    • ikonsgr 80's Home Micros WorkBench
    • Awards
Thanks for  your detailed explanation andycadley!  :)
Obviously things changed with PLUS models regarding ROMs, so rules for CPC models are not valid anymore.
Now, i suppose that in theory, the "special" mappings of the first three ROMS are important only when you want to use a cartridge on CPC models that contains only upper roms e.g. original firmware must still function as lower rom, right? But is there any cartridge (cpr file) that would need to do that?
Is it right to assume that practically the 1st rom at cb00 of any cpr file, must always mapped as lower Rom, if you want to use is on CPC models?
Also does this mean that the same cb00 ROM would also respond as UPPER ROM 0? Or Upper ROM 0 must be cb01 rom?

For example, if i want to load correctly ALCON2020 to an Amstrad cpc the rules for correct respond of ROM slots (loaded from the cpr file) would be:

- Rom at cb00 should respond as lower ROM AND upper ROM 0?
- Rom at cb01 should respond as upper ROM 1
- Rom at cb02 should respond as upper ROM 2
- Rom at cb03 should respond as upper ROM 3
...........................................

or

- Rom at cb00 should respond as lower ROM ONLY
- Rom at cb01 should respond as upper ROM 0
- Rom at cb02 should respond as upper ROM 1
- Rom at cb03 should respond as upper ROM 2
.........................................

Which one is the correct approach? Having cb00 act both as lower rom and upper rom 0, or have cb00 act as lower rom only, and all subsequent roms (cb01, cb02, cb03 etc) act as Amstrad ROMS with -1 offset (cb01->rom 0, cb02->rom 1 etc)?
like
0
No reactions

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 2.836
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
    • Awards
tried so far, ALCON2020, SpaceM, Klax, FutureOS.
To install FutureOS on an EPROM card it's important to recognize that the ROM numbers are fixed. The installer DSK allows to adapt the ROM numbers. Then you can burn the data on EPROMs and use it.

For the Cartridge of FutureOS the ROM numbers are also fixed. In addition it does use features of the 6128plus. So it will not run on the regular CPC6128.

Let me help if I can help any further.  :) :) :)
« Last Edit: 16:27, 19 October 21 by GUNHED »
like
0
No reactions
http://futureos.de --> Get the revolutionary FutureOS (Update: 2021.01.24)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.07.15)

Offline abalore

  • CPC6128
  • ****
  • Posts: 172
  • Country: es
    • Awards
Hello,

Alcon2020 and my game compilations use the ROM number range &80 - &9F
So, it needs your ROM board to translate these numbers to the range &00-&1F in order to work. That should be easy, just ignoring the most significant bit.

That said, to make Alcon2020 work you need to map the slot &00 to lower and the rest to upper. That simple.
Regards,Abalore
like
1
Members reacted like:
XeNoMoRPH,

Offline andycadley

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.010
    • Awards
Cb00 is only the Lower ROM, CB01 is Upper ROM 0 and CB02 is Upper ROM 7.


The mapping to ROM0 and ROM7 was really only intended to support the standard BASIC cartridge for running in backcompat mode. It's probably necessary for a lot of the third party cartridge conversions though (which will have copies of the system ROMs in them to make them work)


It's not impossible for a "real" Plus cart to use these mappings too, but I'd say it's unlikely. The Lower ROM mapping is more important in that regard since it is enabled and paged in when the system starts so will contain cartridge startup code. After that you can use RMR2 to map a wider selection of ROMs as the Lower ROM (and move the location of the Lower ROM should you choose)
like
0
No reactions

Offline ikonsgr

  • 6128 Plus
  • ******
  • Posts: 572
  • Country: gr
    • ikonsgr 80's Home Micros WorkBench
    • Awards
Hello,

Alcon2020 and my game compilations use the ROM number range &80 - &9F
So, it needs your ROM board to translate these numbers to the range &00-&1F in order to work. That should be easy, just ignoring the most significant bit.

That said, to make Alcon2020 work you need to map the slot &00 to lower and the rest to upper. That simple.
Regards,Abalore
That's really straight forward!  :) Only one clarification: since cb00 should be mapped as lower rom 0, and all others (cb01, cb02 etc) as upper roms (1-31), this means that upper rom 0 is not used? Or maybe i need to map cb00 to upper rom too?
like
0
No reactions

Offline ikonsgr

  • 6128 Plus
  • ******
  • Posts: 572
  • Country: gr
    • ikonsgr 80's Home Micros WorkBench
    • Awards
Cb00 is only the Lower ROM, CB01 is Upper ROM 0 and CB02 is Upper ROM 7.
Ok, but since cb01 should respond to ROM 0, what about upper rom 1? Should i use cb01 too? In 2 words, should i need to "Mirror" map cb01 to upper ROM 0 AND upper ROM1 ?
Also, if i need to map cb02 to ROM7 then where should i map cb07 if it exists too?



 
like
0
No reactions

Offline ikonsgr

  • 6128 Plus
  • ******
  • Posts: 572
  • Country: gr
    • ikonsgr 80's Home Micros WorkBench
    • Awards
To install FutureOS on an EPROM card it's important to recognize that the ROM numbers are fixed. The installer DSK allows to adapt the ROM numbers. Then you can burn the data on EPROMs and use it.
For the Cartridge of FutureOS the ROM numbers are also fixed. In addition it does use features of the 6128plus. So it will not run on the regular CPC6128.
Let me help if I can help any further.  :) :) :)
Well, i've tried to use the futureos cpr files but with no luck. It would be helpful if you can tell me the exact mapping of the cbxx roms in the cpr file. Something like:
cb00-> lower ROM 0,
cb01-> upper rom 0
etc
like
0
No reactions

Offline abalore

  • CPC6128
  • ****
  • Posts: 172
  • Country: es
    • Awards
That's really straight forward!  :) Only one clarification: since cb00 should be mapped as lower rom 0, and all others (cb01, cb02 etc) as upper roms (1-31), this means that upper rom 0 is not used? Or maybe i need to map cb00 to upper rom too?
Exactly. Upper ROM 0 is not used
like
0
No reactions

Offline andycadley

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.010
    • Awards
Ok, but since cb01 should respond to ROM 0, what about upper rom 1? Should i use cb01 too? In 2 words, should i need to "Mirror" map cb01 to upper ROM 0 AND upper ROM1 ?
Also, if i need to map cb02 to ROM7 then where should i map cb07 if it exists too?



 


No, none of the other cartridge slots get mapped to the "normal" Upper ROM ranges. There will simply be no ROM in that slot unless an external ROMbox is attached.
like
0
No reactions

Offline abalore

  • CPC6128
  • ****
  • Posts: 172
  • Country: es
    • Awards
Exactly. Upper ROM 0 is not used
Notice that if you use all the upper ROMs and also the lower, you would need 528KB, which doesn't fit into a 512KB cartridge. There is no point to use all of them, and everything is easier if you reserve the slot 0 for the lower ROM, which is required to boot the cartridge.
like
0
No reactions

Offline ikonsgr

  • 6128 Plus
  • ******
  • Posts: 572
  • Country: gr
    • ikonsgr 80's Home Micros WorkBench
    • Awards
Notice that if you use all the upper ROMs and also the lower, you would need 528KB, which doesn't fit into a 512KB cartridge. There is no point to use all of them, and everything is easier if you reserve the slot 0 for the lower ROM, which is required to boot the cartridge.
That's really a relief, it would be really a headache to have in use both upper and lower rom 0  :)
One (hopefully  :) ) last question: Since cb00 should be mapped as lower rom 0 (when game is loaded in CPC models) does this means that you access ROM 0 inside your code, by directly applying rom read operations at 0000-&3fff address range? Or you need first to select it using an:OUT &DF00,&80 and then access it through &0000=&3FFF address range? Or maybe you use ROM 0 only at start up, so all this is meaningless?  :)
like
0
No reactions

Offline andycadley

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.010
    • Awards
ROMs still have to be paged in and out in the usual fashion (or on a Plus additionally via RMR2). When the machine starts up the Lower ROM will be enabled (so code execution will start there) but ROMs can and will be switched on and off as appropriate.
like
0
No reactions

Offline abalore

  • CPC6128
  • ****
  • Posts: 172
  • Country: es
    • Awards
That's really a relief, it would be really a headache to have in use both upper and lower rom 0  :)
One (hopefully  :) ) last question: Since cb00 should be mapped as lower rom 0 (when game is loaded in CPC models) does this means that you access ROM 0 inside your code, by directly applying rom read operations at 0000-&3fff address range? Or you need first to select it using an:OUT &DF00,&80 and then access it through &0000=&3FFF address range? Or maybe you use ROM 0 only at start up, so all this is meaningless?  :)
There is nothing like "Lower ROM 0", there is only "Lower ROM" since it's a single 16KB block. When lower ROM is enabled, you access it in the &0000-&3fff range, no further operations are required. The port &DF is only for upper ROM selection, it's nothing related to lower ROM.
like
0
No reactions