Author Topic: MODE / Inks resetting?  (Read 345 times)

0 Members and 1 Guest are viewing this topic.

Offline evolutional

  • CPC464
  • **
  • Posts: 5
  • Country: gb
    • Awards
MODE / Inks resetting?
« on: 23: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?
like
0
No reactions

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.426
  • Country: fr
    • Awards
Re: MODE / Inks resetting?
« Reply #1 on: 00:43, 25 September 21 »
RUNning a problem from Basic does that. To prevent this, LOAD it and CALL it instead.
like
0
No reactions
Targhan/Arkos

Arkos Tracker 2.0.1 now released! - Follow the news on Twitter!
Disark - A cross-platform Z80 disassembler/source converter
FDC Tool 1.1 - Read Amsdos files without the system

Imperial Mahjong
Orion Prime

Offline m_dr_m

  • 464 Plus
  • *****
  • Posts: 327
  • Country: gb
  • http://orgams.wikidot.com/
    • OrgaMS!
    • Awards
Re: MODE / Inks resetting?
« Reply #2 on: 08: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.
like
0
No reactions

Offline evolutional

  • CPC464
  • **
  • Posts: 5
  • Country: gb
    • Awards
Re: MODE / Inks resetting?
« Reply #3 on: 11:28, 25 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!
like
0
No reactions