Closed Kroc closed 4 years ago
A string label for a slot is a great idea! But I think I can also make it so that when you refer to a SLOT you can use its address. But when you have a SLOT starting at address $2 and you try to use SLOT 2, that should issue a warning and a note which one is used, a SLOT starting at $2 or a SLOT number 2...
Agreed!
I made it so that SLOTs can now be given names, but you still need to give a SLOT a number as well. Next I'll add support for SLOT selection by its address...
I hope it works now, it was quite a big change in the code...
This will be great for sharing sections between different systems!
SLOT IDs are rather arbitrary, especially on a system where there will usually be overlapping SLOTs; that is, you may wish to assign RAM sections into SLOTs that overlap an underlying BANK/SLOT. Take for example this commodore 64 map:
Since the C64 is all RAM, you can begin your code at $0200 (although in practice, you would begin at $0801) and continue going all the way up to $FFFF
However, if you want to assign some large areas of RAM for non-code (such as where game levels are loaded in), you don't want to assign that space inline with your code.
$C000-$CFFF
is an unused patch of RAM and is often used for variables or machine code. $D000-$DFFF is the I/O address space, and no code can be placed there, but the RAM underneath can be used. $E000-$FFFF is the KERNAL ROM space, but again the RAM underneath can be used.In this instance, the SLOT numbers are not helpful or indicative when used on
.SECTION
/.RAMSECTION
directives. Being able to assign more indicative numbers to SLOT IDs would go some way in increasing readability:For projects compiling for multiple systems, that may be assigning code & RAM sections into vastly different memory layouts; slot numbers work against us. What might be SLOT 3 on one system, might be SLOT 5 on another. Having some kind of either label (or string) name assignment for SLOTs would alleviate this concern: