Add missing docs
This commit is contained in:
parent
7270dac4c8
commit
f743bf5ea9
45
files/Quickdev16_1.5_sdcard.txt
Normal file
45
files/Quickdev16_1.5_sdcard.txt
Normal file
@ -0,0 +1,45 @@
|
||||
--------------------------------
|
||||
SDcard Board
|
||||
--------------------------------
|
||||
Connector
|
||||
|
||||
1 DO -> 7
|
||||
2 GND -> 6
|
||||
3 VCC -> 4
|
||||
4 CS -> 1
|
||||
5 DI -> 2
|
||||
6 CLK -> 5
|
||||
-
|
||||
SDcard
|
||||
------------------\
|
||||
| \
|
||||
| 8 7 6 5 4 3 2 1 9 |
|
||||
| |
|
||||
|
||||
1 CS
|
||||
2 CMD/DI
|
||||
3 GND
|
||||
4 VCC
|
||||
5 CLK/SCLK
|
||||
6 GND
|
||||
7 DAT/DO
|
||||
8 --
|
||||
9 --
|
||||
|
||||
|
||||
--------------------------------
|
||||
Quickdev Header
|
||||
--------------------------------
|
||||
top/usb
|
||||
1 GND -> GND
|
||||
2 ISP RST - RESET -
|
||||
3 ISP SCK - PB7 - CLK
|
||||
4 ISP MISO - PB6 - DI
|
||||
5 ISP MOSI - PB5 - DO
|
||||
6 MMC CS - PB4 - CS
|
||||
7 VCC -> VCC
|
||||
|
||||
|
||||
|
||||
#define SPI_DI 6 MISO
|
||||
#define SPI_DO 5 MOSI
|
||||
BIN
files/Quickdev16_Seeedstudio2.6_orderlist.ods
Normal file
BIN
files/Quickdev16_Seeedstudio2.6_orderlist.ods
Normal file
Binary file not shown.
BIN
files/Quickdev16_Seeedstudio2.6_parts_2.6_reichelt_CSD.ods
Normal file
BIN
files/Quickdev16_Seeedstudio2.6_parts_2.6_reichelt_CSD.ods
Normal file
Binary file not shown.
29
files/Quickdev16_ascii_banner.txt
Normal file
29
files/Quickdev16_ascii_banner.txt
Normal file
@ -0,0 +1,29 @@
|
||||
________ .__ __ ________ ____ ________
|
||||
\_____ \ __ __|__| ____ | | __\______ \ _______ _/_ |/ _____/
|
||||
/ / \ \| | \ |/ ___\| |/ / | | \_/ __ \ \/ /| / __ \
|
||||
/ \_/. \ | / \ \___| < | ` \ ___/\ / | \ |__\ \
|
||||
\_____\ \_/____/|__|\___ >__|_ \/_______ /\___ >\_/ |___|\_____ /
|
||||
\__> \/ \/ \/ \/ \/
|
||||
___.
|
||||
__ __ _____\_ |__
|
||||
| | \/ ___/| __ \
|
||||
| | /\___ \ | \_\ \
|
||||
|____//____ >|___ /
|
||||
\/ \/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
BIN
files/Quickdev16_label.odt
Normal file
BIN
files/Quickdev16_label.odt
Normal file
Binary file not shown.
BIN
files/Quickdev16_label_rund.odt
Normal file
BIN
files/Quickdev16_label_rund.odt
Normal file
Binary file not shown.
BIN
files/docs/avr/A200_PDIUSBD12-08.pdf
Normal file
BIN
files/docs/avr/A200_PDIUSBD12-08.pdf
Normal file
Binary file not shown.
18951
files/docs/avr/A300_atmega644-xx.pdf
Normal file
18951
files/docs/avr/A300_atmega644-xx.pdf
Normal file
File diff suppressed because one or more lines are too long
25130
files/docs/avr/at90usb.pdf
Normal file
25130
files/docs/avr/at90usb.pdf
Normal file
File diff suppressed because one or more lines are too long
BIN
files/docs/avr/at90usb646.pdf
Normal file
BIN
files/docs/avr/at90usb646.pdf
Normal file
Binary file not shown.
BIN
files/docs/avr/at90usb_overview.pdf
Normal file
BIN
files/docs/avr/at90usb_overview.pdf
Normal file
Binary file not shown.
BIN
files/docs/avr/at90usb_short.pdf
Normal file
BIN
files/docs/avr/at90usb_short.pdf
Normal file
Binary file not shown.
BIN
files/docs/avr/stk500.pdf
Normal file
BIN
files/docs/avr/stk500.pdf
Normal file
Binary file not shown.
BIN
files/docs/ftdi/DS_FT232R_V202.pdf
Normal file
BIN
files/docs/ftdi/DS_FT232R_V202.pdf
Normal file
Binary file not shown.
BIN
files/docs/ftdi/FT232RL.pdf
Normal file
BIN
files/docs/ftdi/FT232RL.pdf
Normal file
Binary file not shown.
2248
files/docs/snes/65816.STD
Normal file
2248
files/docs/snes/65816.STD
Normal file
File diff suppressed because it is too large
Load Diff
515
files/docs/snes/65816/addrmode.txt
Normal file
515
files/docs/snes/65816/addrmode.txt
Normal file
@ -0,0 +1,515 @@
|
||||
|
||||
G65SC802 and G65SC816
|
||||
Microprocessor Addressing modes
|
||||
|
||||
The G65SC816 is capable of directly addressing 16 MBytes of memory.
|
||||
This address space has special significance within certain addressing
|
||||
modes, as follows:
|
||||
|
||||
Reset and Interrupt Vectors
|
||||
The Reset and Interrupt vectors use the majority of the fixed addresses
|
||||
between 00FFE0 and 00FFFF.
|
||||
|
||||
Stack
|
||||
The Native mode Stack address will always be within the range 000000 to
|
||||
00FFFF. In the Emulation mode, the Stack address range is 000100 to 0001FF.
|
||||
The following opcodes and addressing modes can increment or decrement beyond
|
||||
this range when accessing two or three bytes:
|
||||
JSL; JSR (a,x); PEA; PEI; PER; PHD; PLD; RTL; d,s; (d,s),y.
|
||||
|
||||
Direct
|
||||
The Direct addressing modes are often used to access memory registers and
|
||||
pointers. The contents of the Direct Register (D) is added to the offset
|
||||
contained in the instruction operand to produce an address in the range 000000
|
||||
to 00FFFF. Note that in the Emulation mode, [Direct] and [Direct],y addressing
|
||||
modes and the PEI instruction will increment from 0000FE or 0000FF into the
|
||||
Stack area, even if D=0.
|
||||
|
||||
Program Address Space
|
||||
The Program Bank register is not affected by the Relative, Relative Long,
|
||||
Absolute, Absolute Indirect, and Absolute Indexed Indirect addressing modes
|
||||
or by incrementing the Program Counter from FFFF. The only instructions that
|
||||
affect the Program Bank register are: RTI, RTL, JML, JSL, and JMP Absolute
|
||||
Long. Program code may exceed 64K bytes altough code segments may not span
|
||||
bank boundaries.
|
||||
|
||||
Data Address Space
|
||||
The data address space is contiguous throughout the 16 MByte address space.
|
||||
Words, arrays, records, or any data structures may span 64K byte bank
|
||||
boundaries with no compromise in code efficiency. As a result, indexing from
|
||||
page FF in the G65SC802 may result in data accessed in page zero. The
|
||||
following addressing modes generate 24-bit effective addresses.
|
||||
|
||||
* Direct Indexed Indirect (d,x)
|
||||
* Direct Indirect Indexed (d),y
|
||||
* Direct Indirect (d)
|
||||
* Direct Indirect Long [d]
|
||||
* Direct Indirect Indexed Long [d],y
|
||||
* Absolute
|
||||
* Absolute,x
|
||||
* Absolute,y
|
||||
* Absolute long
|
||||
* Absolute long indexed
|
||||
* Stack Relative Indirect Indexed (d,s),y
|
||||
|
||||
The following addressing mode descriptions provide additional detail as
|
||||
to how effective addresses are calculated.
|
||||
|
||||
Twenty-four addressing modes are available for use with the G65SC802
|
||||
and G65SC816 microprocessors. The "long" addressing modes may be
|
||||
used with the G65SC802; however, the high byte of the address is not
|
||||
available to the hardware. Detailed descriptions of the 24 addressing
|
||||
modes are as follows:
|
||||
|
||||
|
||||
1. Immediate Addressing -- #
|
||||
The operand is the second byte (second and third bytes when in the 16-bit
|
||||
mode) of the instruction.
|
||||
|
||||
|
||||
2. Absolute -- a
|
||||
|
||||
With Absolute addressing the second and third bytes of the instruction form
|
||||
the low-order 16 bits of the effective address. The Data Bank Register
|
||||
contains the high-order 8 bits of the operand address.
|
||||
|
||||
__________________________
|
||||
Instruction: | opcode | addrl | addrh |
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Operand
|
||||
Address: | DB | addrh | addrl |
|
||||
|
||||
|
||||
|
||||
3. Absolute Long -- al
|
||||
|
||||
The second, third, and fourth byte of the instruction form the 24-bit
|
||||
effective address.
|
||||
|
||||
__________________________________
|
||||
Instruction: | opcode | addrl | addrh | baddr |
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Operand
|
||||
Address: | baddr | addrh | addrl |
|
||||
|
||||
|
||||
4. Direct -- d
|
||||
|
||||
The second byte of the instruction is added to the Direct Register
|
||||
(D) to form the effective address. An additional cycle is required
|
||||
when the Direct Register is not page aligned (DL not equal 0). The
|
||||
Bank register is always 0.
|
||||
|
||||
___________________
|
||||
Instruction: | opcode | offset |
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
| Direct Register |
|
||||
|
||||
+ | offset |
|
||||
---------------------
|
||||
Operand
|
||||
Address: | 00 | effective address |
|
||||
|
||||
|
||||
5. Accumulator -- A
|
||||
This form of addressing always uses a single byte instruction. The
|
||||
operand is the Accumulator.
|
||||
|
||||
|
||||
6. Implied -- i
|
||||
|
||||
Implied addressing uses a single byte instruction. The operand is implicitly
|
||||
defined by the instruction.
|
||||
|
||||
|
||||
7. Direct Indirect Indexed -- (d),y
|
||||
|
||||
This address mode is often referred to as Indirect,Y. The second byte of the
|
||||
instruction is added to the Direct Register (D). The 16-bit contents of this
|
||||
memory location is then combined with the Data Bank register to form a 24-bit
|
||||
base address. The Y Index Register is added to the base address to form the
|
||||
effective address.
|
||||
|
||||
___________________
|
||||
Instruction: | opcode | offset |
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
| Direct Register |
|
||||
|
||||
+ | offset |
|
||||
---------------------
|
||||
| 00 | direct address |
|
||||
|
||||
|
||||
then:
|
||||
| 00 | (direct address) |
|
||||
|
||||
+ | DB |
|
||||
-------------------------------
|
||||
| base address |
|
||||
|
||||
+ | | Y Reg |
|
||||
------------------------------
|
||||
Operand
|
||||
Address: | effective address |
|
||||
|
||||
|
||||
|
||||
8. Direct Indirect Indexed Long -- [d],y
|
||||
|
||||
With this addressing mode the 24-bit base address is pointed to by
|
||||
the sum of the second byte of the instruction and the Direct
|
||||
Register The effective address is this 24-bit base address plus the Y
|
||||
Index Register
|
||||
|
||||
___________________
|
||||
Instruction: | opcode | offset |
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
| Direct Register |
|
||||
|
||||
+ | offset |
|
||||
---------------------
|
||||
| 00 | direct address |
|
||||
|
||||
|
||||
then:
|
||||
| (direct address) |
|
||||
|
||||
+ | | Y Reg |
|
||||
------------------------------
|
||||
Operand
|
||||
Address: | effective address |
|
||||
|
||||
|
||||
|
||||
9. Direct Indexed Indirect -- (d,x)
|
||||
|
||||
This address mode is often referred to as Indirect X The second
|
||||
byte of the Instruction is added to the sum of the Direct Register
|
||||
and the X Index Register. The result points to the low-order 16 bits
|
||||
of the effective address. The Data Bank Register contains the high-
|
||||
order 8 bits of the effective address.
|
||||
|
||||
___________________
|
||||
Instruction: | opcode | offset |
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
| Direct Register |
|
||||
|
||||
+ | offset |
|
||||
---------------------
|
||||
| direct address |
|
||||
|
||||
+ | | X Reg |
|
||||
---------------------
|
||||
| 00 | address |
|
||||
|
||||
|
||||
then:
|
||||
| 00 | (address) |
|
||||
|
||||
+ | DB |
|
||||
-------------------------------
|
||||
Operand
|
||||
Address: | effective address |
|
||||
|
||||
|
||||
|
||||
10. Direct Indexed With X -- d,x
|
||||
|
||||
The second byte of the instruction is added to the sum of the Direct Register
|
||||
and the X Index Register to form the 16-bit effective address. The operand is
|
||||
always in Bank 0.
|
||||
|
||||
___________________
|
||||
Instruction: | opcode | offset |
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
| Direct Register |
|
||||
|
||||
+ | offset |
|
||||
---------------------
|
||||
| direct address |
|
||||
|
||||
+ | | X Reg |
|
||||
-------------------------------
|
||||
Operand
|
||||
Address: | 00 | effective address |
|
||||
|
||||
|
||||
|
||||
11. Direct Indexed With Y -- d,y
|
||||
|
||||
The second byte of the instruction is added to the sum of the Direct Register
|
||||
and the Y Index Register to form the 16-bit effective address. The operand is
|
||||
always in Bank 0.
|
||||
|
||||
___________________
|
||||
Instruction: | opcode | offset |
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
| Direct Register |
|
||||
|
||||
+ | offset |
|
||||
---------------------
|
||||
| direct address |
|
||||
|
||||
+ | | Y Reg |
|
||||
-------------------------------
|
||||
Operand
|
||||
Address: | 00 | effective address |
|
||||
|
||||
|
||||
|
||||
12. Absolute Indexed With X -- a,x
|
||||
|
||||
The second and third bytes of the instruction are added to the
|
||||
X Index Register to form the low-order 16 bits of the ef~ective ad-
|
||||
dress The Data Bank Register contains the high-order 8 bits of the
|
||||
effective address
|
||||
|
||||
____________________________
|
||||
Instruction: | opcode | addrl | addrh |
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
| DB | addrrh | addrl |
|
||||
|
||||
+ | | X Reg |
|
||||
-------------------------------
|
||||
Operand
|
||||
Address: | effective address |
|
||||
|
||||
|
||||
|
||||
13. Absolute Indexed With Y -- a,y
|
||||
|
||||
The second and third bytes of the instruction are added to the
|
||||
Y Index Register to form the low-order 16 bits of the eftective ad-
|
||||
dress The Data Bank Register contains the high-order 8 bits of tne
|
||||
effective address.
|
||||
|
||||
____________________________
|
||||
Instruction: | opcode | addrl | addrh |
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
| DB | addrrh | addrl |
|
||||
|
||||
+ | | Y Reg |
|
||||
-------------------------------
|
||||
Operand
|
||||
Address: | effective address |
|
||||
|
||||
|
||||
|
||||
14. Absolute Long Indexed With X -- al,x
|
||||
|
||||
The second third and fourth bytes ot the instruction form a 24-bit base
|
||||
address. The effective address is the sum of this 24-bit address and the
|
||||
X Index Register.
|
||||
|
||||
____________________________________
|
||||
Instruction: | opcode | addrl | addrh | baddr |
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
| baddr | addrrh | addrl |
|
||||
|
||||
+ | | X Reg |
|
||||
-------------------------------
|
||||
Operand
|
||||
Address: | effective address |
|
||||
|
||||
|
||||
|
||||
15. Program Counter Relative -- r
|
||||
|
||||
This address mode referred to as Relative Addressing is used only with the
|
||||
Branch instructions. If the conditlon being tested is met, the second byte
|
||||
of the instruction is added to the Program Counter, which has been updated
|
||||
to point to the opcode of the next instruction. The offset is a signed 8-bit
|
||||
quantity in the range from -128 to 127 The Program Bank Register is not
|
||||
affected.
|
||||
|
||||
|
||||
16. Program Counter Relative Long -- rl
|
||||
|
||||
This address mode referred to as Relative Long Addressing is used only with
|
||||
the Unconditional Branch Long instruction (BRL) and the Push Effective
|
||||
Relative instruction (PER). The second and third 2 bytes of the instruction
|
||||
are added to the Program Counter which has been updated to point to the opcode
|
||||
of the next instruction. With the branch instruction the Program Counter is
|
||||
loaded with the result With the Push Effective Relative instruction the result
|
||||
is stored on the stack. The offset and result are both an unsigned 16-bit
|
||||
quantity in the range 0 to 65535.
|
||||
|
||||
|
||||
17. Absolute Indirect -- (a)
|
||||
|
||||
The second and third bytes of the instruction form an address to a pointer
|
||||
in Bank 0. The Program Counter is loaded with the first and second bytes at
|
||||
this pointer With the Jump Long (JML) instruction the Program Bank Register
|
||||
is loaded with the third byte of the pointer
|
||||
|
||||
____________________________
|
||||
Instruction: | opcode | addrl | addrh |
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
| baddr | addrrh | addrl |
|
||||
|
||||
|
||||
Indirect Address = | 00 | addrh | addrl |
|
||||
|
||||
New PC = (indirect address)
|
||||
|
||||
with JML:
|
||||
|
||||
New PC = (indirect address)
|
||||
|
||||
New PB = (indirect address +2)
|
||||
|
||||
|
||||
|
||||
18. Direct Indirect -- (d)
|
||||
|
||||
The second byte of the instruction is added to the Direct Register to form
|
||||
a pointer to the low-order 16 bits of the effective address. The Data Bank
|
||||
Register contains the high-order 8 bits of the effective address.
|
||||
|
||||
|
||||
___________________
|
||||
Instruction: | opcode | offset |
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
| Direct Register |
|
||||
|
||||
+ | offset |
|
||||
---------------------
|
||||
| 00 | direct address |
|
||||
|
||||
|
||||
then:
|
||||
| 00 | (direct address) |
|
||||
|
||||
+ | DB |
|
||||
-------------------------------
|
||||
Operand
|
||||
Address: | effective address |
|
||||
|
||||
|
||||
|
||||
19. Direct Indirect Long -- [d]
|
||||
|
||||
The second byte of the instruction is added to the Direct Register to form
|
||||
a pointer to the 24-bit effective address.
|
||||
|
||||
___________________
|
||||
Instruction: | opcode | offset |
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
| Direct Register |
|
||||
|
||||
+ | offset |
|
||||
---------------------
|
||||
| 00 | direct address |
|
||||
|
||||
|
||||
then:
|
||||
-------------------------------
|
||||
Operand
|
||||
Address: | (direct address) |
|
||||
|
||||
|
||||
|
||||
20. Absolute Indexed Indirect -- (a,x)
|
||||
|
||||
The second and third bytes of the instruction are added to the X Index
|
||||
Register to form a 16-bit pointer in Bank 0. The contents of this pointer
|
||||
are loaded in the Program Counter. The Program Bank Register is not changed.
|
||||
|
||||
____________________________
|
||||
Instruction: | opcode | addrl | addrh |
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
| addrrh | addrl |
|
||||
|
||||
+ | | X Reg |
|
||||
-------------------------------
|
||||
| 00 | address |
|
||||
|
||||
then:
|
||||
PC = (address)
|
||||
|
||||
|
||||
|
||||
21. Stack -- s
|
||||
|
||||
Stack addressing refers to all instructions that push or pull data from the
|
||||
stack such as Push, Pull, Jump to Subroutine, Return from Subroutine,
|
||||
Interrupts, and Return from Interrupt. The bank address is always 0.
|
||||
Interrupt Vectors are always fetched from Bank 0.
|
||||
|
||||
|
||||
22. Stack Relative -- d,s
|
||||
|
||||
The low-order 16 bits of the effective address is formed from the sum of the
|
||||
second byte of the instruction and the Stack Pointer. The high-order 8 bits
|
||||
of the effective address is always zero. The relative offset is an unsigned
|
||||
8-bit quantity in the range of 0 to 255.
|
||||
|
||||
___________________
|
||||
Instruction: | opcode | offset |
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
| Stack Pointer |
|
||||
|
||||
+ | offset |
|
||||
---------------------
|
||||
| 00 | effective address |
|
||||
|
||||
|
||||
|
||||
23. Stack Relative Indirect Indexed -- (d,s),y
|
||||
|
||||
The second byte of the instruction is added to the Stack Pointer to form
|
||||
a pointer to the low-order 16-bit base address in Bank 0. The Data Bank
|
||||
Register contains the high-order 8 bits of the base address. The effective
|
||||
address is the sum of the 24-bit base address and the Y Index Register.
|
||||
|
||||
___________________
|
||||
Instruction: | opcode | offset |
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
| Stack Pointer |
|
||||
|
||||
+ | offset |
|
||||
---------------------
|
||||
| 00 | S + offset |
|
||||
|
||||
|
||||
then:
|
||||
| S + offset |
|
||||
|
||||
+ | DB |
|
||||
-------------------------------
|
||||
| base address |
|
||||
|
||||
+ | | Y Reg |
|
||||
------------------------------
|
||||
Operand
|
||||
Address: | effective address |
|
||||
|
||||
|
||||
|
||||
24. Block Source Bank, Destination Bank -- xyc
|
||||
|
||||
This addressing mode is used by the Block Move instructions.
|
||||
The second byte of the instruction contains the high-order 8 bits of the
|
||||
destination address.
|
||||
The Y Index Register contains the low-order 16 bits of the destination
|
||||
address. The third byte of the instruction contains the high-order 8 bits
|
||||
of the source address.
|
||||
The X Index Register contains the low-order 16 bits of the source address.
|
||||
The Accumulator contains one less than the number of bytes to move.
|
||||
The second byte of the block move instructions is also loaded into the Data
|
||||
Bank Register.
|
||||
|
||||
____________________________
|
||||
Instruction: | opcode | dstbnk | srcbnk |
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
dstbnk -> DB
|
||||
|
||||
Source Address: | scrbnk | X reg |
|
||||
|
||||
Destination Address: | DB | Y reg |
|
||||
|
||||
|
||||
Increment (MVN) or decrement (MVP) X and Y.
|
||||
Decrement A (if greaterthan zero) then PC-3 -> PC.
|
||||
|
||||
823
files/docs/snes/65816/detailop.txt
Normal file
823
files/docs/snes/65816/detailop.txt
Normal file
@ -0,0 +1,823 @@
|
||||
|
||||
Table 9. Detailed Instruction Operation
|
||||
|
||||
ADDRESS MODE
|
||||
CYCLE /VP /ML VDA VPA ADDRESS BUS DATA BUS R/W
|
||||
|
||||
|
||||
1 Immediate -- #
|
||||
(LDY,CPY,CPX,LDX,ORA,AND,EOR,ADC,BIT,LDA,CMP,SBC,REP,SEP)
|
||||
(14 Op Codes)
|
||||
(2 and 3 bytes)
|
||||
(2 and 3 cycles)
|
||||
|
||||
1 1 1 1 1 PBR,PC Op Code 1
|
||||
2 1 1 0 1 PBR,PC+1 IDL 1
|
||||
2a 1 1 0 1 PBR,PC+2 IDH 1
|
||||
|
||||
|
||||
|
||||
2a Absolute -- a
|
||||
(BIT,STY,STZ,LDY,CPY,CPX,STX,LDX,ORA,AND,EOR,ADC,STA,LDA,CMP,SBC)
|
||||
(16 Op Codes)
|
||||
(3 bytes)
|
||||
(4 and 5 cycles)
|
||||
|
||||
1 1 1 1 1 PBR,PC Op Code 1
|
||||
2 1 1 0 1 PBR,PC+1 AAL 1
|
||||
3 1 1 0 1 PBR,PC+2 AAH 1
|
||||
4 1 1 1 0 DBR,AA Data Low 1/0
|
||||
(1) 4a 1 1 1 0 DBR,AA+1 Data High 1/0
|
||||
|
||||
|
||||
2b Absolute (R-M-W) -- a
|
||||
(ASL,ROL,LSR,ROR,DEC,INC,TSB,TRB)
|
||||
(8 Op Codes)
|
||||
(3 bytes)
|
||||
(6 and 8 cycles)
|
||||
|
||||
1 1 1 1 1 PBA,PC Op Code 1
|
||||
2 1 1 0 1 PBR,PC+1 AAL 1
|
||||
3 1 1 0 1 PBR,PC+2 AAH 1
|
||||
4 1 0 1 0 DBR,AA Data Low 1
|
||||
(1) 4a 1 0 1 0 DBR,AA+1 Data High 1
|
||||
(3) 5 1 0 0 0 DBR,AA+2 IO 1
|
||||
(1) 6a 1 0 1 0 DBR,AA+3 Data Hiqh 0
|
||||
6 1 0 1 0 DBR,AA Data Low 0
|
||||
|
||||
|
||||
2c Absolute(JUMP) -- a
|
||||
(JMP)(4C)
|
||||
(1 Op Code)
|
||||
(3 bytes)
|
||||
(3 cycles)
|
||||
1 1 1 1 1 PBR,PC Op Code 1
|
||||
2 1 1 0 1 PBR,PC+1 NEW PCL 1
|
||||
3 1 1 0 1 PBR,PC+2 NEW PCH 1
|
||||
1 1 1 1 1 PBR,NEWPC New Op Code 1
|
||||
|
||||
|
||||
2d Absolute (Jump to subroutine) -- a
|
||||
(JSR)
|
||||
(1 Op Code)
|
||||
(3 bytes)
|
||||
(6 cycles)
|
||||
(different order from N6502)
|
||||
|
||||
1 1 1 1 1 PBR,PC Op Code 1
|
||||
2 1 1 0 1 PBA,PC+1 NEW FCC 1
|
||||
3 1 1 0 1 PBR,PC+2 NEW PCH 1
|
||||
4 1 1 0 0 PBR,PC+2 IO 1
|
||||
5 1 1 1 0 0,S PCH 0
|
||||
6 1 1 1 0 0,S-1 PCL 0
|
||||
1 1 1 1 1 PBA,NEWPC New Op Code 1
|
||||
|
||||
|
||||
|
||||
3a Absolute Long -- al
|
||||
(ORA,AND,EOR,ADC,STA,LDA,CMP,SBC)
|
||||
(8 Op Codes)
|
||||
(4 bytes)
|
||||
(5 and 6 cycles)
|
||||
|
||||
1 1 1 1 1 PBR,PC Op Code 1
|
||||
2 1 1 0 1 PBR,PC+1 AAL 1
|
||||
3 1 1 0 1 PBR,PC+2 AAH 1
|
||||
4 1 1 0 1 PBR,PC+3 AAB 1
|
||||
5 1 1 1 0 AAB,AA Data Low 1/0
|
||||
(1) 5a 1 1 1 0 AAB,AA+1 Data High 1/0
|
||||
|
||||
|
||||
3b Absolute Long (JUMP) -- al
|
||||
(JMP)
|
||||
(1 Op Code)
|
||||
(4 bytes)
|
||||
(4 cycles)
|
||||
1 1 1 1 1 PBR,PC Op Code 1
|
||||
2 1 1 0 1 PBR,PC+1 NEW PCL 1
|
||||
3 1 1 0 1 PBR,PC+2 NEW PCH 1
|
||||
4 1 1 0 1 PBR,PC+3 NEW BR 1
|
||||
1 1 1 1 1 NEW PBR,PC New Op Code 1
|
||||
|
||||
|
||||
3c Absolute Long (Jump to Subroutine Long) -- al
|
||||
(JSL)
|
||||
(1 Op Code)
|
||||
(4 bytes)
|
||||
(7 cycles)
|
||||
1 1 1 1 1 PBR,PC Op Code 1
|
||||
2 1 1 0 1 PBR,PC+1 NEW PCL 1
|
||||
3 1 1 0 1 PBR,PC+2 NEW PCH 1
|
||||
4 1 1 1 0 0,S PBR 0
|
||||
5 1 1 0 0 0,S IO 1
|
||||
6 1 1 0 1 PBR,PC+3 NEW PBR 1
|
||||
7 1 1 1 0 0,S-1 PCH 0
|
||||
8 1 1 1 0 0,S-2 FCL 0
|
||||
1 1 1 1 1 NEW PBR,PC New Op Code 1
|
||||
|
||||
|
||||
|
||||
4a Direct -- d
|
||||
(BIT,STZ,STY,LDY,CPY,CPX,STX,LDX,ORA,AND,EOR,ADC,STA,LDA,CMP,SBC)
|
||||
(16 Op Codes)
|
||||
(2 bytes)
|
||||
(3,4 and 5 cycles)
|
||||
|
||||
1 1 1 1 1 PBR,PC Op Code 1
|
||||
2 1 1 0 1 PBR,PC+1 DO 1
|
||||
(2) 2a 1 1 0 0 PBR,PC+2 IO 1
|
||||
3 1 1 1 0 0,D+DO Data Low 1/0
|
||||
(1) 3a 1 1 1 0 0,D+DO+1 Data High 1/0
|
||||
|
||||
|
||||
4b Direct (R-M-W) -- d
|
||||
(ASL,ROL,LSR,ROR,DEC,INC,TSB,TRB)
|
||||
(8 Op Codes)
|
||||
(2 bytes)
|
||||
(5,6,7 and 8 cycles)
|
||||
|
||||
1 1 1 1 1 PBR,PC Op Code 1
|
||||
2 1 1 0 1 PBR,PC+1 DO 1
|
||||
(2) 3a 1 1 0 0 PBR,PC+1 IO 1
|
||||
3 1 0 1 0 0,D+DO Data Low 1
|
||||
(1) 3a 1 0 1 0 0,D+DO+1 Data High 1
|
||||
(3) 4 1 0 0 0 0,D+DO+1 IO 1
|
||||
(1) 5a 1 0 1 0 0,D+D0+1 Data High 0
|
||||
5 1 0 1 0 0,D+DO Data Low 0
|
||||
|
||||
|
||||
|
||||
5 Accumurator -- A
|
||||
(ASL,INC,ROL,DEC,LSR,ROR)
|
||||
(6 Op Codes)
|
||||
(1 byte)
|
||||
(2 cycles)
|
||||
|
||||
1 1 1 1 1 PBR,PC Op COde 1
|
||||
2 1 1 0 0 PBR,PC+1 IO 1
|
||||
|
||||
|
||||
|
||||
6a Implied -- i
|
||||
(DEY,INY,INX,DEX,NOP,XCE,TYA,TAY,TXA,TXS,TAX,TSX,TCS,TSC,TCD,TDC,
|
||||
TXY,TYX,CLC,SEC,CLI,SEI,CLV,CLD,SED)
|
||||
(25 Op Codes)
|
||||
(1 byte)
|
||||
(2 cycles)
|
||||
|
||||
1 1 1 1 1 PBR,PC Op Code 1
|
||||
2 1 1 0 0 PBR,PC+1 IO 1
|
||||
|
||||
|
||||
*6b Implied -- i
|
||||
(XBA)
|
||||
(1 Op Code)
|
||||
(1 byte)
|
||||
(3 cycles)
|
||||
|
||||
1 1 1 1 1 PBR,PC Op Code 1
|
||||
2 1 1 0 0 PBR,PC+1 IO 1
|
||||
3 1 1 0 0 PBR,PC+1 IO 1
|
||||
|
||||
|
||||
|
||||
ADDRESS MODE
|
||||
CYCLE /VP /ML VDA VPA RDY ADDRESS BUS DATA BUS R/W
|
||||
|
||||
|
||||
6c Wait for Interrupt
|
||||
(WAI)
|
||||
(1 Op Code)
|
||||
(1 byte)
|
||||
(3 cycles)
|
||||
|
||||
1 1 1 1 1 1 PBR,PC Op Code 1
|
||||
(9) 2 1 1 0 0 1 PBR,PC+1 IO 1
|
||||
3 1 1 0 0 0 PBR,PC+1 IO 1
|
||||
IRQ,NMI 1 1 1 1 1 1 PBR,PC+1 IRO(BRK) 1
|
||||
|
||||
|
||||
6d Stop-The-Clock
|
||||
(STP)
|
||||
(1 Op Code)
|
||||
(1 byte)
|
||||
(3 cycles)
|
||||
|
||||
1 1 1 1 1 1 PBR,PC Op Code 1
|
||||
2 1 1 0 0 1 PBR,PC+1 IO 1
|
||||
RES=1 3 1 1 0 0 1 PBR,PC+1 IO 1
|
||||
RES=0 1c 1 1 0 0 1 PBR,PC+1 RES(BRK) 1
|
||||
RES=0 1b 1 1 0 0 1 PBR,PC+1 RES(BRK) 1
|
||||
RES=1 1a 1 1 0 0 1 PBR,PC+1 RES(BRK) 1
|
||||
1 1 1 1 1 1 PBR,PC+1 BEGIN 1
|
||||
|
||||
See 21a Stack (Hardware interrupt)
|
||||
|
||||
|
||||
|
||||
ADDRESS MODE
|
||||
CYCLE /VP /ML VDA VPA ADDRESS BUS DATA BUS R/W
|
||||
|
||||
7 Direct Indirect Indexed -- (d),y
|
||||
(ORA,AND,EOR,ADC,STA,LDA,CMP,SBC)
|
||||
(8 Op Codes)
|
||||
(2 bytes)
|
||||
(5,6,7 and 8 cycles)
|
||||
|
||||
1 1 1 1 1 PBR,PC Op Code 1
|
||||
2 1 1 0 1 PBR,PC+1 DO 1
|
||||
(2) 2a 1 1 0 0 PBR,PC+1 IO 1
|
||||
3 1 1 1 0 0,D+DO AAL 1
|
||||
4 1 1 1 0 0,D+DO+1 AAH 1
|
||||
(4) 4a 1 1 0 0 DBR,AAH,AAL+YL IO 1
|
||||
5 1 1 1 0 DBR,AA+Y Data Low 1/0
|
||||
(1) 5a 1 1 1 1 DBR,AA+Y+1 Data High 1/0
|
||||
|
||||
|
||||
|
||||
8 Direct Indirect Indexed Long -- [d],y
|
||||
(ORA,AND,EOR,ADC,STA,LDA,CMP,SBC)
|
||||
(8 Op Codes)
|
||||
(2 bytes)
|
||||
(6,7 and 8 cycles)
|
||||
|
||||
1 1 1 1 1 PBR,PC Op Code 1
|
||||
2 1 1 0 1 PBR,PC+1 DO 1
|
||||
(2) 2a 1 1 0 0 PBR,PC+1 IO 1
|
||||
3 1 1 1 0 0,D+DO AAL 1
|
||||
4 1 1 1 0 0,D+DO+1 AAH 1
|
||||
5 1 1 1 0 0,D+DO+2 AAB 1
|
||||
6 1 1 1 0 AAB,AA+Y Data Low 1/0
|
||||
(1) 6a 1 1 1 0 AAB,AA+Y+1 Data High 1/0
|
||||
|
||||
|
||||
|
||||
9 Direct Indexed Indirect -- (d,x)
|
||||
(ORA,AND,EOR,ADC,STA,LDA,CMP,SBC)
|
||||
(8 Op Codes)
|
||||
(2 bytes)
|
||||
(6,7 and 8 cycles)
|
||||
|
||||
1 1 1 1 1 PBR,PC Op Code 1
|
||||
2 1 1 0 1 PBR,PC+1 DO 1
|
||||
(2) 2a 1 1 0 0 PBR,PC+1 IO 1
|
||||
3 1 1 0 0 PBR,PC+1 IO 1
|
||||
a 1 1 1 0 0,D+DO+X AAL 1
|
||||
5 1 1 1 0 0,D+DO+X+1 AAH 1
|
||||
6 1 1 1 0 DBR,AA Data Low 1/0
|
||||
(1) 6a 1 1 1 0 DBR,AA+1 Data High 1/0
|
||||
|
||||
|
||||
|
||||
10a Direct,X -- d,x
|
||||
(BIT,STZ,STY,LDY,ORA,AND,EOR,ADC,STA,LDA,CMP,SBC)
|
||||
(12 Op Codes)
|
||||
(2 bytes)
|
||||
(4,5 and 6 cycles)
|
||||
|
||||
1 1 1 1 1 PBR,PC Op Code 1
|
||||
2 1 1 0 1 PBR,PC+1 DO 1
|
||||
(2) 2a 1 1 0 0 PBR,PC+1 IO 1
|
||||
3 1 1 0 0 PBR,PC+1 IO 1
|
||||
4 1 1 1 0 0,D+DO+X Data Low 1/0
|
||||
(1) 4a 1 1 1 0 0,D+DO+X+1 Data High 1/0
|
||||
|
||||
|
||||
10b Direct,X (R-M-W) -- d,x
|
||||
(ASL,ROL,LSR,ROR,DEC,INC)
|
||||
(6 Op Codes)
|
||||
(2 bytes)
|
||||
(6,7,8 and 9 cycles)
|
||||
|
||||
1 1 1 1 1 PBR,PC Op Code 1
|
||||
2 1 1 0 1 PBR,PC+1 DO 1
|
||||
(2) 2a 1 1 0 0 PBR,PC+1 IO 1
|
||||
3 1 1 0 0 PBR,PC+1 IO 1
|
||||
4 1 0 1 0 0,D+DO+X Data Low 1
|
||||
(1) 4a 1 0 1 0 0,D+DO+X+1 Data High 1
|
||||
(3) 5 1 0 0 0 0,D+DO+X+1 IO 1
|
||||
(1) 6a 1 0 1 0 0,D+DO+X+1 Data High 0
|
||||
6 1 0 1 0 0,D+DO+X Data Low 0
|
||||
|
||||
|
||||
|
||||
11 Direct,Y -- d,y
|
||||
(STX,LDX)
|
||||
(2 Op Codes)
|
||||
(2 bytes)
|
||||
(4,5 and 6 cycles)
|
||||
|
||||
1 1 1 1 1 PBR,PC Op Code 1
|
||||
2 1 1 0 1 PBR,PC+1 DO 1
|
||||
(2) 2a 1 1 0 0 PBR,PC+1 IO 1
|
||||
3 1 1 0 0 PBR,PC+1 IO 1
|
||||
4 1 1 1 0 0,D+DO+Y Data Low 1/0
|
||||
(1) 4a 1 1 1 0 0,D+DO+Y+1 Data High 1/0
|
||||
|
||||
|
||||
|
||||
12a Absolute,X -- a,x
|
||||
(BlT,LDY,STZ,ORA,AND,EOR,ADC,STA,LDA,CMP,SBC)
|
||||
(11 Op Codes)
|
||||
(3 bytes)
|
||||
(4,5 and 6 cycles)
|
||||
|
||||
1 1 1 1 1 PBR,PC Op code 1
|
||||
2 1 1 0 1 PBR,PC+1 AAL 1
|
||||
3 1 1 0 1 PBR,PC+2 AAH 1
|
||||
(4) 3a 1 1 0 0 DBR,AAH,AAL+XL IO 1
|
||||
4 1 1 1 0 DBR,AA+X Data Low 1/0
|
||||
(1) 4a 1 1 1 0 DBR,AA+X+1 Data High 1/0
|
||||
|
||||
|
||||
12b Absolute,X (R-M-W) -- a,x
|
||||
(ASC,ROL,LSR,ROR,DEC,INC)
|
||||
(6 Op Codes)
|
||||
(3 bytes)
|
||||
(7 and 9 cycles)
|
||||
|
||||
1 1 1 1 1 PBR,PC Op Code 1
|
||||
2 1 1 0 1 PBR,PC+1 AAL 1
|
||||
3 1 1 0 1 PBR,PC+2 AAH 1
|
||||
4 1 1 0 0 DBR,AAH,AAL+XL IO 1
|
||||
5 1 0 1 0 DBR,AA+X Data Low 1
|
||||
(1) 5a 1 0 1 0 DBR,AA+X+1 Data High 1
|
||||
(3) 6 1 0 0 0 DBR,AA+X+1 lO 1
|
||||
(1) 7a 1 0 1 0 DBR,AA+X+1 Data High 0
|
||||
7 1 0 1 0 DBR,AA+X Data Low 0
|
||||
|
||||
|
||||
|
||||
*13 Absolute Long,X -- al,x
|
||||
(ORA,AND,EOR,ADC,STA,LDA,CMP,SBC)
|
||||
(8 Op Codes)
|
||||
(4 bytes)
|
||||
(5 and 6 cycles)
|
||||
|
||||
1 1 1 1 1 PBR,PC Op Code 1
|
||||
2 1 1 0 1 PBR,PC+1 AAL 1
|
||||
3 1 1 0 1 PBR,PC+7 AAH 1
|
||||
4 1 1 0 1 PBA,PC+3 AAB 1
|
||||
5 1 1 1 0 AAB,AA+X Data Low 1/0
|
||||
(1) 5a 1 1 1 0 AAB,AA+X+1 Data High 1/0
|
||||
|
||||
|
||||
|
||||
14 Absolute,Y -- a,y
|
||||
(LDX,ORA,AND,EOR,ADC,STA,LDA,CMP,SBC)
|
||||
(9 Op Codes)
|
||||
(3 bytes)
|
||||
(4,5 and 6 cycles)
|
||||
|
||||
1 1 1 1 1 PBR,PC Op Code 1
|
||||
2 1 1 0 1 PBR,PC+1 AAL 1
|
||||
3 1 1 0 1 PBR,PC+2 AAH 1
|
||||
(4) 3a 1 1 0 0 DBR,AAH,AAL+YL IO 1
|
||||
4 1 1 1 0 DBR,AA+Y Data Low 1/0
|
||||
(1) 4a 1 1 1 0 DBR,AA+Y+1 Data High 1/0
|
||||
|
||||
|
||||
|
||||
15 Relative -- r
|
||||
(BPL,BMI,BVC,BVS,BCC,BCS,BNE,BEQ,BRA)
|
||||
(9 Op Codes)
|
||||
(2 bytes)
|
||||
(2,3 and 1 cycles)
|
||||
|
||||
1 1 1 1 1 PBR,PC Op Code 1
|
||||
2 1 1 0 1 PBR,PC+1 Offset 1
|
||||
(5) 2a 1 1 0 0 PBR,PC+2 IO 1
|
||||
(61 2b 1 1 0 0 PBR,PC+2+OFF IO 1
|
||||
1 1 1 1 1 PBR,NewPC New Op Code 1
|
||||
|
||||
|
||||
|
||||
*16 Relative Long -- rl
|
||||
(BRL)
|
||||
(1 Op Code)
|
||||
(3 bytes)
|
||||
(4 cycles)
|
||||
|
||||
1 1 1 1 1 PBR,PC Op Code 1
|
||||
2 1 1 0 1 PBR,PC+1 Offset Low 1
|
||||
3 1 1 0 1 PBR,PC+2 Offset High 1
|
||||
4 1 1 0 0 PBR,PC+2 IO 1
|
||||
1 1 1 1 1 PBR,NewPC New Op Code 1
|
||||
|
||||
|
||||
|
||||
17a Absolute Indirect -- (a)
|
||||
(JMP)
|
||||
(1 Op Code)
|
||||
(3 bytes)
|
||||
(5 cycles)
|
||||
|
||||
1 1 1 1 1 PBR,PC Op Code 1
|
||||
2 1 1 0 1 PBR,PC+1 AAL 1
|
||||
3 1 1 0 1 PBR,PC+2 AAH 1
|
||||
4 1 1 1 0 0,AA NEW PCL 1
|
||||
5 1 1 1 0 0,AA+1 NEW PCH 1
|
||||
1 1 1 1 1 PBR,NewPC New Op Code 1
|
||||
|
||||
|
||||
*17b Absolute Indirect -- (a)
|
||||
(JML)
|
||||
(1 Op Code)
|
||||
(3 bytes)
|
||||
(6 cycles)
|
||||
|
||||
1 1 1 1 1 PBR,PC Op Code 1
|
||||
2 1 1 0 1 PBR,PC+1 AAL 1
|
||||
3 1 1 0 1 PBR,PC+1 AAH 1
|
||||
4 1 1 1 0 0,AA NEW PCL 1
|
||||
5 1 1 1 0 0,AA+1 NEW PCH 1
|
||||
6 1 1 1 0 0,AA+2 NEW PBR 1
|
||||
1 1 1 1 1 NEW PBR,PC New Op Code 1
|
||||
|
||||
|
||||
|
||||
**18 Direct Indirect -- (d)
|
||||
(ORA,AND,EOR,ADC,STA,LDA,CMP,SBC)
|
||||
(8 Op Codes)
|
||||
(2 bytes)
|
||||
(5,6 and 7 cycles)
|
||||
|
||||
1 1 1 1 1 PBR,PC Op Code 1
|
||||
2 1 1 0 1 PBR,PC+1 DO 1
|
||||
(2) 2a 1 1 0 0 PBR,PC+1 IO 1
|
||||
3 1 1 1 0 0,D+DO AAL 1
|
||||
1 1 1 1 0 0,D+DO+1 AAH 1
|
||||
5 1 1 1 0 DBR,AA Data Low 1/0
|
||||
(1) 5a 1 1 1 0 DBR,AA+1 Data Low 1/0
|
||||
|
||||
|
||||
|
||||
*19 Direct Indirect Long -- [d]
|
||||
(ORA,AND,EOR,ADC,STA,LDA,CMP,SBC)
|
||||
(8 Op Codes)
|
||||
(2 bytes)
|
||||
(6,7 and 8 cycles)
|
||||
|
||||
1 1 1 1 1 PBR,PC Op Code 1
|
||||
2 1 1 0 1 PBR,PC+1 DO 1
|
||||
(2) 2a 1 1 0 0 PBR,PC+1 IO 1
|
||||
3 1 1 1 0 0,D+DO AAL 1
|
||||
4 1 1 1 0 0,D+DO+1 AAH 1
|
||||
5 1 1 1 0 0,D+DO+2 AAB 1
|
||||
6 1 1 1 0 AAB,AA Data Low 1/0
|
||||
(1) 6a 1 1 1 0 AAB,AA+1 Data High 1/0
|
||||
|
||||
|
||||
|
||||
20a Absolute Indexed Indirect -- (a,x)
|
||||
(JMP)
|
||||
(1 Op Code)
|
||||
(3 bytes)
|
||||
(6 cycles)
|
||||
|
||||
1 1 1 1 1 PBR,PC Op Code 1
|
||||
2 1 1 0 1 PBR,PC+1 AAL 1
|
||||
3 1 1 0 1 PBR,PC+2 AAH 1
|
||||
4 1 1 0 0 PBR,PC+2 IO 1
|
||||
5 1 1 0 1 PBR,AA+X NEW PCL 1
|
||||
6 1 1 0 1 PBR,AA+X+1 NEW PCH 1
|
||||
1 1 1 1 1 PBR,NEWPC New Op Code 1
|
||||
|
||||
|
||||
*20b Absolute Indered Indirect (Jump to Subroutine Indexed Indirect) -- (a,x)
|
||||
(JSR)
|
||||
(1 Op Code)
|
||||
(3 bytes)
|
||||
(8 cycles)
|
||||
|
||||
1 1 1 1 1 PBR,PC Op Code 1
|
||||
2 1 1 0 1 PBR,PC+1 AAL 1
|
||||
3 1 1 1 0 0,S PCH 0
|
||||
4 1 1 1 0 0,S-1 PCL 0
|
||||
5 1 1 0 1 PBR,PC+2 AAH 1
|
||||
6 1 1 0 0 PBR,PC+2 IO 1
|
||||
7 1 1 0 1 PBR,AA+X NEW PCL 1
|
||||
8 1 1 0 1 PBR,AA+X+1 NEW PCH 1
|
||||
1 1 1 1 1 PBR,NEWPC New Op Code 1
|
||||
|
||||
|
||||
|
||||
21a Stack (Hardware Interrupts) -- s
|
||||
(IRQ,NMI,ABORT,RES)
|
||||
(4 hardware Interrupts)
|
||||
(0 bytes)
|
||||
(7 and 8 cycles)
|
||||
|
||||
1 1 1 1 1 PBR,PC IO 1
|
||||
(3) 2 1 1 0 0 PBR,PC IO 1
|
||||
(7) 3 1 1 1 0 0,S PBR 0
|
||||
(10) 4 1 1 1 0 0,S-1 PCH 0
|
||||
(10) 5 1 1 1 0 0,S-2 PCL 0
|
||||
(10,11) 6 1 1 1 0 0,S-3 P 0
|
||||
7 0 1 1 0 0,VA AAVL 1
|
||||
8 0 1 1 0 0,VA+1 AAVH 1
|
||||
1 1 1 1 1 0,AAV New Op Code 1
|
||||
|
||||
|
||||
21b Stack (Software Interrupts) -- s
|
||||
(BRK,COP)
|
||||
(2 Op Codes)
|
||||
(2 bytes)
|
||||
(7 and 8 cycles)
|
||||
|
||||
1 1 1 1 1 PBR,PC Op Code 1
|
||||
(3) 2 1 1 0 1 PBR,PC+1 Signature 1
|
||||
(7) 3 1 1 1 0 0,S PBR 0
|
||||
4 1 1 1 0 0,S-1 PCH 0
|
||||
5 1 1 1 0 0,S-2 PCL 0
|
||||
6 1 1 1 0 0,S-3 (COP Latches) P 0
|
||||
7 0 1 1 0 0,VA AAVL 1
|
||||
8 0 1 1 0 0,VA+1 AAVH 1
|
||||
1 1 1 1 1 0,AAV New Op Code 1
|
||||
|
||||
|
||||
21c Stack (Return from Interrupt) -- s
|
||||
(RTI)
|
||||
(1 Op Code)
|
||||
(1 byte)
|
||||
(6 and 7 cycles)
|
||||
(different order from N6502)
|
||||
|
||||
1 1 1 1 1 PBR,PC Op Code 1
|
||||
2 1 1 0 0 PBR,PC+1 IO 1
|
||||
(3) 3 1 1 0 0 PBR,PC+1 IO 1
|
||||
4 1 1 1 0 0,S+1 P 1
|
||||
5 1 1 1 0 0,S+2 New PCL 1
|
||||
6 1 1 1 0 0,S+3 New PCH 1
|
||||
(7) 7 1 1 1 0 0,S+4 PBR 1
|
||||
1 1 1 1 1 PBR,NewPC New Op Code 1
|
||||
|
||||
|
||||
21d Stack (Return from Subroutine) -- s
|
||||
(RTS)
|
||||
(1 Op Code)
|
||||
(1 byte)
|
||||
(6 cycles)
|
||||
|
||||
1 1 1 1 1 PBR,PC Op Code 1
|
||||
2 1 1 0 0 PBR,PC+1 IO 1
|
||||
3 1 1 0 0 PBR,PC+1 IO 1
|
||||
4 1 1 1 0 0,S+1 New PCL-1 1
|
||||
5 1 1 1 0 0,S+2 New PCH 1
|
||||
6 1 1 0 0 0,S+2 IO 1
|
||||
1 1 1 1 1 PBR,NewPC New Op Code 1
|
||||
|
||||
|
||||
*21e Stack (Return from Subroutine Long) -- s
|
||||
(RTL)
|
||||
(1 Op Code)
|
||||
(1 byte)
|
||||
(6 cycles)
|
||||
1 1 1 1 1 PBR,PC Op Code 1
|
||||
2 1 1 0 0 PBR,PC+1 IO 1
|
||||
3 1 1 0 0 PBR,PC+1 IO 1
|
||||
4 1 1 1 0 0,S+1 NEW PCL 1
|
||||
5 1 1 1 0 0,S+2 NEW PCH 1
|
||||
6 1 1 1 0 0,S+3 NEW PBR 1
|
||||
1 1 1 1 1 NEWPBR,PC New Op Code 1
|
||||
|
||||
|
||||
21f Stack (Push) -- s
|
||||
(PHP,PHA,PHY,PHX,PHD,PHK,PHB)
|
||||
(7 Op Codes)
|
||||
(1 byte)
|
||||
(3 and 4 cycles)
|
||||
|
||||
1 1 1 1 1 PBR,PC Op Code 1
|
||||
2 1 1 0 0 PBR,PC+1 IO 1
|
||||
3a 1 1 1 0 0,S Register High 0
|
||||
3 1 1 1 0 0,S-1 Register Low 0
|
||||
|
||||
|
||||
21g Stack (Pull) -- s
|
||||
(PLP,PLA,PLY,PLX,PLD,PLB)
|
||||
(Different than N6502)
|
||||
(6 Op Codes)
|
||||
(1 byte)
|
||||
(4 and 5 cycles)
|
||||
|
||||
1 1 1 1 1 PBR,PC Op Code 1
|
||||
2 1 1 0 0 PBR,PC+1 IO 1
|
||||
3 1 1 0 0 PBR,PC+1 IO 1
|
||||
4 1 1 1 0 0,S+1 Register Low 1
|
||||
(1) 4a 1 1 1 0 0,S+2 Register High 1
|
||||
|
||||
|
||||
*21h Stack (Push Effective Indirect Address) -- s
|
||||
(PEI)
|
||||
(1 Op Code)
|
||||
(2 bytes)
|
||||
(6 and 7 cycles)
|
||||
|
||||
1 1 1 1 1 PBR,PC Op Code 1
|
||||
2 1 1 0 1 PBR,PC+1 DO 1
|
||||
(2) 2a 1 1 0 0 PBR,PC+1 IO 1
|
||||
3 1 1 1 0 0,D+DO AAL 1
|
||||
d 1 1 1 0 0,D+DO+1 AAH 1
|
||||
5 1 1 1 0 0,S AAH 0
|
||||
6 1 1 1 0 0,S-1 AAL 0
|
||||
|
||||
|
||||
*21i Stack (Push Effective Absolute Address) -- s
|
||||
(PEA)
|
||||
(1 Op Code)
|
||||
(3 bytes)
|
||||
(5 cycles)
|
||||
|
||||
1 1 1 1 1 PBR,PC Op Code 1
|
||||
2 1 1 0 1 PBR,PC+1 AAL 1
|
||||
3 1 1 0 1 PBR,PC+2 AAH 1
|
||||
4 1 1 1 0 0,S AAH 0
|
||||
5 1 1 1 0 0,S-1 AAL 0
|
||||
|
||||
|
||||
|
||||
*21j Stack (Push Effective Program Counter Relative Address) -- s
|
||||
(PER)
|
||||
(1 Op Code)
|
||||
(3 bytes)
|
||||
(6 cycles)
|
||||
1 1 1 1 1 PBR,PC Op Code 1
|
||||
2 1 1 0 1 PBR,PC+1 Offset Low 1
|
||||
3 1 1 0 1 PBR,PC+2 Offset High 1
|
||||
4 1 1 0 0 PBR,PC+2 IO 1
|
||||
5 1 1 1 0 0,S PCH+Offset+CARRY 0
|
||||
6 1 1 1 0 0,S-1 PCL + Offset 0
|
||||
|
||||
|
||||
|
||||
*22 Stace Relative -- d,s
|
||||
(ORA,AND,EOR,ADC,STA,LDA,CMP,SBC)
|
||||
(8 Op Codes)
|
||||
(2 bytes)
|
||||
(4 and 5 cycles)
|
||||
|
||||
1 1 1 1 1 PBR,PC Op Code 1
|
||||
2 1 1 0 1 PBR,PC+1 SO 1
|
||||
3 1 1 0 0 PBR,PC+1 IO 1
|
||||
4 1 1 1 0 0,S+SO Data Low 1/0
|
||||
(1) 4a 1 1 1 0 0,S+SO+1 Data High 1/0
|
||||
|
||||
|
||||
|
||||
*23 Stack Relative Indirect Indexed -- (d,s),y
|
||||
(8 Op Codes)
|
||||
(2 bytes)
|
||||
(7 and 8 cycles)
|
||||
|
||||
1 1 1 1 1 PBR,PC Op Code 1
|
||||
2 1 1 0 1 PBR,PC+1 SO 1
|
||||
3 1 1 0 0 PBR,PC+1 IO 1
|
||||
4 1 1 1 0 0,S+SO AAL 1
|
||||
5 1 1 1 0 0,S+SO+1 AAH 1
|
||||
6 1 1 0 0 0,S+SO+1 IO 1
|
||||
7 1 1 1 0 DBR,AA+Y Data Low 1/0
|
||||
(1) 7a 1 1 1 0 DBR,AA+Y+1 Data High 1/0
|
||||
|
||||
|
||||
|
||||
*24a Block Move Positive (forward) -- xyc
|
||||
(MVP)
|
||||
(1 Op Code)
|
||||
(3 bytes)
|
||||
(7 cycles)
|
||||
|
||||
+- 1 1 1 1 1 PBR,PC Op Code 1
|
||||
| 2 1 1 0 1 PBR,PC+1 DBA 1
|
||||
| 3 1 1 0 1 PBR,PC+2 SBA 1
|
||||
N-2 | 4 1 1 1 0 SBA,X Source Data 1
|
||||
Byte | 5 1 1 1 0 DBA,Y Dest Data 0
|
||||
C=2 | 6 1 1 0 0 DBA,Y IO 1
|
||||
+- 7 1 1 0 0 DBA,Y IO 1
|
||||
|
||||
+- 1 1 1 1 1 PBR,PC Op Code 1
|
||||
| 2 1 1 0 1 PBR,PC+1 DBA 1
|
||||
N-1 | 3 1 1 0 1 PBR,PC+2 SBA 1
|
||||
Byte | 4 1 1 1 0 SBA,X-1 Source Data 1
|
||||
C=1 | 5 1 1 1 0 DBA,Y-1 Dest Data 0
|
||||
| 6 1 1 0 0 DBA,Y-1 IO 1
|
||||
+- 7 1 1 0 0 DBA,Y-1 IO 1
|
||||
|
||||
+- 1 1 1 1 1 PBR,PC Op Code 1
|
||||
| 2 1 1 0 1 PBR,PC+1 DBA 1
|
||||
N Byte | 3 1 1 0 1 PBR,PC+2 SBA 1
|
||||
Last | 4 1 1 1 0 SBA,X-2 Source Data 1
|
||||
C=0 | 5 1 1 1 0 DBA,Y-2 Dest Data 0
|
||||
| 6 1 1 0 0 DBA,Y-2 IO 1
|
||||
| 7 1 1 0 0 DBA,Y-2 IO 1
|
||||
+- 1 1 1 1 1 PBR,PC+3 New Op Code 1
|
||||
|
||||
x = Source Address
|
||||
y = Destination
|
||||
c = Number of Bytes to move -1
|
||||
x,y Decrement
|
||||
MVP is used when the destination start address is higher (more positive)
|
||||
than the source start address.
|
||||
|
||||
FFFFFF
|
||||
^ Dest Start
|
||||
| Source Start
|
||||
| Dest End
|
||||
| Source End
|
||||
000000
|
||||
|
||||
|
||||
*24b, Block Move Negative (backward) -- xyc
|
||||
(MVN)
|
||||
(1 Op Code)
|
||||
(3 bytes)
|
||||
(7 cycles)
|
||||
|
||||
+- 1 1 1 1 1 PBR,PC Op Code 1
|
||||
| 2 1 1 0 1 PBR,PC+1 DBA 1
|
||||
| 3 1 1 0 1 PBR,PC+2 SBA 1
|
||||
N-2 | 4 1 1 1 0 SBA,X Source Data 1
|
||||
Byte | 5 1 1 1 0 DBA,Y Dest Data 0
|
||||
C=2 | 6 1 1 0 0 DBA,Y IO 1
|
||||
+- 7 1 1 0 0 DBA,Y IO 1
|
||||
|
||||
+- 1 1 1 1 1 PBR,PC Op Code 1
|
||||
| 2 1 1 0 1 PBR,PC+1 DBA 1
|
||||
N-1 | 3 1 1 0 1 PBR,PC+2 SBA 1
|
||||
Byte | 4 1 1 1 0 SBA,X+1 Source Data 1
|
||||
C=1 | 5 1 1 1 0 DBA,Y+1 Dest Data 0
|
||||
| 6 1 1 0 0 DBA,Y+1 IO 1
|
||||
+- 7 1 1 0 0 DBA,Y+1 IO 1
|
||||
|
||||
+- 1 1 1 1 1 PBR,PC Op Code 1
|
||||
| 2 1 1 0 1 PBR,PC+1 DBA 1
|
||||
N Byte | 3 1 1 0 1 PBR,PC+2 SBA 1
|
||||
Last | 4 1 1 1 0 SBA,X+2 Source Data 1
|
||||
C=0 | 5 1 1 1 0 DBA,Y+2 Dest Data 0
|
||||
| 6 1 1 0 0 DBA,Y+2 IO 1
|
||||
| 7 1 1 0 0 DBA,Y+2 IO 1
|
||||
+- 1 1 1 1 1 PBR,PC+3 New Op Code 1
|
||||
|
||||
x = Source Address
|
||||
y = Destination
|
||||
c = Number of Bytes to move -1
|
||||
x,y Increment
|
||||
MVN is used when the destination start address is lower (more negative)
|
||||
than the source start address.
|
||||
|
||||
FFFFFF
|
||||
| Source End
|
||||
| Dest End
|
||||
| Source Start
|
||||
v Dest Start
|
||||
000000
|
||||
|
||||
|
||||
|
||||
Notes
|
||||
(1) Add 1 byte (for immediate only) for M=O or X=O (i.e. 16 bit data),
|
||||
add 1 cycle for M=O or X=0.
|
||||
(2) Add 1 cycle for direct register low (DL) not equal 0.
|
||||
(3) Special case for aborting instruction. This is the last cycle which
|
||||
may be aborted or the Status, PBR or DBR registers will be updated.
|
||||
(4) Add 1 cycle for indexing across page boundaries, or write, or X=0.
|
||||
When X=1 or in the emulation mode, this cycle contains invalid
|
||||
addresses.
|
||||
(5) Add 1 cycle if branch is taken.
|
||||
(6) Add 1 cycle if branch is taken across page boundaries in 6502 emutation
|
||||
mode (E=1).
|
||||
(7) Subtract 1 cycle for 6502 emulation mode (E=1).
|
||||
(8) Add 1 cycle lor REP, SEP.
|
||||
(9) Wait at cycle 2 for 2 cycles after /NMI or /IRQ active input.
|
||||
(10) R/W remains high during Reset.
|
||||
(11) BRK bit 4 equals "0" in Emulation mode.
|
||||
|
||||
|
||||
Abbreviations
|
||||
AAB Absolute Address Bank
|
||||
AAH Absolute Address High
|
||||
AAL Absolute Address Low
|
||||
AAVH Absolute Address Vector High
|
||||
AAVL Absolute Address Vector Low
|
||||
C Accumulator
|
||||
D Direct Register
|
||||
DBA Destination Bank Address
|
||||
DBR Data Bank Register
|
||||
DO Direct Offset
|
||||
IDH Immediate Data High
|
||||
IDL Immediate Data Low
|
||||
IO Internal Operation
|
||||
P Status Register
|
||||
PBR Program Bank Register
|
||||
PC Program Counter
|
||||
R-M-W Read-Modify-Write
|
||||
S Stack Address
|
||||
SBA Source Bank Address
|
||||
SO Stack Offset
|
||||
VA Vector Address
|
||||
x, y Index Registers
|
||||
* New G65SC816/802 Addressing Modes
|
||||
** New G65SC02 Addressing Modes
|
||||
Blank NMOS 6502 Addressing Modes
|
||||
|
||||
|
||||
BIN
files/docs/snes/65816/diagram.gif
Normal file
BIN
files/docs/snes/65816/diagram.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
72
files/docs/snes/65816/feature.txt
Normal file
72
files/docs/snes/65816/feature.txt
Normal file
@ -0,0 +1,72 @@
|
||||
|
||||
GTE G 65 SC 802 / G 65 SC 816
|
||||
Microcircuits
|
||||
|
||||
|
||||
CMOS 8/16-Bit Microprocessor Family
|
||||
|
||||
Features
|
||||
Advanced CMOS design for low power consumption and increased
|
||||
noise immunity
|
||||
Emulation mode for total software compatibility with 6502 designs
|
||||
Full 16-bit ALU, Accumulator, Stack Pointer, and Index Registers
|
||||
Direct Register for ''zero page'' addressing
|
||||
24 addressing modes (including 13 original 6502 modes)
|
||||
Wait for Interrupt (WAI) and Stop the Clock (STP) instructions
|
||||
for reduced power consumption and decreased interrupt latency
|
||||
91 instructions with 255 opcodes
|
||||
Co-Processor (COP) instruction and associated vector
|
||||
Powerful Block Move instructions
|
||||
|
||||
Features (G65SC802 Only)
|
||||
8-Bit Mode with both software and hardware (pin-to-pin) compatibility
|
||||
with 6502 designs (64 KByte memory space)
|
||||
Program selectable 16-bit operation
|
||||
Choice of external or on-board clock generation
|
||||
|
||||
Features (G65SC816 Only)
|
||||
Full 16-bit operation with 24 address lines for 16 MByte memory
|
||||
Program selectable 8-Bit Mode for 6502 coding compatibility.
|
||||
Valid Program Address (VPA) and Valid Data Address (VDA) outputs
|
||||
for dual cache and DMA cycle steal implementation
|
||||
Vector Pull (VP) output indicates when interrupt vectors are being
|
||||
fetched. May be used for vectoring/prioritizing interrupts.
|
||||
Abort interrupt and associated vector for interrupting any instruction
|
||||
without modifying internal registers
|
||||
Memory Lock (ML) for multiprocessor system implementation
|
||||
|
||||
|
||||
General Description
|
||||
|
||||
The G65SC802 and G65SC816 are ADV-CMOS (ADVanced CMOS) 16-bit microprocessors
|
||||
featuring total software compatibility with 8-bit NMOS and CMOS 6500 series
|
||||
microprocessors. The G65SC802 is pin-to-pin compatible with 8-bit 6502 devices
|
||||
currently available, while also providing full 16-bit internal operation. The
|
||||
G65SC816 provides 24 address lines for 16 MByte addressing, while providing
|
||||
both 8-bit and 16-bit operation.
|
||||
|
||||
Each microprocessor contains an Emulation (E) mode for emulating 8-bit NMOS
|
||||
and CMOS 6500-Series microprocessors. A software switch determines whether the
|
||||
processor is in the 8-bit ernulation mode or in the Native 16-bit mode.
|
||||
This allows existing 8-bit system designs to use the many powerful features of
|
||||
the G65SC802 and G65SC816.
|
||||
|
||||
The G65SC802 and G65SC816 provide the system engineer with many powerful
|
||||
features and options. A 16-bit Direct Page Register is provided to augment the
|
||||
Direct Page addressing mode, and there are separate Program Bank Registers
|
||||
for 24-bit memory addressing.
|
||||
Other valuable features Include:
|
||||
* An Abort input which can interrupt the current instruction without
|
||||
modifying internal registers
|
||||
* Valid Data Address (VDA) and Valid Program Address (VPA) outputs which
|
||||
facilitate dual cache memory by indicating whether a data or program
|
||||
segment is being accessed.
|
||||
* Vector modification by simply monitoring the Vector Pull (VP) output.
|
||||
* Block Move Instructions
|
||||
|
||||
|
||||
G65SC802 and G65SC816 microprocessors offer the design engineer a new freedom
|
||||
of design and application, and the many advantages of state-of-the-art
|
||||
ADV-CMOS technology.
|
||||
|
||||
This is advanced information and specifications are subject to change without notice.
|
||||
455
files/docs/snes/65816/funcdesc.txt
Normal file
455
files/docs/snes/65816/funcdesc.txt
Normal file
@ -0,0 +1,455 @@
|
||||
|
||||
|
||||
Functional Description
|
||||
|
||||
The G65SC802 offers the design engineer the opportunity to utilize both
|
||||
existing software programs and hardware configurations, while also
|
||||
achieving the added advantages of increased register lengths and faster
|
||||
execution times. The G65SC802's "ease of use" design and implementation
|
||||
features provide the designer with increased flexibility and reduced
|
||||
implementation costs In the Emulation mode, the G65SC802 not only offers
|
||||
software compatibility, but is also hardware (pin-to-pin) compatible with
|
||||
6502 designs plus it provides the advantages of 16-bit internal operation
|
||||
in 6502-compatible applications. The G65SC802 is an excellent direct
|
||||
replacement microprocessor for 6502 designs.
|
||||
|
||||
The G65SC816 provides the design engineer with upward mobility and software
|
||||
compatibility in applications where a 16-bit system configuration is desired.
|
||||
The G65SC816's 16-bit hardware configuration, coupled with current software
|
||||
allows a wide selection of system applications. In the Emulation mode, the
|
||||
G65SC816 ofters many advantages, including full software compatibility with
|
||||
6502 coding. In addition, the G65SC816's powerful instruction set and
|
||||
addressing modes make it an excellent choice for new 16-bit designs.
|
||||
|
||||
Internal organization of the G65SC802 and G65SC816 can be divided into two
|
||||
parts: 1) The Register Section, and 2) The Control Section Instructions
|
||||
(or opcodes) obtained from program memory are executed by implementing a
|
||||
series of data transfers within the Register Section.
|
||||
Signals that cause data transfers to be executed are generated within the
|
||||
Control Section. Both the G65SC802 and the G65SC816 have a 16-bit internal
|
||||
architecture with an 8-bit external data bus.
|
||||
|
||||
|
||||
Instructlon Register and Decode
|
||||
|
||||
An opcode enters the processor on the Data Bus, and is latched into the
|
||||
Instruction Register during the instruction fetch cycle. This instruction is
|
||||
then decoded, along with timing and interrupt signals, to generate the
|
||||
various Instruction Register control signals.
|
||||
|
||||
|
||||
Timing Control Unit (TCU)
|
||||
|
||||
The Timing Control Unit keeps track of each instruction cycle as it is
|
||||
executed. The TCU is set to zero each time an instruction fetch is executed,
|
||||
and is advanced at the beginning of each cycle for as many cycles as is
|
||||
required to complete the instruction Each data transfer between registers
|
||||
depends upon decoding the contents of both the Instruction Register and
|
||||
the Timing Control Unit.
|
||||
|
||||
|
||||
Arithmetic and Logic Unit (ALU)
|
||||
|
||||
All arithmetic and logic operations take place within the 16-bit ALU. In
|
||||
addition to data operations, the ALU also calculates the effective address
|
||||
for relative and indexed addressing modes. The result of a data operation
|
||||
is stored in either memory or an internal register. Carry, Negative, Over-
|
||||
flow and Zero flags may be updated following the ALU data operation.
|
||||
|
||||
|
||||
Internal Registers (Refer to Figure 2, Programming Model)
|
||||
|
||||
Accumulator (A)
|
||||
The Accumulator is a general purpose register which stores one of the
|
||||
operands, or the result of most arithmetic and logical operations. In the
|
||||
Native mode (E=0), when the Accumulator Select Bit (M) equals zero, the
|
||||
Accumulator is established as 16 bits wide. When the Accumulator Select
|
||||
Bit (M) equals one, the Accumulator is 8 bits wide. In this case, the upper
|
||||
8 bits (AH) may be used for temporary storage in conjunction with the
|
||||
Exchange AH and AL instruction.
|
||||
|
||||
Data Bank (DB)
|
||||
During the Native mode (E=0), the 8-bit Data Bank Register holds the default
|
||||
bank address for memory transfers. The 24-bit address is composed of the
|
||||
16-bit instruction effective address and the 8-bit Data Bank address. The
|
||||
register value is multiplexed with the data value and is present on the
|
||||
Data/Address lines during the first half of a data transfer memory cycle for
|
||||
the G65SC816. The Data Bank Register is initialized to zero during Reset.
|
||||
|
||||
Direct (D)
|
||||
The 16-bit Direct Register provides an address offset for all instructions
|
||||
using direct addressing. The effective bank zero address is formed by adding
|
||||
the 8-bit instruction operand address to the Direct Register. The Direct
|
||||
Register is initialized to zero during Reset.
|
||||
|
||||
Index (X and Y)
|
||||
There are two Index Registers (X and Y) which may be used as general purpose
|
||||
registers or to provide an index value for calculation of the effective
|
||||
address. When executing an instruction with indexed addressing, the
|
||||
microprocessor fetches the opcode and the base address, and then modifies the
|
||||
address by adding the Index Register contents to the address prior to
|
||||
performing the desired operation.
|
||||
Pre-indexing or postindexing of Indirect addresses may be selected. In the
|
||||
Native mode (E=0), both Index Registers are 16 bits wide (providing the Index
|
||||
Select Bit (X) equals zero). If the Index Select Bit (X) equals one, both
|
||||
registers will be 8 bits wide.
|
||||
|
||||
Processor Status (P)
|
||||
The 8-bit Processor Status Register contains status flags and mode select bits.
|
||||
The Carry (C), Negative (N). Overflow (V), and Zero (Z) status flags serve to
|
||||
report the status ot most ALU operations. These status flags are tested by use
|
||||
of Conditional Branch instructions. The Decimal (D), IRQ Disable (I), Memory,
|
||||
Accumuiator (M), and Index (X) bits are used as mode select flags. These flags
|
||||
are set by the program to change microprocessor operations.
|
||||
|
||||
The Emulation (E) select and the Break (B) flags are accessible only through
|
||||
the Processor Status Register. The Emulation mode select flag is selected by
|
||||
the Exchange Carry and Emulation Bits (XCE) instruction.
|
||||
Table 2, G65SC802 and G65SC816 Mode Comparison, illustrates the features of
|
||||
the Native (E=0) and Emulation (E=1) modes. The M and X flags are always equal
|
||||
to one in the Emulation mode. When an interrupt occurs during the Emulation
|
||||
mode, the Break flag is written to stack memory as bit 4 of the Processor
|
||||
Status Register.
|
||||
|
||||
Program Bank (PB)
|
||||
The 8-bit Program Bank Register holds the bank address for all instruction
|
||||
fetches. The 24-bit address consists of the 16-bit instruction effective
|
||||
address and the 8-bit Program Bank address. The register value is multiplexed
|
||||
with the data value and presented on the Data/Address lines during the first
|
||||
half of a program memory read cycle. The Program Bank Register is initialized
|
||||
to zero during Reset.
|
||||
|
||||
Program Counter (PC)
|
||||
The 16-bit Program Counter Register provides the addresses which are used to
|
||||
step the microprocessor through sequential program instructions. The register
|
||||
is incremented each time an instruction or operand is fetched from program
|
||||
memory.
|
||||
|
||||
Stack Pointer (S)
|
||||
The Stack Pointer is a 16-bit register which is used to indicate the next
|
||||
available location in the stack memory area. It serves as the effective address
|
||||
in stack addressing modes as well as subroutine and interrupt processing. The
|
||||
Stack Pointer allows simple implementation of nested subroutines and multiple-
|
||||
level interrupts. During the Emulation mode, the Stack Pointer high-order byte
|
||||
(SH) is always equal to 01. The Bank Address is 00 for all Stack operations.
|
||||
|
||||
|
||||
Signal Description
|
||||
|
||||
The following Signal Description applies to both the G65SC802 and the
|
||||
SSC816 except as otherwise noted.
|
||||
|
||||
|
||||
Abort (/ABORT) -- G65SC816
|
||||
The Abort input prevents modification of any internal registers during
|
||||
execution of the current instruction. Upon completion of this instruction,
|
||||
an interrupt sequence is initiated. The location of the aborted opcode is
|
||||
stored as the return address in Stack memory. The Abort vector address is
|
||||
00FFF8, 9 (Emulation mode) or 00FFE8, 9 (Native mode). Abort is asserted
|
||||
whenever there is a low level on the Abort input. and the Phi2 clock is high.
|
||||
The Abort internal latch is cleared during the second cycle of the interrupt
|
||||
sequence. This signal may be used to handle out-of-bounds memory references
|
||||
in virtual memory systems.
|
||||
|
||||
Address Bus (A0-A15)
|
||||
These sixteen output lines form the Address Bus for memory and I/O exchange on
|
||||
the Data Bus. When using the G65SC816, the address lines may be set to the
|
||||
high impedance state by the Bus Enable (BE) signal.
|
||||
|
||||
Bus Enable (BE)
|
||||
The Bus Enable input signal allows external control of the Address and Data
|
||||
Buffers, as well as the R/W signal With Bus Enable high, the R/W and Address
|
||||
Buffers are active. The Data/Address Buffers are active during the first half
|
||||
of every cycle and the second half of a write cycle. When BE is low, these
|
||||
buffers are disabled. Bus Enable is an asynchronous signal.
|
||||
|
||||
Data Bus (D0-D7) -- G65SC802
|
||||
The eight Data Bus lines provide an 8-bit bidirectional Data Bus for use
|
||||
during data exchanges between the microprocessor and external memory or
|
||||
peripherals. Two memory cycles are required for the transfer of 16-bit values.
|
||||
|
||||
Data/Address Bus (D0/BA0-D7/BA7) -- G65SC816
|
||||
These eight lines multiplex bits BAO-BA7 with the data value. The Bank Address
|
||||
is present during the first half of a memory cycle, and the data value is read
|
||||
or written during the second half of the memory cycle.
|
||||
The Bank address external transparent latch should be latched when the Phi2
|
||||
clock is high or RDY is low. Two memory cycles are required to transfer 16-bit
|
||||
values. These lines may be set to the high impedance state by the Bus Enable
|
||||
(BE) signal.
|
||||
|
||||
Emulation Status (E) -- G65SC816 (Also Applies to G65SC802, 44-Pin Version)
|
||||
The Emulation Status output reflects the state of the Emulation (E) mode flag
|
||||
in the Processor Status (P) Register. This signal may be thought of an opcode
|
||||
extension and used for memory and system management.
|
||||
|
||||
Interrupt Request (/IRQ)
|
||||
The Interrupt Request input signal is used to request that an interrupt
|
||||
sequence be initiated. When the IRQ Disable (I) flag is cleared, a low input
|
||||
logic level initiates an interrupt sequence after the current instruction is
|
||||
completed. The Wait for Interrupt (WAI) instruction may be executed to ensure
|
||||
the interrupt will be recognized immediately. The Interrupt Request vector
|
||||
address is 00FFFE,F (Emulation mode) or 00FFEE,F (Native mode). Since IRQ is a
|
||||
level-sensitive input, an interrupt will occur if the interrupt source was not
|
||||
cleared since the last interrupt.
|
||||
Also, no interrupt will occur if the interrupt source is cleared prior to
|
||||
interrupt recognition.
|
||||
|
||||
Memory Lock (/ML) -- G65SC816 (Also Applies to G65SC802, 44-Pin Version)
|
||||
The Memory Lock output may be used to ensure the integrity of Read-Modify-Write
|
||||
instructions in a multiprocessor system. Memory Lock indicates the need to
|
||||
defer arbitration of the next bus cycle. Memory Lock is low during the last
|
||||
three or five cycles of ASL, DEC, INC, LSR, ROL, ROR, TRB, and TSB memory
|
||||
referencing instructions, depending the state of the M flag.
|
||||
|
||||
Memory/Index Select Status (M/X) -- G65SC816
|
||||
This multiplexed output reflects the state ot the Accumulator (M) and index (X)
|
||||
select flags (bits 5 and 4 of the Processor Status (P) Register).
|
||||
Flag M is valid during the Phi2 clock positive transition. Instructions PLP,
|
||||
REP, RTI and SEP may change the state of these bits. Note that the M/X output
|
||||
may be invalid in the cycle following a change in the M or X bits. These bits
|
||||
may be thought of as opcode extensions and may be used for memory and system
|
||||
management.
|
||||
|
||||
Non-Maskable Interrupt (/NMI)
|
||||
A high-to-low transition initiates an intenupt sequence after the current
|
||||
instruction is completed. The Wait for Interrupt (WAI) instruction may be
|
||||
executed to ensure that the interrupt will be recognized immediately. The
|
||||
Non-Maskable Interrupt vector address is 00FFFA,B (Emulation mode) or 00FFEA,B
|
||||
(Native mode). Since NMI is an edge-sensitive Input, an interrupt will occur
|
||||
if there is a negative transition while servicing a previous interrupt. Also,
|
||||
no interrupt will occur if NMI remains low.
|
||||
|
||||
Phase 1 Out (Phi1 (OUT)) -- G65SC802
|
||||
This inverted clock output signal provides timing for external read and write
|
||||
operations. Executing the Stop (STP) instruction holds this clock in the low
|
||||
state.
|
||||
|
||||
Phase 2 In (Phi2 (IN))
|
||||
This is the system clock input to the microprocessor internal clock generator
|
||||
(equivalent to Phi0 (IN) on the 6502). During the low power Standby Mode, Phi2
|
||||
(IN) should be held in the high state to preserve the contents of internal
|
||||
registers.
|
||||
|
||||
Phase 2 Out (Phi2 (OUT)) -- G65SC802
|
||||
This clock output signal provides timing for external read and write
|
||||
operations. Addresses are valid (after the Address Setup Time (TADS))
|
||||
following the negative transition of Phase 2 Out. Executing the Stop (STP)
|
||||
instruction holds Phase 2 Out in the High state.
|
||||
|
||||
Read/Write (R/W)
|
||||
When the R/W output signal is in the high state, the microprocessor is reading
|
||||
data from memory or I/O. When in the low state, the Data Bus contains valid
|
||||
data from the microprocessor which is to be stored at the addressed memory
|
||||
location. When using the G65SC816, the R/W signal may be set to the high
|
||||
impedance state by Bus Enable (BE).
|
||||
|
||||
Ready (RDY)
|
||||
This bidirectional signal indicates that a Wait for Interrupt (WAI) instruction
|
||||
has been executed allowing the user to halt operation of the microprocessor.
|
||||
A low input logic level will halt the microprocessor in its current state (note
|
||||
that when in the Emulation mode, the G65SC802 stops only during a read cycle).
|
||||
Returning RDY to the active high state allows the microprocessor to continue
|
||||
following the next Phase 2 In Clock negative transition. The RDY signal is
|
||||
internally pulled low following the execution of a Wait for Interrupt (WAI)
|
||||
instruction, and then returned to the high state when a /RES, /ABORT, /NMI, or
|
||||
/IRQ external interrupt is provided. This feature may be used to eliminate
|
||||
interrupt latency by placing the WAI instruction at the beginning of the IRQ
|
||||
servicing routine. If the IRQ Disable flag has been set, the next instruction
|
||||
will be executed when the IRQ occurs. The processor will not stop after a WAI
|
||||
instruction if RDY has been forced to a high state. The Stop (STP) instruction
|
||||
has no effect on RDY.
|
||||
|
||||
Reset (/RES)
|
||||
The Reset input is used to initialize the microprocessor and start program
|
||||
execution. The Reset input buffer has hysteresis such that a simple R-C timing
|
||||
circuit may be used with the internal pullup device. The /RES signal must be
|
||||
held low for at least two clock cycles after VDD reaches operating voltage.
|
||||
Ready (RDY) has no effect while RES is being held low. During this Reset
|
||||
conditioning period, the following processor initialization takes place:
|
||||
|
||||
Registers
|
||||
|
||||
D = 0000 SH = 01
|
||||
DB = 00 XH = 00
|
||||
PB = 00 YH = 00
|
||||
|
||||
N V M X D I Z C/E
|
||||
P = * * 1 1 0 1 * */1
|
||||
|
||||
* = Not Initialized
|
||||
STP and WAI instructions are cleared.
|
||||
|
||||
|
||||
Signals
|
||||
|
||||
E = 1 VDA = 0
|
||||
M/X = 1 /VP = 1
|
||||
R/W = 1 VPA = 0
|
||||
SYNC = 0
|
||||
|
||||
|
||||
When Reset is brought high, an interrupt sequence is initiated:
|
||||
* R/W remains in the high state during the stack address cycles.
|
||||
* The Reset vector address is 00FFFC,D.
|
||||
|
||||
|
||||
Set Overtlow (/SO) -- G65SC802
|
||||
A negative transition on this input sets the Overflow (V) flag, bit 6 of the
|
||||
Processor Status (P) Register.
|
||||
|
||||
Synchronlze (SYNC) -- G65SC802
|
||||
The SYNC output is provided to identify those cycles during which the
|
||||
microprocessor is fetching an opcode. The SYNC signal is high during an opcode
|
||||
fetch cycle, and when combined with Ready (RDY), can be used for single
|
||||
instruction execution.
|
||||
|
||||
|
||||
Valid Data Address (VDA) and
|
||||
Valid Program Address (VPA) -- G65SC816
|
||||
These two output signals indicate the type of memory being accessed by
|
||||
the address bus. The following coding applies:
|
||||
|
||||
VDA VPA
|
||||
0 0 Internal Operation -- Address and Data Bus available. Address
|
||||
outputs may be invalid due to low byte additions only.
|
||||
|
||||
0 1 Valid program address -- may be used for program cache control.
|
||||
|
||||
1 0 Valid data address -- may be used for data cache control.
|
||||
|
||||
1 1 Opcode fetch -- may be used for program cache control
|
||||
and single step control.
|
||||
|
||||
|
||||
VDD and Vss
|
||||
VDD Vss the positive supply voltage and Vss is system ground. When
|
||||
using only one ground on the G65SC802 DIP package, pin 21 preferred.
|
||||
|
||||
Vector Pull (VP) -- G65SC816 (Also Applies to G65SC802 44-Pin Version)
|
||||
The Vector Pull output indicates that a vector location is being addressed
|
||||
during an interrupt sequence. /VP is low during the last two interrupt sequence
|
||||
cycles, during which time the processor reads the interrupt vector. The /VP
|
||||
signal may be used to select and prioritize interrupts from several sources by
|
||||
modifying the vector addresses.
|
||||
|
||||
--------------------------------------------------------------------------
|
||||
|
||||
8 bits 8 bits 8 bits
|
||||
|
||||
DB DB Data Bank Register
|
||||
XH XL Index Register (X)
|
||||
YH YL Index Register (Y)
|
||||
00 SH SL Stack Pointer (S)
|
||||
AH AL Accumulator (A)
|
||||
PB PCH PCL Program Counter (PC)
|
||||
Program Bank Register (PB)
|
||||
00 DH DL Direct Register (D)
|
||||
|
||||
L = Low, H = High
|
||||
|
||||
|
||||
Processor Status Register (P)
|
||||
____________________________
|
||||
| 1 B E |
|
||||
|__________________________|
|
||||
| N V M X D I Z C |
|
||||
|__________________________|
|
||||
|
||||
1 Always 1 if E=1
|
||||
B Break 0 on Stack after interupt if E=1
|
||||
E Emulation Bit 0= Native mode, 1= 6502 emulation
|
||||
|
||||
N Negative 1= Negative
|
||||
V Overflow 1= True
|
||||
M Memory/Acc. Select 1= 8 bit, 0= 16 bit
|
||||
X Index Register Select 1= 8 bit, 0= 16 bit
|
||||
D Decimal mode 1= Decimal Mode
|
||||
I IRQ Disable 1= Disable
|
||||
Z Zero 1= Result Zero
|
||||
C Carry 1= True
|
||||
|
||||
|
||||
Figure 2. Programming model
|
||||
|
||||
--------------------------------------------------------------------------
|
||||
|
||||
|
||||
Table 1. G65SC802 and G65SC816 Compability
|
||||
|
||||
Function G65SC802/816 G65SC02 NMOS 6502
|
||||
Emulation
|
||||
Decimal Mode:
|
||||
* After Interrupts 0 -> D 0 -> D Not initialized
|
||||
* N, Z Flags Valid Valid Undefined
|
||||
* ADC, SBC No added cycle Add 1 cycle No added cycle
|
||||
|
||||
Read-Modify-Write:
|
||||
* Absolute Indexed, No Page Crossing
|
||||
7 cycles 6 cycles 7 cycles
|
||||
* Write Last 2 cycles Last cycle Last 2 cycles
|
||||
* Memory Lock Last 3 cycles Last 2 cycles Not available
|
||||
|
||||
Jump Indirect:
|
||||
* Cycles 5 cycles 6 cycles 5 cycles
|
||||
* Jump Address, operand = xxFF Correct Correct Invalid
|
||||
|
||||
Branch or Index Across Page Boundary
|
||||
Read last Read last Read invalid
|
||||
program byte program byte address
|
||||
|
||||
0 -> RDY During Write G65SC802: Ignored Processor Ignored until
|
||||
until read stops read
|
||||
G65SC816: Processor
|
||||
stops
|
||||
|
||||
Write During Reset No Yes No
|
||||
|
||||
Unused Opcodes No operation No operation Undefined
|
||||
|
||||
Phi1 (OUT), Phi2 (OUT), /SO, SYNC Signals
|
||||
Available with Available Available
|
||||
G65SC802 only
|
||||
|
||||
RDY Signal Bidirectional Input Input
|
||||
|
||||
--------------------------------------------------------------------------
|
||||
|
||||
Table 2. G65SC802 and G65SC816 Mode Comparison
|
||||
|
||||
Function Emulation (E = 1) Native (E = 0)
|
||||
|
||||
Stack Pointer (S) 8 bits in page 1 16 bits
|
||||
|
||||
Direct Index Address Wrap within page Crosses page boundary
|
||||
|
||||
Processor Status (P):
|
||||
* Bit 4 Always one, except zero X flag (8/16-bit Index)
|
||||
in stack after hardware
|
||||
interrupt
|
||||
|
||||
* Bit 5 Always one M flag (8/16-bit Accumulator)
|
||||
|
||||
|
||||
Branch Across Page Boundary
|
||||
4 cycles 3 cycles
|
||||
|
||||
Vector Locations:
|
||||
ABORT 00FFF8,9 00FFF8,9
|
||||
BRK 00FFFE,F 00FFF6,7
|
||||
COP 00FFF4,5 00FFF4,5
|
||||
IRQ 00FFFE,F 00FFFE,F
|
||||
NMI 00FFFA,B 00FFFA,B
|
||||
RES 00FFFC,D 00FFFC,D (1 -> E)
|
||||
|
||||
|
||||
Program Bank (PB) During Interrupt, RTI
|
||||
Not pushed, pulled Pushed and pulled
|
||||
|
||||
0 -> RDY During Write
|
||||
G65SC802: Ignored until read Processor stops
|
||||
G65SC816: Processor stops
|
||||
|
||||
Write During Read-Modify-Write
|
||||
Last 2 cycles Last 1 or 2 cycles depending
|
||||
on M flag
|
||||
|
||||
91
files/docs/snes/65816/instnote.txt
Normal file
91
files/docs/snes/65816/instnote.txt
Normal file
@ -0,0 +1,91 @@
|
||||
|
||||
Notes on G65SC802/816 Instructions
|
||||
|
||||
All Opcodes Function in All Modes of Operation
|
||||
|
||||
It should be noted that all opcodes function in all modes of operation.
|
||||
However, some instructions and addressing modes are intended for G65SC816
|
||||
24-bit addressing and are therefore less useful for the G65SC802. The
|
||||
following is a list of Instructions and addressing modes which are primarily
|
||||
intended for G65SC816 use:
|
||||
|
||||
JSL; RTL; [d]; [d],y; JMP al; JML; al; al,x
|
||||
|
||||
The following instructions may be used with the G65SC802 even though a
|
||||
Bank Address is not multiplexed on the Data Bus:
|
||||
|
||||
PHK; PHB; PLB
|
||||
|
||||
The following instructions have "limited" use in the Emulation mode.
|
||||
|
||||
* The REP and SEP instructions cannot modify the M and X bits when in the
|
||||
Emulation mode. In this mode the M and X bits will always be high (logic 1).
|
||||
|
||||
* When in the Emulation mode, the MVP and MVN instructions only move data
|
||||
in page zero since X and Y Index Register high byte is zero.
|
||||
|
||||
|
||||
Indirect Jumps
|
||||
|
||||
The JMP (a) and JML (a) instructions use the direct Bank for indirect
|
||||
addressing, while JMP (a,x) and JSR (a,x) use the Program Bank for indirect
|
||||
address tables.
|
||||
|
||||
|
||||
Switching Modes
|
||||
|
||||
When switching from the Native mode to the Emulation mode, the X and M bits
|
||||
of the Status Register are set high (logic 1), the high byte of the Stack is
|
||||
set to 01, and the high bytes of the X and Y Index Registers are set to 00.
|
||||
To save previous values, these bytes must always be stored before changing
|
||||
modes. Note that the low byte of the S, X and Y Registers and the low and high
|
||||
byte of the Accumulator AL and AH are not affected by a mode change.
|
||||
|
||||
|
||||
WAI Instruction
|
||||
|
||||
The WAI instruction pulls RDY low and places the processor in the WAI
|
||||
"low power" mode. /NMI, /IRQ or /RESET will terminate the WAI condition and
|
||||
transfer control to the interrupt handler routine. Note that an /ABORT input
|
||||
will abort the WAI instruction, but will not restart the processor. When the
|
||||
Status Register I flag is set (IRQ disabled), the IRQ interrupt will cause the
|
||||
next instruction (following the WAI instruction) to be executed without going
|
||||
to the IRQ interrupt handler. This method results in the highest speed response
|
||||
to an IRQ input. When an interrupt is received after an ABORT which occurs
|
||||
during the WAI instruction, the processor will return to the WAI instruction.
|
||||
Other than RES (highest priority), ABORT is the next highest priority, followed
|
||||
by NMI or IRQ interrupts.
|
||||
|
||||
|
||||
STP Instruction
|
||||
|
||||
The STP instruction disables the Phi2 clock to all circuitry. When disabled,
|
||||
the Phi2 clock is held in the high state. In this case, the Data Bus will
|
||||
remain in the data transfer state and the Bank address will not be multiplexed
|
||||
onto the Data Bus. Upon executing the STP instruction, the /RES signal is the
|
||||
only input which can restart the processor. The processor is restarted by
|
||||
enabling the Phi2 clock, which occurs on the falling edge of the /RES input.
|
||||
Note that the external oscillator must be stable and operating properly before
|
||||
RES goes high.
|
||||
|
||||
|
||||
Tranters trom 8-Bit to 16-Bit, or 16-Bit to 8-Bit Registers
|
||||
|
||||
All transfers from one register to another will result in a full 16-bit output
|
||||
from the source register. The destination register size will determine the
|
||||
number of bits actually stored in the destination register and the values
|
||||
stored in the processor Status Register. The following are always 16-bit
|
||||
transfers, regardless of the accumulator size:
|
||||
|
||||
TCS; TSC; TCD; TDC
|
||||
|
||||
|
||||
Stack Transfers
|
||||
|
||||
When in the Emulation mode, a 01 is forced into SH. In this case, the B
|
||||
Accumulator will not be loaded into SH during a TCS instruction. When in the
|
||||
Native mode, the B Accumulator is transferred to SH. Note that in both the
|
||||
Emulation and Native modes, the full 16 bits of the Stack Register are
|
||||
transferred to the Accumulator, regardless of the state of the M bit in the
|
||||
Status Register.
|
||||
|
||||
197
files/docs/snes/65816/instruct.txt
Normal file
197
files/docs/snes/65816/instruct.txt
Normal file
@ -0,0 +1,197 @@
|
||||
|
||||
|
||||
Table 5. Arithmetic and Logical Instructions
|
||||
|
||||
Mne- Operation Addressing Mode Status
|
||||
monic M/X E=1 or E = 0 and dir, dir, (dir) (dir, (dir) [dir] abs abs, abs, absl absl d,s (d,s)
|
||||
E=0 and M/X=1 M/X = 0 Immed Accu dir x y x) ,y x y ,x ,y N V M X D I Z C
|
||||
|
||||
ADC Pm AL + B + Pc -> AL A + W + Pc -> A 69 65 75 72 61 71 67 6D 7D 79 6F 7F 63 73 N V . . . . Z C
|
||||
AND Pm AL /\B -> AL A /\W -> A 29 25 35 32 21 31 27 2D 3D 39 2F 3F 23 33 N . . . . . Z .
|
||||
ASL Pm Pc <-B <- 0 Pc <- W <- 0 0A 06 16 0E 1E N . . . . . Z C
|
||||
BIT Pm AL /\B A /\W 89 24 34 2C 3C N V . . . . Z .
|
||||
|
||||
CMP Pm AL - B A - W C9 C5 D5 D2 C1 D1 C7 CD DD D9 CF DF C3 D3 N . . . . . Z C
|
||||
CPX Px XL - B X - W E0 E4 EC N . . . . . Z C
|
||||
CPY Px YL - B Y - W C0 C4 CC N . . . . . Z C
|
||||
DEC Pm B - 1 -> B W - 1 -> W 3A C6 D6 CE DE N . . . . . Z .
|
||||
|
||||
EOR Pm AL V- B -> AL A V- W -> A 49 45 55 52 41 51 47 4D 5D 59 4F 5F 43 53 N . . . . . Z .
|
||||
INC Pm B + 1 -> B W + 1 -> W 1A E6 F6 EE FE N . . . . . Z .
|
||||
LDA Pm B -> AL W -> A A9 A5 B5 B2 A1 B1 B7 AD BD B9 AF BF A3 B3 N . . . . . Z .
|
||||
LDX Px B -> XL W -> X A2 A6 B6 AE BE N . . . . . Z .
|
||||
|
||||
LDY Px B -> YL W -> Y A0 A4 B4 AC BC N . . . . . Z .
|
||||
LSR Pm 0 -> B -> Pc 0 -> W -> Pc 4A 46 56 4E 5E 0 . . . . . Z C
|
||||
ORA Pm AL V B -> AL A V W -> A 09 05 15 12 01 11 17 0D 1D 19 0F 1F 03 13 N . . . . . Z .
|
||||
ROL Pm Pc <- B <- Pc Pc <- W <- Pc 2A 26 36 2E 3E N . . . . . Z C
|
||||
|
||||
ROR Pm Pc -> B -> Pc Pc -> W -> Pc 6A 66 76 6E 7E N . . . . . Z C
|
||||
SBC Pm AL - B - Pc -> AL A - W - Pc -> A E9 E5 F5 F2 E1 F1 F7 ED FD F9 EF FF E3 F3 N V . . . . Z C
|
||||
STA Pm AL -> B A -> W 85 95 92 81 91 97 8D 9D 99 8F 9F 83 93 . . . . . . . .
|
||||
STX Px XL -> B X -> W 86 96 8E . . . . . . . .
|
||||
|
||||
STY Px YL -> B Y -> W 84 94 8C . . . . . . . .
|
||||
STZ Pm 0 -> B 0 -> W 64 74 9C 9E . . . . . . . .
|
||||
TRB Pm /AL /\ B -> B /A /\ W -> W 14 1C . . . . . . Z .
|
||||
TSB Pm AL V B -> B A V W -> W 04 0C . . . . . . Z .
|
||||
|
||||
|
||||
|
||||
V logical OR B byte per effective address
|
||||
/\ logical AND W word per effective address
|
||||
V- logical exclusive OR r relative offset
|
||||
+ arithmetic addition A Accumulator, AL low half of Accumulator
|
||||
- arithmetic subtraction X Index Register, XL low half of X register
|
||||
!= not equal Y Index Register, YL low half of Y register
|
||||
. status bit not affected Pc carry bit
|
||||
/ negation M/X effective mode bit in Status Register (Pm or Px)
|
||||
Ws word per stack pointer
|
||||
Bs byte per stack pointer
|
||||
|
||||
Notes:
|
||||
|
||||
BIT instruction does not affect N and V flags when using immediate
|
||||
addressing mode. When using other addressing modes, the N and V flags
|
||||
are respectively set to bits 7 and 6 or 15 and 14 of the addressed memory
|
||||
depending on mode (byte or word).
|
||||
|
||||
For all Read/Modify/Write instruction addressing modes except accumulator
|
||||
Add 2 cycles for E=1 or E=0 and Pm=1 (8-bit mode)
|
||||
Add 3 cycles for E=0 and Pm=0 (16-bit mode).
|
||||
|
||||
Add one cycle when indexing across page boundary and E=1 except for STA and
|
||||
STZ instructions.
|
||||
|
||||
If E=1 then 1 -> SH and XL -> SL If E=0 then X -> S regardless of Pm or Px.
|
||||
|
||||
Exchanges the carry (Pc) and E bits. Whenever the E bit is set the following
|
||||
registers and status bits are locked into the indicated state:
|
||||
XH=0, YH=0, SH=1, Pm=1, Px=1.
|
||||
|
||||
Add 1 cycle if branch is taken. In Emulation (E= 1 ) mode only --add 1 cycle
|
||||
if the branch is taken and crosses a page boundary.
|
||||
|
||||
Add 1 cycle in Emulation mode (E=1) for (dir),y; abs,x; and abs,y addressing
|
||||
modes.
|
||||
|
||||
With TSB and TRB instruction, the Z flag is set or cleared by the result
|
||||
of AAB or AAW.
|
||||
For all Read/Modify/Write instruction addressing modes except accumulator --
|
||||
Add 2 cycles for E=1 or E=0 and Pm=1 (8-bit mode)
|
||||
Add 3 cycles for E=0 and Pm=0 (16-bit mode).
|
||||
|
||||
|
||||
|
||||
Table 6. Branch, Transter, Push, Pull, and Implied Addressing Mode Instructions
|
||||
|
||||
Operation Operation Status
|
||||
Mnemonic Bytes M/X Cycles 8 Bit Cycles 16 Bit Implied Stack Relative N V M X D I Z C Mnemonic
|
||||
|
||||
BCC (6) 2 - 2 PC+r -> PC 2 PC+r -> PC 90 . . . . . . . . BCC
|
||||
BCS (6) 2 - 2 PC+r -> PC 2 PC+r -> PC B0 . . . . . . . . BCS
|
||||
BEQ (6) 2 - 2 PC+r -> PC 2 PC+r -> PC F0 . . . . . . . . BEQ
|
||||
BMI (6) 2 - 2 PC+r -> PC 2 PC+r -> PC 30 . . . . . . . . BMI
|
||||
|
||||
BNE (6) 2 - 2 PC+r -> PC 2 PC+r -> PC D0 . . . . . . . . BNE
|
||||
BPL (6) 2 - 2 PC+r -> PC 2 PC+r -> PC 10 . . . . . . . . BPL
|
||||
BRA (6) 2 - 2 PC+r -> PC 2 PC+r -> PC 80 . . . . . . . . BRA
|
||||
BVC (6) 2 - 2 PC+r -> PC 2 PC+r -> PC 50 . . . . . . . . BVC
|
||||
BVS (6) 2 - 2 PC+r -> PC 2 PC+r -> PC 70 . . . . . . . . BVS
|
||||
|
||||
CLC 1 - 2 0 -> Pc 2 0 -> Pc 18 . . . . . . . 0 CLC
|
||||
CLD 1 - 2 0 -> Pd 2 0 -> Pd D8 . . . . 0 . . . CLD
|
||||
CLI 1 - 2 0 -> Pi 2 0 -> Pi 58 . . . . . 0 . . CLI
|
||||
CLV 1 - 2 0 -> Pv 2 O -> Pv B8 . 0 . . . . . . CLV
|
||||
|
||||
DEX 1 Px 2 XL - 1 -> XL 2 X - 1 -> X CA N . . . . . Z . DEX
|
||||
DEY 1 Px 2 YL - 1 -> YL 2 Y - 1 ->Y 88 N . . . . . Z . DEY
|
||||
INX 1 Px 2 XL + 1 -> XL 2 X + 1 -> X E8 N . . . . . Z . INX
|
||||
INY 1 Px 2 YL + 1 -> YL 2 Y + 1 -> Y C8 N . . . . . Z . INY
|
||||
|
||||
NOP 1 - 2 no operation 2 no operation EA . . . . . . . . NOP
|
||||
PEA 3 - 5 W->Ws, S-2 ->S 5 same F4 . . . . . . . . PEA
|
||||
PEI 2 - 6 W->Ws, S-2 ->S 6 same D4 . . . . . . . . PEI
|
||||
|
||||
PER 3 - 6 W ->Ws, S-2 ->S 6 same 62 . . . . . . . . PER
|
||||
PHA 1 Pm 3 AL->Bs, S-1 ->S 4 A ->Ws, S-2 ->S 48 . . . . . . . . PHA
|
||||
PHB 1 - 3 DB->Bs, S-1 ->S 3 same 8B . . . . . . . . PHB
|
||||
PHD 1 - 4 D ->Ws, S-2 ->S 4 same OB . . . . . . . . PHD
|
||||
|
||||
PHK 1 - 3 PB->Bs, S-1 ->S same 4B . . . . . . . . PHK
|
||||
PHP 1 - 3 P ->Bs, S-1 ->S 3 same 08 . . . . . . . . PHP
|
||||
PHX 1 Px 3 XL->Bs, S-1 ->S 4 X-Ws, S-2 -> S DA . . . . . . . . PHX
|
||||
PHY 1 Px 3 YL->Bs, S-1 ->S 4 Y ->Ws, S-2 ->S 5A . . . . . . . . PHY
|
||||
|
||||
PLA 1 Pm 4 S+1 ->S, Bs -> AL 5 S+2 ->S, Ws->A 68 N . . . . . Z . PLA
|
||||
PLB 1 - 4 S+1 ->S, Bs -> DB 4 same AB N . . . . . Z . PLB
|
||||
PLD 1 - 5 S+2 ->S, Ws -> D 5 same 2B N . . . . . Z . PLD
|
||||
PLP 1 - 4 S+1 ->S, Bs -> P 4 same 28 N V M X D I Z C PLP
|
||||
|
||||
PLX 1 Px 4 S+1 ->S, Bs -> XL 5 S+2 ->S, Ws->X FA N . . . . . Z . PLX
|
||||
PLY 1 Px 4 S+1 ->S, Bs -> YL 5 S+2 ->S, Ws->Y 7A N . . . . . Z . PLY
|
||||
|
||||
SEC 1 - 2 1 -> Pc 2 1 -> Pc 38 . . . . . . . 1 SEC
|
||||
SED 1 - 2 1 -> Pd 2 1 -> Pd F8 . . . . 1 . . . SED
|
||||
SEI 1 - 2 1 -> Pi 2 1 -> Pi 78 . . . . . 1 . . SEI
|
||||
|
||||
TAX 1 Px 2 AL -> XL 2 A -> X AA N . . . . . Z . TAX
|
||||
TAY 1 Px 2 AL -> YL 2 A -> Y A8 N . . . . . Z . TAY
|
||||
TCD 1 - 2 A -> D 2 A -> D 5B N . . . . . Z . TCD
|
||||
|
||||
TCS 1 - 2 A -> S A -> S 1B . . . . . . . . TCS
|
||||
TDC 1 - 2 D -> A 2 D -> A 7B N . . . . . Z . TDC
|
||||
TSC 1 - 2 S -> A 2 S -> A 3B N . . . . . Z . TSC
|
||||
TSX 1 Px 2 SL -> XL 2 S -> X BA N . . . . . Z . TSX
|
||||
|
||||
TXA 1 Pm 2 XL -> AL 2 X -> A 8A N . . . . . Z . TXA
|
||||
TXS 1 - 2 see note 4 2 X -> S 9A . . . . . . . . TXS
|
||||
TXY 1 Px 2 XL -> YL 2 X -> Y 9B N . . . . . Z . TXY
|
||||
TYA 1 Pm 2 YL -> AL 2 Y -> A 98 N . . . . . Z . TYA
|
||||
|
||||
TYX 1 Px 2 YL -> XL 2 Y -> X BB N . . . . . Z . TYX
|
||||
XCE 1 - 2 see note 5 2 see note 5 FB . . . . . . . C XCE
|
||||
|
||||
See Notes on page 13.
|
||||
|
||||
|
||||
|
||||
|
||||
Table 7. Other Addressing Mode Instructions
|
||||
|
||||
|
||||
Status
|
||||
Mnemonic Addressing Mode Opcode Cycles Bytes N V M X D I Z C Mnemonic Function
|
||||
|
||||
BRK stack 00 7/8 2 . . . . 0 1 . . BRK See discussion in Interrupt Processing Sequence section.
|
||||
BRL relative long 82 3 3 . . . . . . . . BRL PC+r -> PC where -32768 < r < 32767.
|
||||
COP stack 02 7/8 2 . . . . 0 1 . . COP See discussion in Interrupt Processing Sequence section.
|
||||
JML absolute indirect DC 6 3 JMLW -> PC, B-PB
|
||||
|
||||
JMP absolute 4C 3 3 . . . . . . . . JMP W -> PC
|
||||
JMP absolute indirect 6C 5 3 . . . . . . . . JMP W -> PC
|
||||
JMP absolute indexed indirect 7C 6 3 . . . . . . . . JMP W -> PC
|
||||
JMP absolute long 5C 4 4 JMP W -> PC, B -> PB
|
||||
|
||||
JSL absolute long 22 8 4 . . . . . . . . JSL PB -> Bs, S-1 -S, PC -> Ws, S-2 -> S, W -> PC, B -> PB
|
||||
JSR absolute 20 6 3 . . . . . . . JSR PC -> Ws, S-2 -> S, W -> PC
|
||||
JSR absolute indexed indirect FC 6 3 . . . . . . . . JSR PC -> Ws, S-2 -> S, W -> PC
|
||||
MVN block 54 7/byte 3 . . . . . . . . MVN See discussion in Addressing Mode section
|
||||
MVP block 44 7/byte 3 . . . . . . . . MVP
|
||||
REP immediate C2 3 2 N V M X D I Z C REP P /\ /B -> P
|
||||
RTI stack 40 6/7 1 N V M X D I Z C RTI S+1 -> S, Bs -> P, S+2 -> S, Ws -> PC,
|
||||
if E=0 then S+1 -> S, Bs -> PB
|
||||
|
||||
RTL stack 6B 6 1 . . . . . . . . RTL S+2 -> S, Ws~1 -> PC, S+1 -> S, Bs -> PB
|
||||
|
||||
RTS stack 60 6 1 . . . . . . . . RTS S+2 -> S, Ws+1 -> PC
|
||||
SEP immediate E2 3 2 N V M X D I Z C SEP PVB -> P
|
||||
STP implied DB 3+ 1 . . . . . . . . STP Stop the clock. Requires reset to continue.
|
||||
WAI implied CB 3+ 1 . . . . . . . . WAI Wait for inte-rupt. RDY held low until Interrupt.
|
||||
XBA implied EB 3 1 N . . . . . Z . XBA Swap AH and AL. Status bits reflect final condition of AL.
|
||||
|
||||
Notes on page 13.
|
||||
|
||||
|
||||
|
||||
16
|
||||
61
files/docs/snes/65816/intrrpts.txt
Normal file
61
files/docs/snes/65816/intrrpts.txt
Normal file
@ -0,0 +1,61 @@
|
||||
|
||||
Interrupt Processing Sequence
|
||||
|
||||
|
||||
The interrupt processing sequence is initiated as the direct result of hard-
|
||||
vare Abort, Interrupt Request, Non-Maskable Interrupt, or Reset inputs.
|
||||
The interrupt sequence can also be initiated as a result of the Break or
|
||||
Co-Processor instructions within the software. The following listings
|
||||
describe the function of each cycle in the interrupt processing sequence:
|
||||
|
||||
|
||||
Hardware Interrupt /ABORT, /IRQ, /NMI, /RES Inputs
|
||||
|
||||
Cycle No.
|
||||
E = 0 E = 1 Address Data R/W SYNC VDA VPA VP Description
|
||||
|
||||
1 1 PC X 1 1 1 1 1 Internal Operation
|
||||
2 2 PC X 1 0 0 0 1 Internal Operation
|
||||
3 [1] S PB 0 0 1 0 1 Write PB to Stack, S-1ÑS
|
||||
4 3 S PCH [2] 0[3] 0 1 0 1 Write PCH to Stack, S-1ÑS
|
||||
5 4 S PCL 12] 0[3] 0 1 0 1 Write PCL to Stack, S-1ÑS
|
||||
6 5 S P [4] 0[3] 0 1 0 1 Write P to Stack, S-1ÑS
|
||||
7 6 VL (VL) 1 0 1 0 0 Read Vector Low Byte,
|
||||
0->PD, 1->P1, OO->PB
|
||||
8 7 VH (VH) 1 0 1 0 0 Read Vector High 8yte
|
||||
|
||||
|
||||
Software Interrupt - BRK, COP Instructions
|
||||
|
||||
Cycle No.
|
||||
E = 0 E = 1 Address Data R/W SYNC VDA VPA VP Description
|
||||
1 1 PC-2 X 1 1 1 1 1 Opcode
|
||||
2 2 PC-1 X 1 0 0 1 1 Signature
|
||||
3 111 S PB 0 0 1 0 1 Write PB to Stack, S-1ÑS
|
||||
4 3 S PCH 0 0 1 0 1 Write PCH to Stack, S-1 - S
|
||||
5 4 S PCL 0 0 1 0 1 Write PCL to Stack, S-1ÑS
|
||||
6 5 S P 0 0 1 0 1 Write P to Stack, S-1ÑS
|
||||
7 6 VL (VL) 1 0 1 0 0 Read Vector Low Byte,
|
||||
0ÑPo, 1ÑPl, 00ÑPB
|
||||
8 7 VH (VH) 1 0 1 0 0 Read Vector High Byte
|
||||
|
||||
Notes:
|
||||
[1] Delete this cycle in Emulation mode.
|
||||
[2] Abort writes address of aborted opcode.
|
||||
[3] R/W remains in the high state during Reset.
|
||||
[4] In Emulation mode, bit 4 written to stack is changed to 0.
|
||||
|
||||
|
||||
|
||||
Table 3. Vector Locations
|
||||
|
||||
Emulation Native Priority
|
||||
Name Source (E = 1) (E = 0) Level
|
||||
|
||||
ABORT Hardware 00FFF8,9 00FFE8,9 2
|
||||
BRK Software 00FFFE,F 00FFE6,7 N/A
|
||||
COP Software 00FFF4,5 00FFE4,5 N/A
|
||||
IRQ Hardware 00FFFE,F 00FFEE,F 4
|
||||
NMI Hardware 00FFFA,B 00FFEA,B 3
|
||||
RES Hardware 00FFFC.D 00FFFC,D 1
|
||||
|
||||
117
files/docs/snes/65816/mnemonic.txt
Normal file
117
files/docs/snes/65816/mnemonic.txt
Normal file
@ -0,0 +1,117 @@
|
||||
|
||||
Table 4. G65SC802 and G65SC816 Instruction Set -- Alphabetical Sequence
|
||||
|
||||
ADC Add Memory to Accumulator with Carry
|
||||
AND "AND" Memory with Accumulator
|
||||
ASL Shift One Bit Left, Memory or Accumulator
|
||||
BCC* Branch on Carry Clear (Pe = O)
|
||||
BCS* Branch on Carry Set (Pe = 1)
|
||||
BEQ Branch if Equal (Pz = 1)
|
||||
BIT Bit Test
|
||||
BMI Branch if Result Minus (PN = 1)
|
||||
BNE Branch if Not Equal (Pz = 0)
|
||||
BPL Branch if Result Plus (PN = 0)
|
||||
BRA Branch Always
|
||||
BRK Force Break
|
||||
BRL Branch Always Long
|
||||
BVC Branch on Overflow Clear (Pv = 0)
|
||||
BVS Branch on Overflow Set (Pv = 1)
|
||||
CLC Clear Carry Flag
|
||||
CLD Clear Decimal Mode
|
||||
CLI Clear Interrupt Disable Bit
|
||||
CLV Clear Overflow Flag
|
||||
CMP* Compare Memory and Accumulator
|
||||
COP Coprocessor
|
||||
CPX Compare Memory and Index X
|
||||
CPY Compare Memory and Index Y
|
||||
DEC* Decrement Memory or Accumulator by One
|
||||
DEX Decrement Index X by One
|
||||
DEY Decrement Index Y by One
|
||||
EOR Exclusive "OR" Memory with Accumulator
|
||||
INC* Increment Memory or Accumulator by One
|
||||
INX Increment Index X by One
|
||||
INY Increment Index Y by One
|
||||
JML** Jump Long
|
||||
JMP Jump to New Location
|
||||
JSL** Jump Subroutine Long
|
||||
JSR Jump to New Location Saving Return Address
|
||||
LDA Load Accumulator with Memory
|
||||
LDX Load Index X with Memory
|
||||
LDY Load Index Y with Memory
|
||||
LSR Shift One Bit Right (Memory or Accumulator)
|
||||
MVN Block Move Negative
|
||||
MVP Block Move Positive
|
||||
NOP No Operation
|
||||
ORA "OR" Memory with Accumulator
|
||||
PEA Push Effective Absolute Address on Stack (or Push Immediate Data on Stack)
|
||||
PEI Push Effective Indirect Address on Stack (add one cycle if DL f 0)
|
||||
PER Push Effective Program Counter Relative Address on Stack
|
||||
PHA Push Accumulator on Stack
|
||||
PHB Push Data Bank Register on Stack
|
||||
PHD Push Direct Register on Stack
|
||||
PHK Push Program Bank Register on Stack
|
||||
PHP Push Processor Status on Stack
|
||||
PHX Push Index X on Stack
|
||||
PHY Push index Y on Stack
|
||||
PLA Pull Accumulator from Stack
|
||||
PLB Pull Data Bank Register from Stack
|
||||
PLD Pull Direct Register from Stack
|
||||
PLP Pull Processor Status from Stack
|
||||
PLX Pull Index X from Stack
|
||||
PLY Pull Index Y form Stack
|
||||
REP Reset Status Bits
|
||||
ROL Rotate One Bit Left (Memory or Accumulator)
|
||||
ROR Rotate One Bit Right (Memory or Accumulator)
|
||||
RTI Return from Interrupt
|
||||
RTL Return from Subroutine Long
|
||||
RTS Return from Subroutine
|
||||
SBC Subtract Memory from Accumulator with Borrow
|
||||
SEC Set Carry Flag
|
||||
SED Set Decimal Mode
|
||||
SEI Set Interrupt Disable Status
|
||||
SEP Set Processor Status Bits
|
||||
STA Store Accumulator in Memory
|
||||
STP Stop the Clock
|
||||
STX Store Index X in Memory
|
||||
STY Store Index Y in Memory
|
||||
STZ Store Zero in Memory
|
||||
TAX Transfer Accumulator to Index X
|
||||
TAY Transfer Accumulator to Index Y
|
||||
TCD* Transfer Accumulator to Direct Register
|
||||
TCS* Transfer Accumulator to Stack Pointer Register
|
||||
TDC* Transfer Direct Register to Accumulator
|
||||
TRB Test and Reset Bit
|
||||
TSB Test and Set Bit
|
||||
TSC* Transfer Stack Pointer Register to Accumulator
|
||||
TSX Transfer Stack Pointer Register to Index X
|
||||
TXA Transfer Index X to Accumulator
|
||||
TXS Transfer Index X to Stack Polnter Register
|
||||
TXY Transfer Index X to Index Y
|
||||
TYA Transfer Index Y to Accumulator
|
||||
TYX Transfer Index Y to Index X
|
||||
WAI Wait for Interrupt
|
||||
XBA* Exchange AH and AL
|
||||
XCE Exchange Carry and Emulation Bits
|
||||
|
||||
|
||||
*) Common Mnemonic Aliases
|
||||
|
||||
Mnemonic Alias
|
||||
BCC BLT
|
||||
BCS BGE
|
||||
CMP CPA
|
||||
DEC A DEA
|
||||
INC A INA
|
||||
TCD TAD
|
||||
TCS TAS
|
||||
TDC TDA
|
||||
TSC TSA
|
||||
XBA SWA
|
||||
|
||||
**) JSL should be recognized as equivalent to JSR
|
||||
when it is specified with long absolute addresses.
|
||||
JML is equivalent to JMP with long addressing forced.
|
||||
|
||||
|
||||
|
||||
-13-
|
||||
97
files/docs/snes/65816/opcodes.txt
Normal file
97
files/docs/snes/65816/opcodes.txt
Normal file
@ -0,0 +1,97 @@
|
||||
|
||||
|
||||
Table 8. Opcode Matrix
|
||||
|
||||
|
||||
MSD LSD MSD
|
||||
--+-------+--------+--------+----------+--------+--------+--------+---------+-------+--------+-------+-------+--------+--------+--------+---------+--
|
||||
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
|
||||
|-------+--------+--------+----------+--------+--------+--------+---------+-------+--------+-------+-------+--------+--------+--------+---------|
|
||||
0 | BRK s |ORA(d,x)| COP s | ORA d,s | TSB d | ORA d | ASL d | ORA [d] | PHP s | ORA # | ASL A | PHD s | TSB a | ORA a | ASL a | ORA al | 0
|
||||
| 2 8 | 2 6 | 2 8 | 2 4 | 2 5 | 2 3 | 2 5 | 2 6 | 1 3 | 2 2 | 1 2 | 1 4 | 3 6 | 3 4 | 3 6 | 4 5 |
|
||||
|-------+--------+--------+----------+--------+--------+--------+---------+-------+--------+-------+-------+--------+--------+--------+---------|
|
||||
1 | BPL r |ORA(d),y| ORA(d) |ORA(d,s),y| TRB d | ORA d,x| ASL d,x|ORA [d],y| CLC i | ORA a,y| INC A | TCS i | TRB a | ORA a,x| ASL a,x| ORA al,x| 1
|
||||
| 2 2 | 2 5 | 2 5 | 2 7 | 2 5 | 2 4 | 2 6 | 2 6 | 1 2 | 3 4 | 1 2 | 1 2 | 3 6 | 3 4 | 3 7 | 4 5 |
|
||||
|-------+--------+--------+----------+--------+--------+--------+---------+-------+--------+-------+-------+--------+--------+--------+---------|
|
||||
2 | JSR a |AND(d,x)| JSL al | AND d,s | BIT d | AND d | ROL d | AND [d] | PLP s | AND # | ROL A | PLD s | BIT a | AND a | ROL a | AND al | 2
|
||||
| 3 6 | 2 6 | 4 8 | 2 4 | 2 3 | 2 3 | 2 5 | 2 6 | 1 4 | 2 2 | 1 2 | 1 5 | 3 4 | 3 4 | 3 6 | 4 5 |
|
||||
|-------+--------+--------+----------+--------+--------+--------+---------+-------+--------+-------+-------+--------+--------+--------+---------|
|
||||
3 | BMI r |AND(d),y| AND (d)|AND(d,s),y| BIT d,x| AND d,x| ROL d,x|AND [d],y| SEC i | AND a,y| DEC A | TSC i | BIT a,x| AND a,x| ROL a,x| AND al,x| 3
|
||||
| 2 2 | 2 5 | 2 5 | 2 7 | 2 4 | 2 4 | 2 6 | 2 6 | 1 2 | 3 4 | 1 2 | 1 2 | 3 4 | 3 4 | 3 7 | 4 5 |
|
||||
|-------+--------+--------+----------+--------+--------+--------+---------+-------+--------+-------+-------+--------+--------+--------+---------|
|
||||
4 | RTI s |EOR(d,x)| reserve| EOR d,s | MVP xya| EOR d | LSR d | EOR [d] | PHA s | EOR # | LSR A | PHK s | JMP a | EOR a | LSR a | EOR al | 4
|
||||
| 1 7 | 2 6 | 2 2 | 2 4 | 3 7 | 2 3 | 2 5 | 2 6 | 1 3 | 2 2 | 1 2 | 1 3 | 3 3 | 3 4 | 3 6 | 4 5 |
|
||||
|-------+--------+--------+----------+--------+--------+--------+---------+-------+--------+-------+-------+--------+--------+--------+---------|
|
||||
5 | BVC r |EOR(d),y| EOR (d)|EOR(d,s),y| MVN xya| EOR d,x| LSR d,x|EOR [d],y| CLI i | EOR a,y| PHY s | TCD i | JMP al | EORa,x | LSRa,x | EOR al,x| 5
|
||||
| 2 2 | 2 5 | 2 5 | 2 7 | 3 7 | 2 4 | 2 6 | 2 6 | 1 2 | 3 4 | 1 3 | 1 2 | 4 4 | 3 4 | 3 7 | 4 5 |
|
||||
|-------+--------+--------+----------+--------+--------+--------+---------+-------+--------+-------+-------+--------+--------+--------+---------|
|
||||
6 | RTS s |ADC(d,x)| PER s | ADC d,s | STZ d | ADC d | ROR d | ADC [d] | PLA s | ADC # | ROR A | RTL s | JMP (a)| ADC a | ROR a | ADC al | 6
|
||||
| 1 6 | 2 6 | 3 6 | 2 4 | 2 3 | 2 3 | 2 5 | 2 6 | 1 4 | 2 2 | 1 2 | 1 6 | 3 5 | 3 4 | 3 6 | 4 5 |
|
||||
|-------+--------+--------+----------+--------+--------+--------+---------+-------+--------+-------+-------+--------+--------+--------+---------|
|
||||
7 | BVS r |ADC(d),y| ADC (d)|ADC(d,s),y| STZ d,x| ADC d,x| ROR d,x|ADC [d],y| SEI i | ADC a,y| PLY s | TDC i |JMP(a,x)| ADC a,x| ROR a,x| ADC al,x| 7
|
||||
| 2 2 | 2 5 | 2 5 | 2 7 | 2 4 | 2 4 | 2 6 | 2 6 | 1 2 | 3 4 | 1 4 | 1 2 | 3 6 | 3 4 | 3 7 | 4 5 |
|
||||
|-------+--------+--------+----------+--------+--------+--------+---------+-------+--------+-------+-------+--------+--------+--------+---------|
|
||||
8 | BRA r |STA(d,x)| BRL rl | STA d,s | STY d | STA d | STX d | STA [d] | DEY i | BIT # | TXA i | PHB s | STY a | STA a | STX a | STA al | 8
|
||||
| 2 2 | 2 6 | 3 3 | 2 4 | 2 3 | 2 3 | 2 3 | 2 6 | 1 2 | 2 2 | 1 2 | 1 3 | 3 4 | 3 4 | 3 4 | 4 5 |
|
||||
|-------+--------+--------+----------+--------+--------+--------+---------+-------+--------+-------+-------+--------+--------+--------+---------|
|
||||
9 | BCC r |STA(d),y| STA (d)|STA(d,s),y| STYd,x | STA d,x| STX d,y|STA [d],y| TYA i | STA a,y| TXS i | TXY i | STZ a | STA a,x| STZ a,x| STA al,x| 9
|
||||
| 2 2 | 2 6 | 2 5 | 2 7 | 2 4 | 2 4 | 2 4 | 2 6 | 1 2 | 3 5 | 1 2 | 1 2 | 3 4 | 3 5 | 3 5 | 4 5 |
|
||||
|-------+--------+--------+----------+--------+--------+--------+---------+-------+--------+-------+-------+--------+--------+--------+---------|
|
||||
A | LDY # |LDA(d,x)| LDX # | LDA d,s | LDY d | LDA d | LDX d | LDA [d] | TAY i | LDA # | TAX i | PLB s | LDY a | LDA a | LDX a | LDA al | A
|
||||
| 2 2 | 2 6 | 2 2 | 2 4 | 2 3 | 2 3 | 2 3 | 2 6 | 1 2 | 2 2 | 1 2 | 1 4 | 3 4 | 3 4 | 3 4 | 4 5 |
|
||||
|-------+--------+--------+----------+--------+--------+--------+---------+-------+--------+-------+-------+--------+--------+--------+---------|
|
||||
B | BCS r |LDA(d),y| LDA (d)|LDA(d,s),y| LDY d,x| LDA d,x| LDX d,y|LDA [d],y| CLV i | LDA a,y| TSX i | TYX i | LDY a,x| LDA a,x| LDX a,y| LDA al,x| B
|
||||
| 2 2 | 2 5 | 2 5 | 2 7 | 2 4 | 2 4 | 2 4 | 2 6 | 1 2 | 3 4 | 1 2 | 1 2 | 3 4 | 3 4 | 3 4 | 4 5 |
|
||||
|-------+--------+--------+----------+--------+--------+--------+---------+-------+--------+-------+-------+--------+--------+--------+---------|
|
||||
C | CPY # |CMP(d,x)| REP # | CMP d,s | CPY d | CMP d | DEC d | CMP [d] | INY i | CMP # | DEX i | WAI i | CPY a | CMP a | DEC a | CMP al | C
|
||||
| 2 2 | 2 6 | 2 3 | 2 4 | 2 3 | 2 3 | 2 5 | 2 6 | 1 2 | 2 2 | 1 2 | 1 3 | 3 4 | 3 4 | 3 4 | 4 5 |
|
||||
|-------+--------+--------+----------+--------+--------+--------+---------+-------+--------+-------+-------+--------+--------+--------+---------|
|
||||
D | BNE r |CMP(d),y| CMP (d)|CMP(d,s),y| PEI s | CMP d,x| DEC d,x|CMP [d],y| CLD i | CMP a,y| PHX s | STP i | JML (a)| CMP a,x| DEC a,x| CMP al,x| D
|
||||
| 2 2 | 2 5 | 2 5 | 2 7 | 2 6 | 2 4 | 2 6 | 2 6 | 1 2 | 3 4 | 1 3 | 1 3 | 3 6 | 3 4 | 3 7 | 4 5 |
|
||||
|-------+--------+--------+----------+--------+--------+--------+---------+-------+--------+-------+-------+--------+--------+--------+---------|
|
||||
E | CPX # |SBC(d,x)| SEP # | SBC d,s | CPX d | SBC d | INC d | SBC [d] | INX i | SBC # | NOP i | XBA i | CPX a | SBC a | INC a | SBC al | E
|
||||
| 2 2 | 2 6 | 2 3 | 2 4 | 2 3 | 2 3 | 2 5 | 2 6 | 1 2 | 2 2 | 1 2 | 1 3 | 3 4 | 3 4 | 3 6 | 4 5 |
|
||||
|-------+--------+--------+----------+--------+--------+--------+---------+-------+--------+-------+-------+--------+--------+--------+---------|
|
||||
F | BEQ r |SBC(d),y| SBC (d)|SBC(d,s),y| PEA s | SBC d,x| INC d,x|SBC [d],y| SED i | SBC a,y| PLX s | XCE i |JSR(a,x)| SBC a,x| INC a,x| SBC al,x| F
|
||||
| 2 2 | 2 5 | 2 5 | 2 7 | 3 5 | 2 4 | 2 6 | 2 6 | 1 2 | 3 4 | 1 4 | 1 2 | 3 6 | 3 4 | 3 7 | 4 5 |
|
||||
|-------+--------+--------+----------+--------+--------+--------+---------+-------+--------+-------+-------+--------+--------+--------+---------|
|
||||
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
|
||||
--+-------+--------+--------+----------+--------+--------+--------+---------+-------+--------+-------+-------+--------+--------+--------+---------+--
|
||||
|
||||
|
||||
|
||||
Symbol Addressing mode
|
||||
|
||||
# immediate
|
||||
A accumulator
|
||||
r program counter relative
|
||||
rl program counter relative long
|
||||
i implied
|
||||
s stack
|
||||
d direct
|
||||
d,x direct indexed (with x)
|
||||
d,y direct indexed (with y)
|
||||
(d) direct Indirect
|
||||
(d,x) direct indexed Indirect
|
||||
(d),y direct Indirect indexed
|
||||
[d] direct indirect long
|
||||
[d],y direct indirect indexed long
|
||||
a absolute
|
||||
a,x absolute indexed (with x)
|
||||
a,y absolute indexed (with y)
|
||||
al absolute long
|
||||
al,x absolute indexed long
|
||||
d,s stack relative
|
||||
(d,s),y stack relative indirect Indexed
|
||||
(a) absolute indirect
|
||||
(a,x) absoite Indxed Indirect
|
||||
xya block move
|
||||
|
||||
|
||||
|
||||
Legend
|
||||
Instruction mnemonic Addressing mode
|
||||
|
||||
Base number of base number Cycles
|
||||
of bytes
|
||||
|
||||
188
files/docs/snes/65816/scnfrmt.txt
Normal file
188
files/docs/snes/65816/scnfrmt.txt
Normal file
@ -0,0 +1,188 @@
|
||||
[Image]
|
||||
|
||||
SNES Screen Format
|
||||
|
||||
[Image]
|
||||
|
||||
|
||||
SNES GRAPHICS INFO FILE V1.0
|
||||
----------------------------
|
||||
By DAX on 28/2/93
|
||||
|
||||
This is a short text file on how the data for the gfx on the SNES are
|
||||
set up..
|
||||
Everything is based around an 8x8 pixel 'Tile' and thinking in terms of
|
||||
tiles makes the whole thing a lot easier.
|
||||
|
||||
4 Colour mode - 2 Bitplanes
|
||||
---------------------------
|
||||
If you split the screen into 8x8 pixel tiles, the order of the graphics data
|
||||
is tile 0,1,2,3,4 etc.(with tile 0 being the first, and 1 being the one on
|
||||
the right of it.)
|
||||
|
||||
Then for each tile, the data is stored as shown below.
|
||||
00 01 02 03 04 05 06 07
|
||||
10 11 12 13 14 15 16 17 Each number representing one pixel in
|
||||
20 21 22 23 24 25 26 27 the 8x8 tile.
|
||||
30 31 32 33 34 35 36 37
|
||||
40 41 42 43 44 45 46 47
|
||||
50 51 52 53 54 55 56 57
|
||||
60 61 62 63 64 65 66 67
|
||||
70 71 72 73 74 75 76 77
|
||||
|
||||
The data is stored in the SNES binary in the following format.
|
||||
Bitplane 0 .. Line 00-07 (One Byte)
|
||||
Line 10-17
|
||||
Line 20-27
|
||||
Line 30-37
|
||||
Line 40-47
|
||||
Line 50-57
|
||||
Line 60-67
|
||||
Line 70-77
|
||||
then Bitplane 1 .. Line 00-07
|
||||
Line 10-17
|
||||
Line 20-27
|
||||
Line 30-37
|
||||
Line 40-47
|
||||
Line 50-57
|
||||
Line 60-67
|
||||
Line 70-77
|
||||
then comes the data for the next tile (the one on the right).etc.
|
||||
|
||||
16 Colour - 4 Bitplanes
|
||||
-----------------------
|
||||
The data for this mode is stored in the same format, with one main change.
|
||||
The data is stored in the format
|
||||
Bitplane 0 .. Line 00-07
|
||||
|
|
||||
Line 70-77
|
||||
|
||||
Bitplane 1 .. Line 00-07
|
||||
|
|
||||
Line 70-77
|
||||
|
||||
Bitplane 2 .. Line 00-07
|
||||
|
|
||||
Line 70-77
|
||||
|
||||
Bitplane 3 .. Line 00-07
|
||||
|
|
||||
Line 70-77
|
||||
|
||||
then the data for the next tile.
|
||||
|
||||
256 Colour - 8 Bitplanes
|
||||
------------------------
|
||||
This is simply an expansion of the 4 and 16 colour modes.
|
||||
Bitplane 0 .. Line 00-07
|
||||
|
|
||||
Line 70-77
|
||||
|
||||
Bitplane 1 .. Line 00-07
|
||||
|
|
||||
Line 70-77
|
||||
|
||||
Bitplane 2 .. Line 00-07
|
||||
|
|
||||
Line 70-77
|
||||
|
||||
Bitplane 3 .. Line 00-07
|
||||
|
|
||||
Line 70-77
|
||||
|
||||
Bitplane 4 .. Line 00-07
|
||||
|
|
||||
Line 70-77
|
||||
|
||||
Bitplane 5 .. Line 00-07
|
||||
|
|
||||
Line 70-77
|
||||
|
||||
Bitplane 6 .. Line 00-07
|
||||
|
|
||||
Line 70-77
|
||||
|
||||
Bitplane 7 .. Line 00-07
|
||||
|
|
||||
Line 70-77
|
||||
|
||||
then the data for the next tile.
|
||||
|
||||
256 Colours - Mode 7 format
|
||||
---------------------------
|
||||
This has some very major differences to the other graphics data formats
|
||||
|
||||
there are two mode7 modes, normal and EXTBG, the data is stored in the
|
||||
same way in both, apart from in EXTBG the Bitplane 7 value will be a
|
||||
priority bit for the pixel, which cuts the colours down to 128.
|
||||
|
||||
Each byte of 'graphics data' is actually the colour value for that pixel
|
||||
on the screen, so if the value is 64, then the colour of that pixel will
|
||||
be the contents of colour register 64.
|
||||
|
||||
The data is stored in VRAM differently to the other modes, with the tile
|
||||
numbers, and the graphics data 'interleaved', starting at $0000 in VRAM,
|
||||
with alternate bytes containing one byte of tile, one byte of gfx - this
|
||||
is shown below.
|
||||
|
||||
Word of VRAM. HI LO
|
||||
Bit 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
|
||||
content |------------------------------||------------------------------|
|
||||
Graphics data(CHAR DATA) Tile number(NAME)
|
||||
|
||||
Because of the storing of 16 bit data in reverse format (LO-HI) this means
|
||||
that if you set the VRAM addr to $0.the first byte written should be the
|
||||
tile name for that position on screen and the second byte should be the first
|
||||
byte of the Mode7 graphics data.if the VRAM addr is set to $1 the first byte
|
||||
written will be the tile name for that position on scr, and the second byte
|
||||
should be the second byte of the mode7 graphics data.
|
||||
ETC
|
||||
|
||||
In mode7 you can only have a maximum of 256 tiles, because of the fact that
|
||||
the mode7 data only takes up the first half of VRAM(32k) you can only have 16k
|
||||
of graphics data which is 256 tiles of 8x8 with 256 colours.
|
||||
This is quite a limitation, but can be used quite effectively.
|
||||
|
||||
The tile numbers are stored in a format according to a 128x128 tile screen
|
||||
so tile 128($80) would be the tile below 0($0) on the screen, and so on.
|
||||
so VRAM addr $0 is the top left tile, and $1 is the one on the right of it
|
||||
$80 is the one on the left side, one row down.
|
||||
|
||||
the graphics data is stored based on an 8x8 tile again.
|
||||
but slightly different.
|
||||
Each byte(pixel) is stored so...
|
||||
Bit number Contents
|
||||
0 Bitplane 0 pixel value
|
||||
1 Bitplane 1 pixel value
|
||||
2 Bitplane 2 pixel value
|
||||
3 Bitplane 3 pixel value
|
||||
4 Bitplane 4 pixel value
|
||||
5 Bitplane 5 pixel value
|
||||
6 Bitplane 6 pixel value
|
||||
7 Bitplane 7 pixel value /
|
||||
(EXTBG mode - Priority value)
|
||||
|
||||
The data is then stored in the sequence
|
||||
00,01,02,03,04,05,06,07
|
||||
10,11,12,13,14,15,16,16 (Look at diagram at start of file
|
||||
| | | for explanation)
|
||||
70,71,72,73,74,75,76,77
|
||||
|
||||
with one byte for each position(pixel), according to the 8x8 tile format,
|
||||
with one tile after another.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
I hope this text file helps those of you having trouble converting graphics
|
||||
for use on the SNES, I have been asked a few times recently for this info
|
||||
so I decided to type up this short text file on it.
|
||||
Hopefully it should explain it!
|
||||
|
||||
|
||||
|
||||
[Image]
|
||||
|
||||
© 1996 Damaged Cybernetics
|
||||
|
||||
|
||||
|
||||
[Image]
|
||||
14
files/docs/snes/65816/thetrip.tag
Executable file
14
files/docs/snes/65816/thetrip.tag
Executable file
@ -0,0 +1,14 @@
|
||||
|
||||
This File Passed thru:
|
||||
_ _ _
|
||||
/{____________ ___________ /{_______________________)\
|
||||
\\ ; ----._/:\ : --./ \\ ; ----._/ .\. ,/ _ \
|
||||
\. / :: \. ;/ \. / /; /. | /_; :
|
||||
\_| / | ___/ \_| // ` / : :; ,/
|
||||
| |/| .. |. \ | |/; . \ | |; |
|
||||
/. \| :. |; __/\ /. \ \ .\|. |. |
|
||||
\___ / \ || /____. ') \___ ./_ "/_ /____\ /
|
||||
\/ \||/ \ ;/ \/ \/ \/ V
|
||||
)/
|
||||
` T1! 207.8.XXX.XX
|
||||
SiteOp: Stumble
|
||||
2762
files/docs/snes/65816info.txt
Normal file
2762
files/docs/snes/65816info.txt
Normal file
File diff suppressed because it is too large
Load Diff
BIN
files/docs/snes/ArchitekturdesSNES-Final.doc
Normal file
BIN
files/docs/snes/ArchitekturdesSNES-Final.doc
Normal file
Binary file not shown.
61
files/docs/snes/Intrrpts.txt
Normal file
61
files/docs/snes/Intrrpts.txt
Normal file
@ -0,0 +1,61 @@
|
||||
|
||||
Interrupt Processing Sequence
|
||||
|
||||
|
||||
The interrupt processing sequence is initiated as the direct result of hard-
|
||||
vare Abort, Interrupt Request, Non-Maskable Interrupt, or Reset inputs.
|
||||
The interrupt sequence can also be initiated as a result of the Break or
|
||||
Co-Processor instructions within the software. The following listings
|
||||
describe the function of each cycle in the interrupt processing sequence:
|
||||
|
||||
|
||||
Hardware Interrupt /ABORT, /IRQ, /NMI, /RES Inputs
|
||||
|
||||
Cycle No.
|
||||
E = 0 E = 1 Address Data R/W SYNC VDA VPA VP Description
|
||||
|
||||
1 1 PC X 1 1 1 1 1 Internal Operation
|
||||
2 2 PC X 1 0 0 0 1 Internal Operation
|
||||
3 [1] S PB 0 0 1 0 1 Write PB to Stack, S-1ÑS
|
||||
4 3 S PCH [2] 0[3] 0 1 0 1 Write PCH to Stack, S-1ÑS
|
||||
5 4 S PCL 12] 0[3] 0 1 0 1 Write PCL to Stack, S-1ÑS
|
||||
6 5 S P [4] 0[3] 0 1 0 1 Write P to Stack, S-1ÑS
|
||||
7 6 VL (VL) 1 0 1 0 0 Read Vector Low Byte,
|
||||
0->PD, 1->P1, OO->PB
|
||||
8 7 VH (VH) 1 0 1 0 0 Read Vector High 8yte
|
||||
|
||||
|
||||
Software Interrupt - BRK, COP Instructions
|
||||
|
||||
Cycle No.
|
||||
E = 0 E = 1 Address Data R/W SYNC VDA VPA VP Description
|
||||
1 1 PC-2 X 1 1 1 1 1 Opcode
|
||||
2 2 PC-1 X 1 0 0 1 1 Signature
|
||||
3 111 S PB 0 0 1 0 1 Write PB to Stack, S-1ÑS
|
||||
4 3 S PCH 0 0 1 0 1 Write PCH to Stack, S-1 - S
|
||||
5 4 S PCL 0 0 1 0 1 Write PCL to Stack, S-1ÑS
|
||||
6 5 S P 0 0 1 0 1 Write P to Stack, S-1ÑS
|
||||
7 6 VL (VL) 1 0 1 0 0 Read Vector Low Byte,
|
||||
0ÑPo, 1ÑPl, 00ÑPB
|
||||
8 7 VH (VH) 1 0 1 0 0 Read Vector High Byte
|
||||
|
||||
Notes:
|
||||
[1] Delete this cycle in Emulation mode.
|
||||
[2] Abort writes address of aborted opcode.
|
||||
[3] R/W remains in the high state during Reset.
|
||||
[4] In Emulation mode, bit 4 written to stack is changed to 0.
|
||||
|
||||
|
||||
|
||||
Table 3. Vector Locations
|
||||
|
||||
Emulation Native Priority
|
||||
Name Source (E = 1) (E = 0) Level
|
||||
|
||||
ABORT Hardware 00FFF8,9 00FFE8,9 2
|
||||
BRK Software 00FFFE,F 00FFE6,7 N/A
|
||||
COP Software 00FFF4,5 00FFE4,5 N/A
|
||||
IRQ Hardware 00FFFE,F 00FFEE,F 4
|
||||
NMI Hardware 00FFFA,B 00FFEA,B 3
|
||||
RES Hardware 00FFFC.D 00FFFC,D 1
|
||||
|
||||
BIN
files/docs/snes/LoROM.png
Normal file
BIN
files/docs/snes/LoROM.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 158 KiB |
65
files/docs/snes/Qaddress.txt
Normal file
65
files/docs/snes/Qaddress.txt
Normal file
@ -0,0 +1,65 @@
|
||||
Addressing mode quick reference
|
||||
By Qwertie (QwertMan@hotmail.com)
|
||||
|
||||
I lifted this straight from my emulator code, which I tend to comment heavily :)
|
||||
|
||||
Please correct me if any of this is wrong...
|
||||
|
||||
// ADDRESSING MODES - several categories, one mode from each category can be combined
|
||||
// None of the instructions can use all combinations, and certain combinations are
|
||||
// never used with any instruction.
|
||||
// Used to calculate memory address:
|
||||
// Absolute: Argument is two bytes and specifies a memory location
|
||||
// + Long: Argument is three bytes instead opcode $addr
|
||||
// Direct: Argument is one byte; memory address formed by adding D.
|
||||
// Bank is always 0, unless indirect addressing is also used, in
|
||||
// which case the bank is the program bank. opcode <$addr
|
||||
// Stack Relative: Argument is one byte, which is added to the stack pointer
|
||||
// to find the final address. opcode $addr,S
|
||||
// Indexed addressing:
|
||||
// Indexed: Memory location argument is added to X or Y to get the final
|
||||
// memory location. opcode $addr,X or Y
|
||||
// Note that certain indexed addressing modes only work with the X register
|
||||
// or only with the Y register.
|
||||
//
|
||||
// Note! The above addressing mode specifiers are used only to specify the
|
||||
// size of the argument and how it is used. The specifiers DO NOT SPECIFY
|
||||
// anything about the actual memory location being referenced.
|
||||
// For example, suppose the Absolute Indexed mode is used. This means that
|
||||
// the argument to the opcode is 16 bits and will be added to an index
|
||||
// register. It does not, however, mean that the value at the calculated
|
||||
// memory location will be a 16-bit value. The size of the value at the memory
|
||||
// location is determined by either:
|
||||
// a. whether the processor is in 16-bit mode (and whether E=0), or
|
||||
// b. if indirect addressing is used, whether the Long Indirect mode is used.
|
||||
//
|
||||
// Indirect addressing:
|
||||
// Indirect: Uses indirection (pointers). In other words, after the memory
|
||||
// location is found and the contents are loaded, the contents are used as
|
||||
// a SECOND memory location and the value at the second memory location is
|
||||
// used in the operation. opcode ($addr)
|
||||
// + Direct Long: Normally, the pointer found at the specified location
|
||||
// will be two bytes. If Direct Indirect Long is used, the pointer
|
||||
// at the memory address found will be a three-byte long address.
|
||||
// opcode [$addr]
|
||||
// Indexed Indirect (preindexed; (arg,x)) vs. Indirect Indexed (postindexed;
|
||||
// (arg),x): remember, these two are different!
|
||||
//
|
||||
// Stack relative addressing: denoted by arg,s, the address is calculated by
|
||||
// adding the argument value to the stack pointer. Always accesses bank 0,
|
||||
// since the stack is always in bank 0.
|
||||
// There is also two more modes, which are never used with any other specifiers:
|
||||
// Implied: Opcode has no arguments
|
||||
// Immediate: The argument specifies an actual constant value to be used,
|
||||
// rather than a memory address. [opcode #$XX or #$XXXX]
|
||||
|
||||
Vector Locations:
|
||||
In Emulation Mode: In Native Mode:
|
||||
00.FFFE /IRQ or BRK 00.FFEE /IRQ
|
||||
00.FFFC /RESET 00.FFEC (Unused)
|
||||
00.FFFA /NMI 00.FFEA /NMI
|
||||
00.FFF8 /ABORT 00.FFE8 /ABORT
|
||||
00.FFF6 (Unused) 00.FFE6 BRK
|
||||
00.FFF4 CSP 00.FFE4 CSP
|
||||
-The location after the one listed holds the high byte of the address
|
||||
-CSP (Call system procedure) is same as the COP mnemonic
|
||||
BIN
files/docs/snes/SNES-PIN
Normal file
BIN
files/docs/snes/SNES-PIN
Normal file
Binary file not shown.
343
files/docs/snes/SNES-ROM.TXT
Normal file
343
files/docs/snes/SNES-ROM.TXT
Normal file
@ -0,0 +1,343 @@
|
||||
|
||||
______ _____ _____ _______ ___ ___
|
||||
/ __/ /. _ \ ___/ __/ |____ \___ /. \/ \
|
||||
\___ .\// |. \ / . \__ .\ |. _/ \// .\
|
||||
/. \\ |: .\ __/ \\ || | .\ ! \ \/. \
|
||||
\______ /___|____/____\____ / |__| \\___/____||: \
|
||||
By Mind Rape \___/ |______/
|
||||
v1.5 (C) Damaged Cybernetics 1994-95
|
||||
|
||||
|
||||
This document main goal is show where one can find the SNES ROM
|
||||
information. Most of this information was collected thru hacking
|
||||
the rom to death and help from Norm/Yoshi/chp.
|
||||
|
||||
License codes are taken from SU and probably incorrect.
|
||||
|
||||
Source? None here, if you are going to screw with the bin,
|
||||
you probably know what you are doing (HOPEFULLY).
|
||||
|
||||
If you have any questions, comments,corrections, additional information,
|
||||
you can either find me on IRC as (MindRape) or you can send me email
|
||||
(much prefered) mind@primenet.com. Also if you write anything
|
||||
interesting then send it to me!
|
||||
|
||||
You may distribute this document freely, but you may not change
|
||||
the information here and redistribute. If you use this information
|
||||
please credit me. You steal this information and say you did it,
|
||||
you know it's a LIE and there you are.
|
||||
|
||||
=[SNES ROM Makeup]===========================================================
|
||||
|
||||
ROM Title : 21 Bytes
|
||||
|
||||
* Titles are all in upper case
|
||||
* Japanese titles are in high ascii values
|
||||
good rule of thumb if you can't read the title and
|
||||
it's country code is Japan and your American,
|
||||
you probably can't play it. :>
|
||||
|
||||
Rom Makeup : 7654 3210
|
||||
0000-0000
|
||||
|__| |__|
|
||||
| |
|
||||
| |___Bank Size 0001 = HiROM (64K Banks Mode 21)
|
||||
| 0000 = Low Rom (32K Banks Mode 20)
|
||||
|
|
||||
|________ROM Speed 0111 = Fast Rom
|
||||
0000 = Slow Rom
|
||||
|
||||
* Could someone give the correct
|
||||
* speeds of the ROMs? I got
|
||||
* conflicting answers.
|
||||
|
||||
|
||||
ROM Type : 1 Byte
|
||||
|
||||
Hex ROM Type
|
||||
---------------------
|
||||
00 ROM
|
||||
01 ROM/RAM
|
||||
02 ROM/SRAM
|
||||
03 ROM/DSP1
|
||||
04 ROM/DSP1/RAM
|
||||
05 ROM/DSP1/SRAM
|
||||
06 FX
|
||||
|
||||
* SRAM = Save Ram
|
||||
* DSP1 = Nintendo's 1st generation of DSP (Math coprocessor)
|
||||
* FX = RISC based math coprocessor
|
||||
Only a couple of games support the FX Chip, Star Fox
|
||||
is the most well known one.
|
||||
|
||||
|
||||
ROM Size : 1 BYTE
|
||||
|
||||
Hex Size
|
||||
--------------
|
||||
08 2 Mbit
|
||||
09 4 Mbit
|
||||
0A 8 Mbit
|
||||
0B 16 Mbit
|
||||
0C 32 Mbit
|
||||
|
||||
* As of this documentation 32MBit ROMs are the largest that
|
||||
Nintendo currently uses. Rumors of a 40+ kart are around,
|
||||
but cannot be verified.
|
||||
|
||||
* 8MBit ROMs are the most common in the entire library of
|
||||
SNES karts
|
||||
|
||||
* ROMs are always multiples 2, thus 2MBit ROMs are the smallest
|
||||
Space Invaders (c) Taito is a 2MBit ROM (Japan only)
|
||||
|
||||
* Easy way to calc rom size without a lookup table
|
||||
|
||||
1 << (ROM_SIZE - 7) MBits
|
||||
|
||||
ie. 8Mbit ROMs = 0Ah = 10d
|
||||
1 << (0A-7) = 8 Mbit
|
||||
|
||||
SRAM Size : 1 BYTE
|
||||
|
||||
Hex Size
|
||||
--------------
|
||||
00 No SRAM
|
||||
01 16 Kbit
|
||||
02 32 Kbit
|
||||
03 64 Kbit
|
||||
|
||||
* 64Kbit is the largest SRAM size that Nintendo currently uses.
|
||||
* 256Kbit is standard for most copiers.
|
||||
|
||||
* Easy way to calc SRAM Size without a lookup table
|
||||
|
||||
1 << (3+SRAM_BYTE) Kbits
|
||||
|
||||
ie. 16Kbit = 01
|
||||
1 << (3+1) = 16
|
||||
|
||||
|
||||
COUNTRY CODE : 1 BYTE
|
||||
|
||||
Hex Country Video Mode
|
||||
------------------------------------------
|
||||
00 Japan (NTSC)
|
||||
01 USA (NTSC)
|
||||
02 Europe, Oceania, Asia (PAL)
|
||||
03 Sweden (PAL)
|
||||
04 Finland (PAL)
|
||||
05 Denmark (PAL)
|
||||
06 France (PAL)
|
||||
07 Holland (PAL)
|
||||
08 Spain (PAL)
|
||||
09 Germany, Austria, Switz (PAL)
|
||||
10 Italy (PAL)
|
||||
11 Hong Kong, China (PAL)
|
||||
12 Indonesia (PAL)
|
||||
13 Korea (PAL)
|
||||
|
||||
* Country Codes are from SU.INI, could someone verify these?
|
||||
|
||||
LICENSE : 1 BYTE
|
||||
0 <Invalid License Code>
|
||||
1 Nintendo
|
||||
5 Zamuse
|
||||
8 Capcom
|
||||
9 HOT B
|
||||
10 Jaleco
|
||||
11 STORM (Sales Curve) (1)
|
||||
15 Mebio Software
|
||||
18 Gremlin Graphics
|
||||
21 COBRA Team
|
||||
22 Human/Field
|
||||
24 Hudson Soft
|
||||
26 Yanoman
|
||||
28 Tecmo (1)
|
||||
30 Forum
|
||||
31 Park Place Productions / VIRGIN
|
||||
33 Tokai Engeneering (SUNSOFT?)
|
||||
34 POW
|
||||
35 Loriciel / Micro World
|
||||
38 Enix
|
||||
40 Kemco (1)
|
||||
41 Seta Co.,Ltd.
|
||||
45 Visit Co.,Ltd.
|
||||
53 HECT
|
||||
61 Loriciel
|
||||
64 Seika Corp.
|
||||
65 UBI Soft
|
||||
71 Spectrum Holobyte
|
||||
73 Irem
|
||||
75 Raya Systems/Sculptured Software
|
||||
76 Renovation Pruducts
|
||||
77 Malibu Games (T*HQ Inc.) / Black Pearl
|
||||
79 U.S. Gold
|
||||
80 Absolute Entertainment
|
||||
81 Acclaim
|
||||
82 Activision
|
||||
83 American Sammy
|
||||
84 GameTek
|
||||
85 Hi Tech
|
||||
86 LJN Toys
|
||||
90 Mindscape
|
||||
93 Technos Japan Corp. (Tradewest)
|
||||
95 American Softworks Corp.
|
||||
96 Titus
|
||||
97 Virgin Games
|
||||
98 Maxis
|
||||
103 Ocean
|
||||
105 Electronic Arts
|
||||
107 Laser Beam
|
||||
110 Elite
|
||||
111 Electro Brain
|
||||
112 Infogrames
|
||||
113 Interplay
|
||||
114 LucasArts
|
||||
115 Sculptured Soft
|
||||
117 STORM (Sales Curve) (2)
|
||||
120 THQ Software
|
||||
121 Accolade Inc.
|
||||
122 Triffix Entertainment
|
||||
124 Microprose
|
||||
127 Kemco (2)
|
||||
130 Namcot/Namco Ltd. (1)
|
||||
132 Koei/Koei! (second license?)
|
||||
134 Tokuma Shoten Intermedia
|
||||
136 DATAM-Polystar
|
||||
139 Bullet-Proof Software
|
||||
140 Vic Tokai
|
||||
143 I'Max
|
||||
145 CHUN Soft
|
||||
146 Video System Co., Ltd.
|
||||
147 BEC
|
||||
151 Kaneco
|
||||
153 Pack in Video
|
||||
154 Nichibutsu
|
||||
155 TECMO (2)
|
||||
156 Imagineer Co.
|
||||
160 Wolf Team
|
||||
164 Konami
|
||||
165 K.Amusement
|
||||
167 Takara
|
||||
169 Technos Jap. ????
|
||||
170 JVC
|
||||
172 Toei Animation
|
||||
173 Toho
|
||||
175 Namcot/Namco Ltd. (2)
|
||||
177 ASCII Co. Activison
|
||||
178 BanDai America
|
||||
180 Enix
|
||||
182 Halken
|
||||
186 Culture Brain
|
||||
187 Sunsoft
|
||||
188 Toshiba EMI/System Vision
|
||||
189 Sony (Japan) / Imagesoft
|
||||
191 Sammy
|
||||
192 Taito
|
||||
194 Kemco (3) ????
|
||||
195 Square
|
||||
196 NHK
|
||||
197 Data East
|
||||
198 Tonkin House
|
||||
200 KOEI
|
||||
202 Konami USA
|
||||
205 Meldac/KAZe
|
||||
206 PONY CANYON
|
||||
207 Sotsu Agency
|
||||
209 Sofel
|
||||
210 Quest Corp.
|
||||
211 Sigma
|
||||
214 Naxat
|
||||
216 Capcom Co., Ltd. (2)
|
||||
217 Banpresto
|
||||
219 Hiro
|
||||
221 NCS
|
||||
222 Human Entertainment
|
||||
223 Ringler Studios
|
||||
224 K.K. DCE / Jaleco
|
||||
226 Sotsu Agency
|
||||
228 T&ESoft
|
||||
229 EPOCH Co.,Ltd.
|
||||
231 Athena
|
||||
232 Asmik
|
||||
233 Natsume
|
||||
234 King/A Wave
|
||||
235 Atlus
|
||||
236 Sony Music
|
||||
238 Psygnosis / igs
|
||||
243 Beam Software
|
||||
244 Tec Magik
|
||||
255 Hudson Soft
|
||||
|
||||
* License Codes are from SU.INI, could someone verify these?
|
||||
|
||||
* I believe the # of licenses is low. Is it possible that
|
||||
License and Country codes are used in conjuction to produce
|
||||
that many more licenses?
|
||||
|
||||
VERSION - 1 byte
|
||||
|
||||
* The Version is interpeted this way.
|
||||
1.?? - (thanks to yoshi for the correction)
|
||||
|
||||
CHECKSUM COMPLEMENT - 2 bytes the complement of the checksum :>
|
||||
|
||||
The bits are reversed of the CHECKSUM
|
||||
|
||||
CHECKSUM - 2 bytes Checksum of the bin
|
||||
|
||||
* Anyone know how the checksum is calculated for the ROM?
|
||||
|
||||
NMI/VBL Vector - 2 bytes - OFFSET 81FAh (lowrom)
|
||||
OFFSET 101FAh (hirom)
|
||||
|
||||
RESET Vector - 2 bytes where to start our code at - OFFSET 81FCh (lowrom)
|
||||
- OFFSET 101FAh (hirom)
|
||||
* 8000h is common for Low Roms
|
||||
|
||||
=[READING THE CORRECT BIN INFORMATION]==================================
|
||||
|
||||
The bin information can be found in 2 possible places,
|
||||
|
||||
a) End of the 1st 32K bank (Low ROM) (81c0h/w 512 byte header)
|
||||
b) End of the 1st 64K bank (HiROM) (101c0h/w 512 byte header)
|
||||
|
||||
You could use UCON's method (author chp).
|
||||
|
||||
The method is as followed:
|
||||
|
||||
UCON's method is to OR the Checksum and the Complement. If the
|
||||
resulting value is FFFFh, then we found the correct location of
|
||||
to extract rest of the data out. HOWEVER! This fails on several
|
||||
karts, such as Castle Wolfenstien 3D and Super Tetris 3 for example.
|
||||
|
||||
Reason being is that not all developers put the correct complement
|
||||
or bother even to implement it. I would suspect! That this maybe
|
||||
a ploy to keep other developers out of the bin, for if they can't
|
||||
find the reset vector, disassembling becomes a bit difficult.
|
||||
|
||||
=[Other Information on SNES?]================================================
|
||||
|
||||
Famicom Development FTP Site
|
||||
busop.cit.wayne.edu - pub/famidev
|
||||
|
||||
Yoshi's SNES Documentation 2.3
|
||||
|
||||
This is considered the BEST source of SNES hardware information,
|
||||
and the most complete!
|
||||
|
||||
busop.cit.wayne.edu - pub/famidev/incoming/sndoc230.lzh
|
||||
|
||||
=[w0rd!]=====================================================================
|
||||
|
||||
w0rd to all following console dudes
|
||||
|
||||
GoosE_,yoshi,sir jinx,chp,SHORYUKEN,_bubsy,felon,archimede
|
||||
rugalz,SinZ,dragonz,procyon,royce,hoodlem,bri_acid,kamikitty,
|
||||
norm,ZillionZ Members,grayarea,Victor,drunkfux(h0h0h0h0),dmessiah,
|
||||
piratendo
|
||||
|
||||
<insert your favorite group(s) greet here> (heh)
|
||||
|
||||
Later Mind Rape
|
||||
971
files/docs/snes/SNES.DOC
Normal file
971
files/docs/snes/SNES.DOC
Normal file
@ -0,0 +1,971 @@
|
||||
=-=-=
|
||||
SNES Documentation v1.3: Written by Yoshi of Digital Exodus.
|
||||
=-=-=
|
||||
1) Memory Map.
|
||||
i) "Main" memory map.
|
||||
ii) Additional info.
|
||||
2) SNES Color explaination.
|
||||
3) SNES DMA Memory Map and explaination.
|
||||
4) SNES Graphics (tiles) explaination.
|
||||
5) SNES Screen mode definitions.
|
||||
6) SNES OAM/Sprite explaination.
|
||||
7) Magicom Disk registers and Memory controller locations.
|
||||
69) About the author...
|
||||
FF) Greetings, Thanx, etc...
|
||||
=-=-=
|
||||
1) Memory Map.
|
||||
i) "Main" memory map.
|
||||
-----------
|
||||
Just so you know... the R and/or W's on the left side before the
|
||||
memory location mean [R]eadable and/or [W]riteable. I don't know
|
||||
what happens if you try to read from the write-only registers:
|
||||
I think you get bogus data, but that's about it.
|
||||
-----------
|
||||
W |$2100: Screen display register.
|
||||
x000bbbb
|
||||
x: 0 = Screen on.
|
||||
1 = Screen off.
|
||||
bbbb: 0-$F = Brightness of screen.
|
||||
|
||||
*** If you increment $2100 so the register goes up
|
||||
to $xF (x being whatever), you can make the
|
||||
screen "fade in". Make -SURE- you do this only
|
||||
during the VBlank period! If you don't, the screen
|
||||
goes totally wacko! The 'GS programmers like myself
|
||||
call it "Syncing to the VBL".
|
||||
-----------
|
||||
W |$2101: OAM (Sprite) sizes.
|
||||
sssnnbbb
|
||||
s: Size.
|
||||
n: Name selection (upper 4k word address).
|
||||
b: Base selection (8k word segment address).
|
||||
|
||||
*** The sizes are defined as follows:
|
||||
000: 8x8 or 16x16
|
||||
001: 8x8 or 32x32
|
||||
|
||||
*** I've never used this register, nor sprites.
|
||||
Check Section 6 for information
|
||||
which was not done by me: If you understand
|
||||
it better than I do, good deal.
|
||||
-----------
|
||||
W |$2102: Address of OAM (Sprites).
|
||||
???????? | ????????
|
||||
|
||||
*** This register i've never used. All I know is
|
||||
that it's a -WORD- in length, not a byte.
|
||||
-----------
|
||||
W |$2104: Data for OAM (Sprites).
|
||||
????????
|
||||
|
||||
*** I've never used this register. It's like $210D:
|
||||
You have to store a value in it twice.
|
||||
-----------
|
||||
W |$2105: Screen mode.
|
||||
abcdfeee
|
||||
a: Plane 3 tile size.
|
||||
b: Plane 2 tile size.
|
||||
c: Plane 1 tile size.
|
||||
d: Plane 0 tile size.
|
||||
0 = 8x8 tiles.
|
||||
1 = 16x16 tiles.
|
||||
e: MODE definition.
|
||||
f: Make Plane 2 take highest priority.
|
||||
-----------
|
||||
W |$2106: Screen pixelation (aka. MOSAIC) register.
|
||||
xxxxabcd
|
||||
x: 0-$F = Pixel size.
|
||||
a: Affect plane 3.
|
||||
b: Affect plane 2.
|
||||
c: Affect plane 1.
|
||||
d: Affect plane 0.
|
||||
|
||||
*** Just like $2100, this only works during VBlank.
|
||||
I recommend you setup what planes you want to
|
||||
affect at the start of the program, then to
|
||||
make them change, do the following:
|
||||
LDA #$03 ; Affect planes 0 and 1.
|
||||
STA TempReg1
|
||||
STA $2106
|
||||
JSR WaitVBlank
|
||||
LDA TempReg1
|
||||
Loop STA $2106
|
||||
CLC
|
||||
ADC #$10
|
||||
CMP #$F3
|
||||
BNE Loop
|
||||
-----------
|
||||
W |$2107: Plane 0 VRAM location register.
|
||||
xxxxxxab
|
||||
x: Address of VRAM location.
|
||||
ab: Virtual screen size selection.
|
||||
|
||||
*** The virtual screen size dealy goes like this:
|
||||
32x32 to 32x64 to 64x32 to 64x64. Visually,
|
||||
you only see 32x32(x25) at once unless you
|
||||
change the ACTUAL screen size.
|
||||
|
||||
*** The way I use this register is pretty simple.
|
||||
Lets say the VRAM is in $2000... Therefore,
|
||||
we'd go like this:
|
||||
LDA #$20
|
||||
STA $2107
|
||||
-----------
|
||||
W |$2108: Plane 1 VRAM location register.
|
||||
W |$2109: Plane 2 VRAM location register.
|
||||
W |$210A: Plane 3 VRAM location register.
|
||||
*** All of these follow the same definition as $2107.
|
||||
-----------
|
||||
W |$210B: Tile VRAM location register.
|
||||
aaaabbbb
|
||||
a: Location of tiles for Plane 1.
|
||||
b: Location of tiles for Plane 0.
|
||||
|
||||
*** The way you use this register is fairly neat.
|
||||
Since you only have a nybble to work with (which
|
||||
ranges from $0-F only) your Tile location can
|
||||
only be $0000 to $F000. You can't have an address
|
||||
such as $5F91 or $1C4A which holds your tile
|
||||
data. You just can't have it. :-)
|
||||
|
||||
-----------
|
||||
W |$210C: Tile VRAM location register.
|
||||
ccccdddd
|
||||
c: Location of tiles for Plane 3.
|
||||
d: Location of tiles for Plane 2.
|
||||
|
||||
*** Same stats for $210B go for this one; 'cept the
|
||||
plane registers are different.
|
||||
-----------
|
||||
W |$210D: Plane 0 X-scroll register.
|
||||
*** This register is really funky. You have to write
|
||||
to it twice in a row (each piece of data being
|
||||
1 byte). The register is setup as the following:
|
||||
- You store the first 8 bits (the first byte) which
|
||||
ranges from $00 to $FF. After you store this
|
||||
value, you have to store the next 3 bits in the
|
||||
same register.
|
||||
*** The following code demonstrates how to move plane 0
|
||||
left:
|
||||
LDA Plane0X
|
||||
DEC
|
||||
STA Plane0X
|
||||
STA $210D
|
||||
STZ $210D
|
||||
If you make that into a loop by itself, the result
|
||||
is the plane keeps scrolling left forever; it even
|
||||
wraps around back to the start.
|
||||
|
||||
*** Note: I've been told this is a nasty way to do it
|
||||
because MODE 7 uses 13 bits of the above,
|
||||
while the rest use 10. I'm not taking care of
|
||||
the MSB. :-(
|
||||
|
||||
-----------
|
||||
W |$210E: Plane 0 Y-Scroll register.
|
||||
W |$210F: Plane 1 X-Scroll register.
|
||||
W |$2110: Plane 1 Y-Scroll register.
|
||||
W |$2111: Plane 2 X-Scroll register.
|
||||
W |$2112: Plane 2 Y-Scroll register.
|
||||
W |$2113: Plane 3 X-Scroll register.
|
||||
W |$2114: Plane 3 Y-Scroll register.
|
||||
*** All of these follow the same definition as $210D.
|
||||
-----------
|
||||
W |$2115: Video port control.
|
||||
*** If you store the following listed values in this register,
|
||||
the following happens:
|
||||
|
||||
$80: H/L increment which determines if the address will be
|
||||
incremented after it reads/writes to/from $2118 and
|
||||
$2139, or $2119 and $213A.
|
||||
|
||||
W |$2116: Video port address.
|
||||
*** 16 bit VRAM address.
|
||||
$2117: Video port address (continued, due to 16 bits).
|
||||
W |$2118: Video port data.
|
||||
*** Data register for writing VRAM data.
|
||||
$2119: Video port data.
|
||||
*** Same as above.
|
||||
-----------
|
||||
W |$211A: MODE 7 Information register.
|
||||
xy????ab
|
||||
a: Horizontal or Vertical flip.
|
||||
b: Horizontal or Vertical flip.
|
||||
x: Landscape repeat type.
|
||||
y: Landscape repeat type.
|
||||
|
||||
*** I have not the SLIGHTEST idea what the hell
|
||||
the original author means by this. If someone
|
||||
can explain it, tell me.
|
||||
-----------
|
||||
W |$211B: COS (COSIN) rotate angle / X Expansion.
|
||||
W |$211C: SIN (SIN) rotate angle / X Expansion.
|
||||
W |$211D: SIN (SIN) rotate angle / Y Expansion.
|
||||
W |$211E: COS (COSIN) rotate angle / Y Expansion.
|
||||
W |$211F: 13 bit address for the center of Rotate X.
|
||||
W |$2120: 13 bit address for the center of Rotate Y.
|
||||
|
||||
*** All above things i've never used, nor do I
|
||||
have any explainations on them. Use them at
|
||||
your own risk, or until I get info on 'em.
|
||||
|
||||
*** $211F and $2120 are like $210D: You have to
|
||||
write a byte to them twice.
|
||||
-----------
|
||||
W |$2121: Color # (or pallete) selection register.
|
||||
xxxxxxxx
|
||||
x: Color # ($00-$FF).
|
||||
|
||||
*** This register is probably one of the most simple
|
||||
registers I know of to use. You simply store the
|
||||
# of the color you want to modify before writing
|
||||
to $2122. This register is autoincrementing, so
|
||||
you don't have to "LDA #$01, STA $2121, LDA #$02,
|
||||
STA $2121, LDA #$03..." and so on...
|
||||
Code is as follows:
|
||||
STZ $2121 ; Start at color 0.
|
||||
STZ $2122 ; Color #0 = 00 00
|
||||
STZ $2122
|
||||
LDA #$FF ; Color #1 = 7F FF (white).
|
||||
STA $2122
|
||||
LDA #$7F
|
||||
STA $2122
|
||||
LDA #$1F ; Color #2 = 00 1F (red).
|
||||
STA $2122
|
||||
STZ $2122
|
||||
-----------
|
||||
W |$2122: Color data register.
|
||||
xxxxxxxx
|
||||
x: Value of color.
|
||||
|
||||
*** Color on the SNES is trippy; it's 15 bit. Check
|
||||
Section 2 on how the SNES colors are setup. Some
|
||||
example code I listed for $2121... Anyways, this
|
||||
register is like $210D (plane X-scroll) and those
|
||||
types: You have to store the value in it twice.
|
||||
For instance: If you wanted the color white (which
|
||||
is $7FFF in SNES-color), you would have to do the
|
||||
following:
|
||||
LDA [whatever color #]
|
||||
STA $2121
|
||||
LDA #$FF ; We first store the "lower half"
|
||||
STA $2122
|
||||
LDA #$7F ; Then the upper...
|
||||
STA $2122
|
||||
It's really not that hard, but it'll take some
|
||||
getting used to :-) Remember, check Section 2 on
|
||||
how the SNES does it's color, and for tile-setup,
|
||||
check Section 4.
|
||||
-----------
|
||||
W |$212C: Playfield/Sprite-enable register.
|
||||
abcdefgh
|
||||
a: Plane 3 enable (for Sprites).
|
||||
b: Plane 2 enable (for Sprites).
|
||||
c: Plane 1 enable (for Sprites).
|
||||
d: Plane 0 enable (for Sprites).
|
||||
e: Enable plane 3.
|
||||
f: Enable plane 2.
|
||||
g: Enable plane 1.
|
||||
h: Enable plane 0.
|
||||
*** This register allows you to enable which planes
|
||||
you want to put sprites on (to move or etc.) and
|
||||
to scroll, or other neato things. If you wanna
|
||||
use all 4 planes, but no sprites, shove $0F into
|
||||
this register. If you want to use all the planes,
|
||||
but want sprites on planes 1 and 3, you would shove
|
||||
$AF into this register. It's very easy to do.
|
||||
-----------
|
||||
W |$2133: Screen mode register.
|
||||
????ab?c
|
||||
a: Interlace Y.
|
||||
b: Overscan.
|
||||
c: Interlace X.
|
||||
|
||||
*** To be blatently honest, I have -NO IDEA- what
|
||||
this register does; I don't understand what
|
||||
Corsair & Dax meant by Interlace and Overscan.
|
||||
If someone can explain this register to me, i'd
|
||||
be very grateful :-).
|
||||
-----------
|
||||
R |$2139: VRAM port data (reading).
|
||||
$213A: " "
|
||||
-----------
|
||||
?? |$2140 *** These are the audio registers. 'never used 'em.
|
||||
?? |$2141 Try shoving data into them; who knows, if you get
|
||||
?? |$2142 music sometime, then you know you're on the right
|
||||
?? |$2143 track. :-)
|
||||
-----------
|
||||
?? |$4200: Counter Enable.
|
||||
??yx???a
|
||||
a: Joypad-read Enable (1 = Readable).
|
||||
x: Horizontal Counter Enable.
|
||||
y: Vertical Counter Enable.
|
||||
-----------
|
||||
?? |$4201: 8 bit parallel data.
|
||||
|
||||
*** This is the expansion bus for the Famicom.
|
||||
-----------
|
||||
RW |$420B: DMA enable register.
|
||||
abcdefgh
|
||||
a: DMA #7.
|
||||
b: DMA #6.
|
||||
c: DMA #5.
|
||||
d: DMA #4.
|
||||
e: DMA #3.
|
||||
f: DMA #2.
|
||||
g: DMA #1.
|
||||
h: DMA #0.
|
||||
|
||||
*** I've personally never used DMA for anything. I hope
|
||||
someone out there has, and can tell me how to use
|
||||
it. :-)
|
||||
-----------
|
||||
?? |$420D: Memory select.
|
||||
???????x
|
||||
x: Fast/Normal ROM flip.
|
||||
0 = Normal.
|
||||
1 = Fast.
|
||||
-----------
|
||||
R |$4210: VBL register.
|
||||
x???????
|
||||
x: VBlank period
|
||||
1 = On.
|
||||
0 = Off.
|
||||
|
||||
*** This is probably the most important register
|
||||
you should work with. Without it, you die,
|
||||
and other things happen. :-) The following
|
||||
routine allows you to sync to the VBL/wait
|
||||
for the VBL to pass by so you can do your work:
|
||||
- LDA $4210
|
||||
AND #$80
|
||||
BEQ -
|
||||
LDA $4210
|
||||
|
||||
From a programmers' standpoint, the following
|
||||
code should do the EXACT SAME as the above,
|
||||
but faster. NOTE thou, that it doesn't. I
|
||||
think the timing is off, that's why it doesn't
|
||||
work right. But, here-goes:
|
||||
|
||||
- LDA $4210
|
||||
BPL -
|
||||
LDA $4210
|
||||
-----------
|
||||
?? |$4211: ?????.
|
||||
x???????
|
||||
x: IRQ Enable flag (1: Enabled).
|
||||
|
||||
*** I don't even know the DESCRIPTION of the reg-
|
||||
ister! :-)
|
||||
-----------
|
||||
RW |$4212: Joypad-ready register.
|
||||
???????x
|
||||
x: Ready-state bit (1: Ready).
|
||||
|
||||
*** I'm not sure how this register is setup; all I know
|
||||
is how to use it. Code is as follows:
|
||||
PadLoop LDA $4212
|
||||
AND #$01
|
||||
BNE PadLoop
|
||||
This waits for the joypad to become ready to read.
|
||||
-----------
|
||||
RW |$4218: Joypad #0 register (1 out of 2).
|
||||
abcd0000
|
||||
a: 0 = A button not pressed.
|
||||
1 = A button pressed.
|
||||
b: 0 = X button not pressed.
|
||||
1 = X button pressed.
|
||||
c: 0 = Top-left button not pressed.
|
||||
1 = Top-left button pressed.
|
||||
d: 0 = Top-right button not pressed.
|
||||
1 = Top-right button pressed.
|
||||
*** These are self-explainitory. To find out the
|
||||
status of each bit, just AND #$ for that bit...
|
||||
The code for checking is the following:
|
||||
LDA $4218
|
||||
AND #$80 ; Is the A button pressed?
|
||||
BNE YesA ; Button pressed (bit is 1).
|
||||
LDA $4218
|
||||
AND #$40 ; Is button X pressed?
|
||||
BNE YesX ; Button pressed (bit is 1).
|
||||
LDA $4218
|
||||
AND #$10 ; Is the top-right button pressed?
|
||||
BNE YesTopR ; Button pressed (bit is 1).
|
||||
...and so on. It's very simple.
|
||||
*** Note: The Corsair & Dax document was -WRONG-.
|
||||
It took me a good hour or two to find this
|
||||
out, so I decided i'd better write down the
|
||||
CORRECT way to do things).
|
||||
-----------
|
||||
RW |$4219: Joypad #0 register (2 out of 2).
|
||||
abcdefgh
|
||||
a: 0 = B button not pressed.
|
||||
1 = B button pressed.
|
||||
b: 0 = Y button not pressed.
|
||||
1 = Y button pressed.
|
||||
c: 0 = Select button not pressed.
|
||||
1 = Select button pressed.
|
||||
d: 0 = Start button not pressed.
|
||||
1 = Start button pressed.
|
||||
e: 0 = Up not pressed.
|
||||
1 = Up pressed.
|
||||
f: 0 = Down not pressed.
|
||||
1 = Down pressed.
|
||||
g: 0 = Left not pressed.
|
||||
1 = Left pressed.
|
||||
h: 0 = Right not pressed.
|
||||
1 = Right pressed.
|
||||
*** Same as $4218... Some demo code follows:
|
||||
LDA $4219
|
||||
AND #$80 ; Is the B button pressed?
|
||||
BNE YesB ; Button pressed (bit is 1).
|
||||
LDA $4219
|
||||
AND #$04 ; Is Down pressed?
|
||||
BNE YesDown ; Button pressed (bit is 1).
|
||||
LDA $4219
|
||||
AND #$02 ; Is Left pressed?
|
||||
BNE YesLeft ; Button pressed (bit is 1).
|
||||
-----------
|
||||
RW |$421A: Joypad #1 register (1 out of 2).
|
||||
RW |$421B: Joypad #1 register (2 out of 2).
|
||||
RW |$421C: Joypad #2 register (1 out of 2).
|
||||
RW |$421D: Joypad #2 register (2 out of 2).
|
||||
RW |$421E: Joypad #3 register (2 out of 2).
|
||||
RW |$421F: Joypad #3 register (2 out of 2).
|
||||
*** Setup is the same as $4218 and $4219.
|
||||
=-=-=
|
||||
1) Memory Map
|
||||
ii) Additional info.
|
||||
-----------
|
||||
RW |$FFC0: Cartridge title.
|
||||
RW |$FFD6: ROM/RAM Info on cart..
|
||||
RW |$FFD7: ROM Size.
|
||||
RW |$FFD8: RAM Size.
|
||||
RW |$FFD9: Maker ID Code.
|
||||
RW |$FFDB: Version #.
|
||||
RW |$FFDC: Checksum complement.
|
||||
RW |$FFDE: Checksum.
|
||||
RW |$FFEA: NMI vector/VBL Interrupt.
|
||||
RW |$FFEC: Reset vector.
|
||||
|
||||
*** With SMC (Magicom) files the offset is $7e00 less
|
||||
than above.
|
||||
*** I've never actually used this information before:
|
||||
This could be SMC header only; but then why would
|
||||
there be memory locations for such? Strange. I'll
|
||||
leave the information I put in up to SNESASM v1.05.
|
||||
I use the psuedo-ops NAM, VER, and other things.
|
||||
|
||||
=-=-=
|
||||
2) SNES Color explaination.
|
||||
-----------
|
||||
Oh BOY! So you're interested in finding out how the SNES does
|
||||
it's color (via $2122), right? Well here ya go...
|
||||
|
||||
The SNES has a strange way of doing color (atleast that i've
|
||||
seen in my lifetime). Color is 15 bit; each "RGB" value (red,
|
||||
green, and blue) has 5 bits a piece.
|
||||
|
||||
When it comes to putting data into $2122, the format (in binary)
|
||||
is the following (I put them into each byte):
|
||||
0bbbbbgg gggrrrrr
|
||||
|
|
||||
|_ Someone needs to tell me what this bit
|
||||
-REALLY- is. I've just been told to set
|
||||
it to 0...
|
||||
We guess that the Japanese didn't like the idea of putting them
|
||||
in the "standard" order of R, G, then B: but instead wanted them
|
||||
in alphabetical order. Silly! :-).
|
||||
|
||||
The way -I- do my color conversions is on a calculator... Just
|
||||
plug in the bits you want to set in binary, then let the calc.
|
||||
convert it into hexadecimal. It's pretty easy; or you can be
|
||||
a Studly Programmer (hehehe) and do it in your head.
|
||||
|
||||
A quick color chart: $7FFF: White (0111 1111 1111 1111)
|
||||
$001F: Red (0000 0000 0001 1111)
|
||||
$03E0: Green (0000 0011 1110 0000)
|
||||
$7C00: Blue (0111 1100 0000 0000)
|
||||
$7C1F: Purple (0111 1100 0001 1111)
|
||||
$7FE0: Aqua (0111 1111 1110 0000)
|
||||
$03FF: Yellow (0000 0011 1111 1111);
|
||||
Well there you have it. It's pretty simple after you get the hang
|
||||
of it; when using the SNES, you get REALLY good with binary math:
|
||||
You'll find this out after working with the machine for awhile.
|
||||
|
||||
=-=-=
|
||||
3) DMA Memory Map and explaination.
|
||||
-----------
|
||||
?? |$43x0: DMA Control register (??? Not sure ???).
|
||||
W |$43x1: DMA Destination register.
|
||||
$18 = Video Port access.
|
||||
$22 = Color pallete access.
|
||||
|
||||
*** This gives access to only some of the video chip.
|
||||
registers. Hell if I know which ones.
|
||||
-----------
|
||||
W |$43x2: Source address.
|
||||
*** THIS REGISTER IS A WORD IN LENGTH ***
|
||||
*** The document I have says:
|
||||
"lo-hi 16 lowest bits". Who knows...
|
||||
-----------
|
||||
W |$43x4: Source bank address.
|
||||
*** The document I have says:
|
||||
"8 highest bits".
|
||||
-----------
|
||||
W |$43x5: Transfer size register.
|
||||
*** Same as above:
|
||||
"lo-hi".
|
||||
-----------
|
||||
All the "x"s represent the DMA # (ranging from 0 to 7).
|
||||
DMA #0: $4300-$4305.
|
||||
DMA #1: $4310-$4315.
|
||||
......
|
||||
DMA #7: $4370-$4375.
|
||||
=-=-=
|
||||
4) SNES Graphics (tiles) explaination.
|
||||
-----------
|
||||
This is probably the most requested section of the document for
|
||||
people whom are starting out on the SNES and want to learn just
|
||||
how in the hell the SNES -DOES- do it's graphics.
|
||||
|
||||
There's so much to explain!!!
|
||||
|
||||
The SNES does it's graphics in tiles (surprise surprise!).
|
||||
|
||||
There are different MODEs on the SNES; the most famous being
|
||||
is MODE 7. Alas: Most people think using $2106 is MODE 7 ($2106
|
||||
is for screen pixelation: Where the pixels get "larger". Look
|
||||
in Section 1 for an explaination of this register).
|
||||
*** THIS IS NOT MODE 7!!! ***.
|
||||
So the next time the pixels get really "big" (almost making them
|
||||
look like IBM PC 320x200x256 mode :-)), and your friend says "WOW!
|
||||
MODE 7 is COOL," punch 'em in the nose for me. Just kidding.
|
||||
|
||||
Also, another thing I should mention: Bitplanes are NOT THE SAME
|
||||
AS PLANES. Planes are like "screens." You can scroll a plane, but
|
||||
not a bitplane. Bitplanes are put ONTO a plane, which can be
|
||||
scrolled any direction.
|
||||
|
||||
I'll be explaining MODE 1. MODE 7 is too tough for me to
|
||||
explain, since you end up losing colors and other screwy things...
|
||||
Check Section-5 for a mode-# list.
|
||||
|
||||
MODE #/Playfields MaxColor/Tile Palettes Colors
|
||||
---------------------------------------------------------------------------
|
||||
0 4 4 8 16
|
||||
1 3 16/16/4 (HUH?) 8 128
|
||||
|
||||
MODE 0 is good for geometric shapes (if you were going to rotate
|
||||
a wireframe cube), basic star scrolls, or a very "bland" text
|
||||
scroller.
|
||||
|
||||
Let's start with MODE 1.
|
||||
|
||||
MODE 1 is best for really basic things: Star scrollers, text
|
||||
scrolls, geometric (non detailed) art, or line drawings; it's
|
||||
only 16 colors/bitplane, and there's only 4 bitplanes to play
|
||||
with.
|
||||
|
||||
What you need is 4 bitplanes of data. You don't -HAVE- to
|
||||
use 4 bitplanes... You can use 1 bitplane if you want, but
|
||||
you only get 16 colors (NO!!! :-)).
|
||||
|
||||
You also need a plane map: You can't just have the predefined
|
||||
graphics data and thats it: You have to "setup the plane" to
|
||||
tell it what tile goes where.
|
||||
|
||||
For demonstration purposes, i'll use code to explain it.
|
||||
|
||||
-----------
|
||||
The "lda #$0000" "tcd" transfers the DP location pointer to
|
||||
where the scratchpad RAM is. This makes things go much faster,
|
||||
because DP is always faster than normal RAM (yay for DP!!!)
|
||||
|
||||
The other part puts where the location of the data in the
|
||||
binary/image is into two DP locations: font and font2.
|
||||
|
||||
font equ $00 ; Direct page equates.
|
||||
font2 equ font+1
|
||||
|
||||
sei
|
||||
phk
|
||||
plb
|
||||
clc
|
||||
xce
|
||||
rep #$30
|
||||
lda #$0000
|
||||
tcd
|
||||
lda #charset
|
||||
sta font
|
||||
lda #charset2
|
||||
sta font2
|
||||
-----------
|
||||
The following code tells the SNES where the actual data
|
||||
is in VRAM memory.
|
||||
|
||||
lda #$10 ; Plane 0 text @ VRAM $1000.
|
||||
sta $2107
|
||||
|
||||
lda #$02 ; Tiles for Plane 0 @ VRAM $2000.
|
||||
sta $210b
|
||||
-----------
|
||||
The following code actually MOVES the data in the binary/image
|
||||
into the SNES's VRAM.
|
||||
|
||||
sep #$20
|
||||
ldx #$2000 ; This puts the data sent thru $2118 and
|
||||
; $2119 into VRAM $2000.
|
||||
stx $2116
|
||||
ldy #$0000
|
||||
- lda (font),y ; Get bitplane 0 data (font)
|
||||
sta $2118 ; ... and store it in bitplane 0.
|
||||
lda (font2),y ; Get bitplane 1 data (font2)
|
||||
sta $2119 ; ... and store it in bitplane 1...
|
||||
stz $2118 ; I don't want to use bitplane 2 and 3,
|
||||
stz $2119 ; so I store zeros here. You could put
|
||||
; more font data in there if you wanted.
|
||||
iny
|
||||
cpy #$0200
|
||||
bne -
|
||||
|
||||
ldx #$1000 ; This puts the data sent thru $2118 and
|
||||
stx $2116 ; $2119 into VRAM $1000.
|
||||
ldx #$0000
|
||||
- lda TEXT,x ; Get the character from TEXT...
|
||||
and #$3f ; AND #$3F because we only want the first
|
||||
; 64 characters in the font.
|
||||
sta $2118 ;
|
||||
stz $2119 ; Check near the end of this Section for
|
||||
; an explaination on what the actual bits
|
||||
; do instead of just storing 0 there all
|
||||
; the time.
|
||||
inx
|
||||
cpx #$0400
|
||||
bne -
|
||||
-----------
|
||||
Here's the actual data names (charset, charset2, and TEXT).
|
||||
My new source has them in dcb % statements to make the font
|
||||
more readable: The first time I did this, I had to convert
|
||||
the binary stuff I wrote on paper into hex, then put them
|
||||
into decent hex statements in an orderly fashion.
|
||||
|
||||
charset
|
||||
dcb $00,$00,$00,$00,$00,$00,$00,$00 ;'@'
|
||||
dcb $00,$3c,$66,$7e,$66,$66,$66,$00 ;'A'
|
||||
dcb $00,$7c,$66,$7c,$66,$66,$7c,$00 ;'B'
|
||||
dcb $00,$3c,$66,$60,$60,$66,$3c,$00 ;'C'
|
||||
dcb $00,$78,$6c,$66,$66,$6c,$78,$00 ;'D'
|
||||
dcb $00,$7e,$60,$78,$60,$60,$7e,$00 ;'E'
|
||||
dcb $00,$7e,$60,$78,$60,$60,$60,$00 ;'F'
|
||||
dcb $00,$3c,$66,$60,$6e,$66,$3c,$00 ;'G'
|
||||
dcb $00,$66,$66,$7e,$66,$66,$66,$00 ;'H'
|
||||
dcb $00,$3c,$18,$18,$18,$18,$3c,$00 ;'I'
|
||||
dcb $00,$1e,$0c,$0c,$0c,$6c,$38,$00 ;'J'
|
||||
dcb $00,$6c,$78,$70,$78,$6c,$66,$00 ;'K'
|
||||
dcb $00,$60,$60,$60,$60,$60,$7e,$00 ;'L'
|
||||
dcb $00,$63,$77,$7f,$6b,$63,$63,$00 ;'M'
|
||||
dcb $00,$66,$76,$7e,$7e,$6e,$66,$00 ;'N'
|
||||
dcb $00,$3c,$66,$66,$66,$66,$3c,$00 ;'O'
|
||||
dcb $00,$7c,$66,$66,$7c,$60,$60,$00 ;'P'
|
||||
dcb $00,$3c,$66,$66,$66,$3c,$0e,$00 ;'Q'
|
||||
dcb $00,$7c,$66,$66,$7c,$6c,$66,$00 ;'R'
|
||||
dcb $00,$3e,$60,$3c,$06,$66,$3c,$00 ;'S'
|
||||
dcb $00,$7e,$18,$18,$18,$18,$18,$00 ;'T'
|
||||
dcb $00,$66,$66,$66,$66,$66,$3c,$00 ;'U'
|
||||
dcb $00,$66,$66,$66,$66,$3c,$18,$00 ;'V'
|
||||
dcb $00,$63,$63,$6b,$7f,$77,$63,$00 ;'W'
|
||||
dcb $00,$66,$3c,$18,$3c,$66,$66,$00 ;'X'
|
||||
dcb $00,$66,$66,$3c,$18,$18,$18,$00 ;'Y'
|
||||
dcb $00,$7e,$0c,$18,$30,$60,$7e,$00 ;'Z'
|
||||
dcb $08,$00,$00,$00,$00,$00,$00,$00 ;'['
|
||||
dcb $00,$00,$00,$00,$00,$00,$00,$00 ;'\'
|
||||
dcb $00,$00,$00,$00,$00,$00,$00,$00 ;']'
|
||||
dcb $00,$00,$00,$00,$00,$00,$00,$00 ;'^'
|
||||
dcb $00,$08,$00,$00,$00,$00,$00,$00 ;'_'
|
||||
dcb $00,$00,$00,$00,$00,$00,$00,$00 ;' '
|
||||
dcb $00,$7E,$7E,$3C,$18,$00,$18,$00 ;'!'
|
||||
dcb $00,$00,$00,$00,$00,$00,$00,$00 ;'"'
|
||||
dcb $80,$80,$80,$80,$80,$80,$80,$80 ;'#'
|
||||
dcb $FC,$FE,$FF,$F7,$F7,$FF,$FE,$FC ;'$'
|
||||
dcb $3E,$42,$4E,$5C,$5C,$4E,$42,$3E ;'%'
|
||||
dcb $00,$00,$00,$00,$00,$00,$00,$01 ;'&'
|
||||
dcb $00,$00,$00,$07,$00,$00,$00,$00 ;'''
|
||||
dcb $00,$04,$08,$08,$08,$08,$04,$00 ;'('
|
||||
dcb $00,$20,$10,$10,$10,$10,$20,$00 ;')'
|
||||
dcb $08,$08,$08,$F8,$08,$08,$08,$08 ;'*'
|
||||
dcb $10,$10,$10,$1F,$10,$10,$10,$10 ;'+'
|
||||
dcb $10,$10,$20,$C0,$00,$00,$00,$00 ;','
|
||||
dcb $00,$00,$00,$FF,$00,$00,$00,$00 ;'-'
|
||||
dcb $00,$00,$00,$00,$00,$18,$18,$00 ;'.'
|
||||
dcb $00,$00,$00,$FF,$80,$80,$80,$80 ;'/'
|
||||
dcb $00,$3c,$66,$6e,$76,$66,$3c,$00 ;'0'
|
||||
dcb $00,$18,$38,$18,$18,$18,$7e,$00 ;'1'
|
||||
dcb $00,$7c,$06,$0c,$30,$60,$7e,$00 ;'2'
|
||||
dcb $00,$7e,$06,$1c,$06,$66,$3c,$00 ;'3'
|
||||
dcb $00,$0e,$1e,$36,$7f,$06,$06,$00 ;'4'
|
||||
dcb $00,$7e,$60,$7c,$06,$66,$3c,$00 ;'5'
|
||||
dcb $00,$3e,$60,$7c,$66,$66,$3c,$00 ;'6'
|
||||
dcb $00,$7e,$06,$0c,$0c,$0c,$0c,$00 ;'7'
|
||||
dcb $00,$3c,$66,$3c,$66,$66,$3c,$00 ;'8'
|
||||
dcb $00,$3c,$66,$3e,$06,$66,$3c,$00 ;'9'
|
||||
dcb $00,$00,$00,$03,$04,$08,$08,$08 ;':'
|
||||
dcb $00,$80,$80,$F0,$80,$80,$00,$00 ;';'
|
||||
dcb $80,$80,$80,$FF,$00,$00,$00,$00 ;'<'
|
||||
dcb $00,$00,$00,$C0,$20,$10,$10,$10 ;'='
|
||||
dcb $08,$08,$04,$03,$00,$00,$00,$00 ;'>'
|
||||
dcb $00,$00,$00,$00,$00,$00,$00,$00 ;'?'
|
||||
|
||||
charset2
|
||||
dcb $00,$3C,$4E,$5E,$5E,$40,$3C,$00 ;'@'
|
||||
dcb $00,$3c,$66,$7e,$66,$66,$66,$00 ;'A'
|
||||
dcb $00,$7c,$66,$7c,$66,$66,$7c,$00 ;'B'
|
||||
dcb $00,$3c,$66,$60,$60,$66,$3c,$00 ;'C'
|
||||
dcb $00,$78,$6c,$66,$66,$6c,$78,$00 ;'D'
|
||||
dcb $00,$7e,$60,$78,$60,$60,$7e,$00 ;'E'
|
||||
dcb $00,$7e,$60,$78,$60,$60,$60,$00 ;'F'
|
||||
dcb $00,$3c,$66,$60,$6e,$66,$3c,$00 ;'G'
|
||||
dcb $00,$66,$66,$7e,$66,$66,$66,$00 ;'H'
|
||||
dcb $00,$3c,$18,$18,$18,$18,$3c,$00 ;'I'
|
||||
dcb $00,$1e,$0c,$0c,$0c,$6c,$38,$00 ;'J'
|
||||
dcb $00,$6c,$78,$70,$78,$6c,$66,$00 ;'K'
|
||||
dcb $00,$60,$60,$60,$60,$60,$7e,$00 ;'L'
|
||||
dcb $00,$63,$77,$7f,$6b,$63,$63,$00 ;'M'
|
||||
dcb $00,$66,$76,$7e,$7e,$6e,$66,$00 ;'N'
|
||||
dcb $00,$3c,$66,$66,$66,$66,$3c,$00 ;'O'
|
||||
dcb $00,$7c,$66,$66,$7c,$60,$60,$00 ;'P'
|
||||
dcb $00,$3c,$66,$66,$66,$3c,$0e,$00 ;'Q'
|
||||
dcb $00,$7c,$66,$66,$7c,$6c,$66,$00 ;'R'
|
||||
dcb $00,$3e,$60,$3c,$06,$66,$3c,$00 ;'S'
|
||||
dcb $00,$7e,$18,$18,$18,$18,$18,$00 ;'T'
|
||||
dcb $00,$66,$66,$66,$66,$66,$3c,$00 ;'U'
|
||||
dcb $00,$66,$66,$66,$66,$3c,$18,$00 ;'V'
|
||||
dcb $00,$63,$63,$6b,$7f,$77,$63,$00 ;'W'
|
||||
dcb $00,$66,$3c,$18,$3c,$66,$66,$00 ;'X'
|
||||
dcb $00,$66,$66,$3c,$18,$18,$18,$00 ;'Y'
|
||||
dcb $00,$7e,$0c,$18,$30,$60,$7e,$00 ;'Z'
|
||||
dcb $00,$00,$00,$00,$00,$00,$00,$00 ;'['
|
||||
dcb $09,$09,$00,$00,$00,$00,$00,$00 ;'\'
|
||||
dcb $00,$00,$00,$00,$00,$00,$00,$00 ;']'
|
||||
dcb $00,$00,$00,$00,$00,$00,$00,$00 ;'^'
|
||||
dcb $00,$08,$00,$00,$00,$00,$00,$00 ;'_'
|
||||
dcb $00,$00,$00,$00,$00,$00,$00,$00 ;' '
|
||||
dcb $00,$7E,$7E,$3C,$18,$00,$18,$00 ;'!'
|
||||
dcb $00,$00,$00,$00,$00,$00,$00,$00 ;'"'
|
||||
dcb $80,$80,$80,$80,$80,$80,$80,$80 ;'#'
|
||||
dcb $FC,$FE,$FF,$F7,$F7,$FF,$FE,$FC ;'$'
|
||||
dcb $3E,$42,$4E,$5C,$5C,$4E,$42,$3E ;'%'
|
||||
dcb $00,$00,$00,$00,$00,$00,$00,$01 ;'&'
|
||||
dcb $00,$00,$00,$07,$00,$00,$00,$00 ;'''
|
||||
dcb $00,$04,$08,$08,$08,$08,$04,$00 ;'('
|
||||
dcb $00,$20,$10,$10,$10,$10,$20,$00 ;')'
|
||||
dcb $08,$08,$08,$F8,$08,$08,$08,$08 ;'*'
|
||||
dcb $10,$10,$10,$1F,$10,$10,$10,$10 ;'+'
|
||||
dcb $10,$10,$20,$C0,$00,$00,$00,$00 ;','
|
||||
dcb $00,$00,$00,$FF,$00,$00,$00,$00 ;'-'
|
||||
dcb $00,$00,$00,$00,$00,$18,$18,$00 ;'.'
|
||||
dcb $00,$00,$00,$FF,$80,$80,$80,$80 ;'/'
|
||||
dcb $00,$3c,$66,$6e,$76,$66,$3c,$00 ;'0'
|
||||
dcb $00,$18,$38,$18,$18,$18,$7e,$00 ;'1'
|
||||
dcb $00,$7c,$06,$0c,$30,$60,$7e,$00 ;'2'
|
||||
dcb $00,$7e,$06,$1c,$06,$66,$3c,$00 ;'3'
|
||||
dcb $00,$0e,$1e,$36,$7f,$06,$06,$00 ;'4'
|
||||
dcb $00,$7e,$60,$7c,$06,$66,$3c,$00 ;'5'
|
||||
dcb $00,$3e,$60,$7c,$66,$66,$3c,$00 ;'6'
|
||||
dcb $00,$7e,$06,$0c,$0c,$0c,$0c,$00 ;'7'
|
||||
dcb $00,$3c,$66,$3c,$66,$66,$3c,$00 ;'8'
|
||||
dcb $00,$3c,$66,$3e,$06,$66,$3c,$00 ;'9'
|
||||
dcb $00,$00,$00,$03,$04,$08,$08,$08 ;':'
|
||||
dcb $00,$80,$80,$F0,$80,$80,$00,$00 ;';'
|
||||
dcb $80,$80,$80,$FF,$00,$00,$00,$00 ;'<'
|
||||
dcb $00,$00,$00,$C0,$20,$10,$10,$10 ;'='
|
||||
dcb $08,$08,$04,$03,$00,$00,$00,$00 ;'>'
|
||||
dcb $00,$00,$00,$00,$00,$00,$00,$00 ;'?'
|
||||
|
||||
TEXT dcb " THIS IS YOUR ENTIRE SCREEN "
|
||||
dcb " HERE... IF YOU REMOVE ONE OF "
|
||||
dcb " THE LINES WHICH IS BLANK, THE "
|
||||
dcb " SCREEN ENDS UP BEING FUNKY "
|
||||
dcb " DOWN AT THE BOTTOM OF THE "
|
||||
dcb " SCREEN. "
|
||||
dcb " "
|
||||
dcb " SO MAKE SURE YOU ALWAYS LEAVE "
|
||||
dcb " ALL OF THIS TEXT THINGS IN! "
|
||||
dcb " "
|
||||
dcb " "
|
||||
dcb " "
|
||||
dcb " YOSHI THE DINO "
|
||||
dcb " "
|
||||
dcb " "
|
||||
dcb " "
|
||||
dcb " "
|
||||
dcb " "
|
||||
dcb " "
|
||||
dcb " "
|
||||
dcb " "
|
||||
dcb " "
|
||||
dcb " "
|
||||
dcb " "
|
||||
dcb " "
|
||||
dcb " "
|
||||
dcb " "
|
||||
dcb " "
|
||||
dcb " "
|
||||
dcb "********************************"
|
||||
dcb " "
|
||||
dcb " "
|
||||
-----------
|
||||
Well there's some code for those whom want to rip it :-).
|
||||
|
||||
I hope I haven't confused you yet: If I have, go back and re-read
|
||||
the code. I've been working with the SNES for awhile, so I under-
|
||||
stand a little more than a beginner.
|
||||
|
||||
You're probably wondering how the heck the following line ends
|
||||
up being an "@" on your TV, or whatever you have your SNES
|
||||
hooked up to.
|
||||
|
||||
Lets look at charset and charset2.
|
||||
|
||||
charset
|
||||
dcb $00,$00,$00,$00,$00,$00,$00,$00 ;'@'
|
||||
|
||||
charset2
|
||||
dcb $00,$3C,$4E,$5E,$5E,$40,$3C,$00 ;'@'
|
||||
|
||||
Convert charsets hex-statements into binary. Consider each
|
||||
new "$xx" statement a new pixel line. Tile size is 8x8.
|
||||
|
||||
00000000 = $00
|
||||
00000000 = $00
|
||||
00000000 = $00
|
||||
00000000 = $00
|
||||
00000000 = $00
|
||||
00000000 = $00
|
||||
00000000 = $00
|
||||
00000000 = $00
|
||||
|
||||
Convert charset2s hex-statements into binary.
|
||||
|
||||
00000000 = $00
|
||||
00111100 = $3C
|
||||
01001110 = $4E
|
||||
01011110 = $5E
|
||||
01011110 = $5E
|
||||
01000000 = $40
|
||||
00111100 = $3C
|
||||
00000000 = $00
|
||||
|
||||
*NOW* do you see the at-symbol? (and yes, I -DID- draw all
|
||||
of the font by hand. It took me HOURS, but I did it).
|
||||
|
||||
You're probably now asking: "Well, that tells me how to define
|
||||
where a pixel IS: but how do I define it's color?"
|
||||
|
||||
This is the fun part. It's sort-of hard to explain:
|
||||
If you have a 0 for bitplane 0, a 0 for bitplane 1, a 0 for
|
||||
bitplane 2, and a 0 for bitplane 3, you get the color 0.
|
||||
i.e.: 0000 = Color #0
|
||||
||||___________Bitplane 0
|
||||
|||__________Bitplane 1
|
||||
||_________Bitplane 2
|
||||
|________Bitplane 3
|
||||
|
||||
So, think about a 0 for bitplane 0, a 1 for bitplane 1 & 2
|
||||
and a 0 for bitplane 3.
|
||||
i.e.: 0110 = Color #6
|
||||
||||___________Bitplane 0
|
||||
|||__________Bitplane 1
|
||||
||_________Bitplane 2
|
||||
|________Bitplane 3
|
||||
|
||||
This is probably the best explaination i've ever seen done about
|
||||
SNES pixel-color definition, so don't plan on seeing one any
|
||||
better anytime soon :-).
|
||||
|
||||
Anyway, the result above gives you the color # per pixel; it's
|
||||
fairly interesting... it's like an "overlay" type of method.
|
||||
|
||||
I mentioned in the source above that you should check near the
|
||||
end of the Section for info on why I "stz $2119". Well, here's
|
||||
why: The bits in the tile-data are fairly "silly": The tile
|
||||
"character" itself is 10 bits, while the other 6 are "fun bits,"
|
||||
as I call them. Here's the explaination:
|
||||
yx?cccNN | NNNNNNNN
|
||||
y: Flip the tile vertically.
|
||||
x: Flip the tile horiztonally.
|
||||
?: Dunno! Set it to 1 and find out.
|
||||
c: Pallete # (0-7).
|
||||
N: Character itself.
|
||||
|
||||
So, I STZ there: Yes, I leave the top bits "unset," which means
|
||||
you could get messed up data, but as far as I have checked, the
|
||||
SNES has "clear memory" when you start it up: So the bits I don't
|
||||
zero-out should be zeros anyways! :-) If you want to set them,
|
||||
feel free to do so! The results of flipping Y and X are sortof
|
||||
fun to play with. "To read this scrolly, you must stand on your
|
||||
head" :-)
|
||||
=-=-=
|
||||
5) SNES Screen mode definitions.
|
||||
-----------
|
||||
MODE # of bitplanes Colors per plane Palletes Max. # of colors
|
||||
---------------------------------------------------------------------------
|
||||
0 2 4 8 32
|
||||
1 4 16 8 128
|
||||
2 ? ??? ? ???
|
||||
3 8 256 1 256
|
||||
4 ? ??? ? ???
|
||||
5 ? ??? ? ???
|
||||
6 ? 16 8 128 (Interlaced mode)
|
||||
7 ? 256 1 256 (Yes, MODE 7)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
The parms which have "?" or "???" mean I don't know what they REALLY
|
||||
are: I got a document which explained them, but it was bogus: It
|
||||
said a 16 color mode had -1- bitplane. Weird... I'm not even sure
|
||||
about MODE 6. But, we know what MODE 7 is, even if I'm not sure how
|
||||
many bitplanes it DOES use (the doc says 1, I say 8).
|
||||
|
||||
I've tested MODE 0 and 1 myself. MODE 3 I might test in the future,
|
||||
but i've never had the desire to draw up 8 bitplanes of data by
|
||||
hand ( I don't have a SNES-graphics-generator for the PC! :-( ).
|
||||
=-=-=
|
||||
6) SNES OAM/Sprite explaination.
|
||||
-----------
|
||||
The sprites use a lookup table that contains info on their X and
|
||||
Y position on the screen, their size, if they're flipped horizontally
|
||||
or vertically, their color, and the actual character.
|
||||
|
||||
The format you need to make the table in is as follows:
|
||||
|
||||
Size Address/Offset Explaination
|
||||
---------------------------------------------------------------------------
|
||||
*** SPRITE 0 ***
|
||||
BYTE 0
|
||||
xxxxxxxx
|
||||
x: X location.
|
||||
BYTE 1
|
||||
yyyyyyyy
|
||||
y: Y location.
|
||||
WORD 2+3
|
||||
abcdeeex | xxxxxxxx
|
||||
a: Vertical flip.
|
||||
b: Horizontal flip.
|
||||
c: Playfield priority.
|
||||
d: Playfield priority.
|
||||
e: Pallete #.
|
||||
x: Character #.
|
||||
*** SPRITE 0 ***
|
||||
BYTE 4
|
||||
xxxxxxxx
|
||||
x: X location.
|
||||
BYTE 5
|
||||
yyyyyyyy
|
||||
y: Y location.
|
||||
....... and so on .......
|
||||
---------------------------------------------------------------------------
|
||||
Continue this table all the way down to sprite #127 (the 128th
|
||||
sprite).
|
||||
|
||||
Don't think you're
|
||||
BIN
files/docs/snes/SNESKART.doc
Normal file
BIN
files/docs/snes/SNESKART.doc
Normal file
Binary file not shown.
BIN
files/docs/snes/SNESKart-TurtleGroupInc..pdf
Normal file
BIN
files/docs/snes/SNESKart-TurtleGroupInc..pdf
Normal file
Binary file not shown.
1379
files/docs/snes/SNESMAP2.TXT
Normal file
1379
files/docs/snes/SNESMAP2.TXT
Normal file
File diff suppressed because it is too large
Load Diff
92
files/docs/snes/SNESMNEM.TXT
Normal file
92
files/docs/snes/SNESMNEM.TXT
Normal file
@ -0,0 +1,92 @@
|
||||
add add adress for all instruction fetches
|
||||
adc add memory to accumulator with carry
|
||||
and 'and' memory with accumulator
|
||||
asl arithmic shift left 1 bit (memory or accumulator)
|
||||
bcc branch on carry clear C=0
|
||||
bcs branch on carry set C=1
|
||||
beq branch if equal Z=1
|
||||
bit bit test
|
||||
bmi branch if result is negative N=1
|
||||
bne branch if not equal Z=0
|
||||
bpl branch if result is plus N=0
|
||||
bra branch always
|
||||
brk force break
|
||||
brl branch always long
|
||||
bvc branch on overflow clear V=0
|
||||
bvs branch on overflow set V=1
|
||||
clc clear carry flag C=0
|
||||
cld clear decimal mode D=0
|
||||
cli clear interrupt disable bit I=0
|
||||
clv clear overflow flag V=0
|
||||
cmp compare memory and accumulator
|
||||
cop coprocessor
|
||||
cpx compare memory and index x
|
||||
cpy compare memory and index y
|
||||
dec decrement memory or accumulator by one
|
||||
dex decrement index x by one
|
||||
dey decrement index y by one
|
||||
eor exclusive 'or' memory with accumulator
|
||||
inc increment memory or accumulator by one
|
||||
inx increment index x by one
|
||||
iny increment index y by one
|
||||
jml jump long other banks possible
|
||||
jmp jump to location in same bank
|
||||
jsl jump to subroutine long
|
||||
jsr jump to subroutine in same bank
|
||||
lda load accumulator with memory
|
||||
ldx load index x with memory
|
||||
ldy load index y with memory
|
||||
lsr logical shift right by one bit (memory or accu)
|
||||
mvn move block negative (uses x,y,a)
|
||||
mvp move block positive (uses x,y,a)
|
||||
nop no operation
|
||||
ora 'or' memory with accumulator
|
||||
pea push effective adres (or data) on stack
|
||||
pei push effective indirect adres on stack
|
||||
per push effective program counter relative adres on stack
|
||||
pha push accumulator on stack
|
||||
phb push data bank register on stack
|
||||
phd push direct register on stack
|
||||
phk push program bank register on stack
|
||||
php push processor status on stack
|
||||
phx push index register x on stack
|
||||
phy push index register y on stack
|
||||
pla pull accumulator from stack
|
||||
plb pull data bank register from stack
|
||||
pld pull direct register from stack
|
||||
plp pull processor status from stack
|
||||
plx pull index x from stack
|
||||
ply pull index y from stack
|
||||
rep reset processor status bits
|
||||
rol rotate left one bit (memory or accu)
|
||||
ror rorate right one bit (memory or accu)
|
||||
rti return from interrupt
|
||||
rtl return from subroutine long
|
||||
rts return from subroutine
|
||||
sbc subtract memory from accumulator with borrow
|
||||
sec set carry flag C=1
|
||||
sed set decimal mode D=1
|
||||
sei set interrupt disable status I=1
|
||||
sep set processor status bits
|
||||
sta store accumulator in memory
|
||||
stp stop the clock (only reset will help)
|
||||
stx store index x in memory
|
||||
sty store index y in memory
|
||||
stz store zero in memory
|
||||
tad (tcd) transfer accumulator to direct register
|
||||
tas (tcs) transfer accumulator to stack pointer register
|
||||
tax transfer accumulator to index x
|
||||
tay transfer accumulator to index y
|
||||
tda (tdc) transfer direct register to accumulator
|
||||
trb test and reset bit
|
||||
tsa (tsc) transfer stack pointer register to accumulator
|
||||
tsb test and set bit
|
||||
tsx transfer stack pointer register to index x
|
||||
txa transfer index x to accumulator
|
||||
txs transfer index x to stack pointer register
|
||||
txy transfer index x to index y
|
||||
tya transfer index y to accumulator
|
||||
tyx transfer index y to index x
|
||||
wai wait for interrupt
|
||||
xba exchange accumulator high and low 8 bits
|
||||
xce exchange carry and emulation bits
|
||||
129
files/docs/snes/SNESMem.txt
Normal file
129
files/docs/snes/SNESMem.txt
Normal file
@ -0,0 +1,129 @@
|
||||
+=-=-=-=-=-=-=-=-=-=-=+
|
||||
| SNES Memory Mapping |
|
||||
| By: ]SiMKiN[ |
|
||||
| v2.0 |
|
||||
+=-=-=-=-=-=-=-=-=-=-=+
|
||||
|
||||
|
||||
• FastROM's can execute at 3.58Mhz
|
||||
• SlowROM's can only execute 2.68Mhz
|
||||
|
||||
• The SNES lets you access ROM through bank $00 onwards and bank
|
||||
$80 onwards such that locations $00:8000 and $80:8000 are congruent,
|
||||
(they access the same locations.)
|
||||
• When accessing bank $00 onwards the 65816 runs at 2.68Mhz. However,
|
||||
when accessing bank $80 onwards the 65816 can run at 2.68Mhz or
|
||||
3.58Mhz depending on how you set bit 0 of $420D.
|
||||
|
||||
• This Document Contains Information Regarding ROM's upto 32mbit.
|
||||
If you have any information regarding ROM's above 32mbit please send
|
||||
E-Mail to 'simkin@innocent.com'
|
||||
|
||||
+======================================================================+
|
||||
| Mode 20: LoROM Memory Model (32k Banks) |
|
||||
| --------------------------------------- |
|
||||
| • $80-$ef : $8000-$ffff |
|
||||
| Mirrored to $00-6f |
|
||||
| • $f0-$ff : $8000-$ffff |
|
||||
+=========+=============+====================================+=========+
|
||||
| Bank | Offset | Definition | Shadow |
|
||||
+=========+=============+====================================+=========+
|
||||
| $00-$2f | $0000-$1fff | LowRAM, shadowed from $7e | $7e |
|
||||
| | $2000-$2fff | PPU1, APU | $00-$3f |
|
||||
| | $3000-$3fff | SFX, DSP, etc. | $00-$3f |
|
||||
| | $4000-$41ff | Controller | $00-$3f |
|
||||
| | $4200-$5fff | PPU2, DMA, etc. | $00-$3f |
|
||||
| | $6000-$7fff | RESERVED | $00-$3f |
|
||||
| | $8000-$ffff | (Mode 20 ROM) | ------- |
|
||||
+---------+-------------+------------------------------------+---------+
|
||||
| $30-$3f | $0000-$1fff | LowRAM, shadowed from $7e | $7e |
|
||||
| | $2000-$2fff | PPU1, APU | $00-$3f |
|
||||
| | $3000-$3fff | SFX, DSP, etc. | $00-$3f |
|
||||
| | $4000-$41ff | Controller | $00-$3f |
|
||||
| | $4200-$5fff | PPU2, DMA, etc. | $00-$3f |
|
||||
| | $6000-$7fff | RESERVED | ------- |
|
||||
| | $8000-$ffff | (Mode 20 ROM) | $80-$bf |
|
||||
+---------+-------------+------------------------------------+---------+
|
||||
| $40-$6f | $0000-$7fff | RESERVED | ------- |
|
||||
| | $8000-$ffff | (Mode 20 ROM) | $C0-$EF |
|
||||
+---------+-------------+------------------------------------+---------+
|
||||
| $70-$77 | $0000-$ffff | (Mode 20 SRAM) 256KBytes | ------- |
|
||||
+---------+-------------+------------------------------------+---------+
|
||||
| $78-$7d | $0000-$ffff | RESERVED | ------- |
|
||||
+---------+-------------+------------------------------------+---------+
|
||||
| $7e | $0000-$1fff | LowRAM | $00-$3f |
|
||||
| | $2000-$7fff | HighRAM | ------- |
|
||||
| | $8000-$ffff | Expanded RAM | ------- |
|
||||
+---------+-------------+------------------------------------+---------+
|
||||
| $7f | $0000-$ffff | Expanded RAM | ------- |
|
||||
+---------+-------------+------------------------------------+---------+
|
||||
| $80-$ef | $0000-$ffff | Mirror of $00-$6f | $00-$6f |
|
||||
+---------+-------------+------------------------------------+---------+
|
||||
| $f0-$ff | $0000-$7fff | RESERVED | ------- |
|
||||
| | $8000-$ffff | (Mode 20 ROM) | ------- |
|
||||
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
|
||||
|
||||
+======================================================================+
|
||||
| Mode 21: HiROM Memory Model (64k Banks) |
|
||||
| --------------------------------------- |
|
||||
| • $C0-$ff : $0000-$ffff |
|
||||
| High Parts ONLY '($8000-$ffff)' are Shadowed to $00-3f |
|
||||
+=========+=============+====================================+=========+
|
||||
| Bank | Offset | Definition | Shadow |
|
||||
+=========+=============+====================================+=========+
|
||||
| $00-$2f | $0000-$1fff | LowRAM, shadowed from $7e | $7e |
|
||||
| | $2000-$2fff | PPU1, APU | $00-$3f |
|
||||
| | $3000-$3fff | SFX, DSP, etc. | $00-$3f |
|
||||
| | $4000-$41ff | Controller | $00-$3f |
|
||||
| | $4200-$5fff | PPU2, DMA, etc. | $00-$3f |
|
||||
| | $6000-$7fff | RESERVED | $00-$3f |
|
||||
| | $8000-$ffff | (Mode 21 ROM) from $C0-$EF | $C0-$EF |
|
||||
+---------+-------------+------------------------------------+---------+
|
||||
| $30-$3f | $0000-$1fff | LowRAM, shadowed from $7e | $7e |
|
||||
| | $2000-$2fff | PPU1, APU | $00-$3f |
|
||||
| | $3000-$3fff | SFX, DSP, etc. | $00-$3f |
|
||||
| | $4000-$41ff | Controller | $00-$3f |
|
||||
| | $4200-$5fff | PPU2, DMA, etc. | $00-$3f |
|
||||
| | $6000-$7fff | (Mode 21 SRAM) 256KBytes | ------- |
|
||||
| | $8000-$ffff | (Mode 21 ROM) from $C0-$EF | $C0-$EF |
|
||||
+---------+-------------+------------------------------------+---------+
|
||||
| $40-$6f | $0000-$7fff | (Mode 21 ROM) from $C0-$EF | $C0-$EF |
|
||||
+---------+-------------+------------------------------------+---------+
|
||||
| $70-$77 | $0000-$ffff | (Mode 20 SRAM) 256KBytes | ------- |
|
||||
+---------+-------------+------------------------------------+---------+
|
||||
| $78-$7d | $0000-$ffff | RESERVED | ------- |
|
||||
+---------+-------------+------------------------------------+---------+
|
||||
| $7e | $0000-$1fff | LowRAM | $00-$3f |
|
||||
| | $2000-$7fff | HighRAM | ------- |
|
||||
| | $8000-$ffff | Expanded RAM | ------- |
|
||||
+---------+-------------+------------------------------------+---------+
|
||||
| $7f | $0000-$ffff | Expanded RAM | ------- |
|
||||
+---------+-------------+------------------------------------+---------+
|
||||
| $80-$bf | $0000-$ffff | Mirror of $00-$3f | $00-$3f |
|
||||
+---------+-------------+------------------------------------+---------+
|
||||
| $c0-$ff | $0000-$ffff | (Mode 21 ROM) | ------- |
|
||||
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
|
||||
|
||||
• ROM: The SNES ROM Image
|
||||
• RAM: The SNES Work Memory (WRAM)
|
||||
LowRAM, HighRAM, & Expanded RAM
|
||||
All together = 128 Kilo-Bytes
|
||||
• SRAM: Save RAM (Extra RAM added by Cart)
|
||||
The SNES only utilizes 256 Kilo-bits
|
||||
However 256 Kilo-Bytes are provided.
|
||||
|
||||
• APU: Audio Processing Unit
|
||||
SPC700, Inside which has a DSP
|
||||
• PPU: Picture Processing Unit
|
||||
PPU1: 5c77-01
|
||||
PPU2: 5c78-03
|
||||
|
||||
• SFX: Super FX Cart Chip, by Nintendo
|
||||
• DSP: Digital Signal Processing Cart Chip
|
||||
a.k.a. 'NEC mUPD77C25'
|
||||
|
||||
• Shadow: "Congruent Bank". Same meaning as Mirror.
|
||||
|
||||
_____________________________________________________
|
||||
.o(_Thanx to: zsKnight, Lord Esnes, Y0SHi, and MintaBoo_)o.
|
||||
|
||||
82
files/docs/snes/SNESMem2.txt
Normal file
82
files/docs/snes/SNESMem2.txt
Normal file
@ -0,0 +1,82 @@
|
||||
+=-=-=-=-=-=-=-=-=-=-=+
|
||||
| SNES Memory Mapping |
|
||||
| By: ]SiMKiN[ |
|
||||
| v1.0 |
|
||||
+=-=-=-=-=-=-=-=-=-=-=+
|
||||
|
||||
|
||||
• LoROM: Mode 20
|
||||
• HiROM: Mode 21
|
||||
|
||||
• FastROM's can execute at 3.58Mhz
|
||||
• SlowROM's can only execute 2.68Mhz
|
||||
|
||||
• The SNES lets you access ROM through bank $00 onwards and bank
|
||||
$80 onwards such that locations $00:8000 and $80:8000 are congruent,
|
||||
(they access the same locations.)
|
||||
• When accessing bank $00 onwards the 65816 runs at 2.68Mhz. However,
|
||||
when accessing bank $80 onwards the 65816 can run at 2.68Mhz or
|
||||
3.58Mhz depending on how you set bit 0 of $420D.
|
||||
|
||||
+=========+=============+====================================+=========+
|
||||
| Bank | Offset | Definition | Shadow |
|
||||
+=========+=============+====================================+=========+
|
||||
| $00-$2f | $0000-$1fff | LowRAM, each bank is shadowed | $00-$3f |
|
||||
| | | From bank $7e | $7e |
|
||||
| | $2000-$2fff | PPU1, APU | $00-$3f |
|
||||
| | $3000-$3fff | SFX, DSP, etc. | $00-$3f |
|
||||
| | $4000-$41ff | Controller | $00-$3f |
|
||||
| | $4200-$5fff | PPU2, DMA, etc. | $00-$3f |
|
||||
| | $6000-$7fff | Reserved? | $00-$3f |
|
||||
| | $8000-$ffff | (Mode 20, 21 - ROM) | ------- |
|
||||
+---------+-------------+------------------------------------+---------+
|
||||
| $30-$3f | $0000-$1fff | LowRAM, each bank is shadowed | $00-$3f |
|
||||
| | | From bank $7e | $7e |
|
||||
| | $2000-$2fff | PPU1, APU | $00-$3f |
|
||||
| | $3000-$3fff | SFX, DSP, etc. | $00-$3f |
|
||||
| | $4000-$41ff | Controller | $00-$3f |
|
||||
| | $4200-$5fff | PPU2, DMA, etc. | $00-$3f |
|
||||
| | $6000-$7fff | (Mode 21 - SRAM) 256KBytes | ------- |
|
||||
| | $8000-$ffff | (Mode 20, 21 - ROM) | ------- |
|
||||
+---------+-------------+------------------------------------+---------+
|
||||
| $40-$6f | $0000-$7fff | (Mode 21 - ROM) | ------- |
|
||||
| | $8000-$ffff | (Mode 20, 21 - ROM) | ------- |
|
||||
+---------+-------------+------------------------------------+---------+
|
||||
| $70-$77 | $0000-$ffff | (Mode 20, 21 - SRAM) 256KBytes | ------- |
|
||||
+---------+-------------+------------------------------------+---------+
|
||||
| $78-$7d | $0000-$ffff | Never Used | ------- |
|
||||
+---------+-------------+------------------------------------+---------+
|
||||
| $7e | $0000-$1fff | LowRAM | $00-$3f |
|
||||
| | | Shadowed to banks $00-$3f | ------- |
|
||||
| | $2000-$7fff | HighRAM | ------- |
|
||||
| | $8000-$ffff | Expanded Ram | ------- |
|
||||
+---------+-------------+------------------------------------+---------+
|
||||
| $7f | $0000-$ffff | More Expanded RAM | ------- |
|
||||
+---------+-------------+------------------------------------+---------+
|
||||
| $80-$ef | $0000-$ffff | Mirror of $00-$6f | $00-$6f |
|
||||
+---------+-------------+------------------------------------+---------+
|
||||
| $f0-$ff | $0000-$ffff | (Mode 21 - ROM) | ------- |
|
||||
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
|
||||
|
||||
• ROM: The SNES ROM Image
|
||||
• RAM: The SNES Work Memory (WRAM)
|
||||
LowRAM, HighRAM, & Expanded RAM
|
||||
All together = 128 Kilo-Bytes
|
||||
• SRAM: Save RAM (Extra RAM added by Cart)
|
||||
The SNES only utilizes 256 Kilo-bits
|
||||
However 256 Kilo-Bytes are provided.
|
||||
|
||||
• APU: Audio Processing Unit
|
||||
SPC700, Inside which has a DSP
|
||||
• PPU: Picture Processing Unit
|
||||
PPU1: 5c77-01
|
||||
PPU2: 5c78-03
|
||||
|
||||
• SFX: Super FX Cart Chip, by Nintendo
|
||||
• DSP: Digital Signal Processing Cart Chip
|
||||
a.k.a. 'NEC mUPD77C25'
|
||||
|
||||
• Shadow: "Congruent Bank". Same meaning as Mirror.
|
||||
|
||||
_________________________________________________
|
||||
.o(_Thanx to: Y0SHi, zsKnight, MrGrim, and MintaBoo_)o.
|
||||
35
files/docs/snes/SNESROM.PIN
Normal file
35
files/docs/snes/SNESROM.PIN
Normal file
@ -0,0 +1,35 @@
|
||||
Here's the pinout to a 4Mbit/*Mbit mask Rom used in SNES carts as I've
|
||||
deduced from various specs and actual testing.
|
||||
|
||||
1 A17 ------\__/------ +5v 32
|
||||
2 A18 | | *OE 31
|
||||
3 A15 A19 30
|
||||
4 A12 A14 29
|
||||
5 A7 A13 28
|
||||
6 A6 A8 27
|
||||
7 A5 A9 26
|
||||
8 A4 A11 25
|
||||
9 A3 A16 24
|
||||
10 A2 A10 23
|
||||
11 A1 *CE 22
|
||||
12 A0 D7 21
|
||||
13 D0 D6 20
|
||||
14 D1 D5 19
|
||||
15 D2 D4 18
|
||||
16 GND |---------------| D3 17
|
||||
|
||||
The design approximates std EPROM/SRAM pinouts except for the upper address
|
||||
lines (A16-A19), and OE which sits where VPP or PRGM usually is for an EPROM.
|
||||
This pinout approximates Fujitsu's tentative mask ROM pinouts (a package
|
||||
called GAMEMEDC.ZIP seems to base itself on this and is consequently wrong).
|
||||
Nintendo uses Fujitsu chips in some carts, but from my testing and card-edge
|
||||
pinouts provided by other users, I conclude that Fujitsu must have modified
|
||||
the designs.
|
||||
|
||||
NOTE!: Card-edge pin #40, address line 15 (A15) is not used by any cart I've
|
||||
seen. And ROM pin #3 (see above) that I've determined to be A15 is connected
|
||||
to card-edge pin#41, labeled on many pinouts schems as A16..not A15!!!
|
||||
Would some one please verify this inconsistency.
|
||||
|
||||
PS: How many Megabits can the Snes address?
|
||||
|
||||
373
files/docs/snes/SNES_Lockout.txt
Normal file
373
files/docs/snes/SNES_Lockout.txt
Normal file
@ -0,0 +1,373 @@
|
||||
|
||||
Disabling the Super NES/Super Famicom "Lockout Chip"
|
||||
====================================================
|
||||
(rev. 0.5 27-Dec-97)
|
||||
|
||||
[Expert summary: disconnect CIC pin 4]
|
||||
|
||||
This document is copyright © 1997 by Mark Knibbs <mark_k@iname.com>. The latest
|
||||
version, and several other console-related documents, should be available at:
|
||||
http://www.netcomuk.co.uk/~markk/index.html
|
||||
The direct URL for this file is:
|
||||
http://www.netcomuk.co.uk/~markk/Consoles/SNES_Lockout.txt
|
||||
|
||||
You are explicitly permitted to include the *unmodified* document on web sites,
|
||||
FTP sites and the like. But it is best to simply link to the document on my web
|
||||
page, as this means that you automatically pick up any changes made.
|
||||
|
||||
If you have any comments, suggestions or questions about this document, please
|
||||
contact me. If you would like to perform a similar modification to your NES 8-
|
||||
bit console, you should see:
|
||||
http://www.netcomuk.co.uk/~markk/Consoles/NES_Lockout.txt
|
||||
|
||||
|
||||
|
||||
Revision History
|
||||
----------------
|
||||
0.1 27-Jul-97 First release.
|
||||
0.2 19-Aug-97 Added information about another PCB revision and the lockout
|
||||
chip used in U.S./Japanese consoles.Various other small
|
||||
changes.
|
||||
0.3 21-Aug-97 Added information about later model U.S. console (PCB
|
||||
revision SNS-CPU-GPM-01). Added section about removing a game
|
||||
pak with power on. Other minor changes.
|
||||
0.4 22-Sep-97 Changed email address and web URLs. Added "Possible
|
||||
Incompatibilities" section.
|
||||
0.5 27-Dec-97 Added step describing how to dissipate stored charge in the
|
||||
console before opening it. Added paragraph on precautions
|
||||
against static electricity. Added pointer to my SNES 50/60Hz
|
||||
modification document. Minor edits and changes.
|
||||
|
||||
|
||||
|
||||
Introduction
|
||||
------------
|
||||
This document details a simple modification that you can perform on your Super
|
||||
NES or Super Famicom 16-bit video game console in order to disable the "lockout
|
||||
chip" protection system. The "lockout chip" system means that no PAL games can
|
||||
be played on an unmodified U.S. or Japanese console, or vice versa.
|
||||
|
||||
If you have a PAL model Super NES, I strongly recommend that you also fit a
|
||||
switch to change between 50Hz and 60Hz modes. 60Hz mode runs games full-screen,
|
||||
at the correct speed (20% faster than the usual PAL speed). Additionally, more
|
||||
recent games (e.g. Super Mario All-Stars, Super Metroid) contain code to check
|
||||
for 60Hz. So it is not usually possible to run, say, the Japanese version of
|
||||
such a game on a PAL console. Details of this modification, and an accompanying
|
||||
picture, can be found at:
|
||||
http://www.netcomuk.co.uk/~markk/index.html
|
||||
|
||||
|
||||
The procedure given here should work for ANY model Super NES or Super Famicom,
|
||||
both NTSC and PAL versions. As of this writing I have only applied the
|
||||
modification to two UK model PAL Super NES consoles.
|
||||
|
||||
Why might you want to do this? Well, I can think of a few reasons:
|
||||
· You own a PAL Super NES, and currently have to use a clumsy "universal
|
||||
adapter" to be able to use American or Japanese games - with this
|
||||
modification you are able to directly use Japanese cartridges, and can use
|
||||
American games either by cutting a larger hole for the cartridge, or using
|
||||
an extension adapter (you can use your old universal adapter for this - you
|
||||
will no longer need to plug in the second "domestic" cartridge);
|
||||
· You own illicit or unlicensed games which can't be played on your console (I
|
||||
have seen a counterfeit Street Fighter II cartridge which contains no lockout
|
||||
chip, and thus normally requires that a universal adapter be used);
|
||||
· If you own an American model console, you can make it run almost every SNES
|
||||
game by removing the tabs behind the cartridge slot, disabling the lockout
|
||||
chip, and fitting a 50Hz/60Hz switch. If you have a PAL or Japanese console,
|
||||
you will need to file away the cartridge slot in order to accomodate the
|
||||
larger U.S. cartridges, if you want to be able to directly run every game.
|
||||
|
||||
|
||||
If you perform this procedure on your console, PLEASE LET ME KNOW WHETHER IT
|
||||
WORKS! I want to update this document so that it's applicable to as many
|
||||
consoles as possible. Please also tell me which PCB revision your console has
|
||||
(e.g. "SHVC-CPU-01"), the model (e.g. "SNS-001"), serial number, and the date
|
||||
code stamped on the label underneath (e.g. "9313"). I don't anticipate there
|
||||
being many relevant differences between different SNES models, though. I would
|
||||
welcome any comments you have about this document. Send them to the email
|
||||
address given above.
|
||||
|
||||
|
||||
If you are interested in the operation of the lockout chip and Nintendo's
|
||||
history in general, you might like to read David Sheff's book "Game Over", and
|
||||
consult U.S. patents 4,799,635 and/or 5,070,479. Indeed, I obtained the
|
||||
information necessary to carry out this modification from one of the patents.
|
||||
|
||||
|
||||
|
||||
Background
|
||||
----------
|
||||
Before the NES was first released in the U.S.A., Nintendo developed a system
|
||||
for preventing the use of unauthorised software with it. Much counterfeit
|
||||
software had apparently been produced for their Famicom (Family Computer)
|
||||
system, and Nintendo wanted to avoid this happening for the NES.
|
||||
|
||||
Another benefit (to Nintendo) of the system was that legal third-party
|
||||
development was severely hindered. Only Nintendo licensees could buy the
|
||||
lockout chips, one of which was fitted inside every game cartridge. Licensees
|
||||
were apparently charged around US$9 for each chip, in addition to having to pay
|
||||
steep royalties. Nintendo patented the lockout chip concept, and copyrighted
|
||||
the code contain within it.
|
||||
|
||||
Nintendo also used the lockout system to provide "territorial protection". This
|
||||
means that you can't use a U.K. or European NES game in a U.S. console, for
|
||||
example.
|
||||
|
||||
Nintendo used exactly the same system for the Super NES. American and Japanese
|
||||
consoles use identical lockout chips. You can run Japanese games on an American
|
||||
console by simply removing two plastic tabs from behind the cartridge slot.
|
||||
|
||||
PAL versions of the Super NES use a different lockout chip. So PAL cartridges
|
||||
cannot be played on an American or Japanese machine, or vice versa. Many
|
||||
companies produced "universal adapters" to get around this problem. Typically,
|
||||
these have two cartridge slots. You put the foreign game in one, and a domestic
|
||||
game in the other. The adapter uses the lockout chip from the domestic game to
|
||||
enable the foreign game to be played.
|
||||
|
||||
|
||||
|
||||
How the Lockout System Works
|
||||
----------------------------
|
||||
This is a very brief, simplified description. Consult Nintendo's patent for
|
||||
detailed information.
|
||||
|
||||
Functionally identical chips are fitted in the console and inside every game
|
||||
cartridge. (For the SNES, the chips are packaged differently - the one inside
|
||||
the console is surface-mounted, and the one in game cartridges is usually a
|
||||
normal DIL package.)
|
||||
|
||||
Depending on whether a certain pin (pin 4) of the chip is grounded or at +5V,
|
||||
the chip functions as either a lock or as a key. Inside the console, pin 4 of
|
||||
the lockout chip is at +5V (lock), and inside the game cartridge pin 4 is at 0V
|
||||
(key).
|
||||
|
||||
When you switch on the console, the CPU and PPU chips are held in a reset
|
||||
state. The two lockout chips talk to each other. Since they are identical, they
|
||||
should be saying exactly the same thing at exactly the same time. Each chip
|
||||
compares its output with that of its counterpart. If they match, the lock chip
|
||||
releases the reset state of the console, and the game can start. The two chips
|
||||
still talk to each other, and if their outputs ever differ, the lock chip
|
||||
causes the console to reset, and the key chip (inside the game cartridge) may
|
||||
use the chip select lines of the cartridge ROM chips to disable the ROMs.
|
||||
|
||||
The lockout chip is in fact a 4-bit microprocessor with its own internal ROM
|
||||
and RAM. The program it runs was called "10NES" for the NES version of the
|
||||
chip.
|
||||
|
||||
|
||||
|
||||
How the Modification Works
|
||||
--------------------------
|
||||
This depends on changing the lock device to think that it's actually a key. If
|
||||
both devices are configured to be the same type (i.e., both keys), to quote
|
||||
Nintendo's patent "an unstable state takes place and no operations are
|
||||
performed at all." This means that the two chips will do nothing. So the
|
||||
console will not be reset, and the key device will not disable the cartridge
|
||||
ROM chips.
|
||||
|
||||
To carry out the modification you need to disconnect pin 4 of the lockout chip,
|
||||
and connect this pin to ground (0V) instead. (In fact, it seems that you only
|
||||
need to disconnect the pin.)
|
||||
|
||||
Whilst coming up with this method, I considered two other possible ways of
|
||||
achieving the result. I have not tried either of these, and I would be
|
||||
interested to hear if they work. If you feel like doing one of these, contact
|
||||
me for pinout information. The first involves connecting the lockout chip's
|
||||
input to its own output. Thus it may always think that its counterpart chip is
|
||||
present. The second involves simply disconnecting the chip's clock input.
|
||||
|
||||
|
||||
|
||||
Performing the Modification
|
||||
---------------------------
|
||||
Whilst the modification is very simple, if you have not used a soldering iron
|
||||
before I suggest that you ask someone who has some experience with soldering
|
||||
and electronics in general to help you. Maybe your local TV repair person will
|
||||
be willing to do it for you, if you provide a copy of this document and a
|
||||
screwdriver for opening the Super NES case.
|
||||
|
||||
Game consoles, in common with most modern electronic devices are VERY SENSITIVE
|
||||
TO STATIC ELECTRICITY. Ideally, wear a grounding strap and work on a conductive
|
||||
surface when modifying your console. Avoid wearing clothes containing man-made
|
||||
fibres, which are prone to static (e.g. nylon). As far as possible, avoid
|
||||
touching component leads or PCB tracks. Handle the board by its edges.
|
||||
|
||||
Print out and read this document several times before opening your console.
|
||||
|
||||
|
||||
You will need the following:
|
||||
|
||||
· A screwdriver suitable for opening the Super NES case. The screws are special
|
||||
tamperproof screws, referred to as "System Zero" or "Line Head System". A
|
||||
suitable screwdriver can be obtained from a company called MCM Electronics in
|
||||
the USA (http://www.mcmelectronics.com/) or from RS Components in the UK.
|
||||
|
||||
· A crosshead screwdriver suitable for removing some screws inside the Super
|
||||
NES (a "No. 1" bit will be suitable).
|
||||
|
||||
· A low power grounded soldering iron with a fine bit and some desoldering
|
||||
braid.
|
||||
|
||||
· A thin needle or similar implement.
|
||||
|
||||
· A pair of sharp scissors.
|
||||
|
||||
|
||||
When removing screws, make sure you remember which type goes in which hole!
|
||||
Here are step-by-step instructions:
|
||||
|
||||
1. Turn off the console and remove all leads attached to it (AC adapter,
|
||||
controller, A/V lead, etc.). After doing this, turn the power switch on for
|
||||
a couple of seconds and then off again. This dissipates any stored charge
|
||||
inside; you may see the power LED light for a moment as you do this. IT IS
|
||||
*VERY IMPORTANT* THAT YOU DO THIS! YOU RISK DAMAGING YOUR CONSOLE IF YOU
|
||||
DO NOT!
|
||||
|
||||
2. Turn the console upside-down, and remove the six screws from the base. Turn
|
||||
it back over, and lift off the upper part of the case. Position the console
|
||||
so that it is facing you.
|
||||
|
||||
3. Remove the eject lever. Pull up the right-hand side of the metal rod and
|
||||
slide it out, then remove the lever and spring.
|
||||
|
||||
4. Remove the two screws which secure the power switch to the casing. Lift up
|
||||
the switch so that you can get at the screw below.
|
||||
|
||||
5. Gently remove the ribbon cable which leads to the controller socket PCB
|
||||
from the connector at the front of the PCB.
|
||||
|
||||
You do not need to do this if you have a late revision console. You can
|
||||
identify this by the fact that there are only two screws holding down the
|
||||
shielding, and you can see that the ribbon cable does not interfere with
|
||||
removal of the shielding.
|
||||
|
||||
6. Now unscrew the metal shielding from in front of the cartridge slot. The
|
||||
exact details of this step depend on which revision PCB your console has. I
|
||||
will give specifics for the three variants that are known to me.
|
||||
|
||||
· For early consoles, which can be identified by the separate plug-in sound
|
||||
module "SHVC-SOUND", there are six screws to remove from the shielding,
|
||||
including the two which are on either side of the cartridge slot. (After
|
||||
removing the shielding, you may see "SHVC-CPU-01" printed on the PCB if
|
||||
you have a U.S. or Japanese console.)
|
||||
|
||||
· For later consoles, which have no separate sound module, there are four
|
||||
screws to remove. (You may see "SNSP-CPU-02" printed on the PCB after
|
||||
removing the shielding for a PAL console.)
|
||||
|
||||
· For still later consoles, there are two screws to remove. For this type
|
||||
of console, there is no need to remove the controller ribbon cable. (You
|
||||
may see "SNS-CPU-GPM-01" printed on the PCB after removing the shielding
|
||||
for a U.S. model console.)
|
||||
|
||||
7. Carefully lift up the metal shielding. The edges may be quite sharp. You
|
||||
will see various chips. There is more than one type of SNES PCB. Earlier
|
||||
models can be distinguished because the sound hardware is contained in a
|
||||
separate plug-in module labelled "SHVC-SOUND" (towards the rear right of
|
||||
the console). Later revisions integrated this onto the main PCB.
|
||||
|
||||
The position of the lockout chip depends on which kind of PCB your console
|
||||
has. For a U.S. model console with separate sound module, PCB revision
|
||||
"SHVC-CPU-01", the lockout chip is labelled U8 on the PCB, and says:
|
||||
F411
|
||||
© 1990
|
||||
Nintendo
|
||||
It is located just behind the reset switch.
|
||||
|
||||
For a later revision PAL console with integrated sound, PCB revision
|
||||
"SNSP-CPU-02", the lockout chip is labelled U8 on the PCB, and says:
|
||||
F413A
|
||||
© 1992
|
||||
Nintendo
|
||||
It is located towards the front left of the PCB, near the power switch.
|
||||
|
||||
For a still later revision U.S. console, PCB revision "SNS-CPU-GPM-01", the
|
||||
lockout chip is labelled U8 on the PCB, and says:
|
||||
F411A
|
||||
© 1990
|
||||
Nintendo
|
||||
It is located behind and to the left of the reset switch.
|
||||
|
||||
8. Locate pin 4 of the lockout chip. The pins at each corner are numbered on
|
||||
the PCB. Just count along from pin 1 to find pin 4.
|
||||
|
||||
9. Use the desoldering braid and soldering iron to remove some of the solder
|
||||
from pin 4. It may help to cut the end of the braid into a "V" shape, so
|
||||
that you don't inadvertently desolder any adjacent pins. Position the end
|
||||
of the braid over where pin 4 meets the PCB, and briefly press down on this
|
||||
with the soldering iron bit. You should see that some solder has been
|
||||
"sucked into" the braid.
|
||||
|
||||
Using the needle, apply a gentle levering action to the pin as you
|
||||
momentarily touch the soldering iron to it. The pin should come away from
|
||||
the PCB. Carefully pull it up using the tip of the needle as a lever, so
|
||||
that the end is a couple of millimetres away from the PCB.
|
||||
|
||||
10. That's it! You can optionally solder a short length of wire between pin 4
|
||||
and 0V. Pin 9 of the lockout chip is at 0V, so you could connect these two
|
||||
pins. Alternatively, you may wish to add a switch; see the "Possible
|
||||
Incompatibilities" section below.
|
||||
|
||||
11. It is a good idea to test the console before putting it back together. Rest
|
||||
the power switch on its mounting and connect the AC adapter, controller,
|
||||
video lead and a game pak. Switch the console on. If all has gone well, the
|
||||
display should appear as usual. Turn the console off, and insert a foreign
|
||||
game pak (i.e., a U.S. or Japanese game pak if you have a PAL console; PAL
|
||||
game pak if you have a U.S. or Japanese console). Turn the console off and
|
||||
remove all attachments (AC adapter, etc.). Turn the power switch on and
|
||||
then off.
|
||||
|
||||
12. Put the console back together. The procedure is the reverse of steps 2 to 7
|
||||
above. You may find fitting the eject lever tricky. If so, put the metal
|
||||
rod through the lever, and put the spring on the left end of this, so that
|
||||
the outwards-pointing end of the spring is downwards. The outwards-pointing
|
||||
end should be the longer of the two. Ease the spring and lever into
|
||||
position, ensuring that the end of the spring goes into the recess in the
|
||||
casing. Now carefully move the other end of the spring back until it is in
|
||||
the recess in the lever.
|
||||
|
||||
|
||||
|
||||
Possible Incompatibilities
|
||||
--------------------------
|
||||
A few very recent titles may be incompatible with this modification. One
|
||||
example is PAL "Street Fighter Alpha 2", used with a PAL SNES whose lockout
|
||||
chip has been disabled. The graphics were reported to be corrupted in some way.
|
||||
There is also reported to be more than one version of "Super Mario RPG", one of
|
||||
which may be incompatible.
|
||||
|
||||
I know why this is. One explanation might be that Nintendo changed the lockout-
|
||||
related circuitry inside the cartridges, to detect the "deadlock" situation
|
||||
caused by disabling the console's lockout chip, and interfere with normal use
|
||||
of the game in this case.
|
||||
|
||||
To solve this problem, and allow at least all domestic titles to be played, you
|
||||
can fit a DPST switch to pin 4 of the lockout chip. Connect the middle switch
|
||||
terminal to pin 4, and the other two terminals to +5V and ground respectively.
|
||||
Then, with the switch in one position the lockout chip will be disabled, and in
|
||||
the other it will operate as normal. Contact me if you are unsure of how to do
|
||||
this.
|
||||
|
||||
|
||||
|
||||
At Your Own Risk!
|
||||
-----------------
|
||||
There are some interesting things which can be done now that the lockout chip
|
||||
is disabled. If you try the following, it is at your own risk. Be aware that
|
||||
removing a game pak while the console is on may damage your console or your
|
||||
game pak.
|
||||
|
||||
If your SNES has an "eject prevention lever", you will have to try this before
|
||||
fitting the case back on. (To see whether your console has one, open the game
|
||||
pak shutter, and move the power switch. If you see a piece of plastic move out
|
||||
when the switch is in the "on" position, that is the eject prevention lever.
|
||||
Nintendo removed this from later U.S. models of the SNES, at least.)
|
||||
|
||||
Plug in a game pak; "Street Fighter II" is a suitable one. Turn on the console,
|
||||
and wait until some music starts playing. Now carefully remove the game pak,
|
||||
without turning off the console first. You should find that the display blanks,
|
||||
but the music keeps playing until the end of the tune! This is because the
|
||||
sound processor has its own RAM, and the music code is loaded into this. So
|
||||
music continues to play even after removing the game pak.
|
||||
|
||||
---
|
||||
302
files/docs/snes/SWC.TXT
Normal file
302
files/docs/snes/SWC.TXT
Normal file
@ -0,0 +1,302 @@
|
||||
|
||||
E.V.O.L.U.T.I.O.N. A.U.S.T.R.A.L.I.A.
|
||||
o o o
|
||||
/\ /\ /\ ___o ___o
|
||||
o_____________/ \_ _______o / \ / \_________| |____________o | |
|
||||
\ __ / / |\ \ / ./ __\ \ _ \ |\ \ \ | .|
|
||||
\ \__/_/___/ ./ |/\ /\ .\/ o/ | .\ \___\) .) .|/\ /\ \ \ \| o|
|
||||
/\_______// o/ / / / o/ O/___| o|\ \ / o/ o/ / / o/ .\ \ O|
|
||||
/ /_/ O/ O/| ( (_/ O/ /_) ) O|_) )/ O/| ( (_/ O/ o|\ |
|
||||
\ ____/_________\ \___/_________/________// / |___\_______/| O| \___|
|
||||
_\ \______________\ \_____________________/ / | |______
|
||||
_________________________________________________/ Poise/RaZoR PC |__________
|
||||
|
||||
Presents : The Super Wild Card & Super Magicom Programmers Handbook.
|
||||
|
||||
Typed by : MicroChip/Evolution/Submission
|
||||
|
||||
Call the Evolution WHQ on : Southern Cross BBS (SNES/MD/PC/AMIGA)
|
||||
--> +61-3-428-9359 (2 Nodes Ringdown)
|
||||
|
||||
|
||||
***************************************************************************
|
||||
|
||||
|
||||
HardWare Specifcations & Features
|
||||
---------------------------------
|
||||
|
||||
|
||||
1) DRAM - 28Mega Bits Maximum Available
|
||||
2) SRAM - 256k (Battery Backup)
|
||||
3) ROM - 128k (Firmware)
|
||||
4) Floppy Drive Interface -
|
||||
* Motorola MCS3201 Chip (NEC 765A Compatible)
|
||||
* Compatible with IBM PC/AT & XT Disk Drive System
|
||||
* Suports 3.5" & 5.25" Flopy Disk Drive.
|
||||
* DB-25 Female Connector (non-standard)
|
||||
* Supports only Non-DMA mode (polling)
|
||||
5) Parallel Port Interface -
|
||||
* 8 bits input, 4 bits output, 1 bit handshake.
|
||||
* DB-25 Female Connector
|
||||
* Use Male to Male DB-25 Connector to connect to PC's Parallel Port
|
||||
6) Core Chip -
|
||||
* Altera EP1810 Chip (First Generation)
|
||||
* Front Far East FC9203 Chip (Currently Shipping)
|
||||
* Front Far East FC9304 Chip (Not Avilable)
|
||||
7) Versions -
|
||||
Ver. Bios-Name Core Mode21 Saver Description
|
||||
'A' Magicom EP1810 No Yes External Drive
|
||||
'B' Wild Card EP1810 Yes Yes External or Bulid-in DD
|
||||
'C' Wild Card FC9203 Yes Yes External or Bulid-in DD
|
||||
'D' Wild Card FC9304 Yes Yes (Under Development)
|
||||
'E' Wild Card EP1810 Yes No Magic Drive Adapter
|
||||
'F' Wild Card FC9203 Yes No Magic Drive Adapter
|
||||
|
||||
|
||||
SoftWare Specifications & Features
|
||||
----------------------------------
|
||||
|
||||
1) Registers -
|
||||
|
||||
[Floppy Drive I/O]
|
||||
C000R : Input Register
|
||||
Bit 7 - MCS3201 IRQ Signal
|
||||
Bit 6 - Drive 'Index' Signal (Disk Insert Check)
|
||||
C002W : Digital Output Register
|
||||
C004R : Main Status Register
|
||||
C005RW: Data Register
|
||||
C007R : Digital Input Register
|
||||
C007W : Disk Control Register
|
||||
* Consult the MCS3201 Data Sheet for more detailed information.
|
||||
|
||||
[Parallel I/O]
|
||||
C008R : Bit 07 : Parallel Data Input (reading this register will
|
||||
reverse the busy flag)
|
||||
C008W : Bit 03 : Parallel Data Output
|
||||
Bit 00 : 0=Mode 20, 1=Mode 21 (DRAM Mapping)
|
||||
Bit 01 : 0=Mode 1, 1=Mode 2 (SRAM Mapping)
|
||||
|
||||
C009R : Busy Flag, Bit 7 (EP1810 Version)
|
||||
C000R : Busy Flag, Bit 5 (FC9203 Version)
|
||||
|
||||
[Page Select]
|
||||
E000W : Memory Page 0
|
||||
E001W : Memory Page 1
|
||||
E002W : Memory Page 2
|
||||
E003W : Memory Page 3
|
||||
|
||||
[Mode Select]
|
||||
E004W : System Mode 0 (Bios Mode, Power On Default)
|
||||
E004W : System Mode 0 (Play Cartridge)
|
||||
E004W : System Mode 0 (Cartridge Emulation 1)
|
||||
E004W : System Mode 0 (Cartridge Emulation 2)
|
||||
|
||||
[Others]
|
||||
|
||||
E008W : 44256 Dram Type (For 2,4,6,8 Mega Dram Card.
|
||||
E009W : 441000 Dram Type (For 8,16,24,32 Mega Dram Card)
|
||||
|
||||
E00CW : Enable cartridge page mapping at A000FFF (Sys Mode 0)
|
||||
Disable cartridge page mapping at bank 205F,A0 (Sys Mode 2,3)
|
||||
E00DW : Enable SRAM page mapping at A000FFF (Sys Mode 0)
|
||||
Enable cartridge mapping at Bank 205F,A0 (Sys Mode 2,3)
|
||||
|
||||
* The bank address of the above registers is 007D,80.
|
||||
* The above registers are available only in System Mode 0 (BIOS Mode)
|
||||
* [Mode Select] registers also available in System Mode 2.
|
||||
|
||||
2) Memory Mapping -
|
||||
|
||||
[System Mode 0]
|
||||
bb2000B3FFFRW : SRAM or Cartridge page mapping, bb=407D,C0
|
||||
bb8000B9FFFRW : DRAM page mapping, bb=007D,80
|
||||
bbA000bBFFFRW : SRAM or Cartridge page mapping, bb=007D,90
|
||||
bbC000W : I/O Registers, bb=007D,80 (Registers)
|
||||
bbE000bFFFFR : ROM Page mapping, bb=01 (Firmware)
|
||||
|
||||
* 1 Page = 8k Bytes, 1 Bank = 4 pages
|
||||
* bb:000F = 4 Mega Bytes
|
||||
* bb:001F = 8 Mega Bytes
|
||||
* bb:002F = 12 Mega Bytes
|
||||
* bb:003F = 16 Mega Bytes
|
||||
|
||||
[System Mode 1]
|
||||
bb0000b7FFFR : Cartridge Mapping, bb=407D,C0 (Mode 21)
|
||||
bb8000bFFFFR : Cartridge Mapping, bb=007d,80 (Mode 20,21)
|
||||
|
||||
[System Mode 2]
|
||||
bb0000b7FFFR : DRAM Mapping, bb=407D,C00 (Mode 21)
|
||||
bb8000BFFFFR : DRAM Mapping, bb=0070,800 (Mode 20,21)
|
||||
70800070FFFFRW : SRAM Mode 1 Mapping
|
||||
306000307FFFRW : SRAM Mode 2 Mapping, Page 0
|
||||
316000317FFFRW : SRAM Mode 2 Mapping, Page 1
|
||||
326000327FFFRW : SRAM Mode 2 Mapping, Page 2
|
||||
336000337FFFRW : SRAM Mode 2 Mapping, Page 3
|
||||
|
||||
* bbE004bE007W : Mode Select Registers, bb=007D,80
|
||||
|
||||
[System Mode 3]
|
||||
bb0000b7FFFR : DRAM Mapping, bb=406F,C0 (Mode 21)
|
||||
bb8000BFFFFR : DRAM Mapping, bb=006F,80 (Mode 20,21)
|
||||
70800070FFFFRW : SRAM Mode 1 Mapping
|
||||
306000307FFFRW : SRAM Mode 2 Mapping, Page 0
|
||||
316000317FFFRW : SRAM Mode 2 Mapping, Page 1
|
||||
326000327FFFRW : SRAM Mode 2 Mapping, Page 2
|
||||
336000337FFFRW : SRAM Mode 2 Mapping, Page 3
|
||||
|
||||
* Mode 21 - Even DRAM is mapped to bb0000b7FFF
|
||||
Odd DRAM is mapped to bb8000bFFFF
|
||||
|
||||
|
||||
3) Parallel I/O Protocol -
|
||||
|
||||
[Protocol used in PC]
|
||||
|
||||
* Byte Output procedure:
|
||||
Wait Busy Bit = 1 Status Port Bit 7 (Hex n79,n7D)
|
||||
Write One Bytes Data Latch (Hex n78,n7C)
|
||||
Reverse Strobe bit Control Port Bit 0 (Hex n7a,n7E)
|
||||
|
||||
* Byte Input procedure:
|
||||
Wait Busy Bit = 0 Status Port Bit 7 (Hex n79.n7D)
|
||||
Read Low 4 bits of byte Status Port Bit 36 (Hex n79.n7D)
|
||||
Reverse Strobe bit Control Port Bit 0 (Hex n7A.n7E)
|
||||
Wait Bust Bit = 0 Status PortBit 7 (Hex n79.n7D)
|
||||
Read High 4 Bits of byte Status Port Bit 36 (Hex n79.n7D)
|
||||
Reverse Strobe Bit Control Port Bit 0 (Hex n7A.n7E)
|
||||
|
||||
* 5 Types of Commands
|
||||
|
||||
* Command length = 9 bytes
|
||||
|
||||
* Command Format:
|
||||
Byte 1 D5 ID Code 1
|
||||
Byte 2 AA ID Code 2
|
||||
Byte 3 96 ID Code 3
|
||||
Byte 4 00|01|04|05|06 Command Code
|
||||
Byte 5 A1 Low Byte of Address
|
||||
Byte 6 AH High Bytes of Address
|
||||
Byte 7 LL Low Byte of Data Length
|
||||
Byte 8 LH High Byte of data Length
|
||||
Byte 9 CC Checksum = 81^Byte4^Byte5^Byte6^Byte7^Byte8
|
||||
|
||||
* Command [00] : Download Data
|
||||
a1,ah = Address
|
||||
11,1h = Data Length
|
||||
Output Data after Command
|
||||
|
||||
* Command [01] : Upload Data
|
||||
a1,ah = Address
|
||||
11,1h = Data Length
|
||||
Input Data after Command
|
||||
|
||||
* Command [04] : Force SFC Program to JMP
|
||||
a1,ah = address
|
||||
|
||||
* Command [05] : Set Memory Page Number
|
||||
a1 Bit 1 = Page Number
|
||||
a1 Bit27 + ah Bit 1 = Bank Number
|
||||
|
||||
* Command [06] : SUB Function
|
||||
a1 = 0 Initial Device
|
||||
a1 = 1 Play Game in DRAM
|
||||
a1 = 2 Play Cartridge
|
||||
|
||||
|
||||
Password Format
|
||||
---------------
|
||||
|
||||
1) Description -
|
||||
Use the Data in the password to replace the data in the memory
|
||||
at the offset address (according to the game file)
|
||||
|
||||
2) Format 1 -
|
||||
* Game Doctor Gold Finger Format
|
||||
* 20 bits address space assigment
|
||||
* 3 data bytes per string
|
||||
* [Gaaaaaddddddccc]
|
||||
'G' = Means Game Doctor Format
|
||||
aaaaa = Offser address of game file (Excluding 512 bytes header)
|
||||
dddddd = 3 data Bytes (If the second ot the third data is '00',
|
||||
this means that the data is uncganged in
|
||||
the second of third byte)
|
||||
ccc = Checksum (Not used in SWC and SMC)
|
||||
|
||||
3) Format 2 -
|
||||
* 'FFE' Format
|
||||
* 24 bit address space assigment
|
||||
* 1 to 36 data bytes per string
|
||||
* No Checksum
|
||||
* [nnaaaaaadd....]
|
||||
nn = Data bytes length
|
||||
aaaaaa = Offset Address of Game file (excluding 512 bytes header)
|
||||
dd.... = nn Bytes data (Should be nn*2 Characters)
|
||||
|
||||
File Header
|
||||
-----------
|
||||
|
||||
1) Created by JSI/Front Far East
|
||||
|
||||
2) 512 Bytes Length
|
||||
|
||||
3) Byte
|
||||
0 - Low Byte of 8k-Bytes page Counts
|
||||
1 - High Byte of 8k-Bytes page Counts
|
||||
2 - Emulation Mode Select
|
||||
Bit 7 6 5 4 3 2 1
|
||||
x : 1=Run in Mode 0 (Jump $8000)
|
||||
x : 0=Last File of the Game (Multi-File)
|
||||
x : 0=Mode 1, 1=Mode 2 (SRAM Mapping)
|
||||
x : 0=Mode 20, 1=Mode 21 (DRAM Mapping)
|
||||
x : 0=Run in Mode 3, 1=Run in Mode 2 (JMP Reset)
|
||||
x : 0=Disable, 1=Enable (external cartridge
|
||||
memory image at Bank 205F,A0 System Mode 2,3)
|
||||
8 - File ID Code 1 (Should be 'AA')
|
||||
9 - File ID Code 2 (Should be 'BB')
|
||||
10 - Check this byte if ID 1 & 2 Match
|
||||
02 : Magic Griffin Game File (PC Engine)
|
||||
03 : Magic Griffin SRAM Data File
|
||||
04 : SWC & SMC Game File (SNES)
|
||||
05 : SWC & SMC Password, SRAM data, Saver Data File.
|
||||
06 : SMD Game File (Megadrive)
|
||||
07 : SMD SRAM Data File
|
||||
37 - Reserved (Should be 00)
|
||||
11511 - Reserved (Should be 00)
|
||||
|
||||
|
||||
****************************** The End ***********************************
|
||||
|
||||
|
||||
Personal Greetings go to:
|
||||
|
||||
Ice/ATX - See ya at the Rave!
|
||||
Krayzi/PE - Stop pulling those pipes.
|
||||
Krimsym - See ya at Insanity!
|
||||
VIking Child/Submission - Use a condom next time!
|
||||
Ginnie/Razor - PC's RULE - NOT!
|
||||
TV & Revenger/Submission - Why an A4000?
|
||||
Poise/Razor - Where's my text screen??
|
||||
Itec/Submission - Lets get TCC going again?
|
||||
Mixer/Mel - See ya at Kentucky!
|
||||
WormEater & RAM - Call my board!
|
||||
Kirk/Anthrox - How ya going Pete? Will Call ya soon!
|
||||
Mat - Speed kills - NOT!
|
||||
Choronzon - Let me see ya trade!
|
||||
Sweet Thing - Thanx for the support!
|
||||
Woody & Sandman - Call my bbs you lazy bastards.. hehe
|
||||
Cameo - I want a pre-release...
|
||||
Rotox - Call me..
|
||||
Mr. IRQ - Dove' il mio manuale?
|
||||
Jacknife - Thanx for the Support Dude!
|
||||
And to all my friends I have forgotten about coz I am tired!
|
||||
|
||||
Group Greetings go to:
|
||||
|
||||
Submission, Magical, Anthrox, Paradox, Razor, Fairlight, BSL, Elitendo,
|
||||
PE, Quartex, Skid Row and to all others I missed!
|
||||
|
||||
NOTE: If any Australian's wish to purchase a Super Wild Card they are
|
||||
asked to call (03) 883-0297 (24hour paging service)............
|
||||
|
||||
|
||||
| ||||