What exactly is a slot in WLA?

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
What exactly is a slot in WLA?
by on (#152510)
So, I've specified that I want a pure ROM (.CARTRIDGETYPE 0), 16KB, just bank 0, and as such, in the beginning of my header I write
Code:
.ROMBANKSIZE $4000
.ROMBANKS 0

Now in the WLA documentation, it says that giving the 0 argument will force two banks, at 32KBytes (I presume it means total). HOWEVER, cartridge type ($0147) specifies 0 to be pure ROM, and $0148 specifies that the 0 argument will force each bank size to be 32KBytes (NO ROM banking...but then, how can there be no MBC when we have two banks, 0-$8000? So, what in the hell is .CARTRIDGETYPE 0? Just some nonexistent type?).

Now, outisde of my confusion, WLA doesn't even want to bother assembling. It just throws ".ROMBANKS needs a positive integer value"...So, 0 isn't even a valid value?>>!?


P.S. A beginner question: what exactly is a SLOT? I've searched high and low and I can't find the proper explanation
Thanks
Re: WLA - Pure ROM specifier in header
by on (#152513)
Does it copy the value directly into $0148, or does it take the base 2 logarithm?
Re: WLA - Pure ROM specifier in header
by on (#152514)
Lol nvm, I should've read it more accurately. I realized the smallest amount of banks you can have is 2, since addresses $4000-$7FFF are always accessible, just that the MBC is used when you have more than 2 banks. Sorry about that.

But yeah, what is a SLOT, I still needa know lol

P.S. it's neither, it just does some hardcoded conversions I think, I launched bgb and it didn't throw any errors. So I assume when I specify .ROMBANKS 2 it writes a 0 to $0148
Re: WLA - Pure ROM specifier in header
by on (#152515)
Google wla-dx slot returned this older topic, which defined "slot" as what the VESA spec calls a "window": part of the CPU address space through which a particular part of the ROM (a "bank") can be read.

On NES, an UNROM cartridge has 4 or 8 banks, which are mapped into two windows (or "slots") in the CPU address space. One window is $8000-$BFFF; writes to the mapper port select which bank is visible in this switchable window. The other window is $C000-$FFFF, and it is always mapped to the last bank of the ROM. MBCs on Game Boy work similarly: MBC1 has a window at $0000-$3FFF fixed to the first bank of the ROM and a switchable window at $4000-$7FFF controlled by writes to $2000.

A no-MBC cartridge (comparable to an NROM cartridge on NES) has one bank that encompasses the entire ROM, which is mapped into one window from $0000-$7FFF.
Re: WLA - Pure ROM specifier in header
by on (#152520)
tepples wrote:
Google wla-dx slot returned this older topic, which defined "slot" as what the VESA spec calls a "window": part of the CPU address space through which a particular part of the ROM (a "bank") can be read.

On NES, an UNROM cartridge has 4 or 8 banks, which are mapped into two windows (or "slots") in the CPU address space. One window is $8000-$BFFF; writes to the mapper port select which bank is visible in this switchable window. The other window is $C000-$FFFF, and it is always mapped to the last bank of the ROM. MBCs on Game Boy work similarly: MBC1 has a window at $0000-$3FFF fixed to the first bank of the ROM and a switchable window at $4000-$7FFF controlled by writes to $2000.

A no-MBC cartridge (comparable to an NROM cartridge on NES) has one bank that encompasses the entire ROM, which is mapped into one window from $0000-$7FFF.


Fair enough. So, slots are in essence an abstraction for the programmer? Could I specify, for example, 4 slots in bank 0, lets say a slot for bg tiles, sprites, program code, and header? I'm a bit confused, as you say that an UNROM is mapped to two windows, however, on an NROM, the window stretches across the entire ROM, so I guess the NES doesn't care about the slot sizes/locations

Are slots like sections, just to help you configure your ROM mapping the way you want it?
Re: What exactly is a slot in WLA?
by on (#152580)
I use RGBDS, so take this answer with a grain of salt, but for GB/GBC, the "slot" would be the memory area from $0000-$3FFF, and $4000-$7FFF. It just references the addresses.

On all Gameboy cartridges, ROM bank 0 is mapped to $0000-$3FFF, and that bank is always available. You can't switch it out. The address range $4000-$7FFF is for ROM banks 1 -> xxxx, and those are switchable. The "slot" points to the address for range $0000-$3FFF and another points to $4000-$7FFF.
Re: What exactly is a slot in WLA?
by on (#152602)
A slot is a location in memory. If you wanted $2000 bytes of ram at $c000, you'd make a slot with size $2000 at $c000 (obviously). So that would be:
Code:
slotsize $2000
slot 0 $c000


You can also use slots for the Gameboy's two accessible banks:
Code:
slotsize $4000
slot 0 $0000
slot 1 $4000