-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
331 changed files
with
15,181 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
============================================================================= | ||
Check Sheet for Dreamcast Program (for direct hardware control) Version 0.20 | ||
03/03/99 SEGA Tech Support | ||
============================================================================= | ||
|
||
<< Drawing (without Kamui) >> | ||
|
||
- Kamui is being used to access the drawing system register when the graphic | ||
chip for the development target differs from the product version. | ||
|
||
-------------------------------------------------------------------------------- | ||
* The following check items will become valid when the same graphic chip is used | ||
for development targets and product versions. Until then, Kamui must be used as | ||
shown above. | ||
-------------------------------------------------------------------------------- | ||
|
||
- Soft reset and register settings are being initialized before TA transfer. | ||
- During Ch2 DMA, suspension of Ch2 DMA is being confirmed and a soft reset is being | ||
used to empty TA FIFO upon forcible interruption of TA. | ||
- When using user tile clipping, more than 1 invisible dummy polygon is being sent | ||
before setting global parameters to change items such as the area. | ||
- Direct data (such as texture) is being sent while YUV macro block send is | ||
in progress. | ||
- End of TSP is being used for drawing complete interrupt. | ||
- The display area is set to the drawing area minus 1 when the y scale is reduced. | ||
- An invisible opaque polygon that covers the entire screen is registered when using | ||
presorted half-transparent polygons. | ||
- Half-transparent sorting mode is set to auto sort when using modifiers | ||
with half-transparent and tri-linear polygons. | ||
- Intensity shadow volume is being used for polygons that use bump map texture. | ||
- The nu screen is being divided into an even number of sections when strip buffer | ||
mode is being used for the frame buffer. | ||
- The value set for FB_X_CLIP or FB_Y_CLIP exceeds the screen size when using strip | ||
buffer mode for the frame buffer. | ||
|
||
<< SH4 >> | ||
|
||
- The SAR, DAR, DMATCR, and CHCR registers of SH4-DMA are only being rewritten | ||
when the CHCR DE bit is set to 0. | ||
- DMA for channels 1 and 3 is being used in accordance with the workaround described | ||
under "Failure to write peripheral module control register during DMA transfer" | ||
in the manual. | ||
- An NMI has been generated during DMA. | ||
- Flash memory is not being accessed before setting G1FRC and G1FWC. | ||
- 32-byte access to system ROM is not being used before setting G1FRC and G1FWC. | ||
- Only system ROM is being accessed before setting the CPU BSC. | ||
|
||
<< File System >> | ||
|
||
- Two commands are not being written to the command register in immediate succession. | ||
- Undefined commands are not being issued. | ||
- Commands are not being issued with incorrect parameters. | ||
- Operation is being implemented according to protocol. | ||
- Data registers are being accessed in words and other registers are being accessed | ||
in bytes. | ||
- ROM and FLASH are not being accessed during DMA. | ||
- The transfer mode (feature register) is set correctly. | ||
- G1 Bus is set correctly. | ||
- The drive select register is not being accessed. | ||
- Error processing is working properly with all commands. | ||
|
||
<< Peripherals >> | ||
|
||
- The command that indicates the end of each command in the command file is located | ||
at the 8th long word of a 32-byte boundary. | ||
- The command file is composed of long word units. | ||
- A storage address indicated for received data in the command file is at a 32-byte | ||
boundary | ||
- The address of the Maple register in the command file starts with 0x0???????. | ||
- DMA is being disabled when writing values to the system control and DMA trigger | ||
selection registers. | ||
|
||
<< Sound >> | ||
|
||
- When accessing sound memory and registers, long access (4-byte) is always being | ||
done using 4-byte boundaries. | ||
- Sound memory is being accessed through the cache through area. | ||
- Addresses other than those of defined memory and registers are not being accessed. | ||
- After data has been written to sound memory, FIFO is being checked to ensure | ||
that it is empty before doing read operations. | ||
- FIFO is being checked to ensure that it is empty when writes to sound memory are | ||
performed more than 9 times in succession. | ||
- Before reset/control of the sound CPU, VREG contents in the same register are always | ||
saved. | ||
- When reading RTC data, measures are being taken to ensure that data being read is | ||
not invalid because it is in the process of being updated. (such as reading the | ||
data twice and verifying that it is the same). | ||
- Sound system internal DMA is being used. | ||
|
||
- EOF - |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pchk020_txt lists items that must be followed if application program accesses hardware directly. However it does not cover all restrictions. Please be sure to read other restriction documents as well. |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,263 @@ | ||
/* dcrp.c - scrambles and unscrambles Dreamcast-executables | ||
* | ||
* 2000 <c> Maiwe | ||
* | ||
* contact: [email protected] | ||
* | ||
*/ | ||
|
||
/* Notes: | ||
* ~~~~~~ | ||
* | ||
* Dreamcast(tm) has a special method for booting regular CDs as opposed | ||
* to GDs. The executable file to be booted must be scrambled in a | ||
* certain way in order to execute properly which is what this program | ||
* does. | ||
* | ||
*/ | ||
|
||
#include <sys/stat.h> | ||
#include <errno.h> | ||
#include <unistd.h> | ||
#include <stdlib.h> | ||
#include <stdio.h> | ||
|
||
int main(int, char **); | ||
void usage(void); | ||
void scramble(void); | ||
void scramble2(int, char *); | ||
void copy_data(char *); | ||
void unscramble(void); | ||
void unscramble2(int, char *); | ||
void copy_data2(char *); | ||
|
||
unsigned int permutation_key = 0; | ||
unsigned short permutation_buf[0x10000]; | ||
char *input_buf; | ||
char *output_buf; | ||
int buf_pos; | ||
int data_size; | ||
|
||
int | ||
main(argc, argv) | ||
int argc; | ||
char **argv; | ||
{ | ||
|
||
struct stat st_buf; | ||
FILE *ins, *outs; | ||
|
||
if (argc != 4) | ||
usage(); | ||
|
||
if (stat(argv[2], &st_buf) < 0) { | ||
fprintf(stderr, "dcrp: %s: %s\n", argv[2], strerror(errno)); | ||
exit (-1); | ||
} | ||
|
||
data_size = st_buf.st_size; | ||
if (!(input_buf = malloc(data_size))) { | ||
fprintf(stderr, "dcrp: %s\n", strerror(errno)); | ||
exit (-1); | ||
} | ||
if (!(output_buf = malloc(data_size))) { | ||
fprintf(stderr, "dcrp: %s\n", strerror(errno)); | ||
exit (-1); | ||
} | ||
|
||
ins = fopen(argv[2], "r"); | ||
if (ins == NULL) { | ||
fprintf(stderr, "dcrp: %s: %s\n", argv[2], strerror(errno)); | ||
exit (-1); | ||
} | ||
|
||
outs = fopen(argv[3], "w"); | ||
if (outs == NULL) { | ||
fprintf(stderr, "dcrp: %s: %s\n", argv[3], strerror(errno)); | ||
exit (-1); | ||
} | ||
|
||
if (fread(input_buf, data_size, 1, ins) != 1) { | ||
if (ferror(ins)) { | ||
fprintf(stderr, "dcrp: fread() failed: %s\n", strerror(errno)); | ||
exit (-1); | ||
} | ||
fprintf(stderr, "dcrp: fread() failed: not all of input file read\n"); | ||
exit (-1); | ||
} | ||
|
||
fclose(ins); | ||
|
||
if (strcmp(argv[1], "scramble") == 0) | ||
scramble(); | ||
else if (strcmp(argv[1], "unscramble") == 0) | ||
unscramble(); | ||
else | ||
usage(); | ||
|
||
if (fwrite(output_buf, data_size, 1, outs) != 1) { | ||
if (ferror(outs)) { | ||
fprintf(stderr, "dcrp: fwrite() failed: %s\n", strerror(errno)); | ||
exit (-1); | ||
} | ||
fprintf(stderr, "dcrp: fwrite() failed: not all of input file written\n"); | ||
exit (-1); | ||
} | ||
|
||
fprintf(stdout, "Done\n"); | ||
|
||
} | ||
|
||
void | ||
usage() | ||
{ | ||
fprintf(stderr, "dcrp v1.1 13-Jun-2000 <c> Maiwe\n"); | ||
fprintf(stderr, "usage: dcrp <scramble | unscramble> <input> <output>\n"); | ||
exit (-1); | ||
} | ||
|
||
void | ||
scramble() | ||
{ | ||
|
||
int j; | ||
char *ptr; | ||
int align; | ||
int size = data_size; | ||
|
||
permutation_key = size & 0x0000ffff; | ||
buf_pos = 0; | ||
|
||
align = size & 0x0000001f; | ||
if (align != 0) | ||
size -= align; | ||
|
||
ptr = input_buf; | ||
j = 0x00200000; | ||
do { | ||
while (size >= j) { | ||
scramble2(j, ptr); | ||
size = size - j; | ||
ptr = ptr + ((j>>2)<<2); | ||
} | ||
j = j>>1; | ||
} while (j >= 0x20); | ||
|
||
if (align != 0) | ||
copy_data(ptr); | ||
|
||
} | ||
|
||
void | ||
scramble2(size, addr) | ||
int size; | ||
char *addr; | ||
{ | ||
|
||
unsigned short *ptr = permutation_buf; | ||
int i; | ||
int bs = size>>5; | ||
unsigned short *k; | ||
unsigned short index; | ||
int m; | ||
unsigned short temp; | ||
|
||
for (i = 0; i < bs; i++) | ||
ptr[i] = i; | ||
|
||
k = &ptr[bs-1]; | ||
for (m = bs - 1; m >= 0; m--) { | ||
permutation_key = (permutation_key * 2109 + 9273) & 0x7fff; | ||
index = (((permutation_key + 0xc000) & 0xffff) * m)>>16; | ||
|
||
temp = ptr[index]; | ||
ptr[index] = *k; | ||
*k = temp; | ||
copy_data(addr + ((*k)<<5)); | ||
k--; | ||
} | ||
|
||
} | ||
|
||
void | ||
copy_data(addr) | ||
char *addr; | ||
{ | ||
int i; | ||
|
||
for (i = 0; i < 0x20 && buf_pos < data_size; i++) | ||
*(output_buf + (buf_pos++)) = addr[i]; | ||
} | ||
|
||
void | ||
unscramble() | ||
{ | ||
|
||
int j; | ||
char *ptr; | ||
int align; | ||
int size = data_size; | ||
|
||
permutation_key = size & 0x0000ffff; | ||
buf_pos = 0; | ||
|
||
align = size & 0x0000001f; | ||
if (align != 0) | ||
size -= align; | ||
|
||
ptr = output_buf; | ||
j = 0x00200000; | ||
do { | ||
while (size >= j) { | ||
unscramble2(j, ptr); | ||
size = size - j; | ||
ptr = ptr + ((j>>2)<<2); | ||
} | ||
j = j>>1; | ||
} while (j >= 0x20); | ||
|
||
if (align != 0) | ||
copy_data2(ptr); | ||
|
||
} | ||
|
||
void | ||
unscramble2(size, addr) | ||
int size; | ||
char *addr; | ||
{ | ||
|
||
short *ptr = permutation_buf; | ||
int i; | ||
int bs = size>>5; | ||
unsigned short *k; | ||
unsigned short index; | ||
int m; | ||
unsigned short temp; | ||
|
||
for (i = 0; i < bs; i++) | ||
ptr[i] = i; | ||
|
||
k = &ptr[bs-1]; | ||
for (m = bs - 1; m >= 0; m--) { | ||
permutation_key = (permutation_key * 2109 + 9273) & 0x7fff; | ||
index = (((permutation_key + 0xc000) & 0xffff) * m)>>16; | ||
|
||
temp = ptr[index]; | ||
ptr[index] = *k; | ||
*k = temp; | ||
copy_data2(addr + ((*k)<<5)); | ||
k--; | ||
} | ||
|
||
} | ||
|
||
void | ||
copy_data2(addr) | ||
char *addr; | ||
{ | ||
int i; | ||
|
||
for (i = 0; i < 0x20 && buf_pos < data_size; i++) | ||
addr[i] = *(input_buf + (buf_pos++)); | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.