General Category > Programming

How to Transfer ROMS to rom board from cpr file, for ALCON, future os,spacem etc

(1/5) > >>

ikonsgr:
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...  ???

gerald:
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

ikonsgr:
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...  ???  :)

andycadley:
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).

ikonsgr:
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)?

Navigation

[0] Message Index

[#] Next page

Go to full version
Powered by SMFPacks Reactions Mod
Powered by SMFPacks Alerts Pro Mod
Powered by SMFPacks Mentions Pro Mod