c64mem: limited all files to -$0400
This commit is contained in:
parent
fc9bff2c60
commit
2875440702
6 changed files with 3 additions and 269 deletions
|
|
@ -320,23 +320,3 @@ $0332-$0333 ISAVE Vector: Indirect entry to Kernal SAVE
|
|||
$0334-$033B TEMP Unused.
|
||||
$033C-$03FB TBUFFR Tape I/O Buffer.
|
||||
$03FC-$03FF TEMP Unused.
|
||||
$0400-$07E7 VICSCN Default Screen Video Matrix.
|
||||
$07E8-$07F7 TEMP Unused.
|
||||
$07F8-$07FF SPNTRS Default Sprite Data Pointers.
|
||||
|
||||
$0800-$9FFF Normal BASIC Program space.
|
||||
$8000-$9FFF Optional Cartridge ROM space.
|
||||
$A000-$BFFF BASIC ROM (Part) or 8 KB RAM.
|
||||
$C000-$CFFF 4 KB RAM.
|
||||
$D000-$DFFF Input/Output Devices and Colour RAM or
|
||||
4 KB RAM or Character ROM.
|
||||
$D000-$D02E 6566 Video Interface Chip, VIC II.
|
||||
$D400-$D41C 6581 Sound Interface Device, SID.
|
||||
$D500-$D7FF SID Images.
|
||||
$D800-$DBE7 Colour RAM (Nybbles = 4 Bit RAM, LSB).
|
||||
$DBE8-$DBFF Unused Nybbles.
|
||||
$DC00-$DC0F 6526 Complex Interface Adaptor, CIA.
|
||||
$DD00-$DD0F 6526 Complex Interface Adaptor, CIA.
|
||||
$E000-$FFFF BASIC (Part)/Kernal ROM or 8 KB RAM.
|
||||
$E000-$E4FF BASIC ROM (Part) or RAM.
|
||||
$E500-$FFFF Kernal ROM or RAM.
|
||||
|
|
|
|||
|
|
@ -219,17 +219,3 @@ $032E-$032F USRCMD Warm start vector ($FE66)
|
|||
$0330-$0331 ILOAD LOAD link ($F4A5)
|
||||
$0332-$0333 ISAVE SAVE link ($F5ED)
|
||||
$033C-$03FB TBUFFR Cassette buffer
|
||||
$0400-$07FF VICSCN Screen memory
|
||||
$0800-$9FFF Basic ROM memory
|
||||
$8000-$9FFF Alternate: Rom plug-in area
|
||||
$A000-$BFFF ROM : Basic
|
||||
$A000-$BFFF Alternate: RAM
|
||||
$C000-$CFFF RAM memory, including alternate
|
||||
$D000-$D02E Video Chip (6566)
|
||||
$D400-$D41C Sound Chip (6581 SID)
|
||||
$D800-$DBFF Color nybble memory
|
||||
$DC00-$DC0F Interface chip 1, IRQ (6526 CIA)
|
||||
$DD00-$DD0F Interface chip 2, NMI (6526 CIA)
|
||||
$D000-$DFFF Alternate: Character set
|
||||
$E000-$FFFF ROM: Operating System
|
||||
$E000-$FFFF Alternate : RAM
|
||||
|
|
|
|||
|
|
@ -3378,180 +3378,3 @@ $033C-$03FB TBUFFER Cassette I/O Buffer
|
|||
$03FC-$03FF Unused
|
||||
|
||||
Four more free bytes.
|
||||
|
||||
$0400-$07FF VICSCN Video Screen Memory Area
|
||||
|
||||
This is the default location of the video screen memory area, which
|
||||
contains the video matrix and the sprite data pointers. Keep in mind,
|
||||
however, that the video screen memory area can be relocated to start
|
||||
on any even 1K boundary. Its location at any given moment is
|
||||
getermined by the VIC-II chip memory control register at 53272
|
||||
($D018), and the VIC-II memory bank select bits on CIA #2 Data Port A
|
||||
(56576, $DD00).
|
||||
|
||||
$0400-$07E7 Video Matrix: 25 Lines by 40 Columns
|
||||
|
||||
The video matrix is where thext screen characters are stored in RAM.
|
||||
Normally, the VIC-II chip will treat each byte of memory here as a
|
||||
screen display code and will display the text character that
|
||||
corresponds to that byte of code. The first byte of memory here will
|
||||
be displayed in the top-left corner of the screen, and subsequent
|
||||
bytes will be displayed in the columns to the right and the rows below
|
||||
that character.
|
||||
|
||||
It is possible to make text or graphics characters appear on the
|
||||
screen by POKEing their screen codes directly into this area of RAM.
|
||||
For example, the letter A has a screen code value of 1. Therefore,
|
||||
POKE 1024,1 should make the letter A appear in the top-left corner of
|
||||
the screen.
|
||||
|
||||
However, you should be aware that the most current version of the
|
||||
Operating System initializes the color RAM which is used for the
|
||||
foreground color of text characters to the same value as the
|
||||
background color every time that the screen is cleared. The result is
|
||||
that although the POKE will put a blue A on the screen, you won't be
|
||||
able to see it because it is the same color blue as the background.
|
||||
This can be remedied by POKEing a different value into color RAM
|
||||
(which starts at 55296 ($D800)).
|
||||
|
||||
A POKE 1024,1:POKE 1024+54272,1 will put a white A in the upper-left
|
||||
corner of the screen. The loop
|
||||
|
||||
FOR I=0 TO 255:POKE 1024+I,I:POKE 1024+54272+I,1:NEXT
|
||||
|
||||
will display all of the characters in white at the top of the screen.
|
||||
Another solution to the color RAM problem is to fool the Operating
|
||||
System into initializing the color RAM for you. If you change the
|
||||
background color to the desired foreground color before you clear the
|
||||
screen, color RAM will be set to that color. Then, all you have to do
|
||||
is change the background color back to what it was. This example will
|
||||
show how it's done:
|
||||
|
||||
10 POKE 53281,2:REM BACKGROUND IS RED
|
||||
20 PRINT CHR$(147):REM CLEAR SCREEN
|
||||
30 POKE 53281,1:REM BACKGROUND IS WHITE
|
||||
40 POKE 1024,1:REM RED "A" APPEARS IN TOP LEFT CORNER
|
||||
|
||||
$07F8-$07FF Sprite Shape Data Pointers
|
||||
|
||||
The last eight bytes of the video matrix (whether it is here at the
|
||||
default location, or has been relocated elsewhere) are used as
|
||||
pointers to the data blocks used to define the sprite shapes.
|
||||
|
||||
Each sprite is 3 bytes wide (24 bits) by 21 lines high. It therefore
|
||||
requires 63 bytes for its shape definition, but it actually uses 64
|
||||
bytes in order to arrive at an even 256 shape blocks in the 16K area
|
||||
of RAM which the VIC-II chip addresses.
|
||||
|
||||
Each pointer holds the current data block being used to define the
|
||||
shape of one sprite. The block numver used to define the shape of
|
||||
Sprite 0 is held in location 2040 ($07F8), the Sprite 1 shape block is
|
||||
designated by location 2041 ($07F9), etc. The value in the pointer
|
||||
times 64 equals the starting location of the sprite shape data table.
|
||||
For example, a value of 11 in location 2040 indicates that the shape
|
||||
data for Sprite 0 starts at address 704 (11*64), and continues for 63
|
||||
more bytes to 767.
|
||||
|
||||
For additional information on sprite graphics, see the entries for
|
||||
individual VIC-II chip sprite graphics locations, and the summary at
|
||||
the beginning of the VIC-II chip section, at 53248 ($D000).
|
||||
|
||||
$0800-$9FFF BASIC Program Text
|
||||
|
||||
This is the area where the actual BASIC program text is stored. The
|
||||
text of a BASIC program consists of linked lines of program tokens.
|
||||
Each line contains the following:
|
||||
|
||||
1. A two-byte pointer to the address of the next program line (in
|
||||
standard low-byte, high-byte order). After the last program line, a
|
||||
link pointer consisting of two zeros marks the end of the program.
|
||||
|
||||
2. A two-byte line number (also in low-byte, high-byte order).
|
||||
|
||||
3. The program commands. Each keyword is stored as a one-byte
|
||||
character whose value is equal to or greater than 128. Print, for
|
||||
example, is stored as the number 151. Other elements of the BASIC
|
||||
command, such as the variable names, string literals ("HELLO"), and
|
||||
numbers, are stored using their ASCII equivalents.
|
||||
|
||||
4. A 0 character, which acts as a line terminator. In order for
|
||||
BASIC to work correctly, the first character of the BASIC text area
|
||||
must be 0.
|
||||
|
||||
A quick review of the BASIC pointers starting at 43 ($002B) reveals that
|
||||
the layout of the BASIC program area (going from lower memory
|
||||
addresses to higher) is as follows:
|
||||
|
||||
* BASIC Program Text
|
||||
* Non-Array Variables and String Descriptors
|
||||
* Array Variables
|
||||
* Free Area (Reported by FRE(0))
|
||||
* String Text Area (Strings build from top of memory down into free area)
|
||||
* BASIC ROM
|
||||
|
||||
It is interesting to note that the NEW command does not zero out the
|
||||
text area but rather replaces the first link address in the BASIC
|
||||
program with two zeros, indicating the end of the program. Therefore,
|
||||
you can recover a program from a NEW by replacing the first link
|
||||
adress, finding the address of the two zeros that actually mark the
|
||||
end of the program, and setting the pointers at 45, 47, and 49 (which
|
||||
all point to the end of a BASIC program before the program is RUN) to
|
||||
the byte following these zeros.
|
||||
|
||||
$1000-$1FFF Character ROM Image for VIC-II Chip When Using Memory Bank 0 (Default)
|
||||
|
||||
Though the VIC-II chip shares memory with the 6510 processor chip, it
|
||||
does not always see that memory in exactly the same way as the main
|
||||
microprocessor.
|
||||
|
||||
Although the 6510 accesses RAM at these locations, when the VIC-II is
|
||||
banked to use the first 16K of RAM (which is the default condition),
|
||||
it sees the character ROM here (the 6510 cannot access this ROM unless
|
||||
it is switched into its memory at 49152 ($C000)). This solves the
|
||||
riddle of how the VIC-II chip can use the character ROM at 49152
|
||||
($C000) for character shape data and RAM at 1024 ($0400), when it can
|
||||
only address memory within a 16K range. It also means that the RAM at
|
||||
4096-8191 cannot be used for screen display memory or user-defined
|
||||
character dot data, and sprite data blocks 64-127 are not accessible.
|
||||
|
||||
You can verify this by turning on bitmap graphics with the screen
|
||||
memory set to display addresses from 0 to 8192. You will see that the
|
||||
bottom portion of the screen shows all of the text character shapes
|
||||
stored in the ROM. For more information on the format of text
|
||||
character data storage, see the description of the Character ROM at
|
||||
49152 ($C000).
|
||||
|
||||
$8000 Autostart ROM Cartridge
|
||||
|
||||
An 8K or 16K autostart ROM cartridge designed to use this as a
|
||||
starting memory address may be plugged into the Expansion Port on the
|
||||
back. If the cartridge ROM at locations 32772-32776 ($8004-$8008)
|
||||
contains the numbers 195, 194, 205, 56, 48 ($C3, $C2, $CD, $38, $30)
|
||||
when the computer powers up, it will start the program pointed to by
|
||||
the vector at locations 32768-32769 ($8000-$8001), and will use
|
||||
32770-32771 ($8002-$8003) for a warm start vector when the RESTORE key
|
||||
is pressed. These characters are PETASCII for the inverse letters
|
||||
CBM, followed by the digits 80. An autostart cartridge may also be
|
||||
addressed at 40960 ($A000), where it would replace BASIC, or at 61440
|
||||
($F000), where it would replace the Kernal.
|
||||
|
||||
It is possible to have a 16K cartridge sitting at 32768 ($8000), such
|
||||
as Simon's BASIC, which can be turned on and off so that the BASIC ROM
|
||||
underneath can also be used. Finally, it is even possible to have
|
||||
bank-selected cartridges, which turn banks of memory in the cartidge
|
||||
on and off alternately, so that a 32K program could fit into only 16K
|
||||
of addressing space.
|
||||
|
||||
$9000-$9FFF Character ROM Image for VIC-II Chip When Using Memory Bank 2
|
||||
|
||||
When the VIC-II chip is set up to use the third 16K block of memory
|
||||
for graphics (as would be the case when the 64 is set up to emulate
|
||||
the PET, which has its text screen memory at 32768 ($8000), it sees
|
||||
the character generator ROM at this address (see entry at 4096 ($1000)
|
||||
above for more details).
|
||||
|
||||
It should be noted that the character ROM is available only when the
|
||||
VIC-II chip is using banks 0 or 2. When using one of the other two
|
||||
banks, the user must supply all of the character shape data in a RAM
|
||||
table.
|
||||
|
||||
|
|
|
|||
|
|
@ -238,14 +238,3 @@ $0332-$0333 ISAVE KERNAL SAVE Routine Vector
|
|||
$0334-$033B Unused
|
||||
$033C-$03FB TBUFFR Tape I/O Buffer
|
||||
$03FC-$03FF Unused
|
||||
$0400-$07FF VICSCN 1024 Byte Screen Memory Area
|
||||
$0400-$07E7 Video Matrix: 25 Lines X 40 Columns
|
||||
$07F8-$07FF Sprite Data Pointers
|
||||
$0800-$9FFF Normal BASIC Program Space
|
||||
$8000-$9FFF VSP Cartridge ROM - 8192 Bytes
|
||||
$A000-$BFFF BASIC ROM - 8192 Bytes (or 8K RAM)
|
||||
$C000-$CFFF RAM - 4096 Bytes
|
||||
$D000-$DFFF Input/Output Devices and
|
||||
Color RAM or Character Generator ROM
|
||||
or RAM - 4096 Bytes
|
||||
$E000-$FFFF KERNAL ROM - 8192 Bytes (or 8K RAM)
|
||||
|
|
|
|||
|
|
@ -890,47 +890,3 @@ $0334-$033B Unused (8 bytes).
|
|||
$033C-$03FB TBUFFR Datasette buffer (192 bytes).
|
||||
|
||||
$03FC-$03FF Unused (4 bytes).
|
||||
|
||||
$0400-$07E7 VICSCN Default area of screen memory (1000 bytes).
|
||||
|
||||
$07E8-$07F7 Unused (16 bytes).
|
||||
|
||||
$07F8-$07FF Default area for sprite pointers (8 bytes).
|
||||
|
||||
$0800 Unused. (Must contain a value of 0 so that the BASIC program can be RUN.)
|
||||
|
||||
$0801-$9FFF Default BASIC area (38911 bytes).
|
||||
|
||||
$8000-$9FFF Optional cartridge ROM (8192 bytes).
|
||||
|
||||
$8000-$8001 Execution address of cold reset.
|
||||
|
||||
$8002-$8003 Execution address of non-maskable interrupt service routine.
|
||||
|
||||
$8004-$8008 Cartridge signature
|
||||
|
||||
If contains the uppercase PETSCII string "CBM80" ($C3,$C2,$CD,$38,$30) then the routine vectors are accepted by the KERNAL.
|
||||
|
||||
$A000-$BFFF BASIC ROM or RAM area (8192 bytes)
|
||||
|
||||
depends on the value of bits #0-#2 of the processor port at memory address $0001:
|
||||
|
||||
* %x00, %x01 or %x10: RAM area.
|
||||
* %x11: BASIC ROM.
|
||||
|
||||
$C000-$CFFF Upper RAM area (4096 bytes).
|
||||
|
||||
$DE00-$DEFF I/O Area #1, memory mapped registers or machine code routines of optional external devices (256 bytes)
|
||||
|
||||
Layout and contents depend on the actual device.
|
||||
|
||||
$DF00-$DFFF I/O Area #2, memory mapped registers or machine code routines of optional external devices (256 bytes)
|
||||
|
||||
Layout and contents depend on the actual device.
|
||||
|
||||
$E000-$FFFF KERNAL ROM or RAM area (8192 bytes)
|
||||
|
||||
depends on the value of bits #0-#2 of the processor port at memory address $0001:
|
||||
|
||||
* %x0x: RAM area.
|
||||
* %x1x: KERNAL ROM.
|
||||
|
|
|
|||
|
|
@ -286,7 +286,7 @@ while(True):
|
|||
list_symbol = []
|
||||
for i in range(0, files):
|
||||
if linenumber[i] >= len(data[i]):
|
||||
break
|
||||
continue
|
||||
line = data[i][linenumber[i]]
|
||||
address1 = line[1:5]
|
||||
address1 = int(address1, 16)
|
||||
|
|
@ -311,12 +311,12 @@ while(True):
|
|||
address2 = None
|
||||
symbol = None
|
||||
good_symbols = []
|
||||
for i in range(0, files):
|
||||
for i in range(0, len(list_address1)):
|
||||
if list_address1[i] == address1 and (address2 == None or (list_address2[i] != None and list_address2[i] > address2)):
|
||||
address2 = list_address2[i]
|
||||
|
||||
# get symbols of longest range
|
||||
for i in range(0, files):
|
||||
for i in range(0, len(list_address1)):
|
||||
if list_address1[i] == address1 and list_address2[i] == address2 and list_symbol[i] != '':
|
||||
good_symbols.append(list_symbol[i])
|
||||
#print('xxx', address1, address2, good_symbols)
|
||||
|
|
|
|||
Loading…
Reference in a new issue