mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-28 01:49:33 -06:00
Meta:
Using Unix tools to operate on a tree containing filename with spaces in them is really annoying, so rename the handful of instances where there were spaces. Host.cpp has never been used. Games tend to lookup the following directories that we don't yet have anything to put in, so prepopulate them in Data/User/Wii: title/00010001 title/00010002 title/00010003 title/00010004 title/00010005 title/00010006 title/00010007 meta shared2/title Set eol-style native on a number of text files which didn't already have it. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5572 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -1,304 +1,304 @@
|
||||
omments: 1
|
||||
|
||||
A Compendium of Gamecube Action Replay Code Types
|
||||
|
||||
Note: This is note a Complete code type list.
|
||||
|
||||
The purpose of this document is to catalogue and explain the effects of different AR code types in a clear, concise, and easy to read format. Please note that this document is not intended to explain EVERY code type, only those of interest to the amateur hacker.
|
||||
|
||||
It would not have been possible to write this document without Kenobi's "GCN AR CODES TYPES EXPLANATION", found at www.GSCentral.com, so a big thank-you goes to Kenobi and Parasyte for their contributions to the GCN hacking scene.
|
||||
|
||||
Kenobi's documentation is recommended reading as it is very complete, precise, and exact in it's explanations. However, that is also it's main flaw, it's TOO complex and technical for the casual or newbie hacker to understand. If "Address = ((0x0wXXXXXXX) AND 0x01FFFFFF) OR 0x80000000)" makes any sense to you, then I implore you to read Kenobi's guide instead. The intended audience for this document is people who'd rather have things explained in plain English.
|
||||
|
||||
It should be noted that every decrypted AR code has a basic two-part format that is universal to every code. The first half contains the code type and address to be written to. The second half contains the value to be written.
|
||||
|
||||
The Gamecube has a memory range of 80000000 - 817FFFFF (cached), or C0000000 - C17FFFFF (uncached). However for the sake of simplicity, the AR uses an offset number in the range of 00000000 - 017FFFFF. The code type identifier is an 8-bit value that is applied to the first two digits of the offset. For example, if your offset is 00012345, and you wish to perform a 32-bit write (04), you simply add (04000000) + (00012345) = 04012345.
|
||||
|
||||
In order to conserve space and simplicity, only the 8-bit code type identifier and particulars of the second half of the code will be explained below, as the method for procuring the first half has already been described above ;)
|
||||
|
||||
Terms:
|
||||
|
||||
8-bit - Byte - 0x12
|
||||
16-bit - Halfword - 0x1234
|
||||
32-bit - Word - 0x12345678
|
||||
|
||||
---Writes---
|
||||
|
||||
(00) - NNNNNNXX
|
||||
8-bit write. X is the value, N is the number of times to repeat.
|
||||
|
||||
(02) NNNNXXXX
|
||||
16-bit write. X is the value, N is the number of times to repeat.
|
||||
|
||||
(04) XXXXXXXX
|
||||
32-bit write. X is the value.
|
||||
|
||||
Examples:
|
||||
|
||||
00006500 00000312
|
||||
Will write byte 0x12 to 80006500, 80006501, 80006502, 800067503.
|
||||
|
||||
02006500 00011234
|
||||
Will write halfword 0x1234 to 80006500, 80006502.
|
||||
|
||||
05006500 12345678
|
||||
Will write word 0x12345678 to 81006500.
|
||||
|
||||
|
||||
---Addition---
|
||||
|
||||
(80) - 000000XX
|
||||
8-bit Addition. Load the byte at the address, add X to it, and save resulting byte.
|
||||
|
||||
(82) - 0000XXXX
|
||||
16-bit Addition. Load the halfword at the address, add X to it, and save resulting halfword.
|
||||
|
||||
(84) - XXXXXXXX
|
||||
32-bit Addition. Load the word at the address, add X to it, and save resulting word.
|
||||
|
||||
---Single Line Activators---
|
||||
|
||||
***Equal***
|
||||
(08) 000000XX
|
||||
8-bit Equal activator.
|
||||
|
||||
(0A) 0000XXXX
|
||||
16-bit Equal activator.
|
||||
|
||||
(0C) XXXXXXXX
|
||||
32-bit Equal activator.
|
||||
|
||||
X is the value the address must equal to activate the next line of code.
|
||||
|
||||
***NOT Equal***
|
||||
(10) 000000XX
|
||||
8-bit NOT Equal activator.
|
||||
|
||||
(12) 0000XXXX
|
||||
16-bit NOT Equal activator.
|
||||
|
||||
(14) XXXXXXXX
|
||||
32-bit NOT Equal activator.
|
||||
|
||||
If the value stored at the address is not equal to X, activate the next line of code.
|
||||
|
||||
***If Lower (signed)***
|
||||
(18) 000000XX
|
||||
8-bit If Lower (signed) activator.
|
||||
|
||||
(1A) 0000XXXX
|
||||
16-bit If Lower (signed) activator.
|
||||
|
||||
(1C) XXXXXXXX
|
||||
32-bit If Lower (signed) activator.
|
||||
|
||||
If the value stored at the address is lower than X, activate the next line of code.
|
||||
|
||||
***If Higher (signed)***
|
||||
(20) 000000XX
|
||||
8-bit If Higher (signed) activator.
|
||||
|
||||
(22) 0000XXXX
|
||||
16-bit If Higher (signed) activator.
|
||||
|
||||
(24) XXXXXXXX
|
||||
32-bit If Higher (signed) activator.
|
||||
|
||||
If the value stored at the address is higher than X, activate the next line of code.
|
||||
|
||||
***If Lower (unsigned)***
|
||||
(28) 000000XX
|
||||
8-bit If Lower (unsigned) activator.
|
||||
|
||||
(2A) 0000XXXX
|
||||
16-bit If Lower (unsigned) activator.
|
||||
|
||||
(2C) XXXXXXXX
|
||||
32-bit If Lower (unsigned) activator.
|
||||
|
||||
If the value stored at the address is lower than X, activate the next line of code.
|
||||
|
||||
***If Higher (unsigned)***
|
||||
(30) 000000XX
|
||||
8-bit If Higher (unsigned) activator.
|
||||
|
||||
(32) 0000XXXX
|
||||
16-bit If Higher (unsigned) activator.
|
||||
|
||||
(34) XXXXXXXX
|
||||
32-bit If Higher (unsigned) activator.
|
||||
|
||||
If the value stored at the address is higher than X, activate the next line of code.
|
||||
|
||||
---Double Line Activators---
|
||||
|
||||
***Equal***
|
||||
(48) 000000XX
|
||||
8-bit activator.
|
||||
|
||||
(4A) 0000XXXX
|
||||
16-bit activator.
|
||||
|
||||
(4C) XXXXXXXX
|
||||
32-bit activator.
|
||||
|
||||
X is the value the address must equal to activate the next two lines of code.
|
||||
|
||||
***NOT Equal***
|
||||
(50) 000000XX
|
||||
8-bit NOT Equal activator.
|
||||
|
||||
(52) 0000XXXX
|
||||
16-bit NOT Equal activator.
|
||||
|
||||
(54) XXXXXXXX
|
||||
32-bit NOT Equal activator.
|
||||
|
||||
If the value stored at the address is not equal to X, activate the next two lines of code.
|
||||
|
||||
***If Lower (signed)***
|
||||
(58) 000000XX
|
||||
8-bit If Lower (signed) activator.
|
||||
|
||||
(5A) 0000XXXX
|
||||
16-bit If Lower (signed) activator.
|
||||
|
||||
(5C) XXXXXXXX
|
||||
32-bit If Lower (signed) activator.
|
||||
|
||||
If the value stored at the address is lower than X, activate the next two lines of code.
|
||||
|
||||
***If Higher (signed)***
|
||||
(60) 000000XX
|
||||
8-bit If Higher (signed) activator.
|
||||
|
||||
(62) 0000XXXX
|
||||
16-bit If Higher (signed) activator.
|
||||
|
||||
(64) XXXXXXXX
|
||||
32-bit If Higher (signed) activator.
|
||||
|
||||
If the value stored at the address is higher than X, activate the next two lines of code.
|
||||
|
||||
***If Lower (unsigned)***
|
||||
(68) 000000XX
|
||||
8-bit If Lower (unsigned) activator.
|
||||
|
||||
(6A) 0000XXXX
|
||||
16-bit If Lower (unsigned) activator.
|
||||
|
||||
(6C) XXXXXXXX
|
||||
32-bit If Lower (unsigned) activator.
|
||||
|
||||
If the value stored at the address is lower than X, activate the next two lines of code.
|
||||
|
||||
***If Higher (unsigned)***
|
||||
(70) 000000XX
|
||||
8-bit If Higher (unsigned) activator.
|
||||
|
||||
(72) 0000XXXX
|
||||
16-bit If Higher (unsigned) activator.
|
||||
|
||||
(74) XXXXXXXX
|
||||
32-bit If Higher (unsigned) activator.
|
||||
|
||||
If the value stored at the address is higher than X, activate the next two lines of code.
|
||||
|
||||
---Multi-Line Activators---
|
||||
|
||||
Note that all multi-line codes must end with the line 00000000 40000000.
|
||||
|
||||
***Equal***
|
||||
(88) 000000XX
|
||||
8-bit activator.
|
||||
|
||||
(8A) 0000XXXX
|
||||
16-bit activator.
|
||||
|
||||
(8C) XXXXXXXX
|
||||
32-bit activator.
|
||||
|
||||
X is the value the address must equal to activate the next lines of code.
|
||||
|
||||
***NOT Equal***
|
||||
(90) 000000XX
|
||||
8-bit NOT Equal activator.
|
||||
|
||||
(92) 0000XXXX
|
||||
16-bit NOT Equal activator.
|
||||
|
||||
(94) XXXXXXXX
|
||||
32-bit NOT Equal activator.
|
||||
|
||||
If the value stored at the address is not equal to X, activate the next lines of code.
|
||||
|
||||
***If Lower (signed)***
|
||||
(98) 000000XX
|
||||
8-bit If Lower (signed) activator.
|
||||
|
||||
(9A) 0000XXXX
|
||||
16-bit If Lower (signed) activator.
|
||||
|
||||
(9C) XXXXXXXX
|
||||
32-bit If Lower (signed) activator.
|
||||
|
||||
If the value stored at the address is lower than X, activate the next lines of code.
|
||||
|
||||
***If Higher (signed)***
|
||||
(A0) 000000XX
|
||||
8-bit If Higher (signed) activator.
|
||||
|
||||
(A2) 0000XXXX
|
||||
16-bit If Higher (signed) activator.
|
||||
|
||||
(A4) XXXXXXXX
|
||||
32-bit If Higher (signed) activator.
|
||||
|
||||
If the value stored at the address is higher than X, activate the next lines of code.
|
||||
|
||||
***If Lower (unsigned)***
|
||||
(A8) 000000XX
|
||||
8-bit If Lower (unsigned) activator.
|
||||
|
||||
(AA) 0000XXXX
|
||||
16-bit If Lower (unsigned) activator.
|
||||
|
||||
(AC) XXXXXXXX
|
||||
32-bit If Lower (unsigned) activator.
|
||||
|
||||
If the value stored at the address is lower than X, activate the next lines of code.
|
||||
|
||||
***If Higher (unsigned)***
|
||||
(B0) 000000XX
|
||||
8-bit If Higher (unsigned) activator.
|
||||
|
||||
(B2) 0000XXXX
|
||||
16-bit If Higher (unsigned) activator.
|
||||
|
||||
(B4) XXXXXXXX
|
||||
32-bit If Higher (unsigned) activator.
|
||||
|
||||
If the value stored at the address is higher than X, activate the next lines of code.
|
||||
|
||||
---Alignment---
|
||||
|
||||
Codes must be properly aligned depending on the type of code.
|
||||
8-bit codes can be used on ANY address.
|
||||
16-bit codes must have an address that is a multiple of 2: 0,2,4,6,8,A,C,E.
|
||||
32-bit codes must have an address that is a multiple of 4:0,4,8,C.
|
||||
If codes aren't aligned, they may not work, or may cause your AR to spaz out and kill your cat (R.I.P. Snowball).
|
||||
|
||||
---Signed & Unsigned Numbers---
|
||||
|
||||
Unsigned means :
|
||||
For 8-bits : 0x00 -> 0xFF = 0 to 255.
|
||||
For 16-bits: 0x0000 -> 0xFFFF = 0 to 65535.
|
||||
For 32-bits: 0x00000000 -> 0xFFFFFFFF = 0 to 4294967295.
|
||||
|
||||
Signed means :
|
||||
For 8-bits : 0x00 -> 0x7F = 0 to 127.
|
||||
0x80 -> 0xFF = -127 to -1.
|
||||
For 16-bits: 0x0000 -> 0x7FFF = 0 to 32767.
|
||||
0x8000 -> 0xFFFF = -32768 to -1.
|
||||
For 32-bits: 0x00000000 -> 0x7FFFFFFF = 0 to 2147483647.
|
||||
omments: 1
|
||||
|
||||
A Compendium of Gamecube Action Replay Code Types
|
||||
|
||||
Note: This is note a Complete code type list.
|
||||
|
||||
The purpose of this document is to catalogue and explain the effects of different AR code types in a clear, concise, and easy to read format. Please note that this document is not intended to explain EVERY code type, only those of interest to the amateur hacker.
|
||||
|
||||
It would not have been possible to write this document without Kenobi's "GCN AR CODES TYPES EXPLANATION", found at www.GSCentral.com, so a big thank-you goes to Kenobi and Parasyte for their contributions to the GCN hacking scene.
|
||||
|
||||
Kenobi's documentation is recommended reading as it is very complete, precise, and exact in it's explanations. However, that is also it's main flaw, it's TOO complex and technical for the casual or newbie hacker to understand. If "Address = ((0x0wXXXXXXX) AND 0x01FFFFFF) OR 0x80000000)" makes any sense to you, then I implore you to read Kenobi's guide instead. The intended audience for this document is people who'd rather have things explained in plain English.
|
||||
|
||||
It should be noted that every decrypted AR code has a basic two-part format that is universal to every code. The first half contains the code type and address to be written to. The second half contains the value to be written.
|
||||
|
||||
The Gamecube has a memory range of 80000000 - 817FFFFF (cached), or C0000000 - C17FFFFF (uncached). However for the sake of simplicity, the AR uses an offset number in the range of 00000000 - 017FFFFF. The code type identifier is an 8-bit value that is applied to the first two digits of the offset. For example, if your offset is 00012345, and you wish to perform a 32-bit write (04), you simply add (04000000) + (00012345) = 04012345.
|
||||
|
||||
In order to conserve space and simplicity, only the 8-bit code type identifier and particulars of the second half of the code will be explained below, as the method for procuring the first half has already been described above ;)
|
||||
|
||||
Terms:
|
||||
|
||||
8-bit - Byte - 0x12
|
||||
16-bit - Halfword - 0x1234
|
||||
32-bit - Word - 0x12345678
|
||||
|
||||
---Writes---
|
||||
|
||||
(00) - NNNNNNXX
|
||||
8-bit write. X is the value, N is the number of times to repeat.
|
||||
|
||||
(02) NNNNXXXX
|
||||
16-bit write. X is the value, N is the number of times to repeat.
|
||||
|
||||
(04) XXXXXXXX
|
||||
32-bit write. X is the value.
|
||||
|
||||
Examples:
|
||||
|
||||
00006500 00000312
|
||||
Will write byte 0x12 to 80006500, 80006501, 80006502, 800067503.
|
||||
|
||||
02006500 00011234
|
||||
Will write halfword 0x1234 to 80006500, 80006502.
|
||||
|
||||
05006500 12345678
|
||||
Will write word 0x12345678 to 81006500.
|
||||
|
||||
|
||||
---Addition---
|
||||
|
||||
(80) - 000000XX
|
||||
8-bit Addition. Load the byte at the address, add X to it, and save resulting byte.
|
||||
|
||||
(82) - 0000XXXX
|
||||
16-bit Addition. Load the halfword at the address, add X to it, and save resulting halfword.
|
||||
|
||||
(84) - XXXXXXXX
|
||||
32-bit Addition. Load the word at the address, add X to it, and save resulting word.
|
||||
|
||||
---Single Line Activators---
|
||||
|
||||
***Equal***
|
||||
(08) 000000XX
|
||||
8-bit Equal activator.
|
||||
|
||||
(0A) 0000XXXX
|
||||
16-bit Equal activator.
|
||||
|
||||
(0C) XXXXXXXX
|
||||
32-bit Equal activator.
|
||||
|
||||
X is the value the address must equal to activate the next line of code.
|
||||
|
||||
***NOT Equal***
|
||||
(10) 000000XX
|
||||
8-bit NOT Equal activator.
|
||||
|
||||
(12) 0000XXXX
|
||||
16-bit NOT Equal activator.
|
||||
|
||||
(14) XXXXXXXX
|
||||
32-bit NOT Equal activator.
|
||||
|
||||
If the value stored at the address is not equal to X, activate the next line of code.
|
||||
|
||||
***If Lower (signed)***
|
||||
(18) 000000XX
|
||||
8-bit If Lower (signed) activator.
|
||||
|
||||
(1A) 0000XXXX
|
||||
16-bit If Lower (signed) activator.
|
||||
|
||||
(1C) XXXXXXXX
|
||||
32-bit If Lower (signed) activator.
|
||||
|
||||
If the value stored at the address is lower than X, activate the next line of code.
|
||||
|
||||
***If Higher (signed)***
|
||||
(20) 000000XX
|
||||
8-bit If Higher (signed) activator.
|
||||
|
||||
(22) 0000XXXX
|
||||
16-bit If Higher (signed) activator.
|
||||
|
||||
(24) XXXXXXXX
|
||||
32-bit If Higher (signed) activator.
|
||||
|
||||
If the value stored at the address is higher than X, activate the next line of code.
|
||||
|
||||
***If Lower (unsigned)***
|
||||
(28) 000000XX
|
||||
8-bit If Lower (unsigned) activator.
|
||||
|
||||
(2A) 0000XXXX
|
||||
16-bit If Lower (unsigned) activator.
|
||||
|
||||
(2C) XXXXXXXX
|
||||
32-bit If Lower (unsigned) activator.
|
||||
|
||||
If the value stored at the address is lower than X, activate the next line of code.
|
||||
|
||||
***If Higher (unsigned)***
|
||||
(30) 000000XX
|
||||
8-bit If Higher (unsigned) activator.
|
||||
|
||||
(32) 0000XXXX
|
||||
16-bit If Higher (unsigned) activator.
|
||||
|
||||
(34) XXXXXXXX
|
||||
32-bit If Higher (unsigned) activator.
|
||||
|
||||
If the value stored at the address is higher than X, activate the next line of code.
|
||||
|
||||
---Double Line Activators---
|
||||
|
||||
***Equal***
|
||||
(48) 000000XX
|
||||
8-bit activator.
|
||||
|
||||
(4A) 0000XXXX
|
||||
16-bit activator.
|
||||
|
||||
(4C) XXXXXXXX
|
||||
32-bit activator.
|
||||
|
||||
X is the value the address must equal to activate the next two lines of code.
|
||||
|
||||
***NOT Equal***
|
||||
(50) 000000XX
|
||||
8-bit NOT Equal activator.
|
||||
|
||||
(52) 0000XXXX
|
||||
16-bit NOT Equal activator.
|
||||
|
||||
(54) XXXXXXXX
|
||||
32-bit NOT Equal activator.
|
||||
|
||||
If the value stored at the address is not equal to X, activate the next two lines of code.
|
||||
|
||||
***If Lower (signed)***
|
||||
(58) 000000XX
|
||||
8-bit If Lower (signed) activator.
|
||||
|
||||
(5A) 0000XXXX
|
||||
16-bit If Lower (signed) activator.
|
||||
|
||||
(5C) XXXXXXXX
|
||||
32-bit If Lower (signed) activator.
|
||||
|
||||
If the value stored at the address is lower than X, activate the next two lines of code.
|
||||
|
||||
***If Higher (signed)***
|
||||
(60) 000000XX
|
||||
8-bit If Higher (signed) activator.
|
||||
|
||||
(62) 0000XXXX
|
||||
16-bit If Higher (signed) activator.
|
||||
|
||||
(64) XXXXXXXX
|
||||
32-bit If Higher (signed) activator.
|
||||
|
||||
If the value stored at the address is higher than X, activate the next two lines of code.
|
||||
|
||||
***If Lower (unsigned)***
|
||||
(68) 000000XX
|
||||
8-bit If Lower (unsigned) activator.
|
||||
|
||||
(6A) 0000XXXX
|
||||
16-bit If Lower (unsigned) activator.
|
||||
|
||||
(6C) XXXXXXXX
|
||||
32-bit If Lower (unsigned) activator.
|
||||
|
||||
If the value stored at the address is lower than X, activate the next two lines of code.
|
||||
|
||||
***If Higher (unsigned)***
|
||||
(70) 000000XX
|
||||
8-bit If Higher (unsigned) activator.
|
||||
|
||||
(72) 0000XXXX
|
||||
16-bit If Higher (unsigned) activator.
|
||||
|
||||
(74) XXXXXXXX
|
||||
32-bit If Higher (unsigned) activator.
|
||||
|
||||
If the value stored at the address is higher than X, activate the next two lines of code.
|
||||
|
||||
---Multi-Line Activators---
|
||||
|
||||
Note that all multi-line codes must end with the line 00000000 40000000.
|
||||
|
||||
***Equal***
|
||||
(88) 000000XX
|
||||
8-bit activator.
|
||||
|
||||
(8A) 0000XXXX
|
||||
16-bit activator.
|
||||
|
||||
(8C) XXXXXXXX
|
||||
32-bit activator.
|
||||
|
||||
X is the value the address must equal to activate the next lines of code.
|
||||
|
||||
***NOT Equal***
|
||||
(90) 000000XX
|
||||
8-bit NOT Equal activator.
|
||||
|
||||
(92) 0000XXXX
|
||||
16-bit NOT Equal activator.
|
||||
|
||||
(94) XXXXXXXX
|
||||
32-bit NOT Equal activator.
|
||||
|
||||
If the value stored at the address is not equal to X, activate the next lines of code.
|
||||
|
||||
***If Lower (signed)***
|
||||
(98) 000000XX
|
||||
8-bit If Lower (signed) activator.
|
||||
|
||||
(9A) 0000XXXX
|
||||
16-bit If Lower (signed) activator.
|
||||
|
||||
(9C) XXXXXXXX
|
||||
32-bit If Lower (signed) activator.
|
||||
|
||||
If the value stored at the address is lower than X, activate the next lines of code.
|
||||
|
||||
***If Higher (signed)***
|
||||
(A0) 000000XX
|
||||
8-bit If Higher (signed) activator.
|
||||
|
||||
(A2) 0000XXXX
|
||||
16-bit If Higher (signed) activator.
|
||||
|
||||
(A4) XXXXXXXX
|
||||
32-bit If Higher (signed) activator.
|
||||
|
||||
If the value stored at the address is higher than X, activate the next lines of code.
|
||||
|
||||
***If Lower (unsigned)***
|
||||
(A8) 000000XX
|
||||
8-bit If Lower (unsigned) activator.
|
||||
|
||||
(AA) 0000XXXX
|
||||
16-bit If Lower (unsigned) activator.
|
||||
|
||||
(AC) XXXXXXXX
|
||||
32-bit If Lower (unsigned) activator.
|
||||
|
||||
If the value stored at the address is lower than X, activate the next lines of code.
|
||||
|
||||
***If Higher (unsigned)***
|
||||
(B0) 000000XX
|
||||
8-bit If Higher (unsigned) activator.
|
||||
|
||||
(B2) 0000XXXX
|
||||
16-bit If Higher (unsigned) activator.
|
||||
|
||||
(B4) XXXXXXXX
|
||||
32-bit If Higher (unsigned) activator.
|
||||
|
||||
If the value stored at the address is higher than X, activate the next lines of code.
|
||||
|
||||
---Alignment---
|
||||
|
||||
Codes must be properly aligned depending on the type of code.
|
||||
8-bit codes can be used on ANY address.
|
||||
16-bit codes must have an address that is a multiple of 2: 0,2,4,6,8,A,C,E.
|
||||
32-bit codes must have an address that is a multiple of 4:0,4,8,C.
|
||||
If codes aren't aligned, they may not work, or may cause your AR to spaz out and kill your cat (R.I.P. Snowball).
|
||||
|
||||
---Signed & Unsigned Numbers---
|
||||
|
||||
Unsigned means :
|
||||
For 8-bits : 0x00 -> 0xFF = 0 to 255.
|
||||
For 16-bits: 0x0000 -> 0xFFFF = 0 to 65535.
|
||||
For 32-bits: 0x00000000 -> 0xFFFFFFFF = 0 to 4294967295.
|
||||
|
||||
Signed means :
|
||||
For 8-bits : 0x00 -> 0x7F = 0 to 127.
|
||||
0x80 -> 0xFF = -127 to -1.
|
||||
For 16-bits: 0x0000 -> 0x7FFF = 0 to 32767.
|
||||
0x8000 -> 0xFFFF = -32768 to -1.
|
||||
For 32-bits: 0x00000000 -> 0x7FFFFFFF = 0 to 2147483647.
|
||||
0x80000000 -> 0xFFFFFFFF = -2147483648 to -1.
|
File diff suppressed because it is too large
Load Diff
@ -1,52 +1,52 @@
|
||||
// DSP_InterC.cpp : Defines the entry point for the console application.
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "DSPOpcodes.h"
|
||||
|
||||
uint16 g_IMemory[0x1000];
|
||||
uint16 g_currentAddress;
|
||||
|
||||
uint16 FetchOpcode()
|
||||
{
|
||||
uint16 value = swap16(g_IMemory[g_currentAddress & 0x0FFF]);
|
||||
g_currentAddress++;
|
||||
return value;
|
||||
}
|
||||
|
||||
void DecodeOpcode(uint16 op);
|
||||
|
||||
void Decode(uint16 startAddress, uint16 endAddress)
|
||||
{
|
||||
g_currentAddress = startAddress;
|
||||
|
||||
while (g_currentAddress < endAddress)
|
||||
{
|
||||
uint16 oldPC = g_currentAddress;
|
||||
uint16 op = FetchOpcode();
|
||||
|
||||
OutBuffer::Add("// l_%4X:", oldPC);
|
||||
DecodeOpcode(op);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int _tmain(int argc, _TCHAR* argv[])
|
||||
{
|
||||
FILE* pFile = fopen("c:\\_\\dsp_rom.bin", "rb");
|
||||
if (pFile == NULL)
|
||||
return -1;
|
||||
|
||||
fread(g_IMemory, 0x1000, 1, pFile);
|
||||
fclose(pFile);
|
||||
|
||||
|
||||
//////
|
||||
OutBuffer::Init();
|
||||
Decode(0x80e7, 0x81f9);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// DSP_InterC.cpp : Defines the entry point for the console application.
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "DSPOpcodes.h"
|
||||
|
||||
uint16 g_IMemory[0x1000];
|
||||
uint16 g_currentAddress;
|
||||
|
||||
uint16 FetchOpcode()
|
||||
{
|
||||
uint16 value = swap16(g_IMemory[g_currentAddress & 0x0FFF]);
|
||||
g_currentAddress++;
|
||||
return value;
|
||||
}
|
||||
|
||||
void DecodeOpcode(uint16 op);
|
||||
|
||||
void Decode(uint16 startAddress, uint16 endAddress)
|
||||
{
|
||||
g_currentAddress = startAddress;
|
||||
|
||||
while (g_currentAddress < endAddress)
|
||||
{
|
||||
uint16 oldPC = g_currentAddress;
|
||||
uint16 op = FetchOpcode();
|
||||
|
||||
OutBuffer::Add("// l_%4X:", oldPC);
|
||||
DecodeOpcode(op);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int _tmain(int argc, _TCHAR* argv[])
|
||||
{
|
||||
FILE* pFile = fopen("c:\\_\\dsp_rom.bin", "rb");
|
||||
if (pFile == NULL)
|
||||
return -1;
|
||||
|
||||
fread(g_IMemory, 0x1000, 1, pFile);
|
||||
fclose(pFile);
|
||||
|
||||
|
||||
//////
|
||||
OutBuffer::Init();
|
||||
Decode(0x80e7, 0x81f9);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1,249 +1,249 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9,00"
|
||||
Name="DSP_InterC"
|
||||
ProjectGUID="{A010425E-9D5E-461E-910D-0804C2A944D5}"
|
||||
RootNamespace="DSP_InterC"
|
||||
Keyword="Win32Proj"
|
||||
TargetFrameworkVersion="196613"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="1"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\DSP_InterC.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DSPExt.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DSPExt.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DSPOpcodes.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DSPOpcodes.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\OutBuffer.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\OutBuffer.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\stdafx.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\stdafx.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\targetver.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
||||
>
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath=".\ReadMe.txt"
|
||||
>
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9,00"
|
||||
Name="DSP_InterC"
|
||||
ProjectGUID="{A010425E-9D5E-461E-910D-0804C2A944D5}"
|
||||
RootNamespace="DSP_InterC"
|
||||
Keyword="Win32Proj"
|
||||
TargetFrameworkVersion="196613"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="1"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\DSP_InterC.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DSPExt.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DSPExt.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DSPOpcodes.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DSPOpcodes.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\OutBuffer.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\OutBuffer.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\stdafx.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\stdafx.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\targetver.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
||||
>
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath=".\ReadMe.txt"
|
||||
>
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
|
@ -1,33 +1,33 @@
|
||||
========================================================================
|
||||
CONSOLE APPLICATION : DSP_InterC Project Overview
|
||||
========================================================================
|
||||
|
||||
AppWizard has created this DSP_InterC application for you.
|
||||
|
||||
This file contains a summary of what you will find in each of the files that
|
||||
make up your DSP_InterC application.
|
||||
|
||||
|
||||
DSP_InterC.vcproj
|
||||
This is the main project file for VC++ projects generated using an Application Wizard.
|
||||
It contains information about the version of Visual C++ that generated the file, and
|
||||
information about the platforms, configurations, and project features selected with the
|
||||
Application Wizard.
|
||||
|
||||
DSP_InterC.cpp
|
||||
This is the main application source file.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
Other standard files:
|
||||
|
||||
StdAfx.h, StdAfx.cpp
|
||||
These files are used to build a precompiled header (PCH) file
|
||||
named DSP_InterC.pch and a precompiled types file named StdAfx.obj.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
Other notes:
|
||||
|
||||
AppWizard uses "TODO:" comments to indicate parts of the source code you
|
||||
should add to or customize.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
========================================================================
|
||||
CONSOLE APPLICATION : DSP_InterC Project Overview
|
||||
========================================================================
|
||||
|
||||
AppWizard has created this DSP_InterC application for you.
|
||||
|
||||
This file contains a summary of what you will find in each of the files that
|
||||
make up your DSP_InterC application.
|
||||
|
||||
|
||||
DSP_InterC.vcproj
|
||||
This is the main project file for VC++ projects generated using an Application Wizard.
|
||||
It contains information about the version of Visual C++ that generated the file, and
|
||||
information about the platforms, configurations, and project features selected with the
|
||||
Application Wizard.
|
||||
|
||||
DSP_InterC.cpp
|
||||
This is the main application source file.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
Other standard files:
|
||||
|
||||
StdAfx.h, StdAfx.cpp
|
||||
These files are used to build a precompiled header (PCH) file
|
||||
named DSP_InterC.pch and a precompiled types file named StdAfx.obj.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
Other notes:
|
||||
|
||||
AppWizard uses "TODO:" comments to indicate parts of the source code you
|
||||
should add to or customize.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -1,45 +1,45 @@
|
||||
CPU:
|
||||
---------------------------------------------------------------------------------------
|
||||
|
||||
void DSPSendCommands2(_pBuffer, _NumberOfMessages, _StartWork)
|
||||
{
|
||||
|
||||
while (!DSP_Running_Check());
|
||||
|
||||
OldInterrupts = OSDisableInterrupts();
|
||||
|
||||
if (DSPCheckMailToDSP() != 0)
|
||||
{
|
||||
OSRestoreInterrupts();
|
||||
return -1;
|
||||
}
|
||||
|
||||
DSPSendMailToDSP(_NumberOfMessages)
|
||||
|
||||
DSPAssertInt()
|
||||
|
||||
while (DSPCheckMailToDSP() != 0) {}
|
||||
|
||||
if (_NumberOfMessages == 0)
|
||||
_NumberOfMessages = 1
|
||||
|
||||
|
||||
if (_StartWork != 0)
|
||||
{
|
||||
r28 = DSPStartWork(*_pBuffer, _StartWork)
|
||||
}
|
||||
_StartWork = 0
|
||||
|
||||
|
||||
while(Count != _NumberOfMessages)
|
||||
{
|
||||
DSPSendMailToDSP(Buffer[Count])
|
||||
while (DSPCheckMailToDSP() != 0) {}
|
||||
Count++
|
||||
}
|
||||
|
||||
OSRestoreInterrupts(OldInterrupts)
|
||||
|
||||
return r28;
|
||||
}
|
||||
|
||||
CPU:
|
||||
---------------------------------------------------------------------------------------
|
||||
|
||||
void DSPSendCommands2(_pBuffer, _NumberOfMessages, _StartWork)
|
||||
{
|
||||
|
||||
while (!DSP_Running_Check());
|
||||
|
||||
OldInterrupts = OSDisableInterrupts();
|
||||
|
||||
if (DSPCheckMailToDSP() != 0)
|
||||
{
|
||||
OSRestoreInterrupts();
|
||||
return -1;
|
||||
}
|
||||
|
||||
DSPSendMailToDSP(_NumberOfMessages)
|
||||
|
||||
DSPAssertInt()
|
||||
|
||||
while (DSPCheckMailToDSP() != 0) {}
|
||||
|
||||
if (_NumberOfMessages == 0)
|
||||
_NumberOfMessages = 1
|
||||
|
||||
|
||||
if (_StartWork != 0)
|
||||
{
|
||||
r28 = DSPStartWork(*_pBuffer, _StartWork)
|
||||
}
|
||||
_StartWork = 0
|
||||
|
||||
|
||||
while(Count != _NumberOfMessages)
|
||||
{
|
||||
DSPSendMailToDSP(Buffer[Count])
|
||||
while (DSPCheckMailToDSP() != 0) {}
|
||||
Count++
|
||||
}
|
||||
|
||||
OSRestoreInterrupts(OldInterrupts)
|
||||
|
||||
return r28;
|
||||
}
|
||||
|
||||
|
@ -1,45 +1,45 @@
|
||||
# this can be used to upgrade disassemblies that aren't too annotated.
|
||||
# won't do very well on the current zelda disasm.
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
def GetPrefixLine(l, a):
|
||||
for s in a:
|
||||
if s[0:len(l)] == l:
|
||||
return s
|
||||
return ""
|
||||
|
||||
def GetComment(l):
|
||||
comment_start = l.find("//")
|
||||
if comment_start < 0:
|
||||
comment_start = l.find("->")
|
||||
if comment_start < 0:
|
||||
return ""
|
||||
|
||||
while (l[comment_start-1] == ' ') or (l[comment_start-1] == '\t'):
|
||||
comment_start -= 1
|
||||
|
||||
return l[comment_start:]
|
||||
|
||||
|
||||
def main():
|
||||
old_lines = open("DSP_UC_Zelda.txt", "r").readlines()
|
||||
# for l in old_lines:
|
||||
# print l
|
||||
new_lines = open("zeldanew.txt", "r").readlines()
|
||||
|
||||
for i in range(0, len(old_lines)):
|
||||
prefix = old_lines[i][0:14]
|
||||
comment = GetComment(old_lines[i])
|
||||
new_line = GetPrefixLine(prefix, new_lines)
|
||||
if new_line:
|
||||
old_lines[i] = new_line[:-1] + comment[:-1] + "\n"
|
||||
|
||||
for i in range(0, len(old_lines)):
|
||||
print old_lines[i],
|
||||
|
||||
new_file = open("output.txt", "w")
|
||||
new_file.writelines(old_lines)
|
||||
|
||||
# this can be used to upgrade disassemblies that aren't too annotated.
|
||||
# won't do very well on the current zelda disasm.
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
def GetPrefixLine(l, a):
|
||||
for s in a:
|
||||
if s[0:len(l)] == l:
|
||||
return s
|
||||
return ""
|
||||
|
||||
def GetComment(l):
|
||||
comment_start = l.find("//")
|
||||
if comment_start < 0:
|
||||
comment_start = l.find("->")
|
||||
if comment_start < 0:
|
||||
return ""
|
||||
|
||||
while (l[comment_start-1] == ' ') or (l[comment_start-1] == '\t'):
|
||||
comment_start -= 1
|
||||
|
||||
return l[comment_start:]
|
||||
|
||||
|
||||
def main():
|
||||
old_lines = open("DSP_UC_Zelda.txt", "r").readlines()
|
||||
# for l in old_lines:
|
||||
# print l
|
||||
new_lines = open("zeldanew.txt", "r").readlines()
|
||||
|
||||
for i in range(0, len(old_lines)):
|
||||
prefix = old_lines[i][0:14]
|
||||
comment = GetComment(old_lines[i])
|
||||
new_line = GetPrefixLine(prefix, new_lines)
|
||||
if new_line:
|
||||
old_lines[i] = new_line[:-1] + comment[:-1] + "\n"
|
||||
|
||||
for i in range(0, len(old_lines)):
|
||||
print old_lines[i],
|
||||
|
||||
new_file = open("output.txt", "w")
|
||||
new_file.writelines(old_lines)
|
||||
|
||||
main()
|
@ -1,150 +1,150 @@
|
||||
; This is the ucode used to "unlock" memcards
|
||||
; RE purely out of interest, and hunch that it does trickies
|
||||
|
||||
IROM_BASE: equ 0x8000
|
||||
|
||||
; Exception vectors
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
halt ; Exception 0-6 nop slide to here
|
||||
rti ; Exception 7
|
||||
halt
|
||||
|
||||
; Entry point
|
||||
; Standard init stuff
|
||||
sbset #0x06
|
||||
sbclr #0x03
|
||||
sbclr #0x04
|
||||
sbset #0x05
|
||||
lri $CR, #0x00ff
|
||||
lri $WR0, #0xffff
|
||||
lri $WR1, #0xffff
|
||||
lri $WR2, #0xffff
|
||||
lri $WR3, #0xffff
|
||||
set40
|
||||
|
||||
; 0xdcd10000 is the init mail
|
||||
call wait_for_dsp_mbox
|
||||
si @DMBH, #0xdcd1
|
||||
si @DMBL, #0x0000
|
||||
si @DIRQ, #0x0001
|
||||
; Wait for cpu to say "go!" - i think
|
||||
wait_for_start_cmd:
|
||||
call wait_for_cpu_mbox
|
||||
lrs $AC1.L, @CMBL
|
||||
cmpi $AC1.M, #0xff00
|
||||
jnz wait_for_start_cmd
|
||||
|
||||
dma_dram_and_prepare_for_crazy_irom_func:
|
||||
call wait_for_cpu_mbox
|
||||
mrr $AC0.M, $AC1.M
|
||||
lrs $AC0.L, @CMBL ; main ram addr.l
|
||||
andi $AC0.M, #0x0fff ; main ram addr.h & 0x0fff
|
||||
lri $AX0.L, #0x0400 ; dsp addr
|
||||
lri $AX0.H, #0x0010 ; length (bytes)
|
||||
lri $AX1.L, #0x0000 ; dsp dram to cpu
|
||||
set16
|
||||
call do_dma
|
||||
call IROM_BASE+0x0644; holy mother of jesus that func is gonna be hard
|
||||
|
||||
; 0xdcd10003 means finished unlocking?
|
||||
call wait_for_dsp_mbox
|
||||
si @DMBH, #0xdcd1
|
||||
si @DMBL, #0x0003
|
||||
si @DIRQ, #0x0001
|
||||
set40
|
||||
call wait_for_cpu_mbox
|
||||
cmpi $AC1.M, #0xcdd1
|
||||
jnz dma_dram_and_prepare_for_crazy_irom_func
|
||||
lrs $AC1.M, @CMBL
|
||||
cmpi $AC1.M, #0x0001
|
||||
jz _005afunc
|
||||
cmpi $AC1.M, #0x0002
|
||||
jz IROM_BASE ; End of this ucode, wait for a new one
|
||||
jmp dma_dram_and_prepare_for_crazy_irom_func
|
||||
halt ; Prolly never reached
|
||||
|
||||
; 10 mails from cpu then irom func - looks interesting
|
||||
_005afunc:
|
||||
set16
|
||||
call wait_for_cpu_mbox
|
||||
lrs $AC1.L, @CMBL
|
||||
call wait_for_cpu_mbox
|
||||
lrs $AC1.L, @CMBL
|
||||
call wait_for_cpu_mbox
|
||||
lrs $AC1.L, @CMBL
|
||||
call wait_for_cpu_mbox
|
||||
lr $IX1, @CMBL
|
||||
andi $AC1.M, #0x0fff
|
||||
mrr $IX0, $AC1.M
|
||||
call wait_for_cpu_mbox
|
||||
lr $IX3, @CMBL
|
||||
call wait_for_cpu_mbox
|
||||
lr $IX2, @CMBL
|
||||
call wait_for_cpu_mbox
|
||||
lr $AR0, @CMBL
|
||||
call wait_for_cpu_mbox
|
||||
lrs $AX0.L, @CMBL
|
||||
andi $AC1.M, #0x0fff
|
||||
mrr $AX0.H, $AC1.M
|
||||
call wait_for_cpu_mbox
|
||||
lrs $AX1.L, @CMBL
|
||||
call wait_for_cpu_mbox
|
||||
lrs $AX1.H, @CMBL
|
||||
sbclr #0x05
|
||||
sbclr #0x06
|
||||
jmp IROM_BASE+0x00b5; IROM - can dma stuff
|
||||
halt
|
||||
|
||||
wait_for_dsp_mbox:
|
||||
lrs $AC1.M, @DMBH
|
||||
andcf $AC1.M, #0x8000
|
||||
jlz wait_for_dsp_mbox
|
||||
ret
|
||||
|
||||
wait_for_cpu_mbox:
|
||||
lrs $AC1.M, @CMBH
|
||||
andcf $AC1.M, #0x8000
|
||||
jlnz wait_for_cpu_mbox
|
||||
ret
|
||||
|
||||
do_dma:
|
||||
srs @DSMAH, $AC0.M
|
||||
srs @DSMAL, $AC0.L
|
||||
sr @DSPA, $AX0.L
|
||||
sr @DSCR, $AX1.L
|
||||
sr @DSBL, $AX0.H
|
||||
wait_dma:
|
||||
lrs $AC0.M, @DSCR
|
||||
andcf $AC0.M, #0x0004
|
||||
jlz wait_dma
|
||||
ret
|
||||
|
||||
; Trailing nops...pad to 32bytes
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
|
||||
; uCode is 0xb0 words
|
||||
; This is the ucode used to "unlock" memcards
|
||||
; RE purely out of interest, and hunch that it does trickies
|
||||
|
||||
IROM_BASE: equ 0x8000
|
||||
|
||||
; Exception vectors
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
halt ; Exception 0-6 nop slide to here
|
||||
rti ; Exception 7
|
||||
halt
|
||||
|
||||
; Entry point
|
||||
; Standard init stuff
|
||||
sbset #0x06
|
||||
sbclr #0x03
|
||||
sbclr #0x04
|
||||
sbset #0x05
|
||||
lri $CR, #0x00ff
|
||||
lri $WR0, #0xffff
|
||||
lri $WR1, #0xffff
|
||||
lri $WR2, #0xffff
|
||||
lri $WR3, #0xffff
|
||||
set40
|
||||
|
||||
; 0xdcd10000 is the init mail
|
||||
call wait_for_dsp_mbox
|
||||
si @DMBH, #0xdcd1
|
||||
si @DMBL, #0x0000
|
||||
si @DIRQ, #0x0001
|
||||
; Wait for cpu to say "go!" - i think
|
||||
wait_for_start_cmd:
|
||||
call wait_for_cpu_mbox
|
||||
lrs $AC1.L, @CMBL
|
||||
cmpi $AC1.M, #0xff00
|
||||
jnz wait_for_start_cmd
|
||||
|
||||
dma_dram_and_prepare_for_crazy_irom_func:
|
||||
call wait_for_cpu_mbox
|
||||
mrr $AC0.M, $AC1.M
|
||||
lrs $AC0.L, @CMBL ; main ram addr.l
|
||||
andi $AC0.M, #0x0fff ; main ram addr.h & 0x0fff
|
||||
lri $AX0.L, #0x0400 ; dsp addr
|
||||
lri $AX0.H, #0x0010 ; length (bytes)
|
||||
lri $AX1.L, #0x0000 ; dsp dram to cpu
|
||||
set16
|
||||
call do_dma
|
||||
call IROM_BASE+0x0644; holy mother of jesus that func is gonna be hard
|
||||
|
||||
; 0xdcd10003 means finished unlocking?
|
||||
call wait_for_dsp_mbox
|
||||
si @DMBH, #0xdcd1
|
||||
si @DMBL, #0x0003
|
||||
si @DIRQ, #0x0001
|
||||
set40
|
||||
call wait_for_cpu_mbox
|
||||
cmpi $AC1.M, #0xcdd1
|
||||
jnz dma_dram_and_prepare_for_crazy_irom_func
|
||||
lrs $AC1.M, @CMBL
|
||||
cmpi $AC1.M, #0x0001
|
||||
jz _005afunc
|
||||
cmpi $AC1.M, #0x0002
|
||||
jz IROM_BASE ; End of this ucode, wait for a new one
|
||||
jmp dma_dram_and_prepare_for_crazy_irom_func
|
||||
halt ; Prolly never reached
|
||||
|
||||
; 10 mails from cpu then irom func - looks interesting
|
||||
_005afunc:
|
||||
set16
|
||||
call wait_for_cpu_mbox
|
||||
lrs $AC1.L, @CMBL
|
||||
call wait_for_cpu_mbox
|
||||
lrs $AC1.L, @CMBL
|
||||
call wait_for_cpu_mbox
|
||||
lrs $AC1.L, @CMBL
|
||||
call wait_for_cpu_mbox
|
||||
lr $IX1, @CMBL
|
||||
andi $AC1.M, #0x0fff
|
||||
mrr $IX0, $AC1.M
|
||||
call wait_for_cpu_mbox
|
||||
lr $IX3, @CMBL
|
||||
call wait_for_cpu_mbox
|
||||
lr $IX2, @CMBL
|
||||
call wait_for_cpu_mbox
|
||||
lr $AR0, @CMBL
|
||||
call wait_for_cpu_mbox
|
||||
lrs $AX0.L, @CMBL
|
||||
andi $AC1.M, #0x0fff
|
||||
mrr $AX0.H, $AC1.M
|
||||
call wait_for_cpu_mbox
|
||||
lrs $AX1.L, @CMBL
|
||||
call wait_for_cpu_mbox
|
||||
lrs $AX1.H, @CMBL
|
||||
sbclr #0x05
|
||||
sbclr #0x06
|
||||
jmp IROM_BASE+0x00b5; IROM - can dma stuff
|
||||
halt
|
||||
|
||||
wait_for_dsp_mbox:
|
||||
lrs $AC1.M, @DMBH
|
||||
andcf $AC1.M, #0x8000
|
||||
jlz wait_for_dsp_mbox
|
||||
ret
|
||||
|
||||
wait_for_cpu_mbox:
|
||||
lrs $AC1.M, @CMBH
|
||||
andcf $AC1.M, #0x8000
|
||||
jlnz wait_for_cpu_mbox
|
||||
ret
|
||||
|
||||
do_dma:
|
||||
srs @DSMAH, $AC0.M
|
||||
srs @DSMAL, $AC0.L
|
||||
sr @DSPA, $AX0.L
|
||||
sr @DSCR, $AX1.L
|
||||
sr @DSBL, $AX0.H
|
||||
wait_dma:
|
||||
lrs $AC0.M, @DSCR
|
||||
andcf $AC0.M, #0x0004
|
||||
jlz wait_dma
|
||||
ret
|
||||
|
||||
; Trailing nops...pad to 32bytes
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
|
||||
; uCode is 0xb0 words
|
||||
|
@ -1,34 +1,34 @@
|
||||
DSP startup sequence:
|
||||
|
||||
DspBoot called with (JASystem::TAudioThread::syncDSP()) as a parameter.
|
||||
DSP lib initialized
|
||||
A Dsp task is created:
|
||||
init callback = DspHandShake()
|
||||
req callback = JASystem::TAudioThread::syncDSP()
|
||||
Task is pushed as first task and executed
|
||||
|
||||
DSP send DSP_INIT command (0xDCD10003)
|
||||
__DSPHandler receive the command
|
||||
|
||||
task's init callback (DspHandShake) is called
|
||||
1 mail is read from dsp (and discarded)
|
||||
DSP flag is set as running
|
||||
|
||||
AIRegisterDMACallback(JASystem::TAudioThread::syncAudio((void))
|
||||
AIStartDMA() to initialize dma in AI module
|
||||
|
||||
-----------------------------------
|
||||
|
||||
DSP run sequence:
|
||||
|
||||
__DSPHandler receive command DSP_RESUME
|
||||
callback JASystem::TAudioThread::syncDSP called and pull 1 mail
|
||||
A message is send by OSSendMessage(1)
|
||||
|
||||
JASystem::TAudioThread::audioproc receive OSMessage:
|
||||
0=update dac
|
||||
1=update dsp
|
||||
2=nop ?
|
||||
3=exit thread
|
||||
|
||||
DSP startup sequence:
|
||||
|
||||
DspBoot called with (JASystem::TAudioThread::syncDSP()) as a parameter.
|
||||
DSP lib initialized
|
||||
A Dsp task is created:
|
||||
init callback = DspHandShake()
|
||||
req callback = JASystem::TAudioThread::syncDSP()
|
||||
Task is pushed as first task and executed
|
||||
|
||||
DSP send DSP_INIT command (0xDCD10003)
|
||||
__DSPHandler receive the command
|
||||
|
||||
task's init callback (DspHandShake) is called
|
||||
1 mail is read from dsp (and discarded)
|
||||
DSP flag is set as running
|
||||
|
||||
AIRegisterDMACallback(JASystem::TAudioThread::syncAudio((void))
|
||||
AIStartDMA() to initialize dma in AI module
|
||||
|
||||
-----------------------------------
|
||||
|
||||
DSP run sequence:
|
||||
|
||||
__DSPHandler receive command DSP_RESUME
|
||||
callback JASystem::TAudioThread::syncDSP called and pull 1 mail
|
||||
A message is send by OSSendMessage(1)
|
||||
|
||||
JASystem::TAudioThread::audioproc receive OSMessage:
|
||||
0=update dac
|
||||
1=update dsp
|
||||
2=nop ?
|
||||
3=exit thread
|
||||
|
||||
dsp is updated
|
Reference in New Issue
Block a user