Funkheld,
I am not sure I follow..
SCREEN $80 ...
from the doc -
$80 320x240@256c
40x30 text
this makes layer 0 over 64K ! - per the VERA doc, the KERNAL VRAM map has this -
$0:0000-$1:2BFF 320x240@256c Bitmap
and indeed.. 320*240*8bits per pixel = 75 KB ...
Then you set L1_Config to $64 - only the 4 matters here though, since it sets bitmap mode ... for 1 BPP ... which means every 8 pixels in a row is within 1 byte ... 320x240*1bpp = 320*240 / 8 = 9.375K
Because layer0 is "oversized" here, you have this in VRAM now -
$0:0000 Layer0 - start of layer0 line 0
$0:FF00 Layer 0 - start of layer0 line 204
$1:0000 Layer 0 - 256,204 of layer 0.... Layer 1 starts ...
$1:2580 Layer0 - 256,234 ..... Layer1 end
$1:2C00 Layer0 has ended..
The layers overlap in memory... my example with the multiple layers and setting layer1 at $1:0000 had layer0 set to 4bit, which would occupy only 37.5KB !
If you want to have layer0 be 8bit graphics starting at $0:0000, then you can't put anything else before $1:2C00 and still have 320x240..
You could set the vscale to stretch the pixels and use less in height - 320x200 would be 62.5K ... or you would have to set layer1 higher up in VRAM .. at 1bpp it _is_ only ~9.5K ... so isn't really problem setting L1_tilebase to $1:2C00 >> 9 .... $96 ...
Then in VRAM the 2 layers wouldn't overlap and interfere with each other..
this works even for layer1 up to 4bit - 4bit 320x240 would be 37.5KB ... so first 75K is 8bit layer0, then + 37.5KB = 112.5K of VRAM used out of the ~126.5K that is up for grabs..
OR, another way to think of this overlapping issue... is that layer0 should be covered from line ~204 down... Like if one used sprites or layer0 to cover the bottom ~40 lines with some sort of status display or something, then you effectively have a 320x240 video mode but layer0 is only really using 320x200 ...
but for now, just be aware of where everything _ends_ in VRAM, because the VERA does not care if you tell it everything is using the same VRAM somehow...
As small example, a few of my assembler programs have a little debug font set loaded at $0:0000, and then I stuck layer0 as a 256 color layer starting at $0:0000 .... but I used a tile layer1 that purposely obscured the first 7 or 8 lines at the top of the screen, so it didn't matter that was where my tileset was...
https://github.com/hstubbs3/CommanderX1 ... ls-001.asm
https://github.com/hstubbs3/CommanderX1 ... g_font.inc
and this is why somewhere near the top of my own code I have taken to doing this - just commenting the heck out of what is where in VRAM and how large it all is... What my plan is, since the VRAM "memory map" is basically up to the programmer...
; VRAM Addresses
; Address range Description
; $00000 - $1F9BF Video RAM - 129,424 bytes -> 126K is 129,024 (1F800)
; $1F9C0 - $1F9FF PSG registers
; $1FA00 - $1FBFF Palette
; $1FC00 - $1FFFF Sprite attributes
VRAM_SPRITES = $00000 ; putting sprite data at start of VRAM for now.. may move later?
VRAM_BITMAP_LAYERA =$11800 ; starts at 70K ... so up to ~70K for sprites.. not too shabby..
VRAM_BITMAP_LAYERB =$18000 ; ~25K needs to start at 2K boundary... 121.5-25= 96k
VRAM_TEXT_SCREEN = $1E400 ; 121.5K 256 x 21 => 32 x 24 would take 1.5K tiles is min.. 64*32 = 2K 8 config..
VRAM_SPRITE_BUF = $1EC00 ; 123K - sprite attribute buffer for swapping data in ..
VRAM_CHARSET = $1F000 ; $1:F000-$1:F7FF Charset loaded by kernal here .. is at 124K ..
; only can go to 126K ...
VRAM_palette = $1FA00 ;
VRAM_sprite_attributes = $1FC00