Author Topic: Bank switching - instant?  (Read 349 times)

0 Members and 1 Guest are viewing this topic.

Offline shaymanjohn

  • CPC464
  • **
  • Posts: 26
  • Country: gb
  • Liked: 67
  • Likes Given: 27
Bank switching - instant?
« on: 15:49, 27 May 20 »
When switching memory banks (on a 6128) does the newly selected bank become immediately available, or does it take some time to switch in (maybe end of hblank, or vblank, or some other time)?


This is the code I'm using to switch banks:


ld b, 0x7f
ld c, 0xc4 ; this value is the scheme
out (c), c
... use data from new bank ...


Thanks




Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 1.870
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
  • Liked: 849
  • Likes Given: 2103
Re: Bank switching - instant?
« Reply #1 on: 16:29, 27 May 20 »
When switching memory banks (on a 6128) does the newly selected bank become immediately available,
Yes, it does.

This is the code I'm using to switch banks:
ld b, 0x7f
ld c, 0xc4 ; this value is the scheme
out (c), c
... use data from new bank ...
Thanks

It's more quick and smaller to use:
LD BC,&7FC4
OUT (C),C



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

Offline shaymanjohn

  • CPC464
  • **
  • Posts: 26
  • Country: gb
  • Liked: 67
  • Likes Given: 27
Re: Bank switching - instant?
« Reply #2 on: 16:33, 27 May 20 »
Ah yes!


Thanks GUNHED  :) 
« Last Edit: 16:38, 27 May 20 by shaymanjohn »