News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_Ast

Rom Initialisation

Started by Ast, 14:58, 12 January 18

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ast

Hi !


A simple question... As everybody know (or not?) amstrad firmware is able to initialise the 16th first roms (0-15) on cpc 6128 and up to 8 (0-7) on cpc 464.
But if i want to use 16-31 slots, how can i do to init them ? Does anyone know about it ?
Please, don't speak about "booster.rom", i don't want to use it...
Thanks for your futures advices!
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcome !

CraigsBar

Quote from: Ast on 14:58, 12 January 18
Hi !


A simple question... As everybody know (or not?) amstrad firmware is able to initialise the 16th first roms (0-15) on cpc 6128 and up to 8 (0-7) on cpc 464.
But if i want to use 16-31 slots, how can i do to init them ? Does anyone know about it ?
Please, don't speak about "booster.rom", i don't want to use it...
Thanks for your futures advices!
Fw 3.1 initialises 0-31

Sent from my ONEPLUS 3t using Tapatalk

IRC:  #Retro4All on Freenode

Ast

Sorry but, rom 16-31 are not initialised with fw 3.15 :/
All i want to see would be a piece of code... why not ?


If you can't i will take a piece of cake...
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcome !

HAL6128

...there are two different type of FW31.5. One with 16 ROM slot support and another with 32. Look a the filenames on the disk image.
...proudly supported Schnapps Demo, Pentomino and NQ-Music-Disc with GFX

Ast

Thanks for your help!
I have decided to code my own and i have succeeded!
iMPdos does it during the boot (all 32 roms are initialised!)
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcome !

robcfg

Would you mind explaining how is it done, please?

Ast

Of course, i will do it tonight!
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcome !

Ast

Here is the code source :




   org #a000
;
; Add roms 16 up to 31
; (c)Ast/iMPACT January 2017
;   
   di
num   ld a,16 ; We start with rom number 16
   ld bc,#7f84+2 ; Upper rom On | Lower rom off | Mode 2
   out (c),c
   ld b,#df
   out (c),a ; Connect the rom selected in Upper Rom
   ld a,(#c006)
   cp #c3
   call z,found ; If a rom is found.....
   ld a,(num+1)
   inc a ; next rom
   ld (num+1),a
   cp #20 ; Max Rom
   jr nc,allromsok ; Si rom>=#20 go to
   jr num ; Else test if next rom is connected
allromsok
   ld bc,#7f8e ; Upper and Lower roms off | Mode 2
   out (c),c
   ld bc,#df00 ; Select Rom 0
   out (c),c
   ei
   ret
;
; If a rom is found then...
;
found
   ld a,(num+1) ; a=rom number found
   ld hl,(#b8d3) ; Last rom found Adress
   push hl ; save it
   dec hl
   dec hl
   dec hl
   dec hl ; New adress
   ld (#b8d3),hl ;
   pop de ; de=hl
   ld (hl),e ; poke new rom adress
   inc hl
   ld (hl),d
   inc hl
   ld (hl),a ; and rom number
   inc hl
   ld (hl),0
   ret



I hope it could help some people to understand how it works...
Thank you for reading as Capcom said !
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcome !

arnoldemu


Thank you for the code.  :)

If anyone wants to use this code on 464, then you can start at 8 and use &b1a6 instead of &b8d3.

My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Ast

So all have been said...  :P
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcome !

Duke


IanS

How do the extra roms reserve memory?. Does each extra rom get IY setup correctly when the commands are run?

rpalmer

Ast,

The code you supplied assumes all ROM types require initialization which is incorrect. There are 3 types foreground, background and extension.

According to Soft968 Section 10 which states that foreground ROMs are responsible for initializing background ROMs. Extension ROM types are never initialized since they provide only support routines and jump instruction at &C006 may cause problems if called unexpectedly.

The code should have tested the ROM type (at &C000) and if it is a foreground/background  type then assume the jump instruction is at &C006 to initialize the ROM. This is how the firmware manual describes how the system handles ROM initialization. Soft968 Section 10 also references initializing background ROMs via KL_ROM_WALK and KL_INIT_BACK, but these are for background ROMs with no foreground ROM as I understand it.

rpalmer

GUNHED

#13
In addition there are three more ROM types:

- FutureOS extension ROMs (ignored by native OS)
- CP/M expansion ROMs (ignored by native OS)
- Background ROMs returning with Carry cleared from initialization, therefore not using RAM, but able to display a sign on message for example.
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

Ast

don't panic ! It runs ! That's the most important no ?
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcome !

Squeekboxandj

Hey, old thread I know but thanks to Ast for the Rom initialisation code and thanks to Arnoldemu for the tweek. I used this code on my 464 and assembled it to &8000 instead of &a000 and saved as a binary file. Now all 0-31 roms are working.


Happy New Year everybody.
CPC464 & 6128

Ast

Great !
It's cool to read someone is using this piece of code. Thanks to U !
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcome !

Powered by SMFPacks Menu Editor Mod