It is currently Sun Oct 22, 2017 3:56 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Thu Aug 06, 2015 12:18 pm 
Offline

Joined: Fri Jul 24, 2015 1:30 pm
Posts: 18
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


Last edited by gnarlyWarlock on Thu Aug 06, 2015 12:43 pm, edited 2 times in total.

Top
 Profile  
 
PostPosted: Thu Aug 06, 2015 12:26 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19115
Location: NE Indiana, USA (NTSC)
Does it copy the value directly into $0148, or does it take the base 2 logarithm?


Top
 Profile  
 
PostPosted: Thu Aug 06, 2015 12:36 pm 
Offline

Joined: Fri Jul 24, 2015 1:30 pm
Posts: 18
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


Top
 Profile  
 
PostPosted: Thu Aug 06, 2015 12:45 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19115
Location: NE Indiana, USA (NTSC)
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.


Top
 Profile  
 
PostPosted: Thu Aug 06, 2015 1:45 pm 
Offline

Joined: Fri Jul 24, 2015 1:30 pm
Posts: 18
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?


Top
 Profile  
 
PostPosted: Fri Aug 07, 2015 10:00 am 
Offline

Joined: Fri Aug 07, 2015 9:53 am
Posts: 1
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.


Top
 Profile  
 
PostPosted: Fri Aug 07, 2015 12:55 pm 
Offline
User avatar

Joined: Sat Jan 03, 2015 5:58 pm
Posts: 367
Location: ...
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group