Table of Contents

Class Banking

Namespace
GB
Assembly
GBSharp.Framework.dll

The currently mapped ROM bank.

public static class Banking
Inheritance
Banking
Inherited Members

Remarks

You should not normally need this. [Bank] handles switching for calls and the framework's loaders take the bank of the data they are given, so ordinary code never names a bank at runtime.

It exists because the framework and your own code reach the hardware through the same mechanism (thesis section 19), and because some patterns (walking a table that lives in another bank, say) cannot be expressed any other way. Switching by hand means you are responsible for restoring the previous bank, and for not doing it from code that is itself banked: the switch would unmap the function performing it.

Properties

Current

The bank currently mapped into the switchable window.

[Native("_current_bank")]
public static byte Current { get; }

Property Value

byte

Methods

Switch(byte)

Maps a bank into the switchable window.

[Native("gbs_bank_switch")]
public static void Switch(byte bank)

Parameters

bank byte

Remarks

Only safe from resident code. Save Current first if the caller needs the previous bank back.