CPCWiki forum

General Category => Programming => Topic started by: evolutional on 21:39, 24 September 21

Title: MODE / Inks resetting?
Post by: evolutional on 21:39, 24 September 21
Hey - I'm pretty new to CPC dev so I apologize if this is a n00b question :D

I'm writing a tape loader bootstrapper that has the following parts:


1. BASIC, set mode, set inks, RUN the next file...
2. Assembly loader / bootstrapper that loads in the screen (via CASREAD)
3. ... then loads the main asm program (again, via CASREAD) and jumps to it

The problem I'm hitting seems to be that as soon as the asm loader is loaded and executed (eg: RUN completes), the CPC resets the mode and the inks all go back to those the ROM initializes. This is causing the loading screen to be loaded in MODE 1 with the default palette - not what I was hoping for - especially as the asm loader doesn't touch the gate array.

Does anyone know what the cause for this behaviour is? Is there something I can do to prevent this?
Title: Re: MODE / Inks resetting?
Post by: Targhan on 22:43, 24 September 21
RUNning a problem from Basic does that. To prevent this, LOAD it and CALL it instead.
Title: Re: MODE / Inks resetting?
Post by: m_dr_m on 06:29, 25 September 21
Don't apologise, that's heartwarming to see beginners on CPC.


Yep, the firmware does several inits (including de-activating ROMs!) when running a binary program, to give the program a clean state.
Title: Re: MODE / Inks resetting?
Post by: evolutional on 09:28, 25 September 21
Quote from: Targhan on 22:43, 24 September 21
RUNning a problem from Basic does that. To prevent this, LOAD it and CALL it instead.


Ah perfect, thank you. A bit of wrangling to find a MEMORY location that was suitable and it worked, thanks!
Powered by SMFPacks Menu Editor Mod