Author Topic: Rom Initialisation  (Read 735 times)

0 Members and 1 Guest are viewing this topic.

Offline Ast

  • 6128 Plus
  • ******
  • Posts: 910
  • Country: fr
    • Amstrad cpc Website of Ast/iMPACT
  • Liked: 637
Rom Initialisation
« on: 15: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!
_____________________

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


Amstrad Plus French Forum

All friends are welcomed !

Offline CraigsBar

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.181
  • Country: ie
  • The party ain't over yet
    • index.php?action=treasury
  • Liked: 1114
Re: Rom Initialisation
« Reply #1 on: 16:23, 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


Offline Ast

  • 6128 Plus
  • ******
  • Posts: 910
  • Country: fr
    • Amstrad cpc Website of Ast/iMPACT
  • Liked: 637
Re: Rom Initialisation
« Reply #2 on: 01:08, 13 January 18 »
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"


Amstrad Plus French Forum

All friends are welcomed !

Offline HAL 6128

  • 464 Plus
  • *****
  • Posts: 453
  • Country: de
    • index.php?action=treasury
  • Liked: 223
Re: Rom Initialisation
« Reply #3 on: 14:17, 13 January 18 »
...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 Pentomino and NQ-Music-Disc with GFX

Offline Ast

  • 6128 Plus
  • ******
  • Posts: 910
  • Country: fr
    • Amstrad cpc Website of Ast/iMPACT
  • Liked: 637
Re: Rom Initialisation
« Reply #4 on: 12:39, 15 January 18 »
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"


Amstrad Plus French Forum

All friends are welcomed !

Offline robcfg

  • Supporter
  • 6128 Plus
  • *
  • Posts: 2.021
  • Country: se
  • 8-Bit Technomancer
    • index.php?action=treasury
  • Liked: 864
Re: Rom Initialisation
« Reply #5 on: 13:43, 15 January 18 »
Would you mind explaining how is it done, please?

Offline Ast

  • 6128 Plus
  • ******
  • Posts: 910
  • Country: fr
    • Amstrad cpc Website of Ast/iMPACT
  • Liked: 637
Re: Rom Initialisation
« Reply #6 on: 15:29, 15 January 18 »
Of course, i will do it tonight!
_____________________

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


Amstrad Plus French Forum

All friends are welcomed !

Offline Ast

  • 6128 Plus
  • ******
  • Posts: 910
  • Country: fr
    • Amstrad cpc Website of Ast/iMPACT
  • Liked: 637
Re: Rom Initialisation
« Reply #7 on: 22:06, 15 January 18 »
Here is the code source :


Code: [Select]

   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"


Amstrad Plus French Forum

All friends are welcomed !

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.331
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2236
Re: Rom Initialisation
« Reply #8 on: 22:18, 15 January 18 »

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

Offline Ast

  • 6128 Plus
  • ******
  • Posts: 910
  • Country: fr
    • Amstrad cpc Website of Ast/iMPACT
  • Liked: 637
Re: Rom Initialisation
« Reply #9 on: 22:36, 15 January 18 »
So all have been said...  :P
_____________________

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


Amstrad Plus French Forum

All friends are welcomed !

Offline Duke

  • Supporter
  • 6128 Plus
  • *
  • Posts: 965
  • Country: dk
    • spinpoint.org
  • Liked: 921
Re: Rom Initialisation
« Reply #10 on: 22:41, 15 January 18 »
Thanks @Ast , very handy :)

Offline IanS

  • CPC6128
  • ****
  • Posts: 194
  • Country: gb
    • index.php?action=treasury
  • Liked: 49
Re: Rom Initialisation
« Reply #11 on: 23:08, 15 January 18 »
How do the extra roms reserve memory?. Does each extra rom get IY setup correctly when the commands are run?

Offline rpalmer

  • 464 Plus
  • *****
  • Posts: 495
  • Country: au
  • Liked: 333
Re: Rom Initialisation
« Reply #12 on: 23:08, 15 January 18 »
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

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 713
  • Country: de
  • Reincarnation of TFM
  • Liked: 337
Re: Rom Initialisation
« Reply #13 on: 16:38, 16 January 18 »
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 ROM, but able to display a sign on message for example.

http://futureos.de --> Get the revolutionary FutureOS (Recent update: 2018.08.23)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Ver.: 2018.08.15)

Offline Ast

  • 6128 Plus
  • ******
  • Posts: 910
  • Country: fr
    • Amstrad cpc Website of Ast/iMPACT
  • Liked: 637
Re: Rom Initialisation
« Reply #14 on: 16:32, 17 January 18 »
don't panic ! It runs ! That's the most important no ?
_____________________

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


Amstrad Plus French Forum

All friends are welcomed !